@@ -299,6 +276,7 @@ import { request } from "../../../../shared/utils/request";
const router = useRouter();
const route = useRoute();
+// 组件挂载时获取数据
const yhzDetail = ref({}); // 养护站详情数据
const INIT_FORM = reactive({
event: {
@@ -323,10 +301,6 @@ const INIT_FORM = reactive({
inputManpower: null, // 投入人力
inputFunds: null, // 投入资金
inputEquipment: null, // 投入设备
- snowMeltingAgent: null, // 融雪剂
- sandbags: null, // 麻袋
- antiSlipSand: null, // 防滑沙
- antiSlipChains: null, // 防滑链
createTime: "", // 创建时间
updateTime: "", // 更新时间
},
@@ -338,6 +312,7 @@ const INIT_FORM = reactive({
createTime: "", // 创建时间
updateTime: "", // 更新时间
},
+ yhzMaterialList: [], // 养护站物资列表
photos: [],
});
const form = reactive({ ...INIT_FORM });
@@ -379,6 +354,12 @@ const onClickLeft = () => {
});
};
+// 打开添加物资弹窗
+const handleOpenAddMaterial = () => {
+ console.log("打开添加物资弹窗");
+}
+
+
const handleAdd = () => {
console.log("form", toRaw(form));
};
@@ -460,6 +441,11 @@ const handleDelete = (file) => {
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
+.add-wzbtn {
+ width: calc(100% - 32px);
+ margin: 10px 16px;
+}
+
.add-btn {
position: fixed;
bottom: 20px;
diff --git a/packages/screen/src/component/MenuBar/index.js b/packages/screen/src/component/MenuBar/index.js
index 66f508b..2ba4b32 100644
--- a/packages/screen/src/component/MenuBar/index.js
+++ b/packages/screen/src/component/MenuBar/index.js
@@ -1,4 +1,4 @@
-import { h, ref, onMounted, reactive, watch, toRaw, nextTick } from "vue";
+import { h, ref, onMounted, reactive, watch, toRaw, nextTick, onUnmounted } from "vue";
import { request } from "@/utils/request";
import { Search } from "@element-plus/icons-vue";
import { useRoute, useRouter } from 'vue-router'
@@ -29,7 +29,6 @@ const getMenuList = async () => {
export default () => {
// 点击菜单处理
- const router = useRouter();
const handleMenuClick = (menu) => {
console.log('menu', menu)
if (menu.path) {
@@ -39,18 +38,31 @@ export default () => {
}
};
- onMounted(async () => {
- await getMenuList();
- const firstMenuItem = menuList.value[0]?.children?.[0];
- if (firstMenuItem) {
- handleMenuClick(firstMenuItem);
+ const router = useRouter();
+ const tokenRef = ref(localStorage.getItem('token'));
+ watch(tokenRef, async (newVal) => {
+ if (newVal) {
+ await getMenuList();
+ const firstMenuItem = menuList.value[0]?.children?.[0];
+ if (firstMenuItem) {
+ handleMenuClick(firstMenuItem);
+ }
}
- })
+ }, { immediate: true });
+ const handleStorageChange = (e) => {
+ if (e.key === 'token') {
+ tokenRef.value = e.newValue;
+ }
+ };
+ onMounted(() => {
+ window.addEventListener('storage', handleStorageChange);
+ });
+ onUnmounted(() => {
+ window.removeEventListener('storage', handleStorageChange);
+ });
return {
menuList,
handleMenuClick,
-
-
}
};
\ No newline at end of file
diff --git a/packages/screen/src/utils/request.js b/packages/screen/src/utils/request.js
index 14dac79..51ae450 100644
--- a/packages/screen/src/utils/request.js
+++ b/packages/screen/src/utils/request.js
@@ -8,8 +8,8 @@ const service = axios.create({
// 请求拦截器
service.interceptors.request.use(config => {
// 暂时先写死token 实际项目中再调整token的获取位置
- const token = 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VySWQiOjE5ODY2ODgzMjY1MjAwNTc4NTcsImFjY291bnQiOiJieHp0IiwidXVpZCI6Ijc5Zjk5NWE0LTAyNGEtNDA3My04YjVhLTIxNGI4MDBmNmQ1YyIsInJlbWVtYmVyTWUiOnRydWUsImV4cGlyYXRpb25EYXRlIjoxNzYyODUxOTg2OTI1LCJvdGhlcnMiOm51bGwsInN1YiI6IjE5ODY2ODgzMjY1MjAwNTc4NTciLCJpYXQiOjE3NjI4MjMxODYsImV4cCI6MTc2Mjg1MTk4Nn0.nZziqdUarLN1uRfs1pBRrBt-HxqBOGJy67HwaAbIiY7uSv-q9kzfiec7Djd1jkV_OnzhW3jN8h-pl8ILCFl0HA'
- // const token = localStorage.getItem('token');
+ // const token = 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VySWQiOjE5ODY2ODgzMjY1MjAwNTc4NTcsImFjY291bnQiOiJieHp0IiwidXVpZCI6Ijc5Zjk5NWE0LTAyNGEtNDA3My04YjVhLTIxNGI4MDBmNmQ1YyIsInJlbWVtYmVyTWUiOnRydWUsImV4cGlyYXRpb25EYXRlIjoxNzYyODUxOTg2OTI1LCJvdGhlcnMiOm51bGwsInN1YiI6IjE5ODY2ODgzMjY1MjAwNTc4NTciLCJpYXQiOjE3NjI4MjMxODYsImV4cCI6MTc2Mjg1MTk4Nn0.nZziqdUarLN1uRfs1pBRrBt-HxqBOGJy67HwaAbIiY7uSv-q9kzfiec7Djd1jkV_OnzhW3jN8h-pl8ILCFl0HA'
+ const token = localStorage.getItem('token');
if (token) {
config.headers.Authorization = `${token}`;
}
diff --git a/packages/screen/src/views/Home.vue b/packages/screen/src/views/Home.vue
index a099b55..2a1280a 100644
--- a/packages/screen/src/views/Home.vue
+++ b/packages/screen/src/views/Home.vue
@@ -1,101 +1,18 @@
-
-
-
-
-
-
-
左侧图表1
-
-
-
左侧图表2
-
-
-
-
-
-
-
-
右侧图表1
-
-
-
右侧图表2
-
-
-
-
+
-
From de2f66773915c67c6c34f3e281bfe20e11366589 Mon Sep 17 00:00:00 2001
From: huangchenhao <123673748@qq.com>
Date: Tue, 11 Nov 2025 14:34:38 +0800
Subject: [PATCH 4/6] +
---
packages/screen/src/utils/request.js | 2 --
1 file changed, 2 deletions(-)
diff --git a/packages/screen/src/utils/request.js b/packages/screen/src/utils/request.js
index 51ae450..c857a76 100644
--- a/packages/screen/src/utils/request.js
+++ b/packages/screen/src/utils/request.js
@@ -7,8 +7,6 @@ const service = axios.create({
// 请求拦截器
service.interceptors.request.use(config => {
- // 暂时先写死token 实际项目中再调整token的获取位置
- // const token = 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VySWQiOjE5ODY2ODgzMjY1MjAwNTc4NTcsImFjY291bnQiOiJieHp0IiwidXVpZCI6Ijc5Zjk5NWE0LTAyNGEtNDA3My04YjVhLTIxNGI4MDBmNmQ1YyIsInJlbWVtYmVyTWUiOnRydWUsImV4cGlyYXRpb25EYXRlIjoxNzYyODUxOTg2OTI1LCJvdGhlcnMiOm51bGwsInN1YiI6IjE5ODY2ODgzMjY1MjAwNTc4NTciLCJpYXQiOjE3NjI4MjMxODYsImV4cCI6MTc2Mjg1MTk4Nn0.nZziqdUarLN1uRfs1pBRrBt-HxqBOGJy67HwaAbIiY7uSv-q9kzfiec7Djd1jkV_OnzhW3jN8h-pl8ILCFl0HA'
const token = localStorage.getItem('token');
if (token) {
config.headers.Authorization = `${token}`;
From 43527ab2d2b2a1b730672013a337cefdd1fa9c5e Mon Sep 17 00:00:00 2001
From: huangchenhao <123673748@qq.com>
Date: Tue, 11 Nov 2025 14:51:55 +0800
Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=E5=91=98?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E6=97=B6=20=E5=A6=82=E6=9E=9C=E6=9C=AA?=
=?UTF-8?q?=E8=BE=93=E5=85=A5=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6=20?=
=?UTF-8?q?=E5=88=99=E4=B8=8D=E6=9F=A5=E8=AF=A2=E4=BB=BB=E4=BD=95=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../views/EquipmentManagement/addDialog.vue | 6 +++-
.../EquipmentManagement/detailDialog.vue | 36 +++++++++----------
.../views/EquipmentManagement/editDialog.vue | 6 +++-
.../src/views/EquipmentManagement/index.js | 6 ++--
.../src/views/EquipmentManagement/index.vue | 1 +
.../views/MaterialManagement/detailDialog.vue | 20 +++++------
.../src/views/MaterialManagement/index.js | 6 ++--
.../component/addDialog.vue | 12 +++----
.../ServiceStationManagePage/personData.vue | 3 --
9 files changed, 51 insertions(+), 45 deletions(-)
diff --git a/packages/screen/src/views/EquipmentManagement/addDialog.vue b/packages/screen/src/views/EquipmentManagement/addDialog.vue
index 6fd5a4d..19c47d7 100644
--- a/packages/screen/src/views/EquipmentManagement/addDialog.vue
+++ b/packages/screen/src/views/EquipmentManagement/addDialog.vue
@@ -53,7 +53,11 @@
-
+
+
+
+
+
diff --git a/packages/screen/src/views/EquipmentManagement/detailDialog.vue b/packages/screen/src/views/EquipmentManagement/detailDialog.vue
index 3fecff9..202eda0 100644
--- a/packages/screen/src/views/EquipmentManagement/detailDialog.vue
+++ b/packages/screen/src/views/EquipmentManagement/detailDialog.vue
@@ -8,60 +8,60 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/packages/screen/src/views/EquipmentManagement/editDialog.vue b/packages/screen/src/views/EquipmentManagement/editDialog.vue
index c44db15..d941801 100644
--- a/packages/screen/src/views/EquipmentManagement/editDialog.vue
+++ b/packages/screen/src/views/EquipmentManagement/editDialog.vue
@@ -53,7 +53,11 @@
-
+
+
+
+
+
diff --git a/packages/screen/src/views/EquipmentManagement/index.js b/packages/screen/src/views/EquipmentManagement/index.js
index 6e2324a..1814870 100644
--- a/packages/screen/src/views/EquipmentManagement/index.js
+++ b/packages/screen/src/views/EquipmentManagement/index.js
@@ -320,7 +320,7 @@ const getDetailData = async (row) => {
model.title = `设备详情`;
model.content = DetailDialog;
model.props = {
- detailData: res.data,
+ detailData: res.data.equipment,
};
model.onCancel = () => {
dialogType.value = '';
@@ -335,9 +335,9 @@ const getDetailData = async (row) => {
if (dialogType.value === 'edit') {
model.title = `编辑设备`;
model.content = EditDialog;
- Object.assign(form, res.data);
+ Object.assign(form, res.data.equipment);
model.props = {
- detailData: res.data,
+ detailData: res.data.equipment,
form: form,
};
model.onCancel = () => {
diff --git a/packages/screen/src/views/EquipmentManagement/index.vue b/packages/screen/src/views/EquipmentManagement/index.vue
index b235b94..bec07ff 100644
--- a/packages/screen/src/views/EquipmentManagement/index.vue
+++ b/packages/screen/src/views/EquipmentManagement/index.vue
@@ -43,6 +43,7 @@
>
+
diff --git a/packages/screen/src/views/MaterialManagement/detailDialog.vue b/packages/screen/src/views/MaterialManagement/detailDialog.vue
index 6dabad8..f5575ad 100644
--- a/packages/screen/src/views/MaterialManagement/detailDialog.vue
+++ b/packages/screen/src/views/MaterialManagement/detailDialog.vue
@@ -8,41 +8,41 @@