干燥机配套车间生产管理系统/云平台服务端
baoshiwei
2023-03-10 1fb197352b6a263646e4ccd3ed1c7854ede031dd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
import { BasicColumn, FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { filterDictTextByCache } from '/@/utils/dict/JDictSelectUtil';
 
export const columns: BasicColumn[] = [
  {
    title: '模板标题',
    dataIndex: 'templateName',
    width: 80,
  },
  {
    title: '模板编码',
    dataIndex: 'templateCode',
    width: 100,
  },
  {
    title: '通知模板',
    dataIndex: 'templateContent',
    width: 150,
  },
  {
    title: '模板类型',
    dataIndex: 'templateType',
    width: 100,
    customRender: ({ text }) => filterDictTextByCache('msgType', text),
  },
  {
    title: '是否应用',
    dataIndex: 'useStatus',
    width: 90,
    customRender: function ({ text }) {
      if (text == '1') {
        return '是';
      } else {
        return '否';
      }
    },
  },
];
 
export const searchFormSchema: FormSchema[] = [
  {
    label: '模板标题',
    field: 'templateName',
    component: 'Input',
  },
  {
    label: '模板编码',
    field: 'templateCode',
    component: 'Input',
  },
  {
    label: '模板类型',
    field: 'templateType',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'msgType',
    },
  },
];
 
export const formSchemas: FormSchema[] = [
  {
    label: 'ID',
    field: 'id',
    component: 'Input',
    show: false,
  },
  {
    label: '模板标题',
    field: 'templateName',
    component: 'Input',
    required: true,
  },
  {
    label: '模板编码',
    field: 'templateCode',
    component: 'Input',
    dynamicRules: ({ model, schema }) => {
      return [ ...rules.duplicateCheckRule('sys_sms_template', 'template_code', model, schema, true)];
    },
    // 编辑模式下不可修改编码
    dynamicDisabled: (params) => !!params.values.id,
  },
  {
    label: '模板类型',
    field: 'templateType',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'msgType',
      placeholder: '请选择模板类型',
    },
    required: true,
  },
  {
    label: '是否应用',
    field: 'useStatus',
    component: 'JSwitch',
    componentProps: {
      options: ['1', '0'],
    },
  },
  {
    label: '模板内容',
    field: 'templateContent',
    component: 'InputTextArea',
    componentProps: {
      autoSize: {
        minRows: 8,
        maxRows: 8,
      },
    },
    ifShow: ({ values }) => {
      return !['2', '4', '5'].includes(values.templateType);
    },
  },
 
  {
    label: '模板内容',
    field: 'templateContent',
    component: 'JEditor',
    ifShow: ({ values }) => {
      return ['2', '4'].includes(values.templateType);
    },
  },
  {
    label: '模板内容',
    field: 'templateContent',
    component: 'JMarkdownEditor',
    ifShow: ({ values }) => {
      return ['5'].includes(values.templateType);
    },
  },
];
 
export const sendTestFormSchemas: FormSchema[] = [
  {
    label: '模板编码',
    field: 'templateCode',
    component: 'Input',
    show: false,
  },
  {
    label: '模板标题',
    field: 'templateName',
    component: 'Input',
    componentProps: { disabled: true },
  },
  {
    label: '模板内容',
    field: 'templateContent',
    component: 'InputTextArea',
    componentProps: { disabled: true, rows: 5 },
  },
  {
    label: '测试数据',
    field: 'testData',
    component: 'InputTextArea',
    required: true,
    helpMessage: 'JSON数据',
    defaultValue: '{}',
    componentProps: {
      placeholder: '请输入JSON格式测试数据',
      rows: 5,
    },
  },
  {
    label: '消息类型',
    field: 'msgType',
    component: 'JDictSelectTag',
    required: true,
    defaultValue:'system',
    componentProps: { dictCode: 'messageType',type:'radio' },
  },
  {
    label: '消息接收方',
    field: 'receiver',
    required: true,
    component: 'JSelectUser',
    componentProps: {
      labelKey: 'username',
      rowKey: 'username',
    },
  },
];