Browse Source

优化

master
陈裕财 4 years ago
parent
commit
4e80fbaf01
  1. 1
      src/api/xm/core/xmMyFocus.js
  2. 3
      src/router/routes_xm.js
  3. 77
      src/views/xm/core/xmMenu/XmMenuDetailRoute.vue
  4. 9
      src/views/xm/core/xmMenu/XmMenuEdit.vue
  5. 113
      src/views/xm/core/xmMyFocus/XmMyDoFocus.vue
  6. 12
      src/views/xm/core/xmMyFocus/XmMyFocusList.vue
  7. 77
      src/views/xm/core/xmQuestion/XmQuestionDetailRoute.vue
  8. 11
      src/views/xm/core/xmQuestion/XmQuestionEdit.vue
  9. 77
      src/views/xm/core/xmTask/XmTaskDetailRoute.vue
  10. 10
      src/views/xm/core/xmTask/XmTaskEdit.vue

1
src/api/xm/core/xmMyFocus.js

@ -39,6 +39,7 @@ export const myFocusForIndex = params => { return axios.get(`${base}/xm/core/xmM
//初始化页面上的字典 //初始化页面上的字典
export const initDicts = (that) => { export const initDicts = (that) => {
var itemCodes=[];//在此添加要加载的字典 如['sex','grade','lvl'] var itemCodes=[];//在此添加要加载的字典 如['sex','grade','lvl']
that.dicts['focusType']=[{id:'1',name:'项目'},{id:'2',name:'任务'},{id:'3',name:'产品'},{id:'4',name:'需求'},{id:'5',name:'缺陷'},]
if(itemCodes.length>0){ if(itemCodes.length>0){
initSimpleDicts('all',itemCodes).then(res=>{ initSimpleDicts('all',itemCodes).then(res=>{
Object.assign(that.dicts,res.data.data) Object.assign(that.dicts,res.data.data)

3
src/router/routes_xm.js

@ -23,6 +23,7 @@ export default {
{ path: 'xmEnvList/XmEnvListMng', component: _import('xm/core/xmEnvList/XmEnvListMng'), name: 'XmEnvListMng', meta: { title: '环境清单' }}, { path: 'xmEnvList/XmEnvListMng', component: _import('xm/core/xmEnvList/XmEnvListMng'), name: 'XmEnvListMng', meta: { title: '环境清单' }},
{ path: 'xmTask/XmTaskCenter', component: _import('xm/core/xmTask/XmTaskCenter'), name: 'xmTaskCenter', meta: { title: '任务大厅' }}, { path: 'xmTask/XmTaskCenter', component: _import('xm/core/xmTask/XmTaskCenter'), name: 'xmTaskCenter', meta: { title: '任务大厅' }},
{ path: 'xmTask/XmMyTaskCenter', component: _import('xm/core/xmTask/XmMyTaskCenter'), name: 'xmMyTaskCenter', meta: { title: '任务(我的)' }}, { path: 'xmTask/XmMyTaskCenter', component: _import('xm/core/xmTask/XmMyTaskCenter'), name: 'xmMyTaskCenter', meta: { title: '任务(我的)' }},
{ path: 'xmTask/XmTaskDetailRoute', component: _import('xm/core/xmTask/XmTaskDetailRoute'), name: 'XmTaskDetailRoute', meta: { title: '任务详情' },hidden:true},
] ]
}, },
@ -54,6 +55,7 @@ export default {
{ path: 'xmQuestion/XmQuestionMngMy', component: _import('xm/core/xmQuestion/XmQuestionMngMy'), name: 'XmQuestionMngMy', meta: { title: '我的缺陷' }}, { path: 'xmQuestion/XmQuestionMngMy', component: _import('xm/core/xmQuestion/XmQuestionMngMy'), name: 'XmQuestionMngMy', meta: { title: '我的缺陷' }},
{ path: 'xmTestCase/XmTestCaseMng', component: _import('xm/core/xmTestCase/XmTestCaseMng'), name: 'XmTestCaseMng', meta: { title: '测试设计' }}, { path: 'xmTestCase/XmTestCaseMng', component: _import('xm/core/xmTestCase/XmTestCaseMng'), name: 'XmTestCaseMng', meta: { title: '测试设计' }},
{ path: 'xmTestCaseExec/XmTestCaseExecMng', component: _import('xm/core/xmTestCaseExec/XmTestCaseExecMng'), name: 'XmTestCaseExecMng', meta: { title: '测试执行' }}, { path: 'xmTestCaseExec/XmTestCaseExecMng', component: _import('xm/core/xmTestCaseExec/XmTestCaseExecMng'), name: 'XmTestCaseExecMng', meta: { title: '测试执行' }},
{ path: 'xmQuestion/XmQuestionDetailRoute', component: _import('xm/core/xmQuestion/XmQuestionDetailRoute'), name: 'XmQuestionDetailRoute', meta: { title: '缺陷明细' },hidden:true},
] ]
}, },
@ -107,6 +109,7 @@ export default {
{ path: 'xmProduct/XmProductRecycle', component: _import('xm/core/xmProduct/XmProductRecycle'), name: 'XmProductRecycle', meta: { title: '产品回收站' }}, { path: 'xmProduct/XmProductRecycle', component: _import('xm/core/xmProduct/XmProductRecycle'), name: 'XmProductRecycle', meta: { title: '产品回收站' }},
{ path: 'xmProduct/XmProductTplMng', component: _import('xm/core/xmProduct/XmProductTplMng'), name: 'XmProductTplMng', meta: { title: '产品模板' }}, { path: 'xmProduct/XmProductTplMng', component: _import('xm/core/xmProduct/XmProductTplMng'), name: 'XmProductTplMng', meta: { title: '产品模板' }},
{ path: 'xmMenu/XmMenuDetailRoute', component: _import('xm/core/xmMenu/XmMenuDetailRoute'), name: 'XmMenuDetailRoute', meta: { title: '需求明细' },hidden:true},
{ path: 'xmMenu/XmMenuMng', component: _import('xm/core/xmMenu/XmMenuMng'), name: 'XmMenuMng', meta: { title: '需求管理' }}, { path: 'xmMenu/XmMenuMng', component: _import('xm/core/xmMenu/XmMenuMng'), name: 'XmMenuMng', meta: { title: '需求管理' }},
{ path: 'xmMenuExchange/XmMenuExchangeMng', component: _import('xm/core/xmMenuExchange/XmMenuExchangeMng'), name: 'XmMenuExchangeMng', meta: { title: '互动评论' }}, { path: 'xmMenuExchange/XmMenuExchangeMng', component: _import('xm/core/xmMenuExchange/XmMenuExchangeMng'), name: 'XmMenuExchangeMng', meta: { title: '互动评论' }},

77
src/views/xm/core/xmMenu/XmMenuDetailRoute.vue

@ -0,0 +1,77 @@
<template>
<section class="padding">
<xm-menu-edit v-if="xmMenu" :xm-menu="xmMenu" :visible="showInfo"></xm-menu-edit>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { listXmMenu } from '@/api/xm/core/xmMenu';
import { mapGetters } from 'vuex';
import XmMenuEdit from './XmMenuEdit'
export default {
computed: {
...mapGetters([
'userInfo','roles'
]),
},
watch:{
},
data() {
return {
xmMenu:null,
showInfo:false,
}
},//end data
methods: {
initByQueryId(){
if(this.$route.query && this.$route.query.id){
var localStorageXmMenu=localStorage.getItem("xm-menu-info-route")
var menu=null;
if(localStorageXmMenu){
menu=JSON.parse(localStorageXmMenu)
if(menu && menu.id==this.$route.query.id){
this.xmMenu=menu
this.showInfo=true;
}else{
this.getXmMenu(this.$route.query.id);
}
}else{
this.getXmMenu(this.$route.query.id);
}
}
},
getXmMenu(id){
listXmMenu({id:id}).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.xmMenu=res.data.data[0]
localStorage.setItem("xm-menu-info-route",JSON.stringify(this.xmMenu))
this.showInfo=true;
}else{
}
})
}
},//end methods
components: {
XmMenuEdit,
//
},
activated(){
this.initByQueryId();
},
mounted() {
this.initByQueryId();
}
}
</script>
<style scoped>
</style>

9
src/views/xm/core/xmMenu/XmMenuEdit.vue

@ -174,6 +174,9 @@
<el-tab-pane label="附件" name="8"> <el-tab-pane label="附件" name="8">
上传附件 上传附件
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="关注" name="91">
<xm-my-do-focus v-if="activateTabPaneName=='91'" :biz-id="editForm.menuId" :pbiz-id="editForm.productId" :biz-name="editForm.menuName" focus-type="4"></xm-my-do-focus>
</el-tab-pane>
<el-tab-pane label="日志" name="9"> <el-tab-pane label="日志" name="9">
<xm-record v-if="activateTabPaneName=='9'" :biz-id="editForm.menuId" :obj-type="'menu'"></xm-record> <xm-record v-if="activateTabPaneName=='9'" :biz-id="editForm.menuId" :obj-type="'menu'"></xm-record>
</el-tab-pane> </el-tab-pane>
@ -207,7 +210,8 @@ import XmMenuOverview from './XmMenuOverview.vue';
import XmMenuExchangeMng from '../xmMenuExchange/XmMenuExchangeMng.vue'; import XmMenuExchangeMng from '../xmMenuExchange/XmMenuExchangeMng.vue';
import TagMng from "@/views/mdp/arc/tag/TagMng"; import TagMng from "@/views/mdp/arc/tag/TagMng";
import XmSubWorkItem from "@/views/xm/core/xmMenuWorkItem/XmSubWorkItem"; import XmSubWorkItem from "@/views/xm/core/xmMenuWorkItem/XmSubWorkItem";
import XmRecord from '../xmRecord/XmRecord'
import XmRecord from '../xmRecord/XmRecord'
import XmMyDoFocus from '../xmMyFocus/XmMyDoFocus.vue';
export default { export default {
computed: { computed: {
@ -484,7 +488,8 @@ import XmMenuExchangeMng from '../xmMenuExchange/XmMenuExchangeMng.vue';
TagMng, TagMng,
XmMenuExchangeMng, XmMenuExchangeMng,
XmSubWorkItem, XmSubWorkItem,
XmRecord
XmRecord,
XmMyDoFocus
}, },
mounted() { mounted() {

113
src/views/xm/core/xmMyFocus/XmMyDoFocus.vue

@ -0,0 +1,113 @@
<template>
<section>
<el-row v-if="xmMyFocuss.length>0">
<el-tag type="success">已关注</el-tag> <el-button @click="handleDel"></el-button>
</el-row>
<el-row v-if="xmMyFocuss.length<=0">
<el-tag type="primary">未关注</el-tag> <el-button @click="saveSubmit"></el-button>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import config from "@/common/config"; //import
import { initDicts, listXmMyFocus,addXmMyFocus,delXmMyFocus } from '@/api/xm/core/xmMyFocus';
import { mapGetters } from 'vuex'
export default {
name:'xmMyDoFocus',
components: {
},
computed: {
...mapGetters([ 'userInfo' ]),
},
props:['pbizId','bizId','focusType','bizName'],
watch: {
bizId(){
this.searchXmMyFocuss()
}
},
data() {
return {
load:{ list: false, edit: false, del: false, add: false },//...
dicts:{},// params={categoryId:'all',itemCodes:['sex']} {sex: [{id:'1',name:''},{id:'2',name:''}]}
xmMyFocuss:[],
}//end return
},//end data
methods: {
...util,
// XmMyFocus
searchXmMyFocuss() {
let params = {
pbizId:this.pbizId,
bizId:this.bizId,
focusType:this.focusType
};
this.load.list = true;
listXmMyFocus(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.xmMyFocuss = res.data.data;
}else{
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch( err => this.load.list = false );
},
initData: function(){
this.searchXmMyFocuss();
},
//xmMyFocus
handleDel: function ( ) {
var row=this.xmMyFocuss[0]
this.load.del=true;
let params = { userid:row.userid, bizId:row.bizId, pbizId:row.pbizId };
delXmMyFocus(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if(tips.isOk){
this.searchXmMyFocuss();
}
this.$notify({ position:'bottom-left', showClose:true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
},
//XmMyFocus @submit="afterEditSubmit"
saveSubmit: function () {
this.load.edit=true
let params = {pbizId:this.pbizId,bizId:this.bizId,focusType:this.focusType,bizName:this.bizName}
var func=addXmMyFocus
func(params).then((res) => {
this.load.edit=false
var tips=res.data.tips;
if(tips.isOk){
this.searchXmMyFocuss()
this.$emit('submit');// @submit="afterAddSubmit"
}
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err =>this.load.edit=false);
},
},//end method
mounted() {
this.$nextTick(() => {
initDicts(this);
this.initData()
});
}
}
</script>
<style scoped>
</style>

12
src/views/xm/core/xmMyFocus/XmMyFocusList.vue

@ -54,7 +54,8 @@
</div> </div>
</div> </div>
<div v-for="(o,index) in oths" :key="index" class="list-item"> <div v-for="(o,index) in oths" :key="index" class="list-item">
<el-link @click="toBizPage(o)">{{o.bizName }}</el-link>
<el-tag v-for="(item,index) in formatDictsWithClass(dicts,'focusType',o.focusType)" :key="index" :type="item.className">{{item.name}}</el-tag>
<el-link @click="toBizPage(o)"> {{o.bizName }}</el-link>
<div class="tool-bar"> <div class="tool-bar">
<span class="u-btn"> <span class="u-btn">
<el-button type="text" @click="handleDel(o,index)" icon="el-icon-remove-outline" title="取消关注"> 取消关注</el-button> <el-button type="text" @click="handleDel(o,index)" icon="el-icon-remove-outline" title="取消关注"> 取消关注</el-button>
@ -205,11 +206,20 @@ export default {
this.editFormVisible = true; this.editFormVisible = true;
this.editForm = Object.assign({}, row); this.editForm = Object.assign({}, row);
}, },
/**
* that.dicts['focusType']=[{id:'1',name:'项目'},{id:'2',name:'任务'},{id:'3',name:'产品'},{id:'4',name:'需求'},{id:'5',name:'缺陷'},]
*/
toBizPage(bizObj){ toBizPage(bizObj){
if(bizObj.focusType=='1'){ if(bizObj.focusType=='1'){
this.$router.push({path:'/xm/core/xmProject/XmProjectInfoRoute',query:{id:bizObj.bizId}}) this.$router.push({path:'/xm/core/xmProject/XmProjectInfoRoute',query:{id:bizObj.bizId}})
}else if(bizObj.focusType=='3'){ }else if(bizObj.focusType=='3'){
this.$router.push({path:'/xm/core/xmProduct/XmProductInfoRoute',query:{id:bizObj.bizId}}) this.$router.push({path:'/xm/core/xmProduct/XmProductInfoRoute',query:{id:bizObj.bizId}})
}else if(bizObj.focusType=='2'){
this.$router.push({path:'/xm/core/xmTask/XmTaskDetailRoute',query:{id:bizObj.bizId}})
}else if(bizObj.focusType=='4'){
this.$router.push({path:'/xm/core/xmMenu/XmMenuDetailRoute',query:{id:bizObj.bizId}})
}else if(bizObj.focusType=='5'){
this.$router.push({path:'/xm/core/xmQuestion/XmQuestionDetailRoute',query:{id:bizObj.bizId}})
} }
}, },
// XmMyFocus // XmMyFocus

77
src/views/xm/core/xmQuestion/XmQuestionDetailRoute.vue

@ -0,0 +1,77 @@
<template>
<section class="padding">
<xm-question-edit v-if="xmQuestion" :xm-question="xmQuestion" :visible="showInfo"></xm-question-edit>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { listXmQuestion } from '@/api/xm/core/xmQuestion';
import { mapGetters } from 'vuex';
import XmQuestionEdit from './XmQuestionEdit'
export default {
computed: {
...mapGetters([
'userInfo','roles'
]),
},
watch:{
},
data() {
return {
xmQuestion:null,
showInfo:false,
}
},//end data
methods: {
initByQueryId(){
if(this.$route.query && this.$route.query.id){
var localStorageXmQuestion=localStorage.getItem("xm-question-info-route")
var question=null;
if(localStorageXmQuestion){
question=JSON.parse(localStorageXmQuestion)
if(question && question.id==this.$route.query.id){
this.xmQuestion=question
this.showInfo=true;
}else{
this.getXmQuestion(this.$route.query.id);
}
}else{
this.getXmQuestion(this.$route.query.id);
}
}
},
getXmQuestion(id){
listXmQuestion({id:id}).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.xmQuestion=res.data.data[0]
localStorage.setItem("xm-question-info-route",JSON.stringify(this.xmQuestion))
this.showInfo=true;
}else{
}
})
}
},//end methods
components: {
XmQuestionEdit,
//
},
activated(){
this.initByQueryId();
},
mounted() {
this.initByQueryId();
}
}
</script>
<style scoped>
</style>

11
src/views/xm/core/xmQuestion/XmQuestionEdit.vue

@ -64,7 +64,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-tabs value="1">
<el-tabs v-model="activateTabPaneName">
<el-tab-pane name="1" label="基本信息"> <el-tab-pane name="1" label="基本信息">
<el-row> <el-row>
@ -177,8 +177,10 @@
</div> </div>
</el-form-item> </el-form-item>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane label="关注" name="91">
<xm-my-do-focus v-if="activateTabPaneName=='91'" :biz-id="editForm.id" :pbiz-id="editForm.projectId" :biz-name="editForm.name" focus-type="5"></xm-my-do-focus>
</el-tab-pane>
@ -230,6 +232,7 @@
import TagMng from "@/views/mdp/arc/tag/TagMng"; import TagMng from "@/views/mdp/arc/tag/TagMng";
import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect'; import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect';
import XmMyDoFocus from '../xmMyFocus/XmMyDoFocus.vue';
export default { export default {
computed: { computed: {
@ -315,6 +318,7 @@
expectResultEditorVisible:false, expectResultEditorVisible:false,
opStepEditorVisible:false, opStepEditorVisible:false,
xmProductVersions:[{id:"1.0.0" ,name:'1.0.0'}], xmProductVersions:[{id:"1.0.0" ,name:'1.0.0'}],
activateTabPaneName:'1',
/**end 在上面加自定义属性**/ /**end 在上面加自定义属性**/
}//end return }//end return
},//end data },//end data
@ -524,6 +528,7 @@
components: { components: {
// 'xm-question-edit':XmQuestionEdit // 'xm-question-edit':XmQuestionEdit
'upload': AttachmentUpload,XmGroupMng,VueEditor,XmTaskList,xmMenuSelect,XmQuestionHandleMng,TagMng,XmProjectSelect, 'upload': AttachmentUpload,XmGroupMng,VueEditor,XmTaskList,xmMenuSelect,XmQuestionHandleMng,TagMng,XmProjectSelect,
XmMyDoFocus
}, },
mounted() { mounted() {
console.log("question_add"); console.log("question_add");

77
src/views/xm/core/xmTask/XmTaskDetailRoute.vue

@ -0,0 +1,77 @@
<template>
<section class="padding">
<xm-task-edit v-if="xmTask" :xm-task="xmTask" :visible="showInfo"></xm-task-edit>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { listXmTask } from '@/api/xm/core/xmTask';
import { mapGetters } from 'vuex';
import XmTaskEdit from './XmTaskEdit'
export default {
computed: {
...mapGetters([
'userInfo','roles'
]),
},
watch:{
},
data() {
return {
xmTask:null,
showInfo:false,
}
},//end data
methods: {
initByQueryId(){
if(this.$route.query && this.$route.query.id){
var localStorageTask=localStorage.getItem("xm-task-info-route")
var task=null;
if(localStorageTask){
task=JSON.parse(localStorageTask)
if(task && task.id==this.$route.query.id){
this.xmTask=task
this.showInfo=true;
}else{
this.getTask(this.$route.query.id);
}
}else{
this.getTask(this.$route.query.id);
}
}
},
getTask(id){
listXmTask({id:id}).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.xmTask=res.data.data[0]
localStorage.setItem("xm-task-info-route",JSON.stringify(this.xmTask))
this.showInfo=true;
}else{
}
})
}
},//end methods
components: {
XmTaskEdit,
//
},
activated(){
this.initByQueryId();
},
mounted() {
this.initByQueryId();
}
}
</script>
<style scoped>
</style>

10
src/views/xm/core/xmTask/XmTaskEdit.vue

@ -219,6 +219,9 @@
<el-step title="提现" description="企业付款完成后,个人对钱包中余额进行提现"></el-step> <el-step title="提现" description="企业付款完成后,个人对钱包中余额进行提现"></el-step>
</el-steps> </el-steps>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="关注" name="91">
<xm-my-do-focus v-if="activateTabPaneName=='91'" :biz-id="editForm.id" :pbiz-id="editForm.projectId" :biz-name="editForm.name" focus-type="2"></xm-my-do-focus>
</el-tab-pane>
<el-tab-pane label="日志" name="9"> <el-tab-pane label="日志" name="9">
<xm-record v-if="activateTabPaneName=='9'" :biz-id="editForm.id" :obj-type="'task'"></xm-record> <xm-record v-if="activateTabPaneName=='9'" :biz-id="editForm.id" :obj-type="'task'"></xm-record>
</el-tab-pane> </el-tab-pane>
@ -282,7 +285,8 @@
import XmSubWorkItem from "@/views/xm/core/xmTaskWorkItem/XmSubWorkItem"; import XmSubWorkItem from "@/views/xm/core/xmTaskWorkItem/XmSubWorkItem";
import xmQuestionForTask from "@/views/xm/core/xmQuestion/XmQuestionForTask"; import xmQuestionForTask from "@/views/xm/core/xmQuestion/XmQuestionForTask";
import XmTaskWorkloadRecord from "../xmTaskWorkload/XmTaskWorkloadRecord" import XmTaskWorkloadRecord from "../xmTaskWorkload/XmTaskWorkloadRecord"
import XmMenuEdit from '../xmMenu/XmMenuEdit.vue';
import XmMenuEdit from '../xmMenu/XmMenuEdit.vue';
import XmMyDoFocus from '../xmMyFocus/XmMyDoFocus.vue';
export default { export default {
computed: { computed: {
...mapGetters([ ...mapGetters([
@ -307,7 +311,7 @@ import XmMenuEdit from '../xmMenu/XmMenuEdit.vue';
} }
} }
}, },
props:['xmTask','visible','xmProject','projectPhase',"parentTask"],
props:['xmTask','visible','xmProject',"parentTask"],
watch: { watch: {
'xmTask':function( xmTask ) { 'xmTask':function( xmTask ) {
}, },
@ -631,7 +635,7 @@ import XmMenuEdit from '../xmMenu/XmMenuEdit.vue';
components: { components: {
xmSkillMng, xmSkillMng,
skillMng,xmMenuSelect,XmTaskList,XmExecuserMng,XmGroupSelect,XmMenuRichDetail,TagMng,XmSubWorkItem,XmTaskWorkloadRecord,XmMenuEdit, skillMng,xmMenuSelect,XmTaskList,XmExecuserMng,XmGroupSelect,XmMenuRichDetail,TagMng,XmSubWorkItem,XmTaskWorkloadRecord,XmMenuEdit,
XmRecord,xmQuestionForTask,
XmRecord,xmQuestionForTask,XmMyDoFocus,
// 'xm-task-edit':XmTaskEdit // 'xm-task-edit':XmTaskEdit
}, },
mounted() { mounted() {

Loading…
Cancel
Save