|
@@ -1,7 +1,8 @@
|
|
|
-import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, UserPageQuery,EditReq ,DelReq,dict} from '@fast-crud/fast-crud';
|
|
|
+import { AddReq,useCompute, CreateCrudOptionsProps, CreateCrudOptionsRet, UserPageQuery,EditReq ,DelReq,dict} from '@fast-crud/fast-crud';
|
|
|
import * as api from './api';
|
|
|
import { auth } from '/@/utils/authFunction';
|
|
|
|
|
|
+const { compute } = useCompute();
|
|
|
|
|
|
export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
|
const pageRequest = async (query: UserPageQuery) => {
|
|
@@ -136,7 +137,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
|
article_title: {
|
|
|
title: '设备标题',
|
|
|
search: {
|
|
|
- show: false,
|
|
|
+ show: true,
|
|
|
},
|
|
|
treeNode: true,
|
|
|
type: 'input',
|
|
@@ -160,7 +161,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
|
},
|
|
|
article_content:{
|
|
|
title: '内容',
|
|
|
- type: 'textarea',
|
|
|
+ // type: 'textarea',
|
|
|
+ type: 'editor-wang5',
|
|
|
column: {
|
|
|
show:true,
|
|
|
minWidth: 120,
|
|
@@ -170,11 +172,33 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
|
col: {
|
|
|
span: 24
|
|
|
},
|
|
|
- component: { showWordLimit: true, maxlength: 200 ,placeholder: '请填写内容' },
|
|
|
+ // component: { showWordLimit: true, maxlength: 200 ,placeholder: '请填写内容' },
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '内容为必填项',
|
|
|
}],
|
|
|
+ component: {
|
|
|
+ disabled: false,
|
|
|
+ id: '1', // 当同一个页面有多个editor时,需要配置不同的id
|
|
|
+ editorConfig: {
|
|
|
+ // 是否只读
|
|
|
+ readOnly: compute((context) => {
|
|
|
+ const { mode } = context;
|
|
|
+ if (mode === 'add') {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }),
|
|
|
+ },
|
|
|
+ uploader: {
|
|
|
+ type: 'form',
|
|
|
+ buildUrl(res: any) {
|
|
|
+ console.log("res::::",res)
|
|
|
+ return res.url;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
},
|
|
|
viewForm:{
|
|
|
component: { placeholder: '' },
|