|
@@ -27,9 +27,14 @@
|
|
|
>
|
|
|
<div style="width:100%;">
|
|
|
<span style="text-overflow: ellipsis;"> {{ data.title }} </span>
|
|
|
- <!-- <span> {{ node}} </span> -->
|
|
|
- <!-- 添加 -->
|
|
|
-
|
|
|
+
|
|
|
+ <!-- 调整排序 -->
|
|
|
+ <i
|
|
|
+ class="el-icon-sort"
|
|
|
+ @click="sortpai(data, node)"
|
|
|
+ v-if="node.level == 2"
|
|
|
+ title="调整排序"
|
|
|
+ ></i>
|
|
|
</div>
|
|
|
</span>
|
|
|
</el-tree>
|
|
@@ -82,11 +87,9 @@
|
|
|
</el-input>
|
|
|
</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
|
|
|
- )">编辑元素</el-button>
|
|
|
- <el-button :size="size" :type="type" @click="adjustExcel(row.id,row.primaryKeyId)">调整表单</el-button>
|
|
|
+ <el-button :size="size" :type="type" :disabled="row.excelIds == -1" @click="Associationlist(row)">关联清表</el-button>
|
|
|
+ <el-button :size="size" :type="type" @click="rightClick(row)">编辑元素</el-button>
|
|
|
+ <el-button :size="size" :type="type" :disabled="row.excelIds == -1" @click="adjustExcel(row.id,row.primaryKeyId)">调整表单</el-button>
|
|
|
<el-button :size="size" :type="type" @click="handleEditFormula(row)">编辑公式</el-button>
|
|
|
|
|
|
</template>
|
|
@@ -96,7 +99,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<Qute ref="Qute" :projectid="projectid" :wbsid="wbsid" :onLoad1="onLoad1" :refreshTree="refreshTree"> </Qute>
|
|
|
- <Relation ref="Relation" :GLExcelFrom="GLExcelFrom" :wbsid="wbsid"></Relation>
|
|
|
+ <Relation ref="Relation" :GLExcelFrom="GLExcelFrom" :wbsid="wbsid" :onLoad1="onLoad1"></Relation>
|
|
|
<!-- 编辑元素 -->
|
|
|
<!-- 编辑元素 -->
|
|
|
<el-dialog
|
|
@@ -113,6 +116,7 @@
|
|
|
:pid="editElementQuery.pid"
|
|
|
:wbsid="editElementQuery.wbsid"
|
|
|
:nodeid="editElementQuery.nodeid"
|
|
|
+ :initTableId="editElementQuery.initTableId"
|
|
|
@hideDialog="editElementVisible = false"
|
|
|
v-if="editElementVisible"
|
|
|
></EditElement>
|
|
@@ -192,22 +196,38 @@
|
|
|
v-if="formulaCompVisible"
|
|
|
></FormulaEdit>
|
|
|
</el-dialog>
|
|
|
+ <!-- 排序弹框 -->
|
|
|
+ <el-dialog
|
|
|
+ title="调整排序"
|
|
|
+ :visible.sync="sortTag"
|
|
|
+ width="50%"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <ManualSorting v-if="sortTag2" @bianhua="bianhua()" :sort="sort" />
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="(sortTag = false), (sortTag2 = false)"
|
|
|
+ >取 消</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" @click="editSort()">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import {tabTypeLazyTree,delAprojectTab} from "@/api/manager/wbsprivate";
|
|
|
-import {selectFormElements,selectPrivateFormElements} from "@/api/manager/wbstree";
|
|
|
+import {selectPrivateFormElements} from "@/api/manager/wbstree";
|
|
|
import {getExcelHtml} from "@/api/exctab/excelmodel"
|
|
|
import Qute from "./qutediaolog/qute1.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";
|
|
|
+import ManualSorting from '@/components/WbsTree/ManualSorting'
|
|
|
|
|
|
|
|
|
export default {
|
|
|
- components: { dynamicExcel, EditElement, Qute,Relation,FormulaEdit },
|
|
|
+ components: { dynamicExcel, EditElement, Qute,Relation,FormulaEdit,ManualSorting },
|
|
|
computed:{
|
|
|
ids () {
|
|
|
let ids = [];
|
|
@@ -339,6 +359,7 @@ export default {
|
|
|
ids: "",
|
|
|
excelId: "",
|
|
|
initTableName: "",
|
|
|
+ initTableId:'',
|
|
|
},
|
|
|
//编辑元素弹窗
|
|
|
editElementVisible: false, //编辑元素弹框
|
|
@@ -364,8 +385,9 @@ export default {
|
|
|
curTreeData: {},
|
|
|
projectid:'',
|
|
|
treeId:"",
|
|
|
- curNode:{}
|
|
|
-
|
|
|
+ curNode:{},
|
|
|
+ sortTag: false,
|
|
|
+ sortTag2: false,
|
|
|
|
|
|
|
|
|
};
|
|
@@ -377,7 +399,44 @@ export default {
|
|
|
// this.treeLoad1()
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
+ async sortpai(data,node) {
|
|
|
+ console.log(data,node);
|
|
|
+ await this.findWbsTreePrivateSameLevel(node,data)
|
|
|
+ this.sortTag = true;
|
|
|
+ this.sortTag2 = true;
|
|
|
+ },
|
|
|
+ editSort() {
|
|
|
+ this.wbsTreePrivateSort();
|
|
|
+ },
|
|
|
+ bianhua() {
|
|
|
+ this.sortTag2 = false;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.sortTag2 = true;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async wbsTreePrivateSort() {
|
|
|
+ //wbs私有树节点手动排序
|
|
|
+ // const { data: res } = await wbsTreePrivateSort(this.sort);
|
|
|
+ // console.log(res);
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // this.sortTag = false;
|
|
|
+ // this.sortTag2 = false;
|
|
|
+ // this. treeLoad1();
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ async findWbsTreePrivateSameLevel(node,data) {
|
|
|
+ const { data: res } =await tabTypeLazyTree({parentId:node.data.parentId,projectId:this.projectid,current:1,size:1000})
|
|
|
+ if (res.code == 200) {
|
|
|
+ console.log(res.data,'res1111111');
|
|
|
+ let tabArr=res.data.records
|
|
|
+ tabArr.forEach((item)=>{
|
|
|
+ item.tableName=item.title
|
|
|
+ })
|
|
|
+ console.log(tabArr,'tabArr');
|
|
|
+ this.sort =tabArr
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
async treeLoad1 () {
|
|
|
let id = 12345678910
|
|
|
let das = await this.tabTypeLazyTree(id, this.projectid,this.page.current,this.page.size)
|
|
@@ -396,7 +455,7 @@ export default {
|
|
|
},
|
|
|
loadNode(node, resolve) {
|
|
|
const parentId = (node.level === 0) ? 12345678910 : node.data.id;
|
|
|
- tabTypeLazyTree({parentId,projectId:this.projectid,current:1,size:200}).then(res => {
|
|
|
+ tabTypeLazyTree({parentId,projectId:this.projectid,current:1,size:1000}).then(res => {
|
|
|
resolve(res.data.data.records.map(item => {
|
|
|
return {
|
|
|
...item,
|
|
@@ -426,13 +485,33 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- onLoad1(){
|
|
|
- if(this.treeId){
|
|
|
+ // onLoad1(){
|
|
|
+ // if(this.treeId){
|
|
|
+ // this.tabTypeLazyTree(this.treeId,this.projectid, this.page.current,this.page.size).then((res)=>{
|
|
|
+ // this.loadData=res.records
|
|
|
+ // this.page.total=res.total
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ //编辑后刷新
|
|
|
+ onLoad1(){
|
|
|
+ // console.log(this.level,'1111111111');
|
|
|
+ if(this.curNode.level===1&&this.curNode.data.hasChildren){
|
|
|
this.tabTypeLazyTree(this.treeId,this.projectid, this.page.current,this.page.size).then((res)=>{
|
|
|
this.loadData=res.records
|
|
|
this.page.total=res.total
|
|
|
})
|
|
|
+ }else{
|
|
|
+ this.tabTypeLazyTree(this.treeId,this.projectid, this.page.current,this.page.size).then((res)=>{
|
|
|
+ let faArr=res.records;
|
|
|
+ this.loadData=faArr.filter((item)=>{
|
|
|
+ if(item.id===this.treeId){
|
|
|
+ return item
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
+ // this.refreshTreeData()
|
|
|
},
|
|
|
resetChange(item){
|
|
|
console.log(item);
|
|
@@ -447,6 +526,7 @@ export default {
|
|
|
console.log(data,node,'treedata');
|
|
|
this.curNode=node
|
|
|
this.treeId=data.id
|
|
|
+ this.curTreeData=data
|
|
|
if(data.hasChildren){
|
|
|
this.tabTypeLazyTree(data.id, this.projectid,this.page.current,this.page.size).then((res)=>{
|
|
|
console.log(res.records);
|
|
@@ -518,12 +598,16 @@ export default {
|
|
|
this.GLExcelFrom.id = row.primaryKeyId;
|
|
|
this.GLExcelFrom.excelId =row.excelIds;
|
|
|
this.GLExcelFrom.ids = row.id;
|
|
|
- this.GLExcelFrom.initTableName =row.initTableName
|
|
|
+ this.GLExcelFrom.initTableName =row.initTableName;
|
|
|
+ this.GLExcelFrom.initTableId =row.initTableId;
|
|
|
+ this.GLExcelFrom.nodeid =this.curTreeData.id
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
//#region 编辑元素
|
|
|
async rightClick(row) {
|
|
|
console.log(row,'编辑元素');
|
|
|
- await this.getExcelHtml2(row.id);
|
|
|
+ await this.getExcelHtml2(row.primaryKeyId);
|
|
|
// console.log('编辑元素');
|
|
|
this.editElementQuery.pkeyId = row.primaryKeyId;
|
|
|
this.editElementQuery.excelId = row.excelIds;
|
|
@@ -531,8 +615,8 @@ export default {
|
|
|
this.editElementQuery.initTableName =row. initTableName;
|
|
|
this.editElementQuery.pid = this.$route.query.pid;
|
|
|
this.editElementQuery.wbsid = this.$route.query.wbsid;
|
|
|
- // this.editElementQuery.nodeid = this.curTreeData.id;
|
|
|
-
|
|
|
+ this.editElementQuery.initTableId = row.initTableId;
|
|
|
+ this.editElementQuery.nodeid = this.curTreeData.id;
|
|
|
this.editElementVisible = true;
|
|
|
},
|
|
|
async getExcelHtml2(pkeyId) {
|
|
@@ -598,7 +682,7 @@ export default {
|
|
|
refreshTree(){
|
|
|
//刷新左边树形数据
|
|
|
const parentId =12345678910
|
|
|
- tabTypeLazyTree({parentId,projectId:this.projectid,current:1,size:200}).then(res => {
|
|
|
+ tabTypeLazyTree({parentId,projectId:this.projectid,current:1,size:1000}).then(res => {
|
|
|
this.data=res.data.data.records;
|
|
|
this.$nextTick(()=>{
|
|
|
if(this.curNode.level==2){
|