el-plus-crud 0.0.92 → 0.0.94

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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.0.94](https://github.com/KDJack/el-plus-crud/compare/v0.0.93...v0.0.94) (2023-09-28)
6
+
7
+ ### [0.0.93](https://github.com/KDJack/el-plus-crud/compare/v0.0.92...v0.0.93) (2023-09-28)
8
+
5
9
  ### [0.0.92](https://github.com/KDJack/el-plus-crud/compare/v0.0.91...v0.0.92) (2023-09-27)
6
10
 
7
11
  ### [0.0.91](https://github.com/KDJack/el-plus-crud/compare/v0.0.90...v0.0.91) (2023-09-26)
@@ -5492,12 +5492,12 @@ const E2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5492
5492
  disabled: L.disabled,
5493
5493
  onFocus: s,
5494
5494
  onBlur: w,
5495
- onkeypress: "return( /[\\d\\.]/.test(String.fromCharCode(event.keyCode)))"
5495
+ onkeypress: "return( /[-\\d\\.]/.test(String.fromCharCode(event.keyCode)))"
5496
5496
  }), null, 16, ["modelValue", "disabled"])) : le("", !0);
5497
5497
  };
5498
5498
  }
5499
5499
  });
5500
- const Js = /* @__PURE__ */ Ze(x2, [["__scopeId", "data-v-56546790"]]), C2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Js }, Symbol.toStringTag, { value: "Module" })), O2 = {
5500
+ const Js = /* @__PURE__ */ Ze(x2, [["__scopeId", "data-v-7540aaf3"]]), C2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Js }, Symbol.toStringTag, { value: "Module" })), O2 = {
5501
5501
  name: "ElPlusFormPassword",
5502
5502
  inheritAttrs: !1,
5503
5503
  typeName: "password",
@@ -7677,7 +7677,7 @@ const Km = /* @__PURE__ */ Ze(Hm, [["__scopeId", "data-v-37fedb7f"]]), Jm = {
7677
7677
  emits: ["getUrlConsumerIds", "selection", "select", "selectAll", "update:modelValue", "tabChange", "expandChange", "inited"],
7678
7678
  setup(f, { expose: i, emit: l }) {
7679
7679
  var Qn, Yt, gn, He, _t, yn, kl, En;
7680
- const o = f, j = Fe("defaultConf"), p = Fe("format"), g = _([]), z = _(null), M = _(), s = _(((He = (Qn = o.tableConfig) == null ? void 0 : Qn.tabConf) == null ? void 0 : He.tabs[((gn = (Yt = o.tableConfig) == null ? void 0 : Yt.tabConf) == null ? void 0 : gn.default) || 0].value) ?? ""), w = _({}), y = me(() => (E) => E.key ? w.value[E.key] || 0 : ""), A = me(() => (E, re) => {
7680
+ const o = f, j = Fe("defaultConf"), p = Fe("format"), g = _([]), z = _(null), M = _(), s = _({}), w = _(((He = (Qn = o.tableConfig) == null ? void 0 : Qn.tabConf) == null ? void 0 : He.tabs[((gn = (Yt = o.tableConfig) == null ? void 0 : Yt.tabConf) == null ? void 0 : gn.default) || 0].value) ?? ""), y = me(() => (E) => E.key ? s.value[E.key] || 0 : ""), A = me(() => (E, re) => {
7681
7681
  var ne, Oe, Pe, it;
7682
7682
  return typeof ((Oe = (ne = o.tableConfig) == null ? void 0 : ne.tableAttr) == null ? void 0 : Oe.selectable) == "function" ? (it = (Pe = o.tableConfig) == null ? void 0 : Pe.tableAttr) == null ? void 0 : it.selectable(E, re) : !0;
7683
7683
  }), C = _(), L = _(!1), Y = _(!!((yn = (_t = o.tableConfig) == null ? void 0 : _t.tabConf) != null && yn.fetch)), F = _(!1), P = j.size || "default", H = _({});
@@ -7791,7 +7791,7 @@ const Km = /* @__PURE__ */ Ze(Hm, [["__scopeId", "data-v-37fedb7f"]]), Jm = {
7791
7791
  ...typeof o.tableConfig.queryMap == "function" ? await o.tableConfig.queryMap() : o.tableConfig.queryMap,
7792
7792
  t_: (/* @__PURE__ */ new Date()).getTime()
7793
7793
  };
7794
- return o.isPager && (E.current = pe.current, E.size = pe.size), (re = o.tableConfig) != null && re.tabConf && ((ne = o.tableConfig) != null && ne.tabConf.prop) && (E[(Oe = o.tableConfig) == null ? void 0 : Oe.tabConf.prop] = s.value), E = q(E), o.isDialog, (he = (it = (Pe = o.tableConfig) == null ? void 0 : Pe.toolbar) == null ? void 0 : it.export) != null && he.isAuth, E;
7794
+ return o.isPager && (E.current = pe.current, E.size = pe.size), (re = o.tableConfig) != null && re.tabConf && ((ne = o.tableConfig) != null && ne.tabConf.prop) && (E[(Oe = o.tableConfig) == null ? void 0 : Oe.tabConf.prop] = w.value), E = q(E), o.isDialog, (he = (it = (Pe = o.tableConfig) == null ? void 0 : Pe.toolbar) == null ? void 0 : it.export) != null && he.isAuth, E;
7795
7795
  }
7796
7796
  function q(E) {
7797
7797
  if (!E)
@@ -7844,7 +7844,7 @@ const Km = /* @__PURE__ */ Ze(Hm, [["__scopeId", "data-v-37fedb7f"]]), Jm = {
7844
7844
  }
7845
7845
  async function fn(E = !1) {
7846
7846
  var re, ne, Oe, Pe;
7847
- return await mt(!0), !E && ((re = o.tableConfig) != null && re.tabConf) && ((ne = o.tableConfig) != null && ne.tabConf.fetch) && (w.value = await ((Pe = o.tableConfig) == null ? void 0 : Pe.tabConf.fetch(Object.assign({}, await te(), (Oe = o.tableConfig) == null ? void 0 : Oe.tabConf.queryMap))), Y.value = !1), G.value;
7847
+ return await mt(!0), !E && ((re = o.tableConfig) != null && re.tabConf) && ((ne = o.tableConfig) != null && ne.tabConf.fetch) && (s.value = await ((Pe = o.tableConfig) == null ? void 0 : Pe.tabConf.fetch(Object.assign({}, await te(), (Oe = o.tableConfig) == null ? void 0 : Oe.tabConf.queryMap))), Y.value = !1), G.value;
7848
7848
  }
7849
7849
  function Mn() {
7850
7850
  H.value = at.cloneDeep(C.value.getData()), fn();
@@ -7888,8 +7888,8 @@ const Km = /* @__PURE__ */ Ze(Hm, [["__scopeId", "data-v-37fedb7f"]]), Jm = {
7888
7888
  }, null, 8, ["modelValue", "tbName", "column", "size", "isShowRefresh", "loading", "toolbar", "isDialog"])) : le("", !0),
7889
7889
  E.tableConfig.tabConf ? (h(), Q("div", Xm, [
7890
7890
  fe(Pe, {
7891
- modelValue: s.value,
7892
- "onUpdate:modelValue": re[1] || (re[1] = (dt) => s.value = dt),
7891
+ modelValue: w.value,
7892
+ "onUpdate:modelValue": re[1] || (re[1] = (dt) => w.value = dt),
7893
7893
  size: "default",
7894
7894
  onChange: At
7895
7895
  }, {
package/example/App.vue CHANGED
@@ -1,252 +1,252 @@
1
- <template>
2
- <el-config-provider :locale="zhCn">
3
- <div class="layout-padding">
4
- <ElPlusTable ref="listTableRef" :tableConfig="tableConfig" colMinWidth="100px" :isIndex="false" headerAlign="center"></ElPlusTable>
5
-
6
- <ElPlusFormGroup v-model="formData" :formGroup="formGroupConfig">
7
- <template #default0>default0插槽</template>
8
- <template #default1>default1插槽</template>
9
- <template #default2>default2插槽</template>
10
- </ElPlusFormGroup>
11
- </div>
12
- </el-config-provider>
13
- </template>
14
-
15
- <script setup lang="ts" name="systemUser">
16
- import { reactive, ref, onMounted } from 'vue'
17
- import zhCn from 'element-plus/es/locale/lang/zh-cn'
18
- import { ElMessage } from 'element-plus'
19
- import { IFormBack, IFormDesc, IFormGroupConfig, ITableConfig } from 'types'
20
-
21
- let formData = reactive({
22
- name: ''
23
- } as any)
24
- const formGroupConfig = ref({
25
- column: 2,
26
- // requestFn: () => {},
27
- beforeRequest: (data: any) => {
28
- return data
29
- },
30
- success: (formBack: IFormBack) => {
31
- ElMessage.success('保存成功~')
32
- // 表单回调
33
- formBack.callBack && formBack.callBack()
34
- },
35
- group: [
36
- {
37
- title: '基本信息',
38
- formDesc: {
39
- name: { type: 'input', label: '名称', require: true, attrs: { maxlength: 30 } },
40
- contactsName: { type: 'input', label: '联系人', require: true, attrs: { maxlength: 20 } },
41
- contactsPhone: { type: 'input', label: '联系电话', rules: 'phone', require: true }
42
- } as IFormDesc
43
- },
44
- {
45
- title: '地址信息',
46
- formDesc: {
47
- // _area: { type: 'area', label: '所在地区', require: true },
48
- address: { type: 'input', label: '详细地址', require: true, attrs: { maxlength: 50 } }
49
- } as IFormDesc
50
- },
51
- // {
52
- // title: '文件上传',
53
- // formDesc: {
54
- // businessLicense: { type: 'upload', label: '营业执照', require: true, colspan: 2 },
55
- // appendix: { type: 'upload', upType: 'file', label: '附件', multiple: true, require: true, colspan: 2 }
56
- // } as IFormDesc
57
- // },
58
- {
59
- title: '备注信息',
60
- formDesc: {
61
- remark: { type: 'textarea', label: '备注', colspan: 2, require: true }
62
- } as IFormDesc
63
- }
64
- ]
65
- } as IFormGroupConfig)
66
-
67
- const tableConfig = ref({
68
- // fetch: queryDistributorPage,
69
- // tbName: 'goodsList',
70
- column: [
71
- { prop: 'distributorName', label: '二级企业名称', width: '120px', fixed: 'left' },
72
- { prop: 'distributorName', label: '经营主体', width: '160px', fixed: 'left' },
73
- {
74
- label: '合同执行',
75
- children: [
76
- {
77
- label: '采购业务',
78
- children: [
79
- {
80
- label: '本月发生',
81
- children: [
82
- { prop: 'goodsName', label: '数量(万吨)' },
83
- { prop: 'goodsName', label: '金额(万元)' }
84
- ]
85
- },
86
- {
87
- label: '本年累计数',
88
- children: [
89
- {
90
- label: '上游供应',
91
- children: [
92
- { prop: 'goodsName', label: '区域' },
93
- { prop: 'goodsName', label: '供应方性质' }
94
- ]
95
- },
96
- {
97
- label: '数量(万吨)',
98
- children: [
99
- { prop: 'goodsName', label: '数值' },
100
- { prop: 'goodsName', label: '去年金额' },
101
- { prop: 'goodsName', label: '同比' }
102
- ]
103
- },
104
- {
105
- label: '金额(万元)',
106
- children: [
107
- { prop: 'goodsName', label: '数值' },
108
- { prop: 'goodsName', label: '去年金额' },
109
- { prop: 'goodsName', label: '同比' }
110
- ]
111
- }
112
- ]
113
- }
114
- ]
115
- },
116
- {
117
- label: '销售业务',
118
- children: [
119
- {
120
- label: '本月发生',
121
- children: [
122
- { prop: 'goodsName', label: '数量(万吨)' },
123
- { prop: 'goodsName', label: '金额(万元)' }
124
- ]
125
- },
126
- {
127
- label: '本年累计数',
128
- children: [
129
- {
130
- label: '上游供应',
131
- children: [
132
- { prop: 'goodsName', label: '区域' },
133
- { prop: 'goodsName', label: '供应方性质' }
134
- ]
135
- },
136
- {
137
- label: '数量(万吨)',
138
- children: [
139
- { prop: 'goodsName', label: '数值' },
140
- { prop: 'goodsName', label: '去年金额' },
141
- { prop: 'goodsName', label: '同比' }
142
- ]
143
- },
144
- {
145
- label: '金额(万元)',
146
- children: [
147
- { prop: 'goodsName', label: '数值' },
148
- { prop: 'goodsName', label: '去年金额' },
149
- { prop: 'goodsName', label: '同比' }
150
- ]
151
- }
152
- ]
153
- }
154
- ]
155
- }
156
- ]
157
- },
158
- {
159
- label: '财务数据',
160
- children: [
161
- {
162
- label: '营业收入',
163
- children: [
164
- {
165
- label: '本月发生',
166
- children: [
167
- { prop: 'goodsName', label: '数量(万吨)' },
168
- { prop: 'goodsName', label: '金额(万元)' }
169
- ]
170
- },
171
- {
172
- label: '本年累计数',
173
- children: [
174
- { prop: 'goodsName', label: '数量(万吨)' },
175
- { prop: 'goodsName', label: '金额(万元)' },
176
- { prop: 'goodsName', label: '去年金额' },
177
- { prop: 'goodsName', label: '同比' }
178
- ]
179
- }
180
- ]
181
- },
182
- {
183
- label: '营业成本',
184
- children: [
185
- {
186
- label: '本月发生',
187
- children: [
188
- { prop: 'goodsName', label: '数量(万吨)' },
189
- { prop: 'goodsName', label: '金额(万元)' }
190
- ]
191
- },
192
- {
193
- label: '本年累计数',
194
- children: [
195
- { prop: 'goodsName', label: '数量(万吨)' },
196
- { prop: 'goodsName', label: '金额(万元)' },
197
- { prop: 'goodsName', label: '去年金额' },
198
- { prop: 'goodsName', label: '同比' }
199
- ]
200
- }
201
- ]
202
- },
203
- {
204
- label: '业务毛利率',
205
- children: [
206
- { prop: 'goodsName', label: '数值' },
207
- { prop: 'goodsName', label: '去年数值' },
208
- { prop: 'goodsName', label: '同比' }
209
- ]
210
- },
211
- {
212
- label: '营业利润',
213
- children: [
214
- { prop: 'goodsName', label: '金额(万元)' },
215
- { prop: 'goodsName', label: '去年金额' },
216
- { prop: 'goodsName', label: '同比' }
217
- ]
218
- }
219
- ]
220
- },
221
- {
222
- label: '操作',
223
- fixed: 'right',
224
- type: 'btns',
225
- btns: []
226
- }
227
- ],
228
- queryMap: {},
229
- toolbar: {
230
- // 功能按钮列表
231
- btns: [{ label: '新增商品', type: 'add', on: { click: () => {} } }],
232
- formConfig: {
233
- beforeRequest: (data: any) => {
234
- if (data.goodsKinds) {
235
- data.goodsKinds = data.goodsKinds[data.goodsKinds.length - 1]
236
- }
237
- return data
238
- },
239
- formDesc: {
240
- searchKey: { type: 'input', label: '输入查询', placeholder: '物料编码、商品条码、商品名称、自编码、属性' },
241
- enabled: { type: 'select', label: '状态', options: 'enabledList' }
242
- }
243
- }
244
- // 导出信息
245
- // export: { url: exportUrl, name: '商品信息导出' }
246
- }
247
- } as ITableConfig)
248
-
249
- onMounted(async () => {
250
- // 初始化部门列表
251
- })
252
- </script>
1
+ <template>
2
+ <el-config-provider :locale="zhCn">
3
+ <div class="layout-padding">
4
+ <ElPlusTable ref="listTableRef" :tableConfig="tableConfig" colMinWidth="100px" :isIndex="false" headerAlign="center"></ElPlusTable>
5
+
6
+ <ElPlusFormGroup v-model="formData" :formGroup="formGroupConfig">
7
+ <template #default0>default0插槽</template>
8
+ <template #default1>default1插槽</template>
9
+ <template #default2>default2插槽</template>
10
+ </ElPlusFormGroup>
11
+ </div>
12
+ </el-config-provider>
13
+ </template>
14
+
15
+ <script setup lang="ts" name="systemUser">
16
+ import { reactive, ref, onMounted } from 'vue'
17
+ import zhCn from 'element-plus/es/locale/lang/zh-cn'
18
+ import { ElMessage } from 'element-plus'
19
+ import { IFormBack, IFormDesc, IFormGroupConfig, ITableConfig } from 'types'
20
+
21
+ let formData = reactive({
22
+ name: ''
23
+ } as any)
24
+ const formGroupConfig = ref({
25
+ column: 2,
26
+ // requestFn: () => {},
27
+ beforeRequest: (data: any) => {
28
+ return data
29
+ },
30
+ success: (formBack: IFormBack) => {
31
+ ElMessage.success('保存成功~')
32
+ // 表单回调
33
+ formBack.callBack && formBack.callBack()
34
+ },
35
+ group: [
36
+ {
37
+ title: '基本信息',
38
+ formDesc: {
39
+ name: { type: 'input', label: '名称', require: true, attrs: { maxlength: 30 } },
40
+ contactsName: { type: 'input', label: '联系人', require: true, attrs: { maxlength: 20 } },
41
+ contactsPhone: { type: 'input', label: '联系电话', rules: 'phone', require: true }
42
+ } as IFormDesc
43
+ },
44
+ {
45
+ title: '地址信息',
46
+ formDesc: {
47
+ // _area: { type: 'area', label: '所在地区', require: true },
48
+ address: { type: 'input', label: '详细地址', require: true, attrs: { maxlength: 50 } }
49
+ } as IFormDesc
50
+ },
51
+ // {
52
+ // title: '文件上传',
53
+ // formDesc: {
54
+ // businessLicense: { type: 'upload', label: '营业执照', require: true, colspan: 2 },
55
+ // appendix: { type: 'upload', upType: 'file', label: '附件', multiple: true, require: true, colspan: 2 }
56
+ // } as IFormDesc
57
+ // },
58
+ {
59
+ title: '备注信息',
60
+ formDesc: {
61
+ remark: { type: 'textarea', label: '备注', colspan: 2, require: true }
62
+ } as IFormDesc
63
+ }
64
+ ]
65
+ } as IFormGroupConfig)
66
+
67
+ const tableConfig = ref({
68
+ // fetch: queryDistributorPage,
69
+ // tbName: 'goodsList',
70
+ column: [
71
+ { prop: 'distributorName', label: '二级企业名称', width: '120px', fixed: 'left' },
72
+ { prop: 'distributorName', label: '经营主体', width: '160px', fixed: 'left' },
73
+ {
74
+ label: '合同执行',
75
+ children: [
76
+ {
77
+ label: '采购业务',
78
+ children: [
79
+ {
80
+ label: '本月发生',
81
+ children: [
82
+ { prop: 'goodsName', label: '数量(万吨)' },
83
+ { prop: 'goodsName', label: '金额(万元)' }
84
+ ]
85
+ },
86
+ {
87
+ label: '本年累计数',
88
+ children: [
89
+ {
90
+ label: '上游供应',
91
+ children: [
92
+ { prop: 'goodsName', label: '区域' },
93
+ { prop: 'goodsName', label: '供应方性质' }
94
+ ]
95
+ },
96
+ {
97
+ label: '数量(万吨)',
98
+ children: [
99
+ { prop: 'goodsName', label: '数值' },
100
+ { prop: 'goodsName', label: '去年金额' },
101
+ { prop: 'goodsName', label: '同比' }
102
+ ]
103
+ },
104
+ {
105
+ label: '金额(万元)',
106
+ children: [
107
+ { prop: 'goodsName', label: '数值' },
108
+ { prop: 'goodsName', label: '去年金额' },
109
+ { prop: 'goodsName', label: '同比' }
110
+ ]
111
+ }
112
+ ]
113
+ }
114
+ ]
115
+ },
116
+ {
117
+ label: '销售业务',
118
+ children: [
119
+ {
120
+ label: '本月发生',
121
+ children: [
122
+ { prop: 'goodsName', label: '数量(万吨)' },
123
+ { prop: 'goodsName', label: '金额(万元)' }
124
+ ]
125
+ },
126
+ {
127
+ label: '本年累计数',
128
+ children: [
129
+ {
130
+ label: '上游供应',
131
+ children: [
132
+ { prop: 'goodsName', label: '区域' },
133
+ { prop: 'goodsName', label: '供应方性质' }
134
+ ]
135
+ },
136
+ {
137
+ label: '数量(万吨)',
138
+ children: [
139
+ { prop: 'goodsName', label: '数值' },
140
+ { prop: 'goodsName', label: '去年金额' },
141
+ { prop: 'goodsName', label: '同比' }
142
+ ]
143
+ },
144
+ {
145
+ label: '金额(万元)',
146
+ children: [
147
+ { prop: 'goodsName', label: '数值' },
148
+ { prop: 'goodsName', label: '去年金额' },
149
+ { prop: 'goodsName', label: '同比' }
150
+ ]
151
+ }
152
+ ]
153
+ }
154
+ ]
155
+ }
156
+ ]
157
+ },
158
+ {
159
+ label: '财务数据',
160
+ children: [
161
+ {
162
+ label: '营业收入',
163
+ children: [
164
+ {
165
+ label: '本月发生',
166
+ children: [
167
+ { prop: 'goodsName', label: '数量(万吨)' },
168
+ { prop: 'goodsName', label: '金额(万元)' }
169
+ ]
170
+ },
171
+ {
172
+ label: '本年累计数',
173
+ children: [
174
+ { prop: 'goodsName', label: '数量(万吨)' },
175
+ { prop: 'goodsName', label: '金额(万元)' },
176
+ { prop: 'goodsName', label: '去年金额' },
177
+ { prop: 'goodsName', label: '同比' }
178
+ ]
179
+ }
180
+ ]
181
+ },
182
+ {
183
+ label: '营业成本',
184
+ children: [
185
+ {
186
+ label: '本月发生',
187
+ children: [
188
+ { prop: 'goodsName', label: '数量(万吨)' },
189
+ { prop: 'goodsName', label: '金额(万元)' }
190
+ ]
191
+ },
192
+ {
193
+ label: '本年累计数',
194
+ children: [
195
+ { prop: 'goodsName', label: '数量(万吨)' },
196
+ { prop: 'goodsName', label: '金额(万元)' },
197
+ { prop: 'goodsName', label: '去年金额' },
198
+ { prop: 'goodsName', label: '同比' }
199
+ ]
200
+ }
201
+ ]
202
+ },
203
+ {
204
+ label: '业务毛利率',
205
+ children: [
206
+ { prop: 'goodsName', label: '数值' },
207
+ { prop: 'goodsName', label: '去年数值' },
208
+ { prop: 'goodsName', label: '同比' }
209
+ ]
210
+ },
211
+ {
212
+ label: '营业利润',
213
+ children: [
214
+ { prop: 'goodsName', label: '金额(万元)' },
215
+ { prop: 'goodsName', label: '去年金额' },
216
+ { prop: 'goodsName', label: '同比' }
217
+ ]
218
+ }
219
+ ]
220
+ },
221
+ {
222
+ label: '操作',
223
+ fixed: 'right',
224
+ type: 'btns',
225
+ btns: []
226
+ }
227
+ ],
228
+ queryMap: {},
229
+ toolbar: {
230
+ // 功能按钮列表
231
+ btns: [{ label: '新增商品', type: 'add', on: { click: () => {} } }],
232
+ formConfig: {
233
+ beforeRequest: (data: any) => {
234
+ if (data.goodsKinds) {
235
+ data.goodsKinds = data.goodsKinds[data.goodsKinds.length - 1]
236
+ }
237
+ return data
238
+ },
239
+ formDesc: {
240
+ searchKey: { type: 'input', label: '输入查询', placeholder: '物料编码、商品条码、商品名称、自编码、属性' },
241
+ enabled: { type: 'select', label: '状态', options: 'enabledList' }
242
+ }
243
+ }
244
+ // 导出信息
245
+ // export: { url: exportUrl, name: '商品信息导出' }
246
+ }
247
+ } as ITableConfig)
248
+
249
+ onMounted(async () => {
250
+ // 初始化部门列表
251
+ })
252
+ </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <el-input-number v-if="isInit" class="ElPlusFormNumber-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue" :disabled="disabled" @focus="handelFocus" @blur="handelBlur" onkeypress="return( /[\d\.]/.test(String.fromCharCode(event.keyCode)))" />
2
+ <el-input-number v-if="isInit" class="ElPlusFormNumber-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue" :disabled="disabled" @focus="handelFocus" @blur="handelBlur" onkeypress="return( /[-\d\.]/.test(String.fromCharCode(event.keyCode)))" />
3
3
  </template>
4
4
  <script lang="ts">
5
5
  export default {
@@ -167,8 +167,17 @@ const handelSpanMethod = ref(null as unknown as Function)
167
167
  const elPlusTableRef = ref()
168
168
 
169
169
  // 顶部Tab数据
170
- const tableTabVal = ref(props.tableConfig?.tabConf?.tabs[props.tableConfig?.tabConf?.default || 0].value ?? '')
171
170
  const tabStatic = ref({} as any)
171
+ const tableTabVal = ref(props.tableConfig?.tabConf?.tabs[props.tableConfig?.tabConf?.default || 0].value ?? '')
172
+ // const tableTabVal = computed(() => {
173
+ // if (props.tableConfig?.tabConf) {
174
+ // if (props.tableConfig?.tabConf?.defaultVal !== undefined && props.tableConfig?.tabConf?.defaultVal !== null) {
175
+ // return props.tableConfig?.tabConf?.defaultVal
176
+ // }
177
+ // return props.tableConfig?.tabConf?.tabs[props.tableConfig?.tabConf?.default || 0].value ?? ''
178
+ // }
179
+ // return ''
180
+ // })
172
181
  const getTabLabel = computed(() => (item: ITableTabItem) => {
173
182
  if (item.key) {
174
183
  return tabStatic.value[item.key] || 0
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "el-plus-crud",
3
- "version": "0.0.92",
3
+ "version": "0.0.94",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "el-plus-crud",
9
- "version": "0.0.92",
9
+ "version": "0.0.94",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@element-plus/icons-vue": "^2.1.0",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "el-plus-crud",
3
3
  "description": "采用Vue3 + TS,封装的element-plus数据驱动表单、列表组件",
4
4
  "author": "K.D.Jack",
5
- "version": "0.0.92",
5
+ "version": "0.0.94",
6
6
  "license": "MIT",
7
7
  "private": false,
8
8
  "main": "dist/el-plus-crud.mjs",
package/types/index.d.ts CHANGED
@@ -308,6 +308,8 @@ export interface ITableTabConf {
308
308
  queryMap?: any
309
309
  // 默认选中的下标
310
310
  default?: number
311
+ // 默认选中的值
312
+ defaultVal?: string | number
311
313
  }
312
314
 
313
315
  /**