Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 优化文件树交互;修复选中文件夹后copy、删除case拉取全部列表的bug;删除type=oe相关逻辑;脑图增加缩略图,增加跨用例或从xmind复制粘贴;fix: 修复左上角全部数量展示不正确的问题 #67

Merged
merged 3 commits into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions case-server/src/main/resources/web/dist/antd.85a50b54.chunk.css

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion case-server/src/main/resources/web/dist/index.html
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
<!DOCTYPE html><html xmlns:th="http://www.thymeleaf.org"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>AgileTC</title><script>window.routerBase = "/";</script></head><body><div id="root"></div><script th:src="@{/umi.9b090468.js}"></script><script src="/umi.378c3e3d.js"></script></body></html>
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>AgileTC</title>
</head>
<body>
<div id="root"></div>
<script th:src="@{/umi.1851e76a.js}"></script>
</body>
</html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions case-server/src/main/resources/web/dist/umi.1851e76a.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion case-server/src/main/resources/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"rc-scroll-anim": "^2.7.4",
"rc-texty": "^0.2.0",
"react": "^16.8.6",
"react-agiletc-editor": "^0.1.7",
"react-agiletc-editor": "^0.1.9",
"react-dom": "^16.8.6",
"react-resize-panel": "^0.3.5"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class CaseModal extends React.Component {
channel: 1,
},
}).then(res => {
this.setState({ cardTree: res.data.children });
this.setState({ cardTree: res.data ? res.data.children : [] });
});
};
getDetailById = () => {
Expand Down Expand Up @@ -141,7 +141,7 @@ class CaseModal extends React.Component {
caseType: 0,
caseContent: initData,
title: values.case,
channel: this.props.type === 'oe' ? 1 : 0,
channel: 1,
bizId: values.bizId ? values.bizId.join(',') : '-1',
id: this.state.operate != 'add' ? this.props.data.id : '',
requirementId,
Expand All @@ -150,17 +150,10 @@ class CaseModal extends React.Component {

// 判断是否上传了xmind文件
let xmindFile = this.state.xmindFile;
let { type } = this.props;

let url =
type === 'oe'
? `${this.props.doneApiPrefix}/case/create`
: '/case/create';
let url = `${this.props.doneApiPrefix}/case/create`;
if (xmindFile) {
url =
type === 'oe'
? `${this.props.doneApiPrefix}/file/import`
: '/file/import';
url = `${this.props.doneApiPrefix}/file/import`;
params = new FormData();
params.append('file', xmindFile);
params.append('creator', getCookies('username'));
Expand All @@ -169,7 +162,7 @@ class CaseModal extends React.Component {
params.append('requirementId', requirementId);

params.append('description', values.description);
params.append('channel', this.props.type === 'oe' ? 1 : 0);
params.append('channel', 1);
params.append('bizId', values.bizId ? values.bizId.join(',') : '-1');
}
request(url, { method: 'POST', body: params }).then(res => {
Expand Down Expand Up @@ -208,13 +201,12 @@ class CaseModal extends React.Component {
description: values.description,
modifier: getCookies('username'),
bizId: values.bizId ? values.bizId.join(',') : '-1',
channel: this.props.type === 'oe' ? 1 : 0,
channel: 1,
};

let { type } = this.props;

let url =
type === 'oe' ? `${this.props.doneApiPrefix}/case/edit` : '/case/edit';
let url = `${this.props.doneApiPrefix}/case/edit`;
request(url, { method: 'POST', body: params }).then(res => {
if (res.code == 200) {
this.props.onUpdate && this.props.onUpdate();
Expand All @@ -224,7 +216,7 @@ class CaseModal extends React.Component {
}
});
};
renderTreeNodes = data =>
renderTreeNodes = (data = []) =>
data.map(item => {
item.title = <span>{item.text}</span>;
if (item.children) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ class CaseLists extends React.Component {
treeData: [],
levelId: '',
levelText: '',
expandedKeys: ['1'], //搜索时查找到的城市key
searchValue: '',
autoExpandParent: true,
dataList: [],
caseIds: [-1],
caseIds: ['root'],
isSelect: true,
isSibling: true,
isAdd: true,
Expand Down Expand Up @@ -83,9 +82,9 @@ class CaseLists extends React.Component {
}
}
getTreeList = () => {
const { productLineId } = this.state;
const { productLineId, caseIds } = this.state;
const { doneApiPrefix } = this.props;
request(`${doneApiPrefix}/dir/list`, {
return request(`${doneApiPrefix}/dir/list`, {
method: 'GET',
params: {
productLineId,
Expand All @@ -99,7 +98,7 @@ class CaseLists extends React.Component {
caseIds:
this.state.treeSelect.length > 0
? this.state.treeSelect.toString()
: [-1],
: caseIds,
},
() => {
this.getCaseList(1, '', '', '', []);
Expand Down Expand Up @@ -128,11 +127,11 @@ class CaseLists extends React.Component {
caseType: 0,
title: nameFilter || '',
creator: createrFilter || '',
channel: this.props.type === 'oe' ? 1 : 0,
channel: 1,
requirementId: iterationFilter || '',
beginTime: choiseDate.length > 0 ? `${choiseDate[0]} 00:00:00` : '',
endTime: choiseDate.length > 0 ? `${choiseDate[1]} 23:59:59` : '',
bizId: caseIds ? caseIds : -1,
bizId: caseIds ? caseIds : 'root',
},
}).then(res => {
if (res.code === 200) {
Expand Down Expand Up @@ -164,11 +163,7 @@ class CaseLists extends React.Component {
});
};
getProductMumber = () => {
let { type } = this.props;
let url = '/case/listCreators';
if (type === 'oe') {
url = `${this.props.doneApiPrefix}/case/listCreators`;
}
let url = `${this.props.doneApiPrefix}/case/listCreators`;
request(url, {
method: 'GET',
params: { productLineId: this.state.productLineId, caseType: 0 },
Expand Down Expand Up @@ -234,7 +229,6 @@ class CaseLists extends React.Component {
} = this.state;
const { match, doneApiPrefix } = this.props;
const { productLineId } = match.params;

return (
<div className="all-content">
<FileTree
Expand All @@ -251,58 +245,32 @@ class CaseLists extends React.Component {
<div className="min-hig-content">
<div className="site-drawer-render-in-current-wrapper">
<Row className="m-b-10">
<Col>
{(this.props.type !== 'oe' && (
<Col span={18} className="text-left">
<Button
type="primary"
className="m-l-10"
onClick={this.onShowFilterBoxClick}
>
{(this.state.showFilterBox && (
<span>
<Icon type="minus" />
收起
</span>
)) || (
<span>
<Icon type="filter" /> 筛选
</span>
)}
</Button>
</Col>
)) || (
<Col span={18}>
<Col span={18}>
<div style={{ margin: '10px' }}>
快速筛选:<a>全部({total})</a>
</div>
</Col>
</Col>
)}
<Col xs={6} className="text-right">
{(this.props.type === 'oe' && (
<Button className="m-l-10" onClick={this.filterHandler}>
<Icon type="filter" /> 筛选
</Button>
)) ||
null}
&nbsp;&nbsp;&nbsp;
<Button
type="primary"
onClick={text => {
this.handleTask('add');
this.setState({
currCase: null,
visible: true,
project: null,
requirement: null,
});
}}
>
<Icon type="plus" /> 新建用例集
</Button>
</Col>
<Col span={18}>
<div style={{ margin: '10px' }}>
快速筛选:<a>全部({total})</a>
</div>
</Col>
<Col xs={6} className="text-right">
<Button
style={{ marginRight: 16 }}
onClick={this.filterHandler}
>
<Icon type="filter" /> 筛选
</Button>
<Button
type="primary"
onClick={() => {
this.handleTask('add');
this.setState({
currCase: null,
visible: true,
project: null,
requirement: null,
});
}}
>
<Icon type="plus" /> 新建用例集
</Button>
</Col>
</Row>
<hr
Expand Down Expand Up @@ -334,7 +302,7 @@ class CaseLists extends React.Component {
choiseDate={choiseDate}
></List>

{(this.props.type === 'oe' && filterVisble && (
{(filterVisble && (
<OeFilter
onCancel={this.closeFilter}
getCaseList={this.getCaseList}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
Pagination,
message,
Modal,
Divider,
Checkbox,
Icon,
Menu,
Expand Down Expand Up @@ -76,12 +75,8 @@ class Lists extends React.Component {
}
}
delOk = record => {
let { type } = this.props;

let url = '/case/delete';
if (type === 'oe') {
url = `${this.props.doneApiPrefix}/case/delete`;
}
let { getTreeList } = this.props;
let url = `${this.props.doneApiPrefix}/case/delete`;

let params = {
id: record.id,
Expand All @@ -92,8 +87,8 @@ class Lists extends React.Component {
}).then(res => {
if (res.code === 200) {
message.success('删除成功');
this.props.getCaseList(this.state.current, '', '', '', '');

// this.props.getCaseList(this.state.current, '', '', '', '');
getTreeList();
this.setState({ checked: false });
} else {
message.error(res.msg);
Expand Down Expand Up @@ -145,10 +140,7 @@ class Lists extends React.Component {
key: 'title',
width: 200,
render: (text, record) => {
let url = `/case/caseManager/${this.props.productId}/${record.id}/undefined/0`;
if (this.props.type == 'oe') {
url = `${this.props.baseUrl}/caseManager/${this.props.productId}/${record.id}/undefined/0`;
}
let url = `${this.props.baseUrl}/caseManager/${this.props.productId}/${record.id}/undefined/0`;
return <Link to={url}>{text}</Link>;
},
},
Expand Down Expand Up @@ -318,18 +310,6 @@ class Lists extends React.Component {
<Icon type="ellipsis" />
</a>
</Dropdown>

{(type !== 'oe' && <Divider type="vertical" />) || null}
{(type !== 'oe' && (
<a
onClick={text => {
this.seeSmkCase(record);
}}
>
查看冒烟case
</a>
)) ||
null}
</span>
);
},
Expand Down Expand Up @@ -363,7 +343,6 @@ class Lists extends React.Component {
this.getRecordList(record.caseId || record.id);
this.setState({
taskVisible: false,

expendKeys: [record.caseId || record.id],
});
};
Expand Down Expand Up @@ -394,10 +373,8 @@ class Lists extends React.Component {
// 获取case信息
getCaseInfo = (priority, resource) => {
const { record, titleModeTask } = this.state;
let url = '/case/countByCondition';
if (this.props.type === 'oe') {
url = `${this.props.doneApiPrefix}/case/countByCondition`;
}
let url = `${this.props.doneApiPrefix}/case/countByCondition`;

request(url, {
method: 'GET',
params: {
Expand Down Expand Up @@ -508,10 +485,7 @@ class Lists extends React.Component {
let recordCreator = record.creator.match(/\(([^)]*)\)/)
? record.creator.match(/\(([^)]*)\)/)[1]
: record.creator;
let url = `/case/caseManager/${this.props.productId}/${record.caseId}/${record.id}/3`;
if (this.props.type == 'oe') {
url = `${this.props.baseUrl}/caseManager/${this.props.productId}/${record.caseId}/${record.id}/3`;
}
let url = `${this.props.baseUrl}/caseManager/${this.props.productId}/${record.caseId}/${record.id}/3`;

return (
<span>
Expand Down Expand Up @@ -657,12 +631,8 @@ class Lists extends React.Component {
}
};
getRecordList = id => {
let { type } = this.props;
let url = `${this.props.doneApiPrefix}/record/list`;

let url = `/record/list`;
if (type === 'oe') {
url = `${this.props.doneApiPrefix}/record/list`;
}
request(url, { method: 'GET', params: { caseId: id } }).then(res => {
if (res.code == 200) {
let { list } = this.state;
Expand Down Expand Up @@ -691,12 +661,8 @@ class Lists extends React.Component {

// /record/delete
deleteRecordList = record => {
let { type } = this.props;
let url = `${this.props.doneApiPrefix}/record/delete`;

let url = `/record/delete`;
if (type === 'oe') {
url = `${this.props.doneApiPrefix}/record/delete`;
}
request(url, { method: 'POST', body: { id: record.id } }).then(res => {
if (res.code == 200) {
this.getRecordList(record.caseId);
Expand Down
Loading