Browse Source

修改代码初步代码

plg 4 months ago
parent
commit
cfb5ad68ac

+ 1 - 1
nginx/logs/nginx.pid

@@ -1 +1 @@
-11772
+36364

+ 174 - 0
vue/package-lock.json

@@ -15,6 +15,7 @@
         "crypto-js": "^4.1.1",
         "element-plus": "^2.2.16",
         "jwchat": "^1.0.10",
+        "less": "^4.2.0",
         "vue": "^3.2.38",
         "vue-axios": "^3.4.1",
         "vue-router": "^4.1.5"
@@ -1187,6 +1188,17 @@
       "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==",
       "peer": true
     },
+    "node_modules/copy-anything": {
+      "version": "2.0.6",
+      "resolved": "https://registry.npmmirror.com/copy-anything/-/copy-anything-2.0.6.tgz",
+      "integrity": "sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==",
+      "dependencies": {
+        "is-what": "^3.14.1"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/mesqueeb"
+      }
+    },
     "node_modules/core-js": {
       "version": "2.6.12",
       "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
@@ -1313,6 +1325,18 @@
         "babel-runtime": "6.x"
       }
     },
+    "node_modules/errno": {
+      "version": "0.1.8",
+      "resolved": "https://registry.npmmirror.com/errno/-/errno-0.1.8.tgz",
+      "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==",
+      "optional": true,
+      "dependencies": {
+        "prr": "~1.0.1"
+      },
+      "bin": {
+        "errno": "cli.js"
+      }
+    },
     "node_modules/es5-ext": {
       "version": "0.10.62",
       "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz",
@@ -1866,6 +1890,12 @@
         "node": ">=4"
       }
     },
+    "node_modules/graceful-fs": {
+      "version": "4.2.11",
+      "resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz",
+      "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
+      "optional": true
+    },
     "node_modules/has": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
@@ -1900,6 +1930,30 @@
         "@babel/runtime": "^7.12.0"
       }
     },
+    "node_modules/iconv-lite": {
+      "version": "0.6.3",
+      "resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz",
+      "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
+      "optional": true,
+      "dependencies": {
+        "safer-buffer": ">= 2.1.2 < 3.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/image-size": {
+      "version": "0.5.5",
+      "resolved": "https://registry.npmmirror.com/image-size/-/image-size-0.5.5.tgz",
+      "integrity": "sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==",
+      "optional": true,
+      "bin": {
+        "image-size": "bin/image-size.js"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
     "node_modules/immer": {
       "version": "9.0.21",
       "resolved": "https://registry.npmjs.org/immer/-/immer-9.0.21.tgz",
@@ -1974,6 +2028,11 @@
       "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz",
       "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww=="
     },
+    "node_modules/is-what": {
+      "version": "3.14.1",
+      "resolved": "https://registry.npmmirror.com/is-what/-/is-what-3.14.1.tgz",
+      "integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA=="
+    },
     "node_modules/js-tokens": {
       "version": "4.0.0",
       "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -2042,6 +2101,31 @@
         "csstype": "^3.1.0"
       }
     },
+    "node_modules/less": {
+      "version": "4.2.0",
+      "resolved": "https://registry.npmmirror.com/less/-/less-4.2.0.tgz",
+      "integrity": "sha512-P3b3HJDBtSzsXUl0im2L7gTO5Ubg8mEN6G8qoTS77iXxXX4Hvu4Qj540PZDvQ8V6DmX6iXo98k7Md0Cm1PrLaA==",
+      "dependencies": {
+        "copy-anything": "^2.0.1",
+        "parse-node-version": "^1.0.1",
+        "tslib": "^2.3.0"
+      },
+      "bin": {
+        "lessc": "bin/lessc"
+      },
+      "engines": {
+        "node": ">=6"
+      },
+      "optionalDependencies": {
+        "errno": "^0.1.1",
+        "graceful-fs": "^4.1.2",
+        "image-size": "~0.5.0",
+        "make-dir": "^2.1.0",
+        "mime": "^1.4.1",
+        "needle": "^3.1.0",
+        "source-map": "~0.6.0"
+      }
+    },
     "node_modules/local-pkg": {
       "version": "0.4.3",
       "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz",
@@ -2123,6 +2207,19 @@
         "sourcemap-codec": "^1.4.8"
       }
     },
+    "node_modules/make-dir": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmmirror.com/make-dir/-/make-dir-2.1.0.tgz",
+      "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
+      "optional": true,
+      "dependencies": {
+        "pify": "^4.0.1",
+        "semver": "^5.6.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
     "node_modules/memoize-one": {
       "version": "6.0.0",
       "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz",
@@ -2150,6 +2247,18 @@
         "node": ">=8.6"
       }
     },
+    "node_modules/mime": {
+      "version": "1.6.0",
+      "resolved": "https://registry.npmmirror.com/mime/-/mime-1.6.0.tgz",
+      "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
+      "optional": true,
+      "bin": {
+        "mime": "cli.js"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
     "node_modules/mime-db": {
       "version": "1.52.0",
       "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
@@ -2222,6 +2331,22 @@
         "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
       }
     },
+    "node_modules/needle": {
+      "version": "3.3.1",
+      "resolved": "https://registry.npmmirror.com/needle/-/needle-3.3.1.tgz",
+      "integrity": "sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==",
+      "optional": true,
+      "dependencies": {
+        "iconv-lite": "^0.6.3",
+        "sax": "^1.2.4"
+      },
+      "bin": {
+        "needle": "bin/needle"
+      },
+      "engines": {
+        "node": ">= 4.4.x"
+      }
+    },
     "node_modules/next-tick": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
@@ -2252,6 +2377,14 @@
       "resolved": "https://registry.npmjs.org/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz",
       "integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw=="
     },
+    "node_modules/parse-node-version": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/parse-node-version/-/parse-node-version-1.0.1.tgz",
+      "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==",
+      "engines": {
+        "node": ">= 0.10"
+      }
+    },
     "node_modules/path-parse": {
       "version": "1.0.7",
       "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
@@ -2278,6 +2411,15 @@
         "node": ">=8.6"
       }
     },
+    "node_modules/pify": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmmirror.com/pify/-/pify-4.0.1.tgz",
+      "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
+      "optional": true,
+      "engines": {
+        "node": ">=6"
+      }
+    },
     "node_modules/pkg-types": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.2.tgz",
@@ -2315,6 +2457,12 @@
         "node": ">=6"
       }
     },
+    "node_modules/prr": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/prr/-/prr-1.0.1.tgz",
+      "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==",
+      "optional": true
+    },
     "node_modules/queue-microtask": {
       "version": "1.2.3",
       "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -2391,6 +2539,18 @@
         "queue-microtask": "^1.2.2"
       }
     },
+    "node_modules/safer-buffer": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz",
+      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+      "optional": true
+    },
+    "node_modules/sax": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npmmirror.com/sax/-/sax-1.4.1.tgz",
+      "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==",
+      "optional": true
+    },
     "node_modules/scroll-into-view-if-needed": {
       "version": "2.2.31",
       "resolved": "https://registry.npmjs.org/scroll-into-view-if-needed/-/scroll-into-view-if-needed-2.2.31.tgz",
@@ -2405,6 +2565,15 @@
       "integrity": "sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ==",
       "dev": true
     },
+    "node_modules/semver": {
+      "version": "5.7.2",
+      "resolved": "https://registry.npmmirror.com/semver/-/semver-5.7.2.tgz",
+      "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
+      "optional": true,
+      "bin": {
+        "semver": "bin/semver"
+      }
+    },
     "node_modules/slate": {
       "version": "0.72.8",
       "resolved": "https://registry.npmjs.org/slate/-/slate-0.72.8.tgz",
@@ -2525,6 +2694,11 @@
         "node": ">=8.0"
       }
     },
+    "node_modules/tslib": {
+      "version": "2.8.0",
+      "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.8.0.tgz",
+      "integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA=="
+    },
     "node_modules/type": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",

+ 1 - 0
vue/package.json

@@ -14,6 +14,7 @@
     "crypto-js": "^4.1.1",
     "element-plus": "^2.2.16",
     "jwchat": "^1.0.10",
+    "less": "^4.2.0",
     "vue": "^3.2.38",
     "vue-axios": "^3.4.1",
     "vue-router": "^4.1.5"

BIN
vue/src/assets/content/kedu.png


BIN
vue/src/assets/login/car.png


BIN
vue/src/assets/login/login_banner.png


BIN
vue/src/assets/login/login_banner1.png


BIN
vue/src/assets/login/login_left.png


BIN
vue/src/assets/login/password.png


BIN
vue/src/assets/login/user.png


+ 16 - 0
vue/src/router/index.js

@@ -22,6 +22,22 @@ const router = createRouter({
                     path: 'WangEditor',
                     component: () => import('../views/WangEditor.vue')
                 },
+                //车辆方向检测
+                {
+                    path: 'Direction',
+                    component: () => import('../views/Direction.vue')
+                },
+                //车辆分类检测
+                {
+                    path: 'Category',
+                    component: () => import('../views/Category.vue')
+                },
+                //车辆分类与方向检测
+                {
+                    path: 'DirectionAndCategory',
+                    component: () => import('../views/DirectionAndCategory.vue')
+                },
+                //历史记录
                 {
                     path: 'RecordList',
                     component: () => import('../views/RecordList.vue')

+ 2 - 2
vue/src/utils/http.js

@@ -9,9 +9,9 @@ const apiUrl = _baseUrl
 //axios配置
 // 设置接口响应时间
 axios.defaults.timeout = 120000
-axios.defaults.baseURL = 'http://localhost:8000' //
+// axios.defaults.baseURL = 'http://localhost:8000' //
 
-// axios.defaults.baseURL = 'http://10.113.248.3:8000' //
+axios.defaults.baseURL = 'http://10.113.248.3:8000' //
 // axios.defaults.baseURL = 'https://dcbt.jue-ming.com:8666' //
 // axios.defaults.baseURL = 'http://120.55.54.207:8666' //
 // axios.defaults.baseURL = '/api'

+ 249 - 0
vue/src/views/Category.vue

@@ -0,0 +1,249 @@
+<script lang="ts" setup>
+import { ref, onMounted, reactive } from "vue";
+import { ElMessage } from "element-plus";
+import { genFileId } from "element-plus";
+import axios from "axios";
+
+const leftDirection = ref("东");
+const rightDirection = ref("西");
+const directionList = ref<any>([
+  { value: "东", label: "东" },
+  { value: "西", label: "西" },
+  { value: "南", label: "南" },
+  { value: "北", label: "北" },
+]);
+const flag = ref<string>("");
+const disableFlag = ref<boolean>(false);
+const upload = ref<any>();
+
+const formData = ref<any>();
+
+const fileType = ref<string>("");
+
+const taskType = ref<string>("car_classification");
+
+//车辆类型
+const car_type = ref<string>("");
+//运动方向
+
+//文件的对象
+const currentFile = ref<any>();
+const uploadFile = (file: any) => {
+  currentFile.value = file.file;
+  let name = file.file.name;
+  let index = name.lastIndexOf(".");
+  fileType.value = name.substr(index + 1);
+  //   fileType.value = e.target.files[0].name;
+  //校验文件名字
+  if (!reType(fileType.value)) {
+    alert;
+    ElMessage({
+      message: "请选择正确的文件格式",
+      type: "error",
+    });
+    //清空选择的列表
+    upload.value.clearFiles();
+    currentFile.value = null;
+    fileType.value = "";
+    return;
+  }
+};
+const startFun = () => {
+  const formData = new FormData();
+  formData.append("file", currentFile.value);
+  formData.append("userName", name.value);
+  formData.append("fileType", fileType.value);
+  //第一个方向
+  //   formData.append("negativaDir", leftDirection.value);
+  //   //第二个方向
+  //   formData.append("positiveDir", rightDirection.value);
+
+  formData.append("taskType", taskType.value);
+  disableFlag.value = true;
+  axios
+    .post(`/v1/record/create`, formData)
+    .then((res) => {
+      console.log(res);
+      debugger;
+      //如果结果是返回的是正确的
+      if (res?.data?.code == 200) {
+        disableFlag.value = false;
+        flag.value = res.data.data;
+        //   chartList = arr2;
+        //开始调用 //查询记录详情
+        queryDetail();
+        //发送以后得到返回的id,然后一直启动轮询一直调接口
+      }
+    })
+    .catch((err) => {
+      disableFlag.value = false;
+    });
+  //   formData.append("userName", params.name);
+  //   formData.append("fileType", fileForma.value);
+};
+
+const queryDetail = () => {
+  axios.get(`/v1/record/${flag.value}/find`, {}).then((res) => {
+    if (res.data.code == 200) {
+      //当结果为空时
+      //   ElMessage({
+      //   message: `结果为${res.data.data.Result}`,
+      //   type: "error",
+      // });
+      car_type.value = res.data.data.Result;
+      if (res.data.data.Result == "") {
+        ElMessage({
+          message: `解析结果为空`,
+          type: "success",
+        });
+      }
+    }
+    // console.log(res.data.data.Result !== "");
+  });
+};
+const fileList = ref<any>([]);
+
+const name = ref<string>("");
+
+const reType = (val: string): boolean => {
+  if (
+    val == "json" ||
+    val == "txt" ||
+    val == "wav" ||
+    val == "npy" ||
+    val == "xls" ||
+    val == "xlsx" ||
+    val == "sql"
+  ) {
+    return true;
+  } else {
+    return false;
+  }
+};
+
+const handleExceed: any["onExceed"] = (files) => {
+  upload.value!.clearFiles();
+  const file = files[0] as any;
+  file.uid = genFileId();
+  upload.value!.handleStart(file);
+};
+
+onMounted(() => {
+  name.value = JSON.parse(sessionStorage.getItem("userInfo") ?? "{}")?.organName;
+});
+</script>
+<template>
+  <div class="out">
+    <p>车辆分类检测</p>
+    <div class="inner_content">
+      <div class="inner_first">
+        <div style="margin-bottom: 10px">选择文件</div>
+        <el-upload
+          ref="upload"
+          auto-upload="false"
+          class="upload-demo"
+          :on-change="handleChange"
+          :file-list="fileList"
+          drag
+          :limit="1"
+          :on-exceed="handleExceed"
+          action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
+          :http-request="uploadFile"
+        >
+          <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+          <div class="el-upload__text"><em>点击上传</em></div>
+          <template #tip>
+            <!-- <div class="el-upload__tip">jpg/png files with a size less than 500kb</div> -->
+          </template>
+        </el-upload>
+        <div style="margin-bottom: 10px" v-show="false">选择方向</div>
+        <div class="class_dre" v-show="false">
+          <el-select
+            v-model="leftDirection"
+            placeholder="Select"
+            size="large"
+            style="width: 70px"
+          >
+            <el-option
+              v-for="item in directionList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+              :disabled="item.value == rightDirection"
+            />
+          </el-select>
+          <img style="width: 350px" src="../assets/content/kedu.png" alt="" />
+          <el-select
+            v-model="rightDirection"
+            placeholder="Select"
+            size="large"
+            style="width: 70px"
+          >
+            <el-option
+              v-for="item in directionList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+              :disabled="item.value == leftDirection"
+            />
+          </el-select>
+        </div>
+        <div class="start_pg">
+          <el-button @click="startFun" :disabled="disableFlag">开始检测</el-button>
+        </div>
+        <div>检测结果:</div>
+        <div class="run_dir">
+          <div>车辆类别:</div>
+          <div class="run_input">{{ car_type }}</div>
+        </div>
+        <!-- <div class="run_dir">
+          <div>运动方向</div>
+          <div class="run_input">{{ direction_run }}</div>
+        </div> -->
+      </div>
+    </div>
+  </div>
+</template>
+<style scoped lang="less">
+.out {
+  height: 80vh;
+  display: flex;
+  flex-direction: column;
+  /* background-color: #F0F3FA; */
+}
+.inner_content {
+  display: flex;
+  justify-content: center;
+  width: 100%;
+  flex: 1;
+  .inner_first {
+    width: 500px;
+    .class_dre {
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+    }
+  }
+  /* background-color: #f0f3fa; */
+}
+.start_pg {
+  display: flex;
+  justify-content: end;
+  margin-top: 20px;
+}
+.run_dir {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-top: 20px;
+  .run_input {
+    margin-left: 20px;
+    word-break: break-all;
+    flex: 1;
+    border: 1px solid #d0d3d9;
+    height: 40px;
+    // line-height: 40px;
+    padding-left: 20px;
+  }
+}
+</style>

+ 250 - 0
vue/src/views/Direction.vue

@@ -0,0 +1,250 @@
+<script lang="ts" setup>
+import { ref, onMounted, reactive } from "vue";
+import { ElMessage } from "element-plus";
+import { genFileId } from "element-plus";
+import axios from "axios";
+
+const leftDirection = ref("东");
+const rightDirection = ref("西");
+const directionList = ref<any>([
+  { value: "东", label: "东" },
+  { value: "西", label: "西" },
+  { value: "南", label: "南" },
+  { value: "北", label: "北" },
+]);
+const flag = ref<string>("");
+const disableFlag = ref<boolean>(false);
+const upload = ref<any>();
+
+const formData = ref<any>();
+
+const fileType = ref<string>("");
+
+const taskType = ref<string>("car_direction");
+
+//车辆类型
+const car_type = ref<string>("");
+//运动方向
+
+//文件的对象
+const currentFile = ref<any>();
+const uploadFile = (file: any) => {
+  currentFile.value = file.file;
+  let name = file.file.name;
+  let index = name.lastIndexOf(".");
+  fileType.value = name.substr(index + 1);
+  //   fileType.value = e.target.files[0].name;
+  //校验文件名字
+  if (!reType(fileType.value)) {
+    alert;
+    ElMessage({
+      message: "请选择正确的文件格式",
+      type: "error",
+    });
+    //清空选择的列表
+    upload.value.clearFiles();
+    currentFile.value = null;
+    fileType.value = "";
+    return;
+  }
+};
+const startFun = () => {
+  const formData = new FormData();
+  formData.append("file", currentFile.value);
+  formData.append("userName", name.value);
+  formData.append("fileType", fileType.value);
+  //第一个方向
+  formData.append("negativaDir", leftDirection.value);
+  //第二个方向
+  formData.append("positiveDir", rightDirection.value);
+
+  formData.append("taskType", taskType.value);
+  disableFlag.value = true;
+  axios
+    .post(`/v1/record/create`, formData)
+    .then((res) => {
+      console.log(res);
+      debugger;
+      //如果结果是返回的是正确的
+      if (res?.data?.code == 200) {
+        disableFlag.value = false;
+        flag.value = res.data.data;
+        //   chartList = arr2;
+        //开始调用 //查询记录详情
+        queryDetail();
+        //发送以后得到返回的id,然后一直启动轮询一直调接口
+      }
+    })
+    .catch((err) => {
+      disableFlag.value = false;
+    });
+  //   formData.append("userName", params.name);
+  //   formData.append("fileType", fileForma.value);
+};
+
+const queryDetail = () => {
+  axios.get(`/v1/record/${flag.value}/find`, {}).then((res) => {
+    if (res.data.code == 200) {
+      //当结果为空时
+      //   ElMessage({
+      //   message: `结果为${res.data.data.Result}`,
+      //   type: "error",
+      // });
+      car_type.value = res.data.data.Result;
+      if (res.data.data.Result == "") {
+        ElMessage({
+          message: `解析结果为空`,
+          type: "success",
+        });
+      }
+
+   
+    }
+    // console.log(res.data.data.Result !== "");
+  });
+};
+const fileList = ref<any>([]);
+
+const name = ref<string>("");
+
+const reType = (val: string): boolean => {
+  if (
+    val == "json" ||
+    val == "txt" ||
+    val == "wav" ||
+    val == "npy" ||
+    val == "xls" ||
+    val == "xlsx" ||
+    val == "sql"
+  ) {
+    return true;
+  } else {
+    return false;
+  }
+};
+
+const handleExceed: any["onExceed"] = (files) => {
+  upload.value!.clearFiles();
+  const file = files[0] as any;
+  file.uid = genFileId();
+  upload.value!.handleStart(file);
+};
+
+onMounted(() => {
+  name.value = JSON.parse(sessionStorage.getItem("userInfo") ?? "{}")?.organName;
+});
+</script>
+<template>
+  <div class="out">
+    <p>车辆方向检测</p>
+    <div class="inner_content">
+      <div class="inner_first">
+        <div style="margin-bottom: 10px">选择文件</div>
+        <el-upload
+          ref="upload"
+          auto-upload="false"
+          class="upload-demo"
+          :on-change="handleChange"
+          :file-list="fileList"
+          drag
+          :limit="1"
+          :on-exceed="handleExceed"
+          action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
+          :http-request="uploadFile"
+        >
+          <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+          <div class="el-upload__text"><em>点击上传</em></div>
+          <template #tip>
+            <!-- <div class="el-upload__tip">jpg/png files with a size less than 500kb</div> -->
+          </template>
+        </el-upload>
+        <div style="margin-bottom: 10px">选择方向</div>
+        <div class="class_dre">
+          <el-select
+            v-model="leftDirection"
+            placeholder="Select"
+            size="large"
+            style="width: 70px"
+          >
+            <el-option
+              v-for="item in directionList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+              :disabled="item.value == rightDirection"
+            />
+          </el-select>
+          <img style="width: 350px" src="../assets/content/kedu.png" alt="" />
+          <el-select
+            v-model="rightDirection"
+            placeholder="Select"
+            size="large"
+            style="width: 70px"
+          >
+            <el-option
+              v-for="item in directionList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+              :disabled="item.value == leftDirection"
+            />
+          </el-select>
+        </div>
+        <div class="start_pg">
+          <el-button @click="startFun" :disabled="disableFlag">开始检测</el-button>
+        </div>
+        <div>检测结果</div>
+        <div class="run_dir">
+          <div>车辆方向:</div>
+          <div class="run_input">{{car_type }}</div>
+        </div>
+        <!-- <div class="run_dir">
+          <div>运动方向</div>
+          <div class="run_input">{{ direction_run }}</div>
+        </div> -->
+      </div>
+    </div>
+  </div>
+</template>
+<style scoped lang="less">
+.out {
+  height: 80vh;
+  display: flex;
+  flex-direction: column;
+  /* background-color: #F0F3FA; */
+}
+.inner_content {
+  display: flex;
+  justify-content: center;
+  width: 100%;
+  flex: 1;
+  .inner_first {
+    width: 500px;
+    .class_dre {
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+    }
+  }
+  /* background-color: #f0f3fa; */
+}
+.start_pg {
+  display: flex;
+  justify-content: end;
+  margin-top: 20px;
+}
+.run_dir {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-top: 20px;
+  .run_input {
+    margin-left: 20px;
+    flex: 1;
+    border: 1px solid #d0d3d9;
+    height: 40px;
+    word-break: break-all;
+    padding-left: 20px;
+  }
+}
+</style>

+ 266 - 0
vue/src/views/DirectionAndCategory.vue

@@ -0,0 +1,266 @@
+<script lang="ts" setup>
+import { ref, onMounted, reactive } from "vue";
+import { ElMessage } from "element-plus";
+import { genFileId } from "element-plus";
+import axios from "axios";
+
+const leftDirection = ref("东");
+const rightDirection = ref("西");
+const directionList = ref<any>([
+  { value: "东", label: "东" },
+  { value: "西", label: "西" },
+  { value: "南", label: "南" },
+  { value: "北", label: "北" },
+]);
+const flag = ref<string>("");
+const disableFlag = ref<boolean>(false);
+const upload = ref<any>();
+
+const formData = ref<any>();
+
+const fileType = ref<string>("");
+
+const taskType = ref<string>("class_direc");
+
+//车辆类型
+const car_type = ref<string>("");
+//运动方向
+const direction_run = ref<string>("");
+
+//文件的对象
+const currentFile = ref<any>();
+const uploadFile = (file: any) => {
+  currentFile.value = file.file;
+  let name = file.file.name;
+  let index = name.lastIndexOf(".");
+  fileType.value = name.substr(index + 1);
+  //   fileType.value = e.target.files[0].name;
+  //校验文件名字
+  if (!reType(fileType.value)) {
+    alert;
+    ElMessage({
+      message: "请选择正确的文件格式",
+      type: "error",
+    });
+    //清空选择的列表
+    upload.value.clearFiles();
+    currentFile.value = null;
+    fileType.value = "";
+    return;
+  }
+};
+const startFun = () => {
+  const formData = new FormData();
+  formData.append("file", currentFile.value);
+  formData.append("userName", name.value);
+  formData.append("fileType", fileType.value);
+  //第一个方向
+  formData.append("negativaDir", leftDirection.value);
+  //第二个方向
+  formData.append("positiveDir", rightDirection.value);
+
+  formData.append("taskType", taskType.value);
+  disableFlag.value = true;
+  axios
+    .post(`/v1/record/create`, formData)
+    .then((res) => {
+      console.log(res);
+      debugger;
+      //如果结果是返回的是正确的
+      if (res?.data?.code == 200) {
+        disableFlag.value = false;
+        flag.value = res.data.data;
+        //   chartList = arr2;
+        //开始调用 //查询记录详情
+        queryDetail();
+        //发送以后得到返回的id,然后一直启动轮询一直调接口
+      }
+    })
+    .catch((err) => {
+      disableFlag.value = false;
+    });
+  //   formData.append("userName", params.name);
+  //   formData.append("fileType", fileForma.value);
+};
+
+const queryDetail = () => {
+  axios.get(`/v1/record/${flag.value}/find`, {}).then((res) => {
+    if (res.data.code == 200) {
+      //当结果为空时
+      //   ElMessage({
+      //   message: `结果为${res.data.data.Result}`,
+      //   type: "error",
+      // });
+      car_type.value = res.data.data.Result;
+      direction_run.value = res.data.data.Result;
+      if (res.data.data.Result == "") {
+        ElMessage({
+          message: `解析结果为空`,
+          type: "success",
+        });
+      }else{
+        //查看是否包含;
+        //判断字符串中是否包含分号 ;
+        let a =res.data.data.Result;
+       
+        if( a.inclides(';')){
+            let b = res.data.data.Result
+            car_type.value = b[0];
+            direction_run.value =b[1];
+        }else{
+            car_type.value = res.data.data.Result;
+            direction_run.value = res.data.data.Result;
+        }
+
+       
+      }
+    }
+    // console.log(res.data.data.Result !== "");
+  });
+};
+const fileList = ref<any>([]);
+
+const name = ref<string>("");
+
+const reType = (val: string): boolean => {
+  if (
+    val == "json" ||
+    val == "txt" ||
+    val == "wav" ||
+    val == "npy" ||
+    val == "xls" ||
+    val == "xlsx" ||
+    val == "sql"
+  ) {
+    return true;
+  } else {
+    return false;
+  }
+};
+
+const handleExceed: any["onExceed"] = (files) => {
+  upload.value!.clearFiles();
+  const file = files[0] as any;
+  file.uid = genFileId();
+  upload.value!.handleStart(file);
+};
+
+onMounted(() => {
+  name.value = JSON.parse(sessionStorage.getItem("userInfo") ?? "{}")?.organName;
+});
+</script>
+<template>
+  <div class="out">
+    <p>车辆类别与方向检测</p>
+    <div class="inner_content">
+      <div class="inner_first">
+        <div style="margin-bottom: 10px">选择文件</div>
+        <el-upload
+          ref="upload"
+          auto-upload="false"
+          class="upload-demo"
+          :on-change="handleChange"
+          :file-list="fileList"
+          drag
+          :limit="1"
+          :on-exceed="handleExceed"
+          action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
+          :http-request="uploadFile"
+        >
+          <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+          <div class="el-upload__text"><em>点击上传</em></div>
+          <template #tip>
+            <!-- <div class="el-upload__tip">jpg/png files with a size less than 500kb</div> -->
+          </template>
+        </el-upload>
+        <div style="margin-bottom: 10px">选择方向</div>
+        <div class="class_dre">
+          <el-select
+            v-model="leftDirection"
+            placeholder="Select"
+            size="large"
+            style="width: 70px"
+          >
+            <el-option
+              v-for="item in directionList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+              :disabled="item.value == rightDirection"
+            />
+          </el-select>
+          <img style="width: 350px" src="../assets/content/kedu.png" alt="" />
+          <el-select
+            v-model="rightDirection"
+            placeholder="Select"
+            size="large"
+            style="width: 70px"
+          >
+            <el-option
+              v-for="item in directionList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+              :disabled="item.value == leftDirection"
+            />
+          </el-select>
+        </div>
+        <div class="start_pg">
+          <el-button @click="startFun" :disabled="disableFlag">开始检测</el-button>
+        </div>
+        <div></div>
+        <div class="run_dir">
+          <div>检测结果:</div>
+          <div class="run_input">{{ car_type }}</div>
+        </div>
+        <div class="run_dir">
+          <div>运动方向:</div>
+          <div class="run_input">{{ direction_run }}</div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<style scoped lang="less">
+.out {
+  height: 80vh;
+  display: flex;
+  flex-direction: column;
+  /* background-color: #F0F3FA; */
+}
+.inner_content {
+  display: flex;
+  justify-content: center;
+  width: 100%;
+  flex: 1;
+  .inner_first {
+    width: 500px;
+    .class_dre {
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+    }
+  }
+  /* background-color: #f0f3fa; */
+}
+.start_pg {
+  display: flex;
+  justify-content: end;
+  margin-top: 20px;
+}
+.run_dir {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-top: 20px;
+  .run_input {
+    word-break: break-all;
+    margin-left: 20px;
+    flex: 1;
+    border: 1px solid #d0d3d9;
+    height: 40px;
+    // line-height: 40px;
+    padding-left: 20px;
+  }
+}
+</style>

+ 29 - 3
vue/src/views/HelloWorld.vue

@@ -77,7 +77,7 @@
                 </el-icon>
                 <template #title>审核页面</template>
               </el-menu-item> -->
-              <el-menu-item index="/main/institutionManage" v-if="type == '1'">
+              <!-- <el-menu-item index="/main/institutionManage" v-if="type == '1'">
                 <el-icon>
                   <document />
                 </el-icon>
@@ -89,12 +89,38 @@
                   <document />
                 </el-icon>
                 <template #title>文件上传</template>
+              </el-menu-item> -->
+              <el-menu-item index="/main/Direction" v-if="type == '1'">
+                <el-icon>
+                  <document />
+                </el-icon>
+                <template #title>车辆方向检测</template>
+              </el-menu-item>
+
+              <el-menu-item index="/main/Category">
+                <el-icon>
+                  <document />
+                </el-icon>
+                <template #title>车辆分类检测</template>
               </el-menu-item>
+              <el-menu-item index="/main/DirectionAndCategory" v-if="type == '1'">
+                <el-icon>
+                  <document />
+                </el-icon>
+                <template #title>车辆分类与方向检测</template>
+              </el-menu-item>
+<!-- 
+              <el-menu-item index="/main/fileUpload">
+                <el-icon>
+                  <document />
+                </el-icon>
+                <template #title>文件上传</template>
+              </el-menu-item> -->
               <el-menu-item index="/main/recordList">
                 <el-icon>
                   <document />
                 </el-icon>
-                <template #title>上传记录</template>
+                <template #title>历史记录</template>
               </el-menu-item>
               <!-- <el-menu-item
                 v-if="userInfo.type === '0'"
@@ -141,7 +167,7 @@
                 <a href="javascript:;">Copyright© 北京决明科技有限公司</a>
               </li> -->
               <li>
-                <a href="javascript:;">Copyright©2023</a>
+                <a href="javascript:;">Copyright©2024</a>
               </li>
             </ul>
           </div>

+ 14 - 1
vue/src/views/RecordList.vue

@@ -19,8 +19,9 @@
   >
     <el-table-column prop="FileName" label="文件名称" />
     <el-table-column prop="FileType" label="文件类型" />
+    <el-table-column prop="TaskType" label="检测类型" :formatter='typeFunformatter' />
     <el-table-column prop="CreateTime" label="创建时间" />
-    <el-table-column prop="UserName" label="用户名" />
+    <!-- <el-table-column prop="UserName" label="用户名" /> -->
     <el-table-column prop="Result" label="解析结果" />
     <!-- <el-table-column fixed="right" label="操作" width="200" align="center">
       <template #default="scope">
@@ -110,6 +111,18 @@ let orginizeInfo = reactive({
 
 const ruleFormRef = ref();
 
+const typeFunformatter=(val:any)=>{
+  if(val.TaskType=='class_direc'){
+    return '车辆分类与方向检测'
+  }else if(val.TaskType=='car_direction'){
+    return '车辆方向检测'
+  }else if(val.TaskType=='car_classification '){
+    return '车辆分类检测'
+  }else{
+    return ''
+  }
+}
+
 const validateTel = (rule, value, callback) => {
   if (value === "") {
     callback(new Error("请输入联系电话"));

+ 122 - 23
vue/src/views/user/login.vue

@@ -2,15 +2,57 @@
   <div class="bg">
     <div class="content">
       <div class="wrap">
-        <div class="login_right">
+        <div class="new_mid">
+          <div class="new_mid_left">
+            <div class="new_mid_left_inner">
+              <div>车辆综合检测管理系统</div>
+              <img
+                style="width: 350px; margin-top: 40px"
+                src="../../assets/login/car.png"
+                alt=""
+              />
+            </div>
+          </div>
+          <div class="new_mid_right">
+            <div class="new_mid_right_inner">
+              <div>欢迎登录</div>
+              <el-input v-model="form.userName" placeholder="请输入账号" style="margin-top: 90px;margin-bottom:30px">
+                <template #prefix>
+                  <div class="new_us">
+                    <img style="width: 20px" src="../../assets/login/user.png" alt="" />
+                    <div class="new_mid_right_line"></div>
+                  </div>
+                </template>
+              </el-input>
+              <el-input
+                v-model="form.password"
+                @keyup.enter.native="onSubmit"
+                placeholder="请输入密码"
+                show-password
+              >
+                <template #prefix>
+                  <div class="new_us">
+                    <img style="width: 20px;" src="../../assets/login/password.png" alt="" />
+                    <div class="new_mid_right_line"></div>
+                  </div>
+                </template>
+              </el-input>
+
+              <p style="margin-top: 10px;text-align: center;margin-top:80px">
+              <el-button class="login_btn" type="primary" @click="onSubmit"
+                >登录</el-button
+              >
+            </p>
+
+            </div>
+          </div>
+        </div>
+        <!-- <div class="login_right">
           <div class="login_box">
             <div class="login_line"><em></em><span>请登录</span><em></em></div>
             <p>
               <span>账号</span
-              ><el-input
-                v-model="form.userName"
-                placeholder="请输入账号"
-              ></el-input>
+              ><el-input v-model="form.userName" placeholder="请输入账号"></el-input>
             </p>
             <p>
               <span>密码</span
@@ -21,26 +63,19 @@
                 show-password
               ></el-input>
             </p>
-            <el-radio-group v-model="type">
-              <el-radio :label="0">普通用户</el-radio>
-              <el-radio :label="1">管理员</el-radio>
-            </el-radio-group>
-            <div class="goRegister">
-              <!-- <span @click="registShow = true">没有账号去注册?</span>
-                            <span @click="forgetPsd = true">忘记密码?</span> -->
-            </div>
+            <div class="goRegister"></div>
             <p style="margin-top: 10px">
               <el-button class="login_btn" type="primary" @click="onSubmit"
                 >登录</el-button
               >
             </p>
           </div>
-        </div>
+        </div> -->
       </div>
     </div>
   </div>
 </template>
-  
+
 <script lang="ts" setup type="module">
 import { ref, reactive } from "vue";
 import { useRouter } from "vue-router";
@@ -50,7 +85,7 @@ import { ElMessage } from "element-plus";
 
 const router = useRouter();
 
-const type = ref(0);
+const type = ref(1);
 // do not use same name with ref
 const form = reactive({
   userName: "",
@@ -91,14 +126,22 @@ const onSubmit = () => {
       }
     })
     .catch((err) => {
+      debugger;
       ElMessage({
-        message: "账号或密码不正确",
+        message: "账号或密码错误",
         type: "error",
       });
     });
 };
 </script>
 <style scoped>
+.new_mid_right_inner>>>.el-input__wrapper  {
+  border-radius: 40px;
+  background-color: #F7F7F7;
+  border: 0px ;
+  box-shadow:none;
+}
+
 .bg {
   width: 100%;
   display: flex;
@@ -115,12 +158,54 @@ const onSubmit = () => {
 
 .content .wrap {
   display: flex;
-  width: 1200px;
+  width: 100%;
   margin: 0 auto;
-  justify-content: space-between;
+  justify-content: center;
+  align-items: center;
   position: relative;
+  height: 100vh;
+}
+.new_mid {
+  height: 500px;
+  width: 960px;
+  /* background-color: #101010; */
+  display: flex;
+  border-radius: 20px;
+}
+.new_mid_left {
+  /* background-color: #b7b7b7; */
+  background: url(../../assets/login/login_left.png) no-repeat;
+  background-size: 100% 100%;
+  display: flex;
+  flex: 1;
+  border-top-left-radius: 20px;
+  border-bottom-left-radius: 20px;
+}
+.new_mid_right {
+  background-color: #ffffff;
+  display: flex;
+  border-top-right-radius: 20px;
+  border-bottom-right-radius: 20px;
+  flex: 1;
+  /* box-sizing: border-box; */
+  /* padding:100px; */
+}
+.new_mid_left_inner {
+  padding: 40px 40px;
+  font-size: 26px;
+  letter-spacing: 3px;
+  font-weight: 700;
+  text-align: center;
+  display: block;
+  width: 100%;
 }
 
+.new_mid_right_inner {
+  padding: 40px 40px;
+  font-size: 26px;
+  letter-spacing: 3px;
+  font-weight: 700;
+}
 .login_banner {
   margin: 97px 0 0 55px;
 }
@@ -213,9 +298,9 @@ const onSubmit = () => {
 }
 
 .login_btn {
-  width: 298px;
-  height: 42px;
-  background: rgb(87, 172, 187);
+  width: 200px;
+  height: 35px;
+  background: #0425FA;
   opacity: 1;
   border-radius: 22px;
 }
@@ -224,4 +309,18 @@ const onSubmit = () => {
   width: 100%;
   height: 100%;
 }
-</style>
+.new_mid_right_line {
+  height: 30px;
+  width: 1px;
+  background-color: #E9E9E9;
+  margin-left:10px;
+  margin-right:10px;
+}
+.new_us{
+  padding-left:6px;
+  height: 50px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+</style>