Browse Source

代码整洁度 调整

feature/syp_points
zhangyongzhangyong 6 years ago
parent
commit
911c15b9dd
  1. 68
      src/views/modules/case/typicalcase-add-or-update.vue
  2. 2
      src/views/modules/heart/actbanner.vue
  3. 2
      src/views/modules/heart/actinfo-list.vue
  4. 4
      src/views/modules/heart/address-check.vue

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

@ -124,11 +124,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
})
},
@ -146,22 +141,22 @@ export default {
isAble: false,
editorOption: {
placeholder: 'Please enter it here...',
modules:{
toolbar:{
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']//
['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) {
@ -169,7 +164,7 @@ export default {
// Element-uiinput
document.querySelector('#quill-upload input').click()
} else {
this.quill.format('image', false);
this.quill.format('image', false)
}
}
}
@ -213,7 +208,7 @@ export default {
}
},
methods: {
onEditorFocus(index) {
onEditorFocus (index) {
this.imgIndex = index
},
handleChange (file) {
@ -221,7 +216,7 @@ export default {
},
back () {
this.$parent.selectComponent = 'CaseInfoList'
this.$router.push({ path: '/case-typicalcase'})
this.$router.push({ path: '/case-typicalcase' })
},
connectResponse (connectResponse) {
//
@ -242,7 +237,7 @@ export default {
this.dataForm.dynamicItem[connectResponse.caseIndex].associatedId = connectResponse.id
// Id
this.dataForm.dynamicItem[connectResponse.caseIndex].sourceGridId = connectResponse.gridId
//
//
if (connectResponse.associatedType == 0) {
this.dataForm.dynamicItem[connectResponse.caseIndex].publisherName = connectResponse.nickName
} else if (connectResponse.associatedType == 1) {
@ -268,10 +263,9 @@ export default {
this.dataForm.dynamicItem[connectResponse.caseIndex].releaseTime = connectResponse.createdTime
}
this.dataForm.dynamicItem[connectResponse.caseIndex].expressingAttitude = connectResponse.participantsNum
this.requiredFlag = true
},
addConnect(index){
addConnect (index) {
this.connectListVisible = true
this.$nextTick(() => {
this.$refs.connectList.init(index)
@ -291,10 +285,8 @@ export default {
releaseTime: '',
content: '',
expressingAttitude: ''
})
},
//
quillEditorHandle () {
this.quillEditor = new Quill('#J_quillEditor', {
@ -323,11 +315,9 @@ export default {
return false
}
},
// ()
uploadSuccessHandle (res) {
let quill = this.$refs.myQuillEditor[this.imgIndex].quill;
console.log(quill)
let quill = this.$refs.myQuillEditor[this.imgIndex].quill
if (res.code !== 0) {
return this.$message.error(res.msg)
}
@ -363,19 +353,19 @@ export default {
if (!valid) {
return false
}
if(!this.requiredFlag){
alert("请关联案例!")
if (!this.requiredFlag) {
alert('请关联案例!')
return false
}
for(let item of this.dataForm.dynamicItem) {
if(item.associatedId != '') {
for (let item of this.dataForm.dynamicItem) {
if (item.associatedId != '') {
this.dataForm.caseNumber = this.dataForm.caseNumber + 1
}
}
this.isAble = true;
this.isAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/cloudAnalysis/typicalcase', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
this.isAble = false;
this.isAble = false
return this.$message.error(res.msg)
}
this.$message({
@ -383,7 +373,7 @@ export default {
type: 'success',
duration: 500,
onClose: () => {
this.isAble = false;
this.isAble = false
this.back()
}
})
@ -399,7 +389,7 @@ export default {
},
handelError () {
this.loading = false
},
}
}
}
</script>

2
src/views/modules/heart/actbanner.vue

@ -63,7 +63,7 @@
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './actbanner-add-or-update'
import {debounce} from 'lodash'
import { debounce } from 'lodash'
export default {
mixins: [mixinViewModule],
data () {

2
src/views/modules/heart/actinfo-list.vue

@ -144,7 +144,7 @@ export default {
addAction () {
this.$parent.selectComponent = 'ActInfoAdd'
this.$router.push(
{ path: '/heart-actinfo'}
{ path: '/heart-actinfo' }
)
},
joinManage (id) {

4
src/views/modules/heart/address-check.vue

@ -30,8 +30,8 @@ export default {
visible: false,
dataForm: {
address: '',
longitude: 0,//
latitude: 0,//
longitude: 0, //
latitude: 0, //
city: ''
}
}

Loading…
Cancel
Save