"use strict"; const common_vendor = require("../../../common/vendor.js"); if (!Array) { const _easycom_u_navbar2 = common_vendor.resolveComponent("u-navbar"); const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon"); const _easycom_u_loadmore2 = common_vendor.resolveComponent("u-loadmore"); const _easycom_u_empty2 = common_vendor.resolveComponent("u-empty"); const _easycom_u__input2 = common_vendor.resolveComponent("u--input"); const _easycom_u_button2 = common_vendor.resolveComponent("u-button"); const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup"); (_easycom_u_navbar2 + _easycom_u_icon2 + _easycom_u_loadmore2 + _easycom_u_empty2 + _easycom_u__input2 + _easycom_u_button2 + _easycom_u_popup2)(); } const _easycom_u_navbar = () => "../../../node-modules/uview-plus/components/u-navbar/u-navbar.js"; const _easycom_u_icon = () => "../../../node-modules/uview-plus/components/u-icon/u-icon.js"; const _easycom_u_loadmore = () => "../../../node-modules/uview-plus/components/u-loadmore/u-loadmore.js"; const _easycom_u_empty = () => "../../../node-modules/uview-plus/components/u-empty/u-empty.js"; const _easycom_u__input = () => "../../../node-modules/uview-plus/components/u--input/u--input.js"; const _easycom_u_button = () => "../../../node-modules/uview-plus/components/u-button/u-button.js"; const _easycom_u_popup = () => "../../../node-modules/uview-plus/components/u-popup/u-popup.js"; if (!Math) { (_easycom_u_navbar + _easycom_u_icon + _easycom_u_loadmore + _easycom_u_empty + _easycom_u__input + _easycom_u_button + _easycom_u_popup)(); } const _sfc_main = { __name: "deviceNetHistory", setup(__props) { const { proxy } = common_vendor.getCurrentInstance(); const instance = common_vendor.getCurrentInstance(); const { device_type, device_online_status } = proxy.$useDict("device_type", "device_online_status"); const dicts = common_vendor.reactive({ device_type: [], online_status: [] }); const searchMenu = common_vendor.reactive({ showPopMenu: false, selStatus: 0, style: { marginTop: "174rpx" }, searchMenu_body_style: { height: "600rpx" }, params: { mercName: void 0, deviceId: void 0, deviceType: void 0, busyState: void 0, activeState: void 0, no: void 0 } }); function openSearchMenu() { searchMenu.showPopMenu = true; } function resetSearchMenu() { searchMenu.params.deviceId = void 0; searchMenu.params.deviceType = void 0; searchMenu.params.mercName = void 0; searchMenu.params.no = void 0; } function doSearch(o) { if (o == 0) resetSearchMenu(); setTimeout(function() { searchMenu.showPopMenu = false; data.curPage = 1; getList(); }, 500); } common_vendor.ref(""); const data = common_vendor.reactive({ reqUrls: { list: "/device/device-net-record/page" }, curPage: 1, loadmoreStatus: "nomore", params: { page: { current: 1, size: 10, orders: [ { asc: false, column: "create_time" } ] } }, fullHeight: 0, screenHeight: 1920, // screenWidht:1080, dataList: [], total: 0, isRemember: [] }); common_vendor.onMounted(() => { dicts.device_type = [{ value: null, label: "全部" }].concat(device_type.value); dicts.online_status = [{ value: null, label: "全部" }].concat(device_online_status.value); data.screenHeight = common_vendor.index.getSystemInfoSync().windowHeight; searchMenu.searchMenu_body_style.height = data.screenHeight - 90 + "px"; getList(); const query = common_vendor.index.createSelectorQuery().in(instance); query.select(".scrollview").boundingClientRect((r) => { common_vendor.index.getSystemInfo({ success(res) { const model = res.model; const modelInclude = [ "iPhone X", "iPhone XR", "iPhone XS", "iPhone XS MAX", "iPhone 12/13 mini", "iPhone 12/13 (Pro)", "iPhone 12/13 Pro Max", "iPhone 14 Pro Max" ]; let safeDistance = modelInclude.includes(model); console.log(res.windowHeight, r.top); let h = 0; if (safeDistance) { h = res.windowHeight - r.top; } else { h = res.windowHeight - r.top; } data.fullHeight += h + "px"; } }); }).exec(); }); function scrolltolower() { if (data.loadmoreStatus == "nomore") return; data.curPage++; getList(); } function getList() { return new Promise((resolve, reject) => { data.params.page.current = data.curPage; data.params.deviceId = searchMenu.params.deviceId; if (data.curPage == 1) { data.dataList = []; } proxy.$request({ url: data.reqUrls.list, data: data.params, method: "post" }).then((res) => { console.log("***", res); if (res.records) { data.dataList = data.dataList.concat(res.records); } data.total = res.total; if (res.records.length < 10) { data.loadmoreStatus = "nomore"; } else { data.loadmoreStatus = "loadmore"; } resolve(res); }).catch((err) => { reject(err); }); }); } function gotoDeviceDetail(o) { } function rightClick() { console.log("点击了右侧"); } return (_ctx, _cache) => { return common_vendor.e({ a: common_vendor.o(rightClick), b: common_vendor.p({ title: "联网记录查询", titleStyle: "color:#fff;fontSize:36rpx;", bgColor: "#2C6FF3", autoBack: true, leftIconColor: "#fff", placeholder: true }), c: common_vendor.t(data.total), d: common_vendor.p({ name: "arrow-right", size: "14" }), e: common_vendor.o(openSearchMenu), f: data.dataList.length > 0 }, data.dataList.length > 0 ? common_vendor.e({ g: common_vendor.f(data.dataList, (item1, index1, i0) => { return common_vendor.e({ a: item1.deviceName }, item1.deviceName ? { b: common_vendor.t(item1.deviceName), c: common_vendor.t(item1.deviceId) } : { d: common_vendor.t(item1.deviceId) }, { e: common_vendor.t(item1.netStatus == "1" ? "在线" : "离线"), f: common_vendor.n(item1.netStatus == 1 ? "online" : ""), g: common_vendor.t(item1.createTime), h: common_vendor.o(($event) => gotoDeviceDetail(item1.deviceId), item1.deviceId), i: item1.deviceId }); }), h: data.dataList.length > 0 }, data.dataList.length > 0 ? { i: common_vendor.p({ status: data.loadmoreStatus }) } : {}) : { j: common_vendor.p({ mode: "data", text: "数据为空" }) }, { k: common_vendor.o(scrolltolower), l: data.fullHeight, m: common_vendor.o(($event) => searchMenu.params.deviceId = $event), n: common_vendor.p({ placeholder: "请输入机器名称,编号", border: "surround", modelValue: searchMenu.params.deviceId }), o: common_vendor.o(($event) => doSearch(0)), p: common_vendor.p({ size: "normal", plain: true, text: "关闭" }), q: common_vendor.o(resetSearchMenu), r: common_vendor.p({ size: "normal", type: "primary", plain: true, text: "重置" }), s: common_vendor.o(($event) => doSearch(1)), t: common_vendor.p({ size: "normal", type: "primary", text: "查找" }), v: common_vendor.s(searchMenu.searchMenu_body_style), w: common_vendor.p({ show: searchMenu.showPopMenu, duration: "0", customStyle: searchMenu.style, round: 10, mode: "right", duration: 300, overlay: false }) }); }; } }; const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-276658a7"], ["__file", "F:/兴元/开门柜项目/平台端管理系统小程序/src/pages/xy_system/devices/deviceNetHistory.vue"]]); wx.createPage(MiniProgramPage);