Browse Source

数据映射修改

duy 1 week ago
parent
commit
2f928a706f

+ 48 - 39
src/components/table-form/modules/components.vue

@@ -41,11 +41,10 @@
 </template>
 
 <script setup>
-import { onMounted, ref, useSlots } from "vue";
-import { isNullES } from "js-fast-way";
-import { useAppStore } from "~src/store";
-const store = useAppStore();
-
+import { onMounted, ref, useSlots } from 'vue'
+import { isNullES } from 'js-fast-way'
+import { useAppStore } from '~src/store'
+import { getStoreValue } from '~uti/storage'
 const props = defineProps({
     type: [String, Number],
     placeholder: [String, Number],
@@ -73,54 +72,64 @@ const props = defineProps({
     deftext: [String, Number],
     maxlength: [String, Number],
     tip: [String, Number],
-});
+})
+
+const store = useAppStore()
 
-const objsData = ref("");
-const isShowName = ref(store.getIsShowName);
+const objsData = ref('')
+const isShowName = ref(store.getIsShowName)
+const placeholder = ref(props.placeholder)
 //渲染完成
 onMounted(() => {
     if (props.multiple) {
-        typeName.value = "multiple_select";
+        typeName.value = 'multiple_select'
     } else {
-        typeName.value = props.type;
+        typeName.value = props.type
     }
     if (!isNullES(props.objs)) {
-        objsData.value = JSON.stringify(props.objs);
+        objsData.value = JSON.stringify(props.objs)
     }
-    matchingType();
-});
+    matchingType()
+    const tableId = getStoreValue('tableId')
+    Object.keys(tableId).forEach(key => {
+        if (key === props.keyname) {
+            placeholder.value = tableId[key]
+        } 
+    })
+    
+})
 
 //匹配组件类型
-const name = ref("");
-const typeName = ref("");
+const name = ref('')
+const typeName = ref('')
 const typeObj = {
-    text: "输入框",
-    select: "下拉框",
-    multiple_select: "多选下拉框",
-    select_option: "下拉框选项",
-    textarea: "多行输入框",
-    checkbox_group: "多选框组",
-    form_checkbox: "多选框组合",
-    checkbox: "多选框",
-    radio_group: "单选框组",
-    radio: "单选框",
-    date: "日期框",
-    time: "时间框",
-    datetime: "日期时间框",
-    datetimerange: "日期时间范围框",
-    dap_site_data: "远程搜索框",
-    strength_search: "设计强度搜索框",
-    upload: "图片展示以及上传框",
-    echart: "图表组件",
-};
+    text: '输入框',
+    select: '下拉框',
+    multiple_select: '多选下拉框',
+    select_option: '下拉框选项',
+    textarea: '多行输入框',
+    checkbox_group: '多选框组',
+    form_checkbox: '多选框组合',
+    checkbox: '多选框',
+    radio_group: '单选框组',
+    radio: '单选框',
+    date: '日期框',
+    time: '时间框',
+    datetime: '日期时间框',
+    datetimerange: '日期时间范围框',
+    dap_site_data: '远程搜索框',
+    strength_search: '设计强度搜索框',
+    upload: '图片展示以及上传框',
+    echart: '图表组件',
+}
 const matchingType = () => {
-    if (isNullES(typeName.value)) return;
-    name.value = typeObj[typeName.value];
-};
+    if (isNullES(typeName.value)) return
+    name.value = typeObj[typeName.value]
+}
 
 //判断插槽是否有内容
-const slots = useSlots();
-const isSlots = !!slots.default;
+const slots = useSlots()
+const isSlots = !!slots.default
 </script>
 
 <style scoped lang="scss">

+ 76 - 68
src/store/index.js

@@ -1,37 +1,39 @@
-import { defineStore } from "pinia";
-import pinia from "~src/store/init";
-import website from "~src/config/index";
-import logoIcon from "~src/assets/logo/icon.png";
-import { clearStoreAll } from "hc-vue3-ui";
-import { getStoreValue, setStoreValue } from "~src/utils/storage";
+import { defineStore } from 'pinia'
+import pinia from '~src/store/init'
+import website from '~src/config/index'
+import logoIcon from '~src/assets/logo/icon.png'
+import { clearStoreAll } from 'hc-vue3-ui'
+import { getStoreValue, setStoreValue } from '~src/utils/storage'
 import {
     removeRefreshToken,
     removeToken,
     setRefreshToken,
     setToken,
-} from "~src/api/auth";
+} from '~src/api/auth'
 
-export const useAppStore = defineStore("main", {
+export const useAppStore = defineStore('main', {
     state: () => ({
         //系统信息
-        title: getStoreValue("title") || website.title,
-        logoIcon: getStoreValue("logoIcon") || logoIcon,
-        logoName: getStoreValue("logoName") || website.name,
+        title: getStoreValue('title') || website.title,
+        logoIcon: getStoreValue('logoIcon') || logoIcon,
+        logoName: getStoreValue('logoName') || website.name,
         //主题信息
-        theme: getStoreValue("theme") || website.theme,
-        color: getStoreValue("color") || website.color,
+        theme: getStoreValue('theme') || website.theme,
+        color: getStoreValue('color') || website.color,
         //用户信息
-        token: getStoreValue("token") || "",
-        refreshToken: getStoreValue("refreshToken") || "",
-        tenantId: getStoreValue("tenantId") || "",
-        userInfo: getStoreValue("userInfo") || {},
+        token: getStoreValue('token') || '',
+        refreshToken: getStoreValue('refreshToken') || '',
+        tenantId: getStoreValue('tenantId') || '',
+        userInfo: getStoreValue('userInfo') || {},
         //菜单信息
-        menus: getStoreValue("menus") || [],
-        buttons: getStoreValue("buttons") || {},
+        menus: getStoreValue('menus') || [],
+        buttons: getStoreValue('buttons') || {},
         //其他配置信息
-        isCollapse: getStoreValue("isCollapse") || false, //菜单折叠
+        isCollapse: getStoreValue('isCollapse') || false, //菜单折叠
         //表单显示配置
-        isShowName: getStoreValue("isShowName") || true, //表单显示名称
+        isShowName: getStoreValue('isShowName') || true, //表单显示名称
+        //表单改变值Id
+        tableId: getStoreValue('tableId') || true, 
     }),
     getters: {
         //系统信息
@@ -53,95 +55,101 @@ export const useAppStore = defineStore("main", {
         getCollapse: (state) => state.isCollapse,
         //表单显示配置
         getIsShowName: (state) => state.isShowName,
+        getTableId: (state) => state.tableId,
     },
     actions: {
         //系统信息
         setTitle(value) {
-            this.title = value;
-            setStoreValue("title", value);
+            this.title = value
+            setStoreValue('title', value)
         },
         setLogoIcon(value) {
-            this.logoIcon = value;
-            setStoreValue("logoIcon", value);
+            this.logoIcon = value
+            setStoreValue('logoIcon', value)
         },
         setLogoName(value) {
-            this.logoName = value;
-            setStoreValue("logoName", value);
+            this.logoName = value
+            setStoreValue('logoName', value)
         },
         //主题信息
         setTheme(value) {
-            this.theme = value;
-            setStoreValue("theme", value);
+            this.theme = value
+            setStoreValue('theme', value)
         },
         setColor(value) {
-            this.color = value;
-            setStoreValue("color", value);
+            this.color = value
+            setStoreValue('color', value)
         },
         //用户信息
         setTokenVal(value) {
-            this.token = value;
-            setToken(value);
-            setStoreValue("token", value);
+            this.token = value
+            setToken(value)
+            setStoreValue('token', value)
         },
         setRefreshTokenVal(value) {
-            this.refreshToken = value;
-            setRefreshToken(value);
-            setStoreValue("refreshToken", value);
+            this.refreshToken = value
+            setRefreshToken(value)
+            setStoreValue('refreshToken', value)
         },
         setTenantId(value) {
-            this.tenantId = value;
-            setStoreValue("tenantId", value);
+            this.tenantId = value
+            setStoreValue('tenantId', value)
         },
         setUserInfo(value) {
-            this.userInfo = value;
-            setStoreValue("userInfo", value);
+            this.userInfo = value
+            setStoreValue('userInfo', value)
         },
         //菜单信息
         setMenus(value) {
-            this.menus = value;
-            setStoreValue("menus", value);
+            this.menus = value
+            setStoreValue('menus', value)
         },
         setButtons(value) {
-            this.buttons = value;
-            setStoreValue("buttons", value);
+            this.buttons = value
+            setStoreValue('buttons', value)
         },
         getButtonsVal(value) {
-            return this.buttons[value] || false;
+            return this.buttons[value] || false
         },
         //其他配置信息
         setCollapse(value) {
             //菜单折叠
-            this.isCollapse = value;
-            setStoreValue("isCollapse", value);
+            this.isCollapse = value
+            setStoreValue('isCollapse', value)
         },
         //表单显示
         setIsShowName(value) {
-            this.isShowName = value;
-            setStoreValue("isShowName", value);
+            this.isShowName = value
+            setStoreValue('isShowName', value)
+        },
+        setTableId(value) {
+            this.tableId = value
+            setStoreValue('tableId', value)
         },
         //清除缓存和token
         clearStoreData() {
-            this.title = null;
-            this.logoIcon = null;
-            this.logoName = null;
-            this.theme = website.theme;
-            this.color = website.color;
-            this.token = null;
-            this.refreshToken = null;
-            this.tenantId = null;
-            this.userInfo = null;
-            this.menus = null;
-            this.buttons = null;
-            this.isCollapse = false;
-            this.isShowName = true;
+            this.title = null
+            this.logoIcon = null
+            this.logoName = null
+            this.theme = website.theme
+            this.color = website.color
+            this.token = null
+            this.refreshToken = null
+            this.tenantId = null
+            this.userInfo = null
+            this.menus = null
+            this.buttons = null
+            this.isCollapse = false
+            this.isShowName = true
+            this.tableId = ''
             //清除缓存
-            clearStoreAll();
-            removeToken();
-            removeRefreshToken();
+            clearStoreAll()
+            removeToken()
+            removeRefreshToken()
         },
     },
-});
+})
 
 export default function useUserStoreWidthOut() {
-    return useAppStore(pinia);
+    return useAppStore(pinia)
 }

+ 14 - 1
src/views/desk/test-collect.vue

@@ -8,7 +8,7 @@
                 <el-link type="primary" @click="editRowClick(row)">编辑</el-link>
                 <el-link type="warning" @click="partitioningClick(row)">配置划分</el-link>
                 <el-link type="success" @click="associationList(row)">关联清表</el-link>
-                <el-link type="info">数据映射配置</el-link>
+                <el-link type="info" @click="dataMap(row)">数据映射配置</el-link>
                 <el-link type="danger" @click="delRowClick(row)">删除</el-link>
             </template>
         </hc-table>
@@ -36,6 +36,10 @@
             :info="associationInfo"
             :type="3"
         />
+        <HcdDataMap
+            v-model="dataMapShow"
+            :data="dataMapItem"
+        />
     </hc-card>
 </template>
 
@@ -46,6 +50,7 @@ import { HcDelMsg } from 'hc-vue3-ui'
 import HcPartitioning from './test-collect/partitioning.vue'
 import mainApi from '~api/desk/test-collect'
 import HcAssociationList from '../project/list/association-list.vue'
+import HcdDataMap from './test-collect/dataMap.vue'
 
 //激活
 onActivated(() => {
@@ -163,6 +168,14 @@ const associationList = async (item) => {
     await nextTick()
     isAssociationShow.value = true
 }
+//数据映射
+const dataMapShow = ref(false)
+const dataMapItem = ref({})
+const dataMap = async (row)=>{
+    dataMapItem.value = row
+    await nextTick()
+    dataMapShow.value = true
+}
 </script>
 
 <style lang="scss">

+ 320 - 0
src/views/desk/test-collect/dataMap.vue

@@ -0,0 +1,320 @@
+<template>
+    <hc-drawer v-model="isShow" to-id="hc-main-box" is-close @close="drawerClose">
+        <hc-body split :options="splitOptions">
+            <template #left>
+                <hc-card scrollbar>
+                    <hc-table-form
+                        v-if="tableShow"
+                        ref="excelRef"
+                        :html="excelHtml"
+                        @tap="excelClick"
+                    />
+                </hc-card>
+            </template>
+            <hc-card>
+                <el-form ref="formRef" :model="formModel" label-position="top" label-width="auto" size="large">
+                    <el-form-item label="选择表单">
+                        <el-select v-model="formModel.formVal" placeholder="请选择" @change="changeform">
+                            <el-option
+                                v-for="item in formoptions"
+                                :key="item.initTabId"
+                                :label="item.tabName"
+                                :value="item.initTabId"
+                            />
+                        </el-select>
+                    </el-form-item>
+                    <el-form-item label="选择元素">
+                        <el-select v-model="formModel.eleVal" placeholder="请选择" filterable @change="changeEle">
+                            <el-option
+                                v-for="item in eleOptions"
+                                :key="item.ekey"
+                                :label="item.eName"
+                                :value="item.ekey"
+                            />
+                        </el-select>
+                    </el-form-item>
+                </el-form>
+                <hc-card-item title="映射数据来源">
+                    <h4>表单名称:</h4>{{ infoDetail?.tabName }}
+                    <h4 class="mt-4">元素字段:</h4>{{ infoDetail?. elementName }}
+                </hc-card-item>
+                <template #extra>
+                    <el-button hc-btn>返回上一级</el-button>
+                    <el-button hc-btn type="primary" :loading="saveLoading" @click="saveInfo">保存</el-button>
+                </template>
+            </hc-card>
+        </hc-body>
+    </hc-drawer>
+</template>
+
+<script setup>
+import { nextTick, ref, watch } from 'vue'
+import { getArrValue, getObjVal, getObjValue, isArrIndex } from 'js-fast-way'
+import mainApi from '~api/desk/test-collect'
+import { setStoreValue } from '~uti/storage'
+
+const props = defineProps({
+    data: {
+        type: Object,
+        default: () => ({}),
+    },
+})
+
+const emit = defineEmits(['close'])
+
+
+//页面分割
+const splitOptions = { sizes: [70, 30], snapOffset: 0, minSize: [300, 300] }
+
+//双向绑定
+const isShow = defineModel('modelValue', {
+    default: false,
+})
+  //获取当前清表表所有已匹配的映射字段列表
+  const linkedData = ref({})
+const getLinkedData = async ()=>{
+    const { code, data } = await mainApi.getLinkData({
+                id:dataInfo.value.id,
+          })
+          if (code === 200) {
+            linkedData.value = getArrValue(data)
+           const mappedObject = Object.fromEntries(data.map(item => [item.htmlKeyName, item.elementValue]))
+          linkedData.value = mappedObject
+          setStoreValue('tableId', linkedData.value)
+          } else {
+          linkedData.value = []
+        }
+      
+}
+//监听数据
+const dataInfo = ref(props.data)
+watch(() => props.data, (data) => {
+    dataInfo.value = data
+  
+}, { immediate: true, deep: true })
+watch(() =>linkedData.value, (data) => {
+  setStoreValue('tableId,data')
+  
+}, { immediate: true, deep: true })
+
+//监听显示
+watch(isShow, (val) => {
+    if (val) getDataApi()
+})
+//表单相关
+const excelRef = ref(null)
+const excelHtml = ref('')
+
+
+//获取属性
+const getAttribute = async (dom, key) => {
+    try {
+        return dom?.getAttribute(`data-${key}`)
+    } catch (e) {
+        return null
+    }
+}
+//框框被点击
+const keys = [
+    'type',
+    'key',
+    'tr',
+    'td',
+    'index',
+    'x1',
+    'y1',
+    'x2',
+    'y2',
+    'name',
+    'text',
+    'rows',
+    'format',
+    'tip',
+    'weighing',
+    'label',
+    'value',
+    'src',
+    'val',
+    'contractid',
+    'pkeyid',
+    'objs',
+    'range',
+    'def',
+    'max',
+]
+//
+const tableShow = ref(true)
+const refreshTable = async ()=>{
+    tableShow.value = false
+  
+   
+    setTimeout(async ()=>{
+        await getDataApi()
+        tableShow.value = true
+      
+       
+    }, 1000)
+}
+//元素被点击
+const excelClick = async (item) => {
+    const dom = item?.target
+    let obj = { zdom: item }
+    for (let i = 0; i < keys.length; i++) {
+        obj[keys[i]] = await getAttribute(dom, keys[i])
+    }
+  curItem.value.htmlKeyName = obj.key
+  getLinkDetailData( obj.key)
+
+}
+
+const clickArr = ref([])
+//获取表单数据
+const getHtmlData = async ()=>{
+    const { data } = await mainApi.getLinkHtml({
+        classId:dataInfo.value.id,
+    })
+    excelHtml.value = data || ''
+ 
+}
+const formRef = ref(null)
+const formModel = ref({})
+const formoptions = ref([])
+const getDataApi = async ()=>{
+    await getFormoptions()
+    await getHtmlData()
+  await getLinkedData()
+
+ 
+}
+//获取元素映射
+
+const getLinkDetailData = async (keyName)=>{
+    const { code, data } = await mainApi.getLinkDetail({
+            classId:dataInfo.value.id,
+            keyName,
+          })
+          if (code === 200) {
+           infoDetail.value.tabName = data?.tabName
+           infoDetail.value.elementName = data?.elementName
+       
+          } else {
+            infoDetail.value = { tabName:'',
+            elementName:'' }
+        }
+        if (data) {
+            formoptions.value.forEach((ele)=>{
+                if (ele.tabName === data?.tabName) {
+                formModel.value.formVal = ele.initTabId
+                console.log( formModel.value.formVal, ' formModel.value.formVal')
+                changeform(formModel.value.formVal)
+                
+                }
+            })
+         
+        } else {
+            formModel.value = {}
+        }
+}
+const getFormoptions = async ()=>{
+    const { data } = await mainApi.getLinkTablist({ classId:dataInfo.value.id })
+    formoptions.value = getArrValue(data)
+}
+const getEleOptions = async ()=>{
+    const { data } = await mainApi.getLinkElelist({ id:formModel.value.formVal })
+    eleOptions.value = getArrValue(data)
+    eleOptions.value.forEach((ele)=>{
+                if (ele.eName === infoDetail.value.elementName) {
+                formModel.value.eleVal = ele.ekey
+                }
+            })
+}
+const eleOptions = ref([])
+const infoDetail = ref({
+    tabName:'',
+    elementName:'',
+})
+const curItem = ref({
+        elementId:'',
+        elementKey:'',
+        htmlKeyName:'',
+        trialTabId:'',
+        trialTabName:'',
+})
+
+watch(curItem.value, (val) => {
+  
+    const { elementId, elementKey, htmlKeyName, trialTabId, trialTabName } = val
+    if (elementId && elementKey && htmlKeyName && trialTabId && trialTabName) {
+          const newItem = Object.assign({}, val)
+          let variable
+         variable = isArrIndex(clickArr.value, 'htmlKeyName', newItem.htmlKeyName, variable) 
+          if (variable) {
+            clickArr.value.forEach((ele)=>{
+              if (ele.htmlKeyName === newItem.htmlKeyName) {
+                ele.elementId = newItem.elementId
+                ele.elementKey = newItem.elementKey
+                ele.htmlKeyName = newItem.htmlKeyName
+                ele.trialTabId = newItem.trialTabId
+                ele.trialTabName = newItem.trialTabName
+
+              }
+            })
+          } else {
+            clickArr.value.push(newItem)
+          }
+
+
+        }
+})
+const changeform = (val)=>{
+    getEleOptions()
+    formModel.value.eleVal = ''
+    formoptions.value.forEach((ele)=>{
+        if (ele.initTabId === val) {
+        infoDetail.value.tabName = ele.tabName
+        curItem.value.trialTabId = ele.pkeyId
+        curItem.value.trialTabName = ele.initTableName
+        }
+    })
+}
+const changeEle = (val)=>{
+    eleOptions.value.forEach((ele)=>{
+        if (ele.ekey === val) {
+            infoDetail.value.elementName = ele.eName
+         
+            curItem.value.elementKey = val
+            curItem.value.elementId = ele.id
+        }
+      })
+}
+//映射数据保存
+const saveLoading = ref(false)
+const saveInfo = async ()=>{
+    if (clickArr.value.length === 0) {
+      window.$message.warning('请进行数据映射配置')
+      return
+    }
+    saveLoading.value = true
+        const { msg, code, error } = await mainApi.saveLinkDetail({
+                    classId:dataInfo.value.id,
+                    reflectionBeanList:clickArr.value,
+        })
+        saveLoading.value = false
+        if (code === 200 && !error) {
+            window.$message.success(msg)
+           
+            refreshTable()
+            clickArr.value = []
+        }
+}
+//关闭抽屉
+const drawerClose = () => {
+    isShow.value = false
+    clickArr.value = []
+    emit('close')
+}
+</script>
+
+<style lang="scss">
+
+</style>

+ 98 - 99
src/views/project/list/adjust-excel.vue

@@ -34,8 +34,8 @@
                     v-if="tabsKey === 'tab2'"
                     ref="setEVisaRef"
                     :info="dataInfo"
-                    @finish="getDataApi"
                     :type="type"
+                    @finish="getDataApi"
                 />
                 <HcSetFormula
                     v-if="tabsKey === 'tab3'"
@@ -47,15 +47,15 @@
                     v-if="tabsKey === 'tab4'"
                     ref="setDefaultRef"
                     :info="dataInfo"
-                    @finish="getDataApi"
                     :type="2"
+                    @finish="getDataApi"
                 />
                 <HcSetPrompt
                     v-if="tabsKey === 'tab5'"
                     ref="setPromptRef"
                     :info="dataInfo"
-                    @finish="getDataApi"
                     :type="2"
+                    @finish="getDataApi"
                 />
             </hc-card>
         </hc-page-split>
@@ -63,17 +63,16 @@
 </template>
 
 <script setup>
-import { ref, watch } from "vue";
-import { getObjValue, isNullES } from "js-fast-way";
-import HcSetInput from "./adjust-excel/set-input.vue";
-import HcSetEVisa from "./adjust-excel/set-e-visa.vue";
-import HcSetFormula from "./adjust-excel/set-formula.vue";
-import HcSetDefault from "./adjust-excel/set-default.vue";
-import HcSetPrompt from "./adjust-excel/set-prompt.vue";
-import excelApi from "~api/exctab/exceltab";
+import { ref, watch } from 'vue'
+import { getObjValue, isNullES } from 'js-fast-way'
+import HcSetInput from './adjust-excel/set-input.vue'
+import HcSetEVisa from './adjust-excel/set-e-visa.vue'
+import HcSetFormula from './adjust-excel/set-formula.vue'
+import HcSetDefault from './adjust-excel/set-default.vue'
+import HcSetPrompt from './adjust-excel/set-prompt.vue'
+import excelApi from '~api/exctab/exceltab'
 
-import { useAppStore } from "~src/store";
-const store = useAppStore();
+import { useAppStore } from '~src/store'
 const props = defineProps({
     info: {
         type: Object,
@@ -81,146 +80,146 @@ const props = defineProps({
     },
     type: {
         type: [String, Number],
-        default: "", //默认没有,独立表单库类型为2
+        default: '', //默认没有,独立表单库类型为2
     },
-});
-
+})
 //事件
-const emit = defineEmits(["close"]);
-
+const emit = defineEmits(['close'])
+const store = useAppStore()
 //双向绑定
-const isShow = defineModel("modelValue", {
+const isShow = defineModel('modelValue', {
     default: false,
-});
+})
 
 //监听数据
-const dataInfo = ref(props.info);
-const type = ref(props.type);
+const dataInfo = ref(props.info)
+const type = ref(props.type)
 watch(
     () => [props.info, props.type],
     ([data, tpe]) => {
-        dataInfo.value = getObjValue(data);
+        dataInfo.value = getObjValue(data)
 
-        type.value = tpe;
+        type.value = tpe
     },
-    { immediate: true, deep: true }
-);
+    { immediate: true, deep: true },
+)
 
 //监听显示
 watch(isShow, (val) => {
-    if (val) getDataApi();
-    store.setIsShowName(false);
-});
+    if (val) getDataApi()
+    store.setIsShowName(false)
+})
 
 //页面分割
-const splitOptions = { sizes: [70, 30], snapOffset: 0, minSize: [300, 300] };
+const splitOptions = { sizes: [70, 30], snapOffset: 0, minSize: [300, 300] }
 
 //选项卡
-const tabsKey = ref("tab1");
+const tabsKey = ref('tab1')
 const tabsProps = [
-    { label: "输入框", value: "tab1" },
-    { label: "电签位置", value: "tab2" },
-    { label: "公式条件", value: "tab3" },
-    { label: "默认信息", value: "tab4" },
-    { label: "提示信息", value: "tab5" },
-];
+    { label: '输入框', value: 'tab1' },
+    { label: '电签位置', value: 'tab2' },
+    { label: '公式条件', value: 'tab3' },
+    { label: '默认信息', value: 'tab4' },
+    { label: '提示信息', value: 'tab5' },
+]
 
 //处理相关数据
-const excelRef = ref(null);
-const excelHtml = ref("");
+const excelRef = ref(null)
+const excelHtml = ref('')
 const getDataApi = async () => {
     const { pkeyId, excelId, primaryKeyId, excelIds } = getObjValue(
-        dataInfo.value
-    );
+        dataInfo.value,
+    )
     if (type.value !== 2) {
         if (isNullES(pkeyId) || isNullES(excelId)) {
-            tableFormLoading.value = false;
-            window?.$message.warning("表单值异常,请联系管理员");
-            return;
+            tableFormLoading.value = false
+            window?.$message.warning('表单值异常,请联系管理员')
+            return
         }
     } else {
         if (isNullES(primaryKeyId) || isNullES(excelIds)) {
-            tableFormLoading.value = false;
-            window?.$message.warning("表单值异常,请联系管理员");
-            return;
+            tableFormLoading.value = false
+            window?.$message.warning('表单值异常,请联系管理员')
+            return
         }
     }
     const { data } = await excelApi.getExcelHtml({
         pkeyId: pkeyId ? pkeyId : primaryKeyId,
-    });
-    excelHtml.value = data || "";
-};
+    })
+    excelHtml.value = data || ''
+}
 
 //ref
-const setInputRef = ref(null);
-const setEVisaRef = ref(null);
-const setFormulaRef = ref(null);
-const setDefaultRef = ref(null);
-const setPromptRef = ref(null);
+const setInputRef = ref(null)
+const setEVisaRef = ref(null)
+const setFormulaRef = ref(null)
+const setDefaultRef = ref(null)
+const setPromptRef = ref(null)
 
 //框框被点击
 const keys = [
-    "type",
-    "key",
-    "tr",
-    "td",
-    "index",
-    "x1",
-    "y1",
-    "x2",
-    "y2",
-    "name",
-    "text",
-    "rows",
-    "format",
-    "tip",
-    "weighing",
-    "label",
-    "value",
-    "src",
-    "val",
-    "contractid",
-    "pkeyid",
-    "objs",
-    "range",
-    "def",
-    "max",
-];
+    'type',
+    'key',
+    'tr',
+    'td',
+    'index',
+    'x1',
+    'y1',
+    'x2',
+    'y2',
+    'name',
+    'text',
+    'rows',
+    'format',
+    'tip',
+    'weighing',
+    'label',
+    'value',
+    'src',
+    'val',
+    'contractid',
+    'pkeyid',
+    'objs',
+    'range',
+    'def',
+    'max',
+]
 const excelClick = async (item) => {
-    const dom = item?.target;
-    let obj = { zdom: item };
+    const dom = item?.target
+    let obj = { zdom: item }
     for (let i = 0; i < keys.length; i++) {
-        obj[keys[i]] = await getAttribute(dom, keys[i]);
+        obj[keys[i]] = await getAttribute(dom, keys[i])
     }
-    if (tabsKey.value === "tab1") {
+    if (tabsKey.value === 'tab1') {
         //设置输入框
-        setInputRef.value?.setDomData(obj);
-    } else if (tabsKey.value === "tab2") {
+        setInputRef.value?.setDomData(obj)
+    } else if (tabsKey.value === 'tab2') {
         //电签
-        setEVisaRef.value?.setDomData(obj);
-    } else if (tabsKey.value === "tab4") {
+        setEVisaRef.value?.setDomData(obj)
+    } else if (tabsKey.value === 'tab4') {
         //默认信息
-        setDefaultRef.value?.setDomData(obj);
-    } else if (tabsKey.value === "tab5") {
+        setDefaultRef.value?.setDomData(obj)
+    } else if (tabsKey.value === 'tab5') {
         //提示信息
-        setPromptRef.value?.setDomData(obj);
+        setPromptRef.value?.setDomData(obj)
     }
-};
+}
 
 //获取属性
 const getAttribute = async (dom, key) => {
     try {
-        return dom?.getAttribute(`data-${key}`);
+        return dom?.getAttribute(`data-${key}`)
     } catch (e) {
-        return null;
+        return null
     }
-};
+}
 
 //关闭抽屉
 const drawerClose = () => {
-    isShow.value = false;
-    emit("close");
-};
+    isShow.value = false
+    store.setIsShowName(true)
+    emit('close')
+}
 </script>
 
 <style lang="scss">