deviceNetHistory.js 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. if (!Array) {
  4. const _easycom_u_navbar2 = common_vendor.resolveComponent("u-navbar");
  5. const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
  6. const _easycom_u_loadmore2 = common_vendor.resolveComponent("u-loadmore");
  7. const _easycom_u_empty2 = common_vendor.resolveComponent("u-empty");
  8. const _easycom_u__input2 = common_vendor.resolveComponent("u--input");
  9. const _easycom_u_button2 = common_vendor.resolveComponent("u-button");
  10. const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
  11. (_easycom_u_navbar2 + _easycom_u_icon2 + _easycom_u_loadmore2 + _easycom_u_empty2 + _easycom_u__input2 + _easycom_u_button2 + _easycom_u_popup2)();
  12. }
  13. const _easycom_u_navbar = () => "../../../node-modules/uview-plus/components/u-navbar/u-navbar.js";
  14. const _easycom_u_icon = () => "../../../node-modules/uview-plus/components/u-icon/u-icon.js";
  15. const _easycom_u_loadmore = () => "../../../node-modules/uview-plus/components/u-loadmore/u-loadmore.js";
  16. const _easycom_u_empty = () => "../../../node-modules/uview-plus/components/u-empty/u-empty.js";
  17. const _easycom_u__input = () => "../../../node-modules/uview-plus/components/u--input/u--input.js";
  18. const _easycom_u_button = () => "../../../node-modules/uview-plus/components/u-button/u-button.js";
  19. const _easycom_u_popup = () => "../../../node-modules/uview-plus/components/u-popup/u-popup.js";
  20. if (!Math) {
  21. (_easycom_u_navbar + _easycom_u_icon + _easycom_u_loadmore + _easycom_u_empty + _easycom_u__input + _easycom_u_button + _easycom_u_popup)();
  22. }
  23. const _sfc_main = {
  24. __name: "deviceNetHistory",
  25. setup(__props) {
  26. const { proxy } = common_vendor.getCurrentInstance();
  27. const instance = common_vendor.getCurrentInstance();
  28. const {
  29. device_type,
  30. device_online_status
  31. } = proxy.$useDict("device_type", "device_online_status");
  32. const dicts = common_vendor.reactive({
  33. device_type: [],
  34. online_status: []
  35. });
  36. const searchMenu = common_vendor.reactive({
  37. showPopMenu: false,
  38. selStatus: 0,
  39. style: {
  40. marginTop: "174rpx"
  41. },
  42. searchMenu_body_style: {
  43. height: "600rpx"
  44. },
  45. params: {
  46. mercName: void 0,
  47. deviceId: void 0,
  48. deviceType: void 0,
  49. busyState: void 0,
  50. activeState: void 0,
  51. no: void 0
  52. }
  53. });
  54. function openSearchMenu() {
  55. searchMenu.showPopMenu = true;
  56. }
  57. function resetSearchMenu() {
  58. searchMenu.params.deviceId = void 0;
  59. searchMenu.params.deviceType = void 0;
  60. searchMenu.params.mercName = void 0;
  61. searchMenu.params.no = void 0;
  62. }
  63. function doSearch(o) {
  64. if (o == 0)
  65. resetSearchMenu();
  66. setTimeout(function() {
  67. searchMenu.showPopMenu = false;
  68. data.curPage = 1;
  69. getList();
  70. }, 500);
  71. }
  72. common_vendor.ref("");
  73. const data = common_vendor.reactive({
  74. reqUrls: {
  75. list: "/device/device-net-record/page"
  76. },
  77. curPage: 1,
  78. loadmoreStatus: "nomore",
  79. params: {
  80. page: {
  81. current: 1,
  82. size: 10,
  83. orders: [
  84. {
  85. asc: false,
  86. column: "create_time"
  87. }
  88. ]
  89. }
  90. },
  91. fullHeight: 0,
  92. screenHeight: 1920,
  93. // screenWidht:1080,
  94. dataList: [],
  95. total: 0,
  96. isRemember: []
  97. });
  98. common_vendor.onMounted(() => {
  99. dicts.device_type = [{ value: null, label: "全部" }].concat(device_type.value);
  100. dicts.online_status = [{ value: null, label: "全部" }].concat(device_online_status.value);
  101. data.screenHeight = common_vendor.index.getSystemInfoSync().windowHeight;
  102. searchMenu.searchMenu_body_style.height = data.screenHeight - 90 + "px";
  103. getList();
  104. const query = common_vendor.index.createSelectorQuery().in(instance);
  105. query.select(".scrollview").boundingClientRect((r) => {
  106. common_vendor.index.getSystemInfo({
  107. success(res) {
  108. const model = res.model;
  109. const modelInclude = [
  110. "iPhone X",
  111. "iPhone XR",
  112. "iPhone XS",
  113. "iPhone XS MAX",
  114. "iPhone 12/13 mini",
  115. "iPhone 12/13 (Pro)",
  116. "iPhone 12/13 Pro Max",
  117. "iPhone 14 Pro Max"
  118. ];
  119. let safeDistance = modelInclude.includes(model);
  120. console.log(res.windowHeight, r.top);
  121. let h = 0;
  122. if (safeDistance) {
  123. h = res.windowHeight - r.top;
  124. } else {
  125. h = res.windowHeight - r.top;
  126. }
  127. data.fullHeight += h + "px";
  128. }
  129. });
  130. }).exec();
  131. });
  132. function scrolltolower() {
  133. if (data.loadmoreStatus == "nomore")
  134. return;
  135. data.curPage++;
  136. getList();
  137. }
  138. function getList() {
  139. return new Promise((resolve, reject) => {
  140. data.params.page.current = data.curPage;
  141. data.params.deviceId = searchMenu.params.deviceId;
  142. if (data.curPage == 1) {
  143. data.dataList = [];
  144. }
  145. proxy.$request({
  146. url: data.reqUrls.list,
  147. data: data.params,
  148. method: "post"
  149. }).then((res) => {
  150. console.log("***", res);
  151. if (res.records) {
  152. data.dataList = data.dataList.concat(res.records);
  153. }
  154. data.total = res.total;
  155. if (res.records.length < 10) {
  156. data.loadmoreStatus = "nomore";
  157. } else {
  158. data.loadmoreStatus = "loadmore";
  159. }
  160. resolve(res);
  161. }).catch((err) => {
  162. reject(err);
  163. });
  164. });
  165. }
  166. function gotoDeviceDetail(o) {
  167. }
  168. function rightClick() {
  169. console.log("点击了右侧");
  170. }
  171. return (_ctx, _cache) => {
  172. return common_vendor.e({
  173. a: common_vendor.o(rightClick),
  174. b: common_vendor.p({
  175. title: "联网记录查询",
  176. titleStyle: "color:#fff;fontSize:36rpx;",
  177. bgColor: "#2C6FF3",
  178. autoBack: true,
  179. leftIconColor: "#fff",
  180. placeholder: true
  181. }),
  182. c: common_vendor.t(data.total),
  183. d: common_vendor.p({
  184. name: "arrow-right",
  185. size: "14"
  186. }),
  187. e: common_vendor.o(openSearchMenu),
  188. f: data.dataList.length > 0
  189. }, data.dataList.length > 0 ? common_vendor.e({
  190. g: common_vendor.f(data.dataList, (item1, index1, i0) => {
  191. return common_vendor.e({
  192. a: item1.deviceName
  193. }, item1.deviceName ? {
  194. b: common_vendor.t(item1.deviceName),
  195. c: common_vendor.t(item1.deviceId)
  196. } : {
  197. d: common_vendor.t(item1.deviceId)
  198. }, {
  199. e: common_vendor.t(item1.netStatus == "1" ? "在线" : "离线"),
  200. f: common_vendor.n(item1.netStatus == 1 ? "online" : ""),
  201. g: common_vendor.t(item1.createTime),
  202. h: common_vendor.o(($event) => gotoDeviceDetail(item1.deviceId), item1.deviceId),
  203. i: item1.deviceId
  204. });
  205. }),
  206. h: data.dataList.length > 0
  207. }, data.dataList.length > 0 ? {
  208. i: common_vendor.p({
  209. status: data.loadmoreStatus
  210. })
  211. } : {}) : {
  212. j: common_vendor.p({
  213. mode: "data",
  214. text: "数据为空"
  215. })
  216. }, {
  217. k: common_vendor.o(scrolltolower),
  218. l: data.fullHeight,
  219. m: common_vendor.o(($event) => searchMenu.params.deviceId = $event),
  220. n: common_vendor.p({
  221. placeholder: "请输入机器名称,编号",
  222. border: "surround",
  223. modelValue: searchMenu.params.deviceId
  224. }),
  225. o: common_vendor.o(($event) => doSearch(0)),
  226. p: common_vendor.p({
  227. size: "normal",
  228. plain: true,
  229. text: "关闭"
  230. }),
  231. q: common_vendor.o(resetSearchMenu),
  232. r: common_vendor.p({
  233. size: "normal",
  234. type: "primary",
  235. plain: true,
  236. text: "重置"
  237. }),
  238. s: common_vendor.o(($event) => doSearch(1)),
  239. t: common_vendor.p({
  240. size: "normal",
  241. type: "primary",
  242. text: "查找"
  243. }),
  244. v: common_vendor.s(searchMenu.searchMenu_body_style),
  245. w: common_vendor.p({
  246. show: searchMenu.showPopMenu,
  247. duration: "0",
  248. customStyle: searchMenu.style,
  249. round: 10,
  250. mode: "right",
  251. duration: 300,
  252. overlay: false
  253. })
  254. });
  255. };
  256. }
  257. };
  258. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-276658a7"], ["__file", "F:/兴元/开门柜项目/平台端管理系统小程序/src/pages/xy_system/devices/deviceNetHistory.vue"]]);
  259. wx.createPage(MiniProgramPage);