|
@@ -41,14 +41,17 @@
|
|
|
v-if="true"
|
|
|
style="flex:1;"
|
|
|
>
|
|
|
- <avue-crud ref="crud"
|
|
|
+ <avue-crud
|
|
|
+ ref="crud"
|
|
|
:data="loadData"
|
|
|
:option="loadOption"
|
|
|
v-model="obj"
|
|
|
:page.sync="page"
|
|
|
@on-load="onLoad"
|
|
|
@search-change="searchChange"
|
|
|
- @search-reset="resetChange">
|
|
|
+ @search-reset="resetChange"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ >
|
|
|
|
|
|
<template slot="menuRight">
|
|
|
<el-button
|
|
@@ -56,9 +59,7 @@
|
|
|
size="small"
|
|
|
icon="el-icon-delete"
|
|
|
plain
|
|
|
-
|
|
|
- @click="handleDelete"
|
|
|
- >删除元素表
|
|
|
+ @click="handleDelete">删除元素表
|
|
|
</el-button>
|
|
|
|
|
|
<el-button
|
|
@@ -108,6 +109,7 @@
|
|
|
<el-table-column
|
|
|
prop="tableType"
|
|
|
label="表类型"
|
|
|
+
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-select
|
|
@@ -441,10 +443,11 @@
|
|
|
<script>
|
|
|
import { detailExcel, excelType, tabLazytree, wbstree, getWbsTypeList,} from '@/api/exctab/excelmodel';
|
|
|
import {updateBatchNodeTableInfo,selectByNodeTable,selectFormElements} from "@/api/manager/wbstree";
|
|
|
-import {tabTypeLazyTreeAll} from "@/api/manager/wbsprivate";
|
|
|
+import {tabTypeLazyTreeAll,delTabInfoAll} from "@/api/manager/wbsprivate";
|
|
|
import FormulaEdit from "@/views/formula/edit.vue";
|
|
|
import PublicWbs from './PublicWbs.vue'
|
|
|
import { searchNodeTables, } from "@/api/exctab/excelmodel";
|
|
|
+import { getDictionary } from "@/api/system/dict";
|
|
|
|
|
|
export default {
|
|
|
components:{
|
|
@@ -456,6 +459,8 @@ export default {
|
|
|
editElementFormTag:false,//编辑元素
|
|
|
formDatass: [],
|
|
|
selectionList:[],
|
|
|
+ tableTypelist:[],
|
|
|
+ ownerTypeList:[],
|
|
|
page: {
|
|
|
size: 10,
|
|
|
current: 1,
|
|
@@ -667,6 +672,7 @@ export default {
|
|
|
},
|
|
|
nodeClick(data){
|
|
|
console.log(data,'treedata');
|
|
|
+ this.curTreeData=data
|
|
|
this.treeId=data.id
|
|
|
this.tabTypeLazyTreeAll(data.id, this.page.current,this.page.size).then((res)=>{
|
|
|
this.loadData=res.records
|
|
@@ -718,8 +724,8 @@ export default {
|
|
|
type: "warning"
|
|
|
})
|
|
|
.then(() => {
|
|
|
- // return remove(this.ids);
|
|
|
- console.log(this.ids,'this.ids删除');
|
|
|
+ return delTabInfoAll(this.ids);
|
|
|
+ // console.log(this.ids,'this.ids删除');
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.onLoad(this.page);
|
|
@@ -798,34 +804,75 @@ export default {
|
|
|
this.formDatass = [...this.selectionList]
|
|
|
this.formDatass.forEach(val => {
|
|
|
da.push({
|
|
|
- tableType: val.tableType - 0,
|
|
|
- tableOwner: val.tableOwner - 0,
|
|
|
+ tableType: val.tabType,
|
|
|
+ tableOwner: val.tabOwner,
|
|
|
id: val.id,
|
|
|
- tableName: val.tableName,
|
|
|
+ tableName: val.title,
|
|
|
fillRate: val.fillRate,
|
|
|
})
|
|
|
})
|
|
|
this.formDatass = da
|
|
|
- this.editElementFormTag = true
|
|
|
+ console.log(this.formDatass,'this.formDatass');
|
|
|
+ this.editElementFormTag = true;
|
|
|
+ this.getTableTypelist();
|
|
|
+ this.getOwnerTypelist();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getTableTypelist() {
|
|
|
+ if (this.tableTypelist.length > 1) {
|
|
|
+ return;
|
|
|
}
|
|
|
+ getDictionary({
|
|
|
+ code: "table_type",
|
|
|
+ }).then((res) => {
|
|
|
+ res.data.data.forEach((element) => {
|
|
|
+ element.dictKey = Number(element.dictKey);
|
|
|
+ });
|
|
|
+ this.tableTypelist = res.data.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ formatTableType(row, column, cellValue) {
|
|
|
+ for (let i = 0; i < this.tableTypelist.length; i++) {
|
|
|
+ if (this.tableTypelist[i].dictKey == cellValue) {
|
|
|
+ return this.tableTypelist[i].dictValue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return cellValue;
|
|
|
+ //console.log(cellValue)
|
|
|
},
|
|
|
editeditElementFormMF () {//保存按钮
|
|
|
let da = []
|
|
|
let tag = true
|
|
|
+ // console.log(this.formDatass,'this.formDatass');
|
|
|
+ console.log(this.tableTypelist,'tableTypelist');
|
|
|
this.formDatass.forEach(val => {
|
|
|
if (!val.tableName || !val.tableType || !val.tableOwner) {
|
|
|
tag = false
|
|
|
return
|
|
|
} else {
|
|
|
+ let newarr= this.tableTypelist.filter(e => e.dictValue===val.tableType);
|
|
|
+ let newarr1= this.ownerTypeList.filter(e => e.dictValue===val.tableOwner);
|
|
|
da.push({
|
|
|
id: val.id,
|
|
|
nodeName: val.tableName,
|
|
|
- tableType: val.tableType,
|
|
|
- tableOwner: val.tableOwner,
|
|
|
+ tableType: newarr[0].dictKey,
|
|
|
+ tableOwner: newarr1[0].dictKey,
|
|
|
fillRate: val.fillRate,
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
})
|
|
|
if (tag) {
|
|
|
this.updateBatchNodeTableInfo(da)
|
|
@@ -840,19 +887,12 @@ export default {
|
|
|
const { data: res } = await updateBatchNodeTableInfo(da)
|
|
|
//console.log(res);
|
|
|
if (res.code == 200) {
|
|
|
+ this.$message.success('操作成功');
|
|
|
this.editElementFormTag = false
|
|
|
- this.updateNodeTable()
|
|
|
+ this.onLoad(this.page);
|
|
|
}
|
|
|
},
|
|
|
- updateNodeTable () {
|
|
|
- selectByNodeTable(this.curTreeData.id).then((res) => {
|
|
|
- if (res.data.data.length) {
|
|
|
- this.elemtData = res.data.data;
|
|
|
- } else {
|
|
|
- this.elemtData = [];
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
+
|
|
|
|
|
|
|
|
|
//#region 接口
|
|
@@ -863,21 +903,7 @@ 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);
|
|
|
- // //导入模板名称
|
|
|
- // this.from.import={}
|
|
|
- }
|
|
|
- },
|
|
|
|
|
|
async excelType () {//清表类型
|
|
|
const { data: res } = await excelType({ code: 'sys_excltab_type' })
|