@xuekl/cli-components 1.5.4 → 1.5.6

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/XklForm.vue CHANGED
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <el-form ref="XklFormRef" :model="form" :label-width="opts.labelWidth">
2
+ <el-form ref="XklFormRef" :model="form" :label-width="opts.labelWidth" @keyup.enter.native="enterSubmit()">
3
3
  <div class="hide-input">
4
4
  <input type="text" />
5
5
  <input type="password" />
@@ -78,6 +78,7 @@ import XklDatePicker from './XklDatePicker.vue'
78
78
  import { componentGlobal } from '@xuekl/cli-base/global'
79
79
 
80
80
  const props = defineProps(['form'])
81
+ const emit = defineEmits(['enter'])
81
82
  const XklFormRef = ref(null)
82
83
  const { form } = props
83
84
  const sourceFormList: FormItem[] = []
@@ -88,6 +89,9 @@ if (typeof opts.defaultCollapse !== 'undefined') {
88
89
  isCollapse.value = opts.defaultCollapse
89
90
  }
90
91
 
92
+ const enterSubmit = () => {
93
+ emit('enter')
94
+ }
91
95
  // 获取符合mode的字段
92
96
  const modeFields: any = {}
93
97
  Object.keys(form).forEach(prop => {
package/XklTable.vue CHANGED
@@ -58,7 +58,7 @@ import { baseConf, tableConf } from './index'
58
58
  const props = defineProps(['table'])
59
59
  const { table } = props
60
60
  const dictTypes = table.columns.map(res => res.dict).filter(res => !!res)
61
- const dictStore = {}
61
+ const dictStore = ref({})
62
62
  const XklTable = ref(null)
63
63
  table.element = table.element || {}
64
64
 
@@ -73,14 +73,14 @@ dictTypes.forEach((dict: string) => {
73
73
  method: 'get',
74
74
  params: http.adornParams({})
75
75
  }).then(({ data }) => {
76
- dictStore[dict] = data.data
76
+ dictStore.value[dict] = data.data
77
77
  })
78
78
  })
79
79
 
80
80
  const dictLabel = computed(() => {
81
81
  return function (col: any, row: any) {
82
- if (dictStore[col.dict]) {
83
- const item = dictStore[col.dict].find(res => res.dictValue == row[col.prop]) || {}
82
+ if (dictStore.value[col.dict]) {
83
+ const item = dictStore.value[col.dict].find(res => res.dictValue == row[col.prop]) || {}
84
84
  return item.dictLabel
85
85
  }
86
86
  return ''
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuekl/cli-components",
3
- "version": "1.5.4",
3
+ "version": "1.5.6",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {