xianniu-ui 0.3.21 → 0.3.23
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/lib/xianniu-ui.common.js +99 -53
- package/lib/xianniu-ui.umd.js +99 -53
- package/lib/xianniu-ui.umd.min.js +3 -3
- package/package.json +2 -2
- package/packages/search/main.vue +30 -13
- package/packages/table/main.vue +11 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xianniu-ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.23",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "lib/xianniu-ui.umd.min.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"public"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"axios": "^0.26.0",
|
|
25
24
|
"core-js": "^3.6.5",
|
|
26
25
|
"dayjs": "^1.10.7",
|
|
27
26
|
"decimal.js": "^10.4.2",
|
|
@@ -39,6 +38,7 @@
|
|
|
39
38
|
"@vue/cli-plugin-router": "~4.5.0",
|
|
40
39
|
"@vue/cli-service": "~4.5.0",
|
|
41
40
|
"@vue/component-compiler-utils": "^2.6.0",
|
|
41
|
+
"axios": "^0.26.1",
|
|
42
42
|
"babel-eslint": "^10.1.0",
|
|
43
43
|
"babel-plugin-component": "^1.1.1",
|
|
44
44
|
"babel-plugin-module-resolver": "^2.7.1",
|
package/packages/search/main.vue
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="xn-search">
|
|
3
3
|
<el-form ref="form" inline :model="form" :label-width="labelWidth">
|
|
4
4
|
<el-row :gutter="0" class="xn-search--row">
|
|
5
|
-
<template v-for="(item, idx) in
|
|
5
|
+
<template v-for="(item, idx) in form.value">
|
|
6
6
|
<el-col v-bind="{ ...col }" :key="idx" v-show="item.isShow || isColl">
|
|
7
7
|
<el-form-item
|
|
8
8
|
v-if="item.type === 'city'"
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
class="xn-search--row_col"
|
|
13
13
|
>
|
|
14
14
|
<xn-city
|
|
15
|
+
:key="item.prop"
|
|
15
16
|
:data-level="(item.options && item.options.dataLevel) || 2"
|
|
16
|
-
v-model="
|
|
17
|
+
v-model="item.modelVal"
|
|
17
18
|
@on-city="handleChangeCity"
|
|
18
19
|
/>
|
|
19
20
|
</el-form-item>
|
|
@@ -25,9 +26,10 @@
|
|
|
25
26
|
class="xn-search--row_col"
|
|
26
27
|
>
|
|
27
28
|
<el-input
|
|
29
|
+
:key="item.prop"
|
|
28
30
|
style="width: 100%"
|
|
29
31
|
v-bind="item.options ? { ...item.options } : {}"
|
|
30
|
-
v-model="
|
|
32
|
+
v-model="item.modelVal"
|
|
31
33
|
:clearable="item.clearable || true"
|
|
32
34
|
:placeholder="item.placeholder || '请填写' + item.label"
|
|
33
35
|
/>
|
|
@@ -40,8 +42,9 @@
|
|
|
40
42
|
class="xn-search--row_col"
|
|
41
43
|
>
|
|
42
44
|
<el-select
|
|
45
|
+
:key="item.prop"
|
|
43
46
|
style="width: 100%"
|
|
44
|
-
v-model="
|
|
47
|
+
v-model="item.modelVal"
|
|
45
48
|
:placeholder="item.placeholder || '请选择' + item.label"
|
|
46
49
|
:clearable="item.clearable || true"
|
|
47
50
|
filterable
|
|
@@ -71,7 +74,8 @@
|
|
|
71
74
|
class="xn-search--row_col"
|
|
72
75
|
>
|
|
73
76
|
<xn-date
|
|
74
|
-
|
|
77
|
+
:key="item.prop"
|
|
78
|
+
v-model="item.modelVal"
|
|
75
79
|
:mode="item.mode || 'range'"
|
|
76
80
|
:type="item.type || 'daterange'"
|
|
77
81
|
:is-shortcut="showShortcut(item)"
|
|
@@ -203,16 +207,29 @@ export default {
|
|
|
203
207
|
};
|
|
204
208
|
},
|
|
205
209
|
created() {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
|
|
210
|
+
// this.init();
|
|
211
|
+
},
|
|
212
|
+
watch: {
|
|
213
|
+
formData: {
|
|
214
|
+
handler(n) {
|
|
215
|
+
n&&n.length&&this.init();
|
|
216
|
+
},
|
|
217
|
+
immediate:true
|
|
218
|
+
},
|
|
214
219
|
},
|
|
215
220
|
methods: {
|
|
221
|
+
init() {
|
|
222
|
+
this.form.value = []
|
|
223
|
+
for (let i = 0, formData = this.formData; i < formData.length; i++) {
|
|
224
|
+
const item = formData[i];
|
|
225
|
+
item.isShow = i > 3 && this.showColl ? false : true;
|
|
226
|
+
this.form.value.push({
|
|
227
|
+
...item,
|
|
228
|
+
key: item.prop,
|
|
229
|
+
modelVal: "",
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
},
|
|
216
233
|
onSearch() {
|
|
217
234
|
const formValue = {};
|
|
218
235
|
if (this.formData) {
|
package/packages/table/main.vue
CHANGED
|
@@ -121,13 +121,13 @@
|
|
|
121
121
|
type="index"
|
|
122
122
|
></el-table-column>
|
|
123
123
|
<slot>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
124
|
+
<template v-for="(item, idx) in columns">
|
|
125
|
+
<column
|
|
126
|
+
:key="idx"
|
|
127
|
+
v-if="item.checked === true"
|
|
128
|
+
v-bind="item"
|
|
129
|
+
></column>
|
|
130
|
+
</template>
|
|
131
131
|
</slot>
|
|
132
132
|
<template #append v-if="$slots.append">
|
|
133
133
|
<slot name="append"></slot>
|
|
@@ -199,10 +199,13 @@ export default {
|
|
|
199
199
|
},
|
|
200
200
|
computed: {},
|
|
201
201
|
created() {
|
|
202
|
+
|
|
203
|
+
},
|
|
204
|
+
updated() {
|
|
202
205
|
!this.$slots.default &&
|
|
203
206
|
this.columns.length &&
|
|
204
207
|
this.columns.forEach((item) => {
|
|
205
|
-
this.$set(item, "checked", true);
|
|
208
|
+
if(item.checked !== true) this.$set(item, "checked", true);
|
|
206
209
|
});
|
|
207
210
|
},
|
|
208
211
|
methods: {
|