fix: license管理类型初始
This commit is contained in:
@@ -2,15 +2,12 @@
|
|||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { reactive, ref, onMounted, toRaw } from 'vue';
|
import { reactive, ref, onMounted, toRaw } from 'vue';
|
||||||
import { PageContainer } from '@ant-design-vue/pro-layout';
|
import { PageContainer } from '@ant-design-vue/pro-layout';
|
||||||
import { Form, message, Modal } from 'ant-design-vue/lib';
|
import { Form, 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 { ColumnsType } from 'ant-design-vue/lib/table';
|
import { ColumnsType } from 'ant-design-vue/lib/table';
|
||||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||||
import {
|
import { uploadLicense, listLicense } from '@/api/configManage/license';
|
||||||
uploadLicense,
|
|
||||||
listLicense,
|
|
||||||
} from '@/api/configManage/license';
|
|
||||||
import useI18n from '@/hooks/useI18n';
|
import useI18n from '@/hooks/useI18n';
|
||||||
import useNeInfoStore from '@/store/modules/neinfo';
|
import useNeInfoStore from '@/store/modules/neinfo';
|
||||||
import { FileType } from 'ant-design-vue/lib/upload/interface';
|
import { FileType } from 'ant-design-vue/lib/upload/interface';
|
||||||
@@ -133,24 +130,6 @@ function fnTableSize({ key }: MenuInfo) {
|
|||||||
tableState.size = key as SizeType;
|
tableState.size = key as SizeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**文件对话框对象信息状态类型 */
|
|
||||||
type FileStateType = {
|
|
||||||
/**是否下发或激活框 */
|
|
||||||
visible: boolean;
|
|
||||||
/**框类型 */
|
|
||||||
visibleType: string;
|
|
||||||
/**标题 */
|
|
||||||
title: string;
|
|
||||||
/**提示内容 */
|
|
||||||
content: string;
|
|
||||||
/**网元参数 */
|
|
||||||
neOtions: Record<string, any>[];
|
|
||||||
/**表单数据 */
|
|
||||||
from: Record<string, any>;
|
|
||||||
/**确定按钮 loading */
|
|
||||||
confirmLoading: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**查询信息列表 */
|
/**查询信息列表 */
|
||||||
function fnGetList() {
|
function fnGetList() {
|
||||||
if (tableState.loading) return;
|
if (tableState.loading) return;
|
||||||
@@ -176,8 +155,6 @@ type ModalStateType = {
|
|||||||
visibleByHistory: boolean;
|
visibleByHistory: boolean;
|
||||||
/**标题 */
|
/**标题 */
|
||||||
title: string;
|
title: string;
|
||||||
/**网元类型设备对象 */
|
|
||||||
neType: string[];
|
|
||||||
/**表单数据 */
|
/**表单数据 */
|
||||||
from: Record<string, any>;
|
from: Record<string, any>;
|
||||||
/**确定按钮 loading */
|
/**确定按钮 loading */
|
||||||
@@ -189,9 +166,8 @@ let modalState: ModalStateType = reactive({
|
|||||||
visibleByEdit: false,
|
visibleByEdit: false,
|
||||||
visibleByHistory: false,
|
visibleByHistory: false,
|
||||||
title: '任务设置',
|
title: '任务设置',
|
||||||
neType: [],
|
|
||||||
from: {
|
from: {
|
||||||
neType: '',
|
neType: undefined,
|
||||||
comment: '',
|
comment: '',
|
||||||
file: undefined,
|
file: undefined,
|
||||||
fileList: [],
|
fileList: [],
|
||||||
@@ -244,8 +220,8 @@ function fnModalOk() {
|
|||||||
modalState.confirmLoading = true;
|
modalState.confirmLoading = true;
|
||||||
const from = toRaw(modalState.from);
|
const from = toRaw(modalState.from);
|
||||||
let formData = new FormData();
|
let formData = new FormData();
|
||||||
formData.append('nfType', modalState.neType[0]);
|
formData.append('nfType', from.neType[0]);
|
||||||
formData.append('nfId', modalState.neType[1]);
|
formData.append('nfId', from.neType[1]);
|
||||||
formData.append('comment', from.comment);
|
formData.append('comment', from.comment);
|
||||||
formData.append('file', from.file);
|
formData.append('file', from.file);
|
||||||
const hide = message.loading({ content: t('common.loading') });
|
const hide = message.loading({ content: t('common.loading') });
|
||||||
@@ -287,13 +263,6 @@ function fnModalCancel() {
|
|||||||
modalStateFrom.resetFields();
|
modalStateFrom.resetFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 对话框弹出显示为 网元版本信息
|
|
||||||
*/
|
|
||||||
function fnModalVisibleByHistory() {
|
|
||||||
modalState.visibleByHistory = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**上传前检查或转换压缩 */
|
/**上传前检查或转换压缩 */
|
||||||
function fnBeforeUploadFile(file: FileType) {
|
function fnBeforeUploadFile(file: FileType) {
|
||||||
if (modalState.confirmLoading) return false;
|
if (modalState.confirmLoading) return false;
|
||||||
@@ -337,10 +306,8 @@ onMounted(() => {
|
|||||||
.fnNelist()
|
.fnNelist()
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||||
if (res.data.length > 0) {
|
// 获取列表数据
|
||||||
const item = res.data[0];
|
fnGetList();
|
||||||
modalState.from.neType = item.neType;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
message.warning({
|
message.warning({
|
||||||
content: `暂无网元列表数据`,
|
content: `暂无网元列表数据`,
|
||||||
@@ -348,8 +315,6 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 获取列表数据
|
|
||||||
fnGetList();
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -487,15 +452,8 @@ onMounted(() => {
|
|||||||
name="neType"
|
name="neType"
|
||||||
v-bind="modalStateFrom.validateInfos.neType"
|
v-bind="modalStateFrom.validateInfos.neType"
|
||||||
>
|
>
|
||||||
<!-- <a-select
|
|
||||||
v-model:value="modalState.from.neType"
|
|
||||||
:options="useNeInfoStore().getNeCascaderOtions"
|
|
||||||
:placeholder="t('views.configManage.softwareManage.neTypePlease')"
|
|
||||||
>
|
|
||||||
</a-select> -->
|
|
||||||
|
|
||||||
<a-cascader
|
<a-cascader
|
||||||
v-model:value="modalState.neType"
|
v-model:value="modalState.from.neType"
|
||||||
:options="useNeInfoStore().getNeCascaderOtions"
|
:options="useNeInfoStore().getNeCascaderOtions"
|
||||||
:allow-clear="false"
|
:allow-clear="false"
|
||||||
:placeholder="t('views.configManage.softwareManage.neTypePlease')"
|
:placeholder="t('views.configManage.softwareManage.neTypePlease')"
|
||||||
|
|||||||
Reference in New Issue
Block a user