jinx před 2 roky
rodič
revize
b4fd57816d

+ 6 - 3
src/components/files/TagManager.vue

@@ -4,10 +4,10 @@
         <TagEditor v-if="notify && isEdit" :notify="notify" @action="onAction" />
         <TagView v-if="notify && !isEdit" :notify="notify" />
     </div>
-    <Toast v-if="showTips" type="warn" :content="showTips" :close="() => (showTips = null)" />
+    <Toast v-if="showTips" v-bind="toastOps" :content="showTips" :close="() => (showTips = null)" />
 </template>
 <script setup>
-import { inject, watch, computed ,ref} from 'vue'
+import { inject, watch, computed, ref } from 'vue'
 import TagItem from './TagItem.vue'
 import TagEditor from './TagEditor.vue'
 import TagView from './TagView.vue'
@@ -28,11 +28,14 @@ const isEdit = inject('isEdit')
 const init = sdk => {
     // sdk.TagManager.load(tags)
 }
+const toastOps = ref({
+    type: 'success',
+})
 const onAction = text => {
     showTips.value = text
 }
 const initLaserTag = () => {
-  // consoler.error('******************initLaserTag')
+    // consoler.error('******************initLaserTag')
     window.laser.then(sdk => {
         // sdk.scene.on('posChange', cameraPos => {
         //     tags.value.forEach(tag => {

+ 7 - 1
src/components/files/index.vue

@@ -38,7 +38,7 @@
             <div>{{ $t('tag.deleteTagText') }}</div>
         </template>
     </ui-confirm>
-    <Toast v-if="showTips" type="warn" :content="showTips" :close="() => (showTips = null)" />
+    <Toast v-if="showTips" :type="toastOps" :content="showTips" :close="() => (showTips = null)" />
 </template>
 <script setup>
 import { ref, inject, watchEffect, onMounted, nextTick, watch } from 'vue'
@@ -54,12 +54,17 @@ const props = defineProps(['show'])
 const emits = defineEmits(['add', 'exit'])
 // const source = inject('source')
 const showTips = ref(null)
+const toastOps = ref({
+    type: 'success',
+})
 const handlerDel = status => {
     if (status == 'ok') {
         http.post(`smart-site/marking/del`, {
             markingId: delComfirm.value.id,
         }).then(response => {
             if (response.success) {
+                toastOps.value.type = 'success'
+                showTips.value = '删除成功'
                 let index = tags.value.findIndex(item => item.sid == delComfirm.value.sid)
                 if (index != -1) {
                     tags.value.splice(index, 1)
@@ -68,6 +73,7 @@ const handlerDel = status => {
                     notify.value = null
                 }
             } else {
+                toastOps.value.type = 'warm'
                 showTips.value = response.message
             }
             delComfirm.value = null