|
@@ -13,7 +13,7 @@
|
|
<div class="hc-tree-box">
|
|
<div class="hc-tree-box">
|
|
<el-scrollbar>
|
|
<el-scrollbar>
|
|
<WbsTree
|
|
<WbsTree
|
|
- :auto-expand-keys="TreeAutoExpandKeys" :contract-id="contractId" :project-id="projectId" :class-id="dataId"
|
|
|
|
|
|
+ :auto-expand-keys="TreeAutoExpandKeys" :contract-id="contractId" :project-id="projectId" :class-id="classifyId"
|
|
@nodeTap="nodeWbsElTreeClick"
|
|
@nodeTap="nodeWbsElTreeClick"
|
|
/>
|
|
/>
|
|
</el-scrollbar>
|
|
</el-scrollbar>
|
|
@@ -149,7 +149,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import { onMounted, ref, watch } from 'vue'
|
|
|
|
|
|
+import { onActivated, onMounted, ref, watch } from 'vue'
|
|
import { useAppStore } from '~src/store'
|
|
import { useAppStore } from '~src/store'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
import WbsTree from './components/WbsTree.vue'
|
|
import WbsTree from './components/WbsTree.vue'
|
|
@@ -172,7 +172,7 @@ const userInfo = ref(useAppState.getUserInfo)
|
|
//路由参数
|
|
//路由参数
|
|
const routerQuery = useRoutes?.query
|
|
const routerQuery = useRoutes?.query
|
|
//存储目录格式 1按部位存储,2按日期存储
|
|
//存储目录格式 1按部位存储,2按日期存储
|
|
-const dataId = routerQuery?.classifyId || ''
|
|
|
|
|
|
+const dataId = ref(routerQuery?.id || '')
|
|
const wbsNodeIds = routerQuery?.wbsId || ''
|
|
const wbsNodeIds = routerQuery?.wbsId || ''
|
|
const classifyId = routerQuery?.classifyId || ''
|
|
const classifyId = routerQuery?.classifyId || ''
|
|
const dataType = parseInt(routerQuery?.dataType + '') || 1
|
|
const dataType = parseInt(routerQuery?.dataType + '') || 1
|
|
@@ -204,11 +204,14 @@ watch(contractId, (val) => {
|
|
const TreeAutoExpandKeys = ref([])
|
|
const TreeAutoExpandKeys = ref([])
|
|
|
|
|
|
//渲染完成
|
|
//渲染完成
|
|
-onMounted(() => {
|
|
|
|
|
|
+onActivated(() => {
|
|
|
|
+ dataId.value = useRoutes?.query?.id || ''
|
|
|
|
+ console.log( dataId.value, 'dataId.value')
|
|
if (dataType === 1) {
|
|
if (dataType === 1) {
|
|
TreeAutoExpandKeys.value = getStoreValue('TreeExpandKeys')
|
|
TreeAutoExpandKeys.value = getStoreValue('TreeExpandKeys')
|
|
}
|
|
}
|
|
formDataFormat({})
|
|
formDataFormat({})
|
|
|
|
+
|
|
queryById()
|
|
queryById()
|
|
formValue.value.shootingUser = userInfo.value['real_name']
|
|
formValue.value.shootingUser = userInfo.value['real_name']
|
|
if (wbsNodeIds) {
|
|
if (wbsNodeIds) {
|
|
@@ -220,9 +223,9 @@ onMounted(() => {
|
|
//详情
|
|
//详情
|
|
const queryByLoading = ref(false)
|
|
const queryByLoading = ref(false)
|
|
const queryById = async () => {
|
|
const queryById = async () => {
|
|
- if (dataId) {
|
|
|
|
|
|
+ if (dataId.value) {
|
|
queryByLoading.value = true
|
|
queryByLoading.value = true
|
|
- const { error, code, data } = await imageApi.queryById({ id: dataId })
|
|
|
|
|
|
+ const { error, code, data } = await imageApi.queryById({ id: dataId.value })
|
|
//判断状态
|
|
//判断状态
|
|
queryByLoading.value = false
|
|
queryByLoading.value = false
|
|
if (!error && code === 200) {
|
|
if (!error && code === 200) {
|
|
@@ -250,9 +253,18 @@ const getFileTitleNamedata = async (wbsNodeIds) => {
|
|
const wbsId = ref('')
|
|
const wbsId = ref('')
|
|
const treeItemInfo = ref({})
|
|
const treeItemInfo = ref({})
|
|
const nodeWbsElTreeClick = ({ data, keys }) => {
|
|
const nodeWbsElTreeClick = ({ data, keys }) => {
|
|
|
|
+ if (dataId.value.length > 1 && data['primaryKeyId'] !== wbsNodeIds) {
|
|
|
|
+ window.$message.warning('编辑文件时,不可切换节点')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
if (data.notExsitChild === true) {
|
|
if (data.notExsitChild === true) {
|
|
treeItemInfo.value = data
|
|
treeItemInfo.value = data
|
|
wbsId.value = data['primaryKeyId']
|
|
wbsId.value = data['primaryKeyId']
|
|
|
|
+ if (dataId.value.length < 1) {
|
|
|
|
+ formValue.value = {}
|
|
|
|
+ uploadFileList.value = []
|
|
|
|
+ previewFileList.value = []
|
|
|
|
+ }
|
|
formValue.value.wbsId = data['primaryKeyId']
|
|
formValue.value.wbsId = data['primaryKeyId']
|
|
getFileTitleNamedata(data['primaryKeyId'])
|
|
getFileTitleNamedata(data['primaryKeyId'])
|
|
//缓存自动展开
|
|
//缓存自动展开
|