cashier-web/src/views/admim/system/params/config/add.ts

67 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import ParamsApi, { type addRequest } from "@/api/system/params";
import type { IModalConfig } from "@/components/CURD/types";
import { paramTypeOptions } from './config'
const modalConfig: IModalConfig<addRequest> = {
pageName: "sys:user",
dialog: {
title: "添加系统参数",
width: 800,
draggable: true,
},
form: {
labelWidth: 140,
},
formAction: function (data) {
return ParamsApi.add(data);
},
beforeSubmit(data) {
console.log("提交之前处理", data);
},
formItems: [
{
label: "参数编码",
prop: "paramCode",
rules: [{ required: true, message: "请输入参数编码", trigger: "blur" }],
type: "input",
attrs: {
placeholder: "请输入参数编码",
},
},
{
label: "参数值",
prop: "paramValue",
rules: [{ required: true, message: "请输入参数值", trigger: "blur" }],
type: "input",
attrs: {
placeholder: "请输入参数值",
},
},
{
label: "参数类型",
prop: "paramType",
rules: [{ required: true, message: "请选择参数类型", trigger: "blur" }],
type: "select",
attrs: {
placeholder: "请选择参数类型",
},
col: {
xs: 24,
sm: 12,
},
options: paramTypeOptions,
},
{
type: "textarea",
label: "备注",
prop: "remark",
rules: [{ required: true, message: "请输入备注", trigger: "blur" }],
attrs: {
placeholder: "请输入备注",
},
},
],
};
// 如果有异步数据会修改配置的推荐用reactive包裹而纯静态配置的可以直接导出
export default reactive(modalConfig);