feat: 网元版本状态标签字典
This commit is contained in:
@@ -5,14 +5,16 @@ import { Modal, TableColumnsType, message } from 'ant-design-vue/lib';
|
|||||||
import { SizeType } from 'ant-design-vue/lib/config-provider';
|
import { SizeType } from 'ant-design-vue/lib/config-provider';
|
||||||
import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface';
|
import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface';
|
||||||
import useNeInfoStore from '@/store/modules/neinfo';
|
import useNeInfoStore from '@/store/modules/neinfo';
|
||||||
import useI18n from '@/hooks/useI18n';
|
|
||||||
import { NE_TYPE_LIST } from '@/constants/ne-constants';
|
import { NE_TYPE_LIST } from '@/constants/ne-constants';
|
||||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||||
import { listNeVersion, operateNeVersion } from '@/api/ne/neVersion';
|
import { listNeVersion, operateNeVersion } from '@/api/ne/neVersion';
|
||||||
import { parseDateToStr } from '@/utils/date-utils';
|
import { parseDateToStr } from '@/utils/date-utils';
|
||||||
|
import useI18n from '@/hooks/useI18n';
|
||||||
|
import useDictStore from '@/store/modules/dict';
|
||||||
import useLockedStore from '@/store/modules/locked';
|
import useLockedStore from '@/store/modules/locked';
|
||||||
const lockedStore = useLockedStore();
|
const lockedStore = useLockedStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { getDict } = useDictStore();
|
||||||
|
|
||||||
// 异步加载组件
|
// 异步加载组件
|
||||||
const EditModal = defineAsyncComponent(
|
const EditModal = defineAsyncComponent(
|
||||||
@@ -22,6 +24,9 @@ const UploadMoreFile = defineAsyncComponent(
|
|||||||
() => import('../neSoftware/components/UploadMoreFile.vue')
|
() => import('../neSoftware/components/UploadMoreFile.vue')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**字典数据-状态 */
|
||||||
|
let dictStatus = ref<DictType[]>([]);
|
||||||
|
|
||||||
/**网元参数 */
|
/**网元参数 */
|
||||||
let neOtions = ref<Record<string, any>[]>([]);
|
let neOtions = ref<Record<string, any>[]>([]);
|
||||||
|
|
||||||
@@ -267,7 +272,7 @@ function fnRecordVersion(
|
|||||||
) {
|
) {
|
||||||
let contentTip = `${action} version packages?`;
|
let contentTip = `${action} version packages?`;
|
||||||
if (action === 'upgrade') {
|
if (action === 'upgrade') {
|
||||||
contentTip = t('views.ne.neVersion.upgradeTip')
|
contentTip = t('views.ne.neVersion.upgradeTip');
|
||||||
if (row.newVersion === '' || row.newVersion === '-') {
|
if (row.newVersion === '' || row.newVersion === '-') {
|
||||||
message.warning(t('views.ne.neVersion.upgradeTipEmpty'), 3);
|
message.warning(t('views.ne.neVersion.upgradeTipEmpty'), 3);
|
||||||
return;
|
return;
|
||||||
@@ -278,7 +283,7 @@ function fnRecordVersion(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (action === 'rollback') {
|
if (action === 'rollback') {
|
||||||
contentTip = t('views.ne.neVersion.rollbackTip')
|
contentTip = t('views.ne.neVersion.rollbackTip');
|
||||||
if (row.preVersion === '' || row.preVersion === '-') {
|
if (row.preVersion === '' || row.preVersion === '-') {
|
||||||
message.warning(t('views.ne.neVersion.rollbackTipEmpty'), 3);
|
message.warning(t('views.ne.neVersion.rollbackTipEmpty'), 3);
|
||||||
return;
|
return;
|
||||||
@@ -410,6 +415,10 @@ function fnRecordUpgrade() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
// 初始字典数据
|
||||||
|
getDict('ne_version_status').then(res => {
|
||||||
|
dictStatus.value = res;
|
||||||
|
});
|
||||||
// 获取网元网元列表
|
// 获取网元网元列表
|
||||||
useNeInfoStore()
|
useNeInfoStore()
|
||||||
.fnNelist()
|
.fnNelist()
|
||||||
@@ -586,6 +595,9 @@ onMounted(() => {
|
|||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<DictTag :options="dictStatus" :value="record.status" />
|
||||||
|
</template>
|
||||||
<template v-if="column.key === 'id'">
|
<template v-if="column.key === 'id'">
|
||||||
<a-space :size="8" align="center">
|
<a-space :size="8" align="center">
|
||||||
<a-tooltip placement="topRight">
|
<a-tooltip placement="topRight">
|
||||||
|
|||||||
@@ -3,12 +3,19 @@ import { Modal, TableColumnsType, message } from 'ant-design-vue/lib';
|
|||||||
import { defineAsyncComponent, onMounted, reactive, ref, toRaw } from 'vue';
|
import { defineAsyncComponent, onMounted, reactive, ref, toRaw } from 'vue';
|
||||||
import { fnToStepName } from '../hooks/useStep';
|
import { fnToStepName } from '../hooks/useStep';
|
||||||
import useI18n from '@/hooks/useI18n';
|
import useI18n from '@/hooks/useI18n';
|
||||||
|
import useDictStore from '@/store/modules/dict';
|
||||||
import { listNeVersion, operateNeVersion } from '@/api/ne/neVersion';
|
import { listNeVersion, operateNeVersion } from '@/api/ne/neVersion';
|
||||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { getDict } = useDictStore();
|
||||||
|
|
||||||
const UploadMoreFile = defineAsyncComponent(
|
const UploadMoreFile = defineAsyncComponent(
|
||||||
() => import('../../../ne/neSoftware/components/UploadMoreFile.vue')
|
() => import('../../../ne/neSoftware/components/UploadMoreFile.vue')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**字典数据-状态 */
|
||||||
|
let dictStatus = ref<DictType[]>([]);
|
||||||
|
|
||||||
/**表格字段列 */
|
/**表格字段列 */
|
||||||
let tableColumns = ref<TableColumnsType>([
|
let tableColumns = ref<TableColumnsType>([
|
||||||
{
|
{
|
||||||
@@ -44,6 +51,7 @@ let tableColumns = ref<TableColumnsType>([
|
|||||||
{
|
{
|
||||||
title: 'status',
|
title: 'status',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
|
key: 'status',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
@@ -214,7 +222,14 @@ function fnStepNext(stepName: 'NeInfoSoftwareLicense') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fnGetList();
|
// 初始字典数据
|
||||||
|
getDict('ne_version_status')
|
||||||
|
.then(res => {
|
||||||
|
dictStatus.value = res;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
fnGetList();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -238,6 +253,11 @@ onMounted(() => {
|
|||||||
onChange: fnTableSelectedRowKeys,
|
onChange: fnTableSelectedRowKeys,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<DictTag :options="dictStatus" :value="record.status" />
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
|
|
||||||
<!-- 新增多文件上传框 -->
|
<!-- 新增多文件上传框 -->
|
||||||
@@ -255,6 +275,8 @@ onMounted(() => {
|
|||||||
:visible="state.visibleByUpgrade"
|
:visible="state.visibleByUpgrade"
|
||||||
title="Upgrade Version"
|
title="Upgrade Version"
|
||||||
:confirm-loading="state.confirmLoading"
|
:confirm-loading="state.confirmLoading"
|
||||||
|
:closable="false"
|
||||||
|
:cancelButtonProps="{ disabled: state.visibleByUpgrade }"
|
||||||
@ok="fnModalOk"
|
@ok="fnModalOk"
|
||||||
@cancel="fnModalCancel"
|
@cancel="fnModalCancel"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user