meixioacomponent 1.1.49 → 1.1.51

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.
Files changed (25) hide show
  1. package/lib/meixioacomponent.common.js +337 -52
  2. package/lib/meixioacomponent.umd.js +337 -52
  3. package/lib/meixioacomponent.umd.min.js +7 -7
  4. package/package.json +1 -1
  5. package/packages/components/base/baseArea/api.js +7 -0
  6. package/packages/components/base/baseArea/areaConfig.js +4 -3
  7. package/packages/components/base/baseArea/baseAreaV2.vue +157 -0
  8. package/packages/components/base/baseArea/index.js +2 -1
  9. package/packages/components/base/elDatePicker/basic/date-table.vue +441 -441
  10. package/packages/components/base/elDatePicker/basic/month-table.vue +269 -269
  11. package/packages/components/base/elDatePicker/basic/time-spinner.vue +304 -304
  12. package/packages/components/base/elDatePicker/basic/year-table.vue +111 -111
  13. package/packages/components/base/elDatePicker/index.js +6 -6
  14. package/packages/components/base/elDatePicker/index.vue +27 -27
  15. package/packages/components/base/elDatePicker/panel/date-range.vue +680 -680
  16. package/packages/components/base/elDatePicker/panel/date.vue +609 -609
  17. package/packages/components/base/elDatePicker/panel/month-range.vue +289 -289
  18. package/packages/components/base/elDatePicker/panel/time-range.vue +248 -248
  19. package/packages/components/base/elDatePicker/panel/time-select.vue +178 -178
  20. package/packages/components/base/elDatePicker/panel/time.vue +186 -186
  21. package/packages/components/base/elDatePicker/picker/date-picker.js +55 -55
  22. package/packages/components/base/elDatePicker/picker/time-picker.js +39 -39
  23. package/packages/components/base/elDatePicker/picker/time-select.js +21 -21
  24. package/packages/components/base/elDatePicker/picker.vue +956 -956
  25. package/packages/components/proForm/proForm/pro_form.vue +6 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meixioacomponent",
3
- "version": "1.1.49",
3
+ "version": "1.1.51",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -0,0 +1,7 @@
1
+ export const GetAreaTree = (params) => {
2
+ return window[`meixiRequest`]({
3
+ method: 'get',
4
+ params: params,
5
+ url: '/third/lbs/getAreaInfo',
6
+ })
7
+ }
@@ -1,6 +1,7 @@
1
1
  const areaConfig = [
2
- { value: "province" },
3
- { value: "city" },
4
- { value: "district" },
2
+ {value: "province"},
3
+ {value: "city"},
4
+ {value: "district"},
5
+ {value: 'town'}
5
6
  ];
6
7
  export default areaConfig;
@@ -0,0 +1,157 @@
1
+ <template>
2
+ <div class="base-area-select-wrap">
3
+ <el-cascader
4
+ ref="cascader"
5
+ :disabled="disable||loading"
6
+ :props="treeProps" :size="size" @change="onChange"
7
+ @expand-change="onExpandChange"
8
+ :placeholder="placeholder"
9
+ v-model="localValue">
10
+ <template #empty>
11
+ <el-empty description="正在加载数据中" v-if="loading"></el-empty>
12
+ <el-empty v-else description="暂无数据"></el-empty>
13
+ </template>
14
+ </el-cascader>
15
+ </div>
16
+ </template>
17
+
18
+ <script>
19
+ import baseButtonHandleVue from '../baseButtonHandle/baseButtonHandle.vue'
20
+ import {GetAreaTree} from "./api";
21
+ import areaConfig from "./areaConfig";
22
+ //
23
+
24
+ export default {
25
+ name: 'baseArea',
26
+ data() {
27
+ return {
28
+ loading: false,
29
+ localValue: '',
30
+ localDetailValue: {},
31
+ treeProps: {
32
+ lazy: true,
33
+ value: 'name',
34
+ label: 'name',
35
+ leaf: 'leaf',
36
+ lazyLoad: (node, resolve) => {
37
+ const {level, value} = node;
38
+ this.loading = true;
39
+ GetAreaTree({
40
+ keyword: value
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
+ }
56
+ },
57
+ created() {
58
+ },
59
+
60
+ mounted() {
61
+ if (this.module) {
62
+ const {province, city, district, town} = this.module;
63
+ this.localValue = [province, city, district];
64
+ if (town) {
65
+ this.localValue.push(town);
66
+ }
67
+ this.localDetailValue = {
68
+ province,
69
+ city,
70
+ district,
71
+ town
72
+ }
73
+ this.placeholder = `${province}-${city}-${district}${town ? `-${town}` : ''}`
74
+ }
75
+ },
76
+
77
+ props: {
78
+ value: {
79
+ default: null,
80
+ },
81
+ disable: {
82
+ type: Boolean,
83
+ default: false,
84
+ },
85
+ size: {type: String, default: 'small'}
86
+ },
87
+
88
+ components: {
89
+ baseButtonHandleVue,
90
+ },
91
+ computed: {
92
+ module: {
93
+ set(val) {
94
+ this.$emit('input', val)
95
+ },
96
+ get() {
97
+ return this.$props.value
98
+ },
99
+ },
100
+
101
+ },
102
+ methods: {
103
+ onChange() {
104
+ this.onAreaChange(this.$refs.cascader.getCheckedNodes(false)[0]);
105
+ const _value = {
106
+ ...this.localDetailValue,
107
+ }
108
+ this.$emit('confirmAreaValue', _value)
109
+ this.module = _value;
110
+ },
111
+ onExpandChange(value) {
112
+ // console.log('onExpandChange')
113
+ // console.log(value);
114
+ },
115
+ onAreaChange(value) {
116
+ try {
117
+ const {level, label, data} = value;
118
+ if (!level) return;
119
+ for (let i = 0; i < level; i++) {
120
+ this.localDetailValue[`${areaConfig[i].value}`] = null;
121
+ }
122
+ if (!this.localDetailValue[`idList`]) {
123
+ this.localDetailValue[`idList`] = [0, 0, 0, 0];
124
+ }
125
+
126
+ this.localDetailValue[`${areaConfig[level - 1].value}`] = label;
127
+ this.localDetailValue[`idList`][level - 1] = data.code;
128
+ if (!value.parent) {
129
+ return;
130
+ }
131
+ this.onAreaChange(value.parent);
132
+ } catch (error) {
133
+ console.log(error);
134
+ }
135
+ },
136
+ },
137
+ watch: {
138
+ module(newVal, oldVal) {
139
+
140
+ },
141
+ },
142
+ }
143
+ </script>
144
+
145
+ <style lang="less" scoped>
146
+ .base-area-select-wrap {
147
+ width: 100%;
148
+ height: auto;
149
+ overflow: hidden;
150
+ border-radius: calc(var(--radius) * 2);
151
+
152
+ /deep/ .el-cascader {
153
+ width: 100% !important;
154
+ }
155
+ }
156
+
157
+ </style>
@@ -1,7 +1,8 @@
1
1
  import baseArea from "./baseArea.vue";
2
+ import baseAreaV2 from "./baseAreaV2.vue";
2
3
 
3
4
  baseArea.install = function (Vue) {
4
- Vue.component(baseArea.name, baseArea);
5
+ Vue.component(baseArea.name, baseAreaV2);
5
6
  };
6
7
 
7
8
  export default baseArea;