修复调试页面切换时数据重置

This commit is contained in:
shefengchun 2023-02-03 17:21:36 +08:00
parent b17435d0dd
commit fed77c3e81
5 changed files with 75 additions and 35 deletions

View File

@ -50,6 +50,7 @@ export default defineComponent({
DebuggingItem,
},
setup() {
let set = GlobalData.getInstance().getCurrentClient();
let $store = useStore();
let $t = useI18n();

View File

@ -51,7 +51,42 @@ export default defineComponent({
val.value=props.value=="1"?true:false
const send = () => {
set?.SetBlendingOption(props.name, val.value ? "1" : "0");
}
const use_sessionStorage=()=>{
if(sessionStorage.Debugging){
let tmp=JSON.parse(sessionStorage.Debugging);
for (let index = 0;index < tmp.length; index++) {
if(Object.keys(tmp[index])[0]==props.name){
val.value=Object.values(tmp[index])[0]=="1"?true:false
break
}
}
}
}
onMounted(()=>{
use_sessionStorage()
})
onBeforeUnmount(() => {
let key=props.name
let value=val.value
if(sessionStorage.Debugging){
let tmp=JSON.parse(sessionStorage.Debugging);
let count=0;
for (let index = 0;index < tmp.length; index++) {
if(Object.keys(tmp[index])[0]==key){
tmp[index]={[key]:value}
break
}
count=index
}
if(count==tmp.length-1)tmp.push({[key]:value});
sessionStorage.Debugging = JSON.stringify(tmp);
}else{
sessionStorage.Debugging = JSON.stringify([{[key]:value}]);
}
});
return {
send,
val,

View File

@ -237,8 +237,31 @@ export default defineComponent({
set?.SetBlendingOption(show_blending_grids_id.value, show_blending_grids.value ? "1" : "0");
};
const resetall = () => {
set?.ResetBlendingConfig()
set?.ResetBlendingConfig().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
options.value = ""
$store.commit("setSelectedProjector", "0/0");
setTimeout(() => {
clear_sessionStorage()
options.value = tmp
}, 300);
}
const clear_sessionStorage=()=>{
sessionStorage.removeItem("FusionLocale");
sessionStorage.removeItem("SurfaceCorrection");
sessionStorage.removeItem("DensityCorrection");
sessionStorage.removeItem("FourPointCalibration");
sessionStorage.removeItem("GridSettings");
sessionStorage.removeItem("Debugging");
}
const config = ref({ col: 0, row: 0 });
const EnableBlending = ref(false);
let optionsstr = ref();
@ -265,15 +288,6 @@ export default defineComponent({
{ deep: true }
);
const erroe = () => {
$q.notify({
color: "negative",
icon: "warning",
message: "数据获取失败!",
position: "top",
timeout: 1500,
});
};
const save = () => {
medium.value = true
//
@ -294,11 +308,7 @@ export default defineComponent({
send_show_blending_grids();
$store.commit("setSelectedProjector", "0/0");
setTimeout(() => {
sessionStorage.removeItem("FusionLocale");
sessionStorage.removeItem("SurfaceCorrection");
sessionStorage.removeItem("DensityCorrection");
sessionStorage.removeItem("FourPointCalibration");
sessionStorage.removeItem("GridSettings");
clear_sessionStorage()
}, 500);
options.value="FusionLocale"
};
@ -314,15 +324,6 @@ export default defineComponent({
})
}
onBeforeMount(() => {
// setTimeout(() => {
// try {
// } catch (error) {
// erroe();
// }
// }, 1000);
});
onMounted(() => {
setTimeout(() => {
set?.GetBlendingConfig("").then((res) => {
@ -355,7 +356,7 @@ export default defineComponent({
]
const apply_the_selected_configuration = () => {
set?.ApplyBlendingScene(select_configuration_name.value).then((res) => {
let tmp = JSON.parse(res ? res.config : "");
let tmp = JSON.parse(res ? res.config : "{}");
EnableBlending.value = tmp.enable;
$store.commit("setEnablefusion", tmp.enable);
config.value.col = tmp.col;
@ -367,13 +368,10 @@ export default defineComponent({
options.value = ""
$store.commit("setSelectedProjector", "0/0");
setTimeout(() => {
sessionStorage.removeItem("FusionLocale");
sessionStorage.removeItem("SurfaceCorrection");
sessionStorage.removeItem("DensityCorrection");
sessionStorage.removeItem("FourPointCalibration");
sessionStorage.removeItem("GridSettings");
clear_sessionStorage()
options.value = tmp
}, 800);
getconfig()
}
const plan_list_op = ref(plan_list)
const filterFn = (val: any, update: any, abort: any) => {
@ -392,9 +390,13 @@ export default defineComponent({
}
const isdebug = computed(() => {
let tmp = JSON.parse($store.state.fusion_configuration)
let str = 'debug@show_mask'
return tmp.options[str] == '1' || record_times.value > 2
try {
let tmp = JSON.parse($store.state.fusion_configuration)
return record_times.value > 2
} catch (error) {
}
})
const name_to_be_deleted=ref("");
const del_scenes=(name:string)=>{

View File

@ -445,5 +445,6 @@ export default {
"disable_blending":"disable blending",
"disable_clip":"disable clip",
"show_mask":"hide desktop",
"save_bmp":"save bmp"
"save_bmp":"save bmp",
"disable_blending_params":"disable blending params"
};

View File

@ -714,5 +714,6 @@ export default {
"disable_blending":"禁用混合",
"disable_clip":"禁用裁剪",
"show_mask":"隐藏桌面",
"save_bmp":"保存BMP"
"save_bmp":"保存BMP",
"disable_blending_params":"禁用融合参数"
};