ProfilePage.qml 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973
  1. import Felgo
  2. import QtMultimedia
  3. import QtQuick
  4. import QtQuick.Controls
  5. import EasyModel 1.0
  6. import com.example.database 1.0
  7. import "../controls"
  8. import "../common"
  9. import "../model"
  10. AppPage {
  11. id: page_sys
  12. title: qsTr("系统设置")
  13. backgroundColor: app.theme_backgroundColor
  14. navigationBarHidden: true
  15. property var picinfo_list:[]
  16. signal logoutClicked
  17. signal themChange(string mode)
  18. MediaPlayer{
  19. id: audio
  20. audioOutput: AudioOutput{}
  21. source: Qt.resolvedUrl("../../assets/mp3/button.mp3")
  22. }
  23. Connections {
  24. target: mqtt
  25. }
  26. Component {
  27. id: sqlite_component
  28. AppPage {
  29. id: sqlite_page
  30. implicitHeight: 800
  31. implicitWidth: 1280
  32. rightBarItem: IconButtonBarItem {
  33. iconType: IconType.paintbrush
  34. onClicked: {
  35. console.log("database")
  36. sqliteModal.open()
  37. }
  38. }
  39. property int verHeaderHeight: 30
  40. property int verHeaderWidth: 150
  41. property int horHeaderHeight: 30
  42. property color scrollBarColor: "cyan"
  43. property int scrollBarWidth: 6
  44. property variant columnWidthArr: [30,100,100,100,100,100,200,100,100,100,100,100,100]
  45. property variant table_mqtt_Value: ["id","dtype","ip","port","imei","uid","pwd","clientid","qos","keepalive","sub","pub","offline"]
  46. property variant table_ftp_Value: ["id","ip","port","dir","uid","pwd","mode"]
  47. property variant table_location_Value: ["id","lbs_lat","lbs_lng","gps_lat","gps_lng","gps_elevation"]
  48. property variant table_camera_Value: ["camera_type","mode","stitch_photonum","photo_width","photo_height","auto_focus"]
  49. property variant table_json_Value: ["id","datetime","json_data","json_data"]
  50. property int datacount: 1
  51. DatabaseInterface
  52. {
  53. id: db_cfg
  54. }
  55. EasyTableModel{
  56. id: table_model
  57. horHeader: table_mqtt_Value
  58. }
  59. TableView{
  60. id: table_view
  61. height: sqlite_page.implicitHeight
  62. anchors{
  63. left: parent.left
  64. right: parent.right
  65. top: parent.top
  66. leftMargin: 30
  67. topMargin: sqlite_page.horHeaderHeight
  68. }
  69. clip: true
  70. boundsBehavior: Flickable.StopAtBounds
  71. columnSpacing: 1
  72. rowSpacing: 1
  73. rowHeightProvider: function (row) {
  74. return sqlite_page.verHeaderHeight;
  75. }
  76. columnWidthProvider: function (column) {
  77. return sqlite_page.columnWidthArr[column];
  78. }
  79. ScrollBar.vertical: ScrollBar {
  80. id: scroll_vertical
  81. anchors.right: parent.right
  82. anchors.rightMargin: 2
  83. contentItem: Rectangle{
  84. visible: (scroll_vertical.size<1.0)
  85. implicitWidth: sqlite_page.scrollBarWidth
  86. color: sqlite_page.scrollBarColor
  87. }
  88. }
  89. ScrollBar.horizontal: ScrollBar {
  90. id: scroll_horizontal
  91. anchors.bottom: parent.bottom
  92. anchors.bottomMargin: 2
  93. contentItem: Rectangle{
  94. visible: (scroll_horizontal.size<1.0)
  95. implicitHeight: sqlite_page.scrollBarWidth
  96. color: sqlite_page.scrollBarColor
  97. }
  98. }
  99. model: table_model
  100. delegate: Rectangle {
  101. color: (model.row%2)?"orange":Qt.darker("orange")
  102. AppText{
  103. id : value_text
  104. anchors.centerIn: parent
  105. verticalAlignment: Text.AlignVCenter
  106. horizontalAlignment: Text.AlignHCenter
  107. text: model.value
  108. AppButton {
  109. onClicked: {
  110. var dialog = InputDialog.inputTextSingleLine(app,
  111. "请输入要修改内容",
  112. value_text.text,
  113. function(ok,text){
  114. if(ok){
  115. value_text.text = text
  116. model.edit=text;
  117. console.log("edit",model.value)
  118. if(sqlite_switch.checked)
  119. {
  120. if(table_combox.displayText===table_combox.model[0]||table_combox.displayText===table_combox.model[1])
  121. {
  122. columnWidthArr = [30,100,100,100,100,100,200,100,100,100,100,100,100]
  123. db_cfg.updateData(table_combox.displayText,table_mqtt_Value[index],model.value)
  124. }
  125. if(table_combox.displayText===table_combox.model[2]||table_combox.displayText===table_combox.model[3])
  126. {
  127. db_cfg.updateData(table_combox.displayText,table_ftp_Value[index],model.value)
  128. }
  129. if(table_combox.displayText===table_combox.model[4])
  130. {
  131. db_cfg.updateData(table_combox.displayText,table_location_Value[index],model.value)
  132. }
  133. if(table_combox.displayText===table_combox.model[5]){
  134. db_cfg.updateData(table_combox.displayText,table_camera_Value[index],model.value)
  135. }
  136. }
  137. }
  138. })
  139. dialog.negativeAction = false
  140. dialog.outsideTouchable = true
  141. }
  142. }
  143. }
  144. }
  145. }
  146. Item{
  147. id: header_horizontal
  148. anchors{
  149. left: parent.left
  150. right: parent.right
  151. leftMargin: 30
  152. }
  153. height: sqlite_page.horHeaderHeight
  154. z: 2
  155. property int posXTemp: 0
  156. MouseArea{
  157. anchors.fill: parent
  158. onPressed: {
  159. header_horizontal.posXTemp=mouseX;
  160. }
  161. onPositionChanged: {
  162. if(table_view.contentX+(header_horizontal.posXTemp-mouseX)>0){
  163. table_view.contentX+=(header_horizontal.posXTemp-mouseX);
  164. }else{
  165. table_view.contentX=0;
  166. }
  167. header_horizontal.posXTemp=mouseX;
  168. }
  169. }
  170. Row {
  171. id: header_horizontal_row
  172. anchors.fill: parent
  173. leftPadding: -table_view.contentX
  174. clip: true
  175. spacing: 0
  176. Repeater {
  177. model: table_view.columns > 0 ? table_view.columns : 0
  178. Rectangle {
  179. id: header_horizontal_item
  180. width: table_view.columnWidthProvider(index)+table_view.columnSpacing
  181. height: sqlite_page.horHeaderHeight
  182. color: "purple"
  183. AppText {
  184. anchors.centerIn: parent
  185. text: table_model.headerData(index, Qt.Horizontal)
  186. }
  187. Rectangle{
  188. width: 1
  189. height: parent.height
  190. anchors.right: parent.right
  191. color: "black"
  192. opacity: 0.5
  193. }
  194. MouseArea{
  195. width: 3
  196. height: parent.height
  197. anchors.right: parent.right
  198. cursorShape: Qt.SplitHCursor
  199. onPressed: header_horizontal.posXTemp=mouseX;
  200. onPositionChanged: {
  201. if((header_horizontal_item.width-(header_horizontal.posXTemp-mouseX))>10){
  202. header_horizontal_item.width-=(header_horizontal.posXTemp-mouseX);
  203. }else{
  204. header_horizontal_item.width=10;
  205. }
  206. header_horizontal.posXTemp=mouseX;
  207. sqlite_page.columnWidthArr[index]=(header_horizontal_item.width-table_view.columnSpacing);
  208. table_view.forceLayout();
  209. }
  210. }
  211. }
  212. }
  213. }
  214. }
  215. Column {
  216. id: header_verical
  217. height: sqlite_page.implicitHeight
  218. anchors{
  219. left: parent.left
  220. top: parent.top
  221. topMargin: sqlite_page.horHeaderHeight
  222. }
  223. topPadding: -table_view.contentY
  224. z: 2
  225. clip: true
  226. spacing: 1
  227. Repeater {
  228. model: table_view.rows > 0 ? table_view.rows : 0
  229. Rectangle {
  230. width: 30
  231. height: table_view.rowHeightProvider(index)
  232. color: "green"
  233. Text {
  234. anchors.centerIn: parent
  235. text: table_model.headerData(index, Qt.Vertical)
  236. }
  237. }
  238. }
  239. }
  240. AppModal {
  241. id: sqliteModal
  242. fullscreen: false
  243. modalHeight: dp(380) + nativeUtils.safeAreaInsets.bottom
  244. NavigationStack {
  245. AppPage {
  246. title: "配置信息管理"
  247. rightBarItem: TextButtonBarItem {
  248. text: "关闭"
  249. textItem.font.pixelSize: sp(16)
  250. onClicked: sqliteModal.close()
  251. }
  252. Column {
  253. id: sqliteColumn
  254. width: parent.width
  255. Section {
  256. title: "数据库"
  257. ComboBox {
  258. id: sqlite_combox
  259. height: dp(40)
  260. width: parent.width/2
  261. model: ["config.db", "data.db"]
  262. }
  263. }
  264. Section {
  265. title: "数据表"
  266. ComboBox {
  267. id: table_combox
  268. height: dp(40)
  269. width: parent.width/2
  270. model: ["mqtt", "mqtt_other","ftp","ftp_other","location","camera","data"]
  271. onActivated: {
  272. console.log(displayText)
  273. table_model.table_name = displayText
  274. if(displayText===model[0]||displayText===model[1])
  275. {
  276. columnWidthArr = [30,100,100,100,100,100,200,100,100,100,100,100,100]
  277. table_model.horHeader = table_mqtt_Value
  278. }
  279. else if(displayText===model[2]||displayText===model[3])
  280. {
  281. table_model.horHeader = table_ftp_Value
  282. }
  283. else if(displayText===model[4])
  284. {
  285. table_model.horHeader = table_location_Value
  286. }else if(displayText===model[5]){
  287. columnWidthArr = [100,100,150,100,100,100]
  288. table_model.horHeader = table_camera_Value
  289. }
  290. else if(displayText===model[6])
  291. {
  292. table_model.horHeader = table_json_Value
  293. }
  294. table_model.initData=db_cfg.queryData(displayText,datacount)
  295. }
  296. }
  297. }
  298. AppText {
  299. id: sqlite_text
  300. text: "开关:"
  301. }
  302. AppSwitch {
  303. id: sqlite_switch
  304. anchors.left: sqlite_text.light
  305. anchors.leftMargin: 10
  306. onToggled: {
  307. if(sqlite_switch.checked){
  308. var dbs = db_cfg.openDatabase(sqlite_combox.displayText)
  309. if(dbs){
  310. console.log("打开数据库成功");
  311. sqlite_combox.enabled = false
  312. table_combox.enabled = true
  313. if(sqlite_combox.displayText==="data.db")
  314. {
  315. table_combox.displayText=table_combox.model[6];
  316. }
  317. table_model.table_name = table_combox.displayText
  318. table_model.initData=db_cfg.queryData(table_combox.displayText,datacount)
  319. }else{
  320. sqlite_switch.checked = false
  321. sqlite_combox.enabled = true;
  322. console.log("打开数据库失败");
  323. }
  324. }else{
  325. sqlite_combox.enabled = true;
  326. db_cfg.closeDatabase()
  327. console.log("关闭数据库");
  328. }
  329. }
  330. }
  331. }
  332. }
  333. }
  334. }
  335. }
  336. }
  337. Grid {
  338. anchors.fill: parent
  339. anchors.leftMargin: 5
  340. anchors.topMargin:5
  341. columns: 1
  342. rows: 3
  343. columnSpacing: 10
  344. rowSpacing: 5
  345. horizontalItemAlignment: Grid.AlignHCenter
  346. Rectangle {
  347. radius: 5
  348. width: parent.width * 0.995
  349. height: parent.height*0.18
  350. color: app.cardColor
  351. Timer {
  352. interval: 1000
  353. running: true
  354. repeat: true
  355. onTriggered: {
  356. picinfo_list = serial.pathinfo()
  357. text_info.text = "占用大小:" + picinfo_list[2] + "(Mb)" + "文件数量:" + picinfo_list[1]
  358. text_pathinfo.text = "图片存储目录:" + picinfo_list[0]
  359. }
  360. }
  361. AppImage {
  362. anchors.verticalCenter: parent.verticalCenter
  363. anchors.left: parent.left
  364. fillMode: Image.PreserveAspectFit
  365. source: "../../assets/floder.svg"
  366. }
  367. Column{
  368. id: column_info
  369. anchors.verticalCenter: parent.verticalCenter
  370. anchors.left: parent.left
  371. anchors.leftMargin: 100
  372. AppText{
  373. id: text_info
  374. text: "存储占用:" + ""
  375. color: app.fontColor
  376. font.bold: true
  377. }
  378. AppText{
  379. id: text_pathinfo
  380. text:"图片存储目录:"
  381. fontSize: 10
  382. color: "gray"
  383. }
  384. }
  385. AppButton {
  386. id:btn_fresh
  387. anchors.verticalCenter: parent.verticalCenter
  388. anchors.left: column_info.right
  389. anchors.leftMargin: dp(50)
  390. text: "刷新"
  391. flat: false
  392. textColor: "black"
  393. backgroundColor: "#e9e9e9"
  394. borderColor: "white"
  395. onClicked: {
  396. serial.readPathinfo()
  397. }
  398. }
  399. AppButton {
  400. id:btn_clear
  401. anchors.verticalCenter: parent.verticalCenter
  402. anchors.left: btn_fresh.right
  403. text: "清理"
  404. flat: false
  405. textColor: "white"
  406. backgroundColor: "#0aa26b"
  407. borderColor: "white"
  408. onClicked: {
  409. serial.removepic()
  410. }
  411. }
  412. }
  413. Row{
  414. width: parent.width
  415. height: parent.height*0.39
  416. spacing:5
  417. Rectangle {
  418. width: parent.width*0.245
  419. height: parent.height
  420. color: app.cardColor
  421. radius: 5
  422. Column{
  423. anchors.fill: parent
  424. spacing: 5
  425. AppImage {
  426. anchors.horizontalCenter: parent.horizontalCenter
  427. fillMode: Image.PreserveAspectFit
  428. source: "../../assets/ztl.svg"
  429. }
  430. AppText{
  431. anchors.horizontalCenter: parent.horizontalCenter
  432. text: "状态栏开关"
  433. color: app.fontColor
  434. font.bold: true
  435. }
  436. Switch{
  437. anchors.horizontalCenter: parent.horizontalCenter
  438. objectName: "openbar_btn"
  439. id: openbar_btn
  440. signal opernBar
  441. signal closeBar
  442. onClicked: {
  443. if(openbar_btn.checked==true){
  444. console.log("打开状态栏")
  445. opernBar()
  446. }else{
  447. console.log("关闭状态栏")
  448. closeBar()
  449. }
  450. }
  451. }
  452. }
  453. }
  454. Rectangle {
  455. radius: 5
  456. width: parent.width*0.245
  457. height: parent.height
  458. color: app.cardColor
  459. Column{
  460. anchors.fill: parent
  461. spacing: 5
  462. AppImage {
  463. anchors.horizontalCenter: parent.horizontalCenter
  464. fillMode: Image.PreserveAspectFit
  465. source: "../../assets/dhl.svg"
  466. }
  467. AppText{
  468. anchors.horizontalCenter: parent.horizontalCenter
  469. id: net_sta
  470. text: "导航栏开关"
  471. color: app.fontColor
  472. font.bold: true
  473. }
  474. Switch{
  475. id: opennav_btn
  476. objectName: "opennav_btn"
  477. signal opernNav
  478. signal closeNav
  479. anchors.horizontalCenter: parent.horizontalCenter
  480. onClicked: {
  481. if(opennav_btn.checked==true){
  482. console.log("打开导航栏")
  483. opernNav()
  484. }else{
  485. console.log("关闭导航栏")
  486. closeNav()
  487. }
  488. }
  489. }
  490. }
  491. }
  492. Rectangle {
  493. radius: 5
  494. width: parent.width*0.245
  495. height: parent.height
  496. color: app.cardColor
  497. MouseArea{
  498. anchors.fill: parent
  499. onClicked: {
  500. appimage_theme.visible = false
  501. apptext_title.visible = false
  502. apptext_select.visible = false
  503. row_select.visible = true
  504. }
  505. }
  506. Column {
  507. id: row_select
  508. visible: false
  509. anchors.fill: parent
  510. spacing: 5
  511. Component.onCompleted: {
  512. app.theme_md = settings.getValue("theme_mode")
  513. if(app.theme_md==="auto"){
  514. auto_rdb.checked = true
  515. rec_auto_rdb.border.color = "#0aa26b"
  516. apptext_select.text = "当前:自动"
  517. }else if(theme_md==="day"){
  518. day_rdb.checked = true;
  519. rec_day_rdb.border.color = "#0aa26b"
  520. apptext_select.text = "当前:白天"
  521. }else if(theme_md==="night"){
  522. night_rdb.checked = true;
  523. rec_night_rdb.border.color = "#0aa26b"
  524. apptext_select.text = "当前:黑夜"
  525. }
  526. }
  527. AppText{
  528. id: apptext_title_mode
  529. anchors.horizontalCenter: parent.horizontalCenter
  530. text: "设置模式"
  531. font.bold: true
  532. }
  533. CustomRadioButton {
  534. id: auto_rdb
  535. anchors.horizontalCenter: parent.horizontalCenter
  536. width: parent.width*0.8
  537. checked: true
  538. text: "自动"
  539. Rectangle {
  540. id: rec_auto_rdb
  541. anchors.fill: parent
  542. color: "#f5f5f5"
  543. radius: 5
  544. border.color: "#f5f5f5"
  545. border.width: 2
  546. }
  547. onCheckedChanged: {
  548. if(auto_rdb.checked){
  549. rec_auto_rdb.border.color = "#0aa26b"
  550. settings.setValue("theme_mode","auto")
  551. themChange("auto")
  552. apptext_select.text = "当前:自动"
  553. }else{
  554. rec_auto_rdb.border.color = "#f5f5f5"
  555. }
  556. row_select.visible = false
  557. rec_theme.color = app.cardColor
  558. appimage_theme.visible = true
  559. apptext_title.visible = true
  560. apptext_select.visible = true
  561. }
  562. }
  563. CustomRadioButton {
  564. id: night_rdb
  565. anchors.horizontalCenter: parent.horizontalCenter
  566. width: parent.width*0.8
  567. text: "黑夜"
  568. Rectangle {
  569. id: rec_night_rdb
  570. anchors.fill: parent
  571. color: "#f5f5f5"
  572. radius: 5
  573. border.color: "#f5f5f5"
  574. border.width: 2
  575. }
  576. onCheckedChanged: {
  577. if(night_rdb.checked){
  578. settings.setValue("theme_mode","night")
  579. rec_night_rdb.border.color = "#0aa26b"
  580. themChange("night")
  581. apptext_select.text = "当前:黑夜"
  582. }else{
  583. rec_night_rdb.border.color = "#f5f5f5"
  584. }
  585. row_select.visible = false
  586. rec_theme.color = app.cardColor
  587. appimage_theme.visible = true
  588. apptext_title.visible = true
  589. apptext_select.visible = true
  590. }
  591. }
  592. CustomRadioButton {
  593. id: day_rdb
  594. anchors.horizontalCenter: parent.horizontalCenter
  595. width: parent.width*0.8
  596. text: "白天"
  597. Rectangle {
  598. id: rec_day_rdb
  599. anchors.fill: parent
  600. color: "#f5f5f5"
  601. radius: 5
  602. border.color: "#f5f5f5"
  603. border.width: 2
  604. }
  605. onCheckedChanged: {
  606. if(day_rdb.checked){
  607. settings.setValue("theme_mode","day")
  608. rec_day_rdb.border.color = "#0aa26b"
  609. themChange("day")
  610. apptext_select.text = "当前:白天"
  611. }else{
  612. rec_day_rdb.border.color = "#f5f5f5"
  613. }
  614. row_select.visible = false
  615. rec_theme.color = app.cardColor
  616. appimage_theme.visible = true
  617. apptext_title.visible = true
  618. apptext_select.visible = true
  619. }
  620. }
  621. }
  622. Column {
  623. anchors.fill: parent
  624. spacing: 5
  625. topPadding: 10
  626. AppImage {
  627. id: appimage_theme
  628. anchors.horizontalCenter: parent.horizontalCenter
  629. fillMode: Image.PreserveAspectFit
  630. source: "../../assets/themset.svg"
  631. }
  632. AppText{
  633. id: apptext_title
  634. anchors.horizontalCenter: parent.horizontalCenter
  635. text: "设置主题"
  636. color: app.fontColor
  637. font.bold: true
  638. }
  639. AppText {
  640. id: apptext_select
  641. anchors.horizontalCenter: parent.horizontalCenter
  642. text: "当前:" + settings.getValue("theme_mode")
  643. fontSize: 10
  644. font.bold: false
  645. color: "gray"
  646. }
  647. }
  648. }
  649. Rectangle {
  650. radius: 5
  651. width: parent.width*0.245
  652. height: parent.height
  653. color: app.cardColor
  654. Column {
  655. anchors.fill: parent
  656. spacing: 5
  657. topPadding: 10
  658. AppButton {
  659. anchors.fill: parent
  660. onClicked: {
  661. logoutClicked()
  662. }
  663. }
  664. AppImage {
  665. id: image_exit
  666. anchors.horizontalCenter: parent.horizontalCenter
  667. fillMode: Image.PreserveAspectFit
  668. source: "../../assets/logout.svg"
  669. }
  670. AppText{
  671. anchors.horizontalCenter: parent.horizontalCenter
  672. text: "退出登录"
  673. color: app.fontColor
  674. font.bold: true
  675. }
  676. }
  677. }
  678. }
  679. Row {
  680. width: parent.width
  681. height: parent.height*0.39
  682. spacing: 5
  683. Rectangle {
  684. radius: 5
  685. width: parent.width*0.245
  686. height: parent.height
  687. color: app.cardColor
  688. Column {
  689. anchors.fill: parent
  690. spacing: 5
  691. topPadding: 10
  692. AppImage {
  693. anchors.horizontalCenter: parent.horizontalCenter
  694. fillMode: Image.PreserveAspectFit
  695. source: "../../assets/updateboard.svg"
  696. }
  697. AppText {
  698. anchors.horizontalCenter: parent.horizontalCenter
  699. text: "升级主板"
  700. color: app.fontColor
  701. font.bold: true
  702. }
  703. AppText {
  704. anchors.horizontalCenter: parent.horizontalCenter
  705. text: "当前:" + app.boardversionText
  706. fontSize: 10
  707. color: "gray"
  708. }
  709. MouseArea {
  710. anchors.horizontalCenter: parent.horizontalCenter
  711. width: parent.width * 0.7
  712. height: dp(30)
  713. AppText {
  714. anchors.centerIn: parent
  715. text: "点击升级"
  716. color: "#0aa26b"
  717. font.pixelSize: sp(12)
  718. }
  719. onClicked: {
  720. var dialog = InputDialog.inputTextSingleLine(page_sys,
  721. "请输入密钥!",
  722. "Input here",
  723. function(ok, text){
  724. if(ok){
  725. if(text==="2024"){
  726. mqtt.sendUpdatesBoard()
  727. }else{
  728. nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
  729. }
  730. }
  731. }
  732. )
  733. }
  734. }
  735. }
  736. }
  737. Rectangle {
  738. radius: 5
  739. width: parent.width*0.245
  740. height: parent.height
  741. color: app.cardColor
  742. Column {
  743. anchors.fill: parent
  744. spacing: 5
  745. topPadding: 10
  746. AppImage {
  747. anchors.horizontalCenter: parent.horizontalCenter
  748. fillMode: Image.PreserveAspectFit
  749. source: "../../assets/updateapp.svg"
  750. }
  751. AppText {
  752. anchors.horizontalCenter: parent.horizontalCenter
  753. text: "升级App"
  754. color: app.fontColor
  755. font.bold: true
  756. }
  757. AppText {
  758. anchors.horizontalCenter: parent.horizontalCenter
  759. text: "当前:" + app.appversionText
  760. fontSize: 10
  761. color: "gray"
  762. }
  763. MouseArea {
  764. anchors.horizontalCenter: parent.horizontalCenter
  765. width: parent.width * 0.7
  766. height: dp(30)
  767. AppText {
  768. anchors.centerIn: parent
  769. text: "点击升级"
  770. color: "#0aa26b"
  771. font.pixelSize: sp(12)
  772. }
  773. onClicked: {
  774. var dialog = InputDialog.inputTextSingleLine(page_sys,
  775. "请输入密钥!",
  776. "Input here",
  777. function(ok, text){
  778. if(ok){
  779. if(text==="2024"){
  780. mqtt.sendUpdateApp()
  781. }else{
  782. nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
  783. }
  784. }
  785. }
  786. )
  787. }
  788. }
  789. }
  790. }
  791. Rectangle {
  792. id: rec_theme
  793. radius: 5
  794. width: parent.width*0.245
  795. height: parent.height
  796. color: app.cardColor
  797. Column {
  798. anchors.fill: parent
  799. anchors.topMargin: parent.height * 0.15
  800. spacing: 10
  801. AppImage {
  802. id: image_reboot
  803. anchors.horizontalCenter: parent.horizontalCenter
  804. fillMode: Image.PreserveAspectFit
  805. source: "../../assets/reboot.svg"
  806. }
  807. AppText{
  808. id: text_reboot
  809. anchors.horizontalCenter: parent.horizontalCenter
  810. text: "系统重启"
  811. color: app.fontColor
  812. font.bold: true
  813. }
  814. MouseArea {
  815. anchors.horizontalCenter: parent.horizontalCenter
  816. width: parent.width * 0.7
  817. height: dp(30)
  818. AppText {
  819. anchors.centerIn: parent
  820. text: "点击重启"
  821. color: "#0aa26b"
  822. font.pixelSize: sp(12)
  823. }
  824. onClicked: {
  825. var dialog = InputDialog.inputTextSingleLine(page_sys,
  826. "请输入密钥!",
  827. "Input here",
  828. function(ok, text){
  829. if(ok){
  830. if(text==="2024"){
  831. serial.reboot()
  832. }else{
  833. nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
  834. }
  835. }
  836. }
  837. )
  838. }
  839. }
  840. }
  841. }
  842. Rectangle {
  843. radius: 5
  844. width: parent.width*0.245
  845. height: parent.height
  846. color: app.cardColor
  847. Column {
  848. anchors.centerIn: parent
  849. anchors.horizontalCenter: parent.horizontalCenter
  850. spacing: 5
  851. AppText {
  852. anchors.horizontalCenter: parent.horizontalCenter
  853. text: "参数调试"
  854. color: app.fontColor
  855. font.bold: true
  856. }
  857. MouseArea {
  858. anchors.horizontalCenter: parent.horizontalCenter
  859. width: parent.width * 0.7
  860. height: dp(30)
  861. AppText {
  862. anchors.centerIn: parent
  863. text: "点击进入"
  864. color: "#0aa26b"
  865. font.pixelSize: sp(12)
  866. }
  867. onClicked: {
  868. var dialog = InputDialog.inputTextSingleLine(page_sys,
  869. "请输入密钥!",
  870. "Input here",
  871. function(ok, text){
  872. if(ok){
  873. if(text==="2024"){
  874. page_sys.navigationStack.push(sqlite_component)
  875. }else{
  876. nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
  877. }
  878. }
  879. }
  880. )
  881. }
  882. }
  883. }
  884. }
  885. }
  886. }
  887. }