| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- 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}',
- },
- <% } %>
- <% } %>
- ];
|