feat:还原更新框架

This commit is contained in:
2026-07-23 14:49:48 +08:00
parent d5a6a16ea5
commit 75c7434f79
529 changed files with 43714 additions and 68201 deletions
@@ -1,22 +1,22 @@
/*
* @Author : LQ
* @Description :
* @version : 3.0
* @Date : 2021-08-20 16:44:21
* @LastAuthor : jry
* @lastTime : 2025-12-19 08:55:21
* @FilePath : /uview-plus/libs/config/props/form.js
*/
export default {
// form 组件
form: {
model: {},
rules: {},
errorType: 'message',
borderBottom: true,
labelPosition: 'left',
labelWidth: 45,
labelAlign: 'left',
labelStyle: {}
}
}
/*
* @Author : LQ
* @Description :
* @version : 1.0
* @Date : 2021-08-20 16:44:21
* @LastAuthor : LQ
* @lastTime : 2021-08-20 17:03:49
* @FilePath : /u-view2.0/uview-ui/libs/config/props/form.js
*/
export default {
// form 组件
form: {
model: {},
rules: {},
errorType: 'message',
borderBottom: true,
labelPosition: 'left',
labelWidth: 45,
labelAlign: 'left',
labelStyle: {}
}
}
@@ -1,50 +1,47 @@
import { defineMixin } from '../../libs/vue'
import FormDefaultProps from './form'
import { registerComponentProps } from '../../libs/config/props.js'
const defProps = registerComponentProps(FormDefaultProps)
export const props = defineMixin({
props: {
// 当前form的需要验证字段的集合
model: {
type: Object,
default: () => defProps.form.model
},
// 验证规则
rules: {
type: [Object, Function, Array],
default: () => defProps.form.rules
},
// 有错误时的提示方式,message-提示信息,toast-进行toast提示
// border-bottom-下边框呈现红色,none-无提示
errorType: {
type: String,
default: () => defProps.form.errorType
},
// 是否显示表单域的下划线边框
borderBottom: {
type: Boolean,
default: () => defProps.form.borderBottom
},
// label的位置,left-左边,top-上边
labelPosition: {
type: String,
default: () => defProps.form.labelPosition
},
// label的宽度,单位px
labelWidth: {
type: [String, Number],
default: () => defProps.form.labelWidth
},
// lable字体的对齐方式
labelAlign: {
type: String,
default: () => defProps.form.labelAlign
},
// lable的样式,对象形式
labelStyle: {
type: Object,
default: () => defProps.form.labelStyle
}
}
})
import { defineMixin } from '../../libs/vue'
import defProps from '../../libs/config/props.js'
export const props = defineMixin({
props: {
// 当前form的需要验证字段的集合
model: {
type: Object,
default: () => defProps.form.model
},
// 验证规则
rules: {
type: [Object, Function, Array],
default: () => defProps.form.rules
},
// 有错误时的提示方式,message-提示信息,toast-进行toast提示
// border-bottom-下边框呈现红色,none-无提示
errorType: {
type: String,
default: () => defProps.form.errorType
},
// 是否显示表单域的下划线边框
borderBottom: {
type: Boolean,
default: () => defProps.form.borderBottom
},
// label的位置,left-左边,top-上边
labelPosition: {
type: String,
default: () => defProps.form.labelPosition
},
// label的宽度,单位px
labelWidth: {
type: [String, Number],
default: () => defProps.form.labelWidth
},
// lable字体的对齐方式
labelAlign: {
type: String,
default: () => defProps.form.labelAlign
},
// lable的样式,对象形式
labelStyle: {
type: Object,
default: () => defProps.form.labelStyle
}
}
})
@@ -16,7 +16,7 @@
/**
* Form 表单
* @description 此组件一般用于表单场景,可以配置Input输入框,Select弹出框,进行表单验证等。
* @tutorial https://uview-plus.jiangruyi.com/components/form.html
* @tutorial https://ijry.github.io/uview-plus/components/form.html
* @property {Object} model 当前form的需要验证字段的集合
* @property {Object | Function | Array} rules 验证规则
* @property {String} errorType 错误的提示方式,见上方说明 ( 默认 message )
@@ -25,10 +25,10 @@
* @property {String | Number} labelWidth 提示文字的宽度,单位px ( 默认 45 )
* @property {String} labelAlign lable字体的对齐方式 ( 默认 ‘left' )
* @property {Object} labelStyle lable的样式,对象形式
* @example <up-form labelPosition="left" :model="model1" :rules="rules" ref="form1"></up-form>
* @example <up-formlabelPosition="left" :model="model1" :rules="rules" ref="form1"></up-form>
*/
export default {
name: "up-form",
name: "u-form",
mixins: [mpMixin, mixin, props],
provide() {
return {
@@ -121,7 +121,7 @@
this.children.map((child) => {
// 如果u-form-item的prop在props数组中,则清除对应的校验结果信息
if (props[0] === undefined || props.includes(child.prop)) {
child.message = '';
child.message = null;
}
});
},
@@ -190,11 +190,11 @@
});
errorsRes.push(...errors);
childErrors.push(...errors);
}
//没有配置,或者配置了showErrorMsg为true时候,才修改子组件message,默认没有配置
if(!options||options?.showErrorMsg==true){
child.message =
childErrors[0]?.message ? childErrors[0].message : '';
}
//没有配置,或者配置了showErrorMsg为true时候,才修改子组件message,默认没有配置
if(!options||options?.showErrorMsg==true){
child.message =
childErrors[0]?.message ? childErrors[0].message : null;
}
if (i == (rules.length - 1)) {
resolve(errorsRes)
@@ -219,10 +219,10 @@
});
});
},
/**
* 校验全部数据
* @param {Object} options
* @param {Boolean} options.showErrorMsg -是否显示校验信息,
/**
* 校验全部数据
* @param {Object} options
* @param {Boolean} options.showErrorMsg -是否显示校验信息,
*/
validate(options) {
// 开发环境才提示,生产环境不会提示