meixioacomponent 2.0.40 → 2.0.41

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meixioacomponent",
3
- "version": "2.0.40",
3
+ "version": "2.0.41",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -20,43 +20,29 @@
20
20
 
21
21
  <script>
22
22
  import baseButtonHandleVue from '../baseButtonHandle/baseButtonHandle.vue'
23
- import {GetAreaTree} from "./api";
24
23
  import areaConfig from "./areaConfig";
25
24
  import {TransomComponentSize} from "../../../utils/utils";
25
+ import {mixinsByBaseArea} from "../../mixins/mixinsByBaseArea";
26
26
  //
27
27
 
28
28
  export default {
29
29
  name: 'baseArea',
30
30
  data() {
31
31
  return {
32
- loading: false,
33
32
  localValue: [],
34
33
  localDetailValue: {},
35
- placeholder: '请选择省市区镇',
36
- options: [],
37
34
  inputProps: {
38
35
  value: '',
39
36
  },
40
37
  }
41
38
  },
39
+ mixins: [mixinsByBaseArea],
42
40
  created() {
43
41
  },
44
-
45
- mounted() {
46
- this.loadArea('').then(res => {
47
- this.options = res;
48
- })
49
- },
50
-
51
42
  props: {
52
43
  value: {
53
44
  default: null,
54
45
  },
55
- disable: {
56
- type: Boolean,
57
- default: false,
58
- },
59
- size: {type: String, default: 'small'}
60
46
  },
61
47
 
62
48
  components: {
@@ -95,33 +81,6 @@ export default {
95
81
  }
96
82
  }
97
83
  },
98
- load(node) {
99
- const {value, data} = node;
100
- return new Promise((resolve) => {
101
- this.loadArea(data ? data.code : '').then(res => {
102
- resolve(res);
103
- })
104
- })
105
- },
106
-
107
- loadArea(keyword) {
108
- return new Promise((resolve) => {
109
- this.loading = true;
110
- GetAreaTree({
111
- keyword: keyword
112
- }).then(res => {
113
- if (Array.isArray(res)) {
114
- res.forEach(item => {
115
- item[`children`] = item.level !== 4;
116
- })
117
- this.loading = false;
118
- resolve(res);
119
- } else {
120
- resolve([]);
121
- }
122
- })
123
- })
124
- },
125
84
  onChange() {
126
85
  this.inputProps.value = '';
127
86
  this.$nextTick(() => {
@@ -0,0 +1,71 @@
1
+ <template>
2
+ <div class="base_area_by_multiple-wrap">
3
+ <t-cascader
4
+ ref="cascader"
5
+ v-model="value"
6
+ :options="options"
7
+ @change="onChange"
8
+ :load="load"
9
+ :keys="{
10
+ value:'value',
11
+ label:'name',
12
+ children: 'children',
13
+ }"
14
+ :disabled="disable||loading"
15
+ :placeholder="placeholder"
16
+ value-mode="all"
17
+ value-type="full"
18
+ multiple
19
+ clearable/>
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ /**
25
+ * 该组件不支持回显
26
+ */
27
+ import {defineComponent} from 'vue'
28
+ import {mixinsByBaseArea} from "../../mixins/mixinsByBaseArea";
29
+ import areaConfig from "../baseArea/areaConfig";
30
+
31
+ export default defineComponent({
32
+ name: "baseAreaByMultiple",
33
+ data() {
34
+ return {
35
+ options: [],
36
+ value: []
37
+ }
38
+ },
39
+ mixins: [mixinsByBaseArea],
40
+ methods: {
41
+ onChange() {
42
+ },
43
+ getCheckValue() {
44
+ const valueList = this.value;
45
+ const value = [];
46
+ for (let i = 0; i < valueList.length; i++) {
47
+ const itemLength = valueList[i];
48
+ const obj = {
49
+ idList: [],
50
+ };
51
+ for (let j = 0; j < itemLength.length; j++) {
52
+ const item = itemLength[j];
53
+ const splitList = item.split('-');
54
+ obj.idList.push(splitList[0]);
55
+ obj[`${areaConfig[j].value}`] = splitList[1];
56
+ }
57
+ value.push(obj);
58
+ }
59
+ return value;
60
+ }
61
+ }
62
+ })
63
+ </script>
64
+
65
+
66
+ <style scoped lang="less">
67
+ .base_area_by_multiple-wrap {
68
+ width: 100%;
69
+ height: auto;
70
+ }
71
+ </style>
@@ -0,0 +1,7 @@
1
+ import baseAreaByMultiple from "./baseAreaByMultiple.vue"
2
+
3
+ baseAreaByMultiple.install = function (Vue) {
4
+ Vue.component(baseAreaByMultiple.name, baseAreaByMultiple);
5
+ };
6
+
7
+ export default baseAreaByMultiple;
@@ -3,6 +3,7 @@ exports.__esModule = true;
3
3
  var baseAnchor_1 = require("./base/baseAnchor");
4
4
  var baseAppendix_1 = require("./base/baseAppendix");
5
5
  var baseArea_1 = require("./base/baseArea");
6
+ var baseAreaByMultiple_1 = require("./base/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");
@@ -94,6 +95,7 @@ var meixicomponents = [
94
95
  baseLineInfoGroup_1["default"],
95
96
  baseLineInfoItem_1["default"],
96
97
  basePageHeader_1["default"],
98
+ baseAreaByMultiple_1["default"],
97
99
  basePagination_1["default"],
98
100
  basePlainTable_1["default"],
99
101
  baseSection_1["default"],
@@ -176,6 +178,7 @@ var meixioacomponent = {
176
178
  basePagination: basePagination_1["default"],
177
179
  basePlainTable: basePlainTable_1["default"],
178
180
  baseSection: baseSection_1["default"],
181
+ baseAreaByMultiple: baseAreaByMultiple_1["default"],
179
182
  baseSkeleton: baseSkeleton_1["default"],
180
183
  baseSvg: baseSvg_1["default"],
181
184
  baseTimeTypeSelect: baseTimeTypeSelect_1["default"],
@@ -1,6 +1,7 @@
1
1
  import baseAnchor from "./base/baseAnchor";
2
2
  import baseAppendix from "./base/baseAppendix";
3
3
  import baseArea from "./base/baseArea";
4
+ import baseAreaByMultiple from "./base/baseAreaByMultiple"
4
5
  import baseAvatar from "./base/baseAvatar";
5
6
  import baseButtonHandle from "./base/baseButtonHandle";
6
7
  import baseDefaultSvg from "./base/baseDefaultSvg";
@@ -98,6 +99,7 @@ const meixicomponents: any[] = [
98
99
  baseLineInfoGroup,
99
100
  baseLineInfoItem,
100
101
  basePageHeader,
102
+ baseAreaByMultiple,
101
103
  basePagination,
102
104
  basePlainTable,
103
105
  baseSection,
@@ -185,6 +187,7 @@ const meixioacomponent = {
185
187
  basePagination,
186
188
  basePlainTable,
187
189
  baseSection,
190
+ baseAreaByMultiple,
188
191
  baseSkeleton,
189
192
  baseSvg,
190
193
  baseTimeTypeSelect,
@@ -0,0 +1,54 @@
1
+ import {GetAreaTree} from "../base/baseArea/api";
2
+
3
+ export const mixinsByBaseArea = {
4
+ data() {
5
+ return {
6
+ loading: false,
7
+ options: [],
8
+ placeholder: '请选择省市区镇',
9
+ }
10
+ },
11
+ mounted() {
12
+ this.loadArea('').then(res => {
13
+ this.options = res;
14
+ })
15
+ },
16
+ props: {
17
+ disable: {
18
+ type: Boolean,
19
+ default: false,
20
+ },
21
+ size: {type: String, default: 'small'}
22
+ },
23
+ methods: {
24
+ load(node) {
25
+ const {value, data} = node;
26
+ return new Promise((resolve) => {
27
+ this.loadArea(data ? data.code : '').then(res => {
28
+ resolve(res);
29
+ })
30
+ })
31
+ },
32
+ loadArea(keyword) {
33
+ return new Promise((resolve) => {
34
+ this.loading = true;
35
+ GetAreaTree({
36
+ keyword: keyword
37
+ }).then(res => {
38
+ if (Array.isArray(res)) {
39
+ res.forEach(item => {
40
+ item[`children`] = item.level !== 4;
41
+ item[`value`] = `${item.name}-${item.code}`
42
+ })
43
+ this.loading = false;
44
+ resolve(res);
45
+ } else {
46
+ resolve([]);
47
+ }
48
+ })
49
+ })
50
+ },
51
+ }
52
+
53
+
54
+ }
@@ -333,7 +333,6 @@ export default {
333
333
  formAreaConfirm(params) {
334
334
  this.submitVerifiData(params).then(res => {
335
335
  if (res) {
336
- this.$refs[`area-${params.config.key}`][0].doClose()
337
336
  this.$emit('formItemConfirm', params.config)
338
337
  } else {
339
338
  this.$message.error('请重新选择')