yujialong 4 years ago
parent 0c8fb7a6b4
commit 1bf612f841
  1. 4
      src/api/index.js
  2. 64
      src/layouts/header/index.vue
  3. 113
      src/pages/data/list/index.vue
  4. 13
      src/pages/index/list/index.vue
  5. 6
      src/pages/role/list/index.vue
  6. 4
      src/pages/setting/person/download.vue
  7. 25
      src/pages/setting/person/info.vue
  8. 2
      src/pages/user/list/index.vue
  9. 6
      src/router/modules/setting.js
  10. 2
      src/setting.js

@ -84,8 +84,8 @@ export default {
queryDatabaseInfo:`/data/data/dataRecord/queryDatabaseInfo`, queryDatabaseInfo:`/data/data/dataRecord/queryDatabaseInfo`,
queryDatabaseInfoByMonth:`/data/data/dataRecord/queryDatabaseInfoByMonth`, queryDatabaseInfoByMonth:`/data/data/dataRecord/queryDatabaseInfoByMonth`,
saveRecord:`/data/data/dataRecord/saveRecord`, saveRecord:`/data/data/dataRecord/saveRecord`,
databaseInfoExport:`/data/data/dataRecord/databaseInfoExport`, databaseInfoExport:`${Setting.apiBaseURL}/data/data/dataRecord/databaseInfoExport`,
databaseInfoByMonthExport:`/data/data/dataRecord/databaseInfoByMonthExport`, databaseInfoByMonthExport:`${Setting.apiBaseURL}/data/data/dataRecord/databaseInfoByMonthExport`,
onlineNumber:`/data/data/dataRecord/onlineNumber`, onlineNumber:`/data/data/dataRecord/onlineNumber`,
getProductInfoBySchoolId:`/data/data/product/getProductInfoBySchoolId`, getProductInfoBySchoolId:`/data/data/product/getProductInfoBySchoolId`,
} }

@ -15,6 +15,10 @@
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="person" v-if="!isCustomer">个人资料</el-dropdown-item> <el-dropdown-item command="person" v-if="!isCustomer">个人资料</el-dropdown-item>
<template v-else>
<el-dropdown-item command="resetPw">修改密码</el-dropdown-item>
<el-dropdown-item command="myDownload">我的下载</el-dropdown-item>
</template>
<el-dropdown-item command="logout">退出登录</el-dropdown-item> <el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
@ -29,6 +33,24 @@
<img class="search" src="../../assets/img/search.png" alt="" @click="toSearch"> <img class="search" src="../../assets/img/search.png" alt="" @click="toSearch">
</div> </div>
</div> </div>
<el-dialog title="修改密码" :visible.sync="passwordVisible" :close-on-click-modal="false" @close="closePassword" width="30%">
<el-form ref="passwordForm" label-width="60px">
<el-form-item label="原密码">
<el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input>
</el-form-item>
<el-form-item label="新密码">
<el-input type="password" v-model="passwordForm.newPassword" placeholder="请输入新密码" @keyup.enter.native="editPassword"></el-input>
</el-form-item>
<el-form-item label="新密码">
<el-input type="password" v-model="passwordForm.reNewPassword" placeholder="请确认新密码" @keyup.enter.native="editPassword"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="passwordVisible = false"> </el-button>
<el-button size="small" type="primary" @click="editPassword"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
@ -45,6 +67,13 @@ export default {
userName: '', userName: '',
isUser: false, isUser: false,
showSetting: true, showSetting: true,
id: '',
passwordVisible: false,
passwordForm: {
password: '',
newPassword: '',
reNewPassword: ''
},
}; };
}, },
components: { navbar }, components: { navbar },
@ -58,7 +87,7 @@ export default {
}, },
mounted(){ mounted(){
if(this.customer){ if(this.customer){
let customer = Boolean(atob(decodeURI(this.customer))) let customer = atob(decodeURI(this.customer)) == 'false' ? false : true
this.setCustomer(customer) this.setCustomer(customer)
} }
this.token && this.getUserInfo() this.token && this.getUserInfo()
@ -78,7 +107,7 @@ export default {
this.showSetting = false this.showSetting = false
} }
this.userName = userAccount.account this.userName = userAccount.account
this.id = userAccount.id
this.setInfo({ this.setInfo({
avatar: userInfo.userAvatars, avatar: userInfo.userAvatars,
schoolId: userAccount.schoolId, schoolId: userAccount.schoolId,
@ -123,10 +152,39 @@ export default {
userCommand(command){ userCommand(command){
if(command == 'person'){ if(command == 'person'){
this.$router.push('/setting/person') this.$router.push('/setting/person')
}else if(command == 'resetPw'){
this.showPassword()
}else if(command == 'myDownload'){
this.$router.push('/setting/download')
}else{ }else{
this.logout() this.logout()
} }
} },
showPassword() {
this.passwordVisible = true
},
editPassword() {
if(!this.passwordForm.password) return util.warningMsg('请输入原密码')
if(!this.passwordForm.newPassword) return util.warningMsg('请输入新密码')
if(!this.passwordForm.reNewPassword) return util.warningMsg('请确认新密码')
if(this.passwordForm.newPassword.length < 6 || this.passwordForm.reNewPassword.length < 6) return util.warningMsg('请输入6位数以上的密码')
if(this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return util.warningMsg('输入的新密码不一致,请重新确认')
if(this.passwordForm.password === this.passwordForm.newPassword) return util.warningMsg('原密码跟新密码不能一致')
let data = this.passwordForm
data.accountId = this.id
this.$post(this.api.examinePassword,data).then(res => {
util.successMsg('修改成功')
this.passwordVisible = false
}).catch(err => {})
},
closePassword() {
this.passwordForm = {
password: '',
newPassword: '',
reNewPassword: ''
}
},
}, },
}; };
</script> </script>

@ -1,7 +1,7 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<div class="left"> <div class="left">
<el-menu class="menu" ref="type" @open="handleOpen" @close="handleClose" @select="selectType" unique-opened :default-active="defaultType" :default-openeds="defaultOpenType"> <el-menu class="menu" ref="type" @open="openType" @select="selectType" unique-opened :default-active="defaultType" :default-openeds="defaultOpenType">
<template v-for="item in typeList"> <template v-for="item in typeList">
<!-- 如果第一层有子菜单则继续循环 --> <!-- 如果第一层有子菜单则继续循环 -->
<template v-if="item.children.length"> <template v-if="item.children.length">
@ -75,7 +75,11 @@
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="showName" label="数据表名称" align="center"></el-table-column> <el-table-column prop="showName" label="数据表名称" align="center"></el-table-column>
<el-table-column prop="dataTotal" label="数据总量" align="center"></el-table-column> <el-table-column prop="dataTotal" label="数据总量" align="center"></el-table-column>
<el-table-column prop="dataSize" label="数据大小" align="center"></el-table-column> <el-table-column prop="dataSize" label="数据大小" align="center">
<template slot-scope="scope">
{{scope.row.dataSize}}M
</template>
</el-table-column>
<el-table-column prop="updateTime" label="更新时间" align="center"></el-table-column> <el-table-column prop="updateTime" label="更新时间" align="center"></el-table-column>
<el-table-column label="操作" width="220" align="center"> <el-table-column label="操作" width="220" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -245,6 +249,21 @@ export default {
this.page = 1 this.page = 1
this.getData() this.getData()
}, },
openType(index,indexPath){
let typeList = this.typeList
let firstChild = typeList.find(n => n.id == index)
let id = ''
if(firstChild){
id = firstChild.children[0].id
}else{
typeList.map(n => {
n.children.map(n => {
if(n.id == index) id = n.children[0].id
})
})
}
this.selectType(id,indexPath)
},
preview(row){ preview(row){
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => { this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
this.$post(this.api.saveRecord,{ this.$post(this.api.saveRecord,{
@ -271,16 +290,21 @@ export default {
this.fields = val ? this.fieldsList.map(n => n.comment) : [] this.fields = val ? this.fieldsList.map(n => n.comment) : []
}, },
download(row){ download(row){
this.curRow = row this.$get(`${this.api.isDownload}`,{
this.downloadVisible = true tableId: row.id,
schoolId: this.schoolId,
}).then(res => {
this.curRow = row
this.downloadVisible = true
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => { this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
let comment = res.comment let comment = res.comment
let fieldsList = [] let fieldsList = []
comment.map(n => { comment.map(n => {
n.field != 'id' && n.field != 'operation_time' && fieldsList.push(n) n.field != 'id' && n.field != 'operation_time' && fieldsList.push(n)
}) })
this.fieldsList = fieldsList this.fieldsList = fieldsList
}).catch(res => {})
}).catch(res => {}) }).catch(res => {})
}, },
closeDownload(){ closeDownload(){
@ -290,12 +314,6 @@ export default {
this.endTime = '' this.endTime = ''
this.frequency = '' this.frequency = ''
this.$router.push('/data').catch(err => {}) this.$router.push('/data').catch(err => {})
},
handleOpen(){
},
handleClose(){
}, },
confirmDown(){ confirmDown(){
let fields = this.fields let fields = this.fields
@ -334,43 +352,36 @@ export default {
if(invalid) return util.warningMsg('请选择完整区间') if(invalid) return util.warningMsg('请选择完整区间')
this.$get(`${this.api.isDownload}`,{ let newFields = []
tableId: this.curRow.id, let fieldsList = this.fieldsList
schoolId: this.schoolId, fields.map(n => {
}).then(res => { newFields.push(fieldsList.find(e => e.comment == n).field)
if(res.status != 200) return util.warningMsg(res.message) })
let msgObj = util.successMsg('数据正在生成中,请稍等片刻,生成后会自动下载,您可以先访问其他页面。',5000)
let newFields = [] this.downloadVisible = false
let fieldsList = this.fieldsList
fields.map(n => {
newFields.push(fieldsList.find(e => e.comment == n).field)
})
let msgObj = util.successMsg('数据正在生成中,请稍等片刻,生成后会自动下载,您可以先访问其他页面。',5000)
this.downloadVisible = false
let startTime = this.startTime ? this.startTime : '' let startTime = this.startTime ? this.startTime : ''
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: { headers: {
token: this.token token: this.token
}, },
responseType: 'blob' responseType: 'blob'
}).then((res) => { }).then((res) => {
msgObj.close() msgObj.close()
if(res.data.type != 'multipart/form-data') return util.warningMsg('数据总数为零!') if(res.data.type != 'multipart/form-data') return util.warningMsg('数据总数为零!')
util.downloadFileDirect(`${this.curRow.showName}.xls`,new Blob([res.data])) util.downloadFileDirect(`${this.curRow.showName}.xls`,new Blob([res.data]))
this.$get(`${this.api.downloadRecord}?tableId=${this.curRow.id}&fields=${newFields.join()}` + (startTime ? `&startTime=${startTime}` : '') + (endTime ? `&endTime=${endTime}` : '') + `&frequency=${frequency}`).then(res => {}).catch(res => {}) this.$get(`${this.api.downloadRecord}?tableId=${this.curRow.id}&fields=${newFields.join()}` + (startTime ? `&startTime=${startTime}` : '') + (endTime ? `&endTime=${endTime}` : '') + `&frequency=${frequency}`).then(res => {}).catch(res => {})
this.$post(this.api.saveRecord,{ this.$post(this.api.saveRecord,{
tableId: this.curRow.id, tableId: this.curRow.id,
type: 1, type: 1,
}).then(res => {}).catch(res => {}) }).then(res => {}).catch(res => {})
}).catch(res => { }).catch(res => {
msgObj.close() msgObj.close()
}) })
}).catch(res => {})
} }
} }
}; };

@ -26,7 +26,11 @@
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="showName" label="数据表名称" align="center"></el-table-column> <el-table-column prop="showName" label="数据表名称" align="center"></el-table-column>
<el-table-column prop="dataTotal" label="数据总量" align="center"></el-table-column> <el-table-column prop="dataTotal" label="数据总量" align="center"></el-table-column>
<el-table-column prop="dataSize" label="数据大小" align="center"></el-table-column> <el-table-column prop="dataSize" label="数据大小" align="center">
<template slot-scope="scope">
{{scope.row.dataSize}}M
</template>
</el-table-column>
<el-table-column prop="updateTime" label="更新时间" align="center"></el-table-column> <el-table-column prop="updateTime" label="更新时间" align="center"></el-table-column>
<el-table-column label="操作" width="180" align="center"> <el-table-column label="操作" width="180" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -105,7 +109,12 @@ export default {
}, },
download(row){ download(row){
if(this.token){ if(this.token){
this.$router.push(`/data?download=true&id=${row.id}&name=${row.name}`) this.$get(`${this.api.isDownload}`,{
tableId: row.id,
schoolId: this.schoolId,
}).then(res => {
this.$router.push(`/data?download=true&id=${row.id}&name=${row.name}`)
}).catch(res => {})
}else{ }else{
this.$router.push('/login') this.$router.push('/login')
} }

@ -29,7 +29,7 @@
<el-table-column label="操作" width="180" align="center"> <el-table-column label="操作" width="180" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="showRole(scope.row)" v-auth>查看</el-button> <el-button type="text" @click="showRole(scope.row)" v-auth>查看</el-button>
<template v-if="scope.row.id != 1"> <template v-if="scope.row.id != '1409424489820102658'">
<el-button type="text" @click="editRole(scope.row)" v-auth>编辑</el-button> <el-button type="text" @click="editRole(scope.row)" v-auth>编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button> <el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
</template> </template>
@ -37,8 +37,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"> <el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</el-pagination>
</div> </div>
<el-dialog :title="isDetail ? '查看角色' : (isAdd ? '新增角色' : '编辑角色')" :visible.sync="roleVisible" width="500px" @close="closeRole" class="dialog" :close-on-click-modal="false"> <el-dialog :title="isDetail ? '查看角色' : (isAdd ? '新增角色' : '编辑角色')" :visible.sync="roleVisible" width="500px" @close="closeRole" class="dialog" :close-on-click-modal="false">
@ -237,7 +236,6 @@ export default {
let delList = newArr.map(item => { let delList = newArr.map(item => {
return item.id return item.id
}) })
//
this.$confirm(`此批量删除操作不可逆,是否确认删除?`, '提示', { this.$confirm(`此批量删除操作不可逆,是否确认删除?`, '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {

@ -14,7 +14,7 @@
<el-table-column prop="databaseName" label="数据表名称" align="center"></el-table-column> <el-table-column prop="databaseName" label="数据表名称" align="center"></el-table-column>
<el-table-column prop="dataTotal" label="数据总量" align="center"></el-table-column> <el-table-column prop="dataTotal" label="数据总量" align="center"></el-table-column>
<el-table-column prop="dataSize" label="数据大小" align="center"></el-table-column> <el-table-column prop="dataSize" label="数据大小" align="center"></el-table-column>
<el-table-column prop="updateTime" label="更新时间" width="150" align="center"></el-table-column> <el-table-column prop="tableUpdateTime" label="更新时间" width="150" align="center"></el-table-column>
<el-table-column prop="downloadTime" label="下载时间" width="150" align="center"></el-table-column> <el-table-column prop="downloadTime" label="下载时间" width="150" align="center"></el-table-column>
<el-table-column label="操作" width="180" align="center"> <el-table-column label="操作" width="180" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -35,7 +35,7 @@ import util from '@/libs/util'
import Setting from '@/setting' import Setting from '@/setting'
import axios from 'axios' import axios from 'axios'
export default { export default {
name: 'role', name: 'download',
data() { data() {
return { return {
token: util.local.get(Setting.tokenKey), token: util.local.get(Setting.tokenKey),

@ -138,6 +138,9 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="fold">
<img :class="{active: showArch}" src="@/assets/img/arrow.png" alt="" @click="showArch = !showArch">
</div>
</div> </div>
</div> </div>
@ -340,7 +343,7 @@ export default {
}; };
}, },
mounted() { mounted() {
this.getdata(); this.getdata()
this.getProvince() this.getProvince()
this.getSchoolData() this.getSchoolData()
this.getSubject() this.getSubject()
@ -476,7 +479,7 @@ export default {
userName: form.userName userName: form.userName
}) })
util.successMsg('提交成功') util.successMsg('提交成功')
this.$router.back() this.getdata()
}else{ }else{
util.errorMsg('提交失败') util.errorMsg('提交失败')
} }
@ -531,12 +534,9 @@ export default {
let data = this.passwordForm let data = this.passwordForm
data.accountId = this.form.id data.accountId = this.form.id
this.$post(this.api.examinePassword,data) this.$post(this.api.examinePassword,data).then(res => {
.then(res => { util.successMsg('更换成功')
if(res.status == 200){ this.passwordVisible = false
util.successMsg('更换成功')
this.passwordVisible = false
}
}).catch(err => {}) }).catch(err => {})
}, },
closePassword() { closePassword() {
@ -854,5 +854,14 @@ export default {
border-radius: 8px; border-radius: 8px;
border: 1px dashed #C0C4CC; border: 1px dashed #C0C4CC;
} }
.fold{
text-align: center;
img{
cursor: pointer;
&.active{
transform: rotate(180deg);
}
}
}
} }
</style> </style>

@ -347,6 +347,8 @@ export default {
closeUser(){ closeUser(){
this.$refs.form.resetFields() this.$refs.form.resetFields()
this.form.userId = '' this.form.userId = ''
this.accountRepeat = false
this.workNumberRepeat = false
}, },
addTeacher(){ addTeacher(){
this.isDetail = false this.isDetail = false

@ -19,5 +19,11 @@ export default {
component: () => import('@/pages/setting/person'), component: () => import('@/pages/setting/person'),
meta: { title: '个人中心' } meta: { title: '个人中心' }
}, },
{
name: `${pre}download`,
path: `download`,
component: () => import('@/pages/setting/person/download'),
meta: { title: '我的下载' }
},
] ]
}; };

@ -16,7 +16,7 @@ const Setting = {
showProgressBar: true, showProgressBar: true,
// 接口请求地址 // 接口请求地址
// apiBaseURL: env === 'development' ? 'http://192.168.31.216:9000' : 'http://39.108.250.202:9000', // apiBaseURL: env === 'development' ? 'http://192.168.31.216:9000' : 'http://39.108.250.202:9000',
apiBaseURL: env === 'development' ? 'http://192.168.31.216:9000' : 'http://39.108.250.202:9000', apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000' : 'http://39.108.250.202:9000',
// 接口请求返回错误时,弹窗的持续时间,单位:秒 // 接口请求返回错误时,弹窗的持续时间,单位:秒
modalDuration: 3, modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice

Loading…
Cancel
Save