傅豪杰 vor 1 Jahr
Ursprung
Commit
480153b9b3

+ 3 - 2
ruoyi-ui/src/mock/cpnsList.js

@@ -2,7 +2,7 @@
  * @Author: 傅豪杰 18516149270@163.com
  * @Date: 2023-07-24 14:48:20
  * @LastEditors: 傅豪杰 18516149270@163.com
- * @LastEditTime: 2023-07-24 18:43:12
+ * @LastEditTime: 2023-07-26 16:49:36
  * @FilePath: /infrared_remote/admin_web/ruoyi-ui/src/mock/cpnsList.js
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -19,7 +19,8 @@ export const cpnsList = [
     fontSize: '14px',
     background: '#000',
     color: '#fff',
-    backgroundImage:''
+    backgroundImage:'',
+    typeNum:'1'
   },
   {
     classType: 'icon-wenben',

+ 95 - 52
ruoyi-ui/src/views/base/addBase/blocks/detailDialog.vue

@@ -46,66 +46,109 @@ export default {
       },
       // 表单配置
       fromDataConfig:[
-          {
-            itemType: "input",
-            prop: "name",
-            label:'基础库名',
-            attrs: {
-              placeholder: "请输入基础库名"
-            },
+        {
+          itemType: "input",
+          prop: "name",
+          label:'基础库名',
+          attrs: {
+            placeholder: "请输入基础库名"
           },
-          {
-            itemType: "input",
-            prop: "bandValue",
-            label:'波段值',
-            attrs: {
-              inputType:'Number',
-              placeholder: "请输入波段值,默认38000"
-            },
+        },
+        {
+          itemType: "input",
+          prop: "bandValue",
+          label:'波段值',
+          attrs: {
+            inputType:'Number',
+            placeholder: "请输入波段值,默认38000"
           },
-          {
-            itemType: "input",
-            prop: "bootCode",
-            label:'引导码',
-            attrs: {
-              placeholder: "请输入引导码"
-            },
+        },
+        {
+          itemType: "input",
+          prop: "repeatCode",
+          label:'重复码',
+          attrs: {
+            placeholder: "请输入重复码"
           },
-          {
-            itemType: "input",
-            prop: "bootCodeSend",
-            label:'引导码发送次数',
-            attrs: {
-              inputType:'Number',
-              placeholder: "请输入引导码发送次数"
-            },
+        },
+        {
+          itemType: "input",
+          prop: "bootCode",
+          label:'引导码',
+          attrs: {
+            placeholder: "请输入引导码"
           },
-          {
-            itemType: "input",
-            prop: "dateCode",
-            label:'数据码',
-            attrs: {
-              placeholder: "请输入数据码",
-              span:2,
-              type:'textarea'
-            },
+        },
+        {
+          itemType: "input",
+          prop: "bootCodeSend",
+          label:'引导码发送次数',
+          attrs: {
+            inputType:'Number',
+            placeholder: "请输入引导码发送次数"
           },
-          {
-            itemType: "input",
-            prop: "overCode",
-            label:'结束码',
-            attrs: {
-              placeholder: "请输入结束码"
-            },
-          }
+        },
+        {
+          itemType: "input",
+          prop: "synchronizeCode",
+          label:'同步码',
+          attrs: {
+            placeholder: "请输入同步码"
+          },
+        },
+        {
+          itemType: "input",
+          prop: "synchronizeCodeSend",
+          label:'同步码发送次数',
+          attrs: {
+            inputType:'Number',
+            placeholder: "请输入同步码发送次数"
+          },
+        },
+        {
+          itemType: "input",
+          prop: "dateCode",
+          label:'数据码',
+          attrs: {
+            placeholder: "请输入数据码",
+            span:2,
+            type:'textarea'
+          },
+        },
+        {
+          itemType: "input",
+          prop: "overCode",
+          label:'结束码',
+          attrs: {
+            placeholder: "请输入结束码"
+          },
+        },
+        {
+          itemType: "input",
+          prop: "dateBinary0",
+          label:'数据码二进制0',
+          attrs: {
+            placeholder: "请输入数据码二进制0"
+          },
+        },
+        {
+          itemType: "input",
+          prop: "dateBinary1",
+          label:'数据码二进制1',
+          attrs: {
+            placeholder: "请输入数据码二进制1"
+          },
+        }
       ],
       // 表单验证
       fromRules:{
-          name:[{required: true, message: '请输入基础库名'}],
-          bootCode:[{required: true, message: '请输入引导码'}],
-          bootCodeSend:[{required: true, message: '请输入引导码发送次数'}],
-          dateCode:[{required: true, message: '请输入数据码'}],
-          overCode:[{required: true, message: '请输入结束码'}]
+        name:[{required: true, message: '请输入基础库名'}],
+        bootCode:[{required: true, message: '请输入引导码'}],
+        bootCodeSend:[{required: true, message: '请输入引导码发送次数'}],
+        dateCode:[{required: true, message: '请输入数据码'}],
+        overCode:[{required: true, message: '请输入结束码'}],
+        dateBinary0:[{required: true, message: '请输入数据码二进制0'}],
+        dateBinary1:[{required: true, message: '请输入数据码二进制1'}]
       },
       // 表单key
       fromKey:0

+ 5 - 0
ruoyi-ui/src/views/base/addBase/index.vue

@@ -56,9 +56,14 @@ export default {
       tableConfig: [
         { "name": "基础库名" },
         { "bandValue": "波段值" },
+        { "repeatCode": "重复码" },
         { "bootCode": "引导码" },
         { "bootCodeSend": "引导码发送次数"},
+        { "synchronizeCode": "同步码" },
+        { "synchronizeCodeSend": "同步码发送次数"},
         { "dateCode": "数据码" },
+        { "dateBinary0": "数据码二进制0" },
+        { "dateBinary1": "数据码二进制1" },
         { "overCode": "结束码" },
         { "status": "状态", formatter: row => this.selectDictLabel(useStatus, row.status)},
         { "createTime": "创建时间", formatter:row => this.dayjs(row.createTime).format("YYYY-MM-DD HH:mm")}

+ 32 - 24
ruoyi-ui/src/views/template/addButton/blocks/config.js

@@ -1,3 +1,11 @@
+/*
+ * @Author: 傅豪杰 18516149270@163.com
+ * @Date: 2023-07-24 13:57:02
+ * @LastEditors: 傅豪杰 18516149270@163.com
+ * @LastEditTime: 2023-07-26 16:23:26
+ * @FilePath: /infrared_remote/admin_web/ruoyi-ui/src/views/template/addButton/blocks/config.js
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
 const formConfig = function(){
   return [
     {
@@ -8,30 +16,30 @@ const formConfig = function(){
         placeholder: "请输入按钮名称"
       },
     },
-    {
-      itemType: "select",
-      prop: "typeNum",
-      label:'按钮类型',
-      attrs: {
-        list: this.btnType    
-      }
-    },
-    {
-      itemType: "input",
-      prop: "addSubMax",
-      label:'最大值',
-      attrs: {
-        placeholder: "加减型,请输入最大值",
-      },
-    },
-    {
-      itemType: "input",
-      prop: "addSubMin",
-      label:'最小值',
-      attrs: {
-        placeholder: "加减型,请输入最小值",
-      },
-    },
+    // {
+    //   itemType: "select",
+    //   prop: "typeNum",
+    //   label:'按钮类型',
+    //   attrs: {
+    //     list: this.btnType    
+    //   }
+    // },
+    // {
+    //   itemType: "input",
+    //   prop: "addSubMax",
+    //   label:'最大值',
+    //   attrs: {
+    //     placeholder: "加减型,请输入最大值",
+    //   },
+    // },
+    // {
+    //   itemType: "input",
+    //   prop: "addSubMin",
+    //   label:'最小值',
+    //   attrs: {
+    //     placeholder: "加减型,请输入最小值",
+    //   },
+    // },
     {
       itemType: "input",
       prop: "dictateParameter",

+ 8 - 8
ruoyi-ui/src/views/template/addButton/blocks/detailDialog.vue

@@ -74,7 +74,7 @@ export default {
       this.$refs.dialog.show();
     },
     // 初始化表单数据
-    initFormData(fromData){
+    initFormData(fromData) {
       this.fromData = {
           content:'',
           ...fromData
@@ -82,7 +82,7 @@ export default {
       this.fromKey++;
     },
     // 详情
-    async handleInitData(){
+    async handleInitData() {
       const {dialogType,rowData} = this;
       if(dialogType === 'add') return this.initFormData({})
       // 调接口获取详情
@@ -92,21 +92,21 @@ export default {
       this.initFormData(from);
     },
     // 关闭之前回调.
-    async handleBeforeClose(type){
+    async handleBeforeClose(type) {
       if(type !='ok') return true;
       const validate = await this.$refs.ruleForm.validate();
 
       if(!validate) return false;
       const params = {
-          ...this.fromData,
-          baseId: Number(this.fromData.baseId)
+        ...this.fromData,
+        baseId: Number(this.fromData.baseId)
       }
       //  调接口更新数据
       const res = await addButtonApi.configAddOrEdit(params);
       if(res.code !=200){
-          this.$modal.msgError(res.msg);
-          return false;
-      }
+        this.$modal.msgError(res.msg);
+        return false;
+    }
 
       this.$emit('updateList')
       this.initFormData({})

+ 54 - 12
ruoyi-ui/src/views/template/addTemplate/blocks/config.js

@@ -67,21 +67,21 @@ const btnFormConfig = function(type) {
     ]
   }
   return [
-    {
-      itemType: 'select',
-      prop: 'typeNum',
-      label: '按钮类型',
-      attrs: {
-        list: btnType
-      }
-    },
+    // {
+    //   itemType: 'select',
+    //   prop: 'typeNum',
+    //   label: '按钮类型',
+    //   attrs: {
+    //     list: btnType
+    //   }
+    // },
     ...orderList,
     {
       itemType: 'input',
       prop: 'defValue',
       label:'默认值',
       attrs: {
-          placeholder: "请输入功能默认值"
+        placeholder: "请输入功能默认值"
       }
     },
     {
@@ -89,7 +89,15 @@ const btnFormConfig = function(type) {
       prop: 'bandValue',
       label:'波段值',
       attrs: {
-          placeholder: '请输入波段值,默认38000'
+        placeholder: '请输入波段值'
+      }
+    },
+    {
+      itemType: 'input',
+      prop: 'repeatCode',
+      label: '重复码',
+      attrs: {
+        placeholder: '请输入重复码'
       }
     },
     {
@@ -97,7 +105,7 @@ const btnFormConfig = function(type) {
       prop: 'bootCode',
       label:'引导码',
       attrs: {
-          placeholder: '请输入引导码'
+        placeholder: '请输入引导码'
       }
     },
     {
@@ -105,10 +113,27 @@ const btnFormConfig = function(type) {
       prop: 'bootCodeSend',
       label:'引导码发送次数',
       attrs: {
-          placeholder: '请输入引导码发送次数'
+        placeholder: '请输入引导码发送次数'
       }
     },
     {
+      itemType: "input",
+      prop: "synchronizeCode",
+      label:'同步码',
+      attrs: {
+        placeholder: "请输入同步码"
+      },
+    },
+    {
+      itemType: "input",
+      prop: "synchronizeCodeSend",
+      label:'同步码发送次数',
+      attrs: {
+        inputType:'Number',
+        placeholder: "请输入同步码发送次数"
+      },
+    },
+    {
       itemType: 'input',
       prop: 'dateCode',
       label:'数据码',
@@ -125,7 +150,24 @@ const btnFormConfig = function(type) {
       attrs: {
           placeholder: '请输入结束码'
       }
+    },
+    {
+      itemType: "input",
+      prop: "dateBinary0",
+      label:'数据码二进制0',
+      attrs: {
+        placeholder: "请输入数据码二进制0"
+      },
+    },
+    {
+      itemType: "input",
+      prop: "dateBinary1",
+      label:'数据码二进制1',
+      attrs: {
+        placeholder: "请输入数据码二进制1"
+      },
     }
+    
   ]
 }
 

+ 16 - 16
ruoyi-ui/src/views/template/addTemplate/blocks/detailDialog.vue

@@ -44,14 +44,14 @@
               <grid-layout 
                 :key="pageArray.length+'_'+layoutKey"
                 :layout.sync="pageArray"
-                :col-num="6"
+                :col-num="3"
                 :row-height="30"
                 :is-draggable="true"
                 :is-resizable="false"
                 :is-mirrored="false"
                 :vertical-compact="false"
                 :prevent-collision="true"
-                :margin="[10, 10]"
+                :margin="[10, 0]"
                 :use-css-transforms="false"
                 :auto-size="false"
                 class="box-canvs-main-screen"
@@ -388,7 +388,7 @@ export default {
       // 调接口获取详情
       const res = await addTemplateApi.configDetail({ id: rowData.id });
       if (res.code !== 200) return this.initFormData({ })
-      const from = { ...res.data, baseId: res.data.baseId.toString() }
+      const form = { ...res.data, baseId: res.data.baseId.toString() }
       this.pageArray = JSON.parse(res.data.components).map((item, index) => ({
         ...item,
         x: Number(item.x),
@@ -398,7 +398,10 @@ export default {
         i: index,
         text: item.content
       }))
-      this.initFormData(from);
+      const { allBase } = this
+      const baseItem = allBase.filter(item => item.value === form.baseId)[0]
+      this.baseItem = baseItem
+      this.initFormData(form)
     },
     // 关闭之前回调.
     async handleBeforeClose(type) {
@@ -407,7 +410,7 @@ export default {
       };
       // 按钮配置项校验
       let validateResult = null
-      for(let index = 0; index <= this.pageArray.length-1; index++) {
+      for (let index = 0; index <= this.pageArray.length-1; index++) {
         validateResult = this.validateBtn(this.pageArray[index])
         if (validateResult !== true) {
           this.isShowSeting = true
@@ -440,29 +443,26 @@ export default {
       this.initFormData({})
       return true
     },
-    // 数据验证
-    validateList() {
-      let pageArray = this.pageArray
-      for (let i = 0; i < pageArray.length - 1; i++) {
-        let item = pageArray[i]
-        // const { typeNum, defValue, bandValue, bootCode  }
-      }
-    },
     // 添加
     addCpns(item) {
       if (!this.baseItem.id) {
         this.$message.error('请先选择基础库')
         return
       }
-      const newItem = { w: 2, h: 2, x: 1, y: this.pageArray.map(item => item?.y).sort()[this.pageArray.length-1] || 1, i: this.pageArrayCount, ...item }
+      const newItem = { w: 2, h: 1, x: 1, y: this.pageArray.map(item => item?.y).sort()[this.pageArray.length-1] || 1, i: this.pageArrayCount, ...item }
       if (this.baseItem.id !== undefined) {
-        const { bandValue, bootCode, bootCodeSend, dateCode, overCode } = this.baseItem
+        const { bandValue, bootCode, bootCodeSend, dateCode, overCode, synchronizeCode, synchronizeCodeSend, dateBinary0, dateBinary1, repeatCode } = this.baseItem
         if (item.type === 'button') {
           newItem.bandValue = bandValue
+          newItem.repeatCode = repeatCode
           newItem.bootCode = bootCode
           newItem.bootCodeSend = bootCodeSend
           newItem.dateCode = dateCode
           newItem.overCode = overCode
+          newItem.synchronizeCode = synchronizeCode
+          newItem.synchronizeCodeSend = synchronizeCodeSend
+          newItem.dateBinary0 = dateBinary0
+          newItem.dateBinary1 = dateBinary1
           newItem.addSubMax = ''
           newItem.addSubMin = ''
         }
@@ -597,7 +597,7 @@ h3 {
       position: absolute;
       top: 90px;
       left: 20px;
-      width: 333px;
+      width: 334px;
       height: 585px;
       border: 1px solid #000;
       border-radius: 4px;