@utogether/udp-core 1.0.1-beta.9 → 1.0.2
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/build/plugins.ts +37 -39
- package/dist/{403-BOzKHdlm.js → 403-B1rIjAAu.js} +6 -6
- package/dist/{404-uwgt4Nll.js → 404-mBqc2y4t.js} +4 -4
- package/dist/{500-4HBf6V9m.js → 500-BoI45Zdh.js} +2 -2
- package/dist/{AuthorityInfo-DvbIh1vT.js → AuthorityInfo-B08NBIIn.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-BlCPvwXU.js → AuthorityInfo.vue_vue_type_style_index_0_lang-BLP1SaiH.js} +3 -3
- package/dist/{Company-D7Q9BFmr.js → Company-JGGyWEWH.js} +3 -3
- package/dist/{CompanyPanel-C0-PJlrt.js → CompanyPanel-BQ_cCmDx.js} +7 -7
- package/dist/{Department-h2hlXACv.js → Department-z2iO6hwM.js} +10 -10
- package/dist/{DepartmentPanel-B6hDEQpG.js → DepartmentPanel-BtQe7zwU.js} +108 -78
- package/dist/{DesignPanel-cS58-1v9.js → DesignPanel-7mhtVWas.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-LdvLC8VU.js → DesignPanel.vue_vue_type_style_index_0_lang-4EsHemj_.js} +6 -6
- package/dist/{DictView-T3TmpBa8.js → DictView-CjchV2Yk.js} +15 -16
- package/dist/InvOrganization-Pn1O_XP0.js +74 -0
- package/dist/{Org-CnCBDGKF.js → Org-BqytV_vi.js} +1 -1
- package/dist/{Preview-BaktKXB1.js → Preview-CLpUUMay.js} +2 -2
- package/dist/{ReportDefine-5Rb0PO9A.js → ReportDefine-Cz1KtEUF.js} +1 -1
- package/dist/{ReportDesign-DYdkVREA.js → ReportDesign-BaORYud4.js} +13 -13
- package/dist/{ReportQuery-BwhzIXMt.js → ReportQuery-CPCPXiXz.js} +1 -1
- package/dist/{ReportQueryFrom-PHtWwlOe.js → ReportQueryFrom-C_AcrfkJ.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-BE5yZNPM.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-Bm67ejay.js} +1 -1
- package/dist/{ReportTemplate-DaadVXIi.js → ReportTemplate-CFiNMz79.js} +11 -11
- package/dist/{Role-Dtg3nAmG.js → Role-B-XDoJd5.js} +3 -3
- package/dist/{RoleAssign-DEGtLssH.js → RoleAssign-BolW8YVs.js} +8 -8
- package/dist/{RolePanel-DpUzfE_o.js → RolePanel-2kfs5tw9.js} +1 -1
- package/dist/{RolePanel-CT7BTPmy.js → RolePanel-HilSuYns.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-Xyo0YEI0.js → RolePanel.vue_vue_type_script_setup_true_lang-CE4gApUY.js} +7 -7
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-Dg2A6DJu.js → RolePanel.vue_vue_type_script_setup_true_lang-DPzgfAyV.js} +13 -13
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-CyutzDZS.js → ScrollPanel.vue_vue_type_style_index_0_lang-CCTH4RkH.js} +4 -4
- package/dist/{Staff-_NlAGkrh.js → Staff-BTk3whFC.js} +3 -3
- package/dist/{StaffInfo-DVgUvVgd.js → StaffInfo-d3AuSzlA.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-C8hmlFgX.js → StaffInfo.vue_vue_type_script_setup_true_lang-eOL4VlfE.js} +5 -5
- package/dist/{StaffPanel-DKNZE3IE.js → StaffPanel-DV-D4jjz.js} +1 -1
- package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-4sFq3CEo.js +135 -0
- package/dist/{SysUser-kQUf7XKz.js → SysUser-BnjYytws.js} +2 -2
- package/dist/{SysUserPanel-C191uX3U.js → SysUserPanel-CBoyD-Qi.js} +1 -1
- package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-PrTlTZR-.js +341 -0
- package/dist/{SystemMenu-DwuSvHnj.js → SystemMenu-kYB_ZaUt.js} +36 -36
- package/dist/{UserInfo-DIsInFld.js → UserInfo-4dx97VBL.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-CnvGdbej.js → UserInfo.vue_vue_type_style_index_0_lang-BpbC_ZDm.js} +10 -10
- package/dist/{childView-3Bs2UBEw.js → childView-CHPNfTEb.js} +1 -1
- package/dist/{childView-BawyULD7.js → childView-CKA_JgVZ.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-YpWF-p2F.js → childView.vue_vue_type_style_index_0_lang-Bym2fQRd.js} +7 -7
- package/dist/childView.vue_vue_type_style_index_0_lang-W7bCtXeu.js +177 -0
- package/dist/{code-rule-DVaYcn8S.js → code-rule-CbxuZg0-.js} +40 -38
- package/dist/core.es.js +18 -12
- package/dist/{cron-task-xuzP-BpE.js → cron-task-nTOpqQYf.js} +7 -7
- package/dist/flow-task-B07st2aD.js +10 -0
- package/dist/{frameView-Cudt06qS.js → frameView-Z1tPUyCh.js} +1 -1
- package/dist/index-C3q8HoJM.js +4650 -0
- package/dist/{layoutView-BlFTV2jX.js → layoutView--MGA9zUB.js} +1766 -1760
- package/dist/{log-in-e7D5Ss1P.js → log-in-CSYJDA6m.js} +36 -29
- package/dist/log-out-DiwGCg7p.js +130 -0
- package/dist/login-C6Y0ajDp.js +251 -0
- package/dist/{login-log-kqKzKTto.js → login-log-C0V-_l3F.js} +5 -3
- package/dist/{lov-view-B2HaxyMs.js → lov-view-Cmv7wZZ9.js} +6 -6
- package/dist/{menuInfo-BxCTJ1VW.js → menuInfo-UeutJpOa.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-CLOPNeUW.js → menuInfo.vue_vue_type_style_index_0_lang-CWX4Mu67.js} +118 -98
- package/dist/{pda-app-DPsAFNiw.js → pda-app-B6w99SJo.js} +10 -10
- package/dist/{resource-Dibb7t8u.js → resource-BybJvUv0.js} +4 -4
- package/dist/{su-welcome-DejR0KkM.js → su-welcome-C1bmxHoY.js} +119 -121
- package/dist/sys-config-BnmIDnCj.js +370 -0
- package/dist/udp-core.css +1 -9
- package/dist/utogether-MlnyYtNS.js +4 -0
- package/index.ts +49 -40
- package/package.json +18 -18
- package/src/App.vue +65 -65
- package/src/api/http.ts +1 -4
- package/src/api/index.ts +4 -2
- package/src/api/user.ts +2 -2
- package/src/components/SuCharts/src/UserInfo.vue +78 -78
- package/src/components/SuScrollTree/ScrollPanel.vue +1 -6
- package/src/components/udp/content/index.vue +88 -0
- package/src/components/udp/{form.vue → form/form.vue} +13 -16
- package/src/components/udp/{grid.vue → grid/index.vue} +56 -27
- package/src/components/udp/index.ts +4 -9
- package/src/components/udp/ut-stamp-badge/index.vue +271 -0
- package/src/components/udp/utils.ts +66 -105
- package/src/layout/components/lay-navbar/index.vue +8 -6
- package/src/layout/components/lay-panel/index.vue +150 -150
- package/src/layout/components/lay-search/index.vue +25 -25
- package/src/layout/components/lay-select-org/index.vue +4 -9
- package/src/layout/components/lay-setting/index.vue +503 -510
- package/src/layout/components/lay-sidebar/horizontal.vue +8 -6
- package/src/layout/components/lay-sidebar/mixNav.vue +260 -258
- package/src/layout/components/lay-sidebar/sidebar-logo.vue +101 -98
- package/src/layout/components/lay-tag/index.vue +24 -51
- package/src/layout/hooks/useDataThemeChange.ts +1 -1
- package/src/layout/hooks/useNav.ts +176 -173
- package/src/layout/hooks/useTag.ts +227 -233
- package/src/layout/types.ts +93 -92
- package/src/main.ts +115 -119
- package/src/plugins/i18n/en.ts +302 -302
- package/src/plugins/i18n/module/u-workflow.ts +1 -1
- package/src/plugins/i18n/zh.ts +21 -6
- package/src/plugins/vxe-table/index.ts +116 -53
- package/src/plugins/vxe-table/render.tsx +945 -956
- package/src/router/index.ts +17 -17
- package/src/router/modules/flow.ts +35 -0
- package/src/router/modules/home.ts +32 -32
- package/src/router/modules/remaining.ts +58 -58
- package/src/router/utils.ts +420 -377
- package/src/store/modules/app.ts +2 -4
- package/src/store/modules/epTheme.ts +48 -49
- package/src/store/modules/multiTags.ts +15 -14
- package/src/store/modules/permission.ts +25 -15
- package/src/store/modules/system.ts +1 -3
- package/src/style/button.scss +85 -85
- package/src/style/login.css +1 -1
- package/src/style/vxetable.scss +61 -2
- package/src/utils/dataFormat/index.ts +223 -223
- package/src/utils/index.ts +3 -1
- package/src/utils/lifecycle.ts +39 -20
- package/src/utils/propTypes.ts +1 -6
- package/src/utils/storage/index.ts +2 -2
- package/src/utils/udp/http/index.ts +24 -11
- package/src/utils/udp/http/types.d.ts +3 -10
- package/src/views/login/login-view.vue +4 -18
- package/src/views/organization/company/CompanyPanel.vue +259 -259
- package/src/views/organization/department/Department.vue +58 -58
- package/src/views/organization/department/DepartmentPanel.vue +303 -283
- package/src/views/organization/inv-org/InvOrganization.vue +22 -7
- package/src/views/organization/staff/StaffInfo.vue +127 -133
- package/src/views/organization/staff/StaffPanel.vue +162 -145
- package/src/views/system/cron/cron-task.vue +2 -12
- package/src/views/system/menu/SystemMenu.vue +185 -183
- package/src/views/system/menu/menuInfo.vue +384 -363
- package/src/views/system/role/UserInfo.vue +195 -195
- package/src/views/system/role-assign/RoleAssign.vue +57 -57
- package/src/views/system/role-assign/RolePanel.vue +139 -139
- package/src/views/system/sys/sys-config.vue +69 -20
- package/src/views/system/sysUser/SysUserPanel.vue +97 -28
- package/src/views/uapp/pda/pda-app.vue +208 -208
- package/src/views/udev/coderule/code-rule.vue +132 -121
- package/src/views/udev/dict/DictView.vue +2 -2
- package/src/views/udev/dict/childView.vue +183 -222
- package/src/views/udev/lov/childView.vue +1 -7
- package/src/views/udev/lov/lov-view.vue +91 -91
- package/src/views/uhome/components/menu-favorite.vue +314 -331
- package/src/views/uhome/su-welcome.vue +319 -339
- package/src/views/ulogin/login.vue +325 -321
- package/src/views/upms/interface/log-in.vue +100 -106
- package/src/views/upms/interface/log-out.vue +104 -107
- package/src/views/upms/user/login-log.vue +54 -60
- package/src/views/urpt/design/DesignPanel.vue +507 -507
- package/src/views/urpt/design/Preview.vue +1 -0
- package/src/views/urpt/design/ReportDesign.vue +2 -4
- package/src/views/utask/flow-task.vue +18 -0
- package/types/global.d.ts +231 -236
- package/dist/InvOrganization-BVuOhzbt.js +0 -66
- package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-BOOO6Cek.js +0 -111
- package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-SwNbAEvW.js +0 -294
- package/dist/childView.vue_vue_type_style_index_0_lang-DWIFCX3X.js +0 -187
- package/dist/index-CKnq5xIa.js +0 -2623
- package/dist/log-out--RRncZhN.js +0 -120
- package/dist/login-CpKykfdf.js +0 -253
- package/dist/sys-config-DiySRWns.js +0 -277
- package/dist/utogether-Dct_14Zk.js +0 -182
- package/src/components/udp/count-down.vue +0 -536
- package/src/components/udp/flip-down/FlipCard/flip-card.vue +0 -251
- package/src/components/udp/flip-down/FlipCard/interfaces.ts +0 -4
- package/src/components/udp/flip-down/FlipClock/flip-clock.vue +0 -113
- package/src/components/udp/form-upload.vue +0 -482
- package/src/components/udp/lov.vue +0 -388
- package/src/components/udp/modal-form.vue +0 -189
- package/src/components/udp/modal-grid.vue +0 -288
- package/src/components/udp/upload.vue +0 -423
- package/src/utils/udp/useRender.ts +0 -431
|
@@ -1,536 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flip-clock">
|
|
3
|
-
<template v-for="data in timeData" :key="data.label">
|
|
4
|
-
<span v-show="data.show" :id="data.elementId" class="flip-clock__piece">
|
|
5
|
-
<div v-if="flipAnimation">
|
|
6
|
-
<span
|
|
7
|
-
class="flip-clock__card flip-card"
|
|
8
|
-
:style="countdownSize ? `font-size:${countdownSize}` : ''"
|
|
9
|
-
>
|
|
10
|
-
<b class="flip-card__top">{{ twoDigits(data.current) }}</b>
|
|
11
|
-
<b class="flip-card__bottom" :data-value="twoDigits(data.current)" />
|
|
12
|
-
<b class="flip-card__back" :data-value="twoDigits(data.previous)" />
|
|
13
|
-
<b class="flip-card__back-bottom" :data-value="twoDigits(data.previous)" />
|
|
14
|
-
</span>
|
|
15
|
-
</div>
|
|
16
|
-
<div v-else>
|
|
17
|
-
<span class="no-animation__card">{{ twoDigits(data.current) }}</span>
|
|
18
|
-
</div>
|
|
19
|
-
<span
|
|
20
|
-
v-if="showLabels"
|
|
21
|
-
class="flip-clock__slot"
|
|
22
|
-
:style="labelSize ? `font-size:${labelSize}` : ''"
|
|
23
|
-
>{{ data.label }}</span
|
|
24
|
-
>
|
|
25
|
-
</span>
|
|
26
|
-
</template>
|
|
27
|
-
</div>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<script lang="ts">
|
|
31
|
-
export default {
|
|
32
|
-
name: 'SuCountdown'
|
|
33
|
-
};
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<script setup lang="ts">
|
|
37
|
-
import { computed, onBeforeMount, onMounted, onUnmounted, ref, watch } from 'vue';
|
|
38
|
-
import dayjs from 'dayjs';
|
|
39
|
-
|
|
40
|
-
const props = defineProps({
|
|
41
|
-
countdown: {
|
|
42
|
-
type: Boolean,
|
|
43
|
-
default: false
|
|
44
|
-
},
|
|
45
|
-
deadline: {
|
|
46
|
-
type: String,
|
|
47
|
-
required: false,
|
|
48
|
-
default: dayjs().add(5, 'days').format('YYYY-MM-DD HH:mm:ss')
|
|
49
|
-
},
|
|
50
|
-
deadlineISO: {
|
|
51
|
-
type: String,
|
|
52
|
-
required: false
|
|
53
|
-
},
|
|
54
|
-
deadlineDate: {
|
|
55
|
-
type: Date,
|
|
56
|
-
required: false
|
|
57
|
-
},
|
|
58
|
-
countdownSize: {
|
|
59
|
-
type: String,
|
|
60
|
-
required: false
|
|
61
|
-
// default:"2.2rem"
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
labelSize: {
|
|
65
|
-
type: String,
|
|
66
|
-
required: false
|
|
67
|
-
// default:"2.2rem"
|
|
68
|
-
},
|
|
69
|
-
stop: {
|
|
70
|
-
type: Boolean,
|
|
71
|
-
required: false
|
|
72
|
-
},
|
|
73
|
-
flipAnimation: {
|
|
74
|
-
type: Boolean,
|
|
75
|
-
required: false,
|
|
76
|
-
default: true
|
|
77
|
-
},
|
|
78
|
-
showDays: {
|
|
79
|
-
type: Boolean,
|
|
80
|
-
required: false,
|
|
81
|
-
default: true
|
|
82
|
-
},
|
|
83
|
-
showHours: {
|
|
84
|
-
type: Boolean,
|
|
85
|
-
required: false,
|
|
86
|
-
default: true
|
|
87
|
-
},
|
|
88
|
-
showMinutes: {
|
|
89
|
-
type: Boolean,
|
|
90
|
-
required: false,
|
|
91
|
-
default: true
|
|
92
|
-
},
|
|
93
|
-
showSeconds: {
|
|
94
|
-
type: Boolean,
|
|
95
|
-
required: false,
|
|
96
|
-
default: true
|
|
97
|
-
},
|
|
98
|
-
showLabels: {
|
|
99
|
-
type: Boolean,
|
|
100
|
-
required: false,
|
|
101
|
-
default: true
|
|
102
|
-
},
|
|
103
|
-
labels: {
|
|
104
|
-
type: Object,
|
|
105
|
-
required: false,
|
|
106
|
-
default: function () {
|
|
107
|
-
return {
|
|
108
|
-
days: 'Days',
|
|
109
|
-
hours: 'Hours',
|
|
110
|
-
minutes: 'Minutes',
|
|
111
|
-
seconds: 'Seconds'
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
mainColor: {
|
|
116
|
-
type: String,
|
|
117
|
-
default: '#EC685C'
|
|
118
|
-
},
|
|
119
|
-
secondFlipColor: {
|
|
120
|
-
type: String,
|
|
121
|
-
default: props => props.mainColor
|
|
122
|
-
},
|
|
123
|
-
mainFlipBackgroundColor: {
|
|
124
|
-
type: String,
|
|
125
|
-
default: '#222222'
|
|
126
|
-
},
|
|
127
|
-
secondFlipBackgroundColor: {
|
|
128
|
-
type: String,
|
|
129
|
-
default: '#393939'
|
|
130
|
-
},
|
|
131
|
-
labelColor: {
|
|
132
|
-
type: String,
|
|
133
|
-
default: '#222222'
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
const now = ref(Math.trunc(new Date().getTime() / 1000));
|
|
138
|
-
const date = ref<number>(0);
|
|
139
|
-
const interval = ref();
|
|
140
|
-
const diff = ref(0);
|
|
141
|
-
const show = ref(false);
|
|
142
|
-
const timeData = ref([
|
|
143
|
-
{
|
|
144
|
-
current: 0,
|
|
145
|
-
previous: 0,
|
|
146
|
-
label: props.labels.days,
|
|
147
|
-
elementId: 'flip-card-days-' + Date.now(),
|
|
148
|
-
show: props.showDays
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
current: 0,
|
|
152
|
-
previous: 0,
|
|
153
|
-
label: props.labels.hours,
|
|
154
|
-
elementId: 'flip-card-hours-' + Date.now(),
|
|
155
|
-
show: props.showHours
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
current: 0,
|
|
159
|
-
previous: 0,
|
|
160
|
-
label: props.labels.minutes,
|
|
161
|
-
elementId: 'flip-card-minutes-' + Date.now(),
|
|
162
|
-
show: props.showMinutes
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
current: 0,
|
|
166
|
-
previous: 0,
|
|
167
|
-
label: props.labels.seconds,
|
|
168
|
-
elementId: 'flip-card-seconds-' + Date.now(),
|
|
169
|
-
show: props.showSeconds
|
|
170
|
-
}
|
|
171
|
-
]);
|
|
172
|
-
|
|
173
|
-
const updateAllCards = () => {
|
|
174
|
-
updateTime(0, days);
|
|
175
|
-
updateTime(1, hours);
|
|
176
|
-
updateTime(2, minutes);
|
|
177
|
-
updateTime(3, seconds);
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
const twoDigits = value => {
|
|
181
|
-
if (value != undefined) {
|
|
182
|
-
if (value.toString().length <= 1) {
|
|
183
|
-
return '0' + value.toString();
|
|
184
|
-
}
|
|
185
|
-
return value.toString();
|
|
186
|
-
} else {
|
|
187
|
-
return '00';
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
const updateTime = (idx, newValue) => {
|
|
192
|
-
if (idx >= timeData.value.length || newValue === undefined) {
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// if (window['requestAnimationFrame']) {
|
|
197
|
-
// frame = requestAnimationFrame(updateTime.bind(this));
|
|
198
|
-
// }
|
|
199
|
-
|
|
200
|
-
const d = timeData.value[idx];
|
|
201
|
-
const val = newValue.value < 0 ? 0 : newValue.value;
|
|
202
|
-
const el = document.querySelector(`#${d.elementId}`);
|
|
203
|
-
|
|
204
|
-
if (val !== d.current) {
|
|
205
|
-
d.previous = d.current;
|
|
206
|
-
d.current = val;
|
|
207
|
-
|
|
208
|
-
if (el) {
|
|
209
|
-
el.classList.remove('flip');
|
|
210
|
-
// @ts-ignore
|
|
211
|
-
void el.offsetWidth;
|
|
212
|
-
el.classList.add('flip');
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
if (idx === 0) {
|
|
216
|
-
const els = el!.querySelectorAll('span b');
|
|
217
|
-
if (els) {
|
|
218
|
-
//@ts-ignore
|
|
219
|
-
for (const e of els) {
|
|
220
|
-
const cls = e.classList[0];
|
|
221
|
-
if (newValue.value / 1000 >= 1) {
|
|
222
|
-
if (!cls.includes('-4digits')) {
|
|
223
|
-
const newCls = cls + '-4digits';
|
|
224
|
-
e.classList.add(newCls);
|
|
225
|
-
e.classList.remove(cls);
|
|
226
|
-
}
|
|
227
|
-
} else {
|
|
228
|
-
if (cls.includes('-4digits')) {
|
|
229
|
-
const newCls = cls.replace('-4digits', '');
|
|
230
|
-
e.classList.add(newCls);
|
|
231
|
-
e.classList.remove(cls);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
} else {
|
|
236
|
-
console.log('....');
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
const seconds = computed(() => {
|
|
243
|
-
if (props.countdown) {
|
|
244
|
-
return Math.trunc(diff.value) % 60;
|
|
245
|
-
}
|
|
246
|
-
return Math.trunc(now.value) % 60;
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
const minutes = computed(() => {
|
|
250
|
-
if (props.countdown) {
|
|
251
|
-
return Math.trunc(diff.value / 60) % 60;
|
|
252
|
-
}
|
|
253
|
-
return Math.trunc(now.value / 60) % 60;
|
|
254
|
-
});
|
|
255
|
-
const hours = computed(() => {
|
|
256
|
-
if (props.countdown) {
|
|
257
|
-
return Math.trunc(diff.value / 60 / 60) % 24;
|
|
258
|
-
}
|
|
259
|
-
return new Date(now.value * 1000).getHours();
|
|
260
|
-
// return Math.trunc(now.value / 60 / 60) % 24;
|
|
261
|
-
});
|
|
262
|
-
const days = computed(() => {
|
|
263
|
-
if (props.countdown) {
|
|
264
|
-
return Math.trunc(diff.value / 60 / 60 / 24);
|
|
265
|
-
}
|
|
266
|
-
return Math.trunc(now.value / 60 / 60 / 24);
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
watch(
|
|
270
|
-
() => props.deadline,
|
|
271
|
-
newVal => {
|
|
272
|
-
const endTime = newVal as unknown as String;
|
|
273
|
-
date.value = Math.trunc(Date.parse(endTime.replace(/-/g, '/')) / 1000);
|
|
274
|
-
if (!date.value) {
|
|
275
|
-
throw new Error("Invalid props value, correct the 'deadline'");
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
);
|
|
279
|
-
|
|
280
|
-
watch(now, () => {
|
|
281
|
-
if (props.countdown) {
|
|
282
|
-
diff.value = date.value - now.value;
|
|
283
|
-
if (diff.value <= 0 || props.stop) {
|
|
284
|
-
diff.value = 0;
|
|
285
|
-
updateTime(3, 0);
|
|
286
|
-
} else {
|
|
287
|
-
updateAllCards();
|
|
288
|
-
}
|
|
289
|
-
} else {
|
|
290
|
-
updateAllCards();
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
watch(diff, newVal => {
|
|
295
|
-
if (newVal == 0) {
|
|
296
|
-
// emit('timeElapsed');
|
|
297
|
-
updateAllCards();
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
onMounted(() => {
|
|
302
|
-
if (diff.value !== 0) {
|
|
303
|
-
show.value = true;
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
|
|
307
|
-
onBeforeMount(() => {
|
|
308
|
-
if (props.countdown) {
|
|
309
|
-
if (!props.deadline) {
|
|
310
|
-
throw new Error("Missing props 'deadline'");
|
|
311
|
-
}
|
|
312
|
-
const endTime = props.deadline;
|
|
313
|
-
let epoch = Date.parse(endTime.replace(/-/g, '/'));
|
|
314
|
-
if (props.deadlineDate != null) {
|
|
315
|
-
epoch = Date.parse(props.deadlineDate.toDateString());
|
|
316
|
-
}
|
|
317
|
-
if (props.deadlineISO) {
|
|
318
|
-
epoch = Date.parse(props.deadlineISO);
|
|
319
|
-
}
|
|
320
|
-
date.value = Math.trunc(epoch / 1000);
|
|
321
|
-
if (!date.value) {
|
|
322
|
-
throw new Error("Invalid props value, correct the 'deadline'");
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
interval.value = setInterval(() => {
|
|
326
|
-
now.value = Math.trunc(new Date().getTime() / 1000);
|
|
327
|
-
}, 1000);
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
onUnmounted(() => {
|
|
331
|
-
// if (window['cancelAnimationFrame']) {
|
|
332
|
-
// cancelAnimationFrame(frame);
|
|
333
|
-
// }
|
|
334
|
-
clearInterval(interval.value);
|
|
335
|
-
});
|
|
336
|
-
</script>
|
|
337
|
-
|
|
338
|
-
<style lang="scss">
|
|
339
|
-
.no-animation__card {
|
|
340
|
-
font-weight: 500;
|
|
341
|
-
font-size: 2rem;
|
|
342
|
-
line-height: 1.5;
|
|
343
|
-
display: block;
|
|
344
|
-
color: v-bind(mainColor);
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.flip-clock {
|
|
348
|
-
text-align: center;
|
|
349
|
-
perspective: 600px;
|
|
350
|
-
margin: 0 auto;
|
|
351
|
-
|
|
352
|
-
*,
|
|
353
|
-
*:before,
|
|
354
|
-
*:after {
|
|
355
|
-
box-sizing: border-box;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
.flip-clock__piece {
|
|
360
|
-
display: inline-block;
|
|
361
|
-
margin: 0 0.2vw;
|
|
362
|
-
|
|
363
|
-
@media (min-width: 1000px) {
|
|
364
|
-
margin: 0 5px;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
.flip-clock__slot {
|
|
369
|
-
font-size: 1rem;
|
|
370
|
-
line-height: 1.5;
|
|
371
|
-
display: block;
|
|
372
|
-
color: v-bind(labelColor);
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
$halfHeight: 0.72em;
|
|
376
|
-
$borderRadius: 0.15em;
|
|
377
|
-
|
|
378
|
-
.flip-card {
|
|
379
|
-
display: block;
|
|
380
|
-
position: relative;
|
|
381
|
-
padding-bottom: $halfHeight;
|
|
382
|
-
font-size: 2.25rem;
|
|
383
|
-
line-height: 0.95;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
@media (min-width: 1000px) {
|
|
387
|
-
.flip-clock__slot {
|
|
388
|
-
font-size: 1.2rem;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
.flip-card {
|
|
392
|
-
font-size: 3rem;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
.flip-card__top,
|
|
397
|
-
.flip-card__bottom,
|
|
398
|
-
.flip-card__back-bottom,
|
|
399
|
-
.flip-card__back::before,
|
|
400
|
-
.flip-card__back::after {
|
|
401
|
-
display: block;
|
|
402
|
-
height: $halfHeight;
|
|
403
|
-
color: v-bind(mainColor);
|
|
404
|
-
background: v-bind(mainFlipBackgroundColor);
|
|
405
|
-
padding: 0.23em 0.15em 0.4em;
|
|
406
|
-
border-radius: $borderRadius $borderRadius 0 0;
|
|
407
|
-
backface-visibility: hidden;
|
|
408
|
-
-webkit-backface-visibility: hidden;
|
|
409
|
-
transform-style: preserve-3d;
|
|
410
|
-
width: 2.1em;
|
|
411
|
-
height: $halfHeight;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
.flip-card__top-4digits,
|
|
415
|
-
.flip-card__bottom-4digits,
|
|
416
|
-
.flip-card__back-bottom-4digits,
|
|
417
|
-
.flip-card__back-4digits::before,
|
|
418
|
-
.flip-card__back-4digits::after {
|
|
419
|
-
display: block;
|
|
420
|
-
height: $halfHeight;
|
|
421
|
-
color: v-bind(mainColor);
|
|
422
|
-
background: v-bind(mainFlipBackgroundColor);
|
|
423
|
-
padding: 0.23em 0.15em 0.4em;
|
|
424
|
-
border-radius: $borderRadius $borderRadius 0 0;
|
|
425
|
-
backface-visibility: hidden;
|
|
426
|
-
-webkit-backface-visibility: hidden;
|
|
427
|
-
transform-style: preserve-3d;
|
|
428
|
-
width: 2.65em;
|
|
429
|
-
height: $halfHeight;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
.flip-card__bottom,
|
|
433
|
-
.flip-card__back-bottom,
|
|
434
|
-
.flip-card__bottom-4digits,
|
|
435
|
-
.flip-card__back-bottom-4digits {
|
|
436
|
-
color: v-bind(secondFlipColor);
|
|
437
|
-
position: absolute;
|
|
438
|
-
top: 50%;
|
|
439
|
-
left: 0;
|
|
440
|
-
border-top: solid 1px #000;
|
|
441
|
-
background: v-bind(secondFlipBackgroundColor);
|
|
442
|
-
border-radius: 0 0 $borderRadius $borderRadius;
|
|
443
|
-
pointer-events: none;
|
|
444
|
-
overflow: hidden;
|
|
445
|
-
z-index: 2;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
.flip-card__back-bottom,
|
|
449
|
-
.flip-card__back-bottom-4digits {
|
|
450
|
-
z-index: 1;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
.flip-card__bottom::after,
|
|
454
|
-
.flip-card__back-bottom::after,
|
|
455
|
-
.flip-card__bottom-4digits::after,
|
|
456
|
-
.flip-card__back-bottom-4digits::after {
|
|
457
|
-
display: block;
|
|
458
|
-
margin-top: -$halfHeight;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
.flip-card__back::before,
|
|
462
|
-
.flip-card__bottom::after,
|
|
463
|
-
.flip-card__back-bottom::after,
|
|
464
|
-
.flip-card__back-4digits::before,
|
|
465
|
-
.flip-card__bottom-4digits::after,
|
|
466
|
-
.flip-card__back-bottom-4digits::after {
|
|
467
|
-
content: attr(data-value);
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
.flip-card__back,
|
|
471
|
-
.flip-card__back-4digits {
|
|
472
|
-
position: absolute;
|
|
473
|
-
top: 0;
|
|
474
|
-
height: 100%;
|
|
475
|
-
left: 0%;
|
|
476
|
-
pointer-events: none;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
.flip-card__back::before,
|
|
480
|
-
.flip-card__back-4digits::before {
|
|
481
|
-
position: relative;
|
|
482
|
-
overflow: hidden;
|
|
483
|
-
z-index: -1;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
.flip .flip-card__back::before,
|
|
487
|
-
.flip .flip-card__back-4digits::before {
|
|
488
|
-
z-index: 1;
|
|
489
|
-
animation: flipTop 0.3s cubic-bezier(0.37, 0.01, 0.94, 0.35);
|
|
490
|
-
animation-fill-mode: both;
|
|
491
|
-
transform-origin: center bottom;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
.flip .flip-card__bottom,
|
|
495
|
-
.flip .flip-card__bottom-4digits {
|
|
496
|
-
transform-origin: center top;
|
|
497
|
-
animation-fill-mode: both;
|
|
498
|
-
animation: flipBottom 0.6s cubic-bezier(0.15, 0.45, 0.28, 1);
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
@keyframes flipTop {
|
|
502
|
-
0% {
|
|
503
|
-
transform: rotateX(0deg);
|
|
504
|
-
z-index: 2;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
0%,
|
|
508
|
-
99% {
|
|
509
|
-
opacity: 1;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
100% {
|
|
513
|
-
transform: rotateX(-90deg);
|
|
514
|
-
opacity: 0;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
@keyframes flipBottom {
|
|
519
|
-
0%,
|
|
520
|
-
50% {
|
|
521
|
-
z-index: -1;
|
|
522
|
-
transform: rotateX(90deg);
|
|
523
|
-
opacity: 0;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
51% {
|
|
527
|
-
opacity: 1;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
100% {
|
|
531
|
-
opacity: 1;
|
|
532
|
-
transform: rotateX(0deg);
|
|
533
|
-
z-index: 5;
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
</style>
|