|
@@ -33,18 +33,45 @@
|
|
|
<button type="submit" @click="onAddConfirm">确定</button>
|
|
|
</div>
|
|
|
</transition>
|
|
|
+ <ui-confirm v-if="delComfirm" @ok="handlerDel" @no="handlerDel">
|
|
|
+ <template #content>
|
|
|
+ <div>确定要删除资料吗?</div>
|
|
|
+ </template>
|
|
|
+ </ui-confirm>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import { ref, inject, watchEffect, onMounted, nextTick } from 'vue'
|
|
|
import { http } from '@/utils/request'
|
|
|
-
|
|
|
+import UiConfirm from '@/components/dialog/Confirm.vue'
|
|
|
let editTag = null
|
|
|
let tempTag = null
|
|
|
const exit$ = ref(null)
|
|
|
const add$ = ref(null)
|
|
|
const props = defineProps(['show'])
|
|
|
const emits = defineEmits(['add', 'exit'])
|
|
|
-
|
|
|
+const handlerDel = status => {
|
|
|
+ if (status == 'ok') {
|
|
|
+ http.post(`smart-site/marking/del`, {
|
|
|
+ markingId: delComfirm.value.id,
|
|
|
+ }).then(response => {
|
|
|
+ if (response.success) {
|
|
|
+ console.log(delComfirm.value)
|
|
|
+ let index = tags.value.findIndex(item => item.sid == delComfirm.value.sid)
|
|
|
+ if (index != -1) {
|
|
|
+ tags.value.splice(index, 1)
|
|
|
+ }
|
|
|
+ if (notify.value && notify.value.id == delComfirm.value.id) {
|
|
|
+ notify.value = null
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ delComfirm.value = null
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ delComfirm.value = null
|
|
|
+ }
|
|
|
+}
|
|
|
+const delComfirm = ref(null)
|
|
|
const showFiles = ref(false)
|
|
|
const showToolbar = ref(false)
|
|
|
const showMoreSid = ref('')
|
|
@@ -208,16 +235,7 @@ const onMoreHandler = (type, tag) => {
|
|
|
}
|
|
|
// window.kankan.TagManager.focusBeforeModify(editTag.sid)
|
|
|
} else if (type == 'delete') {
|
|
|
- http.post(`smart-site/marking/del`, {
|
|
|
- markingId: tag.id,
|
|
|
- }).then(response => {
|
|
|
- if (response.success) {
|
|
|
- let index = tags.value.findIndex(item => item.sid == tag.sid)
|
|
|
- if (index != -1) {
|
|
|
- tags.value.splice(index, 1)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ delComfirm.value = tag
|
|
|
}
|
|
|
showMoreSid.value = ''
|
|
|
}
|