yanghao hace 16 horas
padre
commit
219fa8d29c

+ 109 - 89
src/views/pms/video_center/category/index.vue

@@ -1,42 +1,49 @@
 <template>
   <div style="padding: 6px">
-    <el-card v-show="showSearch" style="margin-bottom: 5px;border: 0;" shadow="never"> 
-
+    <el-card v-show="showSearch" style="margin-bottom: 5px; border: 0" shadow="never">
       <el-form :model="queryParams" ref="queryFormRef" inline style="margin-bottom: -20px">
         <el-form-item :label="t('product.index091251-2')" prop="categoryName">
-          <el-input 
-            v-model="queryParams.categoryName" 
-            :placeholder="t('product.index091251-3')" 
-            clearable 
-            size="default" 
-            @keyup.enter="handleQuery" 
+          <el-input
+            v-model="queryParams.categoryName"
+            :placeholder="t('product.index091251-3')"
+            clearable
+            size="default"
+            @keyup.enter="handleQuery"
           />
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" :icon="Search" size="default" @click="handleQuery">搜索</el-button>
+          <el-button type="primary" :icon="Search" size="default" @click="handleQuery"
+            >搜索</el-button
+          >
           <el-button :icon="Refresh" size="default" @click="resetQuery">重置</el-button>
-          
         </el-form-item>
       </el-form>
     </el-card>
 
-    <el-card class="main-card" shadow="never" style="border: 0;">
+    <el-card class="main-card" shadow="never" style="border: 0">
       <div class="card-toolbar mb8">
         <el-button type="primary" :icon="Plus" size="default" @click="handleAdd">新增</el-button>
       </div>
-      
-      <el-table 
-        class="base-table" 
-        v-loading="loading" 
-        :data="categoryList" 
-        @selection-change="handleSelectionChange" 
-        
+
+      <el-table
+        class="base-table"
+        v-loading="loading"
+        :data="categoryList"
+        @selection-change="handleSelectionChange"
       >
         <el-table-column label="产品分类名称" align="center" prop="categoryName" min-width="150" />
-        <el-table-column label="备注" align="left" header-align="center" prop="remark" min-width="150" />
+        <el-table-column
+          label="备注"
+          align="left"
+          header-align="center"
+          prop="remark"
+          min-width="150"
+        />
         <el-table-column label="系统定义" align="center" prop="isSys" min-width="150">
           <template #default="scope">
-            <el-icon v-if="scope.row.isSys == 1" style="color: #346cef; font-size: 20px"><Check /></el-icon>
+            <el-icon v-if="scope.row.isSys == 1" style="color: #346cef; font-size: 20px"
+              ><Check
+            /></el-icon>
             <el-icon v-else style="font-size: 20px"><CircleClose /></el-icon>
           </template>
         </el-table-column>
@@ -46,7 +53,12 @@
             <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
+        <el-table-column
+          label="操作"
+          align="center"
+          class-name="small-padding fixed-width"
+          width="200"
+        >
           <template #default="scope">
             <el-button
               size="small"
@@ -72,42 +84,34 @@
             >
               删除
             </el-button>
-            <span style="font-size: 10px; color: #999" v-if="scope.row.isSys == '1' && isTenant">系统定义,不能修改</span>
+            <span style="font-size: 10px; color: #999" v-if="scope.row.isSys == '1' && isTenant"
+              >系统定义,不能修改</span
+            >
           </template>
         </el-table-column>
       </el-table>
 
-      <pagination 
-        v-show="total > 0" 
-        :total="total" 
-        v-model:page="queryParams.pageNum" 
-        v-model:limit="queryParams.pageSize" 
-        @pagination="getList" 
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        v-model:page="queryParams.pageNo"
+        v-model:limit="queryParams.pageSize"
+        @pagination="getList"
       />
 
       <!-- 添加或修改产品分类对话框 -->
-      <el-dialog 
-        v-model="open" 
-        title="产品分类" 
-        width="500px" 
-        append-to-body
-      >
-        <el-form 
-          ref="formRef" 
-          :model="form" 
-          :rules="rules" 
-          label-width="80px"
-        >
+      <el-dialog v-model="open" title="产品分类" width="500px" append-to-body>
+        <el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
           <el-form-item label="分类名称" prop="categoryName">
             <el-input v-model="form.categoryName" placeholder="请输入产品分类名称" />
           </el-form-item>
           <el-form-item label="显示顺序" prop="orderNum">
-            <el-input-number 
-              controls-position="right" 
-              v-model="form.orderNum" 
-              type="number" 
-              style="width: 150px;"
-              placeholder="请输入显示顺序" 
+            <el-input-number
+              controls-position="right"
+              v-model="form.orderNum"
+              type="number"
+              style="width: 150px"
+              placeholder="请输入显示顺序"
             />
           </el-form-item>
           <el-form-item label="备注" prop="remark">
@@ -117,7 +121,9 @@
         <template #footer>
           <div class="dialog-footer">
             <el-button type="primary" @click="submitForm" v-show="form.categoryId">修 改</el-button>
-            <el-button type="primary" @click="submitForm" v-show="!form.categoryId">新 增</el-button>
+            <el-button type="primary" @click="submitForm" v-show="!form.categoryId"
+              >新 增</el-button
+            >
             <el-button @click="cancel">取 消</el-button>
           </div>
         </template>
@@ -129,11 +135,26 @@
 <script setup>
 import { ref, reactive, onMounted } from 'vue'
 import { ElMessage, ElMessageBox, ElForm } from 'element-plus'
-import { Search, Refresh, InfoFilled, Check, CircleClose, Plus, View, Delete } from '@element-plus/icons-vue'
+import {
+  Search,
+  Refresh,
+  InfoFilled,
+  Check,
+  CircleClose,
+  Plus,
+  View,
+  Delete
+} from '@element-plus/icons-vue'
 import { parseTime } from '@/utils/dateUtil'
 
 // API 导入
-import { addCategory, delCategory, getCategory, listCategory, updateCategory } from '@/api/pms/video/category'
+import {
+  addCategory,
+  delCategory,
+  getCategory,
+  listCategory,
+  updateCategory
+} from '@/api/pms/video/category'
 
 const { t } = useI18n() // 国际化
 // 定义响应式数据
@@ -152,10 +173,10 @@ const formRef = ref()
 // 查询参数
 const queryParams = reactive({
   showSenior: false,
-  pageNum: 1,
+  pageNo: 1,
   pageSize: 20,
   categoryName: null,
-  isSys: null,
+  isSys: null
 })
 
 // 表单参数
@@ -172,7 +193,7 @@ const form = reactive({
   createTime: null,
   updateBy: null,
   updateTime: null,
-  remark: null,
+  remark: null
 })
 
 // 表单校验规则
@@ -180,17 +201,17 @@ const rules = {
   categoryName: [
     {
       required: true,
-      message: t("product.category142342-4"),
-      trigger: 'blur',
-    },
+      message: t('product.category142342-4'),
+      trigger: 'blur'
+    }
   ],
   isSys: [
     {
       required: true,
-      message: t("product.category142342-5"),
-      trigger: 'blur',
-    },
-  ],
+      message: t('product.category142342-5'),
+      trigger: 'blur'
+    }
+  ]
 }
 
 // 初始化
@@ -205,32 +226,32 @@ const init = () => {
 // 获取列表数据
 const getList = () => {
   loading.value = true
-    listCategory(queryParams).then((response) => {
-    console.log(response);
+  listCategory(queryParams).then((response) => {
+    console.log(response)
     categoryList.value = response.list
     total.value = response.total
-    loading.value = false 
+    loading.value = false
   })
 
-    // 测试数据
-    // setTimeout(() => {
-    //     categoryList.value = [
-    //     {
-    //       categoryId: 1,
-    //       categoryName: '分类1',
-    //       tenantId: null,
-    //       tenantName: null,
-    //       isSys: '0',
-    //       parentId: null,
-    //       orderNum: 1,
-    //       delFlag: null,
-    //       createBy: null,
-    //       createTime: '2023-05-05T09:09:09.000+00:00',
-    //     }
-    //   ]
-    //   total.value = 1
-    //   loading.value = false
-    // }, 1000)
+  // 测试数据
+  // setTimeout(() => {
+  //     categoryList.value = [
+  //     {
+  //       categoryId: 1,
+  //       categoryName: '分类1',
+  //       tenantId: null,
+  //       tenantName: null,
+  //       isSys: '0',
+  //       parentId: null,
+  //       orderNum: 1,
+  //       delFlag: null,
+  //       createBy: null,
+  //       createTime: '2023-05-05T09:09:09.000+00:00',
+  //     }
+  //   ]
+  //   total.value = 1
+  //   loading.value = false
+  // }, 1000)
 }
 
 // 取消操作
@@ -254,9 +275,9 @@ const reset = () => {
     createTime: null,
     updateBy: null,
     updateTime: null,
-    remark: null,
+    remark: null
   })
-  
+
   // 修复:正确调用表单重置方法
   if (formRef.value) {
     formRef.value.resetFields()
@@ -265,7 +286,7 @@ const reset = () => {
 
 // 查询操作
 const handleQuery = () => {
-  queryParams.pageNum = 1
+  queryParams.pageNo = 1
   getList()
 }
 
@@ -286,7 +307,7 @@ const handleSelectionChange = (selection) => {
 const handleAdd = () => {
   reset()
   open.value = true
-  title.value = t("product.category142342-6")
+  title.value = t('product.category142342-6')
 }
 
 // 修改操作
@@ -296,7 +317,6 @@ const handleUpdate = (row) => {
 
   Object.assign(form, row)
   open.value = true
-
 }
 
 // 提交表单
@@ -324,10 +344,10 @@ const submitForm = () => {
 const handleDelete = (row) => {
   const categoryIds = row.categoryId || ids.value
   let msg = ''
-  ElMessageBox.confirm(t("product.category142342-8", [categoryIds]), '提示', {
+  ElMessageBox.confirm(t('product.category142342-8', [categoryIds]), '提示', {
     confirmButtonText: '确定',
     cancelButtonText: '取消',
-    type: 'warning',
+    type: 'warning'
   })
     .then(() => {
       return delCategory(categoryIds).then((response) => {
@@ -346,4 +366,4 @@ onMounted(() => {
   getList()
   init()
 })
-</script>
+</script>

+ 3 - 3
src/views/pms/video_center/device/device-log.vue

@@ -119,7 +119,7 @@
         <pagination
           v-show="total > 0"
           :total="total"
-          v-model:page="queryParams.pageNum"
+          v-model:page="queryParams.pageNo"
           v-model:limit="queryParams.pageSize"
           @pagination="getList"
         />
@@ -158,7 +158,7 @@ const deviceLogList = ref([])
 const daterangeTime = ref([])
 
 const queryParams = reactive({
-  pageNum: 1,
+  pageNo: 1,
   pageSize: 10,
   logType: null,
   logValue: null,
@@ -203,7 +203,7 @@ const getList = () => {
 }
 
 const handleQuery = () => {
-  queryParams.pageNum = 1
+  queryParams.pageNo = 1
   getList()
 }
 

+ 51 - 43
src/views/pms/video_center/device/index.vue

@@ -18,20 +18,20 @@
             style="width: 130px"
           />
         </el-form-item>
-         <el-form-item label="所在部门" prop="deptId">
-                  <el-tree-select
-                    v-model="queryParams.deptId"
-                    :data="deptList"
-                    :props="defaultProps"
-                    check-strictly
-                    node-key="id"
-                    filterable
-                    placeholder="请选择所在部门"
-                     @keyup.enter="handleQuery"
-                    style="width: 200px;"
-                   size="default"
-                  />
-                </el-form-item>
+        <el-form-item label="所在部门" prop="deptId">
+          <el-tree-select
+            v-model="queryParams.deptId"
+            :data="deptList"
+            :props="defaultProps"
+            check-strictly
+            node-key="id"
+            filterable
+            placeholder="请选择所在部门"
+            @keyup.enter="handleQuery"
+            style="width: 200px"
+            size="default"
+          />
+        </el-form-item>
         <el-form-item label="设备编号" prop="serialNumber">
           <el-input
             v-model="queryParams.serialNumber"
@@ -63,7 +63,6 @@
             >查询</el-button
           >
           <el-button :icon="Refresh" size="default" @click="resetQuery">重置</el-button>
-         
         </el-form-item>
       </el-form>
     </el-card>
@@ -73,7 +72,7 @@
       shadow="never"
       v-if="showType == 'list'"
       :style="showSearch ? '' : 'margin:0'"
-      style="border: 0;"
+      style="border: 0"
     >
       <div class="card-toolbar mb8">
         <div>
@@ -270,7 +269,7 @@
       <pagination
         v-show="total > 0"
         :total="total"
-        v-model:page="queryParams.pageNum"
+        v-model:page="queryParams.pageNo"
         v-model:limit="queryParams.pageSize"
         :page-sizes="[12, 24, 36, 60]"
         @pagination="getList"
@@ -282,7 +281,7 @@
       shadow="never"
       v-if="showType == 'card'"
       :style="showSearch ? '' : 'margin:0'"
-       style="border: 0;"
+      style="border: 0"
     >
       <div class="card-toolbar mb8">
         <div>
@@ -346,7 +345,12 @@
           :key="index"
           style="margin-bottom: 30px; text-align: center"
         >
-          <el-card :body-style="{ padding: '20px' }" shadow="hover" class="card-item"  style="border: 0;">
+          <el-card
+            :body-style="{ padding: '20px' }"
+            shadow="hover"
+            class="card-item"
+            style="border: 0"
+          >
             <el-row :gutter="10" justify="space-between">
               <el-col :span="18" style="text-align: left">
                 <el-link
@@ -380,28 +384,32 @@
                 />
               </el-col>
               <el-col :span="2">
-                <div style="font-size: 28px; color: #ccc;">
-                  <Icon icon="svg-icon:wifi_4" style="font-size: 26px;" v-if="item.status == 3 && item.rssi >= '-55'" />
+                <div style="font-size: 28px; color: #ccc">
+                  <Icon
+                    icon="svg-icon:wifi_4"
+                    style="font-size: 26px"
+                    v-if="item.status == 3 && item.rssi >= '-55'"
+                  />
 
                   <Icon
-                    style="font-size: 26px;"
+                    style="font-size: 26px"
                     icon="svg-icon:wifi_3"
                     v-else-if="item.status == 3 && item.rssi >= '-70' && item.rssi < '-55'"
                   />
 
                   <Icon
-                  style="font-size: 26px;"
+                    style="font-size: 26px"
                     icon="svg-icon:wifi_2"
                     v-else-if="item.status == 3 && item.rssi >= '-85' && item.rssi < '-70'"
                   />
 
                   <Icon
-                  style="font-size: 26px;"
+                    style="font-size: 26px"
                     icon="svg-icon:wifi_1"
                     v-else-if="item.status == 3 && item.rssi >= '-100' && item.rssi < '-85'"
                   />
 
-                  <Icon icon="svg-icon:wifi_0" v-else style="font-size: 26px;" />
+                  <Icon icon="svg-icon:wifi_0" v-else style="font-size: 26px" />
                 </div>
               </el-col>
             </el-row>
@@ -430,7 +438,7 @@
                     {{ item.deptName || '无' }}
                   </el-descriptions-item>
                   <el-descriptions-item label="关联设备">
-                     {{ item.deviceCode || '无' }}
+                    {{ item.deviceCode || '无' }}
                   </el-descriptions-item>
                 </el-descriptions>
               </el-col>
@@ -487,7 +495,7 @@
       <pagination
         v-show="total > 0"
         :total="total"
-        v-model:page="queryParams.pageNum"
+        v-model:page="queryParams.pageNo"
         v-model:limit="queryParams.pageSize"
         :page-sizes="[12, 24, 36, 60]"
         @pagination="getList"
@@ -598,7 +606,7 @@ const baseUrl = import.meta.env.VITE_BASE_URL
 
 // 查询参数
 const queryParams = reactive({
-  pageNum: 1,
+  pageNo: 1,
   pageSize: 12,
   showChild: true,
   deviceName: null,
@@ -613,7 +621,7 @@ const queryParams = reactive({
   status: null,
   networkAddress: null,
   activeTime: null,
-  deptId:null
+  deptId: null
 })
 
 // 表单参数
@@ -630,16 +638,16 @@ const form = reactive({
 
 // 批量导入参数
 const isSubDev = ref(false)
-const  deptList = ref([])
+const deptList = ref([])
 // 生命周期钩子
-onMounted(async() => {
+onMounted(async () => {
   const time = route.query.t
   if (time != null && time != uniqueId.value) {
     uniqueId.value = time
     // 页码筛选
-    let pageNum = route.query.pageNum
-    if (pageNum != null) {
-      queryParams.pageNum = Number(pageNum)
+    let pageNo = route.query.pageNo
+    if (pageNo != null) {
+      queryParams.pageNo = Number(pageNo)
     }
     // 产品筛选
     let productId = route.query.productId
@@ -665,7 +673,7 @@ onMounted(async() => {
   }
 
   getList()
-   deptList.value = handleTree(await DeptApi.getSimpleDeptList())
+  deptList.value = handleTree(await DeptApi.getSimpleDeptList())
 
   // 以后会用,暂时注释掉
   // connectMqtt()
@@ -676,9 +684,9 @@ onActivated(() => {
   if (time != null && time != uniqueId.value) {
     uniqueId.value = time
     // 页码筛选
-    let pageNum = route.query.pageNum
-    if (pageNum != null) {
-      queryParams.pageNum = Number(pageNum)
+    let pageNo = route.query.pageNo
+    if (pageNo != null) {
+      queryParams.pageNo = Number(pageNo)
     }
     // 产品筛选
     let productId = route.query.productId
@@ -899,7 +907,7 @@ function getList() {
 
 /** 搜索按钮操作 */
 function handleQuery() {
-  queryParams.pageNum = 1
+  queryParams.pageNo = 1
   getList()
 }
 
@@ -932,7 +940,7 @@ function handleEditDevice(row, activeName) {
     query: {
       deviceId: deviceId,
       isSubDev: isSubDevValue,
-      pageNum: queryParams.pageNum,
+      pageNo: queryParams.pageNo,
       activeName: activeName
     }
   })
@@ -952,7 +960,7 @@ function handleRunDevice(row) {
       query: {
         deviceId: deviceId,
         isSubDev: isSubDevValue,
-        pageNum: queryParams.pageNum,
+        pageNo: queryParams.pageNo,
         activeName: 'sipChannel'
       }
     })
@@ -962,7 +970,7 @@ function handleRunDevice(row) {
       query: {
         deviceId: deviceId,
         isSubDev: isSubDevValue,
-        pageNum: queryParams.pageNum,
+        pageNo: queryParams.pageNo,
         activeName: 'runningStatus'
       }
     })
@@ -979,7 +987,7 @@ function handleDelete(row) {
   })
     .then(() => {
       if (row.deviceType === 3) {
-         delSipDeviceBySipId(row.serialNumber)
+        delSipDeviceBySipId(row.serialNumber)
       }
       return delDevice(deviceIds)
     })

+ 22 - 19
src/views/pms/video_center/device/product-list.vue

@@ -12,10 +12,8 @@
           />
         </el-form-item>
         <el-form-item>
-          <el-button type="primary"  size="small" @click="handleQuery">
-            查询
-          </el-button>
-          <el-button  size="small" @click="resetQuery"> 重置 </el-button>
+          <el-button type="primary" size="small" @click="handleQuery"> 查询 </el-button>
+          <el-button size="small" @click="resetQuery"> 重置 </el-button>
         </el-form-item>
       </el-form>
 
@@ -43,12 +41,18 @@
 
         <el-table-column label="认证方式" align="center" prop="status">
           <template #default="scope">
-            <dict-tag :type="DICT_TYPE.VIDEO_CENTER_VERTIFICATE_METHOD" :value="scope.row.vertificateMethod" />
+            <dict-tag
+              :type="DICT_TYPE.VIDEO_CENTER_VERTIFICATE_METHOD"
+              :value="scope.row.vertificateMethod"
+            />
           </template>
         </el-table-column>
         <el-table-column label="联网方式" align="center" prop="networkMethod">
           <template #default="scope">
-             <dict-tag :type="DICT_TYPE.VIDEO_CENTER_NETWORK_METHOD" :value="scope.row.networkMethod" />
+            <dict-tag
+              :type="DICT_TYPE.VIDEO_CENTER_NETWORK_METHOD"
+              :value="scope.row.networkMethod"
+            />
           </template>
         </el-table-column>
         <el-table-column label="创建时间" align="center" prop="createTime" width="100">
@@ -58,15 +62,15 @@
         </el-table-column>
       </el-table>
 
-     <div class="mt-5 flex justify-center">
-          <pagination
-        v-show="total > 0"
-        :total="total"
-        v-model:page="queryParams.pageNum"
-        v-model:limit="queryParams.pageSize"
-        @pagination="getList"
-      />
-     </div>
+      <div class="mt-5 flex justify-center">
+        <pagination
+          v-show="total > 0"
+          :total="total"
+          v-model:page="queryParams.pageNo"
+          v-model:limit="queryParams.pageSize"
+          @pagination="getList"
+        />
+      </div>
     </div>
     <template #footer>
       <div class="dialog-footer">
@@ -82,8 +86,7 @@ import { ref, reactive, onMounted } from 'vue'
 import { listProduct } from '@/api/pms/video/product'
 import { parseTime } from '@/utils/dateUtil'
 import { getDicts } from '@/api/pms/video/dicts'
-import {DICT_TYPE, getDictLabel} from "@/utils/dict";
-
+import { DICT_TYPE, getDictLabel } from '@/utils/dict'
 
 const { t } = useI18n()
 
@@ -116,7 +119,7 @@ const queryFormRef = ref()
 const singleTableRef = ref()
 
 const queryParams = reactive({
-  pageNum: 1,
+  pageNo: 1,
   pageSize: 10,
   productName: null,
   categoryId: null,
@@ -147,7 +150,7 @@ const getList = () => {
 }
 
 const handleQuery = () => {
-  queryParams.pageNum = 1
+  queryParams.pageNo = 1
   getList()
 }
 

+ 12 - 18
src/views/pms/video_center/media/index.vue

@@ -1,17 +1,13 @@
 <template>
   <div id="mediaServer" class="iot-sip-mediaServer">
-    <el-card style="padding-bottom: 100px;border: 0;" v-loading="loading" shadow="never">
+    <el-card style="padding-bottom: 100px; border: 0" v-loading="loading" shadow="never">
       <div class="mb-8">
-        <el-button
-          type="primary"
-        
-          :icon="Plus"
-          size="small"
-          @click="add"
-          
-          >{{ t('sip.mediaServer998535-0') }}</el-button
+        <el-button type="primary" :icon="Plus" size="small" @click="add">{{
+          t('sip.mediaServer998535-0')
+        }}</el-button>
+        <el-button type="warning" plain :icon="Refresh" size="small" @click="getServerList"
+          >刷新</el-button
         >
-        <el-button type="warning" plain :icon="Refresh" size="small" @click="getServerList">刷新</el-button>
       </div>
       <el-row :gutter="30">
         <el-col
@@ -28,7 +24,7 @@
             <el-card shadow="always" class="card-item">
               <el-row :gutter="10">
                 <el-col :span="15">
-                  <el-descriptions :column="1" size="small" style="white-space: nowrap;">
+                  <el-descriptions :column="1" size="small" style="white-space: nowrap">
                     <el-descriptions-item :label="t('sip.mediaServer998535-1')">
                       {{ item.serverId }}
                     </el-descriptions-item>
@@ -96,7 +92,7 @@
       <pagination
         v-show="total > 0"
         :total="total"
-        v-model:page="queryParams.pageNum"
+        v-model:page="queryParams.pageNo"
         v-model:limit="queryParams.pageSize"
         :page-sizes="[12, 24, 36, 60]"
         @pagination="getServerList"
@@ -139,12 +135,12 @@ const num = ref(getNumberByWidth())
 const total = ref(0)
 
 defineOptions({
-  name:'VideoCenterMediaServer'
+  name: 'VideoCenterMediaServer'
 })
 
 // 查询参数
 const queryParams = reactive({
-  pageNum: 1,
+  pageNo: 1,
   pageSize: 10
 })
 
@@ -165,7 +161,7 @@ const initData = () => {
 
 // 页码变化
 const pageNumChange = (val) => {
-  queryParams.pageNum = val
+  queryParams.pageNo = val
   getServerList()
 }
 
@@ -184,7 +180,6 @@ const getServerList = () => {
     total.value = response.total
     loading.value = false
   })
-
 }
 
 // 添加
@@ -225,11 +220,10 @@ const del = (row) => {
   const ids = row.id // 这里原代码有问题,应该是row.id而不是this.ids
   ElMessageBox.confirm(t('sip.mediaServer998535-7', [ids]))
     .then(async function () {
-     await delmediaServer(ids)
+      await delmediaServer(ids)
       await getServerList()
     })
     .then(() => {
-     
       ElMessage.success('删除成功')
     })
     .catch(() => {})

+ 39 - 72
src/views/pms/video_center/product/index.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="product normal-form" style="padding: 6px">
-    <el-card style="margin: 20px;border:0; margin-top: 10px;" shadow="never">
+    <el-card style="margin: 20px; border: 0; margin-top: 10px" shadow="never">
       <el-form
-      class="search-form"
+        class="search-form"
         ref="queryFormRef"
         :inline="true"
         :model="queryParams"
@@ -33,7 +33,7 @@
             :placeholder="t('product.index091251-5')"
             clearable
             size="default"
-            style="width: 150px;"
+            style="width: 150px"
           >
             <el-option
               v-for="dict in iot_product_status"
@@ -50,18 +50,12 @@
           <el-button :icon="Refresh" size="default" @click="resetQuery">{{
             t('product.index091251-7')
           }}</el-button>
-         
         </el-form-item>
       </el-form>
     </el-card>
-    <el-card class="main-card" shadow="never" style="margin: 20px;border:0">
+    <el-card class="main-card" shadow="never" style="margin: 20px; border: 0">
       <div class="card-toolbar mb8">
-        <el-button
-         
-          type="primary"
-          size="small"
-          :icon="Plus"
-          @click="handleEditProduct(0)"
+        <el-button type="primary" size="small" :icon="Plus" @click="handleEditProduct(0)"
           >新增</el-button
         >
         <el-radio-group v-model="showType" class="float-right ml-10" plain size="small">
@@ -91,11 +85,15 @@
             :xl="6"
             style="margin-bottom: 30px; text-align: center"
           >
-            <el-card :body-style="{ padding: '20px' }" shadow="hover" class="card-item" style="border: 0;">
+            <el-card
+              :body-style="{ padding: '20px' }"
+              shadow="hover"
+              class="card-item"
+              style="border: 0"
+            >
               <el-row type="flex" :gutter="10" justify="space-between">
                 <el-col :span="16" style="text-align: left">
                   <el-link
-                    
                     :underline="false"
                     style="font-weight: bold; font-size: 16px; line-height: 32px"
                     @click="handleDeviceDetail(item)"
@@ -196,16 +194,11 @@
                 </el-col>
               </el-row>
               <div class="card-item__footer">
-                <el-button
-                  
-                  size="small"
-                  class="detail-btn"
-                  @click="handleEditProduct(item)"
+                <el-button size="small" class="detail-btn" @click="handleEditProduct(item)"
                   >查看详情</el-button
                 >
                 <el-button
                   v-if="item.status == 1 && item.isOwner != 0"
-                 
                   size="small"
                   class="delete-btn"
                   @click="handleDelete(item)"
@@ -213,7 +206,6 @@
                 >
                 <el-button
                   v-if="item.status == 2 && item.isOwner != 0"
-                  
                   size="small"
                   class="success-btn"
                   :disabled="item.isAuthorize != 1"
@@ -221,11 +213,7 @@
                 >
                   设备授权
                 </el-button>
-                <el-button
-                  
-                  size="small"
-                  type="warning"
-                  @click="handleViewDevice(item.productId)"
+                <el-button size="small" type="warning" @click="handleViewDevice(item.productId)"
                   >查看设备</el-button
                 >
               </div>
@@ -312,16 +300,10 @@
             width="300"
           >
             <template #default="{ row }">
-              <el-button
-                
-                type="primary"
-                plain
-                style="padding: 5px"
-                @click="handleEditProduct(row)"
+              <el-button type="primary" plain style="padding: 5px" @click="handleEditProduct(row)"
                 >查看详情</el-button
               >
               <el-button
-                
                 type="primary"
                 plain
                 style="padding: 5px"
@@ -330,7 +312,6 @@
               >
               <el-button
                 v-if="row.status == 2 && row.isOwner != 0"
-               
                 type="success"
                 plain
                 style="padding: 5px"
@@ -339,7 +320,6 @@
               >
               <el-button
                 v-if="row.status == 1 && row.isOwner != 0"
-                
                 type="danger"
                 plain
                 style="padding: 5px"
@@ -351,20 +331,18 @@
         </el-table>
       </template>
       <el-empty v-else description="暂无数据,请添加产品" />
-     <div class="mt-5 flex justify-right">
-         <el-pagination
-        v-show="total > 0"
-        :total="total"
-        v-model:current-page="queryParams.pageNum"
-        v-model:page-size="queryParams.pageSize"
-        :page-sizes="[12, 24, 36, 60]"
-        layout="total, sizes, prev, pager, next, jumper"
-        @update:current-page="getList"
-        @update:page-size="getList"
-      />
-     </div>
-
-     
+      <div class="mt-5 flex justify-right">
+        <el-pagination
+          v-show="total > 0"
+          :total="total"
+          v-model:current-page="queryParams.pageNo"
+          v-model:page-size="queryParams.pageSize"
+          :page-sizes="[12, 24, 36, 60]"
+          layout="total, sizes, prev, pager, next, jumper"
+          @update:current-page="getList"
+          @update:page-size="getList"
+        />
+      </div>
     </el-card>
   </div>
 </template>
@@ -385,7 +363,6 @@ import gatewaySvg from '@/assets/imgs/gateway.svg'
 import { getDicts } from '@/api/pms/video/dicts'
 import { DICT_TYPE } from '@/utils/dict'
 
-
 const { t } = useI18n() // 国际化
 
 // 定义组件名称
@@ -418,7 +395,7 @@ const uniqueId = ref(0)
 const baseUrl = ref(import.meta.VITE_BASE_URL)
 
 const queryParams = reactive({
-  pageNum: 1,
+  pageNo: 1,
   pageSize: 12,
   showSenior: true,
   productName: null,
@@ -447,18 +424,15 @@ function importTemplate() {
   download('iot/product/temp-json', {}, `产品模板${new Date().getTime()}.xlsx`)
 }
 
-
 // 文件上传中处理
 function handleFileUploadProgress(event, file, fileList) {
   upload.isUploading = true
 }
 
-
 // 查询产品列表
 function getList() {
   loading.value = true
   listProduct(queryParams).then((response) => {
-   
     productList.value = response.list
     total.value = response.total
     loading.value = false
@@ -502,10 +476,10 @@ async function handleChangeProductStatus(productId, status, deviceType) {
     }
   }
   ElMessageBox.confirm(message, t('product.index091251-34'), {
-      confirmButtonText: t('product.index091251-35'),
-      cancelButtonText: t('product.index091251-36'),
-      type: 'warning'
-    })
+    confirmButtonText: t('product.index091251-35'),
+    cancelButtonText: t('product.index091251-36'),
+    type: 'warning'
+  })
     .then(() => {
       let data = {
         productId,
@@ -538,7 +512,6 @@ function handleViewDevice(productId) {
   })
 }
 
-
 // 取消按钮
 function cancel() {
   open.value = false
@@ -547,7 +520,7 @@ function cancel() {
 
 // 搜索按钮操作
 function handleQuery() {
-  queryParams.pageNum = 1
+  queryParams.pageNo = 1
   getList()
 }
 
@@ -557,28 +530,23 @@ function resetQuery() {
   handleQuery()
 }
 
-
 // 删除按钮操作
 function handleDelete(row) {
   const productIds = row.productId || 0
   let msg = ''
-   ElMessageBox
-    .confirm(t('product.index091251-39', [productIds]))
+  ElMessageBox.confirm(t('product.index091251-39', [productIds]))
     .then(function () {
       // 删除SIP配置
       delSipconfigByProductId(productIds).then((response) => {})
       delProduct(productIds).then((response) => {
-      
         msg = response.msg
         getList()
       })
-    }).then(() => {
-      
+    })
+    .then(() => {
       ElMessage.success('删除成功')
-    }).catch(() => { })
-
-
-   
+    })
+    .catch(() => {})
 }
 
 // 修改按钮操作
@@ -591,7 +559,7 @@ function handleEditProduct(row) {
     name: 'VideoCenterProductEdit',
     query: {
       productId: productId,
-      pageNum: queryParams.pageNum
+      pageNo: queryParams.pageNo
     }
   })
 }
@@ -616,7 +584,6 @@ onMounted(() => {
   getList()
 
   getDicts('iot_product_status').then((response) => {
-   
     iot_product_status.value = response
   })
 })
@@ -626,7 +593,7 @@ if (route.query.t) {
   const time = route.query.t
   if (time != null && time != uniqueId.value) {
     uniqueId.value = time
-    queryParams.pageNum = Number(route.query.pageNum)
+    queryParams.pageNo = Number(route.query.pageNo)
     getList()
   }
 }

+ 7 - 7
src/views/pms/video_center/product/product-edit.vue

@@ -788,7 +788,7 @@
             <el-pagination
               v-show="tempTotal > 0"
               v-model:page-size="tempParams.pageSize"
-              v-model:current-page="tempParams.pageNum"
+              v-model:current-page="tempParams.pageNo"
               :total="tempTotal"
               layout="total, prev, pager, next"
               small
@@ -834,7 +834,7 @@
             <el-pagination
               v-show="total > 0"
               v-model:page-size="pointsParams.pageSize"
-              v-model:current-page="pointsParams.pageNum"
+              v-model:current-page="pointsParams.pageNo"
               :total="total"
               layout="total, prev, pager, next"
               small
@@ -1049,7 +1049,7 @@ const getDeviceList = async (deptId) => {
 const form = reactive({
   networkMethod: 1,
   deviceType: 1,
-  groupName:'',
+  groupName: '',
   vertificateMethod: 3,
   transport: 'MQTT',
   imgUrl: '',
@@ -1170,13 +1170,13 @@ const tempTotal = ref(0)
 
 // 查询参数
 const pointsParams = reactive({
-  pageNum: 1,
+  pageNo: 1,
   pageSize: 8,
   templateId: 0
 })
 
 const tempParams = reactive({
-  pageNum: 1,
+  pageNo: 1,
   pageSize: 10,
   templateName: ''
 })
@@ -1706,7 +1706,7 @@ const queryTemp = () => {
 
 /** 搜索按钮操作 */
 const handleQuery = () => {
-  tempParams.pageNum = 1
+  tempParams.pageNo = 1
   getTempList()
 }
 
@@ -1722,7 +1722,7 @@ const updateModel = () => {
 }
 
 // Lifecycle hooks
-onMounted(async() => {
+onMounted(async () => {
   // 获取产品信息
   const productId = route.query && route.query.productId
   form.productId = productId

+ 62 - 62
src/views/pms/video_center/product/product-select-template.vue

@@ -3,26 +3,26 @@
     <el-divider />
     <el-form :model="queryParams" ref="productSelectTemplateRef" inline>
       <el-form-item :label="t('product.product-select-template318012-0')" prop="templateName">
-        <el-input 
-          v-model="queryParams.templateName" 
-          :placeholder="t('product.product-select-template318012-1')" 
-          clearable 
-          size="default" 
-          @keyup.enter="handleQuery" 
+        <el-input
+          v-model="queryParams.templateName"
+          :placeholder="t('product.product-select-template318012-1')"
+          clearable
+          size="default"
+          @keyup.enter="handleQuery"
         />
       </el-form-item>
       <el-form-item :label="t('product.product-select-template.318012-2')" prop="type">
-        <el-select 
-          v-model="queryParams.type" 
-          :placeholder="t('product.product-select-template318012-3')" 
-          clearable 
+        <el-select
+          v-model="queryParams.type"
+          :placeholder="t('product.product-select-template318012-3')"
+          clearable
           size="default"
         >
-          <el-option 
-            v-for="dict in dict.type.iot_things_type" 
-            :key="dict.value" 
-            :label="dict.label" 
-            :value="dict.value" 
+          <el-option
+            v-for="dict in dict.type.iot_things_type"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
           />
         </el-select>
       </el-form-item>
@@ -36,77 +36,77 @@
       </el-form-item>
     </el-form>
 
-    <el-table 
-      :border="false" 
-      v-loading="loading" 
-      :data="templateList" 
-      @selection-change="handleSelectionChange" 
-      ref="selectTemplateTableRef" 
+    <el-table
+      :border="false"
+      v-loading="loading"
+      :data="templateList"
+      @selection-change="handleSelectionChange"
+      ref="selectTemplateTableRef"
       size="default"
     >
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column 
-        :label="t('product.product-select-template318012-0')" 
-        align="center" 
-        prop="templateName" 
+      <el-table-column
+        :label="t('product.product-select-template318012-0')"
+        align="center"
+        prop="templateName"
       />
-      <el-table-column 
-        :label="t('product.product-select-template318012-6')" 
-        align="center" 
-        prop="identifier" 
+      <el-table-column
+        :label="t('product.product-select-template318012-6')"
+        align="center"
+        prop="identifier"
       />
-      <el-table-column 
-        :label="t('product.product-select-template318012-7')" 
-        align="center" 
+      <el-table-column
+        :label="t('product.product-select-template318012-7')"
+        align="center"
         prop="type"
       >
         <template #default="scope">
           <dict-tag :options="dict.type.iot_things_type" :value="scope.row.type" />
         </template>
       </el-table-column>
-      <el-table-column 
-        :label="t('product.product-things-model142341-12')" 
-        align="center" 
-        prop="isChart" 
+      <el-table-column
+        :label="t('product.product-things-model142341-12')"
+        align="center"
+        prop="isChart"
         width="75"
       >
         <template #default="scope">
           <dict-tag :options="dict.type.iot_yes_no" :value="scope.row.isChart" />
         </template>
       </el-table-column>
-      <el-table-column 
-        :label="t('product.product-select-template318012-9')" 
-        align="center" 
-        prop="isMonitor" 
+      <el-table-column
+        :label="t('product.product-select-template318012-9')"
+        align="center"
+        prop="isMonitor"
         width="75"
       >
         <template #default="scope">
           <dict-tag :options="dict.type.iot_yes_no" :value="scope.row.isMonitor" />
         </template>
       </el-table-column>
-      <el-table-column 
-        :label="t('product.product-select-template318012-10')" 
-        align="center" 
-        prop="isReadonly" 
+      <el-table-column
+        :label="t('product.product-select-template318012-10')"
+        align="center"
+        prop="isReadonly"
         width="75"
       >
         <template #default="scope">
           <dict-tag :options="dict.type.iot_yes_no" :value="scope.row.isReadonly" />
         </template>
       </el-table-column>
-      <el-table-column 
-        :label="t('product.product-select-template318012-11')" 
-        align="center" 
-        prop="isHistory" 
+      <el-table-column
+        :label="t('product.product-select-template318012-11')"
+        align="center"
+        prop="isHistory"
         width="75"
       >
         <template #default="scope">
           <dict-tag :options="dict.type.iot_yes_no" :value="scope.row.isHistory" />
         </template>
       </el-table-column>
-      <el-table-column 
-        :label="t('product.product-select-template318012-12')" 
-        align="center" 
+      <el-table-column
+        :label="t('product.product-select-template318012-12')"
+        align="center"
         prop="datatype"
       >
         <template #default="scope">
@@ -115,12 +115,12 @@
       </el-table-column>
     </el-table>
 
-    <pagination 
-      v-show="total > 0" 
-      :total="total" 
-      v-model:page="queryParams.pageNum" 
-      v-model:limit="queryParams.pageSize" 
-      @pagination="getList" 
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      v-model:page="queryParams.pageNo"
+      v-model:limit="queryParams.pageSize"
+      @pagination="getList"
     />
   </div>
 </template>
@@ -164,7 +164,7 @@ const templateList = ref([])
 
 // 查询参数
 const queryParams = reactive({
-  pageNum: 1,
+  pageNo: 1,
   pageSize: 10,
   templateName: null,
   type: null
@@ -173,7 +173,7 @@ const queryParams = reactive({
 // 获取列表数据
 const getList = () => {
   loading.value = true
-  listTemplate(queryParams).then(response => {
+  listTemplate(queryParams).then((response) => {
     templateList.value = response.list
     total.value = response.total
     loading.value = false
@@ -182,7 +182,7 @@ const getList = () => {
 
 // 搜索操作
 const handleQuery = () => {
-  queryParams.pageNum = 1
+  queryParams.pageNo = 1
   getList()
 }
 
@@ -196,7 +196,7 @@ const resetQuery = () => {
 
 // 处理选择变化
 const handleSelectionChange = (selection) => {
-  ids.value = selection.map(item => item.templateId)
+  ids.value = selection.map((item) => item.templateId)
   single.value = selection.length !== 1
   multiple.value = !selection.length
   // 向父组件传递ID数组
@@ -212,4 +212,4 @@ onMounted(() => {
 defineExpose({
   selectTemplateTableRef
 })
-</script>
+</script>

+ 26 - 70
src/views/pms/video_center/product/product-things-model.vue

@@ -13,7 +13,7 @@
           :placeholder="t('product.product-things-model142341-128')"
           clearable
           size="small"
-          style="width: 150px;"
+          style="width: 150px"
         >
           <el-option
             v-for="dict in iot_yes_no"
@@ -29,7 +29,7 @@
           :placeholder="t('product.product-things-model142341-130')"
           clearable
           size="small"
-           style="width: 150px;"
+          style="width: 150px"
         >
           <el-option
             v-for="dict in iot_things_type"
@@ -45,7 +45,7 @@
           :placeholder="t('product.product-things-model142341-132')"
           clearable
           size="small"
-           style="width: 150px;"
+          style="width: 150px"
         >
           <el-option
             v-for="dict in iot_yes_no"
@@ -97,27 +97,14 @@
         </el-button>
       </el-col> -->
       <el-col :span="1.5" v-if="productInfo.status == 1 && productInfo.isOwner != 0">
-        <el-button
-          type="primary"
-          plain
-          :icon="Upload2"
-          size="small"
-          @click="handleSelect"
-         
-        >
+        <el-button type="primary" plain :icon="Upload2" size="small" @click="handleSelect">
           {{ t('product.product-things-model142341-1') }}
         </el-button>
       </el-col>
       <el-col :span="1.5" class="flex-center">
-        <el-button
-          type="primary"
-          plain
-          :icon="Refresh"
-          size="small"
-          @click="getList"
-          
-          >{{ t('product.product-things-model142341-2') }}</el-button
-        >
+        <el-button type="primary" plain :icon="Refresh" size="small" @click="getList">{{
+          t('product.product-things-model142341-2')
+        }}</el-button>
       </el-col>
       <el-col :span="1.5" class="flex-center">
         <el-button type="info" plain :icon="View" size="small" @click="handleOpenThingsModel">
@@ -160,32 +147,17 @@
           <dict-tag :options="iot_yes_no" :value="scope.row.isChart" />
         </template>
       </el-table-column>
-      <el-table-column
-        label="实时监测"
-        align="center"
-        prop=""
-        width="75"
-      >
+      <el-table-column label="实时监测" align="center" prop="" width="75">
         <template #default="scope">
           <dict-tag :options="iot_yes_no" :value="scope.row.isMonitor" />
         </template>
       </el-table-column>
-      <el-table-column
-        label="APP展示"
-        align="center"
-        prop=""
-        width="75"
-      >
+      <el-table-column label="APP展示" align="center" prop="" width="75">
         <template #default="scope">
           <dict-tag :options="iot_yes_no" :value="scope.row.isApp" />
         </template>
       </el-table-column>
-      <el-table-column
-        label="只读"
-        align="center"
-        prop=""
-        width="75"
-      >
+      <el-table-column label="只读" align="center" prop="" width="75">
         <template #default="scope">
           <dict-tag :options="iot_yes_no" :value="scope.row.isReadonly" />
         </template>
@@ -254,7 +226,6 @@
             type="primary"
             :icon="View"
             @click="handleUpdate(scope.row)"
-           
             v-if="productInfo.status != 2 && productInfo.isOwner != 0"
           >
             {{ t('product.product-things-model142341-22') }}
@@ -264,7 +235,6 @@
             type="danger"
             :icon="Delete"
             @click="handleDelete(scope.row)"
-          
             v-if="productInfo.status != 2 && productInfo.isOwner != 0"
           >
             {{ t('product.product-things-model142341-23') }}
@@ -275,7 +245,7 @@
 
     <el-pagination
       v-show="total > 0"
-      v-model:current-page="queryParams.pageNum"
+      v-model:current-page="queryParams.pageNo"
       v-model:page-size="queryParams.pageSize"
       :total="total"
       layout="prev, pager, next"
@@ -597,12 +567,8 @@
           </el-form-item>
           <el-form-item :label="t('product.product-things-model142341-81')" prop="">
             <el-radio-group v-model="form.specs.arrayType">
-              <el-radio label="integer">{{
-                t('product.product-things-model142341-38')
-              }}</el-radio>
-              <el-radio label="decimal">{{
-                t('product.product-things-model142341-39')
-              }}</el-radio>
+              <el-radio label="integer">{{ t('product.product-things-model142341-38') }}</el-radio>
+              <el-radio label="decimal">{{ t('product.product-things-model142341-39') }}</el-radio>
               <el-radio label="string">{{ t('product.product-things-model142341-42') }}</el-radio>
               <el-radio label="object">{{ t('product.product-things-model142341-44') }}</el-radio>
             </el-radio-group>
@@ -721,21 +687,8 @@
 
       <template #footer>
         <div class="dialog-footer">
-          <el-button
-            type="primary"
-            @click="submitForm"
-          
-            v-show="form.modelId"
-          >
-            更新
-          </el-button>
-          <el-button
-            type="primary"
-            @click="submitForm"
-           
-            v-show="!form.modelId"
-            >添加</el-button
-          >
+          <el-button type="primary" @click="submitForm" v-show="form.modelId"> 更新 </el-button>
+          <el-button type="primary" @click="submitForm" v-show="!form.modelId">添加</el-button>
           <el-button @click="cancel">取消</el-button>
         </div>
       </template>
@@ -781,7 +734,14 @@ import JsonViewer from 'vue-json-viewer'
 import RightToolbar from './components/RightToolbar/index.vue'
 import 'vue-json-viewer/style.css'
 import thingsParameter from './template/parameter.vue'
-import { addModel, delModel, getModel, importModel, listModel, updateModel } from '@/api/pms/video/model'
+import {
+  addModel,
+  delModel,
+  getModel,
+  importModel,
+  listModel,
+  updateModel
+} from '@/api/pms/video/model'
 import { listByPid } from '@/api/pms/video/salve'
 import {
   Search,
@@ -798,7 +758,6 @@ defineOptions({
   name: 'product-things-model'
 })
 
-
 const { t } = useI18n()
 
 // 定义props
@@ -821,7 +780,6 @@ const iot_things_type = []
 const iot_data_type = []
 const iot_yes_no = []
 
-
 // Refs
 const queryFormRef = ref(null)
 const formRef = ref(null)
@@ -857,7 +815,7 @@ const openThingsModel = ref(false)
 // 查询参数
 const queryParams = reactive({
   productId: 0,
-  pageNum: 1,
+  pageNo: 1,
   pageSize: 20
 })
 const productId = ref(0)
@@ -1049,7 +1007,7 @@ const reset = () => {
 
 /** 搜索按钮操作 */
 const handleQuery = () => {
-  queryParams.pageNum = 1
+  queryParams.pageNo = 1
   getList()
 }
 
@@ -1281,8 +1239,7 @@ const submitForm = () => {
 const handleDelete = (row) => {
   const modelIds = row.modelId
   if (!queryParams.isModbus) {
-    ElMessageBox
-      .confirm(t('product.product-things-model142341-109', modelIds))
+    ElMessageBox.confirm(t('product.product-things-model142341-109', modelIds))
       .then(function () {
         delModel(modelIds).then(() => {
           emit('updateModel')
@@ -1527,7 +1484,6 @@ const getParamData = (data) => {
 const handleImport = () => {
   // this.$refs.importBatchRef.upload.importDeviceDialog = true;
 }
-
 </script>
 
 <style lang="scss" scoped>

+ 65 - 77
src/views/pms/video_center/protocol/index.vue

@@ -1,43 +1,45 @@
 <template>
   <div style="padding: 6px">
-    <el-card v-show="showSearch" style="margin-bottom: 6px;border: 0;" shadow="never">
-      <el-form 
-        ref="queryFormRef" 
-        :inline="true" 
-        :model="queryParams" 
-        label-width="68px" 
+    <el-card v-show="showSearch" style="margin-bottom: 6px; border: 0" shadow="never">
+      <el-form
+        ref="queryFormRef"
+        :inline="true"
+        :model="queryParams"
+        label-width="68px"
         style="margin-bottom: -20px"
       >
         <el-form-item label="协议名称" prop="protocolName">
-          <el-input 
-            v-model="queryParams.protocolName" 
-            placeholder="协议名称" 
-            clearable 
-            size="default" 
-            @keyup.enter="handleQuery" 
+          <el-input
+            v-model="queryParams.protocolName"
+            placeholder="协议名称"
+            clearable
+            size="default"
+            @keyup.enter="handleQuery"
           />
         </el-form-item>
         <el-form-item label="协议编码" prop="protocolCode">
-          <el-input 
-            v-model="queryParams.protocolCode" 
-            placeholder="请输入协议编码" 
-            clearable 
-            size="default" 
-            @keyup.enter="handleQuery" 
+          <el-input
+            v-model="queryParams.protocolCode"
+            placeholder="请输入协议编码"
+            clearable
+            size="default"
+            @keyup.enter="handleQuery"
           />
         </el-form-item>
         <el-form-item>
-          <el-button :icon="Search" size="default" type="primary" @click="handleQuery">搜索</el-button>
+          <el-button :icon="Search" size="default" type="primary" @click="handleQuery"
+            >搜索</el-button
+          >
           <el-button :icon="Refresh" size="default" @click="resetQuery">重置</el-button>
         </el-form-item>
       </el-form>
     </el-card>
 
-    <el-card style="padding-bottom: 80px;border: 0;" shadow="never">
-      <el-table 
-        :border="false" 
-        v-loading="loading" 
-        :data="protocolList" 
+    <el-card style="padding-bottom: 80px; border: 0" shadow="never">
+      <el-table
+        :border="false"
+        v-loading="loading"
+        :data="protocolList"
         @selection-change="handleSelectionChange"
       >
         <el-table-column label="协议名称" align="left" prop="protocolName" />
@@ -48,31 +50,21 @@
       </el-table>
 
       <div class="flex justify-right mt-5">
-         <el-pagination 
-        v-show="total > 0" 
-        v-model:current-page="queryParams.pageNum"
-        v-model:page-size="queryParams.pageSize"
-        :total="total"
-        layout="total, sizes, prev, pager, next, jumper"
-        :page-sizes="[10, 20, 30, 50]"
-        @size-change="handleSizeChange"
-        @current-change="getList"
-      />
+        <el-pagination
+          v-show="total > 0"
+          v-model:current-page="queryParams.pageNo"
+          v-model:page-size="queryParams.pageSize"
+          :total="total"
+          layout="total, sizes, prev, pager, next, jumper"
+          :page-sizes="[10, 20, 30, 50]"
+          @size-change="handleSizeChange"
+          @current-change="getList"
+        />
       </div>
 
       <!-- 添加或修改协议对话框 -->
-      <el-dialog 
-        :title="title" 
-        v-model="open" 
-        append-to-body 
-        width="600px"
-      >
-        <el-form 
-          ref="formRef" 
-          :model="form" 
-          :rules="rules" 
-          label-width="100px"
-        >
+      <el-dialog :title="title" v-model="open" append-to-body width="600px">
+        <el-form ref="formRef" :model="form" :rules="rules" label-width="100px">
           <el-form-item label="协议名称" prop="protocolName">
             <el-input v-model="form.protocolName" placeholder="请输入协议名称" />
           </el-form-item>
@@ -99,12 +91,12 @@
 
 <script setup>
 import { ref, reactive, onMounted, getCurrentInstance } from 'vue'
-import { 
-  listProtocol, 
-  getProtocol, 
-  delProtocol, 
-  addProtocol, 
-  updateProtocol 
+import {
+  listProtocol,
+  getProtocol,
+  delProtocol,
+  addProtocol,
+  updateProtocol
 } from '@/api/pms/video/protocol'
 import { Search, Refresh } from '@element-plus/icons-vue'
 import { ElMessageBox } from 'element-plus'
@@ -115,7 +107,6 @@ defineOptions({
   name: 'Protocol'
 })
 
-
 // Refs
 const queryFormRef = ref(null)
 const formRef = ref(null)
@@ -149,7 +140,7 @@ const queryParams = reactive({
   protocolFileUrl: null,
   protocolType: null,
   jarSign: null,
-  protocolStatus: null,
+  protocolStatus: null
 })
 
 // 表单参数
@@ -163,7 +154,7 @@ const form = reactive({
   createTime: null,
   updateTime: null,
   protocolStatus: 0,
-  delFlag: null,
+  delFlag: null
 })
 
 // 表单校验
@@ -172,47 +163,45 @@ const rules = {
     {
       required: true,
       message: '协议编码不能为空',
-      trigger: 'blur',
-    },
+      trigger: 'blur'
+    }
   ],
   protocolName: [
     {
       required: true,
       message: '协议名称不能为空',
-      trigger: 'blur',
-    },
+      trigger: 'blur'
+    }
   ],
   protocolFileUrl: [
     {
       required: true,
       message: '协议上传地址不能为空',
-      trigger: 'blur',
-    },
+      trigger: 'blur'
+    }
   ],
   protocolType: [
     {
       required: true,
       message: '协议类型不能为空',
-      trigger: 'change',
-    },
+      trigger: 'change'
+    }
   ],
   jarSign: [
     {
       required: true,
       message: '协议摘要不能为空',
-      trigger: 'blur',
-    },
-  ],
+      trigger: 'blur'
+    }
+  ]
 }
 
 // 方法定义
 /** 查询协议列表 */
 const getList = (val) => {
-
-    loading.value = true
-    queryParams.pageNo = val
-    listProtocol(queryParams).then((response) => {
- 
+  loading.value = true
+  queryParams.pageNo = val
+  listProtocol(queryParams).then((response) => {
     protocolList.value = response.list
     total.value = response.total
     loading.value = false
@@ -243,14 +232,14 @@ const reset = () => {
     createTime: null,
     updateTime: null,
     protocolStatus: 0,
-    delFlag: null,
+    delFlag: null
   })
   formRef.value?.resetFields()
 }
 
 /** 搜索按钮操作 */
 const handleQuery = () => {
-  queryParams.pageNum = 1
+  queryParams.pageNo = 1
   getList()
 }
 
@@ -309,8 +298,7 @@ const submitForm = () => {
 /** 删除按钮操作 */
 const handleDelete = (row) => {
   const idsVal = row.id || ids.value
-  ElMessageBox
-    .confirm('是否确认删除协议编号为"' + idsVal + '"的数据项?')
+  ElMessageBox.confirm('是否确认删除协议编号为"' + idsVal + '"的数据项?')
     .then(function () {
       return delProtocol(idsVal)
     })
@@ -326,7 +314,7 @@ const handleExport = () => {
   download(
     'iot/protocol/export',
     {
-      ...queryParams,
+      ...queryParams
     },
     `protocol_${new Date().getTime()}.xlsx`
   )
@@ -336,4 +324,4 @@ const handleExport = () => {
 onMounted(() => {
   getList()
 })
-</script>
+</script>

+ 3 - 3
src/views/pms/video_center/sip/channel.vue

@@ -87,7 +87,7 @@
     <pagination
       v-show="total > 0"
       :total="total"
-      v-model:page="queryParams.pageNum"
+      v-model:page="queryParams.pageNo"
       v-model:limit="queryParams.pageSize"
       @pagination="getList"
     />
@@ -131,7 +131,7 @@ const open = ref(false)
 
 // 查询参数
 const queryParams = reactive({
-  pageNum: 1,
+  pageNo: 1,
   pageSize: 10,
   deviceSipId: null
 })
@@ -230,7 +230,7 @@ const reset = () => {
 
 // 搜索按钮操作
 const handleQuery = () => {
-  queryParams.pageNum = 1
+  queryParams.pageNo = 1
   getList()
 }
 

+ 1 - 1
src/views/pms/video_center/sip/components/player/DeviceTree.vue

@@ -122,7 +122,7 @@ const defaultProps = reactive({
 
 // 查询参数
 const queryParams = reactive({
-  pageNum: 1,
+  pageNo: 1,
   pageSize: 100,
   status: 3,
   deviceType: 3

+ 1 - 1
src/views/pms/video_center/sip/components/player/deviceLiveStream.vue

@@ -74,7 +74,7 @@ const channelList = ref([])
 
 // 查询参数
 const queryParams = reactive({
-  pageNum: 1,
+  pageNo: 1,
   pageSize: 99,
   deviceSipId: null,
   channelSipId: null

+ 94 - 98
src/views/pms/video_center/sip/components/player/deviceVideo.vue

@@ -1,82 +1,78 @@
 <template>
-    <div style="display: block; width: 1000px">
-        <div style="display: flex;margin-bottom: 10px;">
-            <el-row>
-                <span style="margin-left: 10px" prop="channelName">通道:</span>
-                <el-select 
-                    v-model="channelId" 
-                    placeholder="请选择" 
-                    @change="changeChannel" 
-                    style="width: 200px; margin-right: 10px" 
-                    size="small"
-                >
-                    <el-option 
-                        v-for="option in channelList" 
-                        :key="option.value" 
-                        :label="option.label" 
-                        :value="option.value"
-                    />
-                </el-select>
-                <span style="overflow: auto; margin-left: 10px">日期:</span>
-                <el-date-picker 
-                    v-model="queryDate" 
-                    type="date" 
-                    size="small" 
-                    value-format="YYYY-MM-DD" 
-                    clearable 
-                    placeholder="选择日期" 
-                    style="width: 180px; margin-right: 10px" 
-                />
-                <el-button-group style="margin: 0">
-                    <el-button 
-                        size="small" 
-                        type="success" 
-                        title="查看录像" 
-                        @click="loadDevRecord()" 
-                        :disabled="channelId === '' || !queryDate"
-                    >
-                        <el-icon><VideoCamera /></el-icon>
-                        <span class="pl-1">查看</span>
-                    </el-button>
-                </el-button-group>
-
-                <span style="margin-left: 82px; overflow: auto">时间:</span>
-                <el-button-group>
-                    <el-time-picker
-                        size="small"
-                        is-range
-                        align="left"
-                        v-model="timeRange"
-                        value-format="YYYY-MM-DD HH:mm:ss"
-                        range-separator="至"
-                        start-placeholder="开始时间"
-                        end-placeholder="结束时间"
-                        placeholder="选择时间范围"
-                        @change="timePickerChange"
-                        style="width: 200px"
-                        :disabled="channelId === '' || !queryDate"
-                    />
-                </el-button-group>
-                <el-button-group style="margin: 0 0 0 10px">
-                    <el-button 
-                        size="small" 
-                        type="primary" 
-                        title="下载选定录像" 
-                        @click="downloadRecord()" 
-                        :disabled="channelId === '' || !timeRange"
-                    >
-                        <el-icon><Download /></el-icon>
-                        <span class="pl-1">转存</span>
-                    </el-button>
-                </el-button-group>
-            </el-row>
-        </div>
-        <player 
-            ref="playbacker" 
-            :playerinfo="playinfo" 
-            class="components-container"
+  <div style="display: block; width: 1000px">
+    <div style="display: flex; margin-bottom: 10px">
+      <el-row>
+        <span style="margin-left: 10px" prop="channelName">通道:</span>
+        <el-select
+          v-model="channelId"
+          placeholder="请选择"
+          @change="changeChannel"
+          style="width: 200px; margin-right: 10px"
+          size="small"
+        >
+          <el-option
+            v-for="option in channelList"
+            :key="option.value"
+            :label="option.label"
+            :value="option.value"
+          />
+        </el-select>
+        <span style="overflow: auto; margin-left: 10px">日期:</span>
+        <el-date-picker
+          v-model="queryDate"
+          type="date"
+          size="small"
+          value-format="YYYY-MM-DD"
+          clearable
+          placeholder="选择日期"
+          style="width: 180px; margin-right: 10px"
         />
+        <el-button-group style="margin: 0">
+          <el-button
+            size="small"
+            type="success"
+            title="查看录像"
+            @click="loadDevRecord()"
+            :disabled="channelId === '' || !queryDate"
+          >
+            <el-icon><VideoCamera /></el-icon>
+            <span class="pl-1">查看</span>
+          </el-button>
+        </el-button-group>
+
+        <span style="margin-left: 82px; overflow: auto">时间:</span>
+        <el-button-group>
+          <el-time-picker
+            size="small"
+            is-range
+            align="left"
+            v-model="timeRange"
+            value-format="YYYY-MM-DD HH:mm:ss"
+            range-separator="至"
+            start-placeholder="开始时间"
+            end-placeholder="结束时间"
+            placeholder="选择时间范围"
+            @change="timePickerChange"
+            style="width: 200px"
+            :disabled="channelId === '' || !queryDate"
+          />
+        </el-button-group>
+        <el-button-group style="margin: 0 0 0 10px">
+          <el-button
+            size="small"
+            type="primary"
+            title="下载选定录像"
+            @click="downloadRecord()"
+            :disabled="channelId === '' || !timeRange"
+          >
+            <el-icon><Download /></el-icon>
+            <span class="pl-1">转存</span>
+          </el-button>
+        </el-button-group>
+      </el-row>
     </div>
+    <player ref="playbacker" :playerinfo="playinfo" class="components-container" />
+  </div>
 </template>
 
 <script setup lang="ts">
@@ -111,9 +107,9 @@ const hisData = ref([])
 const playinfo = ref({
   playtype: 'playback',
   deviceId: '',
-  channelId: '',
+  channelId: ''
 })
-const channelList = ref<{value: string, label: string}[]>([])
+const channelList = ref<{ value: string; label: string }[]>([])
 const playbackinfo = ref({})
 const timeRange = ref<[string, string] | null>(null)
 const startTime = ref<string | null>(null)
@@ -121,10 +117,10 @@ const endTime = ref<string | null>(null)
 
 // 查询参数
 const queryParams = ref({
-    pageNum: 1,
-    pageSize: 10,
-    deviceSipId: null as string | null,
-    channelSipId: null as string | null,
+  pageNo: 1,
+  pageSize: 10,
+  deviceSipId: null as string | null,
+  channelSipId: null as string | null
 })
 
 const deviceInfo = ref<Device | null>(null)
@@ -151,7 +147,7 @@ const init = () => {
   playinfo.value = {
     playtype: 'playback',
     deviceId: props.device.serialNumber,
-    channelId:''
+    channelId: ''
   }
 }
 
@@ -210,17 +206,17 @@ const loadDevRecord = async () => {
     const end = Math.floor((date + 24 * 60 * 60 * 1000 - 1) / 1000)
     const query = {
       start: start,
-      end: end,
+      end: end
     }
     vodData.value = {
       start: start,
       end: end,
-      base: start,
+      base: start
     }
     setTime(queryDate.value + ' 00:00:00', queryDate.value + ' 23:59:59')
-    
+
     try {
-        const res = await getDevRecord(deviceId.value, channelId.value, query)
+      const res = await getDevRecord(deviceId.value, channelId.value, query)
       console.log('res :>> ', res)
       hisData.value = res.recordItems
       if (res.recordItems) {
@@ -239,13 +235,13 @@ const loadDevRecord = async () => {
         } else {
           ElMessage({
             type: 'warning',
-            message: '请确认设备是否支持录像,或者设备SD卡是否正确插入!',
+            message: '请确认设备是否支持录像,或者设备SD卡是否正确插入!'
           })
         }
       } else {
         ElMessage({
           type: 'warning',
-          message: '请确认设备是否支持录像,或者设备SD卡是否正确插入!',
+          message: '请确认设备是否支持录像,或者设备SD卡是否正确插入!'
         })
       }
     } catch (error) {
@@ -258,9 +254,9 @@ const loadDevRecord = async () => {
 const playback = async () => {
   const query = {
     start: (vodData.value as any).start,
-    end: (vodData.value as any).end,
+    end: (vodData.value as any).end
   }
-  
+
   try {
     if (ssrc.value) {
       await closeStream(deviceId.value, channelId.value, ssrc.value)
@@ -270,7 +266,7 @@ const playback = async () => {
       initUrl(res)
     } else {
       const res = await playbackvideo(deviceId.value, channelId.value, query)
-       console.log('***********************', res)
+      console.log('***********************', res)
       initUrl(res)
     }
     triggerPlay(hisData.value)
@@ -291,7 +287,7 @@ const seekPlay = (s: any) => {
   const seekRange = curTime - (vodData.value as any).start
   if (ssrc.value) {
     const query = {
-      seek: seekRange,
+      seek: seekRange
     }
     playbackSeek(deviceId.value, channelId.value, streamId.value, query).then((res) => {
       playbacker.value.setPlaybackStartTime(curTime)
@@ -346,22 +342,22 @@ const downloadRecord = async () => {
     ElMessage.error('请选择时间范围')
     return
   }
-  
+
   const start = Math.floor(new Date(startTime.value).getTime() / 1000)
   const end = Math.floor(new Date(endTime.value).getTime() / 1000)
   const query = {
     startTime: start,
     endTime: end,
-    speed: '4',
+    speed: '4'
   }
-  
+
   try {
     const res = await startDownloadRecord(deviceId.value, channelId.value, query)
     console.log('开始转存到流服务器:' + deviceId.value + ' : ' + channelId.value)
     if (res.code === 200) {
       ElMessage({
         type: 'success',
-        message: '转存到流服务器,请前往视频中心->录像管理查看!',
+        message: '转存到流服务器,请前往视频中心->录像管理查看!'
       })
     }
   } catch (error) {
@@ -383,4 +379,4 @@ defineExpose({
   destroy,
   queryDate
 })
-</script>
+</script>

+ 16 - 23
src/views/pms/video_center/sip/index.vue

@@ -28,18 +28,18 @@
             size="default"
             style="width: 150px"
           >
-           <el-option
+            <el-option
               v-for="dict in getStrDictOptions(DICT_TYPE.VIDEO_DEVICE_STATUS)"
               :key="dict.value"
               :label="dict.label"
               :value="dict.value"
             />
-
-           
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" :icon="Search" size="default" @click="handleQuery">搜素</el-button>
+          <el-button type="primary" :icon="Search" size="default" @click="handleQuery"
+            >搜素</el-button
+          >
           <el-button :icon="Refresh" size="default" @click="resetQuery">重置</el-button>
         </el-form-item>
       </el-form>
@@ -109,11 +109,7 @@
             <span>{{ parseTime(scope.row.registerTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
           </template>
         </el-table-column>
-        <el-table-column
-          label="操作"
-          align="center"
-          class-name="small-padding fixed-width"
-        >
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
           <template #default="scope">
             <el-button
               size="small"
@@ -129,7 +125,7 @@
       <pagination
         v-show="total > 0"
         :total="total"
-        v-model:page="queryParams.pageNum"
+        v-model:page="queryParams.pageNo"
         v-model:limit="queryParams.pageSize"
         @pagination="getList"
       />
@@ -147,7 +143,6 @@
         </el-form-item>
         <el-form-item :label="t('sip.index998533-9')" prop="deviceType">
           <el-select v-model="createForm.deviceType" :placeholder="t('sip.index998533-14')">
-        
             <el-option
               v-for="dict in getStrDictOptions(DICT_TYPE.VIDEO_TYPE)"
               :key="dict.value"
@@ -158,8 +153,6 @@
         </el-form-item>
         <el-form-item :label="t('sip.index998533-15')" prop="channelType">
           <el-select v-model="createForm.channelType" :placeholder="t('sip.index998533-16')">
-        
-
             <el-option
               v-for="dict in getStrDictOptions(DICT_TYPE.CHANNEL_TYPE)"
               :key="dict.value"
@@ -250,7 +243,7 @@ import { ref, reactive, watch, onMounted } from 'vue'
 import { useRouter } from 'vue-router'
 import { useStore } from 'vuex'
 import { Search, Refresh, Plus, Delete, Edit } from '@element-plus/icons-vue'
-import { regionData,codeToText } from 'element-china-area-data'
+import { regionData, codeToText } from 'element-china-area-data'
 import { listChannel, getChannel, delChannel, addChannel, binding } from '@/api/pms/video/channel'
 import { getDeviceBySerialNumber, listDeviceShort } from '@/api/pms/video/device'
 import { getSceneModelList } from '@/api/pms/video/list'
@@ -341,7 +334,7 @@ const city = ref('')
 
 // 查询参数
 const queryParams = reactive({
-  pageNum: 1,
+  pageNo: 1,
   pageSize: 10,
   deviceSipId: null,
   deviceChannelId: null,
@@ -499,8 +492,8 @@ const getProductData = (product) => {
 // 行政区划改变
 const changeProvince = (data) => {
   if (data && data[0] != null && data[1] != null && data[2] != null) {
-      const str = codeToText[data[0]] + '/' + codeToText[data[1]] + '/' + codeToText[data[2]]
-      createForm.citycode = str
+    const str = codeToText[data[0]] + '/' + codeToText[data[1]] + '/' + codeToText[data[2]]
+    createForm.citycode = str
   }
 }
 
@@ -515,9 +508,9 @@ const getDeviceBySerial = (serialNumber) => {
 // 查询通道列表
 const getList = () => {
   listChannel(queryParams).then((response) => {
-      sipidList.value = response.list
-      total.value = response.total
-      loading.value = false
+    sipidList.value = response.list
+    total.value = response.total
+    loading.value = false
   })
 }
 
@@ -548,7 +541,7 @@ const reset = () => {
 // 搜索按钮操作
 const handleQuery = () => {
   loading.value = true
-  queryParams.pageNum = 1
+  queryParams.pageNo = 1
   getList()
 }
 
@@ -594,7 +587,7 @@ const handleBinding = (row) => {
 const getDeviceList = () => {
   const params = {
     showChild: true,
-    pageNum: 1,
+    pageNo: 1,
     pageSize: 9999
   }
   listDeviceShort(params).then((res) => {
@@ -609,7 +602,7 @@ const getDeviceList = () => {
 // 获取场景列表数据
 const getSceneListDatas = () => {
   const params = {
-    pageNum: 1,
+    pageNo: 1,
     pageSize: 9999
   }
   getSceneModelList(params).then((res) => {

+ 141 - 111
src/views/pms/video_center/sip/product-list.vue

@@ -1,47 +1,75 @@
 <template>
-    <el-dialog :title="t('sip.product-list998536-0')" v-model="open" append-to-body width="600px">
-        <div style="margin-top: 15px">
-           
-            <el-form ref="queryFormRef" :inline="true" :model="queryParams">
-                <el-form-item label="产品名称" prop="productName">
-                    <el-input v-model="queryParams.productName" placeholder="请输入产品名称" clearable size="small" @keyup.enter="handleQuery" />
-                </el-form-item>
-                <el-form-item>
-                    <el-button :icon="Search" size="small" type="primary" @click="handleQuery">{{ t('search') }}</el-button>
-                    <el-button :icon="Refresh" size="small" @click="resetQuery">{{ t('reset') }}</el-button>
-                </el-form-item>
-            </el-form>
-
-            <el-table ref="singleTableRef" v-loading="loading" :data="productList" @row-click="rowClick" highlight-current-row size="small">
-                <el-table-column label="选择" align="center" width="50">
-                    <template #default="scope">
-                        <input :checked="scope.row.isSelect" name="product" type="radio" />
-                    </template>
-                </el-table-column>
-                <el-table-column label="产品名称" align="center" prop="productName" />
-                <el-table-column label="分类名称" align="center" prop="categoryName" />
-                <el-table-column :label="t('sip.product-list998536-1')" align="center" prop="tenantName" />
-                <el-table-column :label="t('sip.product-list998536-2')" align="center" prop="networkMethod">
-                    <template #default="scope">
-                        <dict-tag :options="DICT_TYPE.VIDEO_CENTER_NETWORK_METHOD" :value="scope.row.networkMethod" />
-                    </template>
-                </el-table-column>
-                <el-table-column :label="t('sip.mediaServer998535-4')" align="center" prop="createTime" width="100">
-                    <template #default="scope">
-                        <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
-                    </template>
-                </el-table-column>
-            </el-table>
-
-            <pagination v-show="total > 0" v-model:limit="queryParams.pageSize" v-model:page="queryParams.pageNum" :total="total" @pagination="getList" />
-        </div>
-        <template #footer>
-            <div class="dialog-footer mt-10 flex justify-end">
-                <el-button type="primary" @click="confirmSelectProduct">确认</el-button>
-                <el-button @click="closeDialog">关闭</el-button>
-            </div>
-        </template>
-    </el-dialog>
+  <el-dialog :title="t('sip.product-list998536-0')" v-model="open" append-to-body width="600px">
+    <div style="margin-top: 15px">
+      <el-form ref="queryFormRef" :inline="true" :model="queryParams">
+        <el-form-item label="产品名称" prop="productName">
+          <el-input
+            v-model="queryParams.productName"
+            placeholder="请输入产品名称"
+            clearable
+            size="small"
+            @keyup.enter="handleQuery"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button :icon="Search" size="small" type="primary" @click="handleQuery">{{
+            t('search')
+          }}</el-button>
+          <el-button :icon="Refresh" size="small" @click="resetQuery">{{ t('reset') }}</el-button>
+        </el-form-item>
+      </el-form>
+
+      <el-table
+        ref="singleTableRef"
+        v-loading="loading"
+        :data="productList"
+        @row-click="rowClick"
+        highlight-current-row
+        size="small"
+      >
+        <el-table-column label="选择" align="center" width="50">
+          <template #default="scope">
+            <input :checked="scope.row.isSelect" name="product" type="radio" />
+          </template>
+        </el-table-column>
+        <el-table-column label="产品名称" align="center" prop="productName" />
+        <el-table-column label="分类名称" align="center" prop="categoryName" />
+        <el-table-column :label="t('sip.product-list998536-1')" align="center" prop="tenantName" />
+        <el-table-column :label="t('sip.product-list998536-2')" align="center" prop="networkMethod">
+          <template #default="scope">
+            <dict-tag
+              :options="DICT_TYPE.VIDEO_CENTER_NETWORK_METHOD"
+              :value="scope.row.networkMethod"
+            />
+          </template>
+        </el-table-column>
+        <el-table-column
+          :label="t('sip.mediaServer998535-4')"
+          align="center"
+          prop="createTime"
+          width="100"
+        >
+          <template #default="scope">
+            <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination
+        v-show="total > 0"
+        v-model:limit="queryParams.pageSize"
+        v-model:page="queryParams.pageNo"
+        :total="total"
+        @pagination="getList"
+      />
+    </div>
+    <template #footer>
+      <div class="dialog-footer mt-10 flex justify-end">
+        <el-button type="primary" @click="confirmSelectProduct">确认</el-button>
+        <el-button @click="closeDialog">关闭</el-button>
+      </div>
+    </template>
+  </el-dialog>
 </template>
 
 <script setup>
@@ -50,7 +78,6 @@ import { Search, Refresh } from '@element-plus/icons-vue'
 import { listProduct } from '@/api/pms/video/product'
 import { DICT_TYPE, getDictLabel, getIntDictOptions } from '@/utils/dict'
 
-
 function parseTime(time, pattern) {
   if (arguments.length === 0 || !time) {
     return null
@@ -60,12 +87,15 @@ function parseTime(time, pattern) {
   if (typeof time === 'object') {
     date = time
   } else {
-    if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
+    if (typeof time === 'string' && /^[0-9]+$/.test(time)) {
       time = parseInt(time)
     } else if (typeof time === 'string') {
-      time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), '');
+      time = time
+        .replace(new RegExp(/-/gm), '/')
+        .replace('T', ' ')
+        .replace(new RegExp(/\.[\d]{3}/gm), '')
     }
-    if ((typeof time === 'number') && (time.toString().length === 10)) {
+    if (typeof time === 'number' && time.toString().length === 10) {
       time = time * 1000
     }
     date = new Date(time)
@@ -82,7 +112,9 @@ function parseTime(time, pattern) {
   const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
     let value = formatObj[key]
     // Note: getDay() returns 0 on Sunday
-    if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
+    if (key === 'a') {
+      return ['日', '一', '二', '三', '四', '五', '六'][value]
+    }
     if (result.length > 0 && value < 10) {
       value = '0' + value
     }
@@ -94,10 +126,10 @@ function parseTime(time, pattern) {
 const { t } = useI18n() // 国际化
 // 定义 props
 const props = defineProps({
-    productId: {
-        type: Number,
-        default: 0,
-    },
+  productId: {
+    type: Number,
+    default: 0
+  }
 })
 
 // 定义 emits
@@ -116,100 +148,98 @@ const product = ref({})
 
 // 查询参数
 const queryParams = reactive({
-    pageNum: 1,
-    pageSize: 10,
-    productName: null,
-    categoryId: null,
-    categoryName: null,
-    tenantId: null,
-    tenantName: null,
-    isSys: null,
-    status: 2, //已发布
-    deviceType: 3, // 监控设备
-    networkMethod: null,
+  pageNo: 1,
+  pageSize: 10,
+  productName: null,
+  categoryId: null,
+  categoryName: null,
+  tenantId: null,
+  tenantName: null,
+  isSys: null,
+  status: 2, //已发布
+  deviceType: 3, // 监控设备
+  networkMethod: null
 })
 
 // 获取列表数据
 const getList = () => {
-    loading.value = true
-    listProduct(queryParams).then((response) => {
-        // 产品列表初始化isSelect值,用于单选
-        for (let i = 0; i < response.list.length; i++) {
-            response.list[i].isSelect = false
-        }
-        productList.value = response.list
-        total.value = response.total
-        if (props.productId != 0) {
-            setRadioSelected(props.productId)
-        }
-        loading.value = false
-    })
+  loading.value = true
+  listProduct(queryParams).then((response) => {
+    // 产品列表初始化isSelect值,用于单选
+    for (let i = 0; i < response.list.length; i++) {
+      response.list[i].isSelect = false
+    }
+    productList.value = response.list
+    total.value = response.total
+    if (props.productId != 0) {
+      setRadioSelected(props.productId)
+    }
+    loading.value = false
+  })
 }
 
 // 搜索操作
 const handleQuery = () => {
-    queryParams.pageNum = 1
-    getList()
+  queryParams.pageNo = 1
+  getList()
 }
 
 // 重置操作
 const resetQuery = () => {
-    Object.assign(queryParams, {
-        pageNum: 1,
-        pageSize: 10,
-        productName: null,
-        categoryId: null,
-        categoryName: null,
-        tenantId: null,
-        tenantName: null,
-        isSys: null,
-        status: 2,
-        deviceType: 3,
-        networkMethod: null,
-    })
-    handleQuery()
+  Object.assign(queryParams, {
+    pageNo: 1,
+    pageSize: 10,
+    productName: null,
+    categoryId: null,
+    categoryName: null,
+    tenantId: null,
+    tenantName: null,
+    isSys: null,
+    status: 2,
+    deviceType: 3,
+    networkMethod: null
+  })
+  handleQuery()
 }
 
 // 行点击事件
 const rowClick = (row) => {
-    if (row != null) {
-        setRadioSelected(row.productId)
-        product.value = row
-    }
+  if (row != null) {
+    setRadioSelected(row.productId)
+    product.value = row
+  }
 }
 
 // 设置单选按钮选中
 const setRadioSelected = (productId) => {
-    for (let i = 0; i < productList.value.length; i++) {
-        if (productList.value[i].productId == productId) {
-            productList.value[i].isSelect = true
-        } else {
-            productList.value[i].isSelect = false
-        }
+  for (let i = 0; i < productList.value.length; i++) {
+    if (productList.value[i].productId == productId) {
+      productList.value[i].isSelect = true
+    } else {
+      productList.value[i].isSelect = false
     }
+  }
 }
 
 // 确认选择产品
 const confirmSelectProduct = () => {
-    emit('productEvent', product.value)
-    open.value = false
+  emit('productEvent', product.value)
+  open.value = false
 }
 
 // 关闭对话框
 const closeDialog = () => {
-    open.value = false
+  open.value = false
 }
 
 // 生命周期钩子
 onMounted(() => {
-    // 组件创建时的操作可以放在这里
+  // 组件创建时的操作可以放在这里
 })
 
 // 暴露方法给父组件调用
 defineExpose({
-    open,
-    getList,
-   
-   
+  open,
+  getList
 })
-</script>
+</script>

+ 43 - 32
src/views/pms/video_center/sip/sipconfig.vue

@@ -1,5 +1,5 @@
 <template>
-  <div style="padding:6px;">
+  <div style="padding: 6px">
     <el-form ref="formRef" :model="form">
       <el-row :gutter="100">
         <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
@@ -16,7 +16,6 @@
         <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
           <el-form-item :label="t('sip.sipConfig998537-5')">
             <el-input v-model="accessWay" disabled />
-            
           </el-form-item>
           <el-form-item :label="t('sip.sipConfig998537-6')" prop="port">
             <el-input v-model="form.port" type="number" disabled />
@@ -26,11 +25,19 @@
           </el-form-item>
         </el-col>
         <el-col :xs="23" :sm="23" :md="23" :lg="23" :xl="15">
-          <el-form-item style="text-align:center;margin-top:20px;">
-            <el-button v-show="form.id && productInfo.status != 2" type="primary" @click="submitForm">
+          <el-form-item style="text-align: center; margin-top: 20px">
+            <el-button
+              v-show="form.id && productInfo.status != 2"
+              type="primary"
+              @click="submitForm"
+            >
               更新
             </el-button>
-            <el-button v-show="!form.id && productInfo.status != 2" type="primary" @click="submitForm">
+            <el-button
+              v-show="!form.id && productInfo.status != 2"
+              type="primary"
+              @click="submitForm"
+            >
               添加
             </el-button>
           </el-form-item>
@@ -57,8 +64,8 @@ defineOptions({
 const props = defineProps({
   product: {
     type: Object,
-    default: null,
-  },
+    default: null
+  }
 })
 
 // 定义 emits(如果需要)
@@ -79,9 +86,9 @@ const productInfo = ref({})
 
 // 查询参数
 const queryParams = reactive({
-  pageNum: 1,
+  pageNo: 1,
   pageSize: 10,
-  productId: null,
+  productId: null
 })
 
 // 表单参数
@@ -92,26 +99,32 @@ const form = reactive({
   password: '',
   port: '',
   serverSipid: '',
-  productId: null,
+  productId: null
 })
 
 // 表单校验规则
 const rules = {
-  domain: [{
-    required: true,
-    message: t('sip.sipConfig998537-8'),
-    trigger: 'blur',
-  }],
-  serverSipid: [{
-    required: true,
-    message: t('sip.sipConfig998537-9'),
-    trigger: 'blur',
-  }],
-  password: [{
-    required: true,
-    message: t('sip.sipConfig998537-10'),
-    trigger: 'blur',
-  }],
+  domain: [
+    {
+      required: true,
+      message: t('sip.sipConfig998537-8'),
+      trigger: 'blur'
+    }
+  ],
+  serverSipid: [
+    {
+      required: true,
+      message: t('sip.sipConfig998537-9'),
+      trigger: 'blur'
+    }
+  ],
+  password: [
+    {
+      required: true,
+      message: t('sip.sipConfig998537-10'),
+      trigger: 'blur'
+    }
+  ]
 }
 
 // 监听 product 变化
@@ -131,7 +144,7 @@ watch(
 
 // 获取产品下第一条SIP配置
 function getSipconfigData() {
-  getSipconfig(productInfo.value.productId).then(response => {
+  getSipconfig(productInfo.value.productId).then((response) => {
     Object.assign(form, response)
   })
 
@@ -143,13 +156,13 @@ const submitForm = () => {
   formRef.value.validate((valid) => {
     if (valid) {
       form.productId = productInfo.value.productId
-      
+
       if (form.id != null) {
-        updateSipconfig(form).then(response => {
+        updateSipconfig(form).then((response) => {
           ElMessage.success(t('sip.sipConfig998537-13'))
         })
       } else {
-        addSipconfig(form).then(response => {
+        addSipconfig(form).then((response) => {
           ElMessage.success(t('sip.sipConfig998537-14'))
           getSipconfigData()
         })
@@ -164,8 +177,6 @@ onMounted(() => {
   if (productInfo.value && productInfo.value.productId != 0) {
     getSipconfigData()
   }
-
-  
 })
 </script>
 
@@ -173,4 +184,4 @@ onMounted(() => {
 .specsColor {
   background-color: #fcfcfc;
 }
-</style>
+</style>