|
@@ -47,15 +47,11 @@ AppPage {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //行表头-竖向的
|
|
|
|
|
property int verHeaderHeight: 30
|
|
property int verHeaderHeight: 30
|
|
|
property int verHeaderWidth: 150
|
|
property int verHeaderWidth: 150
|
|
|
- //列表头-横向的
|
|
|
|
|
property int horHeaderHeight: 30
|
|
property int horHeaderHeight: 30
|
|
|
- //滚动条
|
|
|
|
|
property color scrollBarColor: "cyan"
|
|
property color scrollBarColor: "cyan"
|
|
|
property int scrollBarWidth: 6
|
|
property int scrollBarWidth: 6
|
|
|
- //列宽
|
|
|
|
|
property variant columnWidthArr: [30,100,100,100,100,100,200,100,100,100,100,100,100]
|
|
property variant columnWidthArr: [30,100,100,100,100,100,200,100,100,100,100,100,100]
|
|
|
|
|
|
|
|
property variant table_mqtt_Value: ["id","dtype","ip","port","imei","uid","pwd","clientid","qos","keepalive","sub","pub","offline"]
|
|
property variant table_mqtt_Value: ["id","dtype","ip","port","imei","uid","pwd","clientid","qos","keepalive","sub","pub","offline"]
|
|
@@ -65,7 +61,6 @@ AppPage {
|
|
|
property variant table_json_Value: ["id","datetime","json_data","json_data"]
|
|
property variant table_json_Value: ["id","datetime","json_data","json_data"]
|
|
|
property int datacount: 1
|
|
property int datacount: 1
|
|
|
|
|
|
|
|
-
|
|
|
|
|
DatabaseInterface
|
|
DatabaseInterface
|
|
|
{
|
|
{
|
|
|
id: db_cfg
|
|
id: db_cfg
|
|
@@ -74,10 +69,8 @@ AppPage {
|
|
|
EasyTableModel{
|
|
EasyTableModel{
|
|
|
id: table_model
|
|
id: table_model
|
|
|
horHeader: table_mqtt_Value
|
|
horHeader: table_mqtt_Value
|
|
|
- //initData: []//myClass.getdata_JsonArray()
|
|
|
|
|
- //initData: []
|
|
|
|
|
}
|
|
}
|
|
|
- //表格内容(不包含表头)
|
|
|
|
|
|
|
+
|
|
|
TableView{
|
|
TableView{
|
|
|
id: table_view
|
|
id: table_view
|
|
|
height: sqlite_page.implicitHeight
|
|
height: sqlite_page.implicitHeight
|
|
@@ -93,29 +86,17 @@ AppPage {
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
columnSpacing: 1
|
|
columnSpacing: 1
|
|
|
rowSpacing: 1
|
|
rowSpacing: 1
|
|
|
- //视图的高度
|
|
|
|
|
- //contentHeight: rowHeightProvider(0) * rows + rowHeightProvider(rows-1)
|
|
|
|
|
- //视图的宽度
|
|
|
|
|
- //contentWidth:
|
|
|
|
|
- //content内容区域边距,但是不影响滚动条的位置
|
|
|
|
|
- //leftMargin:
|
|
|
|
|
- //topMargin:
|
|
|
|
|
- //此属性可以包含一个函数,该函数返回模型中每行的行高
|
|
|
|
|
rowHeightProvider: function (row) {
|
|
rowHeightProvider: function (row) {
|
|
|
return sqlite_page.verHeaderHeight;
|
|
return sqlite_page.verHeaderHeight;
|
|
|
}
|
|
}
|
|
|
- //此属性可以保存一个函数,该函数返回模型中每个列的列宽
|
|
|
|
|
columnWidthProvider: function (column) {
|
|
columnWidthProvider: function (column) {
|
|
|
return sqlite_page.columnWidthArr[column];
|
|
return sqlite_page.columnWidthArr[column];
|
|
|
- //return Math.max(1, (table_view.width - leftMargin) / table_view.columns)
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ScrollBar.vertical: ScrollBar {
|
|
ScrollBar.vertical: ScrollBar {
|
|
|
id: scroll_vertical
|
|
id: scroll_vertical
|
|
|
anchors.right: parent.right
|
|
anchors.right: parent.right
|
|
|
anchors.rightMargin: 2
|
|
anchors.rightMargin: 2
|
|
|
- //active: table_view.ScrollBar.vertical.active
|
|
|
|
|
- //policy: ScrollBar.AsNeeded
|
|
|
|
|
contentItem: Rectangle{
|
|
contentItem: Rectangle{
|
|
|
visible: (scroll_vertical.size<1.0)
|
|
visible: (scroll_vertical.size<1.0)
|
|
|
implicitWidth: sqlite_page.scrollBarWidth
|
|
implicitWidth: sqlite_page.scrollBarWidth
|
|
@@ -127,30 +108,21 @@ AppPage {
|
|
|
id: scroll_horizontal
|
|
id: scroll_horizontal
|
|
|
anchors.bottom: parent.bottom
|
|
anchors.bottom: parent.bottom
|
|
|
anchors.bottomMargin: 2
|
|
anchors.bottomMargin: 2
|
|
|
- //active: table_view.ScrollBar.vertical.active
|
|
|
|
|
- //policy: ScrollBar.AsNeeded
|
|
|
|
|
contentItem: Rectangle{
|
|
contentItem: Rectangle{
|
|
|
visible: (scroll_horizontal.size<1.0)
|
|
visible: (scroll_horizontal.size<1.0)
|
|
|
implicitHeight: sqlite_page.scrollBarWidth
|
|
implicitHeight: sqlite_page.scrollBarWidth
|
|
|
color: sqlite_page.scrollBarColor
|
|
color: sqlite_page.scrollBarColor
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- //model是在C++中定义的,和QtC++是类似的
|
|
|
|
|
|
|
+
|
|
|
model: table_model
|
|
model: table_model
|
|
|
delegate: Rectangle {
|
|
delegate: Rectangle {
|
|
|
- color: (model.row%2)?"orange":Qt.darker("orange") //根据行数设置背景颜色
|
|
|
|
|
|
|
+ color: (model.row%2)?"orange":Qt.darker("orange")
|
|
|
AppText{
|
|
AppText{
|
|
|
id : value_text
|
|
id : value_text
|
|
|
anchors.centerIn: parent
|
|
anchors.centerIn: parent
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
- // 水平居中对齐
|
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
- //elide: Text.ElideRight
|
|
|
|
|
- // selectByMouse: true
|
|
|
|
|
- // selectedTextColor: "black"
|
|
|
|
|
- // selectionColor: "white"
|
|
|
|
|
-
|
|
|
|
|
- //获取单元格对应的值
|
|
|
|
|
text: model.value
|
|
text: model.value
|
|
|
AppButton {
|
|
AppButton {
|
|
|
onClicked: {
|
|
onClicked: {
|
|
@@ -161,7 +133,6 @@ AppPage {
|
|
|
if(ok){
|
|
if(ok){
|
|
|
value_text.text = text
|
|
value_text.text = text
|
|
|
model.edit=text;
|
|
model.edit=text;
|
|
|
- //将改变写入到数据库中
|
|
|
|
|
console.log("edit",model.value)
|
|
console.log("edit",model.value)
|
|
|
if(sqlite_switch.checked)
|
|
if(sqlite_switch.checked)
|
|
|
{
|
|
{
|
|
@@ -184,50 +155,23 @@ AppPage {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- // Disable the negative action
|
|
|
|
|
dialog.negativeAction = false
|
|
dialog.negativeAction = false
|
|
|
- // Dismiss when touched outside
|
|
|
|
|
dialog.outsideTouchable = true
|
|
dialog.outsideTouchable = true
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- // onEditingFinished: {
|
|
|
|
|
- // model.edit=text;
|
|
|
|
|
- // //将改变写入到数据库中
|
|
|
|
|
- // console.log("edit",model.value)
|
|
|
|
|
- // if(sqlite_switch.checked)
|
|
|
|
|
- // {
|
|
|
|
|
- // if(table_combox.displayText===table_combox.model[0]||table_combox.displayText===table_combox.model[1])
|
|
|
|
|
- // {
|
|
|
|
|
- // db_cfg.updateData(table_combox.displayText,table_mqtt_Value[index],model.value)
|
|
|
|
|
- // }
|
|
|
|
|
- // if(table_combox.displayText===table_combox.model[2]||table_combox.displayText===table_combox.model[3])
|
|
|
|
|
- // {
|
|
|
|
|
- // db_cfg.updateData(table_combox.displayText,table_ftp_Value[index],model.value)
|
|
|
|
|
- // }
|
|
|
|
|
- // if(table_combox.displayText===table_combox.model[4])
|
|
|
|
|
- // {
|
|
|
|
|
- // db_cfg.updateData(table_combox.displayText,table_location_Value[index],model.value)
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // }
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- //横项表头
|
|
|
|
|
|
|
+
|
|
|
Item{
|
|
Item{
|
|
|
id: header_horizontal
|
|
id: header_horizontal
|
|
|
anchors{
|
|
anchors{
|
|
|
left: parent.left
|
|
left: parent.left
|
|
|
right: parent.right
|
|
right: parent.right
|
|
|
- leftMargin: 30//control.verHeaderWidth
|
|
|
|
|
|
|
+ leftMargin: 30
|
|
|
}
|
|
}
|
|
|
height: sqlite_page.horHeaderHeight
|
|
height: sqlite_page.horHeaderHeight
|
|
|
z: 2
|
|
z: 2
|
|
|
- //暂存鼠标拖动的位置
|
|
|
|
|
property int posXTemp: 0
|
|
property int posXTemp: 0
|
|
|
MouseArea{
|
|
MouseArea{
|
|
|
anchors.fill: parent
|
|
anchors.fill: parent
|
|
@@ -285,7 +229,6 @@ AppPage {
|
|
|
}
|
|
}
|
|
|
header_horizontal.posXTemp=mouseX;
|
|
header_horizontal.posXTemp=mouseX;
|
|
|
sqlite_page.columnWidthArr[index]=(header_horizontal_item.width-table_view.columnSpacing);
|
|
sqlite_page.columnWidthArr[index]=(header_horizontal_item.width-table_view.columnSpacing);
|
|
|
- //刷新布局,这样宽度才会改变
|
|
|
|
|
table_view.forceLayout();
|
|
table_view.forceLayout();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -293,14 +236,13 @@ AppPage {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- //竖向表头
|
|
|
|
|
|
|
+
|
|
|
Column {
|
|
Column {
|
|
|
id: header_verical
|
|
id: header_verical
|
|
|
height: sqlite_page.implicitHeight
|
|
height: sqlite_page.implicitHeight
|
|
|
anchors{
|
|
anchors{
|
|
|
left: parent.left
|
|
left: parent.left
|
|
|
top: parent.top
|
|
top: parent.top
|
|
|
- //bottom: parent.bottom
|
|
|
|
|
topMargin: sqlite_page.horHeaderHeight
|
|
topMargin: sqlite_page.horHeaderHeight
|
|
|
}
|
|
}
|
|
|
topPadding: -table_view.contentY
|
|
topPadding: -table_view.contentY
|
|
@@ -320,35 +262,6 @@ AppPage {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- // JsonListModel {
|
|
|
|
|
- // id: jsonModel
|
|
|
|
|
- // source: table_model.initData
|
|
|
|
|
- // keyField: "id"
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // AppListView {
|
|
|
|
|
- // anchors.fill: parent
|
|
|
|
|
- // bottomMargin: nativeUtils.safeAreaInsets.bottom
|
|
|
|
|
- // model: jsonModel
|
|
|
|
|
-
|
|
|
|
|
- // delegate: SimpleRow {
|
|
|
|
|
- // text: model.sub
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // // Transition animation for adding items
|
|
|
|
|
- // add: Transition {
|
|
|
|
|
- // NumberAnimation {
|
|
|
|
|
- // property: "opacity"
|
|
|
|
|
- // from: 0
|
|
|
|
|
- // to: 1
|
|
|
|
|
- // duration: 1000
|
|
|
|
|
- // easing.type: Easing.OutQuad
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
AppModal {
|
|
AppModal {
|
|
|
id: sqliteModal
|
|
id: sqliteModal
|
|
@@ -437,8 +350,6 @@ AppPage {
|
|
|
}
|
|
}
|
|
|
table_model.table_name = table_combox.displayText
|
|
table_model.table_name = table_combox.displayText
|
|
|
table_model.initData=db_cfg.queryData(table_combox.displayText,datacount)
|
|
table_model.initData=db_cfg.queryData(table_combox.displayText,datacount)
|
|
|
- //text_row_count.text = db_cfg.getTable_row(table_combox.displayText)
|
|
|
|
|
- //rowindex_text.text = datacount
|
|
|
|
|
}else{
|
|
}else{
|
|
|
sqlite_switch.checked = false
|
|
sqlite_switch.checked = false
|
|
|
sqlite_combox.enabled = true;
|
|
sqlite_combox.enabled = true;
|
|
@@ -463,12 +374,12 @@ AppPage {
|
|
|
anchors.fill: parent
|
|
anchors.fill: parent
|
|
|
anchors.leftMargin: 5
|
|
anchors.leftMargin: 5
|
|
|
anchors.topMargin:5
|
|
anchors.topMargin:5
|
|
|
- //anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
columns: 1
|
|
columns: 1
|
|
|
rows: 3
|
|
rows: 3
|
|
|
columnSpacing: 10
|
|
columnSpacing: 10
|
|
|
rowSpacing: 5
|
|
rowSpacing: 5
|
|
|
horizontalItemAlignment: Grid.AlignHCenter
|
|
horizontalItemAlignment: Grid.AlignHCenter
|
|
|
|
|
+
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
radius: 5
|
|
radius: 5
|
|
|
width: parent.width * 0.995
|
|
width: parent.width * 0.995
|
|
@@ -488,15 +399,15 @@ AppPage {
|
|
|
|
|
|
|
|
AppImage {
|
|
AppImage {
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
- anchors.left: parent.left //
|
|
|
|
|
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
|
|
|
|
|
|
|
+ anchors.left: parent.left
|
|
|
|
|
+ fillMode: Image.PreserveAspectFit
|
|
|
source: "../../assets/floder.svg"
|
|
source: "../../assets/floder.svg"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Column{
|
|
Column{
|
|
|
id: column_info
|
|
id: column_info
|
|
|
- anchors.verticalCenter: parent.verticalCenter // 在垂直方向上居中
|
|
|
|
|
- anchors.left: parent.left //
|
|
|
|
|
|
|
+ anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
+ anchors.left: parent.left
|
|
|
anchors.leftMargin: 100
|
|
anchors.leftMargin: 100
|
|
|
AppText{
|
|
AppText{
|
|
|
id: text_info
|
|
id: text_info
|
|
@@ -515,7 +426,7 @@ AppPage {
|
|
|
|
|
|
|
|
AppButton {
|
|
AppButton {
|
|
|
id:btn_fresh
|
|
id:btn_fresh
|
|
|
- anchors.verticalCenter: parent.verticalCenter // 在垂直方向上居中
|
|
|
|
|
|
|
+ anchors.verticalCenter: parent.verticalCenter
|
|
|
anchors.left: column_info.right
|
|
anchors.left: column_info.right
|
|
|
anchors.leftMargin: dp(50)
|
|
anchors.leftMargin: dp(50)
|
|
|
text: "刷新"
|
|
text: "刷新"
|
|
@@ -530,7 +441,7 @@ AppPage {
|
|
|
|
|
|
|
|
AppButton {
|
|
AppButton {
|
|
|
id:btn_clear
|
|
id:btn_clear
|
|
|
- anchors.verticalCenter: parent.verticalCenter // 在垂直方向上居中
|
|
|
|
|
|
|
+ anchors.verticalCenter: parent.verticalCenter
|
|
|
anchors.left: btn_fresh.right
|
|
anchors.left: btn_fresh.right
|
|
|
text: "清理"
|
|
text: "清理"
|
|
|
flat: false
|
|
flat: false
|
|
@@ -542,11 +453,12 @@ AppPage {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
Row{
|
|
Row{
|
|
|
- //anchors.fill: parent
|
|
|
|
|
width: parent.width
|
|
width: parent.width
|
|
|
- height: parent.height*0.35
|
|
|
|
|
|
|
+ height: parent.height*0.39
|
|
|
spacing:5
|
|
spacing:5
|
|
|
|
|
+
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
width: parent.width*0.245
|
|
width: parent.width*0.245
|
|
|
height: parent.height
|
|
height: parent.height
|
|
@@ -556,20 +468,19 @@ AppPage {
|
|
|
anchors.fill: parent
|
|
anchors.fill: parent
|
|
|
spacing: 5
|
|
spacing: 5
|
|
|
AppImage {
|
|
AppImage {
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
- // 将元素的顶部锚定到父元素的顶部
|
|
|
|
|
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
|
|
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ fillMode: Image.PreserveAspectFit
|
|
|
source: "../../assets/ztl.svg"
|
|
source: "../../assets/ztl.svg"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
AppText{
|
|
AppText{
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
text: "状态栏开关"
|
|
text: "状态栏开关"
|
|
|
color: app.fontColor
|
|
color: app.fontColor
|
|
|
font.bold: true
|
|
font.bold: true
|
|
|
}
|
|
}
|
|
|
Switch{
|
|
Switch{
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
objectName: "openbar_btn"
|
|
objectName: "openbar_btn"
|
|
|
id: openbar_btn
|
|
id: openbar_btn
|
|
|
signal opernBar
|
|
signal opernBar
|
|
@@ -596,12 +507,12 @@ AppPage {
|
|
|
anchors.fill: parent
|
|
anchors.fill: parent
|
|
|
spacing: 5
|
|
spacing: 5
|
|
|
AppImage {
|
|
AppImage {
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
|
|
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ fillMode: Image.PreserveAspectFit
|
|
|
source: "../../assets/dhl.svg"
|
|
source: "../../assets/dhl.svg"
|
|
|
}
|
|
}
|
|
|
AppText{
|
|
AppText{
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
id: net_sta
|
|
id: net_sta
|
|
|
text: "导航栏开关"
|
|
text: "导航栏开关"
|
|
|
color: app.fontColor
|
|
color: app.fontColor
|
|
@@ -612,7 +523,7 @@ AppPage {
|
|
|
objectName: "opennav_btn"
|
|
objectName: "opennav_btn"
|
|
|
signal opernNav
|
|
signal opernNav
|
|
|
signal closeNav
|
|
signal closeNav
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
onClicked: {
|
|
onClicked: {
|
|
|
if(opennav_btn.checked==true){
|
|
if(opennav_btn.checked==true){
|
|
|
console.log("打开导航栏")
|
|
console.log("打开导航栏")
|
|
@@ -667,7 +578,7 @@ AppPage {
|
|
|
|
|
|
|
|
AppText{
|
|
AppText{
|
|
|
id: apptext_title_mode
|
|
id: apptext_title_mode
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
text: "设置模式"
|
|
text: "设置模式"
|
|
|
font.bold: true
|
|
font.bold: true
|
|
|
}
|
|
}
|
|
@@ -768,16 +679,17 @@ AppPage {
|
|
|
Column {
|
|
Column {
|
|
|
anchors.fill: parent
|
|
anchors.fill: parent
|
|
|
spacing: 5
|
|
spacing: 5
|
|
|
|
|
+ topPadding: 10
|
|
|
AppImage {
|
|
AppImage {
|
|
|
id: appimage_theme
|
|
id: appimage_theme
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
|
|
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ fillMode: Image.PreserveAspectFit
|
|
|
source: "../../assets/themset.svg"
|
|
source: "../../assets/themset.svg"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
AppText{
|
|
AppText{
|
|
|
id: apptext_title
|
|
id: apptext_title
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
text: "设置主题"
|
|
text: "设置主题"
|
|
|
color: app.fontColor
|
|
color: app.fontColor
|
|
|
font.bold: true
|
|
font.bold: true
|
|
@@ -785,7 +697,7 @@ AppPage {
|
|
|
|
|
|
|
|
AppText {
|
|
AppText {
|
|
|
id: apptext_select
|
|
id: apptext_select
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
text: "当前:" + settings.getValue("theme_mode")
|
|
text: "当前:" + settings.getValue("theme_mode")
|
|
|
fontSize: 10
|
|
fontSize: 10
|
|
|
font.bold: false
|
|
font.bold: false
|
|
@@ -800,10 +712,10 @@ AppPage {
|
|
|
width: parent.width*0.245
|
|
width: parent.width*0.245
|
|
|
height: parent.height
|
|
height: parent.height
|
|
|
color: app.cardColor
|
|
color: app.cardColor
|
|
|
-
|
|
|
|
|
Column {
|
|
Column {
|
|
|
anchors.fill: parent
|
|
anchors.fill: parent
|
|
|
- spacing: 10
|
|
|
|
|
|
|
+ spacing: 5
|
|
|
|
|
+ topPadding: 10
|
|
|
AppButton {
|
|
AppButton {
|
|
|
anchors.fill: parent
|
|
anchors.fill: parent
|
|
|
onClicked: {
|
|
onClicked: {
|
|
@@ -812,13 +724,14 @@ AppPage {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
AppImage {
|
|
AppImage {
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
|
|
|
|
|
|
|
+ id: image_exit
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ fillMode: Image.PreserveAspectFit
|
|
|
source: "../../assets/logout.svg"
|
|
source: "../../assets/logout.svg"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
AppText{
|
|
AppText{
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
text: "退出登录"
|
|
text: "退出登录"
|
|
|
color: app.fontColor
|
|
color: app.fontColor
|
|
|
font.bold: true
|
|
font.bold: true
|
|
@@ -829,8 +742,9 @@ AppPage {
|
|
|
|
|
|
|
|
Row {
|
|
Row {
|
|
|
width: parent.width
|
|
width: parent.width
|
|
|
- height: parent.height*0.43
|
|
|
|
|
|
|
+ height: parent.height*0.39
|
|
|
spacing: 5
|
|
spacing: 5
|
|
|
|
|
+
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
radius: 5
|
|
radius: 5
|
|
|
width: parent.width*0.245
|
|
width: parent.width*0.245
|
|
@@ -838,54 +752,49 @@ AppPage {
|
|
|
color: app.cardColor
|
|
color: app.cardColor
|
|
|
|
|
|
|
|
Column {
|
|
Column {
|
|
|
- id: column_bi
|
|
|
|
|
anchors.fill: parent
|
|
anchors.fill: parent
|
|
|
- MouseArea {
|
|
|
|
|
- anchors.fill: parent
|
|
|
|
|
- onClicked: {
|
|
|
|
|
- column_bi.visible = false
|
|
|
|
|
- column_bi.enabled = false
|
|
|
|
|
- column_bu.visible = true
|
|
|
|
|
- column_bu.enabled = true
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ spacing: 5
|
|
|
|
|
+ topPadding: 10
|
|
|
|
|
+
|
|
|
|
|
+ AppImage {
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ fillMode: Image.PreserveAspectFit
|
|
|
|
|
+ source: "../../assets/updateboard.svg"
|
|
|
}
|
|
}
|
|
|
- AppText{
|
|
|
|
|
- anchors.centerIn: parent
|
|
|
|
|
- text: "控制系统版本:" + app.boardversionText
|
|
|
|
|
- fontSize: 20
|
|
|
|
|
- font.bold: true
|
|
|
|
|
|
|
+
|
|
|
|
|
+ AppText {
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ text: "升级主板"
|
|
|
color: app.fontColor
|
|
color: app.fontColor
|
|
|
|
|
+ font.bold: true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ AppText {
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ text: "当前:" + app.boardversionText
|
|
|
|
|
+ fontSize: 10
|
|
|
|
|
+ color: "gray"
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- Column {
|
|
|
|
|
- id: column_bu
|
|
|
|
|
- visible: false
|
|
|
|
|
- anchors.fill: parent
|
|
|
|
|
- spacing: 10
|
|
|
|
|
- AppButton {
|
|
|
|
|
- anchors.fill: parent
|
|
|
|
|
|
|
+ MouseArea {
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ width: parent.width * 0.7
|
|
|
|
|
+ height: dp(30)
|
|
|
|
|
+ AppText {
|
|
|
|
|
+ anchors.centerIn: parent
|
|
|
|
|
+ text: "点击升级"
|
|
|
|
|
+ color: "#0aa26b"
|
|
|
|
|
+ font.pixelSize: sp(12)
|
|
|
|
|
+ }
|
|
|
onClicked: {
|
|
onClicked: {
|
|
|
- column_bi.visible = true
|
|
|
|
|
- column_bi.enabled = true
|
|
|
|
|
- column_bu.visible = false
|
|
|
|
|
- column_bu.enabled = false
|
|
|
|
|
var dialog = InputDialog.inputTextSingleLine(page_sys,
|
|
var dialog = InputDialog.inputTextSingleLine(page_sys,
|
|
|
"请输入密钥!",
|
|
"请输入密钥!",
|
|
|
"Input here",
|
|
"Input here",
|
|
|
- function(ok,text){
|
|
|
|
|
|
|
+ function(ok, text){
|
|
|
if(ok){
|
|
if(ok){
|
|
|
if(text==="2024"){
|
|
if(text==="2024"){
|
|
|
mqtt.sendUpdatesBoard()
|
|
mqtt.sendUpdatesBoard()
|
|
|
}else{
|
|
}else{
|
|
|
- /*
|
|
|
|
|
- 0:普通消息框,只有一个“确定”按钮。
|
|
|
|
|
- 1:警告消息框,通常用于提醒用户注意。
|
|
|
|
|
- 2:确认消息框,包含“是”和“否”两个按钮。
|
|
|
|
|
- 3:询问消息框,包含“是”、“否”和“取消”三个按钮。
|
|
|
|
|
- 4:错误消息框,用于显示错误或异常情况。
|
|
|
|
|
- */
|
|
|
|
|
nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
|
|
nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -893,22 +802,7 @@ AppPage {
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- AppImage {
|
|
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
|
|
|
|
|
- source: "../../assets/updateboard.svg"
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- AppText{
|
|
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
- text: "升级主板"
|
|
|
|
|
- color: app.fontColor
|
|
|
|
|
- font.bold: true
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
Rectangle {
|
|
@@ -918,44 +812,45 @@ AppPage {
|
|
|
color: app.cardColor
|
|
color: app.cardColor
|
|
|
|
|
|
|
|
Column {
|
|
Column {
|
|
|
- id: column_ai
|
|
|
|
|
- spacing: 10
|
|
|
|
|
- anchors.fill: parent
|
|
|
|
|
- MouseArea {
|
|
|
|
|
- anchors.fill: parent
|
|
|
|
|
- onClicked: {
|
|
|
|
|
- column_ai.visible = false
|
|
|
|
|
- column_ai.enabled = false
|
|
|
|
|
- column_au.visible = true
|
|
|
|
|
- column_au.enabled = true
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ anchors.fill: parent
|
|
|
|
|
+ spacing: 5
|
|
|
|
|
+ topPadding: 10
|
|
|
|
|
|
|
|
- AppText{
|
|
|
|
|
- anchors.centerIn: parent
|
|
|
|
|
- text: "App版本:" + app.appversionText
|
|
|
|
|
- fontSize: 20
|
|
|
|
|
- font.bold: true
|
|
|
|
|
- color: app.fontColor
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ AppImage {
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ fillMode: Image.PreserveAspectFit
|
|
|
|
|
+ source: "../../assets/updateapp.svg"
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- Column {
|
|
|
|
|
- id: column_au
|
|
|
|
|
- visible: false
|
|
|
|
|
- spacing: 10
|
|
|
|
|
- anchors.fill: parent
|
|
|
|
|
- AppButton {
|
|
|
|
|
- anchors.fill: parent
|
|
|
|
|
|
|
+ AppText {
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ text: "升级App"
|
|
|
|
|
+ color: app.fontColor
|
|
|
|
|
+ font.bold: true
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ AppText {
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ text: "当前:" + app.appversionText
|
|
|
|
|
+ fontSize: 10
|
|
|
|
|
+ color: "gray"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ MouseArea {
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ width: parent.width * 0.7
|
|
|
|
|
+ height: dp(30)
|
|
|
|
|
+ AppText {
|
|
|
|
|
+ anchors.centerIn: parent
|
|
|
|
|
+ text: "点击升级"
|
|
|
|
|
+ color: "#0aa26b"
|
|
|
|
|
+ font.pixelSize: sp(12)
|
|
|
|
|
+ }
|
|
|
onClicked: {
|
|
onClicked: {
|
|
|
- column_ai.visible = true
|
|
|
|
|
- column_ai.enabled = true
|
|
|
|
|
- column_au.visible = false
|
|
|
|
|
- column_au.enabled = false
|
|
|
|
|
var dialog = InputDialog.inputTextSingleLine(page_sys,
|
|
var dialog = InputDialog.inputTextSingleLine(page_sys,
|
|
|
"请输入密钥!",
|
|
"请输入密钥!",
|
|
|
"Input here",
|
|
"Input here",
|
|
|
- function(ok,text){
|
|
|
|
|
|
|
+ function(ok, text){
|
|
|
if(ok){
|
|
if(ok){
|
|
|
if(text==="2024"){
|
|
if(text==="2024"){
|
|
|
mqtt.sendUpdateApp()
|
|
mqtt.sendUpdateApp()
|
|
@@ -967,17 +862,6 @@ AppPage {
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- AppImage {
|
|
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
|
|
|
|
|
- source: "../../assets/updateapp.svg"
|
|
|
|
|
- }
|
|
|
|
|
- AppText{
|
|
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
- text: "升级App"
|
|
|
|
|
- color: app.fontColor
|
|
|
|
|
- font.bold: true
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -990,33 +874,50 @@ AppPage {
|
|
|
|
|
|
|
|
Column {
|
|
Column {
|
|
|
anchors.fill: parent
|
|
anchors.fill: parent
|
|
|
|
|
+ anchors.topMargin: parent.height * 0.15
|
|
|
spacing: 10
|
|
spacing: 10
|
|
|
|
|
|
|
|
- AppButton {
|
|
|
|
|
- id: button_reboot
|
|
|
|
|
- anchors.fill: parent
|
|
|
|
|
- onClicked:{
|
|
|
|
|
- serial.reboot()
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
AppImage {
|
|
AppImage {
|
|
|
id: image_reboot
|
|
id: image_reboot
|
|
|
- anchors.centerIn: parent
|
|
|
|
|
- //anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
|
|
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ fillMode: Image.PreserveAspectFit
|
|
|
source: "../../assets/reboot.svg"
|
|
source: "../../assets/reboot.svg"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
AppText{
|
|
AppText{
|
|
|
id: text_reboot
|
|
id: text_reboot
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
|
|
- anchors.top: image_reboot.bottom
|
|
|
|
|
- anchors.topMargin: 10
|
|
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
text: "系统重启"
|
|
text: "系统重启"
|
|
|
color: app.fontColor
|
|
color: app.fontColor
|
|
|
font.bold: true
|
|
font.bold: true
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ MouseArea {
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ width: parent.width * 0.7
|
|
|
|
|
+ height: dp(30)
|
|
|
|
|
+ AppText {
|
|
|
|
|
+ anchors.centerIn: parent
|
|
|
|
|
+ text: "点击重启"
|
|
|
|
|
+ color: "#0aa26b"
|
|
|
|
|
+ font.pixelSize: sp(12)
|
|
|
|
|
+ }
|
|
|
|
|
+ onClicked: {
|
|
|
|
|
+ var dialog = InputDialog.inputTextSingleLine(page_sys,
|
|
|
|
|
+ "请输入密钥!",
|
|
|
|
|
+ "Input here",
|
|
|
|
|
+ function(ok, text){
|
|
|
|
|
+ if(ok){
|
|
|
|
|
+ if(text==="2024"){
|
|
|
|
|
+ serial.reboot()
|
|
|
|
|
+ }else{
|
|
|
|
|
+ nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1026,122 +927,47 @@ AppPage {
|
|
|
height: parent.height
|
|
height: parent.height
|
|
|
color: app.cardColor
|
|
color: app.cardColor
|
|
|
|
|
|
|
|
- MouseArea {
|
|
|
|
|
- anchors.fill: parent
|
|
|
|
|
- onClicked: {
|
|
|
|
|
- if(column_di.visible === false){
|
|
|
|
|
- column_di.visible = true
|
|
|
|
|
- column_di.enabled = true
|
|
|
|
|
- column_debug.visible = false
|
|
|
|
|
- column_debug.enabled = false
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- Column {
|
|
|
|
|
- id: column_di
|
|
|
|
|
- spacing: 10
|
|
|
|
|
- anchors.fill: parent
|
|
|
|
|
- AppButton {
|
|
|
|
|
- anchors.centerIn: parent
|
|
|
|
|
- text: "高级功能"
|
|
|
|
|
- textColor: app.fontColor
|
|
|
|
|
- flat: false
|
|
|
|
|
- borderColor: "green"
|
|
|
|
|
- fontBold: true
|
|
|
|
|
- onClicked: {
|
|
|
|
|
- var dialog = InputDialog.inputTextSingleLine(page_sys,
|
|
|
|
|
- "请输入密钥!",
|
|
|
|
|
- "Input here",
|
|
|
|
|
- function(ok,text){
|
|
|
|
|
- if(ok){
|
|
|
|
|
- if(text==="2024"){
|
|
|
|
|
- column_di.visible = false
|
|
|
|
|
- column_di.enabled = false
|
|
|
|
|
- column_debug.visible = true
|
|
|
|
|
- column_debug.enabled = true
|
|
|
|
|
- }else{
|
|
|
|
|
- nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- )
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
Column {
|
|
Column {
|
|
|
- id: column_debug
|
|
|
|
|
- spacing: 10
|
|
|
|
|
- visible: false
|
|
|
|
|
- enabled: false
|
|
|
|
|
- anchors.fill: parent
|
|
|
|
|
|
|
+ anchors.centerIn: parent
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ spacing: 5
|
|
|
|
|
|
|
|
- AppCheckBox {
|
|
|
|
|
- id: acb_log
|
|
|
|
|
- text: "日志"
|
|
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
- onCheckedChanged: {
|
|
|
|
|
- if(acb_log.checked){
|
|
|
|
|
- app.log_enable = true
|
|
|
|
|
- console.log("日志开")
|
|
|
|
|
- }else{
|
|
|
|
|
- app.log_enable = false
|
|
|
|
|
- console.log("日志关")
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ AppText {
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ text: "参数调试"
|
|
|
|
|
+ color: app.fontColor
|
|
|
|
|
+ font.bold: true
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- AppCheckBox {
|
|
|
|
|
- id: acb_stitch
|
|
|
|
|
- text: "拼接"
|
|
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
- onCheckedChanged: {
|
|
|
|
|
- if(acb_stitch.checked){
|
|
|
|
|
- app.stitch_enable = true
|
|
|
|
|
- console.log("拼接参数开")
|
|
|
|
|
- }else{
|
|
|
|
|
- app.stitch_enable = false
|
|
|
|
|
- console.log("拼接参数关")
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- AppCheckBox {
|
|
|
|
|
- id: acb_pqt
|
|
|
|
|
- text: "清晰度"
|
|
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
- onCheckedChanged: {
|
|
|
|
|
- if(acb_pqt.checked){
|
|
|
|
|
- app.photoclarity = true
|
|
|
|
|
- console.log("拼接参数开")
|
|
|
|
|
- }else{
|
|
|
|
|
- app.photoclarity = false
|
|
|
|
|
- console.log("拼接参数关")
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- AppButton {
|
|
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
- text: "SQLITE"
|
|
|
|
|
- implicitHeight: 25
|
|
|
|
|
- implicitWidth: 40
|
|
|
|
|
- flat: false
|
|
|
|
|
- onClicked: {
|
|
|
|
|
- //打开SQLIT界面
|
|
|
|
|
- page_sys.navigationStack.push(sqlite_component)
|
|
|
|
|
-// var component = Qt.createComponent("SqlScreen.qml")
|
|
|
|
|
-// if(component.status === Component.Ready){
|
|
|
|
|
-// var SqlScreen = component.createObject(parent)
|
|
|
|
|
-// if(SqlScreen!==null){
|
|
|
|
|
-// SqlScreen.show()
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ MouseArea {
|
|
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
+ width: parent.width * 0.7
|
|
|
|
|
+ height: dp(30)
|
|
|
|
|
+ AppText {
|
|
|
|
|
+ anchors.centerIn: parent
|
|
|
|
|
+ text: "点击进入"
|
|
|
|
|
+ color: "#0aa26b"
|
|
|
|
|
+ font.pixelSize: sp(12)
|
|
|
|
|
+ }
|
|
|
|
|
+ onClicked: {
|
|
|
|
|
+ var dialog = InputDialog.inputTextSingleLine(page_sys,
|
|
|
|
|
+ "请输入密钥!",
|
|
|
|
|
+ "Input here",
|
|
|
|
|
+ function(ok, text){
|
|
|
|
|
+ if(ok){
|
|
|
|
|
+ if(text==="2024"){
|
|
|
|
|
+ page_sys.navigationStack.push(sqlite_component)
|
|
|
|
|
+ }else{
|
|
|
|
|
+ nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|