Commit 7936efea authored by 熊成伟's avatar 熊成伟

debug

parent f4c459db
Pipeline #15382 passed with stages
in 55 seconds
......@@ -8,22 +8,15 @@ const Index = (props) => {
return (
<div className="address-box">
<List>
{data && data.length > 0 && data.map((item, index) => (
<div>
<div className="sub-title">
{item.DEPTNAME}
</div>
{item.childrenUser && item.childrenUser.map((child, index) => (
<Item key={child.XM} className="sub-checkbox" onChange={(val) => setName(child.XM, val.target.checked)}>
{child.XM || ''}
{data && data.length > 0 && data.map((item, index) => item.XM ? (
<Item key={index} className="sub-checkbox" onChange={(val) => setName(item, val.target.checked)}>
{item.XM || ''}
<div className="address-user">
<img alt="" className='smallIco mr-5' src='/img/tel.png' />
{child.YDDH || '无'}
{item.YDDH || '无'}
</div>
</Item>
))}
</div>
))}
) : <div key={index} className="sub-title">{item.DEPTNAME}</div>)}
</List>
</div>
......
......@@ -48,14 +48,14 @@
content: '';
display: block;
width: 1px;
min-height: 80px;
min-height: 120px;
background-color: rgba(34, 192, 100, 1);
}
.auto-step-content::before{
content: '';
display: block;
width: 1px;
min-height: 80px;
min-height: 100px;
background-color: rgba(228, 228, 228, 1);
}
......@@ -85,10 +85,10 @@
}
.auto-step-content-result{
margin-top: 15px;
line-height: 41px;
border-radius: 7px;
background: rgba(0, 0, 0, 0.05);
margin: 15px 10px 0;
padding: 0 15px;
}
......
......@@ -38,7 +38,8 @@ const Backlog = (props) => {
setStart(false);
setEnd(res.rows && res.rows.length >= 10)
let result = end && res.rows ? data.concat(res.rows) : data;
res.rows && res.rows.length >= 10 && setCurrent(1);
res.rows && res.rows.length >= 10 && setCurrent(current + 1);
current > 0 && res.rows && res.rows.length === 0 && setCurrent(current - 1);
setData(result);
setLoading(false);
});
......
import React from 'react';
import {Modal} from 'antd-mobile'
// import {Modal} from 'antd-mobile'
import './index.less';
const operation = Modal.operation;
// const operation = Modal.operation;
const Option = (props) => {
const onChange = () => {
const input = document.getElementsByClassName("option-text");
props.onChange(input[0].value)
};
const setValue = (val) => {
const input = document.getElementsByClassName("option-text");
input[0].value = val
};
// const setValue = (val) => {
// const input = document.getElementsByClassName("option-text");
// input[0].value = val
// };
return (
<div>
<div className="option-card">
<div className="option-title">
<div>流转意见:</div>
<a
className="option-fast"
onClick={() => operation([
{ text: '默认一', onPress: () => setValue('默认一') },
{ text: '默认二', onPress: () => setValue('默认二') },
])}
>
常用阅办意见<img alt="" src="/img/option-icon.png" className="option-icon"/>
</a>
{/*<a*/}
{/*className="option-fast"*/}
{/*onClick={() => operation([*/}
{/*{ text: '默认一', onPress: () => setValue('默认一') },*/}
{/*{ text: '默认二', onPress: () => setValue('默认二') },*/}
{/*])}*/}
{/*>*/}
{/*常用阅办意见<img alt="" src="/img/option-icon.png" className="option-icon"/>*/}
{/*</a>*/}
</div>
<textarea className="option-text" onChange={onChange}/>
</div>
......
import React, {useState, useEffect} from 'react';
import Document from 'react-document-title'
import {WingBlank, WhiteSpace, ActionSheet} from 'antd-mobile'
import {WingBlank, WhiteSpace, ActionSheet, Toast} from 'antd-mobile'
import axiosRequest from '../../utils/request';
import TopTabs from '../../components/BlankTabs'
import Skeleton from '../../components/Skeleton'
......@@ -17,7 +17,10 @@ const Process = (props) => {
const [templateId, setTemplateId] = useState();
const [tableId, setTableId] = useState();
const [nodeId, setNodeId] = useState();
const [operateId, setOperateId] = useState()
const [operateId, setOperateId] = useState();
const [flowTbId, setFlowTbId] = useState();
console.log(operateId)
//回到顶部
useEffect(() => {
......@@ -33,9 +36,10 @@ const Process = (props) => {
const keys = res.elementList ? Object.keys(res.elementList) : []
setBasic(res.elementList ? keys.map(item => ({title: item})) : [])
setTableId(res.table && res.table.tableId);
setTemplateId(res.property && res.property.templateId)
setNodeId(res.property && res.property.curNodeId)
setOperateId(res.property && res.property.operateId)
setTemplateId(res.property && res.property.templateId);
setNodeId(res.property && res.property.curNodeId);
setOperateId(res.property && res.property.operateId);
setFlowTbId(res.property && res.property.flowTbId);
});
}, []);
......@@ -90,7 +94,7 @@ const Process = (props) => {
url: `/idtAppServiceV6/oApp/nextNodeList`,
body: {curNodeId: nodeId}
}).then(res => {
const result = res ? res.map(item => ({button: item.name, target: item.special})) : []
const result = res ? res.map(item => ({button: item.name, target: item.special, nodetype: item.nodetype})) : []
setButton(result)
});
};
......@@ -119,7 +123,8 @@ const Process = (props) => {
}
}, [basic]);
const [blyj, setBlyj] = useState()
const [blyj, setBlyj] = useState();
console.log(blyj)
const optionChange = val => {
setBlyj(val)
setDisabled(!(val != null && val !== ''))
......@@ -130,9 +135,8 @@ const Process = (props) => {
//点击输入框, 聚焦移动
const textClick = () => {
const top = document.getElementById(`event-option`).offsetTop;
document.getElementById("event").scrollTo(0,top)
document.getElementsByClassName("option-text")[0].focus();
window.scrollTo(0, document.body.scrollHeight);
optionBlur()
};
......@@ -141,8 +145,7 @@ const Process = (props) => {
setCurrent(name)
name === 'option' && document.getElementsByClassName("option-text")[0].focus();
name === 'option' && optionBlur()
const top = document.getElementById(`event-${name}`).offsetTop;
console.log(top)
const top = document.getElementById(`event-${name}`).offsetTop - document.getElementById(`event-basic`).offsetTop;
window.scrollTo(0,top);
};
......@@ -156,25 +159,8 @@ const Process = (props) => {
};
};
const beforeSubmit = () => {
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/save`,
body: {
tableId,
templateId,
dealInfo: {"BLYJ": blyj},
params: {uuid},
curNodeId: nodeId,
operateId
}
}).then(res => {
console.log(res)
});
}
const showActionSheet = () => {
const BUTTON = []
const BUTTON = [];
button.map(item => BUTTON.push(item.button));
const BUTTONS = BUTTON.concat(['取消']);
ActionSheet.showActionSheetWithOptions({
......@@ -189,31 +175,54 @@ const Process = (props) => {
});
};
const subUrl = key => {
beforeSubmit()
// const url = button[key].target;
// props.history.push(`/blank/submit/${url}`)
button[key].nodetype === 'bakup' ? end() :
props.history.push(`/blank/submit/${nodeId}/${uuid}/${flowTbId ? flowTbId : 'null'}`)
};
const end = () => {
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/application/interfaces/flow/saveWorkFlowModel.jsp`,
body: {
flowNodeId: nodeId,
attachId: uuid,
flowTbId: flowTbId === 'null' ? '' : flowTbId,
userListMap: JSON.stringify([{}])
}
}).then(res => {
if (res.success === 'success') {
Toast.success("操作成功", 1, () => {
props.history.push('/bord/backlog')
});
}
});
}
const handleScroll = () => {
// const adjunct = document.getElementById("event-adjunct").offsetTop;
// const flow = document.getElementById("event-flow").offsetTop;
// const option = document.getElementById("event-option").offsetTop;
// const event = document.getElementById('event');
// const top = event.scrollTop;
// const scrollHeight = event.scrollHeight;
// const clientHeight = event.clientHeight
// if (top >= 0 && top < adjunct) {
// setCurrent('basic')
// }else if (top >= adjunct && top < flow) {
// setCurrent('adjunct')
// }else if (top >= flow && top < option) {
// setCurrent('flow')
// }else if (top >= option) {
// setCurrent('option')
// }
// if (top + clientHeight === scrollHeight) {
// setCurrent('option')
// }
const basic = document.getElementById("event-basic").offsetTop;
const adjunct = document.getElementById("event-adjunct").offsetTop;
const flow = document.getElementById("event-flow").offsetTop;
const option = document.getElementById("event-option").offsetTop;
const top = document.documentElement.scrollTop || document.body.scrollTop;
let clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
let scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
console.log(top)
if (top >= basic && top < adjunct) {
console.log('basic');
setCurrent('basic')
}else if (top >= adjunct - basic && top < flow) {
console.log('adjunct');
setCurrent('adjunct')
}else if (top >= flow - basic && top < option) {
console.log('flow');
setCurrent('flow')
}else if (top >= option - basic) {
console.log('option');
setCurrent('option')
}
if (top + clientHeight === scrollHeight) {
setCurrent('option')
}
};
useEffect(() => {
window.addEventListener('scroll', handleScroll, true);
......@@ -240,13 +249,16 @@ const Process = (props) => {
{basicLoading ? <Option onChange={optionChange}/> : <Skeleton/>}
</WingBlank>
</div>
<div className="event-footer">
{(basicLoading && adjunctLoading && flowLoading && basicLoading) && (
<div className={`event-footer-button ${(footStatus && disabled) ? 'button-disabled' : '' }`} onClick={footStatus && !disabled ? showActionSheet: textClick}>
{!footStatus && (
<img alt="" src="/img/process-edit.png" className="process-edit"/>
)}
{footButton}
</div>
)}
</div>
......
import React, {useEffect, useState} from 'react';
// import {WingBlank, WhiteSpace, ActivityIndicator} from "antd-mobile";
import Skeleton from '../../components/Skeleton'
import axiosRequest from '../../utils/request';
import AddressCheckbox from '../../components/AddressList/AddressCheckbox';
import {WingBlank, WhiteSpace, Toast} from "antd-mobile";
const SubmitDetail = (props) => {
const {flowNodeId, uuid, flowTbId} = props.match.params;
const [data, setData] = useState([]);
// const [title, setTitle] = useState([]);
const [loading, setLoading] = useState(false);
const [disabled, setDisabled] = useState(true);
useEffect(() => {
const {type} = props.match.params
setLoading(true)
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/oApp/getLeaders?nType=${type}`,
url: `/idtAppServiceV6/application/interfaces/flow/getFlowJs.jsp?flowNodeId=${flowNodeId}`,
}).then(res => {
setLoading(false)
setData(res)
});
......@@ -21,16 +26,34 @@ const SubmitDetail = (props) => {
const [suData, setSuData] = useState([])
const checkName = (name, checked) => {
const newData = [...suData];
const index = newData.indexOf(name);
checked ? newData.push(name) : newData.splice(index, 1);
const index = newData.findIndex(item => item.XM === name.XM);
checked ? newData.push({XM: name.XM, XMPY: name.XMPY}) : newData.splice(index, 1);
newData.length > 0 ? setDisabled(false) : setDisabled(true)
setSuData(newData)
}
const textClick = () => {
console.log(suData)
axiosRequest({
method: 'post',
url: `/idtAppServiceV6/application/interfaces/flow/saveWorkFlowModel.jsp`,
body: {
flowNodeId,
attachId: uuid,
flowTbId: flowTbId === 'null' ? '' : flowTbId,
userListMap: JSON.stringify(suData)
}
}).then(res => {
if (res.success === 'success') {
Toast.success("操作成功", 1, () => {
props.history.push('/bord/backlog')
});
}
});
}
return (
<div>
{loading ? <WingBlank><WhiteSpace/><Skeleton/></WingBlank> : (
<div>
<div className='adMainBox'>
<AddressCheckbox data={data} setName={checkName}/>
......@@ -42,6 +65,9 @@ const SubmitDetail = (props) => {
</div>
</div>
)}
</div>
);
};
......
......@@ -12,7 +12,8 @@
.event-footer{
height: 45px;
position: fixed;
bottom: 0; left: 0; right: 0
bottom: 0; left: 0; right: 0;
z-index: 10;
}
.event-footer-button{
width: 100%;
......
......@@ -31,9 +31,8 @@ const Notice = (props) => {
setStart(false);
setEnd(res.rows && res.rows.length >= 10)
let result = end && res.rows ? data.concat(res.rows) : data;
console.log('end', end, 'result',result, 'res', res)
res.rows && res.rows.length >= 10 && setCurrent(1);
res.rows && res.rows.length >= 10 && setCurrent(current + 1);
current > 0 && res.rows && res.rows.length === 0 && setCurrent(current - 1);
setData(result);
setLoading(false);
});
......
......@@ -32,7 +32,7 @@ const ReactRouter = () => {
<Route path="/blank" component={() =>
<BlankLayout>
<Route path="/blank/work/:type" component={WorkDetail}/>
<Route path="/blank/submit/:type" component={SubmitDetail}/>
<Route path="/blank/submit/:flowNodeId/:uuid/:flowTbId" component={SubmitDetail}/>
<Route path="/blank/info/:id/:uuid" component={Process}/>
</BlankLayout>
}/>
......
......@@ -48,13 +48,15 @@ export const createAPI = (baseURL) => {
headers,
}))
.then(function (response) {
response = response.data;
// console.log(response)
response = response.data || response.tree;
if (!response || !response.data) {
// console.log(!response || !(response.data || response.tree))
if (!response || !(response.data || response.tree)) {
// response.status === 'failure' && (window.location.href = '/login')
response.code === 'idt-core-501' && (window.location.href = '/login')
console.log('response出错, 无返回数据!', response); return false;
response.message === '票据已经失效' && (window.location.href = '/login')
console.log('response出错, 无返回数据!', response);
// return false;
};
if (response.data && response.data.errorMessage) {
Toast.fail(response.data.errorMessage);
......@@ -73,8 +75,8 @@ export const createAPI = (baseURL) => {
menu.length > 0 && localStorage.setItem("menu", JSON.stringify(menu));
}
if (response.data) {
return response.data;
if (response.data || response.tree || response.success) {
return response.data ? response.data : (response.tree ? response.tree : response);
} else {
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment