Ver Fonte

会议门禁接口参数调整

fanghuisheng há 5 dias atrás
pai
commit
6d9844639a

+ 3 - 3
src/api/business/door.js

@@ -5,7 +5,7 @@ import { request } from "@/utils/request";
  * @method Select 列表查询
  * @method Select 列表查询
  * @method Update 列表修改
  * @method Update 列表修改
  * @method Insert 列表新增
  * @method Insert 列表新增
- * @method Delete 列表删除
+ * @method Delete 列表删除(路径参数为 deviceUuid)
  * @method RecordInsert 记录列表新增
  * @method RecordInsert 记录列表新增
  * @method RecordSelect 记录列表查询
  * @method RecordSelect 记录列表查询
  * @method control 开门
  * @method control 开门
@@ -35,9 +35,9 @@ export function doorApi() {
                 data,
                 data,
             });
             });
         },
         },
-        Delete: (data) => {
+        Delete: (deviceUuid) => {
             return request({
             return request({
-                url: `/service-eg/egDevice/` + data,
+                url: `/service-eg/egDevice/` + deviceUuid,
                 method: 'DELETE',
                 method: 'DELETE',
             });
             });
         },
         },

+ 2 - 2
src/api/business/meeting.js

@@ -98,9 +98,9 @@ export function deviceApi() {
                 data
                 data
             });
             });
         },
         },
-        Delete: (data) => {
+        Delete: (deviceUuid) => {
             return request({
             return request({
-                url: '/service-meeting/meetingDevice?deviceId=' + data,
+                url: '/service-meeting/meetingDevice?deviceUuid=' + deviceUuid,
                 method: 'DELETE',
                 method: 'DELETE',
             });
             });
         },
         },

+ 2 - 1
src/pages/business/door/list/index.vue

@@ -93,6 +93,7 @@ function init() {
     .MyPage({
     .MyPage({
       current: state.current, //页数
       current: state.current, //页数
       size: state.pageSize, //条数
       size: state.pageSize, //条数
+      deviceType: 1,
     })
     })
     .then((requset) => {
     .then((requset) => {
       if (requset.data.records.length > 0) {
       if (requset.data.records.length > 0) {
@@ -108,7 +109,7 @@ function init() {
 
 
 /** 门禁设置 */
 /** 门禁设置 */
 function doorSetting(event) {
 function doorSetting(event) {
-  proxy.$tab.navigateTo(`/pages/business/door/list/setting?pagesTitle=${event.deviceName}&id=${event.id}`);
+  proxy.$tab.navigateTo(`/pages/business/door/list/setting?pagesTitle=${event.deviceName}&deviceUuid=${event.deviceUuid}`);
   console.log(event);
   console.log(event);
 }
 }
 
 

+ 14 - 7
src/pages/business/door/list/setting.vue

@@ -151,7 +151,8 @@ const state = reactive({
     show: false,
     show: false,
     type: "",
     type: "",
     form: {
     form: {
-      id: "",
+      deviceUuid: "",
+      deviceName: "",
       imgPath: "",
       imgPath: "",
       remark: "",
       remark: "",
       password: "",
       password: "",
@@ -231,19 +232,25 @@ onShow(() => {});
 onLoad((options) => {
 onLoad((options) => {
   if ("pagesTitle" in options) {
   if ("pagesTitle" in options) {
     state.pageTitle = options.pagesTitle;
     state.pageTitle = options.pagesTitle;
+    state.modal.form.deviceName = options.pagesTitle;
   }
   }
-  if ("id" in options) {
-    state.modal.form.id = options.id;
+  const deviceUuid = options.deviceUuid || options.id;
+  if (deviceUuid) {
+    state.modal.form.deviceUuid = deviceUuid;
+    state.deviceUuid = deviceUuid;
 
 
     doorApi()
     doorApi()
       .Select({
       .Select({
-        id: options.id,
-        current: 1, //页数
-        size: 20000000, //条数
+        deviceUuid,
+        deviceType: 1,
+        current: 1,
+        size: 10,
       })
       })
       .then((response) => {
       .then((response) => {
         const records = response.data.records[0];
         const records = response.data.records[0];
-        state.modal.form.id = records.id;
+        if (!records) return;
+        state.modal.form.deviceUuid = records.deviceUuid;
+        state.modal.form.deviceName = records.deviceName || state.pageTitle;
         state.modal.form.imgPath = records.imgPath;
         state.modal.form.imgPath = records.imgPath;
         state.modal.form.openMode = records.openMode;
         state.modal.form.openMode = records.openMode;
         state.modal.form.remark = records.remark;
         state.modal.form.remark = records.remark;

+ 1 - 1
src/pages/business/door/record/index.vue

@@ -45,7 +45,7 @@
                   fontSize: '14px',
                   fontSize: '14px',
                   fontWeight: 600,
                   fontWeight: 600,
                 }"
                 }"
-                >{{ data.egDevice?.deviceName }}</view
+                >{{ data.egDevice?.deviceName || data.deviceName }}</view
               >
               >
               <view>通行时间:{{ data.passTime ? data.passTime.replace("T", " ") : "" }}</view>
               <view>通行时间:{{ data.passTime ? data.passTime.replace("T", " ") : "" }}</view>
               <view>
               <view>

+ 1 - 1
src/pages/business/meeting/detailed/index.vue

@@ -43,7 +43,7 @@
             <view>会议室设施</view>
             <view>会议室设施</view>
           </view>
           </view>
           <view class="menu-item mt10">
           <view class="menu-item mt10">
-            <view class="text-right" v-for="dev in detailsData.meetingDevice" :key="dev">{{ dev.deviceName || "" }}</view>
+            <view class="text-right" v-for="dev in detailsData.meetingDevice" :key="dev.deviceUuid || dev.deviceName">{{ dev.deviceName || "" }}</view>
           </view>
           </view>
         </view>
         </view>
       </view>
       </view>

+ 1 - 0
src/pages/business/meeting/index.vue

@@ -302,6 +302,7 @@ function changeSheet(e) {
     deviceApi()
     deviceApi()
       .Select({
       .Select({
         roomId: state.popup.list.roomId,
         roomId: state.popup.list.roomId,
+        deviceType: 2,
         current: 1,
         current: 1,
         size: 2000,
         size: 2000,
       })
       })

+ 3 - 2
src/store/modules/control.js

@@ -22,6 +22,7 @@ const controlStore = defineStore("control", {
             domain: undefined,
             domain: undefined,
             doorList: {
             doorList: {
                 id: undefined,
                 id: undefined,
+                deviceUuid: undefined,
                 name: undefined,
                 name: undefined,
             },
             },
         },
         },
@@ -73,7 +74,7 @@ const controlStore = defineStore("control", {
                     domain: !isToken ? this.form.domain : undefined, //域名
                     domain: !isToken ? this.form.domain : undefined, //域名
                     userId: !isToken ? event.userId : undefined,
                     userId: !isToken ? event.userId : undefined,
                     userName: !isToken ? event.userName : undefined,
                     userName: !isToken ? event.userName : undefined,
-                    deviceUuid: !isToken ? this.form.doorList.id : event.deviceUuid,
+                    deviceUuid: !isToken ? (this.form.doorList.deviceUuid || this.form.doorList.id) : event.deviceUuid,
                     productCode: "502_USKY",
                     productCode: "502_USKY",
                     commandCode: "door_onoff",
                     commandCode: "door_onoff",
                     commandValue: 1,
                     commandValue: 1,
@@ -101,7 +102,7 @@ const controlStore = defineStore("control", {
                 .RecordInsert({
                 .RecordInsert({
                     domain: !getToken() ? this.form.domain : undefined, //域名
                     domain: !getToken() ? this.form.domain : undefined, //域名
                     userName: event.userName, //用户姓名
                     userName: event.userName, //用户姓名
-                    deviceUuid: !getToken() ? this.form.doorList.id : event.deviceUuid,//设备Uuid
+                    deviceUuid: !getToken() ? (this.form.doorList.deviceUuid || this.form.doorList.id) : event.deviceUuid, //设备Uuid
                     passType: 3, //通行方式(1、人脸 2、刷卡 3、手机)
                     passType: 3, //通行方式(1、人脸 2、刷卡 3、手机)
                     passTime: dayjs().format("YYYY-MM-DDTHH:mm:ss"), //通行时间
                     passTime: dayjs().format("YYYY-MM-DDTHH:mm:ss"), //通行时间
                     passResult: msg, //通行结果
                     passResult: msg, //通行结果