@bsgoal/common 2.7.8 → 2.7.9

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.7.8",
3
+ "version": "2.7.9",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -61,7 +61,8 @@ const configOptions = ref([
61
61
  formatter: (value = '') => {
62
62
  return `${value}`.match(/^\d{1,}$/) ? value : ''
63
63
  },
64
- placeholder: ''
64
+ placeholder: '',
65
+ rules:true
65
66
  },
66
67
 
67
68
  {
@@ -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-30 14:05:39
5
+ * @LastEditTime: 2023-05-30 14:24:25
6
6
  * @FilePath: \common\src\components\bsgoal-base-form\index.vue
7
7
  * @Description: 表单公共组件
8
8
  *
@@ -175,11 +175,11 @@ const configOptionsGet = computed(() => {
175
175
  const { configOptions } = props
176
176
  const options = unref(configOptions)
177
177
  const reOptions = options.map((option) => {
178
- let { rules = [], label = '', validator = false } = option
178
+ let { rules = [], label = '', prop = ''} = option
179
179
  const requiredRule = { required: true, message: `${label}不能为空`, trigger: 'blur' }
180
180
  if (isBoolean(rules) && rules) {
181
181
  rules = [requiredRule]
182
- } else if ( !validator && Array.isArray(rules) && !!rules.length ) {
182
+ } else if ( !prop.startsWith('_') && Array.isArray(rules) && !!rules.length ) {
183
183
  rules = [ requiredRule ,...rules,]
184
184
  }
185
185
  option.rules = rules
@@ -434,7 +434,7 @@ defineExpose({
434
434
  :key="key"
435
435
  >
436
436
  <el-col :class="{ 'base_form--visible': !visible }" :xs="24" :sm="24" :md="medium">
437
- <el-form-item :label="label" :prop="prop" :rules="rules">
437
+ <el-form-item :label="label" :prop="prop" :rules="rules" :required="!!rules.length">
438
438
  <slot :name="[prop]" :option="{ readonly, value: model[prop], values: model }">
439
439
  <!-- S 内容组件 -->
440
440
  <template v-if="!readonly">