meixioacomponent 0.3.26 → 0.3.29

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.
@@ -29,8 +29,9 @@
29
29
  :key="index"
30
30
  :label="item.value"
31
31
  v-for="(item, index) in config.list"
32
- >{{ item.label }}</el-radio-button
33
32
  >
33
+ {{ item.label }}
34
+ </el-radio-button>
34
35
  </el-radio-group>
35
36
 
36
37
  <!-- checkbox多选框 -->
@@ -38,7 +39,7 @@
38
39
  :min="checkMin"
39
40
  :max="checkMax"
40
41
  v-model="module"
41
- style="width: 100%"
42
+ style="width: 100%;"
42
43
  v-else-if="config.type == 'checkbox'"
43
44
  >
44
45
  <el-checkbox
@@ -46,8 +47,9 @@
46
47
  :key="index"
47
48
  :label="item"
48
49
  disabled
49
- >{{ item }}</el-checkbox
50
50
  >
51
+ {{ item }}
52
+ </el-checkbox>
51
53
  </el-checkbox-group>
52
54
  <!-- textarea -->
53
55
  <el-input
@@ -57,8 +59,7 @@
57
59
  type="textarea"
58
60
  v-model="module"
59
61
  v-if="config.type == 'textarea'"
60
- >
61
- </el-input>
62
+ ></el-input>
62
63
 
63
64
  <base-icon
64
65
  :size="`s`"
@@ -78,9 +79,8 @@
78
79
  v-model="module"
79
80
  :disabled="isDisabled"
80
81
  v-if="config.type == 'input'"
81
- style="width: 100%; height: 100%"
82
- >
83
- </el-input>
82
+ style="width: 100%; height: 100%;"
83
+ ></el-input>
84
84
  <!-- 数字类型无小数 -->
85
85
  <el-input-number
86
86
  ref="target"
@@ -89,7 +89,7 @@
89
89
  v-model.number="module"
90
90
  :disabled="isDisabled"
91
91
  v-else-if="config.type == 'number'"
92
- style="width: 100%; height: 100%"
92
+ style="width: 100%; height: 100%;"
93
93
  ></el-input-number>
94
94
  <!--数字类型两位小数 -->
95
95
  <el-input-number
@@ -99,7 +99,7 @@
99
99
  :controls="false"
100
100
  v-model.number="module"
101
101
  :disabled="isDisabled"
102
- style="width: 100%; height: 100%"
102
+ style="width: 100%; height: 100%;"
103
103
  v-else-if="config.type == 'number2'"
104
104
  ></el-input-number>
105
105
  <!-- select选择器 -->
@@ -113,7 +113,7 @@
113
113
  :loading="selectLoading"
114
114
  :disabled="isDisabled"
115
115
  @visible-change="visibleChange"
116
- style="width: 100%; height: 100%"
116
+ style="width: 100%; height: 100%;"
117
117
  v-else-if="config.type == 'select' && selectStore"
118
118
  :multipleLimit="config.multipleLimit"
119
119
  >
@@ -122,8 +122,7 @@
122
122
  :key="item.value"
123
123
  :label="item[`${selectConfig.label}`]"
124
124
  :value="item[`${selectConfig.value}`]"
125
- >
126
- </el-option>
125
+ ></el-option>
127
126
  </el-select>
128
127
  <!-- 时间选择器 -->
129
128
  <el-date-picker
@@ -136,11 +135,10 @@
136
135
  value-format="yyyy-MM-dd HH:mm:ss"
137
136
  :disabled="isDisabled"
138
137
  :prefix-icon="`el-icon-time`"
139
- style="width: 100%; height: 100%"
138
+ style="width: 100%; height: 100%;"
140
139
  v-else-if="config.type == 'time'"
141
140
  :picker-options="config.pickerOptions"
142
- >
143
- </el-date-picker>
141
+ ></el-date-picker>
144
142
  <!-- 单选框 -->
145
143
  <el-radio-group
146
144
  v-model="module"
@@ -153,8 +151,9 @@
153
151
  :label="item.value"
154
152
  :disabled="isDisabled"
155
153
  v-for="(item, index) in config.list"
156
- >{{ item.label }}</el-radio-button
157
154
  >
155
+ {{ item.label }}
156
+ </el-radio-button>
158
157
  </el-radio-group>
159
158
  <!-- 选择器 -->
160
159
  <el-checkbox-group
@@ -162,7 +161,7 @@
162
161
  :min="checkMin"
163
162
  :max="checkMax"
164
163
  v-model="module"
165
- style="width: 100%"
164
+ style="width: 100%;"
166
165
  :disabled="isDisabled"
167
166
  v-else-if="config.type == 'checkbox'"
168
167
  >
@@ -171,8 +170,9 @@
171
170
  :label="item"
172
171
  :disabled="isDisabled"
173
172
  v-for="(item, index) in config.list"
174
- >{{ item }}</el-checkbox
175
173
  >
174
+ {{ item }}
175
+ </el-checkbox>
176
176
  </el-checkbox-group>
177
177
  <!-- 文本输入框 -->
178
178
  <el-input
@@ -183,8 +183,7 @@
183
183
  v-model="module"
184
184
  :disabled="isDisabled"
185
185
  v-if="config.type == 'textarea'"
186
- >
187
- </el-input>
186
+ ></el-input>
188
187
  <!-- 插槽 -->
189
188
  <slot name="template" v-else-if="config.type == 'template'"></slot>
190
189
  </div>
@@ -211,27 +210,27 @@
211
210
  </template>
212
211
 
213
212
  <script>
214
- import { FilterTime } from "../../../utils/utils";
213
+ import { FilterTime } from '../../../utils/utils'
215
214
  //
216
- import componentConfig from "../../../config/componentConfig";
215
+ import componentConfig from '../../../config/componentConfig'
217
216
  export default {
218
217
  data() {
219
218
  return {
220
219
  isEdit: false,
221
220
  oldValue: null,
222
- };
221
+ }
223
222
  },
224
223
  created() {
225
- this.init();
224
+ this.init()
226
225
  },
227
226
  mounted() {
228
227
  this.$nextTick(() => {
229
- const { labelWidth } = this.$props;
230
- this.$refs.formItemRef.parentNode.style.cssText += `;width:calc(100% - ${labelWidth}) !important`;
228
+ const { labelWidth } = this.$props
229
+ this.$refs.formItemRef.parentNode.style.cssText += `;width:calc(100% - ${labelWidth}) !important`
231
230
  if (this.$props.disableWatcher) {
232
- this.triggerDisable(this.$props.value);
231
+ this.triggerDisable(this.$props.value)
233
232
  }
234
- });
233
+ })
235
234
  },
236
235
  props: {
237
236
  disabled: {
@@ -252,7 +251,7 @@ export default {
252
251
 
253
252
  size: {
254
253
  type: String,
255
- default: "small",
254
+ default: 'small',
256
255
  },
257
256
 
258
257
  labelWidth: {},
@@ -260,72 +259,72 @@ export default {
260
259
 
261
260
  computed: {
262
261
  isDisabled() {
263
- const { config, disabled } = this.$props;
264
- return config.disabled || disabled;
262
+ const { config, disabled } = this.$props
263
+ return config.disabled || disabled
265
264
  },
266
265
  multiple() {
267
- return this.$props.config.multipleLimit ? true : false;
266
+ return this.$props.config.multipleLimit ? true : false
268
267
  },
269
268
  selectLoading() {
270
- return this.selectStore?.getLoading();
269
+ return this.selectStore?.getLoading()
271
270
  },
272
271
  selectStore() {
273
- return componentConfig.selectStore.getStore(this.$props.config.useStore);
272
+ return componentConfig.selectStore.getStore(this.$props.config.useStore)
274
273
  },
275
274
 
276
275
  selectData() {
277
- return this.selectStore.getData();
276
+ return this.selectStore.getData()
278
277
  },
279
278
 
280
279
  selectConfig() {
281
- return this.selectStore.getConfig();
280
+ return this.selectStore.getConfig()
282
281
  },
283
282
 
284
283
  spContentType() {
285
- let configType = this.$props.config.type;
284
+ let configType = this.$props.config.type
286
285
  if (
287
- configType == "radio" ||
288
- configType == "label" ||
289
- configType == "checkbox" ||
290
- configType == "textarea"
286
+ configType == 'radio' ||
287
+ configType == 'label' ||
288
+ configType == 'checkbox' ||
289
+ configType == 'textarea'
291
290
  ) {
292
- return true;
291
+ return true
293
292
  }
294
- return false;
293
+ return false
295
294
  },
296
295
  contentValue() {
297
- let type = this.$props.config.type;
296
+ let type = this.$props.config.type
298
297
  switch (type) {
299
- case "input":
300
- case "textarea":
301
- return this.module;
298
+ case 'input':
299
+ case 'textarea':
300
+ return this.module
302
301
 
303
- case "select":
304
- let list = this.selectData;
302
+ case 'select':
303
+ let list = this.selectData
305
304
  if (list.length > 0) {
306
305
  if (!this.multiple) {
307
306
  if (this.module) {
308
307
  let index = list.findIndex((item) => {
309
- return item.value == this.module;
310
- });
311
- return list[index].label;
308
+ return item.value == this.module
309
+ })
310
+ return list[index].label
312
311
  } else {
313
- return "暂无数据";
312
+ return '暂无数据'
314
313
  }
315
314
  } else {
316
- let text = "";
315
+ let text = ''
317
316
  this.module.forEach((item) => {
318
317
  let index = list.findIndex((citem) => {
319
- return citem.value == item;
320
- });
318
+ return citem.value == item
319
+ })
321
320
 
322
- text += text ? ` / ${list[index].label}` : list[index].label;
323
- });
324
- return text;
321
+ text += text ? ` / ${list[index].label}` : list[index].label
322
+ })
323
+ return text
325
324
  }
326
325
  } else {
327
- this.loadSelectData();
328
- return this.$props.config.value;
326
+ this.loadSelectData()
327
+ return this.$props.config.value
329
328
  }
330
329
 
331
330
  // case "time":
@@ -338,37 +337,37 @@ export default {
338
337
  // }
339
338
 
340
339
  default:
341
- return this.module;
340
+ return this.module
342
341
  }
343
342
  },
344
343
  type() {
345
- return this.$props.config.type;
344
+ return this.$props.config.type
346
345
  },
347
346
 
348
347
  checkMax() {
349
- let max = this.$props.config.max;
350
- return max ? max : this.$props.config.list.length;
348
+ let max = this.$props.config.max
349
+ return max ? max : this.$props.config.list.length
351
350
  },
352
351
 
353
352
  checkMin() {
354
- let min = this.$props.config.min;
355
- return min < 0 || min == undefined || min == null ? 0 : min;
353
+ let min = this.$props.config.min
354
+ return min < 0 || min == undefined || min == null ? 0 : min
356
355
  },
357
356
  module: {
358
357
  get() {
359
- let type = this.$props.config.type;
360
- if (type == "select") {
358
+ let type = this.$props.config.type
359
+ if (type == 'select') {
361
360
  if (this.selectData.length <= 0) {
362
- this.loadSelectData();
361
+ this.loadSelectData()
363
362
  }
364
363
  }
365
364
 
366
- return this.$props.value;
365
+ return this.$props.value
367
366
  },
368
367
  set(val) {
369
- this.$emit("input", val);
368
+ this.$emit('input', val)
370
369
  if (this.$props.disableWatcher) {
371
- this.triggerDisable(val);
370
+ this.triggerDisable(val)
372
371
  }
373
372
  },
374
373
  },
@@ -376,74 +375,79 @@ export default {
376
375
  methods: {
377
376
  init() {
378
377
  if (this.$props.form) {
379
- this.isEdit = true;
378
+ this.isEdit = true
380
379
  }
381
380
  },
382
381
  handleContent() {
383
382
  if (this.$props.config.click) {
384
- this.$props.config.click(this.$props.config);
383
+ this.$props.config.click(this.$props.config)
385
384
  }
386
385
  },
387
386
  handleClick(type) {
388
387
  switch (type) {
389
- case "edit":
390
- this.isEdit = !this.isEdit;
388
+ case 'edit':
389
+ this.isEdit = !this.isEdit
391
390
  this.$nextTick(() => {
392
- this.targetFocus();
393
- });
391
+ this.targetFocus()
392
+ })
394
393
  if (this.isEdit) {
395
- this.oldValue = this.value;
394
+ this.oldValue = this.value
396
395
  } else {
397
- this.module = this.oldValue;
398
- this.oldValue = null;
396
+ this.module = this.oldValue
397
+ this.oldValue = null
399
398
  }
400
- break;
401
- case "content":
402
- this.handleContent();
403
- break;
404
- case "confirm":
405
- this.$emit("formItemConfirm", {
399
+ break
400
+ case 'content':
401
+ this.handleContent()
402
+ break
403
+ case 'confirm':
404
+ this.$emit('formItemConfirm', {
406
405
  this: this,
407
406
  config: this.$props.config,
408
- });
409
- break;
407
+ })
408
+ break
410
409
  default:
411
- break;
410
+ break
412
411
  }
413
412
  },
414
413
  targetFocus() {
415
- let ref = this.$refs.target;
416
- console.log(ref);
414
+ let ref = this.$refs.target
415
+ console.log(ref)
417
416
  if (ref) {
418
- ref.focus();
417
+ ref.focus()
419
418
  }
420
419
  },
421
420
  handleConfirm() {
422
- this.isEdit = false;
421
+ this.isEdit = false
423
422
  },
424
423
  loadSelectData() {
425
- this.selectStore.loadData();
424
+ this.selectStore.loadData()
426
425
  },
427
426
  visibleChange(visible) {
428
- if (!visible) return;
429
- if (this.selectData.length > 0) return;
430
- this.loadSelectData();
427
+ if (!visible) return
428
+ if (this.selectData.length > 0) return
429
+ this.loadSelectData()
431
430
  },
432
431
  triggerDisable(val) {
433
- let effects = this.$props.disableWatcher.effects;
432
+ let effects = this.$props.disableWatcher.effects
434
433
  effects.forEach((item) => {
435
434
  let obj = {
436
435
  key: item.key,
437
436
  type: item.type,
438
437
  result: item.fn(val),
439
- };
438
+ }
440
439
 
441
- console.log(val);
442
- this.$emit("disableWatcherResult", obj);
443
- });
440
+ console.log(val)
441
+ this.$emit('disableWatcherResult', obj)
442
+ })
444
443
  },
445
444
  },
446
- };
445
+ watch: {
446
+ form(newVal, oldVal) {
447
+ this.init();
448
+ },
449
+ },
450
+ }
447
451
  </script>
448
452
 
449
453
  <style lang="less" scoped>
package/src/App.vue ADDED
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <div id="app">
3
+ <div style="height: 100vh">
4
+ <test />
5
+
6
+ <!-- <base-time-line
7
+ :hasTimeWeek="false"
8
+ :timeLineSource="items"
9
+ ></base-time-line> -->
10
+
11
+ <!-- <base-popover-button
12
+ v-model="test"
13
+ iconClass="element"
14
+ buttonIcon="el-icon-delete-solid"
15
+ ></base-popover-button>
16
+
17
+ <base-icon iconClass="element" name="el-icon-delete-solid" :event="true"> </base-icon> -->
18
+ </div>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ import test from "./component/test.vue";
24
+
25
+ import BaseArea from "../packages/components/base/baseArea/baseArea.vue";
26
+ import BaseTimeLine from "../packages/components/base/baseTimeLine/baseTimeLine.vue";
27
+ export default {
28
+ components: { test, BaseArea, BaseTimeLine },
29
+ data() {
30
+ return {
31
+ test: [],
32
+ items: [
33
+ { type: "", label: "标签一" },
34
+ { type: "success", label: "标签二" },
35
+ { type: "info", label: "标签三" },
36
+ { type: "danger", label: "标签四" },
37
+ { type: "warning", label: "标签五" },
38
+ ],
39
+ value: [],
40
+ value2: [],
41
+ value3: [],
42
+ };
43
+ },
44
+ mounted() {},
45
+ methods: {},
46
+ };
47
+ </script>
48
+
49
+ <style lang="less" scoped>
50
+ .add-company-step-three-wrap {
51
+ width: 100%;
52
+ height: 100%;
53
+ overflow-y: auto;
54
+ .upload-wrap {
55
+ width: 100%;
56
+ height: 170px;
57
+ display: flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ /deep/ .base-upload-item-wrap {
61
+ margin: 0px;
62
+ }
63
+ }
64
+ }
65
+ </style>
Binary file