|
@@ -32,6 +32,12 @@
|
|
|
</div>
|
|
|
<div class="project-info">
|
|
|
<HcCard title="当前节点工程用表信息">
|
|
|
+ <template #extra>
|
|
|
+ <el-button type="primary" hc-btn @click="addingFormClick">
|
|
|
+ <HcIcon name="add"/>
|
|
|
+ <span>引用元素表</span>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
<HcTable :column="tableProjectColumn" :datas="tableProjectData" :isIndex="false" border>
|
|
|
<template #tableType="{row}">{{getRowTableType(row['tableType'])}}</template>
|
|
|
<template #tableOwner="{row}">{{getRowTableOwnerType(row['tableOwner'])}}</template>
|
|
@@ -236,6 +242,41 @@
|
|
|
</el-scrollbar>
|
|
|
</HcDialog>
|
|
|
|
|
|
+ <!--添加独立表单-->
|
|
|
+ <HcDialog :show="addingFormModal" title="引用元素表" widths="84%" isTable :padding="false" :loading="addingFormLoading" @close="addingFormClose" @save="addingFormSave">
|
|
|
+ <div class="adding-form-dialog-box">
|
|
|
+ <div class="dialog-tree-box">
|
|
|
+ <el-scrollbar>
|
|
|
+ <ElTree class="hc-tree-node"
|
|
|
+ ref="addingFormTreeRef"
|
|
|
+ :props="addingFormTreeProps"
|
|
|
+ :load="addingFormTreeLoadNode"
|
|
|
+ lazy highlight-current accordion
|
|
|
+ @node-click="addingFormTreeClick">
|
|
|
+ </ElTree>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ <div class="dialog-table-box">
|
|
|
+ <div class="dialog-search">
|
|
|
+ <el-autocomplete
|
|
|
+ class="block" clearable
|
|
|
+ v-model="searchTreeTitle"
|
|
|
+ :fetch-suggestions="querySearchTree"
|
|
|
+ placeholder="请输入关键词检索"
|
|
|
+ node-key="primaryKeyId"
|
|
|
+ value-key="title"
|
|
|
+ @select="searchTreeSelect"/>
|
|
|
+ </div>
|
|
|
+ <div class="dialog-table">
|
|
|
+ <HcTable :column="dialogTableColumn" :datas="dialogTableData" isCheck @selection-change="dialogTableSelection"/>
|
|
|
+ </div>
|
|
|
+ <div class="dialog-pages">
|
|
|
+ <HcPages :pages="searchFormPage" @change="searchFormPageChange"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </HcDialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -440,7 +481,6 @@ const searchNodeAllTableApi = async (pid) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//树菜单配置
|
|
|
const ElTreeMenu = ref([
|
|
|
{icon: 'add-circle', label: '新增节点', key: "add"},
|
|
@@ -930,6 +970,107 @@ const toBackClick = () => {
|
|
|
router.push({path: '/data-fill/wbs'})
|
|
|
}
|
|
|
|
|
|
+//添加独立表单
|
|
|
+const addingFormModal = ref(false)
|
|
|
+const addingFormClick = () => {
|
|
|
+ addingFormLoading.value = false
|
|
|
+ addingFormModal.value = true
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//树配置
|
|
|
+const addingFormTreeRef = ref(null)
|
|
|
+const addingFormTreeProps = {
|
|
|
+ label: 'title',
|
|
|
+ children: 'children',
|
|
|
+ isLeaf: 'isLeaf'
|
|
|
+}
|
|
|
+
|
|
|
+//树加载
|
|
|
+const addingFormTreeLoadNode = async (node, resolve) => {
|
|
|
+ if (node.level === 0) {
|
|
|
+ const resData = await tabTypeLazyTree()
|
|
|
+ console.log(resData)
|
|
|
+ resolve(resData)
|
|
|
+ } else {
|
|
|
+ resolve([])
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//树被点击
|
|
|
+const addingFormTreeItem = ref({})
|
|
|
+const addingFormTreeClick = async (data) => {
|
|
|
+ addingFormTreeItem.value = data
|
|
|
+ const resData = await tabTypeLazyTree(data?.primaryKeyId)
|
|
|
+ console.log(resData)
|
|
|
+ dialogTableData.value = resData
|
|
|
+}
|
|
|
+
|
|
|
+//搜索
|
|
|
+const searchTreeTitle = ref('')
|
|
|
+const querySearchTree = async (key, resolve) => {
|
|
|
+ const primaryKeyId = addingFormTreeItem.value?.primaryKeyId ?? ''
|
|
|
+ const resData = await tabTypeLazyTree(primaryKeyId, key)
|
|
|
+ console.log(resData)
|
|
|
+ resolve(resData)
|
|
|
+}
|
|
|
+const searchTreeSelect = (item) => {
|
|
|
+ console.log(item)
|
|
|
+}
|
|
|
+
|
|
|
+//搜索
|
|
|
+const searchFormPage = ref({current: 1, size: 20, total: 0})
|
|
|
+const searchFormPageChange = ({current, size}) => {
|
|
|
+ searchFormPage.value.current = current
|
|
|
+ searchFormPage.value.size = size
|
|
|
+}
|
|
|
+
|
|
|
+//表格数据
|
|
|
+const dialogTableColumn = ref([
|
|
|
+ {key:'title', name: '表单名称'},
|
|
|
+ {key:'tableType', name: '元素表类型'},
|
|
|
+ {key:'tableOwner', name: '元素总量'},
|
|
|
+ {key:'fillRate1', name: '所属方'},
|
|
|
+ {key:'fillRate', name: '填报率'}
|
|
|
+])
|
|
|
+const dialogTableData = ref([])
|
|
|
+
|
|
|
+//多选
|
|
|
+const dialogTableKeys = ref([]);
|
|
|
+const dialogTableSelection = (rows) => {
|
|
|
+ dialogTableKeys.value = rows
|
|
|
+}
|
|
|
+
|
|
|
+//获取数据
|
|
|
+const tabTypeLazyTree = async (parentId = '12345678910', titleName = '') => {
|
|
|
+ let obj = {}
|
|
|
+ if(parentId) obj.parentId = parentId
|
|
|
+ if(titleName) obj.titleName = titleName
|
|
|
+ //发起请求
|
|
|
+ const { data } = await divisionApi.tabTypeLazyTree({
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ ...obj
|
|
|
+ })
|
|
|
+ const resData = getArrValue(data)
|
|
|
+ resData.forEach(item => {
|
|
|
+ item.isLeaf = true
|
|
|
+ })
|
|
|
+ return resData
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+//保存
|
|
|
+const addingFormLoading = ref(false)
|
|
|
+const addingFormSave = () => {
|
|
|
+
|
|
|
+}
|
|
|
+//关闭
|
|
|
+const addingFormClose = () => {
|
|
|
+ addingFormModal.value = false
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
//左右拖动,改变树形结构宽度
|
|
|
const leftWidth = ref(382);
|
|
|
const onmousedown = () => {
|