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所需要的返回结构不一致所以需要配置此项
//请参考文档http://fast-crud.docmirror.cn/api/crud-options/request.html
transformQuery: ({ page, form, sort }: any) => {
if (sort.asc !== undefined){
form["ordering"] = `${sort.asc ? "" : "-"}${sort.prop}`
}
//转换为你pageRequest所需要的请求参数结构
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: {
title: 'ID',
type: 'text',
@@ -103,7 +91,7 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
search: {show: true},
column: {
minWidth: 120,
sortable: true,
sortable: "custom",
},
form: {
rules: [{required: true, message: '角色名称必填'}],
@@ -118,7 +106,7 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
search: {show: false},
column: {
width: 120,
sortable: true,
sortable: "custom",
},
form: {
rules: [{required: true, message: '权限标识必填'}],
@@ -131,9 +119,10 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
type: 'number',
column: {
width: 90,
sortable: true,
sortable: "custom",
},
form: {
rules: [{required: true, message: '排序必填'}],
value: 1,
},
},
@@ -157,9 +146,10 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
}),
column: {
width: 130,
sortable: true,
sortable: "custom",
},
form: {
rules: [{required: true, message: '是否管理员必填'}],
value: false,
},
},
@@ -183,9 +173,10 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
}),
column: {
width: 90,
sortable: true,
sortable: "custom",
},
form: {
rules: [{required: true, message: '状态必填'}],
value: true,
},
},
@@ -195,7 +186,7 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
search: {show: false},
column: {
width: 170,
sortable: true,
sortable: "custom",
},
form: {
show: false,
@@ -209,7 +200,7 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
type: 'text',
search: {show: false},
column: {
sortable: true,
sortable: "custom",
width: 170,
},
form: {
@@ -219,18 +210,17 @@ export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExp
},
},
},
description: {
title: '备注',
type: 'textarea',
search: {show: false},
form: {
component: {
maxlength: 200,
placeholder: '输入备注',
},
},
},
// description: {
// title: '备注',
// type: 'textarea',
// search: {show: false},
// form: {
// component: {
// maxlength: 200,
// placeholder: '输入备注',
// },
// },
// },
},
},
};

View File

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

View File

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