duy 2 éve
szülő
commit
86649036f2

+ 20 - 1
src/router/views/index.js

@@ -180,7 +180,17 @@ export default [{
             },
             component: () =>
               import ( /* webpackChunkName: "views" */ '@/views/manager/wbsinfo/edit')
-          }]
+          },
+          {
+            path: '/wbs/element',
+            name: '元素库',
+            meta: {
+              i18n: 'element',
+            },
+            component: () =>
+              import ( /* webpackChunkName: "views" */ '@/views/manager/wbsinfo/element')
+          },
+        ]
     }, {
         path: '/contract',
         component: Layout,
@@ -243,6 +253,15 @@ export default [{
                 },
                 component: () =>
                     import ( /* webpackChunkName: "views" */ '@/views/manager/projectinfo/editElement/editElement')
+            },
+            {
+                path: 'independent',
+                name: '独立表单库',
+                meta: {
+                    i18n: 'independent'
+                },
+                component: () =>
+                    import ( /* webpackChunkName: "views" */ '@/views/manager/projectinfo/independent')
             }
         ]
     }, {

+ 1 - 1
src/views/exctab/ElementIdentification/index.vue

@@ -838,7 +838,7 @@ export default {
     //#region
     handleNodeClick(data) {
       //树节点点击事件
-      console.log(data);
+      console.log(data,'树节点点击事件');
       if (data.fileType == 3) {
         this.getExcelHtmlCol(data.id); //获取excel模板
         if (this.dataType.length == 0) {

+ 6 - 2
src/views/exctab/excelmodel/excelmodel.vue

@@ -474,7 +474,9 @@ export default {
         this.from.fileUrl = res.data.fileUrl      //文件路径
         let routeUrl = res.data.fileUrl
         let pSrc = routeUrl + '?r=' + new Date()
-        this.excelSrc = 'http://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(pSrc)
+        this.excelSrc = 'http://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(pSrc);
+        // //导入模板名称
+        // this.from.import={}
       }
     },
     async getWbsTypeList () {//清表编辑 wbs 下拉框选择
@@ -672,6 +674,7 @@ export default {
       return resolve(das)
     },
     nodeClick (data) {//外层树结构
+      this.from.import=""
       if (data.hasChildren == false) {
         this.from.checkd = true
       } else if (data.fileType == 3) {
@@ -687,6 +690,7 @@ export default {
           id: '',//清表树ID
           extension: '', //文件名称
           fileUrl: '',//文件路径
+         
         }
       }
     },
@@ -913,7 +917,7 @@ export default {
       let formData = new FormData()
       formData.append('file', file.raw)
       formData.append('nodeId', this.from.id)
-      //console.log(file.raw)
+      // console.log(file.raw)
 
       const loading = this.$loading({
         lock: true,

+ 632 - 0
src/views/manager/projectinfo/independent.vue

@@ -0,0 +1,632 @@
+<template>
+  <div style="height: 100%" class="flexStar">
+    <div class="boxswai" style="width: 26%; padding-left: 0px">
+      <div class="boxnei" style="display: flex; flex-direction: column">
+        <h3>引用元素表</h3>
+        <div style="overflow: auto; flex: 1">
+          <avue-tree
+            :option="treeOption"
+            :data="treeData"
+            @node-click="nodeClick"
+          ></avue-tree>
+        </div>
+      </div>
+    </div>
+    <div
+      class="boxswai"
+      style="width: 74%; padding-left: 0px; padding-right: 0px"
+    >
+      <div class="boxnei">
+        <div
+          class="marleft10"
+          style="height: 100%; display: flex; flex-direction: column"
+        >
+          <div class="martop20" v-if="true" style="flex: 1">
+            <avue-crud
+              :data="loadData"
+              :option="loadOption"
+              v-model="obj"
+              ref="crud"
+              @selection-change="selectionChange"
+            >qingb
+              <template slot="menuRight">
+                            <el-button
+                              type="primary"
+                              size="small"
+                              plain
+                              @click="quteEle"
+                            >引用元素表单库
+                            </el-button>
+                      
+                          <el-button
+                            size="small"
+                            type="danger"
+                            plain
+                            
+                            @click="handleDelete"
+                          >删除表单
+                          </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
+                        )">编辑元素</el-button>
+                      <el-button  :size="size" :type="type" @click="adjustExcel(row.pkeyId,row.excelId)">调整表单</el-button>
+                      <el-button  :size="size" :type="type" @click="handleEditFormula(row)">编辑公式</el-button>
+                      
+                </template>
+            </avue-crud>
+          </div>
+        </div>
+      </div>
+    </div>
+    <Qute ref="Qute"> </Qute>
+    <Relation ref="Relation" :GLExcelFrom="GLExcelFrom"/>
+    <!-- 编辑元素 -->
+       <!-- 编辑元素 -->
+    <el-dialog
+      title=" "
+      :visible.sync="editElementVisible"
+      fullscreen
+      append-to-body
+      class="full-dialog"
+    >
+      <EditElement
+        :pkeyId="editElementQuery.pkeyId"
+        :excelId="editElementQuery.excelId"
+        :id="editElementQuery.id"
+        :initTableName="editElementQuery.initTableName"
+        :pid="editElementQuery.pid"
+        :wbsid="editElementQuery.wbsid"
+        :nodeid="editElementQuery.nodeid"
+        @hideDialog="editElementVisible = false"
+        v-if="editElementVisible"
+      ></EditElement>
+    </el-dialog>
+      <!-- 调整表单模板 -->
+    <div v-if="excelHtml" class="excelHtml">
+      <dynamicExcel
+        @remove="removeExcel"
+        v-if="excelHtml"
+        :pkeyId="GLExcelFrom.id"
+      />
+    </div>
+<!-- 元素公式 -->
+    <el-dialog
+      title="元素公式"
+      :visible.sync="editEleFormulaVisible"
+      width="800px"
+      append-to-body
+      :close-on-click-modal="false"
+    >
+      <div class="flex mg-b-10">
+        <el-input
+          v-model="formulaInput"
+          placeholder="请输入名称"
+          size="samll"
+          clearable
+          @clear="searchFormulaName"
+        ></el-input>
+        <el-button type="info" class="mg-l-10" @click="searchFormulaName"
+          >搜索</el-button
+        >
+      </div>
+      <el-table
+        :data="editEleListFilter"
+        border
+        style="width: 100%"
+        height="400px"
+      >
+        <el-table-column align="center" prop="eName" label="字段信息">
+        </el-table-column>
+        <el-table-column align="center" label="操作" width="200">
+          <template slot-scope="scope">
+            <el-link
+              :type="scope.row.isSaveFormula == 1 ? 'warning' : 'primary'"
+              @click="toFormulaEdit(scope.row)"
+              >公式配置</el-link
+            >
+            <!-- <el-link
+              class="mg-l-10"
+              type="danger"
+              @click="delEleRowHandle(scope.$index,editEleListFilter)"
+            >删除</el-link> -->
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
+      <!-- 公式 -->
+    <el-dialog
+      title="元素公式"
+      :visible.sync="formulaCompVisible"
+      fullscreen
+      append-to-body
+      class="full-dialog"
+    >
+      <FormulaEdit
+        :wbsid="id"
+        :nodeid="curTreeData.id"
+        :eleid="formulaCurRow.id"
+        :projectid="projectid"
+        @hideDialog="formulaCompVisible = false"
+        v-if="formulaCompVisible"
+      ></FormulaEdit>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  detailExcel,
+  excelType,
+  tabLazytree,
+  wbstree,
+  getWbsTypeList,
+} from "@/api/exctab/excelmodel";
+import {
+  updateBatchNodeTableInfo,
+  selectByNodeTable,
+  selectFormElements,
+} from "@/api/manager/wbstree";
+import {
+  getList,
+  tabLazytreeAll,
+  saveLinkTab,
+  getExcelHtml,
+} from "@/api/exctab/excelmodel"
+import {
+  getDetail,} from "@/api/manager/wbsprivate";
+import Qute from "./qutediaolog/qute.vue";//引入元素库
+import Relation from './qutediaolog/relation.vue'//关联清表
+import EditElement from "@/views/manager/projectinfo/editElement/editElement.vue";//编辑元素
+import dynamicExcel from "./treeTemplate/dynamicExcel.vue";
+import FormulaEdit from "@/views/formula/edit.vue";
+
+export default {
+   components: { dynamicExcel, EditElement, Qute,Relation,FormulaEdit },
+  computed:{
+     ids () {
+      let ids = [];
+      this.selectionList.forEach(ele => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
+    }
+  },
+  data() {
+    return {
+      dialogVisible: false,
+      obj: {},
+      treeData: [
+        {
+          value: 0,
+          label: "一级部门",
+          children: [
+            {
+              value: 1,
+              label: "一级部门1",
+            },
+          ],
+        },
+      ],
+      treeOption: {
+        defaultExpandAll: true,
+        filter: false,
+        addBtn: false,
+        formOption: {
+          labelWidth: 100,
+          column: [
+            {
+              label: "自定义项",
+              prop: "test",
+            },
+          ],
+        },
+        props: {
+          labelText: "标题",
+          label: "label",
+          value: "value",
+          children: "children",
+        },
+      },
+      loadData: [],
+      loadData1: [
+        {
+          tableName: "张三",
+          formatTableType: "男",
+        },
+      ],
+      loadData2: [
+        {
+          tableName: "李四2",
+          formatTableType: "女",
+        },
+      ],
+      loadOption: {
+        height: "auto",
+        calcHeight: 30,
+        tip: false,
+        searchShow: false,
+        searchMenuSpan: 6,
+        border: true,
+        index: true,
+        viewBtn: false,
+        selection: true,
+        editBtn: false,
+        delBtn: false,
+        addBtn: false,
+        menu: true,
+        menuWidth:300,
+
+        dialogClickModal: false,
+        column: [
+          {
+            label: "表单名称",
+            prop: "tableName",
+
+            editDisplay: false,
+            addDisplay: false,
+          },
+          {
+            label: "元素表类型",
+            prop: "formatTableType",
+            // search: true,
+            rules: [
+              {
+                required: true,
+                message: "请输入名称",
+                trigger: "blur",
+              },
+            ],
+          },
+
+          {
+            label: "元素总量",
+            prop: "elementTotal",
+
+            editDisplay: false,
+            addDisplay: false,
+            rules: [
+              {
+                message: "请输入表数量",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "所书方",
+            prop: "formatOwner",
+
+            editDisplay: false,
+            addDisplay: false,
+            rules: [
+              {
+                message: "请输入表数量",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "填报率",
+            prop: "fillRate",
+
+            editDisplay: false,
+            addDisplay: false,
+            rules: [
+              {
+                message: "请输入表数量",
+                trigger: "blur",
+              },
+            ],
+          },
+        ],
+      },
+      selectionList:[],
+      GLExcelFrom: {
+          id: "",
+          name: "",
+          search: "", //搜素框舒服的值
+          ids: "",
+          excelId: "",
+          initTableName: "",
+      },
+      //编辑元素弹窗
+      editElementVisible: false, //编辑元素弹框
+      editElementQuery: {
+        pkeyId: "",
+        excelId: "",
+        id: "",
+        initTableName: "",
+        pid: "",
+        wbsid: "",
+        nodeid: "",
+      }, //
+      excelHtml:false,//调整表单
+      curEleTable: {},//编辑元素公式
+      editEleFormulaVisible: false,//元素公式
+      formulaInput: "",
+      editEleListFilter: [],
+      editEleListAll: [],
+      formulaCurRow: {}, //当前元素
+      formulaCompVisible:false,
+        //#region公式
+      id: "",
+      curTreeData: {},
+      projectid:''
+
+
+    };
+  },
+  created() {
+    this.loadData = this.loadData1;
+  },
+  methods: {
+    nodeClick(data) {
+      if (data.value == 0) {
+        this.loadData = this.loadData1;
+      } else if (data.value == 1) {
+        this.loadData = this.loadData2;
+      }
+      this.$message.success(JSON.stringify(data));
+    },
+    handleClose(done) {
+      this.$confirm("确认关闭?")
+        .then((_) => {
+          done();
+        })
+        .catch((_) => {});
+    },
+    //引用元素表单库
+    quteEle(){
+      this.$refs.Qute.show()
+    },
+    handleDelete () {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          // return remove(this.ids);
+          console.log(this.ids,'this.ids删除');
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    selectionChange (list) {
+    this.selectionList = list;
+    },
+    selectionClear () {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    //关联清表
+     Associationlist(row) {
+       console.log('关联清表');
+       this.$refs.Relation.show()
+      this.GLExcelFrom.name = row.modeId;
+   
+      this.GLExcelFrom.id = row.pkeyId;
+      this.GLExcelFrom.excelId =row.excelId;
+      this.GLExcelFrom.ids = row.id;
+      this.GLExcelFrom.initTableName =row.initTableName;
+      this.GLExcelFrom.excelId=row.excelId
+    },
+       //#region 编辑元素
+    async rightClick(pkeyId, excelId, id, initTableName) {
+      // await this.getExcelHtml2(pkeyId);
+      // console.log('编辑元素');
+      // 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 getExcelHtml2(pkeyId) {
+      const { data: res } = await getExcelHtml({ pkeyId });
+      console.log(res);
+      if (res.code === 200) {
+        localStorage.setItem("editElement", res.data);
+      }
+    },
+      //#region 调整表单
+    adjustExcel(pkeyId, excelId) {
+      this.excelHtml=true
+      // console.log('调整表单');
+      // //调整表单
+      // this.GLExcelFrom.id = pkeyId;
+      // this.getExcelHtml(pkeyId);
+    },
+    handleEditFormula(row) {
+      console.log('公式');
+      this.curEleTable = row;
+      selectFormElements(this.curEleTable.id).then((res) => {
+        this.editEleListFilter = res.data.data;
+        this.editEleListAll = [].concat(this.editEleListFilter);
+      });
+      this.editEleFormulaVisible = true;
+    },
+    //搜索 筛选
+    searchFormulaName() {
+      this.editEleListFilter = this.editEleListAll.filter((ele) => {
+        return ele.eName.indexOf(this.formulaInput) > -1;
+      });
+    },
+   async getExcelHtml(pkeyId) {
+      const { data: res } = await getExcelHtml({ pkeyId });
+      console.log(res);
+      if (res.code === 200) {
+        localStorage.setItem("excelHtml", res.data);
+        this.adjustmentExcel = res.data;
+        this.excelHtml = true;
+      }
+    },
+    removeExcel() {
+      this.excelHtml = false;
+    },
+        //跳转到公式配置页面
+    toFormulaEdit(row) {
+      // this.$router.push({
+      //   path: '/formula/edit',
+      //   query: {
+      //     wbsid: this.id,
+      //     eleid: row.id,
+      //     nodeid:this.curTreeData.id,
+      //     projectid:this.projectid
+      //   }
+      // });
+
+      this.formulaCurRow = row;
+      this.formulaCompVisible = true;
+    },
+    // getNodeDetail(data, node) {
+    //   let parentName = "";
+    //   if (node.parent.data) {
+    //     parentName = node.parent.data.title;
+    //   }
+    //   this.curTreeData = data;
+    //   this.curTreeNode = node;
+    //   this.curTreeData.parentName = parentName;
+    //   getDetail(data.id, this.id, this.projectid).then((res) => {
+    //     res.data.data.parentName = parentName;
+    //     this.tableData = [res.data.data];
+    //     this.nodeDetail = Object.assign({}, res.data.data);
+    //   });
+    //   this.updateNodeTable();
+
+    //   //获取节点展开路径
+    //   this.getExpandedKeys(node);
+    // },
+
+  },
+
+  mounted() {
+    // this.heightss = this.$refs.rulesss.clientHeight
+  },
+};
+</script>
+
+<style scoped lang="scss">
+//调整表单样式
+.excelHtml {
+  position: absolute;
+  z-index: 999999;
+  top: 50px;
+  left: 0px;
+  width: 100%;
+  height: 100%;
+}
+.marleft10 {
+  margin-left: 10px;
+}
+/deep/.el-tree-node__expand-icon {
+  font-size: 16px;
+}
+.colorblue {
+  color: rgb(0, 82, 217);
+}
+
+.treecontent /deep/.el-scrollbar {
+  height: 100%;
+}
+
+.el-scrollbar {
+  height: 100%;
+}
+
+.rightHeader {
+  display: flex;
+  justify-content: flex-start;
+  align-items: top;
+  font-size: 14px;
+  background-color: #fff;
+
+  .excelname {
+    box-sizing: border-box;
+    min-width: 200px;
+    height: 28px;
+    border: 1px solid rgb(220, 220, 220);
+    padding: 0 10px;
+    border-radius: 3px;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+  }
+}
+
+.dialogModel {
+  .dialogBox {
+    .middle {
+      display: flex;
+
+      .left {
+        border: 1px solid rgb(220, 220, 220);
+        border-radius: 3px;
+        height: 500px;
+        width: 49%;
+
+        .select {
+          box-sizing: border-box;
+          display: flex;
+          justify-content: center;
+          padding: 5px 0;
+          border-bottom: 1px solid #e0e0e0;
+        }
+        .leftscroll {
+          height: 450px;
+          overflow-y: scroll;
+        }
+      }
+
+      .right {
+        height: auto;
+        height: 60px;
+        max-height: 500px;
+        margin-left: 2%;
+        // height: 500px;
+        border-radius: 3px;
+        td {
+          box-sizing: border-box;
+          padding: 5px 10px;
+          height: 30px;
+          line-height: 30px;
+        }
+      }
+    }
+  }
+
+  .btbox {
+    margin-top: 20px;
+    display: flex;
+    justify-content: center;
+  }
+}
+
+.rightBox {
+  flex: 1;
+}
+
+.boxswai {
+  height: 100%;
+  box-sizing: border-box;
+  padding-bottom: 10px;
+}
+</style>

+ 179 - 0
src/views/manager/projectinfo/qutediaolog/qute.vue

@@ -0,0 +1,179 @@
+<template>
+<el-dialog
+    title="引用元素表"
+    :visible.sync="dialogVisible"
+    width="70%"
+    append-to-body
+    destroy-on-close
+    custom-class="flow-design-dialog"
+    >
+        <el-container>
+        <el-aside width="200px">
+        <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" ></avue-tree>
+        </el-aside>
+        <el-main>
+            <avue-crud
+            :data="loadData"
+            :option="loadOption"
+            v-model="obj"
+            ></avue-crud>
+        </el-main>
+        </el-container>
+        <span slot="footer" class="dialog-footer">
+            <el-button @click="dialogVisible = false">取 消</el-button>
+            <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+        </span>
+    </el-dialog>
+</template>
+
+<script>
+export default {
+    data() {
+      return {
+        dialogVisible:false,
+        obj: {},
+        treeData:[{
+          value:0,
+          label:'一级部门',
+          children:[
+            {
+              value:1,
+              label:'一级部门1',
+            }
+          ]
+        }],
+      treeOption:{
+        defaultExpandAll:true,
+        filter:false,
+        addBtn:false,
+        formOption:{
+          labelWidth:100,
+          column:[{
+              label:'自定义项',
+              prop:'test'
+          }],
+        },
+        props:{
+          labelText:'标题',
+          label:'label',
+          value:'value',
+          children:'children'
+        }
+      },
+      loadData:[],
+      loadData1: [
+        {
+          tableName: '张三',
+          formatTableType: '男'
+        }
+      ],
+      loadData2: [
+        {
+          tableName: '李四2',
+          formatTableType: '女'
+        }
+      ],
+      loadOption: {
+        height: 'auto',
+        calcHeight: 30,
+        tip: false,
+        searchShow: false,
+        searchMenuSpan: 6,
+        border: true,
+        index: true,
+        viewBtn: false,
+        selection: true,
+        editBtn:false,
+        delBtn:false,
+        addBtn:false,
+        menu:false,
+      
+        dialogClickModal: false,
+        column: [
+          {
+            label: '表单名称',
+            prop: 'tableName',
+           
+            editDisplay: false,
+            addDisplay: false,
+          },
+          {
+            label: "元素表类型",
+            prop: "formatTableType",
+            // search: true,
+            rules: [{
+              required: true,
+              message: "请输入名称",
+              trigger: "blur"
+            }]
+          },
+
+          {
+            label: "元素总量",
+            prop: "elementTotal",
+          
+            editDisplay: false,
+            addDisplay: false,
+            rules: [{
+              message: "请输入表数量",
+              trigger: "blur",
+            }]
+          },
+          {
+            label: "所书方",
+            prop: "formatOwner",
+          
+            editDisplay: false,
+            addDisplay: false,
+            rules: [{
+              message: "请输入表数量",
+              trigger: "blur",
+            }]
+          },
+          {
+            label: "填报率",
+            prop: "fillRate",
+          
+            editDisplay: false,
+            addDisplay: false,
+            rules: [{
+              message: "请输入表数量",
+              trigger: "blur",
+            }]
+          },
+
+        ]
+      },
+      }
+    },
+    created(){
+       this.loadData=this.loadData1;
+    },
+    methods: {
+      nodeClick(data){
+        if(data.value==0){
+          this.loadData=this.loadData1;
+        }else  if(data.value==1){
+          this.loadData=this.loadData2;
+        }
+        this.$message.success(JSON.stringify(data))
+      },
+      handleClose(done) {
+        this.$confirm('确认关闭?')
+          .then(_ => {
+            done();
+          })
+          .catch(_ => {});
+      },
+      show(){
+        this.dialogVisible=true
+      }
+    },
+    
+   
+}
+</script>
+
+<style>
+
+</style>

+ 228 - 0
src/views/manager/projectinfo/qutediaolog/relation.vue

@@ -0,0 +1,228 @@
+<template>
+  <div>
+    <el-dialog
+        title="关联清表"
+        class="excelBox"
+        :visible.sync="GLExcel"
+        width="500px"
+        modal-append-to-body
+        append-to-body
+        @close="GLExcelMD"
+        >
+        <div>
+            <el-select
+            style="width: 400px"
+            v-model="GLExcelFrom.name"
+            placeholder="请选择"
+            @change="changetherr()"
+            >
+            <el-option
+                v-for="(item, key) in GLExcelData"
+                :key="key"
+                :label="item.name"
+                :value="item.id"
+            >
+            </el-option>
+            </el-select>
+            <el-scrollbar style="margin-top: 20px; height: 50vh">
+            <el-input
+                style="width: 400px"
+                v-model.trim="GLExcelFrom.search"
+                placeholder="请输入需要选择的内容"
+            ></el-input>
+            <el-tree
+                :filter-node-method="filterNode222"
+                ref="tree"
+                class="filter-tree"
+                style="margin-top: 10px"
+                :props="GLExcelProps"
+                :data="exceldata"
+                node-key="id"
+                accordion
+                show-checkbox
+                @check="checkchange"
+                v-loading="GLExcelLoading"
+            >
+            </el-tree>
+            </el-scrollbar>
+        </div>
+        <span
+            slot="footer"
+            class="dialog-footer"
+            style="display: flex; justify-content: center; align-items: center"
+        >
+            <el-button @click="GLExcelMD()">取 消</el-button>
+            <el-button
+            style="margin-left: 30px"
+            type="primary"
+            v-throttle="2000"
+            @click="saveLinkTab()"
+            >确 定</el-button
+            >
+        </span>
+        </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  getList,
+  tabLazytreeAll,
+  saveLinkTab,
+  getExcelHtml,
+} from "@/api/exctab/excelmodel";
+export default {
+    props:{
+        GLExcelFrom:Object
+    },
+    data(){
+        return{
+            GLExcel:false,
+            // GLExcelFrom: {
+            //     id: "",
+            //     name: "",
+            //     search: "", //搜素框舒服的值
+            //     ids: "",
+            //     excelId: "",
+            //     initTableName: "",
+            // },
+            exceldata: [], //清表模板
+            GLExcelData: [], //
+            GLExcelLoading: false,
+            GLExcelProps: {
+                label: "name",
+                children: "children",
+                disabled: "hasChildren",
+                isLeaf: function (data) {
+                let tag = false;
+                if (!data.hasChildren) {
+                    tag = true;
+                }
+                if (data.isExistForm == 1) {
+                    tag = true;
+                }
+                return tag;
+                },
+            },
+        }
+    },
+     watch: {
+        "GLExcelFrom.search"(val) {
+        console.log(val);
+        if (this.exceldata) {
+            this.$refs.tree.filter(val);
+        }
+        },
+    },
+    methods:{
+            show(){
+                this.GLExcel=true;
+                console.log(this.GLExcelFrom,'GLExcelFrom');
+                this.getList({
+                    current: 1,
+                    size: 100000,
+                    parentId: 0,
+                });
+                setTimeout(() => {
+                    this.$refs.tree.setCheckedKeys([this.GLExcelFrom.excelId]);
+                }, 2000);
+            },
+           GLExcelMD() {
+                //弹框关闭事件
+                this.GLExcelFrom.name = "";
+                this.GLExcelFrom.search = "";
+                this.GLExcelFrom.id = "";
+                this.exceldata = [];
+                this.$refs.tree.setCheckedKeys([]);
+                this.GLExcel = false;
+            },
+            async tabLazytreeAll() {
+                //清表树信息
+                this.GLExcelLoading = true;
+                const { data: res } = await tabLazytreeAll({
+                    modeId: this.GLExcelFrom.name,
+                    name: this.GLExcelFrom.search,
+                });
+                this.GLExcelLoading = false;
+                console.log(res);
+                if (res.code === 200 && res.msg === "操作成功") {
+                    this.exceldata = res.data;
+             }
+            },
+            changetherr() {
+                //清表类型选择框change事件
+                if (this.GLExcelFrom.name != "") {
+                    this.GLExcelFrom.search = "";
+                    this.tabLazytreeAll();
+                }
+            },
+                   //#region 关联清表
+            async getList(da) {
+                //获取清表模板信息
+                const { data: res } = await getList(da);
+                console.log(res);
+                if (res.code === 200 && res.msg === "操作成功") {
+                    this.GLExcelData = res.data.records;
+                }
+            },
+            filterNode222(value, data) {
+                if (!value) return true;
+                return data.name.indexOf(value) !== -1;
+            },
+            checkchange(data) {
+                //节点选中回调
+                if (this.$refs.tree.getCheckedNodes().length === 0) {
+                    this.$refs.tree.setCheckedKeys([]);
+                } else if (this.$refs.tree.getCheckedNodes().length >= 1) {
+                    this.$refs.tree.setCheckedKeys([data.id]);
+                }
+            },
+            async saveLinkTab() {
+                //保存按钮
+                let checkNodes = this.$refs.tree.getCheckedNodes();
+                if (checkNodes.length > 0) {
+                    let node = checkNodes[checkNodes.length - 1];
+                    if (node.fileType != 3) {
+                    this.$message({
+                        type: "warning",
+                        message: "请先上传Excel表",
+                    });
+                    return;
+                    }
+                    console.log(node.id,'node.id');
+                    console.log(this.GLExcelFrom.id,'this.GLExcelFrom.id');
+                    const { data: res } = await saveLinkTab({
+                    exceTabId: node.id,
+                    tabId: this.GLExcelFrom.id,
+                    });
+                    console.log(res);
+                    if (res.code === 200) {
+                    this.$message({
+                        type: "success",
+                        message: "关联清表成功",
+                    });
+                    // selectByNodeTable刷新表单列表
+                    // this.updateNodeTable();
+                    this.GLExcel = false;
+                    this.rightClick(
+                        this.GLExcelFrom.id,
+                        this.GLExcelFrom.excelId,
+                        this.GLExcelFrom.ids,
+                        this.GLExcelFrom.initTableName
+                    );
+                    }
+                } else {
+                    this.$message({
+                    type: "warning",
+                    message: "请先设置清表",
+                    });
+                }
+            },
+            
+    }
+}
+</script>
+
+<style>
+
+</style>

+ 23 - 7
src/views/manager/projectinfo/tree.vue

@@ -256,6 +256,14 @@
               @click="syncInfoHandle"
               >同步节点参数</el-button
             >
+           <el-button
+            class="el-btn-purple"
+            type="primary"
+            size="medium"
+            icon="el-icon-upload"
+            @click="independent"
+            >独立表单库</el-button
+          >
           </div>
           <template v-if="leftType == 5">
             <div class="mg-b-10">节点信息</div>
@@ -748,7 +756,7 @@
         >
       </span>
     </el-dialog>
-
+<!-- 节点详情 -->
     <el-dialog
       :title="dialogTitle"
       :visible.sync="dialogVisible"
@@ -863,7 +871,7 @@
         >
       </span>
     </el-dialog>
-
+<!-- 创建新的元素表 -->
     <el-dialog
       title="创建新的元素表"
       :visible.sync="eleVisible"
@@ -1050,7 +1058,7 @@
         >
       </span>
     </el-dialog>
-
+<!-- 模板导入 -->
     <el-dialog
       title="模版导入"
       :visible.sync="importVisible"
@@ -1104,7 +1112,7 @@
         <el-button type="primary" @click="importHandle">确 定</el-button>
       </span>
     </el-dialog>
-
+<!-- 编辑元素 -->
     <el-dialog
       :title="(curEleTable.tableName ? curEleTable.tableName : '') + ''"
       :visible.sync="editEleVisible"
@@ -1152,7 +1160,7 @@
         >确 定</el-button> -->
       </span>
     </el-dialog>
-
+<!-- 元素公式 -->
     <el-dialog
       title="元素公式"
       :visible.sync="editEleFormulaVisible"
@@ -1196,7 +1204,7 @@
         </el-table-column>
       </el-table>
     </el-dialog>
-
+<!-- 导入划分 -->
     <el-dialog
       title="导入划分"
       :visible.sync="importTemplateVisible"
@@ -1231,7 +1239,7 @@
         >
       </span>
     </el-dialog>
-
+<!-- 节点参数 -->
     <el-dialog
       title="节点参数"
       :visible.sync="nodeInfoVisible"
@@ -3056,6 +3064,14 @@ export default {
     },
 
     getTypeTreeDetail() {},
+    independent(){
+      console.log('独立表单库');
+      this.$router.push({
+        path: '/project/independent',
+      
+      });
+    }
+
   },
   watch: {
     "GLExcelFrom.search"(val) {

+ 18 - 0
src/views/manager/wbsinfo.vue

@@ -31,6 +31,17 @@
         >删 除
         </el-button>
       </template>
+      <template slot="menuRight">
+        <!-- 新增元素按钮 -->
+        <el-button
+          size="small"
+          style="background-color:#FFA042;color:white;font-weight:bold"
+          plain
+          v-if="permission.wbsinfo_delete"
+          @click="handleElement"
+        >元素库
+        </el-button>
+      </template>
       <template
         slot-scope="{row,index}"
         slot="menu"
@@ -151,6 +162,13 @@ export default {
     }
   },
   methods: {
+    //点击元素库
+    handleElement(){
+      console.log('元素库');
+      this.$router.push({
+        path: '/wbs/element',
+      })
+    },
     rowSave (row, done, loading) {
       add(row).then(() => {
         this.onLoad(this.page);

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

@@ -0,0 +1,616 @@
+<template>
+     <!-- 关联公共WBS模板 -->
+      <el-dialog
+        title="关联公共WBS模板"
+        class="excelBox"
+        :visible.sync="AssociatedPublicTap"
+        modal-append-to-body
+        append-to-body
+        :close-on-click-modal="false"
+      >
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-select
+              style="width: 100%"
+              v-model="GLExcelFrom.name"
+              placeholder="请选择"
+              @change="changetherr()"
+            >
+              <el-option
+                v-for="(item, key) in GLExcelData"
+                :key="key"
+                :label="item.wbsName"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+            <el-scrollbar style="height: 50vh">
+              <div class="flex" style="margin-top: 10px" v-if="isShowInput">
+                <el-input
+                  size="small"
+                  placeholder="输入关键字搜索"
+                  clearable
+                  @clear="clearInput"
+                  v-model="filterText1"
+                >
+                </el-input>
+                <el-button size="small" class="mg-l-10" @click="treeFilter1"
+                  >搜索</el-button
+                >
+              </div>
+              <el-tree
+                v-if="GLExcelFromtag"
+                @node-click="handleNodeClickExcel"
+                ref="tree"
+                class="filter-tree"
+                style="margin-top: 10px"
+                :props="GLExcelProps"
+                :data="exceldata"
+                :load="loadNodeTan"
+                lazy
+                node-key="id"
+                accordion
+                :show-checkbox="activeName == 'add'"
+                :check-strictly="true"
+                :default--checked-keys="selectNodeIds"
+              >
+              </el-tree>
+
+              <el-tree
+                style="width: 100%"
+                ref="treeall1"
+                v-loading="treeloading1"
+                :data="allTreeData1"
+                :props="treeProps1"
+                @node-click="handleNodeClickExcel"
+                node-key="id"
+                :expand-on-click-node="false"
+                :filter-node-method="filterNode1"
+                v-show="GLExcelFromtag1"
+                :show-checkbox="activeName == 'add'"
+                :default--checked-keys="selectNodeIds"
+              >
+              </el-tree>
+            </el-scrollbar>
+          </el-col>
+          <el-col :span="12" v-if="addElementForm.wbsId">
+            <el-tabs v-model="activeName" type="card">
+              <el-tab-pane label="关联元素表" name="link">
+                <el-table
+                  :data="addTableData"
+                  border
+                  style="width: 100%"
+                  class="martop20"
+                >
+                  <el-table-column
+                    prop="tableName"
+                    label="已有元素表名称"
+                    align="center"
+                  >
+                  </el-table-column>
+                  <el-table-column prop="name" label="操作" align="center">
+                    <template slot-scope="scope">
+                      <el-button
+                        type="primary"
+                        size="mini"
+                        style="margin: 0px"
+                        @click="relationMD(scope.row, '关联')"
+                        v-show="!scope.row.checknd"
+                        :loading="scope.row.loading"
+                        >选择关联</el-button
+                      >
+                      <el-button
+                        type="danger"
+                        size="mini"
+                        style="margin: 0px"
+                        @click="relationMD(scope.row, '取消关联')"
+                        v-show="scope.row.checknd"
+                        :loading="scope.row.loading"
+                        >取消关联</el-button
+                      >
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </el-tab-pane>
+              <el-tab-pane label="新增元素表" name="add">
+                <div>
+                  <div class="flexBetween martop20">
+                    <el-input
+                      v-model="addElementForm.nodeName"
+                      placeholder="请输入表名"
+                    ></el-input>
+                    <el-select
+                      class="marleft10"
+                      v-model="addElementForm.tableType"
+                      placeholder="请选择表类型"
+                    >
+                      <el-option
+                        v-for="(item, index) in exceltypeData"
+                        :key="index"
+                        :label="item.dictValue"
+                        :value="item.dictKey"
+                      ></el-option>
+                    </el-select>
+                  </div>
+                  <el-select
+                    style="width: 100%"
+                    class="martop20"
+                    v-model="addElementForm.tableOwner"
+                    placeholder="请选择所属方"
+                  >
+                    <el-option
+                      v-for="(item, index) in ownerTypeList"
+                      :key="index"
+                      :label="item.dictValue"
+                      :value="item.dictKey"
+                    ></el-option>
+                  </el-select>
+                </div>
+              </el-tab-pane>
+            </el-tabs>
+          </el-col>
+        </el-row>
+        <span
+          slot="footer"
+          class="dialog-footer"
+          style="display: flex; justify-content: center; align-items: center"
+        >
+          <el-button @click="AssociatedPublicClose()">取 消</el-button>
+          <el-button
+            style="margin-left: 30px"
+            type="primary"
+            @click="saveElementMD()"
+            >确 定</el-button
+          >
+        </span>
+    </el-dialog>
+</template>
+
+<script>
+import {  getAlltree } from "@/api/manager/wbstree";
+import { getDictionary } from "@/api/system/dict";
+import { dictionarydataType } from "@/api/exctab/editelement";
+import {
+  tabLazytree,
+  getExcelHtmlCol,
+  excelType,
+  submitExcelRelationWbsTreeAndElement,
+  getWbsTypeList,
+  getLazytree,
+  cancelRelation,
+  saveRelation,
+  searchNodeTables,
+  tabLazytreeAll,
+  exctabcellSave,
+  exctabcellRemove,
+  exctabcellUpdate,
+} from "@/api/exctab/excelmodel";
+import { getColByTabId } from "@/api/manager/AdjustForm";
+
+export default {
+    props:{
+        from:Object
+    },
+    data(){
+        return{
+            AssociatedPublicTap:false,
+               //#region 弹框属性
+            GLExcelFrom: {
+                    id: "",
+                    name: "",
+                    search: "", //搜素框舒服的值
+            },
+            GLExcelData: [], //
+            isShowInput:false,
+            filterText1:'',
+            GLExcelFromtag1: false,
+            GLExcelFromtag:false,
+            GLExcelProps: {
+                label: "title",
+                children: "children",
+                isLeaf: function (data) {
+                if (data.hasChildren && data.isExistForm != 1) {
+                    return false;
+                } else if (data.hasChildren && data.isExistForm == 1) {
+                    return true;
+                } else {
+                    return true;
+                }
+                },
+            },
+            exceldata:[],
+            selectNodeIds:[],
+            
+            treeloading1: false,
+            allTreeData1: [],
+            treeProps1: {
+                label: "title",
+                children: "children",
+                isLeaf: "hasChildren",
+            },
+              
+            addElementForm: {
+                    id: "",
+                    initTableName: "",
+                    nodeName: "",
+                    tableType: "",
+                    tableOwner: "",
+                    wbsId: "",
+                    parentId: "",
+            },
+            nodeTypelist:[],
+            ownerTypeList: [],
+            
+            addTableData: [], //新增元素信息表
+            activeName: "link",
+            dataType: [],
+            addElement: false,
+            exceltypeData:[]
+     
+        }
+    },
+    methods:{
+            show(){
+                console.log(this.from);
+                this.AssociatedPublicTap=true;
+                this.getWbsTypeList();
+                console.log(this.from,'点击节点数据');
+                this.excelType();
+                this.getOwnerTypelist();
+                this.getColByTabId()
+                 
+
+               
+                
+            },
+             addElementMD() {
+                //新增元素信息表按钮
+                this.excelType();
+                this.addElement = true;
+            },
+            async excelType() {
+                //清表类型
+                const { data: res } = await excelType({ code: "sys_excltab_type" });
+                console.log(res);
+                if (res.code === 200) {
+                    this.exceltypeData = res.data;
+                }
+            },
+            async getWbsTypeList() {
+                //获取清表模板信息
+                const { data: res } = await getWbsTypeList({ wbstype: 1 });
+
+                if (res.code === 200 && res.msg === "操作成功") {
+                    this.GLExcelData = res.data;
+                }
+            },
+            changetherr(item) {
+                console.log(item, "关联item");
+                console.log(this.GLExcelFrom.name, "name");
+                //下拉框change事件
+                this.GLExcelFromtag = false;
+                this.GLExcelFromtag1 = false;
+                this.filterText1 = "";
+                if (this.GLExcelFrom.name != "") {
+                    this.GLExcelFrom.search = "";
+                    this.exceldata = [];
+                    this.addTableData = [];
+                    this.isShowInput = false;
+                    this.addElementForm.wbsId = "";
+                    this.$nextTick(() => {
+                    this.GLExcelFromtag = true;
+                    });
+                }
+            },
+            clearInput() {
+            (this.selectedId = ""),
+                (this.GLExcelFromtag1 = false),
+                (this.GLExcelFromtag = true);
+                    if( this.$refs.tree){
+                    this.nodeIds = this.$refs.tree.getCheckedKeys();
+                    }
+                    if(this.$refs.treeall1){
+                        this.nodeIds1 = this.$refs.treeall1.getCheckedKeys();
+                    }   
+                    this.selectNodeIds=this.uniqueArr(this.nodeIds,this.nodeIds1 )
+                console.log(this.selectNodeIds,'this.selectNodeIds111111');
+                    // this.$refs.tree.setCheckedKeys(this.selectNodeIds)
+                    
+                    this.$nextTick(()=>{
+                    this.$refs.tree.setCheckedKeys(this.selectNodeIds)
+                    })
+
+            },
+            treeFilter1() {
+                if (this.filterText1) {
+                        if( this.$refs.tree){
+                        this.nodeIds = this.$refs.tree.getCheckedKeys();
+                        }
+                        if(this.$refs.treeall1){
+                            this.nodeIds1 = this.$refs.treeall1.getCheckedKeys();
+                        }
+                        
+                    this.selectNodeIds=this.uniqueArr(this.nodeIds,this.nodeIds1 )
+                    this.$refs.treeall1.setCheckedKeys(this.selectNodeIds)
+                    console.log(this.selectNodeIds,'this.selectNodeIds');
+                    this.GLExcelFromtag1 = true;
+                    this.GLExcelFromtag = false;
+                    this.treeloading1 = true;
+                    console.log(this.selectedId, "selectedId");
+                    console.log(this.GLExcelFrom.name, "this.GLExcelFrom.name");
+                    // tabLazytreeAll({
+                    //   modeId: this.GLExcelFrom.name,
+                    //   name: "",
+                    // })
+                    getAlltree("000000", 1, this.GLExcelFrom.name).then((res) => {
+                    this.treeloading1 = false;
+                    this.allTreeData1 = res.data.data;
+                    console.log(this.exceldata, "this.exceldata");
+                    console.log(this.GLExcelFromtag, "this.GLExcelFromtag");
+
+                    this.$nextTick(() => {
+                        console.log("过滤2", this.filterText1);
+                        this.$refs.treeall1.filter(this.filterText1);
+                    });
+                    });
+                }
+            },
+            
+            handleNodeClickExcel(data) {
+                console.log(data,'点击节点事件');
+                //点击节点事件
+                this.addElementForm.wbsId = this.GLExcelFrom.name;
+                this.addElementForm.parentId = data.id;
+                //this.selectByNodeTable(data.id)
+                this.searchNodeTables(data.id);
+            },
+             //#region
+     
+            async loadNodeTan(node, resolve) {
+                //懒加载
+                console.log(node);
+                this.selectedId = node.data.id;
+                if (node.level === 0) {
+                    return resolve(await this.getLazytree(0));
+                } else {
+                    return resolve(await this.getLazytree(node.data.id));
+                }
+            },
+            filterNode1(value, data) {
+                if (!value) return true;
+                return data.title.indexOf(value) !== -1;
+            },
+            getOwnerTypelist() {
+                    if (this.ownerTypeList.length > 1) {
+                        return;
+                    }
+                    getDictionary({
+                        code: "owner_type",
+                    }).then((res) => {
+                        res.data.data.forEach((element) => {
+                        element.dictKey = Number(element.dictKey);
+                        });
+                        this.ownerTypeList = res.data.data;
+                    });
+            },
+             relationMD(row, type) {
+                //关联取消关联
+                row.loading = true;
+                if (type == "关联") {
+                    saveRelation(row.id, this.from.id, this.tableData)
+                    .then(() => {
+                        row.checknd = true;
+                        row.isLinkTable = 2;
+                    })
+                    .finally(() => {
+                        row.loading = false;
+                    });
+                } else {
+                    cancelRelation({
+                    id: row.id,
+                    excelTabId: this.from.id,
+                    })
+                    .then(() => {
+                        row.checknd = false;
+                        row.isLinkTable = 1;
+                    })
+                    .finally(() => {
+                        row.loading = false;
+                    });
+                }
+            },
+            AssociatedPublicClose() {
+                console.log("AssociatedPublicClose");
+                //关联公共WBS模板关闭事件
+                this.addElementForm = {
+                  id: "",
+                  initTableName: "",
+                  nodeName:"",
+                  tableType: '',
+                  tableOwner: '',
+                  wbsId: '',
+                  parentId: '',
+                }
+                this.GLExcelFrom = {
+                  name: '',
+                  search: ''
+                }
+                this.exceldata = []
+                this.addElement = false
+
+                //清理之前填写的数据
+                this.addElementForm.wbsId = "";
+                // this.addElementForm.tableType = '';
+                this.addElementForm.tableOwner = "";
+
+                if (this.$refs.tree) {
+                    this.$refs.tree.setCheckedKeys([]);
+                    this.$refs.tree.setCurrentKey(null);
+                }
+
+                this.addTableData = [];
+                this.AssociatedPublicTap = false;
+            },
+            saveElementMD() {
+                //保存按钮
+                if (this.addElementForm.wbsId) {
+                    console.log(this.tableData,'this.tableData');
+                    if (this.activeName == "link") {
+                    this.submitExcelRelationWbsTreeAndElement({
+                        excelTabId: this.from.id,
+                        elementList: this.tableData,
+                        submitStatus: 1,
+                    });
+                    } else {
+                    if (
+                        this.addElementForm.nodeName &&
+                        this.addElementForm.tableType &&
+                        this.addElementForm.tableOwner
+                    ) {
+                        // let nodeIds = this.$refs.tree.getCheckedKeys();
+                        // let nodeIds1 = this.$refs.treeall1.getCheckedKeys();
+                        // console.log(nodeIds,'nodeIds');
+                        // console.log(nodeIds1,'nodeIds1');
+                        if( this.$refs.tree){
+                        this.nodeIds = this.$refs.tree.getCheckedKeys();
+                        }
+                        if(this.$refs.treeall1){
+                        this.nodeIds1 = this.$refs.treeall1.getCheckedKeys();
+                        }
+                        
+                        this.selectNodeIds=this.uniqueArr(this.nodeIds,this.nodeIds1 )
+                        console.log(this.selectNodeIds,'去重的数组');
+                    
+                        if (this.selectNodeIds.length < 1) {
+                        this.$message({
+                            type: "warning",
+                            message: "至少勾选一个节点",
+                        });
+                        return;
+                        }
+
+                        this.submitExcelRelationWbsTreeAndElement({
+                        nodeName: this.addElementForm.nodeName,
+                        tableType: this.addElementForm.tableType,
+                        tableOwner: this.addElementForm.tableOwner,
+                        wbsId: this.addElementForm.wbsId,
+                        elementList: this.tableData,
+                        nodeIds: this.selectNodeIds,
+                        excelTabId: this.from.id,
+                        submitStatus: 2,
+                        });
+                    } else {
+                        this.$message({
+                        type: "warning",
+                        message: "请填写和选择新增的表名,表类型,表所属方",
+                        });
+                    }
+                    }
+                } else {
+                    this.$message({
+                    type: "warning",
+                    message: "请先选择WBS树节点表单",
+                    });
+                }
+                this.activeName="link"
+            },
+            async getLazytree(parentId) {
+                //清表树信息
+                const { data: res } = await getLazytree({
+                    parentId: parentId,
+                    wbsId: this.GLExcelFrom.name,
+                    wbsType: "1",
+                });
+                console.log(res);
+                if (res.code === 200 && res.msg === "操作成功") {
+                    this.isShowInput = true;
+                    console.log(this.isShowInput, " this.isShowInput");
+                    res.data.forEach((val) => {
+                    val.isExistForm = !!val.isExistForm;
+                    });
+                    return res.data;
+                } else {
+                    return [];
+                }
+            },
+                //查看节点下已关联的元素表信息
+            searchNodeTables(id) {
+                searchNodeTables(id, this.from.id).then((res) => {
+                    if (res.data.data.length > 0) {
+                    res.data.data.forEach((val) => {
+                        if (val.isLinkTable == 2) {
+                        val.checknd = true;
+                        } else {
+                        val.checknd = false;
+                        }
+                        val.loading = false;
+                    });
+                    this.addTableData = res.data.data;
+                    } else {
+                    this.addTableData = [];
+                    }
+                });
+            },
+             //数组去重
+            uniqueArr(arr1, arr2) {
+                //合并两个数组
+                arr1.push(...arr2)//或者arr1 = [...arr1,...arr2]
+                //去重
+                let arr3 = Array.from(new Set(arr1))//let arr3 = [...new Set(arr1)]
+                return arr3
+            },
+            async dictionarydataType() {
+                //数据类型字典
+                const { data: res } = await dictionarydataType();
+                console.log(res);
+                if (res.code == 200) {
+                    res.data.forEach((element) => {
+                    element.dictKey = Number(element.dictKey);
+                    });
+                    this.dataType = res.data;
+                }
+            },
+             async submitExcelRelationWbsTreeAndElement(da) {
+                 console.log(da,'新增元素信息表');
+                //保存接口
+                da.elementList.forEach((ele) => {
+                    ele.eName = ele.textInfo;
+                    ele.eType = ele.textElementType;
+                    ele.eAllowDeviation = ele.textDeviation;
+                });
+                const { data: res } = await submitExcelRelationWbsTreeAndElement(da);
+                console.log(res);
+                if (res.code == 200) {
+                    this.$message({
+                    type: "success",
+                    message: "设置成功",
+                    });
+                    this.AssociatedPublicTap = false;
+                    this.AssociatedPublicClose();
+                }
+            },
+            async getColByTabId() {
+                //获取字段信息
+                // const { data: res } = await getColByTabId({tabId: this.from.id });
+               
+                const { data: res } = await getColByTabId({tabId: '1537614072773054466' });
+                console.log(res);
+                if (res.code === 200) {
+                    res.data.forEach((element) => {
+                    //element.eName = element.textInfo;
+                    if (element.textElementType < 1) {
+                        element.textElementType = 1;
+                    }
+                    });
+                    this.tableData = res.data;
+                    console.log(this.tableData,'获取字段信息');
+                }
+            },
+
+    }
+}
+</script>
+
+<style>
+
+</style>

+ 1059 - 0
src/views/manager/wbsinfo/element.vue

@@ -0,0 +1,1059 @@
+<template>
+  <div
+    style="height:100%;"
+    class="flexStar"
+  >
+    <div
+      class="boxswai"
+      style="width:26%;padding-left:0px;"
+    >
+      <div class="boxnei" style="display: flex;flex-direction: column;"> 
+        <div style="overflow: auto;flex:1">
+        <el-tree
+          style="display: inline-block;min-width: 100%;"
+          ref="trees"
+          :loading="loading"
+          :load="treeLoad"
+          lazy
+          :data="data"
+          :props="defaultProps"
+          @node-click="nodeClick"
+          node-key="id"
+          :expand-on-click-node="false"
+          v-show="!allTreeShow"
+        >
+          <span
+            class="custom-tree-node"
+            slot-scope="{ data ,node }"
+            @mouseover.stop="mouseOver(data)"
+            @mouseleave.stop="mouseLeave(data)"
+            style="box-sizing: border-box;padding-right:70px!important;;"
+          >
+            <div style="width:100%;">
+              <span style="text-overflow: ellipsis;"> {{ data.name }} </span>
+              <!-- <span> {{ node}} </span> -->
+              <!-- 添加 -->
+          
+            </div>
+          </span>
+        </el-tree>
+   
+        </div>
+      </div>
+    </div>
+    <div
+      class="boxswai"
+      style="width:74%;padding-left:0px;padding-right:0px;"
+    >
+      <div class="boxnei">
+        <div
+          class="marleft10"
+          style="height:100%;
+          display: flex;flex-direction: column;"
+        >
+          <!-- 上传、删除、下载操作栏 -->
+          <div
+            class="rightHeader"
+            v-show="from.checkd"
+          > 
+          </div>
+
+          <el-empty
+            style="height:80%;"
+            v-show="false"
+            description="该目录为根目录没有EXCEL文件"
+          ></el-empty>
+          <div
+            class="martop20"
+            v-if="true"
+            style="flex:1;"
+          >
+              <avue-crud ref="crud"
+                  :option="elemntOption"
+                  :page.sync="page"
+                  :table-loading="elementloading"
+                  @on-load="getList"
+                  @row-update="rowUpdate"
+              
+                  @refresh-change="refreshChange"
+                  @selection-change="selectionChange"
+                  v-model="elemtform"
+                  :data="elemtData">
+
+                  <template slot="menuRight">
+                          <el-button
+                            type="danger"
+                            size="small"
+                            icon="el-icon-delete"
+                            plain
+                          
+                            @click="handleDelete"
+                          >删除元素表
+                          </el-button>
+                    
+                        <el-button
+                          size="small"
+                          type="primary"
+                          plain
+                          
+                          @click="editele"
+                        >编辑表单
+                        </el-button>
+                  </template>
+                  <template slot-scope="{type,size,row}" slot="menu">
+                      <el-button  :size="size" :type="type" @click="distribution(row)">分配节点</el-button>
+                      <el-button  :size="size" :type="type" @click="handleEditFormula(row)">公式配置</el-button>
+                    <el-button  :size="size" :type="type" @click="editElement(row)">编辑元素</el-button>
+                  </template>
+                </avue-crud>
+          </div>
+        </div>
+      </div>
+    </div>
+   
+    <!-- 编辑元素表单信息 -->
+    <el-dialog
+      title="编辑元素表单信息"
+      :visible.sync="editElementFormTag"
+      width="60%"
+      :modal-append-to-body="false"
+    >
+      <div>
+        <el-table
+          :data="formDatass"
+          border
+          style="width: 100%"
+        >
+          <el-table-column
+            prop="tableName"
+            label="表名"
+          >
+            <template slot-scope="scope">
+              <el-input
+                v-model="scope.row.tableName"
+                placeholder="请输入表名称"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="tableType"
+            label="表类型"
+          >
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.tableType"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="(item,key) in tableTypelist"
+                  :key="key"
+                  :label="item.dictValue"
+                  :value="item.dictKey"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="tableOwner"
+            label="所属方"
+          >
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.tableOwner"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="(item,key) in ownerTypeList"
+                  :key="key"
+                  :label="item.dictValue"
+                  :value="item.dictKey"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="fillRate"
+            label="填报率"
+          >
+            <template slot-scope="scope">
+              <el-input
+                v-model="scope.row.fillRate"
+                placeholder="请输入填报率"
+              ></el-input>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <span
+        slot="footer"
+        class="dialog-footer"
+      >
+        <el-button @click="editElementFormTag = false">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="editeditElementFormMF()"
+        >确 定</el-button>
+      </span>
+    </el-dialog>
+    <!-- 公式配置 -->
+    <el-dialog
+      title="元素公式"
+      :visible.sync="editEleFormulaVisible"
+      width="800px"
+      append-to-body
+      :close-on-click-modal="false"
+    >
+      <div class="flex mg-b-10">
+        <el-input
+          v-model="formulaInput"
+          placeholder="请输入名称"
+          size="samll" clearable @clear="searchFormulaName"
+        ></el-input>
+        <el-button type="info" class="mg-l-10" @click="searchFormulaName">搜索</el-button>
+      </div>
+      <el-table
+        :data="editEleListFilter"
+        border
+        style="width: 100%"
+        height="400px"
+      >
+        <el-table-column
+          align="center"
+          prop="eName"
+          label="元素名称"
+        >
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="操作"
+          width="200"
+        >
+          <template slot-scope="scope">
+            <el-link
+              :type="scope.row.isSaveFormula == 1?'warning':'primary'"
+              @click="toFormulaEdit(scope.row)"
+            >公式配置</el-link>
+            <el-link
+              class="mg-l-10"
+              type="danger"
+              @click="delEleRowHandle(scope.$index,editEleListFilter)"
+            >删除</el-link>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
+     <!-- 公式 -->
+    <el-dialog
+      title="元素公式"
+      :visible.sync="formulaCompVisible"
+      fullscreen
+      append-to-body
+      class="full-dialog"
+    >
+      <FormulaEdit
+        :wbsid="id"
+        :nodeid="curTreeData.id"
+        :eleid="formulaCurRow.id"
+        :projectid="projectid"
+        @hideDialog="formulaCompVisible = false"
+        v-if="formulaCompVisible"
+      ></FormulaEdit>
+    </el-dialog>
+  <!-- 关联公共WBS模板 -->
+    <PublicWbs  ref="PublicWbs" :from="from"/>
+    <!-- 编辑元素 -->
+     <el-dialog
+      :title="(curEleTable.tableName?curEleTable.tableName:'')+'  元素编辑'"
+      :visible.sync="editEleVisible"
+      width="80%"
+      append-to-body
+      :close-on-click-modal="false"
+    >
+      <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
+      <el-table
+        :data="editEleList"
+        border
+        style="width: 100%"
+        height="400px"
+      >
+        <el-table-column
+          align="center"
+          type="index"
+          width="50"
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          prop="eName"
+          label="元素名称"
+        >
+          <template slot="header">
+            <i class="required"></i>
+            <span>元素名称</span>
+          </template>
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.eName"
+              size="small"
+              placeholder="请输入内容"
+            ></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          prop="eType"
+          label="数据类型"
+          width="120"
+        >
+          <template slot="header">
+            <i class="required"></i>
+            <span>数据类型</span>
+          </template>
+          <template slot-scope="scope">
+            <el-select
+              v-model="scope.row.eType"
+              @change="setDefaultLength(scope.row)"
+              size="small"
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="item in dataTypeList"
+                :key="item.id"
+                :label="item.dictValue"
+                :value="item.dictKey"
+              ></el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          prop="eLength"
+          label="长度"
+          width="120"
+        >
+          <template slot="header">
+            <i class="required"></i>
+            <span>长度</span>
+          </template>
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.eLength"
+              size="small"
+              placeholder="请输入内容"
+            ></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          prop="eAllowDeviation"
+          label="允许偏差值"
+        >
+          <template slot-scope="scope">
+            <div class="flex">
+              <el-select
+                v-model="scope.row.allow"
+                size="small"
+                placeholder="请选择"
+                style="width:120px"
+              >
+                <el-option
+                  :key="1"
+                  label="-"
+                  value="-"
+                ></el-option>
+                <el-option
+                  :key="2"
+                  label=">"
+                  value=">"
+                ></el-option>
+                <el-option
+                  :key="3"
+                  label="<"
+                  value="<"
+                ></el-option>
+                <el-option
+                  :key="4"
+                  label="≥"
+                  value="≥"
+                ></el-option>
+                <el-option
+                  :key="5"
+                  label="≤"
+                  value="≤"
+                ></el-option>
+                <el-option
+                  :key="6"
+                  label="±"
+                  value="±"
+                ></el-option>
+                <el-option
+                  :key="7"
+                  label="【】"
+                  value="【】"
+                ></el-option>
+              </el-select>
+              <el-input
+                v-model="scope.row.deviation"
+                size="small"
+                placeholder="请输入内容"
+              ></el-input>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          prop="eInspectionMethod"
+          label="检查方法和频率"
+        >
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.eInspectionMethod"
+              size="small"
+              placeholder="请输入内容"
+            ></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="操作"
+          width="120"
+        >
+          <template slot="header">
+            <el-button
+              @click="addEleRow(editEleList)"
+              type="text"
+              icon="el-icon-circle-plus-outline"
+              class="text-icon"
+            ></el-button>
+          </template>
+          <template slot-scope="scope">
+            <el-button
+              v-if="scope.row.id"
+              icon="el-icon-remove-outline"
+              type="text"
+              @click="delEleRowHandle(scope.$index,editEleList)"
+              class="text-icon text-icon-danger"
+            ></el-button>
+            <div
+              class="flex"
+              v-else
+            >
+              <el-button
+                @click="saveNewEle(scope.row)"
+                type="mini"
+              >保存</el-button>
+              <el-button
+                icon="el-icon-remove-outline"
+                type="text"
+                @click="delEleRowHandle(scope.$index,editEleList)"
+                class="text-icon text-icon-danger"
+              ></el-button>
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <span
+        slot="footer"
+        class="dialog-footer"
+      >
+        <el-button @click="editEleVisible = false">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="saveEles"
+        >确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+  
+</template>
+
+<script>
+import { detailExcel, excelType, tabLazytree,  wbstree, getWbsTypeList,} from '@/api/exctab/excelmodel';
+import {updateBatchNodeTableInfo,selectByNodeTable,selectFormElements} from "@/api/manager/wbstree";
+import FormulaEdit from "@/views/formula/edit.vue";
+import PublicWbs from './PublicWbs.vue'
+import { searchNodeTables, } from "@/api/exctab/excelmodel";
+
+export default {
+  components:{
+    FormulaEdit,
+    PublicWbs
+  },
+  data () {
+    return {
+      editElementFormTag:false,//编辑元素
+      formDatass: [],
+      selectionList:[],
+       page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 2
+      },
+      formelemtfoelemtformrm: {},
+      elementloading: false,
+      elemtData:[
+        {
+          tableName:'张三',
+          sex:'男',
+          id:1
+        }, {
+          tableName:'李四',
+          sex:'女',
+          id:2
+        }
+      ],
+      elemntOption: {
+        height: 'auto',
+        calcHeight: 30,
+        tip: false,
+        searchShow: false,
+        searchMenuSpan: 6,
+        border: true,
+        index: true,
+        viewBtn: false,
+        selection: true,
+        editBtn:false,
+        delBtn:false,
+        addBtn:false,
+        dialogClickModal: false,
+        column: [
+          {
+            label: '表单名称',
+            prop: 'tableName',
+           
+            editDisplay: false,
+            addDisplay: false,
+          },
+          {
+            label: "元素表类型",
+            prop: "formatTableType",
+            // search: true,
+            rules: [{
+              required: true,
+              message: "请输入名称",
+              trigger: "blur"
+            }]
+          },
+
+          {
+            label: "元素总量",
+            prop: "elementTotal",
+          
+            editDisplay: false,
+            addDisplay: false,
+            rules: [{
+              message: "请输入表数量",
+              trigger: "blur",
+            }]
+          },
+          {
+            label: "所书方",
+            prop: "formatOwner",
+          
+            editDisplay: false,
+            addDisplay: false,
+            rules: [{
+              message: "请输入表数量",
+              trigger: "blur",
+            }]
+          },
+          {
+            label: "填报率",
+            prop: "fillRate",
+          
+            editDisplay: false,
+            addDisplay: false,
+            rules: [{
+              message: "请输入表数量",
+              trigger: "blur",
+            }]
+          },
+
+        ]
+      },
+      curEleTable:{},
+      eleReg: /(-|>|<|≥|≤|±|【】)?([^≥≤±【】]*)/,
+      editEleList:[],
+      editEleListAll:[],
+      editEleFormulaVisible:false,
+      editEleListFilter:[],
+      excelId:'',
+      treeNode: {},
+      //#region 鼠标
+      leftTRee: '',//左侧树ID
+      threessW: 400,
+      //#endregion
+      heightss: '',//
+      loading: false,//懒加载
+      data: [],//清表模板
+      filterText:"",//搜索关键字
+      allTreeShow:false,//是否显示整棵树
+      treeloading:false,
+      defaultProps: {
+        children: "children",
+        isLeaf: function (data) {
+          return !data.hasChildren || (data.isExistForm == 1);
+        },
+      },
+      wbsdata: [],//wbs模板
+      //#region 右侧数据
+      from:{
+        checkd:false
+      },
+      rules: {
+        nodeName: [
+          { required: true, message: '请输入清表名称', trigger: 'blur' },
+        ],
+        tabType: [
+          { required: true, message: '请选择清表类型', trigger: 'blur' },
+        ],
+      },
+      wbsform: {
+        id: '',
+        wbsType: '',
+        wbsName: '',
+      },//wbs树选中的值
+      tableData: [],//右侧表数据
+      wbsmiddle: false,//选择wbs模板那块是否有
+      tableList: [],//进行处理的wbs关联表
+      exceltypeData: [],//清表类型枚举
+      wbsmodel: [],//wbs模板名称枚举
+      //#endregion
+
+      saveExcelLoad:false,
+      filterText1: "",
+      addTableData:[],
+      //编辑元素
+      editEleVisible:false,
+      formulaInput:"",//公式配置
+      formulaCompVisible: false, //公式弹框
+      formulaCurRow: {}, //当前元素
+      id:'',
+      curTreeData:{},
+      projectid:""
+
+    }
+  },
+  computed:{
+     ids () {
+      let ids = [];
+      this.selectionList.forEach(ele => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
+    }
+  },
+  methods: {
+      currentChange (currentPage) {
+        this.page.currentPage = currentPage;
+      },
+      sizeChange (pageSize) {
+        this.page.pageSize = pageSize;
+      },
+      selectionChange (list) {
+      this.selectionList = list;
+      },
+      selectionClear () {
+        this.selectionList = [];
+        this.$refs.crud.toggleSelection();
+      },
+     getList () {
+      // this.elementloading = true;
+      const data = Object.assign({
+        pageNum: this.page.currentPage,
+        pageSize: this.page.pageSize,
+      }, this.params)
+      this.data = [];
+      // getList(data).then(res => {
+      //   const data = res.data.data
+      //   this.loading = false;
+      //   this.page.total = data.total;
+      //   const result = data.list;
+      //   this.data = result;
+      // })
+    },
+
+
+    refreshChange () {
+      this.getList();
+      this.$message.success('刷新成功')
+    },
+     onLoad (page, params = {}) {
+      this.loading = true;
+      // getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+      //   const data = res.data.data;
+      //   this.page.total = data.total;
+      //   this.data = data.records;
+      //   this.loading = false;
+      //   this.selectionClear();
+      // });
+    },
+    handleDelete () {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          // return remove(this.ids);
+          console.log(this.ids,'this.ids删除');
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    //编辑元素表单信息
+   
+    editElement (row) {
+      console.log(row,'row');
+      this.curEleTable = row;
+      selectFormElements(this.curEleTable.initTableId).then((res) => {
+        res.data.data.forEach((element) => {
+          this.eleReg.exec(element.eAllowDeviation);
+          //console.log(RegExp.$1)
+          //console.log(RegExp.$2)
+          element.allow = RegExp.$1 ? RegExp.$1 : '';
+          element.deviation = RegExp.$2 ? RegExp.$2 : '';
+        })
+        this.editEleList = res.data.data;
+      })
+      this.editEleVisible = true;
+    },
+    //分配节点
+    distribution(row){
+      console.log('分配节点');
+      this.$refs.PublicWbs.show();
+      this.from.id=row.id
+      
+      // this.AssociatedPublicTap = true;
+    },
+     handleEditFormula (index, row) {
+      // this.curEleTable = row;
+      // selectFormElements(this.curEleTable.initTableId).then((res) => {
+
+      //   this.editEleListFilter = res.data.data;
+      //   this.editEleListAll = [].concat(this.editEleListFilter);
+      // })
+      this.editEleFormulaVisible = true;
+    },
+     //搜索 筛选
+    searchFormulaName(){
+      this.editEleListFilter = this.editEleListAll.filter((ele)=>{
+        return ele.eName.indexOf(this.formulaInput) > -1;
+      })
+    },
+        //跳转到公式配置页面
+    toFormulaEdit(row) {
+      // this.$router.push({
+      //   path: '/formula/edit',
+      //   query: {
+      //     wbsid: this.id,
+      //     eleid: row.id,
+      //     nodeid:this.curTreeData.id,
+      //     projectid:this.projectid
+      //   }
+      // });
+
+      this.formulaCurRow = row;
+      this.formulaCompVisible = true;
+    },
+    editele(){
+      console.log('编辑元素表单信息');
+      // this.editElementFormTag=true
+        console.log('编辑元素表单信息');
+        if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+       if (this.elemtData.length) {
+        let da = []
+        this.formDatass = [...this.selectionList]
+        this.formDatass.forEach(val => {
+          da.push({
+            tableType: val.tableType - 0,
+            tableOwner: val.tableOwner - 0,
+            id: val.id,
+            tableName: val.tableName,
+            fillRate: val.fillRate,
+          })
+        })
+        this.formDatass = da
+        this.editElementFormTag = true
+      }
+    },
+    editeditElementFormMF () {//保存按钮
+      let da = []
+      let tag = true
+      this.formDatass.forEach(val => {
+        if (!val.tableName || !val.tableType || !val.tableOwner) {
+          tag = false
+          return
+        } else {
+          da.push({
+            id: val.id,
+            nodeName: val.tableName,
+            tableType: val.tableType,
+            tableOwner: val.tableOwner,
+            fillRate: val.fillRate,
+          })
+        }
+
+      })
+      if (tag) {
+        this.updateBatchNodeTableInfo(da)
+      } else {
+        this.$message({
+          type: 'success',
+          message: '请填写完整元素表单的所有信息!',
+        })
+      }
+    },
+    async updateBatchNodeTableInfo (da) {//共有编辑元素
+      const { data: res } = await updateBatchNodeTableInfo(da)
+      //console.log(res);
+      if (res.code == 200) {
+        this.editElementFormTag = false
+        this.updateNodeTable()
+      }
+    },
+     updateNodeTable () {
+      selectByNodeTable(this.curTreeData.id).then((res) => {
+        if (res.data.data.length) {
+          this.elemtData = res.data.data;
+        } else {
+          this.elemtData = [];
+        }
+      })
+    },
+
+
+    //#region 接口
+    async tabLazytree (parentId, modeId) {//清表树
+      const { data: res } = await tabLazytree({ parentId, modeId })
+      console.log(res);
+      if (res.code === 200) {
+        return res.data
+      }
+    },
+    async detailExcel (id) {//获取列表信息
+
+      const { data: res } = await detailExcel({ id })
+      console.log(res);
+      if (res.code === 200) {
+        this.from.id = res.data.id
+        this.from.extension = res.data.extension  //文件名称
+        this.from.fileUrl = res.data.fileUrl      //文件路径
+        let routeUrl = res.data.fileUrl
+        let pSrc = routeUrl + '?r=' + new Date()
+        this.excelSrc = 'http://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(pSrc);
+        // //导入模板名称
+        // this.from.import={}
+      }
+    },
+  
+    async excelType () {//清表类型
+      const { data: res } = await excelType({ code: 'sys_excltab_type' })
+      console.log(res);
+      if (res.code === 200) {
+        res.data.forEach(element => {
+          element.dictKey = Number(element.dictKey)
+        });
+        this.exceltypeData = res.data
+      }
+    },
+    // async wbstree () {//wbs树懒加载
+    //   this.loading = true;
+    //   const { data: res } = await wbstree({ parentId: 0, wbsId: this.excelForm.wbsId, wbsType: this.excelForm.wbsType })
+    //   console.log(res);
+    //   this.loading = false
+    //   if (res.code === 200) {
+    //     res.data.forEach((val) => {
+    //       if (!val.hasChildren) {
+    //         val.leaf = true
+    //       }
+    //     })
+    //     this.wbsdata = res.data
+    //   }
+    // },
+
+
+    //#region  外层左侧事件
+    mouseLeave (data) {
+      if (data.moreShow) {
+        this.$set(data, 'moreShow', false)
+      }
+    },
+    mouseOver (data) {
+      if (!data.moreShow) {
+        this.$set(data, 'moreShow', true)
+      }
+    },
+    async treeLoad (node, resolve) {
+      let id = node.data.id
+      if (node.level == 0) {
+        id = 0
+      }
+      let das = await this.tabLazytree(id, this.$route.params.id)
+      return resolve(das)
+    },
+    nodeClick (data) {//外层树结构
+    console.log(data,'treedata');
+      this.from.import=""
+      if (data.hasChildren == false) {
+        this.from.checkd = true
+      } else if (data.fileType == 3) {
+        this.from.checkd = true
+      } else {
+        this.from.checkd = false
+      }
+      if (this.from.checkd) {
+        this.detailExcel(data.id)
+      } else {
+        this.from = {
+          checkd: false,//判断是否可以进行上传、重新上传excel
+          id: '',//清表树ID
+          extension: '', //文件名称
+          fileUrl: '',//文件路径
+         
+        }
+      }
+    },
+
+
+    
+    //查看节点下已关联的元素表信息
+    searchNodeTables(id) {
+      searchNodeTables(id, this.from.id).then((res) => {
+        if (res.data.data.length > 0) {
+          res.data.data.forEach((val) => {
+            if (val.isLinkTable == 2) {
+              val.checknd = true;
+            } else {
+              val.checknd = false;
+            }
+            val.loading = false;
+          });
+          this.addTableData = res.data.data;
+        } else {
+          this.addTableData = [];
+        }
+      });
+    },
+
+  },
+  created () {
+    this.excelType()//清表类型
+  },
+  mounted () {
+    // this.heightss = this.$refs.rulesss.clientHeight
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.marleft10 {
+  margin-left: 10px;
+}
+/deep/.el-tree-node__expand-icon {
+  font-size: 16px;
+}
+.colorblue {
+  color: rgb(0, 82, 217);
+}
+
+.treecontent /deep/.el-scrollbar {
+  height: 100%;
+}
+
+.el-scrollbar {
+  height: 100%;
+}
+
+.rightHeader {
+  display: flex;
+  justify-content: flex-start;
+  align-items: top;
+  font-size: 14px;
+  background-color: #fff;
+
+  .excelname {
+    box-sizing: border-box;
+    min-width: 200px;
+    height: 28px;
+    border: 1px solid rgb(220, 220, 220);
+    padding: 0 10px;
+    border-radius: 3px;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+  }
+}
+
+.dialogModel {
+  .dialogBox {
+    .middle {
+      display: flex;
+
+      .left {
+        border: 1px solid rgb(220, 220, 220);
+        border-radius: 3px;
+        height: 500px;
+        width: 49%;
+
+        .select {
+          box-sizing: border-box;
+          display: flex;
+          justify-content: center;
+          padding: 5px 0;
+          border-bottom: 1px solid #e0e0e0;
+        }
+        .leftscroll {
+          height: 450px;
+          overflow-y: scroll;
+        }
+      }
+
+      .right {
+        height: auto;
+        height: 60px;
+        max-height: 500px;
+        margin-left: 2%;
+        // height: 500px;
+        border-radius: 3px;
+        td {
+          box-sizing: border-box;
+          padding: 5px 10px;
+          height: 30px;
+          line-height: 30px;
+        }
+      }
+    }
+  }
+
+  .btbox {
+    margin-top: 20px;
+    display: flex;
+    justify-content: center;
+  }
+}
+
+.rightBox {
+  flex: 1;
+}
+
+.boxswai{
+  height: 100%;
+  box-sizing: border-box;
+  padding-bottom: 10px;
+}
+</style>