Browse Source

[Mod 0000] JAddInput组件添加自定义占位字符的功能

houzekong 8 months ago
parent
commit
78e1c2fdff

+ 3 - 2
src/components/Form/src/jeecg/components/JAddInput.vue

@@ -1,7 +1,7 @@
 <template>
   <div v-for="(param, index) in dynamicInput.params" :key="index" style="display: flex">
-    <a-input placeholder="请输入参数key" v-model:value="param.label" style="width: 30%; margin-bottom: 5px" @input="emitChange" />
-    <a-input placeholder="请输入参数value" v-model:value="param.value" style="width: 30%; margin: 0 0 5px 5px" @input="emitChange" />
+    <a-input :placeholder="placeholders[0]" v-model:value="param.label" style="width: 30%; margin-bottom: 5px" @input="emitChange" />
+    <a-input :placeholder="placeholders[1]" v-model:value="param.value" style="width: 30%; margin: 0 0 5px 5px" @input="emitChange" />
     <MinusCircleOutlined
       v-if="dynamicInput.params.length > min"
       class="dynamic-delete-button"
@@ -34,6 +34,7 @@
       //update-begin---author:wangshuai ---date:20220516  for:[VUEN-1043]系统编码规则,最后一个输入框不能删除------------
       //自定义删除按钮多少才会显示
       min: propTypes.integer.def(1),
+      placeholders: propTypes.array.def(['请输入参数key', '请输入参数value']),
       //update-end---author:wangshuai ---date:20220516  for:[VUEN-1043]系统编码规则,最后一个输入框不能删除--------------
     },
     emits: ['change', 'update:value'],

+ 12 - 2
src/views/vent/deviceManager/configurationTable/configuration.data.ts

@@ -79,11 +79,21 @@ export const formSchema: FormSchema[] = [
     },
   },
   {
-    label: '所展示点位及名称',
-    field: 'moduleData',
+    label: '主要内容配置',
+    field: 'moduleData.list',
     component: 'JAddInput',
     componentProps: {
       min: 0,
+      placeholders: ['请输入点位', '请输入名称'],
+    },
+  },
+  {
+    label: '图表内容配置',
+    field: 'moduleData.chart',
+    component: 'JAddInput',
+    componentProps: {
+      min: 0,
+      placeholders: ['请输入点位', '请输入名称'],
     },
   },
 ];

+ 2 - 1
src/views/vent/deviceManager/configurationTable/index.vue

@@ -1,3 +1,4 @@
+<!-- eslint-disable vue/multi-word-component-names -->
 <template>
   <div class="device-manager-box">
     <NormalTable
@@ -15,7 +16,7 @@
 </template>
 
 <script lang="ts" name="system-user" setup>
-  //ts语法
+  // 相关文档请参阅 vent/home/configurable/README.md
   import { ref } from 'vue';
   import NormalTable from '../comment/NormalTable.vue';
   import { list, deleteById, saveOrUpdate } from './configuration.api';