|
@@ -139,15 +139,54 @@
|
|
|
<HcDialog :show="CTDModal" title="关联试验数据" widths="850px" saveText="确认关联" @close="CTDModal = false" @save="CTDModal = false">
|
|
|
开发中...
|
|
|
</HcDialog>
|
|
|
+ <!-- 复制本表 -->
|
|
|
+ <HcDialog :show="CopyModal" title="复制本表" widths="1200px" saveText="确认复制" @close="CopyModal = false" @save="CopyModal = false">
|
|
|
+ <el-alert title="复跨节点复制: 把当前表格已形成的数据复制到其他工程部位的相同表格里面" type="warning" :closable="false"/>
|
|
|
+ <el-alert title="本节点复制:在当前节点内复制本表及数据" type="warning" :closable="false"/>
|
|
|
+ <div class="radio-group-box">
|
|
|
+ <el-radio-group v-model="CopyModalType">
|
|
|
+ <el-radio label="1">跨节点复制</el-radio>
|
|
|
+ <el-radio label="2" class="ml-4">本节点复制</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
|
|
|
+ :projectId="projectId"
|
|
|
+ :contractId="contractId"
|
|
|
+ @nodeTap="wbsElTreeClick"
|
|
|
+ @nodeLoading="ElTreeNodeLoading"
|
|
|
+
|
|
|
+ />
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ <div class="copy-node-many-table">
|
|
|
+ <el-scrollbar v-loading="ListItemLoading" >
|
|
|
+ <el-table :data="copyModalTable" border stripe>
|
|
|
+ <el-table-column prop="fullName" label="表格名称"/>
|
|
|
+ <el-table-column prop="action" label="操作" width="120" align="center">
|
|
|
+ <template #default="{row}">
|
|
|
+ <el-checkbox v-model="row.isCheck" size="large" @change="copyModalTableCheck(row)"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </HcDialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import {ref,watch,nextTick} from "vue";
|
|
|
+import {getStoreData, setStoreData} from '~src/utils/storage'
|
|
|
import notableform from '~src/assets/view/notableform.svg';
|
|
|
import HTableForm from "~src/plugins/HTableForm"
|
|
|
+import WbsTree from "../components/WbsTree.vue"
|
|
|
import wbsApi from "~api/data-fill/wbs"
|
|
|
import HcUpload from "./HcUpload.vue"
|
|
|
import {utilsText, isType, formValidate, deepClone, getObjValue} from "vue-utils-plus"
|
|
|
+import {useAppStore} from "~src/store";
|
|
|
|
|
|
//初始
|
|
|
const props = defineProps({
|
|
@@ -184,6 +223,11 @@ const isStatus = ref(props.status)
|
|
|
const isPrimaryKeyId = ref(props.primaryKeyId)
|
|
|
const contractId = ref(props.contractId)
|
|
|
const projectInfo = ref(props.projectInfo)
|
|
|
+const useAppState = useAppStore()
|
|
|
+const authBtnTabKey = ref(props.authBtnTabKey)
|
|
|
+
|
|
|
+//全局变量
|
|
|
+const projectId = ref(useAppState.getProjectId);
|
|
|
|
|
|
//监听
|
|
|
watch(() => [
|
|
@@ -459,9 +503,61 @@ const delClick = async (item) => {
|
|
|
window?.$message?.warning('pkeyId为空')
|
|
|
}
|
|
|
}
|
|
|
+//复制本表弹窗
|
|
|
+const CopyModal = ref(false);
|
|
|
+const CopyModalType=ref('1');
|
|
|
+const treeLoading = ref(false);
|
|
|
+const copyModalTable=ref([])
|
|
|
+
|
|
|
+
|
|
|
+//树相关变量
|
|
|
+// const primaryKeyId = ref('')
|
|
|
+const nodeItemInfo = ref({})
|
|
|
+const nodeDataInfo = ref({})
|
|
|
+//树加载完成
|
|
|
+const ElTreeNodeLoading = () => {
|
|
|
+ treeLoading.value = false
|
|
|
+}
|
|
|
|
|
|
+//获取数据列表
|
|
|
+const ListItemLoading = ref(false);
|
|
|
+const checked1=ref(true)
|
|
|
+const searchNodeAllTable = async () => {
|
|
|
+ copyModalTable.value = []
|
|
|
+ const info = nodeDataInfo.value;
|
|
|
+ ListItemLoading.value = true
|
|
|
+ const {error, code, data} = await wbsApi.searchNodeAllTable({
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ primaryKeyId: info['primaryKeyId'],
|
|
|
+ type: authBtnTabKey.value
|
|
|
+ })
|
|
|
+ //处理数据
|
|
|
+ ListItemLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ copyModalTable.value = getArrValue(data);
|
|
|
+ copyModalTable.value.forEach((item)=>{
|
|
|
+ item.isCheck=false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ copyModalTable.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
+const getTableDataAll = () => {
|
|
|
+ searchNodeAllTable()
|
|
|
+}
|
|
|
+
|
|
|
+//树被点击
|
|
|
+const wbsElTreeClick = ({node, data, keys}) => {
|
|
|
+ nodeItemInfo.value = node
|
|
|
+ nodeDataInfo.value = data
|
|
|
+ getTableDataAll();
|
|
|
+}
|
|
|
//复制本表
|
|
|
const copyClick = async (item,index) => {
|
|
|
+ // CopyModal.value=true;
|
|
|
+ // const copyModalTable=ref([])
|
|
|
+
|
|
|
if (item.pkeyId) {
|
|
|
if (isStatus.value !== '3') {
|
|
|
if (!item.isRenderTableForm) {
|
|
@@ -486,6 +582,10 @@ const copyClick = async (item,index) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//勾选复制本表
|
|
|
+const copyModalTableCheck = async (item) => {
|
|
|
+ console.log('复制本表',item);
|
|
|
+}
|
|
|
const copeBussTab = async (pkeyIds) => {
|
|
|
const {error, code} = await wbsApi.copeBussTab({
|
|
|
pkeyId: pkeyIds
|
|
@@ -877,6 +977,9 @@ defineExpose({
|
|
|
font-size: 22px;
|
|
|
}
|
|
|
}
|
|
|
+.radio-group-box{
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
<style lang="scss">
|
|
@@ -927,4 +1030,26 @@ defineExpose({
|
|
|
.el-form-item.special-form-item .el-form-item__content .el-input .el-input__wrapper .el-input__inner {
|
|
|
font-family: "EUDC", 宋体, v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
|
}
|
|
|
+//复制本表弹窗
|
|
|
+.copy-node-many-box {
|
|
|
+ position: relative;
|
|
|
+ height: 53vh;
|
|
|
+ display: flex;
|
|
|
+ margin-top: 24px;
|
|
|
+ margin-bottom: -30px;
|
|
|
+ border-top: 1px solid #efeff5;
|
|
|
+ .copy-node-many-tree {
|
|
|
+ position: relative;
|
|
|
+ flex: 1;
|
|
|
+ height: 100%;
|
|
|
+ padding: 20px 20px 20px 0;
|
|
|
+ border-right: 1px solid #efeff5;
|
|
|
+ }
|
|
|
+ .copy-node-many-table {
|
|
|
+ position: relative;
|
|
|
+ flex: 1;
|
|
|
+ height: 100%;
|
|
|
+ padding: 20px 0 20px 20px;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|