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`,
queryDatabaseInfoByMonth:`/data/data/dataRecord/queryDatabaseInfoByMonth`,
saveRecord:`/data/data/dataRecord/saveRecord`,
databaseInfoExport:`/data/data/dataRecord/databaseInfoExport`,
databaseInfoByMonthExport:`/data/data/dataRecord/databaseInfoByMonthExport`,
databaseInfoExport:`${Setting.apiBaseURL}/data/data/dataRecord/databaseInfoExport`,
databaseInfoByMonthExport:`${Setting.apiBaseURL}/data/data/dataRecord/databaseInfoByMonthExport`,
onlineNumber:`/data/data/dataRecord/onlineNumber`,
getProductInfoBySchoolId:`/data/data/product/getProductInfoBySchoolId`,
}

@ -15,6 +15,10 @@
</div>
<el-dropdown-menu slot="dropdown">
<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-menu>
</el-dropdown>
@ -29,6 +33,24 @@
<img class="search" src="../../assets/img/search.png" alt="" @click="toSearch">
</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>
</template>
<script>
@ -45,6 +67,13 @@ export default {
userName: '',
isUser: false,
showSetting: true,
id: '',
passwordVisible: false,
passwordForm: {
password: '',
newPassword: '',
reNewPassword: ''
},
};
},
components: { navbar },
@ -58,7 +87,7 @@ export default {
},
mounted(){
if(this.customer){
let customer = Boolean(atob(decodeURI(this.customer)))
let customer = atob(decodeURI(this.customer)) == 'false' ? false : true
this.setCustomer(customer)
}
this.token && this.getUserInfo()
@ -78,7 +107,7 @@ export default {
this.showSetting = false
}
this.userName = userAccount.account
this.id = userAccount.id
this.setInfo({
avatar: userInfo.userAvatars,
schoolId: userAccount.schoolId,
@ -123,10 +152,39 @@ export default {
userCommand(command){
if(command == 'person'){
this.$router.push('/setting/person')
}else if(command == 'resetPw'){
this.showPassword()
}else if(command == 'myDownload'){
this.$router.push('/setting/download')
}else{
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>

@ -1,7 +1,7 @@
<template>
<div class="wrap">
<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-if="item.children.length">
@ -75,7 +75,11 @@
<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="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 label="操作" width="220" align="center">
<template slot-scope="scope">
@ -245,6 +249,21 @@ export default {
this.page = 1
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){
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
this.$post(this.api.saveRecord,{
@ -271,16 +290,21 @@ export default {
this.fields = val ? this.fieldsList.map(n => n.comment) : []
},
download(row){
this.curRow = row
this.downloadVisible = true
this.$get(`${this.api.isDownload}`,{
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 => {
let comment = res.comment
let fieldsList = []
comment.map(n => {
n.field != 'id' && n.field != 'operation_time' && fieldsList.push(n)
})
this.fieldsList = fieldsList
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
let comment = res.comment
let fieldsList = []
comment.map(n => {
n.field != 'id' && n.field != 'operation_time' && fieldsList.push(n)
})
this.fieldsList = fieldsList
}).catch(res => {})
}).catch(res => {})
},
closeDownload(){
@ -290,12 +314,6 @@ export default {
this.endTime = ''
this.frequency = ''
this.$router.push('/data').catch(err => {})
},
handleOpen(){
},
handleClose(){
},
confirmDown(){
let fields = this.fields
@ -334,43 +352,36 @@ export default {
if(invalid) return util.warningMsg('请选择完整区间')
this.$get(`${this.api.isDownload}`,{
tableId: this.curRow.id,
schoolId: this.schoolId,
}).then(res => {
if(res.status != 200) return util.warningMsg(res.message)
let newFields = []
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 newFields = []
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 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()
if(res.data.type != 'multipart/form-data') return util.warningMsg('数据总数为零!')
util.downloadFileDirect(`${this.curRow.showName}.xls`,new Blob([res.data]))
let startTime = this.startTime ? this.startTime : ''
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()
if(res.data.type != 'multipart/form-data') return util.warningMsg('数据总数为零!')
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,{
tableId: this.curRow.id,
type: 1,
}).then(res => {}).catch(res => {})
}).catch(res => {
msgObj.close()
})
}).catch(res => {})
this.$post(this.api.saveRecord,{
tableId: this.curRow.id,
type: 1,
}).then(res => {}).catch(res => {})
}).catch(res => {
msgObj.close()
})
}
}
};

@ -26,7 +26,11 @@
<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="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 label="操作" width="180" align="center">
<template slot-scope="scope">
@ -105,7 +109,12 @@ export default {
},
download(row){
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{
this.$router.push('/login')
}

@ -29,7 +29,7 @@
<el-table-column label="操作" width="180" align="center">
<template slot-scope="scope">
<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="handleDelete(scope.row)" v-auth>删除</el-button>
</template>
@ -37,8 +37,7 @@
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total">
</el-pagination>
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
<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 => {
return item.id
})
//
this.$confirm(`此批量删除操作不可逆,是否确认删除?`, '提示', {
type: 'warning'
}).then(() => {

@ -14,7 +14,7 @@
<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="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 label="操作" width="180" align="center">
<template slot-scope="scope">
@ -35,7 +35,7 @@ import util from '@/libs/util'
import Setting from '@/setting'
import axios from 'axios'
export default {
name: 'role',
name: 'download',
data() {
return {
token: util.local.get(Setting.tokenKey),

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

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

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

@ -16,7 +16,7 @@ const Setting = {
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://39.108.250.202:9000' : 'http://39.108.250.202:9000',
// 接口请求返回错误时,弹窗的持续时间,单位:秒
modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice

Loading…
Cancel
Save