diff --git a/package.json b/package.json index fa46593..46812b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "media_player_client", - "version": "1.4.11", + "version": "1.4.12", "description": "A Quasar Framework app", "productName": "MediaPlayerClient", "author": "fangxiang ", diff --git a/public/pad/source_icon/timer.png b/public/pad/source_icon/timer.png new file mode 100644 index 0000000..492562c Binary files /dev/null and b/public/pad/source_icon/timer.png differ diff --git a/public/source_icon/timer.png b/public/source_icon/timer.png new file mode 100644 index 0000000..492562c Binary files /dev/null and b/public/source_icon/timer.png differ diff --git a/src/common/Common.ts b/src/common/Common.ts index 2ae3f48..8ae674a 100644 --- a/src/common/Common.ts +++ b/src/common/Common.ts @@ -20,6 +20,7 @@ export namespace Common { ["EwindowType::Clock", "img:source_icon/clock.png"], ["EwindowType::Weather", "img:source_icon/weather.png"], ["EwindowType::HdmiIn", "img:source_icon/hdmi.png"], + ["EwindowType::Timer", "img:source_icon/timer.png"], ]); if (icon_map.has(item_type)) { diff --git a/src/components/SignalSourceDialog.vue b/src/components/SignalSourceDialog.vue index 72eed2b..3123dd6 100644 --- a/src/components/SignalSourceDialog.vue +++ b/src/components/SignalSourceDialog.vue @@ -159,22 +159,27 @@ ? showClockDialog() : item_data.window_type == 'EwindowType::Weather' ? showWeatherDialog() - : showPlaylistDialog('.mp4;.avi;.ts;.webm;.flv;.mkv') + : item_data.window_type == 'EwindowType::Timer' + ? showTimerDialog() + : showPlaylistDialog('.mp4;.avi;.ts;.webm;.flv;.mkv;.wmv') " v-model="item_data.media_url" :readonly=" media_url_label.startsWith($t('file path')) || media_url_label.startsWith($t('clock')) || - media_url_label.startsWith($t('weather')) + media_url_label.startsWith($t('weather')) || + media_url_label.startsWith($t('timer')) " :label="media_url_label" :hint=" media_url_label.startsWith($t('file path')) ? $t('dbclick select file') : media_url_label.startsWith($t('clock')) - ? $t('dbclick config clock') + ? $t('dbclick config') + $t('clock') : media_url_label.startsWith($t('weather')) - ? $t('dbclick config weather') + ? $t('dbclick config') + $t('weather') + : media_url_label.startsWith($t('timer')) + ? $t('dbclick config') + $t('timer') : $t('please input') + media_url_label.substr(0, media_url_label.length - 1) " @@ -289,6 +294,7 @@ + @@ -319,6 +325,7 @@ import FileManageDialog from "src/components/FileManageDialog.vue"; import PlaylistDialog from "src/components/PlaylistDialog.vue"; import ClockSignalSourceDialog from "src/components/ClockSignalSourceDialog.vue"; import WeatherSignalSourceDialog from "src/components/WeatherSignalSourceDialog.vue"; +import TimerSignalSourceDialog from "src/components/TimerSignalSourceDialog.vue"; import FileEntity from "src/entities/FileEntity"; @@ -329,6 +336,7 @@ export default defineComponent({ PlaylistDialog, ClockSignalSourceDialog, WeatherSignalSourceDialog, + TimerSignalSourceDialog, }, setup() { @@ -346,6 +354,7 @@ export default defineComponent({ let playlist_dialog: any = ref(null); let clock_dialog: any = ref(null); let weather_dialog: any = ref(null); + let timer_dialog: any = ref(null); let file_manage_dialog: any = ref(null); let suppored_window_types = new Set([ @@ -355,6 +364,7 @@ export default defineComponent({ "EwindowType::Rtsp", "EwindowType::Clock", "EwindowType::Weather", + "EwindowType::Timer", ]); let signal_source_options = [ @@ -382,6 +392,10 @@ export default defineComponent({ label: $t.t("weather"), value: "EwindowType::Weather", }, + { + label: $t.t("timer"), + value: "EwindowType::Timer", + }, ]; const tree_nodes = computed({ @@ -421,6 +435,9 @@ export default defineComponent({ case "EwindowType::Weather": media_url_label.value = $t.t("weather setting") + ":"; break; + case "EwindowType::Timer": + media_url_label.value = $t.t("timer setting") + ":"; + break; default: media_url_label.value = $t.t("file path") + ":"; break; @@ -479,6 +496,7 @@ export default defineComponent({ playlist_dialog, clock_dialog, weather_dialog, + timer_dialog, file_manage_dialog, showDialog(options: any) { if (options) { @@ -546,6 +564,17 @@ export default defineComponent({ item_data.media_url = decodeURI(result); } }, + async showTimerDialog() { + if (item_data.window_type != "EwindowType::Timer") { + return; + } + const result = await timer_dialog.value.showDialogAsync( + item_data.media_url + ); + if (result) { + item_data.media_url = decodeURI(result); + } + }, async showPlaylistDialog(filter: string) { if (item_data.window_type != "EwindowType::Multimedia") { return; diff --git a/src/components/TimerSignalSourceDialog.vue b/src/components/TimerSignalSourceDialog.vue new file mode 100644 index 0000000..db5e3a9 --- /dev/null +++ b/src/components/TimerSignalSourceDialog.vue @@ -0,0 +1,455 @@ + + + + + diff --git a/src/entities/TimerWidgetWindowParamEntity.ts b/src/entities/TimerWidgetWindowParamEntity.ts new file mode 100644 index 0000000..f8851f8 --- /dev/null +++ b/src/entities/TimerWidgetWindowParamEntity.ts @@ -0,0 +1,17 @@ +export default class TimerWidgetWindowParamEntity { + direction = true; + font_size = 25; + text_color = "#000000"; + background_color = "#000000"; + background_transparent = true; + text = ""; + is_relative_time = true; + relative_time_s = 60; + absolute_time = "2022/01/01 00:00:00"; + show_second = true; + show_minute = false; + show_hour = false; + show_day = false; + multiple_lines = false; + note = ""; +} diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index d2aac4a..db71c79 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -24,4 +24,5 @@ export default { "edit window rect": "Window Size Adjust", "set the window rectangle beyond the desktop rectangle, the window rectangle will be clipped, are you sure to use this window rectangle": "if the window size exceeds the desktop size, the window size will be clipped. Are you sure to use this window size", + hour_2_: "hour", }; diff --git a/src/i18n/zh-CN/index.ts b/src/i18n/zh-CN/index.ts index 21da787..11d3b0c 100644 --- a/src/i18n/zh-CN/index.ts +++ b/src/i18n/zh-CN/index.ts @@ -556,4 +556,22 @@ export default { english: "英文", chinese: "中文", "hour mark color": "时标", + timer: "计时器", + "dbclick config": "双击配置", + "timer setting": "计时器设置", + "timer type": "计时器类型", + "forward timer": "正计时", + "backward timer": "倒计时", + "example: 2022/01/01 00:00:00": "例: 2022/01/01 00:00:00", + "timer mode": "计时方式", + "relative time": "相对时间", + "absolute time": "绝对时间", + second: "秒", + duration: "时长", + "start time": "起始时间", + "target time": "目标时间", + minute: "分", + hour_2_: "时", + "the start time should not exceed the current time, and the target time should not be less than the current time": + "正计时的时候起始时间不要超过当前时间,倒计时的时候目标时间不要小于当前时间", }; diff --git a/src/pad/BottomBar.vue b/src/pad/BottomBar.vue index 6d0eb3c..7f4a78b 100644 --- a/src/pad/BottomBar.vue +++ b/src/pad/BottomBar.vue @@ -381,6 +381,7 @@ export default defineComponent({ ["EwindowType::Clock", "img:pad/source_icon/clock.png"], ["EwindowType::Weather", "img:pad/source_icon/weather.png"], ["EwindowType::HdmiIn", "img:pad/source_icon/hdmi_in.png"], + ["EwindowType::HdmiIn", "img:pad/source_icon/timer.png"], ]); if (icon_map.has(item_type)) {