zhangwencui
2026-10-29 3ce715a4e66955eac86dcd2f5c8afcfdf8becb6d
src/main.js
@@ -58,6 +58,7 @@
import PageHeader from "@/components/PageHeader/index.vue";
import { getToken } from "@/utils/auth";
import { toDateOnly } from "@/utils/dateDisplay";
import {
  calculateTaxExclusiveTotalPrice,
  summarizeTable,
@@ -80,6 +81,7 @@
app.config.globalProperties.addDateRange = addDateRange;
app.config.globalProperties.selectDictLabel = selectDictLabel;
app.config.globalProperties.selectDictLabels = selectDictLabels;
app.config.globalProperties.formatDateOnly = toDateOnly;
app.config.globalProperties.javaApi = __BASE_API__;
app.config.globalProperties.HaveJson = (val) => {
  return JSON.parse(JSON.stringify(val));
@@ -116,4 +118,19 @@
});
app._context.components.ElDialog.props.closeOnClickModal.default = false;
// 列表时间统一只展示年月日:未单独配置 formatter 的表格列走这里
const tableColumnFormatter =
  app._context.components.ElTableColumn?.props?.formatter;
if (tableColumnFormatter) {
  const formatCell = (row, column, cellValue) => toDateOnly(cellValue);
  if (typeof tableColumnFormatter === "function") {
    app._context.components.ElTableColumn.props.formatter = {
      type: Function,
      default: formatCell,
    };
  } else {
    tableColumnFormatter.default = formatCell;
  }
}
app.mount("#app");