htui-yllkbz 1.3.36 → 1.3.37
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.
- package/lib/htui.common.js +48 -48
- package/lib/htui.common.js.gz +0 -0
- package/lib/htui.css +1 -1
- package/lib/htui.umd.js +48 -48
- package/lib/htui.umd.js.gz +0 -0
- package/lib/htui.umd.min.js +3 -3
- package/lib/htui.umd.min.js.gz +0 -0
- package/package.json +1 -1
- package/src/packages/HtBaseData/index.vue +3 -3
- package/src/packages/HtMd/index.vue +28 -29
- package/src/packages/common.ts +70 -0
- package/src/packages/style.scss +43 -0
package/lib/htui.umd.min.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
float: left;
|
|
146
146
|
width: 14px;
|
|
147
147
|
height: 14px;
|
|
148
|
-
background:
|
|
148
|
+
background: var(--primary);
|
|
149
149
|
line-height: 34px;
|
|
150
150
|
margin-top: 10px;
|
|
151
151
|
border-radius: 10px;
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
float: left;
|
|
199
199
|
width: 14px;
|
|
200
200
|
height: 14px;
|
|
201
|
-
background:
|
|
201
|
+
background: var(--primary);
|
|
202
202
|
line-height: 34px;
|
|
203
203
|
margin-top: 10px;
|
|
204
204
|
border-radius: 10px;
|
|
@@ -907,7 +907,7 @@ export default class CommonDatas extends Vue {
|
|
|
907
907
|
}
|
|
908
908
|
</style>
|
|
909
909
|
<style lang="scss">
|
|
910
|
-
$primary-color:
|
|
910
|
+
$primary-color: var(--primary);
|
|
911
911
|
.component-item .el-input--suffix .el-input__inner {
|
|
912
912
|
background: none;
|
|
913
913
|
height: 32px !important;
|
|
@@ -4,24 +4,26 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-12-21 16:24:07
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime:
|
|
7
|
+
* @LastEditTime: 2022-07-18 14:59:56
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
|
-
<mavon-editor
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
<mavon-editor
|
|
11
|
+
v-model="state.content"
|
|
12
|
+
:subfield="subfield"
|
|
13
|
+
default_open="{}"
|
|
14
|
+
ref="md"
|
|
15
|
+
@save="save"
|
|
16
|
+
:placeholder="placeholder"
|
|
17
|
+
:editable="!disabled"
|
|
18
|
+
@imgAdd="addImg"
|
|
19
|
+
@change="change"
|
|
20
|
+
/>
|
|
19
21
|
</template>
|
|
20
|
-
<script lang=
|
|
21
|
-
import { Component, Prop, Vue, Watch } from
|
|
22
|
-
import mavonEditor from
|
|
23
|
-
import
|
|
24
|
-
import { _axios } from
|
|
22
|
+
<script lang="ts">
|
|
23
|
+
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
|
|
24
|
+
import mavonEditor from 'mavon-editor';
|
|
25
|
+
import 'mavon-editor/dist/css/index.css';
|
|
26
|
+
import { _axios } from 'vue-kst-auth';
|
|
25
27
|
Vue.use(mavonEditor);
|
|
26
28
|
interface State {
|
|
27
29
|
/** 数据状态 */
|
|
@@ -43,7 +45,7 @@ export default class HtMd extends Vue {
|
|
|
43
45
|
/** 数据 */
|
|
44
46
|
state: State = {
|
|
45
47
|
loading: false,
|
|
46
|
-
content:
|
|
48
|
+
content: '',
|
|
47
49
|
};
|
|
48
50
|
/** 生命周期 */
|
|
49
51
|
created() {
|
|
@@ -53,17 +55,17 @@ export default class HtMd extends Vue {
|
|
|
53
55
|
/** 添加图片 */
|
|
54
56
|
addImg(e: number, f: File) {
|
|
55
57
|
if (this.changImg) {
|
|
56
|
-
this.$emit(
|
|
58
|
+
this.$emit('callBackImg', e, f);
|
|
57
59
|
return;
|
|
58
60
|
}
|
|
59
61
|
const formdata = new FormData();
|
|
60
|
-
formdata.append(
|
|
62
|
+
formdata.append('file', f);
|
|
61
63
|
//将下面上传接口替换为你自己的服务器接口
|
|
62
64
|
_axios({
|
|
63
|
-
url:
|
|
64
|
-
method:
|
|
65
|
+
url: '/files/api/filing/file/upload',
|
|
66
|
+
method: 'post',
|
|
65
67
|
data: formdata,
|
|
66
|
-
headers: {
|
|
68
|
+
headers: { 'Content-Type': 'multipart/form-data' },
|
|
67
69
|
}).then((res) => {
|
|
68
70
|
if (res.status === 200) {
|
|
69
71
|
(this.$refs.md as any).$img2Url(
|
|
@@ -72,28 +74,25 @@ export default class HtMd extends Vue {
|
|
|
72
74
|
);
|
|
73
75
|
}
|
|
74
76
|
});
|
|
75
|
-
|
|
76
77
|
//
|
|
77
78
|
}
|
|
78
79
|
/** 实时改变 */
|
|
79
80
|
change(e: string, text: string) {
|
|
80
|
-
this.$emit(
|
|
81
|
-
|
|
82
|
-
this.$emit("change", e, text);
|
|
83
|
-
|
|
81
|
+
this.$emit('input', e);
|
|
82
|
+
this.$emit('change', e, text);
|
|
84
83
|
//
|
|
85
84
|
}
|
|
86
85
|
/** 保存数据 */
|
|
87
86
|
save(e: string, text: string) {
|
|
88
|
-
this.$emit(
|
|
87
|
+
this.$emit('save', e, text);
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
/** 监听 */
|
|
92
|
-
@Watch(
|
|
91
|
+
@Watch('value', { deep: true })
|
|
93
92
|
onContent(val: string) {
|
|
94
93
|
this.state.content = val;
|
|
95
94
|
}
|
|
96
95
|
/** 计算属性 */
|
|
97
96
|
}
|
|
98
97
|
</script>
|
|
99
|
-
<style lang=
|
|
98
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Descripttion:
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2022-07-18 15:01:02
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2022-07-18 15:03:00
|
|
8
|
+
*/
|
|
9
|
+
import moment from "moment";
|
|
10
|
+
|
|
11
|
+
/** 生成唯一Id
|
|
12
|
+
* @params e 生成的id位数 默认32
|
|
13
|
+
*/
|
|
14
|
+
export const randomString = (e = 32) => {
|
|
15
|
+
/** 生成格式17位的时间YYYY-MM-DD HH:mm:ss.SSS加(e-17)位的随机数 */
|
|
16
|
+
const t = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz23456789",
|
|
17
|
+
a = t.length;
|
|
18
|
+
const now = moment().format('YYYYMMDDHHmmssSSS')
|
|
19
|
+
let n = "";
|
|
20
|
+
if (e > 17) {
|
|
21
|
+
n = now
|
|
22
|
+
|
|
23
|
+
for (let i = 0; i < (e - 17); i++) {
|
|
24
|
+
n += t.charAt(Math.floor(Math.random() * a));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else if (e === 17) {
|
|
28
|
+
n = now
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
for (let i = 0; i < e; i++) {
|
|
32
|
+
n += t.charAt(Math.floor(Math.random() * a));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return n;
|
|
37
|
+
}
|
|
38
|
+
/** 时间计算
|
|
39
|
+
@params fromDate 开始时间
|
|
40
|
+
@params toDate 结束时间
|
|
41
|
+
*/
|
|
42
|
+
export const dateLess = (fromDate: string, toDate: string) => {
|
|
43
|
+
if (fromDate && toDate) {
|
|
44
|
+
const date = new Date(fromDate);
|
|
45
|
+
const date2 = new Date(toDate);
|
|
46
|
+
const s1: number = date.getTime(),
|
|
47
|
+
s2 = date2.getTime();
|
|
48
|
+
const total: number = (s2 - s1) / 1000;
|
|
49
|
+
const day: number = parseInt((total / (24 * 60 * 60)).toString()); //计算整数天数
|
|
50
|
+
const afterDay: number = total - day * 24 * 60 * 60; //取得算出天数后剩余的秒数
|
|
51
|
+
const hour: number = parseInt((afterDay / (60 * 60)).toString()); //计算整数小时数
|
|
52
|
+
const afterHour = total - day * 24 * 60 * 60 - hour * 60 * 60; //取得算出小时数后剩余的秒数
|
|
53
|
+
const min: number = parseInt((afterHour / 60).toString()); //计算整数分
|
|
54
|
+
const afterMin: number =
|
|
55
|
+
parseInt((total - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60).toString()); //取得算出分后剩余的秒数
|
|
56
|
+
if (day === 0) {
|
|
57
|
+
if (hour === 0) {
|
|
58
|
+
return min + "分" + afterMin + "秒";
|
|
59
|
+
} else {
|
|
60
|
+
return hour + "小时" + min + "分" + afterMin + "秒";
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
return day + "天" + hour + "小时" + min + "分" + afterMin + "秒";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
return "-"
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}
|
package/src/packages/style.scss
CHANGED
|
@@ -11,3 +11,46 @@
|
|
|
11
11
|
float: right;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
.component-item {
|
|
15
|
+
width: 100%;
|
|
16
|
+
+ .component-item {
|
|
17
|
+
margin-top: 10px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
.item-origin {
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
border-width: 0px 7px;
|
|
23
|
+
margin-right: 6px;
|
|
24
|
+
border-style: solid;
|
|
25
|
+
}
|
|
26
|
+
$primary-color: var(--primary);
|
|
27
|
+
.component-item .el-input--suffix .el-input__inner {
|
|
28
|
+
background: none;
|
|
29
|
+
height: 32px !important;
|
|
30
|
+
}
|
|
31
|
+
.component-item .is-disabled .el-input__inner {
|
|
32
|
+
background: #f5f5f5;
|
|
33
|
+
}
|
|
34
|
+
.ht-user-dot {
|
|
35
|
+
padding: 0;
|
|
36
|
+
margin: 0;
|
|
37
|
+
float: left;
|
|
38
|
+
width: 14px;
|
|
39
|
+
height: 14px;
|
|
40
|
+
background: $primary-color;
|
|
41
|
+
line-height: 34px;
|
|
42
|
+
margin-top: 10px;
|
|
43
|
+
border-radius: 10px;
|
|
44
|
+
margin-right: 4px;
|
|
45
|
+
}
|
|
46
|
+
.ht-user-name {
|
|
47
|
+
padding: 0;
|
|
48
|
+
margin: 0;
|
|
49
|
+
float: left;
|
|
50
|
+
}
|
|
51
|
+
.ht-user-dot-disabled {
|
|
52
|
+
background: #ccc;
|
|
53
|
+
}
|
|
54
|
+
.ht-user-disabled {
|
|
55
|
+
color: #ddd;
|
|
56
|
+
}
|