sadais-piui 1.2.7-beta92 → 1.2.7-beta93

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.
@@ -1,7 +1,7 @@
1
1
  <!--
2
2
  * @Author: zhangzhenfei
3
3
  * @Date: 2022-05-18 11:08:49
4
- * @LastEditTime: 2024-01-12 11:09:10
4
+ * @LastEditTime: 2024-01-15 14:50:23
5
5
  * @LastEditors: zhangzhenfei
6
6
  * @Description: 选择输入
7
7
  * @FilePath: /piui/components/pi-select-input/index.vue
@@ -16,7 +16,7 @@
16
16
  <pi-input
17
17
  v-else
18
18
  type="text"
19
- :value="getInputValue"
19
+ :value="getInputValue || remoteVal"
20
20
  :custom-class="getInput.customClass"
21
21
  :custom-style="getInput.customStyle"
22
22
  :placeholder="getInput.placeholder"
@@ -149,7 +149,8 @@ export default {
149
149
  },
150
150
  data() {
151
151
  return {
152
- show: false
152
+ show: false,
153
+ remoteVal: ''
153
154
  }
154
155
  },
155
156
  computed: {
@@ -160,6 +161,28 @@ export default {
160
161
  return this.$pi.lang.mergeDeep(selectInput.input, this.input)
161
162
  },
162
163
  getInputValue() {
164
+ return this.handleGetInputValue()
165
+ }
166
+ },
167
+ created() {
168
+ this.initRemoteSelectData()
169
+ },
170
+ methods: {
171
+ initRemoteSelectData() {
172
+ // 如果开启了远程搜索 则在创建之初 先触发一次搜索 让代码触发到用户自定义的parseRemoteSearchResult方法中
173
+ // 目的为了回显数据
174
+ if (
175
+ this.getSelect.remoteSearchConfig.enable &&
176
+ this.getSelect.parseRemoteSearchResult &&
177
+ this.val
178
+ ) {
179
+ this.$nextTick(async () => {
180
+ await this.$refs['pi-select'].handleRemoteSearch()
181
+ this.remoteVal = this.handleGetInputValue()
182
+ })
183
+ }
184
+ },
185
+ handleGetInputValue() {
163
186
  const parseValueFn = this.parseValueFn[PI_DEFAULT_FN_FLAG]
164
187
  ? this.parseValueFn.fn
165
188
  : this.parseValueFn
@@ -195,20 +218,6 @@ export default {
195
218
  return val ? val[this.getSelect.displayField] : ''
196
219
  }
197
220
  }
198
- }
199
- },
200
- created() {
201
- this.initRemoteSelectData()
202
- },
203
- methods: {
204
- initRemoteSelectData() {
205
- // 如果开启了远程搜索 则在创建之初 先触发一次搜索 让代码触发到用户自定义的parseRemoteSearchResult方法中
206
- // 目的为了回显数据
207
- if (this.getSelect.remoteSearchConfig.enable && this.getSelect.parseRemoteSearchResult) {
208
- this.$nextTick(() => {
209
- this.$refs['pi-select'].handleRemoteSearch()
210
- })
211
- }
212
221
  },
213
222
  handlePopupClose() {
214
223
  this.val = false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta92",
3
+ "version": "1.2.7-beta93",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {