feat: 根据网元显示特有菜单

This commit is contained in:
TsMask
2025-05-07 15:45:54 +08:00
parent 2c2ca82442
commit d3efefe7c5
58 changed files with 1110 additions and 1377 deletions

View File

@@ -4,14 +4,14 @@ import { PageContainer } from 'antdv-pro-layout';
import { Modal, TableColumnsType, message } from 'ant-design-vue/es';
import { SizeType } from 'ant-design-vue/es/config-provider';
import { MenuInfo } from 'ant-design-vue/es/menu/src/interface';
import useNeInfoStore from '@/store/modules/neinfo';
import useNeListStore from '@/store/modules/ne_list';
import useI18n from '@/hooks/useI18n';
import { NE_TYPE_LIST } from '@/constants/ne-constants';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { listNeSoftware, delNeSoftware } from '@/api/ne/neSoftware';
import { parseDateToStr } from '@/utils/date-utils';
import { downloadFile } from '@/api/tool/file';
import { saveAs } from 'file-saver';
const neListStore = useNeListStore();
const { t } = useI18n();
// 异步加载组件
@@ -22,9 +22,6 @@ const UploadMoreFile = defineAsyncComponent(
() => import('./components/UploadMoreFile.vue')
);
/**网元参数 */
let neOtions = ref<Record<string, any>[]>([]);
/**查询参数 */
let queryParams = reactive({
/**网元类型 */
@@ -127,7 +124,7 @@ let tableColumns = ref<TableColumnsType>([
if (!opt.value) return '';
return parseDateToStr(opt.value);
},
width: 150,
width: 200,
},
{
title: t('common.operate'),
@@ -191,7 +188,7 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum;
}
listNeSoftware(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
if (res.code === RESULT_CODE_SUCCESS) {
const { total, rows } = res.data;
tablePagination.total = total;
tableState.data = rows;
@@ -335,23 +332,8 @@ function fnRecordMore(type: string | number, row: Record<string, any>) {
}
onMounted(() => {
// 获取网元网元列表
useNeInfoStore()
.fnNelist()
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
neOtions.value = useNeInfoStore().getNeSelectOtions;
} else {
message.warning({
content: t('common.noData'),
duration: 2,
});
}
})
.finally(() => {
// 获取列表数据
fnGetList();
});
// 获取列表数据
fnGetList();
});
</script>
@@ -369,7 +351,7 @@ onMounted(() => {
<a-form-item :label="t('views.ne.common.neType')" name="neType ">
<a-auto-complete
v-model:value="queryParams.neType"
:options="NE_TYPE_LIST.map(v => ({ value: v }))"
:options="neListStore.getNeSelectOtions"
allow-clear
:placeholder="t('common.inputPlease')"
/>
@@ -505,7 +487,7 @@ onMounted(() => {
:data-source="tableState.data"
:size="tableState.size"
:pagination="tablePagination"
:scroll="{ x: tableColumns.length * 150 }"
:scroll="{ x: tableColumns.length * 180 }"
@resizeColumn="(w:number, col:any) => (col.width = w)"
:row-selection="{
type: 'checkbox',