electricControl/.bin/main.js

182 lines
4.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function() {
var Main = /*@__PURE__*/ (function(Component) {
function Main(props) {
Component.call(this, props);
this.data = {
listData: [
{
circuitName: "1路电流",
current: "3.21A",
typeName: "高压风冷:",
isTypeOpen: false
},
{
circuitName: "2路电流",
current: "3.21A",
typeName: "中压风冷:",
isTypeOpen: true
},
{
circuitName: "3路电流",
current: "3.21A",
typeName: "低压风冷:",
isTypeOpen: false
},
{
circuitName: "4路电流",
current: "3.21A",
typeName: "闭锁调压:",
isTypeOpen: true
}
]
};
}
if (Component) Main.__proto__ = Component;
Main.prototype = Object.create(Component && Component.prototype);
Main.prototype.constructor = Main;
Main.prototype.apiready = function() {};
Main.prototype.handleToSet = function() {
api.openWin({
name: "set",
url: "./main/set.stml"
});
};
Main.prototype.handleToHistory = function() {
api.openWin({
name: "history",
url: "./main/history.stml"
});
};
Main.prototype.render = function() {
return apivm.h(
"view",
{class: "index_wrap"},
apivm.h("text", {class: "index_title"}, "运行状态"),
apivm.h(
"view",
{class: "index_list"},
(Array.isArray(this.data.listData)
? this.data.listData
: Object.values(this.data.listData)
).map(function(item$1) {
return apivm.h(
"view",
{class: "index_inline"},
apivm.h(
"view",
{class: "inline_item"},
apivm.h("text", {class: "inline_item_text"}, item$1.circuitName),
apivm.h("text", {class: "inline_item_text"}, item$1.current)
),
apivm.h(
"view",
{class: "inline_item"},
apivm.h("text", {class: "inline_item_text"}, item$1.typeName),
apivm.h("text", {
class: item$1.isTypeOpen
? "inline_item_circle_open"
: "inline_item_circle_close"
}),
apivm.h(
"text",
{class: "inline_item_text"},
item$1.isTypeOpen ? "开" : "关"
)
)
);
})
),
apivm.h(
"view",
{class: "index_footer"},
apivm.h("text", {class: "footer_set", onClick: this.handleToSet}, "设置"),
apivm.h(
"text",
{class: "footer_history", onClick: this.handleToHistory},
"操作历史"
)
)
);
};
return Main;
})(Component);
Main.css = {
".index_wrap": {
width: "100%",
height: "100%",
boxSizing: "border-box",
padding: "20px",
backgroundImage: 'url("../image/login.png")',
backgroundSize: "120%",
backgroundRepeat: "no-repeat",
backgroundPosition: "center"
},
".index_title": {
width: "100%",
textAlign: "center",
fontSize: "60px",
color: "#ffffff",
fontWeight: "bold"
},
".index_list": {marginTop: "50px", display: "flex", alignItems: "center"},
".index_inline": {
display: "flex",
flexDirection: "row",
alignItems: "center",
margin: "10px 0"
},
".inline_item": {
margin: "0 40px",
display: "flex",
flexDirection: "row",
alignItems: "center"
},
".inline_item_text": {
fontSize: "40px",
fontWeight: "bold",
color: "#ffffff",
margin: "0 10px"
},
".inline_item_circle_open": {
width: "40px",
height: "40px",
backgroundColor: "#09be30",
borderRadius: "50%",
margin: "0 10px"
},
".inline_item_circle_close": {
width: "40px",
height: "40px",
backgroundColor: "#fd0101",
borderRadius: "50%",
margin: "0 10px"
},
".index_footer": {
width: "80%",
margin: "50px auto 0",
display: "flex",
flexDirection: "row",
alignItems: "center"
},
".footer_set": {
fontSize: "40px",
fontWeight: "bold",
boxSizing: "border-box",
padding: "10px 20px",
color: "#ffffff"
},
".footer_history": {
fontSize: "40px",
fontWeight: "bold",
marginLeft: "50px",
boxSizing: "border-box",
padding: "10px 20px",
color: "#ffffff"
}
};
apivm.define("main", Main);
apivm.render(apivm.h("main", null), "body");
})();