|
@@ -301,7 +301,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { onActivated, onMounted, ref, watch } from 'vue'
|
|
|
-import { useRouter } from 'vue-router'
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
import TestTree from '../material/components/TestTree.vue'
|
|
|
import { delStoreValue, getStoreValue, setStoreValue } from '~src/utils/storage'
|
|
@@ -314,12 +314,13 @@ import dataApi from '~api/tentative/detect/test'
|
|
|
import testSampleApi from '~api/tentative/material/testSample'
|
|
|
import commissionApi from '~api/tentative/detect/commission'
|
|
|
import acquisitionApi from '~api/tentative/acquisition/data'
|
|
|
-import { arrToId, formValidate, getArrValue, getObjVal, isNullES, isString } from 'js-fast-way'
|
|
|
+import { arrToId, formValidate, getArrValue, getObjVal, getObjValue, isNullES, isString } from 'js-fast-way'
|
|
|
import { HcDelMsg } from 'hc-vue3-ui'
|
|
|
import { toPdfPage } from '~uti/btn-auth'
|
|
|
|
|
|
//变量
|
|
|
const router = useRouter()
|
|
|
+const useRoutes = useRoute()
|
|
|
const useAppState = useAppStore()
|
|
|
const userInfo = ref(useAppState.getUserInfo)
|
|
|
const projectId = ref(useAppState.getProjectId)
|
|
@@ -330,10 +331,7 @@ const isCollapse = ref(useAppState.getCollapse)
|
|
|
const isBubble = ref(useAppState.getBubble)
|
|
|
|
|
|
//监听
|
|
|
-watch(() => [
|
|
|
- useAppState.getCollapse,
|
|
|
- useAppState.getBubble,
|
|
|
-], ([Collapse, bubble]) => {
|
|
|
+watch(() => [useAppState.getCollapse, useAppState.getBubble], ([Collapse, bubble]) => {
|
|
|
isCollapse.value = Collapse
|
|
|
isBubble.value = bubble
|
|
|
})
|
|
@@ -357,10 +355,23 @@ onMounted(() => {
|
|
|
|
|
|
//缓存被激活时,重新获取表格数据
|
|
|
onActivated(() => {
|
|
|
- // setMountOnEventKey()
|
|
|
- getTableData()
|
|
|
+ getDataApi()
|
|
|
})
|
|
|
|
|
|
+const isFirstTime = ref(false)
|
|
|
+const getDataApi = async () => {
|
|
|
+ isFirstTime.value = true
|
|
|
+ const routerQuery = useRoutes?.query
|
|
|
+ let currentPage = routerQuery?.current
|
|
|
+ if (isNullES(currentPage)) {
|
|
|
+ searchForm.value.current = 1
|
|
|
+ } else {
|
|
|
+ searchForm.value.current = Number(currentPage)
|
|
|
+ }
|
|
|
+ console.log(searchForm.value)
|
|
|
+ // setMountOnEventKey()
|
|
|
+ getTableData().then()
|
|
|
+}
|
|
|
|
|
|
//获取合同段信息
|
|
|
const contractData = ref([])
|
|
@@ -425,7 +436,12 @@ const wbsElTreeClick = ({ data, keys }) => {
|
|
|
setStoreValue('testTreeExpandKeys', keys)
|
|
|
//改变搜索表单数据
|
|
|
searchForm.value.nodeId = data['primaryKeyId']
|
|
|
- searchForm.value.current = 1
|
|
|
+ if (!isFirstTime.value) {
|
|
|
+ searchForm.value.current = 1
|
|
|
+ } else {
|
|
|
+ isFirstTime.value = false
|
|
|
+ }
|
|
|
+ console.log('isFirstTime', isFirstTime.value)
|
|
|
getTableData()
|
|
|
}
|
|
|
|
|
@@ -550,13 +566,15 @@ const tableSelection = (rows) => {
|
|
|
const addFormModalClick = () => {
|
|
|
delStoreValue('test-form')
|
|
|
setStoreValue('prenodeDataInfo', nodeDataInfo.value)
|
|
|
+ const obj = getObjValue(searchForm.value)
|
|
|
router.push({
|
|
|
path: '/tentative/detect/test-form',
|
|
|
query: {
|
|
|
nodeId: primaryKeyId.value,
|
|
|
dataType: authBtnTabKey.value,
|
|
|
- cid: searchForm.value?.contractId,
|
|
|
+ cid: obj?.contractId,
|
|
|
isaddType: true,
|
|
|
+ current: obj?.current,
|
|
|
},
|
|
|
})
|
|
|
}
|
|
@@ -565,6 +583,7 @@ const addFormModalClick = () => {
|
|
|
const tableRowEdit = (row, tabTypeKey) => {
|
|
|
setStoreValue('test-form', row)
|
|
|
setStoreValue('prenodeDataInfo', nodeDataInfo.value)
|
|
|
+ const obj = getObjValue(searchForm.value)
|
|
|
router.push({
|
|
|
path: '/tentative/detect/test-form',
|
|
|
query: {
|
|
@@ -572,7 +591,8 @@ const tableRowEdit = (row, tabTypeKey) => {
|
|
|
nodeId: row.nodeId,
|
|
|
dataType: row.type,
|
|
|
tabTypeKey: tabTypeKey,
|
|
|
- cid: searchForm.value?.contractId,
|
|
|
+ cid: obj?.contractId,
|
|
|
+ current: obj?.current,
|
|
|
// prenodeDataInfo:JSON.stringify(nodeDataInfo.value)
|
|
|
},
|
|
|
})
|