htui-yllkbz 1.5.16 → 1.5.18

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.
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2022-07-18 15:01:02
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2023-01-03 14:20:57
7
+ * @LastEditTime: 2024-05-30 14:56:32
8
8
  */
9
9
  import moment from "moment";
10
10
  import { FormValues, TimeModes } from "./type";
@@ -218,3 +218,26 @@ export const getTimeValues = (cronExpression: string) => {
218
218
  const weekDay = +partitions[5] || 1;
219
219
  return { minute, hour, day, month, weekDay, periodUnit: currentPeriodUnit };
220
220
  };
221
+ /** 四舍六入五成双 */
222
+ export const roundHalfToEven = (num: number, precision = 2) => {
223
+ // 将数字乘以10的precision次方,使其小数点后只剩下需要保留的位数
224
+ const factor = Math.pow(10, precision);
225
+ let tempNum = num * factor;
226
+
227
+ // 判断是否需要进位
228
+ const digit = Math.round(tempNum) % 10;
229
+ if (digit >= 5 && digit <= 9) {
230
+ tempNum = Math.ceil(tempNum); // 进位
231
+ } else if (digit === 5) {
232
+ // 检查后一位数字来决定是否进位
233
+ const nextDigit = Math.floor((tempNum * 10) % 10);
234
+ if (nextDigit > 0) {
235
+ tempNum = Math.ceil(tempNum); // 进位
236
+ }
237
+ } else {
238
+ tempNum = Math.floor(tempNum); // 直接舍去
239
+ }
240
+
241
+ // 将结果除以10的precision次方,得到最终舍入后的结果
242
+ return tempNum / factor;
243
+ }
@@ -4,19 +4,19 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-11-15 14:41:40
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2023-08-10 16:41:07
7
+ * @LastEditTime: 2024-08-03 14:28:13
8
8
  -->
9
9
  <template>
10
10
  <div>
11
11
  <el-button @click="state.visible = true">打开</el-button>
12
- <ht-row :gutter="16" :copies="10" colMinHeight="56px">
12
+ <!-- <ht-row :gutter="16" :copies="10" colMinHeight="56px">
13
13
  <ht-col :span="2">iii</ht-col>
14
14
  <ht-col style="height:30px;border:1px solid #ccc" :span="4">iii</ht-col>
15
15
  <ht-col :span="2">iii</ht-col>
16
16
  <ht-col style="height:30px;border:1px solid #ccc" :span="4">iii</ht-col>
17
- </ht-row>
18
- <HtBread></HtBread>
19
- <HtMore>操作</HtMore>
17
+ </ht-row> -->
18
+ <!-- <HtBread></HtBread>
19
+ <HtMore>操作</HtMore> -->
20
20
  <!-- <HtSelectOrg :multiple="false"></HtSelectOrg> -->
21
21
  <!-- <el-button type=""
22
22
  @click="test">test</el-button> -->
@@ -34,56 +34,51 @@
34
34
  </template>
35
35
  </ht-count-down> -->
36
36
 
37
- <ht-md v-model="state.content" :subfield="true"></ht-md>
38
- <!-- <div ref="ht-pdf">
39
- <HtTable
40
- :data="state.data"
41
- :checked="true"
42
- :isExpand="true"
43
- :spanMethodProps="{
44
- colRows: ['name', 'age'],
45
- sameColRows: [],
46
- relateProps: { age: 'test.title,id' },
47
- }"
48
- :height="500"
49
- :columns="state.columns"
50
- >
37
+ <!-- <ht-md v-model="state.content" :subfield="true"></ht-md> -->
38
+ <div ref="ht-pdf">
39
+ <HtTable :data="state.data"
40
+ :showFilter="true"
41
+ :uuId="'dhjsgdshg8989354'"
42
+ :configShow="true"
43
+ :checked="false"
44
+ :isExpand="false"
45
+ :height="500"
46
+ :columns="state.columns">
51
47
  <template slot="header_time1">
52
48
  次数
53
49
  </template>
54
50
  <template slot="header_selectable">
55
51
  是否看一下
56
52
  </template>
57
- <template slot="selectable" slot-scope="{ row }">
53
+ <template slot="selectable"
54
+ slot-scope="{ row }">
58
55
  ----{{ row.selectable }}----yy
59
56
  </template>
60
57
  </HtTable>
61
- </div> -->
62
- <HtDrawer
63
- htClass="ht-new-drawer"
64
- @onOk="submitTest()"
65
- :footerRight="true"
66
- v-model="state.visible"
67
- :title="'买买买'"
68
- >
58
+ </div>
59
+ <HtDrawer htClass="ht-new-drawer"
60
+ @onOk="submitTest()"
61
+ :footerRight="true"
62
+ v-model="state.visible"
63
+ :title="'买买买'">
69
64
  考了多少会计数控了分手快乐
70
65
  </HtDrawer>
71
66
  </div>
72
67
  </template>
73
68
  <script lang="ts">
74
- import { Component, Vue } from 'vue-property-decorator';
75
- import HtTable from '@/packages/HtTable/index.vue';
76
- import HtCountDown from '@/packages/HtCountDown/index.vue';
77
- import HtSelectUser from '@/packages/HtSelectUser/index.vue';
78
- import HtSelectOrg from '@/packages/HtSelectOrg/index.vue';
79
- import HtRow from '@/packages/HtRow/index.vue';
80
- import HtCol from '@/packages/HtCol/index.vue';
81
- import { Column } from '@/packages/type';
82
- import HtDrawer from '@/packages/HtDrawer';
83
- import HtBread from '@/packages/HtBread';
84
- import HtMore from '@/packages/HtMore';
85
- import { getSpanMethod } from '@/packages/HtTable/table-span-method';
86
- import HtMd from '@/packages/HtMd';
69
+ import { Component, Vue } from "vue-property-decorator";
70
+ import HtTable from "@/packages/HtTable/index.vue";
71
+ import HtCountDown from "@/packages/HtCountDown/index.vue";
72
+ import HtSelectUser from "@/packages/HtSelectUser/index.vue";
73
+ import HtSelectOrg from "@/packages/HtSelectOrg/index.vue";
74
+ import HtRow from "@/packages/HtRow/index.vue";
75
+ import HtCol from "@/packages/HtCol/index.vue";
76
+ import { Column } from "@/packages/type";
77
+ import HtDrawer from "@/packages/HtDrawer";
78
+ import HtBread from "@/packages/HtBread";
79
+ import HtMore from "@/packages/HtMore";
80
+ import { getSpanMethod } from "@/packages/HtTable/table-span-method";
81
+ import HtMd from "@/packages/HtMd";
87
82
 
88
83
  interface State {
89
84
  /** 数据状态 */
@@ -115,117 +110,115 @@ export default class Index extends Vue {
115
110
  loading: false,
116
111
  visible: false,
117
112
  start: false,
118
- content: '',
113
+ content: "",
119
114
  colData: [],
120
115
  data: [
121
116
  {
122
- name: '胡涛',
123
- userId: 'f6f09c3c-cf45-863a-d625-3a0955dccc4c',
117
+ name: "胡涛",
118
+ userId: "f6f09c3c-cf45-863a-d625-3a0955dccc4c",
124
119
  selectable: true,
125
120
  times: 1,
126
121
 
127
122
  age: 12,
128
- sex:
129
- 'e49961a4f385e5d341ce3a01ee674c90ea9e037b734228fe26753a01ee674c90,e49961a4f385e5d341ce3a01ee674c90ea9e037b734228fe26753a01ee674c90',
123
+ sex: "e49961a4f385e5d341ce3a01ee674c90ea9e037b734228fe26753a01ee674c90,e49961a4f385e5d341ce3a01ee674c90ea9e037b734228fe26753a01ee674c90",
130
124
  id: 1,
131
- test: { title: '33476c23-9faa-22d3-3ee6-39f97d173566' },
132
- time: '2022-01-20T00:00:00+08:00',
125
+ test: { title: "33476c23-9faa-22d3-3ee6-39f97d173566" },
126
+ time: "2022-01-20T00:00:00+08:00",
133
127
  },
134
128
  {
135
- name: '胡涛',
136
- userId: 'f6f09c3c-cf45-863a-d625-3a0955dccc4c',
129
+ name: "胡涛",
130
+ userId: "f6f09c3c-cf45-863a-d625-3a0955dccc4c",
137
131
  times: 1,
138
132
  age: 12,
139
133
  selectable: false,
140
- sex: 'e49961a4f385e5d341ce3a01ee674c90ea9e037b734228fe26753a01ee674c90',
134
+ sex: "e49961a4f385e5d341ce3a01ee674c90ea9e037b734228fe26753a01ee674c90",
141
135
  id: 2,
142
- test: { title: '测试' },
143
- time: '2022-01-20T00:00:00+08:00',
136
+ test: { title: "测试" },
137
+ time: "2022-01-20T00:00:00+08:00",
144
138
  },
145
139
  {
146
- name: '胡涛1',
147
- userId: 'f6f09c3c-cf45-863a-d625-3a0955dccc4c',
140
+ name: "胡涛1",
141
+ userId: "f6f09c3c-cf45-863a-d625-3a0955dccc4c",
148
142
  age: 13,
149
143
  times: 1,
150
- sex: 'tt',
144
+ sex: "tt",
151
145
  id: 3,
152
- test: { title: '测试' },
153
- time: '2022-01-20T00:00:00+08:00',
146
+ test: { title: "测试" },
147
+ time: "2022-01-20T00:00:00+08:00",
154
148
  },
155
149
  {
156
- name: '胡涛',
157
- userId: 'f6f09c3c-cf45-863a-d625-3a0955dccc4c',
150
+ name: "胡涛",
151
+ userId: "f6f09c3c-cf45-863a-d625-3a0955dccc4c",
158
152
  age: 13,
159
153
  times: 4,
160
154
  file: [],
161
- sex: 'tt',
155
+ sex: "tt",
162
156
  id: 4,
163
- test: { title: '测试' },
164
- time: '2022-01-20T00:00:00+08:00',
157
+ test: { title: "测试" },
158
+ time: "2022-01-20T00:00:00+08:00",
165
159
  },
166
160
  {
167
- name: '胡涛',
168
- userId: 'f6f09c3c-cf45-863a-d625-3a0955dccc4c',
161
+ name: "胡涛",
162
+ userId: "f6f09c3c-cf45-863a-d625-3a0955dccc4c",
169
163
  age: 12,
170
164
  times: 8,
171
- sex: 'tt',
165
+ sex: "tt",
172
166
  id: 41,
173
- test: { title: '测试' },
174
- time: '2022-01-20T00:00:00+08:00',
167
+ test: { title: "测试" },
168
+ time: "2022-01-20T00:00:00+08:00",
175
169
  },
176
170
  ],
177
171
  columns: [
178
172
  {
179
- title: '姓名',
180
- key: 'test.title',
181
- width: '300px',
182
- property: 'base',
173
+ title: "姓名",
174
+ key: "test.title",
175
+ width: "300px",
176
+ property: "base",
183
177
  disabled: true,
184
- deafaultShow: true,
185
- style: 'color:red',
178
+
179
+ style: "color:red",
186
180
  },
187
181
  {
188
- title: 'userId',
189
- key: 'userId',
190
- width: '300px',
191
- type: 'userId',
182
+ title: "userId",
183
+ key: "userId",
184
+ width: "300px",
185
+ type: "userId",
192
186
  },
193
187
  {
194
- title: '姓额外名',
195
- key: 'namey',
188
+ title: "姓额外名",
189
+ key: "namey",
196
190
  children: [
197
191
  {
198
- title: '',
199
- key: 'name',
192
+ title: "",
193
+ key: "name",
200
194
  },
201
195
  {
202
- title: '',
203
- key: 'times',
196
+ title: "",
197
+ key: "times",
204
198
 
205
- align: 'center',
199
+ align: "center",
206
200
  },
207
201
  ],
208
202
  },
209
203
  {
210
- title: 'age',
211
- key: 'age',
204
+ title: "age",
205
+ key: "age",
212
206
  },
213
207
  {
214
- title: 'file',
215
- key: 'file',
216
- type: 'file',
208
+ title: "file",
209
+ key: "file",
210
+ type: "file",
217
211
  },
218
212
  {
219
- title: 'time',
220
- type: 'time',
213
+ title: "time",
214
+ type: "time",
221
215
  spread: true,
222
- key: 'time',
223
- deafaultShow: true,
216
+ key: "time",
224
217
  },
225
218
  {
226
- title: '性别',
227
- key: 'sex',
228
- type: 'file',
219
+ title: "性别",
220
+ key: "sex",
221
+ type: "file",
229
222
  },
230
223
  ],
231
224
  };
@@ -234,7 +227,7 @@ export default class Index extends Vue {
234
227
  //this.rewriteGetComputedStyle();
235
228
  }
236
229
  submitTest() {
237
- console.log('00000');
230
+ console.log("00000");
238
231
  }
239
232
  /** 方法 */
240
233
  // test(e) {
package/lib/demo.html DELETED
@@ -1,10 +0,0 @@
1
- <meta charset="utf-8">
2
- <title>htui demo</title>
3
- <script src="./htui.umd.js"></script>
4
-
5
- <link rel="stylesheet" href="./htui.css">
6
-
7
-
8
- <script>
9
- console.log(htui)
10
- </script>
Binary file
Binary file
Binary file
Binary file