meixioacomponent 1.1.52 → 1.1.53
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/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +5 -2
- package/lib/meixioacomponent.common.js +473 -271
- package/lib/meixioacomponent.umd.js +473 -271
- package/lib/meixioacomponent.umd.min.js +2 -2
- package/package.json +1 -1
- package/packages/components/base/{baseArea → area/baseArea}/baseArea.vue +1 -1
- package/packages/components/base/{baseArea → area/baseArea}/baseAreaV2.vue +4 -46
- package/packages/components/base/area/baseAreaByMultiple/baseAreaByMultiple.vue +82 -0
- package/packages/components/base/area/baseAreaByMultiple/index.js +7 -0
- package/packages/components/base/area/mixins/mixinsByArea.js +33 -0
- package/packages/components/index.js +5 -2
- package/packages/components/index.ts +6 -2
- package/packages/components/proForm/proForm/pro_form.vue +2 -2
- /package/packages/components/base/{baseArea → area/baseArea}/api.js +0 -0
- /package/packages/components/base/{baseArea → area/baseArea}/area.js +0 -0
- /package/packages/components/base/{baseArea → area/baseArea}/areaConfig.js +0 -0
- /package/packages/components/base/{baseArea → area/baseArea}/index.js +0 -0
package/package.json
CHANGED
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
|
|
93
93
|
<script>
|
|
94
94
|
import {json} from 'body-parser'
|
|
95
|
-
import baseButtonHandleVue from '
|
|
95
|
+
import baseButtonHandleVue from '../../baseButtonHandle/baseButtonHandle.vue'
|
|
96
96
|
//
|
|
97
97
|
import areaJson from './area'
|
|
98
98
|
import areaConfig from './areaConfig'
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
ref="cascader"
|
|
5
5
|
:disabled="disable||loading"
|
|
6
6
|
:props="treeProps" :size="size" @change="onChange"
|
|
7
|
-
@expand-change="onExpandChange"
|
|
8
7
|
:placeholder="placeholder"
|
|
9
8
|
v-model="localValue">
|
|
10
9
|
<template #empty>
|
|
@@ -16,46 +15,23 @@
|
|
|
16
15
|
</template>
|
|
17
16
|
|
|
18
17
|
<script>
|
|
19
|
-
import baseButtonHandleVue from '../baseButtonHandle/baseButtonHandle.vue'
|
|
20
|
-
import {GetAreaTree} from "./api";
|
|
21
18
|
import areaConfig from "./areaConfig";
|
|
19
|
+
import {mixinsByArea} from "../mixins/mixinsByArea";
|
|
22
20
|
//
|
|
23
21
|
|
|
24
22
|
export default {
|
|
25
23
|
name: 'baseArea',
|
|
26
24
|
data() {
|
|
27
25
|
return {
|
|
28
|
-
loading: false,
|
|
29
26
|
localValue: '',
|
|
30
27
|
localDetailValue: {},
|
|
31
|
-
treeProps: {
|
|
32
|
-
lazy: true,
|
|
33
|
-
value: 'name',
|
|
34
|
-
label: 'name',
|
|
35
|
-
leaf: 'leaf',
|
|
36
|
-
lazyLoad: (node, resolve) => {
|
|
37
|
-
const {level, value, data} = node;
|
|
38
|
-
this.loading = true;
|
|
39
|
-
GetAreaTree({
|
|
40
|
-
keyword: data ? data.code : ''
|
|
41
|
-
}).then(res => {
|
|
42
|
-
if (Array.isArray(res)) {
|
|
43
|
-
res.forEach(item => {
|
|
44
|
-
item[`leaf`] = item.level === 4;
|
|
45
|
-
})
|
|
46
|
-
this.loading = false;
|
|
47
|
-
resolve(res);
|
|
48
|
-
} else {
|
|
49
|
-
resolve([]);
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
placeholder: '请选择省市区镇'
|
|
55
28
|
}
|
|
56
29
|
},
|
|
57
30
|
created() {
|
|
58
31
|
},
|
|
32
|
+
mixins: [
|
|
33
|
+
mixinsByArea
|
|
34
|
+
],
|
|
59
35
|
|
|
60
36
|
mounted() {
|
|
61
37
|
if (this.module) {
|
|
@@ -78,15 +54,6 @@ export default {
|
|
|
78
54
|
value: {
|
|
79
55
|
default: null,
|
|
80
56
|
},
|
|
81
|
-
disable: {
|
|
82
|
-
type: Boolean,
|
|
83
|
-
default: false,
|
|
84
|
-
},
|
|
85
|
-
size: {type: String, default: 'small'}
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
components: {
|
|
89
|
-
baseButtonHandleVue,
|
|
90
57
|
},
|
|
91
58
|
computed: {
|
|
92
59
|
module: {
|
|
@@ -108,10 +75,6 @@ export default {
|
|
|
108
75
|
this.$emit('confirmAreaValue', _value)
|
|
109
76
|
this.module = _value;
|
|
110
77
|
},
|
|
111
|
-
onExpandChange(value) {
|
|
112
|
-
// console.log('onExpandChange')
|
|
113
|
-
// console.log(value);
|
|
114
|
-
},
|
|
115
78
|
onAreaChange(value) {
|
|
116
79
|
try {
|
|
117
80
|
const {level, label, data} = value;
|
|
@@ -134,11 +97,6 @@ export default {
|
|
|
134
97
|
}
|
|
135
98
|
},
|
|
136
99
|
},
|
|
137
|
-
watch: {
|
|
138
|
-
module(newVal, oldVal) {
|
|
139
|
-
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
100
|
}
|
|
143
101
|
</script>
|
|
144
102
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="base_area_multiple-wrap">
|
|
3
|
+
<el-cascader
|
|
4
|
+
ref="cascader"
|
|
5
|
+
:disabled="disable||loading"
|
|
6
|
+
:props="{
|
|
7
|
+
...treeProps,
|
|
8
|
+
multiple: true,
|
|
9
|
+
checkStrictly: true
|
|
10
|
+
}" :size="size"
|
|
11
|
+
:placeholder="placeholder">
|
|
12
|
+
<template #empty>
|
|
13
|
+
<el-empty description="正在加载数据中" v-if="loading"></el-empty>
|
|
14
|
+
<el-empty v-else description="暂无数据"></el-empty>
|
|
15
|
+
</template>
|
|
16
|
+
</el-cascader>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
/**
|
|
23
|
+
* 该组件不支持回显数据
|
|
24
|
+
*/
|
|
25
|
+
import {defineComponent} from 'vue'
|
|
26
|
+
import {mixinsByArea} from "../mixins/mixinsByArea";
|
|
27
|
+
import areaConfig from "../baseArea/areaConfig";
|
|
28
|
+
|
|
29
|
+
export default defineComponent({
|
|
30
|
+
name: "baseAreaByMultiple",
|
|
31
|
+
data() {
|
|
32
|
+
return {
|
|
33
|
+
tempItem: {},
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
mixins: [mixinsByArea],
|
|
37
|
+
methods: {
|
|
38
|
+
getCheckValue() {
|
|
39
|
+
const valueList = [];
|
|
40
|
+
const checkNodesList = this.$refs.cascader.getCheckedNodes(false);
|
|
41
|
+
for (let i = 0; i < checkNodesList.length; i++) {
|
|
42
|
+
const item = checkNodesList[i];
|
|
43
|
+
this.onAreaChange(item, valueList);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return valueList;
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
onAreaChange(value, list) {
|
|
50
|
+
try {
|
|
51
|
+
const {level, label, data} = value;
|
|
52
|
+
if (!level) return;
|
|
53
|
+
for (let i = 0; i < level; i++) {
|
|
54
|
+
this.tempItem[`${areaConfig[i].value}`] = null;
|
|
55
|
+
}
|
|
56
|
+
if (!this.tempItem[`idList`]) {
|
|
57
|
+
this.tempItem[`idList`] = [];
|
|
58
|
+
}
|
|
59
|
+
this.tempItem[`${areaConfig[level - 1].value}`] = label;
|
|
60
|
+
this.tempItem[`idList`][level - 1] = data.code;
|
|
61
|
+
if (!value.parent) {
|
|
62
|
+
list.push(JSON.parse(JSON.stringify(this.tempItem)));
|
|
63
|
+
this.tempItem = {};
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
this.onAreaChange(value.parent, list);
|
|
67
|
+
} catch (error) {
|
|
68
|
+
console.log(error);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
<style scoped lang="less">
|
|
77
|
+
.base_area_multiple-wrap {
|
|
78
|
+
width: 100%;
|
|
79
|
+
height: auto;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {GetAreaTree} from "../baseArea/api";
|
|
2
|
+
|
|
3
|
+
export const mixinsByArea = {
|
|
4
|
+
|
|
5
|
+
data() {
|
|
6
|
+
return {
|
|
7
|
+
loading: false, treeProps: {
|
|
8
|
+
lazy: true, value: 'name', label: 'name', leaf: 'leaf', lazyLoad: (node, resolve) => {
|
|
9
|
+
const {level, value, data} = node;
|
|
10
|
+
this.loading = true;
|
|
11
|
+
GetAreaTree({
|
|
12
|
+
keyword: data ? data.code : ''
|
|
13
|
+
}).then(res => {
|
|
14
|
+
if (Array.isArray(res)) {
|
|
15
|
+
res.forEach(item => {
|
|
16
|
+
item[`leaf`] = item.level === 4;
|
|
17
|
+
})
|
|
18
|
+
this.loading = false;
|
|
19
|
+
resolve(res);
|
|
20
|
+
} else {
|
|
21
|
+
resolve([]);
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
}, placeholder: '请选择省市区镇'
|
|
26
|
+
}
|
|
27
|
+
}, props: {
|
|
28
|
+
size: {type: String, default: 'small'}, disable: {
|
|
29
|
+
type: Boolean, default: false,
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
exports.__esModule = true;
|
|
3
3
|
var baseAnchor_1 = require("./base/baseAnchor");
|
|
4
4
|
var baseAppendix_1 = require("./base/baseAppendix");
|
|
5
|
-
var baseArea_1 = require("./base/baseArea");
|
|
5
|
+
var baseArea_1 = require("./base/area/baseArea");
|
|
6
|
+
var baseAreaByMultiple_1 = require("./base/area/baseAreaByMultiple");
|
|
6
7
|
var baseAvatar_1 = require("./base/baseAvatar");
|
|
7
8
|
var baseButtonHandle_1 = require("./base/baseButtonHandle");
|
|
8
9
|
var baseDefaultSvg_1 = require("./base/baseDefaultSvg");
|
|
@@ -106,6 +107,7 @@ var meixicomponents = [
|
|
|
106
107
|
index_3["default"],
|
|
107
108
|
baseMoverVerifiBar_1["default"],
|
|
108
109
|
baseTimeLine_1["default"],
|
|
110
|
+
baseAreaByMultiple_1["default"],
|
|
109
111
|
basePopoverButton_1["default"],
|
|
110
112
|
baseTreeSelect_1["default"],
|
|
111
113
|
baseUploadTemplate_1["default"],
|
|
@@ -121,7 +123,7 @@ var meixicomponents = [
|
|
|
121
123
|
baseWait_1["default"],
|
|
122
124
|
vuedraggable_1["default"],
|
|
123
125
|
baseUploadImgAndName_1["default"],
|
|
124
|
-
elDatePicker_1["default"]
|
|
126
|
+
elDatePicker_1["default"],
|
|
125
127
|
];
|
|
126
128
|
var install = function (Vue) {
|
|
127
129
|
componentConfig_1["default"].Vue = Vue;
|
|
@@ -195,6 +197,7 @@ var meixioacomponent = {
|
|
|
195
197
|
baseGuide: baseGuide_1["default"],
|
|
196
198
|
baseText: baseText_1["default"],
|
|
197
199
|
baseTag: baseTag_1["default"],
|
|
200
|
+
baseAreaByMultiple: baseAreaByMultiple_1["default"],
|
|
198
201
|
elDatePicker: elDatePicker_1["default"],
|
|
199
202
|
oaProTableSearch: oaProTableSearch_1["default"],
|
|
200
203
|
baseWait: baseWait_1["default"],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import baseAnchor from "./base/baseAnchor";
|
|
2
2
|
import baseAppendix from "./base/baseAppendix";
|
|
3
|
-
import baseArea from "./base/baseArea";
|
|
3
|
+
import baseArea from "./base/area/baseArea";
|
|
4
|
+
import baseAreaByMultiple from "./base/area/baseAreaByMultiple"
|
|
4
5
|
import baseAvatar from "./base/baseAvatar";
|
|
5
6
|
import baseButtonHandle from "./base/baseButtonHandle";
|
|
6
7
|
import baseDefaultSvg from "./base/baseDefaultSvg";
|
|
@@ -108,6 +109,7 @@ const meixicomponents: any[] = [
|
|
|
108
109
|
baseProTable,
|
|
109
110
|
baseMoverVerifiBar,
|
|
110
111
|
baseTimeLine,
|
|
112
|
+
baseAreaByMultiple,
|
|
111
113
|
basePopoverButton,
|
|
112
114
|
baseTreeSelect,
|
|
113
115
|
baseUploadTemplate,
|
|
@@ -123,7 +125,8 @@ const meixicomponents: any[] = [
|
|
|
123
125
|
baseWait,
|
|
124
126
|
draggable,
|
|
125
127
|
baseUploadImgAndName,
|
|
126
|
-
elDatePicker
|
|
128
|
+
elDatePicker,
|
|
129
|
+
|
|
127
130
|
];
|
|
128
131
|
|
|
129
132
|
const install = (Vue) => {
|
|
@@ -202,6 +205,7 @@ const meixioacomponent = {
|
|
|
202
205
|
baseGuide,
|
|
203
206
|
baseText,
|
|
204
207
|
baseTag,
|
|
208
|
+
baseAreaByMultiple,
|
|
205
209
|
elDatePicker,
|
|
206
210
|
oaProTableSearch,
|
|
207
211
|
baseWait,
|
|
@@ -125,14 +125,14 @@
|
|
|
125
125
|
|
|
126
126
|
<script>
|
|
127
127
|
import pro_form_itemVue from './proFormItem/pro_form_item.vue'
|
|
128
|
-
import baseAreaV2 from "../../base/baseArea/baseAreaV2.vue";
|
|
128
|
+
import baseAreaV2 from "../../base/area/baseArea/baseAreaV2.vue";
|
|
129
129
|
import baseUploadVue from '../../base/baseUpload/baseUpload.vue'
|
|
130
130
|
import pro_formItem_skeletonVue from './pro_form-item_skeleton.vue'
|
|
131
131
|
import baseButtonHandleVue from '../../base/baseButtonHandle/baseButtonHandle.vue'
|
|
132
132
|
//
|
|
133
133
|
import {ArrayChunk} from '../../../utils/utils'
|
|
134
134
|
import BaseNumberInput from '../../base/baseNumberInput/index.vue'
|
|
135
|
-
import BaseArea from "../../base/baseArea/baseArea.vue";
|
|
135
|
+
import BaseArea from "../../base/area/baseArea/baseArea.vue";
|
|
136
136
|
|
|
137
137
|
export default {
|
|
138
138
|
name: 'baseForm',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|