Răsfoiți Sursa

视频暂存2

yanghao 2 săptămâni în urmă
părinte
comite
ddc8ab1061

+ 1 - 1
.env.local

@@ -4,7 +4,7 @@ NODE_ENV=development
 VITE_DEV=true
 
 # 请求路径
-VITE_BASE_URL='http://192.168.188.149:48080' # 192.168.188.149:48080 https://iot.deepoil.cc/
+VITE_BASE_URL='http://192.168.188.149:48080' # 192.168.188.149:48080 https://iot.deepoil.cc
 
 # MQTT服务地址
 VITE_MQTT_SERVER_URL = 'ws://localhost:8083/mqtt'

+ 1 - 1
src/api/pms/video/sipConfig.ts

@@ -28,7 +28,7 @@ export function updateSipconfig(data) {
 
 export function delSipconfigByProductId(productId) {
   return request.delete({
-    url: '/sip/sipconfig/product/' + productId,
+    url: '/rq/iot-sip-config/product/' + productId,
    
   })
 }

+ 26 - 14
src/views/pms/video_center/product/index.vue

@@ -102,7 +102,7 @@
               <el-row type="flex" :gutter="10" justify="space-between">
                 <el-col :span="16" style="text-align: left">
                   <el-link
-                    type=""
+                    
                     :underline="false"
                     style="font-weight: bold; font-size: 16px; line-height: 32px"
                     @click="handleDeviceDetail(item)"
@@ -387,6 +387,8 @@ import { download } from '@/config/axios/service'
 import productSvg from '@/assets/imgs/product.svg'
 import videoSvg from '@/assets/imgs/video.svg'
 import gatewaySvg from '@/assets/imgs/gateway.svg'
+import { getDicts } from '@/api/pms/video/dicts'
+
 
 const { t } = useI18n() // 国际化
 
@@ -400,7 +402,7 @@ const router = useRouter()
 const route = useRoute()
 
 // 字典定义
-const iot_product_status = []
+const iot_product_status = ref([])
 const iot_device_type = []
 const iot_network_method = []
 const iot_vertificate_method = []
@@ -460,7 +462,7 @@ function handleFileUploadProgress(event, file, fileList) {
 function getList() {
   loading.value = true
   listProduct(queryParams).then((response) => {
-    console.log(response)
+   
     productList.value = response.list
     total.value = response.total
     loading.value = false
@@ -509,10 +511,12 @@ async function handleChangeProductStatus(productId, status, deviceType) {
       type: 'warning'
     })
     .then(() => {
-      let data = {}
-      data.productId = productId
-      data.status = status
-      data.deviceType = deviceType
+      let data = {
+        productId,
+        status,
+        deviceType
+      }
+
       changeProductStatus(data)
         .then((response) => {
           getList()
@@ -567,15 +571,18 @@ function handleDelete(row) {
     .then(function () {
       // 删除SIP配置
       delSipconfigByProductId(productIds).then((response) => {})
-      return delProduct(productIds).then((response) => {
+      delProduct(productIds).then((response) => {
+      
         msg = response.msg
+        getList()
       })
-    })
-    .then(() => {
-      getList()
-      ElMessage.success(msg)
-    })
-    .catch(() => {})
+    }).then(() => {
+      
+      ElMessage.success('删除成功')
+    }).catch(() => { })
+
+
+   
 }
 
 // 修改按钮操作
@@ -611,6 +618,11 @@ function handleDeviceAuthorize(item) {
 // 生命周期钩子
 onMounted(() => {
   getList()
+
+  getDicts('iot_product_status').then((response) => {
+   
+    iot_product_status.value = response
+  })
 })
 
 // activated钩子

+ 12 - 9
src/views/pms/video_center/product/product-edit.vue

@@ -716,7 +716,7 @@
               type="success"
               v-if="form.isOwner != 0"
               size="small"
-              @click="changeProductStatus(2)"
+              @click="changeProductStatusAsync(2)"
               >{{ t('product.product-edit473153-42') }}</el-button
             >
           </template>
@@ -727,7 +727,7 @@
               type="danger"
               v-if="form.isOwner != 0"
               size="small"
-              @click="changeProductStatus(1)"
+              @click="changeProductStatusAsync(1)"
               >{{ t('product.product-edit473153-43') }}</el-button
             >
           </template>
@@ -1469,13 +1469,17 @@ const changeProductStatusAsync = async (status) => {
     type: 'warning'
   })
     .then(() => {
-      let data = {}
-      data.productId = form.productId
-      data.status = status
-      data.deviceType = form.deviceType
+      let data = {
+        productId: form.productId,
+        status: status,
+        deviceType: form.deviceType
+      }
+
       changeProductStatus(data)
         .then((response) => {
-          ElMessage.success(response.msg)
+          if (status == 2) {
+            ElMessage.success('发布成功')
+          }
           activeName.value = 'basic'
           getProductInfo()
         })
@@ -1522,7 +1526,6 @@ const changeInputType = (name) => {
 
 // 授权码状态修改
 const changeIsAuthorize = () => {
-  console.log('changeIsAuthorize>>>>>>>>>>>>>>>')
   let text =
     form.isAuthorize == '1'
       ? t('product.product-edit473153-72')
@@ -1609,7 +1612,7 @@ const submitSelect = () => {
 }
 
 const getCurrentRow = (val) => {
-  console.log('getCurrentRow>>>>>>>>>>>>>>>', val)
+  
   if (val != null) {
     selectRowData.value = val
   }