|
@@ -1,7 +1,8 @@
|
|
-import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, UserPageQuery,EditReq ,DelReq} from '@fast-crud/fast-crud';
|
|
|
|
|
|
+import { AddReq,compute, CreateCrudOptionsProps,dict, CreateCrudOptionsRet, UserPageQuery,EditReq ,DelReq} from '@fast-crud/fast-crud';
|
|
import * as api from './api';
|
|
import * as api from './api';
|
|
import { auth } from '/@/utils/authFunction';
|
|
import { auth } from '/@/utils/authFunction';
|
|
-
|
|
|
|
|
|
+import { APIResponseData } from '../columns/types';
|
|
|
|
+import { successMessage } from '/@/utils/message';
|
|
|
|
|
|
export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
const pageRequest = async (query: UserPageQuery) => {
|
|
const pageRequest = async (query: UserPageQuery) => {
|
|
@@ -110,6 +111,40 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
}],
|
|
}],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
+ is_top:{
|
|
|
|
+ title: '是否置顶',
|
|
|
|
+ type: 'dict-switch',
|
|
|
|
+ column: {
|
|
|
|
+ show:true,
|
|
|
|
+ minWidth: 120,
|
|
|
|
+ component: {
|
|
|
|
+ name: 'fs-dict-switch',
|
|
|
|
+ activeText: '',
|
|
|
|
+ inactiveText: '',
|
|
|
|
+ style: '--el-switch-on-color: var(--el-color-primary); --el-switch-off-color: #dcdfe6',
|
|
|
|
+ onChange: compute((context) => {
|
|
|
|
+ return () => {
|
|
|
|
+ api.UpdateObj(context.row).then((res:APIResponseData) => {
|
|
|
|
+ successMessage(res.msg as string);
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ }),
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ dict: dict({
|
|
|
|
+ data: [
|
|
|
|
+ { value: true, label: "置顶" },
|
|
|
|
+ { value: false, label: "取消" }
|
|
|
|
+ ]
|
|
|
|
+ }),
|
|
|
|
+ form: {
|
|
|
|
+ value:true,
|
|
|
|
+ show:true,
|
|
|
|
+ component: { placeholder: '请选择是否置顶' },
|
|
|
|
+ rules: [{ required: false, message: '请选择是否置顶' }],
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+
|
|
publisher_name:{
|
|
publisher_name:{
|
|
title: '发布人',
|
|
title: '发布人',
|
|
type: 'input',
|
|
type: 'input',
|
|
@@ -135,7 +170,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
},
|
|
},
|
|
},
|
|
},
|
|
article_type:{
|
|
article_type:{
|
|
- title: '是否在顶部',
|
|
|
|
|
|
+ title: '文章类型',
|
|
type: 'input',
|
|
type: 'input',
|
|
column: {
|
|
column: {
|
|
show:false,
|
|
show:false,
|
|
@@ -144,8 +179,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
form: {
|
|
form: {
|
|
value:"borrow_rules",
|
|
value:"borrow_rules",
|
|
show:false,
|
|
show:false,
|
|
- component: { placeholder: '请填写是否在顶部' },
|
|
|
|
- rules: [{ required: false, message: '请填写是否在顶部' }],
|
|
|
|
|
|
+ component: { placeholder: '文章类型' },
|
|
|
|
+ rules: [{ required: false, message: '文章类型' }],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
status:{
|
|
status:{
|