three-trees-ui 1.0.14 → 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.
@@ -32,6 +32,7 @@
32
32
  class="search-item"
33
33
  >
34
34
  <p>{{ condition.comment }}:</p>
35
+ <!-- 单行文本输入框 -->
35
36
  <div v-if="condition.controllerType == '1'">
36
37
  <el-input
37
38
  v-model="queryParams[index][condition.field]"
@@ -42,10 +43,8 @@
42
43
  @keyup.enter.native="hideSearch"
43
44
  ></el-input>
44
45
  </div>
45
- <div
46
- v-if="condition.controllerType == '2'"
47
- style="margin-right: 10px"
48
- >
46
+ <!-- 单选框 -->
47
+ <div v-if="condition.controllerType == '2'">
49
48
  <el-radio
50
49
  v-for="(itemR, $index1) in condition.config.options"
51
50
  :key="$index1"
@@ -55,45 +54,139 @@
55
54
  {{ itemR.value }}
56
55
  </el-radio>
57
56
  </div>
58
- <div
59
- v-if="condition.controllerType == '3'"
60
- style="margin-right: 10px"
61
- >
57
+ <!-- 下拉框 -->
58
+ <div v-if="condition.controllerType == '3'">
59
+ <!-- 静态选项 -->
62
60
  <ht-select
63
61
  v-if="condition.config.choiceType == 'static'"
64
62
  v-model="queryParams[index][condition.field]"
63
+ :multiple="condition.config.multiple"
65
64
  :options="condition.config.options"
65
+ popper-class="dialog-select"
66
66
  ></ht-select>
67
- <eip-select-dia
67
+ <!-- 动态选项时展示数据字典 -->
68
+ <ht-dictionary
68
69
  v-else
69
- v-model="queryParams[condition.field]"
70
- :ganged="{
71
- alias: condition.config.customQuery.alias,
72
- valueBind: condition.config.customQuery.valueBind,
73
- noInit: '',
74
- labelBind: condition.config.customQuery.labelBind,
75
- gangedBind: '{}',
76
- bind: condition.config.bind,
77
- }"
78
- :multiple="false"
79
- :filterable="false"
80
- :allow-create="false"
81
- :selectlist="[]"
82
- :query-params="queryParams"
83
- ></eip-select-dia>
70
+ v-model="queryParams[index][condition.field]"
71
+ :dickey="condition.config.dic"
72
+ :filterable="condition.config.filterable"
73
+ popper-class="dialog-select"
74
+ ></ht-dictionary>
84
75
  </div>
85
- <div
86
- v-if="condition.controllerType == '4'"
87
- style="margin-right: 10px"
88
- >
76
+ <!-- 标签 -->
77
+ <div v-if="condition.controllerType == '4'">
89
78
  <eip-tag
90
79
  v-model="queryParams[index][condition.field]"
91
80
  :tag-key="condition.config.tag"
92
- :placeholder="quickSearch"
93
81
  :filterable="condition.config.filterable"
94
82
  :expand="condition.config.expand"
95
83
  ></eip-tag>
96
84
  </div>
85
+ <!-- 日期 -->
86
+ <div v-if="condition.controllerType == '6'">
87
+ <!-- 根据日期的条件类型来判断展示单个日期还是日期范围 -->
88
+ <div
89
+ v-if="condition.condition == 'BETWEEN'"
90
+ style="display: flex;align-items: center;"
91
+ >
92
+ <ht-input
93
+ v-model="queryParams[index].startDate"
94
+ placeholder="开始日期"
95
+ @click.native="showDate(index, 'startDate')"
96
+ readonly
97
+ ></ht-input>
98
+ <span style="margin:0 10px;">至</span>
99
+ <ht-input
100
+ v-model="queryParams[index].endDate"
101
+ placeholder="结束日期"
102
+ @click.native="showDate(index, 'endDate')"
103
+ readonly
104
+ ></ht-input>
105
+ </div>
106
+ <ht-input
107
+ v-else
108
+ v-model="queryParams[index][condition.field]"
109
+ @click.native="showDate(index, condition.field)"
110
+ readonly
111
+ ></ht-input>
112
+ </div>
113
+ <!-- 选择器 -->
114
+ <div v-if="condition.controllerType == '7'">
115
+ <ht-user-selector-input
116
+ v-if="condition.config.alias == 'user'"
117
+ append-to-body
118
+ @change="
119
+ (data) => {
120
+ queryParams[index][condition.field] = getSelectId(data)
121
+ }
122
+ "
123
+ ></ht-user-selector-input>
124
+ <ht-org-selector-input
125
+ v-if="condition.config.alias == 'org'"
126
+ append-to-body
127
+ @change="
128
+ (data) => {
129
+ queryParams[index][condition.field] = getSelectId(data)
130
+ }
131
+ "
132
+ ></ht-org-selector-input>
133
+ <ht-role-selector-input
134
+ v-if="condition.config.alias == 'role'"
135
+ append-to-body
136
+ @change="
137
+ (data) => {
138
+ queryParams[index][condition.field] = getSelectId(data)
139
+ }
140
+ "
141
+ ></ht-role-selector-input>
142
+ <ht-job-selector-input
143
+ v-if="condition.config.alias == 'job'"
144
+ append-to-body
145
+ @change="
146
+ (data) => {
147
+ queryParams[index][condition.field] = getSelectId(data)
148
+ }
149
+ "
150
+ ></ht-job-selector-input>
151
+ <ht-post-selector-input
152
+ v-if="condition.config.alias == 'post'"
153
+ append-to-body
154
+ @change="
155
+ (data) => {
156
+ queryParams[index][condition.field] = getSelectId(data)
157
+ }
158
+ "
159
+ ></ht-post-selector-input>
160
+ <ht-dimension-selector-input
161
+ v-if="condition.config.alias == 'dimension'"
162
+ append-to-body
163
+ @change="
164
+ (data) => {
165
+ queryParams[index][condition.field] = getSelectId(data)
166
+ }
167
+ "
168
+ ></ht-dimension-selector-input>
169
+ </div>
170
+ <!-- 对话框 -->
171
+ <div v-if="condition.controllerType == '5'">
172
+ <ht-custom-dialog
173
+ v-model="queryParams[index][condition.field]"
174
+ :model-name="condition.config.keyBind"
175
+ dialogType="search"
176
+ :custdialog="{
177
+ name: '请选择',
178
+ icon: '',
179
+ custDialog: {
180
+ selectNum: 1,
181
+ conditions: [],
182
+ mappingConf: [],
183
+ custQueryJson: [],
184
+ alias: condition.config.alias,
185
+ type: 'custDialog',
186
+ },
187
+ }"
188
+ ></ht-custom-dialog>
189
+ </div>
97
190
  </div>
98
191
  <div v-show="isShowMoreSearch" class="search-btns">
99
192
  <el-button
@@ -171,7 +264,7 @@
171
264
  </template>
172
265
  <div class="custom-mobile_box">
173
266
  <div
174
- v-for="field in displayfield"
267
+ v-for="field in sortDisplayfield"
175
268
  :key="field.field"
176
269
  class="custom-mobile_box_item"
177
270
  >
@@ -254,6 +347,23 @@
254
347
  @check-change="getChecked"
255
348
  ></el-tree>
256
349
  </van-action-sheet>
350
+ <!-- 修改时间 -->
351
+ <van-popup
352
+ v-model="isShowDatePop"
353
+ v-if="isShowDatePop"
354
+ position="bottom"
355
+ round
356
+ >
357
+ <!-- 日期选择控件 -->
358
+ <van-datetime-picker
359
+ v-model="currentDate"
360
+ :type="dateType"
361
+ title="选择日期"
362
+ :show-toolbar="true"
363
+ @cancel="isShowDatePop = false"
364
+ @confirm="confirmFn"
365
+ />
366
+ </van-popup>
257
367
  </div>
258
368
  </template>
259
369
  <script>
@@ -278,9 +388,14 @@
278
388
  sunIndex: Number,
279
389
  subPath: String,
280
390
  currentSubData: Array,
391
+ dialogConfig: Object,
392
+ dialogType: String,
281
393
  },
282
394
  data() {
283
395
  return {
396
+ dateType: 'date',
397
+ currentDate: '', // 当前日期
398
+ isShowDatePop: false, // 是否显示日期选择控件
284
399
  isShowMoreSearch: false,
285
400
  treeSelectText: '', // 组合树时选中的查询条件
286
401
  isSelectTreeShow: false, // 组合树显示隐藏
@@ -349,8 +464,58 @@
349
464
  this.selectIds.length > 0 ? `(${this.selectIds.length})` : ''
350
465
  return `${this.$t('ht.common.confirm')}${selectedText}`
351
466
  },
467
+ jumpParamKey() {
468
+ return this.dialogConfig && this.dialogConfig.jumpParamKey
469
+ ? this.dialogConfig.jumpParamKey
470
+ : ''
471
+ },
472
+ // 是否保存成跳转url参数
473
+ isHaveJumpUrl() {
474
+ return (
475
+ this.dialogConfig &&
476
+ ((this.isMobile && this.dialogConfig.mobileUrl) ||
477
+ (!this.isMobile && this.dialogConfig.pcUrl))
478
+ )
479
+ },
480
+ sortDisplayfield() {
481
+ return this.displayfield.sort((a, b) => {
482
+ return a.sort > b.sort ? 1 : -1
483
+ })
484
+ },
352
485
  },
353
486
  methods: {
487
+ // 获取已选择的选择器数据id
488
+ getSelectId(data) {
489
+ if (!data || !data.length) {
490
+ return ''
491
+ }
492
+ let ids = []
493
+ data.forEach((item) => {
494
+ ids.push(item.id)
495
+ })
496
+ return ids.join(',')
497
+ },
498
+ showDate(index, key) {
499
+ this.dateType = this.conditionBind[index].config.inputFormat.includes(
500
+ 'mm:'
501
+ )
502
+ ? 'datetime'
503
+ : 'date'
504
+ this.currentDateData = { index, key }
505
+ this.currentDate = this.queryParams[index][key]
506
+ ? new Date(this.queryParams[index][key].replace(/-/g, '/'))
507
+ : new Date()
508
+ this.isShowDatePop = true
509
+ },
510
+ // 日期确认
511
+ confirmFn() {
512
+ let currentConfig = this.conditionBind[this.currentDateData.index]
513
+ this.queryParams[this.currentDateData.index][
514
+ this.currentDateData.key
515
+ ] = this.currentDate.format(currentConfig.config.inputFormat)
516
+
517
+ this.isShowDatePop = false
518
+ },
354
519
  searchInputChange() {
355
520
  if (!this.isShowMoreSearch) {
356
521
  this.search(true)
@@ -396,122 +561,124 @@
396
561
  this.search(true)
397
562
  },
398
563
  showDialog() {
399
- const this_ = this
400
564
  this.fixedParams = {}
565
+ // 如果已存在配置信息就不去请求配置信息 直接初始化数据
566
+ if (this.dialogConfig) {
567
+ this.initDialog(this.dialogConfig)
568
+ return
569
+ }
401
570
  var alias = this.custdialog.custDialog.alias
402
571
  this.$requestConfig
403
572
  .getCustomDialogByAlias(alias)
404
573
  .then((customDialog) => {
405
- if (!customDialog || !customDialog.alias) {
406
- this.$message.error('对话框别名【' + alias + '】不存在!')
407
- return
408
- }
409
- if (customDialog.style == 1) {
410
- var displaylist = JSON.parse(customDialog.displayfield)
411
- this_.nodeKey = displaylist.id
574
+ this.initDialog(customDialog)
575
+ })
576
+ },
577
+ initDialog(customDialog) {
578
+ let alias = this.custdialog.custDialog.alias
579
+ const this_ = this
580
+ if (!customDialog || !customDialog.alias) {
581
+ this.$message.error('对话框别名【' + alias + '】不存在!')
582
+ return
583
+ }
584
+ if (customDialog.style == 1) {
585
+ var displaylist = JSON.parse(customDialog.displayfield)
586
+ this_.nodeKey = displaylist.id
587
+ }
588
+ if (customDialog.needPage && customDialog.requestType === 'POST') {
589
+ let obj = {}
590
+ this.getLastKeyByPath(obj, customDialog.pageKey, 1)
591
+ this.getLastKeyByPath(obj, customDialog.pageSizeKey, 10)
592
+ this.getLastKeyByPath(obj, customDialog.totalKey, true)
593
+ const exp = utils.parseExp(customDialog.dataParam, obj, true)
594
+ if (exp) {
595
+ const params = JSON.parse(exp)
596
+ if (params.pageBean) {
597
+ this.pagination = {
598
+ ...params.pageBean,
599
+ }
412
600
  }
413
- if (customDialog.needPage && customDialog.requestType === 'POST') {
601
+ }
602
+ }
603
+ //对话框按表单字段查询(参数传入的)
604
+ let bindList = this_.custdialog.custDialog.conditions
605
+ this_.param = [] //绑定的表单字段
606
+ if (bindList.length > 0) {
607
+ bindList.forEach((ele) => {
608
+ //绑定表单字段
609
+ if (
610
+ ele.bind &&
611
+ (ele.defaultType == '3' || ele.bind.startsWith('data.searchForm'))
612
+ ) {
414
613
  let obj = {}
415
- this.getLastKeyByPath(obj, customDialog.pageKey, 1)
416
- this.getLastKeyByPath(obj, customDialog.pageSizeKey, 10)
417
- this.getLastKeyByPath(obj, customDialog.totalKey, true)
418
- const exp = utils.parseExp(customDialog.dataParam, obj, true)
419
- if (exp) {
420
- const params = JSON.parse(exp)
421
- if (params.pageBean) {
422
- this.pagination = {
423
- ...params.pageBean,
424
- }
425
- }
426
- }
614
+ obj.field = ele.field
615
+ obj.bind = ele.bind
616
+ obj.bindType = ele.bindType
617
+ this_.param.push(obj)
427
618
  }
428
- //对话框按表单字段查询(参数传入的)
429
- let bindList = this_.custdialog.custDialog.conditions
430
- this_.param = [] //绑定的表单字段
431
- if (bindList.length > 0) {
432
- bindList.forEach((ele) => {
433
- //绑定表单字段
434
- if (
435
- ele.bind &&
436
- (ele.defaultType == '3' ||
437
- ele.bind.startsWith('data.searchForm'))
438
- ) {
439
- let obj = {}
440
- obj.field = ele.field
441
- obj.bind = ele.bind
442
- obj.bindType = ele.bindType
443
- this_.param.push(obj)
444
- }
445
- // bindType 1 表单字段 2固定 3脚本
446
- if (ele.defaultType == '3' && ele.bindType === 2) {
447
- this_.fixedParams[ele.field] = ele.bind || ''
448
- }
449
- })
619
+ // bindType 1 表单字段 2固定 3脚本
620
+ if (ele.defaultType == '3' && ele.bindType === 2) {
621
+ this_.fixedParams[ele.field] = ele.bind || ''
450
622
  }
623
+ })
624
+ }
451
625
 
452
- //判断对话框查询是否有条件
453
- let userInputList = JSON.parse(customDialog.conditionfield)
454
- this_.conditionBind = []
455
- let queryParams = []
456
- let placeholders = []
457
- if (userInputList.length > 0) {
458
- userInputList.forEach((ele) => {
459
- var obj = {}
460
- //条件查询参数(用户输入的) 文本框输入 defaultType 1 用户输入 2固定值 3参数传入 5脚本
461
- if (ele.defaultType == '1') {
462
- obj[ele.field] = ''
463
- queryParams.push(obj)
464
- // queryParams[ele.field] = "";
465
- this_.conditionBind.push(ele)
466
- placeholders.push('请输入' + ele.comment)
467
- }
468
- if (ele.defaultType == '2' && ele.defaultValue) {
469
- this_.fixedParams[ele.field] = ele.defaultValue
470
- }
471
- })
472
- this.$set(this, 'queryParams', queryParams)
473
- this.$set(this, 'placeholders', placeholders)
626
+ //判断对话框查询是否有条件
627
+ let userInputList = JSON.parse(customDialog.conditionfield)
628
+ this_.conditionBind = []
629
+ let queryParams = []
630
+ let placeholders = []
631
+ if (userInputList.length > 0) {
632
+ userInputList.forEach((ele) => {
633
+ var obj = {}
634
+ //条件查询参数(用户输入的) 文本框输入 defaultType 1 用户输入 2固定值 3参数传入 5脚本
635
+ if (ele.defaultType == '1') {
636
+ obj[ele.field] = ''
637
+ queryParams.push(obj)
638
+ // queryParams[ele.field] = "";
639
+ this_.conditionBind.push(ele)
640
+ placeholders.push('请输入' + ele.comment)
474
641
  }
475
- if (customDialog.style == 0 || customDialog.style == 2) {
476
- //列表
477
- this_.customDialogShow({
478
- alias: alias,
479
- customDialog: customDialog,
480
- })
481
- } else if (customDialog.style == 1) {
482
- //树形
483
- this_.pageParam = { alias: alias, customDialog: customDialog }
484
- this_.customDialog = customDialog
485
- let param = {}
486
- this_.conditionfieldTree = []
487
- //判断是否存在条件
488
- if (customDialog.conditionfield) {
489
- this_.conditionfieldTree = JSON.parse(
490
- customDialog.conditionfield
491
- )
492
- if (this_.conditionfieldTree.length > 0) {
493
- for (
494
- let i = this_.conditionfieldTree.length - 1;
495
- i >= 0;
496
- i--
497
- ) {
498
- //判断条件字段是否是动态传入(defaultType:4:动态传入,2:固定值
499
- if (this_.conditionfieldTree[i].defaultType == '4') {
500
- param[this_.conditionfieldTree[i].field] =
501
- this_.conditionfieldTree[i].comment
502
- }
503
- }
642
+ if (ele.defaultType == '2' && ele.defaultValue) {
643
+ this_.fixedParams[ele.field] = ele.defaultValue
644
+ }
645
+ })
646
+ this.$set(this, 'queryParams', queryParams)
647
+ this.$set(this, 'placeholders', placeholders)
648
+ }
649
+ if (customDialog.style == 0 || customDialog.style == 2) {
650
+ //列表
651
+ this_.customDialogShow({
652
+ alias: alias,
653
+ customDialog: customDialog,
654
+ })
655
+ } else if (customDialog.style == 1) {
656
+ //树形
657
+ this_.pageParam = { alias: alias, customDialog: customDialog }
658
+ this_.customDialog = customDialog
659
+ let param = {}
660
+ this_.conditionfieldTree = []
661
+ //判断是否存在条件
662
+ if (customDialog.conditionfield) {
663
+ this_.conditionfieldTree = JSON.parse(customDialog.conditionfield)
664
+ if (this_.conditionfieldTree.length > 0) {
665
+ for (let i = this_.conditionfieldTree.length - 1; i >= 0; i--) {
666
+ //判断条件字段是否是动态传入(defaultType4:动态传入,2:固定值
667
+ if (this_.conditionfieldTree[i].defaultType == '4') {
668
+ param[this_.conditionfieldTree[i].field] =
669
+ this_.conditionfieldTree[i].comment
504
670
  }
505
671
  }
506
- //有动态传入的字段
507
- if (JSON.stringify(param) != '{}') {
508
- this_.dialogVisible = true
509
- } else {
510
- //无动态传入的字段
511
- this_.customDialogTreeShow(this_.pageParam)
512
- }
513
672
  }
514
- })
673
+ }
674
+ //有动态传入的字段
675
+ if (JSON.stringify(param) != '{}') {
676
+ this_.dialogVisible = true
677
+ } else {
678
+ //无动态传入的字段
679
+ this_.customDialogTreeShow(this_.pageParam)
680
+ }
681
+ }
515
682
  },
516
683
  treeClick(data) {
517
684
  // 单选
@@ -648,13 +815,22 @@
648
815
  }
649
816
  // 添加用户id 岗位id 组织id
650
817
  try {
651
- if (this.$requestConfig.getUserId()) {
818
+ if (
819
+ this.$requestConfig.getUserId &&
820
+ this.$requestConfig.getUserId()
821
+ ) {
652
822
  ctx.userId = this.$requestConfig.getUserId()
653
823
  }
654
- if (this.$requestConfig.getOrgId()) {
824
+ if (
825
+ this.$requestConfig.getOrgId &&
826
+ this.$requestConfig.getOrgId()
827
+ ) {
655
828
  ctx.orgId = this.$requestConfig.getOrgId()
656
829
  }
657
- if (this.$requestConfig.getPostId()) {
830
+ if (
831
+ this.$requestConfig.getPostId &&
832
+ this.$requestConfig.getPostId()
833
+ ) {
658
834
  ctx.postId = this.$requestConfig.getPostId()
659
835
  }
660
836
  } catch (e) {
@@ -751,8 +927,28 @@
751
927
  this.selectOrgs = this.convertComment2Field(str, field)
752
928
  this.custdialog.custDialog.mappingConf.forEach((con) => {
753
929
  var val = ''
754
- str.forEach((item) => {
755
- val += item[con.from] + ','
930
+ str.forEach((item, index) => {
931
+ // 此处添加url跳转参数保存逻辑
932
+ if (
933
+ this.jumpParamKey &&
934
+ this.isHaveJumpUrl &&
935
+ (this.modelName == 'data.' + con['target'][0] ||
936
+ (this.modelName.includes('item.') &&
937
+ con['target'][0].endsWith(this.modelName.split('.')[1])))
938
+ ) {
939
+ // 如果有冒号 冒号前面是传值key 后面是取值key
940
+ let jumpParamKey = this.jumpParamKey
941
+ let jumpParamValue = this.jumpParamKey
942
+ if (this.jumpParamKey.includes(':')) {
943
+ jumpParamKey = this.jumpParamKey.split(':')[0]
944
+ jumpParamValue = this.jumpParamKey.split(':')[1]
945
+ }
946
+ val += `${item[con.from]}¯${jumpParamKey}:${
947
+ this.selectOrgs[index][jumpParamValue]
948
+ },`
949
+ } else {
950
+ val += item[con.from] + ','
951
+ }
756
952
  })
757
953
  if (this.modelName == 'data.' + con['target'][0]) {
758
954
  utils.setValueByPath(
@@ -839,6 +1035,29 @@
839
1035
  //用户输入的
840
1036
  if (this.queryParams.length != 0 && this.queryParams[0] != '') {
841
1037
  this.conditionBind.forEach((item, index) => {
1038
+ // 日期范围特殊处理
1039
+ if (item.dbType == 'date' && item.condition == 'BETWEEN') {
1040
+ if (
1041
+ (this.queryParams[index].startDate &&
1042
+ !this.queryParams[index].endDate) ||
1043
+ (!this.queryParams[index].startDate &&
1044
+ this.queryParams[index].endDate)
1045
+ ) {
1046
+ flag = true
1047
+ this.$message.info('日期范围未填写完整!')
1048
+ return
1049
+ }
1050
+ if (
1051
+ this.queryParams[index].startDate &&
1052
+ this.queryParams[index].endDate
1053
+ ) {
1054
+ this.queryParams[index][
1055
+ item.field
1056
+ ] = `${this.queryParams[index].startDate},${this.queryParams[index].endDate}`
1057
+ } else {
1058
+ this.queryParams[index][item.field] = ''
1059
+ }
1060
+ }
842
1061
  if (this.queryParams[index][item.field]) {
843
1062
  querys.push({
844
1063
  property: item.field,
@@ -912,13 +1131,22 @@
912
1131
  ctx.total = pageBean.pageBean.total
913
1132
  // 添加用户id 岗位id 组织id
914
1133
  try {
915
- if (this.$requestConfig.getUserId()) {
1134
+ if (
1135
+ this.$requestConfig.getUserId &&
1136
+ this.$requestConfig.getUserId()
1137
+ ) {
916
1138
  ctx.userId = this.$requestConfig.getUserId()
917
1139
  }
918
- if (this.$requestConfig.getOrgId()) {
1140
+ if (
1141
+ this.$requestConfig.getOrgId &&
1142
+ this.$requestConfig.getOrgId()
1143
+ ) {
919
1144
  ctx.orgId = this.$requestConfig.getOrgId()
920
1145
  }
921
- if (this.$requestConfig.getPostId()) {
1146
+ if (
1147
+ this.$requestConfig.getPostId &&
1148
+ this.$requestConfig.getPostId()
1149
+ ) {
922
1150
  ctx.postId = this.$requestConfig.getPostId()
923
1151
  }
924
1152
  } catch (e) {
@@ -951,6 +1179,8 @@
951
1179
  } else {
952
1180
  param.pageBean.pageSize = -1
953
1181
  }
1182
+ // 日期格式的 改成数组
1183
+ // this.changeDateFormat(param)
954
1184
  //构造请求的参数
955
1185
  let requestParam = {
956
1186
  pageBean: param,
@@ -986,6 +1216,21 @@
986
1216
  }
987
1217
  }
988
1218
  },
1219
+ changeDateFormat(param) {
1220
+ let dateValidate1 = /^\d{4}\-\d{2}\-\d{2}$/
1221
+ let dateValidate2 = /^([1-2][0-9][0-9][0-9]-[0-1]{0,1}[0-9]-[0-3]{0,1}[0-9])\s(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
1222
+ Object.keys(param).forEach((key) => {
1223
+ if (
1224
+ param[key] &&
1225
+ typeof param[key] == 'string' &&
1226
+ param[key].includes(',') &&
1227
+ (dateValidate1.test(param[key].split(',')[0]) ||
1228
+ dateValidate2.test(param[key].split(',')[0]))
1229
+ ) {
1230
+ param[key] = param[key].split(',')
1231
+ }
1232
+ })
1233
+ },
989
1234
  getSearchValueByKey() {
990
1235
  let queryParamsObj = {}
991
1236
  if (this.queryParams.length > 0) {
@@ -1205,13 +1450,45 @@
1205
1450
  }
1206
1451
  }
1207
1452
  }
1453
+ // 如果是查询中使用的对话框
1454
+ if (this.dialogType == 'search') {
1455
+ let returnVal = []
1456
+ str.forEach((item) => {
1457
+ returnVal.push(decodeURIComponent(item[this.modelName]))
1458
+ })
1459
+ this.$emit('updateInput', returnVal.join(','))
1460
+ return
1461
+ }
1208
1462
  const pInst = utils.getOnlineFormInstance(this)
1209
1463
  this.custdialog.custDialog.mappingConf.forEach((con) => {
1210
1464
  var val = ''
1211
1465
  var from = con.from.toLowerCase()
1212
1466
  str.forEach((item) => {
1213
1467
  if (item) {
1214
- val += decodeURIComponent(item[from]) + ','
1468
+ if (
1469
+ this.jumpParamKey &&
1470
+ this.isHaveJumpUrl &&
1471
+ (this.modelName == 'data.' + con['target'][0] ||
1472
+ (this.modelName.includes('item.') &&
1473
+ con['target'][0].endsWith(this.modelName.split('.')[1])))
1474
+ ) {
1475
+ let jumpParamKey = this.jumpParamKey
1476
+ let jumpParamValue = this.jumpParamKey
1477
+ if (this.jumpParamKey.includes(':')) {
1478
+ jumpParamKey = this.jumpParamKey.split(':')[0]
1479
+ jumpParamValue = this.jumpParamKey.split(':')[1]
1480
+ }
1481
+ // 需根据key 找到对应 返回数据的返回名称
1482
+ let returnMap = returnStr.find((k) => {
1483
+ return k.field.toLowerCase() == jumpParamValue.toLowerCase()
1484
+ })
1485
+ let returnMapKey = returnMap ? returnMap.comment : ''
1486
+ val += `${decodeURIComponent(
1487
+ item[from]
1488
+ )}¯${jumpParamKey}:${decodeURIComponent(item[returnMapKey])},`
1489
+ } else {
1490
+ val += decodeURIComponent(item[from]) + ','
1491
+ }
1215
1492
  }
1216
1493
  })
1217
1494
  if (this.modelName == 'data.' + con['target'][0]) {
@@ -1279,20 +1556,6 @@
1279
1556
  }
1280
1557
  }
1281
1558
  },
1282
- // getSelected() {
1283
- // let arr = []
1284
- // this.selectIds.forEach((item) => {
1285
- // debugger
1286
- // let obj = this.dialogData.find((sub) => {
1287
- // return sub.id_ === item
1288
- // })
1289
- // if (obj) {
1290
- // arr.push(obj)
1291
- // }
1292
- // })
1293
-
1294
- // return arr
1295
- // },
1296
1559
  calacInputSuffixHeight() {
1297
1560
  this.$emit('calacInputSuffixHeight')
1298
1561
  },
@@ -1616,4 +1879,50 @@
1616
1879
  padding: 10px 5px;
1617
1880
  overflow-y: auto;
1618
1881
  }
1882
+ .dialog-select {
1883
+ z-index: 2500 !important;
1884
+ }
1885
+ .mobile-van-action {
1886
+ &.min-height-action {
1887
+ min-height: 50%;
1888
+ }
1889
+ .dialog-mobile__title {
1890
+ font-size: 18px;
1891
+ color: #1a1a1a;
1892
+ }
1893
+ .dialog-mobile__close {
1894
+ float: right;
1895
+ }
1896
+ .van-action-sheet__cancel {
1897
+ padding: 8px 5px;
1898
+ background: $base-color-blue;
1899
+ color: $base-color-white;
1900
+ }
1901
+ .search-box {
1902
+ padding-right: 60px;
1903
+ position: relative;
1904
+ > .unfold-icon {
1905
+ position: absolute;
1906
+ right: 20px;
1907
+ top: 17px;
1908
+ }
1909
+ .search-item {
1910
+ display: flex;
1911
+ align-items: center;
1912
+ > p {
1913
+ width: 90px;
1914
+ font-size: 14px;
1915
+ text-align: right;
1916
+ margin-right: 10px;
1917
+ }
1918
+ > div {
1919
+ flex: 1;
1920
+ overflow: hidden;
1921
+ }
1922
+ }
1923
+ .search-btns {
1924
+ text-align: center;
1925
+ }
1926
+ }
1927
+ }
1619
1928
  </style>