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. 21
      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'
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 host2 = 'http://192.168.31.140:9000'//7
let host3 = 'http://192.168.31.137:9000'//陈
@ -21,7 +21,7 @@ export default {
queryCourseProfessional: `/nakadai/nakadai/professional/queryProfessional`,
// 个人中心
uploadUserAvatars: `/users/users/userAccount/updateUserAvatars`,
uploadUserAvatars: `${Setting.apiBaseURL}/users/users/userAccount/updateUserAvatars`,
userInfo:`/users/users/userInfo/getUserInfo`,
updateUser:`/users/users/userInfo/updateUser`,
findPasswordByEmail:`/users/users/userAccount/findPasswordByEmail`,

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

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

@ -134,9 +134,11 @@
import { mapState } from 'vuex'
import axios from 'axios'
import util from '@/libs/util'
import Setting from '@/setting'
export default {
data() {
return {
token: util.local.get(Setting.tokenKey),
typeId: this.$route.query.typeId,
typeList: [],
defaultType: '',
@ -350,6 +352,9 @@ export default {
let endTime = this.endTime ? this.endTime : ''
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}`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
msgObj.close()

@ -32,12 +32,13 @@
<script>
import { mapState } from 'vuex'
import util from '@/libs/util'
import Setting from '@/setting'
import axios from 'axios'
export default {
name: 'role',
data() {
return {
schoolId: 1001,
token: util.local.get(Setting.tokenKey),
keyword: '',
searchTimer: null,
isDetail: false,
@ -50,7 +51,7 @@ export default {
},
computed: {
...mapState('user', [
'userId','clientId'
'userId','clientId','schoolId'
])
},
watch: {
@ -89,6 +90,9 @@ export default {
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 : ''}`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then(res => {
msgObj.close()

@ -5,7 +5,7 @@
<div class="inner">
<div class="text-center">
<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-upload>
</div>

@ -349,45 +349,6 @@ export default {
...mapActions('user', [
'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() {
this.$get(this.api.userInfo).then(res => {
let userInfo = res.userInfo
@ -432,6 +393,42 @@ export default {
})
}).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() {
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('该账号已存在')
@ -456,7 +453,7 @@ export default {
let data = {
hrUserAccount: {
account: form.account,
userId: form.userId,
id: form.id,
workNumber: form.workNumber,
},
hrUserInfo: {
@ -634,12 +631,6 @@ export default {
clearItemProfess(index){
this.archivesList[index].professionalId = ''
this.archivesList[index].professionalName = ''
// this.archivesList.map(e =>{
// if(e.professionalClassId == item){
// e.professionalId = '',
// e.professionalName = ''
// }
// })
},
getItemProfessional(item,index){
this.clearItemProfess(index)

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

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

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

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