meixioacomponent 0.2.3 → 0.2.6

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.03",
3
+ "version": "0.2.06",
4
4
  "private": false,
5
5
  "author": "YuRi",
6
6
  "main": "lib/meixioacomponent.umd.min.js",
@@ -17,12 +17,13 @@
17
17
  :prop="citem.key"
18
18
  :label="citem.label"
19
19
  v-for="(citem, cindex) in item"
20
- :class="[`chunk-${chunkLength}`, `${flexClass}`]"
20
+ :class="[`chunk-${chunkLength}`, `${flexClass}`, size]"
21
21
  >
22
22
  <span slot="label" class="item-label">{{ citem.label }}</span>
23
23
  <pro_form_itemVue
24
24
  :config="citem"
25
25
  :form="form"
26
+ :size="size"
26
27
  :class="[`form-item-${citem.key}`]"
27
28
  v-if="formType == 'default' && citem.type != 'area'"
28
29
  @formItemConfirm="formItemConfirm"
@@ -120,6 +121,16 @@ export default {
120
121
  type: Object,
121
122
  require: true,
122
123
  },
124
+
125
+ rowNumber: {
126
+ type: Number,
127
+ default: null,
128
+ },
129
+
130
+ size: {
131
+ type: String,
132
+ default: "small",
133
+ },
123
134
  },
124
135
  components: {
125
136
  baseAreaVue,
@@ -160,6 +171,11 @@ export default {
160
171
  ];
161
172
  }
162
173
 
174
+ if (this.$props.rowNumber) {
175
+ this.chunkLength = this.$props.rowNumber;
176
+ return;
177
+ }
178
+
163
179
  let width = this.$refs.proFormWrap.clientWidth;
164
180
  if (this.$props.formType != "default") {
165
181
  this.chunkLength = 1;
@@ -169,24 +185,29 @@ export default {
169
185
  this.chunkLength = 2;
170
186
  return;
171
187
  }
172
-
173
188
  this.chunkLength = 3;
174
189
  },
175
190
  formItemConfirm(params) {
176
- // element 验证单条表单修改
177
- const rulesItem = this.$props.rules[params.config.key];
178
- if (rulesItem) {
179
- this.$refs.form.validateField([`${params.config.key}`], (errorMsg) => {
180
- //console.log(errorMsg);
181
- if (!errorMsg) {
182
- params.this.handleConfirm();
183
- this.$emit("formItemConfirm", params.config);
184
- }
185
- });
186
- } else {
187
- params.this.handleConfirm();
188
- this.$emit("formItemConfirm", params.config);
191
+ if (this.$props.rules) {
192
+ // element 验证单条表单修改
193
+ const rulesItem = this.$props.rules[params.config.key];
194
+ if (rulesItem) {
195
+ this.$refs.form.validateField(
196
+ [`${params.config.key}`],
197
+ (errorMsg) => {
198
+ //console.log(errorMsg);
199
+ if (!errorMsg) {
200
+ params.this.handleConfirm();
201
+ this.$emit("formItemConfirm", params.config);
202
+ return;
203
+ }
204
+ }
205
+ );
206
+ }
207
+ return;
189
208
  }
209
+ params.this.handleConfirm();
210
+ this.$emit("formItemConfirm", params.config);
190
211
  },
191
212
  setFormData() {
192
213
  this.formdata = {};
@@ -292,5 +313,14 @@ export default {
292
313
  .form-footer {
293
314
  margin-top: var(--margin-5);
294
315
  }
316
+
317
+ .mini {
318
+ /deep/ .el-form-item {
319
+ margin-bottom: var(--margin-5);
320
+ }
321
+ /deep/ .el-form-item__label {
322
+ line-height: 28px !important;
323
+ }
324
+ }
295
325
  }
296
326
  </style>
@@ -1,6 +1,8 @@
1
1
  <template>
2
2
  <div
3
3
  :class="{
4
+ mini: size == 'mini',
5
+ small: size == 'small',
4
6
  'form-item-wrap': true,
5
7
  disabled: config.disabled,
6
8
  }"
@@ -49,6 +51,7 @@
49
51
  <el-input
50
52
  autosize
51
53
  disabled
54
+ :size="size"
52
55
  type="textarea"
53
56
  v-model="module"
54
57
  v-if="config.type == 'textarea'"
@@ -68,21 +71,21 @@
68
71
  <!-- input输入框 -->
69
72
  <el-input
70
73
  v-if="config.type == 'input'"
71
- size="small"
74
+ :size="size"
72
75
  v-model="module"
73
76
  style="width: 100%; height: 100%"
74
77
  >
75
78
  </el-input>
76
79
  <!-- 数字类型无小数 -->
77
80
  <el-input-number
78
- size="small"
81
+ :size="size"
79
82
  v-else-if="config.type == 'number'"
80
83
  v-model.number="module"
81
84
  :controls="false"
82
85
  ></el-input-number>
83
86
  <!--数字类型两位小数 -->
84
87
  <el-input-number
85
- size="small"
88
+ :size="size"
86
89
  :precision="2"
87
90
  v-model.number="module"
88
91
  :controls="false"
@@ -90,7 +93,7 @@
90
93
  ></el-input-number>
91
94
  <!-- select选择器 -->
92
95
  <el-select
93
- size="small"
96
+ :size="size"
94
97
  v-model="module"
95
98
  placeholder="请选择"
96
99
  :multiple="multiple"
@@ -113,7 +116,7 @@
113
116
  type="date"
114
117
  align="right"
115
118
  v-model="module"
116
- size="small"
119
+ :size="size"
117
120
  placeholder="选择日期"
118
121
  value-format="timestamp"
119
122
  :prefix-icon="`el-icon-time`"
@@ -137,6 +140,7 @@
137
140
  </el-radio-group>
138
141
  <!-- 选择器 -->
139
142
  <el-checkbox-group
143
+ :size="size"
140
144
  :min="checkMin"
141
145
  :max="checkMax"
142
146
  v-model="module"
@@ -153,6 +157,7 @@
153
157
  <!-- 文本输入框 -->
154
158
  <el-input
155
159
  autosize
160
+ :size="size"
156
161
  type="textarea"
157
162
  v-model="module"
158
163
  v-if="config.type == 'textarea'"
@@ -174,7 +179,7 @@
174
179
  <el-button
175
180
  type="info"
176
181
  size="small"
177
- icon="el-meixicomponenticon-close"
182
+ icon="el-icon-close"
178
183
  class="dropdown-button"
179
184
  @click="handleClick('edit')"
180
185
  plain
@@ -208,6 +213,11 @@ export default {
208
213
  },
209
214
 
210
215
  value: {},
216
+
217
+ size: {
218
+ type: String,
219
+ default: "small",
220
+ },
211
221
  },
212
222
 
213
223
  computed: {
@@ -248,10 +258,14 @@ export default {
248
258
  let list = this.selectData;
249
259
  if (list.length > 0) {
250
260
  if (!this.multiple) {
251
- let index = list.findIndex((item) => {
252
- return item.value == this.module;
253
- });
254
- return list[index].label;
261
+ if (this.module) {
262
+ let index = list.findIndex((item) => {
263
+ return item.value == this.module;
264
+ });
265
+ return list[index].label;
266
+ } else {
267
+ return "暂无数据";
268
+ }
255
269
  } else {
256
270
  let text = "";
257
271
  this.module.forEach((item) => {
@@ -269,9 +283,14 @@ export default {
269
283
  }
270
284
 
271
285
  case "time":
272
- let config = this.$props.config;
273
- let format = config.format ? config.format : "YYYY-MM-DD";
274
- return FilterTime(this.module, format);
286
+ if (this.module) {
287
+ let config = this.$props.config;
288
+ let format = config.format ? config.format : "YYYY-MM-DD";
289
+ return FilterTime(this.module, format);
290
+ } else {
291
+ return "暂无时间";
292
+ }
293
+
275
294
  default:
276
295
  return this.module;
277
296
  }
@@ -363,7 +382,6 @@ export default {
363
382
  border-radius: calc(var(--radius) * 2);
364
383
  .item-content {
365
384
  display: flex;
366
- min-height: 32px;
367
385
  align-items: center;
368
386
  flex-flow: row nowrap;
369
387
  box-sizing: border-box;
@@ -409,7 +427,6 @@ export default {
409
427
  }
410
428
  .item-handle-wrap {
411
429
  width: 100%;
412
- min-height: 32px;
413
430
  border-radius: inherit;
414
431
  /deep/ .el-input__inner {
415
432
  font-weight: var(--font-weight-kg) !important;
@@ -455,4 +472,31 @@ export default {
455
472
  color: var(--font-color-ds) !important;
456
473
  }
457
474
  }
475
+ .small {
476
+ .item-content {
477
+ min-height: 32px;
478
+ }
479
+ .item-handle-wrap {
480
+ min-height: 32px;
481
+ }
482
+ }
483
+ .mini {
484
+
485
+ /deep/ .item-label {
486
+ font-size: var(--font-size-s) !important;
487
+ }
488
+
489
+ .item-content {
490
+ min-height: 24px;
491
+ max-height: 24px;
492
+ /deep/ .base-icon-wrap {
493
+ width: 20px !important;
494
+ height: 20px !important;
495
+ visibility: hidden;
496
+ }
497
+ }
498
+ .item-handle-wrap {
499
+ min-height: 24px;
500
+ }
501
+ }
458
502
  </style>
@@ -4,11 +4,13 @@
4
4
  <base-icon :name="iconClass" :size="`l`" slot="header-prefix"></base-icon>
5
5
  <template slot="sectionContent">
6
6
  <pro_formVue
7
+ :size="size"
7
8
  ref="proForm"
8
9
  :form="false"
9
10
  :rules="rules"
10
11
  :footer="false"
11
12
  :formList="formList"
13
+ :rowNumber="rowNumber"
12
14
  :labelWidth="labelWidth"
13
15
  @formItemConfirm="formItemConfirm"
14
16
  ></pro_formVue> </template
@@ -44,6 +46,14 @@ export default {
44
46
  rules: {
45
47
  type: Object,
46
48
  },
49
+ rowNumber: {
50
+ type: Number,
51
+ default: null,
52
+ },
53
+ size: {
54
+ type: String,
55
+ default: "small",
56
+ },
47
57
  },
48
58
  computed: {
49
59
  iconClass() {