Browse Source

格式化代码;消除全局变量报错

feature/yujt_analysis_pc
yujt 5 years ago
parent
commit
fdb03638d4
  1. 100
      src/views/modules/activity/group-add-or-update.vue
  2. 1
      src/views/modules/activity/map-select.vue
  3. 20
      src/views/modules/section/sectioncategory.vue

100
src/views/modules/activity/group-add-or-update.vue

@ -55,7 +55,7 @@
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import Cookies from "js-cookie"; import Cookies from 'js-cookie'
export default { export default {
data () { data () {
return { return {
@ -86,10 +86,10 @@ export default {
categoryCode: '', categoryCode: '',
typeKey: '' typeKey: ''
}, },
categoryOptions: [], categoryOptions: [],
options: [], options: [],
loading: false, loading: false,
uploadUrl: '' uploadUrl: ''
} }
}, },
computed: { computed: {
@ -167,16 +167,16 @@ export default {
} }
} }
}, },
created () { created () {
this.$nextTick(() => { this.$nextTick(() => {
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
}) })
}, },
methods: { methods: {
init () { init () {
// //
this.getByLoginUser() this.getByLoginUser()
this.getOptions() this.getOptions()
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
@ -197,45 +197,45 @@ export default {
} }
}).catch(() => {}) }).catch(() => {})
}, },
// //
getByLoginUser () { getByLoginUser () {
this.$http this.$http
.get(`/sys/user/deptOptions/getByLoginUser`) .get(`/sys/user/deptOptions/getByLoginUser`)
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.loading = false
this.options = res.data.options
})
.catch(() => {
this.loading = false
})
},
getOptions () {
this.$http
.get(`/property/sectioncategory/list`, { params: { sectionCode: 'interest_group' } }).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.categoryOptions = res.data
console.log(this.categoryOptions)
})
.catch(() => { })
},
deptHandleChange (value) {
this.dataForm.deptId = value.slice(-1).shift()
},
handleAvatarActSuccess (res, file) {
this.loading = false this.loading = false
this.dataForm.groupAvatar = res.data.url this.options = res.data.options
}, })
beforeAvatarUpload (file) { .catch(() => {
this.loading = true
},
handelError () {
this.loading = false this.loading = false
}, })
},
getOptions () {
this.$http
.get(`/property/sectioncategory/list`, { params: { sectionCode: 'interest_group' } }).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.categoryOptions = res.data
console.log(this.categoryOptions)
})
.catch(() => { })
},
deptHandleChange (value) {
this.dataForm.deptId = value.slice(-1).shift()
},
handleAvatarActSuccess (res, file) {
this.loading = false
this.dataForm.groupAvatar = res.data.url
},
beforeAvatarUpload (file) {
this.loading = true
},
handelError () {
this.loading = false
},
// //
dataFormSubmitHandle: debounce(function () { dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {

1
src/views/modules/activity/map-select.vue

@ -69,6 +69,7 @@ export default {
}) })
}, },
getMyLocation () { getMyLocation () {
/* global qq */
var geolocation = new qq.maps.Geolocation( var geolocation = new qq.maps.Geolocation(
'MQFBZ-LTWW6-R7XSK-MFXUQ-DVSIE-BGB4M', 'MQFBZ-LTWW6-R7XSK-MFXUQ-DVSIE-BGB4M',
'e家党群-管理端' 'e家党群-管理端'

20
src/views/modules/section/sectioncategory.vue

@ -77,20 +77,20 @@ export default {
AddOrUpdate AddOrUpdate
}, },
mounted () { mounted () {
this.getOptions(); this.getOptions()
this.getsectionCodeList(); this.getsectionCodeList()
}, },
methods: { methods: {
getsectionCodeList () { getsectionCodeList () {
this.$http.get(`/sys/dict/listSimple/function_section`) this.$http.get(`/sys/dict/listSimple/function_section`)
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.sectionCodeList = res.data this.sectionCodeList = res.data
console.log(this.sectionCodeList) console.log(this.sectionCodeList)
}) })
.catch(() => {}) .catch(() => {})
}, },
getOptions () { getOptions () {
this.$http.get('/sys/dict/listSimple/function_setcion').then(({ data: res }) => { this.$http.get('/sys/dict/listSimple/function_setcion').then(({ data: res }) => {

Loading…
Cancel
Save