commit 6fee032470fc278097131d0ad2ff3fd8e25d8003
Author: liuwu <975499773@qq.com>
Date: Fri Aug 4 09:20:01 2023 +0800
first commit
diff --git a/.bin/main.js b/.bin/main.js
new file mode 100644
index 0000000..f45dfa1
--- /dev/null
+++ b/.bin/main.js
@@ -0,0 +1,181 @@
+(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");
+})();
diff --git a/.bin/main/history.js b/.bin/main/history.js
new file mode 100644
index 0000000..cb4da0c
--- /dev/null
+++ b/.bin/main/history.js
@@ -0,0 +1,50 @@
+(function() {
+ var History = /*@__PURE__*/ (function(Component) {
+ function History(props) {
+ Component.call(this, props);
+ this.data = {};
+ }
+
+ if (Component) History.__proto__ = Component;
+ History.prototype = Object.create(Component && Component.prototype);
+ History.prototype.constructor = History;
+ History.prototype.apiready = function() {};
+ History.prototype.render = function() {
+ return apivm.h(
+ "view",
+ {class: "history_wrap"},
+ apivm.h("text", {class: "history_title"}, "历史操作记录"),
+ apivm.h(
+ "scroll-view",
+ {class: "history_list", "scroll-x": "false", "scroll-y": true},
+ apivm.h("view", {class: ""})
+ )
+ );
+ };
+
+ return History;
+ })(Component);
+ History.css = {
+ ".history_wrap": {
+ width: "100%",
+ height: "100vh",
+ boxSizing: "border-box",
+ padding: "20px"
+ },
+ ".history_title": {
+ width: "100%",
+ textAlign: "center",
+ fontSize: "40px",
+ fontWeight: "bold",
+ color: "#000000"
+ },
+ ".history_list": {
+ marginTop: "30px",
+ border: "1px solid silver",
+ width: "100%",
+ height: "80vh"
+ }
+ };
+ apivm.define("history", History);
+ apivm.render(apivm.h("history", null), "body");
+})();
diff --git a/.bin/main/set.js b/.bin/main/set.js
new file mode 100644
index 0000000..39dcfd7
--- /dev/null
+++ b/.bin/main/set.js
@@ -0,0 +1,209 @@
+(function() {
+ var Set = /*@__PURE__*/ (function(Component) {
+ function Set(props) {
+ Component.call(this, props);
+ this.data = {
+ setList: [
+ {
+ isSet: false,
+ setVal: "",
+ selectVal: "请选择",
+ selectIndex: 0,
+ name: "高压风冷"
+ },
+ {
+ isSet: true,
+ setVal: "",
+ selectVal: "请选择",
+ selectIndex: 0,
+ name: "中压风冷"
+ },
+ {
+ isSet: false,
+ setVal: "",
+ selectVal: "请选择",
+ selectIndex: 0,
+ name: "低压风冷"
+ },
+ {
+ isSet: true,
+ setVal: "",
+ selectVal: "请选择",
+ selectIndex: 0,
+ name: "闭锁调压"
+ }
+ ],
+
+ //电流通道列表
+ currentList: ["1路", "2路", "3路", "4路"]
+ };
+ }
+
+ if (Component) Set.__proto__ = Component;
+ Set.prototype = Object.create(Component && Component.prototype);
+ Set.prototype.constructor = Set;
+ Set.prototype.apiready = function() {
+ var selector0 = document.getElementById("selector0");
+ var selector1 = document.getElementById("selector1");
+ var selector2 = document.getElementById("selector2");
+ var selector3 = document.getElementById("selector3");
+ selector0.setData({
+ data: this.data.currentList
+ });
+ selector1.setData({
+ data: this.data.currentList
+ });
+ selector2.setData({
+ data: this.data.currentList
+ });
+ selector3.setData({
+ data: this.data.currentList
+ });
+ };
+ Set.prototype.handleBackIndex = function() {
+ api.navigateBack({
+ delta: 2
+ });
+ };
+ Set.prototype.handleSwitchChange = function(e) {
+ var _index = e.target.attributes.index;
+ this.data.setList.forEach(function(item, index) {
+ if (index === _index) {
+ item.isSet = e.detail.value;
+ }
+ });
+ };
+ Set.prototype.handleSelectChange = function(e) {
+ var this$1 = this;
+
+ var _index = e.target.attributes.index;
+ this.data.setList.forEach(function(item, index) {
+ if (index === _index) {
+ item.selectIndex = e.detail.value;
+ item.selectVal = this$1.data.currentList[e.detail.value];
+ }
+ });
+ };
+ Set.prototype.render = function() {
+ var this$1 = this;
+ return apivm.h(
+ "view",
+ {class: "set_wrap"},
+ apivm.h(
+ "text",
+ {class: "set_back_text", onClick: this.handleBackIndex},
+ "返回"
+ ),
+ apivm.h(
+ "view",
+ {class: "set_list"},
+ (Array.isArray(this.data.setList)
+ ? this.data.setList
+ : Object.values(this.data.setList)
+ ).map(function(item$1, index$1) {
+ return apivm.h(
+ "view",
+ {class: "list_inline"},
+ apivm.h(
+ "view",
+ {class: "inline_item"},
+ apivm.h("text", {class: "item_label"}, item$1.name, ":"),
+ apivm.h(
+ "view",
+ {class: "item_content"},
+ apivm.h(
+ "view",
+ {class: "switch_box"},
+ apivm.h("switch", {
+ class: "switch",
+ index: index$1,
+ checked: item$1.isSet,
+ onChange: this$1.handleSwitchChange
+ })
+ ),
+ apivm.h("input", {
+ class: "input",
+ type: "text",
+ disabled: !item$1.isSet,
+ placeholder: "请输入电流值"
+ })
+ )
+ ),
+ apivm.h(
+ "view",
+ {class: "inline_item"},
+ apivm.h("text", {class: "item_label"}, "电流通道:"),
+ apivm.h(
+ "view",
+ {class: "item_content"},
+ apivm.h(
+ "picker",
+ {
+ class: "picker",
+ id: "selector" + index$1,
+ index: index$1,
+ mode: "selector",
+ value: item$1.selectIndex,
+ onChange: this$1.handleSelectChange
+ },
+ apivm.h("text", {class: "item_label"}, item$1.selectVal)
+ )
+ )
+ )
+ );
+ })
+ )
+ );
+ };
+
+ return Set;
+ })(Component);
+ Set.css = {
+ ".set_wrap": {
+ width: "100%",
+ height: "100vh",
+ boxSizing: "border-box",
+ padding: "20px"
+ },
+ ".set_back_text": {fontSize: "40px", color: "#000000", fontWeight: "bold"},
+ ".set_list": {marginTop: "50px", display: "flex", alignItems: "center"},
+ ".list_inline": {
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center",
+ margin: "10px 0"
+ },
+ ".inline_item": {
+ margin: "0 40px",
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center"
+ },
+ ".item_label": {fontSize: "40px", fontWeight: "bold", color: "#000000"},
+ ".item_content": {
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center"
+ },
+ ".switch_box": {
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center",
+ width: "76px",
+ height: "46px"
+ },
+ ".switch": {transform: "scale(1.5, 1.5)"},
+ ".input": {
+ boxSizing: "border-box",
+ padding: "5px",
+ border: "1px solid silver",
+ fontSize: "32px",
+ height: "60px",
+ width: "200px",
+ marginLeft: "20px",
+ borderRadius: "10px"
+ }
+ };
+ apivm.define("set", Set);
+ apivm.render(apivm.h("set", null), "body");
+})();
diff --git a/.yonstudio/.labelinfo b/.yonstudio/.labelinfo
new file mode 100644
index 0000000..c82e379
--- /dev/null
+++ b/.yonstudio/.labelinfo
@@ -0,0 +1 @@
+{"main":"j:\\YouStudio\\test\\pages\\main.stml","set":"j:\\YouStudio\\test\\pages\\main\\set.stml","history":"j:\\YouStudio\\test\\pages\\main\\history.stml"}
\ No newline at end of file
diff --git a/.yonstudio/.project b/.yonstudio/.project
new file mode 100644
index 0000000..00e8f66
--- /dev/null
+++ b/.yonstudio/.project
@@ -0,0 +1 @@
+{"appid":"A1785216780697862147","appname":"test","apptype":"app","synctime":1691110138}
\ No newline at end of file
diff --git a/components/.gitkeep b/components/.gitkeep
new file mode 100644
index 0000000..546dab5
--- /dev/null
+++ b/components/.gitkeep
@@ -0,0 +1 @@
+此目录是组件放置目录
diff --git a/config.xml b/config.xml
new file mode 100644
index 0000000..dff5a67
--- /dev/null
+++ b/config.xml
@@ -0,0 +1,55 @@
+
+
+ test
+
+ Example For yonyou.
+
+ Developer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/css/.gitkeep b/css/.gitkeep
new file mode 100644
index 0000000..0a57a23
--- /dev/null
+++ b/css/.gitkeep
@@ -0,0 +1 @@
+此目录是 css 样式资源目录
diff --git a/html/.gitkeep b/html/.gitkeep
new file mode 100644
index 0000000..afe9846
--- /dev/null
+++ b/html/.gitkeep
@@ -0,0 +1 @@
+此目录是 html 文件夹目录
diff --git a/icon/icon150x150.png b/icon/icon150x150.png
new file mode 100644
index 0000000..84353b6
Binary files /dev/null and b/icon/icon150x150.png differ
diff --git a/image/img.png b/image/img.png
new file mode 100644
index 0000000..d4091b2
Binary files /dev/null and b/image/img.png differ
diff --git a/image/login.png b/image/login.png
new file mode 100644
index 0000000..d866c71
Binary files /dev/null and b/image/login.png differ
diff --git a/launch/launch1080x1920.png b/launch/launch1080x1920.png
new file mode 100644
index 0000000..5a85df8
Binary files /dev/null and b/launch/launch1080x1920.png differ
diff --git a/pages/main.stml b/pages/main.stml
new file mode 100644
index 0000000..21d20f2
--- /dev/null
+++ b/pages/main.stml
@@ -0,0 +1,138 @@
+
+
+ 运行状态
+
+
+
+ {{item.circuitName}}
+ {{item.current}}
+
+
+ {{item.typeName}}
+
+ {{item.isTypeOpen?'开':'关'}}
+
+
+
+
+
+
+
+
diff --git a/pages/main/history.stml b/pages/main/history.stml
new file mode 100644
index 0000000..e2705ce
--- /dev/null
+++ b/pages/main/history.stml
@@ -0,0 +1,45 @@
+
+
+ 历史操作记录
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/main/set.stml b/pages/main/set.stml
new file mode 100644
index 0000000..cfd2023
--- /dev/null
+++ b/pages/main/set.stml
@@ -0,0 +1,150 @@
+
+
+ 返回
+
+
+
+ {{item.name}}:
+
+
+
+
+
+
+ 电流通道:
+
+
+ {{item.selectVal}}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/manifest.xml b/res/manifest.xml
new file mode 100644
index 0000000..b37dc73
--- /dev/null
+++ b/res/manifest.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/script/.gitkeep b/script/.gitkeep
new file mode 100644
index 0000000..5eb7106
--- /dev/null
+++ b/script/.gitkeep
@@ -0,0 +1 @@
+此目录是脚本目录
diff --git a/wgt/.gitkeep b/wgt/.gitkeep
new file mode 100644
index 0000000..c04422a
--- /dev/null
+++ b/wgt/.gitkeep
@@ -0,0 +1 @@
+此目录是资源包目录