diff --git a/ruoyi-ui/README.md b/ruoyi-ui/README.md index 8f09f38e..6f9886d8 100644 --- a/ruoyi-ui/README.md +++ b/ruoyi-ui/README.md @@ -83,13 +83,13 @@ PresetFormItems.js 里面封装了一些可以复用的表单项 data.js 表单封装,里面会使用PresetFormItems的一些FormItem. Form表单属性介绍: - +
{ key: "ServiceAreaAbnormal", //唯一标识 一般tabs才需要 label: "服务区异常",//表单标题 formConfig: { formOptions: {//element中表单配置参数 - column: 2, + column: 2, //一行放多少元素(基于:style grid布局实现) }, list: [//FormItem定义 { @@ -166,7 +166,7 @@ FormItem属性介绍: export const additionalNotes = { label: "补充说明:", // 标题 key: "eventSourceTips", //数据存储字段 - isAlone: true, // 独立 + isAlone: true, // 单独一行 required: true, //必填 default: 5, //默认值 type: "input", //组件类型(el-input 去掉el-即可) 不填默认为input @@ -182,4 +182,64 @@ export const additionalNotes = { return true } }, + ons: { //on监听 element事件 + change(value, ...args) { + const { data, formList } = args.slice(-1)\[0]; //data 为数据 formList为传入的配置项 + mileCal(data); + } + }, }; + +MultipleLabelItem是单独写的组件,事件需按如下配置: + merge({}, PresetFormItems.startStation, + { + options: { + options: [ + { + prefix: { + text: "K", + style: { + color: "#3DE8FF", + }, + }, + key: "startStakeMark[0]", + default: "55", + rules: [ + { + message: "请补全桩号", + callback(value, data) { + console.log(value, data.startStakeMark); + if ( + !((value + "")?.trim() && (data.startStakeMark[1] + "")?.trim()) + ) + return false; + else return true; + }, + }, + ], + ons: { //on监听 element事件 + change(value, ...args) { + const { data, formList } = args.slice[-1](0); //data 为数据 formList为传入的配置项 + data.deviceType && changeHandle(data, formList); + } + }, + }, + { + prefix: { + text: "+", + style: { + color: "#3DE8FF", + }, + }, + default: "378", + key: "startStakeMark[1]", + ons: { //on监听 element事件 + change(value, ...args) { + const { data, formList } = args.slice[-1](0); //data 为数据 formList为传入的配置项 + data.deviceType && changeHandle(data, formList); + } + }, + }, + ], + } + }) diff --git a/ruoyi-ui/src/views/JiHeExpressway/common/PresetFormItems.js b/ruoyi-ui/src/views/JiHeExpressway/common/PresetFormItems.js index 804a9146..f906e716 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/common/PresetFormItems.js +++ b/ruoyi-ui/src/views/JiHeExpressway/common/PresetFormItems.js @@ -137,7 +137,6 @@ export const startStation = { { message: "请补全桩号", callback(value, data) { - console.log(value, data.startStakeMark); if ( !((value + "")?.trim() && (data.startStakeMark[1] + "")?.trim()) ) diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue index 7be002af..9a1f9acd 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue @@ -1,29 +1,12 @@