|
@@ -9,7 +9,35 @@
|
|
|
>
|
|
|
<div class="boxnei" style="display: flex;flex-direction: column;">
|
|
|
<div style="overflow: auto;flex:1">
|
|
|
- <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" ref="avueTree" style="display: inline-block;min-width: 100%;"></avue-tree>
|
|
|
+ <avue-tree
|
|
|
+ :option="treeOption"
|
|
|
+ :data="treeData"
|
|
|
+ @node-click="nodeClick"
|
|
|
+ ref="avueTree"
|
|
|
+ style="display: inline-block;min-width: 100%;">
|
|
|
+ <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.title }} </span>
|
|
|
+ <!-- <span> {{ node}} </span> -->
|
|
|
+ <!-- 添加 -->
|
|
|
+ <span>
|
|
|
+ <!-- 调整排序 -->
|
|
|
+ <i
|
|
|
+ class="el-icon-sort"
|
|
|
+ @click="sortpai(data, node)"
|
|
|
+ v-if="node.level == 2"
|
|
|
+ title="调整排序"
|
|
|
+ ></i>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ </avue-tree>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
@@ -440,6 +468,21 @@
|
|
|
>确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <!-- 私有wbs树排序弹框 -->
|
|
|
+ <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>
|
|
@@ -458,11 +501,13 @@ import FormulaEdit from "@/views/formula/edit.vue";
|
|
|
import PublicWbs from './PublicWbs.vue'
|
|
|
import { searchNodeTables, } from "@/api/exctab/excelmodel";
|
|
|
import { getDictionary } from "@/api/system/dict";
|
|
|
+import ManualSorting from '@/components/WbsTree/ManualSorting'
|
|
|
|
|
|
export default {
|
|
|
components:{
|
|
|
FormulaEdit,
|
|
|
- PublicWbs
|
|
|
+ PublicWbs,
|
|
|
+ ManualSorting
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
@@ -675,6 +720,8 @@ export default {
|
|
|
projectid:"",
|
|
|
curNode:{},
|
|
|
defaultExpandKey:[],//默认展开的节点
|
|
|
+ sortTag: false,
|
|
|
+ sortTag2: false,
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
@@ -687,6 +734,55 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //#region 树形控件外层左侧事件
|
|
|
+ mouseLeave (data) {
|
|
|
+ if (data.moreShow) {
|
|
|
+ this.$set(data, 'moreShow', false)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mouseOver (data) {
|
|
|
+ if (!data.moreShow) {
|
|
|
+ this.$set(data, 'moreShow', true)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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. refreshTreeData();
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ async findWbsTreePrivateSameLevel(node,data) {
|
|
|
+ const { data: res } =await tabTypeLazyTreeAll({parentId:node.data.parentId,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
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
addEleRow (list) {
|
|
|
list.push({});
|
|
|
},
|