| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- 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
- }
- }
- }
- }
- }
|