解决产品新增编辑问题
Showing
5 changed files
with
32 additions
and
15 deletions
src/store/modules/dataRegisterCatalog.ts
0 → 100644
| 1 | const useDataRegisterCatalogStore = defineStore( | ||
| 2 | 'isRefresh', | ||
| 3 | () => { | ||
| 4 | const isRefresh = ref<boolean>(false) | ||
| 5 | |||
| 6 | function set(v: boolean) { | ||
| 7 | isRefresh.value = v; | ||
| 8 | } | ||
| 9 | |||
| 10 | return { | ||
| 11 | isRefresh, | ||
| 12 | set, | ||
| 13 | } | ||
| 14 | }, | ||
| 15 | ) | ||
| 16 | |||
| 17 | export default useDataRegisterCatalogStore | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -30,7 +30,7 @@ import { | ... | @@ -30,7 +30,7 @@ import { |
| 30 | import { ContentWrap } from '@/components/ContentWrap'; | 30 | import { ContentWrap } from '@/components/ContentWrap'; |
| 31 | import importTableField from "./importTableField.vue"; | 31 | import importTableField from "./importTableField.vue"; |
| 32 | import { useValidator } from '@/hooks/useValidator'; | 32 | import { useValidator } from '@/hooks/useValidator'; |
| 33 | import useDataAssetStore from "@/store/modules/dataAsset"; | 33 | import useDataRegisterCatalogStore from "@/store/modules/dataRegisterCatalog"; |
| 34 | import { handleContentWrapView, scrollLastRowToView, changeNum } from '@/utils/common'; | 34 | import { handleContentWrapView, scrollLastRowToView, changeNum } from '@/utils/common'; |
| 35 | import { TableColumnWidth } from '@/utils/enum'; | 35 | import { TableColumnWidth } from '@/utils/enum'; |
| 36 | import { CirclePlus } from '@element-plus/icons-vue'; | 36 | import { CirclePlus } from '@element-plus/icons-vue'; |
| ... | @@ -38,7 +38,7 @@ import { CirclePlus } from '@element-plus/icons-vue'; | ... | @@ -38,7 +38,7 @@ import { CirclePlus } from '@element-plus/icons-vue'; |
| 38 | const { proxy } = getCurrentInstance() as any; | 38 | const { proxy } = getCurrentInstance() as any; |
| 39 | const { required, checkExistName } = useValidator(); | 39 | const { required, checkExistName } = useValidator(); |
| 40 | const userStore = useUserStore(); | 40 | const userStore = useUserStore(); |
| 41 | const assetStore = useDataAssetStore(); | 41 | const registerStore = useDataRegisterCatalogStore(); |
| 42 | const router = useRouter(); | 42 | const router = useRouter(); |
| 43 | const route = useRoute(); | 43 | const route = useRoute(); |
| 44 | const fullPath = route.fullPath; | 44 | const fullPath = route.fullPath; |
| ... | @@ -1088,8 +1088,8 @@ const save = () => { | ... | @@ -1088,8 +1088,8 @@ const save = () => { |
| 1088 | // name: 'registerCatalogManagement' | 1088 | // name: 'registerCatalogManagement' |
| 1089 | path: route.query.dataSources == '1' ? '/data-asset/authordata-catalog' : '/data-asset/register-catalog' | 1089 | path: route.query.dataSources == '1' ? '/data-asset/authordata-catalog' : '/data-asset/register-catalog' |
| 1090 | }); | 1090 | }); |
| 1091 | assetStore.setDamCatalogRefresh(true); | ||
| 1092 | userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); | 1091 | userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); |
| 1092 | registerStore.set(true); | ||
| 1093 | } else { | 1093 | } else { |
| 1094 | proxy.$ElMessage.error(res.msg); | 1094 | proxy.$ElMessage.error(res.msg); |
| 1095 | } | 1095 | } |
| ... | @@ -1114,8 +1114,8 @@ const save = () => { | ... | @@ -1114,8 +1114,8 @@ const save = () => { |
| 1114 | // name: 'registerCatalogManagement' | 1114 | // name: 'registerCatalogManagement' |
| 1115 | path: route.query.dataSources == '1' ? '/data-asset/authordata-catalog' : '/data-asset/register-catalog' | 1115 | path: route.query.dataSources == '1' ? '/data-asset/authordata-catalog' : '/data-asset/register-catalog' |
| 1116 | }); | 1116 | }); |
| 1117 | assetStore.setDamCatalogRefresh(true); | ||
| 1118 | userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); | 1117 | userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); |
| 1118 | registerStore.set(true); | ||
| 1119 | } else { | 1119 | } else { |
| 1120 | proxy.$ElMessage.error(res.msg); | 1120 | proxy.$ElMessage.error(res.msg); |
| 1121 | } | 1121 | } | ... | ... |
| ... | @@ -27,7 +27,7 @@ import { ElMessage, ElMessageBox } from "element-plus"; | ... | @@ -27,7 +27,7 @@ import { ElMessage, ElMessageBox } from "element-plus"; |
| 27 | import { passFlowData, rejectFlowData, revokeFlowData, isMyFirstNode } from "@/api/modules/workFlowService"; | 27 | import { passFlowData, rejectFlowData, revokeFlowData, isMyFirstNode } from "@/api/modules/workFlowService"; |
| 28 | import { onUploadFilePreview, onUploadFileDownload } from '@/api/modules/common'; | 28 | import { onUploadFilePreview, onUploadFileDownload } from '@/api/modules/common'; |
| 29 | import { CircleCloseFilled } from '@element-plus/icons-vue' | 29 | import { CircleCloseFilled } from '@element-plus/icons-vue' |
| 30 | import useDataAssetStore from "@/store/modules/dataAsset"; | 30 | import useDataRegisterCatalogStore from "@/store/modules/dataRegisterCatalog"; |
| 31 | import { TableColumnWidth } from '@/utils/enum'; | 31 | import { TableColumnWidth } from '@/utils/enum'; |
| 32 | import { | 32 | import { |
| 33 | downloadTableData, | 33 | downloadTableData, |
| ... | @@ -40,7 +40,7 @@ const router = useRouter(); | ... | @@ -40,7 +40,7 @@ const router = useRouter(); |
| 40 | const route = useRoute(); | 40 | const route = useRoute(); |
| 41 | const userStore = useUserStore(); | 41 | const userStore = useUserStore(); |
| 42 | const userData = JSON.parse(userStore.userData) | 42 | const userData = JSON.parse(userStore.userData) |
| 43 | const assetStore = useDataAssetStore(); | 43 | const registerStore = useDataRegisterCatalogStore(); |
| 44 | const fullPath = route.fullPath; | 44 | const fullPath = route.fullPath; |
| 45 | const catalogGuid = route.query.guid; | 45 | const catalogGuid = route.query.guid; |
| 46 | const evaGuid = route.query.evaGuid; | 46 | const evaGuid = route.query.evaGuid; |
| ... | @@ -380,7 +380,7 @@ const strategyDetail = ref([]); | ... | @@ -380,7 +380,7 @@ const strategyDetail = ref([]); |
| 380 | const strategyContentLoading = ref(false); | 380 | const strategyContentLoading = ref(false); |
| 381 | 381 | ||
| 382 | onBeforeMount(() => { | 382 | onBeforeMount(() => { |
| 383 | if (!assetStore.isRefreshDamCatalog) { | 383 | if (!registerStore.isRefresh) { |
| 384 | getDetailInfo(); | 384 | getDetailInfo(); |
| 385 | } | 385 | } |
| 386 | if (route.query.useGuid) { | 386 | if (route.query.useGuid) { |
| ... | @@ -405,9 +405,9 @@ onActivated(() => { | ... | @@ -405,9 +405,9 @@ onActivated(() => { |
| 405 | tab.meta.title = foundMode.value == 'download' ? `下载详情-${route.query.name}` : ((foundMode.value == 'read' || foundMode.value == 'readAndDown') ? `查看详情-${route.query.name}` : `详情-${route.query.name}`); | 405 | tab.meta.title = foundMode.value == 'download' ? `下载详情-${route.query.name}` : ((foundMode.value == 'read' || foundMode.value == 'readAndDown') ? `查看详情-${route.query.name}` : `详情-${route.query.name}`); |
| 406 | } | 406 | } |
| 407 | } | 407 | } |
| 408 | if (assetStore.isRefreshDamCatalog) { | 408 | if (registerStore.isRefresh) { |
| 409 | getDetailInfo(); | 409 | getDetailInfo(); |
| 410 | assetStore.setDamCatalogRefresh(false); | 410 | registerStore.set(false); |
| 411 | } | 411 | } |
| 412 | }); | 412 | }); |
| 413 | 413 | ... | ... |
| ... | @@ -14,14 +14,14 @@ import { | ... | @@ -14,14 +14,14 @@ import { |
| 14 | getDataReceiveContract | 14 | getDataReceiveContract |
| 15 | } from "@/api/modules/dataAsset"; | 15 | } from "@/api/modules/dataAsset"; |
| 16 | import { commonPageConfig } from "@/utils/enum"; | 16 | import { commonPageConfig } from "@/utils/enum"; |
| 17 | import useDataAssetStore from "@/store/modules/dataAsset"; | 17 | import useDataRegisterCatalogStore from "@/store/modules/dataRegisterCatalog"; |
| 18 | import useUserStore from "@/store/modules/user"; | 18 | import useUserStore from "@/store/modules/user"; |
| 19 | import deliverUploadDialog from "./components/deliverUploadDialog.vue"; | 19 | import deliverUploadDialog from "./components/deliverUploadDialog.vue"; |
| 20 | 20 | ||
| 21 | const userStore = useUserStore(); | 21 | const userStore = useUserStore(); |
| 22 | const userData = JSON.parse(userStore.userData); | 22 | const userData = JSON.parse(userStore.userData); |
| 23 | 23 | ||
| 24 | const assetStore = useDataAssetStore(); | 24 | const registerStore = useDataRegisterCatalogStore(); |
| 25 | 25 | ||
| 26 | const props = defineProps({ | 26 | const props = defineProps({ |
| 27 | dataSources: { | 27 | dataSources: { |
| ... | @@ -271,11 +271,11 @@ const pageChange = (info) => { | ... | @@ -271,11 +271,11 @@ const pageChange = (info) => { |
| 271 | }; | 271 | }; |
| 272 | 272 | ||
| 273 | onActivated(() => { | 273 | onActivated(() => { |
| 274 | if (assetStore.isRefreshDamCatalog) { | 274 | if (registerStore.isRefresh) { |
| 275 | //如果是首次加载,则不需要调用 | 275 | //如果是首次加载,则不需要调用 |
| 276 | pageInfo.value.curr = 1; | 276 | pageInfo.value.curr = 1; |
| 277 | getTableData(); | 277 | getTableData(); |
| 278 | assetStore.setDamCatalogRefresh(false); | 278 | registerStore.set(false); |
| 279 | } | 279 | } |
| 280 | }); | 280 | }); |
| 281 | 281 | ||
| ... | @@ -376,7 +376,7 @@ const handleClickUploadBtn = (item) => { | ... | @@ -376,7 +376,7 @@ const handleClickUploadBtn = (item) => { |
| 376 | const handleUploadClose = (itemGuid) => { | 376 | const handleUploadClose = (itemGuid) => { |
| 377 | deliverUploadVisible.value = false | 377 | deliverUploadVisible.value = false |
| 378 | if (itemGuid) { | 378 | if (itemGuid) { |
| 379 | assetStore.setDamCatalogRefresh(true); | 379 | registerStore.set(true); |
| 380 | router.push({ | 380 | router.push({ |
| 381 | path: props.dataSources == 1 ? '/data-asset/authordata-catalog/register-catalog-detail' : '/data-asset/register-catalog/register-catalog-detail', | 381 | path: props.dataSources == 1 ? '/data-asset/authordata-catalog/register-catalog-detail' : '/data-asset/register-catalog/register-catalog-detail', |
| 382 | //name: "registerCatalogDetail", | 382 | //name: "registerCatalogDetail", | ... | ... |
| ... | @@ -67,7 +67,7 @@ const processTableInfo = ref({ | ... | @@ -67,7 +67,7 @@ const processTableInfo = ref({ |
| 67 | { label: "操作时间", field: "operatingTime", width: 170 }, | 67 | { label: "操作时间", field: "operatingTime", width: 170 }, |
| 68 | { label: "操作类型", field: "operatingType", width: 110, getName: (scope) => { | 68 | { label: "操作类型", field: "operatingType", width: 110, getName: (scope) => { |
| 69 | let typeMap = { | 69 | let typeMap = { |
| 70 | 1: '新增', | 70 | 1: '提交', |
| 71 | 2: '修改', | 71 | 2: '修改', |
| 72 | 3: '删除' | 72 | 3: '删除' |
| 73 | } | 73 | } | ... | ... |
-
Please register or sign in to post a comment