Commit 83fb89db0d24a65a9c82b940ef2776dfb0d61d68

Authored by fengistao
1 parent 0923c9a5

test

Showing 1 changed file with 44 additions and 42 deletions
1 1 import { BasicColumn } from '/@/components/Table';
2 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 6 export const columns: BasicColumn[] = [
7 7 {
  8 + title: '默认',
  9 + },
  10 + {
8 11 title: '设备名称',
9 12 dataIndex: 'name',
10 13 width: 200,
... ... @@ -13,7 +16,7 @@ export const columns: BasicColumn[] = [
13 16 title: '设备类型',
14 17 dataIndex: 'deviceType',
15 18 width: 200,
16   - slots:{customRender:'deviceType'},
  19 + slots: { customRender: 'deviceType' },
17 20 },
18 21 {
19 22 title: '设备配置',
... ... @@ -24,7 +27,7 @@ export const columns: BasicColumn[] = [
24 27 {
25 28 title: '标签',
26 29 dataIndex: 'label',
27   - width: 180
  30 + width: 180,
28 31 },
29 32 {
30 33 title: '配置信息',
... ... @@ -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 99 export const formSchema: FormSchema[] = [
98 100 {
99 101 field: 'configName',
100 102 label: '配置名称',
101 103 required: true,
102   - component:'Input'
  104 + component: 'Input',
103 105 },
104 106 {
105 107 field: 'messageType',
... ... @@ -107,12 +109,12 @@ export const formSchema: FormSchema[] = [
107 109 required: true,
108 110 component: 'ApiSelect',
109 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 123 required: true,
122 124 component: 'ApiSelect',
123 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 136 field: 'accessKeyId',
135 137 label: 'accessKeyId',
136 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 143 field: 'accessKeySecret',
142 144 label: 'accessKeySecret',
143 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 150 field: 'host',
149 151 label: '服务器地址',
150   - defaultValue:'smtp.163.com',
  152 + defaultValue: 'smtp.163.com',
151 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 158 field: 'port',
157 159 label: '端口',
158 160 defaultValue: 25,
159 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 166 field: 'username',
165 167 label: '用户名',
166 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 173 field: 'password',
172 174 label: '密码',
173 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 180 field: 'config',
179 181 label: '消息配置',
180   - component:'Input',
181   - show:false,
  182 + component: 'Input',
  183 + show: false,
182 184 },
183 185 {
184 186 field: 'id',
185 187 label: '主键',
186   - component:'Input',
187   - show:false,
  188 + component: 'Input',
  189 + show: false,
188 190 },
189 191 {
190 192 field: 'status',
... ... @@ -202,5 +204,5 @@ export const formSchema: FormSchema[] = [
202 204 label: '备注',
203 205 field: 'remark',
204 206 component: 'InputTextArea',
205   - }
  207 + },
206 208 ];
... ...