diff --git a/frontend/matrix-middle-service-web/index.html b/frontend/matrix-middle-service-web/index.html
index 143557b..f6911f3 100644
--- a/frontend/matrix-middle-service-web/index.html
+++ b/frontend/matrix-middle-service-web/index.html
@@ -5,6 +5,13 @@
Vite + Vue + TS
+
diff --git a/frontend/matrix-middle-service-web/package.json b/frontend/matrix-middle-service-web/package.json
index 2ad72f7..144ab97 100644
--- a/frontend/matrix-middle-service-web/package.json
+++ b/frontend/matrix-middle-service-web/package.json
@@ -11,7 +11,10 @@
"build-storybook": "storybook build"
},
"dependencies": {
+ "@amap/amap-jsapi-loader": "^1.0.1",
"@quasar/extras": "^1.15.11",
+ "axios": "^1.3.4",
+ "moment": "^2.29.4",
"pinia": "^2.0.30",
"quasar": "^2.11.5",
"vue": "^3.2.45",
diff --git a/frontend/matrix-middle-service-web/src/App.vue b/frontend/matrix-middle-service-web/src/App.vue
index b3e89cb..2b9c6e4 100644
--- a/frontend/matrix-middle-service-web/src/App.vue
+++ b/frontend/matrix-middle-service-web/src/App.vue
@@ -1,30 +1,5 @@
-
-
-
-
+
-
diff --git a/frontend/matrix-middle-service-web/src/api/index.ts b/frontend/matrix-middle-service-web/src/api/index.ts
new file mode 100644
index 0000000..b3eb39a
--- /dev/null
+++ b/frontend/matrix-middle-service-web/src/api/index.ts
@@ -0,0 +1,8 @@
+import {getAxiosInstance} from "matrix-middle-service-web/src/api/utils";
+
+export const http = getAxiosInstance({
+ baseURL: "/api",
+ timeout: 30 * 1000
+})
+
+export default http;
diff --git a/frontend/matrix-middle-service-web/src/api/record/index.ts b/frontend/matrix-middle-service-web/src/api/record/index.ts
new file mode 100644
index 0000000..f96cedb
--- /dev/null
+++ b/frontend/matrix-middle-service-web/src/api/record/index.ts
@@ -0,0 +1,3 @@
+export const record = {
+ getLocationRecord: "/record/location/get"
+}
diff --git a/frontend/matrix-middle-service-web/src/api/utils.ts b/frontend/matrix-middle-service-web/src/api/utils.ts
new file mode 100644
index 0000000..6d3c6cd
--- /dev/null
+++ b/frontend/matrix-middle-service-web/src/api/utils.ts
@@ -0,0 +1,65 @@
+import axios, {AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig} from "axios";
+import {useQuasar} from "quasar";
+export function getAxiosInstance(axiosRequestConfig: AxiosRequestConfig): AxiosInstance {
+ let instance = axios.create(axiosRequestConfig);
+ // 全局 请求拦截器
+ instance.interceptors.request.use(async (config: InternalAxiosRequestConfig) => {
+ let headers = config.headers || {}
+ return config;
+ })
+ // 全局 响应拦截器
+ instance.interceptors.response.use(successCB, rejectCB);
+ return instance;
+}
+
+
+// 请求成功回调
+export function successCB(response: AxiosResponse | Promise): AxiosResponse | Promise {
+ function processResponse(response: AxiosResponse) {
+ if (response.status === 200) { // 响应成功
+ if (response.data.code === 401) {
+ const $q = useQuasar()
+ $q.notify({
+ position: "top",
+ color: 'negative',
+ message: "登录状态失效, 请重新登录",
+ icon: 'report_problem'
+ })
+ console.log(response,response.data.msg)
+ } else if (response.data.code === 403) {
+ setTimeout(() => {
+ console.log(response,response.data.msg)
+ }, 0)
+ }
+ return response;
+ } else {
+ return Promise.reject(response);
+ }
+ }
+
+ if (response instanceof Promise) {
+ let resp: AxiosResponse
+ return new Promise((resolve)=>{
+ response.then((r: AxiosResponse) => {
+ resp = r;
+ resolve(processResponse(resp))
+ });
+ })
+ } else {
+ return processResponse(response);
+ }
+}
+
+// 请求失败回调
+export function rejectCB(error: any): any {
+ let response = error.response
+ if(response.status === 401){
+ return response;
+ } else if(response.status === 403){
+ setTimeout(() => {
+ console.log(response.data.msg)
+ }, 0)
+ return response;
+ }
+ return Promise.reject(error);
+}
diff --git a/frontend/matrix-middle-service-web/src/components/DateTimeSelector.vue b/frontend/matrix-middle-service-web/src/components/DateTimeSelector.vue
new file mode 100644
index 0000000..cd8434a
--- /dev/null
+++ b/frontend/matrix-middle-service-web/src/components/DateTimeSelector.vue
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ date }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ date.from }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ date.to }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/matrix-middle-service-web/src/components/HelloWorld.vue b/frontend/matrix-middle-service-web/src/components/HelloWorld.vue
index 00571f1..c7dbdd7 100644
--- a/frontend/matrix-middle-service-web/src/components/HelloWorld.vue
+++ b/frontend/matrix-middle-service-web/src/components/HelloWorld.vue
@@ -1,9 +1,16 @@
diff --git a/frontend/matrix-middle-service-web/src/main.ts b/frontend/matrix-middle-service-web/src/main.ts
index 6ac3e1b..75d1aa2 100644
--- a/frontend/matrix-middle-service-web/src/main.ts
+++ b/frontend/matrix-middle-service-web/src/main.ts
@@ -21,6 +21,8 @@ import Store from "matrix-middle-service-web/src/stores";
import Router from "matrix-middle-service-web/src/router";
let app = createApp(App);
+app.use(Store())
+app.use(Router())
app.use(Quasar, {
plugins: {}, // import Quasar plugins and add here
lang: quasarLang,
@@ -37,8 +39,4 @@ app.use(Quasar, {
}
*/
})
-
-app.use(Store)
-app.use(Router)
-
app.mount('#app')
diff --git a/frontend/matrix-middle-service-web/src/router/index.ts b/frontend/matrix-middle-service-web/src/router/index.ts
index 781bd03..23cab16 100644
--- a/frontend/matrix-middle-service-web/src/router/index.ts
+++ b/frontend/matrix-middle-service-web/src/router/index.ts
@@ -1,9 +1,6 @@
-import {
- createRouter,
- createWebHashHistory,
-} from 'vue-router';
+import {createRouter, createWebHistory,} from 'vue-router';
-import routes from './routes';
+import routes from 'matrix-middle-service-web/src/router/routes';
/*
* If not building with SSR mode, you can
@@ -15,17 +12,15 @@ import routes from './routes';
*/
export default function Router(/* { store, ssrContext } */) {
- const createHistory = createWebHashHistory;
+ const createHistory = createWebHistory;
- const Router = createRouter({
+ return createRouter({
scrollBehavior: () => ({left: 0, top: 0}),
routes,
// Leave this as is and make changes in quasar.conf.js instead!
// quasar.conf.js -> build -> vueRouterMode
// quasar.conf.js -> build -> publicPath
- history: createHistory("/"),
+ history: createHistory("./"),
});
-
- return Router;
};
diff --git a/frontend/matrix-middle-service-web/src/router/routes.ts b/frontend/matrix-middle-service-web/src/router/routes.ts
index 3f84b33..0c096b0 100644
--- a/frontend/matrix-middle-service-web/src/router/routes.ts
+++ b/frontend/matrix-middle-service-web/src/router/routes.ts
@@ -3,7 +3,7 @@ import { RouteRecordRaw } from 'vue-router';
const routes: RouteRecordRaw[] = [
{
path: '/',
- component: () => import('matrix-middle-service-web/src/components/HelloWorld.vue'),
+ component: () => import('matrix-middle-service-web/src/views/record/AMapLocation.vue'),
},
];
diff --git a/frontend/matrix-middle-service-web/src/style.css b/frontend/matrix-middle-service-web/src/style.css
index 7294765..297ba86 100644
--- a/frontend/matrix-middle-service-web/src/style.css
+++ b/frontend/matrix-middle-service-web/src/style.css
@@ -60,9 +60,7 @@ button:focus-visible {
}
#app {
- max-width: 1280px;
margin: 0 auto;
- padding: 2rem;
text-align: center;
}
diff --git a/frontend/matrix-middle-service-web/src/views/record/AMapLocation.vue b/frontend/matrix-middle-service-web/src/views/record/AMapLocation.vue
new file mode 100644
index 0000000..a36bf96
--- /dev/null
+++ b/frontend/matrix-middle-service-web/src/views/record/AMapLocation.vue
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/matrix-middle-service-web/vite.config.ts b/frontend/matrix-middle-service-web/vite.config.ts
index 8c6d491..fd7ad07 100644
--- a/frontend/matrix-middle-service-web/vite.config.ts
+++ b/frontend/matrix-middle-service-web/vite.config.ts
@@ -8,7 +8,13 @@ export default defineConfig({
base: "./",
server: {
strictPort: true,
- port: 7868
+ port: 7868,
+ proxy:{
+ "^/api/.*":{
+ target: "http://10.10.10.100:6573/",
+ rewrite: (path) => path.replace(/^\/api\//, ''),
+ },
+ }
},
resolve: {
alias: {
diff --git a/frontend/matrix-middle-service-web/yarn.lock b/frontend/matrix-middle-service-web/yarn.lock
index 5e5560c..c898fdb 100644
--- a/frontend/matrix-middle-service-web/yarn.lock
+++ b/frontend/matrix-middle-service-web/yarn.lock
@@ -5,6 +5,13 @@ __metadata:
version: 6
cacheKey: 8
+"@amap/amap-jsapi-loader@npm:^1.0.1":
+ version: 1.0.1
+ resolution: "@amap/amap-jsapi-loader@npm:1.0.1"
+ checksum: 9fedc17818b5ab07527340a2e6a50546069a3ec27589a0a504b3c524dc33c26757a34486e65fc3d2a926537b2699912ff9f6e0c336685bb8f7e599995c1002f8
+ languageName: node
+ linkType: hard
+
"@ampproject/remapping@npm:^2.2.0":
version: 2.2.0
resolution: "@ampproject/remapping@npm:2.2.0"
@@ -3695,6 +3702,17 @@ __metadata:
languageName: node
linkType: hard
+"axios@npm:^1.3.4":
+ version: 1.3.4
+ resolution: "axios@npm:1.3.4"
+ dependencies:
+ follow-redirects: ^1.15.0
+ form-data: ^4.0.0
+ proxy-from-env: ^1.1.0
+ checksum: 7440edefcf8498bc3cdf39de00443e8101f249972c83b739c6e880d9d669fea9486372dbe8739e88b3bf8bb1ad15f6106693f206f078f4516fe8fd47b1c3093c
+ languageName: node
+ linkType: hard
+
"babel-core@npm:^7.0.0-bridge.0":
version: 7.0.0-bridge.0
resolution: "babel-core@npm:7.0.0-bridge.0"
@@ -5276,6 +5294,16 @@ __metadata:
languageName: node
linkType: hard
+"follow-redirects@npm:^1.15.0":
+ version: 1.15.2
+ resolution: "follow-redirects@npm:1.15.2"
+ peerDependenciesMeta:
+ debug:
+ optional: true
+ checksum: faa66059b66358ba65c234c2f2a37fcec029dc22775f35d9ad6abac56003268baf41e55f9ee645957b32c7d9f62baf1f0b906e68267276f54ec4b4c597c2b190
+ languageName: node
+ linkType: hard
+
"for-each@npm:^0.3.3":
version: 0.3.3
resolution: "for-each@npm:0.3.3"
@@ -5296,6 +5324,17 @@ __metadata:
languageName: node
linkType: hard
+"form-data@npm:^4.0.0":
+ version: 4.0.0
+ resolution: "form-data@npm:4.0.0"
+ dependencies:
+ asynckit: ^0.4.0
+ combined-stream: ^1.0.8
+ mime-types: ^2.1.12
+ checksum: 01135bf8675f9d5c61ff18e2e2932f719ca4de964e3be90ef4c36aacfc7b9cb2fceb5eca0b7e0190e3383fe51c5b37f4cb80b62ca06a99aaabfcfd6ac7c9328c
+ languageName: node
+ linkType: hard
+
"forwarded@npm:0.2.0":
version: 0.2.0
resolution: "forwarded@npm:0.2.0"
@@ -6862,6 +6901,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "matrix-middle-service-web@workspace:."
dependencies:
+ "@amap/amap-jsapi-loader": ^1.0.1
"@babel/core": ^7.21.0
"@quasar/extras": ^1.15.11
"@quasar/vite-plugin": ^1.3.0
@@ -6876,7 +6916,9 @@ __metadata:
"@storybook/vue3-vite": ^7.0.0-beta.54
"@vitejs/plugin-vue": ^4.0.0
autoprefixer: latest
+ axios: ^1.3.4
babel-loader: ^8.3.0
+ moment: ^2.29.4
pinia: ^2.0.30
postcss: latest
quasar: ^2.11.5
@@ -7611,6 +7653,13 @@ __metadata:
languageName: node
linkType: hard
+"moment@npm:^2.29.4":
+ version: 2.29.4
+ resolution: "moment@npm:2.29.4"
+ checksum: 0ec3f9c2bcba38dc2451b1daed5daded747f17610b92427bebe1d08d48d8b7bdd8d9197500b072d14e326dd0ccf3e326b9e3d07c5895d3d49e39b6803b76e80e
+ languageName: node
+ linkType: hard
+
"mri@npm:^1.1.0, mri@npm:^1.2.0":
version: 1.2.0
resolution: "mri@npm:1.2.0"
@@ -8414,7 +8463,7 @@ __metadata:
languageName: node
linkType: hard
-"proxy-from-env@npm:^1.0.0":
+"proxy-from-env@npm:^1.0.0, proxy-from-env@npm:^1.1.0":
version: 1.1.0
resolution: "proxy-from-env@npm:1.1.0"
checksum: ed7fcc2ba0a33404958e34d95d18638249a68c430e30fcb6c478497d72739ba64ce9810a24f53a7d921d0c065e5b78e3822759800698167256b04659366ca4d4