cloud-web-corejs 1.0.13 → 1.0.15

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.
Files changed (36) hide show
  1. package/package.json +1 -1
  2. package/src/components/jsonImport/exportDialog.vue +63 -0
  3. package/src/components/jsonImport/index.js +3 -1
  4. package/src/components/jsonImport/index.vue +6 -5
  5. package/src/components/jsonImport/mixins.js +1 -1
  6. package/src/components/xform/form-designer/form-widget/dialog/preformDialog.vue +77 -0
  7. package/src/components/xform/form-designer/index.vue +13 -3
  8. package/src/components/xform/form-designer/indexMixin.js +4 -3
  9. package/src/components/xform/form-designer/setting-panel/property-editor/field-accessUrl/accessUrl-editor.vue +1 -1
  10. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +1 -0
  11. package/src/components/xform/form-render/container-item/containerItemMixin.js +11 -11
  12. package/src/components/xform/form-render/container-item/data-table-mixin.js +1 -1
  13. package/src/layout/components/Sidebar/default.vue +1226 -0
  14. package/src/layout/components/Sidebar/index.vue +5 -1178
  15. package/src/permission.js +1 -1
  16. package/src/router/modules/customer.js +1 -1
  17. package/src/router/modules/system.js +2 -2
  18. package/src/store/modules/permission.js +4 -3
  19. package/src/views/bd/setting/bd_attach_setting/list.vue +64 -45
  20. package/src/views/bd/setting/form_script/edit.vue +40 -25
  21. package/src/views/bd/setting/form_script/edit1.vue +40 -25
  22. package/src/views/bd/setting/form_script/list.vue +13 -8
  23. package/src/views/bd/setting/form_script/list1.vue +74 -37
  24. package/src/views/bd/setting/form_template/edit.vue +41 -25
  25. package/src/views/bd/setting/form_template/list.vue +72 -58
  26. package/src/views/bd/setting/form_template/preformDialog.vue +77 -0
  27. package/src/views/bd/setting/menu_kind/authDialog.vue +308 -0
  28. package/src/views/bd/setting/menu_kind/dialog.vue +3 -0
  29. package/src/views/bd/setting/menu_kind/list.vue +35 -9
  30. package/src/views/bd/setting/table_model/edit.vue +48 -34
  31. package/src/views/bd/setting/table_model/list.vue +72 -33
  32. package/src/views/user/home/index.vue +7 -4
  33. package/src/views/user/login/indexMixin.js +45 -21
  34. package/src/views/user/user/form_edit.vue +483 -0
  35. package/src/views/user/user/form_list.vue +348 -0
  36. package/src/views/user/user/list.vue +2 -2
@@ -0,0 +1,483 @@
1
+ <template>
2
+ <div class="detail-wrap">
3
+ <el-form ref="editForm" :model="user">
4
+ <div class="d-header clearfix">
5
+ <div class="fl">
6
+ <i class="el-icon-info"/>
7
+ {{ dataId ? '查看' : '新增' }}用户
8
+ </div>
9
+ <div class="fr">
10
+ <!-- <temp-storage-button :option="tempStorageOption" v-if="!dataId"></temp-storage-button>-->
11
+ <base-input-export :option="exportOption" :parent-target="_self" v-if="dataId"/>
12
+ <el-button type="primary" plain class="button-sty" icon="el-icon-unlock" @click="unlock" v-if="user.locked"
13
+ v-hasPermi="'user:unlock'">解锁
14
+ </el-button>
15
+ <el-button type="primary" plain class="button-sty" @click="$baseReload()" icon="el-icon-refresh-right">重置
16
+ </el-button>
17
+ <el-button type="primary" class="button-sty" icon="el-icon-check" @click="saveData">保存</el-button>
18
+ </div>
19
+ </div>
20
+ <baseTabs>
21
+ <baseTabPane label="基本信息">
22
+ <template #default>
23
+ <table class="table-detail">
24
+ <tbody>
25
+ <tr>
26
+ <th>
27
+ <em class="f-red">*</em>
28
+ 登录名
29
+ </th>
30
+ <td colspan="3">
31
+ <el-form-item prop="loginAccount" :rules="[{ required: true, trigger: 'blur' }]">
32
+ <template v-if="dataId">
33
+ <el-input size="small" v-model="user.loginAccount" maxlength="255" autocomplete="off"
34
+ lay-verify="required" required="" :readonly="true"/>
35
+ </template>
36
+ <template v-else>
37
+ <el-input size="small" v-model="user.loginAccount" maxlength="255" autocomplete="off"
38
+ lay-verify="required" required="" clearable/>
39
+ </template>
40
+ </el-form-item>
41
+ </td>
42
+
43
+ <th>
44
+ <em class="f-red">*</em>
45
+ 姓名
46
+ </th>
47
+ <td colspan="3">
48
+ <el-form-item prop="nickName" :rules="[{ required: true, trigger: 'blur' }]">
49
+ <el-input size="small" v-model="user.nickName" maxlength="200" lay-verify="required" required=""
50
+ clearable/>
51
+ </el-form-item>
52
+ </td>
53
+ </tr>
54
+ <tr>
55
+
56
+ <th>
57
+ <em class="f-red" v-if="!dataId">*</em>
58
+ 密码
59
+ </th>
60
+ <td>
61
+ <el-form-item prop="password" :rules="passRules">
62
+ <el-input size="small" type="password" v-model="user.password" show-password maxlength="255"
63
+ autocomplete="off" auto-complete="new-password" clearable/>
64
+ </el-form-item>
65
+ </td>
66
+ <th>
67
+ <em class="f-red" v-if="!dataId">*</em>
68
+ 确认密码
69
+ </th>
70
+ <td>
71
+ <el-form-item prop="rePassword" :rules="pass2Rules">
72
+ <el-input
73
+ size="small"
74
+ type="password"
75
+ v-model="user.rePassword"
76
+ show-password
77
+ maxlength="255"
78
+ autocomplete="off"
79
+ auto-complete="new-password"
80
+ lay-verify="confirmPass"
81
+ clearable
82
+ />
83
+ </el-form-item>
84
+ </td>
85
+ <th>设置</th>
86
+ <td>
87
+ <el-checkbox label="是否启用" v-model="user.enabled"></el-checkbox>
88
+ </td>
89
+
90
+
91
+ </tr>
92
+
93
+ <tr>
94
+ <th>创建人</th>
95
+ <td>{{ user.createBy }}</td>
96
+ <th>创建时间</th>
97
+ <td>{{ user.createDate }}</td>
98
+ <th>更新人</th>
99
+ <td>{{ user.modifyBy }}</td>
100
+ <th>更新时间</th>
101
+ <td>{{ user.modifyDate }}</td>
102
+ </tr>
103
+ </tbody>
104
+ </table>
105
+ </template>
106
+ </baseTabPane>
107
+ </baseTabs>
108
+ </el-form>
109
+ </div>
110
+ </template>
111
+
112
+ <script>
113
+ import xeUtils from "xe-utils";
114
+ /*import tempStorageButton from "@base/components/tempStorage/index.vue";*/
115
+
116
+
117
+ export default {
118
+ name: 'UserEdit',
119
+ components: {
120
+
121
+ },
122
+ props: ['_dataId', 'userType', 'flag'],
123
+ data() {
124
+ var validatePass = (rule, value, callback) => {
125
+ const isPassRequired = !this.dataId;
126
+ if (isPassRequired && (value == '' || value == undefined)) {
127
+ callback(new Error('密码不能为空'));
128
+ } else {
129
+ callback();
130
+ }
131
+ this.$refs.editForm.validateField('rePassword');
132
+ };
133
+ var validatePass2 = (rule, value, callback) => {
134
+ const isPassRequired = !this.dataId;
135
+ const rePassword = value != undefined ? value : '';
136
+ const password = this.user.password != undefined ? this.user.password : '';
137
+
138
+ if (isPassRequired && rePassword == '') {
139
+ callback(new Error('确认密码不能为空'));
140
+ } else if (rePassword != password) {
141
+ callback(new Error('两次输入密码不一致!'));
142
+ } else {
143
+ callback();
144
+ }
145
+ };
146
+
147
+ return {
148
+ dataId: '',
149
+ hBtn: true,
150
+ user: {
151
+ userCompanyInfoDTOs: [],
152
+ userSaleOrgDTOs: [],
153
+ userRoleDTOs: [],
154
+ gender: null,
155
+ enabled: true,
156
+ userType: null,
157
+ countryName: null,
158
+ countryCode: null,
159
+ flag:8
160
+ },
161
+ vxeOption: {},
162
+ companyInfoOption: {},
163
+ userRoleOption: {},
164
+ showRoleDialog: false,
165
+ showCompanyDialog: false,
166
+ showSaleOrgDialog: false,
167
+ showPositionDialog: false,
168
+ saleOrgPositionIndex: 0,
169
+ passRules: [{validator: validatePass, trigger: 'blur', required: false}],
170
+ pass2Rules: [{validator: validatePass2, trigger: 'blur', required: false}],
171
+ activeName: 'first',
172
+ userCustomerListDTO: {
173
+ userCustomerDTOs: []
174
+ },
175
+ customerOption: {},
176
+ showCustomerDialog: false,
177
+ exportOption: {
178
+ prefix: USER_PREFIX,
179
+ title: '用户',
180
+ codes: ["USEREXCEL", "USERPDF", "USERPRINT", "USERHIPRINT"],
181
+ param: () => {
182
+ return [{id: this.dataId}];
183
+ }
184
+ },
185
+ showExtendedProperties: false,
186
+ radio1: '0',
187
+ companyInfo: {},
188
+ vxeOptionMap: {},
189
+ gridRoleDataMap: {},
190
+ gridSaleOrgDataMap: {},
191
+ distributorCode: 'distributor',
192
+ distributorRole: null,
193
+ outUserCodes: [],
194
+ roleDialogParam: {queryAll: true},
195
+ tempStorageOption: {
196
+ storageType: "user",
197
+ data: () => {
198
+ return this.user;
199
+ },
200
+ chooseConfirm: (tempStorageData) => {
201
+ this.user = tempStorageData;
202
+ },
203
+ saveConfirm: () => {
204
+ }
205
+ },
206
+ showCountryDialog: false
207
+ };
208
+ },
209
+ computed: {
210
+ hasCurrentCompany() {
211
+ return this.user.userCompanyInfoDTOs.find(item => item.companyCode == this.companyInfo.companyCode) != null;
212
+ }
213
+ },
214
+ created() {
215
+ if (this._dataId && !isNaN(this._dataId)) this.dataId = this._dataId;
216
+ },
217
+ async mounted() {
218
+
219
+ // this.getEainsGroupDTO();
220
+ // await this.initOutUserRoleCode();
221
+ // await this.initDistributorRole();
222
+ this.getData();
223
+ this.getConpanyInfo()
224
+ },
225
+ methods: {
226
+ getData() {
227
+ if (this.dataId && !isNaN(this.dataId)) {
228
+ this.isEdit = true;
229
+ this.$commonHttp({
230
+ url: USER_PREFIX + `/user/get`,
231
+ method: `post`,
232
+ data: {
233
+ id: this.dataId
234
+ },
235
+ isLoading: true,
236
+ modalStrictly: true,
237
+ success: res => {
238
+ let user = res.objx || {};
239
+ user.userCompanyInfoDTOs = this.user.userCompanyInfoDTOs;
240
+ user.userSaleOrgDTOs = this.user.userSaleOrgDTOs;
241
+ user.userRoleDTOs = this.user.userRoleDTOs;
242
+ this.user = user;
243
+ this.user.password = '';
244
+
245
+ this.showExtendedProperties = true;
246
+ }
247
+ });
248
+ } else {
249
+ this.user.gender = 1;
250
+ this.isEdit = false;
251
+ this.showExtendedProperties = true;
252
+ }
253
+ },
254
+ saveData() {
255
+ let companyCode = this.companyInfo.companyCode;
256
+
257
+ this.$refs.editForm.$baseValidate(valid => {
258
+ if (valid) {
259
+ this.$baseConfirm('您确定要保存吗?').then(() => {
260
+ var url = USER_PREFIX + (this.isEdit ? '/user/update' : '/user/save');
261
+ this.$http({
262
+ url: url,
263
+ method: `post`,
264
+ data: this.user,
265
+ isLoading: true,
266
+ success: res => {
267
+ this.$message({
268
+ message: res.content,
269
+ type: 'success',
270
+ duration: 500,
271
+ onClose: t => {
272
+ if (this.isEdit) {
273
+ this.$baseReload();
274
+ } else {
275
+ this.$baseReload({
276
+ updateParam: {
277
+ _dataId: res.objx
278
+ }
279
+ });
280
+ }
281
+ }
282
+ });
283
+ }
284
+ });
285
+ });
286
+ }
287
+ });
288
+ },
289
+ getSaleOrgData() {
290
+ if (this.dataId) {
291
+ this.$http({
292
+ url: USER_PREFIX + '/user/getUserSaleOrg',
293
+ method: `post`,
294
+ data: {id: this.dataId},
295
+ isLoading: true,
296
+ modalStrictly: true,
297
+ success: res => {
298
+ // this.$refs.saleOrgGrid.loadData(res.objx || []);
299
+ let rows = res.objx || [];
300
+ if (rows.length) {
301
+ // this.gridSaleOrgDataMap = xeUtils.groupBy(rows, 'companyCode');
302
+ Object.assign(this.gridSaleOrgDataMap, xeUtils.groupBy(rows, 'companyCode'));
303
+ }
304
+ this.user.userSaleOrgDTOs = rows;
305
+ }
306
+ });
307
+ }
308
+ },
309
+ getUserRoleData() {
310
+ if (this.dataId) {
311
+ this.$http({
312
+ url: USER_PREFIX + '/user/getUserRole',
313
+ method: `post`,
314
+ data: {id: this.dataId},
315
+ isLoading: true,
316
+ modalStrictly: true,
317
+ success: res => {
318
+ let rows = res.objx || [];
319
+ if (rows.length) {
320
+ // this.gridRoleDataMap = xeUtils.groupBy(rows, 'companyCode');
321
+ Object.assign(this.gridRoleDataMap, xeUtils.groupBy(rows, 'companyCode'));
322
+ }
323
+ this.user.userRoleDTOs = rows;
324
+ }
325
+ });
326
+ }
327
+ },
328
+ deleteSaleOrgItem(row, index, $table) {
329
+ $table.remove(row);
330
+ this.gridSaleOrgDataMap[row.companyCode].splice(index, 1);
331
+ },
332
+ getCompanyInfoData(callback) {
333
+ if (this.dataId) {
334
+ this.$http({
335
+ url: USER_PREFIX + '/user/getUserCompanyInfo',
336
+ method: `post`,
337
+ data: {id: this.dataId},
338
+ isLoading: true,
339
+ modalStrictly: true,
340
+ success: res => {
341
+ let rows = res.objx || [];
342
+ rows.forEach(row => {
343
+ this.gridRoleDataMap[row.companyCode] = [];
344
+ this.gridSaleOrgDataMap[row.companyCode] = [];
345
+ })
346
+ this.user.userCompanyInfoDTOs = rows;
347
+ callback && callback();
348
+ }
349
+ });
350
+ }
351
+ },
352
+
353
+ confirmInsertCompany(rows, callback) {
354
+ if (rows.length > 0) {
355
+ const tableData = this.user.userCompanyInfoDTOs;
356
+ const map = {};
357
+ tableData.forEach(function (item) {
358
+ map[item.companyCode] = 1;
359
+ });
360
+ var items = [];
361
+ rows.forEach(row => {
362
+ const item = {companyCode: row.companyCode, companyName: row.companyName, guid: null};
363
+ if (!map[item.companyCode]) {
364
+ items.push(item);
365
+ }
366
+ this.gridRoleDataMap[item.companyCode] = []
367
+ this.gridSaleOrgDataMap[item.companyCode] = []
368
+ });
369
+ // $grid.insertAt(items, -1);
370
+ this.user.userCompanyInfoDTOs.splice(0, 0, ...items);
371
+ // this.user.userCompanyInfoDTOs = this.user.userCompanyInfoDTOs.concat(items);
372
+ }
373
+ callback && callback();
374
+ },
375
+ deleteCompany(row, index) {
376
+ let companyCode = row.companyCode;
377
+ this.user.userCompanyInfoDTOs.splice(index, 1);
378
+ this.gridSaleOrgDataMap[row.companyCode] = [];
379
+ this.gridRoleDataMap[row.companyCode] = [];
380
+ this.user.userSaleOrgDTOs = this.user.userSaleOrgDTOs.filter(item => item.companyCode != companyCode);
381
+ this.user.userRoleDTOs = this.user.userRoleDTOs.filter(item => item.companyCode != companyCode);
382
+ },
383
+ getConpanyInfo() {
384
+ this.$http({
385
+ url: USER_PREFIX + '/company_info/getCurrent',
386
+ method: `post`,
387
+ isLoading: true,
388
+ success: res => {
389
+ this.companyInfo = res.objx || {};
390
+ let companyCode = this.companyInfo.companyCode;
391
+ if (!this.isEdit) {
392
+ this.addCurrentCompany();
393
+ } else {
394
+ this.getCompanyInfoData(() => {
395
+
396
+ });
397
+ }
398
+ }
399
+ });
400
+ },
401
+ isCurrentCompany(companyCode) {
402
+ return this.companyInfo.companyCode == companyCode;
403
+ },
404
+ addCurrentCompany(callback) {
405
+ this.confirmInsertCompany([this.companyInfo], callback);
406
+ },
407
+
408
+ initDistributorRole() {
409
+ if (this.outUserCodes && this.outUserCodes.length == 1) {
410
+ return this.$http({
411
+ url: USER_PREFIX + '/role/list',
412
+ method: 'post',
413
+ success: res => {
414
+ let roleList = res.objx || [];
415
+ let distributorCode = this.outUserCodes[0];
416
+ this.distributorRole = roleList.find(item => item.code == distributorCode);
417
+ }
418
+ });
419
+ }
420
+ },
421
+ async initOutUserRoleCode() {
422
+ //初始化外部用户编码
423
+ return this.$http({
424
+ url: USER_PREFIX + '/system_parameter/getByCode',
425
+ method: 'post',
426
+ data: {"code": "outUserRoleCode"},
427
+ success: res => {
428
+ let value = (!res.objx || !res.objx.value) ? "distributor" : res.objx.value;
429
+ let codes = value.split(',');
430
+ this.outUserCodes = codes;//外部用户编码
431
+ this.initRoleDialogParam();//初始化角色弹框的查询参数
432
+ }
433
+ });
434
+ },
435
+ initRoleDialogParam() {
436
+ //初始化角色弹框的查询参数
437
+ if (this.userType == 1) {
438
+ //企业用户
439
+ this.roleDialogParam = {
440
+ queryAll: true,
441
+ neCodes: [...this.outUserCodes]
442
+ };
443
+ } else if (this.userType == 2) {
444
+ //外部用户
445
+ this.roleDialogParam = {
446
+ queryAll: true,
447
+ eqCodes: [...this.outUserCodes]
448
+ };
449
+ }
450
+ },
451
+ unlock() {
452
+ this.$baseConfirm('您确定要解锁吗?').then(() => {
453
+ var url = USER_PREFIX + '/user/unlockLoginAccount';
454
+ this.$http({
455
+ url: url,
456
+ method: `post`,
457
+ data: {
458
+ id: this.user.id
459
+ },
460
+ isLoading: true,
461
+ success: res => {
462
+ this.$message({
463
+ message: res.content,
464
+ type: 'success',
465
+ duration: 500,
466
+ onClose: t => {
467
+ this.$baseReload();
468
+ }
469
+ });
470
+ }
471
+ });
472
+ });
473
+ },
474
+ confirmCountry(rows) {
475
+ if (rows.length) {
476
+ let row = rows[0];
477
+ this.user.countryName = row.countryName;
478
+ this.user.countryCode = row.countryCode;
479
+ }
480
+ }
481
+ }
482
+ };
483
+ </script>