@xuekl/cli-components 1.8.0 → 1.9.145

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.
package/XklFormInfo.vue CHANGED
@@ -1,12 +1,13 @@
1
1
  <template>
2
- <el-form class="xkl-form-info" :class="{ 'force-align-left': opts.forceAlignLeft }" ref="XklFormInfoRef" :model="form"
3
- :label-width="opts.labelWidth">
2
+ <el-form class="xkl-form-info" :class="{ 'force-align-left': opts.forceAlignLeft }" ref="XklFormInfoRef"
3
+ :model="form" :label-width="opts.labelWidth">
4
4
  <el-row>
5
5
  <template v-for="item in formList" :key="item.prop">
6
6
  <el-col :span="item.span" v-if="item.show()">
7
- <el-form-item :label="item.label + ':'" :label-width="item.labelWidth">
8
- <span v-if="item.type === 'dict-select'">{{ dictLabel(item.config.dict, form[item.prop]) }}</span>
9
- <span v-else-if="item.type">{{ form[item.reflect] || form[item.prop] }}</span>
7
+ <el-form-item :label="item.label ? item.label + ':' : ''" :label-width="item.labelWidth">
8
+ <span v-if="item.type === 'dict-select'">{{ dictLabel(item.config.dict, form[item.prop])
9
+ }}</span>
10
+ <span v-else-if="item.type">{{ reflect(form[item.reflect]) || form[item.prop] }}</span>
10
11
  <slot v-else :name="item.prop"></slot>
11
12
  </el-form-item>
12
13
  </el-col>
@@ -25,7 +26,8 @@ import http from "@/utils/httpRequest"
25
26
  import { baseConf } from './index'
26
27
  import { setUpperFirst } from '@xuekl/cli-utils'
27
28
  import { FormItem } from '@xuekl/cli-base/type.d'
28
- import { ref, computed } from 'vue'
29
+ import { ref, computed, onBeforeMount } from 'vue'
30
+ import DictStore from "@/utils/DictStore";
29
31
 
30
32
  const props = defineProps(['form'])
31
33
  const XklFormRef = ref(null)
@@ -33,7 +35,6 @@ const { form } = props
33
35
  const formList: FormItem[] = []
34
36
  const opts = form._opts || {}
35
37
 
36
-
37
38
  // 获取符合mode的字段
38
39
  Object.keys(form).forEach(prop => {
39
40
  if (form['get' + setUpperFirst(prop)]) {
@@ -64,26 +65,42 @@ Object.keys(form).forEach(prop => {
64
65
  const dictTypes = formList.map(item => item.config?.dict).filter(res => !!res)
65
66
  const dictStore = ref({})
66
67
 
67
- dictTypes.forEach((dict: string) => {
68
- http({
69
- url: http.adornUrl(`${baseConf.dict_api_url}${dict}`),
70
- method: 'get',
71
- params: http.adornParams({})
72
- }).then(({ data }) => {
73
- dictStore.value[dict] = data.data
74
- })
68
+
69
+ onBeforeMount(async () => {
70
+ for (let dict of dictTypes) {
71
+ dictStore.value[dict] = await DictStore.getDict(dict)
72
+ }
75
73
  })
76
74
 
75
+
77
76
  const dictLabel = computed(() => {
78
- return function (dict: string, val: string | number) {
77
+ return function (dict: string, propValue: any) {
79
78
  if (dictStore.value[dict]) {
80
- const item = dictStore.value[dict].find(res => res.dictValue == val) || {}
81
- return item.dictLabel
79
+ if (Array.isArray(propValue)) {
80
+ const items = dictStore.value[dict].filter(res => propValue.includes(res.dictValue))
81
+ const labels = items.map(it => it.dictLabel)
82
+ return labels.join(',')
83
+ } else {
84
+ const item = dictStore.value[dict].find(res => res.dictValue == propValue) || {}
85
+ return item.dictLabel
86
+ }
87
+
82
88
  }
83
89
  return ''
84
90
  }
85
91
  })
86
92
 
93
+ const reflect = computed(() => {
94
+ return function (value) {
95
+ if (Array.isArray(value)) {
96
+ return value.join(',')
97
+ } else {
98
+ return value
99
+ }
100
+ }
101
+ })
102
+
103
+
87
104
 
88
105
  </script>
89
106
  <style lang="scss" scoped>
package/XklLink.vue CHANGED
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <real-el-link v-if="isAuth(auth)" @click.prevent="btnClick">
2
+ <real-el-link v-if="doAuth(auth)" :underline="false" @click.prevent.stop="btnClick">
3
3
  <slot></slot>
4
4
  </real-el-link>
5
5
  </template>
@@ -10,25 +10,105 @@ export default {
10
10
  </script>
11
11
  <script setup lang="ts">
12
12
  import { ElLink as RealElLink } from 'element-plus'
13
- import { componentGlobal } from '@xuekl/cli-base/global'
13
+ import { Loading } from "@element-plus/icons-vue";
14
14
  import { isAuth } from '@/utils'
15
- const props = defineProps(['auth'])
16
- const emit = defineEmits(['click', 'async'])
15
+ import { ref, useAttrs } from 'vue'
16
+ import { ElMessageBox } from 'element-plus'
17
+ import { useRoute } from 'vue-router'
18
+ const startLoading = window.startLoading
19
+ const finishLoading = window.finishLoading
20
+ const props = defineProps(['auth', 'prevent', 'openType', 'name', 'mask'])
21
+ const route: any = useRoute()
17
22
 
18
- const { auth } = props
19
- let preventClick = false
23
+ const { auth, name } = props
24
+ const mask = typeof props.mask === 'undefined' ? true : props.mask
25
+
26
+ const doAuth = (auth) => {
27
+ if (name) {
28
+ return isAuth(route?.name + ':' + name)
29
+ } else {
30
+ return isAuth(auth)
31
+ }
32
+ }
33
+
34
+
35
+ const attrs: any = useAttrs()
36
+ const preventClick = ref(false)
20
37
 
21
38
  const btnClick = () => {
22
- emit('click')
23
- if (componentGlobal.enableSubmit) {
24
- preventClick = false
25
- componentGlobal.enableSubmit = false
39
+ if (attrs.click) {
40
+ attrs.onClick()
41
+ if (props.openType) {
42
+ window[props.openType] && window[props.openType]()
43
+ }
44
+ }
45
+ if (attrs.onAsync) {
46
+ if (!preventClick.value) {
47
+ preventClick.value = true
48
+ if (props.openType !== 'preventLoading' && startLoading) {
49
+ startLoading()
50
+ }
51
+ attrs.onAsync(() => {
52
+ setTimeout(() => {
53
+ preventClick.value = false;
54
+ if (finishLoading) {
55
+ finishLoading()
56
+ }
57
+ if (props.openType) {
58
+ window[props.openType] && window[props.openType]()
59
+ }
60
+ }, 200)
61
+ })
62
+ }
26
63
  }
27
- if (!preventClick) {
28
- preventClick = true
29
- emit('async', () => {
30
- setTimeout(() => preventClick = false, 200)
31
- })
64
+
65
+ if (attrs.onConfirm) {
66
+ if (props.prevent === false) {
67
+ attrs.onConfirm()
68
+ if (props.openType) {
69
+ window[props.openType] && window[props.openType]()
70
+ }
71
+ } else {
72
+ ElMessageBox.confirm(
73
+ '当前内容可能存在修改,确认继续?',
74
+ '提示',
75
+ {
76
+ confirmButtonText: '确认',
77
+ cancelButtonText: '取消',
78
+ type: 'warning',
79
+ }
80
+ ).then(() => {
81
+ attrs.onConfirm()
82
+ if (props.openType) {
83
+ window[props.openType] && window[props.openType]()
84
+ }
85
+ }).catch(() => {
86
+ })
87
+ }
88
+ } else {
89
+ if (props.openType) {
90
+ window[props.openType] && window[props.openType]()
91
+ }
92
+ }
93
+ }
94
+ </script>
95
+
96
+ <style lang="scss" scoped>
97
+ .loading-mask {
98
+ position: absolute;
99
+ left: 0;
100
+ top: 0;
101
+ bottom: 0;
102
+ right: 0;
103
+ background-color: rgba(0, 0, 0, 0.6);
104
+ z-index: 1003;
105
+ display: flex;
106
+ align-items: center;
107
+ justify-content: center;
108
+
109
+ .is-loading {
110
+ font-size: 40px;
111
+ color: #fff;
32
112
  }
33
113
  }
34
- </script>
114
+ </style>
package/XklSelect.vue CHANGED
@@ -1,6 +1,29 @@
1
1
  <template>
2
- <el-select v-model="selectData" style="width: 100%;" @change="changeHandle">
3
- <el-option v-for="item in dataList" :key="item.id" :label="item.label" :value="item.value"></el-option>
2
+ <div v-if="fakeRender && (!selectData || (selectData && !selectData.length))" class="fake-render el-input__wrapper"
3
+ :class="{ 'el-select__wrapper is-disabled': disabled || readonly }" @click="updateRender">
4
+ <span class="fs-14">{{ $attrs.placeholder
5
+ }}</span>
6
+ </div>
7
+ <el-select v-else ref="XklSelectRef" :automatic-dropdown="true" v-model="selectData"
8
+ :class="{ 'readony-input': readonly }" style="width: 100%;" @change="changeHandle" :filterable="initFilterable"
9
+ :disabled="disabled || readonly" :filter-method="filterMethod" :allow-create="allowCreate"
10
+ :multiple-limit="multipleLimit" @focus="onClick()">
11
+ <!-- <template v-if="createAtFirst && filterVal" #header>
12
+ <div class="el-select-dropdown__item" @click="headerClick()">
13
+ <OptionComponent v-if="config && config.customOption" :item="creatingItem" />
14
+ </div>
15
+ </template> -->
16
+ <el-option v-if="config && config.all && dataList.length" key="all" :label="config.allLabel || 'ALL'"
17
+ value="ALL"></el-option>
18
+ <el-option v-if="createAtFirst && filterVal" :label="creatingItem.label" :value="creatingItem.value"
19
+ @click="creatingItemClick()">
20
+ <OptionComponent v-if="config && config.customOption" :item="creatingItem" />
21
+ </el-option>
22
+ <el-option v-for="item in dataList" :key="item.value.toString()" :label="item.label" :value="item.value">
23
+ <!-- <span v-if="item.tag">{{ item.tag }}</span> -->
24
+ <OptionComponent v-if="config && config.customOption" :item="item" />
25
+ <span v-else>{{ item.label }}</span>
26
+ </el-option>
4
27
  </el-select>
5
28
  </template>
6
29
  <script lang="ts">
@@ -9,42 +32,222 @@ export default {
9
32
  }
10
33
  </script>
11
34
  <script setup lang="ts">
12
- import { onBeforeMount, ref, Ref, watch, computed } from 'vue'
35
+ import { onBeforeMount, ref, Ref, watch, computed, shallowRef, onBeforeUnmount } from 'vue'
13
36
  import { SelectItem } from '@xuekl/cli-base/type.d'
37
+ import { selectConf } from './index'
14
38
  import http from "@/utils/httpRequest"
15
- const props = defineProps(['config', 'list', 'modelValue'])
16
- const emit = defineEmits(['update:label', 'loaded', 'update:modelValue', 'itemChange'])
17
- const { config, list } = props
39
+ import useApp from '@/store/app'
40
+ import { toPromise } from '@xuekl/cli-utils'
41
+ import { pinyin } from 'pinyin-pro'
42
+ import { nextTick } from 'vue'
43
+ interface OptionItem extends SelectItem {
44
+ tag?: string
45
+ pinyinStartStr?: string
46
+ pinyinStr?: string
47
+ abbreviation?: string
48
+ pinyin?: string
49
+ isChecked?: boolean
50
+ isSpecial?: boolean
51
+ }
52
+ const props = defineProps(['config', 'list', 'modelValue', 'filterable', 'readonly', 'disabled', 'cache', 'allowCreate', 'multipleLimit', 'createAtFirst', 'fake'])
53
+ const emit = defineEmits(['update:label', 'click', 'loaded', 'update:modelValue', 'itemChange'])
54
+ const { config, list, filterable, readonly, cache, allowCreate, multipleLimit, createAtFirst, fake } = props
55
+ const appStore = useApp()
56
+
57
+ const dataCahe = cache !== false
58
+
59
+ const dataList: Ref<OptionItem[]> = ref([])
60
+
61
+ const initFilterable = ref(false)
62
+
63
+
64
+ const isFake = typeof fake === 'undefined' ? true : fake
65
+ const fakeRender = ref(isFake)
66
+ const XklSelectRef: any = ref(null)
67
+
68
+ const updateRender = () => {
69
+ fakeRender.value = false
70
+ nextTick(() => {
71
+ XklSelectRef.value.focus()
72
+ })
73
+ }
74
+ initFilterable.value = filterable || selectConf?.filterable
75
+
76
+ const disabled = computed(() => props.disabled)
77
+
78
+ const OptionComponent = config?.customOption
79
+
80
+ let sourceData: OptionItem[] = []
81
+ let filterSourceData: OptionItem[] = []
82
+
83
+
84
+ const creatingItem: Ref<OptionItem> = ref({
85
+ label: '',
86
+ value: '',
87
+ isChecked: false,
88
+ isSpecial: false,
89
+ __created: true
90
+ })
91
+
92
+ const createdItems: Ref<OptionItem[]> = ref([])
93
+
94
+ const creatingItemClick = () => {
95
+ if (selectData.value.length >= multipleLimit) {
96
+ return
97
+ }
98
+ // if (selectData.value.includes(creatingItem.value.value)) {
99
+ // return
100
+ // }
101
+ creatingItem.value.isChecked = !creatingItem.value.isChecked
102
+ if (creatingItem.value.isChecked) {
103
+ createdItems.value.push({ ...creatingItem.value })
104
+ } else {
105
+ createdItems.value = createdItems.value.filter(item => item.value !== creatingItem.value.value)
106
+ }
107
+ }
108
+
109
+ // 允许创建到第一条时候
110
+ if (allowCreate && createAtFirst) {
111
+ watch(() => creatingItem.value.isSpecial, (val) => {
112
+ const item = createdItems.value.find(inner => inner.value == creatingItem.value.value)
113
+ if (item) {
114
+ item.isSpecial = val
115
+ }
116
+ })
117
+ }
118
+
119
+
18
120
 
19
- const dataList: Ref<SelectItem[]> = ref([])
121
+ const filterVal = ref('')
20
122
 
21
123
  const selectData = computed({
22
124
  get() {
23
- return dataList.value.length ? props.modelValue : ''
125
+ if (Array.isArray(props.modelValue)) {
126
+ return (!dataList.value.length && !allowCreate) ? [] : props.modelValue
127
+ }
128
+ return (!dataList.value.length && !allowCreate) ? '' : props.modelValue
24
129
  },
25
130
  set(val) {
131
+
26
132
  emit('update:modelValue', val)
27
133
  }
28
134
  })
29
135
 
30
- const changeHandle = (val: string | number | string[] | number[]) => {
136
+ const filterMethod = (val: any) => {
137
+ if (createAtFirst) {
138
+ filterVal.value = val
139
+ creatingItem.value.value = val
140
+ creatingItem.value.label = val
141
+ creatingItem.value.isChecked = selectData.value.includes(creatingItem.value.value)
142
+ const createdItem = createdItems.value.find(item => item.value == val)
143
+ if (createdItem) {
144
+ creatingItem.value.isSpecial = createdItem.isSpecial
145
+ } else {
146
+ creatingItem.value.isSpecial = false
147
+ }
148
+ }
149
+
150
+ if (val) {
151
+ val = val.trim()
152
+ const filterKeys = config.filterKeys || []
153
+ dataList.value = filterSourceData.filter(res => {
154
+ if (filterKeys.length) {
155
+ for (let k of filterKeys) {
156
+ if (res[k] && res[k].toString().includes(val)) {
157
+ return true
158
+ }
159
+ }
160
+ } else {
161
+ if (config?.smartFilter) {
162
+ const startMatch = val.toUpperCase()
163
+ const endMatch1 = res.value.toString().toUpperCase()
164
+ const endMatch2 = res.label.toString().toUpperCase()
165
+ const endMatch3 = res.pinyinStartStr!.toString().toUpperCase()
166
+ const endMatch4 = res.pinyinStr!.toString().toUpperCase()
167
+ const endMatch5 = res.abbreviation!.toString().toUpperCase()
168
+ const endMatch6 = res.pinyin!.toString().toUpperCase()
169
+ return endMatch1.includes(startMatch) || endMatch2.includes(startMatch)
170
+ || endMatch3.includes(startMatch) || endMatch4.includes(startMatch)
171
+ || endMatch5.includes(startMatch) || endMatch6.includes(startMatch);
172
+ } else {
173
+ return res.value.toString().includes(val) || res.label.includes(val);
174
+ }
175
+ }
176
+ })
177
+ } else {
178
+ dataList.value = filterSourceData
179
+ }
180
+ }
181
+
182
+ const onClick = () => {
183
+ emit('click')
184
+ }
185
+
186
+ const valChangeHandle = (val: string | number | string[] | number[]) => {
31
187
  if (Array.isArray(val)) {
32
- const values = val.map(res => res.value)
33
- const labels = val.map(res => res.label)
34
- const items = dataList.value.filter(res => values.includes(res.value))
188
+ const values: any = val
189
+ const items: OptionItem[] = []
190
+ for (let v of values) {
191
+ const item = filterSourceData.find(inner => inner.value == v)
192
+ if (item) {
193
+ items.push(item)
194
+ } else {
195
+ if (allowCreate) {
196
+ const createdItem = createdItems.value.find(inner => inner.value == v)
197
+ if (createdItem) {
198
+ items.push(createdItem)
199
+ } else {
200
+ items.push({
201
+ label: v,
202
+ value: v,
203
+ } as OptionItem)
204
+ }
205
+ }
206
+ }
207
+ }
208
+ const labels = items.map(res => res.label)
35
209
  if (items) {
36
210
  emit('update:label', labels)
37
211
  emit('itemChange', items)
38
212
  }
39
213
  } else {
40
- const item = dataList.value.find(res => res.value === val)
41
- if (item) {
42
- emit('update:label', item.label)
43
- emit('itemChange', item)
214
+ if (!val) {
215
+ emit('update:label', "")
216
+ emit('itemChange', null)
217
+ } else {
218
+ const item = dataList.value.find(res => res.value === val)
219
+ if (item) {
220
+ emit('update:label', item.label)
221
+ emit('itemChange', item)
222
+ } else {
223
+ if (val == 'ALL') {
224
+ emit('update:label', config.allLabel || val)
225
+ emit('itemChange', {
226
+ label: config.allLabel || val,
227
+ value: val
228
+ })
229
+ } else if (allowCreate) {
230
+ emit('update:label', val)
231
+ emit('itemChange', {
232
+ label: val,
233
+ value: val
234
+ })
235
+ }
236
+ }
44
237
  }
45
238
  }
46
239
  }
47
240
 
241
+ const changeHandle = (val: string | number | string[] | number[]) => {
242
+ if (allowCreate && createAtFirst) {
243
+ // 在自动创建时,第一条的点击事件是晚于change事件的,目前的使用场景是要早于change事件
244
+ setTimeout(() => { valChangeHandle(val) }, 0)
245
+ } else {
246
+ valChangeHandle(val)
247
+ }
248
+
249
+ }
250
+
48
251
  const handleData = (data) => {
49
252
  const split = config?.split
50
253
  const labelTarget = config?.labelTarget
@@ -56,6 +259,7 @@ const handleData = (data) => {
56
259
  }
57
260
 
58
261
  if (data) {
262
+
59
263
  data.forEach(inner => {
60
264
  inner.value = inner[config?.valueTarget || 'value']
61
265
  if (!split) {
@@ -63,47 +267,156 @@ const handleData = (data) => {
63
267
  } else {
64
268
  inner.label = labels.map(label => inner[label]).join(split)
65
269
  }
270
+ if (config?.smartFilter) {
271
+ inner.pinyinStr = pinyin(inner.label, { toneType: 'none', type: 'array' }).join('')
272
+ inner.pinyinStartStr = pinyin(inner.label, { pattern: 'first', toneType: 'none', type: 'array' }).join('')
273
+ }
66
274
  })
67
275
  }
68
276
 
69
277
  return data || []
70
278
  }
71
279
 
280
+ let listWatcher: Function
281
+
72
282
  if (typeof list === 'function') {
73
- watch(list, (val: SelectItem[]) => {
283
+ listWatcher = watch(list, (val: OptionItem[]) => {
74
284
  dataList.value = val
75
285
  })
76
286
  }
77
287
 
288
+ const checkExist = () => {
289
+ // return
290
+ if (!allowCreate) {
291
+ if (Array.isArray(selectData.value)) {
292
+ const exist = dataList.value.some(item => selectData.value.includes(item.value))
293
+ if (!exist) {
294
+ selectData.value = []
295
+ }
296
+ } else {
297
+ const exist = dataList.value.some(item => item.value === selectData.value)
298
+ if (!exist && selectData.value !== 'ALL') {
299
+ selectData.value = ""
300
+ }
301
+ }
302
+ }
303
+ }
304
+
78
305
  onBeforeMount(() => {
306
+
79
307
  if (list) {
80
308
  if (typeof list === 'function') {
81
309
  return false
82
310
  }
83
- dataList.value = handleData(list)
311
+ sourceData = list
312
+ dataList.value = handleData(sourceData)
313
+ filterSourceData = handleData(sourceData)
314
+ // checkExist()
84
315
  } else {
85
316
  if (!config) { return }
86
317
  let doParams
87
318
  if (typeof config.params === 'function') {
88
319
  doParams = config.params
89
320
  } else {
90
- doParams = () => config.params
321
+ doParams = () => config.params || {}
322
+ }
323
+
324
+ const params = doParams()
325
+
326
+ const paramsStr = JSON.stringify(params)
327
+ //先读取缓存中的数据
328
+ if (appStore.urlSelectData[config.url + paramsStr]) {
329
+ sourceData = appStore.urlSelectData[config.url + paramsStr]
330
+ dataList.value = handleData(sourceData)
331
+ filterSourceData = handleData(sourceData)
332
+ // 如果缓存中没有数据,可能是以为接口已经发出数据未返回,需要等待
333
+ if (!dataList.value.length) {
334
+ toPromise(() => appStore.urlSelectData[config.url + paramsStr]).then((vals) => {
335
+ sourceData = vals
336
+ dataList.value = handleData(sourceData)
337
+ filterSourceData = handleData(sourceData)
338
+ emit('loaded', dataList.value, (vals) => {
339
+ sourceData = vals
340
+ dataList.value = handleData(sourceData)
341
+ filterSourceData = handleData(sourceData)
342
+ // appStore.urlSelectData[config.url] = JSON.parse(JSON.stringify(dataList.value))
343
+ })
344
+ })
345
+ } else {
346
+ // 如果有数据则直接完成load
347
+ emit('loaded', dataList.value, (vals) => {
348
+ sourceData = vals
349
+ dataList.value = handleData(sourceData)
350
+ filterSourceData = handleData(sourceData)
351
+ // appStore.urlSelectData[config.url] = JSON.parse(JSON.stringify(dataList.value))
352
+ })
353
+ }
354
+
355
+ if (dataList.value.length) {
356
+ checkExist()
357
+ }
358
+ } else {
359
+ // 缓存中不存在再调用接口 并且开始在缓存中打标记,以防止一个页面有相同接口时会调用多次
360
+ appStore.urlSelectData[config.url + paramsStr] = []
361
+ http({
362
+ url: http.adornUrl(config.url),
363
+ method: 'get',
364
+ params: http.adornParams(params)
365
+ }).then(({ data }) => {
366
+ sourceData = data.data
367
+ dataList.value = handleData(sourceData)
368
+ filterSourceData = handleData(sourceData)
369
+ appStore.urlSelectData[config.url + paramsStr] = sourceData
370
+ emit('loaded', dataList.value, (vals) => {
371
+ sourceData = vals
372
+ dataList.value = handleData(sourceData)
373
+ filterSourceData = handleData(sourceData)
374
+ // appStore.urlSelectData[config.url + paramsStr] = sourceData
375
+ })
376
+ checkExist()
377
+ }).catch(() => {
378
+ appStore.urlSelectData[config.url + paramsStr] = undefined
379
+ })
91
380
  }
92
- http({
93
- url: http.adornUrl(config.url),
94
- method: 'get',
95
- params: http.adornParams(doParams())
96
- }).then(({ data }) => {
97
- dataList.value = handleData(data.data)
98
- emit('loaded', dataList.value)
99
- })
100
381
  }
101
382
  })
383
+
384
+ onBeforeUnmount(() => {
385
+ if (listWatcher) {
386
+ listWatcher(); // 调用返回函数来移除 watch 监听
387
+ }
388
+ dataList.value = []
389
+ sourceData = []
390
+ filterSourceData = []
391
+ if (!dataCahe && config) {
392
+ Object.keys(appStore.urlSelectData).forEach(key => {
393
+ if (key.includes(config.url)) {
394
+ appStore.urlSelectData[key] = undefined
395
+ }
396
+ })
397
+ }
398
+ });
102
399
  </script>
103
400
  <style lang="scss">
104
401
  .readony-input {
105
- .el-input__inner {
106
- cursor: not-allowed;
402
+ .is-disabled .el-input__wrapper {
403
+ background-color: #fff !important;
404
+
405
+ .el-input__inner {
406
+ color: #606266;
407
+ -webkit-text-fill-color: #606266;
408
+ }
107
409
  }
108
410
  }
411
+
412
+ .fake-render {
413
+ width: 100%;
414
+ justify-content: flex-start;
415
+ color: #a8abb2;
416
+ height: 32px;
417
+ }
418
+
419
+ .el-select__wrapper.is-disabled {
420
+ border: 1px solid #dcdfe6;
421
+ }
109
422
  </style>