Просмотр исходного кода

refactor: 优化代码结构和配置,提升可维护性

- 更新生产环境和开发环境的API基础路径
- 修改设备命令接口,支持传递参数
- 移除Navbar组件中的未使用代码
- 统一分机号字段命名,提高代码一致性
- 优化设备信息展示,移除冗余图片
- 更新服务状态数据中的可执行文件名
- 刷新设备状态时增加返回参数
weieryang месяцев назад: 7
Родитель
Сommit
9ea69b3ccc

+ 2 - 2
.env.development

@@ -6,8 +6,8 @@ ENV = 'development'
6 6
 
7 7
 # 若依管理系统/开发环境
8 8
 # VUE_APP_BASE_API = 'http://vue.ruoyi.vip/prod-api'
9
-# VUE_APP_BASE_API = 'http://39.164.159.226:17071/prod-api'
10
-VUE_APP_BASE_API = 'http://192.168.1.11:17071/prod-api'
9
+VUE_APP_BASE_API = 'http://39.164.159.226:17071/prod-api'
10
+# VUE_APP_BASE_API = 'http://192.168.1.11:17071/prod-api'
11 11
 
12 12
 # 路由懒加载
13 13
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 1 - 1
.env.production

@@ -5,4 +5,4 @@ VUE_APP_TITLE = IPPBX管理系统
5 5
 ENV = 'production'
6 6
 
7 7
 # 若依管理系统/生产环境
8
-VUE_APP_BASE_API = 'http://192.168.1.16:17071/prod-api'
8
+VUE_APP_BASE_API = 'http://127.0.0.1:17071/prod-api'

+ 3 - 2
src/api/device/command.js

@@ -1,9 +1,10 @@
1 1
 import request from '@/utils/request'
2 2
 
3 3
 // 执行命令
4
-export function execCommand(id) {
4
+export function execCommand(id, params = {}) {
5 5
     return request({
6 6
         url: '/device/command/exec/' + id,
7
-        method: 'get'
7
+        method: 'get',
8
+        params
8 9
     })
9 10
 }

+ 2 - 2
src/layout/components/Navbar.vue

@@ -12,11 +12,11 @@
12 12
           <div class="right-menu-item">
13 13
             <span class="systemTime">{{ nowDate }}{{ nowTime }}</span>
14 14
           </div>
15
-          <div class="right-menu-item  hover-effect" @click="alarem" style="width: 0.8rem">
15
+          <!-- <div class="right-menu-item  hover-effect" @click="alarem" style="width: 0.8rem">
16 16
             <el-badge :value="noDealCount" :hidden="hiddenNum" class="item">
17 17
               <i class="el-icon-bell"></i>
18 18
             </el-badge>
19
-          </div>
19
+          </div> -->
20 20
           <screenfull id="screenfull" class="right-menu-item hover-effect" />
21 21
           <div class="right-menu-item">
22 22
           <el-divider direction="vertical"></el-divider>

+ 7 - 6
src/views/extension/index.vue

@@ -50,7 +50,7 @@
50 50
       <el-table-column label="设备IP" align="center" prop="deviceIp"/>
51 51
       <el-table-column label="分机号号段" align="center" prop="ext">
52 52
         <template slot-scope="scope">
53
-          <span>{{ scope.row.ext_start }} - {{ scope.row.ext_end }}</span>
53
+          <span>{{ scope.row.extStart }} - {{ scope.row.extEnd }}</span>
54 54
         </template>
55 55
       </el-table-column>
56 56
       
@@ -88,13 +88,13 @@
88 88
             </el-form-item>
89 89
           </el-col>
90 90
           <el-col :span="12">
91
-            <el-form-item label="起始分机号" prop="ext">
92
-              <el-input v-model="form.ext_start" placeholder="请输入分机号" />
91
+            <el-form-item label="起始分机号" prop="extStart">
92
+              <el-input v-model="form.extStart" placeholder="请输入分机号" />
93 93
             </el-form-item>
94 94
           </el-col>
95 95
           <el-col :span="12">
96
-            <el-form-item label="结束分机号" prop="ext">
97
-              <el-input v-model="form.ext_end" placeholder="请输入分机号" />
96
+            <el-form-item label="结束分机号" prop="extEnd">
97
+              <el-input v-model="form.extEnd" placeholder="请输入分机号" />
98 98
             </el-form-item>
99 99
           </el-col>
100 100
         </el-row>
@@ -155,7 +155,8 @@ export default {
155 155
       // 表单校验
156 156
       rules: {
157 157
         deviceIp: [{ required: true, message: '所属设备不能为空', trigger: ['blur', 'change'] }],
158
-        ext: [{ required: true, message: '分机号不能为空', trigger: ['blur', 'change'] }],
158
+        extStart: [{ required: true, message: '起始分机号不能为空', trigger: ['blur', 'change'] }],
159
+        extEnd: [{ required: true, message: '结束分机号不能为空', trigger: ['blur', 'change'] }],
159 160
         
160 161
       },
161 162
       showDept: false,

+ 9 - 8
src/views/index.vue

@@ -66,14 +66,13 @@
66 66
                         </el-dropdown-menu>
67 67
                       </el-dropdown> -->
68 68
                       <div class="device-content" style="display: flex; flex-direction: column; height: 100%;">
69
-                        <p class="device-name" style="font-size: 14px; margin-bottom: 8px;"><strong>{{ device.name
70
-                            }}</strong></p>
69
+                        <p class="device-name" style="font-size: 14px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"><strong>{{ device.name }}</strong></p>
71 70
                         <div class="device-detail" style="display: flex; height: 100%;">
72
-                          <div class="device-img" style="width: 80px; padding-right: 12px;">
71
+                          <!-- <div class="device-img" style="width: 80px; padding-right: 12px;">
73 72
                             <img src="@/assets/images/ippbx.png" alt=""
74 73
                               style="max-height: 80px; object-fit: contain;" />
75
-                          </div>
76
-                          <div class="device-info" style="width: 50%;">
74
+                          </div> -->
75
+                          <div class="device-info">
77 76
                             <p class="device-ip" style="font-size: 12px; color: #666; margin-bottom: 4px;">{{ device.ip
78 77
                               }}</p>
79 78
                             <el-tag v-if="device.status === null" type="info">未知</el-tag>
@@ -340,8 +339,8 @@ export default {
340 339
       // 服务状态数据
341 340
       services: [
342 341
         { id: 1, name: 'py_api', exeName: 'api', status: 'stopped' },
343
-        { id: 2, name: 'vc_control', exeName: 'app.exe', status: 'stopped' },
344
-        { id: 3, name: 'rec', exeName: 'filezilla.exe', status: 'stopped' },
342
+        { id: 2, name: 'vc_control', exeName: 'VCAPP.exe', status: 'stopped' },
343
+        { id: 3, name: 'rec', exeName: 'Rec.exe', status: 'stopped' },
345 344
       ],
346 345
       // 服务器信息
347 346
       server: [],
@@ -477,7 +476,9 @@ export default {
477 476
     },
478 477
     refreshDeviceStatus () {
479 478
       this.$modal.loading("操作中,请稍候!");
480
-      execCommand(4).then(res => {
479
+      execCommand(4, {
480
+        isReturn: 1,
481
+      }).then(res => {
481 482
         // this.$modal.closeLoading();
482 483
         console.log(res.msg.replace(/\r\n/g, '').replace(/""/g, '"'));
483 484
         console.log(JSON.parse(res.msg.replace(/\r\n/g, '').replace(/""/g, '"')), 'refreshDeviceStatus');