Browse Source

优化

master
陈裕财 4 years ago
parent
commit
7f34ad095e
  1. 18
      src/views/xm/core/xmMenu/XmMenuEdit.vue
  2. 1
      src/views/xm/core/xmMenu/XmMenuMng.vue
  3. 10
      src/views/xm/core/xmMenuExchange/MenuUserEditor.vue
  4. 112
      src/views/xm/core/xmMenuExchange/XmMenuExchangeMng.vue
  5. 44
      src/views/xm/core/xmMenuExchange/XmMenuExchangeRoute.vue

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

@ -51,24 +51,28 @@
<el-input type="textarea" v-model="editForm.remark" :autosize="{ minRows: 4, maxRows: 20}" placeholder="什么人?做什么事?,为什么?如: 作为招聘专员,我需要统计员工半年在职/离职人数,以便我能够制定招聘计划" ></el-input> <el-input type="textarea" v-model="editForm.remark" :autosize="{ minRows: 4, maxRows: 20}" placeholder="什么人?做什么事?,为什么?如: 作为招聘专员,我需要统计员工半年在职/离职人数,以便我能够制定招聘计划" ></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row >
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit" :disabled="load.edit==true">提交</el-button>
</el-row>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="概览" lazy> <el-tab-pane label="概览" lazy>
<xm-menu-overview :xm-menu="xmMenu"></xm-menu-overview> <xm-menu-overview :xm-menu="xmMenu"></xm-menu-overview>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="需求评论" lazy>
<xm-menu-exchange-mng :xm-menu="xmMenu"></xm-menu-exchange-mng>
</el-tab-pane>
</el-tabs> </el-tabs>
<el-drawer title="选择员工" :visible.sync="userSelectVisible" size="60%" append-to-body> <el-drawer title="选择员工" :visible.sync="userSelectVisible" size="60%" append-to-body>
<users-select @confirm="onUserSelected" ref="usersSelect"></users-select> <users-select @confirm="onUserSelected" ref="usersSelect"></users-select>
</el-drawer> </el-drawer>
</el-row> </el-row>
<el-row class="page-bottom">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit" :disabled="load.edit==true">提交</el-button>
</el-row>
<el-dialog append-to-body title="标签" :visible.sync="tagSelectVisible" class="dialog-body" width="60%">
<el-drawer append-to-body title="标签" :visible.sync="tagSelectVisible" class="dialog-body" size="60%">
<tag-mng :tagIds="editForm.tagIds?editForm.tagIds.split(','):[]" :jump="true" @select-confirm="onTagSelected"> <tag-mng :tagIds="editForm.tagIds?editForm.tagIds.split(','):[]" :jump="true" @select-confirm="onTagSelected">
</tag-mng> </tag-mng>
</el-dialog>
</el-drawer>
</section> </section>
</template> </template>
@ -79,6 +83,7 @@
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import UsersSelect from "@/views/mdp/sys/user/UsersSelect"; import UsersSelect from "@/views/mdp/sys/user/UsersSelect";
import XmMenuOverview from './XmMenuOverview.vue'; import XmMenuOverview from './XmMenuOverview.vue';
import XmMenuExchangeMng from '../xmMenuExchange/XmMenuExchangeMng.vue';
import TagMng from "@/views/mdp/arc/tag/TagMng"; import TagMng from "@/views/mdp/arc/tag/TagMng";
@ -209,6 +214,7 @@ import XmMenuOverview from './XmMenuOverview.vue';
UsersSelect, UsersSelect,
XmMenuOverview, XmMenuOverview,
TagMng, TagMng,
XmMenuExchangeMng,
}, },
mounted() { mounted() {
this.editForm=Object.assign(this.editForm, this.xmMenu); this.editForm=Object.assign(this.editForm, this.xmMenu);

1
src/views/xm/core/xmMenu/XmMenuMng.vue

@ -922,7 +922,6 @@
this.productVisible=false; this.productVisible=false;
} }
this.$nextTick(() => { this.$nextTick(() => {
debugger;
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el); this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
this.getXmMenus(); this.getXmMenus();
}); });

10
src/views/xm/core/xmMenuExchange/MenuUserEditor.vue

@ -9,7 +9,7 @@
<vue-editor :key="id" :branch-id="userInfo.branchId" :category-id="productId+'-'+menuId" v-model="content"></vue-editor> <vue-editor :key="id" :branch-id="userInfo.branchId" :category-id="productId+'-'+menuId" v-model="content"></vue-editor>
</div> </div>
<div style="margin-top:20px;"></div> <div style="margin-top:20px;"></div>
<el-button @click="publish" class="toolbar" type="primary">发布</el-button> <el-button @click="clearContent" style="margin-right: 0.25rem;" class="toolbar" type="plain"></el-button>
<el-button @click="publish" class="toolbar" type="primary">发布</el-button> <el-button @click="clearContent" style="margin-right: 0.25rem;" class="toolbar" type="plain"></el-button> <el-button @click="close" style="margin-right: 0.25rem;" class="toolbar" type="plain"></el-button>
</div> </div>
</div> </div>
</template> </template>
@ -33,17 +33,17 @@ export default {
}, },
methods: { methods: {
publish() { publish() {
let params = {
content: this.content,
}
if(!this.content){ if(!this.content){
this.$notify.error("请输入内容再提交"); this.$notify.error("请输入内容再提交");
return; return;
} }
this.$emit('publish',params);
this.$emit('publish',this.content);
}, },
clearContent(){ clearContent(){
this.content=""; this.content="";
},
close(){
this.$emit("close")
} }
}, },
mounted() { mounted() {

112
src/views/xm/core/xmMenuExchange/XmMenuExchangeMng.vue

@ -1,31 +1,27 @@
<template> <template>
<section class="padding">
<el-row class="page-main ">
<section class="page-container padding">
<el-row>
<el-input style="width:20%;" v-model="filters.key" placeholder="需求名称、评论、评论人姓名模糊搜素" clearable></el-input >&nbsp;&nbsp;<el-input style="width:20%;" v-model="filters.menuId" placeholder="" clearable></el-input>
<el-button type="primary" @click="searchXmMenuExchanges">查询</el-button>
<el-button type="primary" @click="headEditorVisible=true" v-if="filters.xmMenu">发表需求建议</el-button>
</el-row>
<el-row class="page-main" :style="{overflowX:'auto',height:maxTableHeight+'px'}" ref="table">
<div style="overflow-x:hidden"> <div style="overflow-x:hidden">
<menu-user-editor key="head" :id="'head'+filters.xmMenu.menuId" v-if="filters.xmMenu" :user="{userid:userInfo.userid,username:userInfo.username,headimgurl:userInfo.headimgurl}" :product-id="filters.xmMenu.productId" :menu-id="filters.xmMenu.menuId" @publish="onPublishContent"></menu-user-editor>
<div v-for="(item,i) in xmMenuExchanges" :key="i" class="comment-list clearfix">
<menu-user-editor key="head" :id="'head'+filters.xmMenu.menuId" v-if="filters.xmMenu && headEditorVisible" :user="{userid:userInfo.userid,username:userInfo.username,headimgurl:userInfo.headimgurl}" :product-id="filters.xmMenu.productId" :menu-id="filters.xmMenu.menuId" @publish="onPublishContent"></menu-user-editor>
<div v-for="(item,i) in xmMenuExchanges" :key="i" class="comment-list clearfix">
<div class="comment-avater"> <div class="comment-avater">
<el-avatar icon="el-icon-user-solid"></el-avatar> <el-avatar icon="el-icon-user-solid"></el-avatar>
</div> </div>
<div class="comment-wrap"> <div class="comment-wrap">
<div class="comment-head"> <div class="comment-head">
<span>{{item.cusername}}</span> {{item.ctime}}
<el-button slot="reference" type="text" style="font-size:12px;" @click="handleDel(item)"><i class="el-icon-delete-solid"></i>删除</el-button>
<el-popover
placement="bottom"
trigger="click">
<menu-user-editor :key="'menu-'+i" :id="'menu-'+item.menuId+'-'+i" :user="{userid:item.cuserid,username:item.cusername,headimgurl:item.cuserHeadImg}" :product-id="item.productId" :menu-id="item.menuId" @publish="onPublishContent($event,item)"></menu-user-editor>
<el-button slot="reference" type="text" style="font-size:12px;"><i class="el-icon-paperclip"></i>引用</el-button>
</el-popover>
<el-popover
placement="bottom"
trigger="click">
<menu-user-editor :key="'userreply-'+i" :id="'userreply'+i+item.id" :user="{userid:item.cuserid,username:item.cusername,headimgurl:item.cuserHeadImg}" :product-id="item.productId" :menu-id="item.menuId" @publish="onPublishContent($event,item)"></menu-user-editor>
<el-button slot="reference" type="text" style="font-size:12px;"><i class="el-icon-s-comment"></i>回复</el-button>
</el-popover>
<span>{{item.cusername}}</span> <font style="font-size:12px;color:black;">需求:&nbsp;&nbsp;{{item.menuId}}{{item.menuName}}</font>&nbsp;&nbsp;{{item.ctime}}
<el-button type="text" style="font-size:12px;" @click="handleDel(item)"><i class="el-icon-delete-solid"></i>删除</el-button>
<el-button type="text" style="font-size:12px;" @click="showEditor(item,i)"><i class="el-icon-paperclip"></i>引用</el-button>
<el-button type="text" style="font-size:12px;" @click="showEditor(item,i)"><i class="el-icon-s-comment"></i>回复</el-button>
<small>{{item.createTime}}</small> <small>{{item.createTime}}</small>
</div> </div>
<blockquote v-if="item.pid"> <blockquote v-if="item.pid">
<div v-html="item.premark"></div> <div v-html="item.premark"></div>
<footer> {{item.pusername}}</footer> <footer> {{item.pusername}}</footer>
@ -33,12 +29,14 @@
<div class="comment-content" v-html="item.remark"> <div class="comment-content" v-html="item.remark">
{{item.remark}} {{item.remark}}
</div> </div>
<menu-user-editor :key="'menu-'+i" :id="'menu-'+item.id" v-show="item.showEditor" :user="{userid:userInfo.userid,username:userInfo.username,headimgurl:userInfo.headimgurl}" :product-id="item.productId" :menu-id="item.menuId" @publish="onPublishContent($event,item)" @close="item.showEditor=false"></menu-user-editor>
</div> </div>
</div> </div>
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
</div> </div>
</el-row> </el-row>
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
</section> </section>
</template> </template>
@ -51,6 +49,8 @@
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import {sn} from '@/common/js/sequence'; import {sn} from '@/common/js/sequence';
import VueEditor from '@/components/Tinymce/index';
export default { export default {
computed: { computed: {
...mapGetters([ ...mapGetters([
@ -69,6 +69,7 @@
filters: { filters: {
key: '', key: '',
xmMenu:null, xmMenu:null,
menuId:''
}, },
xmMenuExchanges: [],// xmMenuExchanges: [],//
pageInfo:{// pageInfo:{//
@ -90,14 +91,18 @@
addForm: { addForm: {
menuId:'',menuName:'',productId:'',remark:'',id:'',pid:'',cuserid:'',cusername:'',ctime:'',cbranchId:'',adopt:'',adoptUserid:'',adoptUsername:'',adoptTime:'',closed:'',puserid:'',pusername:'',premark:'',notifyUserids:'',notifyChannels:'',notifyUsernames:'',cuserHeadImg:'',replyType:'' menuId:'',menuName:'',productId:'',remark:'',id:'',pid:'',cuserid:'',cusername:'',ctime:'',cbranchId:'',adopt:'',adoptUserid:'',adoptUsername:'',adoptTime:'',closed:'',puserid:'',pusername:'',premark:'',notifyUserids:'',notifyChannels:'',notifyUsernames:'',cuserHeadImg:'',replyType:''
}, },
addFormInit: {
menuId:'',menuName:'',productId:'',remark:'',id:'',pid:'',cuserid:'',cusername:'',ctime:'',cbranchId:'',adopt:'',adoptUserid:'',adoptUsername:'',adoptTime:'',closed:'',puserid:'',pusername:'',premark:'',notifyUserids:'',notifyChannels:'',notifyUsernames:'',cuserHeadImg:'',replyType:''
},
editFormVisible: false,// editFormVisible: false,//
//xmMenuExchange //xmMenuExchange
editForm: { editForm: {
menuId:'',menuName:'',productId:'',remark:'',id:'',pid:'',cuserid:'',cusername:'',ctime:'',cbranchId:'',adopt:'',adoptUserid:'',adoptUsername:'',adoptTime:'',closed:'',puserid:'',pusername:'',premark:'',notifyUserids:'',notifyChannels:'',notifyUsernames:'',cuserHeadImg:'',replyType:'' menuId:'',menuName:'',productId:'',remark:'',id:'',pid:'',cuserid:'',cusername:'',ctime:'',cbranchId:'',adopt:'',adoptUserid:'',adoptUsername:'',adoptTime:'',closed:'',puserid:'',pusername:'',premark:'',notifyUserids:'',notifyChannels:'',notifyUsernames:'',cuserHeadImg:'',replyType:''
}, },
xmMenuVisible:false, xmMenuVisible:false,
tableHeight:300,
maxTableHeight:300,
content:'',
headEditorVisible:false,
/**begin 自定义属性请在下面加 请加备注**/ /**begin 自定义属性请在下面加 请加备注**/
/**end 自定义属性请在上面加 请加备注**/ /**end 自定义属性请在上面加 请加备注**/
@ -146,7 +151,7 @@
params.orderBy= orderBys.join(",") params.orderBy= orderBys.join(",")
} }
if(this.filters.key!==""){ if(this.filters.key!==""){
//params.xxx=this.filters.key
params.key=this.filters.key
}else{ }else{
//params.xxx=xxxxx //params.xxx=xxxxx
} }
@ -159,6 +164,9 @@
} }
} }
if(this.filters.menuId){
params.menuId=this.filters.menuId
}
if(!params.menuId){ if(!params.menuId){
params.branchId=this.userInfo.branchId params.branchId=this.userInfo.branchId
} }
@ -168,7 +176,9 @@
if(tips.isOk){ if(tips.isOk){
this.pageInfo.total = res.data.total; this.pageInfo.total = res.data.total;
this.pageInfo.count=false; this.pageInfo.count=false;
this.xmMenuExchanges = res.data.data;
var data=res.data.data;
data.forEach(i=>i.showEditor=false)
this.xmMenuExchanges = data;
}else{ }else{
this.$notify({showClose: true, message: tips.msg, type: 'error' }); this.$notify({showClose: true, message: tips.msg, type: 'error' });
} }
@ -238,18 +248,26 @@
this.$emit('row-click',row, event, column);// @row-click="rowClick" this.$emit('row-click',row, event, column);// @row-click="rowClick"
}, },
/**begin 自定义函数请在下面加**/ /**begin 自定义函数请在下面加**/
showEditor(item,replyType){
this.editForm=item;
onPublishContent:function(editor,parentXmMenuExchange){
var params={};
params.remark=editor.content;
if(!parentXmMenuExchange && !this.xmMenu && !this.filters.xmMenu){
this.$notify.error("请选择需求再发表评论")
return;
}
params.id=sn()
if(this.xmMenu){
this.addForm={...this.addFOrmInit}
this.addForm.replyType=replyType;
item.showEditor=true;
},
onPublishContent:function(content,item){
debugger;
var params={...this.addForm}
params.remark=content;
if(item){
params.puserid=item.cuserid
params.premark=item.remark
params.pusername=item.cusername
params.productId=item.productId
params.menuId=item.menuId
params.menuName=item.menuName
params.pid=item.id
}else if(this.xmMenu){
params.menuId=this.xmMenu.menuId params.menuId=this.xmMenu.menuId
params.productId=this.xmMenu.productId params.productId=this.xmMenu.productId
params.menuName=this.xmMenu.menuName params.menuName=this.xmMenu.menuName
@ -260,28 +278,24 @@
params.menuName=this.filters.xmMenu.menuName params.menuName=this.filters.xmMenu.menuName
}else{ }else{
params.menuId=parentXmMenuExchange.menuId
params.productId=parentXmMenuExchange.productId
params.menuName=parentXmMenuExchange.menuName
params.menuId=item.menuId
params.productId=item.productId
params.menuName=item.menuName
} }
} }
params.cuserid=this.userInfo.userid params.cuserid=this.userInfo.userid
params.cusername=this.userInfo.username params.cusername=this.userInfo.username
params.cbranchId=this.userInfo.branchId params.cbranchId=this.userInfo.branchId
params.cuserHeadImg=this.userInfo.headimgurl params.cuserHeadImg=this.userInfo.headimgurl
if(parentXmMenuExchange){
params.pid=parentXmMenuExchange.id
params.premark=parentXmMenuExchange.remark
params.puserid=parentXmMenuExchange.cuserid
params.pusername=parentXmMenuExchange.cusername
}
addXmMenuExchange(params).then(res=>{ addXmMenuExchange(params).then(res=>{
var tips =res.data.tips; var tips =res.data.tips;
if(tips.isOk){ if(tips.isOk){
this.xmMenuExchanges.unshift(res.data.data);
var data=res.data.data;
data.showEditor=false;
this.xmMenuExchanges.unshift(data);
this.editForm.showEditor=false;
this.headEditorVisible=false;
} }
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error'}); this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error'});
}) })
@ -299,10 +313,12 @@
},//end methods },//end methods
components: { components: {
// //
MenuUserEditor
MenuUserEditor,VueEditor
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
this.filters.xmMenu=this.xmMenu this.filters.xmMenu=this.xmMenu
this.getXmMenuExchanges(); this.getXmMenuExchanges();
}); });

44
src/views/xm/core/xmMenuExchange/XmMenuExchangeRoute.vue

@ -0,0 +1,44 @@
<template>
<section class="padding">
</section>
</template>
<script>
import util from '@/common/js/util';//
import config from '@/common/config';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { mapGetters } from 'vuex'
import {sn} from '@/common/js/sequence';
export default {
computed: {
...mapGetters([
'userInfo','roles'
])
},
watch:{
},
data() {
return {
}
},//end data
methods: {
},//end methods
components: {
},
mounted() {
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save