| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817 |
- import QtQuick 2.12
- import QtQuick.Layouts 1.12
- import QtQuick.Controls 2.12
- import Loto 1.0
- Rectangle {
- id: control
- anchors.fill: parent
- // color: "#1A40A9FF"
- color: "transparent"
- radius: 20
- property string jobTicketNo: ""
- property int jobNodeId
- property string jobTicketStatusTypeName: "正在弹出锁具"
- property string jobTicketStatusIconCharactor: "\uf007"
- property string jobTicketStatusValue: "正在弹出锁具>>"
- property int lockStatusCardWidth: 169
- property int lockStatusCardHeight: 226
- property string currentCardNfc: ""
- property bool isReturnLock: false
- // 上锁
- property var lockModel: ListModel {
- // ListElement { position: "点位A"; lockStatus: "未上锁"; lockStatusIcon: "\uf09c"; name: "张三"; locked: false }
- // ListElement { position: "点位B"; lockStatus: "未上锁"; lockStatusIcon: "\uf09c"; name: "李四"; locked: false }
- }
- // 共锁
- property var colockModel: ListModel {
- // ListElement { userId: 0; avatar: ""; cardNfc: ""; lockStatus: "未共锁"; lockStatusIcon: "\uf09c"; name: "张三"; colocked: false }
- // ListElement { userId: 0; avatar: ""; cardNfc: ""; lockStatus: "未共锁"; lockStatusIcon: "\uf09c"; name: "李四"; colocked: false }
- // ListElement { userId: 0; avatar: ""; cardNfc: ""; lockStatus: "未共锁"; lockStatusIcon: "\uf09c"; name: "王五"; colocked: false }
- // ListElement { userId: 0; avatar: ""; cardNfc: ""; lockStatus: "未共锁"; lockStatusIcon: "\uf09c"; name: "王五"; colocked: false }
- // ListElement { userId: 0; avatar: ""; cardNfc: ""; lockStatus: "未共锁"; lockStatusIcon: "\uf09c"; name: "王五"; colocked: false }
- // ListElement { userId: 0; avatar: ""; cardNfc: ""; lockStatus: "未共锁"; lockStatusIcon: "\uf09c"; name: "张三"; colocked: false }
- // ListElement { userId: 0; avatar: ""; cardNfc: ""; lockStatus: "未共锁"; lockStatusIcon: "\uf09c"; name: "李四"; colocked: false }
- // ListElement { userId: 0; avatar: ""; cardNfc: ""; lockStatus: "未共锁"; lockStatusIcon: "\uf09c"; name: "王五"; colocked: false }
- // ListElement { userId: 0; avatar: ""; cardNfc: ""; lockStatus: "未共锁"; lockStatusIcon: "\uf09c"; name: "张三"; colocked: false }
- // ListElement { userId: 0; avatar: ""; cardNfc: ""; lockStatus: "未共锁"; lockStatusIcon: "\uf09c"; name: "李四"; colocked: false }
- // ListElement { userId: 0; avatar: ""; cardNfc: ""; lockStatus: "未共锁"; lockStatusIcon: "\uf09c"; name: "王五"; colocked: false }
- }
- property int fontSize: 16
- property color iconColor: "#40A9FF"
- property color iconBgColor: "#1A40A9FF"
- property int iconSize: 24
- property int tipLabelX: __startJobProcessBtn.x+__startJobProcessBtn.width+10
- Component.onCompleted: {
- let nodeList = WorkNodeFormModel.nodeUserList;
- if (nodeList.length > 0) {
- control.colockModel.clear();
- }
- for (let i = 0; i < nodeList.length; i++) {
- if (nodeList[i].type !== "jtcolocker") {
- continue;
- }
- control.colockModel.append({
- userId: nodeList[i].id,
- avatar: nodeList[i].avatar === null ? "" : nodeList[i].avatar,
- lockStatusIcon: "\uf058",
- name: nodeList[i].nickname,
- cardNfc: nodeList[i].cardNfc === null ? "" : nodeList[i].cardNfc,
- colocked: true,
- lockStatus: "已共锁"
- });
- }
- if (WorkNodeFormModel.modelType === "returnLock") {
- control.isReturnLock = true;
- tabBar.currentIndex = 2;
- }
- }
- TabBar {
- id: tabBar
- currentIndex: stackLayout.currentIndex
- width: parent.width
- enabled: !control.isReturnLock
- background: Rectangle {
- anchors.fill: parent
- color: "transparent"
- }
- TabButton {
- id: __tabBtn1
- height: 59
- background: Rectangle {
- implicitWidth: 100
- implicitHeight: height
- color: __tabBtn1.checked ? "#40A9FF" : "#1A40A9FF"
- radius: 12 // 设置圆角半径
- }
- text: qsTr("第一步:共锁人解锁")
- font.pixelSize: 18
- font.bold: true
- }
- TabButton {
- id: __tabBtn2
- height: 59
- background: Rectangle {
- implicitWidth: 100
- implicitHeight: height
- color: __tabBtn2.checked ? "#40A9FF" : "#1A40A9FF"
- radius: 12 // 设置圆角半径
- }
- text: qsTr("第二步:获取钥匙解锁")
- font.pixelSize: 18
- font.bold: true
- }
- TabButton {
- id: __tabBtn3
- height: 59
- background: Rectangle {
- implicitWidth: 100
- implicitHeight: height
- color: __tabBtn3.checked ? "#40A9FF" : "#1A40A9FF"
- radius: 12 // 设置圆角半径
- }
- text: qsTr("第三步:还锁")
- font.pixelSize: 18
- font.bold: true
- }
- }
- StackLayout {
- id: stackLayout
- width: parent.width
- height: parent.height - tabBar.height
- anchors.top: tabBar.bottom
- currentIndex: tabBar.currentIndex
- Rectangle {
- id: __firstPage
- width: stackLayout.width
- height: stackLayout.height
- color: "transparent"
- focus: true
- Timer {
- id: __firstPageTimer
- interval: 50
- running: true
- repeat: false
- onTriggered: {
- // 调整焦点设置的时序
- __firstPage.forceActiveFocus()
- // console.log("初始化焦点:", __firstPage.activeFocus)
- }
- }
- Component.onCompleted: {
- __firstPageTimer.start();
- }
- MButton {
- id: __colockTips
- anchors.horizontalCenter: parent.horizontalCenter
- y: 30
- height: 48
- width: 800
- btnRadius: 8
- buttonColor: "#1A40A9FF"
- pressedScale: 1.0
- cancelMouseArea: true
- text: qsTr("请所有共锁人确认共锁后,系统会自动检查共锁状态")
- textColor: "white"
- }
- Flickable {
- id: __unlockColockView
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: __colockTips.bottom
- anchors.topMargin: 135
- width: Math.min(__colockRow.width, control.lockStatusCardWidth*4 + 45)
- height: __colockRow.height + 30
- clip: true
- flickableDirection: Flickable.HorizontalFlick
- contentWidth: __colockRow.width
- contentHeight: height
- Row {
- id: __colockRow
- spacing: 15
- Repeater {
- model: control.colockModel
- delegate: LockStatusCard {
- width: control.lockStatusCardWidth
- height: control.lockStatusCardHeight
- bgRadius: 8
- cardColor: "transparent"
- bgBorderColor: colocked ? "green" : "#40A9FF"
- iconCharacter: "\uf406"
- iconColor: "#0A1929"
- avatarUrl: avatar
- text: name
- textFontSize: 18
- textColor: "white"
- statusText: lockStatus
- statusTextFontSize: 16
- statusIconCharacter: lockStatusIcon
- statusIconSize: 20
- statusIconColor: "white"
- // onClicked: {
- // control.colockModel.get(index).lockStatus = "已共锁";
- // control.colockModel.get(index).lockStatusIcon = "\uf058";
- // control.colockModel.get(index).colocked = true;
- // }
- }
- }
- }
- }
- Rectangle {
- id: leftButton
- width: 50; height: 50
- anchors.left: __unlockColockView.left
- anchors.leftMargin: -55
- anchors.verticalCenter: __unlockColockView.verticalCenter
- color: 'transparent'
- border.color: "#40A9FF"
- radius: width/2
- visible: __unlockColockView.contentX === 0 ? false : true
- Text {
- id: iconLabel
- anchors.centerIn: parent
- text: "\uf104"
- color: "#40A9FF"
- font.pixelSize: 36
- font.family: iconFont.name
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- }
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (__unlockColockView.contentX > 0) {
- if (__unlockColockView.contentX > __unlockColockView.width+15) {
- __unlockColockView.contentX -= __unlockColockView.width+15; // 向左滚动一个页面宽度
- } else {
- __unlockColockView.contentX = 0;
- }
- } else {
- __unlockColockView.contentX = 0; // 如果已经到达最左侧,则不滚动
- }
- }
- }
- }
- Rectangle {
- id: rightButton
- width: 50; height: 50
- anchors.right: __unlockColockView.right
- anchors.rightMargin: -55
- anchors.verticalCenter: __unlockColockView.verticalCenter
- color: 'transparent'
- border.color: "#40A9FF"
- radius: width/2
- visible: __unlockColockView.contentX === __unlockColockView.contentWidth - __unlockColockView.width ? false : true
- Text {
- id: __rIconLabel
- anchors.centerIn: parent
- text: "\uf105"
- color: "#40A9FF"
- font.pixelSize: 36
- font.family: iconFont.name
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- }
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (__unlockColockView.contentX < __unlockColockView.contentWidth - __unlockColockView.width) {
- if ((__unlockColockView.contentX+__unlockColockView.width+15) >= __unlockColockView.contentWidth - __unlockColockView.width) {
- __unlockColockView.contentX = __unlockColockView.contentWidth - __unlockColockView.width;
- } else {
- __unlockColockView.contentX += __unlockColockView.width+15; // 向右滚动一个页面宽度
- }
- } else {
- __unlockColockView.contentX = __unlockColockView.contentWidth - __unlockColockView.width; // 如果已经到达最右侧,则不滚动超过内容宽度
- }
- }
- }
- }
- Rectangle {
- id: __successAndExit
- anchors.top: __unlockColockView.bottom
- anchors.topMargin: 35
- width: 136
- height: 49
- anchors.horizontalCenter: parent.horizontalCenter
- visible: false
- color: "#1890FF"
- radius: 12
- IconText {
- anchors.centerIn: parent
- iconCharacter: "\uf058"
- iconSize: 18
- iconColor: "white"
- text: qsTr("完成")
- textColor: "white"
- }
- MouseArea {
- anchors.fill: parent
- onClicked: {
- // appShowHome = true;
- stackLayout.currentIndex = 1;
- }
- }
- }
- }
- Rectangle {
- width: stackLayout.width
- height: stackLayout.height
- color: "transparent"
- MButton {
- id: __startJobProcessBtn
- x: 422
- y: 30
- height: 72
- width: 377
- buttonColor: "#40A9FF"
- text: qsTr("现在取出设备")
- textColor: "white"
- iconCharacter: "\uf084"
- iconColor: "white"
- onClicked: {
- __sleepTimer.start();
- InteractiveCAN.cardNo = control.jobTicketNo;
- InteractiveCAN.taskCode = WorkNodeFormModel.workId
- InteractiveCAN.openEKey();
- }
- }
- Text {
- id: __tipIconLabel
- x: tipLabelX
- y: 55
- text: "\uf0a5"
- color: "orange"
- font.pixelSize: 20
- font.family: iconFont.name
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- SequentialAnimation on x {
- loops: Animation.Infinite // 无限循环动画
- NumberAnimation { from: tipLabelX; to: tipLabelX + 10; duration: 400 } // 向右移动
- PauseAnimation { duration: 100 } // 暂停一段时间(可选)
- NumberAnimation { from: tipLabelX+10; to: tipLabelX; duration: 400 } // 向左移动返回原点
- PauseAnimation { duration: 100 } // 再次暂停(可选)
- }
- }
- Text {
- id: __tipLabel
- x: tipLabelX + 30
- y: 58
- text: qsTr("请点击按钮进行操作")
- color: "white"
- font.pixelSize: 16
- // 普通文字不使用图标字体
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- }
- Flickable {
- id: __subProcesses
- anchors.top: __startJobProcessBtn.bottom
- anchors.topMargin: 35
- anchors.horizontalCenter: parent.horizontalCenter
- Column {
- anchors.fill: parent
- spacing: 20
- JobTicketSubProcess {
- id: subProcess1
- anchors.horizontalCenter: parent.horizontalCenter
- width: 801
- height: 99
- jobTicketStatusTypeName: "分配钥匙"
- jobTicketStatusValue: "正在分配钥匙>>"
- }
- JobTicketSubProcess {
- id: subProcess2
- anchors.horizontalCenter: parent.horizontalCenter
- width: 801
- height: 99
- jobTicketStatusTypeName: "下发作业票"
- jobTicketStatusValue: "正在下发作业票>>"
- }
- JobTicketSubProcess {
- id: subProcess3
- anchors.horizontalCenter: parent.horizontalCenter
- width: 801
- height: 99
- jobTicketStatusTypeName: "取出钥匙"
- jobTicketStatusValue: "打开钥匙扣>>"
- }
- JobTicketSubProcess {
- id: subProcess4
- anchors.horizontalCenter: parent.horizontalCenter
- width: 801
- height: 99
- jobTicketStatusTypeName: "放回钥匙"
- jobTicketStatusValue: "放回钥匙>>"
- }
- Rectangle {
- id: __successFirstStep
- width: 800
- height: 49
- anchors.horizontalCenter: parent.horizontalCenter
- visible: false
- color: "#1890FF"
- radius: 12
- IconText {
- anchors.centerIn: parent
- iconCharacter: "\uf058"
- iconSize: 18
- iconColor: "green"
- text: qsTr("锁具和钥匙已经弹出,请及时取走并前往其对应点位上锁。上锁完成请返回锁柜还回钥匙")
- textColor: "white"
- }
- MouseArea {
- anchors.fill: parent
- onClicked: {
- tabBar.currentIndex += 1;
- }
- }
- }
- }
- }
- onVisibleChanged: {
- InteractiveCAN.updateKeyAndLockStatus();
- }
- }
- Rectangle {
- width: stackLayout.width
- height: stackLayout.height
- color: "transparent"
- MButton {
- id: __lockTips
- anchors.horizontalCenter: parent.horizontalCenter
- y: 30
- height: 48
- width: 800
- btnRadius: 8
- buttonColor: "#1A40A9FF"
- pressedScale: 1.0
- cancelMouseArea: true
- text: qsTr("请将钥匙插入锁柜,插入后,系统会自动检查上锁状态")
- textColor: "white"
- }
- Flickable {
- id: __lockView
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: __lockTips.bottom
- anchors.topMargin: 135
- width: Math.min(__lockRow.width, control.lockStatusCardWidth*4+45)
- height: parent.height - __lockTips.height - 75
- clip: true
- flickableDirection: Flickable.HorizontalFlick
- contentWidth: __lockRow.width
- contentHeight: height
- Row {
- id: __lockRow
- spacing: 15
- Repeater {
- model: control.lockModel
- delegate: LockStatusCard {
- width: control.lockStatusCardWidth
- height: control.lockStatusCardHeight
- bgRadius: 8
- cardColor: "transparent"
- bgBorderColor: locked ? "green" : "#40A9FF"
- iconCharacter: "\uf406"
- iconColor: "#0A1929"
- text: name
- textFontSize: 18
- textColor: "white"
- statusText: lockStatus
- statusTextFontSize: 16
- statusIconCharacter: lockStatusIcon
- statusIconSize: 20
- statusIconColor: "white"
- // onClicked: {
- // control.lockModel.get(index).lockStatus = "已上锁";
- // control.lockModel.get(index).lockStatusIcon = "\uf058";
- // control.lockModel.get(index).locked = true;
- // }
- }
- }
- }
- }
- Rectangle {
- id: __lockLeftButton
- width: 50; height: 50
- anchors.left: __lockView.left
- anchors.leftMargin: -55
- anchors.verticalCenter: __lockView.verticalCenter
- color: 'transparent'
- border.color: "#40A9FF"
- radius: width/2
- visible: __lockView.contentX === 0 ? false : true
- Text {
- id: __lockIconLabel
- anchors.centerIn: parent
- text: "\uf104"
- color: "#40A9FF"
- font.pixelSize: 36
- font.family: iconFont.name
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- }
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (__lockView.contentX > 0) {
- if (__lockView.contentX > __lockView.width+15) {
- __lockView.contentX -= __lockView.width+15; // 向左滚动一个页面宽度
- } else {
- __lockView.contentX = 0;
- }
- } else {
- __lockView.contentX = 0; // 如果已经到达最左侧,则不滚动
- }
- }
- }
- }
- Rectangle {
- id: __lockRightButton
- width: 50; height: 50
- anchors.right: __lockView.right
- anchors.rightMargin: -55
- anchors.verticalCenter: __lockView.verticalCenter
- color: 'transparent'
- border.color: "#40A9FF"
- radius: width/2
- visible: __lockView.contentX === __lockView.contentWidth - __lockView.width ? false : true
- Text {
- id: __lockRIconLabel
- anchors.centerIn: parent
- text: "\uf105"
- color: "#40A9FF"
- font.pixelSize: 36
- font.family: iconFont.name
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- }
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (__lockView.contentX < __lockView.contentWidth - __lockView.width) {
- if ((__lockView.contentX+__lockView.width+15) >= __lockView.contentWidth - __lockView.width) {
- __lockView.contentX = __lockView.contentWidth - __lockView.width;
- } else {
- __lockView.contentX += __lockView.width+15; // 向右滚动一个页面宽度
- }
- } else {
- __lockView.contentX = __lockView.contentWidth - __lockView.width; // 如果已经到达最右侧,则不滚动超过内容宽度
- }
- }
- }
- }
- }
- }
- Connections {
- target: control.colockModel
- function onDataChanged() {
- var allColocked = true;
- for (var i = 0; i < control.colockModel.count; i++) {
- if (!control.colockModel.get(i).colocked) {
- allColocked = false;
- break;
- }
- }
- // 所有共锁人都已确认共锁
- if (allColocked) {
- // TODO: 显示完成按钮
- __successAndExit.visible = true;
- }
- }
- }
- Connections {
- target: InteractiveCAN
- function onSignalJobTicketResult(jsonResult, pointInfo) {
- var lockInfo = JSON.parse(jsonResult);
- if (!lockInfo.hasOwnProperty("data") || !Array.isArray(lockInfo.data)) {
- return;
- }
- for (var i = 0; i < lockInfo.data.length; i++) {
- var dataItem = lockInfo.data[i];
- if (dataItem.hasOwnProperty("taskCode")) {
- if (dataItem.taskCode === WorkNodeFormModel.workId.toString() && dataItem.hasOwnProperty("dataList")) {
- control.lockModel.clear();
- var dataList = dataItem.dataList;
- for (var j = 0; j < dataList.length; j++) {
- var position = dataList[j].dataId.toString();
- var name = pointInfo[position];
- var lockStatus = "";
- var locked = false;
- var status = dataList[j].status;
- var lockStatusIcon = "\uf058";
- var lockNfcinfo = dataList[j].infoRfidNo;
- if (status === 0) {
- lockStatus = "挂锁";
- locked = true;
- } else if (status === 1) {
- lockStatusIcon = "\uf09c";
- lockStatus = "解锁";
- } else if (status === 2) {
- lockStatus = "无操作";
- } else if (status === 3) {
- lockStatus = "已挂锁";
- locked = true;
- }
- control.lockModel.append({
- position: position,
- lockStatus: lockStatus,
- lockStatusIcon: lockStatusIcon,
- name: name,
- locked: locked,
- lockNfc: lockNfcinfo,
- });
- }
- }
- }
- }
- }
-
- function onSignalUpdateBackLockStatus(lockRfidList) {
- for (var i = 0; i < control.lockModel.count; i++) {
- for (var j = 0; j < lockRfidList.length; j++) {
- if (control.lockModel.get(i).lockNfc === lockRfidList[j]) {
- control.lockModel.get(i).lockStatus = "已还锁";
- break;
- }
- }
- }
- }
- }
- function convertCardNfc(cardNfc) {
- let hexCardNfc = "";
- let cardNfcInt = parseInt(cardNfc);
- if (isNaN(cardNfcInt)) {
- return hexCardNfc;
- }
- let hexStr = cardNfcInt.toString(16);
- if (hexStr.length % 2 === 0) {
- for (let i = hexStr.length / 2; i > 0; i--) {
- let subStr = hexStr.substr((i - 1) * 2, 2);
- hexCardNfc += subStr;
- }
- }
- return hexCardNfc.toUpperCase();
- }
- function setcardIDByKey(value) {
- switch(value)
- {
- case Qt.Key_0: control.currentCardNfc = control.currentCardNfc + "0";break;
- case Qt.Key_1: control.currentCardNfc = control.currentCardNfc + "1";break;
- case Qt.Key_2: control.currentCardNfc = control.currentCardNfc + "2";break;
- case Qt.Key_3: control.currentCardNfc = control.currentCardNfc + "3";break;
- case Qt.Key_4: control.currentCardNfc = control.currentCardNfc + "4";break;
- case Qt.Key_5: control.currentCardNfc = control.currentCardNfc + "5";break;
- case Qt.Key_6: control.currentCardNfc = control.currentCardNfc + "6";break;
- case Qt.Key_7: control.currentCardNfc = control.currentCardNfc + "7";break;
- case Qt.Key_8: control.currentCardNfc = control.currentCardNfc + "8";break;
- case Qt.Key_9: control.currentCardNfc = control.currentCardNfc + "9";break;
- case Qt.Key_A: control.currentCardNfc = control.currentCardNfc + "A";break;
- case Qt.Key_B: control.currentCardNfc = control.currentCardNfc + "B";break;
- case Qt.Key_C: control.currentCardNfc = control.currentCardNfc + "C";break;
- case Qt.Key_D: control.currentCardNfc = control.currentCardNfc + "D";break;
- case Qt.Key_E: control.currentCardNfc = control.currentCardNfc + "E";break;
- case Qt.Key_F: control.currentCardNfc = control.currentCardNfc + "F";break;
- case Qt.Key_Return: {
- if (control.currentCardNfc.length > 0) {
- let hexCardNfc = convertCardNfc(control.currentCardNfc);
- for (var i = 0; i < control.colockModel.count; i++) {
- console.log(hexCardNfc, control.colockModel.get(i).cardNfc.toUpperCase());
- if (control.colockModel.get(i).cardNfc.toUpperCase() === hexCardNfc) {
- control.colockModel.get(i).colocked = false;
- control.colockModel.get(i).lockStatus = "解锁";
- control.colockModel.get(i).lockStatusIcon = "\uf09c";
- InteractiveCAN.cardNo = control.jobTicketNo;
- InteractiveCAN.taskCode = WorkNodeFormModel.workId;
- InteractiveCAN.signalUpdateColockStatus(hexCardNfc);
- break;
- }
- }
- }
- control.currentCardNfc = "";
- return
- }
- }
- }
- Keys.onReleased: function(event) {
- if (__unlockColockView.visible) {
- setcardIDByKey(event.key);
- }
- }
- Timer {
- id: __sleepTimer
- interval: 200
- repeat: true
- running: false
- onTriggered: {
- if (InteractiveCAN.okOpenKey) {
- subProcess1.showSuccessfulColor = true;
- }
- if (InteractiveCAN.okSendJobTicket) {
- subProcess2.showSuccessfulColor = true;
- }
- if (InteractiveCAN.okUnLockLocks) {
- subProcess3.showSuccessfulColor = true;
- }
- if (InteractiveCAN.okUnlockKey) {
- subProcess4.showSuccessfulColor = true;
- __sleepTimer.stop();
- __successFirstStep.visible = true;
- }
- }
- }
- }
|