logFile.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. _easycom_u_navbar2();
  6. }
  7. const _easycom_u_navbar = () => "../../../node-modules/uview-plus/components/u-navbar/u-navbar.js";
  8. if (!Math) {
  9. _easycom_u_navbar();
  10. }
  11. const _sfc_main = {
  12. __name: "logFile",
  13. setup(__props) {
  14. const data = common_vendor.reactive({
  15. logs: null,
  16. fullHeight: "1920px",
  17. screenHeight: 1920
  18. });
  19. common_vendor.onLoad((options) => {
  20. showLog(options.file);
  21. });
  22. common_vendor.onMounted(() => {
  23. data.screenHeight = common_vendor.index.getSystemInfoSync().windowHeight;
  24. });
  25. function showLog(file) {
  26. common_vendor.wx$1.downloadFile({
  27. url: file,
  28. success: function(res) {
  29. const filePath = res.tempFilePath;
  30. data.logs = common_vendor.wx$1.getFileSystemManager().readFileSync(filePath, "utf-8");
  31. }
  32. });
  33. }
  34. return (_ctx, _cache) => {
  35. return {
  36. a: common_vendor.o(_ctx.rightClick),
  37. b: common_vendor.p({
  38. title: "日志文件",
  39. titleStyle: "color:#fff;fontSize:36rpx;",
  40. bgColor: "#2C6FF3",
  41. autoBack: true,
  42. leftIconColor: "#fff",
  43. placeholder: true
  44. }),
  45. c: common_vendor.t(data.logs)
  46. };
  47. };
  48. }
  49. };
  50. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ab0140da"], ["__file", "F:/兴元/开门柜项目/平台端管理系统小程序/src/pages/xy_system/logs/logFile.vue"]]);
  51. wx.createPage(MiniProgramPage);