浏览代码

Merge branch 'cf_dev' of http://113.44.0.55:8014/jiaxiaoqiang/JG-CLIENT-TEMP into cf_dev

# Conflicts:
#	package.json
qinhb 2 月之前
父节点
当前提交
12538f0d44

+ 5 - 2
.env.development

@@ -11,9 +11,12 @@ VITE_APP_BASE_API = '/dev-api'
 VITE_APP_UPLOAD_URL = 'http://192.168.101.4:9000'
 
 # 开发接口地址
-VITE_APP_API_URL = 'http://192.168.101.4:7203'
+VITE_APP_API_URL = 'http://192.168.1.69:7203'
 # Websocket地址
-VITE_WEBSOCKET_URL = 'ws://192.168.101.178:7203'
+VITE_WEBSOCKET_URL = 'ws://192.168.1.69:7203'
 ``
 # 是否启用 Mock 服务
 VITE_MOCK_DEV_SERVER = false
+
+#测试系统的url
+VITE_TO_TEST_URL = 'http://127.0.0.1:4001'

+ 3 - 0
.env.production

@@ -10,3 +10,6 @@ VITE_APP_UPLOAD_URL = ''
 
 # Websocket地址
 VITE_WEBSOCKET_URL = 'ws://127.0.0.1:7203'
+
+#测试系统的url
+VITE_TO_TEST_URL = 'http://127.0.0.1:8085'

+ 71 - 70
package.json

@@ -1,11 +1,12 @@
 {
-  "name": "生产线综合管控采集平台",
+  "name": "维修状态数据管控系统-一体机",
   "version": "1.0.0",
   "private": true,
   "type": "module",
   "scripts": {
     "preinstall": "npx only-allow pnpm",
     "dev": "vite serve --mode development",
+    "build:test": "vite build --mode test",
     "build": "vite build --mode production",
     "lint:eslint": "eslint  --fix --ext .ts,.js,.vue ./src ",
     "lint:prettier": "prettier --write \"**/*.{js,cjs,ts,json,tsx,css,less,scss,vue,html,md}\"",
@@ -41,99 +42,99 @@
   },
   "dependencies": {
     "@element-plus/icons-vue": "^2.3.1",
-    "@kjgl77/datav-vue3": "^1.7.4",
-    "@smallwei/avue": "^3.6.0",
-    "@stomp/stompjs": "^7.0.0",
-    "@vitejs/plugin-vue-jsx": "^4.1.1",
-    "@vueup/vue-quill": "^1.2.0",
-    "@vueuse/core": "^10.11.1",
+    "@smallwei/avue": "^3.3.3",
+    "@types/smallwei__avue": "^3.0.5",
+    "@types/uuid": "^9.0.8",
+    "@vue/runtime-core": "^3.4.27",
+    "@vueuse/core": "^10.9.0",
     "@wangeditor/editor": "^5.1.23",
     "@wangeditor/editor-for-vue": "5.1.10",
     "animate.css": "^4.1.1",
-    "axios": "^1.7.9",
-    "codemirror": "^5.65.18",
-    "codemirror-editor-vue3": "^2.8.0",
-    "dhtmlx-gantt": "^9.0.3",
-    "echarts": "^5.5.1",
-    "element-plus": "^2.9.1",
+    "axios": "^1.6.7",
+    "dayjs": "^1.11.10",
+    "echarts": "^5.5.0",
+    "element-plus": "^2.6.0",
     "exceljs": "^4.4.0",
     "file-saver": "^2.0.5",
-    "html2canvas": "^1.4.1",
-    "jspdf": "^2.5.2",
+    "less": "^4.2.0",
     "lodash-es": "^4.17.21",
     "luckyexcel": "^1.0.1",
-    "moment": "^2.30.1",
+    "mitt": "^3.0.1",
+    "nanoid": "^5.0.7",
+    "mitt": "^3.0.1",
+    "nanoid": "^5.1.5",
     "net": "^1.0.2",
     "nprogress": "^0.2.0",
     "path-browserify": "^1.0.1",
-    "path-to-regexp": "^6.3.0",
-    "pinia": "^2.3.0",
-    "pinia-plugin-persist": "^1.0.0",
-    "print-js": "^1.6.0",
-    "qs": "^6.13.1",
-    "sockjs-client": "^1.6.1",
-    "sortablejs": "^1.15.6",
+    "path-to-regexp": "^6.2.1",
+    "pinia": "^2.1.7",
+    "pinia-plugin-persistedstate": "^3.2.1",
+    "sockjs-client": "1.6.1",
+    "sortablejs": "^1.15.2",
+    "path-to-regexp": "^6.2.1",
+    "pinia": "^2.1.7",
+    "pinia-plugin-persistedstate": "^3.2.3",
+    "sockjs-client": "1.6.1",
+    "sortablejs": "^1.15.2",
+
+
     "stompjs": "^2.3.3",
-    "three": "^0.171.0",
-    "unplugin-element-plus": "^0.8.0",
-    "unplugin-icons": "^0.22.0",
-    "uuid": "^11.0.3",
-    "vue": "^3.5.13",
-    "vue-draggable-plus": "^0.6.0",
+    "uuid": "^9.0.1",
+    "vue": "^3.4.21",
     "vue-i18n": "9.9.1",
     "vue-pdf-embed": "2.0.2",
-    "vue-qrcode": "^2.2.2",
-    "vue-router": "^4.5.0",
+    "vue-router": "^4.3.0",
+    "vue3-pdfjs": "^0.1.6",
     "vue3-print-nb": "^0.1.4",
+    "x-data-spreadsheet": "^1.1.9",
     "xlsx": "^0.18.5"
   },
   "devDependencies": {
-    "@commitlint/cli": "^19.6.1",
-    "@commitlint/config-conventional": "^19.6.0",
-    "@eslint/js": "^9.17.0",
-    "@iconify-json/ep": "^1.2.2",
-    "@types/codemirror": "^5.60.15",
-    "@types/lodash": "^4.17.13",
-    "@types/node": "^22.10.2",
+    "@commitlint/cli": "^18.6.1",
+    "@commitlint/config-conventional": "^18.6.2",
+    "@iconify-json/ep": "^1.1.14",
+    "@types/lodash": "^4.14.202",
+    "@types/node": "^20.11.24",
     "@types/nprogress": "^0.2.3",
-    "@types/path-browserify": "^1.0.3",
-    "@types/qs": "^6.9.17",
+    "@types/path-browserify": "^1.0.2",
+    "@types/sockjs-client": "^1.5.4",
     "@types/sortablejs": "^1.15.8",
-    "@typescript-eslint/eslint-plugin": "^8.18.2",
-    "@typescript-eslint/parser": "^8.18.2",
-    "@vitejs/plugin-vue": "^5.2.1",
-    "autoprefixer": "^10.4.20",
-    "commitizen": "^4.3.1",
-    "cz-git": "1.9.4",
-    "eslint": "^9.17.0",
+    "@types/stompjs": "^2.3.9",
+    "@typescript-eslint/eslint-plugin": "^7.1.1",
+    "@typescript-eslint/parser": "^7.1.1",
+    "@vitejs/plugin-vue": "^5.0.4",
+    "@vitejs/plugin-vue-jsx": "^3.1.0",
+    "autoprefixer": "^10.4.18",
+    "commitizen": "^4.3.0",
+    "cz-git": "^1.9.0",
+    "eslint": "^8.57.0",
     "eslint-config-prettier": "^9.1.0",
-    "eslint-plugin-prettier": "^5.2.1",
-    "eslint-plugin-vue": "^9.32.0",
-    "globals": "^15.14.0",
-    "husky": "^9.1.7",
-    "lint-staged": "^15.2.11",
-    "postcss": "^8.4.49",
-    "postcss-html": "^1.7.0",
+    "eslint-plugin-import": "^2.29.1",
+    "eslint-plugin-prettier": "^5.1.3",
+    "eslint-plugin-vue": "^9.22.0",
+    "fast-glob": "^3.3.2",
+    "lint-staged": "^15.2.2",
+    "postcss": "^8.4.35",
+    "postcss-html": "^1.6.0",
     "postcss-scss": "^4.0.9",
-    "prettier": "^3.4.2",
-    "sass": "^1.83.0",
-    "stylelint": "^16.12.0",
+    "prettier": "^3.2.5",
+    "sass": "^1.71.1",
+    "stylelint": "^16.2.1",
     "stylelint-config-html": "^1.1.0",
-    "stylelint-config-recess-order": "^5.1.1",
-    "stylelint-config-recommended-scss": "^14.1.0",
+    "stylelint-config-recess-order": "^4.6.0",
+    "stylelint-config-recommended-scss": "^14.0.0",
     "stylelint-config-recommended-vue": "^1.5.0",
-    "stylelint-config-standard": "^36.0.1",
-    "terser": "^5.37.0",
-    "typescript": "5.5.4",
-    "typescript-eslint": "^8.18.2",
-    "unocss": "0.65.1",
-    "unplugin-auto-import": "^0.18.6",
-    "unplugin-vue-components": "^0.27.5",
-    "vite": "^6.0.5",
-    "vite-plugin-mock-dev-server": "^1.8.3",
+    "stylelint-config-standard": "^36.0.0",
+    "terser": "^5.28.1",
+    "typescript": "^5.3.3",
+    "unocss": "^0.58.5",
+    "unplugin-auto-import": "^0.17.5",
+    "unplugin-icons": "^0.18.5",
+    "unplugin-vue-components": "^0.26.0",
+    "vite": "^5.1.5",
+    "vite-plugin-mock-dev-server": "^1.4.7",
     "vite-plugin-svg-icons": "^2.0.1",
-    "vue-eslint-parser": "^9.4.3",
-    "vue-tsc": "^2.2.0"
+    "vue-tsc": "^2.0.4"
   },
   "repository": "https://gitee.com/youlaiorg/vue3-element-admin.git",
   "author": "有来开源组织",

+ 8 - 0
src/api/prosteps/ceshishuju.ts

@@ -15,6 +15,14 @@ export function startCSSJTesting(processId: string) {
   });
 }
 
+// 查询最后一次执行日志列表
+export function getCSSJLastLogData(processId?: string) {
+  return request({
+    url: `/api/v1/test/engrExecuteLog/queryLastList`,
+    method: "post",
+    data: {},
+  });
+}
 export function deleteCSSJ(id: string) {
   return request({
     url: `/api/v1/testData/del`,

+ 0 - 3
src/components/FullLoading/index.vue

@@ -2,9 +2,6 @@
   <!--  components/Loading/index.vue-->
   <div v-show="isShow" class="loading">
     <div>
-      <div class="loading-content">
-        <img src="/logo.png" object-fit="cover" />
-      </div>
       <div class="titleText">正在加载...</div>
     </div>
   </div>

+ 52 - 12
src/components/RealTimeMsg/index.vue

@@ -38,12 +38,22 @@
     </div>
     <!-- 静电环状态样式 -->
     <div class="staticBox">
-      <div :class="braceletState == 0 ? 'static type0' : 'static type1'">
-        <div class="titleText">静电手环状态:</div>
-        <div class="titleText state">
-          {{ braceletState == 0 ? "离线" : "在线" }}
-        </div>
-      </div>
+      <!--      <div :class="braceletState == 0 ? 'static type0' : 'static type1'">-->
+      <!--        <div class="titleText">静电手环状态:</div>-->
+      <!--        <div class="titleText state">-->
+      <!--          {{ braceletState == 0 ? "离线" : "在线" }}-->
+      <!--        </div>-->
+      <!--      </div>-->
+      <!--      <div style="margin-left: 5px; height: 100%">-->
+      <!--        <el-button-->
+      <!--          style="height: 60px; border-radius: 16px; font-size: 20px"-->
+      <!--          class="login-btn"-->
+      <!--          size="large"-->
+      <!--          type="primary"-->
+      <!--          @click="toCs"-->
+      <!--          >测试系统-->
+      <!--        </el-button>-->
+      <!--      </div>-->
       <!-- <el-button
         v-if="braceletState == 0"
         type="primary"
@@ -52,12 +62,12 @@
         >重新检测</el-button
       > -->
     </div>
-    <div class="lightsBox">
-      <div><div class="titleText">电烙铁状态:</div></div>
-      <div class="light" :class="{ activeLight0: lightIndex == 0 }"></div>
-      <div class="light" :class="{ activeLight1: lightIndex == 1 }"></div>
-      <div class="light" :class="{ activeLight2: lightIndex == 2 }"></div>
-    </div>
+    <!--    <div class="lightsBox">-->
+    <!--      <div><div class="titleText">电烙铁状态:</div></div>-->
+    <!--      <div class="light" :class="{ activeLight0: lightIndex == 0 }"></div>-->
+    <!--      <div class="light" :class="{ activeLight1: lightIndex == 1 }"></div>-->
+    <!--      <div class="light" :class="{ activeLight2: lightIndex == 2 }"></div>-->
+    <!--    </div>-->
   </div>
 </template>
 
@@ -93,6 +103,27 @@ const submit = async (item, index) => {
     ElMessage.success("操作成功!");
   }
 };
+const toCs = () => {
+  console.log("toCs", window.name);
+  // 假设目标标签页的窗口名称为 'myTab'
+  const targetWindow = window.open(
+    import.meta.env.VITE_TO_TEST_URL,
+    "HJ-TEST-SYSTEM"
+  );
+
+  if (targetWindow) {
+    // 如果目标窗口已经打开,则会跳转到该窗口
+    targetWindow.focus();
+  } else {
+    // 如果目标窗口未打开,则会打开一个新的窗口
+    console.log("目标窗口未找到或被阻止");
+  }
+
+  // const newWindow = window.open(import.meta.env.VITE_TO_TEST_URL);
+  // newWindow.addEventListener("beforeunload", () => {
+  //   console.log("ddddddd");
+  // });
+};
 //连接地址
 const ws = ref(null);
 const addWebSocket = () => {
@@ -146,6 +177,15 @@ const changePop = () => {
 };
 onMounted(() => {
   addWebSocket();
+
+  // window.addEventListener("message", (event) => {
+  //   console.log("接收到了新窗口的消息", event);
+  //   // if (event.origin !== 'https://目标域名') return;  // 安全校验
+  //   // if (event.data.action === 'return') {
+  //   //   this.$router.go(-1);  // 返回上一页
+  //   // }
+  //   window.focus();
+  // });
 });
 onUnmounted(() => {
   ws.value.onclose();

+ 18 - 17
src/layout/components/header.vue

@@ -26,14 +26,14 @@
             @click="messageStatus = !messageStatus"
           />
         </div>
-        <div class="task">
-          <el-progress
-            :percentage="processCount"
-            :show-text="false"
-            :stroke-width="10"
-          />
-          <div class="process">任务进度: {{ processCount }}%</div>
-        </div>
+        <!--        <div class="task">-->
+        <!--          <el-progress-->
+        <!--            :percentage="processCount"-->
+        <!--            :show-text="false"-->
+        <!--            :stroke-width="10"-->
+        <!--          />-->
+        <!--          <div class="process">任务进度: {{ processCount }}%</div>-->
+        <!--        </div>-->
         <div>
           <div class="name">{{ userStore.user.username }}</div>
           <div class="work">{{ userStore.user.station }}</div>
@@ -43,15 +43,16 @@
           trigger="contextmenu"
           @command="handleCommand"
         >
-          <img
-            v-if="userStore.user.avatar"
-            :alt="userStore.user.avatar"
-            :src="userStore.user.avatar"
-            object-fit="cover"
-            style="width: 48px; height: 48px; border-radius: 24px"
-            @click="showClick"
-          />
-          <svg-icon v-else icon-class="head" size="48" @click="showClick" />
+          <!--          <img-->
+          <!--            v-if="userStore.user.avatar"-->
+          <!--            :alt="userStore.user.avatar"-->
+          <!--            :src="userStore.user.avatar"-->
+          <!--            object-fit="cover"-->
+          <!--            style="width: 48px; height: 48px; border-radius: 24px"-->
+          <!--            @click="showClick"-->
+          <!--          />-->
+
+          <svg-icon icon-class="head" size="48" @click="showClick" />
           <template #dropdown>
             <el-dropdown-menu style="width: 150px">
               <!--              <el-dropdown-item command="a">Action 1</el-dropdown-item>-->

+ 2 - 0
src/main.ts

@@ -19,6 +19,8 @@ import "animate.css";
 // avue
 import { setupEleAvue } from "@/plugins";
 
+window.name = "HJ-CLIENT-CF";
+
 const app = createApp(App);
 type Lod = {
   show: () => void;

+ 22 - 0
src/styles/index.scss

@@ -288,3 +288,25 @@
 .hiddenCanvasElement {
   display: none;
 }
+
+
+.display-row-sb {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  gap: 20px;
+}
+
+.display-row-start {
+  display: flex;
+  justify-content: start;
+  align-items: center;
+  gap: 20px;
+}
+
+.display-row-end {
+  display: flex;
+  justify-content: end;
+  align-items: center;
+  gap: 20px;
+}

+ 5 - 4
src/views/login/index.vue

@@ -182,7 +182,7 @@ const { height } = useWindowSize();
 
 const loginData = ref<LoginData>({
   userName: "admin",
-  password: "admin@123",
+  password: "123456",
 });
 
 const loginRules = computed?.(() => {
@@ -304,9 +304,10 @@ function handleLogin() {
           /*if (stationType == "5") {
             router.replace({ name: "PrepareMain" });
           } else {*/
-            router.replace({ name: "ProcessMain" });
-         /* }*/
-        }).catch(() => {
+          router.replace({ name: "ProcessMain" });
+          /* }*/
+        })
+        .catch(() => {
           // getCaptcha();
 
           console.log("catch");

+ 56 - 18
src/views/pro-steps/components/ceshishuju.vue

@@ -1,29 +1,34 @@
 <template>
   <div>
-    <div class="csTitle-header">
-      <el-button type="primary" @click="startTesting">开始测试</el-button>
-      <span>产品编码: {{ csObj?.materialName }}</span>
-      <span>产品名称: {{ csObj?.materialCode }}</span>
-      <span>测试人员: {{ csObj?.creator }}</span>
-      <span>测试时间: {{ csObj?.created }}</span>
+    <div class="display-row-sb">
+      <div class="display-row-start">
+        <el-button type="primary" @click="startTesting">开始测试</el-button>
+        <el-button type="primary" @click="getLastTestingData">刷新</el-button>
+      </div>
+      <div class="display-row-end">
+        <span>产品编码: {{ csObj?.materialName }}</span>
+        <span>产品名称: {{ csObj?.materialCode }}</span>
+        <span>测试人员: {{ csObj?.creator }}</span>
+        <span>测试时间: {{ csObj?.created }}</span>
+      </div>
     </div>
 
     <el-table :data="tableData" class="tableView-cssj">
       <el-table-column fixed prop="proName" label="测试项目" align="center" />
       <el-table-column fixed prop="name" label="测试名称" align="center" />
       <el-table-column fixed prop="value" label="测试值" align="center" />
-      <el-table-column prop="flag" align="center" label="是否合格">
-        <template #default="scope">
-          <span
-            :class="{
-              'red-text': scope.row.flag == 0,
-              'green-text': scope.row.writeData == 1,
-            }"
-          >
-            {{ scope.row.flag == 1 ? "合格" : "不合格" }}
-          </span>
-        </template>
-      </el-table-column>
+      <!--      <el-table-column prop="flag" align="center" label="是否合格">-->
+      <!--        <template #default="scope">-->
+      <!--          <span-->
+      <!--            :class="{-->
+      <!--              'red-text': scope.row.flag == 0,-->
+      <!--              'green-text': scope.row.writeData == 1,-->
+      <!--            }"-->
+      <!--            v-text="getFlagText(scope.row.flag)"-->
+      <!--          >-->
+      <!--          </span>-->
+      <!--        </template>-->
+      <!--      </el-table-column>-->
 
       <!--      <el-table-column label="操作" fixed="right" width="200">-->
       <!--        <template #default="scope">-->
@@ -88,6 +93,7 @@ import {
   addCSSJ,
   dataArrayList,
   deleteCSSJ,
+  getCSSJLastLogData,
   startCSSJTesting,
 } from "@/api/prosteps/ceshishuju";
 import { useProcessStore } from "@/store";
@@ -112,6 +118,19 @@ onMounted(() => {
 });
 
 const startTesting = () => {
+  const targetWindow = window.open(
+    import.meta.env.VITE_TO_TEST_URL,
+    "HJ-TEST-SYSTEM"
+  );
+
+  if (targetWindow) {
+    // 如果目标窗口已经打开,则会跳转到该窗口
+    targetWindow.focus();
+  } else {
+    // 如果目标窗口未打开,则会打开一个新的窗口
+    console.log("目标窗口未找到或被阻止");
+  }
+
   startCSSJTesting(store.scanInfo.id).then(() => {
     if (!emitter.all.has(EventsNames.TEST_DATA)) {
       emitter.on(EventsNames.TEST_DATA, (mesaage: any) => {
@@ -122,6 +141,13 @@ const startTesting = () => {
   });
 };
 
+const getLastTestingData = async () => {
+  let res: any = await getCSSJLastLogData();
+  if (res.data) {
+    tableData.value = res?.data || [];
+  }
+};
+
 onUnmounted(() => {
   if (emitter.all.has(EventsNames.TEST_DATA)) {
     emitter.off(EventsNames.TEST_DATA);
@@ -159,6 +185,18 @@ const handleDialogConfirm = () => {
 const handleDialogCancel = () => {
   dialogVisible.value = false;
 };
+
+const getFlagText = (flag: number) => {
+  let text = "";
+  if (flag == 1) {
+    text = "合格";
+  } else if (flag == -1) {
+    text = "";
+  } else {
+    text = "不合格";
+  }
+  return text;
+};
 </script>
 
 <style scoped lang="scss">