Ver código fonte

refactor: adjust some text

Casper Dai 3 anos atrás
pai
commit
cd96a3177f

+ 1 - 1
src/api/device.js

@@ -27,7 +27,7 @@ export function getRatiosWithUser () {
       data: Object.keys(data).map(key => {
         return {
           value: key,
-          label: `${key} ${data[key].map(device => device.name).join(', ')}`
+          label: `${key} ${data[key].slice(0, 3).map(device => device.name).join(', ')}`
         }
       })
     }

+ 7 - 5
src/views/realm/device/Group.vue

@@ -37,17 +37,19 @@ export default {
         ],
         cols: [
           { type: 'refresh', render (data, h) {
-            return data.isMaster
+            return __SUB_DEVICE__ && data.isMaster
               ? h('i', {
                 staticClass: `o-expand-icon u-pointer ${data.loading ? 'el-icon-loading' : 'el-icon-arrow-right'}`,
                 class: { expand: data.expand }
               })
               : null
           } },
-          { label: '设备名称', 'min-width': 120, render (data, h) {
-            return data.empty ? h('span', { staticClass: 'u-color--info' }, '暂无备份设备') : data.name
-          } },
-          { prop: 'productName', label: '产品' },
+          __SUB_DEVICE__
+            ? { label: '设备名称', 'min-width': 120, render (data, h) {
+              return data.empty ? h('span', { staticClass: 'u-color--info' }, '暂无备份设备') : data.name
+            } }
+            : { prop: 'name', label: '设备名称', 'min-width': 120 },
+          { prop: 'productName', label: '配置' },
           { prop: 'serialNumber', label: '序列号' },
           { prop: 'mac', label: 'MAC' },
           { prop: 'address', label: '地址', 'min-width': 100 },

+ 5 - 5
src/views/realm/device/Tenant.vue

@@ -11,11 +11,11 @@
             name="Device"
           />
           <el-tab-pane
-            label="产品"
+            label="屏幕配置"
             name="Product"
           />
           <el-tab-pane
-            label="产品类型"
+            label="屏幕类型"
             name="ProductType"
           />
         </el-tabs>
@@ -30,9 +30,9 @@
 </template>
 
 <script>
-import ProductType from './ProductType'
-import Product from './Product'
-import Device from './Device'
+import ProductType from './components/ProductType'
+import Product from './components/Product'
+import Device from './components/Device'
 
 export default {
   name: 'TenantDeviceManagement',

+ 2 - 1
src/views/realm/device/Device.vue → src/views/realm/device/components/Device.vue

@@ -125,7 +125,7 @@ export default {
           { type: 'add', on: this.onAddDevice }
         ],
         filters: [
-          { key: 'productId', type: 'select', placeholder: '全部产品', ...productSelectSchema },
+          { key: 'productId', type: 'select', placeholder: '全部配置', ...productSelectSchema },
           { key: 'name', type: 'search', placeholder: '设备名称' }
         ],
         cols: [
@@ -142,6 +142,7 @@ export default {
               return data.empty ? h('span', { staticClass: 'u-color--info' }, '暂无备份设备') : data.name
             } }
             : { prop: 'name', label: '设备名称', 'min-width': 120 },
+          { prop: 'productName', label: '配置' },
           { prop: 'serialNumber', label: '序列号', 'min-width': 140 },
           { prop: 'mac', label: 'MAC', 'min-width': 140 },
           { type: 'tag', 'width': 100, render ({ empty, activate, onlineStatus }) {

+ 5 - 5
src/views/realm/device/Product.vue → src/views/realm/device/components/Product.vue

@@ -19,7 +19,7 @@
         <span class="c-grid-form__label required">类型</span>
         <schema-select
           v-model="currObj.productTypeId"
-          placeholder="请选择产品类型"
+          placeholder="请选择屏幕类型"
           :disabled="!isAdd"
           :schema="productTypeSelectSchema"
         />
@@ -114,7 +114,7 @@ export default {
           { key: 'productTypeId', type: 'select', placeholder: '全部类型', ...productTypeSelectSchema }
         ],
         cols: [
-          { prop: 'name', label: '产品名称', 'min-width': 60 },
+          { prop: 'name', label: '配置名称', 'min-width': 60 },
           { prop: 'productTypeName', label: '类型', 'min-width': 60 },
           { prop: 'resolutionRatio', label: '分辨率', 'min-width': 60 },
           { label: '分割器', type: 'tag', width: 100, render ({ fpga }) {
@@ -137,7 +137,7 @@ export default {
       return this.group.path
     },
     dialogTitle () {
-      return this.isAdd ? `新增产品` : `编辑产品`
+      return this.isAdd ? `新增屏幕配置` : `编辑屏幕配置`
     },
     productTypes () {
       return this.isAdd ? this.typeOptions : [{ value: this.currObj.productTypeId, label: this.$currObj.productTypeName }]
@@ -170,14 +170,14 @@ export default {
       if (!this.currObj.name) {
         this.$message({
           type: 'warning',
-          message: '产品名称不能为空'
+          message: '配置名称不能为空'
         })
         return
       }
       if (!this.currObj.productTypeId) {
         this.$message({
           type: 'warning',
-          message: '请选择产品分类'
+          message: '请选择屏幕类型'
         })
         return
       }

+ 13 - 5
src/views/realm/device/ProductType.vue → src/views/realm/device/components/ProductType.vue

@@ -9,10 +9,11 @@
       @confirm="onSave"
     >
       <div class="c-grid-form u-align-self--center">
-        <span class="c-grid-form__label required">名称</span>
+        <span class="c-grid-form__label required">宽高比</span>
         <el-input
           v-model.trim="currObj.name"
-          placeholder="最多50个字符"
+          placeholder="例:16:9"
+          :disabled="!isAdd"
           maxlength="50"
           clearable
         />
@@ -56,7 +57,7 @@ export default {
           { type: 'add', on: this.onAdd }
         ],
         cols: [
-          { prop: 'name', label: '类型名称' },
+          { prop: 'name', label: '宽高比' },
           { prop: 'remark', label: '备注' },
           { type: 'invoke', render: [
             { label: '编辑', on: this.onEdit },
@@ -71,7 +72,7 @@ export default {
       return this.group.path
     },
     dialogTitle () {
-      return this.isAdd ? `新增产品类型` : `编辑产品类型`
+      return this.isAdd ? `新增屏幕类型` : `编辑屏幕类型`
     }
   },
   methods: {
@@ -95,7 +96,14 @@ export default {
       if (!this.currObj.name) {
         this.$message({
           type: 'warning',
-          message: '产品分类名称不能为空'
+          message: '宽高比不能为空'
+        })
+        return
+      }
+      if (!/^[1-9]\d*:[1-9]\d*$/.test(this.currObj.name)) {
+        this.$message({
+          type: 'warning',
+          message: '宽高比格式错误'
         })
         return
       }