import QtQuick import QtQuick.Layouts import QtQuick.Controls import com.InteractiveTask 1.0 Item { id: materialexceptionreport x: 290 y: 130 width: 1600 height: 920 onVisibleChanged: { if (visible) { proThread.moveCursorTo(0, 0); interactiveCore.appendTask( InteractiveTask.TypeViewRefresh_AbnormalReport, null, (json)=>{ var jsonObjRoot = JSON.parse(json); var jsonArrExceptionTypeDict = jsonObjRoot.ExceptionTypeDict; var jsonArrSeverityLevelDict = jsonObjRoot.SeverityLevelDict; materialexception_ExceptionTypeDict.model = jsonArrExceptionTypeDict; materialexception_SeverityLevelDict.model = jsonArrSeverityLevelDict; }); } } // 提交 Button { id: materialexceptionreport_btn_submit x: 1168 y: 835 width: 192 height: 75 background: Rectangle { color: "#ff0000" radius: 10 } text: qsTr("提交") font.pixelSize: 30 palette.buttonText: "white" // 设置字体颜色为绿色 Connections { target: materialexceptionreport_btn_submit onClicked: { // materialexceptionreport_dialog_confirm.open(); infoPromptBox.title("提示"); infoPromptBox.message("确定要上报异常吗?"); infoPromptBox.button_clear(); infoPromptBox.button_push("red", "取消", null, null); infoPromptBox.button_push( "#055eb3", "确定", ()=>{ var jsonObjRoot = {}; jsonObjRoot["exceptionTypeName"] = materialexception_ExceptionTypeDict.currentText; jsonObjRoot["exceptionLevelName"] = materialexception_SeverityLevelDict.currentText; jsonObjRoot["exceptionDescription"] = materialexception_exceptionDescription.text; var strJson = JSON.stringify(jsonObjRoot); var taskType = InteractiveTask.TypeHttpPost_insertIsException; interactiveCore.appendTask( taskType, strJson, (json)=>{ var jsonObjRoot = JSON.parse(json); if (jsonObjRoot.code === 200) { infoPromptBox.title("提交成功"); infoPromptBox.message("提交成功"); infoPromptBox.button_clear(); infoPromptBox.button_push( "#055eb3", "确定", null, null); infoPromptBox.show(); } else { infoPromptBox.title("提交失败"); infoPromptBox.message(jsonObjRoot.msg); infoPromptBox.button_clear(); infoPromptBox.button_push("#055eb3", "确定", null, null); infoPromptBox.show(); } }); }); infoPromptBox.show(); } } } // 返回按钮 Button { id: materialexceptionreport_btn_return x: 1408 y: 835 width: 192 height: 75 background: Rectangle { color: "#055eb3" radius: 10 } text: qsTr("返回") font.pixelSize: 30 palette.buttonText: "white" // 设置字体颜色为绿色 Connections { target: materialexceptionreport_btn_return onClicked: { materialexceptionreport.visible = false; materialException.visible = true; } } } // 主体区域 Rectangle { id: materialexception_main x: 0 y: 0 width: parent.width; height: parent.height * 0.88 color: "#272b7ae9" radius: 10 Rectangle { x : 10 y : 100 width: 1488 height: 77 color: "#00ffffff" Rectangle { x : 20 y : 15 width: 232 height: 48 color: "#00ffffff" Text { anchors.fill: parent font.pixelSize: 30 // font.bold: true color: "#ffffff" horizontalAlignment: Text.AlignRight verticalAlignment: Text.AlignVCenter text: "异常类型:*" } } Rectangle { x: 255 y: 12 width: 551 height: 50 color: "#ffffff" radius: 5 ComboBox { id: materialexception_ExceptionTypeDict anchors.fill: parent focusPolicy: Qt.NoFocus anchors.margins: 2 font.pointSize: 15 focus: false background: Rectangle { color: "transparent" } font.pixelSize: 20 padding:5 font.styleName: "Regular" // model: []; // 当前选中项改变时触发 onCurrentIndexChanged: { } } } } Rectangle { x : 10 y : 200 width: 1488 height: 77 color: "#00ffffff" Rectangle { x : 20 y : 15 width: 232 height: 48 color: "#00ffffff" Text { anchors.fill: parent font.pixelSize: 30 // font.bold: true color: "#ffffff" horizontalAlignment: Text.AlignRight verticalAlignment: Text.AlignVCenter text: "严重等级:*" } } Rectangle { x: 255 y: 12 width: 551 height: 50 color: "#ffffff" radius: 5 ComboBox { id: materialexception_SeverityLevelDict anchors.fill: parent focusPolicy: Qt.NoFocus anchors.margins: 2 font.pointSize: 15 focus: false background: Rectangle { color: "transparent" } font.pixelSize: 20 padding:5 font.styleName: "Regular" model: [] // 当前选中项改变时触发 onCurrentIndexChanged: { } } } } Rectangle { x : 10 y : 300 width: 1488 height: 500 color: "#00ffffff" Rectangle { x : 20 y : 15 width: 232 height: 48 color: "#00ffffff" Text { anchors.fill: parent font.pixelSize: 30 // font.bold: true color: "#ffffff" horizontalAlignment: Text.AlignRight verticalAlignment: Text.AlignVCenter text: "异常描述: " } } Rectangle { x: 255 y: 12 width: 1174 height: 437 color: "#ffffff" radius: 5 TextField { id: materialexception_exceptionDescription anchors.fill: parent anchors.margins: 2 color: "#a3000000" // 70%透明度的黑色 placeholderTextColor: "#60ffffff" // 40%透明度的白色 // 字体设置 font { pixelSize: 20 styleName: "Regular" } // 背景设置 background: Rectangle { color: "transparent" radius: parent.parent.radius - 1 // 使内圆角略小于外框 } // 对齐和边距 horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignT3op padding: 5 // 统一设置四个方向的padding // 其他属性 selectionColor: "#a300aaff" // 选中文本的背景色 wrapMode: Text.NoWrap renderType: Text.QtRendering } } } } }