hfn-components 0.3.9 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,10 @@ export declare const HtElTable: import("hfn-components/es/utils").SFCWithInstall
16
16
  readonly default: "#f0f0f0";
17
17
  };
18
18
  }, {
19
+ targetHead: import("vue").Ref<{
20
+ name: string;
21
+ key: string;
22
+ }[]>;
19
23
  props: import("@vue/shared").LooseRequired<{
20
24
  readonly loading: boolean;
21
25
  readonly dataSource: unknown[];
@@ -706,10 +710,6 @@ export declare const HtElTable: import("hfn-components/es/utils").SFCWithInstall
706
710
  readonly money_name: "金额(元)";
707
711
  };
708
712
  readonly convertKey: (data: any, key: string) => any;
709
- readonly TARGET_HEAD_KEY: {
710
- name: string;
711
- key: string;
712
- }[];
713
713
  readonly TARGET_END_KEY: {
714
714
  name: string;
715
715
  key: string;
@@ -16,6 +16,10 @@ declare const _default: import("vue").DefineComponent<{
16
16
  readonly default: "#f0f0f0";
17
17
  };
18
18
  }, {
19
+ targetHead: import("vue").Ref<{
20
+ name: string;
21
+ key: string;
22
+ }[]>;
19
23
  props: import("@vue/shared").LooseRequired<{
20
24
  readonly loading: boolean;
21
25
  readonly dataSource: unknown[];
@@ -706,10 +710,6 @@ declare const _default: import("vue").DefineComponent<{
706
710
  readonly money_name: "金额(元)";
707
711
  };
708
712
  readonly convertKey: (data: any, key: string) => any;
709
- readonly TARGET_HEAD_KEY: {
710
- name: string;
711
- key: string;
712
- }[];
713
713
  readonly TARGET_END_KEY: {
714
714
  name: string;
715
715
  key: string;
@@ -35,7 +35,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
35
35
  createElementVNode(
36
36
  "div",
37
37
  null,
38
- toDisplayString($setup.TARGET_HEAD_KEY.filter((items) => items.key === item.key.split("_")[0])[0].name),
38
+ toDisplayString($setup.targetHead.filter((items) => items.key === item.key.split("_")[0])[0].name),
39
39
  1
40
40
  /* TEXT */
41
41
  ),
@@ -1,8 +1,9 @@
1
- import { defineComponent } from 'vue';
1
+ import { defineComponent, ref, onMounted } from 'vue';
2
2
  import { ElTable, ElTableColumn, vLoading } from 'element-plus';
3
3
  import { TABLE_KEY, convertKey } from '../../../constants/table.mjs';
4
4
  import { TARGET_HEAD_KEY, TARGET_END_KEY } from '../../../constants/target.mjs';
5
5
  import '../../../constants/chartConfig.mjs';
6
+ import cloneDeep from 'lodash.clonedeep';
6
7
  import ColumnDeal from './columnDeal.vue.mjs';
7
8
  import { elTableProps } from './elTable.mjs';
8
9
 
@@ -11,8 +12,20 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
11
12
  props: elTableProps,
12
13
  setup(__props, { expose: __expose }) {
13
14
  __expose();
15
+ const targetHead = ref(cloneDeep(TARGET_HEAD_KEY));
16
+ onMounted(() => {
17
+ let startYear = 2018;
18
+ const nowYear = (/* @__PURE__ */ new Date()).getFullYear();
19
+ while (startYear <= nowYear) {
20
+ targetHead.value.push({
21
+ name: `${startYear}`,
22
+ key: `${startYear}`
23
+ });
24
+ startYear++;
25
+ }
26
+ });
14
27
  const props = __props;
15
- const __returned__ = { props, get ElTable() {
28
+ const __returned__ = { targetHead, props, get ElTable() {
16
29
  return ElTable;
17
30
  }, get ElTableColumn() {
18
31
  return ElTableColumn;
@@ -22,8 +35,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
22
35
  return TABLE_KEY;
23
36
  }, get convertKey() {
24
37
  return convertKey;
25
- }, get TARGET_HEAD_KEY() {
26
- return TARGET_HEAD_KEY;
27
38
  }, get TARGET_END_KEY() {
28
39
  return TARGET_END_KEY;
29
40
  }, ColumnDeal };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hfn-components",
3
- "version": "0.3.9",
3
+ "version": "0.4.0",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "module": "es/index.mjs",