@bsgoal/common 2.15.17 → 2.15.19

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": "@bsgoal/common",
3
- "version": "2.15.17",
3
+ "version": "2.15.19",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-23 16:35:24
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-06-30 09:17:44
5
+ * @LastEditTime: 2023-07-01 09:17:22
6
6
  * @FilePath: \common\src\components\bsgoal-base-dialog\demo.vue
7
7
  * @Description: 弹窗公共组件 演示
8
8
  *
@@ -14,7 +14,7 @@
14
14
  import { ref } from 'vue'
15
15
  import BsgoalBaseDialog from './index.vue'
16
16
  import BsgoalBaseTabs from '../bsgoal-base-tabs/index.vue'
17
-
17
+ import BsgoalBaseForm from '../bsgoal-base-form/index.vue'
18
18
  defineOptions({
19
19
  name: 'BsgoalBaseDialogDemo'
20
20
  })
@@ -23,6 +23,7 @@ const props = defineProps({})
23
23
 
24
24
  const dialogVisible = ref(false)
25
25
  const dialogVisible2 = ref(false)
26
+ const dialogVisible3 = ref(false)
26
27
 
27
28
  const test = () => {
28
29
  dialogVisible.value = true
@@ -30,6 +31,9 @@ const test = () => {
30
31
  const test2 = () => {
31
32
  dialogVisible2.value = true
32
33
  }
34
+ const test3 = () => {
35
+ dialogVisible3.value = true
36
+ }
33
37
 
34
38
  const activeTabName = ref('tab1')
35
39
  const tabsConfigOptions = ref([
@@ -64,6 +68,231 @@ const triggerShow = (status = '') => {
64
68
  const triggerHide = (status = '') => {
65
69
  console.log(status, '关闭')
66
70
  }
71
+
72
+ const bindModel = ref({ prop1: '111', prop99: 1, prop101: '否', prop102: '0', _prop104: '' })
73
+
74
+ import ComponentTypeEnums from '../../enums/componentTypeEnums.js'
75
+
76
+ // 配置项
77
+ const configOptions = ref([
78
+ // { label: '名称', prop: 'residentialName', limit: 5, readonly: true }
79
+
80
+ {
81
+ label: 'prop104',
82
+ prop: '_prop104',
83
+ validator: true,
84
+ rules: [
85
+ {
86
+ validator: (rule, value, callback) => {
87
+ console.log('value', value)
88
+
89
+ // return callback(new Error('Please input the age'))
90
+ return callback()
91
+ },
92
+ trigger: 'change'
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ label: 'prop103',
98
+ prop: 'prop103',
99
+ type: ComponentTypeEnums.INPUT,
100
+ formatter: (value = '') => {
101
+ return `${value}`.match(/^\d{1,}$/) ? value : ''
102
+ },
103
+ placeholder: '',
104
+ rules: true
105
+ },
106
+
107
+ {
108
+ label: '11',
109
+ prop: 'prop101',
110
+ type: ComponentTypeEnums.CHECKBOX_SINGLE,
111
+ show: { prop102: ['1'] },
112
+ range: [
113
+ {
114
+ value: '是'
115
+ },
116
+ {
117
+ value: '否'
118
+ }
119
+ ]
120
+ },
121
+ {
122
+ type: ComponentTypeEnums.SWITCH,
123
+ label: 'prop102',
124
+ prop: 'prop102',
125
+ range: [
126
+ { label: '是', value: '1' },
127
+ { label: '否', value: '0' }
128
+ ]
129
+ },
130
+ {
131
+ label: 'prop100',
132
+ prop: 'prop100',
133
+ rows: 4,
134
+ length: 1000,
135
+ type: ComponentTypeEnums.INPUT_TEXT_AREA
136
+ },
137
+ {
138
+ label: 'prop99',
139
+ prop: 'prop99',
140
+ value: 0,
141
+ type: ComponentTypeEnums.INPUT_NUMBER,
142
+ max: 'max'
143
+ },
144
+ {
145
+ label: 'prop1',
146
+ // value: '111',
147
+ prop: 'prop1',
148
+ type: ComponentTypeEnums.INPUT,
149
+ width: '100px',
150
+ rules: [],
151
+ readonly: true
152
+ },
153
+ {
154
+ label: 'prop20',
155
+ // value: '111',
156
+ prop: 'prop20',
157
+ type: ComponentTypeEnums.INPUT,
158
+ width: '100px',
159
+ rules: [],
160
+ readonly: true
161
+ },
162
+ {
163
+ label: 'prop2',
164
+ value: [],
165
+ type: ComponentTypeEnums.SELECT,
166
+ prop: 'prop2',
167
+ multiple: true,
168
+ range: [
169
+ {
170
+ label: 'select1',
171
+ value: 'select1'
172
+ },
173
+ {
174
+ label: 'select2',
175
+ value: 'select2'
176
+ },
177
+ {
178
+ label: 'select3',
179
+ value: 'select3'
180
+ },
181
+ {
182
+ label: 'select4',
183
+ value: 'select5'
184
+ }
185
+ ]
186
+ },
187
+ {
188
+ label: 'prop3',
189
+ // value: '111',
190
+ type: ComponentTypeEnums.SLIDER,
191
+ prop: 'prop3'
192
+ },
193
+ {
194
+ label: 'prop4',
195
+ // value: '111',
196
+ type: ComponentTypeEnums.SWITCH,
197
+ prop: 'prop4',
198
+ range: [
199
+ { label: '是', value: 1 },
200
+ { label: '否', value: 0 }
201
+ ]
202
+ },
203
+ {
204
+ label: 'prop5',
205
+ // value: '111',
206
+ type: ComponentTypeEnums.RADIO,
207
+ prop: 'prop5',
208
+ range: [
209
+ {
210
+ label: 'radio1',
211
+ value: 'radio1'
212
+ },
213
+ {
214
+ label: 'radio2',
215
+ value: 'radio2'
216
+ }
217
+ ]
218
+ },
219
+ {
220
+ label: 'prop6',
221
+ value: [],
222
+ type: ComponentTypeEnums.CHECKBOX,
223
+ prop: 'prop6',
224
+ range: [
225
+ {
226
+ label: 'checkbox1',
227
+ value: 'checkbox1'
228
+ },
229
+ {
230
+ label: 'checkbox2',
231
+ value: 'checkbox2'
232
+ }
233
+ ]
234
+ },
235
+ {
236
+ label: 'prop7',
237
+ // value: '111',
238
+ type: ComponentTypeEnums.DATE,
239
+ prop: 'prop7',
240
+ format: 'YYYY-MM-DD'
241
+ },
242
+ {
243
+ label: 'prop9',
244
+ // value: '111',
245
+ type: ComponentTypeEnums.MONTH,
246
+ prop: 'prop9'
247
+ },
248
+ {
249
+ label: 'prop10',
250
+ // value: '111',
251
+ type: ComponentTypeEnums.YEAR,
252
+ prop: 'prop10'
253
+ },
254
+ {
255
+ label: 'prop11',
256
+ // value: '111',
257
+ type: ComponentTypeEnums.DATE_RANGE,
258
+ prop: 'prop11',
259
+ range: ['startDate', 'endDate']
260
+ },
261
+ {
262
+ label: 'prop12',
263
+ // value: '111',
264
+ type: ComponentTypeEnums.MONTH_RANGE,
265
+ prop: 'prop12'
266
+ },
267
+ {
268
+ label: 'prop13',
269
+ // value: '111',
270
+ type: ComponentTypeEnums.TIME,
271
+ prop: 'prop13'
272
+ },
273
+ {
274
+ label: 'prop14',
275
+ // value: '111',
276
+ type: ComponentTypeEnums.TIME_RANGE,
277
+ prop: 'prop14'
278
+ },
279
+ {
280
+ label: 'prop15',
281
+ // value: '111',
282
+ type: ComponentTypeEnums.DATE_TIME,
283
+ prop: 'prop15'
284
+ },
285
+ {
286
+ label: 'prop16',
287
+ // value: '111',
288
+ type: ComponentTypeEnums.DATE_TIME_RANGE,
289
+ prop: 'prop16'
290
+ }
291
+ ])
292
+
293
+ const values = ref({
294
+ residentialName: '1111'
295
+ })
67
296
  </script>
68
297
  <template>
69
298
  <div class="bsgoal-base-dialog-demo">
@@ -84,8 +313,30 @@ const triggerHide = (status = '') => {
84
313
  >
85
314
  <BsgoalBaseTabs v-memo="activeTabName" :config-options="tabsConfigOptions" />
86
315
  </BsgoalBaseDialog>
316
+ <BsgoalBaseDialog
317
+ v-model="dialogVisible3"
318
+ size="medium"
319
+ type="blank"
320
+ @on-confirm="triggerConfirm"
321
+ @on-show="triggerShow"
322
+ @on-hide="triggerHide"
323
+ >
324
+ <div class="bsgoal-base-form-demo">
325
+ <BsgoalBaseForm
326
+ ref="BSGOAL_BASE_FORM_REF"
327
+ readonly
328
+ none="--"
329
+ :limits="10"
330
+ :config-options="configOptions"
331
+ :bind-model="values"
332
+ >
333
+ <template #_prop104> 6666 </template>
334
+ </BsgoalBaseForm>
335
+ </div>
336
+ </BsgoalBaseDialog>
87
337
  <el-button type="primary" @click="test">打开弹窗</el-button>
88
338
  <el-button type="primary" @click="test2">打开弹窗2</el-button>
339
+ <el-button type="primary" @click="test3">打开弹窗3</el-button>
89
340
  </div>
90
341
  </div>
91
342
  </template>
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-23 16:35:19
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-06-30 09:13:34
5
+ * @LastEditTime: 2023-07-01 09:08:25
6
6
  * @FilePath: \common\src\components\bsgoal-base-dialog\index.vue
7
7
  * @Description: 弹窗公共组件
8
8
  *
@@ -75,10 +75,17 @@ const props = defineProps({
75
75
  footer: {
76
76
  type: [Boolean],
77
77
  default: true
78
+ },
79
+ /**
80
+ * 是否重新渲染整个视图
81
+ */
82
+ isRefresh: {
83
+ type: [Boolean],
84
+ default: true
78
85
  }
79
86
  })
80
87
 
81
- const emits = defineEmits(['update:modelValue', 'on-confirm','on-show','on-hide'])
88
+ const emits = defineEmits(['update:modelValue', 'on-confirm', 'on-show', 'on-hide'])
82
89
  const dialogVisible = ref(props.modelValue.value)
83
90
 
84
91
  /**
@@ -168,7 +175,7 @@ const widthGet = computed(() => {
168
175
  }
169
176
  ]"
170
177
  >
171
- <slot></slot>
178
+ <slot v-if="dialogVisible && isRefresh"></slot>
172
179
  </div>
173
180
  <template #footer>
174
181
  <slot name="footer" v-if="footer">
@@ -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-06-30 16:54:25
5
+ * @LastEditTime: 2023-07-01 13:45:35
6
6
  * @FilePath: \common\src\components\bsgoal-base-form\demo.vue
7
7
  * @Description: 表单公共组件演示组件
8
8
  *
@@ -249,7 +249,8 @@ const configOptions = ref([
249
249
  label: 'prop16',
250
250
  // value: '111',
251
251
  type: ComponentTypeEnums.DATE_TIME_RANGE,
252
- prop: 'prop16'
252
+ prop: 'prop16',
253
+ md:24
253
254
  }
254
255
  ])
255
256
 
@@ -266,6 +267,7 @@ const changeValues = (params = '') => {
266
267
  ref="BSGOAL_BASE_FORM_REF"
267
268
  readonly
268
269
  none="--"
270
+ :medium="6"
269
271
  :limits="10"
270
272
  :config-options="configOptions"
271
273
  :bind-model="values"
@@ -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-06-30 19:44:43
5
+ * @LastEditTime: 2023-07-01 13:41:22
6
6
  * @FilePath: \common\src\components\bsgoal-base-form\index.vue
7
7
  * @Description: 表单公共组件
8
8
  *
@@ -463,6 +463,7 @@ defineExpose({
463
463
  <template
464
464
  v-for="(
465
465
  {
466
+ md = 0,
466
467
  label = '',
467
468
  prop = '',
468
469
  type = 'text',
@@ -494,7 +495,7 @@ defineExpose({
494
495
  :class="{ 'base_form--visible': !visible }"
495
496
  :xs="24"
496
497
  :sm="24"
497
- :md="medium"
498
+ :md="md || medium"
498
499
  :style="colStyle"
499
500
  >
500
501
  <el-form-item :style="itemStyle" :label="label" :prop="prop" :rules="rules">
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-14 10:50:11
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-05-22 15:55:30
5
+ * @LastEditTime: 2023-07-01 09:22:49
6
6
  * @FilePath: \common\src\directives\directiveBase.js
7
7
  * @Description: 常用的公共指令
8
8
  *
@@ -76,7 +76,9 @@ export default {
76
76
  })
77
77
  },
78
78
  mounted(el) {
79
+ setTimeout(() => {
79
80
  autoAlign(el)
81
+ }, 100);
80
82
  },
81
83
  unmounted(el) {
82
84
  window.removeEventListener('resize', autoAlign(el))