htui-yllkbz 1.3.34 → 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 +88 -80
- package/lib/htui.common.js.gz +0 -0
- package/lib/htui.css +1 -1
- package/lib/htui.umd.js +88 -80
- 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/App.vue +27 -26
- package/src/packages/HtBaseData/index.vue +19 -15
- package/src/packages/HtMd/index.vue +28 -29
- package/src/packages/HtSelectBaseData/index.vue +3 -1
- package/src/packages/HtSelectOrg/index.vue +4 -1
- package/src/packages/HtSelectUser/index.vue +4 -1
- 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
package/src/App.vue
CHANGED
|
@@ -4,37 +4,38 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-11-15 14:41:40
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2022-
|
|
7
|
+
* @LastEditTime: 2022-07-10 16:50:19
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<div id="app">
|
|
11
|
-
<el-button type=""
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
<el-button type="" @click="test">测试</el-button>
|
|
12
|
+
<HtSelectBaseData
|
|
13
|
+
dataTypeId="chengbenzhongxin"
|
|
14
|
+
v-model="state.value"
|
|
15
|
+
@change="change"
|
|
16
|
+
></HtSelectBaseData>
|
|
16
17
|
|
|
17
|
-
<HtSelectOrg
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
<HtSelectOrg
|
|
19
|
+
:clearable="true"
|
|
20
|
+
:multiple="false"
|
|
21
|
+
v-model="state.value"
|
|
22
|
+
@change="testuser"
|
|
23
|
+
></HtSelectOrg>
|
|
21
24
|
<!-- <HtSelectOrg :clearable="true"
|
|
22
25
|
v-model="state.value"
|
|
23
26
|
@change="testuser"></HtSelectOrg> -->
|
|
24
|
-
-------------
|
|
25
|
-
|
|
26
|
-
----------
|
|
27
|
+
------------- ----------
|
|
27
28
|
<router-view></router-view>
|
|
28
29
|
</div>
|
|
29
30
|
</template>
|
|
30
31
|
|
|
31
32
|
<script lang="ts">
|
|
32
|
-
import { Component, Vue } from
|
|
33
|
-
import HtSelectBaseData from
|
|
34
|
-
import HtSelectOrg from
|
|
35
|
-
import HtSelectUser from
|
|
36
|
-
import HtShowBaseType from
|
|
37
|
-
import { mgr } from
|
|
33
|
+
import { Component, Vue } from 'vue-property-decorator';
|
|
34
|
+
import HtSelectBaseData from '@/packages/HtSelectBaseData';
|
|
35
|
+
import HtSelectOrg from '@/packages/HtSelectOrg';
|
|
36
|
+
import HtSelectUser from '@/packages/HtSelectUser';
|
|
37
|
+
import HtShowBaseType from '@/packages/HtShowBaseType';
|
|
38
|
+
import { mgr } from '@/plugins/oidc-client';
|
|
38
39
|
@Component({
|
|
39
40
|
components: {
|
|
40
41
|
HtSelectBaseData,
|
|
@@ -44,14 +45,14 @@ import { mgr } from "@/plugins/oidc-client";
|
|
|
44
45
|
})
|
|
45
46
|
export default class App extends Vue {
|
|
46
47
|
state = {
|
|
47
|
-
value: [
|
|
48
|
+
value: ['95bd1bfd-59d8-f88b-2b65-39f97d1da058'],
|
|
48
49
|
};
|
|
49
50
|
/** 生命周期 */
|
|
50
51
|
created() {
|
|
51
52
|
// 动态加载引用文件
|
|
52
|
-
const files = this.$store.getters.getBaseData(
|
|
53
|
+
const files = this.$store.getters.getBaseData('files');
|
|
53
54
|
const filesKeys = Object.keys(files);
|
|
54
|
-
let heatStr = document.getElementsByTagName(
|
|
55
|
+
let heatStr = document.getElementsByTagName('head')[0].innerHTML;
|
|
55
56
|
filesKeys.forEach((cur) => {
|
|
56
57
|
const src = files[cur];
|
|
57
58
|
if (src && /\.css$/.test(src.toString())) {
|
|
@@ -61,13 +62,13 @@ export default class App extends Vue {
|
|
|
61
62
|
heatStr += `<link rel="icon" href="${src}">`;
|
|
62
63
|
}
|
|
63
64
|
});
|
|
64
|
-
document.getElementsByTagName(
|
|
65
|
+
document.getElementsByTagName('head')[0].innerHTML = heatStr;
|
|
65
66
|
}
|
|
66
67
|
change() {
|
|
67
68
|
// console.log("eeee", e);
|
|
68
69
|
}
|
|
69
70
|
testuser(e: any) {
|
|
70
|
-
console.log(
|
|
71
|
+
console.log('eee', e);
|
|
71
72
|
}
|
|
72
73
|
test(e: any) {
|
|
73
74
|
//mgr.removeUser();
|
|
@@ -126,14 +127,14 @@ export default class App extends Vue {
|
|
|
126
127
|
|
|
127
128
|
<style lang="scss">
|
|
128
129
|
#app {
|
|
129
|
-
font-family:
|
|
130
|
+
font-family: 'SourceHanSansCN-Normal', 'Avenir', Helvetica, Arial, sans-serif;
|
|
130
131
|
-webkit-font-smoothing: antialiased;
|
|
131
132
|
-moz-osx-font-smoothing: grayscale;
|
|
132
133
|
color: #505050;
|
|
133
134
|
font-size: 14px;
|
|
134
135
|
}
|
|
135
136
|
body {
|
|
136
|
-
font-family:
|
|
137
|
+
font-family: 'SourceHanSansCN-Normal';
|
|
137
138
|
font-size: 14px;
|
|
138
139
|
}
|
|
139
140
|
</style>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
:style="comStyle || ''"
|
|
17
17
|
:filterable="!state.configJson['departmentId'].multiple"
|
|
18
18
|
:clearable="state.configJson['departmentId'].clearable"
|
|
19
|
-
:placeholder="`请选择部门`"
|
|
19
|
+
:placeholder="placeholder || `请选择部门`"
|
|
20
20
|
:collapse-tags="state.configJson['departmentId'].collapseTags"
|
|
21
21
|
v-model="state.selectVal['departmentId']"
|
|
22
22
|
:show-all-levels="state.configJson['departmentId'].showAllLevels"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
class="component-item"
|
|
41
41
|
:class="comClass"
|
|
42
42
|
:style="comStyle || ''"
|
|
43
|
-
:placeholder="`请选择部门`"
|
|
43
|
+
:placeholder="placeholder || `请选择部门`"
|
|
44
44
|
v-model="state.selectVal['departmentId']"
|
|
45
45
|
:props="{
|
|
46
46
|
label: 'name',
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
<!-- 选择人员 -->
|
|
64
64
|
<el-select
|
|
65
65
|
v-model="state.selectVal['userId']"
|
|
66
|
-
placeholder="请选择人员"
|
|
66
|
+
:placeholder="placeholder || '请选择人员'"
|
|
67
67
|
:filterable="!state.configJson['userId'].multiple"
|
|
68
68
|
:disabled="!!disabled"
|
|
69
69
|
:style="comStyle || ''"
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
:class="comClass"
|
|
119
119
|
:style="comStyle || ''"
|
|
120
120
|
:clearable="state.configJson['departmentUser'].clearable"
|
|
121
|
-
:placeholder="`请选择部门下人员`"
|
|
121
|
+
:placeholder="placeholder || `请选择部门下人员`"
|
|
122
122
|
:collapse-tags="state.configJson['departmentUser'].collapseTags"
|
|
123
123
|
v-model="state.selectVal['departmentUser']"
|
|
124
124
|
:show-all-levels="state.configJson['departmentUser'].showAllLevels"
|
|
@@ -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;
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
:style="panStyle"
|
|
175
175
|
:filterable="!state.configJson['departmentUser'].multiple"
|
|
176
176
|
class="component-item"
|
|
177
|
-
:placeholder="`请选择部门下人员`"
|
|
177
|
+
:placeholder="placeholder || `请选择部门下人员`"
|
|
178
178
|
v-model="state.selectVal['departmentUser']"
|
|
179
179
|
:props="{
|
|
180
180
|
label: 'name',
|
|
@@ -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;
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
:disabled="!!disabled"
|
|
234
234
|
:key="item.id"
|
|
235
235
|
:style="comStyle || ''"
|
|
236
|
-
placeholder="请选择严重等级"
|
|
236
|
+
:placeholder="placeholder || '请选择严重等级'"
|
|
237
237
|
:filterable="!state.configJson[item.code].multiple"
|
|
238
238
|
class="component-item"
|
|
239
239
|
@click.native="selectClick($event)"
|
|
@@ -268,7 +268,7 @@
|
|
|
268
268
|
:key="item.id"
|
|
269
269
|
:disabled="!!disabled"
|
|
270
270
|
:style="comStyle || ''"
|
|
271
|
-
placeholder="请选择响应列表"
|
|
271
|
+
:placeholder="placeholder || '请选择响应列表'"
|
|
272
272
|
:filterable="!state.configJson[item.code].multiple"
|
|
273
273
|
class="component-item"
|
|
274
274
|
@click.native="selectClick($event)"
|
|
@@ -303,7 +303,7 @@
|
|
|
303
303
|
>
|
|
304
304
|
<el-cascader
|
|
305
305
|
v-if="!state.configJson[item.code].panel"
|
|
306
|
-
:placeholder="`请选择${item.name}`"
|
|
306
|
+
:placeholder="placeholder || `请选择${item.name}`"
|
|
307
307
|
:disabled="!!disabled"
|
|
308
308
|
class="component-item"
|
|
309
309
|
:style="comStyle || ''"
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
<el-cascader-panel
|
|
331
331
|
v-else
|
|
332
332
|
@click.native="selectClick($event)"
|
|
333
|
-
:placeholder="`请选择${item.name}`"
|
|
333
|
+
:placeholder="placeholder || `请选择${item.name}`"
|
|
334
334
|
class="component-item"
|
|
335
335
|
:key="item.id"
|
|
336
336
|
:style="panStyle"
|
|
@@ -525,6 +525,7 @@ export default class CommonDatas extends Vue {
|
|
|
525
525
|
@Prop() comClass?: string;
|
|
526
526
|
/** 隐藏编码 */
|
|
527
527
|
@Prop() hideCode?: boolean;
|
|
528
|
+
@Prop() placeholder?: string;
|
|
528
529
|
/** 自定义style */
|
|
529
530
|
@Prop() comStyle?: string;
|
|
530
531
|
/** 自定义style */
|
|
@@ -678,7 +679,7 @@ export default class CommonDatas extends Vue {
|
|
|
678
679
|
/** 动态设置显示面板位置 */
|
|
679
680
|
|
|
680
681
|
selectClick(e: any) {
|
|
681
|
-
|
|
682
|
+
//
|
|
682
683
|
// 下拉选择框列表
|
|
683
684
|
//const list = window.document.getElementsByClassName("el-select-dropdown");
|
|
684
685
|
// (list as any).forEach((element: any) => {
|
|
@@ -734,12 +735,15 @@ export default class CommonDatas extends Vue {
|
|
|
734
735
|
}
|
|
735
736
|
);
|
|
736
737
|
}
|
|
737
|
-
if (!e
|
|
738
|
+
if (!e || !e.length) {
|
|
738
739
|
this.state.selectValData[key] = [];
|
|
739
740
|
}
|
|
741
|
+
|
|
740
742
|
this.$emit(
|
|
741
743
|
'change',
|
|
742
|
-
this.state.selectValData[key]
|
|
744
|
+
this.state.selectValData[key] && this.state.selectValData[key].length
|
|
745
|
+
? this.state.selectValData
|
|
746
|
+
: { [key]: [] }
|
|
743
747
|
);
|
|
744
748
|
}
|
|
745
749
|
/** 基础数据递归处理 */
|
|
@@ -903,7 +907,7 @@ export default class CommonDatas extends Vue {
|
|
|
903
907
|
}
|
|
904
908
|
</style>
|
|
905
909
|
<style lang="scss">
|
|
906
|
-
$primary-color:
|
|
910
|
+
$primary-color: var(--primary);
|
|
907
911
|
.component-item .el-input--suffix .el-input__inner {
|
|
908
912
|
background: none;
|
|
909
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>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-12-30 15:47:47
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2022-07-
|
|
7
|
+
* @LastEditTime: 2022-07-17 11:34:00
|
|
8
8
|
-->
|
|
9
9
|
|
|
10
10
|
<template>
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
<HtBaseData
|
|
21
21
|
v-else
|
|
22
22
|
:org="org"
|
|
23
|
+
:placeholder="placeholder"
|
|
23
24
|
:hide-code="hideCode"
|
|
24
25
|
:disabled="disabled"
|
|
25
26
|
com-style="background:#fff"
|
|
@@ -66,6 +67,7 @@ interface State {
|
|
|
66
67
|
export default class HtSelectBaseData extends Vue {
|
|
67
68
|
@Prop() value!: string;
|
|
68
69
|
@Prop() org?: string;
|
|
70
|
+
@Prop() placeholder?: string;
|
|
69
71
|
/** 是否禁用 */
|
|
70
72
|
@Prop({ default: false }) disabled?: boolean;
|
|
71
73
|
/* 是否只读 */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-12-30 14:29:14
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2022-07-
|
|
7
|
+
* @LastEditTime: 2022-07-17 11:32:50
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<span v-if="readonly">
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
</span>
|
|
18
18
|
<HtBaseData
|
|
19
19
|
v-else
|
|
20
|
+
:org="org"
|
|
21
|
+
:placeholder="placeholder"
|
|
20
22
|
:disabled="disabled"
|
|
21
23
|
com-style="background:#fff"
|
|
22
24
|
:config-json="configJson"
|
|
@@ -43,6 +45,7 @@ export default class HtSelectOrg extends Vue {
|
|
|
43
45
|
@Prop() value!: string;
|
|
44
46
|
/** 是否禁用 */
|
|
45
47
|
@Prop() disabled?: boolean;
|
|
48
|
+
@Prop() placeholder?: string;
|
|
46
49
|
@Prop() org?: string;
|
|
47
50
|
/** 是否可以清除 */
|
|
48
51
|
@Prop() clearable?: boolean;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-12-30 14:29:14
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2022-07-
|
|
7
|
+
* @LastEditTime: 2022-07-17 11:33:13
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<span v-if="readonly">
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
</span>
|
|
18
18
|
<HtBaseData
|
|
19
19
|
v-else
|
|
20
|
+
:org="org"
|
|
21
|
+
:placeholder="placeholder"
|
|
20
22
|
:disabled="disabled"
|
|
21
23
|
com-style="background:#fff"
|
|
22
24
|
:config-json="configJson"
|
|
@@ -44,6 +46,7 @@ export default class HtSelectUser extends Vue {
|
|
|
44
46
|
@Prop() org!: string;
|
|
45
47
|
/** 是否禁用 */
|
|
46
48
|
@Prop() disabled?: boolean;
|
|
49
|
+
@Prop() placeholder?: string;
|
|
47
50
|
/** 是否可以清除 */
|
|
48
51
|
@Prop() clearable?: boolean;
|
|
49
52
|
@Prop({ default: true }) show?: boolean;
|
|
@@ -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
|
+
}
|