diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index d7151fe..4d41659 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -62,7 +62,7 @@ export default { }, methods: { local_ops_func: function() { - this.local_ops = this.$store.getters.opts.filter(item => item.name !='user') + this.local_ops = this.$store.getters.opts.filter(item => item.name !='user' && item.name != 'instrument') }, toggleSideBar() { this.$store.dispatch('app/toggleSideBar') diff --git a/src/views/home/index.vue b/src/views/home/index.vue index bcefaef..a98a959 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -10,7 +10,7 @@
-
+
diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 914be64..48af916 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -194,7 +194,10 @@ export default { this.$message.success(res.msg) const { user_info, token } = res.data this.$store.commit('user/SET_ROLE_NAME', user_info.role_name) - this.$store.commit('user/SET_AVATAR', user_info.avatar_url || user_info.avatar_base64) + if (user_info.avatar_url){ + this.$store.commit('user/SET_AVATAR', process.env.VUE_APP_FACE_API + '/' +user_info.avatar_url) + } + this.$store.commit('user/SET_NAME', user_info.real_name) this.$store.commit('user/SET_TOKEN', token) this.$store.dispatch('permission/generateRoutes') @@ -249,7 +252,10 @@ export default { } const { user_info, token } = res.data this.$store.commit('user/SET_ROLE_NAME', user_info.role_name) - this.$store.commit('user/SET_AVATAR', user_info.avatar_url || user_info.avatar_base64) + if (user_info.avatar_url){ + this.$store.commit('user/SET_AVATAR', process.env.VUE_APP_FACE_API + '/' +user_info.avatar_url) + } + // this.$store.commit('user/SET_AVATAR', user_info.avatar_url) this.$store.commit('user/SET_NAME', user_info.real_name) this.$store.commit('user/SET_TOKEN', token) this.$store.dispatch('permission/generateRoutes') diff --git a/src/views/reagent/report/reagentinfo/index.vue b/src/views/reagent/report/reagentinfo/index.vue index 255efaa..1510322 100644 --- a/src/views/reagent/report/reagentinfo/index.vue +++ b/src/views/reagent/report/reagentinfo/index.vue @@ -16,7 +16,7 @@ 搜索
- 导出报告 + 导出报告
diff --git a/src/views/reagent/report/usefrequency/index.vue b/src/views/reagent/report/usefrequency/index.vue index 41a7712..d04a393 100644 --- a/src/views/reagent/report/usefrequency/index.vue +++ b/src/views/reagent/report/usefrequency/index.vue @@ -30,7 +30,7 @@ 搜索
- 导出报告 + 导出报告
diff --git a/src/views/user/index.vue b/src/views/user/index.vue index 0dbfc0f..4596386 100644 --- a/src/views/user/index.vue +++ b/src/views/user/index.vue @@ -202,7 +202,7 @@ - + - + diff --git a/src/views/userinfo/index.vue b/src/views/userinfo/index.vue index 8dfc7ed..5cc5f29 100644 --- a/src/views/userinfo/index.vue +++ b/src/views/userinfo/index.vue @@ -5,7 +5,37 @@
- +
+ +
+ + + + + +
+ 普通上传 + 拍照上传 +
+ +
@@ -47,7 +77,7 @@ import { update_password, getinfo } from '@/api/common' import stringify from '@/utils/stringify' import UserForm from '@/components/UserForm' -import { get_role_name_list, update } from '@/api/user/user' +import { get_role_name_list, update, paizhao_upload_header_img } from '@/api/user/user' export default { name: 'User', components: { UserForm }, @@ -72,8 +102,11 @@ export default { } } return { + ImgVisible:false, pdata: {}, - circleUrl: 'https://t7.baidu.com/it/u=2006997523,200382512&fm=193&f=GIF', + circleUrl: '', + UPLOAD_URL: process.env.VUE_APP_FACE_API + '/user/upload', + fileList:[], activeName: 'first', roledata: [], loading: false, @@ -104,10 +137,53 @@ export default { this.getUserInfo() }, methods: { + ptUpload() { + this.$refs['upload'].$children[0].$refs.input.click(); + }, + paiZhaoupload() { + const loading = this.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); + paizhao_upload_header_img().then(rsp => { + this.circleUrl = process.env.VUE_APP_FACE_API + `/${rsp.data}` + this.pdata.avatar_url = rsp.data + loading.close() + this.ImgVisible = false + }) + + }, + clickUpload () { + this.ImgVisible=true + }, + handleImageClose() { + this.ImgVisible = false + }, + handleAvatarSuccess(res, file) { + // this.$store.commit('user/SET_AVATAR', process.env.VUE_APP_BASE_API + `/${res.data}`) + this.pdata.avatar_url = res.data + this.circleUrl = process.env.VUE_APP_FACE_API + `/${res.data}` + this.ImgVisible = false + }, + beforeAvatarUpload(file) { + const isJPG = file.type === 'image/jpeg'; + const isLt2M = file.size / 1024 / 1024 < 2; + + if (!isJPG) { + this.$message.error('上传头像图片只能是 JPG 格式!'); + } + if (!isLt2M) { + this.$message.error('上传头像图片大小不能超过 2MB!'); + } + return isJPG && isLt2M; + }, getUserInfo() { this.loading = true getinfo().then(res => { this.pdata = res.data + this.circleUrl = process.env.VUE_APP_FACE_API +'/' +res.data.avatar_url }).finally(() => { this.loading = false }) }, submitForm(formName) { @@ -129,7 +205,10 @@ export default { this.dialogVisible = false this.getUserInfo() this.$store.commit('user/SET_ROLE_NAME', this.pdata.role_name) - this.$store.commit('user/SET_AVATAR', this.pdata.avatar_url || this.pdata.avatar_base64) + // this.$store.commit('user/SET_AVATAR', this.pdata.avatar_url) + if (this.pdata.avatar_url){ + this.$store.commit('user/SET_AVATAR', process.env.VUE_APP_FACE_API + '/' +this.pdata.avatar_url) + } this.$store.commit('user/SET_NAME', this.pdata.real_name) }) },