|
@@ -1,4 +1,4 @@
|
|
|
-import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, UserPageQuery,EditReq ,DelReq} from '@fast-crud/fast-crud';
|
|
|
+import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, UserPageQuery,EditReq ,DelReq,dict} from '@fast-crud/fast-crud';
|
|
|
import * as api from './api';
|
|
|
import { auth } from '/@/utils/authFunction';
|
|
|
|
|
@@ -9,12 +9,20 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
|
};
|
|
|
const editRequest = async ({ form, row }: EditReq) => {
|
|
|
form.id = row.id;
|
|
|
+ form.device_id=Number(form.device);
|
|
|
+ form.title=form.article_title;
|
|
|
+ form.content=form.article_content;
|
|
|
return await api.UpdateObj(form);
|
|
|
};
|
|
|
const delRequest = async ({ row }: DelReq) => {
|
|
|
return await api.DelObj(row.id);
|
|
|
};
|
|
|
const addRequest = async ({ form }: AddReq) => {
|
|
|
+ form.device_id=Number(form.device);
|
|
|
+ form.title=form.article_title;
|
|
|
+ form.content=form.article_content;
|
|
|
+ // console.log("sdfsdfsdfform::::",form);
|
|
|
+
|
|
|
return await api.AddObj(form);
|
|
|
};
|
|
|
|
|
@@ -57,14 +65,51 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
|
title: '序号',
|
|
|
form: { show: false },
|
|
|
column: {
|
|
|
+ show:false,
|
|
|
type: 'index',
|
|
|
align: 'center',
|
|
|
width: '70px',
|
|
|
columnSetDisabled: true, //禁止在列设置中选择
|
|
|
},
|
|
|
},
|
|
|
- title: {
|
|
|
- title: '标题',
|
|
|
+ device:{
|
|
|
+ title: '设备id',
|
|
|
+ search: {
|
|
|
+ show: false,
|
|
|
+ },
|
|
|
+ treeNode: true,
|
|
|
+ type: 'dict-select',
|
|
|
+ column: {
|
|
|
+ show:false,
|
|
|
+ minWidth: 120,
|
|
|
+ },
|
|
|
+ dict: dict({
|
|
|
+ url: '/api/system/device/',
|
|
|
+ value: 'id',
|
|
|
+ label: 'name',
|
|
|
+ }),
|
|
|
+ form: {
|
|
|
+ show:true,
|
|
|
+ component: { placeholder: '请选择设备id' },
|
|
|
+ rules: [{ required: true, message: '请选择设备id' }],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ device_code: {
|
|
|
+ title: '设备编码',
|
|
|
+ search: {
|
|
|
+ show: false,
|
|
|
+ },
|
|
|
+ treeNode: true,
|
|
|
+ type: 'input',
|
|
|
+ column: {
|
|
|
+ minWidth: 120,
|
|
|
+ },
|
|
|
+ form: {
|
|
|
+ show:false,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ article_title: {
|
|
|
+ title: '设备标题',
|
|
|
search: {
|
|
|
show: false,
|
|
|
},
|
|
@@ -74,6 +119,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
|
minWidth: 120,
|
|
|
},
|
|
|
form: {
|
|
|
+ show:true,
|
|
|
rules: [
|
|
|
// 表单校验规则
|
|
|
{ required: true, message: '标题必填项' },
|
|
@@ -83,7 +129,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
- content:{
|
|
|
+ article_content:{
|
|
|
title: '内容',
|
|
|
type: 'textarea',
|
|
|
column: {
|
|
@@ -91,6 +137,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
|
minWidth: 120,
|
|
|
},
|
|
|
form: {
|
|
|
+ show:true,
|
|
|
col: {
|
|
|
span: 24
|
|
|
},
|
|
@@ -101,7 +148,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
|
}],
|
|
|
},
|
|
|
},
|
|
|
- publisher_name:{
|
|
|
+ device_name:{
|
|
|
title: '发布人',
|
|
|
type: 'input',
|
|
|
column: {
|
|
@@ -113,7 +160,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
|
rules: [{ required: false, message: '请填写发布人' }],
|
|
|
},
|
|
|
},
|
|
|
- publish_time:{
|
|
|
+ create_datetime:{
|
|
|
title: '发布时间',
|
|
|
type: 'input',
|
|
|
column: {
|
|
@@ -125,21 +172,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
|
rules: [{ required: false, message: '请填写发布时间' }],
|
|
|
},
|
|
|
},
|
|
|
- article_type:{
|
|
|
- title: '是否在顶部',
|
|
|
- type: 'input',
|
|
|
- column: {
|
|
|
- show:false,
|
|
|
- minWidth: 120,
|
|
|
- },
|
|
|
- form: {
|
|
|
- value:"borrow_rules",
|
|
|
- show:false,
|
|
|
- component: { placeholder: '请填写是否在顶部' },
|
|
|
- rules: [{ required: false, message: '请填写是否在顶部' }],
|
|
|
- },
|
|
|
- },
|
|
|
- status:{
|
|
|
+ is_default:{
|
|
|
title: '状态',
|
|
|
type: 'input',
|
|
|
column: {
|
|
@@ -147,12 +180,51 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
|
minWidth: 120,
|
|
|
},
|
|
|
form: {
|
|
|
- value:1,
|
|
|
+ value:true,
|
|
|
show:false,
|
|
|
component: { placeholder: '请填写状态' },
|
|
|
rules: [{ required: false, message: '请填写状态' }],
|
|
|
},
|
|
|
},
|
|
|
+ // device_id:{
|
|
|
+ // title: '设备id',
|
|
|
+ // type: 'input',
|
|
|
+ // column: {
|
|
|
+ // show:false,
|
|
|
+ // minWidth: 120,
|
|
|
+ // },
|
|
|
+ // form: {
|
|
|
+ // show:true,
|
|
|
+ // component: { placeholder: '请填写状态' },
|
|
|
+ // rules: [{ required: false, message: '请填写状态' }],
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // title:{
|
|
|
+ // title: '设备标题',
|
|
|
+ // type: 'input',
|
|
|
+ // column: {
|
|
|
+ // show:false,
|
|
|
+ // minWidth: 120,
|
|
|
+ // },
|
|
|
+ // form: {
|
|
|
+ // show:true,
|
|
|
+ // component: { placeholder: '请填写设备标题' },
|
|
|
+ // rules: [{ required: false, message: '请填写设备标题' }],
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // content:{
|
|
|
+ // title: '设备内容',
|
|
|
+ // type: 'input',
|
|
|
+ // column: {
|
|
|
+ // show:false,
|
|
|
+ // minWidth: 120,
|
|
|
+ // },
|
|
|
+ // form: {
|
|
|
+ // show:true,
|
|
|
+ // component: { placeholder: '请填写设备内容' },
|
|
|
+ // rules: [{ required: false, message: '请填写设备内容' }],
|
|
|
+ // },
|
|
|
+ // },
|
|
|
|
|
|
|
|
|
|