|
|
@ -55,7 +55,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import debounce from 'lodash/debounce' |
|
|
|
import Cookies from "js-cookie"; |
|
|
|
import Cookies from 'js-cookie' |
|
|
|
export default { |
|
|
|
data () { |
|
|
|
return { |
|
|
@ -86,10 +86,10 @@ export default { |
|
|
|
categoryCode: '', |
|
|
|
typeKey: '' |
|
|
|
}, |
|
|
|
categoryOptions: [], |
|
|
|
options: [], |
|
|
|
loading: false, |
|
|
|
uploadUrl: '' |
|
|
|
categoryOptions: [], |
|
|
|
options: [], |
|
|
|
loading: false, |
|
|
|
uploadUrl: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -167,16 +167,16 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
created () { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` |
|
|
|
}) |
|
|
|
}, |
|
|
|
created () { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
init () { |
|
|
|
// 获取下拉菜单 |
|
|
|
this.getByLoginUser() |
|
|
|
this.getOptions() |
|
|
|
// 获取下拉菜单 |
|
|
|
this.getByLoginUser() |
|
|
|
this.getOptions() |
|
|
|
this.visible = true |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['dataForm'].resetFields() |
|
|
@ -197,45 +197,45 @@ export default { |
|
|
|
} |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
// 获取部门 |
|
|
|
getByLoginUser () { |
|
|
|
this.$http |
|
|
|
.get(`/sys/user/deptOptions/getByLoginUser`) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
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) { |
|
|
|
// 获取部门 |
|
|
|
getByLoginUser () { |
|
|
|
this.$http |
|
|
|
.get(`/sys/user/deptOptions/getByLoginUser`) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.loading = false |
|
|
|
this.dataForm.groupAvatar = res.data.url |
|
|
|
}, |
|
|
|
beforeAvatarUpload (file) { |
|
|
|
this.loading = true |
|
|
|
}, |
|
|
|
handelError () { |
|
|
|
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.dataForm.groupAvatar = res.data.url |
|
|
|
}, |
|
|
|
beforeAvatarUpload (file) { |
|
|
|
this.loading = true |
|
|
|
}, |
|
|
|
handelError () { |
|
|
|
this.loading = false |
|
|
|
}, |
|
|
|
// 表单提交 |
|
|
|
dataFormSubmitHandle: debounce(function () { |
|
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
|