|
@@ -197,7 +197,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { nextTick, onDeactivated, onMounted, ref, watch } from 'vue'
|
|
|
+import { nextTick, onDeactivated, onMounted, onUnmounted, ref, watch } from 'vue'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import ListItem from './components/ListItem.vue'
|
|
@@ -268,12 +268,27 @@ onMounted(() => {
|
|
|
getSearchNodeTablesall(2)
|
|
|
getCategoryData()
|
|
|
})
|
|
|
-onDeactivated(() => {
|
|
|
- // 更新内容
|
|
|
- setTimeout(() => {
|
|
|
- window?.location?.reload() //刷新页面
|
|
|
- }, 1000)
|
|
|
+//监听路由参数改变
|
|
|
+watch(() => [
|
|
|
+ useRoutes?.query,
|
|
|
+], ([query]) => {
|
|
|
+ if (isNullES(query.key)) {
|
|
|
+ setTimeout(()=>{
|
|
|
+ window?.location?.reload() //刷新页面
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+}, { deep: true })
|
|
|
+
|
|
|
+//监听项目,合同段
|
|
|
+watch(() => [
|
|
|
+ useAppState.getProjectId,
|
|
|
+ useAppState.getContractId,
|
|
|
+], ([pid, cid]) => {
|
|
|
+ if (pid || cid) {
|
|
|
+ toBackClick()
|
|
|
+ }
|
|
|
})
|
|
|
+
|
|
|
//身份按钮切换数据
|
|
|
const authBtnTabKey = ref(dataType)
|
|
|
const authBtnTabdata = ref([
|