|
|
@ -59,7 +59,7 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-form-item label="案例类型:"prop="associatedType"> |
|
|
|
<el-form-item label="案例类型:" prop="associatedType"> |
|
|
|
<el-select v-model="item.associatedType" :disabled="true"> |
|
|
|
<el-option label="议题" value="0"></el-option> |
|
|
|
<el-option label="项目" value="1"></el-option> |
|
|
@ -69,19 +69,6 @@ |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-form-item label="内容描述:" prop="contentDescription"> |
|
|
|
<!-- <el-upload ref="upload" |
|
|
|
:action="uploadUrl" |
|
|
|
id ="quill-upload" |
|
|
|
:show-file-list="false" |
|
|
|
:before-upload="uploadBeforeUploadHandle" |
|
|
|
:on-success="uploadSuccessHandle" |
|
|
|
style="display: none;"> |
|
|
|
<el-button ref="uploadBtn" |
|
|
|
type="primary" |
|
|
|
id="uploadBtn" |
|
|
|
size="small">{{ $t('upload.button') }}</el-button> |
|
|
|
</el-upload> |
|
|
|
<quill-editor ref="myQuillEditor" v-model="item.contentDescription" :options="editorOption" @focus="onEditorFocus(index)"></quill-editor> --> |
|
|
|
<tinymce-editor v-model="item.contentDescription"></tinymce-editor> |
|
|
|
</el-form-item> |
|
|
|
</el-row> |
|
|
@ -108,13 +95,8 @@ |
|
|
|
<script> |
|
|
|
import debounce from 'lodash/debounce' |
|
|
|
import TypicalcaseConnectList from './typicalcase-connect-list' |
|
|
|
// import { quillEditor } from 'vue-quill-editor' |
|
|
|
import CaseInfoList from './typicalcase-list' |
|
|
|
// import Quill from 'quill' |
|
|
|
import Cookies from 'js-cookie' |
|
|
|
// import 'quill/dist/quill.core.css' |
|
|
|
// import 'quill/dist/quill.snow.css' |
|
|
|
// import 'quill/dist/quill.bubble.css' |
|
|
|
import mixinViewModule from '@/mixins/view-module' |
|
|
|
import TinymceEditor from '@/components/tinymce-editor' |
|
|
|
export default { |
|
|
@ -130,7 +112,6 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
components: { |
|
|
|
// quillEditor, |
|
|
|
TinymceEditor, |
|
|
|
TypicalcaseConnectList, |
|
|
|
CaseInfoList |
|
|
@ -142,38 +123,6 @@ export default { |
|
|
|
content: '', |
|
|
|
loading: false, |
|
|
|
isAble: false, |
|
|
|
// editorOption: { |
|
|
|
// placeholder: 'Please enter it here...', |
|
|
|
// modules: { |
|
|
|
// toolbar: { |
|
|
|
// container: [ |
|
|
|
// ['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线 |
|
|
|
// ['blockquote'], // 引用 |
|
|
|
// [{ 'header': 1 }, { 'header': 2 }], // 标题,键值对的形式;1、2表示字体大小 |
|
|
|
// [{ 'list': 'ordered' }, { 'list': 'bullet' }], // 列表 |
|
|
|
// [{ 'indent': '-1' }, { 'indent': '+1' }], // 缩进 |
|
|
|
// [{ 'direction': 'rtl' }], // 文本方向 |
|
|
|
// [{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小 |
|
|
|
// [{ 'header': [1, 2, 3, 4, 5, 6, false] }], // 几级标题 |
|
|
|
// [{ 'color': [] }, { 'background': [] }], // 字体颜色,字体背景颜色 |
|
|
|
// [{ 'font': [] }], // 字体 |
|
|
|
// [{ 'align': [] }], // 对齐方式 |
|
|
|
// ['clean'], // 清除字体样式 |
|
|
|
// ['image'] // 上传图片、上传视频 |
|
|
|
// ], |
|
|
|
// handlers: { |
|
|
|
// 'image': function (value) { |
|
|
|
// if (value) { |
|
|
|
// // 给个点击触发Element-ui,input框选择图片文件 |
|
|
|
// document.querySelector('#quill-upload input').click() |
|
|
|
// } else { |
|
|
|
// this.quill.format('image', false) |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }, |
|
|
|
uploadUrl: '', |
|
|
|
dataForm: { |
|
|
|
id: '', |
|
|
@ -227,11 +176,11 @@ export default { |
|
|
|
// 案例类别 |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].associatedType = connectResponse.associatedType |
|
|
|
// 内容描述 |
|
|
|
if (connectResponse.associatedType == 0) { |
|
|
|
if (connectResponse.associatedType === 0) { |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].contentDescription = connectResponse.issueContent |
|
|
|
} else if (connectResponse.associatedType == 1) { |
|
|
|
} else if (connectResponse.associatedType === 1) { |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].contentDescription = connectResponse.itemContent |
|
|
|
} else if (connectResponse.associatedType == 2) { |
|
|
|
} else if (connectResponse.associatedType === 2) { |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].contentDescription = connectResponse.topicContent |
|
|
|
} |
|
|
|
// 类别 |
|
|
@ -241,28 +190,28 @@ export default { |
|
|
|
// 网格Id |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].sourceGridId = connectResponse.gridId |
|
|
|
// 发布人姓名 |
|
|
|
if (connectResponse.associatedType == 0) { |
|
|
|
if (connectResponse.associatedType === 0) { |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].publisherName = connectResponse.nickName |
|
|
|
} else if (connectResponse.associatedType == 1) { |
|
|
|
} else if (connectResponse.associatedType === 1) { |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].publisherName = connectResponse.nickName |
|
|
|
} else if (connectResponse.associatedType == 2) { |
|
|
|
} else if (connectResponse.associatedType === 2) { |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].publisherName = connectResponse.nickname |
|
|
|
} |
|
|
|
// 头像 |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].publisherHeader = connectResponse.userFace |
|
|
|
// 内容 |
|
|
|
if (connectResponse.associatedType == 0) { |
|
|
|
if (connectResponse.associatedType === 0) { |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].content = connectResponse.issueContent |
|
|
|
} else if (connectResponse.associatedType == 1) { |
|
|
|
} else if (connectResponse.associatedType === 1) { |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].content = connectResponse.itemContent |
|
|
|
} else if (connectResponse.associatedType == 2) { |
|
|
|
} else if (connectResponse.associatedType === 2) { |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].content = connectResponse.topicContent |
|
|
|
} |
|
|
|
if (connectResponse.associatedType == 0) { |
|
|
|
if (connectResponse.associatedType === 0) { |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].releaseTime = connectResponse.distributeTime |
|
|
|
} else if (connectResponse.associatedType == 1) { |
|
|
|
} else if (connectResponse.associatedType === 1) { |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].releaseTime = connectResponse.distributeTime |
|
|
|
} else if (connectResponse.associatedType == 2) { |
|
|
|
} else if (connectResponse.associatedType === 2) { |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].releaseTime = connectResponse.createdTime |
|
|
|
} |
|
|
|
this.dataForm.dynamicItem[connectResponse.caseIndex].expressingAttitude = connectResponse.participantsNum |
|
|
@ -290,44 +239,6 @@ export default { |
|
|
|
expressingAttitude: '' |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 富文本编辑器 |
|
|
|
// quillEditorHandle () { |
|
|
|
// this.quillEditor = new Quill('#J_quillEditor', { |
|
|
|
// modules: { |
|
|
|
// toolbar: this.quillEditorToolbarOptions |
|
|
|
// }, |
|
|
|
// theme: 'snow' |
|
|
|
// }) |
|
|
|
// this.quillEditor.container.style.height = `${300}px` |
|
|
|
// // // 自定义上传图片功能 (使用element upload组件) |
|
|
|
// this.quillEditor.getModule('toolbar').addHandler('image', () => { |
|
|
|
// this.$refs.uploadBtn.$el.click() |
|
|
|
// }) |
|
|
|
// // 监听内容变化,动态赋值 |
|
|
|
// this.quillEditor.on('text-change', () => { |
|
|
|
// this.dataForm.actContent = this.quillEditor.root.innerHTML |
|
|
|
// if ((this.dataForm.actContent).length > 10000) { |
|
|
|
// return this.$message.error('您输入的的内容已超过字数') |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
// // 上传图片之前 (富文本) |
|
|
|
// uploadBeforeUploadHandle (file) { |
|
|
|
// if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') { |
|
|
|
// this.$message.error(this.$t('upload.tip', { 'format': 'jpg、png、gif' })) |
|
|
|
// return false |
|
|
|
// } |
|
|
|
// }, |
|
|
|
// // 上传图片成功 (富文本) |
|
|
|
// uploadSuccessHandle (res) { |
|
|
|
// let quill = this.$refs.myQuillEditor[this.imgIndex].quill |
|
|
|
// if (res.code !== 0) { |
|
|
|
// return this.$message.error(res.msg) |
|
|
|
// } |
|
|
|
// quill.insertEmbed(quill.getSelection().index, 'image', res.data.url) |
|
|
|
// quill.setSelection(quill.getSelection().index + 1) |
|
|
|
// }, |
|
|
|
// 上传图片ends |
|
|
|
init () { |
|
|
|
this.visible = true |
|
|
|
this.$nextTick(() => { |
|
|
@ -362,7 +273,7 @@ export default { |
|
|
|
return false |
|
|
|
} |
|
|
|
for (let item of this.dataForm.dynamicItem) { |
|
|
|
if (item.associatedId != '') { |
|
|
|
if (item.associatedId !== '') { |
|
|
|
this.dataForm.caseNumber = this.dataForm.caseNumber + 1 |
|
|
|
} |
|
|
|
} |
|
|
|