Browse Source

路由改为动态

main
wang 1 month ago
parent
commit
6960c04b9e
  1. 44
      smart-flow-web/src/views/jwpy/jwpy/flow/index.vue

44
smart-flow-web/src/views/jwpy/jwpy/flow/index.vue

@ -112,7 +112,7 @@
</template> </template>
<script setup> <script setup>
import { ref, computed, reactive, onMounted } from 'vue'; import { ref, computed, reactive, onMounted, watch } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { message, Modal } from 'ant-design-vue'; import { message, Modal } from 'ant-design-vue';
import { PlusOutlined, DeleteOutlined } from '@ant-design/icons-vue'; import { PlusOutlined, DeleteOutlined } from '@ant-design/icons-vue';
@ -136,21 +136,27 @@ function onTabChange(key) {
queryData(); queryData();
} }
// // URL
const currentBizTypeCode = computed(() => { const currentBizTypeCode = computed(() => {
const path = route.path; // 1. query
if (path.includes('/jcj')) return 'CZZX_SJLY_03'; if (route.query && route.query.sjlyNo) {
if (path.includes('/hz')) return 'CZZX_SJLY_06'; return route.query.sjlyNo;
if (path.includes('/crj')) return 'CZZX_SJLY_10'; }
if (path.includes('/cjg')) return 'CZZX_SJLY_04';
if (path.includes('/za')) return 'CZZX_SJLY_12'; // 2. 110
if (path.includes('/js')) return 'CZZX_SJLY_13'; const title = route.meta?.title;
if (path.includes('/xl')) return 'CZZX_SJLY_14'; if (title) {
if (path.includes('/xzsp')) return 'CZZX_SJLY_11'; const dictStore = useDictStore();
if (path.includes('/ajbl')) return 'CZZX_SJLY_07'; const dictList = dictStore.getDictData(DICT_CODE_ENUM.BUSINESS_CLASSIFICATION);
if (path.includes('/xf')) return 'CZZX_SJLY_08'; const matchItem = dictList.find((item) => {
if (path.includes('/wq')) return 'CZZX_SJLY_17'; const label = item.dataLabel;
if (path.includes('/sqfw')) return 'CZZX_SJLY_18'; return title.includes(label) || label.includes(title);
});
if (matchItem) {
return matchItem.dataValue;
}
}
return undefined; return undefined;
}); });
@ -231,6 +237,14 @@ function resetQuery() {
onMounted(queryData); onMounted(queryData);
//
watch(
() => currentBizTypeCode.value,
() => {
resetQuery();
}
);
// ---------------------------- / ---------------------------- // ---------------------------- / ----------------------------
const formRef = ref(); const formRef = ref();

Loading…
Cancel
Save