cloud-web-corejs 1.0.54-dev.344 → 1.0.54-dev.346

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,93 @@
1
+ let modules = {}
2
+ modules = {
3
+ name: "logic_paramEdit",
4
+ props: {
5
+ _dataId: [String, Number],
6
+ paramType: {
7
+ type: Number,
8
+ default: 0,
9
+ },
10
+ },
11
+ components: {},
12
+ data() {
13
+ return {
14
+ isEdit: false,
15
+ tabIndex: "first",
16
+ dataId: "",
17
+ logicParam: {
18
+ enabled: true,
19
+ paramValue: null,
20
+ paramType: this.paramType,
21
+ },
22
+ showCodeEditor: false,
23
+ paramTypeMap: {
24
+ 0: "逻辑参数",
25
+ 1: "操作日志编码",
26
+ 2: "上传文件服务",
27
+ },
28
+ };
29
+ },
30
+ created() {
31
+ if (this._dataId && !isNaN(this._dataId)) this.dataId = this._dataId;
32
+ },
33
+ mounted() {
34
+ this.getData();
35
+ },
36
+ methods: {
37
+ getData() {
38
+ if (this.dataId && !isNaN(this.dataId)) {
39
+ this.isEdit = true;
40
+ this.$commonHttp({
41
+ url: USER_PREFIX + `/logic_param/get`,
42
+ method: `post`,
43
+ data: {
44
+ id: this.dataId,
45
+ },
46
+ isLoading: true,
47
+ modalStrictly: true,
48
+ success: (res) => {
49
+ this.logicParam = res.objx || {};
50
+ this.showCodeEditor = true;
51
+ },
52
+ });
53
+ } else {
54
+ this.showCodeEditor = true;
55
+ }
56
+ },
57
+ saveData() {
58
+ this.$refs.editForm.$baseValidate((valid) => {
59
+ if (valid) {
60
+ this.$baseConfirm(this.$t1("您确定要保存吗?")).then(() => {
61
+ var url =
62
+ USER_PREFIX + (this.isEdit ? `/logic_param/update` : `/logic_param/save`);
63
+ this.$http({
64
+ url: url,
65
+ method: `post`,
66
+ data: this.logicParam,
67
+ isLoading: true,
68
+ success: (res) => {
69
+ this.$message({
70
+ message: res.content,
71
+ type: "success",
72
+ duration: 500,
73
+ onClose: (t) => {
74
+ if (this.isEdit) {
75
+ this.$baseReload();
76
+ } else {
77
+ this.$baseReload({
78
+ updateParam: {
79
+ _dataId: res.objx
80
+ },
81
+ });
82
+ }
83
+ },
84
+ });
85
+ },
86
+ });
87
+ });
88
+ }
89
+ });
90
+ },
91
+ },
92
+ };
93
+ export default modules
@@ -0,0 +1,358 @@
1
+ import editView from "../edit.vue";
2
+ import editView1 from "../edit1.vue";
3
+ import editView2 from "../edit2.vue";
4
+ import tableForm from "@base/components/table/tableForm.vue";
5
+ import { getJsxBtnList, getJsxStatus } from "@base/views/bd/setting/utils/index";
6
+
7
+ let modules = {};
8
+
9
+ modules = {
10
+ props: {
11
+ paramType: {
12
+ type: Number,
13
+ default: 0,
14
+ },
15
+ },
16
+ components: { tableForm, editView, editView1, editView2 },
17
+ data() {
18
+ return {
19
+ activeName: "second",
20
+ dataId: 0,
21
+ showEdit: false,
22
+ vxeOption: {},
23
+ formData: {},
24
+ editViewName:"editView",
25
+ };
26
+ },
27
+ created() {
28
+ this.initEditViewName();
29
+ },
30
+ mounted() {
31
+ this.initTableList();
32
+ },
33
+ methods: {
34
+ initEditViewName(){
35
+ let paramTypeStr = this.paramType ? this.paramType : "";
36
+ this.editViewName = `editView${paramTypeStr}`;
37
+
38
+ },
39
+ searchEvent() {
40
+ this.$refs["table-m1"].commitProxy("reload");
41
+ },
42
+ resetEvent() {
43
+ this.formData = {};
44
+ this.advancedFormData = {};
45
+ this.$refs["table-m1"].commitProxy("reload");
46
+ },
47
+ openEditDialog(id) {
48
+ this.copyId = 0;
49
+ this.dataId = !id || typeof id == "object" ? 0 : id;
50
+ this.activeName = "first";
51
+ this.$openEditView("showEdit");
52
+ },
53
+ getColumnInfo0() {
54
+ //逻辑参数
55
+ let columns = [
56
+ {
57
+ title: this.$t1("参数编码"),
58
+ field: "paramCode",
59
+ width: 150,
60
+ fixed: "left",
61
+ },
62
+ {
63
+ title: this.$t1("参数值"),
64
+ field: "paramValue",
65
+ width: 150,
66
+ },
67
+ {
68
+ title: this.$t1("参数备注"),
69
+ field: "remark",
70
+ width: 150,
71
+ },
72
+ {
73
+ title: this.$t1("组织编码"),
74
+ field: "paramCompanyCode",
75
+ width: 150,
76
+ },
77
+ {
78
+ title: this.$t1("是否启用"),
79
+ field: "enabled",
80
+ width: 150,
81
+ slots: {
82
+ default: ({ row }) => {
83
+ if (row.enabled) {
84
+ return getJsxStatus(null, this.$t1("启用"));
85
+ } else {
86
+ return getJsxStatus("s-3", this.$t1("禁用"));
87
+ }
88
+ },
89
+ },
90
+ },
91
+ ];
92
+
93
+ let searchColumns = [
94
+ {
95
+ title: this.$t1("参数编码"),
96
+ field: "paramCode",
97
+ type: "input",
98
+ common: true,
99
+ },
100
+ {
101
+ title: this.$t1("参数值"),
102
+ field: "paramValue",
103
+ type: "input",
104
+ common: true,
105
+ },
106
+ {
107
+ title: this.$t1("参数备注"),
108
+ field: "remark",
109
+ type: "input",
110
+ common: true,
111
+ },
112
+ {
113
+ title: this.$t1("组织编码"),
114
+ field: "paramCompanyCode",
115
+ type: "input",
116
+ common: true,
117
+ },
118
+ {
119
+ title: this.$t1("是否启用"),
120
+ field: "enabled",
121
+ type: "select",
122
+ itemOption: [
123
+ {
124
+ label: this.$t1("启用"),
125
+ value: true,
126
+ },
127
+ {
128
+ label: this.$t1("禁用"),
129
+ value: false,
130
+ },
131
+ ],
132
+ common: true,
133
+ },
134
+ ];
135
+
136
+ return { columns, searchColumns };
137
+ },
138
+ getColumnInfo1() {
139
+ //操作日志编码
140
+ let columns = [
141
+ {
142
+ title: this.$t1("参数值"),
143
+ field: "paramValue",
144
+ width: 150,
145
+ fixed: "left",
146
+ },
147
+ {
148
+ title: this.$t1("参数备注"),
149
+ field: "remark",
150
+ width: 150,
151
+ },
152
+ {
153
+ title: this.$t1("是否启用"),
154
+ field: "enabled",
155
+ width: 150,
156
+ slots: {
157
+ default: ({ row }) => {
158
+ if (row.enabled) {
159
+ return getJsxStatus(null, this.$t1("启用"));
160
+ } else {
161
+ return getJsxStatus("s-3", this.$t1("禁用"));
162
+ }
163
+ },
164
+ },
165
+ },
166
+ ];
167
+
168
+ let searchColumns = [
169
+ {
170
+ title: this.$t1("参数值"),
171
+ field: "paramValue",
172
+ type: "input",
173
+ common: true,
174
+ },
175
+ {
176
+ title: this.$t1("参数备注"),
177
+ field: "remark",
178
+ type: "input",
179
+ common: true,
180
+ },
181
+ {
182
+ title: this.$t1("是否启用"),
183
+ field: "enabled",
184
+ type: "select",
185
+ itemOption: [
186
+ {
187
+ label: this.$t1("启用"),
188
+ value: true,
189
+ },
190
+ {
191
+ label: this.$t1("禁用"),
192
+ value: false,
193
+ },
194
+ ],
195
+ common: true,
196
+ },
197
+ ];
198
+
199
+ return { columns, searchColumns };
200
+ },
201
+ getColumnInfo2() {
202
+ //上传文件服务
203
+ let columns = [
204
+ {
205
+ title: this.$t1("参数编码"),
206
+ field: "paramCode",
207
+ width: 150,
208
+ fixed: "left",
209
+ },
210
+ {
211
+ title: this.$t1("参数备注"),
212
+ field: "remark",
213
+ width: 150,
214
+ },
215
+ {
216
+ title: this.$t1("是否启用"),
217
+ field: "enabled",
218
+ width: 150,
219
+ slots: {
220
+ default: ({ row }) => {
221
+ if (row.enabled) {
222
+ return getJsxStatus(null, this.$t1("启用"));
223
+ } else {
224
+ return getJsxStatus("s-3", this.$t1("禁用"));
225
+ }
226
+ },
227
+ },
228
+ },
229
+ ];
230
+
231
+ let searchColumns = [
232
+ {
233
+ title: this.$t1("参数编码"),
234
+ field: "paramCode",
235
+ type: "input",
236
+ common: true,
237
+ },
238
+ {
239
+ title: this.$t1("参数值"),
240
+ field: "paramValue",
241
+ type: "input",
242
+ common: true,
243
+ },
244
+ {
245
+ title: this.$t1("参数备注"),
246
+ field: "remark",
247
+ type: "input",
248
+ common: true,
249
+ },
250
+ {
251
+ title: this.$t1("是否启用"),
252
+ field: "enabled",
253
+ type: "select",
254
+ itemOption: [
255
+ {
256
+ label: this.$t1("启用"),
257
+ value: true,
258
+ },
259
+ {
260
+ label: this.$t1("禁用"),
261
+ value: false,
262
+ },
263
+ ],
264
+ common: true,
265
+ },
266
+ ];
267
+
268
+ return { columns, searchColumns };
269
+ },
270
+ getColumnInfo() {
271
+ if (this.paramType === 0) {
272
+ return this.getColumnInfo0();
273
+ } else if (this.paramType === 1) {
274
+ return this.getColumnInfo1();
275
+ } else if (this.paramType === 2) {
276
+ return this.getColumnInfo2();
277
+ }
278
+ },
279
+ initTableList() {
280
+ let that = this;
281
+ let { columns, searchColumns } = this.getColumnInfo();
282
+
283
+ let tableOption = {
284
+ vue: this,
285
+ tableRef: "table-m1",
286
+ tableName: "logic_param_list-m" + this.paramType,
287
+ path: USER_PREFIX + "/logic_param/listPage",
288
+ param: () => {
289
+ return {
290
+ ...this.formData,
291
+ paramType: this.paramType,
292
+ };
293
+ },
294
+ columns: [
295
+ { type: "checkbox", width: 48, resizable: false, fixed: "left" },
296
+ ...columns,
297
+ {
298
+ field: "createBy",
299
+ title: this.$t1("创建人"),
300
+ width: 150,
301
+ },
302
+ {
303
+ field: "createDate",
304
+ title: this.$t1("创建时间"),
305
+ width: 150,
306
+ },
307
+ {
308
+ field: "modifyBy",
309
+ title: this.$t1("更新人"),
310
+ width: 150,
311
+ },
312
+ {
313
+ field: "modifyDate",
314
+ title: this.$t1("更新时间"),
315
+ width: 150,
316
+ },
317
+ {
318
+ width: 47,
319
+ fixed: "right",
320
+ title: "",
321
+ sortable: false,
322
+ slots: {
323
+ default: ({ row }) => {
324
+ return [
325
+ <div>
326
+ <a
327
+ href="javascript:void(0);"
328
+ class="a-link"
329
+ onclick={() => {
330
+ this.openEditDialog(row.id);
331
+ }}
332
+ >
333
+ <el-tooltip
334
+ enterable={false}
335
+ effect="dark"
336
+ content={this.$t1("查看")}
337
+ placement="top"
338
+ popper-class="tooltip-skin"
339
+ >
340
+ <i class="el-icon-edit" />
341
+ </el-tooltip>
342
+ </a>
343
+ </div>,
344
+ ];
345
+ },
346
+ },
347
+ },
348
+ ],
349
+ searchColumns,
350
+ };
351
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
352
+ this.vxeOption = opts;
353
+ });
354
+ },
355
+ },
356
+ };
357
+
358
+ export default modules
@@ -3,14 +3,25 @@
3
3
  <el-form ref="editForm" :model="position">
4
4
  <div class="d-header clearfix">
5
5
  <div class="fl">
6
- <i class="el-icon-info"/>
7
- {{ dataId ? $t1('查看岗位') : $t1('新增岗位') }}
6
+ <i class="el-icon-info" />
7
+ {{ dataId ? $t1("查看岗位") : $t1("新增岗位") }}
8
8
  </div>
9
9
  <div class="fr">
10
- <el-button type="primary" plain class="button-sty" @click="$baseReload()" icon="el-icon-refresh-right">
11
- {{ $t1('重置') }}
10
+ <el-button
11
+ type="primary"
12
+ plain
13
+ class="button-sty"
14
+ @click="$baseReload()"
15
+ icon="el-icon-refresh-right"
16
+ >
17
+ {{ $t1("重置") }}
12
18
  </el-button>
13
- <el-button type="primary" class="button-sty" icon="el-icon-check" @click="saveData">{{ $t1('保存') }}
19
+ <el-button
20
+ type="primary"
21
+ class="button-sty"
22
+ icon="el-icon-check"
23
+ @click="saveData"
24
+ >{{ $t1("保存") }}
14
25
  </el-button>
15
26
  </div>
16
27
  </div>
@@ -19,51 +30,76 @@
19
30
  <template #default>
20
31
  <table class="table-detail">
21
32
  <tbody>
22
- <tr>
23
- <th>
24
- <em class="f-red">*</em>
25
- {{ $t1('岗位名称') }}
26
- </th>
27
- <td>
28
- <el-form-item prop="name" :rules="[{ required: true, trigger: 'blur' }]">
29
- <el-input type="text" autocomplete="off" v-model="position.name" clearable/>
30
- </el-form-item>
31
- </td>
32
- <th>
33
- <em class="f-red">*</em>
34
- {{ $t1('岗位编码') }}
35
- </th>
36
- <td>
37
- <template v-if="dataId">
38
- {{ position.code }}
39
- </template>
40
- <el-form-item v-else prop="code" :rules="[{ required: true, trigger: 'blur' }]">
41
- <el-input type="text" autocomplete="off" v-model="position.code" clearable/>
42
- </el-form-item>
43
- </td>
44
- <th>{{ $t1('设置') }}</th>
45
- <td>
46
- <el-checkbox :label="$t1('是否启用')" v-model="position.enabled"></el-checkbox>
47
- </td>
48
- </tr>
49
- <tr>
50
- <th>{{ $t1('备注') }}</th>
51
- <td colspan="5">
52
- <el-input type="textarea" :rows="2" :placeholder="$t1('请输入内容')" size="small"
53
- v-model="position.memo"
54
- clearable></el-input>
55
- </td>
56
- </tr>
57
- <tr>
58
- <th>{{ $t1('创建人') }}</th>
59
- <td>{{ position._createBy }}</td>
60
- <th>{{ $t1('创建时间') }}</th>
61
- <td>{{ position.createDate }}</td>
62
- <th>{{ $t1('更新人') }}</th>
63
- <td>{{ position._modifyBy }}</td>
64
- <th>{{ $t1('更新时间') }}</th>
65
- <td>{{ position.modifyDate }}</td>
66
- </tr>
33
+ <tr>
34
+ <th>
35
+ <em class="f-red">*</em>
36
+ {{ $t1("岗位名称") }}
37
+ </th>
38
+ <td>
39
+ <el-form-item
40
+ prop="name"
41
+ :rules="[{ required: true, trigger: 'blur' }]"
42
+ >
43
+ <el-input
44
+ type="text"
45
+ autocomplete="off"
46
+ v-model="position.name"
47
+ clearable
48
+ />
49
+ </el-form-item>
50
+ </td>
51
+ <th>
52
+ <em class="f-red">*</em>
53
+ {{ $t1("岗位编码") }}
54
+ </th>
55
+ <td>
56
+ <template v-if="dataId">
57
+ {{ position.code }}
58
+ </template>
59
+ <el-form-item
60
+ v-else
61
+ prop="code"
62
+ :rules="[{ required: true, trigger: 'blur' }]"
63
+ >
64
+ <el-input
65
+ type="text"
66
+ autocomplete="off"
67
+ v-model="position.code"
68
+ clearable
69
+ />
70
+ </el-form-item>
71
+ </td>
72
+ <th>{{ $t1("设置") }}</th>
73
+ <td>
74
+ <el-checkbox
75
+ :label="$t1('是否启用')"
76
+ v-model="position.enabled"
77
+ ></el-checkbox>
78
+ </td>
79
+ </tr>
80
+ <tr>
81
+ <th>{{ $t1("备注") }}</th>
82
+ <td colspan="5">
83
+ <el-input
84
+ type="textarea"
85
+ :rows="2"
86
+ :placeholder="$t1('请输入内容')"
87
+ size="small"
88
+ v-model="position.memo"
89
+ clearable
90
+ ></el-input>
91
+ </td>
92
+ </tr>
93
+ <tr>
94
+ <th>{{ $t1("创建人") }}</th>
95
+ <td>{{ position._createBy }}</td>
96
+ <th>{{ $t1("创建时间") }}</th>
97
+ <td>{{ position.createDate }}</td>
98
+ <th>{{ $t1("更新人") }}</th>
99
+ <td>{{ position._modifyBy }}</td>
100
+ <th>{{ $t1("更新时间") }}</th>
101
+ <td>{{ position.modifyDate }}</td>
102
+ </tr>
67
103
  </tbody>
68
104
  </table>
69
105
  </template>
@@ -75,19 +111,19 @@
75
111
 
76
112
  <script>
77
113
  export default {
78
- name: 'positionEdit',
114
+ name: "positionEdit",
79
115
  props: {
80
- _dataId: [String, Number]
116
+ _dataId: [String, Number],
81
117
  },
82
118
  components: {},
83
119
  data() {
84
120
  return {
85
121
  isEdit: false,
86
- tabIndex: 'first',
87
- dataId: '',
122
+ tabIndex: "first",
123
+ dataId: "",
88
124
  position: {
89
- enabled: true
90
- }
125
+ enabled: true,
126
+ },
91
127
  };
92
128
  },
93
129
  created() {
@@ -104,53 +140,49 @@ export default {
104
140
  url: USER_PREFIX + `/position/get`,
105
141
  method: `post`,
106
142
  data: {
107
- id: this.dataId
143
+ id: this.dataId,
108
144
  },
109
145
  isLoading: true,
110
146
  modalStrictly: true,
111
- success: res => {
147
+ success: (res) => {
112
148
  this.position = res.objx || {};
113
- }
149
+ },
114
150
  });
115
- } else {
116
- this.position = {
117
- enabled: true
118
- };
119
151
  }
120
152
  },
121
153
  saveData() {
122
- this.$refs.editForm.$baseValidate(valid => {
154
+ this.$refs.editForm.$baseValidate((valid) => {
123
155
  if (valid) {
124
- this.$baseConfirm(this.$t1('您确定要保存吗?')).then(() => {
156
+ this.$baseConfirm(this.$t1("您确定要保存吗?")).then(() => {
125
157
  var url = USER_PREFIX + (this.isEdit ? `/position/update` : `/position/save`);
126
158
  this.$http({
127
159
  url: url,
128
160
  method: `post`,
129
161
  data: this.position,
130
162
  isLoading: true,
131
- success: res => {
163
+ success: (res) => {
132
164
  this.$message({
133
165
  message: res.content,
134
- type: 'success',
166
+ type: "success",
135
167
  duration: 500,
136
- onClose: t => {
168
+ onClose: (t) => {
137
169
  if (this.isEdit) {
138
170
  this.$baseReload();
139
171
  } else {
140
172
  this.$baseReload({
141
173
  updateParam: {
142
- _dataId: res.objx
143
- }
174
+ _dataId: res.objx,
175
+ },
144
176
  });
145
177
  }
146
- }
178
+ },
147
179
  });
148
- }
180
+ },
149
181
  });
150
182
  });
151
183
  }
152
184
  });
153
- }
154
- }
185
+ },
186
+ },
155
187
  };
156
188
  </script>