meixioacomponent 0.2.9 → 0.2.12

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": "0.2.09",
3
+ "version": "0.2.12",
4
4
  "private": false,
5
5
  "author": "YuRi",
6
6
  "main": "lib/meixioacomponent.umd.min.js",
@@ -22,7 +22,7 @@
22
22
  :event="true"
23
23
  @iconClick="backArea"
24
24
  v-show="activeIndex > 1"
25
- :name="`icon-icon-arrow-left`"
25
+ :name="`meixicomponenticon-icon-arrow-left`"
26
26
  ></base-icon>
27
27
  </div>
28
28
  </div>
@@ -92,6 +92,7 @@
92
92
  </template>
93
93
 
94
94
  <script>
95
+ import { json } from "body-parser";
95
96
  import baseButtonHandleVue from "../baseButtonHandle/baseButtonHandle.vue";
96
97
  //
97
98
  import areaJson from "./area";
@@ -116,23 +117,6 @@ export default {
116
117
  },
117
118
  created() {
118
119
  this.init();
119
- this.handleConfig = [
120
- {
121
- type: "info",
122
- text: this.module ? "取消" : "清空",
123
- plain: false,
124
- click: () => {
125
- this.cancelValue();
126
- },
127
- },
128
- {
129
- type: "primary",
130
- text: "确定",
131
- click: () => {
132
- this.confirmValue();
133
- },
134
- },
135
- ];
136
120
  },
137
121
 
138
122
  props: {
@@ -151,13 +135,14 @@ export default {
151
135
  computed: {
152
136
  module: {
153
137
  set(val) {
154
- //console.log(val);
138
+ console.log(val);
155
139
  this.$emit("input", val);
156
140
  },
157
141
  get() {
158
142
  return this.$props.value;
159
143
  },
160
144
  },
145
+
161
146
  suffixIcon() {
162
147
  if (this.isOpen) {
163
148
  return "el-icon-arrow-up";
@@ -223,8 +208,34 @@ export default {
223
208
  if (!this.isReview) {
224
209
  this.review();
225
210
  }
211
+ this.setHandleConfig();
226
212
  this.scrollToProvince();
227
213
  },
214
+ setHandleConfig() {
215
+ console.log(this.$props.value);
216
+ this.handleConfig = [
217
+ {
218
+ type: "info",
219
+ text: this.module ? "清空" : "取消",
220
+ plain: false,
221
+ click: () => {
222
+ if (!this.module) {
223
+ this.cancelValue();
224
+ } else {
225
+ this.cancelValue();
226
+ this.module = null;
227
+ }
228
+ },
229
+ },
230
+ {
231
+ type: "primary",
232
+ text: "确定",
233
+ click: () => {
234
+ this.confirmValue();
235
+ },
236
+ },
237
+ ];
238
+ },
228
239
 
229
240
  review() {
230
241
  // let provice = areaJson.findIndex((item) => {});
@@ -321,31 +332,29 @@ export default {
321
332
  this.areaValue = [];
322
333
  } else {
323
334
  this.init();
335
+ // this.module = null;
324
336
  this.isReview = false;
325
337
  }
326
- this.$refs.popover.doClose();
338
+ this.doClose();
327
339
  },
328
340
 
329
341
  confirmValue() {
330
342
  let value = {};
331
343
  for (let i = 0; i < this.areaValue.length; i++) {
332
344
  value[`${areaConfig[i].value}`] = this.areaValue[i].label;
333
- // if (this.module instanceof Object) {
334
- // this.module[`${areaConfig[i].value}`] = this.areaValue[i].label;
335
- // } else if (this.$props.value != null && !this.module) {
336
- // this.$emit("changeValue", {});
337
- // //console.log(this.value);
338
- // this.module[`${areaConfig[i].value}`] = this.areaValue[i].label;
339
- // // let obj = {};
340
- // // obj[`${areaConfig[i].value}`] = this.areaValue[i].label;
341
- // // this.module = obj;
342
- // }
343
345
  }
346
+ if (JSON.stringify(value) !== "{}") {
347
+ this.module = value;
348
+ }
349
+ if (this.$parent.$options._componentTag == "el-form-item") {
350
+ this.$emit("confirmAreaValue");
351
+ } else {
352
+ this.$emit("confirmAreaValue", value);
353
+ this.doClose();
354
+ }
355
+ },
344
356
 
345
- this.module = value;
346
-
347
- this.$emit("confirmAreaValue", value);
348
- //console.log(this.module);
357
+ doClose() {
349
358
  this.$refs.popover.doClose();
350
359
  },
351
360
 
@@ -36,9 +36,14 @@
36
36
  <baseAreaVue
37
37
  :disable="citem.disabled"
38
38
  v-if="citem.type == 'area'"
39
+ :ref="`area-${citem.key}`"
39
40
  v-model="formdata[`${citem.key}`]"
40
41
  :class="[`form-item-${citem.key}`]"
41
- @confirmAreaValue="formItemConfirm(citem)"
42
+ @confirmAreaValue="
43
+ formItemConfirm({
44
+ config: citem,
45
+ })
46
+ "
42
47
  ></baseAreaVue>
43
48
  <baseUploadVue
44
49
  :max="formConfig.max"
@@ -190,26 +195,46 @@ export default {
190
195
  },
191
196
 
192
197
  formItemConfirm(params) {
198
+ if (params.config.type == "area") {
199
+ this.formAreaConfirm(params);
200
+ return;
201
+ }
202
+ let result = this.submitVerifiData(params);
203
+ console.log(result);
204
+ if (result) {
205
+ params.this.handleConfirm();
206
+ this.$emit("formItemConfirm", params.config);
207
+ }
208
+ },
209
+ formAreaConfirm(params) {
210
+ let result = this.submitVerifiData(params);
211
+ if (result) {
212
+ this.$refs[`area-${params.config.key}`][0].doClose();
213
+ this.$emit("formItemConfirm", params.config);
214
+ } else {
215
+ this.$message.error("请重新选择");
216
+ }
217
+ },
218
+ submitVerifiData(params) {
193
219
  if (this.$props.rules) {
194
220
  // element 验证单条表单修改
221
+ let confrim = true;
195
222
  const rulesItem = this.$props.rules[params.config.key];
196
223
  if (rulesItem) {
197
224
  this.$refs.form.validateField(
198
225
  [`${params.config.key}`],
199
226
  (errorMsg) => {
200
- //console.log(errorMsg);
201
- if (!errorMsg) {
202
- params.this.handleConfirm();
203
- this.$emit("formItemConfirm", params.config);
204
- return;
227
+ console.log(errorMsg);
228
+ if (errorMsg) {
229
+ confrim = false;
205
230
  }
206
231
  }
207
232
  );
208
233
  }
209
- return;
234
+ return confrim;
235
+ } else {
236
+ return true;
210
237
  }
211
- params.this.handleConfirm();
212
- this.$emit("formItemConfirm", params.config);
213
238
  },
214
239
  setFormData() {
215
240
  this.formdata = {};
@@ -331,6 +356,11 @@ export default {
331
356
  /deep/ .el-form-item__label {
332
357
  line-height: 24px !important;
333
358
  }
359
+
360
+ /deep/ .el-form-item__error {
361
+ line-height: 0px;
362
+ padding-top: 0px;
363
+ }
334
364
  }
335
365
  }
336
366
  </style>
@@ -488,7 +488,6 @@ export default {
488
488
 
489
489
  .item-content {
490
490
  min-height: 24px;
491
- max-height: 24px;
492
491
  /deep/ .base-icon-wrap {
493
492
  width: 20px !important;
494
493
  height: 20px !important;