Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
H0nGzA1
2023-03-23 18:13:49 +08:00
4 changed files with 43 additions and 58 deletions

View File

@@ -28,6 +28,9 @@ export default {
//你项目后台接口大概率与fast-crud所需要的返回结构不一致所以需要配置此项 //你项目后台接口大概率与fast-crud所需要的返回结构不一致所以需要配置此项
//请参考文档http://fast-crud.docmirror.cn/api/crud-options/request.html //请参考文档http://fast-crud.docmirror.cn/api/crud-options/request.html
transformQuery: ({ page, form, sort }: any) => { transformQuery: ({ page, form, sort }: any) => {
if (sort.asc !== undefined){
form["ordering"] = `${sort.asc ? "" : "-"}${sort.prop}`
}
//转换为你pageRequest所需要的请求参数结构 //转换为你pageRequest所需要的请求参数结构
return { page: page.currentPage, limit: page.pageSize, ...form }; return { page: page.currentPage, limit: page.pageSize, ...form };
}, },

View File

@@ -78,18 +78,6 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
}, },
}, },
}, },
search: {
title: '关键词',
column: {show: false},
type: 'text',
search: {show: true},
form: {
show: false,
component: {
placeholder: '输入关键词搜索',
},
},
},
id: { id: {
title: 'ID', title: 'ID',
type: 'text', type: 'text',
@@ -103,7 +91,7 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
search: {show: true}, search: {show: true},
column: { column: {
minWidth: 120, minWidth: 120,
sortable: true, sortable: "custom",
}, },
form: { form: {
rules: [{required: true, message: '角色名称必填'}], rules: [{required: true, message: '角色名称必填'}],
@@ -118,7 +106,7 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
search: {show: false}, search: {show: false},
column: { column: {
width: 120, width: 120,
sortable: true, sortable: "custom",
}, },
form: { form: {
rules: [{required: true, message: '权限标识必填'}], rules: [{required: true, message: '权限标识必填'}],
@@ -131,9 +119,10 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
type: 'number', type: 'number',
column: { column: {
width: 90, width: 90,
sortable: true, sortable: "custom",
}, },
form: { form: {
rules: [{required: true, message: '排序必填'}],
value: 1, value: 1,
}, },
}, },
@@ -157,9 +146,10 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
}), }),
column: { column: {
width: 130, width: 130,
sortable: true, sortable: "custom",
}, },
form: { form: {
rules: [{required: true, message: '是否管理员必填'}],
value: false, value: false,
}, },
}, },
@@ -183,9 +173,10 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
}), }),
column: { column: {
width: 90, width: 90,
sortable: true, sortable: "custom",
}, },
form: { form: {
rules: [{required: true, message: '状态必填'}],
value: true, value: true,
}, },
}, },
@@ -195,7 +186,7 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
search: {show: false}, search: {show: false},
column: { column: {
width: 170, width: 170,
sortable: true, sortable: "custom",
}, },
form: { form: {
show: false, show: false,
@@ -209,7 +200,7 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
type: 'text', type: 'text',
search: {show: false}, search: {show: false},
column: { column: {
sortable: true, sortable: "custom",
width: 170, width: 170,
}, },
form: { form: {
@@ -219,18 +210,17 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
}, },
}, },
}, },
// description: {
description: { // title: '备注',
title: '备注', // type: 'textarea',
type: 'textarea', // search: {show: false},
search: {show: false}, // form: {
form: { // component: {
component: { // maxlength: 200,
maxlength: 200, // placeholder: '输入备注',
placeholder: '输入备注', // },
}, // },
}, // },
},
}, },
}, },
}; };

View File

@@ -54,29 +54,6 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
columnSetDisabled: true, //禁止在列设置中选择 columnSetDisabled: true, //禁止在列设置中选择
}, },
}, },
search: {
title: '关键词',
column: {
show: false
},
search: {
show: true,
component: {
props: {
clearable: true
},
placeholder: '请输入关键词'
}
},
form: {
show: false,
component: {
props: {
clearable: true
}
}
},
},
username: { username: {
title: '账号', title: '账号',
search: { search: {

View File

@@ -28,6 +28,14 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
editRequest, editRequest,
delRequest, delRequest,
}, },
form: {
col: {span: 24},
labelWidth: '110px',
wrapper: {
is: 'el-dialog',
width: '600px',
},
},
columns: { columns: {
_index: { _index: {
title: '序号', title: '序号',
@@ -70,7 +78,7 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
}, },
method: { method: {
title: '请求方式', title: '请求方式',
sortable: true, sortable: "custom",
search: { search: {
disabled: false, disabled: false,
}, },
@@ -93,6 +101,10 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
label: 'DELETE', label: 'DELETE',
value: 3, value: 3,
}, },
{
label: 'PATCH',
value: 4,
}
], ],
}), }),
form: { form: {
@@ -113,7 +125,7 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
}, },
url: { url: {
title: '接口地址', title: '接口地址',
sortable: true, sortable: "custom",
search: { search: {
disabled: true, disabled: true,
}, },
@@ -155,9 +167,11 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
class: { yxtInput: true }, class: { yxtInput: true },
}, },
helper: { helper: {
render(h) { position: "label",
return <el-alert title="请正确填写,以免请求时被拦截。匹配单例使用正则,例如:/api/xx/.*?/" type="warning" />; tooltip: {
placement: "top-start"
}, },
text: "请正确填写,以免请求时被拦截。匹配单例使用正则,例如:/api/xx/.*?/"
}, },
}, },
}, },
@@ -173,6 +187,7 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
}), }),
form: { form: {
value: true, value: true,
rules: [{ required: true, message: '必填项' }],
component: { component: {
span: 12, span: 12,
}, },