|
@@ -1,6 +1,6 @@
|
|
|
import { BasicColumn } from '/@/components/Table';
|
|
|
import { FormSchema } from '/@/components/Table';
|
|
|
-import { getAllRolesList, getAllTenantList } from './point.api';
|
|
|
+import { selectDevice } from './point.api';
|
|
|
import { rules } from '/@/utils/helper/validator';
|
|
|
import { render } from '/@/utils/common/renderUtils';
|
|
|
export const columns: BasicColumn[] = [
|
|
@@ -10,8 +10,13 @@ export const columns: BasicColumn[] = [
|
|
|
width: 120,
|
|
|
},
|
|
|
{
|
|
|
+ title: '设备类型code',
|
|
|
+ dataIndex: 'devicekind',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
title: 'plc地址',
|
|
|
- dataIndex: 'plcaddr',
|
|
|
+ dataIndex: 'plcaddr',
|
|
|
width: 100,
|
|
|
},
|
|
|
{
|
|
@@ -76,84 +81,14 @@ export const columns: BasicColumn[] = [
|
|
|
},
|
|
|
];
|
|
|
|
|
|
-export const recycleColumns: BasicColumn[] = [
|
|
|
- {
|
|
|
- title: '用户账号',
|
|
|
- dataIndex: 'username',
|
|
|
- width: 100,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '用户姓名',
|
|
|
- dataIndex: 'realname',
|
|
|
- width: 100,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '头像',
|
|
|
- dataIndex: 'avatar',
|
|
|
- width: 80,
|
|
|
- customRender: render.renderAvatar,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '性别',
|
|
|
- dataIndex: 'sex',
|
|
|
- width: 80,
|
|
|
- sorter: true,
|
|
|
- customRender: ({ text }) => {
|
|
|
- return render.renderDict(text, 'sex');
|
|
|
- },
|
|
|
- },
|
|
|
-];
|
|
|
-
|
|
|
export const searchFormSchema: FormSchema[] = [
|
|
|
- // {
|
|
|
- // field: 'devicekind',
|
|
|
- // component: 'JTreeSelect',
|
|
|
- // label: '下拉树选择',
|
|
|
- // helpMessage: ['component模式'],
|
|
|
- // componentProps: {
|
|
|
- // dict: 'sys_permission,name,id',
|
|
|
- // pidField: 'parent_id',
|
|
|
- // },
|
|
|
- // colProps: {
|
|
|
- // span: 12,
|
|
|
- // },
|
|
|
- // },
|
|
|
{
|
|
|
label: '设备类型',
|
|
|
field: 'devicekind',
|
|
|
component: 'MTreeSelect',
|
|
|
- componentProps: {
|
|
|
- fieldNames: {
|
|
|
- children: 'children',
|
|
|
- label: 'itemText',
|
|
|
- value: 'id',
|
|
|
- },
|
|
|
- },
|
|
|
- colProps: { span: 6 },
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'plc地址',
|
|
|
- field: 'plcaddr',
|
|
|
- component: 'Input',
|
|
|
- colProps: { span: 6 },
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'plc读写位数',
|
|
|
- field: 'floatnum',
|
|
|
- component: 'Input',
|
|
|
- colProps: { span: 6 },
|
|
|
- },
|
|
|
- {
|
|
|
- label: '读写类型',
|
|
|
- field: 'datakind',
|
|
|
- component: 'JDictSelectTag',
|
|
|
- componentProps: {
|
|
|
- dictCode: 'datakind',
|
|
|
- placeholder: '请选择读写类型',
|
|
|
- stringToNumber: true,
|
|
|
- },
|
|
|
colProps: { span: 6 },
|
|
|
},
|
|
|
+
|
|
|
{
|
|
|
label: '值名称',
|
|
|
field: 'valuename',
|
|
@@ -166,57 +101,6 @@ export const searchFormSchema: FormSchema[] = [
|
|
|
component: 'Input',
|
|
|
colProps: { span: 6 },
|
|
|
},
|
|
|
- {
|
|
|
- label: '值类型',
|
|
|
- field: 'valuetype',
|
|
|
- component: 'Input',
|
|
|
- colProps: { span: 6 },
|
|
|
- },
|
|
|
- {
|
|
|
- label: '最小值',
|
|
|
- field: 'fmin',
|
|
|
- component: 'Input',
|
|
|
- colProps: { span: 6 },
|
|
|
- },
|
|
|
- {
|
|
|
- label: '最大值',
|
|
|
- field: 'fmax',
|
|
|
- component: 'Input',
|
|
|
- colProps: { span: 6 },
|
|
|
- },
|
|
|
- {
|
|
|
- label: '模拟最大值',
|
|
|
- field: 'testup',
|
|
|
- component: 'Input',
|
|
|
- colProps: { span: 6 },
|
|
|
- },
|
|
|
- {
|
|
|
- label: '模拟最小值',
|
|
|
- field: 'testlow',
|
|
|
- component: 'Input',
|
|
|
- colProps: { span: 6 },
|
|
|
- },
|
|
|
- {
|
|
|
- label: '小数位数',
|
|
|
- field: 'floatnum',
|
|
|
- component: 'Input',
|
|
|
- colProps: { span: 6 },
|
|
|
- },
|
|
|
- {
|
|
|
- label: '是否保存',
|
|
|
- field: 'saveflag',
|
|
|
- component: 'RadioGroup',
|
|
|
- defaultValue: 1,
|
|
|
- componentProps: () => {
|
|
|
- return {
|
|
|
- options: [
|
|
|
- { label: '是', value: 1, key: '1' },
|
|
|
- { label: '否', value: 0, key: '2' },
|
|
|
- ],
|
|
|
- };
|
|
|
- },
|
|
|
- colProps: { span: 6 },
|
|
|
- },
|
|
|
];
|
|
|
|
|
|
export const formSchema: FormSchema[] = [
|
|
@@ -226,214 +110,10 @@ export const formSchema: FormSchema[] = [
|
|
|
component: 'Input',
|
|
|
show: false,
|
|
|
},
|
|
|
- // {
|
|
|
- // label: '用户账号',
|
|
|
- // field: 'username',
|
|
|
- // component: 'Input',
|
|
|
- // dynamicDisabled: ({ values }) => {
|
|
|
- // return !!values.id;
|
|
|
- // },
|
|
|
- // dynamicRules: ({ model, schema }) => rules.duplicateCheckRule('sys_user', 'username', model, schema, true),
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '登录密码',
|
|
|
- // field: 'password',
|
|
|
- // component: 'StrengthMeter',
|
|
|
- // rules: [
|
|
|
- // {
|
|
|
- // required: true,
|
|
|
- // message: '请输入登录密码',
|
|
|
- // },
|
|
|
- // ],
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '确认密码',
|
|
|
- // field: 'confirmPassword',
|
|
|
- // component: 'InputPassword',
|
|
|
- // dynamicRules: ({ values }) => rules.confirmPassword(values, true),
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '用户姓名',
|
|
|
- // field: 'realname',
|
|
|
- // required: true,
|
|
|
- // component: 'Input',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '工号',
|
|
|
- // field: 'workNo',
|
|
|
- // required: true,
|
|
|
- // component: 'Input',
|
|
|
- // dynamicRules: ({ model, schema }) => rules.duplicateCheckRule('sys_user', 'work_no', model, schema, true),
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '职务',
|
|
|
- // field: 'post',
|
|
|
- // required: false,
|
|
|
- // component: 'JSelectPosition',
|
|
|
- // componentProps: {
|
|
|
- // rowKey: 'code',
|
|
|
- // labelKey: 'name',
|
|
|
- // },
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '角色',
|
|
|
- // field: 'selectedroles',
|
|
|
- // component: 'ApiSelect',
|
|
|
- // componentProps: {
|
|
|
- // mode: 'multiple',
|
|
|
- // api: getAllRolesList,
|
|
|
- // labelField: 'roleName',
|
|
|
- // valueField: 'id',
|
|
|
- // },
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '所属部门',
|
|
|
- // field: 'selecteddeparts',
|
|
|
- // component: 'JSelectDept',
|
|
|
- // componentProps: ({ formActionType, formModel }) => {
|
|
|
- // return {
|
|
|
- // sync: false,
|
|
|
- // checkStrictly: true,
|
|
|
- // defaultExpandLevel: 2,
|
|
|
-
|
|
|
- // onSelect: (options, values) => {
|
|
|
- // const { updateSchema } = formActionType;
|
|
|
- // //所属部门修改后更新负责部门下拉框数据
|
|
|
- // updateSchema([
|
|
|
- // {
|
|
|
- // field: 'departIds',
|
|
|
- // componentProps: { options },
|
|
|
- // },
|
|
|
- // ]);
|
|
|
- // //所属部门修改后更新负责部门数据
|
|
|
- // formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1));
|
|
|
- // },
|
|
|
- // };
|
|
|
- // },
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '租户',
|
|
|
- // field: 'relTenantIds',
|
|
|
- // component: 'ApiSelect',
|
|
|
- // componentProps: {
|
|
|
- // mode: 'multiple',
|
|
|
- // api: getAllTenantList,
|
|
|
- // numberToString: true,
|
|
|
- // labelField: 'name',
|
|
|
- // valueField: 'id',
|
|
|
- // },
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '身份',
|
|
|
- // field: 'userIdentity',
|
|
|
- // component: 'RadioGroup',
|
|
|
- // defaultValue: 1,
|
|
|
- // componentProps: ({ formModel }) => {
|
|
|
- // return {
|
|
|
- // options: [
|
|
|
- // { label: '普通用户', value: 1, key: '1' },
|
|
|
- // { label: '上级', value: 2, key: '2' },
|
|
|
- // ],
|
|
|
- // onChange: () => {
|
|
|
- // formModel.userIdentity == 1 && (formModel.departIds = []);
|
|
|
- // },
|
|
|
- // };
|
|
|
- // },
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '负责部门',
|
|
|
- // field: 'departIds',
|
|
|
- // component: 'Select',
|
|
|
- // componentProps: {
|
|
|
- // mode: 'multiple',
|
|
|
- // },
|
|
|
- // ifShow: ({ values }) => values.userIdentity == 2,
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '头像',
|
|
|
- // field: 'avatar',
|
|
|
- // component: 'JImageUpload',
|
|
|
- // componentProps: {
|
|
|
- // fileMax: 1,
|
|
|
- // },
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '生日',
|
|
|
- // field: 'birthday',
|
|
|
- // component: 'DatePicker',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '性别',
|
|
|
- // field: 'sex',
|
|
|
- // component: 'JDictSelectTag',
|
|
|
- // componentProps: {
|
|
|
- // dictCode: 'sex',
|
|
|
- // placeholder: '请选择性别',
|
|
|
- // stringToNumber: true,
|
|
|
- // },
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '邮箱',
|
|
|
- // field: 'email',
|
|
|
- // component: 'Input',
|
|
|
- // rules: rules.rule('email', false),
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '手机号码',
|
|
|
- // field: 'phone',
|
|
|
- // component: 'Input',
|
|
|
- // dynamicRules: ({ model, schema }) => {
|
|
|
- // return [{ ...rules.duplicateCheckRule('sys_user', 'phone', model, schema, true)[0] }, { pattern: /^1[3|4|5|7|8|9][0-9]\d{8}$/, message: '手机号码格式有误' }];
|
|
|
- // },
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '座机',
|
|
|
- // field: 'telephone',
|
|
|
- // component: 'Input',
|
|
|
- // rules: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' }],
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '工作流引擎',
|
|
|
- // field: 'activitiSync',
|
|
|
- // defaultValue: 1,
|
|
|
- // component: 'JDictSelectTag',
|
|
|
- // componentProps: {
|
|
|
- // dictCode: 'activiti_sync',
|
|
|
- // type: 'radio',
|
|
|
- // stringToNumber: true,
|
|
|
- // },
|
|
|
- // },
|
|
|
{
|
|
|
label: '设备类型',
|
|
|
field: 'devicekind',
|
|
|
component: 'MTreeSelect',
|
|
|
- componentProps: {
|
|
|
- fieldNames: {
|
|
|
- children: 'children',
|
|
|
- label: 'itemText',
|
|
|
- value: 'id',
|
|
|
- },
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'plc地址',
|
|
|
- field: 'plcaddr',
|
|
|
- component: 'Input',
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'plc读写位数',
|
|
|
- field: 'floatnum',
|
|
|
- component: 'Input',
|
|
|
- },
|
|
|
- {
|
|
|
- label: '读写类型',
|
|
|
- field: 'datakind',
|
|
|
- component: 'JDictSelectTag',
|
|
|
- componentProps: {
|
|
|
- dictCode: 'datakind',
|
|
|
- placeholder: '请选择读写类型',
|
|
|
- stringToNumber: true,
|
|
|
- },
|
|
|
},
|
|
|
{
|
|
|
label: '值名称',
|
|
@@ -445,143 +125,4 @@ export const formSchema: FormSchema[] = [
|
|
|
field: 'valuecode',
|
|
|
component: 'Input',
|
|
|
},
|
|
|
- {
|
|
|
- label: '值类型',
|
|
|
- field: 'valuetype',
|
|
|
- component: 'JDictSelectTag',
|
|
|
- componentProps: {
|
|
|
- dictCode: 'valuetype',
|
|
|
- placeholder: '请选择读写类型',
|
|
|
- stringToNumber: true,
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- label: '最小值',
|
|
|
- field: 'fmin',
|
|
|
- component: 'Input',
|
|
|
- },
|
|
|
- {
|
|
|
- label: '最大值',
|
|
|
- field: 'fmax',
|
|
|
- component: 'Input',
|
|
|
- },
|
|
|
- {
|
|
|
- label: '模拟最大值',
|
|
|
- field: 'testup',
|
|
|
- component: 'Input',
|
|
|
- },
|
|
|
- {
|
|
|
- label: '模拟最小值',
|
|
|
- field: 'testlow',
|
|
|
- component: 'Input',
|
|
|
- },
|
|
|
- {
|
|
|
- label: '小数位数',
|
|
|
- field: 'floatnum',
|
|
|
- component: 'Input',
|
|
|
- },
|
|
|
- {
|
|
|
- label: '是否保存',
|
|
|
- field: 'saveflag',
|
|
|
- component: 'RadioGroup',
|
|
|
- defaultValue: 1,
|
|
|
- componentProps: () => {
|
|
|
- return {
|
|
|
- options: [
|
|
|
- { label: '是', value: 1, key: '1' },
|
|
|
- { label: '否', value: 0, key: '2' },
|
|
|
- ],
|
|
|
- };
|
|
|
- },
|
|
|
- },
|
|
|
-];
|
|
|
-
|
|
|
-export const formPasswordSchema: FormSchema[] = [
|
|
|
- {
|
|
|
- label: '用户账号',
|
|
|
- field: 'username',
|
|
|
- component: 'Input',
|
|
|
- componentProps: { readOnly: true },
|
|
|
- },
|
|
|
- {
|
|
|
- label: '登录密码',
|
|
|
- field: 'password',
|
|
|
- component: 'StrengthMeter',
|
|
|
- componentProps: {
|
|
|
- placeholder: '请输入登录密码',
|
|
|
- },
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请输入登录密码',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- label: '确认密码',
|
|
|
- field: 'confirmPassword',
|
|
|
- component: 'InputPassword',
|
|
|
- dynamicRules: ({ values }) => rules.confirmPassword(values, true),
|
|
|
- },
|
|
|
-];
|
|
|
-
|
|
|
-export const formAgentSchema: FormSchema[] = [
|
|
|
- {
|
|
|
- label: '',
|
|
|
- field: 'id',
|
|
|
- component: 'Input',
|
|
|
- show: false,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'userName',
|
|
|
- label: '用户名',
|
|
|
- component: 'Input',
|
|
|
- componentProps: {
|
|
|
- readOnly: true,
|
|
|
- allowClear: false,
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'agentUserName',
|
|
|
- label: '代理人用户名',
|
|
|
- required: true,
|
|
|
- component: 'JSelectUser',
|
|
|
- componentProps: {
|
|
|
- rowKey: 'username',
|
|
|
- labelKey: 'realname',
|
|
|
- maxSelectCount: 10,
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'startTime',
|
|
|
- label: '代理开始时间',
|
|
|
- component: 'DatePicker',
|
|
|
- required: true,
|
|
|
- componentProps: {
|
|
|
- showTime: true,
|
|
|
- valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
- placeholder: '请选择代理开始时间',
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'endTime',
|
|
|
- label: '代理结束时间',
|
|
|
- component: 'DatePicker',
|
|
|
- required: true,
|
|
|
- componentProps: {
|
|
|
- showTime: true,
|
|
|
- valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
- placeholder: '请选择代理结束时间',
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'status',
|
|
|
- label: '状态',
|
|
|
- component: 'JDictSelectTag',
|
|
|
- defaultValue: '1',
|
|
|
- componentProps: {
|
|
|
- dictCode: 'valid_status',
|
|
|
- type: 'radioButton',
|
|
|
- },
|
|
|
- },
|
|
|
];
|