vue2-client 1.2.51 → 1.2.54

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 (35) hide show
  1. package/.env +15 -14
  2. package/.eslintrc.js +82 -82
  3. package/CHANGELOG.md +5 -0
  4. package/package.json +1 -1
  5. package/src/base-client/all.js +64 -61
  6. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +225 -0
  7. package/src/base-client/components/common/AddressSearchCombobox/index.js +3 -0
  8. package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +111 -107
  9. package/src/base-client/components/common/CitySelect/CitySelect.vue +244 -0
  10. package/src/base-client/components/common/CitySelect/index.js +3 -0
  11. package/src/base-client/components/common/CitySelect/index.md +109 -0
  12. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +483 -1342
  13. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +770 -555
  14. package/src/base-client/components/common/Upload/Upload.vue +124 -124
  15. package/src/base-client/components/common/Upload/index.js +3 -3
  16. package/src/base-client/components/common/XAddForm/XAddForm.vue +38 -46
  17. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +316 -316
  18. package/src/base-client/components/common/XForm/XForm.vue +268 -275
  19. package/src/base-client/components/common/XForm/XFormItem.vue +348 -285
  20. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
  21. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +131 -131
  22. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +205 -205
  23. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  24. package/src/base-client/plugins/AppData.js +72 -57
  25. package/src/config/CreateQueryConfig.js +298 -80
  26. package/src/pages/resourceManage/orgListManage.vue +40 -40
  27. package/src/router/async/config.async.js +26 -26
  28. package/src/router/index.js +27 -27
  29. package/src/services/api/manage.js +16 -14
  30. package/src/services/api/restTools.js +24 -24
  31. package/src/theme/default/style.less +47 -47
  32. package/src/utils/map-utils.js +28 -29
  33. package/src/utils/request.js +198 -198
  34. package/src/utils/util.js +222 -176
  35. package/vue.config.js +2 -2
@@ -1,285 +1,348 @@
1
- <template>
2
- <!-- 综合筛选 -->
3
- <x-form-col
4
- :xl="xl"
5
- :xxl="xxl"
6
- v-if="attr.type === 'select' && attr.model === 'rowIdValue'">
7
- <a-form-model-item
8
- :ref="attr.model"
9
- :label="attr.name"
10
- :prop="attr.model">
11
- <a-input :disabled="disabled" v-model="form[attr.model]">
12
- <a-select
13
- slot="addonBefore"
14
- v-model="form['rowIdName']"
15
- style="width: 100px">
16
- <a-select-option
17
- v-for="(item,index) in attr.keys"
18
- :key="index"
19
- :value="Object.keys(item)[0]">{{ item[Object.keys(item)[0]] }}
20
- </a-select-option>
21
- </a-select>
22
- </a-input>
23
- </a-form-model-item>
24
- </x-form-col>
25
- <!-- 输入框 -->
26
- <x-form-col
27
- :xl="xl"
28
- :xxl="xxl"
29
- v-else-if="attr.type === 'input'">
30
- <a-form-model-item
31
- :ref="attr.model"
32
- :label="attr.name"
33
- :prop="attr.model">
34
- <a-input :disabled="disabled" v-model="form[attr.model]" :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"/>
35
- </a-form-model-item>
36
- </x-form-col>
37
- <!-- 下拉框 -->
38
- <x-form-col
39
- :xl="xl"
40
- :xxl="xxl"
41
- v-else-if="attr.type === 'select'">
42
- <a-form-model-item
43
- :ref="attr.model"
44
- :label="attr.name"
45
- :prop="attr.model">
46
- <a-select
47
- v-if="!attr.lazyLoad || attr.lazyLoad === 'false'"
48
- v-model="form[attr.model]"
49
- :disabled="disabled"
50
- show-search
51
- :placeholder="attr.placeholder ? attr.placeholder : '请选择'"
52
- :filter-option="filterOption"
53
- >
54
- <a-select-option
55
- v-if="mode === '查询'"
56
- key="999999"
57
- value="全部">全部
58
- </a-select-option>
59
- <template v-if="attr.keys">
60
- <a-select-option
61
- v-for="(item,index) in attr.keys"
62
- :key="index"
63
- :value="Object.keys(item)[0]">
64
- {{ item[Object.keys(item)[0]] }}
65
- </a-select-option>
66
- </template>
67
- <template v-else>
68
- <template v-if="attr.keyName.indexOf('logic@') !== -1">
69
- <a-select-option
70
- v-for="(item,index) in option"
71
- :key="index"
72
- :value="Object.keys(item)[0]">{{ item[Object.keys(item)[0]] }}
73
- </a-select-option>
74
- </template>
75
- <template v-else>
76
- <a-select-option
77
- v-for="item in $appdata.getDictionaryList(attr.keyName)"
78
- :key="item.value"
79
- :value="item.value">
80
- <!-- 徽标(badge) -->
81
- <x-badge :badge-key="attr.keyName" :value="item.value" :replaceText="item.text"/>
82
- </a-select-option>
83
- </template>
84
- </template>
85
- </a-select>
86
- <a-select
87
- v-else
88
- show-search
89
- v-model="form[attr.model]"
90
- :disabled="disabled"
91
- @search="fetchFunction"
92
- :placeholder="attr.placeholder ? attr.placeholder : '搜索' + attr.name"
93
- :filter-option="filterOption"
94
- >
95
- <a-spin v-if="searching" slot="notFoundContent" size="small" />
96
- <a-select-option
97
- v-if="mode === '查询'"
98
- key="999999"
99
- value="全部">全部
100
- </a-select-option>
101
- <a-select-option
102
- v-for="(item,index) in option"
103
- :key="index"
104
- :value="Object.keys(item)[0]">{{ item[Object.keys(item)[0]] }}
105
- </a-select-option>
106
- </a-select>
107
- </a-form-model-item>
108
- </x-form-col>
109
- <!-- TODO 多选框 -->
110
- <!-- TODO 单选框 -->
111
- <!-- 日期范围选择器 -->
112
- <x-form-col
113
- :xl="xl"
114
- :xxl="xxl"
115
- v-else-if="attr.type === 'rangePicker'">
116
- <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
117
- <a-range-picker :disabled="disabled" :show-time="true" v-model="form[attr.model]" valueFormat="YYYY-MM-DD HH:mm:ss"/>
118
- </a-form-model-item>
119
- </x-form-col>
120
- <!-- 月份选择器 -->
121
- <x-form-col
122
- :xl="xl"
123
- :xxl="xxl"
124
- v-else-if="attr.type === 'monthPicker'">
125
- <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
126
- <a-month-picker :disabled="disabled" :show-time="true" v-model="form[attr.model]" valueFormat="YYYY-MM"/>
127
- </a-form-model-item>
128
- </x-form-col>
129
- <!-- 日期选择器 -->
130
- <x-form-col
131
- :xl="xl"
132
- :xxl="xxl"
133
- v-else-if="attr.type === 'datePicker'">
134
- <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
135
- <a-date-picker :disabled="disabled" :show-time="true" v-model="form[attr.model]" valueFormat="YYYY-MM-DD"/>
136
- </a-form-model-item>
137
- </x-form-col>
138
- <!-- 级联选择器 -->
139
- <x-form-col
140
- :xl="xl"
141
- :xxl="xxl"
142
- v-else-if="attr.type === 'cascader'">
143
- <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
144
- <template v-if="attr.keys">
145
- <a-dcascader :disabled="disabled" :option="attr.keys" :value="form[attr.model]"/>
146
- </template>
147
- <template v-else>
148
- <a-dcascader :disabled="disabled" :option="option" :value="form[attr.model]"/>
149
- </template>
150
- </a-form-model-item>
151
- </x-form-col>
152
- <!-- 文本域 -->
153
- <x-form-col
154
- :xl="24"
155
- :xxl="24"
156
- :xs="24"
157
- :sm="24"
158
- :md="24"
159
- :lg="24"
160
- v-else-if="attr.type === 'textarea'">
161
- <a-form-model-item
162
- :ref="attr.model"
163
- :label="attr.name"
164
- :prop="attr.model">
165
- <a-textarea :rows="4" :disabled="disabled" v-model="form[attr.model]" :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"/>
166
- </a-form-model-item>
167
- </x-form-col>
168
- <!-- TODO 文件上传 -->
169
- <x-form-col
170
- :xl="24"
171
- :xxl="24"
172
- :xs="24"
173
- :sm="24"
174
- :md="24"
175
- :lg="24"
176
- v-else-if="attr.type === 'file' || attr.type === 'image'">
177
- <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
178
- <upload :model="attr" @setFiles="setFiles"></upload>
179
- </a-form-model-item>
180
- </x-form-col>
181
- </template>
182
- <script>
183
-
184
- import { post } from '@vue2-client/services/api'
185
- import { debounce } from 'ant-design-vue/lib/vc-table/src/utils'
186
-
187
- export default {
188
- name: 'XFormItem',
189
- data () {
190
- // 检索去抖
191
- this.fetchFunction = debounce(this.fetchFunction, 800)
192
- return {
193
- option: [],
194
- // 最后检索版本
195
- lastFetchId: 0,
196
- // 检索中
197
- searching: false
198
- }
199
- },
200
- props: {
201
- attr: {
202
- type: Object,
203
- default: () => {
204
- return {}
205
- }
206
- },
207
- form: {
208
- type: Object,
209
- default: () => {
210
- return {}
211
- }
212
- },
213
- disabled: {
214
- type: Boolean,
215
- default: () => {
216
- return false
217
- }
218
- },
219
- mode: {
220
- type: String,
221
- default: () => {
222
- return '查询'
223
- }
224
- },
225
- xl: {
226
- type: Number,
227
- default: undefined
228
- },
229
- xxl: {
230
- type: Number,
231
- default: undefined
232
- }
233
- },
234
- created () {
235
- if (this.attr.keyName && this.attr.keyName.indexOf('logic@') !== -1) {
236
- this.getData({}, res => {
237
- this.option = res
238
- })
239
- }
240
- },
241
- methods: {
242
- // 文件框时设置上传组件的值
243
- setFiles (fileIds) {
244
- this.form[this.attr.model] = fileIds
245
- },
246
- // 懒加载检索方法
247
- fetchFunction (value) {
248
- this.lastFetchId += 1
249
- const fetchId = this.lastFetchId
250
- this.option = []
251
- this.searching = true
252
- this.getData({
253
- word: value
254
- }, res => {
255
- if (fetchId !== this.lastFetchId) {
256
- return
257
- }
258
- this.option = res
259
- this.searching = false
260
- })
261
- },
262
- // 获取数据
263
- getData (value, callback) {
264
- if (value !== '') {
265
- const logicName = this.attr.keyName
266
- const logic = logicName.substring(6)
267
- post('/webmeterapi/' + logic, value).then(res => {
268
- callback(res)
269
- })
270
- }
271
- },
272
- filterOption (input, option) {
273
- if (option.componentOptions.children[0].text) {
274
- return (
275
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
276
- )
277
- } else {
278
- return (
279
- option.componentOptions.children[0].child.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
280
- )
281
- }
282
- }
283
- }
284
- }
285
- </script>
1
+ <template>
2
+ <!-- 综合筛选 -->
3
+ <x-form-col
4
+ v-if="attr.type === 'select' && attr.model === 'rowIdValue'"
5
+ :xl="xl"
6
+ :xxl="xxl">
7
+ <a-form-model-item
8
+ :ref="attr.model"
9
+ :label="attr.name"
10
+ :prop="attr.model">
11
+ <a-input v-model="form[attr.model]" :disabled="disabled">
12
+ <a-select
13
+ slot="addonBefore"
14
+ :getPopupContainer=" triggerNode => { return triggerNode.parentNode } "
15
+ v-model="form['rowIdName']"
16
+ style="width: 100px">
17
+ <a-select-option
18
+ v-for="(item,index) in attr.keys"
19
+ :key="index"
20
+ :value="Object.keys(item)[0]">{{ item[Object.keys(item)[0]] }}
21
+ </a-select-option>
22
+ </a-select>
23
+ </a-input>
24
+ </a-form-model-item>
25
+ </x-form-col>
26
+ <!-- 输入框 -->
27
+ <x-form-col
28
+ v-else-if="attr.type === 'input'"
29
+ :xl="xl"
30
+ :xxl="xxl">
31
+ <a-form-model-item
32
+ :ref="attr.model"
33
+ :label="attr.name"
34
+ :prop="attr.model">
35
+ <a-input v-model="form[attr.model]" :disabled="disabled" :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"/>
36
+ </a-form-model-item>
37
+ </x-form-col>
38
+ <!-- 下拉框 -->
39
+ <x-form-col
40
+ v-else-if="attr.type === 'select'"
41
+ :xl="xl"
42
+ :xxl="xxl">
43
+ <a-form-model-item
44
+ :ref="attr.model"
45
+ :label="attr.name"
46
+ :prop="attr.model">
47
+ <a-select
48
+ :getPopupContainer=" triggerNode => { return triggerNode.parentNode } "
49
+ v-if="!attr.lazyLoad || attr.lazyLoad === 'false'"
50
+ v-model="form[attr.model]"
51
+ :disabled="disabled"
52
+ :filter-option="filterOption"
53
+ :placeholder="attr.placeholder ? attr.placeholder : '请选择'"
54
+ show-search
55
+ >
56
+ <a-select-option
57
+ v-if="mode === '查询'"
58
+ key="999999"
59
+ value="全部">全部
60
+ </a-select-option>
61
+ <template v-if="attr.keys">
62
+ <a-select-option
63
+ v-for="(item,index) in attr.keys"
64
+ :key="index"
65
+ :value="Object.keys(item)[0]">
66
+ {{ item[Object.keys(item)[0]] }}
67
+ </a-select-option>
68
+ </template>
69
+ <template v-else>
70
+ <template v-if="attr.keyName.indexOf('logic@') !== -1">
71
+ <a-select-option
72
+ v-for="(item,index) in option"
73
+ :key="index"
74
+ :value="Object.keys(item)[0]">{{ item[Object.keys(item)[0]] }}
75
+ </a-select-option>
76
+ </template>
77
+ <template v-else>
78
+ <a-select-option
79
+ v-for="item in $appdata.getDictionaryList(attr.keyName)"
80
+ :key="item.value"
81
+ :value="item.value">
82
+ <!-- 徽标(badge) -->
83
+ <x-badge :badge-key="attr.keyName" :replaceText="item.text" :value="item.value"/>
84
+ </a-select-option>
85
+ </template>
86
+ </template>
87
+ </a-select>
88
+ <a-select
89
+ v-else
90
+ v-model="form[attr.model]"
91
+ :disabled="disabled"
92
+ :filter-option="filterOption"
93
+ :placeholder="attr.placeholder ? attr.placeholder : '搜索' + attr.name"
94
+ :getPopupContainer=" triggerNode => { return triggerNode.parentNode } "
95
+ show-search
96
+ @search="fetchFunction"
97
+ >
98
+ <a-spin v-if="searching" slot="notFoundContent" size="small" />
99
+ <a-select-option
100
+ v-if="mode === '查询'"
101
+ key="999999"
102
+ value="全部">全部
103
+ </a-select-option>
104
+ <a-select-option
105
+ v-for="(item,index) in option"
106
+ :key="index"
107
+ :value="Object.keys(item)[0]">{{ item[Object.keys(item)[0]] }}
108
+ </a-select-option>
109
+ </a-select>
110
+ </a-form-model-item>
111
+ </x-form-col>
112
+ <!-- 级联下拉框 -->
113
+ <x-form-col
114
+ :xl="xl"
115
+ :xxl="xxl"
116
+ v-else-if="attr.type === 'selects'">
117
+ <a-form-model-item
118
+ :ref="attr.model"
119
+ :label="attr.name"
120
+ :prop="attr.model">
121
+ <a-select
122
+ v-if="!attr.lazyLoad || attr.lazyLoad === 'false'"
123
+ v-model="form[attr.model]"
124
+ :disabled="disabled || !selectsArray[attr.group] || !selectsArray[attr.group][attr.groupIndex] || (selectsArray[attr.group][attr.groupIndex] && selectsArray[attr.group][attr.groupIndex].length === 0)"
125
+ @change="selectsItemCheck(attr.group, attr.groupIndex, form[attr.model])"
126
+ show-search
127
+ :getPopupContainer=" triggerNode => { return triggerNode.parentNode } "
128
+ :placeholder="attr.placeholder ? attr.placeholder : '请选择'"
129
+ >
130
+ <template v-for="optionItem in selectsArray[attr.group][attr.groupIndex]" v-if="selectsArray[attr.group].length > 0 || selectsArray[attr.group][attr.groupIndex]">
131
+ <a-select-option :key="optionItem.label" :value="optionItem.value">
132
+ {{ optionItem.label }}
133
+ </a-select-option>
134
+ </template>
135
+ </a-select>
136
+ </a-form-model-item>
137
+ </x-form-col>
138
+ <!-- TODO 多选框 -->
139
+ <!-- TODO 单选框 -->
140
+ <!-- 日期范围选择器 -->
141
+ <x-form-col
142
+ v-else-if="attr.type === 'rangePicker'"
143
+ :xl="xl"
144
+ :xxl="xxl">
145
+ <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
146
+ <a-range-picker v-model="form[attr.model]" :disabled="disabled" :show-time="true" valueFormat="YYYY-MM-DD HH:mm:ss"/>
147
+ </a-form-model-item>
148
+ </x-form-col>
149
+ <!-- 月份选择器 -->
150
+ <x-form-col
151
+ v-else-if="attr.type === 'monthPicker'"
152
+ :xl="xl"
153
+ :xxl="xxl">
154
+ <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
155
+ <a-month-picker v-model="form[attr.model]" :disabled="disabled" :show-time="true" valueFormat="YYYY-MM"/>
156
+ </a-form-model-item>
157
+ </x-form-col>
158
+ <!-- 日期选择器 -->
159
+ <x-form-col
160
+ v-else-if="attr.type === 'datePicker'"
161
+ :xl="xl"
162
+ :xxl="xxl">
163
+ <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
164
+ <a-date-picker v-model="form[attr.model]" :disabled="disabled" :show-time="true" valueFormat="YYYY-MM-DD"/>
165
+ </a-form-model-item>
166
+ </x-form-col>
167
+ <!-- 级联选择器 -->
168
+ <x-form-col
169
+ v-else-if="attr.type === 'cascader'"
170
+ :xl="xl"
171
+ :xxl="xxl">
172
+ <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
173
+ <template v-if="attr.keys">
174
+ <a-dcascader :disabled="disabled" :option="attr.keys" :value="form[attr.model]"/>
175
+ </template>
176
+ <template v-else>
177
+ <a-dcascader :disabled="disabled" :option="option" :value="form[attr.model]"/>
178
+ </template>
179
+ </a-form-model-item>
180
+ </x-form-col>
181
+ <!-- 文本域 -->
182
+ <x-form-col
183
+ v-else-if="attr.type === 'textarea'"
184
+ :lg="24"
185
+ :md="24"
186
+ :sm="24"
187
+ :xl="24"
188
+ :xs="24"
189
+ :xxl="24">
190
+ <a-form-model-item
191
+ :ref="attr.model"
192
+ :label="attr.name"
193
+ :prop="attr.model">
194
+ <a-textarea v-model="form[attr.model]" :disabled="disabled" :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')" :rows="4"/>
195
+ </a-form-model-item>
196
+ </x-form-col>
197
+ <!-- TODO 文件上传 -->
198
+ <x-form-col
199
+ v-else-if="attr.type === 'file' || attr.type === 'image'"
200
+ :lg="24"
201
+ :md="24"
202
+ :sm="24"
203
+ :xl="24"
204
+ :xs="24"
205
+ :xxl="24">
206
+ <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
207
+ <upload :model="attr" @setFiles="setFiles"></upload>
208
+ </a-form-model-item>
209
+ </x-form-col>
210
+ <!-- TODO 地点搜索框 -->
211
+ <x-form-col
212
+ v-else-if="attr.type === 'addressSearch'"
213
+ :xl="xl"
214
+ :xxl="xxl">
215
+ <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
216
+ <address-search-combobox
217
+ v-model="searchResult"
218
+ searchResultType="Object"
219
+ @onSelect="form=Object.assign(form,JSON.parse(searchResult))"
220
+ :resultKeys="{ address: attr.model, coords: `${attr.model}_coords` }"
221
+ ></address-search-combobox>
222
+ </a-form-model-item>
223
+ </x-form-col>
224
+ <!-- TODO 省市区选择框 -->
225
+ <x-form-col
226
+ v-else-if="attr.type === 'citySelect'"
227
+ :xl="xl"
228
+ :xxl="xxl">
229
+ <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
230
+ <citySelect v-model="form[attr.model]" ></citySelect>
231
+ </a-form-model-item>
232
+ </x-form-col>
233
+ </template>
234
+ <script>
235
+
236
+ import { post } from '@vue2-client/services/api'
237
+ import { debounce } from 'ant-design-vue/lib/vc-table/src/utils'
238
+ import AddressSearchCombobox from '@/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox'
239
+
240
+ export default {
241
+ name: 'XFormItem',
242
+ components: { AddressSearchCombobox },
243
+ data () {
244
+ // 检索去抖
245
+ this.fetchFunction = debounce(this.fetchFunction, 800)
246
+ return {
247
+ option: [],
248
+ // 最后检索版本
249
+ lastFetchId: 0,
250
+ // 检索中
251
+ searching: false,
252
+ searchResult: ''
253
+ }
254
+ },
255
+ props: {
256
+ attr: {
257
+ type: Object,
258
+ default: () => {
259
+ return {}
260
+ }
261
+ },
262
+ form: {
263
+ type: Object,
264
+ required: true
265
+ },
266
+ disabled: {
267
+ type: Boolean,
268
+ default: () => {
269
+ return false
270
+ }
271
+ },
272
+ mode: {
273
+ type: String,
274
+ default: () => {
275
+ return '查询'
276
+ }
277
+ },
278
+ xl: {
279
+ type: Number,
280
+ default: undefined
281
+ },
282
+ xxl: {
283
+ type: Number,
284
+ default: undefined
285
+ },
286
+ selectsArray: {
287
+ type: Object,
288
+ default: () => {
289
+ return {}
290
+ }
291
+ }
292
+ },
293
+ created () {
294
+ if (this.attr.keyName && this.attr.keyName.indexOf('logic@') !== -1) {
295
+ this.getData({}, res => {
296
+ this.option = res
297
+ })
298
+ }
299
+ },
300
+ methods: {
301
+ // 向父组件获取级联框的数据
302
+ selectsItemCheck (groupName, index, value) {
303
+ this.$emit('selectsItemCheck', val => { this.selectsArray = val }, groupName, index, value)
304
+ },
305
+ // 文件框时设置上传组件的值
306
+ setFiles (fileIds) {
307
+ this.form[this.attr.model] = fileIds
308
+ },
309
+ // 懒加载检索方法
310
+ fetchFunction (value) {
311
+ this.lastFetchId += 1
312
+ const fetchId = this.lastFetchId
313
+ this.option = []
314
+ this.searching = true
315
+ this.getData({
316
+ word: value
317
+ }, res => {
318
+ if (fetchId !== this.lastFetchId) {
319
+ return
320
+ }
321
+ this.option = res
322
+ this.searching = false
323
+ })
324
+ },
325
+ // 获取数据
326
+ getData (value, callback) {
327
+ if (value !== '') {
328
+ const logicName = this.attr.keyName
329
+ const logic = logicName.substring(6)
330
+ post('/webmeterapi/' + logic, value).then(res => {
331
+ callback(res)
332
+ })
333
+ }
334
+ },
335
+ filterOption (input, option) {
336
+ if (option.componentOptions.children[0].text) {
337
+ return (
338
+ option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
339
+ )
340
+ } else {
341
+ return (
342
+ option.componentOptions.children[0].child.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
343
+ )
344
+ }
345
+ }
346
+ }
347
+ }
348
+ </script>