three-trees-ui 1.0.17 → 1.0.18

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,60 @@
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
+ let reverseArr = JSON.parse(JSON.stringify(this.displayfield))
482
+ reverseArr.reverse()
483
+ return reverseArr.sort((a, b) => {
484
+ return a.sort > b.sort ? 1 : -1
485
+ })
486
+ },
352
487
  },
353
488
  methods: {
489
+ // 获取已选择的选择器数据id
490
+ getSelectId(data) {
491
+ if (!data || !data.length) {
492
+ return ''
493
+ }
494
+ let ids = []
495
+ data.forEach((item) => {
496
+ ids.push(item.id)
497
+ })
498
+ return ids.join(',')
499
+ },
500
+ showDate(index, key) {
501
+ this.dateType = this.conditionBind[index].config.inputFormat.includes(
502
+ 'mm:'
503
+ )
504
+ ? 'datetime'
505
+ : 'date'
506
+ this.currentDateData = { index, key }
507
+ this.currentDate = this.queryParams[index][key]
508
+ ? new Date(this.queryParams[index][key].replace(/-/g, '/'))
509
+ : new Date()
510
+ this.isShowDatePop = true
511
+ },
512
+ // 日期确认
513
+ confirmFn() {
514
+ let currentConfig = this.conditionBind[this.currentDateData.index]
515
+ this.queryParams[this.currentDateData.index][
516
+ this.currentDateData.key
517
+ ] = this.currentDate.format(currentConfig.config.inputFormat)
518
+
519
+ this.isShowDatePop = false
520
+ },
354
521
  searchInputChange() {
355
522
  if (!this.isShowMoreSearch) {
356
523
  this.search(true)
@@ -396,122 +563,124 @@
396
563
  this.search(true)
397
564
  },
398
565
  showDialog() {
399
- const this_ = this
400
566
  this.fixedParams = {}
567
+ // 如果已存在配置信息就不去请求配置信息 直接初始化数据
568
+ if (this.dialogConfig) {
569
+ this.initDialog(this.dialogConfig)
570
+ return
571
+ }
401
572
  var alias = this.custdialog.custDialog.alias
402
573
  this.$requestConfig
403
574
  .getCustomDialogByAlias(alias)
404
575
  .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
576
+ this.initDialog(customDialog)
577
+ })
578
+ },
579
+ initDialog(customDialog) {
580
+ let alias = this.custdialog.custDialog.alias
581
+ const this_ = this
582
+ if (!customDialog || !customDialog.alias) {
583
+ this.$message.error('对话框别名【' + alias + '】不存在!')
584
+ return
585
+ }
586
+ if (customDialog.style == 1) {
587
+ var displaylist = JSON.parse(customDialog.displayfield)
588
+ this_.nodeKey = displaylist.id
589
+ }
590
+ if (customDialog.needPage && customDialog.requestType === 'POST') {
591
+ let obj = {}
592
+ this.getLastKeyByPath(obj, customDialog.pageKey, 1)
593
+ this.getLastKeyByPath(obj, customDialog.pageSizeKey, 10)
594
+ this.getLastKeyByPath(obj, customDialog.totalKey, true)
595
+ const exp = utils.parseExp(customDialog.dataParam, obj, true)
596
+ if (exp) {
597
+ const params = JSON.parse(exp)
598
+ if (params.pageBean) {
599
+ this.pagination = {
600
+ ...params.pageBean,
601
+ }
412
602
  }
413
- if (customDialog.needPage && customDialog.requestType === 'POST') {
603
+ }
604
+ }
605
+ //对话框按表单字段查询(参数传入的)
606
+ let bindList = this_.custdialog.custDialog.conditions
607
+ this_.param = [] //绑定的表单字段
608
+ if (bindList.length > 0) {
609
+ bindList.forEach((ele) => {
610
+ //绑定表单字段
611
+ if (
612
+ ele.bind &&
613
+ (ele.defaultType == '3' || ele.bind.startsWith('data.searchForm'))
614
+ ) {
414
615
  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
- }
616
+ obj.field = ele.field
617
+ obj.bind = ele.bind
618
+ obj.bindType = ele.bindType
619
+ this_.param.push(obj)
427
620
  }
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
- })
621
+ // bindType 1 表单字段 2固定 3脚本
622
+ if (ele.defaultType == '3' && ele.bindType === 2) {
623
+ this_.fixedParams[ele.field] = ele.bind || ''
450
624
  }
625
+ })
626
+ }
451
627
 
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)
628
+ //判断对话框查询是否有条件
629
+ let userInputList = JSON.parse(customDialog.conditionfield)
630
+ this_.conditionBind = []
631
+ let queryParams = []
632
+ let placeholders = []
633
+ if (userInputList.length > 0) {
634
+ userInputList.forEach((ele) => {
635
+ var obj = {}
636
+ //条件查询参数(用户输入的) 文本框输入 defaultType 1 用户输入 2固定值 3参数传入 5脚本
637
+ if (ele.defaultType == '1') {
638
+ obj[ele.field] = ''
639
+ queryParams.push(obj)
640
+ // queryParams[ele.field] = "";
641
+ this_.conditionBind.push(ele)
642
+ placeholders.push('请输入' + ele.comment)
474
643
  }
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
- }
644
+ if (ele.defaultType == '2' && ele.defaultValue) {
645
+ this_.fixedParams[ele.field] = ele.defaultValue
646
+ }
647
+ })
648
+ this.$set(this, 'queryParams', queryParams)
649
+ this.$set(this, 'placeholders', placeholders)
650
+ }
651
+ if (customDialog.style == 0 || customDialog.style == 2) {
652
+ //列表
653
+ this_.customDialogShow({
654
+ alias: alias,
655
+ customDialog: customDialog,
656
+ })
657
+ } else if (customDialog.style == 1) {
658
+ //树形
659
+ this_.pageParam = { alias: alias, customDialog: customDialog }
660
+ this_.customDialog = customDialog
661
+ let param = {}
662
+ this_.conditionfieldTree = []
663
+ //判断是否存在条件
664
+ if (customDialog.conditionfield) {
665
+ this_.conditionfieldTree = JSON.parse(customDialog.conditionfield)
666
+ if (this_.conditionfieldTree.length > 0) {
667
+ for (let i = this_.conditionfieldTree.length - 1; i >= 0; i--) {
668
+ //判断条件字段是否是动态传入(defaultType4:动态传入,2:固定值
669
+ if (this_.conditionfieldTree[i].defaultType == '4') {
670
+ param[this_.conditionfieldTree[i].field] =
671
+ this_.conditionfieldTree[i].comment
504
672
  }
505
673
  }
506
- //有动态传入的字段
507
- if (JSON.stringify(param) != '{}') {
508
- this_.dialogVisible = true
509
- } else {
510
- //无动态传入的字段
511
- this_.customDialogTreeShow(this_.pageParam)
512
- }
513
674
  }
514
- })
675
+ }
676
+ //有动态传入的字段
677
+ if (JSON.stringify(param) != '{}') {
678
+ this_.dialogVisible = true
679
+ } else {
680
+ //无动态传入的字段
681
+ this_.customDialogTreeShow(this_.pageParam)
682
+ }
683
+ }
515
684
  },
516
685
  treeClick(data) {
517
686
  // 单选
@@ -648,13 +817,22 @@
648
817
  }
649
818
  // 添加用户id 岗位id 组织id
650
819
  try {
651
- if (this.$requestConfig.getUserId()) {
820
+ if (
821
+ this.$requestConfig.getUserId &&
822
+ this.$requestConfig.getUserId()
823
+ ) {
652
824
  ctx.userId = this.$requestConfig.getUserId()
653
825
  }
654
- if (this.$requestConfig.getOrgId()) {
826
+ if (
827
+ this.$requestConfig.getOrgId &&
828
+ this.$requestConfig.getOrgId()
829
+ ) {
655
830
  ctx.orgId = this.$requestConfig.getOrgId()
656
831
  }
657
- if (this.$requestConfig.getPostId()) {
832
+ if (
833
+ this.$requestConfig.getPostId &&
834
+ this.$requestConfig.getPostId()
835
+ ) {
658
836
  ctx.postId = this.$requestConfig.getPostId()
659
837
  }
660
838
  } catch (e) {
@@ -751,8 +929,28 @@
751
929
  this.selectOrgs = this.convertComment2Field(str, field)
752
930
  this.custdialog.custDialog.mappingConf.forEach((con) => {
753
931
  var val = ''
754
- str.forEach((item) => {
755
- val += item[con.from] + ','
932
+ str.forEach((item, index) => {
933
+ // 此处添加url跳转参数保存逻辑
934
+ if (
935
+ this.jumpParamKey &&
936
+ this.isHaveJumpUrl &&
937
+ (this.modelName == 'data.' + con['target'][0] ||
938
+ (this.modelName.includes('item.') &&
939
+ con['target'][0].endsWith(this.modelName.split('.')[1])))
940
+ ) {
941
+ // 如果有冒号 冒号前面是传值key 后面是取值key
942
+ let jumpParamKey = this.jumpParamKey
943
+ let jumpParamValue = this.jumpParamKey
944
+ if (this.jumpParamKey.includes(':')) {
945
+ jumpParamKey = this.jumpParamKey.split(':')[0]
946
+ jumpParamValue = this.jumpParamKey.split(':')[1]
947
+ }
948
+ val += `${item[con.from]}¯${jumpParamKey}:${
949
+ this.selectOrgs[index][jumpParamValue]
950
+ },`
951
+ } else {
952
+ val += item[con.from] + ','
953
+ }
756
954
  })
757
955
  if (this.modelName == 'data.' + con['target'][0]) {
758
956
  utils.setValueByPath(
@@ -839,6 +1037,29 @@
839
1037
  //用户输入的
840
1038
  if (this.queryParams.length != 0 && this.queryParams[0] != '') {
841
1039
  this.conditionBind.forEach((item, index) => {
1040
+ // 日期范围特殊处理
1041
+ if (item.dbType == 'date' && item.condition == 'BETWEEN') {
1042
+ if (
1043
+ (this.queryParams[index].startDate &&
1044
+ !this.queryParams[index].endDate) ||
1045
+ (!this.queryParams[index].startDate &&
1046
+ this.queryParams[index].endDate)
1047
+ ) {
1048
+ flag = true
1049
+ this.$message.info('日期范围未填写完整!')
1050
+ return
1051
+ }
1052
+ if (
1053
+ this.queryParams[index].startDate &&
1054
+ this.queryParams[index].endDate
1055
+ ) {
1056
+ this.queryParams[index][
1057
+ item.field
1058
+ ] = `${this.queryParams[index].startDate},${this.queryParams[index].endDate}`
1059
+ } else {
1060
+ this.queryParams[index][item.field] = ''
1061
+ }
1062
+ }
842
1063
  if (this.queryParams[index][item.field]) {
843
1064
  querys.push({
844
1065
  property: item.field,
@@ -912,13 +1133,22 @@
912
1133
  ctx.total = pageBean.pageBean.total
913
1134
  // 添加用户id 岗位id 组织id
914
1135
  try {
915
- if (this.$requestConfig.getUserId()) {
1136
+ if (
1137
+ this.$requestConfig.getUserId &&
1138
+ this.$requestConfig.getUserId()
1139
+ ) {
916
1140
  ctx.userId = this.$requestConfig.getUserId()
917
1141
  }
918
- if (this.$requestConfig.getOrgId()) {
1142
+ if (
1143
+ this.$requestConfig.getOrgId &&
1144
+ this.$requestConfig.getOrgId()
1145
+ ) {
919
1146
  ctx.orgId = this.$requestConfig.getOrgId()
920
1147
  }
921
- if (this.$requestConfig.getPostId()) {
1148
+ if (
1149
+ this.$requestConfig.getPostId &&
1150
+ this.$requestConfig.getPostId()
1151
+ ) {
922
1152
  ctx.postId = this.$requestConfig.getPostId()
923
1153
  }
924
1154
  } catch (e) {
@@ -951,6 +1181,8 @@
951
1181
  } else {
952
1182
  param.pageBean.pageSize = -1
953
1183
  }
1184
+ // 日期格式的 改成数组
1185
+ // this.changeDateFormat(param)
954
1186
  //构造请求的参数
955
1187
  let requestParam = {
956
1188
  pageBean: param,
@@ -986,6 +1218,21 @@
986
1218
  }
987
1219
  }
988
1220
  },
1221
+ changeDateFormat(param) {
1222
+ let dateValidate1 = /^\d{4}\-\d{2}\-\d{2}$/
1223
+ 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$/
1224
+ Object.keys(param).forEach((key) => {
1225
+ if (
1226
+ param[key] &&
1227
+ typeof param[key] == 'string' &&
1228
+ param[key].includes(',') &&
1229
+ (dateValidate1.test(param[key].split(',')[0]) ||
1230
+ dateValidate2.test(param[key].split(',')[0]))
1231
+ ) {
1232
+ param[key] = param[key].split(',')
1233
+ }
1234
+ })
1235
+ },
989
1236
  getSearchValueByKey() {
990
1237
  let queryParamsObj = {}
991
1238
  if (this.queryParams.length > 0) {
@@ -1205,13 +1452,45 @@
1205
1452
  }
1206
1453
  }
1207
1454
  }
1455
+ // 如果是查询中使用的对话框
1456
+ if (this.dialogType == 'search') {
1457
+ let returnVal = []
1458
+ str.forEach((item) => {
1459
+ returnVal.push(decodeURIComponent(item[this.modelName]))
1460
+ })
1461
+ this.$emit('updateInput', returnVal.join(','))
1462
+ return
1463
+ }
1208
1464
  const pInst = utils.getOnlineFormInstance(this)
1209
1465
  this.custdialog.custDialog.mappingConf.forEach((con) => {
1210
1466
  var val = ''
1211
1467
  var from = con.from.toLowerCase()
1212
1468
  str.forEach((item) => {
1213
1469
  if (item) {
1214
- val += decodeURIComponent(item[from]) + ','
1470
+ if (
1471
+ this.jumpParamKey &&
1472
+ this.isHaveJumpUrl &&
1473
+ (this.modelName == 'data.' + con['target'][0] ||
1474
+ (this.modelName.includes('item.') &&
1475
+ con['target'][0].endsWith(this.modelName.split('.')[1])))
1476
+ ) {
1477
+ let jumpParamKey = this.jumpParamKey
1478
+ let jumpParamValue = this.jumpParamKey
1479
+ if (this.jumpParamKey.includes(':')) {
1480
+ jumpParamKey = this.jumpParamKey.split(':')[0]
1481
+ jumpParamValue = this.jumpParamKey.split(':')[1]
1482
+ }
1483
+ // 需根据key 找到对应 返回数据的返回名称
1484
+ let returnMap = returnStr.find((k) => {
1485
+ return k.field.toLowerCase() == jumpParamValue.toLowerCase()
1486
+ })
1487
+ let returnMapKey = returnMap ? returnMap.comment : ''
1488
+ val += `${decodeURIComponent(
1489
+ item[from]
1490
+ )}¯${jumpParamKey}:${decodeURIComponent(item[returnMapKey])},`
1491
+ } else {
1492
+ val += decodeURIComponent(item[from]) + ','
1493
+ }
1215
1494
  }
1216
1495
  })
1217
1496
  if (this.modelName == 'data.' + con['target'][0]) {
@@ -1279,20 +1558,6 @@
1279
1558
  }
1280
1559
  }
1281
1560
  },
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
1561
  calacInputSuffixHeight() {
1297
1562
  this.$emit('calacInputSuffixHeight')
1298
1563
  },
@@ -1616,4 +1881,50 @@
1616
1881
  padding: 10px 5px;
1617
1882
  overflow-y: auto;
1618
1883
  }
1884
+ .dialog-select {
1885
+ z-index: 2500 !important;
1886
+ }
1887
+ .mobile-van-action {
1888
+ &.min-height-action {
1889
+ min-height: 50%;
1890
+ }
1891
+ .dialog-mobile__title {
1892
+ font-size: 18px;
1893
+ color: #1a1a1a;
1894
+ }
1895
+ .dialog-mobile__close {
1896
+ float: right;
1897
+ }
1898
+ .van-action-sheet__cancel {
1899
+ padding: 8px 5px;
1900
+ background: $base-color-blue;
1901
+ color: $base-color-white;
1902
+ }
1903
+ .search-box {
1904
+ padding-right: 60px;
1905
+ position: relative;
1906
+ > .unfold-icon {
1907
+ position: absolute;
1908
+ right: 20px;
1909
+ top: 17px;
1910
+ }
1911
+ .search-item {
1912
+ display: flex;
1913
+ align-items: center;
1914
+ > p {
1915
+ width: 90px;
1916
+ font-size: 14px;
1917
+ text-align: right;
1918
+ margin-right: 10px;
1919
+ }
1920
+ > div {
1921
+ flex: 1;
1922
+ overflow: hidden;
1923
+ }
1924
+ }
1925
+ .search-btns {
1926
+ text-align: center;
1927
+ }
1928
+ }
1929
+ }
1619
1930
  </style>