duy 9 ヶ月 前
コミット
e6b45034f5

+ 10 - 2
src/views/desk/wbs/create-new-excel.vue

@@ -298,6 +298,11 @@ const props = defineProps({
         type: String,
         default: "",
     },
+    type: {
+        type: [String, Number],
+
+        default: "1", //私有wbs为0,公共wbs为1
+    },
 });
 //事件
 const emit = defineEmits(["close"]);
@@ -325,6 +330,7 @@ const tableId = ref(props.tableId);
 const initTableName = ref(props.initTableName);
 const initTableId = ref(props.initTableId);
 const eKey = ref(props.eKey);
+const type = ref(props.type);
 //监听数据
 watch(
     () => [
@@ -337,8 +343,9 @@ watch(
         props.initTableName,
         props.initTableId,
         props.eKey,
+        props.type,
     ],
-    ([own, table, wbsid, nodeInfo, til, tid, tname, itid, ekey]) => {
+    ([own, table, wbsid, nodeInfo, til, tid, tname, itid, ekey, tpe]) => {
         ownerTypeList.value = own;
         tableTypelist.value = table;
         wbsId.value = wbsid;
@@ -348,6 +355,7 @@ watch(
         initTableName.value = tname;
         initTableId.value = itid;
         eKey.value = ekey;
+        type.value = tpe;
     },
     { deep: true }
 );
@@ -422,7 +430,7 @@ const getEditEleList = async () => {
     const { data } = await mainApi.getTableElements({
         id: tableId.value,
         search: "",
-        type: 1,
+        type: type.value,
     });
     editEleList.value = getArrValue(data);
     const eleReg = /(-|>|<|≥|≤|±|【】)?([^≥≤±【】]*)/;

+ 42 - 0
src/views/project/list/wbs-tree.vue

@@ -172,6 +172,11 @@
                                             type="success"
                                             >取消隐藏</el-link
                                         >
+                                        <el-link
+                                            type="primary"
+                                            @click="handleEdit(row)"
+                                            >编辑</el-link
+                                        >
                                         <el-link
                                             v-del-com:[delInfoTableRow]="row"
                                             type="danger"
@@ -402,6 +407,22 @@
         </tableSort>
         <!-- 预览 -->
         <previewPage v-model="previewShow" :info="previewInfo"></previewPage>
+
+        <!-- 创建新的元素表 -->
+        <createNewExcel
+            v-model="isCreateShow"
+            @close="createClose"
+            :node="treeItem"
+            :wid="wbsId"
+            :tableTypelist="tableTypelist"
+            :ownerTypeList="ownerTypeList"
+            :title="modalTitle"
+            :initTableName="initTableName"
+            :initTableId="initTableId"
+            :tableId="tableId"
+            :eKey="eKey"
+            :type="0"
+        ></createNewExcel>
     </hc-drawer>
 </template>
 
@@ -425,6 +446,7 @@ import archiveTime from "./archiveTime.vue";
 import editElePage from "../../desk/wbs/edit-ele.vue";
 import tableSort from "../../desk/wbs/table-sort.vue";
 import previewPage from "./previewPage.vue";
+import createNewExcel from "../../desk/wbs/create-new-excel.vue";
 
 const props = defineProps({
     type: {
@@ -1149,6 +1171,26 @@ const previewClick = (row) => {
     previewShow.value = true;
     previewInfo.value = row;
 };
+
+//创建新的元素表
+const isCreateShow = ref(false);
+const modalTitle = ref("创建新的元素表");
+const createClose = () => {
+    isCreateShow.value = false;
+    getInfoTableData();
+};
+const initTableName = ref("");
+const initTableId = ref("");
+const eKey = ref("");
+const tableId = ref("");
+const handleEdit = (row) => {
+    isCreateShow.value = true;
+    modalTitle.value = row.tableName + "元素编辑";
+    tableId.value = row.id;
+    initTableName.value = row.initTableName;
+    initTableId.value = row.initTableId;
+    eKey.value = row.ekey;
+};
 </script>
 
 <style scoped lang="scss">