Commit 83fb89db0d24a65a9c82b940ef2776dfb0d61d68

Authored by fengistao
1 parent 0923c9a5

test

Showing 1 changed file with 44 additions and 42 deletions
1 import { BasicColumn } from '/@/components/Table'; 1 import { BasicColumn } from '/@/components/Table';
2 import { FormSchema } from '/@/components/Table'; 2 import { FormSchema } from '/@/components/Table';
3 -import {findDictItemByCode} from "/@/api/system/dict";  
4 -import {MessageEnum} from "/@/enums/messageEnum";  
5 -import {DeviceTypeEnum,DeviceState} from "/@/api/device/model/deviceModel"; 3 +import { findDictItemByCode } from '/@/api/system/dict';
  4 +import { MessageEnum } from '/@/enums/messageEnum';
  5 +import { DeviceTypeEnum, DeviceState } from '/@/api/device/model/deviceModel';
6 export const columns: BasicColumn[] = [ 6 export const columns: BasicColumn[] = [
7 { 7 {
  8 + title: '默认',
  9 + },
  10 + {
8 title: '设备名称', 11 title: '设备名称',
9 dataIndex: 'name', 12 dataIndex: 'name',
10 width: 200, 13 width: 200,
@@ -13,7 +16,7 @@ export const columns: BasicColumn[] = [ @@ -13,7 +16,7 @@ export const columns: BasicColumn[] = [
13 title: '设备类型', 16 title: '设备类型',
14 dataIndex: 'deviceType', 17 dataIndex: 'deviceType',
15 width: 200, 18 width: 200,
16 - slots:{customRender:'deviceType'}, 19 + slots: { customRender: 'deviceType' },
17 }, 20 },
18 { 21 {
19 title: '设备配置', 22 title: '设备配置',
@@ -24,7 +27,7 @@ export const columns: BasicColumn[] = [ @@ -24,7 +27,7 @@ export const columns: BasicColumn[] = [
24 { 27 {
25 title: '标签', 28 title: '标签',
26 dataIndex: 'label', 29 dataIndex: 'label',
27 - width: 180 30 + width: 180,
28 }, 31 },
29 { 32 {
30 title: '配置信息', 33 title: '配置信息',
@@ -86,20 +89,19 @@ export const searchFormSchema: FormSchema[] = [ @@ -86,20 +89,19 @@ export const searchFormSchema: FormSchema[] = [
86 }, 89 },
87 ]; 90 ];
88 91
89 -  
90 -export const isMessage = (type:string)=>{  
91 - return type===MessageEnum.IS_SMS;  
92 -}  
93 -export const isEmail = (type:string)=>{  
94 - return type===MessageEnum.IS_EMAIL;  
95 -} 92 +export const isMessage = (type: string) => {
  93 + return type === MessageEnum.IS_SMS;
  94 +};
  95 +export const isEmail = (type: string) => {
  96 + return type === MessageEnum.IS_EMAIL;
  97 +};
96 98
97 export const formSchema: FormSchema[] = [ 99 export const formSchema: FormSchema[] = [
98 { 100 {
99 field: 'configName', 101 field: 'configName',
100 label: '配置名称', 102 label: '配置名称',
101 required: true, 103 required: true,
102 - component:'Input' 104 + component: 'Input',
103 }, 105 },
104 { 106 {
105 field: 'messageType', 107 field: 'messageType',
@@ -107,12 +109,12 @@ export const formSchema: FormSchema[] = [ @@ -107,12 +109,12 @@ export const formSchema: FormSchema[] = [
107 required: true, 109 required: true,
108 component: 'ApiSelect', 110 component: 'ApiSelect',
109 componentProps: { 111 componentProps: {
110 - api:findDictItemByCode,  
111 - params:{  
112 - dictCode:"message_type" 112 + api: findDictItemByCode,
  113 + params: {
  114 + dictCode: 'message_type',
113 }, 115 },
114 - labelField:'itemText',  
115 - valueField:'itemValue', 116 + labelField: 'itemText',
  117 + valueField: 'itemValue',
116 }, 118 },
117 }, 119 },
118 { 120 {
@@ -121,70 +123,70 @@ export const formSchema: FormSchema[] = [ @@ -121,70 +123,70 @@ export const formSchema: FormSchema[] = [
121 required: true, 123 required: true,
122 component: 'ApiSelect', 124 component: 'ApiSelect',
123 componentProps: { 125 componentProps: {
124 - api:findDictItemByCode,  
125 - params:{  
126 - dictCode:"platform_type" 126 + api: findDictItemByCode,
  127 + params: {
  128 + dictCode: 'platform_type',
127 }, 129 },
128 - labelField:'itemText',  
129 - valueField:'itemValue', 130 + labelField: 'itemText',
  131 + valueField: 'itemValue',
130 }, 132 },
131 - ifShow:({values}) => isMessage(Reflect.get(values,'messageType')), 133 + ifShow: ({ values }) => isMessage(Reflect.get(values, 'messageType')),
132 }, 134 },
133 { 135 {
134 field: 'accessKeyId', 136 field: 'accessKeyId',
135 label: 'accessKeyId', 137 label: 'accessKeyId',
136 required: true, 138 required: true,
137 - component:'Input',  
138 - ifShow:({values}) => isMessage(Reflect.get(values,'messageType')), 139 + component: 'Input',
  140 + ifShow: ({ values }) => isMessage(Reflect.get(values, 'messageType')),
139 }, 141 },
140 { 142 {
141 field: 'accessKeySecret', 143 field: 'accessKeySecret',
142 label: 'accessKeySecret', 144 label: 'accessKeySecret',
143 required: true, 145 required: true,
144 - component:'Input',  
145 - ifShow:({values}) => isMessage(Reflect.get(values,'messageType')), 146 + component: 'Input',
  147 + ifShow: ({ values }) => isMessage(Reflect.get(values, 'messageType')),
146 }, 148 },
147 { 149 {
148 field: 'host', 150 field: 'host',
149 label: '服务器地址', 151 label: '服务器地址',
150 - defaultValue:'smtp.163.com', 152 + defaultValue: 'smtp.163.com',
151 required: true, 153 required: true,
152 - component:'Input',  
153 - ifShow:({values}) => isEmail(Reflect.get(values,'messageType')), 154 + component: 'Input',
  155 + ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')),
154 }, 156 },
155 { 157 {
156 field: 'port', 158 field: 'port',
157 label: '端口', 159 label: '端口',
158 defaultValue: 25, 160 defaultValue: 25,
159 required: true, 161 required: true,
160 - component:'InputNumber',  
161 - ifShow:({values}) => isEmail(Reflect.get(values,'messageType')), 162 + component: 'InputNumber',
  163 + ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')),
162 }, 164 },
163 { 165 {
164 field: 'username', 166 field: 'username',
165 label: '用户名', 167 label: '用户名',
166 required: true, 168 required: true,
167 - component:'Input',  
168 - ifShow:({values}) => isEmail(Reflect.get(values,'messageType')), 169 + component: 'Input',
  170 + ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')),
169 }, 171 },
170 { 172 {
171 field: 'password', 173 field: 'password',
172 label: '密码', 174 label: '密码',
173 required: true, 175 required: true,
174 - component:'InputPassword',  
175 - ifShow:({values}) => isEmail(Reflect.get(values,'messageType')), 176 + component: 'InputPassword',
  177 + ifShow: ({ values }) => isEmail(Reflect.get(values, 'messageType')),
176 }, 178 },
177 { 179 {
178 field: 'config', 180 field: 'config',
179 label: '消息配置', 181 label: '消息配置',
180 - component:'Input',  
181 - show:false, 182 + component: 'Input',
  183 + show: false,
182 }, 184 },
183 { 185 {
184 field: 'id', 186 field: 'id',
185 label: '主键', 187 label: '主键',
186 - component:'Input',  
187 - show:false, 188 + component: 'Input',
  189 + show: false,
188 }, 190 },
189 { 191 {
190 field: 'status', 192 field: 'status',
@@ -202,5 +204,5 @@ export const formSchema: FormSchema[] = [ @@ -202,5 +204,5 @@ export const formSchema: FormSchema[] = [
202 label: '备注', 204 label: '备注',
203 field: 'remark', 205 field: 'remark',
204 component: 'InputTextArea', 206 component: 'InputTextArea',
205 - } 207 + },
206 ]; 208 ];