three-trees-ui 1.0.3 → 1.0.5

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.
@@ -39,6 +39,7 @@
39
39
  direction="vertical"
40
40
  ></el-divider>
41
41
  <el-container>
42
+ <!-- 查询条件 -->
42
43
  <el-header v-if="querysShow" class="middle-header">
43
44
  <div
44
45
  v-for="(condition, index) in conditionBind"
@@ -46,6 +47,7 @@
46
47
  class="search-item"
47
48
  >
48
49
  <p style="font-size: 14px">{{ condition.comment }}:</p>
50
+ <!-- input输入框 -->
49
51
  <div v-if="condition.controllerType == '1'">
50
52
  <el-input
51
53
  v-model="queryParams[index][condition.field]"
@@ -57,6 +59,7 @@
57
59
  @keyup.enter.native="searchEnterFun"
58
60
  ></el-input>
59
61
  </div>
62
+ <!-- 单选按钮 -->
60
63
  <div
61
64
  v-if="condition.controllerType == '2'"
62
65
  style="margin-right: 10px"
@@ -70,35 +73,28 @@
70
73
  {{ itemR.value }}
71
74
  </el-radio>
72
75
  </div>
76
+ <!-- 下拉框 -->
73
77
  <div
74
78
  v-if="condition.controllerType == '3'"
75
79
  style="margin-right: 10px"
76
80
  >
81
+ <!-- 静态选项 -->
77
82
  <ht-select
78
83
  v-if="condition.config.choiceType == 'static'"
79
84
  v-model="queryParams[index][condition.field]"
80
85
  :placeholder="quickSearch"
86
+ :multiple="condition.config.multiple"
81
87
  :options="condition.config.options"
82
88
  ></ht-select>
83
- <eip-select-dia
89
+ <!-- 动态选项时展示数据字典 -->
90
+ <ht-dictionary
84
91
  v-else
85
- v-model="queryParams[condition.field]"
86
- :placeholder="quickSearch"
87
- :ganged="{
88
- alias: condition.config.customQuery.alias,
89
- valueBind: condition.config.customQuery.valueBind,
90
- noInit: '',
91
- labelBind: condition.config.customQuery.labelBind,
92
- gangedBind: '{}',
93
- bind: condition.config.bind,
94
- }"
95
- :multiple="false"
96
- :filterable="false"
97
- :allow-create="false"
98
- :selectlist="[]"
99
- :query-params="queryParams"
100
- ></eip-select-dia>
92
+ v-model="queryParams[index][condition.field]"
93
+ :dickey="condition.config.dic"
94
+ :filterable="condition.config.filterable"
95
+ ></ht-dictionary>
101
96
  </div>
97
+ <!-- 标签 -->
102
98
  <div
103
99
  v-if="condition.controllerType == '4'"
104
100
  style="margin-right: 10px"
@@ -111,6 +107,121 @@
111
107
  :expand="condition.config.expand"
112
108
  ></eip-tag>
113
109
  </div>
110
+ <!-- 日期 -->
111
+ <div
112
+ v-if="condition.controllerType == '6'"
113
+ style="margin-right: 10px"
114
+ >
115
+ <!-- 根据日期的条件类型来判断展示单个日期还是日期范围 -->
116
+ <div v-if="condition.condition == 'BETWEEN'">
117
+ <ht-date
118
+ v-model="queryParams[index].startDate"
119
+ :format="condition.config.inputFormat"
120
+ :valueFormat="condition.config.inputFormat"
121
+ ></ht-date>
122
+
123
+ <ht-date
124
+ v-model="queryParams[index].endDate"
125
+ :format="condition.config.inputFormat"
126
+ :valueFormat="condition.config.inputFormat"
127
+ ></ht-date>
128
+ </div>
129
+ <ht-date
130
+ v-model="queryParams[index][condition.field]"
131
+ v-else
132
+ :format="condition.config.inputFormat"
133
+ :valueFormat="condition.config.inputFormat"
134
+ ></ht-date>
135
+ </div>
136
+ <!-- 选择器 -->
137
+ <div
138
+ v-if="condition.controllerType == '7'"
139
+ style="margin-right: 10px"
140
+ >
141
+ <ht-user-selector-input
142
+ v-model="queryParams[index].selectName"
143
+ v-if="condition.config.alias == 'user'"
144
+ append-to-body
145
+ @change="
146
+ (data) => {
147
+ queryParams[index][condition.field] = getSelectId(data)
148
+ }
149
+ "
150
+ ></ht-user-selector-input>
151
+ <ht-org-selector-input
152
+ v-model="queryParams[index].selectName"
153
+ v-if="condition.config.alias == 'org'"
154
+ append-to-body
155
+ @change="
156
+ (data) => {
157
+ queryParams[index][condition.field] = getSelectId(data)
158
+ }
159
+ "
160
+ ></ht-org-selector-input>
161
+ <ht-role-selector-input
162
+ v-model="queryParams[index].selectName"
163
+ v-if="condition.config.alias == 'role'"
164
+ append-to-body
165
+ @change="
166
+ (data) => {
167
+ queryParams[index][condition.field] = getSelectId(data)
168
+ }
169
+ "
170
+ ></ht-role-selector-input>
171
+ <ht-job-selector-input
172
+ v-model="queryParams[index].selectName"
173
+ v-if="condition.config.alias == 'job'"
174
+ append-to-body
175
+ @change="
176
+ (data) => {
177
+ queryParams[index][condition.field] = getSelectId(data)
178
+ }
179
+ "
180
+ ></ht-job-selector-input>
181
+ <ht-post-selector-input
182
+ v-model="queryParams[index].selectName"
183
+ v-if="condition.config.alias == 'post'"
184
+ append-to-body
185
+ @change="
186
+ (data) => {
187
+ queryParams[index][condition.field] = getSelectId(data)
188
+ }
189
+ "
190
+ ></ht-post-selector-input>
191
+ <ht-dimension-selector-input
192
+ v-model="queryParams[index].selectName"
193
+ v-if="condition.config.alias == 'dimension'"
194
+ append-to-body
195
+ @change="
196
+ (data) => {
197
+ queryParams[index][condition.field] = getSelectId(data)
198
+ }
199
+ "
200
+ ></ht-dimension-selector-input>
201
+ </div>
202
+ <!-- 对话框 -->
203
+ <div
204
+ v-if="condition.controllerType == '5'"
205
+ style="margin-right: 10px"
206
+ >
207
+ <ht-custom-dialog
208
+ v-model="queryParams[index][condition.field]"
209
+ :model-name="condition.config.keyBind"
210
+ dialogType="search"
211
+ :custdialog="{
212
+ name: '请选择',
213
+ icon: '',
214
+ custDialog: {
215
+ selectNum: 1,
216
+ conditions: [],
217
+ mappingConf: [],
218
+ custQueryJson: [],
219
+ alias: condition.config.alias,
220
+ type: 'custDialog',
221
+ },
222
+ }"
223
+ ></ht-custom-dialog>
224
+ </div>
114
225
  </div>
115
226
  <div
116
227
  v-if="conditionBind && conditionBind.length > 0"
@@ -130,7 +241,7 @@
130
241
  </el-button>
131
242
  </div>
132
243
  </el-header>
133
- <el-main class="custom-dialog_main">
244
+ <el-main class="custom-dialog_main" ref="customTableRef">
134
245
  <el-table
135
246
  ref="orgTable"
136
247
  :data="dialogData"
@@ -174,12 +285,11 @@
174
285
  label="序号"
175
286
  ></el-table-column>
176
287
  <el-table-column
177
- v-for="field in displayfield"
288
+ v-for="field in sortDisplayfield"
178
289
  :key="field.field"
179
- :show-overflow-tooltip="true"
180
290
  :prop="field.field"
181
291
  :label="field.comment"
182
- style="width: 100%"
292
+ :width="field.width || ''"
183
293
  ></el-table-column>
184
294
  </el-table>
185
295
  </el-main>
@@ -328,9 +438,13 @@
328
438
  type: Boolean,
329
439
  default: false,
330
440
  },
441
+ dialogConfig: Object,
442
+ dialogType: String,
331
443
  },
332
444
  data() {
333
445
  return {
446
+ startDate: '', // 日期控件
447
+ endDate: '', // 日期控件
334
448
  tableHeight: 350,
335
449
  isEditInputShow: false,
336
450
  customValue: '',
@@ -402,6 +516,24 @@
402
516
  }
403
517
  return []
404
518
  },
519
+ jumpParamKey() {
520
+ return this.dialogConfig && this.dialogConfig.jumpParamKey
521
+ ? this.dialogConfig.jumpParamKey
522
+ : ''
523
+ },
524
+ // 是否保存成跳转url参数
525
+ isHaveJumpUrl() {
526
+ return (
527
+ this.dialogConfig &&
528
+ ((this.isMobile && this.dialogConfig.mobileUrl) ||
529
+ (!this.isMobile && this.dialogConfig.pcUrl))
530
+ )
531
+ },
532
+ sortDisplayfield() {
533
+ return this.displayfield.sort((a, b) => {
534
+ return a.sort > b.sort ? 1 : -1
535
+ })
536
+ },
405
537
  },
406
538
  watch: {
407
539
  dialogData: {
@@ -422,7 +554,6 @@
422
554
  })
423
555
  }
424
556
  }
425
- this.initTableHeight()
426
557
  },
427
558
  immediate: true,
428
559
  deep: true,
@@ -439,149 +570,165 @@
439
570
  })
440
571
  },
441
572
  methods: {
573
+ // 获取已选择的选择器数据id
574
+ getSelectId(data) {
575
+ if (!data || !data.length) {
576
+ return ''
577
+ }
578
+ let ids = []
579
+ data.forEach((item) => {
580
+ ids.push(item.id)
581
+ })
582
+ return ids.join(',')
583
+ },
442
584
  showDialog(isMounted = false) {
443
- const this_ = this
444
585
  this.fixedParams = {}
586
+ // 如果已存在配置信息就不去请求配置信息 直接初始化数据
587
+ if (this.dialogConfig) {
588
+ this.initDialog(this.dialogConfig, isMounted)
589
+ return
590
+ }
445
591
  var alias = this.custdialog.custDialog.alias
446
592
  this.$requestConfig
447
593
  .getCustomDialogByAlias(alias)
448
594
  .then((customDialog) => {
449
- if (!customDialog || !customDialog.alias) {
450
- this.$message.error('对话框别名【' + alias + '】不存在!')
451
- return
452
- }
453
- if (customDialog.style == 1) {
454
- var displaylist = JSON.parse(customDialog.displayfield)
455
- this_.nodeKey = displaylist.id
456
- }
457
- if (customDialog.needPage && customDialog.requestType === 'POST') {
458
- let obj = {}
459
- this.getLastKeyByPath(obj, customDialog.pageKey, 1)
460
- this.getLastKeyByPath(obj, customDialog.pageSizeKey, 10)
461
- this.getLastKeyByPath(obj, customDialog.totalKey, true)
462
- const exp = utils.parseExp(customDialog.dataParam, obj, true)
463
- if (exp) {
464
- const params = JSON.parse(exp)
465
- if (params.pageBean) {
466
- this.pagination = {
467
- ...params.pageBean,
468
- }
469
- }
595
+ this.initDialog(customDialog, isMounted)
596
+ })
597
+ },
598
+ initDialog(customDialog, isMounted) {
599
+ let alias = this.custdialog.custDialog.alias
600
+ const this_ = this
601
+ if (!customDialog || !customDialog.alias) {
602
+ this.$message.error('对话框别名【' + alias + '】不存在!')
603
+ return
604
+ }
605
+ if (customDialog.style == 1) {
606
+ var displaylist = JSON.parse(customDialog.displayfield)
607
+ this_.nodeKey = displaylist.id
608
+ }
609
+ if (customDialog.needPage && customDialog.requestType === 'POST') {
610
+ let obj = {}
611
+ this.getLastKeyByPath(obj, customDialog.pageKey, 1)
612
+ this.getLastKeyByPath(obj, customDialog.pageSizeKey, 10)
613
+ this.getLastKeyByPath(obj, customDialog.totalKey, true)
614
+ const exp = utils.parseExp(customDialog.dataParam, obj, true)
615
+ if (exp) {
616
+ const params = JSON.parse(exp)
617
+ if (params.pageBean) {
618
+ this.pagination = {
619
+ ...params.pageBean,
470
620
  }
471
621
  }
472
- //对话框按表单字段查询(参数传入的)
473
- let bindList = this_.custdialog.custDialog.conditions
474
- this_.param = [] //绑定的表单字段
475
- if (bindList.length > 0) {
476
- bindList.forEach((ele) => {
477
- //绑定表单字段
478
- if (
479
- ele.bind &&
480
- (ele.defaultType == '3' ||
481
- ele.bind.startsWith('data.searchForm'))
482
- ) {
483
- let obj = {}
484
- obj.field = ele.field
485
- obj.bind = ele.bind
486
- obj.bindType = ele.bindType
487
- this_.param.push(obj)
488
- }
489
- //取值对象为脚本时获取value
490
- if (ele.bindType === 3) {
491
- this_.$requestConfig.executeScript(ele.bind).then((res) => {
492
- this_.executeScriptResult = res && res.value
493
- })
494
- }
495
- })
622
+ }
623
+ }
624
+ //对话框按表单字段查询(参数传入的)
625
+ let bindList = this_.custdialog.custDialog.conditions
626
+ this_.param = [] //绑定的表单字段
627
+ if (bindList.length > 0) {
628
+ bindList.forEach((ele) => {
629
+ //绑定表单字段
630
+ if (
631
+ ele.bind &&
632
+ (ele.defaultType == '3' || ele.bind.startsWith('data.searchForm'))
633
+ ) {
634
+ let obj = {}
635
+ obj.field = ele.field
636
+ obj.bind = ele.bind
637
+ obj.bindType = ele.bindType
638
+ this_.param.push(obj)
496
639
  }
497
- //判断对话框查询是否有条件
498
- let userInputList = JSON.parse(customDialog.conditionfield)
499
- this_.quickSearch = '' //填写提示 placeholder
500
- this_.conditionBind = []
501
- let queryParams = []
502
- let placeholders = []
503
- if (userInputList.length > 0) {
504
- userInputList.forEach((ele) => {
505
- var obj = {}
506
- //条件查询参数(用户输入的) 文本框输入 defaultType 1 用户输入 2固定值 3参数传入 5脚本
507
- if (ele.defaultType == '1') {
508
- obj[ele.field] = ''
509
- queryParams.push(obj)
510
- // queryParams[ele.field] = "";
511
- this_.conditionBind.push(ele)
512
- placeholders.push('请输入' + ele.comment)
513
- }
514
- if (ele.defaultType == '2' && ele.defaultValue) {
515
- this_.fixedParams[ele.field] = ele.defaultValue
516
- }
640
+ //取值对象为脚本时获取value
641
+ if (ele.bindType === 3) {
642
+ this_.$requestConfig.executeScript(ele.bind).then((res) => {
643
+ this_.executeScriptResult = res && res.value
517
644
  })
518
- this.$set(this, 'queryParams', queryParams)
519
- this.$set(this, 'placeholders', placeholders)
520
645
  }
521
- //判断是否显示条件查询输入框
522
- if (this_.quickSearch != '') {
523
- this_.querysShow = true
524
- } else {
525
- this_.querysShow = true
646
+ })
647
+ }
648
+ //判断对话框查询是否有条件
649
+ let userInputList = JSON.parse(customDialog.conditionfield)
650
+ this_.quickSearch = '' //填写提示 placeholder
651
+ this_.conditionBind = []
652
+ let queryParams = []
653
+ let placeholders = []
654
+ if (userInputList.length > 0) {
655
+ userInputList.forEach((ele) => {
656
+ var obj = {}
657
+ //条件查询参数(用户输入的) 文本框输入 defaultType 1 用户输入 2固定值 3参数传入 5脚本
658
+ if (ele.defaultType == '1') {
659
+ obj[ele.field] = ''
660
+ queryParams.push(obj)
661
+ // queryParams[ele.field] = "";
662
+ this_.conditionBind.push(ele)
663
+ placeholders.push('请输入' + ele.comment)
526
664
  }
527
- this_.quickSearch = '请输入' + this.quickSearch + '查询'
528
- this_.style = 'height:' + customDialog.height + 'px'
529
- if (window.screen.height && window.screen.height <= 900) {
530
- this.style = 'height:440px'
665
+ if (ele.defaultType == '2' && ele.defaultValue) {
666
+ this_.fixedParams[ele.field] = ele.defaultValue
531
667
  }
532
- if (customDialog.style == 0 || customDialog.style == 2) {
533
- //列表
534
- setTimeout(() => {
535
- this_.customDialogShow(
536
- {
537
- alias: alias,
538
- customDialog: customDialog,
539
- },
540
- isMounted
541
- )
542
- }, 100)
543
- } else if (customDialog.style == 1) {
544
- //树形
545
- this_.pageParam = { alias: alias, customDialog: customDialog }
546
- this_.customDialog = customDialog
547
- let param = {}
548
- this_.conditionfieldTree = []
549
- //判断是否存在条件
550
- if (customDialog.conditionfield) {
551
- this_.conditionfieldTree = JSON.parse(
552
- customDialog.conditionfield
553
- )
554
- if (this_.conditionfieldTree.length > 0) {
555
- for (
556
- let i = this_.conditionfieldTree.length - 1;
557
- i >= 0;
558
- i--
559
- ) {
560
- //判断条件字段是否是动态传入(defaultType:4:动态传入,2:固定值
561
- if (this_.conditionfieldTree[i].defaultType == '4') {
562
- param[this_.conditionfieldTree[i].field] =
563
- this_.conditionfieldTree[i].comment
564
- }
565
- }
566
- }
567
- }
568
- //有动态传入的字段
569
- if (!isMounted) {
570
- if (JSON.stringify(param) != '{}') {
571
- this_.dialogVisible = true
572
- } else {
573
- //无动态传入的字段
574
- this_.customDialogTreeShow(this_.pageParam)
668
+ })
669
+ this.$set(this, 'queryParams', queryParams)
670
+ this.$set(this, 'placeholders', placeholders)
671
+ }
672
+ //判断是否显示条件查询输入框
673
+ if (this_.quickSearch != '') {
674
+ this_.querysShow = true
675
+ } else {
676
+ this_.querysShow = true
677
+ }
678
+ this_.quickSearch = '请输入' + this.quickSearch + '查询'
679
+ this_.style = 'height:' + customDialog.height + 'px'
680
+ if (window.screen.height && window.screen.height <= 900) {
681
+ this.style = 'height:440px'
682
+ }
683
+ if (customDialog.style == 0 || customDialog.style == 2) {
684
+ //列表
685
+ setTimeout(() => {
686
+ this_.customDialogShow(
687
+ {
688
+ alias: alias,
689
+ customDialog: customDialog,
690
+ },
691
+ isMounted
692
+ )
693
+ }, 100)
694
+ } else if (customDialog.style == 1) {
695
+ //树形
696
+ this_.pageParam = { alias: alias, customDialog: customDialog }
697
+ this_.customDialog = customDialog
698
+ let param = {}
699
+ this_.conditionfieldTree = []
700
+ //判断是否存在条件
701
+ if (customDialog.conditionfield) {
702
+ this_.conditionfieldTree = JSON.parse(customDialog.conditionfield)
703
+ if (this_.conditionfieldTree.length > 0) {
704
+ for (let i = this_.conditionfieldTree.length - 1; i >= 0; i--) {
705
+ //判断条件字段是否是动态传入(defaultType:4:动态传入,2:固定值
706
+ if (this_.conditionfieldTree[i].defaultType == '4') {
707
+ param[this_.conditionfieldTree[i].field] =
708
+ this_.conditionfieldTree[i].comment
575
709
  }
576
710
  }
577
711
  }
578
- })
712
+ }
713
+ //有动态传入的字段
714
+ if (!isMounted) {
715
+ if (JSON.stringify(param) != '{}') {
716
+ this_.dialogVisible = true
717
+ } else {
718
+ //无动态传入的字段
719
+ this_.customDialogTreeShow(this_.pageParam)
720
+ }
721
+ }
722
+ }
579
723
  },
580
724
  initTableHeight() {
581
725
  this.$nextTick(() => {
582
- let mainEl = document.getElementsByClassName('custom-dialog_main')
583
- if (mainEl && mainEl.length) {
584
- this.tableHeight = mainEl[0].clientHeight - 40
726
+ let mainEl = this.$refs.customTableRef
727
+ if (mainEl) {
728
+ this.tableHeight =
729
+ mainEl.$el.clientHeight - 2 > 350
730
+ ? mainEl.$el.clientHeight - 2
731
+ : 350
585
732
  }
586
733
  })
587
734
  },
@@ -722,13 +869,22 @@
722
869
  }
723
870
  // 添加用户id 岗位id 组织id
724
871
  try {
725
- if (this.$requestConfig.getUserId()) {
872
+ if (
873
+ this.$requestConfig.getUserId &&
874
+ this.$requestConfig.getUserId()
875
+ ) {
726
876
  ctx.userId = this.$requestConfig.getUserId()
727
877
  }
728
- if (this.$requestConfig.getOrgId()) {
878
+ if (
879
+ this.$requestConfig.getOrgId &&
880
+ this.$requestConfig.getOrgId()
881
+ ) {
729
882
  ctx.orgId = this.$requestConfig.getOrgId()
730
883
  }
731
- if (this.$requestConfig.getPostId()) {
884
+ if (
885
+ this.$requestConfig.getPostId &&
886
+ this.$requestConfig.getPostId()
887
+ ) {
732
888
  ctx.postId = this.$requestConfig.getPostId()
733
889
  }
734
890
  } catch (e) {
@@ -825,8 +981,19 @@
825
981
  this.selectOrgs = this.convertComment2Field(str, field)
826
982
  this.custdialog.custDialog.mappingConf.forEach((con) => {
827
983
  var val = ''
828
- str.forEach((item) => {
829
- val += item[con.from] + ','
984
+ str.forEach((item, index) => {
985
+ // 此处添加url跳转参数保存逻辑
986
+ if (
987
+ this.jumpParamKey &&
988
+ this.isHaveJumpUrl &&
989
+ this.modelName == 'data.' + con['target'][0]
990
+ ) {
991
+ val += `${item[con.from]}¯${this.jumpParamKey}:${
992
+ this.selectOrgs[index][this.jumpParamKey]
993
+ },`
994
+ } else {
995
+ val += item[con.from] + ','
996
+ }
830
997
  })
831
998
  if (this.modelName == 'data.' + con['target'][0]) {
832
999
  utils.setValueByPath(
@@ -911,19 +1078,46 @@
911
1078
  pageBean.pageBean = { page: 1, pageSize: 10, showTotal: true }
912
1079
  }
913
1080
  //用户输入的
1081
+ let flag = false
914
1082
  if (this.queryParams.length != 0 && this.queryParams[0] != '') {
915
1083
  this.conditionBind.forEach((item, index) => {
1084
+ // 日期范围特殊处理
1085
+ if (item.dbType == 'date' && item.condition == 'BETWEEN') {
1086
+ if (
1087
+ (this.queryParams[index].startDate &&
1088
+ !this.queryParams[index].endDate) ||
1089
+ (!this.queryParams[index].startDate &&
1090
+ this.queryParams[index].endDate)
1091
+ ) {
1092
+ flag = true
1093
+ this.$message.info('日期范围未填写完整!')
1094
+ return
1095
+ }
1096
+ if (
1097
+ this.queryParams[index].startDate &&
1098
+ this.queryParams[index].endDate
1099
+ ) {
1100
+ this.queryParams[index][
1101
+ item.field
1102
+ ] = `${this.queryParams[index].startDate},${this.queryParams[index].endDate}`
1103
+ } else {
1104
+ this.queryParams[index][item.field] = ''
1105
+ }
1106
+ }
916
1107
  if (this.queryParams[index][item.field]) {
917
1108
  querys.push({
918
1109
  property: item.field,
919
1110
  value: this.queryParams[index][item.field],
920
1111
  group: 'main',
921
- operation: 'LIKE',
1112
+ operation: item.condition,
922
1113
  relation: 'AND',
923
1114
  })
924
1115
  }
925
1116
  })
926
1117
  }
1118
+ if (flag) {
1119
+ return
1120
+ }
927
1121
  //参数传入的查询拼接
928
1122
  if (this.param) {
929
1123
  this.param.forEach((item) => {
@@ -989,13 +1183,22 @@
989
1183
  queryParamMap.total = pageBean.pageBean.total
990
1184
  // 添加用户id 岗位id 组织id
991
1185
  try {
992
- if (this.$requestConfig.getUserId()) {
1186
+ if (
1187
+ this.$requestConfig.getUserId &&
1188
+ this.$requestConfig.getUserId()
1189
+ ) {
993
1190
  ctx.userId = this.$requestConfig.getUserId()
994
1191
  }
995
- if (this.$requestConfig.getOrgId()) {
1192
+ if (
1193
+ this.$requestConfig.getOrgId &&
1194
+ this.$requestConfig.getOrgId()
1195
+ ) {
996
1196
  ctx.orgId = this.$requestConfig.getOrgId()
997
1197
  }
998
- if (this.$requestConfig.getPostId()) {
1198
+ if (
1199
+ this.$requestConfig.getPostId &&
1200
+ this.$requestConfig.getPostId()
1201
+ ) {
999
1202
  ctx.postId = this.$requestConfig.getPostId()
1000
1203
  }
1001
1204
  } catch (e) {
@@ -1020,12 +1223,14 @@
1020
1223
  value: queryParamMap[bindKey] || ctx[bindKey] || '',
1021
1224
  }
1022
1225
  })
1023
- param.querys = queryList
1226
+ param.querys = queryList || []
1024
1227
  if (this.customDialog.needPage) {
1025
1228
  param.pageBean = obj
1026
1229
  } else {
1027
1230
  param.pageBean.pageSize = -1
1028
1231
  }
1232
+ // 日期格式的 改成数组
1233
+ // this.changeDateFormat(param)
1029
1234
  //构造请求的参数
1030
1235
  let requestParam = {
1031
1236
  pageBean: param,
@@ -1038,6 +1243,7 @@
1038
1243
  totalKey: this.customDialog.totalKey,
1039
1244
  }
1040
1245
  this.getDialoglistJson(requestParam).then(() => {
1246
+ this.initTableHeight()
1041
1247
  this.checkList()
1042
1248
  })
1043
1249
  } catch (e) {
@@ -1051,17 +1257,34 @@
1051
1257
  })
1052
1258
  this.customDialog.pageBean = queryFilter
1053
1259
  this.getDialoglistJson(this.customDialog).then(() => {
1260
+ this.initTableHeight()
1054
1261
  this.checkList()
1055
1262
  })
1056
1263
  } else {
1057
1264
  this.customDialog.pageBean = pageBean
1058
1265
  this.getDialoglistJson(this.customDialog).then(() => {
1266
+ this.initTableHeight()
1059
1267
  this.checkList()
1060
1268
  })
1061
1269
  }
1062
1270
  }
1063
1271
  this.tableRadioVal = ''
1064
1272
  },
1273
+ changeDateFormat(param) {
1274
+ let dateValidate1 = /^\d{4}\-\d{2}\-\d{2}$/
1275
+ 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$/
1276
+ Object.keys(param).forEach((key) => {
1277
+ if (
1278
+ param[key] &&
1279
+ typeof param[key] == 'string' &&
1280
+ param[key].includes(',') &&
1281
+ (dateValidate1.test(param[key].split(',')[0]) ||
1282
+ dateValidate2.test(param[key].split(',')[0]))
1283
+ ) {
1284
+ param[key] = param[key].split(',')
1285
+ }
1286
+ })
1287
+ },
1065
1288
  getSearchValueByKey() {
1066
1289
  let queryParamsObj = {}
1067
1290
  if (this.queryParams.length > 0) {
@@ -1316,6 +1539,8 @@
1316
1539
  },
1317
1540
  // 同步选择结果
1318
1541
  syncInputValue() {
1542
+ // 对话框跳转url需要两个参数 1当前控件绑定的对象参数modelName 2对话框配置中配置的key名称
1543
+ // 同步值时,如果有绑定url跳转参数,值格式为 名称¯跳转key:跳转value
1319
1544
  let thisIndex = null //当前数据所在下标
1320
1545
  let parentIndex = null //父节点所在下标
1321
1546
  if (this.$parent.$el) {
@@ -1403,13 +1628,33 @@
1403
1628
  }
1404
1629
  }
1405
1630
  }
1631
+ // 如果是查询中使用的对话框
1632
+ if (this.dialogType == 'search') {
1633
+ let returnVal = []
1634
+ str.forEach((item) => {
1635
+ returnVal.push(decodeURIComponent(item[this.modelName]))
1636
+ })
1637
+ this.$emit('updateInput', returnVal.join(','))
1638
+ return
1639
+ }
1406
1640
  const pInst = utils.getOnlineFormInstance(this)
1407
1641
  this.custdialog.custDialog.mappingConf.forEach((con) => {
1408
1642
  var val = ''
1409
1643
  var from = con.from.toLowerCase()
1410
1644
  str.forEach((item) => {
1645
+ // 如果有绑定url跳转参数 需获取跳转参数的key
1411
1646
  if (item) {
1412
- val += decodeURIComponent(item[from]) + ','
1647
+ if (
1648
+ this.jumpParamKey &&
1649
+ this.isHaveJumpUrl &&
1650
+ this.modelName == 'data.' + con['target'][0]
1651
+ ) {
1652
+ val += `${decodeURIComponent(item[from])}¯${
1653
+ this.jumpParamKey
1654
+ }:${item[this.jumpParamKey]},`
1655
+ } else {
1656
+ val += decodeURIComponent(item[from]) + ','
1657
+ }
1413
1658
  }
1414
1659
  })
1415
1660
  if (this.modelName == 'data.' + con['target'][0]) {
@@ -1450,7 +1695,6 @@
1450
1695
  const _val = val.substring(0, val.length - 1)
1451
1696
  if (path) {
1452
1697
  if (this.modelName && this.modelName.endsWith(path)) {
1453
- // this.$emit('input', _val)
1454
1698
  this.$emit('updateInput', _val)
1455
1699
  }
1456
1700
  utils.setValueByPath(
@@ -1880,5 +2124,6 @@
1880
2124
  }
1881
2125
  .custom-dialog_main {
1882
2126
  min-height: 350px;
2127
+ padding: 0 20px !important;
1883
2128
  }
1884
2129
  </style>