deesCloud-web/scripts/ps-en.js

113 lines
3.6 KiB
JavaScript
Raw Normal View History

2025-08-01 16:50:32 +08:00
//组件
var pscomponent_en = {
template:`
<div>
<div :style="{ height: tHeight + 'px' }">
<el-tag style="font-size: 16px;">Parameter Units</el-tag>
<template>
<div class="text item" style="margin-top: 20px;margin-left: 40px;color: rgb(255,255,0);">
<span style="margin-right: 20px;color: rgb(255,255,0);">Pressure</span>
<el-radio v-model="radio1" label="1" style="color: rgb(255,255,0);">MPa</el-radio>
<el-radio v-model="radio1" label="2" style="color: rgb(255,255,0);">psi</el-radio>
</div>
</template>
<template>
<div class="text item" style="margin-top: 20px;margin-left: 40px;color: rgb(255,255,0);">
<span style="margin-right: 20px;color: rgb(255,255,0);">Temperature</span>
<el-radio v-model="radio2" label="1" style="color: rgb(255,255,0);" ></el-radio>
<el-radio v-model="radio2" label="2" style="color: rgb(255,255,0);" ></el-radio>
</div>
</template>
<el-tag style="font-size: 16px;margin-top: 20px;">Date Display</el-tag>
<template>
<div class="text item" style="margin-top: 20px;margin-left: 40px;color: rgb(255,255,0);">
<span style="margin-right: 20px;color: rgb(255,255,0);">Date Format</span>
<el-radio v-model="radio3" label="1" style="color: rgb(255,255,0);" >YYYY-MM-DD</el-radio>
<el-radio v-model="radio3" label="2" style="color: rgb(255,255,0);">MM-DD-YYYY</el-radio>
<el-radio v-model="radio3" label="3" style="color: rgb(255,255,0);">DD/MM/YYYY</el-radio>
<el-checkbox v-model="radio4" style="color: rgb(255,255,0);">Abbreviation Of Month</el-checkbox>
</div>
</template>
<el-tag style="font-size: 16px;margin-top: 20px;">Scale Style</el-tag>
<template>
<div class="text item" style="margin-top: 20px;margin-left: 40px;color: rgb(255,255,0);">
<el-radio v-model="radio5" label="1" style="color: rgb(255,255,0);">Style 1</el-radio>
<el-radio v-model="radio5" label="2" style="color: rgb(255,255,0);">Style 2</el-radio>
</div>
</template>
<el-button type="primary" round style="margin-top: 20px;margin-left: 40px;" @click="page_setting">保存配置</el-button>
</div>
</div>
`,
data(){
// 获取当前屏幕的分辨率
let screenW = window.screen.width;
let screenH = window.screen.height;
console.log("screen width:",screenW);
console.log("screen height:",screenH);
return {
tHeight:screenH*0.8,
radio1:'1',
radio2:'1',
radio3:'1',
radio4:false,
radio5:'1',
}
},
mounted() {
this.get_page_setting();
},
methods: {
page_setting(){
var _this = this;
axios.post('/deescloud/page_setting', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
r1:this.$data.radio1,
r2:this.$data.radio2,
r3:this.$data.radio3,
r4:this.$data.radio4,
r5:this.$data.radio5,
})
.then(function (response) {
_this.$message({
message: "设置成功",
type: "success",
duration: 1500
});
_this.get_page_setting();
})
.catch(function (error) {
console.log(error);
});
},
get_page_setting(){
var _this = this;
axios.post('/deescloud/get_page_setting', {
opuser:localStorage.getItem("online_user"),
opuser_uuid:localStorage.getItem("uuid"),
})
.then(function (response) {
_this.$data.radio1 = response.data.r1;
_this.$data.radio2 = response.data.r2;
_this.$data.radio3 = response.data.r3;
_this.$data.radio4 = response.data.r4;
_this.$data.radio5 = response.data.r5;
})
.catch(function (error) {
console.log(error);
});
},
}
}