yujialong 3 years ago
parent 1269387c83
commit 0c8fb7a6b4
  1. 4
      src/api/index.js
  2. 10
      src/layouts/header/index.vue
  3. 4
      src/pages/account/login/index.vue
  4. 5
      src/pages/data/list/index.vue
  5. 8
      src/pages/setting/person/download.vue
  6. 2
      src/pages/setting/person/index.vue
  7. 83
      src/pages/setting/person/info.vue
  8. 12
      src/pages/stat/list/index.vue
  9. 29
      src/pages/user/list/index.vue
  10. 2
      src/setting.js
  11. 4
      src/store/modules/user.js

@ -1,6 +1,6 @@
import Setting from '@/setting' import Setting from '@/setting'
let uploadURL = Setting.upload.apiURL let uploadURL = Setting.upload.apiURL
let host = 'http://www.liuwanr.cn' let host = 'http://39.108.250.202:9000'//
let host1 = 'http://192.168.31.125:9000'//林 let host1 = 'http://192.168.31.125:9000'//林
let host2 = 'http://192.168.31.140:9000'//7 let host2 = 'http://192.168.31.140:9000'//7
let host3 = 'http://192.168.31.137:9000'//陈 let host3 = 'http://192.168.31.137:9000'//陈
@ -21,7 +21,7 @@ export default {
queryCourseProfessional: `/nakadai/nakadai/professional/queryProfessional`, queryCourseProfessional: `/nakadai/nakadai/professional/queryProfessional`,
// 个人中心 // 个人中心
uploadUserAvatars: `/users/users/userAccount/updateUserAvatars`, uploadUserAvatars: `${Setting.apiBaseURL}/users/users/userAccount/updateUserAvatars`,
userInfo:`/users/users/userInfo/getUserInfo`, userInfo:`/users/users/userInfo/getUserInfo`,
updateUser:`/users/users/userInfo/updateUser`, updateUser:`/users/users/userInfo/updateUser`,
findPasswordByEmail:`/users/users/userAccount/findPasswordByEmail`, findPasswordByEmail:`/users/users/userAccount/findPasswordByEmail`,

@ -41,9 +41,10 @@ export default {
return { return {
token: util.local.get(Setting.tokenKey), token: util.local.get(Setting.tokenKey),
isLogin: this.$route.path == '/login', isLogin: this.$route.path == '/login',
customer: this.$route.query.customer,
userName: '', userName: '',
isUser: false, isUser: false,
showSetting: true showSetting: true,
}; };
}, },
components: { navbar }, components: { navbar },
@ -56,11 +57,15 @@ export default {
]) ])
}, },
mounted(){ mounted(){
if(this.customer){
let customer = Boolean(atob(decodeURI(this.customer)))
this.setCustomer(customer)
}
this.token && this.getUserInfo() this.token && this.getUserInfo()
}, },
methods: { methods: {
...mapActions('user', [ ...mapActions('user', [
'setInfo','logout','setManager' 'setInfo','logout','setManager','setCustomer'
]), ]),
getUserInfo(){ getUserInfo(){
this.$get(this.api.userInfo).then(res => { this.$get(this.api.userInfo).then(res => {
@ -107,6 +112,7 @@ export default {
query: { query: {
mg: btoa(true), mg: btoa(true),
schoolId: btoa(this.schoolId), schoolId: btoa(this.schoolId),
customer: btoa(this.isCustomer)
} }
}) })
window.open(route.href) window.open(route.href)

@ -93,7 +93,7 @@ export default {
}, },
methods: { methods: {
...mapActions('user', [ ...mapActions('user', [
'login','setToken' 'login','setCustomer'
]), ]),
typeClick(item){ typeClick(item){
this.form.account = '' this.form.account = ''
@ -181,7 +181,7 @@ export default {
this.form.phone = this.phone this.form.phone = this.phone
this.phoneVisible = false this.phoneVisible = false
this.setToken(res.token) this.setCustomer(res.customer)
util.local.set(Setting.tokenKey,res.token,43200000) util.local.set(Setting.tokenKey,res.token,43200000)
util.successMsg('登录成功') util.successMsg('登录成功')
setTimeout(() => { setTimeout(() => {

@ -134,9 +134,11 @@
import { mapState } from 'vuex' import { mapState } from 'vuex'
import axios from 'axios' import axios from 'axios'
import util from '@/libs/util' import util from '@/libs/util'
import Setting from '@/setting'
export default { export default {
data() { data() {
return { return {
token: util.local.get(Setting.tokenKey),
typeId: this.$route.query.typeId, typeId: this.$route.query.typeId,
typeList: [], typeList: [],
defaultType: '', defaultType: '',
@ -350,6 +352,9 @@ export default {
let endTime = this.endTime ? this.endTime : '' let endTime = this.endTime ? this.endTime : ''
let frequency = this.frequency let frequency = this.frequency
axios.get(`${this.api.downloadData}?tableName=${this.curRow.name}&table_id=${this.curRow.id}&fields=${newFields.join()}&startTime=${startTime}&endTime=${endTime}&frequency=${frequency}`,{ axios.get(`${this.api.downloadData}?tableName=${this.curRow.name}&table_id=${this.curRow.id}&fields=${newFields.join()}&startTime=${startTime}&endTime=${endTime}&frequency=${frequency}`,{
headers: {
token: this.token
},
responseType: 'blob' responseType: 'blob'
}).then((res) => { }).then((res) => {
msgObj.close() msgObj.close()

@ -32,12 +32,13 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import util from '@/libs/util' import util from '@/libs/util'
import Setting from '@/setting'
import axios from 'axios' import axios from 'axios'
export default { export default {
name: 'role', name: 'role',
data() { data() {
return { return {
schoolId: 1001, token: util.local.get(Setting.tokenKey),
keyword: '', keyword: '',
searchTimer: null, searchTimer: null,
isDetail: false, isDetail: false,
@ -50,7 +51,7 @@ export default {
}, },
computed: { computed: {
...mapState('user', [ ...mapState('user', [
'userId','clientId' 'userId','clientId','schoolId'
]) ])
}, },
watch: { watch: {
@ -89,6 +90,9 @@ export default {
let msgObj = util.successMsg('数据正在生成中,请稍等片刻,生成后会自动下载,您可以先访问其他页面。',5000) let msgObj = util.successMsg('数据正在生成中,请稍等片刻,生成后会自动下载,您可以先访问其他页面。',5000)
axios.get(`${this.api.downloadData}?tableName=${row.tableNme}&table_id=${row.id}&fields=${row.fields}&startTime=${row.startTime ? row.startTime : ''}&endTime=${row.endTime ? row.endTime : ''}&frequency=${row.frequency ? row.frequency : ''}`,{ axios.get(`${this.api.downloadData}?tableName=${row.tableNme}&table_id=${row.id}&fields=${row.fields}&startTime=${row.startTime ? row.startTime : ''}&endTime=${row.endTime ? row.endTime : ''}&frequency=${row.frequency ? row.frequency : ''}`,{
headers: {
token: this.token
},
responseType: 'blob' responseType: 'blob'
}).then(res => { }).then(res => {
msgObj.close() msgObj.close()

@ -5,7 +5,7 @@
<div class="inner"> <div class="inner">
<div class="text-center"> <div class="text-center">
<img :src="avatar" class="avatar" /> <img :src="avatar" class="avatar" />
<el-upload :headers="{token}" :action="this.api.uploadUserAvatars" name="file" :limit="1" :on-success="changeAvatar"> <el-upload :headers="{token}" :action="this.api.uploadUserAvatars" name="file" :limit="10" :show-file-list="false" :on-success="changeAvatar">
<el-button type="text" size="small">上传头像</el-button> <el-button type="text" size="small">上传头像</el-button>
</el-upload> </el-upload>
</div> </div>

@ -349,45 +349,6 @@ export default {
...mapActions('user', [ ...mapActions('user', [
'setAvatar','setInfo' 'setAvatar','setInfo'
]), ]),
tabChange(index){
this.active = index
},
getProvince(){
this.$get(this.api.queryProvince).then(res => {
this.provinceList = res.list
}).catch(res => {})
},
getCity(id,type){
this.form.cityId = 1
this.getCityData()
},
getCityData(index){
let provinceId = this.form.provinceId
this.$get(this.api.queryCity,{provinceId}).then(res => {
this.cityList = res.list
}).catch(res => {})
},
getCityName(id,index){
this.archivesList[index].cityName = this.archivesList[index].cityList[id-1].cityName
},
getSchoolName(id,index){
this.archivesList[index].schoolName = this.schoolList[id-1].schoolName
},
getSchoolData(){
this.$get(this.api.querySchool,{schoolName: '',provinceId: this.provinceId,cityId: this.cityId}).then(res => {
this.schoolList = res.list
}).catch(res => {})
},
accountChange(){
this.$get(`${this.api.getAccount}?account=${this.form.account}`).then(res => {
if(res.data.userInfo){
this.accountRepeat = true
util.warningMsg('该账号已存在')
}else{
this.accountRepeat = false
}
}).catch(res => {})
},
getdata() { getdata() {
this.$get(this.api.userInfo).then(res => { this.$get(this.api.userInfo).then(res => {
let userInfo = res.userInfo let userInfo = res.userInfo
@ -432,6 +393,42 @@ export default {
}) })
}).catch(err => {}) }).catch(err => {})
}, },
getProvince(){
this.$get(this.api.queryProvince).then(res => {
this.provinceList = res.list
}).catch(res => {})
},
getCity(id,type){
this.form.cityId = 1
this.getCityData()
},
getCityData(index){
let provinceId = this.form.provinceId
this.$get(this.api.queryCity,{provinceId}).then(res => {
this.cityList = res.list
}).catch(res => {})
},
getCityName(id,index){
this.archivesList[index].cityName = this.archivesList[index].cityList[id-1].cityName
},
getSchoolName(id,index){
this.archivesList[index].schoolName = this.schoolList[id-1].schoolName
},
getSchoolData(){
this.$get(this.api.querySchool,{schoolName: '',provinceId: this.provinceId,cityId: this.cityId}).then(res => {
this.schoolList = res.list
}).catch(res => {})
},
accountChange(){
this.$get(`${this.api.getAccount}?account=${this.form.account}`).then(res => {
if(res.data.userInfo){
this.accountRepeat = true
util.warningMsg('该账号已存在')
}else{
this.accountRepeat = false
}
}).catch(res => {})
},
save() { save() {
if(this.form.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.form.idNumber)) return util.warningMsg('请输入正确的证件号码') if(this.form.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.form.idNumber)) return util.warningMsg('请输入正确的证件号码')
if(this.accountRepeat) return util.warningMsg('该账号已存在') if(this.accountRepeat) return util.warningMsg('该账号已存在')
@ -456,7 +453,7 @@ export default {
let data = { let data = {
hrUserAccount: { hrUserAccount: {
account: form.account, account: form.account,
userId: form.userId, id: form.id,
workNumber: form.workNumber, workNumber: form.workNumber,
}, },
hrUserInfo: { hrUserInfo: {
@ -634,12 +631,6 @@ export default {
clearItemProfess(index){ clearItemProfess(index){
this.archivesList[index].professionalId = '' this.archivesList[index].professionalId = ''
this.archivesList[index].professionalName = '' this.archivesList[index].professionalName = ''
// this.archivesList.map(e =>{
// if(e.professionalClassId == item){
// e.professionalId = '',
// e.professionalName = ''
// }
// })
}, },
getItemProfessional(item,index){ getItemProfessional(item,index){
this.clearItemProfess(index) this.clearItemProfess(index)

@ -111,7 +111,7 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex' import { mapState, mapActions } from 'vuex'
import Setting from '@/setting' import Setting from '@/setting'
import axios from 'axios' import axios from 'axios'
import util from '@/libs/util' import util from '@/libs/util'
@ -177,9 +177,19 @@ export default {
} }
}, },
mounted() { mounted() {
if(!this.schoolId){
let schoolId = this.$route.query.schoolId
if(schoolId) schoolId = atob(decodeURI(schoolId))
this.setInfo({
schoolId
})
}
this.getData() this.getData()
}, },
methods: { methods: {
...mapActions('user', [
'setInfo'
]),
getData(){ getData(){
this.$get(`${this.api.getProductInfoBySchoolId}?schoolId=${this.schoolId}`).then(res => { this.$get(`${this.api.getProductInfoBySchoolId}?schoolId=${this.schoolId}`).then(res => {
let list = res.message let list = res.message

@ -325,13 +325,10 @@ export default {
accountChange(){ accountChange(){
if(this.form.account !== this.originalAccount){ if(this.form.account !== this.originalAccount){
this.$get(`${this.api.checkAccount}?account=${this.form.account}&type=1&platformId=${Setting.platformId}`).then(res => { this.$get(`${this.api.checkAccount}?account=${this.form.account}&type=1&platformId=${Setting.platformId}`).then(res => {
if(res.status == 200){ this.accountRepeat = false
this.accountRepeat = false }).catch(res => {
}else{ this.accountRepeat = true
this.accountRepeat = true })
util.warningMsg('该账号已存在')
}
}).catch(res => {})
}else{ }else{
this.accountRepeat = false this.accountRepeat = false
} }
@ -339,13 +336,10 @@ export default {
workNumberChange(){ workNumberChange(){
if(this.form.workNumber !== this.originalWorkNumber){ if(this.form.workNumber !== this.originalWorkNumber){
this.$get(`${this.api.checkAccount}?workNumber=${this.form.workNumber}&type=2&platformId=${Setting.platformId}`).then(res => { this.$get(`${this.api.checkAccount}?workNumber=${this.form.workNumber}&type=2&platformId=${Setting.platformId}`).then(res => {
if(res.status == 200){ this.workNumberRepeat = false
this.workNumberRepeat = false }).catch(res => {
}else{ this.workNumberRepeat = true
this.workNumberRepeat = true })
util.warningMsg('该工号已存在')
}
}).catch(res => {})
}else{ }else{
this.workNumberRepeat = false this.workNumberRepeat = false
} }
@ -357,7 +351,6 @@ export default {
addTeacher(){ addTeacher(){
this.isDetail = false this.isDetail = false
this.userVisible = true this.userVisible = true
this.isAddteacher = true
}, },
getDetail(accountId){ getDetail(accountId){
this.userVisible = true this.userVisible = true
@ -376,7 +369,6 @@ export default {
email: data.email, email: data.email,
schoolId: data.schoolId, schoolId: data.schoolId,
password: '', password: '',
isEnable: data.isEnable
} }
this.originalAccount = data.account this.originalAccount = data.account
this.originalWorkNumber = data.workNumber this.originalWorkNumber = data.workNumber
@ -384,7 +376,6 @@ export default {
}, },
edit(row){ edit(row){
this.isDetail = false this.isDetail = false
this.isAddteacher = false
this.getDetail(row.accountId) this.getDetail(row.accountId)
}, },
show(row){ show(row){
@ -394,8 +385,8 @@ export default {
confirm(){ confirm(){
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
if(this.accountRepeat) return util.warningMsg('该账号已存在') if(this.accountRepeat) return util.errorMsg('该账号已存在')
if(this.workNumberRepeat) return util.warningMsg('该工号已存在') if(this.workNumberRepeat) return util.errorMsg('该工号已存在')
let data = this.form let data = this.form
data.schoolId = data.schoolId ? data.schoolId : this.schoolId data.schoolId = data.schoolId ? data.schoolId : this.schoolId
if(!data.userId) data.uniqueIdentification = new Date().getTime() if(!data.userId) data.uniqueIdentification = new Date().getTime()

@ -24,7 +24,7 @@ const Setting = {
// Cookies 默认保存时间,单位:天 // Cookies 默认保存时间,单位:天
cookiesExpires: 1, cookiesExpires: 1,
/** /**
* 免登录保存的token的key * token的key
*/ */
tokenKey: 'data_token', tokenKey: 'data_token',
/** /**

@ -78,8 +78,8 @@ export default {
setManager({ state,commit },isManager) { setManager({ state,commit },isManager) {
commit('SET_MANAGER',isManager) commit('SET_MANAGER',isManager)
}, },
setToken({ state,commit },token) { setCustomer({ state,commit },isCustomer) {
commit('SET_CUSTOMER',token) commit('SET_CUSTOMER',isCustomer)
}, },
} }
} }
Loading…
Cancel
Save