wangfei
2 天以前 9101ba64d5aa4722fc6384674682cd508d1315c9
报警弹窗新增提示信息
5个文件已修改
94 ■■■■ 已修改文件
UI-Project/src/views/Caching/cachingbefore.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Caching/cachingun.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Slicecage/slicecage.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/User/userlist.vue 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/hollow/hollowslicecage.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Caching/cachingbefore.vue
@@ -411,6 +411,7 @@
      <el-icon><WarnTriangleFilled /></el-icon>
      <span class="alert-text">
        {{ alertText }} (id:{{ alertMessage }})
        <span class="confirm-text">{{ $t('hellow.pleaseConfirm') }}</span>
      </span>
    </div>
    <button @click="showAlert = false" class="close-btn">×</button>
@@ -686,4 +687,11 @@
  max-width: 80%; /* 防止小屏幕溢出 */
  min-width: 400px; /* 最小宽度保证 */
}
.confirm-text {
  color: rgb(242, 121, 8);
  display: block; /* 强制换行 */
  text-align: center; /* 水平居中 */
  margin-top: 4px; /* 与上一行保持间距 */
  font-weight: 500; /* 加粗突出 */
}
</style>
UI-Project/src/views/Caching/cachingun.vue
@@ -392,6 +392,7 @@
      <el-icon><WarnTriangleFilled /></el-icon>
      <span class="alert-text">
        {{ alertText }} (id:{{ alertMessage }})
        <span class="confirm-text">{{ $t('hellow.pleaseConfirm') }}</span>
      </span>
    </div>
    <button @click="showAlert = false" class="close-btn">×</button>
@@ -593,4 +594,11 @@
  max-width: 80%; /* 防止小屏幕溢出 */
  min-width: 400px; /* 最小宽度保证 */
}
</style>
.confirm-text {
  color: rgb(242, 121, 8);
  display: block; /* 强制换行 */
  text-align: center; /* 水平居中 */
  margin-top: 4px; /* 与上一行保持间距 */
  font-weight: 500; /* 加粗突出 */
}
</style>
UI-Project/src/views/Slicecage/slicecage.vue
@@ -1248,7 +1248,7 @@
      <el-icon><WarnTriangleFilled /></el-icon>
      <span class="alert-text">
        {{ alertText }} (id:{{ alertMessage }})
        <!-- <span class="confirm-text">{{ $t('hellow.pleaseConfirm') }}</span> -->
        <span class="confirm-text">{{ $t('hellow.pleaseConfirm') }}</span>
      </span>
    </div>
    <button @click="showAlert = false" class="close-btn">×</button>
@@ -2040,7 +2040,7 @@
  color: rgb(242, 121, 8);
  display: block; /* 强制换行 */
  text-align: center; /* 水平居中 */
  margin-top: 4px; /* 与上一行保持间距,可选 */
  font-weight: 500; /* 可选,加粗突出 */
  margin-top: 4px; /* 与上一行保持间距 */
  font-weight: 500; /* 加粗突出 */
}
</style>
UI-Project/src/views/User/userlist.vue
@@ -1,25 +1,23 @@
<script setup>
import { Search, Lock } from "@element-plus/icons-vue"; // 新增Lock图标导入
import { reactive, ref, onMounted } from "vue"; // 合并导入
import { reactive, ref, onMounted } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();
import request from "@/utils/request";
import { ElMessage, ElMessageBox } from "element-plus";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
let language = ref(localStorage.getItem("lang") || "zh");
const selectedProjectNoa = ref(null);
const userName = ref("");
const password = ref("");
const confirmPassword = ref(""); // 新增:确认密码
const editPassword = ref(""); // 新增:编辑时的密码
const editConfirmPassword = ref(""); // 新增:编辑时的确认密码
const confirmPassword = ref("");
const editPassword = ref("");
const editConfirmPassword = ref("");
const tableData = ref([]);
const slot = ref("");
const add = ref(false); // 添加弹窗
const adda = ref(false); // 编辑弹窗
const add = ref(false);
const adda = ref(false);
let language = ref(localStorage.getItem("lang") || "zh");
// 获取用户列表
const listByUserName = async () => {
  try {
@@ -33,10 +31,8 @@
    }
  } catch (error) {
    ElMessage.error( );
    console.error("获取用户列表失败:", error);
  }
};
// 重置密码
const open = async (row) => {
  try {
@@ -67,11 +63,9 @@
    }
  }
};
const titleSelectJsona = ref({
  processTypea: [], // 修正字段名拼写
  processTypea: [],
});
// 获取角色列表
const fetchOptionsa = async () => {
  try {
@@ -85,15 +79,13 @@
    }
  } catch (error) {
    ElMessage.error( );
    console.error("获取角色列表失败:", error);
  }
};
// 处理编辑按钮点击
function handleEdit(row) {
  userName.value = row.userName;
  editPassword.value = ""; // 清空编辑密码
  editConfirmPassword.value = ""; // 清空编辑确认密码
  editPassword.value = "";
  editConfirmPassword.value = "";
  if (row.roleList && row.roleList.length > 0) {
    const firstRole = row.roleList[0];
    selectedProjectNoa.value = firstRole.id;
@@ -101,25 +93,22 @@
  adda.value = true;
  window.localStorage.setItem("id", row.id);
}
// 关闭添加弹窗
function closeDialog() {
  add.value = false;
  userName.value = "";
  password.value = "";
  confirmPassword.value = ""; // 清空确认密码
  confirmPassword.value = "";
  selectedProjectNoa.value = "";
}
// 关闭编辑弹窗
function closeDialoga() {
  adda.value = false;
  userName.value = "";
  editPassword.value = ""; // 清空编辑密码
  editConfirmPassword.value = ""; // 清空编辑确认密码
  editPassword.value = "";
  editConfirmPassword.value = "";
  selectedProjectNoa.value = "";
}
// 添加用户
const getTableRow = async () => {
  // 验证用户名
@@ -139,15 +128,14 @@
  }
  // 验证确认密码
  if (!confirmPassword.value) {
    ElMessage.error(t("productStock.inconfirmpassword")); // 需在i18n中添加该字段
    ElMessage.error(t("productStock.inconfirmpassword"));
    return;
  }
  // 验证密码一致性
  if (password.value !== confirmPassword.value) {
    ElMessage.error(t("productStock.passwordNotMatch")); // 需在i18n中添加该字段
    ElMessage.error(t("productStock.passwordNotMatch"));
    return;
  }
  try {
    const response = await request.post("/loadGlass/sys/user/saveUser", {
      userName: userName.value,
@@ -168,10 +156,8 @@
    }
  } catch (error) {
    ElMessage.error( );
    console.error("添加用户失败:", error);
  }
};
// 编辑用户
const getTableRowa = async () => {
  // 验证用户名
@@ -184,7 +170,6 @@
    ElMessage.error(t("productStock.inrole"));
    return;
  }
  // 如果填写了密码,验证密码和确认密码
  if (editPassword.value || editConfirmPassword.value) {
    if (!editPassword.value) {
      ElMessage.error(t("productStock.inpassword"));
@@ -199,14 +184,12 @@
      return;
    }
  }
  let id = window.localStorage.getItem("id");
  if (!id) {
    ElMessage.error(t("productStock.userIdError"));
    return;
  }
  try {
    // 构建请求参数
    const requestData = {
      id: id,
      userName: userName.value,
@@ -216,25 +199,21 @@
        },
      ],
    };
    // 如果填写了密码,添加到请求参数中
    if (editPassword.value) {
      requestData.password = editPassword.value;
    }
    const response = await request.post("/loadGlass/sys/user/updateUser", requestData);
    if (response.code === 200) {
      ElMessage.success(response.message);
      closeDialoga(); // 关闭弹窗并清空表单
      listByUserName(); // 刷新列表
      closeDialoga();
      listByUserName();
    } else {
      ElMessage.error(response.message);
    }
  } catch (error) {
    ElMessage.error( );
    console.error("编辑用户失败:", error);
  }
};
// 删除用户
const opena = async (row) => {
  try {
@@ -259,17 +238,14 @@
  } catch (error) {
    if (error !== "cancel") {
      ElMessage.error( );
      console.error("删除用户失败:", error);
    }
  }
};
onMounted(() => {
  fetchOptionsa();
  listByUserName();
});
</script>
<template>
  <div>
    <el-button
@@ -339,7 +315,6 @@
      </div>
    </el-card>
  </div>
  <!-- 添加用户弹窗 -->
  <el-dialog
    v-model="add"
@@ -450,7 +425,6 @@
      </div>
    </template>
  </el-dialog>
  <!-- 编辑用户弹窗 -->
  <el-dialog
    v-model="adda"
@@ -563,7 +537,6 @@
    </template>
  </el-dialog>
</template>
<style scoped>
#dt {
  display: block;
UI-Project/src/views/hollow/hollowslicecage.vue
@@ -135,7 +135,6 @@
      sums[index] = '合计';
      return;
    }
    // 只对需要计算的列进行求和
    const needSumColumns = ['sumCount', 'pairCount', 'totalNumber', 'realCount'];
    if (needSumColumns.includes(column.property)) {
@@ -942,6 +941,7 @@
      <el-icon><WarnTriangleFilled /></el-icon>
      <span class="alert-text">
        {{ alertText }} (id:{{ alertMessage }})
        <span class="confirm-text">{{ $t('hellow.pleaseConfirm') }}</span>
      </span>
    </div>
    <button @click="showAlert = false" class="close-btn">×</button>
@@ -1517,4 +1517,11 @@
#app-container {
  padding-top: 60px; /* 根据alert高度调整 */
}
.confirm-text {
  color: rgb(242, 121, 8);
  display: block; /* 强制换行 */
  text-align: center; /* 水平居中 */
  margin-top: 4px; /* 与上一行保持间距 */
  font-weight: 500; /* 加粗突出 */
}
</style>