Merge branch 'master' of http://10.124.128.2:8888/eshop/fe_service_ebtp_frontend into uat-export-face-recog

This commit is contained in:
jl-zhoujl2
2022-09-07 17:09:36 +08:00
36 changed files with 1411 additions and 152 deletions

View File

@ -0,0 +1,68 @@
/*客服系统专用*/
//跨系统post传参
export const bizServiceCustomService = REACT_APP_CUSTOMERSERVICE_USERCENTER + '&client_id=' + REACT_APP_CUSTOMERSERVICE_CLIENT_ID + '&redirect_uri=' + REACT_APP_CUSTOMERSERVICE_REDIRECT + '/redirect?page=home&mall3_token=';//智慧客服
//export const bizServiceCustomService = REACT_APP_CUSTOMERSERVICE_USERCENTER + '&client_id=S00hFPxc&redirect_uri=http://localhost:3000/redirect?page=home&mall3_token=';//智慧客服
export function windowOpenChatUI(inputList:any,pathname:string) {
if(inputList && inputList.length>0){
var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement
if(tempForm) document.body.removeChild(tempForm);
tempForm = document.createElement("form")
tempForm.id="tempForm_CustomerService"
tempForm.method="post"
tempForm.action = bizServiceCustomService + sessionStorage.getItem('Authorization')
tempForm.target='_blank'
inputList.map((input: any)=>{
let labelName= input.label!=null?`_CustomerServiceLabel_${input.label}`:''
var hideInput = document.createElement("input")
hideInput.type="hidden"
hideInput.name= input.paraName
hideInput.value = input.isEncode?`${encodeURI(input.paraVal)}${labelName}`:`${input.paraVal}${labelName}`
tempForm.appendChild(hideInput)
})
var input = document.createElement("input")
input.id = 'tempInput_CustomerService'
input.name= 'sceneUrl'
input.value= pathname
tempForm.appendChild(input)
document.body.appendChild(tempForm);
if(tempForm){
tempForm.submit();
document.body.removeChild(tempForm);
}
}
}
//创建临时表单
export function createHiddenForm(inputList:any,pathname:string) {
if(inputList && inputList.length>0){
var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement
if(tempForm) document.body.removeChild(tempForm);
tempForm = document.createElement("form")
tempForm.id="tempForm_CustomerService"
tempForm.method="post"
tempForm.action = bizServiceCustomService + sessionStorage.getItem('Authorization')
tempForm.target='_blank'
inputList.map((input: any)=>{
let labelName= input.label!=null?`_CustomerServiceLabel_${input.label}`:''
var hideInput = document.createElement("input")
hideInput.type="hidden"
hideInput.name= input.paraName
hideInput.value = input.isEncode?`${encodeURI(input.paraVal)}${labelName}`:`${input.paraVal}${labelName}`
tempForm.appendChild(hideInput)
})
var input = document.createElement("input")
input.id = 'tempInput_CustomerService'
input.name= 'sceneUrl'
input.value= pathname
tempForm.appendChild(input)
document.body.appendChild(tempForm);
}
}
//提交临时表单
export function submitHiddenForm() {
var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement
if(tempForm){
tempForm.submit();
document.body.removeChild(tempForm);
}
}

View File

@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
import { Modal, Tag } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import type { ProColumns } from '@ant-design/pro-table';
@ -21,6 +21,7 @@ const modalHeight = window.innerHeight * 96 / 100;
*/
const RiskPreventionSoft: React.FC<RiskPreventionSoftProps> = (props) => {
const { modalVisible, onCancel, onSubmit, data } = props;
const [confirmButtonVisible, setConfirmButtonVisible] = useState<boolean>(true);//是否显示确定按钮
const columns: ProColumns<any[]>[] = [
{
@ -53,6 +54,23 @@ const RiskPreventionSoft: React.FC<RiskPreventionSoftProps> = (props) => {
title: '规则相应内容',
},
];
useEffect(()=>{
setConfirmButtonVisible(getButtonVisible());
},[])
const getButtonVisible = () => {
console.log(data);
for (const risk of data) {
for (const result of risk.result) {
for (const regulationData of result.regulationData) {
if(regulationData.regulationStrategy=="hard"){
return true;
}
}
}
}
return false;
}
return (
<Modal
@ -64,6 +82,7 @@ const RiskPreventionSoft: React.FC<RiskPreventionSoftProps> = (props) => {
bodyStyle={{ maxHeight: modalHeight - 107, overflowY: 'auto', padding: '8px 24px 16px' }}
centered
onCancel={() => onCancel()}
okButtonProps={{hidden: confirmButtonVisible}}
onOk={() => {
onSubmit();
onCancel();