htui-yllkbz 1.3.84 → 1.3.85
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 +1099 -44
- package/lib/htui.common.js.gz +0 -0
- package/lib/htui.css +1 -1
- package/lib/htui.umd.js +1099 -44
- package/lib/htui.umd.js.gz +0 -0
- package/lib/htui.umd.min.js +12 -12
- package/lib/htui.umd.min.js.gz +0 -0
- package/package.json +1 -1
- package/src/App.vue +16 -1
- package/src/packages/HtMore/index.ts +15 -0
- package/src/packages/HtMore/index.vue +78 -0
- package/src/packages/HtSelectCron/index.ts +14 -0
- package/src/packages/HtSelectCron/index.vue +193 -0
- package/src/packages/HtSelectCron/selectDays.vue +58 -0
- package/src/packages/HtSelectCron/selectHours.vue +58 -0
- package/src/packages/HtSelectCron/selectMin.vue +60 -0
- package/src/packages/HtSelectCron/selectMonth.vue +58 -0
- package/src/packages/HtSelectCron/selectWeekDay.vue +76 -0
- package/src/packages/HtSelectTimeSlot/index.ts +14 -0
- package/src/packages/HtSelectTimeSlot/index.vue +186 -0
- package/src/packages/HtTable/index.vue +2 -2
- package/src/packages/HtUpload/index.vue +95 -83
- package/src/packages/common.ts +65 -2
- package/src/packages/index.ts +5 -3
- package/src/packages/type.ts +21 -1
package/lib/htui.umd.min.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-11-15 14:41:40
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime:
|
|
7
|
+
* @LastEditTime: 2023-01-08 16:17:30
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<div id="app">
|
|
@@ -35,6 +35,16 @@
|
|
|
35
35
|
v-model="state.value"
|
|
36
36
|
@change="testuser"></HtSelectOrg> -->
|
|
37
37
|
------------- ----------
|
|
38
|
+
<HtSelectTimeSlot
|
|
39
|
+
v-model="state.timeValue"
|
|
40
|
+
:width="'60px'"
|
|
41
|
+
></HtSelectTimeSlot>
|
|
42
|
+
<HtSelectTimeSlot
|
|
43
|
+
v-model="state.timeValue"
|
|
44
|
+
:readonly="true"
|
|
45
|
+
:width="'60px'"
|
|
46
|
+
></HtSelectTimeSlot>
|
|
47
|
+
<HtMore></HtMore>
|
|
38
48
|
<router-view></router-view>
|
|
39
49
|
</div>
|
|
40
50
|
</template>
|
|
@@ -45,6 +55,8 @@ import HtSelectBaseData from '@/packages/HtSelectBaseData';
|
|
|
45
55
|
import HtSelectOrg from '@/packages/HtSelectOrg';
|
|
46
56
|
import HtSelectUser from '@/packages/HtSelectUser';
|
|
47
57
|
import HtShowBaseType from '@/packages/HtShowBaseType';
|
|
58
|
+
import HtSelectTimeSlot from '@/packages/HtSelectTimeSlot';
|
|
59
|
+
import HtMore from '@/packages/HtMore';
|
|
48
60
|
import { mgr } from '@/plugins/oidc-client';
|
|
49
61
|
@Component({
|
|
50
62
|
components: {
|
|
@@ -52,11 +64,14 @@ import { mgr } from '@/plugins/oidc-client';
|
|
|
52
64
|
HtSelectOrg,
|
|
53
65
|
HtShowBaseType,
|
|
54
66
|
HtSelectUser,
|
|
67
|
+
HtSelectTimeSlot,
|
|
68
|
+
HtMore,
|
|
55
69
|
},
|
|
56
70
|
})
|
|
57
71
|
export default class App extends Vue {
|
|
58
72
|
state = {
|
|
59
73
|
value: ['95bd1bfd-59d8-f88b-2b65-39f97d1da058'],
|
|
74
|
+
timeValue: undefined,
|
|
60
75
|
};
|
|
61
76
|
/** 生命周期 */
|
|
62
77
|
created() {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Descripttion: 更多三个点功能
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2022-04-12 17:34:51
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2023-01-08 16:16:28
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import HtMore from "./index.vue";
|
|
11
|
+
(HtMore as any).install = function (Vue: any) {
|
|
12
|
+
|
|
13
|
+
Vue.component("HtMore", HtMore);
|
|
14
|
+
};
|
|
15
|
+
export default HtMore;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Descripttion: 更多
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2022-09-28 10:24:08
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2023-01-08 17:15:00
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<el-dropdown :trigger="trigger" @command="handleCommand($event, 'command')">
|
|
11
|
+
<span class="el-dropdown-link">
|
|
12
|
+
<slot>
|
|
13
|
+
<div class="ht-link-title" style="cursor:pointer" :style="comStyle">
|
|
14
|
+
<div class="ht-link-item" style="height:5px">.</div>
|
|
15
|
+
<div class="ht-link-item" style="height:5px">.</div>
|
|
16
|
+
<div class="ht-link-item" style="height:5px">.</div>
|
|
17
|
+
</div>
|
|
18
|
+
</slot>
|
|
19
|
+
</span>
|
|
20
|
+
<el-dropdown-menu slot="dropdown">
|
|
21
|
+
<slot name="dropdown">
|
|
22
|
+
<el-dropdown-item v-if="!!showTabs.includes('edit')" command="edit"
|
|
23
|
+
>编辑</el-dropdown-item
|
|
24
|
+
>
|
|
25
|
+
<el-popconfirm
|
|
26
|
+
@confirm="handleCommand('delete', 'confirm')"
|
|
27
|
+
v-if="!!showTabs.includes('delete')"
|
|
28
|
+
:title="`请确认是否删除${tips ? `【${tips}】` : ''}?`"
|
|
29
|
+
>
|
|
30
|
+
<el-dropdown-item slot="reference" command="delete"
|
|
31
|
+
>删除</el-dropdown-item
|
|
32
|
+
>
|
|
33
|
+
</el-popconfirm>
|
|
34
|
+
</slot>
|
|
35
|
+
</el-dropdown-menu>
|
|
36
|
+
</el-dropdown>
|
|
37
|
+
</template>
|
|
38
|
+
<script lang="ts">
|
|
39
|
+
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
|
|
40
|
+
interface State {
|
|
41
|
+
/** 数据状态 */
|
|
42
|
+
loading: boolean;
|
|
43
|
+
/** 弹窗 */
|
|
44
|
+
visible: boolean;
|
|
45
|
+
}
|
|
46
|
+
@Component({
|
|
47
|
+
name: 'HtMore',
|
|
48
|
+
components: {},
|
|
49
|
+
})
|
|
50
|
+
export default class Index extends Vue {
|
|
51
|
+
/** droptitle的样式 */
|
|
52
|
+
@Prop() comStyle?: string;
|
|
53
|
+
@Prop({ default: 'delete' }) showTabs!: string[];
|
|
54
|
+
@Prop({ default: 'click' }) trigger?: string;
|
|
55
|
+
/** 删除的文字提示 */
|
|
56
|
+
@Prop({ default: '' }) tips?: string;
|
|
57
|
+
/** 数据 */
|
|
58
|
+
state: State = {
|
|
59
|
+
loading: false,
|
|
60
|
+
visible: false,
|
|
61
|
+
};
|
|
62
|
+
/** 生命周期 */
|
|
63
|
+
handleCommand(e: string, type: string) {
|
|
64
|
+
if (type === 'command' && e === 'delete') {
|
|
65
|
+
//不管
|
|
66
|
+
} else {
|
|
67
|
+
this.$emit('callback', e);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** 计算属性 */
|
|
72
|
+
}
|
|
73
|
+
</script>
|
|
74
|
+
<style lang="scss" scoped>
|
|
75
|
+
.ht-link-title:hover {
|
|
76
|
+
color: var(--primary);
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Descripttion:cron表达式选择
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2021-11-15 15:00:57
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2023-01-03 14:15:44
|
|
8
|
+
*/
|
|
9
|
+
import HtSelectCron from "./index.vue";
|
|
10
|
+
(HtSelectCron as any).install = function (Vue: any) {
|
|
11
|
+
|
|
12
|
+
Vue.component("HtSelectCron", HtSelectCron);
|
|
13
|
+
};
|
|
14
|
+
export default HtSelectCron;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Descripttion:
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2022-12-20 15:33:00
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2023-01-03 14:54:19
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<div>
|
|
11
|
+
每
|
|
12
|
+
<select-min
|
|
13
|
+
:disabled="disabled"
|
|
14
|
+
:width="width"
|
|
15
|
+
:readonly="readonly"
|
|
16
|
+
class="ht-select-time"
|
|
17
|
+
@change="change"
|
|
18
|
+
v-if="state.formData.periodUnit === 'Minute'"
|
|
19
|
+
v-model="state.formData.minute"
|
|
20
|
+
></select-min>
|
|
21
|
+
<el-select
|
|
22
|
+
:disabled="disabled"
|
|
23
|
+
:readonly="readonly"
|
|
24
|
+
:width="width"
|
|
25
|
+
class="ht-select-time"
|
|
26
|
+
@change="change"
|
|
27
|
+
v-model="state.formData.periodUnit"
|
|
28
|
+
>
|
|
29
|
+
<el-option
|
|
30
|
+
v-for="item in modes"
|
|
31
|
+
:key="item.value"
|
|
32
|
+
:label="item.label"
|
|
33
|
+
:value="item.value"
|
|
34
|
+
></el-option>
|
|
35
|
+
</el-select>
|
|
36
|
+
|
|
37
|
+
<template v-if="state.formData.periodUnit !== 'Minute'">
|
|
38
|
+
的
|
|
39
|
+
<select-month
|
|
40
|
+
:width="width"
|
|
41
|
+
:disabled="disabled"
|
|
42
|
+
:readonly="readonly"
|
|
43
|
+
class="ht-select-time"
|
|
44
|
+
@change="change"
|
|
45
|
+
v-if="state.formData.periodUnit === 'Year'"
|
|
46
|
+
v-model="state.formData.month"
|
|
47
|
+
></select-month>
|
|
48
|
+
<select-days
|
|
49
|
+
:width="width"
|
|
50
|
+
:disabled="disabled"
|
|
51
|
+
:readonly="readonly"
|
|
52
|
+
class="ht-select-time"
|
|
53
|
+
@change="change"
|
|
54
|
+
v-if="showDays"
|
|
55
|
+
v-model="state.formData.day"
|
|
56
|
+
></select-days>
|
|
57
|
+
<select-week-day
|
|
58
|
+
:width="width"
|
|
59
|
+
:disabled="disabled"
|
|
60
|
+
:readonly="readonly"
|
|
61
|
+
class="ht-select-time"
|
|
62
|
+
@change="change"
|
|
63
|
+
v-if="state.formData.periodUnit === 'Week'"
|
|
64
|
+
v-model="state.formData.weekDay"
|
|
65
|
+
></select-week-day>
|
|
66
|
+
<select-hours
|
|
67
|
+
:width="width"
|
|
68
|
+
:disabled="disabled"
|
|
69
|
+
:readonly="readonly"
|
|
70
|
+
class="ht-select-time"
|
|
71
|
+
@change="change"
|
|
72
|
+
v-if="showHours"
|
|
73
|
+
v-model="state.formData.hour"
|
|
74
|
+
></select-hours>
|
|
75
|
+
<select-min
|
|
76
|
+
:width="width"
|
|
77
|
+
:disabled="disabled"
|
|
78
|
+
:readonly="readonly"
|
|
79
|
+
class="ht-select-time"
|
|
80
|
+
@change="change"
|
|
81
|
+
v-model="state.formData.minute"
|
|
82
|
+
></select-min>
|
|
83
|
+
</template>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
86
|
+
<script lang="ts">
|
|
87
|
+
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
|
|
88
|
+
import {
|
|
89
|
+
getCronExpressionByPartition,
|
|
90
|
+
getTimeValues,
|
|
91
|
+
} from '../../packages/common';
|
|
92
|
+
import { FormValues } from '../type';
|
|
93
|
+
import SelectDays from './selectDays.vue';
|
|
94
|
+
import SelectHours from './selectHours.vue';
|
|
95
|
+
import SelectMin from './selectMin.vue';
|
|
96
|
+
import SelectMonth from './selectMonth.vue';
|
|
97
|
+
import SelectWeekDay from './selectWeekDay.vue';
|
|
98
|
+
interface State {
|
|
99
|
+
/** 数据状态 */
|
|
100
|
+
loading: boolean;
|
|
101
|
+
formData: FormValues;
|
|
102
|
+
}
|
|
103
|
+
@Component({
|
|
104
|
+
name: 'HtSelectCron',
|
|
105
|
+
components: {
|
|
106
|
+
SelectDays,
|
|
107
|
+
SelectHours,
|
|
108
|
+
SelectMin,
|
|
109
|
+
SelectMonth,
|
|
110
|
+
SelectWeekDay,
|
|
111
|
+
},
|
|
112
|
+
})
|
|
113
|
+
export default class Index extends Vue {
|
|
114
|
+
/** cron表达式 */
|
|
115
|
+
@Prop() value!: string;
|
|
116
|
+
@Prop() disabled!: boolean;
|
|
117
|
+
@Prop() readonly!: boolean;
|
|
118
|
+
@Prop() width!: boolean;
|
|
119
|
+
/** 数据 */
|
|
120
|
+
state: State = {
|
|
121
|
+
loading: false,
|
|
122
|
+
formData: {
|
|
123
|
+
periodUnit: undefined,
|
|
124
|
+
month: undefined,
|
|
125
|
+
day: undefined,
|
|
126
|
+
hour: undefined,
|
|
127
|
+
minute: undefined,
|
|
128
|
+
weekDay: undefined,
|
|
129
|
+
cronExpression: undefined,
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
/** 生命周期 */
|
|
133
|
+
/** 方法 */
|
|
134
|
+
/** 时间选择改变时候 */
|
|
135
|
+
change() {
|
|
136
|
+
this.state.formData.cronExpression = getCronExpressionByPartition(
|
|
137
|
+
this.state.formData
|
|
138
|
+
);
|
|
139
|
+
this.$emit('input', this.state.formData.cronExpression);
|
|
140
|
+
this.$emit('change', this.state.formData.cronExpression);
|
|
141
|
+
}
|
|
142
|
+
get modes() {
|
|
143
|
+
return [
|
|
144
|
+
{ label: '分钟', value: 'Minute' },
|
|
145
|
+
{ label: '小时', value: 'Hour' },
|
|
146
|
+
{ label: '天', value: 'Day' },
|
|
147
|
+
{ label: '周', value: 'Week' },
|
|
148
|
+
{ label: '月', value: 'Month' },
|
|
149
|
+
{ label: '年', value: 'Year' },
|
|
150
|
+
];
|
|
151
|
+
}
|
|
152
|
+
/** 什么时候展示天 */
|
|
153
|
+
get showDays() {
|
|
154
|
+
const show = ['Month', 'Year'];
|
|
155
|
+
const { periodUnit } = this.state.formData;
|
|
156
|
+
return show.includes(periodUnit || 'undefined');
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** 什么时候展示小时的选择 */
|
|
160
|
+
get showHours() {
|
|
161
|
+
const show = ['Day', 'Week', 'Month', 'Year'];
|
|
162
|
+
const { periodUnit } = this.state.formData;
|
|
163
|
+
return show.includes(periodUnit || 'undefined');
|
|
164
|
+
}
|
|
165
|
+
get showCron() {
|
|
166
|
+
return this.state.formData.cronExpression;
|
|
167
|
+
}
|
|
168
|
+
/** 监听 */
|
|
169
|
+
@Watch('value', { immediate: true })
|
|
170
|
+
getValue(value?: string) {
|
|
171
|
+
if (value) {
|
|
172
|
+
this.state.formData = getTimeValues(value);
|
|
173
|
+
this.state.formData.cronExpression = value;
|
|
174
|
+
} else {
|
|
175
|
+
this.state.formData = {
|
|
176
|
+
//periodUnit: TimeModes.Minute,
|
|
177
|
+
periodUnit: undefined,
|
|
178
|
+
month: undefined,
|
|
179
|
+
day: undefined,
|
|
180
|
+
hour: undefined,
|
|
181
|
+
minute: 10,
|
|
182
|
+
weekDay: undefined,
|
|
183
|
+
cronExpression: undefined,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
</script>
|
|
189
|
+
<style lang="scss" scoped>
|
|
190
|
+
.ht-select-time {
|
|
191
|
+
width: 90px;
|
|
192
|
+
}
|
|
193
|
+
</style>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Descripttion: 选择天
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2022-12-20 15:46:15
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2023-01-03 15:51:16
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<el-select
|
|
11
|
+
v-if="!readonly"
|
|
12
|
+
:style="`width:${width}`"
|
|
13
|
+
clearable
|
|
14
|
+
:disabled="disabled"
|
|
15
|
+
@change="change"
|
|
16
|
+
v-model="state.value"
|
|
17
|
+
>
|
|
18
|
+
<el-option
|
|
19
|
+
v-for="item in 31"
|
|
20
|
+
:key="item"
|
|
21
|
+
:label="`${item}日`"
|
|
22
|
+
:value="item"
|
|
23
|
+
></el-option>
|
|
24
|
+
</el-select>
|
|
25
|
+
<span v-else>{{ state.value ? state.value + '日' : '' }}</span>
|
|
26
|
+
</template>
|
|
27
|
+
<script lang="ts">
|
|
28
|
+
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
|
|
29
|
+
interface State {
|
|
30
|
+
/** 数据状态 */
|
|
31
|
+
loading: boolean;
|
|
32
|
+
value?: number;
|
|
33
|
+
}
|
|
34
|
+
@Component
|
|
35
|
+
export default class Index extends Vue {
|
|
36
|
+
@Prop() value?: number;
|
|
37
|
+
@Prop() disabled?: boolean;
|
|
38
|
+
@Prop() readonly?: boolean;
|
|
39
|
+
@Prop() width?: number | string;
|
|
40
|
+
/** 数据 */
|
|
41
|
+
state: State = {
|
|
42
|
+
loading: false,
|
|
43
|
+
value: undefined,
|
|
44
|
+
};
|
|
45
|
+
/** 生命周期 */
|
|
46
|
+
/** 方法 */
|
|
47
|
+
change() {
|
|
48
|
+
this.$emit('input', this.state.value);
|
|
49
|
+
this.$emit('change', this.state.value);
|
|
50
|
+
}
|
|
51
|
+
/** 监听 */
|
|
52
|
+
@Watch('value', { immediate: true })
|
|
53
|
+
getValue(value?: number) {
|
|
54
|
+
this.state.value = value;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
</script>
|
|
58
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Descripttion: 选择小时
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2022-12-20 15:46:15
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2023-01-03 15:51:21
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<el-select
|
|
11
|
+
:style="`width:${width}`"
|
|
12
|
+
v-if="!readonly"
|
|
13
|
+
clearable
|
|
14
|
+
:disabled="disabled"
|
|
15
|
+
@change="change"
|
|
16
|
+
v-model="state.value"
|
|
17
|
+
>
|
|
18
|
+
<el-option
|
|
19
|
+
v-for="(item, index) in 24"
|
|
20
|
+
:key="index"
|
|
21
|
+
:label="`${index < 10 ? '0' + index : index}时`"
|
|
22
|
+
:value="index"
|
|
23
|
+
></el-option>
|
|
24
|
+
</el-select>
|
|
25
|
+
<span v-else>{{ state.value ? state.value + '时' : '' }}</span>
|
|
26
|
+
</template>
|
|
27
|
+
<script lang="ts">
|
|
28
|
+
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
|
|
29
|
+
interface State {
|
|
30
|
+
/** 数据状态 */
|
|
31
|
+
loading: boolean;
|
|
32
|
+
value?: number;
|
|
33
|
+
}
|
|
34
|
+
@Component
|
|
35
|
+
export default class Index extends Vue {
|
|
36
|
+
@Prop() value?: number;
|
|
37
|
+
@Prop() disabled?: boolean;
|
|
38
|
+
@Prop() width?: number | string;
|
|
39
|
+
@Prop() readonly?: boolean;
|
|
40
|
+
/** 数据 */
|
|
41
|
+
state: State = {
|
|
42
|
+
loading: false,
|
|
43
|
+
value: undefined,
|
|
44
|
+
};
|
|
45
|
+
/** 生命周期 */
|
|
46
|
+
/** 方法 */
|
|
47
|
+
change() {
|
|
48
|
+
this.$emit('input', this.state.value);
|
|
49
|
+
this.$emit('change', this.state.value);
|
|
50
|
+
}
|
|
51
|
+
/** 监听 */
|
|
52
|
+
@Watch('value', { immediate: true })
|
|
53
|
+
getValue(value?: number) {
|
|
54
|
+
this.state.value = value;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
</script>
|
|
58
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Descripttion: 选择分钟
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2022-12-20 15:46:15
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2023-01-03 15:51:26
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<el-select
|
|
11
|
+
v-if="!readonly"
|
|
12
|
+
:style="`width:${width}`"
|
|
13
|
+
:disabled="disabled"
|
|
14
|
+
clearable
|
|
15
|
+
:readonly="readonly"
|
|
16
|
+
@change="change"
|
|
17
|
+
v-model="state.value"
|
|
18
|
+
>
|
|
19
|
+
<el-option
|
|
20
|
+
v-for="(item, index) in 60"
|
|
21
|
+
:key="index"
|
|
22
|
+
:label="`${index < 10 ? '0' + index : index}分`"
|
|
23
|
+
:value="index"
|
|
24
|
+
></el-option>
|
|
25
|
+
</el-select>
|
|
26
|
+
<span v-else>{{ state.value ? state.value + '分' : '' }}</span>
|
|
27
|
+
</template>
|
|
28
|
+
<script lang="ts">
|
|
29
|
+
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
|
|
30
|
+
interface State {
|
|
31
|
+
/** 数据状态 */
|
|
32
|
+
loading: boolean;
|
|
33
|
+
value?: number;
|
|
34
|
+
}
|
|
35
|
+
@Component
|
|
36
|
+
export default class Index extends Vue {
|
|
37
|
+
@Prop() value?: number;
|
|
38
|
+
@Prop() disabled?: boolean;
|
|
39
|
+
@Prop() readonly?: boolean;
|
|
40
|
+
@Prop() width?: number | string;
|
|
41
|
+
|
|
42
|
+
/** 数据 */
|
|
43
|
+
state: State = {
|
|
44
|
+
loading: false,
|
|
45
|
+
value: undefined,
|
|
46
|
+
};
|
|
47
|
+
/** 生命周期 */
|
|
48
|
+
/** 方法 */
|
|
49
|
+
change() {
|
|
50
|
+
this.$emit('input', this.state.value);
|
|
51
|
+
this.$emit('change', this.state.value);
|
|
52
|
+
}
|
|
53
|
+
/** 监听 */
|
|
54
|
+
@Watch('value', { immediate: true })
|
|
55
|
+
getValue(value?: number) {
|
|
56
|
+
this.state.value = value;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
60
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Descripttion: 选择月份
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2022-12-20 15:46:15
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2023-01-03 15:51:29
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<el-select
|
|
11
|
+
v-if="!readonly"
|
|
12
|
+
:style="`width:${width}`"
|
|
13
|
+
:disabled="disabled"
|
|
14
|
+
@change="change"
|
|
15
|
+
clearable
|
|
16
|
+
v-model="state.value"
|
|
17
|
+
>
|
|
18
|
+
<el-option
|
|
19
|
+
v-for="item in 12"
|
|
20
|
+
:key="item"
|
|
21
|
+
:label="`${item}月`"
|
|
22
|
+
:value="item"
|
|
23
|
+
></el-option>
|
|
24
|
+
</el-select>
|
|
25
|
+
<span v-else>{{ state.value ? state.value + '月' : '' }}</span>
|
|
26
|
+
</template>
|
|
27
|
+
<script lang="ts">
|
|
28
|
+
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
|
|
29
|
+
interface State {
|
|
30
|
+
/** 数据状态 */
|
|
31
|
+
loading: boolean;
|
|
32
|
+
value?: number;
|
|
33
|
+
}
|
|
34
|
+
@Component
|
|
35
|
+
export default class Index extends Vue {
|
|
36
|
+
@Prop() value?: number;
|
|
37
|
+
@Prop() disabled?: boolean;
|
|
38
|
+
@Prop() readonly?: boolean;
|
|
39
|
+
@Prop() width?: number | string;
|
|
40
|
+
/** 数据 */
|
|
41
|
+
state: State = {
|
|
42
|
+
loading: false,
|
|
43
|
+
value: undefined,
|
|
44
|
+
};
|
|
45
|
+
/** 生命周期 */
|
|
46
|
+
/** 方法 */
|
|
47
|
+
change() {
|
|
48
|
+
this.$emit('input', this.state.value);
|
|
49
|
+
this.$emit('change', this.state.value);
|
|
50
|
+
}
|
|
51
|
+
/** 监听 */
|
|
52
|
+
@Watch('value', { immediate: true })
|
|
53
|
+
getValue(value?: number) {
|
|
54
|
+
this.state.value = value;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
</script>
|
|
58
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Descripttion: 选择周几
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2022-12-20 15:46:15
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2023-01-03 15:51:35
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<el-select
|
|
11
|
+
v-if="!readonly"
|
|
12
|
+
:style="`width:${width}`"
|
|
13
|
+
:disabled="disabled"
|
|
14
|
+
@change="change"
|
|
15
|
+
clearable
|
|
16
|
+
v-model="state.value"
|
|
17
|
+
>
|
|
18
|
+
<el-option
|
|
19
|
+
v-for="(item, index) in options"
|
|
20
|
+
:key="index"
|
|
21
|
+
:label="item.label"
|
|
22
|
+
:value="index + 1"
|
|
23
|
+
></el-option>
|
|
24
|
+
</el-select>
|
|
25
|
+
<span v-else>{{ getName }}</span>
|
|
26
|
+
</template>
|
|
27
|
+
<script lang="ts">
|
|
28
|
+
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
|
|
29
|
+
interface State {
|
|
30
|
+
/** 数据状态 */
|
|
31
|
+
loading: boolean;
|
|
32
|
+
value?: number;
|
|
33
|
+
}
|
|
34
|
+
@Component
|
|
35
|
+
export default class Index extends Vue {
|
|
36
|
+
@Prop() value?: number;
|
|
37
|
+
@Prop() disabled?: boolean;
|
|
38
|
+
@Prop() readonly?: boolean;
|
|
39
|
+
@Prop() width?: number | string;
|
|
40
|
+
/** 数据 */
|
|
41
|
+
state: State = {
|
|
42
|
+
loading: false,
|
|
43
|
+
value: undefined,
|
|
44
|
+
};
|
|
45
|
+
/** 生命周期 */
|
|
46
|
+
/** 方法 */
|
|
47
|
+
change() {
|
|
48
|
+
this.$emit('input', this.state.value);
|
|
49
|
+
this.$emit('change', this.state.value);
|
|
50
|
+
}
|
|
51
|
+
/** 监听 */
|
|
52
|
+
@Watch('value', { immediate: true })
|
|
53
|
+
getValue(value?: number) {
|
|
54
|
+
this.state.value = value;
|
|
55
|
+
}
|
|
56
|
+
get getName() {
|
|
57
|
+
const { value } = this.state;
|
|
58
|
+
return value
|
|
59
|
+
? this.options.find((item) => item.value === value)?.label
|
|
60
|
+
: '';
|
|
61
|
+
}
|
|
62
|
+
/** 计算属性 */
|
|
63
|
+
get options() {
|
|
64
|
+
return [
|
|
65
|
+
{ label: '星期一', value: 1 },
|
|
66
|
+
{ label: '星期二', value: 2 },
|
|
67
|
+
{ label: '星期三', value: 3 },
|
|
68
|
+
{ label: '星期四', value: 4 },
|
|
69
|
+
{ label: '星期五', value: 5 },
|
|
70
|
+
{ label: '星期六', value: 6 },
|
|
71
|
+
{ label: '星期天', value: 7 },
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
</script>
|
|
76
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Descripttion:选择时间段
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2021-11-15 15:00:57
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2023-01-03 14:39:35
|
|
8
|
+
*/
|
|
9
|
+
import HtSelectTimeSlot from "./index.vue";
|
|
10
|
+
(HtSelectTimeSlot as any).install = function (Vue: any) {
|
|
11
|
+
|
|
12
|
+
Vue.component("HtSelectTimeSlot", HtSelectTimeSlot);
|
|
13
|
+
};
|
|
14
|
+
export default HtSelectTimeSlot;
|