549 lines
11 KiB
TypeScript
549 lines
11 KiB
TypeScript
/**
|
|
* 全字段单表配置信息
|
|
*/
|
|
const singleTableConfig = {
|
|
tableName: 'ai_single',
|
|
tableTxt: 'online测试单表',
|
|
tableType: 1,
|
|
formTemplate: '1',
|
|
showRelationType: false,
|
|
showIdSequence: false,
|
|
themeTemplate: 'normal',
|
|
scroll: 1,
|
|
tableVersion: 1,
|
|
isCheckbox: 'Y',
|
|
isDbSynch: 'Y',
|
|
isPage: 'Y',
|
|
isTree: 'N',
|
|
idType: 'UUID',
|
|
queryMode: 'single',
|
|
formCategory: 'temp',
|
|
};
|
|
|
|
/**
|
|
* 单表字段
|
|
*/
|
|
const singleTableFields = [
|
|
{
|
|
dbFieldName: 'name',
|
|
dbFieldTxt: '商品名称',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 50,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'text',
|
|
fieldLength: 120,
|
|
fieldMustInput: '1',
|
|
isQuery: 1,
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
queryMode: 'single',
|
|
},
|
|
{
|
|
dbFieldName: 'price',
|
|
dbFieldTxt: '单价',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'BigDecimal',
|
|
fieldLength: 120,
|
|
dbLength: 10,
|
|
dbPointLength: 2,
|
|
fieldShowType: 'text',
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
queryMode: 'single',
|
|
},
|
|
{
|
|
dbFieldName: 'yuanjia',
|
|
dbFieldTxt: '原价',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'double',
|
|
dbLength: 6,
|
|
dbPointLength: 2,
|
|
fieldShowType: 'text',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
queryMode: 'single',
|
|
},
|
|
{
|
|
dbFieldName: 'geshu',
|
|
dbFieldTxt: '个数',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'int',
|
|
dbLength: 9,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'text',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
queryMode: 'single',
|
|
},
|
|
{
|
|
dbFieldName: 'jycs',
|
|
dbFieldTxt: '校验测试',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 50,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'text',
|
|
fieldLength: 120,
|
|
fieldValidType: 'only',
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
queryMode: 'single',
|
|
},
|
|
{
|
|
dbFieldName: 'province',
|
|
dbFieldTxt: '正则校验',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 50,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'text',
|
|
fieldLength: 120,
|
|
fieldValidType: '^[a-z|A-Z]{2,10}$',
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
queryMode: 'single',
|
|
},
|
|
{
|
|
dbFieldName: 'zdmrz',
|
|
dbFieldTxt: '自定义查询',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 50,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'text',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 1,
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
queryMode: 'single',
|
|
fieldDefaultValue: '1',
|
|
queryConfigFlag: '1',
|
|
queryShowType: 'list',
|
|
queryDefVal: '1',
|
|
queryDictField: 'sex',
|
|
},
|
|
{
|
|
dbFieldName: 'xiala',
|
|
dbFieldTxt: '下拉',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 50,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'list',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 1,
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
queryMode: 'single',
|
|
dictField: 'sex',
|
|
},
|
|
{
|
|
dbFieldName: 'danxuan',
|
|
dbFieldTxt: '单选',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 50,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'radio',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
queryMode: 'single',
|
|
dictField: 'sex',
|
|
},
|
|
{
|
|
dbFieldName: 'duoxuan',
|
|
dbFieldTxt: '多选',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 50,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'checkbox',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
queryMode: 'single',
|
|
dictField: 'urgent_level',
|
|
},
|
|
{
|
|
dbFieldName: 'kaiguan',
|
|
dbFieldTxt: '开关',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 50,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'switch',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
queryMode: 'single',
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
fieldExtendJson: '[1,2]',
|
|
},
|
|
{
|
|
dbFieldName: 'riqi',
|
|
dbFieldTxt: '日期',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'Date',
|
|
dbLength: 50,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'date',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 1,
|
|
queryMode: 'group',
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
},
|
|
{
|
|
dbFieldName: 'shijian',
|
|
dbFieldTxt: '时间',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'Date',
|
|
dbLength: 50,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'datetime',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 1,
|
|
queryMode: 'group',
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
},
|
|
{
|
|
dbFieldName: 'wenjian',
|
|
dbFieldTxt: '文件',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 250,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'file',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
queryMode: 'single',
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
},
|
|
{
|
|
dbFieldName: 'tupian',
|
|
dbFieldTxt: '图片',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 250,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'image',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
queryMode: 'single',
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
},
|
|
{
|
|
dbFieldName: 'dhwb',
|
|
dbFieldTxt: '多行文本',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 250,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'textarea',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
queryMode: 'single',
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
},
|
|
{
|
|
dbFieldName: 'xldx',
|
|
dbFieldTxt: '下拉多选',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 250,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'list_multi',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
queryMode: 'single',
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
dictField: 'urgent_level',
|
|
},
|
|
{
|
|
dbFieldName: 'xlss',
|
|
dbFieldTxt: '下拉搜索',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 50,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'sel_search',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 1,
|
|
queryMode: 'single',
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
dictField: 'username',
|
|
dictTable: 'sys_user',
|
|
dictText: 'realname',
|
|
},
|
|
{
|
|
dbFieldName: 'popup',
|
|
dbFieldTxt: 'popup',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 100,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'popup',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
queryMode: 'single',
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
dictField: 'username,realname',
|
|
dictTable: 'report_user',
|
|
dictText: 'popup,popback',
|
|
},
|
|
{
|
|
dbFieldName: 'popback',
|
|
dbFieldTxt: 'popback',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 100,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'text',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
queryMode: 'single',
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
},
|
|
{
|
|
dbFieldName: 'fen_tree',
|
|
dbFieldTxt: '分类字典',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 100,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'cat_tree',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
queryMode: 'single',
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
dictField: 'B02',
|
|
},
|
|
{
|
|
dbFieldName: 'bmxz',
|
|
dbFieldTxt: '部门选择',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 100,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'sel_depart',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 1,
|
|
queryMode: 'single',
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
},
|
|
{
|
|
dbFieldName: 'yhxz',
|
|
dbFieldTxt: '用户选择',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 100,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'sel_user',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 1,
|
|
queryMode: 'single',
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
},
|
|
{
|
|
dbFieldName: 'fwb',
|
|
dbFieldTxt: '富文本',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'Text',
|
|
dbLength: 100,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'umeditor',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
queryMode: 'single',
|
|
isShowForm: 1,
|
|
isShowList: 0,
|
|
isReadOnly: 0,
|
|
},
|
|
{
|
|
dbFieldName: 'markdown',
|
|
dbFieldTxt: 'markdown',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'Blob',
|
|
dbLength: 100,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'markdown',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 0,
|
|
queryMode: 'single',
|
|
isShowForm: 1,
|
|
isShowList: 0,
|
|
isReadOnly: 0,
|
|
},
|
|
{
|
|
dbFieldName: 'pca',
|
|
dbFieldTxt: '省市区',
|
|
dbIsKey: 0,
|
|
dbIsNull: 1,
|
|
dbType: 'string',
|
|
dbLength: 100,
|
|
dbPointLength: 0,
|
|
fieldShowType: 'pca',
|
|
fieldLength: 120,
|
|
fieldMustInput: '0',
|
|
isQuery: 1,
|
|
queryMode: 'single',
|
|
isShowForm: 1,
|
|
isShowList: 1,
|
|
isReadOnly: 0,
|
|
},
|
|
];
|
|
|
|
/**
|
|
* 表单页js增强
|
|
* @type {string}
|
|
*/
|
|
const singleTableFormJs = `
|
|
four(){
|
|
this.triggleChangeValue('name', '通过增强设置值')
|
|
}
|
|
beforeSubmit(row){
|
|
return new Promise((resolve, reject)=>{
|
|
setTimeout(()=>{
|
|
if(row.name == 'test'){
|
|
reject('不能提交测试数据');
|
|
}else{
|
|
resolve();
|
|
}
|
|
},3000)
|
|
})
|
|
}
|
|
onlChange(){
|
|
return {
|
|
name(){
|
|
let value = event.value
|
|
let row = this.getFieldsValue()
|
|
let price = row.price
|
|
let values = {'dhwb':'商品名称:'+value+',单价:'+price}
|
|
this.triggleChangeValues(values)
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
// sql增强
|
|
// noinspection SqlDialectInspection,SqlNoDataSourceInspection
|
|
const singleTableSql = "update ai_single set price = 2.00 where id = '#{id}'";
|
|
|
|
/**
|
|
* 索引配置
|
|
*/
|
|
const indexList = [
|
|
{
|
|
indexField: 'jycs',
|
|
indexName: 'index_jycs',
|
|
indexType: 'unique',
|
|
},
|
|
];
|
|
|
|
/**
|
|
* 此对象为最后混入里配置的对象 扩展表类型 属性名需要和此对象保持一致
|
|
* 命名规则 表名_config
|
|
*/
|
|
const ai_single_config = {
|
|
table: singleTableConfig,
|
|
fields: singleTableFields,
|
|
enhanceFormJs: singleTableFormJs,
|
|
enhanceSql: singleTableSql,
|
|
indexList: indexList,
|
|
};
|
|
export default ai_single_config;
|