From 8f1e08d26f33358d377b679b4721060e6e25c0be Mon Sep 17 00:00:00 2001 From: qingzhengli <1204552371@qq.com> Date: Mon, 18 Mar 2024 17:45:02 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/README.md | 66 +++- .../JiHeExpressway/common/PresetFormItems.js | 1 - .../components/FormConfig/index.vue | 36 +- .../images/home-FrameControl/FrameControl.svg | 6 + .../home-VectorControl/VectorControl.svg | 3 + .../components/HomeFrameControl/index.vue | 328 ++++++++++++++++++ .../components/HomeVectorControl/index.vue | 97 ++++++ .../views/JiHeExpressway/pages/Home/index.vue | 7 + 8 files changed, 513 insertions(+), 31 deletions(-) create mode 100644 ruoyi-ui/src/views/JiHeExpressway/images/home-FrameControl/FrameControl.svg create mode 100644 ruoyi-ui/src/views/JiHeExpressway/images/home-VectorControl/VectorControl.svg create mode 100644 ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFrameControl/index.vue create mode 100644 ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeVectorControl/index.vue 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 @@ 导出 - + @@ -34,6 +34,7 @@ :disable="true" placeholder="请输入敏感词,回车搜索" @handleSearch="handleSearch" + ref="form" /> @@ -201,6 +202,12 @@ export default { this.searchData = data; this.getData(); }, + onReset(){ + this.searchData.word = undefined; + // console.log(this.$refs["form"] , "__-========="); + this.$refs["form"].handleResetForm(); + this.getData(); + }, async getData() { // const closeLoading = setLoading(); this.isLoading = true;