8
0
ZaiZai há 1 ano atrás
pai
commit
1678d28fd7

+ 25 - 11
src/views/exctab/modules/add-excel.vue

@@ -18,7 +18,7 @@
                 </el-row>
             </el-form>
         </div>
-        <div class="hc-exctab-exceltab-add-excel-middle">
+        <div v-if="wbsMiddle" class="hc-exctab-exceltab-add-excel-middle">
             <el-row :gutter="14" class="h-full">
                 <el-col :span="12" class="h-full">
                     <div class="left-card h-full">
@@ -94,12 +94,22 @@ const wbsMiddle = ref(false)
 const excelTypeData = ref([])
 const getInfoData = async () => {
     const data = getObjValue(dataInfo.value)
-    console.log(data)
-    if (data.fileType === 3) {
-        wbsMiddle.value = false
+    if (props.type === '新增') {
+        if (data.fileType === 3) {
+            wbsMiddle.value = false
+        } else {
+            wbsMiddle.value = true
+            getWbsTypeList().then() //wbs模板名称
+        }
+        formModel.value = { parentId: data.id }
     } else {
-        wbsMiddle.value = true
-        getWbsTypeList().then() //wbs模板名称
+        if (data.fileType !== 3 && data.hasChildren) {
+            wbsMiddle.value = false
+        } else {
+            wbsMiddle.value = true
+            getWbsTypeList().then() //wbs模板名称
+        }
+        getDetailExcel(data.id).then()
     }
     //获取清表类型
     const types = await getDictionaryData('sys_excltab_type', true)
@@ -107,11 +117,15 @@ const getInfoData = async () => {
         item.value = Number(item.value)
     })
     excelTypeData.value = types
-    //处理表单默认数据
-    if (props.type === '新增') {
-        formModel.value = { parentId: data.id }
-    } else {
-        formModel.value = { id: data.id }
+}
+
+//获取详情
+const getDetailExcel = async (id) => {
+    const { data } = await mainApi.detailExcel(id)
+    formModel.value = {
+        id: data.id,
+        nodeName: data.name, //清表名称
+        tabType: data.tabType, //清表类型
     }
 }
 

+ 4 - 0
src/views/exctab/modules/template.vue

@@ -186,6 +186,10 @@ const treeMenuClick = ({ key, data }) => {
         addExcelInfo.value = getObjValue(data)
         addExcelType.value = '新增'
         addExcelShow.value = true
+    } else if (key === 'edit') {
+        addExcelInfo.value = getObjValue(data)
+        addExcelType.value = '编辑'
+        addExcelShow.value = true
     }
 }