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