spring
昨天 3960a146999f82053bec81333095b0637f7738b2
fix: 完成消息通知
已修改5个文件
136 ■■■■■ 文件已修改
src/api/system/message.js 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/NotificationCenter/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/customerFile/index.vue 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/supplierManage/components/BlacklistTab.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/supplierManage/components/HomeTab.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/system/message.js
@@ -3,7 +3,7 @@
// 查询消息通知列表
export function listMessage(query) {
  return request({
    url: "/system/message/list",
    url: "/system/notice/list",
    method: "get",
    params: query,
  });
@@ -12,33 +12,33 @@
// 查询未读消息数量
export function getUnreadCount() {
  return request({
    url: "/system/message/unreadCount",
    url: "/system/notice/getCount",
    method: "get",
  });
}
// 标记消息为已读
export function markAsRead(messageId) {
export function markAsRead(noticeId) {
  return request({
    url: "/system/message/markAsRead",
    url: "/system/notice/markAsRead",
    method: "post",
    data: { messageId },
    data: { noticeId },
  });
}
// 一键标记所有消息为已读
export function markAllAsRead() {
  return request({
    url: "/system/message/markAllAsRead",
    url: "/system/notice/markAllAsRead",
    method: "post",
  });
}
// 确认消息
export function confirmMessage(messageId) {
export function confirmMessage(noticeId, status) {
  return request({
    url: "/system/message/confirm",
    url: "/system/notice/confirm",
    method: "post",
    data: { messageId },
    data: { noticeId, status },
  });
}
src/layout/components/NotificationCenter/index.vue
@@ -137,7 +137,7 @@
// 确认消息
const handleConfirm = async (messageId) => {
  try {
    const res = await confirmMessage(messageId)
    const res = await confirmMessage(messageId, 1)
    if (res.code === 200) {
      ElMessage.success('确认成功')
      // 标记为已读
src/views/basicData/customerFile/index.vue
@@ -47,14 +47,11 @@
        @pagination="pagination"
      ></PIMTable>
    </div>
    <FormDialog
    <el-dialog
      v-model="dialogFormVisible"
      :title="(type) => type === 'add' ? '新增客户信息' : '编辑客户信息'"
      :operation-type="operationType"
      :title="operationType === 'add' ? '新增客户信息' : '编辑客户信息'"
      width="70%"
      @close="closeDia"
      @confirm="submitForm"
      @cancel="closeDia"
    >
      <el-form
        :model="form"
@@ -196,31 +193,63 @@
          </el-col>
        </el-row>
      </el-form>
    </FormDialog>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitForm">确认</el-button>
          <el-button @click="closeDia">取消</el-button>
        </div>
      </template>
    </el-dialog>
    <!-- 用户导入对话框 -->
    <ImportDialog
      ref="importDialogRef"
      v-model="upload.open"
    <el-dialog
      :title="upload.title"
      v-model="upload.open"
      width="400px"
      :action="upload.url"
      :headers="upload.headers"
      :disabled="upload.isUploading"
      :before-upload="upload.beforeUpload"
      :on-progress="upload.onProgress"
      :on-success="upload.onSuccess"
      :on-error="upload.onError"
      :on-change="upload.onChange"
      @confirm="submitFileForm"
      @cancel="handleImportCancel"
      @download-template="importTemplate"
    />
      append-to-body
    >
      <el-upload
        ref="uploadRef"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
        :action="upload.url + '?updateSupport=' + upload.updateSupport"
        :disabled="upload.isUploading"
        :before-upload="upload.beforeUpload"
        :on-progress="upload.onProgress"
        :on-success="upload.onSuccess"
        :on-error="upload.onError"
        :on-change="upload.onChange"
        :auto-upload="false"
        drag
      >
        <el-icon class="el-icon--upload"><upload-filled /></el-icon>
        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
        <template #tip>
          <div class="el-upload__tip text-center">
            <span>仅允许导入xls、xlsx格式文件。</span>
            <el-link
              type="primary"
              :underline="false"
              style="font-size: 12px; vertical-align: baseline"
              @click="importTemplate"
              >下载模板</el-link
            >
          </div>
        </template>
      </el-upload>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitFileForm">确 定</el-button>
          <el-button @click="upload.open = false">取 消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import {onMounted, ref} from "vue";
import { Search, Close } from "@element-plus/icons-vue";
import { Search } from "@element-plus/icons-vue";
import {
  addCustomer,
  delCustomer,
@@ -232,9 +261,6 @@
import { userListNoPage } from "@/api/system/user.js";
import useUserStore from "@/store/modules/user";
import { getToken } from "@/utils/auth.js";
import { getCurrentDate } from "@/utils/index.js";
import FormDialog from "@/components/Dialog/FormDialog.vue";
import ImportDialog from "@/components/Dialog/ImportDialog.vue";
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
@@ -312,7 +338,6 @@
const selectedRows = ref([]);
const userList = ref([]);
const tableLoading = ref(false);
const importDialogRef = ref(null);
const page = reactive({
  current: 1,
  size: 100,
@@ -401,9 +426,7 @@
    if(response.code === 200){
      proxy.$modal.msgSuccess("文件上传成功");
      upload.open = false;
      if (importDialogRef.value) {
        importDialogRef.value.clearFiles();
      }
      proxy.$refs["uploadRef"].clearFiles();
      getList();
    }else if(response.code === 500){
      proxy.$modal.msgError(response.msg);
@@ -461,13 +484,7 @@
/** 提交上传文件 */
function submitFileForm() {
  upload.isUploading = true;
  if (importDialogRef.value) {
    importDialogRef.value.submit();
  }
}
/** 取消导入 */
function handleImportCancel() {
  upload.open = false;
  proxy.$refs["uploadRef"].submit();
}
/** 导入按钮操作 */
function handleImport() {
@@ -597,6 +614,15 @@
    });
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
  const day = String(today.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
}
onMounted(() => {
    getList();
});
src/views/basicData/supplierManage/components/BlacklistTab.vue
@@ -240,7 +240,6 @@
import useUserStore from "@/store/modules/user";
import { getToken } from "@/utils/auth.js";
import FilesDia from "../filesDia.vue";
import { getCurrentDate } from "@/utils/index.js";
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
@@ -542,6 +541,14 @@
      });
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
  const day = String(today.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
}
// 打开附件弹框
const openFilesFormDia = (row) => {
  nextTick(() => {
src/views/basicData/supplierManage/components/HomeTab.vue
@@ -246,7 +246,6 @@
import useUserStore from "@/store/modules/user";
import { getToken } from "@/utils/auth.js";
import FilesDia from "../filesDia.vue";
import { getCurrentDate } from "@/utils/index.js";
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
@@ -548,6 +547,14 @@
      });
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
  const day = String(today.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
}
// 打开附件弹框
const openFilesFormDia = (row) => {
  nextTick(() => {