@xuekl/cli-components 1.0.8 → 1.1.0

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
@@ -68,6 +68,7 @@ import XklSelect from './XklSelect.vue'
68
68
  import XklTreeSelect from './XklTreeSelect.vue'
69
69
  import XklDict from './XklDict.vue'
70
70
  import XklDatePicker from './XklDatePicker.vue'
71
+ import { componentGlobal } from '@xuekl/cli-base/global'
71
72
 
72
73
  const props = defineProps(['form'])
73
74
  const XklFormRef = ref(null)
@@ -158,9 +159,19 @@ searchSpan.value = 24 - toalSpan % 24
158
159
  const regProto = () => {
159
160
  if (XklFormRef.value) {
160
161
  let enableSubmit = true;
162
+ let submitTimer: NodeJS.Timeout
161
163
  form.setSubmit((callback: (call: () => void, feils: any) => void) => {
164
+ if (componentGlobal.enableFormSubmit) {
165
+ enableSubmit = true
166
+ }
167
+ componentGlobal.enableFormSubmit = false
162
168
  if (enableSubmit) {
163
169
  enableSubmit = false;
170
+ clearTimeout(submitTimer)
171
+ submitTimer = setTimeout(() => {
172
+ componentGlobal.enableFormSubmit = true
173
+ enableSubmit = true
174
+ }, 3000)
164
175
  formList.forEach(field => {
165
176
  modeFields[field.prop] = (form as any)[field.prop]
166
177
  });
package/XklTable.vue CHANGED
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <el-table ref="XklTable" :data="table.list" style="width: 100%" :header-cell-style="{ background: '#F1F4F9' }">
3
- <el-table-column v-if="table.selection" type="selection" align="center"></el-table-column>
3
+ <el-table-column v-if="table.selection" v-bind="table.selectionConfig" type="selection"
4
+ align="center"></el-table-column>
4
5
  <el-table-column v-if="table.index" type="index" align="center" v-bind="table.indexConfig"></el-table-column>
5
6
  <el-table-column v-for="item in table.columns" :key="item.prop" :prop="item.prop" :label="item.label"
6
7
  :width="item.width" :align="item.align || 'center'" :sortable="item.sortable">
@@ -41,11 +42,12 @@ export default {
41
42
  </script>
42
43
  <script setup lang="ts">
43
44
  import http from "@/utils/httpRequest"
44
- import { computed } from "vue";
45
+ import { computed, ref } from "vue";
45
46
  const props = defineProps(['table'])
46
47
  const { table } = props
47
48
  const dictTypes = table.columns.map(res => res.dict).filter(res => !!res)
48
49
  const dictStore = {}
50
+ const XklTable = ref(null)
49
51
 
50
52
  dictTypes.forEach((dict: string) => {
51
53
  http({
@@ -83,4 +85,13 @@ const tagColor = computed(() => {
83
85
  }
84
86
  })
85
87
 
88
+ const getRef = () => {
89
+ return XklTable.value
90
+ }
91
+
92
+ defineExpose({
93
+ getRef
94
+ })
95
+
96
+
86
97
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuekl/cli-components",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {