加入限制

This commit is contained in:
shefengchun 2023-02-24 14:00:14 +08:00
parent aa0e83045b
commit 5027ba5233
6 changed files with 85 additions and 25 deletions

View File

@ -557,7 +557,8 @@ export default defineComponent({
let tmp = JSON.parse($store.state.fusion_configuration).options; let tmp = JSON.parse($store.state.fusion_configuration).options;
auxiliary_line.value = tmp.blending_grids_density_assistant_lines == "1" auxiliary_line.value = tmp.blending_grids_density_assistant_lines == "1"
now_v_h.value = "level" now_v_h.value = "level"
start_point(5, 'all') start_point(Number(options_value_h_point_amount.value[0]), 'h')
start_point(Number(options_value_v_point_amount.value[0]), 'v')
if ( if (
sessionStorage.DensityCorrection && sessionStorage.DensityCorrection &&
sessionStorage.DensityCorrection.length > 0 sessionStorage.DensityCorrection.length > 0
@ -931,7 +932,7 @@ export default defineComponent({
*/ */
const details_selsect_v = (details: any) => { const details_selsect_v = (details: any) => {
let spt = details.deltaY / 100 let spt = details.deltaY / 100
if (spt < 0) { if (spt > 0) {
if (options_model_v.value >= value_v_point.value.length - 1) { if (options_model_v.value >= value_v_point.value.length - 1) {
options_model_v.value = 0 options_model_v.value = 0
} else { } else {
@ -947,7 +948,7 @@ export default defineComponent({
} }
const details_selsect_h = (details: any) => { const details_selsect_h = (details: any) => {
let spt = details.deltaY / 100 let spt = details.deltaY / 100
if (spt < 0) { if (spt > 0) {
if (options_model_h.value >= value_h_point.value.length - 1) { if (options_model_h.value >= value_h_point.value.length - 1) {
options_model_h.value = 0 options_model_h.value = 0
} else { } else {

View File

@ -62,7 +62,9 @@ import {
watch, watch,
nextTick, nextTick,
onBeforeUnmount, onBeforeUnmount,
defineExpose defineExpose,
toRefs,
inject
} from "vue"; } from "vue";
import { useStore } from "src/store"; import { useStore } from "src/store";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
@ -83,7 +85,15 @@ export default defineComponent({
components: { components: {
Vue3DraggableResizable Vue3DraggableResizable
}, },
setup() { props: {
col: {
type: String,
},
row: {
type: String,
}
},
setup(props) {
let set = GlobalData.getInstance().getCurrentClient(); let set = GlobalData.getInstance().getCurrentClient();
let $store = useStore(); let $store = useStore();
let $t = useI18n(); let $t = useI18n();
@ -227,12 +237,38 @@ export default defineComponent({
let tmp = coordinate_transformation_xy_to_value(obj_x, obj_y) let tmp = coordinate_transformation_xy_to_value(obj_x, obj_y)
value.value[index].x = Math.round(tmp.x) value.value[index].x = Math.round(tmp.x)
value.value[index].y = Math.round(tmp.y) value.value[index].y = Math.round(tmp.y)
send_value(index, Math.round(tmp.x), Math.round(tmp.y)) /**
* 判断摄像机
*/
if(now_selsect_projector?.value=='0-0'){
if(index==1||index==3){
value.value[index].x = Math.round(tmp.x)>allconfig.projector_width?allconfig.projector_width:Math.round(tmp.x)
}
}
if(now_selsect_projector?.value=='0-1'){
if(index==0||index==2){
value.value[index].x = Math.round(tmp.x)<0?0:Math.round(tmp.x)
}
}
send_value(index, value.value[index].x , value.value[index].y)
save_set_cache() save_set_cache()
} }
const chang = (index: number, $event: any, type: string) => { const chang = (index: number, $event: any, type: string) => {
index = Number(index) index = Number(index)
if (now_selsect_projector?.value == '0-0') {
if (index == 1 || index == 3) {
value.value[index].x > allconfig.projector_width ? value.value[index].x =allconfig.projector_width : value.value[index].x
}
}
if (now_selsect_projector?.value == '0-1') {
if (index == 0 || index == 2) {
value.value[index].x < 0 ? value.value[index].x= 0 : value.value[index].x
}
}
let tmp = coordinate_transformation_value_to_xy(value.value[index].x, value.value[index].y) let tmp = coordinate_transformation_value_to_xy(value.value[index].x, value.value[index].y)
value_point.value[index].y = Math.round(tmp.y) value_point.value[index].y = Math.round(tmp.y)
value_point.value[index].x = Math.round(tmp.x) value_point.value[index].x = Math.round(tmp.x)
@ -365,7 +401,7 @@ export default defineComponent({
*/ */
const details_selsect=(details:any) => { const details_selsect=(details:any) => {
let spt=details.deltaY/100 let spt=details.deltaY/100
if(spt<0){ if(spt>0){
if(options_model.value>=value_point.value.length-1){ if(options_model.value>=value_point.value.length-1){
options_model.value=0 options_model.value=0
}else{ }else{
@ -389,10 +425,29 @@ export default defineComponent({
switch (type) { switch (type) {
case 'x': case 'x':
if (spt < 0) { if (spt < 0) {
if(now_selsect_projector?.value=='0-0'&&props.col=='2'){
if(options_model.value==1||options_model.value==3){
value.value[options_model.value].x>allconfig.projector_width?value.value[options_model.value].x = allconfig.projector_width:value.value[options_model.value].x++
}else{
value.value[options_model.value].x++ value.value[options_model.value].x++
}
}else{
value.value[options_model.value].x++
}
} else {
if(now_selsect_projector?.value=='0-1'&&props.col=='2'){
if(options_model.value==0||options_model.value==2){
value.value[options_model.value].x <0?value.value[options_model.value].x = 0:value.value[options_model.value].x --
}else{ }else{
value.value[options_model.value].x-- value.value[options_model.value].x--
} }
}else{
value.value[options_model.value].x --
}
}
break; break;
default: default:
if (spt < 0) { if (spt < 0) {
@ -408,7 +463,9 @@ export default defineComponent({
defineExpose({ defineExpose({
options_model, options_model,
}); });
const now_selsect_projector:any = inject<string>("now_selsect_projector");
return { return {
now_selsect_projector,
details_selsect, details_selsect,
resetall, resetall,
div, div,

View File

@ -184,6 +184,7 @@ import {
onBeforeUnmount, onBeforeUnmount,
reactive, reactive,
onMounted, onMounted,
toRefs,
} from "vue"; } from "vue";
import { useStore } from "src/store"; import { useStore } from "src/store";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
@ -207,7 +208,7 @@ export default defineComponent({
{ alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 }, { alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 },
{ alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 }, { alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 },
]); ]);
const auto_sync = ref(false) const auto_sync = ref(true)
const auxiliary_line = ref(false) const auxiliary_line = ref(false)
const send_auxiliary_line = (val: boolean) => { const send_auxiliary_line = (val: boolean) => {
set?.SetBlendingOption("blending_grids_assistant_lines", val ? "1" : "0"); set?.SetBlendingOption("blending_grids_assistant_lines", val ? "1" : "0");

View File

@ -130,7 +130,7 @@ export default defineComponent({
const index = ref(0); const index = ref(0);
const color = reactive(["#ffffff", "#CCCCCC", "#000", "#000"]); const color = reactive(["#ffffff", "#CCCCCC", "#000", "#000"]);
let model = reactive([20, 40, 20]); let model = reactive([20, 40, 20]);
let options = ref([10, 20, 30, 40, 50]); let options = ref([10, 20, 30, 40, 50, 60 ,80]);
let line_width_options = ref([2,4,6,8,10, 20, 30, 40, 50]); let line_width_options = ref([2,4,6,8,10, 20, 30, 40, 50]);
const submit = () => { const submit = () => {
switch (index.value) { switch (index.value) {

View File

@ -183,8 +183,8 @@ export default defineComponent({
}; };
const use_server_config = () => { const use_server_config = () => {
value_point_amount.value = 9 value_point_amount.value = Number(Object.keys(config.multi_curved_surface)[0])
let a = 9 let a = value_point_amount.value
value.value = [] value.value = []
value_point.value = [] value_point.value = []
for (let index = 0; index < config.multi_curved_surface[a].length; index++) { for (let index = 0; index < config.multi_curved_surface[a].length; index++) {
@ -372,7 +372,7 @@ export default defineComponent({
onMounted(() => { onMounted(() => {
Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w) Proportion.value.x = allconfig.projector_width / (div.value.offsetWidth - point.value.w)
Proportion.value.y = allconfig.projector_height / (div.value.offsetHeight - point.value.h) Proportion.value.y = allconfig.projector_height / (div.value.offsetHeight - point.value.h)
start_point(9)
start() start()
use_server_config() use_server_config()
if ( if (
@ -383,6 +383,7 @@ export default defineComponent({
use_set_cache(); use_set_cache();
} }
options_value_point_amount.value = Object.keys(config.multi_curved_surface) options_value_point_amount.value = Object.keys(config.multi_curved_surface)
start_point(Number(options_value_point_amount.value[0]))
window.onresize = () => { window.onresize = () => {
return (() => { return (() => {
if (div != null) { if (div != null) {
@ -536,9 +537,9 @@ export default defineComponent({
for (let key in tmpconfig.multi_curved_surface) { for (let key in tmpconfig.multi_curved_surface) {
options_value_point_amount.value.push(key) options_value_point_amount.value.push(key)
} }
value_point_amount.value = 9 value_point_amount.value = Number(options_value_point_amount.value[0])
amount = 9 amount = Number(options_value_point_amount.value[0])
now_amount.value = 9 now_amount.value = Number(options_value_point_amount.value[0])
$store.commit("setfusion_configuration", res?.config); $store.commit("setfusion_configuration", res?.config);
value.value = [] value.value = []
value_point.value = [] value_point.value = []
@ -642,7 +643,7 @@ export default defineComponent({
*/ */
const details_selsect=(details:any) => { const details_selsect=(details:any) => {
let spt=details.deltaY/100 let spt=details.deltaY/100
if(spt<0){ if(spt>0){
if(options_model.value>=value_point.value.length-1){ if(options_model.value>=value_point.value.length-1){
options_model.value=0 options_model.value=0
}else{ }else{

View File

@ -71,7 +71,7 @@
]" /> ]" />
</div> </div>
<div style="min-height: 72vh"> <div style="min-height: 72vh">
<component ref="child" :is="options" /> <component ref="child" :is="options" :row="config.row" :col="config.col" />
</div> </div>
</div> </div>
</div> </div>
@ -203,6 +203,7 @@ import {
computed, computed,
onMounted, onMounted,
onBeforeMount, onBeforeMount,
provide,
} from "vue"; } from "vue";
import { useStore } from "src/store"; import { useStore } from "src/store";
import { useQuasar, copyToClipboard } from "quasar"; import { useQuasar, copyToClipboard } from "quasar";
@ -422,6 +423,7 @@ export default defineComponent({
case 'FourPointCalibration': case 'FourPointCalibration':
tmp = '4' tmp = '4'
set?.SetBlendingOption("blending_grids_control_point_count", `4`) set?.SetBlendingOption("blending_grids_control_point_count", `4`)
set?.SetBlendingOption("blending_grids_select_point", `4:1`)
break; break;
case 'SurfaceCorrection': case 'SurfaceCorrection':
tmp = '9' tmp = '9'
@ -515,12 +517,7 @@ export default defineComponent({
config.value.col = tmp.col; config.value.col = tmp.col;
config.value.row = tmp.row; config.value.row = tmp.row;
$store.commit("setfusion_configuration", res?.config); $store.commit("setfusion_configuration", res?.config);
optionsstr.value = "FourPointCalibration";
if(config.value.col==1&&config.value.row==1){
optionsstr.value = "FourPointCalibration"
}else{
optionsstr.value = "FusionLocale";
}
allconfig = JSON.parse($store.state.fusion_configuration); allconfig = JSON.parse($store.state.fusion_configuration);
if(allconfig.resolution){ if(allconfig.resolution){
for (let index = 0; index < allconfig.resolution.length; index++) { for (let index = 0; index < allconfig.resolution.length; index++) {
@ -624,7 +621,9 @@ export default defineComponent({
const currently_selected_projector = (value: string) => { const currently_selected_projector = (value: string) => {
set?.SetBlendingOption('blending_grids_select_projector', value); set?.SetBlendingOption('blending_grids_select_projector', value);
now_selsect_projector.value=value now_selsect_projector.value=value
} }
provide("now_selsect_projector",now_selsect_projector);
/** /**
* 设置投影机布局 * 设置投影机布局
@ -703,6 +702,7 @@ export default defineComponent({
} }
} }
return { return {
now_selsect_projector,
re_match_data, re_match_data,
trigger_dialog, trigger_dialog,
confirm, confirm,