doway-coms 2.7.7 → 2.7.8

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 (87) hide show
  1. package/.browserslistrc +2 -2
  2. package/README.md +28 -28
  3. package/package.json +54 -54
  4. package/packages/AuditsList/index.js +7 -7
  5. package/packages/AuditsList/src/index.vue +266 -266
  6. package/packages/BaseButton/index.js +7 -7
  7. package/packages/BaseButton/src/index.vue +241 -241
  8. package/packages/BaseCheckbox/index.js +7 -7
  9. package/packages/BaseCheckbox/src/index.vue +134 -134
  10. package/packages/BaseDate/index.js +7 -7
  11. package/packages/BaseDate/src/index.vue +197 -197
  12. package/packages/BaseDateMonth/index.js +7 -7
  13. package/packages/BaseDateMonth/src/index.vue +163 -163
  14. package/packages/BaseDateWeek/index.js +7 -7
  15. package/packages/BaseDateWeek/src/index.vue +163 -163
  16. package/packages/BaseDatetime/index.js +7 -7
  17. package/packages/BaseDatetime/src/index.vue +196 -196
  18. package/packages/BaseFileGroup/index.js +7 -7
  19. package/packages/BaseFileGroup/src/index.vue +724 -724
  20. package/packages/BaseForm/index.js +7 -7
  21. package/packages/BaseForm/src/index.vue +752 -752
  22. package/packages/BaseGantt/index.js +9 -9
  23. package/packages/BaseGantt/src/index.vue +617 -617
  24. package/packages/BaseGrid/index.js +9 -9
  25. package/packages/BaseGrid/src/SeqSetting.vue +278 -278
  26. package/packages/BaseGrid/src/index.vue +3738 -3734
  27. package/packages/BaseGridAdjust/index.js +9 -9
  28. package/packages/BaseGridAdjust/src/index.vue +482 -482
  29. package/packages/BaseInput/index.js +7 -7
  30. package/packages/BaseInput/src/index.vue +164 -164
  31. package/packages/BaseIntervalInput/index.js +7 -7
  32. package/packages/BaseIntervalInput/src/index.vue +310 -310
  33. package/packages/BaseKanbanEmpty/index.js +7 -7
  34. package/packages/BaseKanbanEmpty/src/index.vue +176 -176
  35. package/packages/BaseNumberInput/index.js +7 -7
  36. package/packages/BaseNumberInput/src/index.vue +290 -290
  37. package/packages/BasePagination/index.js +7 -7
  38. package/packages/BasePagination/src/index.vue +91 -91
  39. package/packages/BasePictureCard/index.js +7 -7
  40. package/packages/BasePictureCard/src/index.vue +580 -580
  41. package/packages/BasePrintPreview/index.js +7 -7
  42. package/packages/BasePrintPreview/src/index.vue +129 -129
  43. package/packages/BasePulldown/index.js +7 -7
  44. package/packages/BasePulldown/src/index.vue +1346 -1346
  45. package/packages/BaseSearch/index.js +7 -7
  46. package/packages/BaseSearch/src/index.vue +935 -935
  47. package/packages/BaseSelect/index.js +7 -7
  48. package/packages/BaseSelect/src/index.vue +155 -155
  49. package/packages/BaseSelectMulti/index.js +7 -7
  50. package/packages/BaseSelectMulti/src/index.vue +148 -148
  51. package/packages/BaseTextArea/index.js +7 -7
  52. package/packages/BaseTextArea/src/index.vue +178 -178
  53. package/packages/BaseTime/index.js +7 -7
  54. package/packages/BaseTime/src/index.vue +166 -166
  55. package/packages/BaseTool/index.js +7 -7
  56. package/packages/BaseTool/src/index.vue +349 -349
  57. package/packages/BaseToolStatus/index.js +7 -7
  58. package/packages/BaseToolStatus/src/ApprovalPersonsGroup.vue +41 -41
  59. package/packages/BaseToolStatus/src/index.vue +439 -439
  60. package/packages/BaseTreeSelect/index.js +8 -8
  61. package/packages/BaseTreeSelect/src/index.vue +437 -437
  62. package/packages/LeaveAMessage/index.js +7 -7
  63. package/packages/LeaveAMessage/src/index.vue +601 -601
  64. package/packages/index.js +194 -194
  65. package/packages/styles/default.css +78 -78
  66. package/packages/styles/default.less +91 -91
  67. package/packages/utils/api.js +107 -107
  68. package/packages/utils/auth.js +38 -38
  69. package/packages/utils/common.js +635 -635
  70. package/packages/utils/dom.js +181 -181
  71. package/packages/utils/enum.js +86 -86
  72. package/packages/utils/filters.js +485 -485
  73. package/packages/utils/gridFormat.js +66 -66
  74. package/packages/utils/msg.js +84 -84
  75. package/packages/utils/patchFiles.js +44 -44
  76. package/packages/utils/request.js +178 -178
  77. package/packages/utils/store.js +314 -314
  78. package/vue.config.js +59 -59
  79. package/dist/css/chunk-vendors.7f83d8f9.css +0 -8
  80. package/dist/css/index.7946d50b.css +0 -1
  81. package/dist/favicon.ico +0 -0
  82. package/dist/js/chunk-vendors.28fda91d.js +0 -340
  83. package/dist/js/index.49bc6add.js +0 -2
  84. package/lib/doway-coms.common.js +0 -120397
  85. package/lib/doway-coms.css +0 -1
  86. package/lib/doway-coms.umd.js +0 -120407
  87. package/lib/doway-coms.umd.min.js +0 -328
@@ -1,437 +1,437 @@
1
- <template>
2
- <div class="d-control-container">
3
- <div
4
- class="d-control-label"
5
- v-if="showLabel === true"
6
- :style="{ width: labelWidth > 0 ? labelWidth + 'px' : 'none' }"
7
- >
8
- {{ label }}
9
- <span v-if="rules && rules['required']" class="d-control-label-required"
10
- >*</span
11
- >
12
- <Tooltip :title="tooltip" v-if="tooltip" style="margin: 0 2px">
13
- <img src="../../styles/icon/help.png" alt="" style="width: 14px" />
14
- </Tooltip>
15
- </div>
16
- <div class="d-control">
17
- <ValidationProvider
18
- v-if="edit === true"
19
- :name="label"
20
- v-slot="v"
21
- :rules="rules"
22
- >
23
- <TreeSelect
24
- ref="treeSelectView"
25
- v-model="currentValue"
26
- :treeData="treeData"
27
- :showSearch="showSearch"
28
- :replaceFields="replaceFields"
29
- :dropdownMatchSelectWidth="dropdownMatchSelectWidth"
30
- :treeDefaultExpandAll="treeDefaultExpandAll"
31
- :treeDefaultExpandedKeys="treeDefaultExpandedKeys"
32
- :filterTreeNode="filterTreeNode"
33
- @change="changeData"
34
- size="small"
35
- :allowClear="allowClear"
36
- @focus="searchData"
37
- @select="selectData"
38
- :dropdownStyle="{
39
- width: treeWidth + 'px',
40
- height: '300px',
41
- ...widthDropdownStyle,
42
- }"
43
- treeNodeFilterProp="title"
44
- :style="{
45
- width: '100%',
46
- }"
47
- :placeholder="placeholder"
48
- ></TreeSelect>
49
- <div class="d-error-msg">
50
- {{ v.errors[0] }}
51
- </div>
52
- </ValidationProvider>
53
-
54
- <span v-else>
55
- <a v-if="route" @click="routeLinkClick">{{ value }}</a>
56
- <span v-else> {{ value }}</span>
57
- </span>
58
- </div>
59
- </div>
60
- </template>
61
-
62
- <script>
63
- import { Tooltip, TreeSelect } from 'ant-design-vue'
64
- import request from '../../utils/request'
65
- import XEUtils from 'xe-utils'
66
- import { ValidationProvider } from 'vee-validate'
67
- export default {
68
- name: 'BaseTreeSelect',
69
- components: {
70
- Tooltip,
71
- TreeSelect,
72
- ValidationProvider,
73
- },
74
- props: {
75
- label: {
76
- type: String,
77
- },
78
- showLabel: {
79
- type: Boolean,
80
- default: function () {
81
- return true
82
- },
83
- },
84
- labelWidth: {
85
- type: Number,
86
- default: function () {
87
- return 100
88
- },
89
- },
90
- api: {
91
- type: String,
92
- required: true,
93
- },
94
- exps: {
95
- // 条件
96
- type: Array,
97
- default: () => {
98
- return []
99
- },
100
- },
101
- value: {
102
- type: String,
103
- default: function () {
104
- return ''
105
- },
106
- },
107
- tooltip: {
108
- type: String,
109
- default: function () {
110
- return ''
111
- },
112
- },
113
- customTitle: {
114
- type: Array,
115
- default: function () {
116
- return []
117
- },
118
- },
119
- // 输入框宽度
120
- width: {
121
- type: Number,
122
- default: function () {
123
- return 100
124
- },
125
- },
126
- // 树宽度
127
- treeWidth: {
128
- type: Number,
129
- default: function () {
130
- return 200
131
- },
132
- },
133
- // 输入框和选择器同宽
134
- dropdownMatchSelectWidth: {
135
- type: Boolean,
136
- default: function () {
137
- return false
138
- },
139
- },
140
- // 替换展示字段
141
- replaceFields: {
142
- type: Object,
143
- default: function () {
144
- return {
145
- children: 'children',
146
- title: 'title',
147
- key: 'key',
148
- value: 'value',
149
- }
150
- },
151
- },
152
- // 是否默认展开所有树节点
153
- treeDefaultExpandAll: {
154
- type: Boolean,
155
- default: function () {
156
- return false
157
- },
158
- },
159
- size: {
160
- type: String,
161
- default: function () {
162
- return 'small'
163
- },
164
- },
165
- // 下拉中显示搜索框
166
- showSearch: {
167
- type: Boolean,
168
- default: function () {
169
- return true
170
- },
171
- },
172
- // 下拉菜单的样式
173
- widthDropdownStyle: {
174
- type: Object,
175
- default: function () {
176
- return {}
177
- },
178
- },
179
- // 清除按钮
180
- allowClear: {
181
- type: Boolean,
182
- default: function () {
183
- return true
184
- },
185
- },
186
- placeholder: {
187
- type: String,
188
- default: function () {
189
- return ''
190
- },
191
- },
192
- rules: {
193
- type: Object,
194
- default: function () {
195
- return null
196
- },
197
- },
198
- formRow: {
199
- type: Object,
200
- default: function () {
201
- return {}
202
- },
203
- },
204
- row: {
205
- type: Object,
206
- default: function () {
207
- return {}
208
- },
209
- },
210
- edit: {
211
- type: Boolean,
212
- default: function () {
213
- return false
214
- },
215
- },
216
- field: {
217
- type: String,
218
- },
219
- columns: {
220
- // 列集合
221
- type: Array,
222
- default: () => {
223
- return []
224
- },
225
- },
226
- propTableData: {
227
- type: Array,
228
- default: function () {
229
- return []
230
- },
231
- },
232
- linkedField: {
233
- type: String,
234
- required: true,
235
- },
236
- linkedTitle: {
237
- type: [],
238
- default: function () {
239
- return []
240
- },
241
- },
242
- method: {
243
- type: String,
244
- default: function () {
245
- return 'post'
246
- },
247
- },
248
- route: Object,
249
- },
250
- data() {
251
- return {
252
- treeData: [],
253
- currentValue: '',
254
- treeDefaultExpandedKeys: [],
255
- }
256
- },
257
- mounted() {
258
- this.searchData()
259
- if (this.treeData.length) {
260
- this.currentValue = this.row[this.linkedField]
261
- } else {
262
- this.currentValue = this.value
263
- }
264
- },
265
- watch: {
266
- treeData(val) {
267
- if (this.treeData.length) {
268
- this.currentValue = this.row[this.linkedField]
269
- this.treeDefaultExpandedKeys = []
270
- this.treeDefaultExpandedKeys.push(this.currentValue)
271
- } else {
272
- this.currentValue = this.value
273
- }
274
- },
275
- edit(value) {
276
- // debugger
277
- if (value) {
278
- if (this.treeData.length) {
279
- this.currentValue = this.row[this.linkedField]
280
- } else {
281
- this.currentValue = this.value
282
- }
283
- }
284
- },
285
- },
286
- computed: {},
287
- methods: {
288
- /**
289
- * 查询数据
290
- */
291
- searchData() {
292
- let tempExp = {
293
- operator: 'or',
294
- expressions: [],
295
- }
296
-
297
- let postExpression = {
298
- field: this.field,
299
- expression: tempExp,
300
- extendParams: {},
301
- }
302
- let repeatRowInfo = {
303
- field: '',
304
- values: [],
305
- }
306
- //查询之前从外部组件构造其他的条件
307
- this.$emit('preSearch', postExpression, repeatRowInfo, this.row)
308
- let postData = {
309
- begin: 1,
310
- size: 0,
311
- expression: postExpression.expression,
312
- sorts: [],
313
- extendParams: postExpression.extendParams,
314
- }
315
- let tempApi = this.getPostApi(postData)
316
- let vm = this
317
- vm.gridLoading = true
318
- request({
319
- url: tempApi,
320
- method: this.method,
321
- data: postData,
322
- })
323
- .then((responseData) => {
324
- vm.treeData = responseData.content
325
- if (this.linkedTitle.length) {
326
- XEUtils.eachTree(vm.treeData, (item) => {
327
- let title = ''
328
- XEUtils.arrayEach(this.linkedTitle, (newTitle) => {
329
- title = title + item[newTitle] + '-'
330
- })
331
- item[this.replaceFields.title] = title.slice(0, -1)
332
- })
333
- }
334
- })
335
- .catch((error) => {
336
- console.error(error)
337
- })
338
- .finally(() => {
339
- vm.gridLoading = false
340
- })
341
- },
342
- getPostApi(postData) {
343
- let tempApi = this.api
344
- if (this.api.indexOf('?') > 0) {
345
- tempApi = this.api.substring(0, this.api.indexOf('?'))
346
- let tempExtenParams = this.api.substring(this.api.indexOf('?') + 1)
347
- tempExtenParams = replaceParam(tempExtenParams, this.formRow)
348
- let tempSplitParams = tempExtenParams.split('&')
349
- for (let i = 0; i < tempSplitParams.length; i++) {
350
- let tempSplitValue = tempSplitParams[i].split('=')
351
- this.$set(postData.extendParams, tempSplitValue[0], tempSplitValue[1])
352
- }
353
- }
354
- return tempApi
355
- },
356
- routeLinkClick() {
357
- //首先需要判断是否有权限
358
- this.$router.pushRoute({
359
- name: this.route.name,
360
- query: { id: this.row[this.route.field] },
361
- })
362
- },
363
- selectData(value, node) {
364
- // this.row[this.linkedField] = value
365
- // this.row[this.field] = node.title
366
- this.$set(this.row, this.linkedField, value)
367
- this.$set(this.row, this.field, node.title)
368
- this.$emit('selectChanged', this.row)
369
- },
370
- filterTreeNode(inputValue,treeNode){
371
- if(treeNode.data.props.dataRef.name.indexOf(inputValue)>-1){
372
- //存在inputValue则返回true,显示该节点
373
- return true;
374
- }
375
- //不存在inputValue则检查父节点是否包含inputValue
376
- let parentId = treeNode.data.props.dataRef.parentId;
377
- while(parentId){
378
- let parentNode = XEUtils.findTree(this.treeData, p=>p.id===parentId)
379
- if(parentNode){
380
- if(parentNode.item.name.indexOf(inputValue)>-1){
381
- return true
382
- }
383
- parentId = parentNode.item.parentId
384
- }else{
385
- break
386
- }
387
- }
388
- return false
389
- },
390
- changeData(value) {
391
- if (!value) {
392
- this.$set(this.row, this.linkedField, '')
393
- this.$set(this.row, this.field, '')
394
- this.$emit('selectChanged', this.row)
395
- }
396
- },
397
- },
398
- }
399
- </script>
400
-
401
- <style lang="scss" scoped>
402
- // ::v-deep .ant-select-tree-dropdown::-webkit-scrollbar {
403
- // width: 5px;
404
- // }
405
- // ::v-deep .ant-select-tree-dropdown::-webkit-scrollbar-thumb {
406
- // /*滚动条里面小方块*/
407
- // border-radius: 10px;
408
- // -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
409
- // background: #e5e5e5;
410
- // }
411
- // ::v-deep .ant-select-tree-dropdown::-webkit-scrollbar-track {
412
- // /*滚动条里面轨道*/
413
- // -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
414
- // border-radius: 10px;
415
- // background: #ffffff;
416
- // }
417
- .pulldown-grid {
418
- min-width: 600px;
419
- width: auto;
420
- height: 350px;
421
- background-color: #fff;
422
- box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.1);
423
- }
424
-
425
- .d-grid-control {
426
- height: 30px;
427
- }
428
- .interceptor-class {
429
- padding: 10px;
430
- ::v-deep .ant-btn {
431
- margin: 10px 10px 0;
432
- }
433
- }
434
- </style>
435
- <style lang="less">
436
- @import '../../styles/default.less';
437
- </style>
1
+ <template>
2
+ <div class="d-control-container">
3
+ <div
4
+ class="d-control-label"
5
+ v-if="showLabel === true"
6
+ :style="{ width: labelWidth > 0 ? labelWidth + 'px' : 'none' }"
7
+ >
8
+ {{ label }}
9
+ <span v-if="rules && rules['required']" class="d-control-label-required"
10
+ >*</span
11
+ >
12
+ <Tooltip :title="tooltip" v-if="tooltip" style="margin: 0 2px">
13
+ <img src="../../styles/icon/help.png" alt="" style="width: 14px" />
14
+ </Tooltip>
15
+ </div>
16
+ <div class="d-control">
17
+ <ValidationProvider
18
+ v-if="edit === true"
19
+ :name="label"
20
+ v-slot="v"
21
+ :rules="rules"
22
+ >
23
+ <TreeSelect
24
+ ref="treeSelectView"
25
+ v-model="currentValue"
26
+ :treeData="treeData"
27
+ :showSearch="showSearch"
28
+ :replaceFields="replaceFields"
29
+ :dropdownMatchSelectWidth="dropdownMatchSelectWidth"
30
+ :treeDefaultExpandAll="treeDefaultExpandAll"
31
+ :treeDefaultExpandedKeys="treeDefaultExpandedKeys"
32
+ :filterTreeNode="filterTreeNode"
33
+ @change="changeData"
34
+ size="small"
35
+ :allowClear="allowClear"
36
+ @focus="searchData"
37
+ @select="selectData"
38
+ :dropdownStyle="{
39
+ width: treeWidth + 'px',
40
+ height: '300px',
41
+ ...widthDropdownStyle,
42
+ }"
43
+ treeNodeFilterProp="title"
44
+ :style="{
45
+ width: '100%',
46
+ }"
47
+ :placeholder="placeholder"
48
+ ></TreeSelect>
49
+ <div class="d-error-msg">
50
+ {{ v.errors[0] }}
51
+ </div>
52
+ </ValidationProvider>
53
+
54
+ <span v-else>
55
+ <a v-if="route" @click="routeLinkClick">{{ value }}</a>
56
+ <span v-else> {{ value }}</span>
57
+ </span>
58
+ </div>
59
+ </div>
60
+ </template>
61
+
62
+ <script>
63
+ import { Tooltip, TreeSelect } from 'ant-design-vue'
64
+ import request from '../../utils/request'
65
+ import XEUtils from 'xe-utils'
66
+ import { ValidationProvider } from 'vee-validate'
67
+ export default {
68
+ name: 'BaseTreeSelect',
69
+ components: {
70
+ Tooltip,
71
+ TreeSelect,
72
+ ValidationProvider,
73
+ },
74
+ props: {
75
+ label: {
76
+ type: String,
77
+ },
78
+ showLabel: {
79
+ type: Boolean,
80
+ default: function () {
81
+ return true
82
+ },
83
+ },
84
+ labelWidth: {
85
+ type: Number,
86
+ default: function () {
87
+ return 100
88
+ },
89
+ },
90
+ api: {
91
+ type: String,
92
+ required: true,
93
+ },
94
+ exps: {
95
+ // 条件
96
+ type: Array,
97
+ default: () => {
98
+ return []
99
+ },
100
+ },
101
+ value: {
102
+ type: String,
103
+ default: function () {
104
+ return ''
105
+ },
106
+ },
107
+ tooltip: {
108
+ type: String,
109
+ default: function () {
110
+ return ''
111
+ },
112
+ },
113
+ customTitle: {
114
+ type: Array,
115
+ default: function () {
116
+ return []
117
+ },
118
+ },
119
+ // 输入框宽度
120
+ width: {
121
+ type: Number,
122
+ default: function () {
123
+ return 100
124
+ },
125
+ },
126
+ // 树宽度
127
+ treeWidth: {
128
+ type: Number,
129
+ default: function () {
130
+ return 200
131
+ },
132
+ },
133
+ // 输入框和选择器同宽
134
+ dropdownMatchSelectWidth: {
135
+ type: Boolean,
136
+ default: function () {
137
+ return false
138
+ },
139
+ },
140
+ // 替换展示字段
141
+ replaceFields: {
142
+ type: Object,
143
+ default: function () {
144
+ return {
145
+ children: 'children',
146
+ title: 'title',
147
+ key: 'key',
148
+ value: 'value',
149
+ }
150
+ },
151
+ },
152
+ // 是否默认展开所有树节点
153
+ treeDefaultExpandAll: {
154
+ type: Boolean,
155
+ default: function () {
156
+ return false
157
+ },
158
+ },
159
+ size: {
160
+ type: String,
161
+ default: function () {
162
+ return 'small'
163
+ },
164
+ },
165
+ // 下拉中显示搜索框
166
+ showSearch: {
167
+ type: Boolean,
168
+ default: function () {
169
+ return true
170
+ },
171
+ },
172
+ // 下拉菜单的样式
173
+ widthDropdownStyle: {
174
+ type: Object,
175
+ default: function () {
176
+ return {}
177
+ },
178
+ },
179
+ // 清除按钮
180
+ allowClear: {
181
+ type: Boolean,
182
+ default: function () {
183
+ return true
184
+ },
185
+ },
186
+ placeholder: {
187
+ type: String,
188
+ default: function () {
189
+ return ''
190
+ },
191
+ },
192
+ rules: {
193
+ type: Object,
194
+ default: function () {
195
+ return null
196
+ },
197
+ },
198
+ formRow: {
199
+ type: Object,
200
+ default: function () {
201
+ return {}
202
+ },
203
+ },
204
+ row: {
205
+ type: Object,
206
+ default: function () {
207
+ return {}
208
+ },
209
+ },
210
+ edit: {
211
+ type: Boolean,
212
+ default: function () {
213
+ return false
214
+ },
215
+ },
216
+ field: {
217
+ type: String,
218
+ },
219
+ columns: {
220
+ // 列集合
221
+ type: Array,
222
+ default: () => {
223
+ return []
224
+ },
225
+ },
226
+ propTableData: {
227
+ type: Array,
228
+ default: function () {
229
+ return []
230
+ },
231
+ },
232
+ linkedField: {
233
+ type: String,
234
+ required: true,
235
+ },
236
+ linkedTitle: {
237
+ type: [],
238
+ default: function () {
239
+ return []
240
+ },
241
+ },
242
+ method: {
243
+ type: String,
244
+ default: function () {
245
+ return 'post'
246
+ },
247
+ },
248
+ route: Object,
249
+ },
250
+ data() {
251
+ return {
252
+ treeData: [],
253
+ currentValue: '',
254
+ treeDefaultExpandedKeys: [],
255
+ }
256
+ },
257
+ mounted() {
258
+ this.searchData()
259
+ if (this.treeData.length) {
260
+ this.currentValue = this.row[this.linkedField]
261
+ } else {
262
+ this.currentValue = this.value
263
+ }
264
+ },
265
+ watch: {
266
+ treeData(val) {
267
+ if (this.treeData.length) {
268
+ this.currentValue = this.row[this.linkedField]
269
+ this.treeDefaultExpandedKeys = []
270
+ this.treeDefaultExpandedKeys.push(this.currentValue)
271
+ } else {
272
+ this.currentValue = this.value
273
+ }
274
+ },
275
+ edit(value) {
276
+ // debugger
277
+ if (value) {
278
+ if (this.treeData.length) {
279
+ this.currentValue = this.row[this.linkedField]
280
+ } else {
281
+ this.currentValue = this.value
282
+ }
283
+ }
284
+ },
285
+ },
286
+ computed: {},
287
+ methods: {
288
+ /**
289
+ * 查询数据
290
+ */
291
+ searchData() {
292
+ let tempExp = {
293
+ operator: 'or',
294
+ expressions: [],
295
+ }
296
+
297
+ let postExpression = {
298
+ field: this.field,
299
+ expression: tempExp,
300
+ extendParams: {},
301
+ }
302
+ let repeatRowInfo = {
303
+ field: '',
304
+ values: [],
305
+ }
306
+ //查询之前从外部组件构造其他的条件
307
+ this.$emit('preSearch', postExpression, repeatRowInfo, this.row)
308
+ let postData = {
309
+ begin: 1,
310
+ size: 0,
311
+ expression: postExpression.expression,
312
+ sorts: [],
313
+ extendParams: postExpression.extendParams,
314
+ }
315
+ let tempApi = this.getPostApi(postData)
316
+ let vm = this
317
+ vm.gridLoading = true
318
+ request({
319
+ url: tempApi,
320
+ method: this.method,
321
+ data: postData,
322
+ })
323
+ .then((responseData) => {
324
+ vm.treeData = responseData.content
325
+ if (this.linkedTitle.length) {
326
+ XEUtils.eachTree(vm.treeData, (item) => {
327
+ let title = ''
328
+ XEUtils.arrayEach(this.linkedTitle, (newTitle) => {
329
+ title = title + item[newTitle] + '-'
330
+ })
331
+ item[this.replaceFields.title] = title.slice(0, -1)
332
+ })
333
+ }
334
+ })
335
+ .catch((error) => {
336
+ console.error(error)
337
+ })
338
+ .finally(() => {
339
+ vm.gridLoading = false
340
+ })
341
+ },
342
+ getPostApi(postData) {
343
+ let tempApi = this.api
344
+ if (this.api.indexOf('?') > 0) {
345
+ tempApi = this.api.substring(0, this.api.indexOf('?'))
346
+ let tempExtenParams = this.api.substring(this.api.indexOf('?') + 1)
347
+ tempExtenParams = replaceParam(tempExtenParams, this.formRow)
348
+ let tempSplitParams = tempExtenParams.split('&')
349
+ for (let i = 0; i < tempSplitParams.length; i++) {
350
+ let tempSplitValue = tempSplitParams[i].split('=')
351
+ this.$set(postData.extendParams, tempSplitValue[0], tempSplitValue[1])
352
+ }
353
+ }
354
+ return tempApi
355
+ },
356
+ routeLinkClick() {
357
+ //首先需要判断是否有权限
358
+ this.$router.pushRoute({
359
+ name: this.route.name,
360
+ query: { id: this.row[this.route.field] },
361
+ })
362
+ },
363
+ selectData(value, node) {
364
+ // this.row[this.linkedField] = value
365
+ // this.row[this.field] = node.title
366
+ this.$set(this.row, this.linkedField, value)
367
+ this.$set(this.row, this.field, node.title)
368
+ this.$emit('selectChanged', this.row)
369
+ },
370
+ filterTreeNode(inputValue,treeNode){
371
+ if(treeNode.data.props.dataRef.name.indexOf(inputValue)>-1){
372
+ //存在inputValue则返回true,显示该节点
373
+ return true;
374
+ }
375
+ //不存在inputValue则检查父节点是否包含inputValue
376
+ let parentId = treeNode.data.props.dataRef.parentId;
377
+ while(parentId){
378
+ let parentNode = XEUtils.findTree(this.treeData, p=>p.id===parentId)
379
+ if(parentNode){
380
+ if(parentNode.item.name.indexOf(inputValue)>-1){
381
+ return true
382
+ }
383
+ parentId = parentNode.item.parentId
384
+ }else{
385
+ break
386
+ }
387
+ }
388
+ return false
389
+ },
390
+ changeData(value) {
391
+ if (!value) {
392
+ this.$set(this.row, this.linkedField, '')
393
+ this.$set(this.row, this.field, '')
394
+ this.$emit('selectChanged', this.row)
395
+ }
396
+ },
397
+ },
398
+ }
399
+ </script>
400
+
401
+ <style lang="scss" scoped>
402
+ // ::v-deep .ant-select-tree-dropdown::-webkit-scrollbar {
403
+ // width: 5px;
404
+ // }
405
+ // ::v-deep .ant-select-tree-dropdown::-webkit-scrollbar-thumb {
406
+ // /*滚动条里面小方块*/
407
+ // border-radius: 10px;
408
+ // -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
409
+ // background: #e5e5e5;
410
+ // }
411
+ // ::v-deep .ant-select-tree-dropdown::-webkit-scrollbar-track {
412
+ // /*滚动条里面轨道*/
413
+ // -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
414
+ // border-radius: 10px;
415
+ // background: #ffffff;
416
+ // }
417
+ .pulldown-grid {
418
+ min-width: 600px;
419
+ width: auto;
420
+ height: 350px;
421
+ background-color: #fff;
422
+ box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.1);
423
+ }
424
+
425
+ .d-grid-control {
426
+ height: 30px;
427
+ }
428
+ .interceptor-class {
429
+ padding: 10px;
430
+ ::v-deep .ant-btn {
431
+ margin: 10px 10px 0;
432
+ }
433
+ }
434
+ </style>
435
+ <style lang="less">
436
+ @import '../../styles/default.less';
437
+ </style>