优霸定制添加时钟信号源时隐藏中文格式
This commit is contained in:
parent
f02cad430f
commit
41e5e90990
|
@ -452,6 +452,7 @@ import GlobalData from "src/common/GlobalData";
|
||||||
import { useQuasar, date as DateHelper } from "quasar";
|
import { useQuasar, date as DateHelper } from "quasar";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import ClockWindowParamEntity from "src/entities/ClockWindowParamEntity";
|
import ClockWindowParamEntity from "src/entities/ClockWindowParamEntity";
|
||||||
|
import { Protocol } from "src/entities/WSProtocol";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "ComponentClockSignalSourceDialog",
|
name: "ComponentClockSignalSourceDialog",
|
||||||
|
@ -463,7 +464,8 @@ export default defineComponent({
|
||||||
let $t = useI18n();
|
let $t = useI18n();
|
||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const date_format_options = ref([
|
|
||||||
|
const date_formats_en_ = [
|
||||||
{
|
{
|
||||||
label: DateHelper.formatDate(now, "YYYY/MM/DD"),
|
label: DateHelper.formatDate(now, "YYYY/MM/DD"),
|
||||||
value: "yyyy/MM/dd",
|
value: "yyyy/MM/dd",
|
||||||
|
@ -472,22 +474,70 @@ export default defineComponent({
|
||||||
label: DateHelper.formatDate(now, "YYYY-MM-DD"),
|
label: DateHelper.formatDate(now, "YYYY-MM-DD"),
|
||||||
value: "yyyy-MM-dd",
|
value: "yyyy-MM-dd",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: DateHelper.formatDate(now, "DD/MM/YYYY"),
|
||||||
|
value: "dd/MM/yyyy",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: DateHelper.formatDate(now, "DD-MM-YYYY"),
|
||||||
|
value: "dd-MM-yyyy",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const date_formats_zh_ = [
|
||||||
{
|
{
|
||||||
label: DateHelper.formatDate(now, "YYYY年MM月DD日"),
|
label: DateHelper.formatDate(now, "YYYY年MM月DD日"),
|
||||||
value: "yyyy年MM月dd日",
|
value: "yyyy年MM月dd日",
|
||||||
},
|
},
|
||||||
]);
|
{
|
||||||
|
label: DateHelper.formatDate(now, "DD日MM月YYYY年"),
|
||||||
|
value: "dd日MM月yyyy年",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
const time_format_options = ref([
|
const time_formats_en_ = [
|
||||||
{
|
{
|
||||||
label: DateHelper.formatDate(now, "HH:mm:ss"),
|
label: DateHelper.formatDate(now, "HH:mm:ss"),
|
||||||
value: "hh:mm:ss",
|
value: "hh:mm:ss",
|
||||||
},
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const time_formats_zh_ = [
|
||||||
{
|
{
|
||||||
label: DateHelper.formatDate(now, "HH时mm分ss秒"),
|
label: DateHelper.formatDate(now, "HH时mm分ss秒"),
|
||||||
value: "hh时mm分ss秒",
|
value: "hh时mm分ss秒",
|
||||||
},
|
},
|
||||||
]);
|
];
|
||||||
|
|
||||||
|
const date_format_options: Ref<Array<any>> = ref([]);
|
||||||
|
|
||||||
|
const time_format_options: Ref<Array<any>> = ref([]);
|
||||||
|
|
||||||
|
const refresh_formats = () => {
|
||||||
|
date_format_options.value = [];
|
||||||
|
|
||||||
|
time_format_options.value = [];
|
||||||
|
|
||||||
|
if (
|
||||||
|
($store.state.device_attribute & Protocol.EDeviceAttribute.CustomISV) ==
|
||||||
|
0
|
||||||
|
) {
|
||||||
|
date_format_options.value = [...date_formats_en_, ...date_formats_zh_];
|
||||||
|
time_format_options.value = [...time_formats_en_, ...time_formats_zh_];
|
||||||
|
} else {
|
||||||
|
date_format_options.value = date_formats_en_;
|
||||||
|
time_format_options.value = time_formats_en_;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
refresh_formats();
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => $store.state.device_attribute,
|
||||||
|
(value) => {
|
||||||
|
refresh_formats();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
let show_dialog = ref(false);
|
let show_dialog = ref(false);
|
||||||
let loading = ref(false);
|
let loading = ref(false);
|
||||||
|
|
Loading…
Reference in New Issue