import { listDictModel } from '/@/api/common'; import { DescItem } from '/@/components/Description'; import { BasicColumn, FormSchema } from '/@/components/Table'; import { radioBoolean } from '/@/utils/filters'; export const columns: BasicColumn[] = [ <% for(var i = 0; i < configList.~size; i++) { %> <% if(configList[i].fieldNameCamelCase != "createBy" &&configList[i].fieldNameCamelCase != "updateBy" && configList[i].fieldNameCamelCase != "tenantId" && configList[i].fieldNameCamelCase!= "deleted" && configList[i].whetherTable) {%> { title: '${configList[i].fieldRemark}', dataIndex: '${configList[i].fieldNameCamelCase}', }, <% } %> <% } %> ]; // 表单列定义 export const searchFormSchema: FormSchema[] = [ <% for(var i = 0; i < configList.~size; i++) { %> <% if(configList[i].fieldNameCamelCase != "createBy" &&configList[i].fieldNameCamelCase != "updateBy" && configList[i].fieldNameCamelCase != "tenantId" && configList[i].fieldNameCamelCase!= "deleted" && configList[i].queryWhether) {%> { label: '${configList[i].fieldRemark}', field: '${configList[i].fieldNameCamelCase}', <% if(configList[i].effectType == "input"){ %> component: 'Input', componentProps: { placeholder: '请输入${configList[i].fieldRemark}', } <% } %> <% if(configList[i].effectType == "inputTextArea"){ %> component: 'InputTextArea', componentProps: { placeholder: '请输入${configList[i].fieldRemark}', } <% } %> <% if(configList[i].effectType == "inputNumber"){ %> component: 'InputNumber', componentProps: { placeholder: '请输入${configList[i].fieldRemark}', } <% } %> <% if(configList[i].effectType == "select"){ %> component: 'Select', componentProps: { options: [{ label: '', value: '' }], }, <% } %> <% if(configList[i].effectType == "apiSelect"){ %> component: 'ApiSelect', componentProps: { api: listDictModel, params: { dictCode: '${configList[i].dictTypeCode}', }, } <% } %> <% if(configList[i].effectType == "switch"){ %> component: 'Switch', componentProps: { options: radioBoolean, } <% } %> <% if(configList[i].effectType == "radioGroup"){ %> component: 'RadioGroup', required: true, componentProps: { options: radioBoolean, } <% } %> <% if(configList[i].effectType == "apiRadioGroup"){ %> component: 'ApiRadioGroup', componentProps: { api: listDictModel, params: { dictCode: '${configList[i].dictTypeCode}', } } <% } %> <% if(configList[i].effectType == "checkboxGroup"){ %> component: 'CheckboxGroup', componentProps: { options: [{label: '选项1',value: '1',}] } <% } %> <% if(configList[i].effectType == "datePicker"){ %> component: 'DatePicker', componentProps: { placeholder: '请选择时间', format: 'YYYY-MM-DD HH:mm:ss', showTime: { format: 'YYYY-MM-DD HH:mm:ss' }, } <% } %> <% if(configList[i].effectType == "upload"){ %> component: 'Input', slot: 'upload', componentProps: { placeholder: '请上传图片', }, <% } %> <% if(configList[i].effectType == "textEditor"){ %> component: 'textEditor', componentProps: ({ formModel }) => { return { height: 300, onChange: (e) => { formModel.${configList[i].fieldNameCamelCase} = e; }, }; } <% } %> }, <% } %> <% } %> ]; // 表单新增编辑 export const dataFormSchema: FormSchema[] = [ <% for(var i = 0; i < configList.~size; i++) { %> <% if(configList[i].fieldNameCamelCase != "createBy" &&configList[i].fieldNameCamelCase != "updateBy" && configList[i].fieldNameCamelCase != "tenantId" && configList[i].fieldNameCamelCase!= "deleted" && configList[i].whetherAddUpdate) {%> { label: '${configList[i].fieldRemark}', field: '${configList[i].fieldNameCamelCase}', <% if(configList[i].effectType == "input"){ %> required: true, <% } %> <% if(configList[i].effectType == "input"){ %> component: 'Input', componentProps: { placeholder: '请输入${configList[i].fieldRemark}', } <% } %> <% if(configList[i].effectType == "inputTextArea"){ %> component: 'InputTextArea', componentProps: { placeholder: '请输入${configList[i].fieldRemark}', } <% } %> <% if(configList[i].effectType == "inputNumber"){ %> component: 'InputNumber', componentProps: { placeholder: '请输入${configList[i].fieldRemark}', } <% } %> <% if(configList[i].effectType == "select"){ %> component: 'Select', componentProps: { options: [{ label: '', value: '' }], }, <% } %> <% if(configList[i].effectType == "apiSelect"){ %> component: 'ApiSelect', componentProps: { api: listDictModel, params: { dictCode: '${configList[i].dictTypeCode}', }, } <% } %> <% if(configList[i].effectType == "switch"){ %> component: 'Switch', componentProps: { options: radioBoolean, } <% } %> <% if(configList[i].effectType == "radioGroup"){ %> component: 'RadioGroup', required: true, componentProps: { options: radioBoolean, } <% } %> <% if(configList[i].effectType == "apiRadioGroup"){ %> component: 'ApiRadioGroup', componentProps: { api: listDictModel, params: { dictCode: '${configList[i].dictTypeCode}', } } <% } %> <% if(configList[i].effectType == "checkboxGroup"){ %> component: 'CheckboxGroup', componentProps: { options: [{label: '选项1',value: '1',}] } <% } %> <% if(configList[i].effectType == "datePicker"){ %> component: 'DatePicker', componentProps: { placeholder: '请选择时间', format: 'YYYY-MM-DD HH:mm:ss', showTime: { format: 'YYYY-MM-DD HH:mm:ss' }, } <% } %> <% if(configList[i].effectType == "upload"){ %> component: 'Input', slot: 'upload', componentProps: { placeholder: '请上传图片', }, <% } %> <% if(configList[i].effectType == "textEditor"){ %> component: 'textEditor', componentProps: ({ formModel }) => { return { height: 300, onChange: (e) => { formModel.${configList[i].fieldNameCamelCase} = e; }, }; } <% } %> }, <% } %> <% } %> ]; // 表单详情查看 export const viewSchema: DescItem[] = [ <% for(var i = 0; i < configList.~size; i++) { %> <% if(configList[i].fieldNameCamelCase != "createBy" &&configList[i].fieldNameCamelCase != "updateBy" && configList[i].fieldNameCamelCase != "tenantId" && configList[i].fieldNameCamelCase!= "deleted" ) {%> { label: '${configList[i].fieldRemark}', field: '${configList[i].fieldNameCamelCase}', }, <% } %> <% } %> ];