ZaiZai 1 an în urmă
părinte
comite
f385beb2a0

+ 54 - 0
src/views/exctab/element/index.vue

@@ -0,0 +1,54 @@
+<template>
+    <hc-drawer v-model="isShow" to-id="hc-main-box" is-close @close="drawerClose">
+        <hc-card>
+            1111
+        </hc-card>
+    </hc-drawer>
+</template>
+
+<script setup>
+import { ref, watch } from 'vue'
+import mainApi from '~api/exctab/exceltab'
+
+const props = defineProps({
+    data: {
+        type: Object,
+        default: () => ({}),
+    },
+})
+
+//事件
+const emit = defineEmits(['close'])
+
+//双向绑定
+const isShow = defineModel('modelValue', {
+    default: false,
+})
+
+//监听数据
+const dataInfo = ref(props.data)
+watch(() => props.data, (data) => {
+    dataInfo.value = data
+}, { immediate: true, deep: true })
+
+//监听显示
+watch(isShow, (val) => {
+    if (val) getDataApi()
+})
+
+//处理相关数据
+const getDataApi = () => {
+    console.log(dataInfo.value)
+}
+
+//关闭抽屉
+const drawerClose = () => {
+    isShow.value = false
+    dataInfo.value = {}
+    emit('close')
+}
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 2 - 0
src/views/exctab/excel/template.vue

@@ -101,6 +101,7 @@ const props = defineProps({
         default: () => ({}),
     },
 })
+
 //事件
 const emit = defineEmits(['close'])
 const store = useAppStore()
@@ -409,6 +410,7 @@ const fullScreenClick = () => {
 const drawerClose = () => {
     isShow.value = false
     tableTempExcelProps.value = {}
+    dataInfo.value = {}
     emit('close')
 }
 </script>

+ 15 - 4
src/views/exctab/exceltab.vue

@@ -20,7 +20,7 @@
                 <el-link type="warning" @click="editRowClick(row)">修改</el-link>
                 <el-link v-del-com:[delRowClick]="row" type="danger">删除</el-link>
                 <el-link type="primary" @click="clearingTableTemp(row)">清表模板</el-link>
-                <el-link type="primary">元素识别</el-link>
+                <el-link type="primary" @click="elementRecognition(row)">元素识别</el-link>
             </template>
         </hc-table>
         <template #action>
@@ -44,7 +44,9 @@
             </template>
         </hc-dialog>
         <!-- 清表模板 -->
-        <HcTemplate v-model="isRowTempShow" :data="rowTempInfo" />
+        <HcClearTemplate v-model="isRowTempShow" :data="rowTempInfo" @close="getTableData" />
+        <!-- 元素识别 -->
+        <HcElementRecognition v-model="isElementShow" :data="rowElementInfo" @close="getTableData" />
     </hc-card>
 </template>
 
@@ -53,7 +55,8 @@ import { HcDelMsg } from 'hc-vue3-ui'
 import { onActivated, ref } from 'vue'
 import { getDictionaryData } from '~uti/tools'
 import { arrToId, deepClone, formValidate, getArrValue, isNullES } from 'js-fast-way'
-import HcTemplate from './excel/template.vue'
+import HcClearTemplate from './excel/template.vue'
+import HcElementRecognition from './element/index.vue'
 import mainApi from '~api/exctab/exceltab'
 
 //激活
@@ -191,8 +194,16 @@ const delDataApi = async (id) => {
 const isRowTempShow = ref(false)
 const rowTempInfo = ref({})
 const clearingTableTemp = (row) => {
+    rowTempInfo.value = row
     isRowTempShow.value = true
-    rowTempInfo.value = deepClone(row)
+}
+
+//元素识别
+const isElementShow = ref(false)
+const rowElementInfo = ref({})
+const elementRecognition = (row) => {
+    rowElementInfo.value = row
+    isElementShow.value = true
 }
 </script>