Răsfoiți Sursa

独立表单库

duy 2 ani în urmă
părinte
comite
4f0c111188

+ 8 - 0
src/api/exctab/editelement.js

@@ -52,3 +52,11 @@ export const submitBatch = (data) => {
         data
     })
 }
+//元素库
+export const tableType = () => {
+    return request({
+      url: '/api/blade-system/dict/dictionary?code=table_type',
+      method: 'get',
+    })
+  }
+  

+ 15 - 7
src/api/manager/wbsprivate.js

@@ -122,13 +122,21 @@ export const syncNodeTable = (primaryKeyId) => {
   })
 }
 
-export const tabTypeLazyTree = (parentId,projectId) => {
+
+
+//清表树
+export const tabTypeLazyTree = (params) => {
   return request({
     url: '/api/blade-manager/wbsPrivate/tab_Type_lazy-tree',
-    method: 'get',
-    params: {
-      parentId,
-      projectId
-    }
+      method: 'get',
+      params
   })
-}
+};
+
+export const tabTypeLazyTreeAll = (params) => {
+  return request({
+    url: '/api/blade-manager/wbsPrivate/tab_Type_lazy-tree/tab_Type_lazy-tree_all',
+      method: 'get',
+      params
+  })
+}

+ 132 - 61
src/views/manager/projectinfo/independent.vue

@@ -4,11 +4,33 @@
       <div class="boxnei" style="display: flex; flex-direction: column">
         <h3>引用元素表</h3>
         <div style="overflow: auto; flex: 1">
-          <avue-tree
-            :option="treeOption"
-            :data="treeData"
+          <el-tree
+            style="display: inline-block;min-width: 100%;"
+            ref="trees"
+            :loading="loading"
+         
+           
+            :data="data"
+            :props="defaultProps"
             @node-click="nodeClick"
-          ></avue-tree>
+            node-key="id"
+            :expand-on-click-node="false"
+            v-show="!allTreeShow"
+          >
+            <span
+              class="custom-tree-node"
+              slot-scope="{ data ,node }"
+            
+              style="box-sizing: border-box;padding-right:70px!important;;"
+            >
+              <div style="width:100%;">
+                <span style="text-overflow: ellipsis;"> {{ data.title }} </span>
+                <!-- <span> {{ node}} </span> -->
+                <!-- 添加 -->
+            
+              </div>
+            </span>
+          </el-tree>
         </div>
       </div>
     </div>
@@ -28,7 +50,12 @@
               v-model="obj"
               ref="crud"
               @selection-change="selectionChange"
-            >qingb
+              :page.sync="page"
+              @search-change="searchChange" 
+              @search-reset="resetChange"
+            >
+            
+         
               <template slot="menuRight">
                             <el-button
                               type="primary"
@@ -47,15 +74,13 @@
                           >删除表单
                           </el-button>
               </template>
+             
                 <template slot-scope="{type,size,row}" slot="menu">
                       <el-button  :size="size" :type="type" @click="Associationlist(row)">关联清表</el-button>
                       <el-button  :size="size" :type="type" @click="rightClick(
-                          row.pkeyId,
-                          row.excelId,
-                          row.id,
-                          row.initTableName
+                          row
                         )">编辑元素</el-button>
-                      <el-button  :size="size" :type="type" @click="adjustExcel(row.pkeyId,row.excelId)">调整表单</el-button>
+                      <el-button  :size="size" :type="type" @click="adjustExcel(row.id,row.primaryKeyId)">调整表单</el-button>
                       <el-button  :size="size" :type="type" @click="handleEditFormula(row)">编辑公式</el-button>
                       
                 </template>
@@ -64,7 +89,7 @@
         </div>
       </div>
     </div>
-    <Qute ref="Qute"> </Qute>
+    <Qute ref="Qute" :projectid="projectid"> </Qute>
     <Relation ref="Relation" :GLExcelFrom="GLExcelFrom"/>
     <!-- 编辑元素 -->
        <!-- 编辑元素 -->
@@ -77,7 +102,6 @@
     >
       <EditElement
         :pkeyId="editElementQuery.pkeyId"
-        :excelId="editElementQuery.excelId"
         :id="editElementQuery.id"
         :initTableName="editElementQuery.initTableName"
         :pid="editElementQuery.pid"
@@ -160,13 +184,7 @@
 </template>
 
 <script>
-import {
-  detailExcel,
-  excelType,
-  tabLazytree,
-  wbstree,
-  getWbsTypeList,
-} from "@/api/exctab/excelmodel";
+import {tabTypeLazyTree,tabTypeLazyTreeAll} from "@/api/manager/wbsprivate";
 import {
   updateBatchNodeTableInfo,
   selectByNodeTable,
@@ -199,20 +217,23 @@ export default {
   },
   data() {
     return {
+      page:{
+        current:1,
+        size:10,
+        total:0
+      },
+      search:{},
+      loading:false,
       dialogVisible: false,
       obj: {},
-      treeData: [
-        {
-          value: 0,
-          label: "一级部门",
-          children: [
-            {
-              value: 1,
-              label: "一级部门1",
-            },
-          ],
+      data: [],
+      defaultProps: {
+        children: "children",
+        isLeaf: function (data) {
+          return data.hasChildren;
         },
-      ],
+      },
+      allTreeShow:false,//是否显示整棵树
       treeOption: {
         defaultExpandAll: true,
         filter: false,
@@ -250,7 +271,7 @@ export default {
         height: "auto",
         calcHeight: 30,
         tip: false,
-        searchShow: false,
+        searchShow: true,
         searchMenuSpan: 6,
         border: true,
         index: true,
@@ -261,19 +282,23 @@ export default {
         addBtn: false,
         menu: true,
         menuWidth:300,
+        searchShowBtn:true,
 
         dialogClickModal: false,
         column: [
           {
-            label: "表名称",
-            prop: "tableName",
-
+            label: "元素表名称",
+            prop: "title",
+            search: true,
             editDisplay: false,
             addDisplay: false,
+            searchPlaceholder:'请输入元素表名称',
+            searchSpan:18,
+            searchLabelWidth:100,
           },
           {
             label: "元素表类型",
-            prop: "formatTableType",
+            prop: "tabType",
             // search: true,
             rules: [
               {
@@ -299,7 +324,7 @@ export default {
           },
           {
             label: "所书方",
-            prop: "formatOwner",
+            prop: "tabOwner",
 
             editDisplay: false,
             addDisplay: false,
@@ -356,22 +381,65 @@ export default {
         //#region公式
       id: "",
       curTreeData: {},
-      projectid:''
+      projectid:'',
+      treeId:""
+
 
 
     };
   },
   created() {
-    this.loadData = this.loadData1;
+    // this.loadData = this.loadData1;
+     this.projectid = this.$route.query.pid;
+     this.treeLoad1()
   },
   methods: {
-    nodeClick(data) {
-      if (data.value == 0) {
-        this.loadData = this.loadData1;
-      } else if (data.value == 1) {
-        this.loadData = this.loadData2;
+
+     async treeLoad1 () {
+      let id = 12345678910
+      let das = await this.tabTypeLazyTree(id, this.projectid,this.page.current,this.page.size)
+      console.log(this.projectid,'projectid');
+     this.data=das.records
+      // return resolve(das.records)
+    },
+        //#region 接口
+    async tabTypeLazyTree (parentId, projectId,current,size,titleName) {//清表树
+      console.log(parentId, projectId);
+      const { data: res } = await tabTypeLazyTree({ parentId, projectId,current,size,titleName })
+      console.log(res);
+      if (res.code === 200) {
+        return res.data
       }
-      this.$message.success(JSON.stringify(data));
+    },
+    //搜索
+    searchChange(params,done){
+     this.tabTypeLazyTree(this.treeId, this.projectid,this.page.current,this.page.size,params.title).then((res)=>{
+          console.log(res.records);
+          this.loadData=res.records;
+           this.page.total=this.loadData.length
+           done();
+        })
+
+    },
+
+    resetChange(item){
+      console.log(item);
+        this.tabTypeLazyTree(this.treeId, this.projectid,this.page.current,this.page.size).then((res)=>{
+          console.log(res.records);
+          this.loadData=res.records;
+           this.page.total=this.loadData.length
+          
+        })
+    },
+    nodeClick (data) {//外层树结构
+        console.log(data,'treedata');
+        this.treeId=data.id
+        this.tabTypeLazyTree(data.id, this.projectid,this.page.current,this.page.size).then((res)=>{
+          console.log(res.records);
+          this.loadData=res.records;
+           this.page.total=this.loadData.length
+          
+        })
     },
     handleClose(done) {
       this.$confirm("确认关闭?")
@@ -382,7 +450,8 @@ export default {
     },
     //引用元素表单库
     quteEle(){
-      this.$refs.Qute.show()
+      this.$refs.Qute.show();
+
     },
     handleDelete () {
       if (this.selectionList.length === 0) {
@@ -399,7 +468,8 @@ export default {
           console.log(this.ids,'this.ids删除');
         })
         .then(() => {
-          this.onLoad(this.page);
+         this.tabTypeLazyTree(this.treeId, this.projectid,this.page.current,this.page.size)
+
           this.$message({
             type: "success",
             message: "操作成功!"
@@ -416,26 +486,27 @@ export default {
     },
     //关联清表
      Associationlist(row) {
-       console.log('关联清表');
+       console.log('关联清表',row);
        this.$refs.Relation.show()
-      this.GLExcelFrom.name = row.modeId;
+      // this.GLExcelFrom.name = row.modeId;
    
-      this.GLExcelFrom.id = row.pkeyId;
-      this.GLExcelFrom.excelId =row.excelId;
+      this.GLExcelFrom.id = row.primaryKeyId;
+      this.GLExcelFrom.excelId =row.id;
       this.GLExcelFrom.ids = row.id;
-      this.GLExcelFrom.initTableName =row.initTableName;
-      this.GLExcelFrom.excelId=row.excelId
+      this.GLEidxcelFrom.initTableName =row.title;
+      // this.GLExcelFrom.excelId=row.excelId
     },
        //#region 编辑元素
-    async rightClick(pkeyId, excelId, id, initTableName) {
-      // await this.getExcelHtml2(pkeyId);
+    async rightClick(row) {
+      console.log(row,'编辑元素');
+      await this.getExcelHtml2(row.id);
       // console.log('编辑元素');
-      // this.editElementQuery.pkeyId = pkeyId;
+      this.editElementQuery.pkeyId = row.primaryKeyId;
       // this.editElementQuery.excelId = excelId;
-      // this.editElementQuery.id = id;
-      // this.editElementQuery.initTableName = initTableName;
-      // this.editElementQuery.pid = this.$route.query.pid;
-      // this.editElementQuery.wbsid = this.$route.query.wbsid;
+      this.editElementQuery.id = row.id;
+      this.editElementQuery.initTableName =row. title;
+      this.editElementQuery.pid = this.$route.query.pid;
+      this.editElementQuery.wbsid = this.$route.query.wbsid;
       // this.editElementQuery.nodeid = this.curTreeData.id;
 
       this.editElementVisible = true;
@@ -452,8 +523,8 @@ export default {
       this.excelHtml=true
       // console.log('调整表单');
       // //调整表单
-      // this.GLExcelFrom.id = pkeyId;
-      // this.getExcelHtml(pkeyId);
+      this.GLExcelFrom.id = pkeyId;
+      this.getExcelHtml(pkeyId);
     },
     handleEditFormula(row) {
       console.log('公式');

+ 13 - 1
src/views/manager/projectinfo/qutediaolog/qute.vue

@@ -27,6 +27,7 @@
 </template>
 
 <script>
+import {tabTypeLazyTreeAll} from "@/api/manager/wbsprivate";
 export default {
     data() {
       return {
@@ -147,9 +148,20 @@ export default {
       }
     },
     created(){
-       this.loadData=this.loadData1;
+      //  this.loadData=this.loadData1;
+      // this.tabTypeLazyTreeAll(this.projectId)
     },
     methods: {
+
+    async tabTypeLazyTreeAll ( projectId) {//清表树
+      console.log(projectId);
+      const { data: res } = await tabTypeLazyTreeAll()
+      console.log(res,'tabTypeLazyTreeAll');
+      if (res.code === 200) {
+        // return res.data
+        console.log(res.data,'tabTypeLazyTreeAll');
+      }
+    },
       nodeClick(data){
         if(data.value==0){
           this.loadData=this.loadData1;

+ 29 - 7
src/views/manager/projectinfo/qutediaolog/relation.vue

@@ -4,7 +4,7 @@
         title="关联清表"
         class="excelBox"
         :visible.sync="GLExcel"
-        width="500px"
+        width="300px"
         modal-append-to-body
         append-to-body
         @close="GLExcelMD"
@@ -86,6 +86,15 @@ export default {
             //     excelId: "",
             //     initTableName: "",
             // },
+            editElementQuery: {
+                pkeyId: "",
+                excelId: "",
+                id: "",
+                initTableName: "",
+                pid: "",
+                wbsid: "",
+                nodeid: "",
+            }, 
             exceldata: [], //清表模板
             GLExcelData: [], //
             GLExcelLoading: false,
@@ -177,6 +186,19 @@ export default {
                     this.$refs.tree.setCheckedKeys([data.id]);
                 }
             },
+                //#region 编辑元素
+            async rightClick(pkeyId, excelId, id, initTableName) {
+                await this.getExcelHtml2(pkeyId);
+                this.editElementQuery.pkeyId = pkeyId;
+                this.editElementQuery.excelId = excelId;
+                this.editElementQuery.id = id;
+                this.editElementQuery.initTableName = initTableName;
+                this.editElementQuery.pid = this.$route.query.pid;
+                this.editElementQuery.wbsid = this.$route.query.wbsid;
+                this.editElementQuery.nodeid = this.curTreeData.id;
+
+                this.editElementVisible = true;
+                },
             async saveLinkTab() {
                 //保存按钮
                 let checkNodes = this.$refs.tree.getCheckedNodes();
@@ -204,12 +226,12 @@ export default {
                     // selectByNodeTable刷新表单列表
                     // this.updateNodeTable();
                     this.GLExcel = false;
-                    this.rightClick(
-                        this.GLExcelFrom.id,
-                        this.GLExcelFrom.excelId,
-                        this.GLExcelFrom.ids,
-                        this.GLExcelFrom.initTableName
-                    );
+                    // this.rightClick(
+                    //     this.GLExcelFrom.id,
+                    //     this.GLExcelFrom.excelId,
+                    //     this.GLExcelFrom.ids,
+                    //     this.GLExcelFrom.initTableName
+                    // );
                     }
                 } else {
                     this.$message({

+ 3 - 0
src/views/manager/projectinfo/tree.vue

@@ -2587,6 +2587,7 @@ export default {
           // selectByNodeTable刷新表单列表
           this.updateNodeTable();
           this.GLExcel = false;
+          console.log(this.GLExcelFrom,'GLExcelFrom');
           this.rightClick(
             this.GLExcelFrom.id,
             this.GLExcelFrom.excelId,
@@ -3068,6 +3069,8 @@ export default {
       console.log('独立表单库');
       this.$router.push({
         path: '/project/independent',
+        query: { pid: this.projectid,wbsid:this.$route.query.wbsid }
+
       
       });
     }

+ 11 - 0
src/views/manager/wbsinfo/PublicWbs.vue

@@ -253,6 +253,17 @@ export default {
             show(){
                 console.log(this.from);
                 this.AssociatedPublicTap=true;
+                 //清除数据
+                this.filterText1 = "";
+                this.exceldata = [];
+                this.allTreeData1 = [];
+                this.selectedId = "";
+                this.GLExcelFrom.name = "";
+                this.isShowInput = false;
+
+                //清理之前填写的数据
+                this.addElementForm.wbsId = "";
+                this.addElementForm.tableOwner = "";
                 this.getWbsTypeList();
                 console.log(this.from,'点击节点数据');
                 this.excelType();

+ 1 - 0
src/views/manager/wbsinfo/edit.vue

@@ -2165,6 +2165,7 @@ export default {
 
     handleEdit (index, row) {
       this.curEleTable = row;
+      console.log(row,'row');
       selectFormElements(this.curEleTable.initTableId).then((res) => {
         res.data.data.forEach((element) => {
           this.eleReg.exec(element.eAllowDeviation);