Browse Source

1、修改举报问题屏蔽原因字数限制

2、修改不规范编码
feature/syp_points
liuchuang 5 years ago
parent
commit
f73ba2afac
  1. 35
      src/components/tinymce-editor/index.vue
  2. 117
      src/views/modules/case/typicalcase-add-or-update.vue
  3. 1
      src/views/modules/custom/reportissue-add-or-update.vue
  4. 10
      src/views/modules/custom/reportissue.vue
  5. 25
      src/views/modules/heart/actinfo-add-or-update.vue
  6. 69
      src/views/modules/heart/actinfo-pull.vue
  7. 57
      src/views/modules/message/mail-template-add-or-update.vue
  8. 62
      src/views/modules/news/allnews-add-or-update.vue
  9. 61
      src/views/modules/news/allnotice-add-or-update.vue
  10. 62
      src/views/modules/news/news-add-or-update.vue
  11. 69
      src/views/modules/news/news-publish.vue
  12. 62
      src/views/modules/news/notice-add-or-update.vue

35
src/components/tinymce-editor/index.vue

@ -38,13 +38,13 @@ export default {
// skin_url: '/tinymce/skins/lightgray',
height: 400,
menu: {
file: {title: '文件', items: 'newdocument'},
edit: {title: '编辑', items: 'undo redo | cut copy paste pastetext | selectall'},
insert: {title: '插入', items: 'image | inserttable'},
view: {title: '查看', items: 'visualaid'},
format: {title: '格式', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat'},
table: {title: '表格', items: 'inserttable tableprops deletetable | cell row column'},
tools: {title: '工具', items: 'spellchecker code'}
file: { title: '文件', items: 'newdocument' },
edit: { title: '编辑', items: 'undo redo | cut copy paste pastetext | selectall' },
insert: { title: '插入', items: 'image | inserttable' },
view: { title: '查看', items: 'visualaid' },
format: { title: '格式', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat' },
table: { title: '表格', items: 'inserttable tableprops deletetable | cell row column' },
tools: { title: '工具', items: 'spellchecker code' }
},
menubar: 'edit insert format table',
plugins: 'powerpaste link lists image code table colorpicker textcolor wordcount contextmenu',
@ -56,16 +56,15 @@ export default {
statusbar: false,
powerpaste_word_import: 'merge',
images_upload_handler: (blobInfo, success, failure) => {
console.log('images_upload_handler')
var form = new FormData();
form.append('file', blobInfo.blob(), blobInfo.filename());
axios.post(`${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`, form).then(res => {
if (res.data.code == 0 && res.data.msg == 'success') {
success(res.data.data.url)
} else {
failure(res.data.msg)
}
})
var form = new FormData()
form.append('file', blobInfo.blob(), blobInfo.filename())
axios.post(`${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`, form).then(res => {
if (res.data.code === 0 && res.data.msg === 'success') {
success(res.data.data.url)
} else {
failure(res.data.msg)
}
})
}
}
}
@ -79,7 +78,7 @@ export default {
}
},
watch: {
value: function(newVal) {
value: function (newVal) {
this.tinymceHtml = newVal
}
},

117
src/views/modules/case/typicalcase-add-or-update.vue

@ -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 }], // 12
// [{ '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-uiinput
// 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': 'jpgpnggif' }))
// 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
}
}

1
src/views/modules/custom/reportissue-add-or-update.vue

@ -30,7 +30,6 @@
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data () {
return {

10
src/views/modules/custom/reportissue.vue

@ -100,7 +100,7 @@ export default {
startTime: '',
endTime: ''
},
anonymous: [{'optionValue':'0', 'optionName':'否'}, {'optionValue':'1', 'optionName':'是'}],
anonymous: [ { 'optionValue': '0', 'optionName': '否' }, { 'optionValue': '1', 'optionName': '是' } ],
pickerBeginDateBefore: {
disabledDate: time => {
let beginDateVal = this.dataForm.startTime
@ -132,10 +132,14 @@ export default {
}
},
shield (val) {
this.$prompt('请输入屏蔽原因', '提示', {
this.$prompt('', '请输入屏蔽原因', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPlaceholder: '100字以内'
closeOnClickModal: false,
closeOnPressEscape: false,
inputPlaceholder: '100字以内',
inputPattern: /^[\S\s]{1,100}$/,
inputErrorMessage: '屏蔽原因不能为空且在100个字以内'
}).then(({ value }) => {
this.$http['post']('/custom/reportissue/shield', { id: val, shieldReason: value }).then(({ data: res }) => {
if (res.code !== 0) {

25
src/views/modules/heart/actinfo-add-or-update.vue

@ -288,8 +288,6 @@
import Cookies from 'js-cookie'
import MapSelect from './map-select'
import debounce from 'lodash/debounce'
// import 'quill/dist/quill.snow.css'
// import Quill from 'quill'
import TinymceEditor from '@/components/tinymce-editor'
export default {
name: 'ActInfoAdd',
@ -334,23 +332,6 @@ export default {
signInIsAble: true,
isAble: false,
loading: false,
//
// quillEditor: null,
// quillEditorToolbarOptions: [
// ['bold', 'italic', 'underline', 'strike'],
// ['blockquote', 'code-block', 'image'],
// [{ 'header': 1 }, { 'header': 2 }],
// [{ 'list': 'ordered' }, { 'list': 'bullet' }],
// [{ 'script': 'sub' }, { 'script': 'super' }],
// [{ 'indent': '-1' }, { 'indent': '+1' }],
// [{ 'direction': 'rtl' }],
// [{ 'size': ['small', false, 'large', 'huge'] }],
// [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
// [{ 'color': [] }, { 'background': [] }],
// [{ 'font': [] }],
// [{ 'align': [] }],
// ['clean']
// ],
uploadUrl: '',
pickerBeginDateBefore: {
disabledDate: (time) => {
@ -398,12 +379,6 @@ export default {
//
this.hideUpload = false
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
// if (this.quillEditor) {
// this.quillEditor.deleteText(0, this.quillEditor.getLength())
// } else {
// this.quillEditorHandle()
// }
// end
})
},
computed: {

69
src/views/modules/heart/actinfo-pull.vue

@ -2,17 +2,6 @@
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="actNewsContent" label="活动新闻稿">
<!-- 富文本编辑器, 容器 -->
<!-- <div id="J_quillEditor"></div> -->
<!-- 自定义上传图片功能 (使用element upload组件) -->
<!-- <el-upload
:action="uploadUrl"
:show-file-list="false"
:before-upload="uploadBeforeUploadHandle"
:on-success="uploadSuccessHandle"
style="display: none;">
<el-button ref="uploadBtn" type="primary" size="small">{{ $t('upload.button') }}</el-button>
</el-upload> -->
<tinymce-editor v-model="dataForm.actNewsContent"></tinymce-editor>
</el-form-item>
</el-form>
@ -24,31 +13,12 @@
</template>
<script>
import Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
// import 'quill/dist/quill.snow.css'
// import Quill from 'quill'
import TinymceEditor from '@/components/tinymce-editor'
export default {
data () {
return {
visible: false,
// quillEditor: null,
// quillEditorToolbarOptions: [
// ['bold', 'italic', 'underline', 'strike'],
// ['blockquote', 'code-block', 'image'],
// [{ 'header': 1 }, { 'header': 2 }],
// [{ 'list': 'ordered' }, { 'list': 'bullet' }],
// [{ 'script': 'sub' }, { 'script': 'super' }],
// [{ 'indent': '-1' }, { 'indent': '+1' }],
// [{ 'direction': 'rtl' }],
// [{ 'size': ['small', false, 'large', 'huge'] }],
// [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
// [{ 'color': [] }, { 'background': [] }],
// [{ 'font': [] }],
// [{ 'align': [] }],
// ['clean']
// ],
uploadUrl: '',
dataForm: {
id: '',
@ -79,49 +49,12 @@ export default {
init () {
this.visible = true
this.$nextTick(() => {
// if (this.quillEditor) {
// this.quillEditor.deleteText(0, this.quillEditor.getLength())
// } else {
// this.quillEditorHandle()
// }
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
// quillEditorHandle () {
// this.quillEditor = new Quill('#J_quillEditor', {
// modules: {
// toolbar: this.quillEditorToolbarOptions
// },
// theme: 'snow'
// })
// // (使element upload)
// this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
// this.quillEditor.getModule('toolbar').addHandler('image', () => {
// this.$refs.uploadBtn.$el.click()
// })
// //
// this.quillEditor.on('text-change', () => {
// this.dataForm.actNewsContent = this.quillEditor.root.innerHTML
// })
// },
// //
// 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': 'jpgpnggif' }))
// return false
// }
// },
// //
// uploadSuccessHandle (res, file, fileList) {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url)
// },
//
getInfo () {
this.$http.get(`/heart/actinfo/${this.dataForm.id}`).then(({ data: res }) => {
@ -129,12 +62,10 @@ export default {
return this.$message.error(res.msg)
}
this.dataForm = res.data
// this.quillEditor.root.innerHTML = this.dataForm.actNewsContent
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
// console.log(this.dataForm.actNewsContent)
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false

57
src/views/modules/message/mail-template-add-or-update.vue

@ -30,31 +30,12 @@
</template>
<script>
import Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
// import 'quill/dist/quill.snow.css'
// import Quill from 'quill'
import TinymceEditor from '@/components/tinymce-editor'
export default {
data () {
return {
visible: false,
// quillEditor: null,
// quillEditorToolbarOptions: [
// ['bold', 'italic', 'underline', 'strike'],
// ['blockquote', 'code-block', 'image'],
// [{ 'header': 1 }, { 'header': 2 }],
// [{ 'list': 'ordered' }, { 'list': 'bullet' }],
// [{ 'script': 'sub' }, { 'script': 'super' }],
// [{ 'indent': '-1' }, { 'indent': '+1' }],
// [{ 'direction': 'rtl' }],
// [{ 'size': ['small', false, 'large', 'huge'] }],
// [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
// [{ 'color': [] }, { 'background': [] }],
// [{ 'font': [] }],
// [{ 'align': [] }],
// ['clean']
// ],
uploadUrl: '',
dataForm: {
id: '',
@ -93,49 +74,12 @@ export default {
init () {
this.visible = true
this.$nextTick(() => {
// if (this.quillEditor) {
// this.quillEditor.deleteText(0, this.quillEditor.getLength())
// } else {
// this.quillEditorHandle()
// }
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
// quillEditorHandle () {
// this.quillEditor = new Quill('#J_quillEditor', {
// modules: {
// toolbar: this.quillEditorToolbarOptions
// },
// theme: 'snow'
// })
// // (使element upload)
// this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
// this.quillEditor.getModule('toolbar').addHandler('image', () => {
// this.$refs.uploadBtn.$el.click()
// })
// //
// this.quillEditor.on('text-change', () => {
// this.dataForm.content = this.quillEditor.root.innerHTML
// })
// },
// //
// 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': 'jpgpnggif' }))
// return false
// }
// },
// //
// uploadSuccessHandle (res, file, fileList) {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url)
// },
//
getInfo () {
this.$http.get(`/message/mailtemplate/${this.dataForm.id}`).then(({ data: res }) => {
@ -143,7 +87,6 @@ export default {
return this.$message.error(res.msg)
}
this.dataForm = res.data
// this.quillEditor.root.innerHTML = this.dataForm.content
}).catch(() => {})
},
//

62
src/views/modules/news/allnews-add-or-update.vue

@ -81,8 +81,6 @@
<script>
import Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
// import 'quill/dist/quill.snow.css'
// import Quill from 'quill'
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './news-add-or-update'
import TinymceEditor from '@/components/tinymce-editor'
@ -120,23 +118,6 @@ export default {
options: [],
categorys: [],
loading: false,
//
// quillEditor: null,
// quillEditorToolbarOptions: [
// ['bold', 'italic', 'underline', 'strike'],
// ['blockquote', 'code-block', 'image'],
// [{ 'header': 1 }, { 'header': 2 }],
// [{ 'list': 'ordered' }, { 'list': 'bullet' }],
// [{ 'script': 'sub' }, { 'script': 'super' }],
// [{ 'indent': '-1' }, { 'indent': '+1' }],
// [{ 'direction': 'rtl' }],
// [{ 'size': ['small', false, 'large', 'huge'] }],
// [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
// [{ 'color': [] }, { 'background': [] }],
// [{ 'font': [] }],
// [{ 'align': [] }],
// ['clean']
// ],
uploadUrl: '',
// end
fileList: [],
@ -161,12 +142,6 @@ export default {
//
this.hideUpload = false
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
// if (this.quillEditor) {
// this.quillEditor.deleteText(0, this.quillEditor.getLength())
// } else {
// this.quillEditorHandle()
// }
// end
})
},
computed: {
@ -211,7 +186,6 @@ export default {
}
this.dataForm = { ...this.dataForm, ...res.data }
this.resetRegistTime()
// this.quillEditor.root.innerHTML = res.data.newsContent
if (this.dataForm.streetId) {
if (this.dataForm.communityId === 0) {
this.dataForm.communityId = this.dataForm.gridId = null
@ -276,42 +250,6 @@ export default {
this.categorys = res.data
}).catch(() => { })
},
//
// quillEditorHandle () {
// this.quillEditor = new Quill('#J_quillEditor', {
// modules: {
// toolbar: this.quillEditorToolbarOptions
// },
// readOnly: true,
// 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.newsContent = this.quillEditor.root.innerHTML
// if ((this.dataForm.newsContent).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': 'jpgpnggif' }))
// return false
// }
// },
// // ()
// uploadSuccessHandle (res, file, fileList) {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url)
// },
//
handleAvatarSuccess (res, file) {
this.loading = false

61
src/views/modules/news/allnotice-add-or-update.vue

@ -48,8 +48,6 @@
<script>
import Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
// import 'quill/dist/quill.snow.css'
// import Quill from 'quill'
import TinymceEditor from '@/components/tinymce-editor'
export default {
data () {
@ -68,22 +66,6 @@ export default {
allDeptIdsShow: []
},
value: '',
//
// quillEditor: null,
// quillEditorToolbarOptions: [
// ['bold', 'italic', 'underline', 'strike'],
// ['image'],
// [{ 'header': 1 }, { 'header': 2 }],
// [{ 'list': 'ordered' }, { 'list': 'bullet' }],
// [{ 'script': 'sub' }, { 'script': 'super' }],
// [{ 'indent': '-1' }, { 'indent': '+1' }],
// [{ 'size': ['small', false, 'large', 'huge'] }],
// [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
// [{ 'color': [] }, { 'background': [] }],
// [{ 'font': [] }],
// [{ 'align': [] }],
// ['clean']
// ],
uploadUrl: '',
// end
streetList: [],
@ -127,41 +109,6 @@ export default {
this.getDeptInfoList('street', localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))
},
methods: {
//
// quillEditorHandle () {
// this.quillEditor = new Quill('#J_quillEditor', {
// modules: {
// toolbar: this.quillEditorToolbarOptions
// },
// readOnly: true,
// theme: 'snow'
// })
// // // (使element upload)
// this.quillEditor.getModule('toolbar').addHandler('image', () => {
// this.$refs.uploadBtn.$el.click()
// })
// //
// this.quillEditor.on('text-change', () => {
// this.dataForm.noticeContent = this.quillEditor.root.innerHTML
// if ((this.dataForm.noticeContent).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': 'jpgpnggif' }))
// return false
// }
// },
// // ()
// uploadSuccessHandle (res, file, fileList) {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url)
// },
init () {
this.visible = true
this.$nextTick(() => {
@ -170,11 +117,6 @@ export default {
//
this.hideUpload = false
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
// if (this.quillEditor) {
// this.quillEditor.deleteText(0, this.quillEditor.getLength())
// } else {
// this.quillEditorHandle()
// }
// end
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
@ -191,7 +133,6 @@ export default {
return this.$message.error(res.msg)
}
this.dataForm = { ...this.dataForm, ...res.data }
// this.quillEditor.root.innerHTML = res.data.noticeContent
if (this.dataForm.streetId) {
if (this.dataForm.communityId === 0) {
this.dataForm.communityId = this.dataForm.gridId = null
@ -279,12 +220,10 @@ export default {
this.getDeptInfoList('grid', this.dataForm.communityId)
},
changeGrid (item) {
console.log(item)
//
// let choosenItem = this.gridList.filter(item => item.id === this.dataForm.gridId)[0]
// this.dataForm.grid = choosenItem.name
// this.dataForm = Object.assign(this.dataForm, { gridId: item })
console.log(this.dataForm)
}
}

62
src/views/modules/news/news-add-or-update.vue

@ -93,8 +93,6 @@
<script>
import Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
// import 'quill/dist/quill.snow.css'
// import Quill from 'quill'
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './news-add-or-update'
import TinymceEditor from '@/components/tinymce-editor'
@ -132,25 +130,7 @@ export default {
options: [],
categorys: [],
loading: false,
//
// quillEditor: null,
// quillEditorToolbarOptions: [
// ['bold', 'italic', 'underline', 'strike'],
// ['blockquote', 'code-block', 'image'],
// [{ 'header': 1 }, { 'header': 2 }],
// [{ 'list': 'ordered' }, { 'list': 'bullet' }],
// [{ 'script': 'sub' }, { 'script': 'super' }],
// [{ 'indent': '-1' }, { 'indent': '+1' }],
// [{ 'direction': 'rtl' }],
// [{ 'size': ['small', false, 'large', 'huge'] }],
// [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
// [{ 'color': [] }, { 'background': [] }],
// [{ 'font': [] }],
// [{ 'align': [] }],
// ['clean']
// ],
uploadUrl: '',
// end
fileList: [],
visible: false
}
@ -173,12 +153,6 @@ export default {
//
this.hideUpload = false
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
// if (this.quillEditor) {
// this.quillEditor.deleteText(0, this.quillEditor.getLength())
// } else {
// this.quillEditorHandle()
// }
// end
})
},
computed: {
@ -223,7 +197,6 @@ export default {
}
this.dataForm = { ...this.dataForm, ...res.data }
this.resetRegistTime()
// this.quillEditor.root.innerHTML = res.data.newsContent
if (this.dataForm.streetId) {
if (this.dataForm.communityId === 0) {
this.dataForm.communityId = this.dataForm.gridId = null
@ -288,41 +261,6 @@ export default {
this.categorys = res.data
}).catch(() => { })
},
//
// 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.newsContent = this.quillEditor.root.innerHTML
// if ((this.dataForm.newsContent).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': 'jpgpnggif' }))
// return false
// }
// },
// // ()
// uploadSuccessHandle (res, file, fileList) {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url)
// },
//
handleAvatarSuccess (res, file) {
this.loading = false

69
src/views/modules/news/news-publish.vue

@ -109,8 +109,6 @@
<script>
import Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
// import 'quill/dist/quill.snow.css'
// import Quill from 'quill'
import AddOrUpdate from './news-add-or-update'
import TinymceEditor from '@/components/tinymce-editor'
export default {
@ -140,25 +138,7 @@ export default {
options: [],
categorys: [],
loading: false,
//
// quillEditor: null,
// quillEditorToolbarOptions: [
// ['bold', 'italic', 'underline', 'strike'],
// ['blockquote', 'code-block', 'image'],
// [{ 'header': 1 }, { 'header': 2 }],
// [{ 'list': 'ordered' }, { 'list': 'bullet' }],
// [{ 'script': 'sub' }, { 'script': 'super' }],
// [{ 'indent': '-1' }, { 'indent': '+1' }],
// [{ 'direction': 'rtl' }],
// [{ 'size': ['small', false, 'large', 'huge'] }],
// [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
// [{ 'color': [] }, { 'background': [] }],
// [{ 'font': [] }],
// [{ 'align': [] }],
// ['clean']
// ],
uploadUrl: '',
// end
fileList: []
}
},
@ -184,12 +164,6 @@ export default {
//
this.hideUpload = false
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
// if (this.quillEditor) {
// this.quillEditor.deleteText(0, this.quillEditor.getLength())
// } else {
// this.quillEditorHandle()
// }
// end
})
},
computed: {
@ -274,41 +248,6 @@ export default {
this.categorys = res.data
}).catch(() => { })
},
//
// 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.newsContent = this.quillEditor.root.innerHTML
// // if ((this.dataForm.newsContent).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': 'jpgpnggif' }))
// return false
// }
// },
// // ()
// uploadSuccessHandle (res, file, fileList) {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url)
// },
setRegistTime () {
this.dataForm.newsReleaseStartTime = this.time[0]
this.dataForm.newsReleaseEndTime = this.time[1]
@ -316,9 +255,6 @@ export default {
// end
//
dataFormSubmitHandle: debounce(function () {
// if ((this.dataForm.newsContent).length > 10000) {
// return this.$message.error('')
// }
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
@ -348,7 +284,6 @@ export default {
this.dataForm.newsProperty = ''
this.visible = false
this.time = []
// this.quillEditor.root.innerHTML = ''
this.dataForm.communityId = this.dataForm.streetId = this.dataForm.gridId = null
this.communityList = this.gridList = []
}
@ -358,9 +293,6 @@ export default {
}, 1000, { 'leading': true, 'trailing': false }),
// 稿
draftDataFormSubmitHandle: debounce(function () {
// if ((this.dataForm.newsContent).length > 10000) {
// return this.$message.error('')
// }
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
@ -390,7 +322,6 @@ export default {
this.dataForm.newsProperty = ''
this.visible = false
this.time = []
// this.quillEditor.root.innerHTML = ''
this.dataForm.communityId = this.dataForm.streetId = this.dataForm.gridId = null
this.communityList = this.gridList = []
}

62
src/views/modules/news/notice-add-or-update.vue

@ -99,8 +99,6 @@
<script>
import Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
// import 'quill/dist/quill.snow.css'
// import Quill from 'quill'
import TinymceEditor from '@/components/tinymce-editor'
export default {
data () {
@ -121,25 +119,8 @@ export default {
noticeVideoUrl: ''
},
value: '',
//
// quillEditor: null,
// quillEditorToolbarOptions: [
// ['bold', 'italic', 'underline', 'strike'],
// ['image'],
// [{ 'header': 1 }, { 'header': 2 }],
// [{ 'list': 'ordered' }, { 'list': 'bullet' }],
// [{ 'script': 'sub' }, { 'script': 'super' }],
// [{ 'indent': '-1' }, { 'indent': '+1' }],
// [{ 'size': ['small', false, 'large', 'huge'] }],
// [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
// [{ 'color': [] }, { 'background': [] }],
// [{ 'font': [] }],
// [{ 'align': [] }],
// ['clean']
// ],
loading: false,
uploadUrl: '',
// end
streetList: [],
communityList: [],
gridList: [],
@ -198,40 +179,6 @@ export default {
this.getModuleCategoryList()
},
methods: {
//
// quillEditorHandle () {
// this.quillEditor = new Quill('#J_quillEditor', {
// modules: {
// toolbar: this.quillEditorToolbarOptions
// },
// theme: 'snow'
// })
// // // (使element upload)
// this.quillEditor.getModule('toolbar').addHandler('image', () => {
// this.$refs.uploadBtn.$el.click()
// })
// //
// this.quillEditor.on('text-change', () => {
// this.dataForm.noticeContent = this.quillEditor.root.innerHTML
// if ((this.dataForm.noticeContent).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': 'jpgpnggif' }))
// return false
// }
// },
// // ()
// uploadSuccessHandle (res, file, fileList) {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url)
// },
init () {
this.visible = true
this.$nextTick(() => {
@ -240,12 +187,6 @@ export default {
//
this.hideUpload = false
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
// if (this.quillEditor) {
// this.quillEditor.deleteText(0, this.quillEditor.getLength())
// } else {
// this.quillEditorHandle()
// }
// end
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
@ -262,7 +203,6 @@ export default {
return this.$message.error(res.msg)
}
this.dataForm = { ...this.dataForm, ...res.data }
// this.quillEditor.root.innerHTML = res.data.noticeContent
this.noticeCategoryList = res.data.noticeCategoriesShow
if (this.dataForm.streetId) {
if (this.dataForm.communityId === 0) {
@ -346,12 +286,10 @@ export default {
this.getDeptInfoList('grid', this.dataForm.communityId)
},
changeGrid (item) {
console.log(item)
//
// let choosenItem = this.gridList.filter(item => item.id === this.dataForm.gridId)[0]
// this.dataForm.grid = choosenItem.name
// this.dataForm = Object.assign(this.dataForm, { gridId: item })
console.log(this.dataForm)
},
handleAvatarActSuccess (res, file) {
this.loading = false

Loading…
Cancel
Save