From 73fe3c5574c8fbb7b18fa9b76d53b918f6f921e1 Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期三, 12 十一月 2025 11:09:04 +0800
Subject: [PATCH] 更换前端打包方式,将ip地址配置提取到public
---
UI-Project/src/views/GlassStorage/MaterialRackManagement.vue | 89 +++++++-------------------------------------
1 files changed, 15 insertions(+), 74 deletions(-)
diff --git a/UI-Project/src/views/GlassStorage/MaterialRackManagement.vue b/UI-Project/src/views/GlassStorage/MaterialRackManagement.vue
index c41ce56..d8000f9 100644
--- a/UI-Project/src/views/GlassStorage/MaterialRackManagement.vue
+++ b/UI-Project/src/views/GlassStorage/MaterialRackManagement.vue
@@ -4,25 +4,23 @@
<div
slot="header"
class="clearfix"
- style="display: flex; align-items: center"
+ style="display: flex; align-items: center;margin-top: -20px;"
>
<!-- 宸︿晶鎸夐挳缁� -->
<div>
- <el-button type="success" size="mini" @click="storage()"
+ <el-button type="success" @click="storage()"
>鍘熺墖浠撳偍璇︽儏</el-button
>
- <el-button type="success" size="mini" @click="handleInbound()"
+ <el-button type="success" @click="handleInbound()"
>鍏ュ簱</el-button
>
- <el-button type="success" size="mini">鍚婅浣嶅叆搴�</el-button>
+ <el-button type="success" >鍚婅浣嶅叆搴�</el-button>
</div>
-
<!-- 鍙充晶閫夋嫨妗� -->
- <el-form-item style="margin-top: 15px; width: 150px">
+ <el-form-item style="margin-top: 15px; width: 150px;margin-left: 10px;">
<el-select v-model="formData2.dzw" placeholder="璇烽�夋嫨鍚婅浣�">
<el-option label="鍚婅浣�1" value="鍚婅浣�1"></el-option>
<el-option label="鍚婅浣�2" value="鍚婅浣�2"></el-option>
- <!-- 鏍规嵁瀹為檯鎯呭喌娣诲姞鏇村閫夐」 -->
</el-select>
</el-form-item>
</div>
@@ -63,23 +61,21 @@
</el-tag>
</template>
</el-table-column>
-
<!-- 鎿嶄綔鍒� -->
<el-table-column label="鎿嶄綔" width="250">
<template #default="{ row }">
<el-button
type="primary"
- size="mini"
@click="edithandleRowClick(row)"
>淇敼</el-button
>
- <el-button type="danger" size="mini" @click="handleDelete(row)"
+ <el-button type="danger" @click="handleDelete(row)"
>鍒犻櫎</el-button
>
- <el-button type="warning" size="mini" @click="handleCheckout(row)"
+ <el-button type="warning" @click="handleCheckout(row)"
>鍑哄簱</el-button
>
- <!-- <el-button type="success" size="mini" @click="addglass()">娣诲姞鍘熺墖</el-button> -->
+ <!-- <el-button type="success" @click="addglass()">娣诲姞鍘熺墖</el-button> -->
</template>
</el-table-column>
</el-table>
@@ -134,24 +130,22 @@
</el-tag>
</template>
</el-table-column>
-
<!-- 鎿嶄綔鍒� -->
<el-table-column label="鎿嶄綔" width="350">
<template #default="{ row }">
- <el-button type="primary" size="mini" @click="handleRestart(row)"
+ <el-button type="primary" @click="handleRestart(row)"
>閲嶆柊寮�濮�</el-button
>
- <el-button type="danger" size="mini" @click="handleDeletetask(row)"
+ <el-button type="danger" @click="handleDeletetask(row)"
>鍒犻櫎浠诲姟</el-button
>
- <el-button type="success" size="mini" @click="handleComplete(row)"
+ <el-button type="success" @click="handleComplete(row)"
>浠诲姟瀹屾垚</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
-
<div class="img-ypcc">
<div
class="img-car1"
@@ -168,7 +162,6 @@
></div>
</div>
</div>
-
<!-- 鍏ュ簱瀵硅瘽妗� -->
<el-dialog
title="鍏ュ簱"
@@ -355,7 +348,6 @@
const handleCurrentChange = (val) => {
currentPage.value = val;
};
-
const formatTaskType = (row, column) => {
if (row.taskType === "浠庝粨浣嶅埌鍚婅浣�") {
return `浠庝粨浣�${row.shelfRack}鍒板悐瑁呬綅${row.loadRack}`;
@@ -367,7 +359,6 @@
return `浠庡悐瑁呬綅${row.loadRack}鍒颁粨浣�${row.shelfRack}`;
}
};
-
const getTagType2 = (status) => {
switch (status) {
case "completed":
@@ -382,51 +373,39 @@
return "";
}
};
-
const getTagType = (status) => {
return status === 1 ? "success" : "danger";
// 鏍规嵁鐘舵�佸�煎喅瀹氭爣绛剧被鍨嬶紝杩欓噷鍋囪鐘舵�佷负1鏃朵负鎴愬姛锛堢豢鑹诧級锛屽惁鍒欎负澶辫触锛堢孩鑹诧級
};
-
const toggleStatus = (row) => {
// 鍒囨崲鏂欐灦鐘舵�佺殑閫昏緫
row.enableState = 1 - row.enableState; // Toggle between 0 and 1
// 姝ゅ鍙互娣诲姞淇濆瓨鐘舵�佺殑閫昏緫锛屾瘮濡傝皟鐢� API 鏇存柊鏁版嵁
};
let socket = null;
-const socketUrl = `ws://${WebSocketHost}:${host}/api/glassStorage/api/talk/storageTask`;
+const socketUrl = `ws://${window.ipConfig.serverUrl}/api/glassStorage/api/talk/storageTask`;
// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
const handleMessage = (data) => {
// 鏇存柊 tableData 鐨勬暟鎹�
-
tableData.value = data.rack[0]; // 鍋囪 tableData 鏄搷搴斿紡瀵硅薄鎴栧彉閲�
-
tableData.value.forEach((item) => {
// 鑾峰彇 createTime 鐨勬椂闂存埑
const createTimeTimestamp = item.createTime;
-
// 鍒涘缓鏃ユ湡瀵硅薄
const date = new Date(createTimeTimestamp);
-
// 鏍煎紡鍖栨棩鏈熸椂闂翠负鏈湴鏍煎紡
const formattedDateTime = date.toLocaleString();
-
// 鏇挎崲鍘熸潵鐨� createTime 瀛楁涓烘牸寮忓寲鍚庣殑鏃ユ湡鏃堕棿瀛楃涓�
item.createTime = formattedDateTime;
});
-
tasktableData.value = data.tasks[0]; // 鍋囪 tasktableData 鏄搷搴斿紡瀵硅薄鎴栧彉閲�
-
tasktableData.value.forEach((item) => {
// 鑾峰彇 createTime 鐨勬椂闂存埑
const createTimeTimestamp = item.startTime;
-
// 鍒涘缓鏃ユ湡瀵硅薄
const date = new Date(createTimeTimestamp);
-
// 鏍煎紡鍖栨棩鏈熸椂闂翠负鏈湴鏍煎紡
const formattedDateTime = date.toLocaleString();
-
// 鏇挎崲鍘熸潵鐨� createTime 瀛楁涓烘牸寮忓寲鍚庣殑鏃ユ湡鏃堕棿瀛楃涓�
item.startTime = formattedDateTime;
});
@@ -440,12 +419,9 @@
}
});
onBeforeUnmount(() => {
- console.log("鍏抽棴浜�");
closeWebSocket();
});
-
const tasktableData = ref([]);
-
const dialogVisible = ref(false);
const formData = ref({
number: "",
@@ -456,11 +432,9 @@
pieces: "",
loadRack: 1,
});
-
const formData2 = ref({
dzw: "",
});
-
const handleDelete = (row) => {
// 浣跨敤 Element UI 鐨� MessageBox.confirm 鏂规硶杩涜浜屾纭
ElMessageBox.confirm("纭畾瑕佹墽琛屽垹闄ゆ搷浣滃悧锛�", "纭鍒犻櫎", {
@@ -470,12 +444,10 @@
})
.then(() => {
// 鐐瑰嚮纭鎸夐挳鐨勫洖璋冿紝鎵ц鍑哄簱鎿嶄綔
-
const intNumber = {
id: parseInt(row.number),
};
deleteRawUsage(intNumber);
-
console.log("鎵ц鍒犻櫎鎿嶄綔");
})
.catch(() => {
@@ -483,7 +455,6 @@
console.log("鍙栨秷鍒犻櫎鎿嶄綔");
});
};
-
const handleCheckout = (row) => {
// 浣跨敤 Element UI 鐨� MessageBox.confirm 鏂规硶杩涜浜屾纭
ElMessageBox.confirm("纭畾瑕佹墽琛屽嚭搴撴搷浣滃悧锛�", "纭鍑哄簱", {
@@ -505,17 +476,14 @@
console.log("鍙栨秷鍑哄簱鎿嶄綔");
});
};
-
const handleInbound = () => {
// 鎵撳紑鍏ュ簱瀵硅瘽妗�
dialogVisible.value = true;
};
-
const storage = () => {
// 鎵撳紑鍏ュ簱瀵硅瘽妗�
Hidden.value = true;
};
-
const handleCloseDialog = () => {
// 鍏抽棴瀵硅瘽妗嗘椂閲嶇疆琛ㄥ崟鏁版嵁
formData.value = {
@@ -528,15 +496,12 @@
};
dialogVisible.value = false;
};
-
const handleConfirmInbound = () => {
inStorage(formData.value);
// 澶勭悊纭鍏ュ簱閫昏緫锛屽彲浠ュ湪杩欓噷鎻愪氦琛ㄥ崟鎴栬�呮墽琛屽叾浠栨搷浣�
- console.log("Confirm Inbound:", formData.value);
// 鍏抽棴瀵硅瘽妗�
dialogVisible.value = false;
};
-
const dialogVisible3 = ref(false);
const colors = ref([
{ "0_glass_id": "Red" },
@@ -544,7 +509,6 @@
{ "0_glass_id": "Blue" },
// Add more colors as needed
]);
-
const formData3 = ref({
selectedColor: "",
wid: "",
@@ -552,7 +516,6 @@
thinkness: "",
num: "",
});
-
const addglass = () => {
// 鎵撳紑鍏ュ簱瀵硅瘽妗�
dialogVisible3.value = true;
@@ -560,17 +523,13 @@
const handleCommand = (command) => {
formData.value.selectedColor = command;
};
-
const clearInput = (field) => {
formData.value[field] = "";
};
-
const submitForm = () => {
- console.log("鎻愪氦鏁版嵁:", formData.value);
dialogVisible3.value = false;
// Add your submit logic here
};
-
const editdialogVisible = ref(false);
const editForm = ref({
id: "",
@@ -582,11 +541,9 @@
});
const editFormRef = ref(null);
let currentRow = ref(null);
-
// 澶勭悊琛岀偣鍑讳簨浠�
const edithandleRowClick = (row) => {
currentRow.value = row;
- console.log(row);
editForm.value.pieces = row.pieces.toString();
editForm.value.batchId = row.batchId;
editForm.value.rawWidth = row.rawWidth;
@@ -594,13 +551,10 @@
editForm.value.rawThickness = row.rawThickness;
editForm.value.id = row.number;
editdialogVisible.value = true;
- console.log(editForm.value);
};
-
// 娣诲姞淇濆瓨缂栬緫鍐呭
const editsaveEdit = () => {
if (!currentRow.value) return;
-
// 鏇存柊褰撳墠琛屾暟鎹�
currentRow.value.pieces = editForm.value.pieces;
currentRow.value.batchId = editForm.value.batchId;
@@ -609,11 +563,9 @@
currentRow.value.rawThickness = editForm.value.rawThickness;
// 璋冪敤鏇存柊鍑芥暟锛屽苟澶勭悊鍏惰繑鍥炵殑 Promise
updateRawUsage(editForm.value);
-
// 鍏抽棴瀵硅瘽妗�
editdialogVisible.value = false;
};
-
// 瀵硅瘽妗嗗叧闂椂閲嶇疆缂栬緫琛ㄥ崟鍜屽綋鍓嶈鏁版嵁
const edithandleDialogClose = () => {
editForm.value.pieces = "";
@@ -621,10 +573,8 @@
editForm.value.rawWidth = "";
editForm.value.rawHeight = "";
editForm.value.rawThickness = "";
-
currentRow.value = null;
};
-
const handleRestart = (row) => {
// 浣跨敤 Element UI 鐨� MessageBox.confirm 鏂规硶杩涜浜屾纭
ElMessageBox.confirm("纭畾瑕佹墽琛岄噸鏂板紑濮嬫搷浣滃悧锛�", "纭閲嶆柊寮�濮�", {
@@ -638,8 +588,6 @@
Type:"閲嶆柊寮�濮�"
}
taskUpdate(taskdata);
-
-
console.log("鎵ц閲嶆柊寮�濮嬫搷浣�", row);
})
.catch(() => {
@@ -647,7 +595,6 @@
console.log("鍙栨秷閲嶆柊寮�濮嬫搷浣�");
});
};
-
const handleDeletetask = (row) => {
// 浣跨敤 Element UI 鐨� MessageBox.confirm 鏂规硶杩涜浜屾纭
ElMessageBox.confirm("纭畾瑕佹墽琛屽垹闄や换鍔℃搷浣滃悧锛�", "纭鍒犻櫎浠诲姟", {
@@ -669,7 +616,6 @@
console.log("鍙栨秷鍒犻櫎浠诲姟鎿嶄綔");
});
};
-
const handleComplete = (row) => {
// 浣跨敤 Element UI 鐨� MessageBox.confirm 鏂规硶杩涜浜屾纭
ElMessageBox.confirm("纭畾瑕佹墽琛屼换鍔″畬鎴愭搷浣滃悧锛�", "纭浠诲姟瀹屾垚", {
@@ -678,7 +624,6 @@
type: "warning",
})
.then(() => {
-
const taskdata={
id:row.id,
Type:"瀹屾垚"
@@ -693,7 +638,6 @@
});
};
</script>
-
<style scoped>
#dt {
display: block;
@@ -711,10 +655,9 @@
text-align: center;
margin-top: -15px;
}
-
.img-ypcc {
margin-left: 80px;
- background-image: url("../../assets/ypcc.png");
+ background-image: url("/ypcc.png");
background-repeat: no-repeat;
background-attachment: local;
min-height: 600px;
@@ -725,9 +668,8 @@
position: relative;
margin-top: 0px;
}
-
.img-car1 {
- background-image: url("../../assets/ypccche.png");
+ background-image: url("/ypccche.png");
position: absolute;
background-repeat: no-repeat;
background-attachment: local;
@@ -738,9 +680,8 @@
overflow: hidden;
position: relative;
}
-
.custom-dialog {
max-height: 90vh; /* 鏈�澶ч珮搴︿负瑙嗗彛楂樺害鐨�90% */
overflow-y: auto; /* 瀵硅瘽妗嗗唴閮ㄥ嚭鐜板瀭鐩存粴鍔ㄦ潯 */
}
-</style>
+</style>
\ No newline at end of file
--
Gitblit v1.8.0