| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035 |
- import Felgo
- import QtMultimedia
- import QtQuick
- import QtQuick.Controls
- import EasyModel 1.0
- import com.example.database 1.0
- import "../controls"
- import "../common"
- import "../model"
- AppPage {
- id: page_sys
- title: qsTr("系统设置")
- backgroundColor: app.theme_backgroundColor
- navigationBarHidden: true
- property var picinfo_list:[]
- signal logoutClicked
- signal themChange(string mode)
- // 参数重置二次确认挂起标志:
- // nativeUtils 是全局单例,其它页面/流程也会弹 messageBox,
- // 必须用标志位区分"本次参数重置弹窗"的确认/取消,避免其它弹窗误触发重置指令
- property bool resetConfirmPending: false
- Connections {
- target: nativeUtils
- function onMessageBoxFinished(accepted) {
- if(!resetConfirmPending) return
- resetConfirmPending = false
- if(accepted){
- console.log("参数重置已确认,发送JSONRPC恢复出厂设置指令!")
- serial.makeJsonRpc("factory_reset", "")
- }else{
- console.log("参数重置已取消")
- }
- }
- }
- MediaPlayer{
- id: audio
- audioOutput: AudioOutput{}
- source: Qt.resolvedUrl("../../assets/mp3/button.mp3")
- }
- Connections {
- target: mqtt
- }
- // 权限管理页:以 Component 形式定义,供"权限管理"按钮 push 进入
- Component {
- id: permission_component
- PermissionPage {
- }
- }
- Component {
- id: sqlite_component
- AppPage {
- id: sqlite_page
- implicitHeight: 800
- implicitWidth: 1280
- rightBarItem: IconButtonBarItem {
- iconType: IconType.paintbrush
- onClicked: {
- console.log("database")
- sqliteModal.open()
- }
- }
- property int verHeaderHeight: 30
- property int verHeaderWidth: 150
- property int horHeaderHeight: 30
- property color scrollBarColor: "cyan"
- property int scrollBarWidth: 6
- 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_ftp_Value: ["id","ip","port","dir","uid","pwd","mode"]
- property variant table_location_Value: ["id","lbs_lat","lbs_lng","gps_lat","gps_lng","gps_elevation"]
- property variant table_camera_Value: ["camera_type","mode","stitch_photonum","photo_width","photo_height","auto_focus"]
- property variant table_json_Value: ["id","datetime","json_data","json_data"]
- property int datacount: 1
- DatabaseInterface
- {
- id: db_cfg
- }
- EasyTableModel{
- id: table_model
- horHeader: table_mqtt_Value
- }
- TableView{
- id: table_view
- height: sqlite_page.implicitHeight
- anchors{
- left: parent.left
- right: parent.right
- top: parent.top
- leftMargin: 30
- topMargin: sqlite_page.horHeaderHeight
- }
- clip: true
- boundsBehavior: Flickable.StopAtBounds
- columnSpacing: 1
- rowSpacing: 1
- rowHeightProvider: function (row) {
- return sqlite_page.verHeaderHeight;
- }
- columnWidthProvider: function (column) {
- return sqlite_page.columnWidthArr[column];
- }
- ScrollBar.vertical: ScrollBar {
- id: scroll_vertical
- anchors.right: parent.right
- anchors.rightMargin: 2
- contentItem: Rectangle{
- visible: (scroll_vertical.size<1.0)
- implicitWidth: sqlite_page.scrollBarWidth
- color: sqlite_page.scrollBarColor
- }
- }
- ScrollBar.horizontal: ScrollBar {
- id: scroll_horizontal
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 2
- contentItem: Rectangle{
- visible: (scroll_horizontal.size<1.0)
- implicitHeight: sqlite_page.scrollBarWidth
- color: sqlite_page.scrollBarColor
- }
- }
- model: table_model
- delegate: Rectangle {
- color: (model.row%2)?"orange":Qt.darker("orange")
- AppText{
- id : value_text
- anchors.centerIn: parent
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- text: model.value
- AppButton {
- onClicked: {
- var dialog = InputDialog.inputTextSingleLine(app,
- "请输入要修改内容",
- value_text.text,
- function(ok,text){
- if(ok){
- value_text.text = text
- 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])
- {
- columnWidthArr = [30,100,100,100,100,100,200,100,100,100,100,100,100]
- 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)
- }
- if(table_combox.displayText===table_combox.model[5]){
- db_cfg.updateData(table_combox.displayText,table_camera_Value[index],model.value)
- }
- }
- }
- })
- dialog.negativeAction = false
- dialog.outsideTouchable = true
- }
- }
- }
- }
- }
- Item{
- id: header_horizontal
- anchors{
- left: parent.left
- right: parent.right
- leftMargin: 30
- }
- height: sqlite_page.horHeaderHeight
- z: 2
- property int posXTemp: 0
- MouseArea{
- anchors.fill: parent
- onPressed: {
- header_horizontal.posXTemp=mouseX;
- }
- onPositionChanged: {
- if(table_view.contentX+(header_horizontal.posXTemp-mouseX)>0){
- table_view.contentX+=(header_horizontal.posXTemp-mouseX);
- }else{
- table_view.contentX=0;
- }
- header_horizontal.posXTemp=mouseX;
- }
- }
- Row {
- id: header_horizontal_row
- anchors.fill: parent
- leftPadding: -table_view.contentX
- clip: true
- spacing: 0
- Repeater {
- model: table_view.columns > 0 ? table_view.columns : 0
- Rectangle {
- id: header_horizontal_item
- width: table_view.columnWidthProvider(index)+table_view.columnSpacing
- height: sqlite_page.horHeaderHeight
- color: "purple"
- AppText {
- anchors.centerIn: parent
- text: table_model.headerData(index, Qt.Horizontal)
- }
- Rectangle{
- width: 1
- height: parent.height
- anchors.right: parent.right
- color: "black"
- opacity: 0.5
- }
- MouseArea{
- width: 3
- height: parent.height
- anchors.right: parent.right
- cursorShape: Qt.SplitHCursor
- onPressed: header_horizontal.posXTemp=mouseX;
- onPositionChanged: {
- if((header_horizontal_item.width-(header_horizontal.posXTemp-mouseX))>10){
- header_horizontal_item.width-=(header_horizontal.posXTemp-mouseX);
- }else{
- header_horizontal_item.width=10;
- }
- header_horizontal.posXTemp=mouseX;
- sqlite_page.columnWidthArr[index]=(header_horizontal_item.width-table_view.columnSpacing);
- table_view.forceLayout();
- }
- }
- }
- }
- }
- }
- Column {
- id: header_verical
- height: sqlite_page.implicitHeight
- anchors{
- left: parent.left
- top: parent.top
- topMargin: sqlite_page.horHeaderHeight
- }
- topPadding: -table_view.contentY
- z: 2
- clip: true
- spacing: 1
- Repeater {
- model: table_view.rows > 0 ? table_view.rows : 0
- Rectangle {
- width: 30
- height: table_view.rowHeightProvider(index)
- color: "green"
- Text {
- anchors.centerIn: parent
- text: table_model.headerData(index, Qt.Vertical)
- }
- }
- }
- }
- AppModal {
- id: sqliteModal
- fullscreen: false
- modalHeight: dp(380) + nativeUtils.safeAreaInsets.bottom
- NavigationStack {
- AppPage {
- title: "配置信息管理"
- rightBarItem: TextButtonBarItem {
- text: "关闭"
- textItem.font.pixelSize: sp(16)
- onClicked: sqliteModal.close()
- }
- Column {
- id: sqliteColumn
- width: parent.width
- Section {
- title: "数据库"
- ComboBox {
- id: sqlite_combox
- height: dp(40)
- width: parent.width/2
- model: ["config.db", "data.db"]
- }
- }
- Section {
- title: "数据表"
- ComboBox {
- id: table_combox
- height: dp(40)
- width: parent.width/2
- model: ["mqtt", "mqtt_other","ftp","ftp_other","location","camera","data"]
- onActivated: {
- console.log(displayText)
- table_model.table_name = displayText
- if(displayText===model[0]||displayText===model[1])
- {
- columnWidthArr = [30,100,100,100,100,100,200,100,100,100,100,100,100]
- table_model.horHeader = table_mqtt_Value
- }
- else if(displayText===model[2]||displayText===model[3])
- {
- table_model.horHeader = table_ftp_Value
- }
- else if(displayText===model[4])
- {
- table_model.horHeader = table_location_Value
- }else if(displayText===model[5]){
- columnWidthArr = [100,100,150,100,100,100]
- table_model.horHeader = table_camera_Value
- }
- else if(displayText===model[6])
- {
- table_model.horHeader = table_json_Value
- }
- table_model.initData=db_cfg.queryData(displayText,datacount)
- }
- }
- }
- AppText {
- id: sqlite_text
- text: "开关:"
- }
- AppSwitch {
- id: sqlite_switch
- anchors.left: sqlite_text.light
- anchors.leftMargin: 10
- onToggled: {
- if(sqlite_switch.checked){
- var dbs = db_cfg.openDatabase(sqlite_combox.displayText)
- if(dbs){
- console.log("打开数据库成功");
- sqlite_combox.enabled = false
- table_combox.enabled = true
- if(sqlite_combox.displayText==="data.db")
- {
- table_combox.displayText=table_combox.model[6];
- }
- table_model.table_name = table_combox.displayText
- table_model.initData=db_cfg.queryData(table_combox.displayText,datacount)
- }else{
- sqlite_switch.checked = false
- sqlite_combox.enabled = true;
- console.log("打开数据库失败");
- }
- }else{
- sqlite_combox.enabled = true;
- db_cfg.closeDatabase()
- console.log("关闭数据库");
- }
- }
- }
- }
- }
- }
- }
- }
- }
- Grid {
- anchors.fill: parent
- anchors.leftMargin: 5
- anchors.topMargin:5
- columns: 1
- rows: 3
- columnSpacing: 10
- rowSpacing: 5
- horizontalItemAlignment: Grid.AlignHCenter
- Rectangle {
- radius: 5
- width: parent.width * 0.995
- height: parent.height*0.18
- color: app.cardColor
- Timer {
- interval: 1000
- running: true
- repeat: true
- onTriggered: {
- picinfo_list = serial.pathinfo()
- text_info.text = "占用大小:" + picinfo_list[2] + "(Mb)" + "文件数量:" + picinfo_list[1]
- text_pathinfo.text = "图片存储目录:" + picinfo_list[0]
- }
- }
- AppImage {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- fillMode: Image.PreserveAspectFit
- source: "../../assets/floder.svg"
- }
- Column{
- id: column_info
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 100
- AppText{
- id: text_info
- text: "存储占用:" + ""
- color: app.fontColor
- font.bold: true
- }
- AppText{
- id: text_pathinfo
- text:"图片存储目录:"
- fontSize: 10
- color: "gray"
- }
- }
- AppButton {
- id:btn_fresh
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: column_info.right
- anchors.leftMargin: dp(50)
- text: "刷新"
- flat: false
- textColor: "black"
- backgroundColor: "#e9e9e9"
- borderColor: "white"
- onClicked: {
- serial.readPathinfo()
- }
- }
- AppButton {
- id:btn_clear
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: btn_fresh.right
- text: "清理"
- flat: false
- textColor: "white"
- backgroundColor: "#0aa26b"
- borderColor: "white"
- onClicked: {
- serial.removepic()
- }
- }
- // 权限管理入口:定位/电话/文件与媒体/修改系统设置等权限的检测与开启
- AppButton {
- id:btn_permission
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: btn_clear.right
- anchors.leftMargin: dp(10)
- text: "权限管理"
- flat: false
- textColor: "white"
- backgroundColor: "#1a73e8"
- borderColor: "white"
- onClicked: {
- page_sys.navigationStack.push(permission_component)
- }
- }
- // 参数重置:二次弹窗确认后,串口发 JSONRPC 指令把 MCU 参数恢复出厂设置
- AppButton {
- id:btn_param_reset
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: btn_permission.right
- anchors.leftMargin: dp(10)
- text: "参数重置"
- flat: false
- textColor: "white"
- backgroundColor: "#d9534f"
- borderColor: "white"
- onClicked: {
- resetConfirmPending = true
- nativeUtils.displayMessageBox(
- "参数重置确认",
- "将把MCU参数恢复出厂设置,该操作不可撤销!\n是否继续?",
- 1
- )
- }
- }
- }
- Row{
- width: parent.width
- height: parent.height*0.39
- spacing:5
- Rectangle {
- width: parent.width*0.245
- height: parent.height
- color: app.cardColor
- radius: 5
- Column{
- anchors.fill: parent
- spacing: 5
- AppImage {
- anchors.horizontalCenter: parent.horizontalCenter
- fillMode: Image.PreserveAspectFit
- source: "../../assets/ztl.svg"
- }
- AppText{
- anchors.horizontalCenter: parent.horizontalCenter
- text: "状态栏开关"
- color: app.fontColor
- font.bold: true
- }
- Switch{
- anchors.horizontalCenter: parent.horizontalCenter
- objectName: "openbar_btn"
- id: openbar_btn
- signal opernBar
- signal closeBar
- onClicked: {
- if(openbar_btn.checked==true){
- console.log("打开状态栏")
- opernBar()
- }else{
- console.log("关闭状态栏")
- closeBar()
- }
- }
- }
- }
- }
- Rectangle {
- radius: 5
- width: parent.width*0.245
- height: parent.height
- color: app.cardColor
- Column{
- anchors.fill: parent
- spacing: 5
- AppImage {
- anchors.horizontalCenter: parent.horizontalCenter
- fillMode: Image.PreserveAspectFit
- source: "../../assets/dhl.svg"
- }
- AppText{
- anchors.horizontalCenter: parent.horizontalCenter
- id: net_sta
- text: "导航栏开关"
- color: app.fontColor
- font.bold: true
- }
- Switch{
- id: opennav_btn
- objectName: "opennav_btn"
- signal opernNav
- signal closeNav
- anchors.horizontalCenter: parent.horizontalCenter
- onClicked: {
- if(opennav_btn.checked==true){
- console.log("打开导航栏")
- opernNav()
- }else{
- console.log("关闭导航栏")
- closeNav()
- }
- }
- }
- }
- }
- Rectangle {
- radius: 5
- width: parent.width*0.245
- height: parent.height
- color: app.cardColor
- MouseArea{
- anchors.fill: parent
- onClicked: {
- appimage_theme.visible = false
- apptext_title.visible = false
- apptext_select.visible = false
- row_select.visible = true
- }
- }
- Column {
- id: row_select
- visible: false
- anchors.fill: parent
- spacing: 5
- Component.onCompleted: {
- app.theme_md = settings.getValue("theme_mode")
- if(app.theme_md==="auto"){
- auto_rdb.checked = true
- rec_auto_rdb.border.color = "#0aa26b"
- apptext_select.text = "当前:自动"
- }else if(theme_md==="day"){
- day_rdb.checked = true;
- rec_day_rdb.border.color = "#0aa26b"
- apptext_select.text = "当前:白天"
- }else if(theme_md==="night"){
- night_rdb.checked = true;
- rec_night_rdb.border.color = "#0aa26b"
- apptext_select.text = "当前:黑夜"
- }
- }
- AppText{
- id: apptext_title_mode
- anchors.horizontalCenter: parent.horizontalCenter
- text: "设置模式"
- font.bold: true
- }
- CustomRadioButton {
- id: auto_rdb
- anchors.horizontalCenter: parent.horizontalCenter
- width: parent.width*0.8
- checked: true
- text: "自动"
- Rectangle {
- id: rec_auto_rdb
- anchors.fill: parent
- color: "#f5f5f5"
- radius: 5
- border.color: "#f5f5f5"
- border.width: 2
- }
- onCheckedChanged: {
- if(auto_rdb.checked){
- rec_auto_rdb.border.color = "#0aa26b"
- settings.setValue("theme_mode","auto")
- themChange("auto")
- apptext_select.text = "当前:自动"
- }else{
- rec_auto_rdb.border.color = "#f5f5f5"
- }
- row_select.visible = false
- rec_theme.color = app.cardColor
- appimage_theme.visible = true
- apptext_title.visible = true
- apptext_select.visible = true
- }
- }
- CustomRadioButton {
- id: night_rdb
- anchors.horizontalCenter: parent.horizontalCenter
- width: parent.width*0.8
- text: "黑夜"
- Rectangle {
- id: rec_night_rdb
- anchors.fill: parent
- color: "#f5f5f5"
- radius: 5
- border.color: "#f5f5f5"
- border.width: 2
- }
- onCheckedChanged: {
- if(night_rdb.checked){
- settings.setValue("theme_mode","night")
- rec_night_rdb.border.color = "#0aa26b"
- themChange("night")
- apptext_select.text = "当前:黑夜"
- }else{
- rec_night_rdb.border.color = "#f5f5f5"
- }
- row_select.visible = false
- rec_theme.color = app.cardColor
- appimage_theme.visible = true
- apptext_title.visible = true
- apptext_select.visible = true
- }
- }
- CustomRadioButton {
- id: day_rdb
- anchors.horizontalCenter: parent.horizontalCenter
- width: parent.width*0.8
- text: "白天"
- Rectangle {
- id: rec_day_rdb
- anchors.fill: parent
- color: "#f5f5f5"
- radius: 5
- border.color: "#f5f5f5"
- border.width: 2
- }
- onCheckedChanged: {
- if(day_rdb.checked){
- settings.setValue("theme_mode","day")
- rec_day_rdb.border.color = "#0aa26b"
- themChange("day")
- apptext_select.text = "当前:白天"
- }else{
- rec_day_rdb.border.color = "#f5f5f5"
- }
- row_select.visible = false
- rec_theme.color = app.cardColor
- appimage_theme.visible = true
- apptext_title.visible = true
- apptext_select.visible = true
- }
- }
- }
- Column {
- anchors.fill: parent
- spacing: 5
- topPadding: 10
- AppImage {
- id: appimage_theme
- anchors.horizontalCenter: parent.horizontalCenter
- fillMode: Image.PreserveAspectFit
- source: "../../assets/themset.svg"
- }
- AppText{
- id: apptext_title
- anchors.horizontalCenter: parent.horizontalCenter
- text: "设置主题"
- color: app.fontColor
- font.bold: true
- }
- AppText {
- id: apptext_select
- anchors.horizontalCenter: parent.horizontalCenter
- text: "当前:" + settings.getValue("theme_mode")
- fontSize: 10
- font.bold: false
- color: "gray"
- }
- }
- }
- Rectangle {
- radius: 5
- width: parent.width*0.245
- height: parent.height
- color: app.cardColor
- Column {
- anchors.fill: parent
- spacing: 5
- topPadding: 10
- AppButton {
- anchors.fill: parent
- onClicked: {
- logoutClicked()
- }
- }
- AppImage {
- id: image_exit
- anchors.horizontalCenter: parent.horizontalCenter
- fillMode: Image.PreserveAspectFit
- source: "../../assets/logout.svg"
- }
- AppText{
- anchors.horizontalCenter: parent.horizontalCenter
- text: "退出登录"
- color: app.fontColor
- font.bold: true
- }
- }
- }
- }
- Row {
- width: parent.width
- height: parent.height*0.39
- spacing: 5
- Rectangle {
- radius: 5
- width: parent.width*0.245
- height: parent.height
- color: app.cardColor
- Column {
- anchors.fill: parent
- spacing: 5
- topPadding: 10
- AppImage {
- anchors.horizontalCenter: parent.horizontalCenter
- fillMode: Image.PreserveAspectFit
- source: "../../assets/updateboard.svg"
- }
- AppText {
- anchors.horizontalCenter: parent.horizontalCenter
- text: "升级主板"
- color: app.fontColor
- font.bold: true
- }
- AppText {
- anchors.horizontalCenter: parent.horizontalCenter
- text: "当前:" + app.boardversionText
- 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: {
- var dialog = InputDialog.inputTextSingleLine(page_sys,
- "请输入密钥!",
- "Input here",
- function(ok, text){
- if(ok){
- if(text==="2024"){
- mqtt.sendUpdatesBoard()
- }else{
- nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
- }
- }
- }
- )
- }
- }
- }
- }
- Rectangle {
- radius: 5
- width: parent.width*0.245
- height: parent.height
- color: app.cardColor
- Column {
- anchors.fill: parent
- spacing: 5
- topPadding: 10
- 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
- }
- 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: {
- var dialog = InputDialog.inputTextSingleLine(page_sys,
- "请输入密钥!",
- "Input here",
- function(ok, text){
- if(ok){
- if(text==="2024"){
- mqtt.sendUpdateApp()
- }else{
- nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
- }
- }
- }
- )
- }
- }
- }
- }
- Rectangle {
- id: rec_theme
- radius: 5
- width: parent.width*0.245
- height: parent.height
- color: app.cardColor
- Column {
- anchors.fill: parent
- anchors.topMargin: parent.height * 0.15
- spacing: 10
- AppImage {
- id: image_reboot
- anchors.horizontalCenter: parent.horizontalCenter
- fillMode: Image.PreserveAspectFit
- source: "../../assets/reboot.svg"
- }
- AppText{
- id: text_reboot
- anchors.horizontalCenter: parent.horizontalCenter
- text: "系统重启"
- color: app.fontColor
- 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)
- }
- }
- }
- )
- }
- }
- }
- }
- Rectangle {
- radius: 5
- width: parent.width*0.245
- height: parent.height
- color: app.cardColor
- Column {
- anchors.centerIn: parent
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 5
- AppText {
- anchors.horizontalCenter: parent.horizontalCenter
- text: "参数调试"
- color: app.fontColor
- 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"){
- page_sys.navigationStack.push(sqlite_component)
- }else{
- nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
- }
- }
- }
- )
- }
- }
- }
- }
- }
- }
- }
|