mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:35:50 +00:00
no message
This commit is contained in:
parent
94f219cf51
commit
d77474983f
@ -20,9 +20,9 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="menu-project">
|
<li class="menu-project">
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="(item, key) in projectLists" :key="key" @click="toggleRoute('project/' + item.id)" :class="classNameRoute('project/' + item.id)">{{item.name}}</li>
|
<li v-for="(item, key) in projectList" :key="key" @click="toggleRoute('project/' + item.id)" :class="classNameRoute('project/' + item.id)">{{item.name}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
<Loading v-if="projectLoad > 0"/>
|
<Loading v-if="loadIng > 0"/>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<Button class="manage-box-new" type="primary" icon="md-add" @click="addShow=true">New Project</Button>
|
<Button class="manage-box-new" type="primary" icon="md-add" @click="addShow=true">New Project</Button>
|
||||||
@ -67,7 +67,7 @@
|
|||||||
</Form>
|
</Form>
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
<Button type="default" @click="addShow=false">{{$L('取消')}}</Button>
|
<Button type="default" @click="addShow=false">{{$L('取消')}}</Button>
|
||||||
<Button type="primary" :loading="projectLoad > 0" @click="onAddProject">{{$L('添加')}}</Button>
|
<Button type="primary" :loading="loadIng > 0" @click="onAddProject">{{$L('添加')}}</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
@ -245,29 +245,20 @@ export default {
|
|||||||
addRule: {},
|
addRule: {},
|
||||||
|
|
||||||
columns: [],
|
columns: [],
|
||||||
|
|
||||||
projectLoad: 0,
|
|
||||||
projectLists: [],
|
|
||||||
projectListTotal: 0,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$store.commit('getUserInfo', this.getProjectLists);
|
this.$store.commit('getUserInfo');
|
||||||
},
|
},
|
||||||
deactivated() {
|
deactivated() {
|
||||||
this.addShow = false;
|
this.addShow = false;
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['userId']),
|
...mapState(['projectList']),
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route' (route) {
|
'$route' (route) {
|
||||||
this.curPath = route.path;
|
this.curPath = route.path;
|
||||||
},
|
|
||||||
userId(userid) {
|
|
||||||
if (userid > 0) {
|
|
||||||
this.getProjectLists()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -342,12 +333,12 @@ export default {
|
|||||||
onAddProject() {
|
onAddProject() {
|
||||||
this.$refs.addProject.validate((valid) => {
|
this.$refs.addProject.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.projectLoad++;
|
this.loadIng++;
|
||||||
$A.apiAjax({
|
$A.apiAjax({
|
||||||
url: 'project/add',
|
url: 'project/add',
|
||||||
data: this.addData,
|
data: this.addData,
|
||||||
complete: () => {
|
complete: () => {
|
||||||
this.projectLoad--;
|
this.loadIng--;
|
||||||
},
|
},
|
||||||
success: ({ret, data, msg}) => {
|
success: ({ret, data, msg}) => {
|
||||||
if (ret === 1) {
|
if (ret === 1) {
|
||||||
@ -356,7 +347,10 @@ export default {
|
|||||||
this.$refs.addProject.resetFields();
|
this.$refs.addProject.resetFields();
|
||||||
this.$set(this.addData, 'template', 0);
|
this.$set(this.addData, 'template', 0);
|
||||||
//
|
//
|
||||||
this.getProjectLists(true);
|
this.loadIng++;
|
||||||
|
this.$store.commit('getProjectList', () => {
|
||||||
|
this.loadIng--;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
$A.modalError(msg);
|
$A.modalError(msg);
|
||||||
}
|
}
|
||||||
@ -365,25 +359,6 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getProjectLists() {
|
|
||||||
this.projectLoad++;
|
|
||||||
$A.apiAjax({
|
|
||||||
url: 'project/lists',
|
|
||||||
complete: () => {
|
|
||||||
this.projectLoad--;
|
|
||||||
},
|
|
||||||
success: ({ret, data, msg}) => {
|
|
||||||
if (ret === 1) {
|
|
||||||
this.projectLists = data.data;
|
|
||||||
this.projectListTotal = data.total;
|
|
||||||
} else {
|
|
||||||
this.projectLists = [];
|
|
||||||
this.projectListTotal = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
<DropdownMenu slot="list">
|
<DropdownMenu slot="list">
|
||||||
<DropdownItem name="setting">{{$L('项目设置')}}</DropdownItem>
|
<DropdownItem name="setting">{{$L('项目设置')}}</DropdownItem>
|
||||||
<DropdownItem name="transfer">{{$L('移交项目')}}</DropdownItem>
|
<DropdownItem name="transfer">{{$L('移交项目')}}</DropdownItem>
|
||||||
<DropdownItem name="delete" divided>{{$L('删除项目')}}</DropdownItem>
|
<DropdownItem name="delete" style="color:#f40" divided>{{$L('删除项目')}}</DropdownItem>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|
||||||
@ -399,6 +399,7 @@
|
|||||||
.project-switch {
|
.project-switch {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
margin-top: 24px;
|
||||||
.project-switch-button {
|
.project-switch-button {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -1016,6 +1017,7 @@ export default {
|
|||||||
this.$Modal.remove();
|
this.$Modal.remove();
|
||||||
if (ret === 1) {
|
if (ret === 1) {
|
||||||
$A.messageSuccess(msg);
|
$A.messageSuccess(msg);
|
||||||
|
this.$store.commit('getProjectList');
|
||||||
this.goForward({path: '/manage/dashboard'}, true);
|
this.goForward({path: '/manage/dashboard'}, true);
|
||||||
}else{
|
}else{
|
||||||
$A.modalError(msg, 301);
|
$A.modalError(msg, 301);
|
||||||
|
|||||||
27
resources/assets/js/store/mutations.js
vendored
27
resources/assets/js/store/mutations.js
vendored
@ -96,6 +96,33 @@ export default {
|
|||||||
state.userId = userInfo.userid;
|
state.userId = userInfo.userid;
|
||||||
state.userToken = userInfo.token;
|
state.userToken = userInfo.token;
|
||||||
state.setStorage('userInfo', state.userInfo);
|
state.setStorage('userInfo', state.userInfo);
|
||||||
|
this.commit('getProjectList');
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目列表
|
||||||
|
* @param state
|
||||||
|
* @param completeCallback
|
||||||
|
*/
|
||||||
|
getProjectList(state, completeCallback) {
|
||||||
|
if (state.userId === 0) {
|
||||||
|
state.projectList = [];
|
||||||
|
typeof completeCallback === "function" && completeCallback();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$A.apiAjax({
|
||||||
|
url: 'project/lists',
|
||||||
|
complete: () => {
|
||||||
|
typeof completeCallback === "function" && completeCallback();
|
||||||
|
},
|
||||||
|
success: ({ret, data, msg}) => {
|
||||||
|
if (ret === 1) {
|
||||||
|
state.projectList = data.data;
|
||||||
|
} else {
|
||||||
|
$A.modalError(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
1
resources/assets/js/store/state.js
vendored
1
resources/assets/js/store/state.js
vendored
@ -185,6 +185,7 @@ export default Object.assign(stateCommon, {
|
|||||||
cacheUserBasic: {},
|
cacheUserBasic: {},
|
||||||
|
|
||||||
projectLoad: 0,
|
projectLoad: 0,
|
||||||
|
projectList: [],
|
||||||
projectDetail: {
|
projectDetail: {
|
||||||
id: 0,
|
id: 0,
|
||||||
project_column: [],
|
project_column: [],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user