|
@@ -1,261 +1,283 @@
|
|
|
<template>
|
|
|
- <basic-container>
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="5">
|
|
|
- <div
|
|
|
- style="text-align: center;fontSize:18px; font-weight: 900;"
|
|
|
- class="marbottom5"
|
|
|
- >元素识别</div>
|
|
|
- <el-tree
|
|
|
- :data="treeData"
|
|
|
- :props="treeProps"
|
|
|
- @node-click="handleNodeClick"
|
|
|
- :load="loadNode"
|
|
|
- lazy
|
|
|
- ></el-tree>
|
|
|
- </el-col>
|
|
|
- <el-col :span="19">
|
|
|
- <div v-if="from.extension==''">表名称</div>
|
|
|
- <div v-else>{{from.extension}}</div>
|
|
|
- <el-row
|
|
|
- class="martop20"
|
|
|
- :gutter="20"
|
|
|
+ <div class="boxswai">
|
|
|
+ <div class="boxnei">
|
|
|
+ <el-row
|
|
|
+ :gutter="20"
|
|
|
+ style="height:100%;"
|
|
|
+ >
|
|
|
+ <el-col
|
|
|
+ :span="5"
|
|
|
+ style="height:99%;"
|
|
|
>
|
|
|
- <el-col :span="16">
|
|
|
- <iframe
|
|
|
- :src="excelSrc"
|
|
|
- width="100%"
|
|
|
- height="700px"
|
|
|
- ></iframe>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <div class="flexBetween flexItemsC">
|
|
|
+ <div
|
|
|
+ style="text-align: center;fontSize:18px; font-weight: 900;"
|
|
|
+ class="marbottom5"
|
|
|
+ >元素识别</div>
|
|
|
+ <div style="height:98%;overflow: auto;width:auto;">
|
|
|
+ <el-tree
|
|
|
+ :data="treeData"
|
|
|
+ :props="treeProps"
|
|
|
+ @node-click="handleNodeClick"
|
|
|
+ :load="loadNode"
|
|
|
+ :expand-on-click-node="false"
|
|
|
+ lazy
|
|
|
+ ></el-tree>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col
|
|
|
+ :span="19"
|
|
|
+ style="height:98%;"
|
|
|
+ >
|
|
|
+ <div v-if="addElementForm.deptName==''">表名称</div>
|
|
|
+ <div v-else>{{addElementForm.deptName}}</div>
|
|
|
+ <el-row
|
|
|
+ class="martop20"
|
|
|
+ :gutter="20"
|
|
|
+ style="height:96%;"
|
|
|
+ >
|
|
|
+ <el-col
|
|
|
+ :span="16"
|
|
|
+ style="overflow:auto;height:100%;"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="parent"
|
|
|
+ id='parent'
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col
|
|
|
+ :span="8"
|
|
|
+ style="overflow:auto;height:100%;"
|
|
|
+ >
|
|
|
+ <div class="flexBetween flexItemsC">
|
|
|
+ <el-button
|
|
|
+ type="info"
|
|
|
+ size="mini"
|
|
|
+ :disabled="from.id==''"
|
|
|
+ @click="automaticRecognition"
|
|
|
+ >自动识别</el-button>
|
|
|
+ <div
|
|
|
+ class="el-icon-plus"
|
|
|
+ @click="pushTableData"
|
|
|
+ style="width:16px;height:16px;backgroundColor:#1DD81D;color:#fff;cursor: pointer;"
|
|
|
+ ></div>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ class="martop20"
|
|
|
+ :data="tableData"
|
|
|
+ border
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ type="index"
|
|
|
+ label="坐标"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="eName"
|
|
|
+ label="元素名称"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.eName"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="eType"
|
|
|
+ label="数据类型"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select
|
|
|
+ v-model="scope.row.eType"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in dataType"
|
|
|
+ :key="item.dictKey"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item.dictKey"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="eAllowDeviation"
|
|
|
+ label="允许偏差值"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.eAllowDeviation"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-link
|
|
|
+ type="danger"
|
|
|
+ @click="deleteTableData(scope.$index)"
|
|
|
+ >删除</el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
<el-button
|
|
|
- type="info"
|
|
|
- size="mini"
|
|
|
+ type="success"
|
|
|
+ class="martop20"
|
|
|
+ @click="establish()"
|
|
|
:disabled="from.id==''"
|
|
|
- @click="automaticRecognition"
|
|
|
- >自动识别</el-button>
|
|
|
- <div
|
|
|
- class="el-icon-plus"
|
|
|
- @click="pushTableData"
|
|
|
- style="width:16px;height:16px;backgroundColor:#1DD81D;color:#fff;cursor: pointer;"
|
|
|
- ></div>
|
|
|
- </div>
|
|
|
+ >关联WBS并创建元素</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <!-- 关联公共WBS模板 -->
|
|
|
+ <el-dialog
|
|
|
+ title="关联公共WBS模板"
|
|
|
+ class="excelBox"
|
|
|
+ :visible.sync="AssociatedPublicTap"
|
|
|
+ modal-append-to-body
|
|
|
+ append-to-body
|
|
|
+ :before-close="AssociatedPublicClose"
|
|
|
+ >
|
|
|
+ <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;">
|
|
|
+ <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
|
|
|
+ >
|
|
|
+ </el-tree>
|
|
|
+ </el-scrollbar>
|
|
|
+ </el-col>
|
|
|
+ <el-col
|
|
|
+ :span="12"
|
|
|
+ v-if="addElementForm.wbsId"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ style="float:right;"
|
|
|
+ class="marbottom20"
|
|
|
+ @click="addElementMD"
|
|
|
+ :disabled="addElement"
|
|
|
+ >新增元素信息表</el-button>
|
|
|
+
|
|
|
<el-table
|
|
|
- class="martop20"
|
|
|
- :data="tableData"
|
|
|
+ :data="addTableData"
|
|
|
border
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<el-table-column
|
|
|
- type="index"
|
|
|
- label="坐标"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="eName"
|
|
|
- label="元素名称"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input
|
|
|
- v-model="scope.row.eName"
|
|
|
- placeholder="请输入内容"
|
|
|
- ></el-input>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="eType"
|
|
|
- label="数据类型"
|
|
|
+ prop="tableName"
|
|
|
+ label="已有元素表名称"
|
|
|
+ align="center"
|
|
|
>
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-select
|
|
|
- v-model="scope.row.eType"
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in dataType"
|
|
|
- :key="item.dictKey"
|
|
|
- :label="item.dictValue"
|
|
|
- :value="item.dictKey"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="eAllowDeviation"
|
|
|
- label="允许偏差值"
|
|
|
+ prop="name"
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input
|
|
|
- v-model="scope.row.eAllowDeviation"
|
|
|
- placeholder="请输入内容"
|
|
|
- ></el-input>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-link
|
|
|
- type="danger"
|
|
|
- @click="deleteTableData(scope.$index)"
|
|
|
- >删除</el-link>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ @click="relationMD(scope.$index,'关联')"
|
|
|
+ v-show="!scope.row.checknd"
|
|
|
+ >关联</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ @click="relationMD(scope.$index,'取消关联')"
|
|
|
+ v-show="scope.row.checknd"
|
|
|
+ >取消关联</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- class="martop20"
|
|
|
- @click="establish()"
|
|
|
- :disabled="from.id==''"
|
|
|
- >关联WBS并创建元素</el-button>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <!-- 关联公共WBS模板 -->
|
|
|
- <el-dialog
|
|
|
- title="关联公共WBS模板"
|
|
|
- class="excelBox"
|
|
|
- :visible.sync="AssociatedPublicTap"
|
|
|
- modal-append-to-body
|
|
|
- append-to-body
|
|
|
- :before-close="AssociatedPublicClose"
|
|
|
- >
|
|
|
- <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;">
|
|
|
- <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
|
|
|
- >
|
|
|
- </el-tree>
|
|
|
- </el-scrollbar>
|
|
|
- </el-col>
|
|
|
- <el-col
|
|
|
- :span="12"
|
|
|
- v-if="addElementForm.wbsId"
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- style="float:right;"
|
|
|
- class="marbottom20"
|
|
|
- @click="addElementMD"
|
|
|
- :disabled="addElement"
|
|
|
- >新增元素信息表</el-button>
|
|
|
-
|
|
|
- <el-table
|
|
|
- :data="addTableData"
|
|
|
- border
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <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"
|
|
|
- @click="relationMD(scope.$index,'关联')"
|
|
|
- v-show="!scope.row.checknd"
|
|
|
- >关联</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- size="mini"
|
|
|
- @click="relationMD(scope.$index,'取消关联')"
|
|
|
- v-show="scope.row.checknd"
|
|
|
- >取消关联</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
|
|
|
- <div v-if="addElement">
|
|
|
- <div class="flexBetween martop40">
|
|
|
- <el-input
|
|
|
- v-model="addElementForm.deptName"
|
|
|
- placeholder="请输入表名"
|
|
|
- ></el-input>
|
|
|
+ <div v-if="addElement">
|
|
|
+ <div class="flexBetween martop40">
|
|
|
+ <el-input
|
|
|
+ v-model="addElementForm.deptName"
|
|
|
+ placeholder="请输入表名"
|
|
|
+ ></el-input>
|
|
|
+ <el-select
|
|
|
+ class="marleft10"
|
|
|
+ v-model="addElementForm.tableType"
|
|
|
+ placeholder="请选择表类型"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item,index) in dataType"
|
|
|
+ :key="index"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item.dictKey"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
<el-select
|
|
|
- class="marleft10"
|
|
|
- v-model="addElementForm.tableType"
|
|
|
- placeholder="请选择表类型"
|
|
|
+ style="width:100%;"
|
|
|
+ class="martop20 "
|
|
|
+ v-model="addElementForm.tableOwner"
|
|
|
+ placeholder="请选择所属方"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="(item,index) in dataType"
|
|
|
+ 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 exceltypeData"
|
|
|
- :key="index"
|
|
|
- :label="item.dictValue"
|
|
|
- :value="item.dictKey"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- </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>
|
|
|
- </basic-container>
|
|
|
+ </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>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { tabLazytree, detailExcel, excelType, submitExcelRelationWbsTreeAndElement, getWbsTypeList, getLazytree } from "@/api/exctab/excelmodel";
|
|
|
+import { tabLazytree, getExcelHtmlCol, excelType, submitExcelRelationWbsTreeAndElement, getWbsTypeList, getLazytree, } from "@/api/exctab/excelmodel";
|
|
|
import { dictionarydataType } from "@/api/exctab/editelement";
|
|
|
import { getColByTabId } from "@/api/manager/AdjustForm";
|
|
|
import { selectByNodeTable } from "@/api/manager/wbstree";
|
|
|
+import Vue from 'vue'
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
@@ -270,7 +292,6 @@ export default {
|
|
|
excelSrc: '',
|
|
|
from: {
|
|
|
id: '',
|
|
|
- extension: '',
|
|
|
},
|
|
|
tableData: [],//外层table
|
|
|
dataType: [],
|
|
@@ -308,11 +329,12 @@ export default {
|
|
|
//#region
|
|
|
handleNodeClick (data) {//树节点点击事件
|
|
|
console.log(data);
|
|
|
- if (data.hasChildren) {
|
|
|
- this.detailExcel(data.id)
|
|
|
+ if (data.fileType == 3) {
|
|
|
+ this.getExcelHtmlCol(data.id)//获取excel模板
|
|
|
if (this.dataType.length == 0) {
|
|
|
- this.dictionarydataType()
|
|
|
+ this.dictionarydataType() //数据类型字典
|
|
|
}
|
|
|
+ this.addElementForm.deptName = data.name
|
|
|
this.from.id = data.id
|
|
|
}
|
|
|
},
|
|
@@ -346,6 +368,28 @@ export default {
|
|
|
this.tableData = res.data
|
|
|
}
|
|
|
},
|
|
|
+ async getExcelHtmlCol (id) {//获取excel模板
|
|
|
+ const { data: res } = await getExcelHtmlCol({ id })
|
|
|
+ console.log(res);
|
|
|
+ if (res.code == 200) {
|
|
|
+ // let _that = this
|
|
|
+ var MyComponent = await Vue.extend({
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ formData: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ template: res.data,
|
|
|
+ })
|
|
|
+ var component = new MyComponent().$mount()
|
|
|
+ let na = document.getElementById('parent')
|
|
|
+ na.innerHTML = `<div
|
|
|
+ class='parent'
|
|
|
+ id='parent'"
|
|
|
+ ></div>`
|
|
|
+ document.getElementById('parent').appendChild(component.$el);
|
|
|
+ }
|
|
|
+ },
|
|
|
//#endregion
|
|
|
|
|
|
//#region 关联公共WBS模板弹框
|
|
@@ -384,6 +428,8 @@ export default {
|
|
|
if (this.GLExcelFrom.name != "") {
|
|
|
this.GLExcelFrom.search = ''
|
|
|
this.exceldata = []
|
|
|
+ this.addTableData = []
|
|
|
+ this.addElementForm.wbsId = ''
|
|
|
this.$nextTick(() => {
|
|
|
this.GLExcelFromtag = true
|
|
|
})
|
|
@@ -530,18 +576,6 @@ export default {
|
|
|
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)
|
|
|
- }
|
|
|
- },
|
|
|
async dictionarydataType () {//数据类型字典
|
|
|
const { data: res } = await dictionarydataType()
|
|
|
console.log(res);
|
|
@@ -556,5 +590,5 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
+<style lang="scss" >
|
|
|
</style>
|