fix: id类型错误

This commit is contained in:
TsMask
2025-02-26 17:25:17 +08:00
parent 8e4df6a85f
commit 15ebd48283
6 changed files with 20 additions and 24 deletions

View File

@@ -351,7 +351,7 @@ defineExpose({
showRemoveIcon: true, showRemoveIcon: true,
showDownloadIcon: false, showDownloadIcon: false,
}" }"
:remove="fnBeforeRemoveFile" @remove="fnBeforeRemoveFile"
:before-upload="fnBeforeUploadFile" :before-upload="fnBeforeUploadFile"
:custom-request="fnUploadFile" :custom-request="fnUploadFile"
:disabled="modalState.confirmLoading" :disabled="modalState.confirmLoading"

View File

@@ -25,8 +25,8 @@ const props = defineProps({
}, },
/**记录ID 优先级高于neId */ /**记录ID 优先级高于neId */
editId: { editId: {
type: String, type: Number,
default: '', default: 0,
}, },
/**网元ID */ /**网元ID */
neId: { neId: {
@@ -219,7 +219,7 @@ function fnDownCode() {
* 对话框弹出显示为 ID编辑 * 对话框弹出显示为 ID编辑
* @param id id * @param id id
*/ */
function fnModalVisibleById(id: string) { function fnModalVisibleById(id: number) {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
getNeLicense(id) getNeLicense(id)
.then(res => { .then(res => {
@@ -269,7 +269,7 @@ watch(
() => props.open, () => props.open,
val => { val => {
if (val) { if (val) {
if (props.editId) { if (props.editId > 0) {
fnModalVisibleById(props.editId); fnModalVisibleById(props.editId);
} }
if (props.neType && props.neId) { if (props.neType && props.neId) {

View File

@@ -211,7 +211,7 @@ type ModalStateType = {
/**新增框或修改框是否显示 */ /**新增框或修改框是否显示 */
openByEdit: boolean; openByEdit: boolean;
/**授权记录ID */ /**授权记录ID */
licenseId: string; licenseId: number;
/**确定按钮 loading */ /**确定按钮 loading */
confirmLoading: boolean; confirmLoading: boolean;
}; };
@@ -219,7 +219,7 @@ type ModalStateType = {
/**对话框对象信息状态 */ /**对话框对象信息状态 */
let modalState: ModalStateType = reactive({ let modalState: ModalStateType = reactive({
openByEdit: false, openByEdit: false,
licenseId: '', licenseId: 0,
confirmLoading: false, confirmLoading: false,
}); });
@@ -227,7 +227,7 @@ let modalState: ModalStateType = reactive({
* 对话框弹出显示为 新增或者修改 * 对话框弹出显示为 新增或者修改
* @param licenseId id * @param licenseId id
*/ */
function fnModalVisibleByEdit(licenseId: string) { function fnModalVisibleByEdit(licenseId: number) {
modalState.licenseId = licenseId; modalState.licenseId = licenseId;
modalState.openByEdit = true; modalState.openByEdit = true;
} }
@@ -247,7 +247,7 @@ function fnModalOk() {
*/ */
function fnModalCancel() { function fnModalCancel() {
modalState.openByEdit = false; modalState.openByEdit = false;
modalState.licenseId = ''; modalState.licenseId = 0;
} }
/**刷新网元授权状态 */ /**刷新网元授权状态 */

View File

@@ -21,8 +21,8 @@ const props = defineProps({
default: false, default: false,
}, },
editId: { editId: {
type: String, type: Number,
default: '', default: 0,
}, },
}); });
@@ -309,8 +309,8 @@ function fnUploadFileDep(up: UploadRequestOption) {
* 对话框弹出显示为 新增或者修改 * 对话框弹出显示为 新增或者修改
* @param id id * @param id id
*/ */
function fnModalVisibleByEdit(id?: string) { function fnModalVisibleByEdit(id: number) {
if (id) { if (id > 0) {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
getNeSoftware(id) getNeSoftware(id)
.then(res => { .then(res => {

View File

@@ -485,7 +485,7 @@ onMounted(() => {});
showRemoveIcon: true, showRemoveIcon: true,
showDownloadIcon: false, showDownloadIcon: false,
}" }"
:remove="fnBeforeRemoveFile" @remove="fnBeforeRemoveFile"
:before-upload="fnBeforeUploadFile" :before-upload="fnBeforeUploadFile"
:custom-request="fnUploadFile" :custom-request="fnUploadFile"
:disabled="modalState.confirmLoading" :disabled="modalState.confirmLoading"

View File

@@ -216,7 +216,7 @@ type ModalStateType = {
/**新增框或修改框是否显示 */ /**新增框或修改框是否显示 */
openByEdit: boolean; openByEdit: boolean;
/**新增框或修改框ID */ /**新增框或修改框ID */
editId: string; editId: number;
/**多文件上传 */ /**多文件上传 */
openByMoreFile: boolean; openByMoreFile: boolean;
/**确定按钮 loading */ /**确定按钮 loading */
@@ -226,7 +226,7 @@ type ModalStateType = {
/**对话框对象信息状态 */ /**对话框对象信息状态 */
let modalState: ModalStateType = reactive({ let modalState: ModalStateType = reactive({
openByEdit: false, openByEdit: false,
editId: '', editId: 0,
openByMoreFile: false, openByMoreFile: false,
confirmLoading: false, confirmLoading: false,
}); });
@@ -235,12 +235,8 @@ let modalState: ModalStateType = reactive({
* 对话框弹出显示为 新增或者修改 * 对话框弹出显示为 新增或者修改
* @param noticeId 网元id, 不传为新增 * @param noticeId 网元id, 不传为新增
*/ */
function fnModalVisibleByEdit(id?: string) { function fnModalVisibleByEdit(id: number) {
if (!id) { modalState.editId = id;
modalState.editId = '';
} else {
modalState.editId = id;
}
modalState.openByEdit = !modalState.openByEdit; modalState.openByEdit = !modalState.openByEdit;
} }
@@ -257,7 +253,7 @@ function fnModalEditOk() {
* 进行表达规则校验 * 进行表达规则校验
*/ */
function fnModalEditCancel() { function fnModalEditCancel() {
modalState.editId = ''; modalState.editId = 0;
modalState.openByEdit = false; modalState.openByEdit = false;
modalState.openByMoreFile = false; modalState.openByMoreFile = false;
} }
@@ -422,7 +418,7 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 --> <!-- 插槽-卡片左侧侧 -->
<template #title> <template #title>
<a-space :size="8" align="center"> <a-space :size="8" align="center">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()"> <a-button type="primary" @click.prevent="fnModalVisibleByEdit(0)">
<template #icon><UploadOutlined /></template> <template #icon><UploadOutlined /></template>
{{ t('views.ne.neSoftware.upload') }} {{ t('views.ne.neSoftware.upload') }}
</a-button> </a-button>