fix:打回弹窗

main
zhoulexin 2 months ago
parent 6816292feb
commit 8152086a7a

@ -18,8 +18,20 @@
<div id="main-editor"></div> <div id="main-editor"></div>
<!-- div id="batch-editor"--> <!-- div id="batch-editor"-->
</div> </div>
<template id="editor-template"><div id="main-ui" class="editor-ui"> <template id="editor-template">
<div id="main-ui" class="editor-ui">
<div id="header"> <div id="header">
<!-- 打回弹出框 -->
<div id="popup" class="popup-container">
<div>
<span>打回原因:</span>
<textarea id="reson" rows="4"></textarea>
</div>
<div>
<span id="cancel-reject-btn" class="reject-button">取消</span>
<span id="save-reject-btn" class="reject-button">确定</span>
</div>
</div>
<div id="global-info"> <div id="global-info">
<!-- text id="frame"></text--> <!-- text id="frame"></text-->
<div id="selectors"> <div id="selectors">
@ -75,7 +87,7 @@
<div id="save-pass" class="ui-button" style="width: auto; display: none;"> <div id="save-pass" class="ui-button" style="width: auto; display: none;">
通过 通过
</div> </div>
<div id="save-reject" class="ui-button" style="width: auto; display: none;"> <div id="save-reject" class="ui-button" style="width: auto; display: none; ">
打回 打回
</div> </div>
<div id="back" class="ui-button" style="width: auto;"> <div id="back" class="ui-button" style="width: auto;">
@ -103,7 +115,6 @@
</div> </div>
<div id="content"> <div id="content">
<div id="container"> <div id="container">
<div id='select-box' ></div> <div id='select-box' ></div>

@ -1085,4 +1085,43 @@ td {
height: 100%; height: 100%;
width: 100%; width: 100%;
z-index: 10; z-index: 10;
}
.popup-container{
display: none;
padding: 10px 20px;
position: absolute;
top: 25px;
right: 10px;
z-index: 999;
background: rgba(255, 255, 255, 0.3);
text-align: center;
color: #fff;
border-radius: 5px;
}
.popup-container>div:first-child{
display: flex;
align-items: center;
justify-content: center;
}
.popup-container>div:first-child>span{
width: 80px;
}
.popup-container>div:first-child>textarea{
resize: none;
border: none;
padding: 10px;
outline: none;
}
.popup-container>div:last-child{
padding-top: 10px;
text-align: right;
}
.reject-button{
display: inline-block;
padding: 0px 10px;
cursor: pointer;
border-radius: 3px;
}
#save-reject-btn{
background: #409eff;
} }

@ -2104,6 +2104,11 @@ function Editor(editorUi, wrapperUi, editorCfg, data, name = "editor") {
// } // }
this.keydown = function (ev) { this.keydown = function (ev) {
const element = document.getElementById('reson');
const displayValue = window.getComputedStyle(element).display;
if (displayValue === 'block') {
return;
}
// if (this.keydownDisabled) // if (this.keydownDisabled)
// return; // return;

@ -229,10 +229,29 @@ var Header = function (
this.ui.querySelector("#save-pass").onclick = () => { this.ui.querySelector("#save-pass").onclick = () => {
qc(1) qc(1)
}; };
// 打回 // 打回弹窗
this.ui.querySelector("#save-reject").onclick = () => { this.ui.querySelector("#save-reject").onclick = () => {
qc(0) document.getElementById('popup').style.display = "block";
}; };
this.ui.addEventListener('click', (event) => {
const target = event.target;
// 处理确认打回按钮
if (target.id === 'save-reject-btn') {
const resonTextarea = this.ui.querySelector('#reson');
const resonValue = resonTextarea.value;
if(!resonValue || resonValue === ''){
alert('请填写打回理由');
}else{
qc(0);
}
}
// 处理取消打回按钮
if (target.id === 'cancel-reject-btn') {
const popup = this.ui.querySelector('#popup');
if (popup) popup.style.display = "none";
}
})
function qc(type){ function qc(type){
const microData = window.microApp.getData() const microData = window.microApp.getData()
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
@ -241,11 +260,12 @@ var Header = function (
// window.microApp.dispatch({ type: 'pointCloudBack', time: new Date() }) // window.microApp.dispatch({ type: 'pointCloudBack', time: new Date() })
document.getElementById('save-pass').style.display = 'none' document.getElementById('save-pass').style.display = 'none'
document.getElementById('save-reject').style.display = 'none' document.getElementById('save-reject').style.display = 'none'
document.getElementById('popup').style.display = "none";
} }
} }
xhr.open( xhr.open(
"POST", "POST",
`${http.requestHttp}/project/qc?id=${microData.dataId}&type=${type}&taskId=${microData.taskId}`, `${http.requestHttp}/project/qc?id=${microData.dataId}&type=${type}&taskId=${microData.taskId}${type === 0 ? `&remark=${document.getElementById('reson').value}` : ''}`,
true true
); );
xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('Content-Type', 'application/json');

Loading…
Cancel
Save