@bsgoal/common 1.7.4 → 1.7.5
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/dist/index.mjs +1062 -4727
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +1 -27
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/bsgoal-base-button/demo.vue +2 -1
- package/src/components/bsgoal-base-button/index.vue +14 -7
- package/src/components/bsgoal-base-form/demo.vue +6 -2
- package/src/components/bsgoal-base-form/index.vue +164 -160
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-05-18 16:24:31
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-
|
|
5
|
+
* @LastEditTime: 2023-05-19 13:41:17
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-button\demo.vue
|
|
7
7
|
* @Description: 按钮 演示
|
|
8
8
|
*
|
|
@@ -29,6 +29,7 @@ export default {
|
|
|
29
29
|
</script>
|
|
30
30
|
<template>
|
|
31
31
|
<div class="bsgoal-base-button-demo">
|
|
32
|
+
<BsgoalBaseButton :task="task" plain > </BsgoalBaseButton>
|
|
32
33
|
<BsgoalBaseButton :task="task" mode="add"> </BsgoalBaseButton>
|
|
33
34
|
<BsgoalBaseButton :task="task" mode="delete"> </BsgoalBaseButton>
|
|
34
35
|
<BsgoalBaseButton :task="task" #default="{ loading }">
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-05-18 16:24:25
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-
|
|
5
|
+
* @LastEditTime: 2023-05-19 13:40:52
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-button\index.vue
|
|
7
7
|
* @Description: 统一按钮
|
|
8
8
|
*
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
---------------------------------------------------------------- */
|
|
14
14
|
import { ref, unref, computed } from 'vue'
|
|
15
15
|
import { Delete, Plus } from '@element-plus/icons-vue'
|
|
16
|
-
import { values } from 'lodash';
|
|
17
16
|
|
|
18
17
|
// props
|
|
19
18
|
const props = defineProps({
|
|
@@ -30,7 +29,7 @@ const props = defineProps({
|
|
|
30
29
|
},
|
|
31
30
|
icon: {
|
|
32
31
|
type: [String, Object],
|
|
33
|
-
default:
|
|
32
|
+
default: ''
|
|
34
33
|
},
|
|
35
34
|
content: {
|
|
36
35
|
type: [String],
|
|
@@ -38,12 +37,16 @@ const props = defineProps({
|
|
|
38
37
|
},
|
|
39
38
|
mode: {
|
|
40
39
|
type: [String],
|
|
41
|
-
default: '
|
|
42
|
-
validator: (v) => ['add', 'delete', 'edit', 'detail'].includes(v)
|
|
40
|
+
default: 'default',
|
|
41
|
+
validator: (v) => ['add', 'delete', 'edit', 'detail','default'].includes(v)
|
|
43
42
|
},
|
|
44
43
|
values: {
|
|
45
44
|
type: [Array, Object],
|
|
46
45
|
default: () => ({})
|
|
46
|
+
},
|
|
47
|
+
plain: {
|
|
48
|
+
type: [Boolean],
|
|
49
|
+
default: false
|
|
47
50
|
}
|
|
48
51
|
})
|
|
49
52
|
|
|
@@ -55,7 +58,7 @@ const triggerClick = () => {
|
|
|
55
58
|
const taskValue = unref(task)
|
|
56
59
|
taskValue(() => {
|
|
57
60
|
loading.value = false
|
|
58
|
-
},props.values)
|
|
61
|
+
}, props.values)
|
|
59
62
|
}
|
|
60
63
|
// ---> E 触发按钮 <---
|
|
61
64
|
|
|
@@ -76,6 +79,8 @@ const iconGet = computed(() => {
|
|
|
76
79
|
switch (mode) {
|
|
77
80
|
case 'delete':
|
|
78
81
|
return Delete
|
|
82
|
+
case 'add':
|
|
83
|
+
return Plus
|
|
79
84
|
}
|
|
80
85
|
return icon
|
|
81
86
|
})
|
|
@@ -91,7 +96,9 @@ export default {
|
|
|
91
96
|
<div class="bsgoal-base-button">
|
|
92
97
|
<div class="base_button" @click="triggerClick">
|
|
93
98
|
<slot :loading="loading">
|
|
94
|
-
<el-button :type="typeGet" :icon="iconGet" :loading="loading">{{
|
|
99
|
+
<el-button :type="typeGet" :icon="iconGet" :loading="loading" :plain="plain">{{
|
|
100
|
+
content
|
|
101
|
+
}}</el-button>
|
|
95
102
|
</slot>
|
|
96
103
|
</div>
|
|
97
104
|
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-10 15:00:00
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-
|
|
5
|
+
* @LastEditTime: 2023-05-19 11:48:29
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-form\demo.vue
|
|
7
7
|
* @Description: 表单公共组件演示组件
|
|
8
8
|
*
|
|
@@ -190,7 +190,11 @@ export default {
|
|
|
190
190
|
:config-options="configOptions"
|
|
191
191
|
:values="values"
|
|
192
192
|
none="--"
|
|
193
|
-
|
|
193
|
+
>
|
|
194
|
+
<template #prop1="{option}">
|
|
195
|
+
<div>666 {{ option }}</div>
|
|
196
|
+
</template>
|
|
197
|
+
</BsgoalBaseForm>
|
|
194
198
|
<el-button type="primary" @click="confirm">提交</el-button>
|
|
195
199
|
</div>
|
|
196
200
|
</template>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-17 11:44:29
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-
|
|
5
|
+
* @LastEditTime: 2023-05-19 11:55:00
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-form\index.vue
|
|
7
7
|
* @Description: 表单公共组件
|
|
8
8
|
*
|
|
@@ -111,7 +111,7 @@ watchEffect(() => {
|
|
|
111
111
|
if (![EnumType.INPUT, EnumType.INPUT_TEXT_AREA].includes(type)) {
|
|
112
112
|
watchPropList.push(prop)
|
|
113
113
|
}
|
|
114
|
-
model.value[prop] = valuesModel[prop] || value
|
|
114
|
+
model.value[prop] = valuesModel[prop] || value
|
|
115
115
|
})
|
|
116
116
|
})
|
|
117
117
|
|
|
@@ -328,169 +328,173 @@ defineExpose({
|
|
|
328
328
|
>
|
|
329
329
|
<el-col :xs="24" :sm="24" :md="medium">
|
|
330
330
|
<el-form-item :label="label" :prop="prop" :rules="rules">
|
|
331
|
-
|
|
331
|
+
<slot :name="[prop]" :option="{ readonly, value: model[prop] }">
|
|
332
|
+
<!-- S 内容组件 -->
|
|
333
|
+
<template v-if="!readonly">
|
|
334
|
+
<!-- / input 输入框组件 -->
|
|
335
|
+
<template v-if="type === EnumType.INPUT">
|
|
336
|
+
<el-input
|
|
337
|
+
v-model="model[prop]"
|
|
338
|
+
:placeholder="placeholderSet(type, label, placeholder)"
|
|
339
|
+
:clearable="clearable"
|
|
340
|
+
@change="triggerValueChange(type, prop)"
|
|
341
|
+
/>
|
|
342
|
+
</template>
|
|
343
|
+
<!-- / input 输入框组件 -->
|
|
344
|
+
<!-- / textarea 输入框组件 -->
|
|
345
|
+
<template v-if="type === EnumType.INPUT_TEXT_AREA">
|
|
346
|
+
<el-input
|
|
347
|
+
v-model="model[prop]"
|
|
348
|
+
type="textarea"
|
|
349
|
+
:rows="rows"
|
|
350
|
+
:clearable="clearable"
|
|
351
|
+
:placeholder="placeholderSet(type, label, placeholder)"
|
|
352
|
+
@change="triggerValueChange(type, prop)"
|
|
353
|
+
/>
|
|
354
|
+
</template>
|
|
355
|
+
<!-- / textarea 输入框组件 -->
|
|
356
|
+
<template v-if="type === EnumType.INPUT_NUMBER">
|
|
357
|
+
<el-input-number
|
|
358
|
+
v-model="num"
|
|
359
|
+
:min="min"
|
|
360
|
+
:max="max"
|
|
361
|
+
@change="triggerValueChange"
|
|
362
|
+
/>
|
|
363
|
+
</template>
|
|
364
|
+
<!-- / 数字输入框 -->
|
|
332
365
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
<
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
366
|
+
<!-- / 单选框 -->
|
|
367
|
+
<template v-if="type === EnumType.RADIO">
|
|
368
|
+
<el-radio-group
|
|
369
|
+
v-model="model[prop]"
|
|
370
|
+
@change="triggerValueChange(type, prop)"
|
|
371
|
+
>
|
|
372
|
+
<template v-for="(item, itemIndex) of range" :key="itemIndex">
|
|
373
|
+
<el-radio :label="item.value">{{ item.label }}</el-radio>
|
|
374
|
+
</template>
|
|
375
|
+
</el-radio-group>
|
|
376
|
+
</template>
|
|
377
|
+
<!-- / 单选框 -->
|
|
378
|
+
<!-- / select 选择器 -->
|
|
379
|
+
<template v-if="type === EnumType.SELECT">
|
|
380
|
+
<el-select
|
|
381
|
+
v-model="model[prop]"
|
|
382
|
+
:placeholder="placeholderSet(type, label, placeholder)"
|
|
383
|
+
@change="triggerValueChange(type, prop)"
|
|
384
|
+
>
|
|
385
|
+
<template v-for="(item, itemIndex) of range" :key="itemIndex">
|
|
386
|
+
<el-option :label="item.label" :value="item.value" />
|
|
387
|
+
</template>
|
|
388
|
+
</el-select>
|
|
389
|
+
</template>
|
|
390
|
+
<!-- / select 选择器 -->
|
|
391
|
+
<!-- / 滑块 -->
|
|
392
|
+
<template v-if="type === EnumType.SLIDER">
|
|
393
|
+
<el-slider
|
|
394
|
+
v-model="model[prop]"
|
|
395
|
+
:min="min"
|
|
396
|
+
:max="max"
|
|
397
|
+
@change="triggerValueChange(type, prop)"
|
|
398
|
+
/>
|
|
399
|
+
</template>
|
|
400
|
+
<!-- / 滑块 -->
|
|
401
|
+
<!-- / Switch 开关 -->
|
|
402
|
+
<template v-if="type === EnumType.SWITCH">
|
|
403
|
+
<el-switch
|
|
404
|
+
v-model="model[prop]"
|
|
405
|
+
:active-value="range[0] || true"
|
|
406
|
+
:inactive-value="range[1] || false"
|
|
407
|
+
@change="triggerValueChange(type, prop)"
|
|
408
|
+
/>
|
|
409
|
+
</template>
|
|
410
|
+
<!-- / Switch 开关 -->
|
|
411
|
+
<!-- / 日期选择器 -->
|
|
412
|
+
<template
|
|
413
|
+
v-if="
|
|
414
|
+
[EnumType.DATE, EnumType.MONTH, EnumType.YEAR, EnumType.DATE_TIME].includes(
|
|
415
|
+
type
|
|
416
|
+
)
|
|
417
|
+
"
|
|
381
418
|
>
|
|
382
|
-
<
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
v-model="model[prop]"
|
|
402
|
-
:active-value="range[0] || true"
|
|
403
|
-
:inactive-value="range[1] || false"
|
|
404
|
-
@change="triggerValueChange(type, prop)"
|
|
405
|
-
/>
|
|
406
|
-
</template>
|
|
407
|
-
<!-- / Switch 开关 -->
|
|
408
|
-
<!-- / 日期选择器 -->
|
|
409
|
-
<template
|
|
410
|
-
v-if="
|
|
411
|
-
[EnumType.DATE, EnumType.MONTH, EnumType.YEAR, EnumType.DATE_TIME].includes(
|
|
412
|
-
type
|
|
413
|
-
)
|
|
414
|
-
"
|
|
415
|
-
>
|
|
416
|
-
<el-date-picker
|
|
417
|
-
v-model="model[prop]"
|
|
418
|
-
:format="formatSet(type, format)"
|
|
419
|
-
:value-format="formatSet(type, format)"
|
|
420
|
-
:type="type"
|
|
421
|
-
:placeholder="placeholderSet(type, label, placeholder)"
|
|
422
|
-
@change="triggerValueChange(type, prop)"
|
|
423
|
-
/>
|
|
424
|
-
</template>
|
|
425
|
-
<!-- / 日期选择器 -->
|
|
426
|
-
<!-- / 日期时间区域选择器 -->
|
|
427
|
-
<template
|
|
428
|
-
v-if="
|
|
429
|
-
[
|
|
430
|
-
EnumType.DATE_RANGE,
|
|
431
|
-
EnumType.MONTH_RANGE,
|
|
432
|
-
EnumType.DATE_TIME_RANGE
|
|
433
|
-
].includes(type)
|
|
434
|
-
"
|
|
435
|
-
>
|
|
436
|
-
<el-date-picker
|
|
437
|
-
v-model="model[prop]"
|
|
438
|
-
:type="type"
|
|
439
|
-
:value-format="formatSet(type, format)"
|
|
440
|
-
:start-placeholder="placeholderSet(type, label, placeholder)[0]"
|
|
441
|
-
:end-placeholder="placeholderSet(type, label, placeholder)[1]"
|
|
442
|
-
@change="triggerValueChange(type, prop)"
|
|
443
|
-
/>
|
|
444
|
-
</template>
|
|
445
|
-
<!-- / 日期时间区域选择器 -->
|
|
446
|
-
<!-- / 时间选择器 -->
|
|
447
|
-
<template v-if="[EnumType.TIME].includes(type)">
|
|
448
|
-
<el-time-picker
|
|
449
|
-
v-model="model[prop]"
|
|
450
|
-
arrow-control
|
|
451
|
-
:value-format="formatSet(type, format)"
|
|
452
|
-
:placeholder="placeholderSet(type, label, placeholder)"
|
|
453
|
-
@change="triggerValueChange(type, prop)"
|
|
454
|
-
/>
|
|
455
|
-
</template>
|
|
456
|
-
<!-- / 时间选择器 -->
|
|
457
|
-
<!-- / 时间区域选择器 -->
|
|
458
|
-
<template v-if="[EnumType.TIME_RANGE].includes(type)">
|
|
459
|
-
<el-time-picker
|
|
460
|
-
v-model="model[prop]"
|
|
461
|
-
is-range
|
|
462
|
-
:value-format="formatSet(type, format)"
|
|
463
|
-
:start-placeholder="placeholderSet(type, label, placeholder)[0]"
|
|
464
|
-
:end-placeholder="placeholderSet(type, label, placeholder)[1]"
|
|
465
|
-
@change="triggerValueChange(type, prop)"
|
|
466
|
-
/>
|
|
467
|
-
</template>
|
|
468
|
-
<!-- / 时间区域选择器 -->
|
|
469
|
-
<!-- / 复选框 -->
|
|
470
|
-
<template v-if="[EnumType.CHECKBOX].includes(type)">
|
|
471
|
-
<el-checkbox-group
|
|
472
|
-
v-model="model[prop]"
|
|
473
|
-
@change="triggerValueChange(type, prop)"
|
|
419
|
+
<el-date-picker
|
|
420
|
+
v-model="model[prop]"
|
|
421
|
+
:format="formatSet(type, format)"
|
|
422
|
+
:value-format="formatSet(type, format)"
|
|
423
|
+
:type="type"
|
|
424
|
+
:placeholder="placeholderSet(type, label, placeholder)"
|
|
425
|
+
@change="triggerValueChange(type, prop)"
|
|
426
|
+
/>
|
|
427
|
+
</template>
|
|
428
|
+
<!-- / 日期选择器 -->
|
|
429
|
+
<!-- / 日期时间区域选择器 -->
|
|
430
|
+
<template
|
|
431
|
+
v-if="
|
|
432
|
+
[
|
|
433
|
+
EnumType.DATE_RANGE,
|
|
434
|
+
EnumType.MONTH_RANGE,
|
|
435
|
+
EnumType.DATE_TIME_RANGE
|
|
436
|
+
].includes(type)
|
|
437
|
+
"
|
|
474
438
|
>
|
|
475
|
-
<
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
439
|
+
<el-date-picker
|
|
440
|
+
v-model="model[prop]"
|
|
441
|
+
:type="type"
|
|
442
|
+
:value-format="formatSet(type, format)"
|
|
443
|
+
:start-placeholder="placeholderSet(type, label, placeholder)[0]"
|
|
444
|
+
:end-placeholder="placeholderSet(type, label, placeholder)[1]"
|
|
445
|
+
@change="triggerValueChange(type, prop)"
|
|
446
|
+
/>
|
|
447
|
+
</template>
|
|
448
|
+
<!-- / 日期时间区域选择器 -->
|
|
449
|
+
<!-- / 时间选择器 -->
|
|
450
|
+
<template v-if="[EnumType.TIME].includes(type)">
|
|
451
|
+
<el-time-picker
|
|
452
|
+
v-model="model[prop]"
|
|
453
|
+
arrow-control
|
|
454
|
+
:value-format="formatSet(type, format)"
|
|
455
|
+
:placeholder="placeholderSet(type, label, placeholder)"
|
|
456
|
+
@change="triggerValueChange(type, prop)"
|
|
457
|
+
/>
|
|
458
|
+
</template>
|
|
459
|
+
<!-- / 时间选择器 -->
|
|
460
|
+
<!-- / 时间区域选择器 -->
|
|
461
|
+
<template v-if="[EnumType.TIME_RANGE].includes(type)">
|
|
462
|
+
<el-time-picker
|
|
463
|
+
v-model="model[prop]"
|
|
464
|
+
is-range
|
|
465
|
+
:value-format="formatSet(type, format)"
|
|
466
|
+
:start-placeholder="placeholderSet(type, label, placeholder)[0]"
|
|
467
|
+
:end-placeholder="placeholderSet(type, label, placeholder)[1]"
|
|
468
|
+
@change="triggerValueChange(type, prop)"
|
|
469
|
+
/>
|
|
470
|
+
</template>
|
|
471
|
+
<!-- / 时间区域选择器 -->
|
|
472
|
+
<!-- / 复选框 -->
|
|
473
|
+
<template v-if="[EnumType.CHECKBOX].includes(type)">
|
|
474
|
+
<el-checkbox-group
|
|
475
|
+
v-model="model[prop]"
|
|
476
|
+
@change="triggerValueChange(type, prop)"
|
|
477
|
+
>
|
|
478
|
+
<template v-for="(item, itemIndex) of range" :key="itemIndex">
|
|
479
|
+
<el-checkbox :label="item.value">{{ item.label }}</el-checkbox>
|
|
480
|
+
</template>
|
|
481
|
+
</el-checkbox-group>
|
|
482
|
+
</template>
|
|
483
|
+
<!-- / 复选框 -->
|
|
484
|
+
<!-- / 模板 -->
|
|
485
|
+
<template v-if="[].includes(type)"> </template>
|
|
486
|
+
<!-- / 模板 -->
|
|
479
487
|
</template>
|
|
480
|
-
<!--
|
|
481
|
-
<!-- / 模板 -->
|
|
482
|
-
<template v-if="[].includes(type)"> </template>
|
|
483
|
-
<!-- / 模板 -->
|
|
484
|
-
</template>
|
|
485
|
-
<!-- E 内容组件 -->
|
|
488
|
+
<!-- E 内容组件 -->
|
|
486
489
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
490
|
+
<!-- S 文本内容 -->
|
|
491
|
+
<template v-else>
|
|
492
|
+
<div>
|
|
493
|
+
<BsgoalBaseTooltip :content="model[prop]" :limit="limit" :none="none" />
|
|
494
|
+
</div>
|
|
495
|
+
</template>
|
|
496
|
+
<!-- E 文本内容 -->
|
|
497
|
+
</slot>
|
|
494
498
|
</el-form-item>
|
|
495
499
|
</el-col>
|
|
496
500
|
</template>
|