cloud-web-corejs 1.0.54-dev.192 → 1.0.54-dev.194

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.54-dev.192",
4
+ "version": "1.0.54-dev.194",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -243,6 +243,33 @@ modules = {
243
243
  } else {
244
244
  if (!dataId) {
245
245
  //新增
246
+ // targetType: "vabsearch",
247
+ if (this.field.type == "vabsearch" && !this.field.options.multipleChoices) {
248
+ let searchDialogConfig = this.field.options.searchDialogConfig || {};
249
+ if (this.field.options.userDefaultVabSearch) {
250
+ let userInfo = this.getFormRef().getUserInfo();
251
+ let valueSourceField = "id";
252
+ let labelSourceField = "nick_name";
253
+ if (this.field.options.clickBindEvent == "1") {
254
+ if (searchDialogConfig.valueSourceField) valueSourceField = searchDialogConfig.valueSourceField
255
+ if (searchDialogConfig.labelSourceField) labelSourceField = searchDialogConfig.labelSourceField
256
+ }
257
+ this.setValue(userInfo[valueSourceField] ?? null);
258
+ this.setShowValue(userInfo[labelSourceField] ?? null);
259
+ } else if (this.field.options.saleOrgDefaultVabSearch) {
260
+ let saleOrgDTO = this.getFormRef().getDefaultSaleOrgDTO();
261
+ if (saleOrgDTO) {
262
+ let valueSourceField = "id";
263
+ let labelSourceField = "name";
264
+ if (this.field.options.clickBindEvent == "1") {
265
+ if (searchDialogConfig.valueSourceField) valueSourceField = searchDialogConfig.valueSourceField
266
+ if (searchDialogConfig.labelSourceField) labelSourceField = searchDialogConfig.labelSourceField
267
+ }
268
+ this.setValue(saleOrgDTO[valueSourceField] ?? null);
269
+ this.setShowValue(saleOrgDTO[valueSourceField] ?? null);
270
+ }
271
+ }
272
+ }
246
273
  if (!this.tableParam) {
247
274
  //主表
248
275
  if (this.isNotNullVal(defaultValue)) {
@@ -910,7 +937,7 @@ modules = {
910
937
 
911
938
  // dialogQueryParam.
912
939
  let queryParam = null;
913
- if(searchDialogConfig.dialogQueryParam){
940
+ if (searchDialogConfig.dialogQueryParam) {
914
941
  queryParam = this.handleCustomEvent(searchDialogConfig.dialogQueryParam)
915
942
  }
916
943
  this.getFormRef().openSearchDialog({
@@ -12,6 +12,7 @@
12
12
  :default-first-option="allowDefaultFirstOption"
13
13
  :automatic-dropdown="field.options.automaticDropdown"
14
14
  :multiple="field.options.multiple" :multiple-limit="field.options.multipleLimit"
15
+ :collapse-tags="!!field.options.multiple"
15
16
  :placeholder="getI18nLabel(field.options.placeholder || '请选择')"
16
17
  :remote="field.options.remote" :remote-method="remoteQuery"
17
18
  @focus="handleFocusCustomEvent" @blur="handleBlurCustomEvent"
@@ -501,7 +501,7 @@ import i18n from "../../../../../../components/xform/utils/i18n";
501
501
  import Sortable from "sortablejs";
502
502
  import {generateId} from "../../../../../../components/xform/utils/util";
503
503
  import columnRenderDialog from "./columnRenderDialog.vue"
504
- import {businessFields} from "@/components/xform/form-designer/widget-panel/widgetsConfig";
504
+ import {businessFields} from "@base/components/xform/form-designer/widget-panel/widgetsConfig";
505
505
 
506
506
  let businessOptions = [
507
507
  {
@@ -9,6 +9,16 @@
9
9
  <el-form-item label="展示字段">
10
10
  <el-input type="text" v-model="optionModel.vabSearchName"></el-input>
11
11
  </el-form-item>
12
+ <template v-if="!optionModel.multipleChoices">
13
+ <el-form-item label="默认用户">
14
+ <el-switch v-model="optionModel.userDefaultVabSearch"
15
+ @change="optionModel.saleOrgDefaultVabSearch=false"></el-switch>
16
+ </el-form-item>
17
+ <el-form-item label="默认机构">
18
+ <el-switch v-model="optionModel.saleOrgDefaultVabSearch"
19
+ @change="optionModel.userDefaultVabSearch=false"></el-switch>
20
+ </el-form-item>
21
+ </template>
12
22
  </div>
13
23
  </template>
14
24
 
@@ -2579,6 +2579,8 @@ export const advancedFields = [
2579
2579
  keyNameEnabled: !1,
2580
2580
  keyName: "",
2581
2581
  vabSearchName: "",
2582
+ userDefaultVabSearch:false,
2583
+ saleOrgDefaultVabSearch:false,
2582
2584
  label: "",
2583
2585
  submitFlag: true,
2584
2586
  disabled: !1,
@@ -3313,6 +3315,155 @@ export const businessFields = [
3313
3315
  ...defaultTextFlagConfig
3314
3316
  }
3315
3317
  },
3318
+
3319
+ {
3320
+ type: "user-vabsearch",
3321
+ targetType: "vabsearch",
3322
+ icon: "searchbox",
3323
+ commonFlag: !0,
3324
+ columnFlag: true,
3325
+ formItemFlag: !0,
3326
+ tableField: null,
3327
+ options: {
3328
+ name: "",
3329
+ keyNameEnabled: !1,
3330
+ keyName: "",
3331
+ vabSearchName: "nick_name",
3332
+ userDefaultVabSearch:false,
3333
+ saleOrgDefaultVabSearch:false,
3334
+ label: "用户",
3335
+ submitFlag: true,
3336
+ disabled: !1,
3337
+ hidden: !1,
3338
+ required: !1,
3339
+ labelWidth: null,
3340
+ labelHidden: !1,
3341
+ readonly: true,
3342
+ onSearchClear: "",
3343
+ dialogModel: '1',
3344
+ systemDialogUrl: null,
3345
+ accessType: "1",
3346
+ onCreated: "",
3347
+ onMounted: "",
3348
+ onChange: "",
3349
+ onAppendButtonClick: "",
3350
+ clickBindEvent: '1',
3351
+ searchDialogConfig: {
3352
+ ...defaultSearchDialogConfig,
3353
+ multipleChoices: false,
3354
+ formCode: "user_dialog",
3355
+ valueSourceField: "id",
3356
+ labelSourceField: "nick_name",
3357
+ },
3358
+ ...defaultWfConfig,
3359
+ valueField: null,
3360
+ multipleChoices: false,
3361
+
3362
+ showRuleFlag: 1,
3363
+ showRuleEnabled: 1,
3364
+ showRules: []
3365
+
3366
+ }
3367
+ },
3368
+ {
3369
+ type: "saleOrg-vabsearch",
3370
+ targetType: "vabsearch",
3371
+ icon: "searchbox",
3372
+ commonFlag: !0,
3373
+ columnFlag: true,
3374
+ formItemFlag: !0,
3375
+ tableField: null,
3376
+ options: {
3377
+ name: "",
3378
+ keyNameEnabled: !1,
3379
+ keyName: "",
3380
+ vabSearchName: "sale_org_name",
3381
+ userDefaultVabSearch:false,
3382
+ saleOrgDefaultVabSearch:false,
3383
+ label: "机构",
3384
+ submitFlag: true,
3385
+ disabled: !1,
3386
+ hidden: !1,
3387
+ required: !1,
3388
+ labelWidth: null,
3389
+ labelHidden: !1,
3390
+ readonly: true,
3391
+ onSearchClear: "",
3392
+ dialogModel: '1',
3393
+ systemDialogUrl: null,
3394
+ accessType: "1",
3395
+ onCreated: "",
3396
+ onMounted: "",
3397
+ onChange: "",
3398
+ onAppendButtonClick: "",
3399
+ clickBindEvent: '1',
3400
+ searchDialogConfig: {
3401
+ ...defaultSearchDialogConfig,
3402
+ multipleChoices: false,
3403
+ formCode: "sale_org_dialog",
3404
+ valueSourceField: "id",
3405
+ labelSourceField: "name"
3406
+ },
3407
+ ...defaultWfConfig,
3408
+ valueField: null,
3409
+ multipleChoices: false,
3410
+
3411
+ showRuleFlag: 1,
3412
+ showRuleEnabled: 1,
3413
+ showRules: []
3414
+
3415
+ }
3416
+ },
3417
+ {
3418
+ type: "role-vabsearch",
3419
+ targetType: "vabsearch",
3420
+ icon: "searchbox",
3421
+ commonFlag: !0,
3422
+ columnFlag: true,
3423
+ formItemFlag: !0,
3424
+ tableField: null,
3425
+ options: {
3426
+ name: "",
3427
+ keyNameEnabled: !1,
3428
+ keyName: "",
3429
+ vabSearchName: "role_name",
3430
+ userDefaultVabSearch:false,
3431
+ saleOrgDefaultVabSearch:false,
3432
+ label: "角色",
3433
+ submitFlag: true,
3434
+ disabled: !1,
3435
+ hidden: !1,
3436
+ required: !1,
3437
+ labelWidth: null,
3438
+ labelHidden: !1,
3439
+ readonly: true,
3440
+ onSearchClear: "",
3441
+ dialogModel: '1',
3442
+ systemDialogUrl: null,
3443
+ accessType: "1",
3444
+ onCreated: "",
3445
+ onMounted: "",
3446
+ onChange: "",
3447
+ onAppendButtonClick: "",
3448
+ clickBindEvent: '1',
3449
+ searchDialogConfig: {
3450
+ ...defaultSearchDialogConfig,
3451
+ multipleChoices: false,
3452
+ formCode: "role_dialog",
3453
+ valueSourceField: "id",
3454
+ labelSourceField: "name"
3455
+ },
3456
+ ...defaultWfConfig,
3457
+ valueField: null,
3458
+ multipleChoices: false,
3459
+
3460
+ showRuleFlag: 1,
3461
+ showRuleEnabled: 1,
3462
+ showRules: []
3463
+
3464
+ }
3465
+ },
3466
+
3316
3467
  ]
3317
3468
 
3318
3469
  export const keyNamePrefixMap = {
@@ -175,8 +175,13 @@ modules = {
175
175
  importDialogOption: {},
176
176
  formDrawerOption: {},
177
177
  showFormDrawer: false,
178
+ userInfo: null,
178
179
  userSaleOrgDTOs: [],
179
180
  userRoleDTOs: [],
181
+
182
+ userSaleOrgDTO2s: [],
183
+ userRoleDTO2s: [],
184
+ defaultUserSaleOrgDTO: null,
180
185
  bdService: null,
181
186
  globalParam: {}
182
187
  };
@@ -225,9 +230,10 @@ modules = {
225
230
  this.registerFormToRefList()
226
231
  this.currentFormData = this.formData;
227
232
  let formConfig = this.formConfig;
228
- await this.getSaleOrgData();
229
- await this.getUserRoleData();
230
- await this.getBdService();
233
+ await this.initUserInfo();
234
+ await this.initSaleOrgData();
235
+ await this.initUserRoleData();
236
+ await this.initBdService();
231
237
  this.buildFormModel(!this.formJsonObj ? null : this.formJsonObj.widgetList);
232
238
  this.hanldeCommonWidget();//处理组件显隐规则
233
239
  if (formConfig.isLoadEntity) {
@@ -246,7 +252,64 @@ modules = {
246
252
  this.handleOnMounted();
247
253
  },
248
254
  methods: {
249
- getSaleOrgData() {
255
+ /**
256
+ * 数据对象key 驼峰下划线相互转化
257
+ * @param {Object} data - 原始对象 支持-数组、key-value对象、字符串
258
+ * @param {String} type hump-转驼峰 toLine-转下划线
259
+ */
260
+ formatHumpLineTransfer (data, type = 'hump') {
261
+ let hump = ''
262
+ // 转换对象中的每一个键值为驼峰的递归
263
+ let formatTransferKey = (data) => {
264
+ if (data instanceof Array) {
265
+ data.forEach(item => formatTransferKey(item))
266
+ } else if (data instanceof Object) {
267
+ for (let key in data) {
268
+ hump = type === 'hump' ? this.formatToHump(key) : this.formatToLine(key)
269
+ data[hump] = data[key]
270
+ if (key !== hump) {
271
+ delete data[key]
272
+ }
273
+ if (data[hump] instanceof Object) {
274
+ formatTransferKey(data[hump])
275
+ }
276
+ }
277
+ } else if (typeof data === 'string') {
278
+ data = type === 'hump' ? this.formatToHump(data) : this.formatToLine(data)
279
+ }
280
+ }
281
+ formatTransferKey(data)
282
+ return data
283
+ },
284
+
285
+ /**
286
+ * 字符串下划线转驼峰
287
+ * @param {String} value 需要转换的值
288
+ */
289
+ formatToHump(value) {
290
+ return value.replace(/\_(\w)/g, (_, letter) => letter.toUpperCase())
291
+ },
292
+
293
+ /**
294
+ * 字符串驼峰转下划线
295
+ * @param {String} value
296
+ */
297
+ formatToLine(value) {
298
+ return value.replace(/([A-Z])/g,"_$1").toLowerCase()
299
+ },
300
+
301
+ initUserInfo() {
302
+ return this.$http({
303
+ url: USER_PREFIX + '/user/currentUser',
304
+ method: 'post',
305
+ success: res => {
306
+ let userInfo = res.objx;
307
+ let row = this.formatHumpLineTransfer(userInfo,"toLine")
308
+ this.userInfo = row;
309
+ }
310
+ });
311
+ },
312
+ initSaleOrgData() {
250
313
  if (this.$store.getters.userId) {
251
314
  return this.$http({
252
315
  url: USER_PREFIX + '/user/getUserSaleOrg',
@@ -258,11 +321,16 @@ modules = {
258
321
  success: res => {
259
322
  let rows = res.objx || [];
260
323
  this.userSaleOrgDTOs = rows;
324
+
325
+ let companyCode = this.$store.getters.companyCode;
326
+ let row2s = rows.filter(row => row.companyCode === companyCode)
327
+ this.userSaleOrgDTO2s = row2s;
328
+ this.defaultUserSaleOrgDTO = row2s.find(item => item.defaults)
261
329
  }
262
330
  });
263
331
  }
264
332
  },
265
- getUserRoleData() {
333
+ initUserRoleData() {
266
334
  if (this.$store.getters.userId) {
267
335
  return this.$http({
268
336
  url: USER_PREFIX + '/user/getUserRole',
@@ -274,11 +342,14 @@ modules = {
274
342
  success: res => {
275
343
  let rows = res.objx || [];
276
344
  this.userRoleDTOs = rows;
345
+
346
+ let companyCode = this.$store.getters.companyCode;
347
+ this.userRoleDTO2s = rows.filter(row => row.companyCode === companyCode)
277
348
  }
278
349
  });
279
350
  }
280
351
  },
281
- getBdService() {
352
+ initBdService() {
282
353
  return this.$http({
283
354
  url: USER_PREFIX + '/form_develop/getBdService',
284
355
  method: `post`,
@@ -291,6 +362,50 @@ modules = {
291
362
  }
292
363
  });
293
364
  },
365
+ getUserInfo() {
366
+ return this.userInfo;
367
+ },
368
+ getUserSaleOrgDTOs() {
369
+ return this.userSaleOrgDTO2s;
370
+ },
371
+ getUserRoleDTOs() {
372
+ return this.userRoleDTO2s;
373
+ },
374
+ getDefaultUserSaleOrgDTO() {
375
+ return this.defaultUserSaleOrgDTO;
376
+ },
377
+ getSaleOrgDTOs() {
378
+ return this.userSaleOrgDTO2s.map(item => {
379
+ return {
380
+ id: item.saleOrgId,
381
+ sn: item.sn,
382
+ name: item.saleOrgName,
383
+ companyCode: item.companyCode,
384
+ companyName: item.companyName
385
+ }
386
+ });
387
+ },
388
+ getRoleDTOs() {
389
+ return this.userRoleDTO2s.map(item => {
390
+ return {
391
+ id: item.roleId,
392
+ code: item.roleCode,
393
+ name: item.roleName,
394
+ companyCode: item.companyCode,
395
+ companyName: item.companyName
396
+ }
397
+ });
398
+ },
399
+ getDefaultSaleOrgDTO() {
400
+ let item = this.defaultUserSaleOrgDTO;
401
+ return item ? {
402
+ id: item.saleOrgId,
403
+ sn: item.sn,
404
+ name: item.saleOrgName,
405
+ companyCode: item.companyCode,
406
+ companyName: item.companyName
407
+ } : null;
408
+ },
294
409
  handleShowContent(callback) {
295
410
  // this.buildFormModel(!this.formJsonObj ? null : this.formJsonObj.widgetList);
296
411
  this.showFormContent = true;
@@ -100,11 +100,13 @@ export default {
100
100
  'project-tag': '标签',
101
101
  'dropdown-menu': '下拉菜单',
102
102
 
103
-
104
103
  "create_by-text": "创建人",
105
104
  "modify_by-text": "更新人",
106
105
  "create_date-text": "创建时间",
107
106
  "modfiy_date-text": "更新时间",
107
+ "user-vabsearch": "用户搜索框",
108
+ "saleOrg-vabsearch": "机构搜索框",
109
+ "role-vabsearch": "角色搜索框",
108
110
  },
109
111
  hint: {
110
112
  formulaSetting: "公式设置",
@@ -595,7 +597,7 @@ export default {
595
597
  enterForQuery: "输入关键字进行过滤",
596
598
  add: "添加",
597
599
  delete: "删除",
598
- censusClass:'统计样式'
600
+ censusClass: '统计样式'
599
601
  }
600
602
  }
601
603
  }