|
|
@ -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(); |
|
|
|
|
|
|
|
|
|