修复字典管理新增值时is_value错误的bug
This commit is contained in:
@@ -308,7 +308,7 @@ class ExportSerializerMixin:
|
||||
async_export_data.delay(
|
||||
data,
|
||||
str(f"导出{get_verbose_name(queryset)}-{datetime.datetime.now().strftime('%Y%m%d%H%M%S')}.xlsx"),
|
||||
DownloadCenter.objects.create(creator=request.user, task_name=f'{get_verbose_name(queryset)}数据导出任务', dept_belong_id=request.user.dept).pk,
|
||||
DownloadCenter.objects.create(creator=request.user, task_name=f'{get_verbose_name(queryset)}数据导出任务', dept_belong_id=request.user.dept_id).pk,
|
||||
self.export_field_label
|
||||
)
|
||||
return SuccessResponse(msg="导入任务已创建,请前往‘下载中心’等待下载")
|
||||
|
||||
@@ -4,7 +4,7 @@ import { DictionaryStore } from '/@/stores/dictionary';
|
||||
/**
|
||||
* @method 获取指定name字典
|
||||
*/
|
||||
export const dictionary = (name: string,key:string|number|undefined) => {
|
||||
export const dictionary = (name: string,key?:string|number|undefined) => {
|
||||
const dict = DictionaryStore()
|
||||
const dictionary = toRaw(dict.data)
|
||||
if(key!=undefined){
|
||||
|
||||
@@ -9,20 +9,20 @@ import {
|
||||
CreateCrudOptionsProps,
|
||||
CreateCrudOptionsRet
|
||||
} from '@fast-crud/fast-crud';
|
||||
import {dictionary} from '/@/utils/dictionary';
|
||||
import { dictionary } from '/@/utils/dictionary';
|
||||
|
||||
export const createCrudOptions = function ({crudExpose, context}: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
export const createCrudOptions = function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const pageRequest = async (query: UserPageQuery) => {
|
||||
return await api.GetList(query);
|
||||
};
|
||||
const editRequest = async ({form, row}: EditReq) => {
|
||||
const editRequest = async ({ form, row }: EditReq) => {
|
||||
form.id = row.id;
|
||||
return await api.UpdateObj(form);
|
||||
};
|
||||
const delRequest = async ({row}: DelReq) => {
|
||||
const delRequest = async ({ row }: DelReq) => {
|
||||
return await api.DelObj(row.id);
|
||||
};
|
||||
const addRequest = async ({form}: AddReq) => {
|
||||
const addRequest = async ({ form }: AddReq) => {
|
||||
const data = crudExpose!.getSearchFormData()
|
||||
const parent = data.parent
|
||||
form.parent = parent
|
||||
@@ -63,7 +63,7 @@ export const createCrudOptions = function ({crudExpose, context}: CreateCrudOpti
|
||||
columns: {
|
||||
_index: {
|
||||
title: '序号',
|
||||
form: {show: false},
|
||||
form: { show: false },
|
||||
column: {
|
||||
//type: 'index',
|
||||
align: 'center',
|
||||
@@ -92,7 +92,7 @@ export const createCrudOptions = function ({crudExpose, context}: CreateCrudOpti
|
||||
form: {
|
||||
rules: [
|
||||
// 表单校验规则
|
||||
{required: true, message: '名称必填项'},
|
||||
{ required: true, message: '名称必填项' },
|
||||
],
|
||||
component: {
|
||||
props: {
|
||||
@@ -116,20 +116,20 @@ export const createCrudOptions = function ({crudExpose, context}: CreateCrudOpti
|
||||
show: false,
|
||||
dict: dict({
|
||||
data: [
|
||||
{label: 'text', value: 0},
|
||||
{label: 'number', value: 1},
|
||||
{label: 'date', value: 2},
|
||||
{label: 'datetime', value: 3},
|
||||
{label: 'time', value: 4},
|
||||
{label: 'file', value: 5},
|
||||
{label: 'boolean', value: 6},
|
||||
{label: 'images', value: 7},
|
||||
{ label: 'text', value: 0 },
|
||||
{ label: 'number', value: 1 },
|
||||
{ label: 'date', value: 2 },
|
||||
{ label: 'datetime', value: 3 },
|
||||
{ label: 'time', value: 4 },
|
||||
{ label: 'file', value: 5 },
|
||||
{ label: 'boolean', value: 6 },
|
||||
{ label: 'images', value: 7 },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
rules: [
|
||||
// 表单校验规则
|
||||
{required: true, message: '数据值类型必填项'},
|
||||
{ required: true, message: '数据值类型必填项' },
|
||||
],
|
||||
value: 0,
|
||||
component: {
|
||||
@@ -200,7 +200,7 @@ export const createCrudOptions = function ({crudExpose, context}: CreateCrudOpti
|
||||
},
|
||||
},
|
||||
view: {
|
||||
component: {props: {height: 100, width: 100}},
|
||||
component: { props: { height: 100, width: 100 } },
|
||||
},
|
||||
/* // 提交时,处理数据
|
||||
valueResolve(row: any, col: any) {
|
||||
@@ -238,7 +238,7 @@ export const createCrudOptions = function ({crudExpose, context}: CreateCrudOpti
|
||||
form: {
|
||||
rules: [
|
||||
// 表单校验规则
|
||||
{required: true, message: '数据值必填项'},
|
||||
{ required: true, message: '数据值必填项' },
|
||||
],
|
||||
component: {
|
||||
props: {
|
||||
@@ -262,7 +262,7 @@ export const createCrudOptions = function ({crudExpose, context}: CreateCrudOpti
|
||||
value: true,
|
||||
rules: [
|
||||
// 表单校验规则
|
||||
{required: true, message: '状态必填项'},
|
||||
{ required: true, message: '状态必填项' },
|
||||
],
|
||||
},
|
||||
},
|
||||
@@ -275,7 +275,7 @@ export const createCrudOptions = function ({crudExpose, context}: CreateCrudOpti
|
||||
component: {},
|
||||
rules: [
|
||||
// 表单校验规则
|
||||
{required: true, message: '排序必填项'},
|
||||
{ required: true, message: '排序必填项' },
|
||||
],
|
||||
},
|
||||
},
|
||||
@@ -288,11 +288,11 @@ export const createCrudOptions = function ({crudExpose, context}: CreateCrudOpti
|
||||
type: 'dict-select',
|
||||
dict: dict({
|
||||
data: [
|
||||
{label: 'success', value: 'success', color: 'success'},
|
||||
{label: 'primary', value: 'primary', color: 'primary'},
|
||||
{label: 'info', value: 'info', color: 'info'},
|
||||
{label: 'danger', value: 'danger', color: 'danger'},
|
||||
{label: 'warning', value: 'warning', color: 'warning'},
|
||||
{ label: 'success', value: 'success', color: 'success' },
|
||||
{ label: 'primary', value: 'primary', color: 'primary' },
|
||||
{ label: 'info', value: 'info', color: 'info' },
|
||||
{ label: 'danger', value: 'danger', color: 'danger' },
|
||||
{ label: 'warning', value: 'warning', color: 'warning' },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
@@ -303,6 +303,16 @@ export const createCrudOptions = function ({crudExpose, context}: CreateCrudOpti
|
||||
},
|
||||
},
|
||||
},
|
||||
is_value: {
|
||||
title: '是否值',
|
||||
column: {
|
||||
show: false
|
||||
},
|
||||
form: {
|
||||
show: false,
|
||||
value: true
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user