增加删除场景功能

This commit is contained in:
shefengchun 2023-02-02 11:24:28 +08:00
parent deeb73cf26
commit 1bee760998
4 changed files with 1636 additions and 1569 deletions

View File

@ -1501,7 +1501,7 @@ export default class ClientConnection {
public async DeleteBlendingScene(name: string) { public async DeleteBlendingScene(name: string) {
return await this.doRpc<Protocol.RpcBlendingResponseEntity>( return await this.doRpc<Protocol.RpcBlendingResponseEntity>(
new Protocol.ApplyBlendingSceneRequestEntity(name) new Protocol.DeleteBlendingSceneRequestEntity(name)
); );
} }

View File

@ -75,8 +75,8 @@
<q-separator /> <q-separator />
<q-card-actions align="right"> <q-card-actions align="right">
<span v-show="isdebug">{{ $t("Whether to hide the desktop") }}</span><q-checkbox v-show="isdebug" style="justify-content: flex-start" <span v-show="isdebug">{{ $t("Whether to hide the desktop") }}</span><q-checkbox v-show="isdebug"
v-model="hide_desktop_value" @click="send_hide_desktop" /> style="justify-content: flex-start" v-model="hide_desktop_value" @click="send_hide_desktop" />
<span>{{ $t("disable blending params") }}</span> <span>{{ $t("disable blending params") }}</span>
<q-checkbox style="justify-content: flex-start" v-model="disable_blending_params" <q-checkbox style="justify-content: flex-start" v-model="disable_blending_params"
@click="send_disable_blending_params" /> @click="send_disable_blending_params" />
@ -89,7 +89,7 @@
<q-btn color="white" @click="resetall" text-color="black" :label="$t('resetall config')" /> <q-btn color="white" @click="resetall" text-color="black" :label="$t('resetall config')" />
<div class="q-space" data-v-39efcd1f=""></div> <div class="q-space" data-v-39efcd1f=""></div>
<q-btn flat :label="$t('Select saved configuration')" no-caps color="primary" <q-btn flat :label="$t('Select saved configuration')" no-caps color="primary"
@click="select_configuration = true" /> @click="select_configuration = true;get_scenes()" />
<q-btn flat :label="$t('Cancel')" no-caps color="primary" v-close-popup <q-btn flat :label="$t('Cancel')" no-caps color="primary" v-close-popup
@click="$store.commit('setSelectedProjector', '0/0');" /> @click="$store.commit('setSelectedProjector', '0/0');" />
<q-btn flat :label="$t('save config')" no-caps color="primary" @click="save" /> <q-btn flat :label="$t('save config')" no-caps color="primary" @click="save" />
@ -105,6 +105,16 @@
<q-card-section class="q-pt-none"> <q-card-section class="q-pt-none">
<q-select filled :model-value="save_cover_name" use-input hide-selected fill-input input-debounce="0" <q-select filled :model-value="save_cover_name" use-input hide-selected fill-input input-debounce="0"
:options="plan_list_op" @filter="filterFn" @input-value="setModel"> :options="plan_list_op" @filter="filterFn" @input-value="setModel">
<template v-slot:option="{ itemProps, opt, selected, toggleOption }">
<q-item v-bind="itemProps">
<q-item-section>
<q-item-label v-html="opt" />
</q-item-section>
<q-item-section side>
<q-icon name="clear" @click="del_scenes(opt)"></q-icon>
</q-item-section>
</q-item>
</template>
</q-select> </q-select>
</q-card-section> </q-card-section>
<q-card-actions align="right" class="bg-white text-teal"> <q-card-actions align="right" class="bg-white text-teal">
@ -121,16 +131,40 @@
<div class="text-h6">{{ $t('read saved configuration') }}</div> <div class="text-h6">{{ $t('read saved configuration') }}</div>
</q-card-section> </q-card-section>
<q-card-section class="q-pt-none"> <q-card-section class="q-pt-none">
<q-select filled v-model="select_configuration_name" :options="plan_list" :label="$t('please choose')" /> <q-select filled v-model="select_configuration_name" :options="plan_list" :label="$t('please choose')" >
<template v-slot:option="{ itemProps, opt, selected, toggleOption }">
<q-item v-bind="itemProps">
<q-item-section>
<q-item-label v-html="opt" />
</q-item-section>
<q-item-section side>
<q-icon name="clear" @click="del_scenes(opt)"></q-icon>
</q-item-section>
</q-item>
</template>
</q-select>
</q-card-section> </q-card-section>
<q-card-actions align="right" class="bg-white text-teal"> <q-card-actions align="right" class="bg-white text-teal">
<q-btn flat :label="$t('Cancel')" color="primary" v-close-popup /> <q-btn flat :label="$t('Cancel')" color="primary" v-close-popup />
<q-btn flat :label="$t('ok')" @click="apply_the_selected_configuration" color="primary" v-close-popup /> <q-btn flat :label="$t('apply')" @click="apply_the_selected_configuration" color="primary" v-close-popup />
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</q-dialog> </q-dialog>
<q-dialog v-model="del_dialog">
<q-card style="width: 700px; max-width: 80vw;">
<q-card-section>
<div class="text-h6">{{ $t('confirm delete') }}</div>
</q-card-section>
<q-card-section class="q-pt-none">
{{ $t('Whether to delete') + name_to_be_deleted }}
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn flat :label="$t('Cancel')" color="primary" v-close-popup />
<q-btn flat :label="$t('ok')" @click="dialog_del_scenes" color="primary" v-close-popup />
</q-card-actions>
</q-card>
</q-dialog>
</q-dialog> </q-dialog>
</template> </template>
@ -191,6 +225,7 @@ export default defineComponent({
show_dialog.value = true; show_dialog.value = true;
}; };
const select_configuration = ref(false) const select_configuration = ref(false)
const del_dialog = ref(false)
const select_configuration_name = ref("") const select_configuration_name = ref("")
const send_hide_desktop = () => { const send_hide_desktop = () => {
set?.SetBlendingOption(hide_desktop_value_id.value, hide_desktop_value.value ? "1" : "0"); set?.SetBlendingOption(hide_desktop_value_id.value, hide_desktop_value.value ? "1" : "0");
@ -242,20 +277,9 @@ export default defineComponent({
}); });
}; };
const save = () => { const save = () => {
set?.SaveBlendingConfig("");
//show_dialog.value = false;
clear();
save_cover_name.value = save_name.value = ''
set?.GetBlendingConfig("").then((res) => {
let tmp = JSON.parse(res ? res.config : "");
EnableBlending.value = tmp.enable;
$store.commit("setEnablefusion", tmp.enable);
config.value.col = tmp.col;
config.value.row = tmp.row;
$store.commit("setfusion_configuration", res?.config);
});
$store.commit("setSelectedProjector", "0/0");
medium.value = true medium.value = true
//
get_scenes()
}; };
const getconfig = () => { const getconfig = () => {
try { try {
@ -280,6 +304,17 @@ export default defineComponent({
}, 500); }, 500);
}; };
const get_scenes = () => {
set?.EnumBlendingScene().then((res) => {
if (res == null || res.scenes.length == 0) return
plan_list.splice(0, plan_list.length);
for (let index = 0; index < res.scenes.length; index++) {
plan_list.push(res.scenes[index]);
}
})
}
onBeforeMount(() => { onBeforeMount(() => {
setTimeout(() => { setTimeout(() => {
try { try {
@ -324,14 +359,30 @@ export default defineComponent({
// //
//console.log(select_configuration_name.value) //console.log(select_configuration_name.value)
set?.ApplyBlendingScene(select_configuration_name.value); set?.ApplyBlendingScene(select_configuration_name.value).then((res) => {
let tmp = JSON.parse(res ? res.config : "");
EnableBlending.value = tmp.enable;
$store.commit("setEnablefusion", tmp.enable);
config.value.col = tmp.col;
config.value.row = tmp.row;
$store.commit("setfusion_configuration", res?.config);
});
let tmp = options.value let tmp = options.value
options.value = "" options.value = ""
getconfig() //getconfig()
$store.commit("setSelectedProjector", "0/0");
setTimeout(() => { setTimeout(() => {
sessionStorage.removeItem("FusionLocale");
sessionStorage.removeItem("SurfaceCorrection");
sessionStorage.removeItem("DensityCorrection");
sessionStorage.removeItem("FourPointCalibration");
sessionStorage.removeItem("GridSettings");
options.value = tmp options.value = tmp
}, 100); }, 800);
// setTimeout(() => {
// options.value = tmp
// }, 100);
} }
const plan_list_op = ref(plan_list) const plan_list_op = ref(plan_list)
const filterFn = (val: any, update: any, abort: any) => { const filterFn = (val: any, update: any, abort: any) => {
@ -345,28 +396,39 @@ export default defineComponent({
save_cover_name.value = val save_cover_name.value = val
} }
const get_scenes = () => {
set?.EnumBlendingScene().then((res) => {
if (res == null || res.scenes.length == 0) return
plan_list.splice(0, plan_list.length);
for (let index = 0; index < res.scenes.length; index++) {
plan_list.push(res.scenes[index]);
}
})
}
get_scenes()
const saveconfig = () => { const saveconfig = () => {
//save_cover_name set?.SaveBlendingConfig(save_cover_name.value);
clear();
save_cover_name.value = save_name.value = ''
set?.GetBlendingConfig("").then((res) => {
let tmp = JSON.parse(res ? res.config : "");
EnableBlending.value = tmp.enable;
$store.commit("setEnablefusion", tmp.enable);
config.value.col = tmp.col;
config.value.row = tmp.row;
$store.commit("setfusion_configuration", res?.config);
});
$store.commit("setSelectedProjector", "0/0");
} }
const isdebug = computed(() => { const isdebug = computed(() => {
let tmp = JSON.parse($store.state.fusion_configuration) let tmp = JSON.parse($store.state.fusion_configuration)
let str = 'debug@show_mask' let str = 'debug@show_mask'
return tmp.options[str] == '1' || record_times.value > 2 return tmp.options[str] == '1' || record_times.value > 2
}) })
const name_to_be_deleted=ref("");
const del_scenes=(name:string)=>{
del_dialog.value=true;
name_to_be_deleted.value=name;
}
const dialog_del_scenes=()=>{
set?.DeleteBlendingScene(name_to_be_deleted.value);
plan_list.splice(plan_list.findIndex(item => item === name_to_be_deleted.value), 1)
}
return { return {
name_to_be_deleted,
dialog_del_scenes,
get_scenes,
del_scenes,
filterFn, filterFn,
setModel, setModel,
send_hide_desktop, send_hide_desktop,
@ -394,7 +456,8 @@ export default defineComponent({
plan_list_op, plan_list_op,
record_times, record_times,
saveconfig, saveconfig,
isdebug isdebug,
del_dialog
}; };
}, },
}); });

View File

@ -438,5 +438,7 @@ export default {
"save":"save", "save":"save",
"Whether to save the configuration":"Whether to save the configuration", "Whether to save the configuration":"Whether to save the configuration",
"New Please enter a name":"New Please enter a name", "New Please enter a name":"New Please enter a name",
"Please select an override":"Please select an override" "Please select an override":"Please select an override",
"confirm delete":"confirm delete",
"delete or not":"delete or not"
}; };

View File

@ -708,4 +708,6 @@ export default {
"Whether to save the configuration":"是否保存配置", "Whether to save the configuration":"是否保存配置",
"New Please enter a name":"新建 请输入名称", "New Please enter a name":"新建 请输入名称",
"Please select an override":"请选择覆盖", "Please select an override":"请选择覆盖",
"confirm delete":"确定删除",
"Whether to delete":"是否删除"
}; };