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