Browse Source

优化

master
陈裕财 4 years ago
parent
commit
230d5ff1a8
  1. 26
      src/components/Tinymce/index.vue
  2. 2
      src/views/xm/core/xmMenuExchange/MenuUserEditor.vue
  3. 6
      src/views/xm/core/xmMenuExchange/XmMenuExchangeMng.vue
  4. 4
      src/views/xm/core/xmQuestion/XmQuestionMng.vue

26
src/components/Tinymce/index.vue

@ -62,17 +62,15 @@ export default {
default: 360, default: 360,
}, },
}, },
data() {
data() {
var tinymceId="vue-tinymce-" + new Date().getTime() + ((Math.random() * 1000).toFixed(0) + "")
return { return {
uploadAction: config.getArcImagePath()+"/arc/image/upload", uploadAction: config.getArcImagePath()+"/arc/image/upload",
uploadOptions:{branchId:'',categoryId:'uploadImm',fileName:'',remark:'',deptid:''},// uploadOptions:{branchId:'',categoryId:'uploadImm',fileName:'',remark:'',deptid:''},//
imageList: [], imageList: [],
dialogVisible: false, dialogVisible: false,
editorHtmlData: this.value, editorHtmlData: this.value,
tinymceId:
"vue-tinymce-" +
new Date().getTime() +
((Math.random() * 1000).toFixed(0) + ""),
tinymceId: tinymceId,
fullscreen: false, fullscreen: false,
languageTypeList: { languageTypeList: {
en: "en", en: "en",
@ -99,7 +97,7 @@ export default {
this.$emit("input", val); this.$emit("input", val);
}, },
language() { language() {
this.destroyTinymce();
//this.destroyTinymce();
//this.$nextTick(() => this.initTinymce()) //this.$nextTick(() => this.initTinymce())
}, },
}, },
@ -119,16 +117,16 @@ export default {
}, },
*/ */
methods: { methods: {
initTinymce() {
initTinymce() {
const _this = this; const _this = this;
window.tinymce.init({ window.tinymce.init({
language: this.language,
selector: `#${this.tinymceId}`,
height: this.height,
language: _this.language,
selector: `#${_this.tinymceId}`,
height: _this.height,
body_class: "panel-body ", body_class: "panel-body ",
object_resizing: false, object_resizing: false,
toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
menubar: this.menubar,
toolbar: _this.toolbar.length > 0 ? _this.toolbar : toolbar,
menubar: _this.menubar,
plugins: plugins, plugins: plugins,
end_container_on_empty_block: true, end_container_on_empty_block: true,
powerpaste_word_import: "clean", powerpaste_word_import: "clean",
@ -203,10 +201,10 @@ export default {
// }, // },
}); });
this.setContent(this.value);
_this.setContent(_this.value);
}, },
destroyTinymce() { destroyTinymce() {
const tinymce = window.tinymce.get(this.tinymceId);
var tinymce = window.tinymce.get(this.tinymceId);
if (this.fullscreen) { if (this.fullscreen) {
tinymce.execCommand("mceFullScreen"); tinymce.execCommand("mceFullScreen");
} }

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

@ -6,7 +6,7 @@
</div> </div>
<div class="comment-wrap"> <div class="comment-wrap">
<div class="clearfix"> <div class="clearfix">
<vue-editor :id="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>

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

@ -2,7 +2,7 @@
<section class="padding"> <section class="padding">
<el-row class="page-main "> <el-row class="page-main ">
<div style="overflow-x:hidden"> <div style="overflow-x:hidden">
<menu-user-editor :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>
<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"> <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>
@ -14,13 +14,13 @@
<el-popover <el-popover
placement="bottom" placement="bottom"
trigger="click"> trigger="click">
<menu-user-editor :id="'userquote'+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>
<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-button slot="reference" type="text" style="font-size:12px;"><i class="el-icon-paperclip"></i>引用</el-button>
</el-popover> </el-popover>
<el-popover <el-popover
placement="bottom" placement="bottom"
trigger="click"> trigger="click">
<menu-user-editor :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>
<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-button slot="reference" type="text" style="font-size:12px;"><i class="el-icon-s-comment"></i>回复</el-button>
</el-popover> </el-popover>
<small>{{item.createTime}}</small> <small>{{item.createTime}}</small>

4
src/views/xm/core/xmQuestion/XmQuestionMng.vue

@ -154,10 +154,10 @@
<el-table-column prop="askUsername" label="创建人" width="100" show-overflow-tooltip> <el-table-column prop="askUsername" label="创建人" width="100" show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="创建时间" width="100" show-overflow-tooltip>
<el-table-column prop="createTime" label="创建时间" sortable width="100" show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column prop="ltime" label="更新时间" width="100" show-overflow-tooltip>
<el-table-column prop="ltime" label="更新时间" sortable width="100" show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column prop="handlerUsername" label="指派给" width="100" show-overflow-tooltip> <el-table-column prop="handlerUsername" label="指派给" width="100" show-overflow-tooltip>
</el-table-column> </el-table-column>

Loading…
Cancel
Save