@bsgoal/common 2.16.4 → 2.17.0

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.
Files changed (80) hide show
  1. package/dist/index.mjs +812 -798
  2. package/dist/index.mjs.map +1 -1
  3. package/dist/index.umd.js +6 -6
  4. package/dist/index.umd.js.map +1 -1
  5. package/package.json +2 -3
  6. package/src/App.vue +0 -9
  7. package/src/combines/useComs.js +0 -41
  8. package/src/combines/useFetchs.js +0 -55
  9. package/src/components/bsgoal-baes-popover/demo.vue +0 -35
  10. package/src/components/bsgoal-baes-popover/index.vue +0 -66
  11. package/src/components/bsgoal-base-alert/demo.vue +0 -39
  12. package/src/components/bsgoal-base-alert/index.vue +0 -49
  13. package/src/components/bsgoal-base-button/demo.vue +0 -54
  14. package/src/components/bsgoal-base-button/index.vue +0 -166
  15. package/src/components/bsgoal-base-cascader/demo.vue +0 -128
  16. package/src/components/bsgoal-base-cascader/index.vue +0 -95
  17. package/src/components/bsgoal-base-dialog/demo.vue +0 -350
  18. package/src/components/bsgoal-base-dialog/index.vue +0 -260
  19. package/src/components/bsgoal-base-form/demo.vue +0 -289
  20. package/src/components/bsgoal-base-form/index.vue +0 -723
  21. package/src/components/bsgoal-base-frame/demo.vue +0 -35
  22. package/src/components/bsgoal-base-frame/index.vue +0 -28
  23. package/src/components/bsgoal-base-input/demo.vue +0 -48
  24. package/src/components/bsgoal-base-input/index.vue +0 -150
  25. package/src/components/bsgoal-base-item/demo.vue +0 -46
  26. package/src/components/bsgoal-base-item/index.vue +0 -66
  27. package/src/components/bsgoal-base-layout/demo.vue +0 -48
  28. package/src/components/bsgoal-base-layout/index.vue +0 -57
  29. package/src/components/bsgoal-base-line/demo.vue +0 -41
  30. package/src/components/bsgoal-base-line/index.vue +0 -70
  31. package/src/components/bsgoal-base-link/demo.vue +0 -38
  32. package/src/components/bsgoal-base-link/index.vue +0 -73
  33. package/src/components/bsgoal-base-search/demo.vue +0 -215
  34. package/src/components/bsgoal-base-search/index.vue +0 -534
  35. package/src/components/bsgoal-base-search-operation/index.vue +0 -77
  36. package/src/components/bsgoal-base-search-table/demo.vue +0 -784
  37. package/src/components/bsgoal-base-search-table/index.vue +0 -291
  38. package/src/components/bsgoal-base-select/demo.vue +0 -71
  39. package/src/components/bsgoal-base-select/index.vue +0 -111
  40. package/src/components/bsgoal-base-sizes/demo.vue +0 -34
  41. package/src/components/bsgoal-base-sizes/index.vue +0 -178
  42. package/src/components/bsgoal-base-switch/demo.vue +0 -39
  43. package/src/components/bsgoal-base-switch/index.vue +0 -76
  44. package/src/components/bsgoal-base-table/demo.vue +0 -302
  45. package/src/components/bsgoal-base-table/index.vue +0 -461
  46. package/src/components/bsgoal-base-table-content/index.vue +0 -64
  47. package/src/components/bsgoal-base-table-empty/demo.vue +0 -37
  48. package/src/components/bsgoal-base-table-empty/index.vue +0 -48
  49. package/src/components/bsgoal-base-table-pagination/demo.vue +0 -35
  50. package/src/components/bsgoal-base-table-pagination/index.vue +0 -110
  51. package/src/components/bsgoal-base-tabs/debug.log +0 -1
  52. package/src/components/bsgoal-base-tabs/demo.vue +0 -65
  53. package/src/components/bsgoal-base-tabs/index.vue +0 -122
  54. package/src/components/bsgoal-base-time/demo.vue +0 -69
  55. package/src/components/bsgoal-base-time/index.vue +0 -177
  56. package/src/components/bsgoal-base-time-range/demo.vue +0 -62
  57. package/src/components/bsgoal-base-time-range/index.vue +0 -170
  58. package/src/components/bsgoal-base-tooltip/demo.vue +0 -38
  59. package/src/components/bsgoal-base-tooltip/index.vue +0 -103
  60. package/src/components/bsgoal-base-tree/demo.vue +0 -141
  61. package/src/components/bsgoal-base-tree/index.vue +0 -286
  62. package/src/components/bsgoal-base-tree-fold/index.vue +0 -64
  63. package/src/components/bsgoal-base-tree-table/debug.log +0 -1
  64. package/src/components/bsgoal-base-tree-table/demo.vue +0 -859
  65. package/src/components/bsgoal-base-tree-table/index.vue +0 -351
  66. package/src/components/bsgoal-base-viewer/assets/upload_default.svg +0 -13
  67. package/src/components/bsgoal-base-viewer/demo.vue +0 -35
  68. package/src/components/bsgoal-base-viewer/index.vue +0 -66
  69. package/src/components/layout/layout-home.vue +0 -60
  70. package/src/components/layout/layout-left-menu.vue +0 -54
  71. package/src/components/layout/layout-right-container.vue +0 -39
  72. package/src/components/layout/layout-top-header.vue +0 -38
  73. package/src/debug.log +0 -1
  74. package/src/directives/directiveBase.js +0 -96
  75. package/src/entry.js +0 -77
  76. package/src/enums/componentTypeEnums.js +0 -35
  77. package/src/main.js +0 -11
  78. package/src/router/index.js +0 -161
  79. package/src/styles/index.css +0 -14
  80. package/src/utils/common.js +0 -56
@@ -1,723 +0,0 @@
1
- <!--
2
- * @Author: canlong.shen
3
- * @Date: 2023-04-17 11:44:29
4
- * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-07-01 13:41:22
6
- * @FilePath: \common\src\components\bsgoal-base-form\index.vue
7
- * @Description: 表单公共组件
8
- *
9
- -->
10
-
11
- <script setup>
12
- /* setup模板
13
- ---------------------------------------------------------------- */
14
- import { ref, computed, unref, watchEffect, watch } from 'vue'
15
- import ComponentTypeEnums from '../../enums/componentTypeEnums.js'
16
- import baseDirective from '../../directives/directiveBase.js'
17
- import BsgoalBaseTooltip from '../bsgoal-base-tooltip/index.vue'
18
- import { ElMessage } from 'element-plus'
19
- import { isObject } from '../../utils/common.js'
20
- import { isBoolean } from 'lodash'
21
-
22
- defineOptions({
23
- name: 'BsgoalBaseForm'
24
- })
25
-
26
- const props = defineProps({
27
- /**
28
- * >----------props----------<
29
- * {
30
- * label:'' // 名称
31
- * value:'' // 值
32
- * prop:'' // 绑定字段
33
- * type:'text' // 内容组件的类型 : 参照 componentTypeEnums
34
- * placeholder:'' // placeholder 提示文本
35
- * readonly: false // 是否为只读文本
36
- * clearable: true //是否为可清空
37
- * }
38
- *
39
- * >----------events----------<
40
- *
41
- * on-form // 触发查询
42
- * on-clear // 触发清空
43
- * on-change // 触发查询变动
44
- * on-fold // 触发折叠
45
- */
46
- configOptions: {
47
- type: [Array],
48
- default: () => []
49
- },
50
- /**
51
- * 中屏设备宽度的比例
52
- */
53
- medium: {
54
- type: [Number, String],
55
- default: 24
56
- },
57
- /**
58
- * 初始值
59
- */
60
- values: {
61
- type: [Object],
62
- default: () => ({})
63
- },
64
- /**
65
- * 全局字数限制
66
- */
67
- limits: {
68
- type: [Number],
69
- default: 0
70
- },
71
- /**
72
- * 全局只读
73
- */
74
- readonlys: {
75
- type: [Boolean],
76
- default: false
77
- },
78
- /**
79
- * 空字段 默认值
80
- */
81
- none: {
82
- type: [String],
83
- default: '无'
84
- },
85
- /**
86
- * 绑定的 mdel
87
- */
88
- bindModel: {
89
- type: [Object],
90
- default: () => ({})
91
- },
92
- /**
93
- * label 位置
94
- */
95
- labelPosition: {
96
- type: [String],
97
- default: 'right',
98
- validator: (v) => ['left', 'rightn', 'top'].includes(v)
99
- },
100
- /**
101
- * base_form 绑定的 style 对象
102
- */
103
- styler: {
104
- type: [Object],
105
- default: () => ({})
106
- },
107
- /**
108
- * el_form_item 绑定的 style 对象
109
- */
110
- itemStyler: {
111
- type: [Object],
112
- default: () => ({})
113
- },
114
-
115
- /**
116
- * 紧凑型
117
- */
118
- compact: {
119
- type: [Boolean],
120
- default: false
121
- }
122
- })
123
-
124
- // emits
125
- const emits = defineEmits(['on-form', 'on-clear', 'on-change', 'on-fold'])
126
-
127
- // el-from 的引用
128
- const EL_FORM_REF = ref(null)
129
-
130
- // 自定义指令
131
- const vAlign = baseDirective.align
132
-
133
- const model = ref()
134
- const watchPropList = []
135
-
136
- // ---> S 初始值 <---
137
-
138
- watchEffect(() => {
139
- const { bindModel = {} } = props
140
- model.value = bindModel
141
- })
142
-
143
- /**
144
- * @Author: canlong.shen
145
- * @description:
146
- * @default:
147
- * @return {*}
148
- */
149
- const watchPropsForShow = (show = {}, model = {}, prop = '') => {
150
- // { prop1:[1,2,3] , prop2: [4,5,6] }
151
- watchEffect(() => {
152
- const resultList = []
153
- for (const [name = '', values = []] of Object.entries(show)) {
154
- resultList.push(values.includes(`${model[name]}`))
155
- }
156
- const { configOptions } = props
157
- const options = unref(configOptions)
158
- const findProp = options.find((fi) => fi.prop === prop)
159
- if (resultList.every((ei) => !!ei)) {
160
- findProp.visible = true
161
- } else {
162
- findProp.visible = false
163
- }
164
- })
165
- }
166
-
167
- /**
168
- * @Author: canlong.shen
169
- * @description: 绑定的对象
170
- * @param {*} computed
171
- * @default:
172
- * @return {*} model
173
- */
174
- watchEffect(() => {
175
- const { configOptions, values } = props
176
- const options = unref(configOptions)
177
- const valuesModel = unref(values)
178
- options.forEach((fei) => {
179
- const { value = '', prop = '', type = '', show = null } = fei
180
- if (![ComponentTypeEnums.INPUT, ComponentTypeEnums.INPUT_TEXT_AREA].includes(type)) {
181
- watchPropList.push(prop)
182
- }
183
- const bindValue = model.value[prop]
184
- if (prop.startsWith('_')) {
185
- model.value[prop] = `${prop}`
186
- } else {
187
- model.value[prop] = bindValue || valuesModel[prop] || value
188
- }
189
-
190
- if (isObject(show)) {
191
- watchPropsForShow(show, unref(model), prop)
192
- }
193
- })
194
- })
195
-
196
- // ---> E 初始值 <---
197
-
198
- /**
199
- * @Author: canlong.shen
200
- * @description: 配置项
201
- * @param {*} computed
202
- * @default:
203
- * @return {*}
204
- */
205
- const configOptionsGet = computed(() => {
206
- const { configOptions } = props
207
- const options = unref(configOptions)
208
- const reOptions = options.map((option) => {
209
- let { rules = [], label = '', prop = '' } = option
210
- const requiredRule = { required: true, message: `${label}不能为空`, trigger: 'blur' }
211
- if (isBoolean(rules) && rules) {
212
- rules = [requiredRule]
213
- } else if (Array.isArray(rules) && !!rules.length) {
214
- rules = [requiredRule, ...rules]
215
- }
216
- option.rules = rules
217
- return option
218
- })
219
- return reOptions
220
- })
221
-
222
- /**
223
- * @Author: canlong.shen
224
- * @description: 设置 placeholder
225
- * @param {*} type
226
- * @param {*} placeholder
227
- * @default:
228
- * @return {*}
229
- */
230
- const placeholderSet = (type = '', label = '', placeholder = '') => {
231
- if (!placeholder) {
232
- switch (type) {
233
- case ComponentTypeEnums.INPUT:
234
- case ComponentTypeEnums.INPUT_TEXT_AREA:
235
- return `请输入${label}`
236
- case ComponentTypeEnums.SELECT:
237
- case ComponentTypeEnums.DATE:
238
- case ComponentTypeEnums.WEEK:
239
- case ComponentTypeEnums.MONTH:
240
- case ComponentTypeEnums.YEAR:
241
- case ComponentTypeEnums.DATE_TIME:
242
- case ComponentTypeEnums.TIME:
243
- return `请选择${label}`
244
- case ComponentTypeEnums.DATE_RANGE:
245
- case ComponentTypeEnums.DATE_TIME_RANGE:
246
- return ['开始日期', '结束日期']
247
- case ComponentTypeEnums.TIME_RANGE:
248
- return ['开始时间', '结束时间']
249
- case ComponentTypeEnums.MONTH_RANGE:
250
- return ['开始月份', '结束月份']
251
- default:
252
- break
253
- }
254
- }
255
-
256
- return placeholder
257
- }
258
-
259
- /**
260
- * @Author: canlong.shen
261
- * @description: 时间格式
262
- * @param {*} type
263
- * @param {*} format
264
- * @default:
265
- * @return {*}
266
- */
267
- const formatSet = (type = '', format = '') => {
268
- if (!format) {
269
- switch (type) {
270
- case ComponentTypeEnums.WEEK:
271
- return 'ww'
272
- case ComponentTypeEnums.DATE:
273
- case ComponentTypeEnums.DATE_RANGE:
274
- return 'YYYY-MM-DD'
275
- case ComponentTypeEnums.MONTH:
276
- return 'MM'
277
- case ComponentTypeEnums.YEAR:
278
- return 'YYYY'
279
- case ComponentTypeEnums.MONTH_RANGE:
280
- return 'YYYY-MM'
281
- case ComponentTypeEnums.TIME:
282
- case ComponentTypeEnums.TIME_RANGE:
283
- return 'HH:mm:ss'
284
- case ComponentTypeEnums.DATE_TIME:
285
- case ComponentTypeEnums.DATE_TIME_RANGE:
286
- return 'YYYY-MM-DD HH:mm:ss'
287
- default:
288
- break
289
- }
290
- }
291
-
292
- return format
293
- }
294
-
295
- /**
296
- * @Author: canlong.shen
297
- * @description: 触发查询
298
- * @default:
299
- * @return {*}
300
- */
301
- const triggerOperationForm = () => {
302
- const modelValue = unref(model)
303
- const { configOptions } = props
304
- const options = unref(configOptions)
305
- for (const option of options) {
306
- const { type = '', range = [], prop = '' } = option
307
- if (type.endsWith('range') && range && range.length === 2) {
308
- const { 0: startValue = '', 1: endValue = '' } = modelValue[prop]
309
- const { 0: startProp = '', 1: endProp = '' } = range
310
- modelValue[startProp] = startValue
311
- modelValue[endProp] = endValue
312
- }
313
- }
314
- emits('on-form', modelValue)
315
- return modelValue
316
- }
317
-
318
- /**
319
- * @Author: canlong.shen
320
- * @description: 触发清空
321
- * @default:
322
- * @return {*}
323
- */
324
- const triggerOperationClear = () => {
325
- EL_FORM_REF.value.resetFields()
326
- emits('on-clear', model.value)
327
- }
328
-
329
- /**
330
- * @Author: canlong.shen
331
- * @description: 触发 值 变化
332
- * @param {*} type
333
- * @param {*} prop
334
- * @default:
335
- * @return {*}
336
- */
337
- const triggerValueChange = (type, prop) => {
338
- // 触发查询
339
- const emitValue = {
340
- type,
341
- prop,
342
- value: model.value[prop] || ''
343
- }
344
- emits('on-change', emitValue)
345
- }
346
-
347
- /**
348
- * @Author: canlong.shen
349
- * @description: 过滤掉插槽字段
350
- * @default:
351
- * @return {*}
352
- */
353
- const filterSlotProps = (model = {}) => {
354
- const rebuildModel = {}
355
- for (const prop of Object.keys(model)) {
356
- if (!prop.startsWith('_')) {
357
- const value = model[prop]
358
- const valueInt = Number.parseFloat(value)
359
- rebuildModel[prop] = ( valueInt || ['0', 0].includes(value) ) && !(/^0.+/i).test(`${value}`) ? valueInt : value
360
- }
361
- }
362
- return rebuildModel
363
- }
364
-
365
- /**
366
- * @Author: canlong.shen
367
- * @description: 表单校验
368
- * @default:
369
- * @return {*}
370
- */
371
- const validateForm = (callback = () => {}) => {
372
- EL_FORM_REF.value.validate((valid = false, field = {}) => {
373
- if (valid) {
374
- const validModel = triggerOperationForm()
375
- const cleanModel = filterSlotProps(validModel)
376
- callback(cleanModel)
377
- } else {
378
- callback(false)
379
-
380
- const firstProp = Object.keys(field)[0]
381
- const {
382
- [firstProp]: {
383
- 0: { message = '' }
384
- }
385
- } = field
386
- ElMessage.error(message)
387
- }
388
- })
389
- }
390
-
391
- // ---> S switch active/inactive 的设置 <---
392
-
393
- /**
394
- * @Author: canlong.shen
395
- * @description: 设置 active 值
396
- * @param {*} range 入参
397
- * @param {*} type 'active' / 'inactive'
398
- * @default:
399
- * @return {*}
400
- */
401
- const setActiveValueText = (range = [], type = '') => {
402
- const { 0: startOption = {}, 1: endOption = {} } = range
403
- const { value: startValue = false, label: startText = '' } = startOption
404
- const { value: endValue = false, label: endText = '' } = endOption
405
-
406
- switch (type) {
407
- case 'active-value':
408
- return startValue
409
- case 'inactive-value':
410
- return endValue
411
- case 'active-text':
412
- return startText
413
- case 'inactive-text':
414
- return endText
415
- default:
416
- break
417
- }
418
- }
419
-
420
- // ---> E switch active/inactive 的设置 <---
421
-
422
- // ---> S styles <---
423
- const colStyle = computed(() => {
424
- const styler = {}
425
- const { compact = false } = props
426
- if (compact) {
427
- styler.marginBottom = '0px'
428
- }
429
- return styler
430
- })
431
- const itemStyle = computed(() => {
432
- const styler = {}
433
- const { compact = false, itemStyler = {} } = props
434
- if (compact) {
435
- styler.marginBottom = '0px'
436
- }
437
-
438
- return { ...styler ,...itemStyler }
439
- })
440
-
441
- // ---> E styles <---
442
-
443
- defineExpose({
444
- triggerOperationClear,
445
- triggerOperationForm,
446
- validateForm,
447
- resetFields: triggerOperationClear
448
- })
449
- </script>
450
- <template>
451
- <div class="bsgoal-base-form">
452
- <div class="base_form" :style="styler">
453
- <!-- / 表单内容 -->
454
- <el-form
455
- ref="EL_FORM_REF"
456
- label-suffix=":"
457
- style="padding: 0px"
458
- :label-position="labelPosition"
459
- :model="model"
460
- v-align
461
- >
462
- <el-row>
463
- <template
464
- v-for="(
465
- {
466
- md = 0,
467
- label = '',
468
- prop = '',
469
- type = 'text',
470
- placeholder = '',
471
- readonly = readonlys,
472
- clearable = true,
473
- rows = 2,
474
- min = 1,
475
- max = 10,
476
- range = [],
477
- format = '',
478
- rules = [],
479
- limit = limits,
480
- length = 255,
481
- visible = true,
482
- multiple = false,
483
- formatter = (v) => {
484
- return v
485
- },
486
- parser = (v) => {
487
- return v
488
- }
489
- } = {},
490
- key
491
- ) of configOptionsGet"
492
- :key="key"
493
- >
494
- <el-col
495
- :class="{ 'base_form--visible': !visible }"
496
- :xs="24"
497
- :sm="24"
498
- :md="md || medium"
499
- :style="colStyle"
500
- >
501
- <el-form-item :style="itemStyle" :label="label" :prop="prop" :rules="rules">
502
- <slot :name="[prop]" :option="{ readonly, value: model[prop], values: model }">
503
- <!-- S 内容组件 -->
504
- <template v-if="!readonly">
505
- <!-- / input 输入框组件 -->
506
- <template v-if="type === ComponentTypeEnums.INPUT">
507
- <el-input
508
- v-model="model[prop]"
509
- :placeholder="placeholderSet(type, label, placeholder)"
510
- :clearable="clearable"
511
- :formatter="formatter"
512
- :parser="parser"
513
- @change="triggerValueChange(type, prop)"
514
- />
515
- </template>
516
- <!-- / input 输入框组件 -->
517
- <!-- / textarea 输入框组件 -->
518
- <template v-if="type === ComponentTypeEnums.INPUT_TEXT_AREA">
519
- <el-input
520
- v-model="model[prop]"
521
- show-word-limit
522
- type="textarea"
523
- :autosize="{ minRows: rows }"
524
- :maxlength="length"
525
- :clearable="clearable"
526
- :placeholder="placeholderSet(type, label, placeholder)"
527
- @change="triggerValueChange(type, prop)"
528
- />
529
- </template>
530
- <!-- / textarea 输入框组件 -->
531
- <template v-if="type === ComponentTypeEnums.INPUT_NUMBER">
532
- <el-input-number
533
- v-model="model[prop]"
534
- controls-position="right"
535
- :min="min"
536
- :max="max"
537
- @change="triggerValueChange"
538
- />
539
- </template>
540
- <!-- / 数字输入框 -->
541
-
542
- <!-- / 单选框 -->
543
- <template v-if="type === ComponentTypeEnums.RADIO">
544
- <el-radio-group
545
- v-model="model[prop]"
546
- @change="triggerValueChange(type, prop)"
547
- >
548
- <template v-for="(item, itemIndex) of range" :key="itemIndex">
549
- <el-radio :label="item.value">{{ item.label }}</el-radio>
550
- </template>
551
- </el-radio-group>
552
- </template>
553
- <!-- / 单选框 -->
554
- <!-- / select 选择器 -->
555
- <template v-if="type === ComponentTypeEnums.SELECT">
556
- <el-select
557
- v-model="model[prop]"
558
- no-data-text="暂无数据"
559
- :multiple="multiple"
560
- :placeholder="placeholderSet(type, label, placeholder)"
561
- @change="triggerValueChange(type, prop)"
562
- >
563
- <template v-for="(item, itemIndex) of range" :key="itemIndex">
564
- <el-option :label="item.label" :value="item.value" />
565
- </template>
566
- </el-select>
567
- </template>
568
- <!-- / select 选择器 -->
569
- <!-- / 滑块 -->
570
- <template v-if="type === ComponentTypeEnums.SLIDER">
571
- <el-slider
572
- v-model="model[prop]"
573
- :min="min"
574
- :max="max"
575
- @change="triggerValueChange(type, prop)"
576
- />
577
- </template>
578
- <!-- / 滑块 -->
579
- <!-- / Switch 开关 -->
580
- <template v-if="type === ComponentTypeEnums.SWITCH">
581
- <el-switch
582
- v-model="model[prop]"
583
- :active-value="setActiveValueText(range, 'active-value')"
584
- :inactive-value="setActiveValueText(range, 'inactive-value')"
585
- :active-text="setActiveValueText(range, 'active-text')"
586
- :inactive-text="setActiveValueText(range, 'inactive-text')"
587
- @change="triggerValueChange(type, prop)"
588
- />
589
- </template>
590
- <!-- / Switch 开关 -->
591
- <!-- / 日期选择器 -->
592
- <template
593
- v-if="
594
- [
595
- ComponentTypeEnums.DATE,
596
- ComponentTypeEnums.MONTH,
597
- ComponentTypeEnums.YEAR,
598
- ComponentTypeEnums.DATE_TIME
599
- ].includes(type)
600
- "
601
- >
602
- <el-date-picker
603
- v-model="model[prop]"
604
- :format="formatSet(type, format)"
605
- :value-format="formatSet(type, format)"
606
- :type="type"
607
- :placeholder="placeholderSet(type, label, placeholder)"
608
- @change="triggerValueChange(type, prop)"
609
- />
610
- </template>
611
- <!-- / 日期选择器 -->
612
- <!-- / 日期时间区域选择器 -->
613
- <template
614
- v-if="
615
- [
616
- ComponentTypeEnums.DATE_RANGE,
617
- ComponentTypeEnums.MONTH_RANGE,
618
- ComponentTypeEnums.DATE_TIME_RANGE
619
- ].includes(type)
620
- "
621
- >
622
- <el-date-picker
623
- v-model="model[prop]"
624
- :type="type"
625
- :value-format="formatSet(type, format)"
626
- :start-placeholder="placeholderSet(type, label, placeholder)[0]"
627
- :end-placeholder="placeholderSet(type, label, placeholder)[1]"
628
- @change="triggerValueChange(type, prop)"
629
- />
630
- </template>
631
- <!-- / 日期时间区域选择器 -->
632
- <!-- / 时间选择器 -->
633
- <template v-if="[ComponentTypeEnums.TIME].includes(type)">
634
- <el-time-picker
635
- v-model="model[prop]"
636
- arrow-control
637
- :value-format="formatSet(type, format)"
638
- :placeholder="placeholderSet(type, label, placeholder)"
639
- @change="triggerValueChange(type, prop)"
640
- />
641
- </template>
642
- <!-- / 时间选择器 -->
643
- <!-- / 时间区域选择器 -->
644
- <template v-if="[ComponentTypeEnums.TIME_RANGE].includes(type)">
645
- <el-time-picker
646
- v-model="model[prop]"
647
- is-range
648
- :value-format="formatSet(type, format)"
649
- :start-placeholder="placeholderSet(type, label, placeholder)[0]"
650
- :end-placeholder="placeholderSet(type, label, placeholder)[1]"
651
- @change="triggerValueChange(type, prop)"
652
- />
653
- </template>
654
- <!-- / 时间区域选择器 -->
655
- <!-- / 复选框 -->
656
- <template v-if="[ComponentTypeEnums.CHECKBOX].includes(type)">
657
- <el-checkbox-group
658
- v-model="model[prop]"
659
- @change="triggerValueChange(type, prop)"
660
- >
661
- <template v-for="(item, itemIndex) of range" :key="itemIndex">
662
- <el-checkbox :label="item.value">{{ item.label }}</el-checkbox>
663
- </template>
664
- </el-checkbox-group>
665
- </template>
666
- <!-- / 复选框 -->
667
- <!-- / 复选框单选 -->
668
- <template v-if="[ComponentTypeEnums.CHECKBOX_SINGLE].includes(type)">
669
- <el-checkbox
670
- v-model="model[prop]"
671
- :true-label="range[0] ? range[0].value : '1'"
672
- :false-label="range[1] ? range[1].value : '0'"
673
- @change="triggerValueChange(type, prop)"
674
- />
675
- </template>
676
- <!-- / 复选框单选 -->
677
- <!-- / 模板 -->
678
- <template v-if="[].includes(type)"> </template>
679
- <!-- / 模板 -->
680
- </template>
681
- <!-- E 内容组件 -->
682
-
683
- <!-- S 文本内容 -->
684
- <template v-else>
685
- <div>
686
- <BsgoalBaseTooltip :content="model[prop]" :limit="limit" :none="none" />
687
- </div>
688
- </template>
689
- <!-- E 文本内容 -->
690
- </slot>
691
- </el-form-item>
692
- </el-col>
693
- </template>
694
- </el-row>
695
- </el-form>
696
- <!-- / 表单内容 -->
697
- </div>
698
- </div>
699
- </template>
700
- <style lang="scss">
701
- /* 覆盖样式
702
- ---------------------------------------------------------------- */
703
- .bsgoal-base-form {
704
- .base_form {
705
- /* padding: 16px 6px 8px 16px; */
706
-
707
- .el-form-item {
708
- // margin-bottom: 8px;
709
- margin-right: 10px;
710
- }
711
-
712
- div.el-input,
713
- div.el-select {
714
- width: 100%;
715
- }
716
- }
717
- .base_form--visible {
718
- width: 0px;
719
- height: 0px;
720
- overflow: hidden;
721
- }
722
- }
723
- </style>