electricControl/.bin/main/history.js

180 lines
4.3 KiB
JavaScript
Raw Normal View History

2023-08-04 09:20:01 +08:00
(function() {
var History = /*@__PURE__*/ (function(Component) {
function History(props) {
Component.call(this, props);
2023-08-04 10:55:53 +08:00
this.data = {
listData: [
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"},
{name: "1"}
]
};
2023-08-04 09:20:01 +08:00
}
if (Component) History.__proto__ = Component;
History.prototype = Object.create(Component && Component.prototype);
History.prototype.constructor = History;
History.prototype.apiready = function() {};
2023-08-04 10:55:53 +08:00
History.prototype.handleBackIndex = function() {
api.navigateBack({
delta: 2
});
};
History.prototype.handleRefresh = function() {
console.log("顶部触发");
};
History.prototype.handleLoadMore = function() {
console.log("加载更多");
};
2023-08-04 09:20:01 +08:00
History.prototype.render = function() {
2023-08-04 10:55:53 +08:00
var this$1 = this;
2023-08-04 09:20:01 +08:00
return apivm.h(
"view",
{class: "history_wrap"},
2023-08-04 10:55:53 +08:00
apivm.h(
"text",
{class: "history_back_text", onClick: this.handleBackIndex},
"返回"
),
2023-08-04 09:20:01 +08:00
apivm.h("text", {class: "history_title"}, "历史操作记录"),
apivm.h(
2023-08-04 10:55:53 +08:00
"view",
{class: "table_wrap"},
apivm.h(
"view",
{class: "table_title"},
apivm.h("text", {class: "table_title_item_one"}, "动作"),
apivm.h("text", {class: "table_title_item_two"}, "实时参数"),
apivm.h("text", {class: "table_title_item_one"}, "时间")
),
apivm.h(
"scroll-view",
{
class: "history_list",
"scroll-x": "false",
"scroll-y": true,
onscrolltoupper: function(event) {
if (this$1.handleRefresh) {
this$1.handleRefresh(event);
} else {
handleRefresh(event);
}
},
onscrolltolower: function(event) {
if (this$1.handleLoadMore) {
this$1.handleLoadMore(event);
} else {
handleLoadMore(event);
}
}
},
(Array.isArray(this.data.listData)
? this.data.listData
: Object.values(this.data.listData)
).map(function(item$1) {
return apivm.h(
"view",
{class: "history_list_inline"},
apivm.h("text", {class: "history_list_inline_item_one"}, item$1.name),
apivm.h("text", {class: "history_list_inline_item_two"}, "111"),
apivm.h("text", {class: "history_list_inline_item_one"}, "111")
);
})
)
2023-08-04 09:20:01 +08:00
)
);
};
return History;
})(Component);
History.css = {
".history_wrap": {
width: "100%",
height: "100vh",
boxSizing: "border-box",
2023-08-04 10:55:53 +08:00
padding: "20px",
backgroundImage: 'url("../../image/login.png")',
backgroundSize: "120%",
backgroundRepeat: "no-repeat",
backgroundPosition: "center",
position: "absolute"
},
".history_back_text": {
fontSize: "40px",
color: "#ffffff",
fontWeight: "bold",
position: "absolute",
top: "20px",
left: "20px"
2023-08-04 09:20:01 +08:00
},
".history_title": {
width: "100%",
textAlign: "center",
fontSize: "40px",
fontWeight: "bold",
2023-08-04 10:55:53 +08:00
color: "#ffffff"
2023-08-04 09:20:01 +08:00
},
2023-08-04 10:55:53 +08:00
".table_wrap": {width: "100%", marginTop: "20px"},
".table_title": {display: "flex", flexDirection: "row", alignItems: "center"},
".table_title_item_one": {
fontSize: "36px",
color: "#ffffff",
border: "1px solid #ffffff",
width: "20%",
boxSizing: "border-box",
padding: "10px",
textAlign: "center"
},
".table_title_item_two": {
fontSize: "36px",
color: "#ffffff",
border: "1px solid #ffffff",
width: "60%",
boxSizing: "border-box",
padding: "10px",
textAlign: "center"
},
".history_list": {border: "1px solid silver", width: "100%", height: "70vh"},
".history_list_inline": {
display: "flex",
flexDirection: "row",
alignItems: "center"
},
".history_list_inline_item_one": {
fontSize: "32px",
color: "#ffffff",
border: "1px solid #ffffff",
width: "20%",
boxSizing: "border-box",
padding: "10px"
},
".history_list_inline_item_two": {
fontSize: "32px",
color: "#ffffff",
border: "1px solid #ffffff",
width: "60%",
boxSizing: "border-box",
padding: "10px"
2023-08-04 09:20:01 +08:00
}
};
apivm.define("history", History);
apivm.render(apivm.h("history", null), "body");
})();