Browse Source

虚拟硬件

qinqiao 5 năm trước cách đây
mục cha
commit
54c3e2f90f

+ 1 - 1
src/apiConfig/virtualDevices.js

@@ -1,3 +1,3 @@
 /*eslint-disable*/ //规避eslint的检查,如没有eslint可不写
 // export const mockUrl = 'http://mock.Intra.xiaojukeji.com' // 线上
-export const mockUrl = 'http://172.23.162.181:9999/virtual-devices' // 线下
+export const mockUrl = 'http://10.96.113.197:9999/virtual-devices' // 线下

+ 20 - 20
src/router/index.js

@@ -268,26 +268,26 @@ export const constantRoutes = [{
                             import ('@/views/Platform/setUp/bizPage'),
                         meta: { title: '业务线' }
                     },
-                    // {
-                    //     path: 'modulePage',
-                    //     name: '业务模块',
-                    //     hidden: true,
-                    //     component: () =>
-                    //         import ('@/views/Platform/setUp/modulePage'),
-                    //     meta: { title: '业务模块' }
-                    // },
-                    // {
-                    //     path: 'platformPage',
-                    //     name: '平台类型',
-                    //     hidden: true,
-                    //     component: () =>
-                    //         import ('@/views/Platform/setUp/platformPage'),
-                    //     meta: { title: '平台类型' }
-                    // },
+                    {
+                        path: 'modulePage',
+                        name: '业务模块',
+                        // hidden: true,
+                        component: () =>
+                            import ('@/views/Platform/setUp/modulePage'),
+                        meta: { title: '业务模块' }
+                    },
+                    {
+                        path: 'platformPage',
+                        name: '平台类型',
+                        // hidden: true,
+                        component: () =>
+                            import ('@/views/Platform/setUp/platformPage'),
+                        meta: { title: '平台类型' }
+                    },
                     // {
                     //     path: 'projectPage',
                     //     name: '工程模块',
-                    //     hidden: true,
+                    //     // hidden: true,
                     //     component: () =>
                     //         import ('@/views/Platform/setUp/projectPage'),
                     //     meta: { title: '工程模块' }
@@ -501,12 +501,12 @@ export const constantRoutes = [{
         path: '/virtualDevices',
         component: Layout,
         name: '虚拟设备',
-        hidden: true,
+        // hidden: true,
         meta: { title: '虚拟设备', icon: 'env_platform' },
         children: [{
                 path: 'HTvehicle',
                 name: '单车',
-                hidden: true,
+                // hidden: true,
                 component: () =>
                     import ('@/views/virtualDevices/HTvehicle.vue'),
                 meta: { title: '单车' }
@@ -514,7 +514,7 @@ export const constantRoutes = [{
             {
                 path: 'HMvehicle',
                 name: '电单车',
-                hidden: true,
+                // hidden: true,
                 component: () =>
                     import ('@/views/virtualDevices/HMvehicle.vue'),
                 meta: { title: '电单车' }

+ 33 - 8
src/views/Platform/setUp/modulePage.vue

@@ -5,7 +5,7 @@
       <el-form :model="moduleForm">
         <div class="set-head">
           业务模块<el-input v-model="moduleForm.bizModuleName" clearable placeholder="请填写" style="margin-left:10px;width:18%;" /> &nbsp;&nbsp;
-          业务线<el-select v-model="moduleForm.bizId" placeholder="请选择" filterable clearable style="margin-left:10px;width:18%;">
+          业务线<el-select v-model="moduleForm.bizId" placeholder="请选择" filterable clearable style="margin-left:10px;width:18%;" @change="choosePlatType()">
             <el-option v-for="item in bizData" :key="item.id" :label="item.bizName" :value="item.id" />
           </el-select>
           平台类型<el-select v-model="moduleForm.platId" placeholder="请选择" filterable clearable style="margin-left:10px;width:18%;">
@@ -24,7 +24,7 @@
             <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff">{{ scope.row.bizModuleName }}</a></template>
           </el-table-column>
           <el-table-column label="平台类型" prop="platName" min-width="70px" align="center"><template slot-scope="scope"><span>{{ scope.row.platName }}</span></template> </el-table-column>
-          <el-table-column label="业务线" prop="bizId" min-width="70px" align="center"><template slot-scope="scope"><span>{{ scope.row.bizId }}</span></template> </el-table-column>
+          <el-table-column label="业务线" prop="bizName" min-width="70px" align="center"><template slot-scope="scope"><span>{{ scope.row.bizName }}</span></template> </el-table-column>
           <el-table-column label="端类型" prop="clientType" min-width="120px" align="center"><template slot-scope="{row}"><span>{{ statusMaps.get(row.clientType) }}</span></template> </el-table-column>
           <el-table-column label="修改人" prop="modifier" min-width="70px" align="center"><template slot-scope="scope"><span>{{ scope.row.modifier }}</span></template> </el-table-column>
           <el-table-column label="操作" align="center" min-width="150px" class-name="small-padding fixed-width">
@@ -42,6 +42,11 @@
               <el-form-item label="业务模块" prop="bizModuleName">
                 <el-input v-model="addModuleForm.bizModuleName" placeholder="请填写" style="margin-left:7px;width:60%;" />
               </el-form-item>
+              <el-form-item label="业务线" prop="bizId">
+                <el-select v-model="addModuleForm.bizId" placeholder="请选择" filterable clearable style="margin-left:20px;width:60%;" @change="getPlatType()">
+                  <el-option v-for="item in bizData" :key="item.id" :label="item.bizName" :value="item.id" />
+                </el-select>
+              </el-form-item>
               <el-form-item label="平台类型" prop="platId">
                 <el-select v-model="addModuleForm.platId" placeholder="请选择" filterable clearable style="margin-left:7px;width:60%;" @change="changePlat()">
                   <el-option v-for="item in platData" :key="item.id" :label="item.platName" :value="item.id" />
@@ -140,7 +145,8 @@ export default {
       // dialogName: '业务线名称',
       addModuleDataRules: {
         bizModuleName: [{ required: true, message: '业务类型不能为空', trigger: 'change' }],
-        platId: [{ required: true, message: '平台类型不能为空', trigger: 'change' }]
+        platId: [{ required: true, message: '平台类型不能为空', trigger: 'change' }],
+        bizId: [{ required: true, message: '业务线不能为空', trigger: 'change' }]
       }
 
     }
@@ -148,7 +154,7 @@ export default {
 
   created() {
     this.getBizList()
-    this.getPlatList()
+    // this.getPlatList()
     this.getList()
   },
   methods: {
@@ -165,15 +171,33 @@ export default {
       })
     },
     // 获取平台类型
-    getPlatList() {
+    choosePlatType() {
       // this.listLoading = true
       this.indexPage = {
+        bizId: this.moduleForm.bizId,
         pageSize: this.pageSize,
         curIndex: this.curIndex - 1
       }
       queryPlatFormTypeList(this.indexPage).then(response => {
         this.platData = response.data.list
-        this.total = 30
+        this.$set(this.moduleForm, 'platId', '')
+        this.total = response.data.total
+        this.listLoading = false
+      })
+    },
+
+    // 新增获取平台类型
+    getPlatType() {
+      // this.listLoading = true
+      this.indexPage = {
+        bizId: this.addModuleForm.bizId,
+        pageSize: this.pageSize,
+        curIndex: this.curIndex - 1
+      }
+      queryPlatFormTypeList(this.indexPage).then(response => {
+        this.platData = response.data.list
+        this.$set(this.addModuleForm, 'platId', '')
+        // this.total = response.data.total
         this.listLoading = false
       })
     },
@@ -196,6 +220,7 @@ export default {
       this.$refs.addModuleForms.resetFields()
       this.$set(this.addModuleForm, 'bizModuleName', '')
       this.$set(this.addModuleForm, 'platId', '')
+      this.$set(this.addModuleForm, 'bizId', '')
     },
     addModuleType(ele) {
       this.$refs['addModuleForms'].validate((valid) => {
@@ -203,7 +228,7 @@ export default {
           this.addModuleForm = ele
           this.addModuleForm.bizModuleName = ele.bizModuleName
           this.addModuleForm.platId = ele.platId
-          this.addModuleForm.bizId = this.platType[0].bizId
+          this.addModuleForm.bizId = ele.bizId
           this.addModuleForm.clientType = this.platType[0].clientType
           this.addModuleForm.creator = this.userInformation
           this.addModuleForm.modifier = this.userInformation
@@ -229,7 +254,7 @@ export default {
       }
       queryBizModuleList(this.indexPage).then(response => {
         this.moduletData = response.data.list
-        this.total = 25
+        this.total = response.data.total
         this.listLoading = false
       })
     },

+ 10 - 1
src/views/virtualDevices/HTvehicle.vue

@@ -387,6 +387,12 @@ export default {
   methods: {
     createdCode() {
       this.dialogStatus = 'create'
+      // this.$set(this.addDeviceData, 'lockModel', '')
+      // this.$set(this.addDeviceData, 'lockSupplier', '')
+      // this.$set(this.addDeviceData, 'deviceNum', '')
+      // this.$set(this.addDeviceData, 'bikeSupplier', '')
+      // this.$set(this.addDeviceData, 'bikeModel', '')
+      this.$refs.addDeviceForms.resetFields()
     },
     // 查看设备详情
     deviceDetails(vel) {
@@ -446,6 +452,7 @@ export default {
       this.dialogStatus = 'update'
       this.serviceData = vel
       this.dialogUpdateVisible = true
+      this.$refs.serviceDataForms.resetFields()
     },
     updateData(vel) {
       if (vel === this.serviceData) {
@@ -558,7 +565,7 @@ export default {
       }
     },
 
-    // 点击提交时调用
+    // 新建点击提交时调用
     createData(ele) {
       this.$refs['addDeviceForms'].validate((valid) => {
         if (valid) {
@@ -575,6 +582,8 @@ export default {
             } else {
               this.$notify({ title: 'Failed', message: response.msg, type: 'error', duration: 3000 })
             }
+          }).catch((error) => {
+            console.log('2323' + error)
           })
         }
       })