服务指令:1、分类标签加数据字典类型指定,2、类别、类型增加默认图片、动态图片组。
This commit is contained in:
parent
8921bd42fc
commit
86a90e42f4
|
|
@ -12,6 +12,14 @@
|
|||
:showCount="true" :disabled="titleDisabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="分类标签类型" v-bind="validateInfos.instructionType"
|
||||
id="ConfigServiceCategoryForm-instructionType" name="instructionType">
|
||||
<j-dict-select-tag type='list' v-model:value="formData.instructionType"
|
||||
dictCode="service_instruction_tag"
|
||||
placeholder="请选择分类标签类型" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" hidden>
|
||||
<a-form-item label="排序" v-bind="validateInfos.sort" id="ConfigServiceCategoryForm-sort" name="sort">
|
||||
<a-input-number v-model:value="formData.sort" placeholder="请输入排序" style="width: 100%" />
|
||||
|
|
@ -26,7 +34,7 @@
|
|||
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="ConfigServiceCategoryForm-izEnabled"
|
||||
name="izEnabled">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled"
|
||||
placeholder="请选择是否启用" allowClear />
|
||||
placeholder="请选择是否启用" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
|
@ -59,6 +67,7 @@ const titleDisabled = ref<boolean>(false);
|
|||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
instructionName: '',
|
||||
instructionType: '',
|
||||
sort: 99,
|
||||
izEnabled: '0',
|
||||
icon:'',
|
||||
|
|
@ -70,6 +79,7 @@ const confirmLoading = ref<boolean>(false);
|
|||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
instructionName: [{ required: true, message: '请输入分类标签名称!' },],
|
||||
instructionType: [{ required: true, message: '请选择分类标签类型!' },],
|
||||
sort: [{ required: true, message: '请输入排序!' }, { pattern: /^\d+$/, message: '请输入正整数!' },],
|
||||
icon: [{ required: true, message: '请选择图标!' }],
|
||||
izEnabled: [{ required: true, message: '请选择是否启用!' },],
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ enum Api {
|
|||
list = '/services/serviceCategory/configServiceCategory/list',
|
||||
save = '/services/serviceCategory/configServiceCategory/add',
|
||||
edit = '/services/serviceCategory/configServiceCategory/edit',
|
||||
getInfo = '/services/serviceCategory/configServiceCategory/getInfo',
|
||||
deleteOne = '/services/serviceCategory/configServiceCategory/delete',
|
||||
deleteBatch = '/services/serviceCategory/configServiceCategory/deleteBatch',
|
||||
importExcel = '/services/serviceCategory/configServiceCategory/importExcel',
|
||||
|
|
@ -31,6 +32,8 @@ export const getImportUrl = Api.importExcel;
|
|||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
export const getInfo = (params) => defHttp.get({ url: Api.getInfo, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
* @param params
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@
|
|||
name="ConfigServiceCategoryForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="分类标签" v-bind="validateInfos.instructionId" id="ConfigServiceTypeForm-instructionId"
|
||||
name="instructionId">
|
||||
<j-dict-select-tag type='list' v-model:value="formData.instructionId"
|
||||
<a-form-item label="分类标签" v-bind="validateInfos.instructionId"
|
||||
id="ConfigServiceTypeForm-instructionId" name="instructionId">
|
||||
<j-dict-select-tag type='list' v-model:value="formData.instructionId" :disabled="formData.colDisabled"
|
||||
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 and iz_enabled = 0 order by sort asc`"
|
||||
placeholder="请选择分类标签" allowClear />
|
||||
</a-form-item>
|
||||
|
|
@ -17,19 +17,37 @@
|
|||
<a-form-item label="服务类别名称" v-bind="validateInfos.categoryName"
|
||||
id="ConfigServiceCategoryForm-categoryName" name="categoryName">
|
||||
<a-input v-model:value="formData.categoryName" placeholder="请输入服务类别名称" :maxlength="10" :showCount="true"
|
||||
:disabled="!formData.instructionId" allow-clear></a-input>
|
||||
:disabled="!formData.instructionId || formData.colDisabled" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="排序" v-bind="validateInfos.sort" id="ConfigServiceCategoryForm-sort" name="sort">
|
||||
<a-input-number v-model:value="formData.sort" placeholder="请输入排序" style="width: 100%" />
|
||||
<a-form-item label="排序" v-bind="validateInfos.sort"
|
||||
id="ConfigServiceCategoryForm-sort" name="sort">
|
||||
<a-input-number v-model:value="formData.sort" :disabled="formData.colDisabled" placeholder="请输入排序" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="ConfigServiceCategoryForm-izEnabled"
|
||||
name="izEnabled">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled"
|
||||
placeholder="请选择是否启用" allowClear />
|
||||
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled"
|
||||
id="ConfigServiceCategoryForm-izEnabled" name="izEnabled">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" :disabled="formData.colDisabled" dictCode="iz_enabled"
|
||||
placeholder="请选择是否启用" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="本地网络标记" v-bind="validateInfos.netFlag"
|
||||
id="ConfigServiceCategoryForm-netFlag" name="netFlag">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.netFlag" dictCode="net_flag"
|
||||
placeholder="请选择本地网络标记" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-show="formData.netFlag=='1'">
|
||||
<a-form-item label="默认图片" v-bind="validateInfos.staticPath" id="ConfigServiceCategoryForm-staticPath" name="staticPath">
|
||||
<JImageUploadToOpe :toOpe="true" :bizPath="'category'" :fileMax="1" v-model:value="formData.staticPath"></JImageUploadToOpe>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-show="formData.netFlag=='1'">
|
||||
<a-form-item label="动画图片" v-bind="validateInfos.animationPath" id="ConfigServiceCategoryForm-animationPath" name="animationPath">
|
||||
<JImageUploadToOpe :toOpe="true" :bizPath="'category'" :fileMax="7" v-model:value="formData.animationPath"></JImageUploadToOpe>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
|
@ -45,9 +63,10 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../ConfigServiceCategory.api';
|
||||
import { getInfo, saveOrUpdate } from '../ConfigServiceCategory.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import JImageUploadToOpe from '/@/components/Form/src/jeecg/components/JImageUploadToOpe.vue';
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({}) },
|
||||
|
|
@ -62,6 +81,10 @@ const formData = reactive<Record<string, any>>({
|
|||
sort: 99,
|
||||
izEnabled: '0',
|
||||
instructionId: '',
|
||||
netFlag: '0',
|
||||
staticPath: '',
|
||||
animationPath: '',
|
||||
colDisabled: false
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||
|
|
@ -92,14 +115,7 @@ const disabled = computed(() => {
|
|||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
function add(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
|
|
@ -110,9 +126,30 @@ function edit(record) {
|
|||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
formData.colDisabled = false;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(data) {
|
||||
getInfo({id: data.id}).then((record) => {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if (record.hasOwnProperty(key)) {
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
formData.colDisabled = true;
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<template>
|
||||
<!-- <j-modal :title="title" :width="width" :visible="visible" @ok="handleOk"
|
||||
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<ConfigServiceCategoryForm ref="registerForm" @ok="submitCallback"
|
||||
<ConfigServiceCategoryForm ref="registerForm" @ok="submitCallback"
|
||||
:formDisabled="disableSubmit" :formBpm="false">
|
||||
</ConfigServiceCategoryForm>
|
||||
</j-modal> -->
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
|
||||
<ConfigServiceCategoryForm ref="registerForm" @ok="submitCallback"
|
||||
<ConfigServiceCategoryForm ref="registerForm" @ok="submitCallback"
|
||||
:formDisabled="disableSubmit" :formBpm="false">
|
||||
</ConfigServiceCategoryForm>
|
||||
<template #footer>
|
||||
|
|
@ -36,11 +36,11 @@ const emit = defineEmits(['register', 'success', 'refresh']);
|
|||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
function add(record) {
|
||||
title.value = '新增';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
registerForm.value.add(record);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ function add() {
|
|||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
title.value = '新增';
|
||||
title.value = '修改';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.edit(record);
|
||||
|
|
|
|||
|
|
@ -1071,11 +1071,7 @@ function addInstruction() {
|
|||
insRegisterModal.value.disableSubmit = false;
|
||||
insRegisterModal.value.add();
|
||||
}
|
||||
//修改动画图片
|
||||
function editAnimationPath(data) {
|
||||
// insRegisterModal.value.disableSubmit = false;
|
||||
// insRegisterModal.value.edit(data);
|
||||
}
|
||||
|
||||
//启用分类标签
|
||||
function usingInstruction(data) {
|
||||
createConfirm({
|
||||
|
|
@ -1115,7 +1111,7 @@ function editInstruction(data) {
|
|||
//新增服务类别
|
||||
function addCategory(data) {
|
||||
catRegisterModal.value.disableSubmit = false;
|
||||
catRegisterModal.value.edit({ instructionId: data.instructionId });
|
||||
catRegisterModal.value.add({ instructionId: data.instructionId });
|
||||
}
|
||||
//启用服务类别
|
||||
function usingCategory(data) {
|
||||
|
|
@ -1147,10 +1143,15 @@ function stopCategory(data) {
|
|||
}
|
||||
});
|
||||
}
|
||||
//修改类别图片
|
||||
function editCategoryAnimationPath(data) {
|
||||
catRegisterModal.value.disableSubmit = false;
|
||||
catRegisterModal.value.edit({ id: data.key });
|
||||
}
|
||||
//新增服务类型
|
||||
function addType(data) {
|
||||
typRegisterModal.value.disableSubmit = false;
|
||||
typRegisterModal.value.edit({ instructionId: data.instructionId, categoryId: data.categoryId });
|
||||
typRegisterModal.value.add({ instructionId: data.instructionId, categoryId: data.categoryId });
|
||||
}
|
||||
//启用服务类型
|
||||
function usingType(data) {
|
||||
|
|
@ -1180,6 +1181,11 @@ function stopType(data) {
|
|||
}
|
||||
});
|
||||
}
|
||||
//修改类别图片
|
||||
function editTypeAnimationPath(data) {
|
||||
typRegisterModal.value.disableSubmit = false;
|
||||
typRegisterModal.value.edit({ id: data.key });
|
||||
}
|
||||
//新增服务指令
|
||||
function addDirective(data) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
|
|
@ -1246,9 +1252,9 @@ function menuItems(data) {
|
|||
} else if (data.izEnabled === '0') {
|
||||
items.push({ key: 'stopCat', label: '停用服务类别', icon: 'ant-design:stop-outlined', canAdd: data.parentLevelEnabled, action: stopCategory })
|
||||
}
|
||||
|
||||
|
||||
if (!!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value) {
|
||||
items.push({ key: 'addIns', label: '修改动画', icon: 'ant-design:plus-outlined', canAdd: true && !!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value, action: editAnimationPath },)
|
||||
items.push({ key: 'editCatImg', label: '修改类别图片', icon: 'ant-design:plus-outlined', canAdd: true && !!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value, action: editCategoryAnimationPath },)
|
||||
}
|
||||
return items
|
||||
}
|
||||
|
|
@ -1264,6 +1270,9 @@ function menuItems(data) {
|
|||
} else if (data.izEnabled === '0') {
|
||||
items.push({ key: 'stopTyp', label: '停用服务类型', icon: 'ant-design:stop-outlined', canAdd: data.parentLevelEnabled, action: stopType })
|
||||
}
|
||||
if (!!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value) {
|
||||
items.push({ key: 'editTypeImg', label: '修改类型图片', icon: 'ant-design:plus-outlined', canAdd: true && !!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value, action: editTypeAnimationPath },)
|
||||
}
|
||||
return items
|
||||
}
|
||||
else if (data.level === 4) {
|
||||
|
|
@ -1360,7 +1369,7 @@ async function initTree() {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查看指令库
|
||||
* 查看指令库
|
||||
*/
|
||||
function handleDirectiveMainOpen() {
|
||||
registerModal.value?.openDM(mainOrgCode.value)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ enum Api {
|
|||
list = '/services/ServiceType/configServiceType/list',
|
||||
save='/services/ServiceType/configServiceType/add',
|
||||
edit='/services/ServiceType/configServiceType/edit',
|
||||
getInfo = '/services/ServiceType/configServiceType/getInfo',
|
||||
deleteOne = '/services/ServiceType/configServiceType/delete',
|
||||
deleteBatch = '/services/ServiceType/configServiceType/deleteBatch',
|
||||
importExcel = '/services/ServiceType/configServiceType/importExcel',
|
||||
|
|
@ -31,6 +32,8 @@ export const getImportUrl = Api.importExcel;
|
|||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
export const getInfo = (params) => defHttp.get({ url: Api.getInfo, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
* @param params
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<a-col :span="24">
|
||||
<a-form-item label="分类标签" v-bind="validateInfos.instructionId" id="ConfigServiceTypeForm-instructionId"
|
||||
name="instructionId">
|
||||
<j-dict-select-tag type='list' v-model:value="formData.instructionId"
|
||||
<j-dict-select-tag type='list' v-model:value="formData.instructionId" :disabled="formData.colDisabled"
|
||||
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 and iz_enabled = 0 order by sort asc`"
|
||||
placeholder="请选择分类标签" allowClear />
|
||||
</a-form-item>
|
||||
|
|
@ -17,28 +17,45 @@
|
|||
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceTypeForm-categoryId"
|
||||
name="categoryId">
|
||||
<j-dict-select-tag type='list' v-model:value="formData.categoryId" :dictCode="categoryDictCode"
|
||||
placeholder="请选择服务类别" allowClear :disabled="!formData.instructionId" />
|
||||
placeholder="请选择服务类别" allowClear :disabled="!formData.instructionId || formData.colDisabled" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务类型" v-bind="validateInfos.typeName" id="ConfigServiceTypeForm-typeName"
|
||||
name="typeName">
|
||||
<a-input v-model:value="formData.typeName" placeholder="请输入服务类型" allow-clear :maxlength="10"
|
||||
:showCount="true" :disabled="!formData.categoryId"></a-input>
|
||||
:showCount="true" :disabled="!formData.categoryId || formData.colDisabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="排序" v-bind="validateInfos.sort" id="ConfigServiceTypeForm-sort" name="sort">
|
||||
<a-input-number v-model:value="formData.sort" placeholder="请输入排序" style="width: 100%" />
|
||||
<a-input-number v-model:value="formData.sort" :disabled="formData.colDisabled" placeholder="请输入排序" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="ConfigServiceTypeForm-izEnabled"
|
||||
name="izEnabled">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled"
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" :disabled="formData.colDisabled" dictCode="iz_enabled"
|
||||
placeholder="请选择是否启用" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="本地网络标记" v-bind="validateInfos.netFlag"
|
||||
id="ConfigServiceCategoryForm-netFlag" name="netFlag">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.netFlag" dictCode="net_flag"
|
||||
placeholder="请选择本地网络标记" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-show="formData.netFlag=='1'">
|
||||
<a-form-item label="默认图片" v-bind="validateInfos.staticPath" id="ConfigServiceCategoryForm-staticPath" name="staticPath">
|
||||
<JImageUploadToOpe :toOpe="true" :bizPath="'type'" :fileMax="1" v-model:value="formData.staticPath"></JImageUploadToOpe>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-show="formData.netFlag=='1'">
|
||||
<a-form-item label="动画图片" v-bind="validateInfos.animationPath" id="ConfigServiceCategoryForm-animationPath" name="animationPath">
|
||||
<JImageUploadToOpe :toOpe="true" :bizPath="'type'" :fileMax="7" v-model:value="formData.animationPath"></JImageUploadToOpe>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
|
|
@ -52,9 +69,10 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../ConfigServiceType.api';
|
||||
import { getInfo, saveOrUpdate } from '../ConfigServiceType.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import JImageUploadToOpe from '/@/components/Form/src/jeecg/components/JImageUploadToOpe.vue';
|
||||
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
|
|
@ -71,6 +89,10 @@ const formData = reactive<Record<string, any>>({
|
|||
typeName: '',
|
||||
sort: 99,
|
||||
izEnabled: '0',
|
||||
netFlag: '0',
|
||||
staticPath: '',
|
||||
animationPath: '',
|
||||
colDisabled: false
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||
|
|
@ -117,14 +139,7 @@ const disabled = computed(() => {
|
|||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
function add(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
|
|
@ -135,9 +150,30 @@ function edit(record) {
|
|||
});
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
formData.colDisabled = false;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(data) {
|
||||
getInfo({id: data.id}).then((record) => {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if (record.hasOwnProperty(key)) {
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
formData.colDisabled = true;
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
|
|
@ -213,4 +249,4 @@ defineExpose({
|
|||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -34,11 +34,11 @@ const emit = defineEmits(['register', 'success', 'refresh']);
|
|||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
function add(record) {
|
||||
title.value = '新增';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
registerForm.value.add(record);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -47,8 +47,7 @@ function add() {
|
|||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
// title.value = disableSubmit.value ? '详情' : '编辑';
|
||||
title.value = '新增';
|
||||
title.value = '修改';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.edit(record);
|
||||
|
|
|
|||
Loading…
Reference in New Issue