htui-yllkbz 1.2.38 → 1.2.42

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.
Binary file
package/package.json CHANGED
@@ -1,54 +1,55 @@
1
- {
2
- "name": "htui-yllkbz",
3
- "version": "1.2.38",
4
- "typings": "types/index.d.ts",
5
- "main": "lib/htui.common.js",
6
- "style": "lib/htui.css",
7
- "private": false,
8
- "files": [
9
- "lib/**",
10
- "types",
11
- "src"
12
- ],
13
- "scripts": {
14
- "serve": "vue-cli-service serve",
15
- "build": "vue-cli-service build",
16
- "lint": "vue-cli-service lint",
17
- "lib": "vue-cli-service build --target lib --name htui --dest lib src/packages/index.ts",
18
- "publish": "npm run lib && npm publish",
19
- "build-exports": "vue-cli-service build --dest dist/components --target wc-async --name xhsj src/exports/* --inline-vue"
20
- },
21
- "dependencies": {
22
- "axios": "^0.21.0",
23
- "core-js": "^3.6.5",
24
- "element-ui": "^2.14.1",
25
- "htui-yllkbz": "^1.2.35",
26
- "mavon-editor": "^2.10.4",
27
- "moment": "^2.29.1",
28
- "vue": "^2.6.11",
29
- "vue-class-component": "^7.2.3",
30
- "vue-kst-auth": "^2.1.15",
31
- "vue-property-decorator": "^8.4.2",
32
- "vue-router": "^3.2.0",
33
- "vuex": "^3.4.0"
34
- },
35
- "devDependencies": {
36
- "@typescript-eslint/eslint-plugin": "^2.33.0",
37
- "@typescript-eslint/parser": "^2.33.0",
38
- "@vue/cli-plugin-babel": "^4.5.0",
39
- "@vue/cli-plugin-eslint": "^4.5.0",
40
- "@vue/cli-plugin-typescript": "^4.5.0",
41
- "@vue/cli-service": "^4.5.0",
42
- "@vue/eslint-config-prettier": "^6.0.0",
43
- "@vue/eslint-config-typescript": "^5.0.2",
44
- "compression-webpack-plugin": "^3.0.0",
45
- "eslint": "^6.7.2",
46
- "eslint-plugin-prettier": "^3.1.3",
47
- "eslint-plugin-vue": "^6.2.2",
48
- "prettier": "^1.19.1",
49
- "sass": "^1.26.5",
50
- "sass-loader": "^8.0.2",
51
- "typescript": "~3.9.3",
52
- "vue-template-compiler": "^2.6.11"
53
- }
54
- }
1
+ {
2
+ "name": "htui-yllkbz",
3
+ "version": "1.2.42",
4
+ "typings": "types/index.d.ts",
5
+ "main": "lib/htui.common.js",
6
+ "style": "lib/htui.css",
7
+ "private": false,
8
+ "files": [
9
+ "lib/**",
10
+ "types",
11
+ "src"
12
+ ],
13
+ "scripts": {
14
+ "serve": "vue-cli-service serve",
15
+ "build": "vue-cli-service build",
16
+ "lint": "vue-cli-service lint",
17
+ "lib": "vue-cli-service build --target lib --name htui --dest lib src/packages/index.ts",
18
+ "publish": "npm run lib && npm publish",
19
+ "build-exports": "vue-cli-service build --dest dist/components --target wc-async --name xhsj src/exports/* --inline-vue"
20
+ },
21
+ "dependencies": {
22
+ "axios": "^0.21.0",
23
+ "core-js": "^3.6.5",
24
+ "element-ui": "^2.14.1",
25
+ "html2canvas": "1.0.0-rc.1",
26
+ "htui-yllkbz": "^1.2.35",
27
+ "mavon-editor": "^2.10.4",
28
+ "moment": "^2.29.1",
29
+ "vue": "^2.6.11",
30
+ "vue-class-component": "^7.2.3",
31
+ "vue-kst-auth": "^2.1.15",
32
+ "vue-property-decorator": "^8.4.2",
33
+ "vue-router": "^3.2.0",
34
+ "vuex": "^3.4.0"
35
+ },
36
+ "devDependencies": {
37
+ "@typescript-eslint/eslint-plugin": "^2.33.0",
38
+ "@typescript-eslint/parser": "^2.33.0",
39
+ "@vue/cli-plugin-babel": "^4.5.0",
40
+ "@vue/cli-plugin-eslint": "^4.5.0",
41
+ "@vue/cli-plugin-typescript": "^4.5.0",
42
+ "@vue/cli-service": "^4.5.0",
43
+ "@vue/eslint-config-prettier": "^6.0.0",
44
+ "@vue/eslint-config-typescript": "^5.0.2",
45
+ "compression-webpack-plugin": "^3.0.0",
46
+ "eslint": "^6.7.2",
47
+ "eslint-plugin-prettier": "^3.1.3",
48
+ "eslint-plugin-vue": "^6.2.2",
49
+ "prettier": "^1.19.1",
50
+ "sass": "^1.26.5",
51
+ "sass-loader": "^8.0.2",
52
+ "typescript": "~3.9.3",
53
+ "vue-template-compiler": "^2.6.11"
54
+ }
55
+ }
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-12-21 16:24:07
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2021-12-26 11:41:28
7
+ * @LastEditTime: 2021-12-29 10:11:23
8
8
  -->
9
9
  <template>
10
10
  <div>
@@ -32,6 +32,10 @@ export default class HtCountDown extends Vue {
32
32
  @Prop() times!: number;
33
33
  /** 是否启动 */
34
34
  @Prop() start?: boolean;
35
+ /** 是否是秒表 */
36
+ @Prop() stopwatch?: boolean;
37
+ /** 刷新频率 --默认1000毫秒 */
38
+ @Prop() frequency?: number;
35
39
 
36
40
  /** 数据 */
37
41
  state: State = {
@@ -39,16 +43,49 @@ export default class HtCountDown extends Vue {
39
43
  count: 0,
40
44
  };
41
45
  timer: any = undefined;
46
+
42
47
  created() {
43
48
  /** 如果是传入的秒数 */
49
+
50
+ if (!this.stopwatch) {
51
+ if (this.times) {
52
+ this.state.count = this.times;
53
+ }
54
+ /** 如果传入的是哪一天 */
55
+ if (this.date) {
56
+ const sec =
57
+ (new Date(this.date).getTime() - new Date().getTime()) / 1000;
58
+ this.state.count = sec > 0 ? sec : 0;
59
+ }
60
+ } else {
61
+ //如果是秒表则启动秒表计时:
62
+ this.startStopWatch(true);
63
+ }
64
+ }
65
+ /** 秒表 */
66
+ startStopWatch(reset: boolean) {
67
+ if (reset) {
68
+ this.state.count = 0;
69
+ }
70
+
71
+ this.timer = setInterval(() => {
72
+ this.state.count = parseFloat(
73
+ (this.state.count + this.getFrequency / 1000).toFixed(5)
74
+ );
75
+ }, this.getFrequency);
76
+ }
77
+ /** 重置 */
78
+ reset() {
44
79
  if (this.times) {
80
+ clearInterval(this.timer);
45
81
  this.state.count = this.times;
82
+ this.getTimer();
46
83
  }
47
- /** 如果传入的是哪一天 */
48
- if (this.date) {
49
- const sec = (new Date(this.date).getTime() - new Date().getTime()) / 1000;
50
- this.state.count = sec > 0 ? sec : 0;
84
+ if (this.stopwatch) {
85
+ clearInterval(this.timer);
86
+ this.startStopWatch(true);
51
87
  }
88
+ //
52
89
  }
53
90
  /** 时间倒计时开始 */
54
91
  getTimer() {
@@ -57,10 +94,14 @@ export default class HtCountDown extends Vue {
57
94
  if (this.state.count === 0) {
58
95
  clearInterval(this.timer);
59
96
  }
60
- }, 1000);
97
+ }, this.getFrequency);
61
98
  }
62
99
  dateLess() {
63
100
  const total: number = this.state.count;
101
+
102
+ if (this.stopwatch) {
103
+ return total;
104
+ }
64
105
  if (!total) {
65
106
  return "--";
66
107
  }
@@ -110,15 +151,21 @@ export default class HtCountDown extends Vue {
110
151
  (new Date(this.date).getTime() - new Date().getTime()) / 1000;
111
152
  this.state.count = sec > 0 ? sec : 0;
112
153
  }
113
- if (!this.date && !this.times) {
154
+ if (this.stopwatch) {
155
+ this.startStopWatch(false);
156
+ } else if (!this.date && !this.times) {
114
157
  this.$notify.error("请先传入完成的参数");
115
158
  return;
159
+ } else {
160
+ this.getTimer();
116
161
  }
117
- this.getTimer();
118
162
  } else {
119
163
  clearInterval(this.timer);
120
164
  }
121
165
  }
166
+ get getFrequency() {
167
+ return this.frequency || 1000;
168
+ }
122
169
  }
123
170
  </script>
124
171
  <style lang='scss' scoped></style>
@@ -5,7 +5,7 @@
5
5
  * @Author: hutao
6
6
  * @Date: 2021-11-11 11:23:24
7
7
  * @LastEditors: hutao
8
- * @LastEditTime: 2021-12-23 14:58:42
8
+ * @LastEditTime: 2022-01-04 09:30:09
9
9
  -->
10
10
  <template>
11
11
  <div v-loading="state.loading">
@@ -120,6 +120,13 @@
120
120
  </div>
121
121
  <span v-else>--</span>
122
122
  </template>
123
+ <!-- 处理部门人员 -->
124
+ <template v-else-if="item.type==='boolean'">
125
+ <el-tag :type="'success'"
126
+ v-if="getPropByPath(row,item.key)">是</el-tag>
127
+ <el-tag type="danger"
128
+ v-else>否</el-tag>
129
+ </template>
123
130
  <!-- 其他 -->
124
131
  <span v-else>{{getPropByPath(row,item.key)}}</span>
125
132
  </slot>
@@ -157,7 +164,6 @@
157
164
  </template>
158
165
  <script lang='ts'>
159
166
  import { Component, Prop, Vue, Watch } from "vue-property-decorator";
160
- import { _axios } from "vue-kst-auth";
161
167
  import { Column, PageInfoType } from "@/packages/type";
162
168
  import PageInfo from "@/packages/PageInfo/index.vue";
163
169
  interface State {
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-10-21 10:08:41
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2021-12-26 11:20:23
7
+ * @LastEditTime: 2022-01-04 09:47:12
8
8
  */
9
9
 
10
10
  // 导入组件
@@ -19,6 +19,7 @@ import HtUpload from './HtUpload/index'
19
19
  import HtMd from './HtMd/index'
20
20
  import HtCountDown from './HtCountDown/index'
21
21
 
22
+
22
23
  // 存储组件列表
23
24
  const components = [HtSelectTable, HtPagination, HtTable, HtExport, HtUpload, HtMd, HtCountDown]
24
25
  // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-10-25 17:05:17
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2021-12-23 11:33:43
7
+ * @LastEditTime: 2022-01-04 09:55:26
8
8
  */
9
9
  /** 初始的默认条数 */
10
10
  export const defalutPageSize = 10
@@ -68,8 +68,8 @@ export interface Column {
68
68
  hide?: boolean;
69
69
  /** 时间是否跨行展示 */
70
70
  spread?: boolean;
71
- /** 通过type展示相应的数据 用户id|部门id|时间格式化*/
72
- type?: 'userId' | 'org' | 'time' | 'common',
71
+ /** 通过type展示相应的数据 用户id|部门id|时间格式化|是否布尔值*/
72
+ type?: 'userId' | 'org' | 'time' | 'common' | 'boolean',
73
73
  /** 只有当type='common'时候有效 数据类型个ca common里面的一样但不包括时间 时间使用time */
74
74
  commonType?: 'userId' | 'departmentId' | 'baseDataId' | 'roleId' | 'baseDataName' | 'baseDataValue',
75
75
  showOverflowTooltip?: boolean,
@@ -4,10 +4,15 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-11-15 14:41:40
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2021-12-21 14:28:09
7
+ * @LastEditTime: 2021-12-29 10:23:59
8
8
  */
9
9
  declare module "*.vue" {
10
10
  import Vue from "vue";
11
11
  export default Vue;
12
12
  }
13
+ declare module "*.js" {
14
+ const body: any
15
+
16
+ export default body;
17
+ }
13
18
  declare module "*.png"
@@ -4,33 +4,42 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-11-15 14:41:40
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2021-12-26 11:39:37
7
+ * @LastEditTime: 2022-01-04 09:47:44
8
8
  -->
9
9
  <template>
10
10
  <div>
11
- <el-tag type="">
12
- <ht-count-down :times="250"
11
+
12
+ <el-button type=""
13
+ @click="test">test</el-button>
14
+ <!-- <ht-count-down :stopwatch="true"
15
+ :frequency="200"
13
16
  :start="!state.start">
14
17
  <template slot-scope="{timeStr}">
15
18
  {{timeStr}}
16
19
  </template>
17
20
  </ht-count-down>
18
- </el-tag>
21
+ <ht-count-down :stopwatch="true"
22
+ :start="!state.start">
23
+ <template slot-scope="{timeStr}">
24
+ {{timeStr}}
25
+ </template>
26
+ </ht-count-down> -->
19
27
 
20
28
  <ht-md v-model="state.content"
21
29
  :subfield="true"></ht-md>
22
- <HtTable :data="state.data"
23
- @onchange="test"
24
- :height="200"
25
- :columns="state.columns">
26
- <div slot="sex"
27
- slot-scope="{row}">{{row.sex?'男':'女'}}</div>
28
- <div slot="age"
29
- slot-scope="{row}">
30
- <el-tag>{{row.age}}</el-tag>
31
- </div>
32
- <div slot="header_name">测试名字</div>
33
- </HtTable>
30
+ <div ref="ht-pdf">
31
+ <HtTable :data="state.data"
32
+ :height="200"
33
+ :columns="state.columns">
34
+ <div slot="sex"
35
+ slot-scope="{row}">{{row.sex?'男':'女'}}</div>
36
+ <div slot="age"
37
+ slot-scope="{row}">
38
+ <el-tag>{{row.age}}</el-tag>
39
+ </div>
40
+ <div slot="header_name">测试名字</div>
41
+ </HtTable>
42
+ </div>
34
43
  <!-- <el-dropdown>
35
44
  <el-select placeholder="请选择">
36
45
  </el-select>
@@ -143,10 +152,24 @@ export default class Index extends Vue {
143
152
  ],
144
153
  };
145
154
  /** 生命周期 */
155
+ created() {
156
+ //this.rewriteGetComputedStyle();
157
+ }
146
158
  /** 方法 */
147
159
  test() {
160
+ (this.$refs.pdf as any).exportPdf(this.$refs["ht-pdf"]);
148
161
  //console.log("ee", e);
149
162
  }
163
+ // rewriteGetComputedStyle() {
164
+ // const getComputedStyle = window.getComputedStyle;
165
+ // window.getComputedStyle = function (element: any, property) {
166
+ // console.log("element", element, typeof element);
167
+ // if (element != "localhost:8080") {
168
+ // return getComputedStyle(element.host || element, property);
169
+ // }
170
+ // return "";
171
+ // };
172
+ // }
150
173
  save(e: string, f: string) {
151
174
  console.log("e,f", e, f);
152
175
  }