no message
This commit is contained in:
parent
351648990f
commit
4ef713a0bf
@ -55,7 +55,41 @@ class ProjectController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目详情
|
||||
* 单个项目信息
|
||||
*
|
||||
* @apiParam {Number} project_id 项目ID
|
||||
*/
|
||||
public function one()
|
||||
{
|
||||
$user = User::authE();
|
||||
if (Base::isError($user)) {
|
||||
return $user;
|
||||
} else {
|
||||
$user = User::IDE($user['data']);
|
||||
}
|
||||
//
|
||||
$project_id = intval(Request::input('project_id'));
|
||||
//
|
||||
$project = Project::with(['projectColumn' => function($query) {
|
||||
$query->with(['projectTask' => function($taskQuery) {
|
||||
$taskQuery->with(['taskUser', 'taskTag'])->where('parent_id', 0);
|
||||
}]);
|
||||
}, 'projectUser'])
|
||||
->select($this->projectSelect)
|
||||
->join('project_users', 'projects.id', '=', 'project_users.project_id')
|
||||
->where('projects.id', $project_id)
|
||||
->where('project_users.userid', $user->userid)
|
||||
->first();
|
||||
if ($project) {
|
||||
$owner_user = $project->projectUser->where('owner', 1)->first();
|
||||
$project->owner_userid = $owner_user ? $owner_user->userid : 0;
|
||||
}
|
||||
//
|
||||
return Base::retSuccess('success', $project);
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个项目详情(比"单个项目信息"多)
|
||||
*
|
||||
* @apiParam {Number} project_id 项目ID
|
||||
*/
|
||||
|
@ -33,9 +33,28 @@
|
||||
</li>
|
||||
<li class="menu-project">
|
||||
<ul>
|
||||
<li v-for="(item, key) in projectList" :key="key" @click="toggleRoute('project/' + item.id)" :class="classNameRoute('project/' + item.id)">
|
||||
<li
|
||||
v-for="(item, key) in projectList"
|
||||
:key="key"
|
||||
:class="classNameRoute('project/' + item.id, openMenu[item.id])"
|
||||
@click="toggleRoute('project/' + item.id)">
|
||||
<div class="project-h1">
|
||||
<em @click.stop="toggleOpenMenu(item.id)"></em>
|
||||
<div class="title">{{item.name}}</div>
|
||||
<div v-if="item.task_my_num > 0" class="num">{{item.task_my_num}}</div>
|
||||
</div>
|
||||
<div class="project-h2">
|
||||
<p>
|
||||
<em>{{$L('我的')}}:</em>
|
||||
<span>{{item.task_my_complete}}/{{item.task_my_num}}</span>
|
||||
<Progress :percent="item.task_my_percent" :stroke-width="6" />
|
||||
</p>
|
||||
<p>
|
||||
<em>{{$L('全部')}}:</em>
|
||||
<span>{{item.task_complete}}/{{item.task_num}}</span>
|
||||
<Progress :percent="item.task_percent" :stroke-width="6" />
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<Loading v-if="loadIng > 0"/>
|
||||
@ -122,7 +141,9 @@ export default {
|
||||
path: 'priority',
|
||||
name: '任务等级'
|
||||
}
|
||||
]
|
||||
],
|
||||
|
||||
openMenu: {}
|
||||
}
|
||||
},
|
||||
|
||||
@ -168,6 +189,10 @@ export default {
|
||||
this.goForward({path: '/manage/' + path});
|
||||
},
|
||||
|
||||
toggleOpenMenu(id) {
|
||||
this.$set(this.openMenu, id, !this.openMenu[id])
|
||||
},
|
||||
|
||||
settingRoute(path) {
|
||||
if (path === 'signout') {
|
||||
$A.modalConfirm({
|
||||
@ -182,9 +207,10 @@ export default {
|
||||
this.toggleRoute('setting/' + path);
|
||||
},
|
||||
|
||||
classNameRoute(path) {
|
||||
classNameRoute(path, openMenu) {
|
||||
return {
|
||||
"active": $A.leftExists(this.curPath, '/manage/' + path)
|
||||
"active": $A.leftExists(this.curPath, '/manage/' + path),
|
||||
"open-menu": openMenu === true,
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -607,7 +607,6 @@ export default {
|
||||
success: ({ret, data, msg}) => {
|
||||
if (ret === 1) {
|
||||
$A.messageSuccess(msg);
|
||||
this.addTaskSuccess(data)
|
||||
this.addShow = false;
|
||||
this.addData = {
|
||||
owner: 0,
|
||||
@ -618,6 +617,8 @@ export default {
|
||||
p_name: '',
|
||||
p_color: '',
|
||||
};
|
||||
this.$store.commit('getProjectOne', data.project_id);
|
||||
this.addTaskSuccess(data)
|
||||
} else {
|
||||
$A.modalError(msg);
|
||||
}
|
||||
|
@ -161,7 +161,6 @@ export default {
|
||||
success: ({ret, data, msg}) => {
|
||||
if (ret === 1) {
|
||||
$A.messageSuccess(msg);
|
||||
this.$emit("on-success", data)
|
||||
this.active = false;
|
||||
this.addData = {
|
||||
owner: 0,
|
||||
@ -172,6 +171,8 @@ export default {
|
||||
p_name: '',
|
||||
p_color: '',
|
||||
}
|
||||
this.$store.commit('getProjectOne', data.project_id);
|
||||
this.$emit("on-success", data)
|
||||
} else {
|
||||
$A.modalError(msg);
|
||||
}
|
||||
|
37
resources/assets/js/store/mutations.js
vendored
37
resources/assets/js/store/mutations.js
vendored
@ -109,6 +109,31 @@ export default {
|
||||
* @param state
|
||||
* @param project_id
|
||||
*/
|
||||
getProjectOne(state, project_id) {
|
||||
if (state.method.runNum(project_id) === 0) {
|
||||
return;
|
||||
}
|
||||
$A.apiAjax({
|
||||
url: 'project/one',
|
||||
data: {
|
||||
project_id: project_id,
|
||||
},
|
||||
success: ({ret, data, msg}) => {
|
||||
if (ret === 1) {
|
||||
let index = state.projectList.findIndex(({id}) => id === data.id);
|
||||
if (index > -1) {
|
||||
state.projectList.splice(index, 1, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取项目详情
|
||||
* @param state
|
||||
* @param project_id
|
||||
*/
|
||||
getProjectDetail(state, project_id) {
|
||||
if (state.method.runNum(project_id) === 0) {
|
||||
return;
|
||||
@ -135,11 +160,19 @@ export default {
|
||||
},
|
||||
success: ({ret, data, msg}) => {
|
||||
if (ret === 1) {
|
||||
state.cacheProject[project_id] = data;
|
||||
if (state.projectDetail.id === project_id) {
|
||||
state.cacheProject[data.id] = data;
|
||||
if (state.projectDetail.id === data.id) {
|
||||
state.projectDetail = data;
|
||||
}
|
||||
state.method.setStorage("cacheProject", state.cacheProject);
|
||||
//
|
||||
let index = state.projectList.findIndex(({id}) => id === data.id);
|
||||
if (index > -1) {
|
||||
const project = $A.cloneJSON(data);
|
||||
delete project.project_column;
|
||||
delete project.project_user;
|
||||
state.projectList.splice(index, 1, project);
|
||||
}
|
||||
} else {
|
||||
$A.modalError(msg);
|
||||
}
|
||||
|
65
resources/assets/sass/pages/page-manage.scss
vendored
65
resources/assets/sass/pages/page-manage.scss
vendored
@ -109,24 +109,36 @@
|
||||
> ul {
|
||||
width: 100%;
|
||||
> li {
|
||||
position: relative;
|
||||
list-style: none;
|
||||
padding: 0 8px 0 30px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 4px auto;
|
||||
border-radius: 4px;
|
||||
list-style: none;
|
||||
.project-h1 {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
&:before {
|
||||
content: "";
|
||||
padding: 0 8px 0 30px;
|
||||
border-radius: 4px;
|
||||
> em {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 8px;
|
||||
left: 2px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
transform: translateY(-50%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
&:before {
|
||||
content: "";
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
background: url("data:image/svg+xml;base64,PHN2ZyB0PSIxNjIyMzkwODExNTQxIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjI0OTk3IiB3aWR0aD0iNDgiIGhlaWdodD0iNDgiPjxwYXRoIGQ9Ik0zNjYuMTgyNCAxMDguMjM2OEw4MTIuMDMyIDQyOC4wMzJhMTAyLjQgMTAyLjQgMCAwIDEgMCAxNjYuNTAyNEwzNjYuMTgyNCA5MTQuMzI5NmExMDIuNCAxMDIuNCAwIDAgMS0xNjIuMDk5Mi04My4yNTEyVjE5MS40ODhhMTAyLjQgMTAyLjQgMCAwIDEgMTYyLjA5OTItODMuMjUxMnoiIHAtaWQ9IjI0OTk4IiBmaWxsPSIjOTk5OTk5Ij48L3BhdGg+PC9zdmc+") no-repeat center center;
|
||||
background-size: contain;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
}
|
||||
.title {
|
||||
flex: 1;
|
||||
@ -141,10 +153,49 @@
|
||||
font-size: 12px;
|
||||
padding-left: 16px;
|
||||
}
|
||||
}
|
||||
.project-h2 {
|
||||
display: none;
|
||||
margin: 16px 4px;
|
||||
padding: 0 8px 0 26px;
|
||||
> p {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 4px 0;
|
||||
height: 36px;
|
||||
em,
|
||||
span {
|
||||
font-style: normal;
|
||||
font-size: 12px;
|
||||
flex-shrink: 0;
|
||||
padding-right: 6px;
|
||||
}
|
||||
.ivu-progress {
|
||||
margin-right: -26px;
|
||||
.ivu-progress-inner {
|
||||
background-color: #e4e4e4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&.active {
|
||||
.project-h1 {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
}
|
||||
&.open-menu {
|
||||
.project-h1 {
|
||||
> em {
|
||||
&:before {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
.project-h2 {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.common-loading {
|
||||
margin: 6px;
|
||||
|
Loading…
x
Reference in New Issue
Block a user