Browse Source

营销-目标管理优化提炼搜索与列表字段

002390 1 year ago
parent
commit
2a5f52d8b1

+ 76 - 0
src/views/business/spd/target/targetTemplate/columns.js

@@ -0,0 +1,76 @@
+export default function useColumns() {
+  const SearchColumns = [
+    {
+      item: { key: "year", title: "年度" },
+      attr: {
+        is: "el-date-picker",
+        type: "year",
+        valueFormat: "yyyy-MM-dd",
+        clearable: true,
+      }
+    },
+    {
+      item: { key: "name", title: "模板名称" },
+      attr: {
+        is: "el-input",
+        clearable: true,
+      }
+    },
+    {
+      item: { key: "dateRange", title: "开始日期" },
+      attr: {
+        is: "el-date-picker",
+        type: "daterange",
+        rangeSeparator: "-",
+        endPlaceholder: "结束",
+        startPlaceholder: "开始",
+        valueFormat: "yyyy-MM-dd",
+      }
+    },
+  ];
+
+  const TableColumns = [
+    {
+      item: { key: "year", title: "年度" },
+      attr: {}
+    },
+    {
+      item: { key: "name", title: "模板名称" },
+      attr: {}
+    },
+    {
+      item: { key: "startTime", title: "开始日期" },
+      attr: {}
+    },
+    {
+      item: { key: "deadlineTime", title: "结束日期" },
+      attr: {}
+    },
+    {
+      item: { key: "cycle", title: "周期" },
+      attr: {}
+    },
+    {
+      item: { key: "unfold", title: "按列展开" },
+      attr: {}
+    },
+    {
+      item: { key: "createByName", title: "创建人" },
+      attr: {}
+    },
+    {
+      item: { key: "createTime", title: "创建时间" },
+      attr: {}
+    },
+    {
+      item: { key: "updateByName", title: "修改人" },
+      attr: {}
+    },
+    {
+      item: { key: "updateTime", title: "修改时间" },
+      attr: {}
+    },
+  ];
+
+  return { SearchColumns, TableColumns }
+}

+ 15 - 0
src/views/business/spd/target/targetTemplate/dicts.js

@@ -0,0 +1,15 @@
+import { initDicts } from "@/utils/init.js";
+
+const modules = require.context("./", true, /column.js$/);
+const columns = [];
+modules.keys().forEach((fileName) => {
+  const data = modules(fileName).default();
+  for (const key in data) {
+    if (key === "TabColumns") {
+      columns.push(...data[key].map((item) => item.TableColumns).flat());
+    } else {
+      columns.push(...data[key]);
+    }
+  }
+});
+export const dicts = initDicts(columns);