From fab6326bf9df3c6db59718bad8f42b0212c73a9e Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 06 一月 2026 15:59:45 +0800
Subject: [PATCH] 双奇点迁移仓库
---
src/views/basicData/product/index.vue | 74 ++++++++++--------------------------
1 files changed, 21 insertions(+), 53 deletions(-)
diff --git a/src/views/basicData/product/index.vue b/src/views/basicData/product/index.vue
index 3aa263e..68e8221 100644
--- a/src/views/basicData/product/index.vue
+++ b/src/views/basicData/product/index.vue
@@ -76,7 +76,7 @@
<div class="right">
<div style="margin-bottom: 10px" v-if="isShowButton">
<el-button type="primary" @click="openModelDia('add')">
- 鏂板瑙勬牸鍨嬪彿
+ 鏂板浜у搧楂樺害
</el-button>
<ImportExcel @uploadSuccess="getModelList" />
<el-button
@@ -129,7 +129,7 @@
</el-dialog>
<el-dialog
v-model="modelDia"
- title="瑙勬牸鍨嬪彿"
+ title="浜у搧楂樺害"
width="400px"
@close="closeModelDia"
@keydown.enter.prevent
@@ -143,10 +143,10 @@
>
<el-row>
<el-col :span="24">
- <el-form-item label="瑙勬牸鍨嬪彿锛�" prop="model">
+ <el-form-item label="浜у搧楂樺害锛�" prop="model">
<el-input
v-model="modelForm.model"
- placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�"
+ placeholder="璇疯緭鍏ヤ骇鍝侀珮搴�"
clearable
@keydown.enter.prevent
/>
@@ -155,10 +155,10 @@
</el-row>
<el-row>
<el-col :span="24">
- <el-form-item label="鍗曚綅锛�" prop="unit">
+ <el-form-item label="楂樺害鍗曚綅锛�" prop="unit">
<el-input
v-model="modelForm.unit"
- placeholder="璇疯緭鍏ュ崟浣�"
+ placeholder="璇疯緭鍏ラ珮搴﹀崟浣�"
clearable
@keydown.enter.prevent
/>
@@ -205,11 +205,11 @@
const expandedKeys = ref([]);
const tableColumn = ref([
{
- label: "瑙勬牸鍨嬪彿",
+ label: "浜у搧楂樺害",
prop: "model",
},
{
- label: "鍗曚綅",
+ label: "楂樺害鍗曚綅",
prop: "unit",
},
{
@@ -281,7 +281,7 @@
form.value.productName = data.productName;
}
};
-// 鎵撳紑瑙勬牸鍨嬪彿寮规
+// 鎵撳紑浜у搧楂樺害寮规
const openModelDia = (type, data) => {
modelOperationType.value = type;
modelDia.value = true;
@@ -319,53 +319,17 @@
proxy.$refs.formRef.resetFields();
productDia.value = false;
};
-// 灏佽涓�涓畨鍏ㄧ殑纭妗嗭紝褰诲簳闃绘Enter閿Е鍙�
-const safeConfirm = (message, title) => {
- // 鏍囪鏄惁鏄紶鏍囩偣鍑伙紙鐐瑰嚮鎸夐挳浼氳Е鍙慺ocus浜嬩欢锛�
- let isMouseClick = false;
- return new Promise((resolve, reject) => {
- const box = ElMessageBox.confirm(message, title, {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- beforeClose: (action, instance, done) => {
- if (action === "confirm") {
- // 鍙湁榧犳爣鐐瑰嚮鏃舵墠鍏佽纭
- if (isMouseClick) {
- done();
- resolve();
- } else {
- // Enter閿Е鍙戞椂闃绘
- done(false);
- }
- } else {
- // 鍙栨秷鎿嶄綔鐩存帴鍏佽
- done();
- reject();
- }
- }
- });
-
- // 鐩戝惉纭鎸夐挳鐨刦ocus浜嬩欢锛堥紶鏍囩偣鍑讳細瑙﹀彂锛孍nter閿笉浼氾級
- setTimeout(() => {
- const confirmBtn = document.querySelector('.el-message-box__btns .el-button--primary');
- if (confirmBtn) {
- confirmBtn.addEventListener('focus', () => {
- isMouseClick = true;
- });
- }
- }, 0); // 寤惰繜鑾峰彇锛岀‘淇滵OM宸叉覆鏌�
- });
-};
-// 鍒犻櫎浜у搧
// 鍒犻櫎浜у搧
const remove = (node, data) => {
- let ids = [data.id];
- // 浣跨敤灏佽鐨剆afeConfirm
- safeConfirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず")
+ let ids = [];
+ ids.push(data.id);
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
.then(() => {
- // 纭鍒犻櫎閫昏緫
tableLoading.value = true;
delProduct(ids)
.then((res) => {
@@ -441,7 +405,11 @@
proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
return;
}
- safeConfirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず")
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
.then(() => {
tableLoading.value = true;
delProductModel(ids)
--
Gitblit v1.9.3