ol-base-components 3.2.7 → 3.2.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ol-base-components",
3
- "version": "3.2.7",
3
+ "version": "3.2.9",
4
4
  "private": false,
5
5
  "main": "src/package/index.js",
6
6
  "bin": {
package/src/App.vue CHANGED
@@ -278,101 +278,42 @@ export default {
278
278
  // inputType: "text"
279
279
  // }
280
280
  ],
281
- tableSearch: [
282
- {
283
- label: "选项1",
284
- value: "code1",
285
- inputType: "text",
286
- compare: "contains",
287
- children: [],
288
- props: {},
289
- },
290
- {
291
- label: "选项2",
292
- value: "code2",
293
- inputType: "number",
294
- compare: "eq",
295
- children: [],
296
- props: {},
297
- },
298
- {
299
- label: "选项3",
300
- value: "code3",
301
- inputType: "select",
302
- compare: "eq",
303
- children: [
304
- {
305
- key: 0,
306
- value: "货位点",
307
- },
308
- {
309
- key: 1,
310
- value: "环线载货通道点",
311
- },
312
- {
313
- key: 2,
314
- value: "其它载货通道点",
315
- },
316
- {
317
- key: 3,
318
- value: "提升机点",
319
- },
320
- {
321
- key: 4,
322
- value: "充电点",
323
- },
324
- {
325
- key: 5,
326
- value: "暂停位点",
327
- },
328
- {
329
- key: 6,
330
- value: "提升机等待位",
331
- },
332
- {
333
- key: 7,
334
- value: "入库口",
335
- },
336
- {
337
- key: 8,
338
- value: "出库口",
339
- },
340
- {
341
- key: 9,
342
- value: "地图外",
343
- },
344
- ],
345
- props: {},
346
- optionSource: {
347
- sourceType: "dict",
348
- dictKey: "pointType",
349
- apiUrl: "",
350
- valueField: "id",
351
- labelField: "name",
352
- options: [],
353
- },
354
- },
355
- ],
281
+ tableSearch: [],
356
282
  customs: [
357
283
  {
358
- name: "选项1",
359
- key: "code1",
284
+ name: "库位编码",
360
285
  keyType: 1,
286
+ key: "WarehouseLocationCode",
287
+ enumName: null,
288
+ custom: false,
361
289
  },
362
290
  {
363
- name: "选项2",
364
- key: "code2",
365
- keyType: 2,
291
+ name: "使用状态",
292
+ keyType: 3,
293
+ key: "UsageStatus",
294
+ enumName: "usageStatusEnum",
295
+ custom: false,
366
296
  },
367
297
  {
368
- name: "选项3",
369
- key: "code3",
370
- keyType: 3,
298
+ name: "是否启用",
299
+ keyType: 1,
300
+ key: "Enabled",
301
+ enumName: null,
302
+ custom: false,
371
303
  },
372
304
  {
373
- name: "选项4",
374
- key: "code4",
305
+ name: "创建时间",
375
306
  keyType: 4,
307
+ key: "CreationTime",
308
+ enumName: null,
309
+ custom: false,
310
+ },
311
+ {
312
+ name: "备注",
313
+ keyType: 1,
314
+ key: "Remark",
315
+ enumName: null,
316
+ custom: false,
376
317
  },
377
318
  ],
378
319
  },
@@ -39,7 +39,9 @@ export default {
39
39
  },
40
40
 
41
41
  mounted() {
42
- this.init();
42
+ this.$nextTick(() => {
43
+ this.init();
44
+ });
43
45
  },
44
46
  methods: {
45
47
  init() {
@@ -69,8 +71,10 @@ export default {
69
71
  }).then(res => {
70
72
  if (res.code !== 200) return;
71
73
  const configList = res.result.settingJson ? JSON.parse(res.result.settingJson) : [];
72
- this.formSearchData.tableSearch = configList;
73
- this.key++;
74
+ this.$set(this.formSearchData, "tableSearch", configList);
75
+ this.$nextTick(() => {
76
+ this.key++;
77
+ });
74
78
  });
75
79
  },
76
80
  //保存
@@ -156,11 +156,8 @@
156
156
  <el-select
157
157
  v-model="currentOptionConfig.dictKey"
158
158
  filterable
159
- remote
160
- reserve-keyword
159
+ :filter-method="filterDict"
161
160
  placeholder="请输入字典,如:orderTypeEnum"
162
- :remote-method="remoteDictQuery"
163
- :loading="dictLoading"
164
161
  style="width: 100%"
165
162
  @change="handleDictKeyChange"
166
163
  clearable
@@ -170,7 +167,10 @@
170
167
  :key="dict.key"
171
168
  :label="dict.label"
172
169
  :value="dict.key"
173
- />
170
+ >
171
+ <span style="float: left">{{ dict.label }}</span>
172
+ <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.key }}</span>
173
+ </el-option>
174
174
  </el-select>
175
175
  </el-form-item>
176
176
 
@@ -383,8 +383,7 @@ export default {
383
383
  },
384
384
  previewOptions: [],
385
385
  allDictList: [],
386
- dictLoading: false,
387
- dictQuery: "",
386
+ allDictListBackup: [],
388
387
  sortable: null,
389
388
  currentConfig: {}, // 配置选项
390
389
  };
@@ -395,13 +394,15 @@ export default {
395
394
  return this.customs.filter(custom => !selectedKeys.includes(custom.key));
396
395
  },
397
396
  },
397
+ created() {
398
+ this.loadAllDictList();
399
+ },
398
400
  watch: {
399
401
  visible: {
400
402
  handler(newVal) {
401
403
  this.dialogVisible = newVal;
402
404
  if (newVal) {
403
405
  this.configList = JSON.parse(JSON.stringify(this.tableSearch));
404
- this.loadAllDictList();
405
406
  this.$nextTick(() => {
406
407
  this.initSortable();
407
408
  });
@@ -794,45 +795,28 @@ export default {
794
795
  });
795
796
 
796
797
  this.allDictList = dictList;
798
+ this.allDictListBackup = dictList;
797
799
  } catch (error) {
798
800
  console.error("加载字典列表失败:", error);
799
801
  this.allDictList = [];
802
+ this.allDictListBackup = [];
800
803
  }
801
804
  },
802
- async remoteDictQuery(query) {
805
+ filterDict(query) {
803
806
  if (!query) {
804
- this.allDictList = [];
807
+ this.allDictList = this.allDictListBackup || [];
805
808
  return;
806
809
  }
807
-
808
- try {
809
- this.dictLoading = true;
810
- const wmsStr = localStorage.getItem("wms") || "{}";
811
- const wmsData = JSON.parse(wmsStr);
812
- const dictData = wmsData.SET_enumsSelect || {};
813
-
814
- const dictList = [];
815
- Object.keys(dictData).forEach(key => {
816
- if (key && key.toLowerCase().includes(query.toLowerCase())) {
817
- const dictItem = dictData[key];
818
- if (dictItem) {
819
- dictList.push({
820
- key: String(key),
821
- label: dictItem.desc || key,
822
- });
823
- }
824
- }
825
- });
826
-
827
- this.allDictList = dictList;
828
- } catch (error) {
829
- console.error("搜索字典失败:", error);
830
- this.$message.error("搜索字典失败");
831
- } finally {
832
- this.dictLoading = false;
833
- }
810
+ const filteredList = this.allDictListBackup.filter(item => {
811
+ return (
812
+ item.key.toLowerCase().includes(query.toLowerCase()) ||
813
+ item.label.toLowerCase().includes(query.toLowerCase())
814
+ );
815
+ });
816
+ this.allDictList = filteredList;
834
817
  },
835
818
  handleDictKeyChange(dictKey) {
819
+ this.allDictList = this.allDictListBackup || [];
836
820
  if (dictKey) {
837
821
  this.loadPreviewOptions();
838
822
  }
@@ -869,6 +853,11 @@ export default {
869
853
  valueFormat: "yyyy-MM-dd",
870
854
  format: "yyyy/MM/dd",
871
855
  };
856
+ } else if (custom.keyType === 3) {
857
+ newItem.optionSource = {
858
+ sourceType: "dict",
859
+ dictKey: custom.enumName,
860
+ };
872
861
  }
873
862
 
874
863
  this.configList.push(newItem);