yyb
10 小时以前 0a58164ce2ea3f1a2b46781757d78b94b212883b
src/views/officeProcessAutomation/NoticeAnnouncement/notice-manage/useNoticeAnnouncement.js
@@ -1,7 +1,7 @@
import { Search } from "@element-plus/icons-vue";
import dayjs from "dayjs";
import { ElMessageBox } from "element-plus";
import { computed, reactive, ref, watch } from "vue";
import { computed, onMounted, reactive, ref, watch } from "vue";
import {
  NOTICE_TYPE_OPTIONS,
  PRIORITY_OPTIONS,
@@ -10,7 +10,6 @@
  DEPT_OPTIONS,
  createEmptyForm,
  loadStoredNotices,
  saveStoredNotices,
  nextNoticeNo,
  validateNoticeForm,
  noticeTypeLabel,
@@ -20,8 +19,7 @@
} from "./noticeAnnouncementUtils.js";
export function useNoticeAnnouncement() {
  const stored = loadStoredNotices();
  const allRows = ref(stored?.length ? stored : []);
  const allRows = ref([]);
  const searchForm = reactive({
    keyword: "",
@@ -151,9 +149,9 @@
    },
  ]);
  function persist() {
    saveStoredNotices(allRows.value);
  }
  onMounted(() => {
    loadStoredNotices();
  });
  function handleQuery() {
    tableLoading.value = true;
@@ -239,7 +237,6 @@
      }
      allRows.value[idx] = { ...prev, ...payload };
    }
    persist();
    formDialog.visible = false;
    return { ok: true };
  }
@@ -258,7 +255,6 @@
      hit.publishTime = now;
      hit.updateTime = now;
      if (hit.noticeType === "emergency") hit.priority = "urgent";
      persist();
      return true;
    } catch {
      return false;
@@ -276,7 +272,6 @@
      if (!hit) return;
      hit.publishStatus = "withdrawn";
      hit.updateTime = dayjs().format("YYYY-MM-DD HH:mm:ss");
      persist();
      return true;
    } catch {
      return false;
@@ -291,7 +286,6 @@
        cancelButtonText: "取消",
      });
      allRows.value = allRows.value.filter((r) => r.id !== row.id);
      persist();
      return true;
    } catch {
      return false;