prc 1 سال پیش
والد
کامیت
504119e9db
3فایلهای تغییر یافته به همراه616 افزوده شده و 423 حذف شده
  1. 163 0
      client/dist/main/index.js
  2. 31 0
      client/dist/preload/index.js
  3. 422 423
      client/src/renderer/pages/ListNum/ListNum4.vue

+ 163 - 0
client/dist/main/index.js

@@ -0,0 +1,163 @@
+"use strict";
+var __defProp = Object.defineProperty;
+var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
+var __publicField = (obj, key, value) => {
+  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
+  return value;
+};
+const electron = require("electron");
+const path = require("path");
+const name = "vutron";
+const version = "1.0.0";
+class Constants {
+}
+// Display app name (uppercase first letter)
+__publicField(Constants, "APP_NAME", name.charAt(0).toUpperCase() + name.slice(1));
+__publicField(Constants, "APP_VERSION", version);
+__publicField(Constants, "IS_DEV_ENV", process.env.NODE_ENV === "development");
+__publicField(Constants, "IS_MAC", process.platform === "darwin");
+__publicField(Constants, "DEFAULT_WEB_PREFERENCES", {
+  nodeIntegration: false,
+  contextIsolation: true,
+  enableRemoteModule: false,
+  preload: path.join(__dirname, "../preload/index.js")
+});
+__publicField(Constants, "APP_INDEX_URL_DEV", "http://localhost:5173/index.html");
+__publicField(Constants, "APP_INDEX_URL_PROD", path.join(__dirname, "../index.html"));
+class IPCs {
+  static initialize(window) {
+    electron.ipcMain.on("msgRequestGetVersion", () => {
+      window.webContents.send("msgReceivedVersion", Constants.APP_VERSION);
+    });
+    electron.ipcMain.on("msgOpenExternalLink", async (event, url) => {
+      await electron.shell.openExternal(url);
+    });
+    electron.ipcMain.on("msgRequestGetServerPort", () => {
+      const port = process.env["PLC_SIM_PORT"];
+      window.webContents.send("msgReceivedServerPort", port);
+    });
+  }
+}
+const exitApp = (mainWindow2) => {
+  if (mainWindow2 && !mainWindow2.isDestroyed()) {
+    mainWindow2.hide();
+  }
+  mainWindow2.destroy();
+  electron.app.exit();
+};
+const createMainWindow = async (mainWindow2) => {
+  mainWindow2 = new electron.BrowserWindow({
+    title: "电力线载波通信测试系统",
+    show: false,
+    // frame: false,
+    width: Constants.IS_DEV_ENV ? 1500 : 1200,
+    height: 650,
+    useContentSize: true,
+    webPreferences: Constants.DEFAULT_WEB_PREFERENCES
+  });
+  console.log(
+    `[Client] Using env value as server port: PLC_SIM_PORT=${process.env["PLC_SIM_PORT"]}.`
+  );
+  mainWindow2.setMenu(null);
+  mainWindow2.on("close", (event) => {
+    event.preventDefault();
+    exitApp(mainWindow2);
+  });
+  mainWindow2.webContents.on("did-frame-finish-load", () => {
+    if (Constants.IS_DEV_ENV) {
+      mainWindow2.webContents.openDevTools();
+    }
+  });
+  electron.ipcMain.on("window-min", function() {
+    mainWindow2.minimize();
+  });
+  electron.ipcMain.on("window-max", function() {
+    if (mainWindow2.isMaximized()) {
+      mainWindow2.restore();
+    } else {
+      mainWindow2.maximize();
+    }
+  });
+  electron.ipcMain.on("window-close", function() {
+    mainWindow2.close();
+  });
+  mainWindow2.once("ready-to-show", () => {
+    mainWindow2.setAlwaysOnTop(true);
+    mainWindow2.show();
+    mainWindow2.focus();
+    mainWindow2.setAlwaysOnTop(false);
+  });
+  if (Constants.IS_DEV_ENV) {
+    await mainWindow2.loadURL(Constants.APP_INDEX_URL_DEV);
+  } else {
+    await mainWindow2.loadFile(Constants.APP_INDEX_URL_PROD);
+  }
+  IPCs.initialize(mainWindow2);
+  return mainWindow2;
+};
+const createErrorWindow = async (errorWindow2, mainWindow2, details) => {
+  if (!Constants.IS_DEV_ENV) {
+    mainWindow2 == null ? void 0 : mainWindow2.hide();
+  }
+  errorWindow2 = new electron.BrowserWindow({
+    title: Constants.APP_NAME,
+    show: false,
+    resizable: Constants.IS_DEV_ENV,
+    webPreferences: Constants.DEFAULT_WEB_PREFERENCES
+  });
+  errorWindow2.setMenu(null);
+  if (Constants.IS_DEV_ENV) {
+    await errorWindow2.loadURL(`${Constants.APP_INDEX_URL_DEV}#/error`);
+  } else {
+    await errorWindow2.loadFile(Constants.APP_INDEX_URL_PROD, { hash: "error" });
+  }
+  errorWindow2.on("ready-to-show", () => {
+    if (!Constants.IS_DEV_ENV && mainWindow2 && !mainWindow2.isDestroyed()) {
+      mainWindow2.destroy();
+    }
+    errorWindow2.show();
+    errorWindow2.focus();
+  });
+  errorWindow2.webContents.on("did-frame-finish-load", () => {
+    if (Constants.IS_DEV_ENV) {
+      errorWindow2.webContents.openDevTools();
+    }
+  });
+  return errorWindow2;
+};
+class Menus {
+  static macOSDisableDefaultMenuItem() {
+    if (Constants.IS_MAC) {
+      electron.systemPreferences.setUserDefault("NSDisabledDictationMenuItem", "boolean", true);
+      electron.systemPreferences.setUserDefault("NSDisabledCharacterPaletteMenuItem", "boolean", true);
+    }
+  }
+}
+const { macOSDisableDefaultMenuItem } = Menus;
+let mainWindow;
+let errorWindow;
+electron.app.on("ready", () => {
+  macOSDisableDefaultMenuItem();
+  mainWindow = createMainWindow(mainWindow);
+});
+electron.app.on("activate", () => {
+  if (!mainWindow) {
+    mainWindow = createMainWindow(mainWindow);
+  }
+});
+electron.app.on("window-all-closed", () => {
+  mainWindow = null;
+  errorWindow = null;
+  if (!Constants.IS_MAC) {
+    electron.app.quit();
+  }
+});
+electron.app.on(
+  "render-process-gone",
+  (event, webContents, details) => {
+    errorWindow = createErrorWindow(errorWindow, mainWindow);
+  }
+);
+process.on("uncaughtException", () => {
+  errorWindow = createErrorWindow(errorWindow, mainWindow);
+});

+ 31 - 0
client/dist/preload/index.js

@@ -0,0 +1,31 @@
+"use strict";
+const electron = require("electron");
+const mainAvailChannels = [
+  "msgRequestGetVersion",
+  "msgOpenExternalLink",
+  "msgRequestGetServerPort"
+];
+const rendererAvailChannels = ["msgReceivedVersion", "msgReceivedServerPort"];
+electron.contextBridge.exposeInMainWorld("mainApi", {
+  send: (channel, ...data) => {
+    if (mainAvailChannels.includes(channel)) {
+      electron.ipcRenderer.send.apply(null, [channel, ...data]);
+    } else {
+      throw new Error(`Send failed: Unknown ipc channel name: ${channel}`);
+    }
+  },
+  receive: (channel, cbFunc) => {
+    if (rendererAvailChannels.includes(channel)) {
+      electron.ipcRenderer.on(channel, (event, ...args) => cbFunc(event, ...args));
+    } else {
+      throw new Error(`Receive failed: Unknown ipc channel name: ${channel}`);
+    }
+  },
+  invoke: async (channel, ...data) => {
+    if (mainAvailChannels.includes(channel)) {
+      const result = await electron.ipcRenderer.invoke.apply(null, [channel, ...data]);
+      return result;
+    }
+    throw new Error(`Invoke failed: Unknown ipc channel name: ${channel}`);
+  }
+});

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 422 - 423
client/src/renderer/pages/ListNum/ListNum4.vue


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است