|
@@ -0,0 +1,124 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div class="text-orange-500 ">复跨节点复制: 把当前表格已形成的数据复制到其他工程部位的相同表格里面</div>
|
|
|
+ <div class="text-orange-500 mtop5">本节点复制:在当前节点内复制本表及数据</div>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="radio-group-box">
|
|
|
+ <el-radio-group v-model="CopyModalType" @change="changeCopyModalType">
|
|
|
+ <el-radio label="1">跨节点复制</el-radio>
|
|
|
+ <el-radio class="ml-4" label="2">本节点复制</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ <div class="copy-node-many-box" v-if="CopyModalType==='1'">
|
|
|
+ <div class="copy-node-many-tree">
|
|
|
+ <el-scrollbar>
|
|
|
+ <WbsTree
|
|
|
+ :treeKey="wbstreeKey"
|
|
|
+ :classifyType="classify"
|
|
|
+ :contractId="contractId"
|
|
|
+ :projectId="projectId"
|
|
|
+ @nodeLoading="ElTreeNodeLoading"
|
|
|
+ @nodeTap="wbsElTreeClick"
|
|
|
+ ref="copywbstree"
|
|
|
+ :autoExpandKeys="treeautokeys"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ />
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ <div class="copy-node-many-table">
|
|
|
+ <el-scrollbar v-loading="tableLoading">
|
|
|
+ <el-table :data="copyModalTable" border stripe>
|
|
|
+ <el-table-column label="表格名称" prop="fullName"/>
|
|
|
+ <el-table-column align="center" label="操作" prop="action" width="120">
|
|
|
+ <template #default="{row}">
|
|
|
+ <el-checkbox v-model="row.isCheck" size="large" @change="copyModalTableCheck(row)"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import {ref, watch, onMounted, nextTick} from "vue";
|
|
|
+import {getArrValue, getObjValue, setPosInsert} from "js-fast-way"
|
|
|
+import wbsApi from "~api/data-fill/wbs"
|
|
|
+import WbsTree from "../components/WbsTree.vue"
|
|
|
+
|
|
|
+const props = defineProps({
|
|
|
+ projectId: [String, Number],
|
|
|
+ contractId: [String, Number],
|
|
|
+ classify:[String, Number],
|
|
|
+ tree_AutoExpandKeys:[Array],
|
|
|
+ treenodeDataInfo:[Object],//外层选中的树
|
|
|
+})
|
|
|
+//参数变量
|
|
|
+const projectId = ref(props.projectId);
|
|
|
+const contractId = ref(props.contractId);
|
|
|
+const classify = ref(props.classify);
|
|
|
+const tree_AutoExpandKeys = ref(props.tree_AutoExpandKeys);
|
|
|
+const treenodeDataInfo = ref(props.treenodeDataInfo);
|
|
|
+const CopyModalType=ref('1')
|
|
|
+const copyModalTable=ref([]);
|
|
|
+const tableLoading=ref(false)
|
|
|
+const treeLoading=ref(false)
|
|
|
+const copywbstree=ref(null)
|
|
|
+//树加载完成
|
|
|
+const ElTreeNodeLoading = () => {
|
|
|
+ treeLoading.value = false
|
|
|
+ console.log(tree_AutoExpandKeys.value,'tree_AutoExpandKeys');
|
|
|
+}
|
|
|
+const wbstreeKey = ref(Math.random())
|
|
|
+const nodeItemInfo=ref({})
|
|
|
+const nodeDataInfo=ref({})
|
|
|
+//树被点击
|
|
|
+const wbsElTreeClick = ({node, data, keys}) => {
|
|
|
+ nodeItemInfo.value = node
|
|
|
+ nodeDataInfo.value = data
|
|
|
+ searchTabledata()
|
|
|
+}
|
|
|
+const searchTabledata = async () => {
|
|
|
+ copyModalTable.value = []
|
|
|
+ const info = nodeDataInfo.value;
|
|
|
+ tableLoading.value = true
|
|
|
+ const {error, code, data} = await wbsApi.searchNodeAllTable({
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ primaryKeyId: info['primaryKeyId'],
|
|
|
+ type: classify.value
|
|
|
+ })
|
|
|
+ //处理数据
|
|
|
+ tableLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ copyModalTable.value = getArrValue(data)
|
|
|
+ } else {
|
|
|
+ copyModalTable.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
+//勾选复制本表
|
|
|
+const copyModalTableCheck = async (item) => {
|
|
|
+ console.log('复制本表', item);
|
|
|
+}
|
|
|
+const treeautokeys=ref([])
|
|
|
+const changeCopyModalType=(val)=>{
|
|
|
+ if(val==='2'){
|
|
|
+ nextTick(()=>{
|
|
|
+ // treeautokeys.value=tree_AutoExpandKeys.value
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+.mtop5{
|
|
|
+ margin-top: 5px;
|
|
|
+}
|
|
|
+</style>
|