ui修改-颜色等

ui1
Joel 3 years ago
parent 316561116f
commit a73994a885
  1. 73
      src/layouts/header/index.vue
  2. 53
      src/layouts/navbar/index.vue
  3. 147
      src/pages/data/list/index.vue
  4. 7
      src/styles/common.scss
  5. 2
      src/styles/default/index.scss

@ -1,13 +1,8 @@
<template> <template>
<div class="header"> <div class="header">
<a class="logo" @click="toIndex"> <a class="logo" @click="toIndex">
<!-- <img width="180" v-if="isLogin || (isManager && showSetting) || !isUser" src="@/assets/img/logo.png" alt=""> -->
<span v-if="token && isManager && !showSetting">{{schoolName}}</span> <span v-if="token && isManager && !showSetting">{{schoolName}}</span>
</a> </a>
<!-- <div class="search" v-if="isData">
<input v-model="keyword" type="text" placeholder="请输入数据表名称">
<img src="../../assets/img/search.png" alt="" class="search-icon">
</div> -->
<div class="inner"> <div class="inner">
<div style="height: 70px;"></div> <div style="height: 70px;"></div>
<navbar ref="nav"></navbar> <navbar ref="nav"></navbar>
@ -57,7 +52,7 @@
</template> </template>
<script> <script>
import navbar from '../navbar' import navbar from '../navbar'
import { mapState,mapActions } from 'vuex' import { mapState, mapActions } from 'vuex'
import Setting from '@/setting' import Setting from '@/setting'
import util from '@/libs/util' import util from '@/libs/util'
import bus from '@/libs/bus' import bus from '@/libs/bus'
@ -87,7 +82,7 @@ export default {
components: { navbar }, components: { navbar },
computed: { computed: {
...mapState('user', [ ...mapState('user', [
'avatar','isManager','schoolId','isCustomer' 'avatar', 'isManager', 'schoolId', 'isCustomer'
]), ]),
...mapState('auth', [ ...mapState('auth', [
'routes' 'routes'
@ -96,25 +91,25 @@ export default {
watch: { watch: {
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
if(!this.rendered){ if (!this.rendered) {
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
bus.$emit('initData',this.keyword) bus.$emit('initData', this.keyword)
},500) }, 500)
} }
this.rendered = false this.rendered = false
}, },
'$route'(to,from) { '$route'(to, from) {
let isData = this.$route.path == '/data/list' let isData = this.$route.path == '/data/list'
if(isData){ if (isData) {
this.rendered = true this.rendered = true
this.keyword = '' this.keyword = ''
} }
this.isData = isData this.isData = isData
} }
}, },
mounted(){ mounted() {
// ,store,, // ,store,,
if(this.customer){ if (this.customer) {
let customer = atob(decodeURI(this.customer)) == 'false' ? false : true let customer = atob(decodeURI(this.customer)) == 'false' ? false : true
this.setCustomer(customer) this.setCustomer(customer)
} }
@ -124,9 +119,9 @@ export default {
}, },
methods: { methods: {
...mapActions('user', [ ...mapActions('user', [
'setInfo','logout','setManager','setCustomer' 'setInfo', 'logout', 'setManager', 'setCustomer'
]), ]),
getUserInfo(){ getUserInfo() {
this.$get(this.api.userInfo).then(res => { this.$get(this.api.userInfo).then(res => {
let userInfo = res.userInfo ? res.userInfo : {} let userInfo = res.userInfo ? res.userInfo : {}
let userAccount = res.userAccount let userAccount = res.userAccount
@ -134,7 +129,7 @@ export default {
this.isUser = isManager this.isUser = isManager
let mg = this.$route.query.mg let mg = this.$route.query.mg
// //
if(mg && atob(decodeURI(mg)) === 'true'){ if (mg && atob(decodeURI(mg)) === 'true') {
this.showSetting = false this.showSetting = false
} }
this.userName = userAccount.account this.userName = userAccount.account
@ -145,30 +140,30 @@ export default {
schoolId: userAccount.schoolId, schoolId: userAccount.schoolId,
}) })
this.setManager(isManager) this.setManager(isManager)
}).catch(err => {}) }).catch(err => { })
}, },
toIndex(){ toIndex() {
this.$refs.nav.jump({ this.$refs.nav.jump({
index: '/index/list', index: '/index/list',
title: '首页' title: '首页'
}) })
}, },
toSearch(){ toSearch() {
this.$refs.nav.jump({ this.$refs.nav.jump({
index: '/index/list', index: '/index/list',
title: '首页' title: '首页'
}) })
}, },
toLogin(){ toLogin() {
this.$refs.nav.jump({ this.$refs.nav.jump({
index: '/login', index: '/login',
title: '登录' title: '登录'
}) })
}, },
// //
toManager(){ toManager() {
let routes = this.routes let routes = this.routes
if(routes.length){ if (routes.length) {
let route = this.$router.resolve({ let route = this.$router.resolve({
path: this.routes[0].name, path: this.routes[0].name,
query: { query: {
@ -178,19 +173,19 @@ export default {
} }
}) })
window.open(route.href) window.open(route.href)
}else{ } else {
// ,, // ,,
util.warningMsg('该角色未开放模块,请联系管理员') util.warningMsg('该角色未开放模块,请联系管理员')
} }
}, },
userCommand(command){ userCommand(command) {
if(command == 'person'){ if (command == 'person') {
this.$router.push('/setting/person').catch(err => {}) this.$router.push('/setting/person').catch(err => { })
}else if(command == 'resetPw'){ } else if (command == 'resetPw') {
this.showPassword() this.showPassword()
}else if(command == 'myDownload'){ } else if (command == 'myDownload') {
this.$router.push('/setting/download').catch(err => {}) this.$router.push('/setting/download').catch(err => { })
}else{ } else {
this.logout() this.logout()
} }
}, },
@ -198,19 +193,19 @@ export default {
this.passwordVisible = true this.passwordVisible = true
}, },
editPassword() { editPassword() {
if(!this.passwordForm.password) return util.warningMsg('请输入原密码') if (!this.passwordForm.password) return util.warningMsg('请输入原密码')
if(!this.passwordForm.newPassword) return util.warningMsg('请输入新密码') if (!this.passwordForm.newPassword) return util.warningMsg('请输入新密码')
if(!this.passwordForm.reNewPassword) 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.length < 6 || this.passwordForm.reNewPassword.length < 6) return util.warningMsg('请输入6位数以上的密码')
if(this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return util.warningMsg('输入的新密码不一致,请重新确认') if (this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return util.warningMsg('输入的新密码不一致,请重新确认')
if(this.passwordForm.password === this.passwordForm.newPassword) return util.warningMsg('原密码跟新密码不能一致') if (this.passwordForm.password === this.passwordForm.newPassword) return util.warningMsg('原密码跟新密码不能一致')
let data = this.passwordForm let data = this.passwordForm
data.accountId = this.id data.accountId = this.id
this.$post(this.api.examinePassword,data).then(res => { this.$post(this.api.examinePassword, data).then(res => {
util.successMsg('修改成功') util.successMsg('修改成功')
this.passwordVisible = false this.passwordVisible = false
}).catch(err => {}) }).catch(err => { })
}, },
closePassword() { closePassword() {
this.passwordForm = { this.passwordForm = {

@ -7,7 +7,7 @@
</template> </template>
<script> <script>
import { mapState,mapActions } from 'vuex' import { mapState, mapActions } from 'vuex'
import addRoutes from '@/libs/route/addRoutes' import addRoutes from '@/libs/route/addRoutes'
import Setting from '@/setting' import Setting from '@/setting'
import util from '@/libs/util' import util from '@/libs/util'
@ -22,7 +22,7 @@ export default {
dataMenu: [{ dataMenu: [{
index: '/index/list', index: '/index/list',
title: '首页' title: '首页'
},{ }, {
index: '/data/list', index: '/data/list',
title: '数据' title: '数据'
}], }],
@ -31,10 +31,10 @@ export default {
{ {
index: '/stat/list', index: '/stat/list',
title: '数据统计' title: '数据统计'
},{ }, {
index: '/user/list', index: '/user/list',
title: '用户管理' title: '用户管理'
},{ }, {
index: '/role/list', index: '/role/list',
title: '角色权限' title: '角色权限'
} }
@ -49,22 +49,22 @@ export default {
]) ])
}, },
watch: { watch: {
'$route'(to,from) { '$route'(to, from) {
let actives = this.actives let actives = this.actives
for(let i in this.actives){ for (let i in this.actives) {
if(actives[i].includes(this.$route.name)) this.active = `/${i}/list` if (actives[i].includes(this.$route.name)) this.active = `/${i}/list`
} }
this.active = this.$route.path this.active = this.$route.path
} }
}, },
mounted() { mounted() {
if(util.local.get(Setting.tokenKey)){// if (util.local.get(Setting.tokenKey)) {//
this.getPer() this.getPer()
if(this.managerStr && atob(decodeURI(this.managerStr)) === 'true'){ if (this.managerStr && atob(decodeURI(this.managerStr)) === 'true') {
this.isManager = true this.isManager = true
this.setManager(false) this.setManager(false)
} }
}else{ } else {
this.menus = this.defaultMenus this.menus = this.defaultMenus
} }
}, },
@ -72,30 +72,30 @@ export default {
...mapActions('user', [ ...mapActions('user', [
'setManager' 'setManager'
]), ]),
initMenu(){ initMenu() {
if(this.isManager){// trueurlmanagerStr if (this.isManager) {// trueurlmanagerStr
this.defaultMenus = this.managerMenus this.defaultMenus = this.managerMenus
if(Setting.dynamicRoute){ if (Setting.dynamicRoute) {
let routes = this.routes let routes = this.routes
let menus = [] let menus = []
this.defaultMenus.map(e => { this.defaultMenus.map(e => {
routes.find(n => n.name == e.index) && menus.push(e) routes.find(n => n.name == e.index) && menus.push(e)
}) })
this.menus = menus this.menus = menus
}else{ } else {
this.menus = this.defaultMenus this.menus = this.defaultMenus
} }
}else{ } else {
// , // ,
this.menus = [...this.defaultMenus,...this.dataMenu] this.menus = [...this.defaultMenus, ...this.dataMenu]
} }
}, },
jump(item){ jump(item) {
this.active = item.index this.active = item.index
this.$router.push(item.index).catch(err => {}) this.$router.push(item.index).catch(err => { })
}, },
// //
getPer(){ getPer() {
this.$get(`${this.api.getPermissions}?platformId=${Setting.platformId}`).then(res => { this.$get(`${this.api.getPermissions}?platformId=${Setting.platformId}`).then(res => {
let routes = res.permissionMenu[0].children let routes = res.permissionMenu[0].children
Setting.dynamicRoute && addRoutes(routes) Setting.dynamicRoute && addRoutes(routes)
@ -112,18 +112,19 @@ export default {
.nav{ .nav{
position: absolute; position: absolute;
top: 0; top: 0;
left: 50%; left: 250px;
transform: translateX(-50%);
display: flex; display: flex;
li{ li{
padding: 0 25px; padding: 0 15px;
margin: 0 20px;
font-size: 16px; font-size: 16px;
line-height: 70px; line-height: 66px;
color: #0d0d0d; color: #3F3F3F;
cursor: pointer; cursor: pointer;
border-bottom: 4px solid transparent;
&.active{ &.active{
color: #fff; color: #0076FF;
background-color: #568df2; border-bottom-color: #0070FF;
} }
} }
} }

@ -192,7 +192,7 @@ export default {
introduce: '', introduce: '',
dataSource: '', dataSource: '',
keyword: '', keyword: '',
search:'', search: '',
listData: [], listData: [],
listDataAll: [], listDataAll: [],
searchListData: [], searchListData: [],
@ -223,22 +223,22 @@ export default {
{ {
id: 1, id: 1,
name: '日频' name: '日频'
},{ }, {
id: 2, id: 2,
name: '周频' name: '周频'
},{ }, {
id: 3, id: 3,
name: '月频' name: '月频'
},{ }, {
id: 4, id: 4,
name: '季频' name: '季频'
},{ }, {
id: 5, id: 5,
name: '年频' name: '年频'
}, },
], ],
currentRow: null, currentRow: null,
searchTimer:null searchTimer: null
} }
}, },
computed: { computed: {
@ -246,13 +246,13 @@ export default {
'schoolId' 'schoolId'
]), ]),
}, },
watch:{ watch: {
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
if(!this.rendered){ if (!this.rendered) {
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData() this.initData()
},500) }, 500)
} }
this.rendered = false this.rendered = false
}, },
@ -260,7 +260,7 @@ export default {
mounted() { mounted() {
this.getType() this.getType()
// , // ,
if(this.$route.query.download){ if (this.$route.query.download) {
this.download({ this.download({
id: this.$route.query.id, id: this.$route.query.id,
name: this.$route.query.name, name: this.$route.query.name,
@ -269,7 +269,7 @@ export default {
} }
}, },
methods: { methods: {
getType(){ getType() {
// //
this.$post(this.api.getTableByClassification).then(res => { this.$post(this.api.getTableByClassification).then(res => {
let typeId = this.typeId // id let typeId = this.typeId // id
@ -277,7 +277,7 @@ export default {
let dataSource = '' // let dataSource = '' //
let action let action
// //
function actionId(arr){//res function actionId(arr) {//res
arr && arr.map((e, i) => { arr && arr.map((e, i) => {
e.id = String(e.id) e.id = String(e.id)
if (!i) { if (!i) {
@ -286,16 +286,16 @@ export default {
if (e.dataSource) dataSource = e.dataSource if (e.dataSource) dataSource = e.dataSource
if (!action) action = e.children[0].children.length ? String(e.children[0].children[0].id) : String(e.children[0].id) if (!action) action = e.children[0].children.length ? String(e.children[0].children[0].id) : String(e.children[0].id)
} }
if(typeId && e.id == typeId) {// id if (typeId && e.id == typeId) {// id
action = String(e.id) action = String(e.id)
if(e.children.length){// if (e.children.length) {//
if(!e.children[0].children.length){// if (!e.children[0].children.length) {//
action = String(e.children[0].id) action = String(e.children[0].id)
}else{// } else {//
action = String(e.children[0].children[0].id) action = String(e.children[0].children[0].id)
} }
} }
}else if(e.children.length){// id } else if (e.children.length) {// id
actionId(e.children) actionId(e.children)
} }
}) })
@ -306,17 +306,17 @@ export default {
this.introduce = introduce this.introduce = introduce
this.dataSource = dataSource this.dataSource = dataSource
this.getData() this.getData()
}).catch(res => {}) }).catch(res => { })
}, },
getData(){ getData() {
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.defaultType}&showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}&updateTime=`).then(res => { this.$post(`${this.api.getIdQueryTable}?categoryId=${this.defaultType}&showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}&updateTime=`).then(res => {
this.listData = res.pageList.records this.listData = res.pageList.records
this.total = res.pageList.total this.total = res.pageList.total
// //
this.listData.length && this.preview(this.listData[0],1) this.listData.length && this.preview(this.listData[0], 1)
}).catch(res => {}) }).catch(res => { })
}, },
initData(){ initData() {
this.page = 1 this.page = 1
this.getData() this.getData()
}, },
@ -326,7 +326,7 @@ export default {
this.getData() this.getData()
}, },
// //
selectType(index,indexPath){ selectType(index, indexPath) {
let introduce = '' let introduce = ''
let dataSource = '' let dataSource = ''
this.keyword = '' this.keyword = ''
@ -335,18 +335,18 @@ export default {
function handleData(data) { function handleData(data) {
data.map((n, i) => { data.map((n, i) => {
// //
if(n.id == index){ if (n.id == index) {
if (n.introduce) introduce = n.introduce if (n.introduce) introduce = n.introduce
if (n.dataSource) dataSource = n.dataSource if (n.dataSource) dataSource = n.dataSource
if (!select) select = n.children.length ? (n.children[0].children.length ? n.children[0].children[0].id : n.children[0].id) : n.id if (!select) select = n.children.length ? (n.children[0].children.length ? n.children[0].children[0].id : n.children[0].id) : n.id
}else{ } else {
handleData(n.children) handleData(n.children)
} }
}) })
} }
handleData(list) handleData(list)
if(!introduce) introduce = list.find(n => n.id == indexPath[0]).introduce if (!introduce) introduce = list.find(n => n.id == indexPath[0]).introduce
if(!dataSource) dataSource = list.find(n => n.id == indexPath[0]).dataSource if (!dataSource) dataSource = list.find(n => n.id == indexPath[0]).dataSource
this.defaultType = select this.defaultType = select
this.introduce = introduce this.introduce = introduce
this.dataSource = dataSource this.dataSource = dataSource
@ -354,16 +354,16 @@ export default {
this.previewData = [] this.previewData = []
this.initData() this.initData()
}, },
previewCurrentChange(val){ previewCurrentChange(val) {
this.currentRow = val this.currentRow = val
}, },
preview(row,isDefault){ preview(row, isDefault) {
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 => {
// +1 // +1
this.$post(this.api.saveRecord,{ this.$post(this.api.saveRecord, {
tableId: row.id, tableId: row.id,
type: 2, type: 2,
}).then(res => {}).catch(res => {}) }).then(res => { }).catch(res => { })
let comment = res.comment let comment = res.comment
let previewHead = [] let previewHead = []
@ -375,9 +375,9 @@ export default {
let data = res.data let data = res.data
data.map(n => { data.map(n => {
for(let i in n){ for (let i in n) {
// +0000,, // +0000,,
if(typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = util.formatDate('yyyy-MM-dd hh:mm:ss',new Date(n[i])) if (typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = util.formatDate('yyyy-MM-dd hh:mm:ss', new Date(n[i]))
} }
}) })
this.previewData = data this.previewData = data
@ -386,14 +386,14 @@ export default {
document.querySelector('#previewTable').scrollIntoView() document.querySelector('#previewTable').scrollIntoView()
}) })
}).catch(res => {}) }).catch(res => { })
}, },
checkAllFieldsChange(val) { checkAllFieldsChange(val) {
this.fields = val ? this.fieldsList.map(n => n.comment) : [] this.fields = val ? this.fieldsList.map(n => n.comment) : []
}, },
download(row){ download(row) {
// , // ,
this.$get(`${this.api.isDownload}`,{ this.$get(`${this.api.isDownload}`, {
tableId: row.id, tableId: row.id,
schoolId: this.schoolId, schoolId: this.schoolId,
}).then(res => { }).then(res => {
@ -401,24 +401,24 @@ export default {
this.downloadVisible = true this.downloadVisible = true
// ,, // ,,
this.$get(`${this.api.getTableTime}`,{ this.$get(`${this.api.getTableTime}`, {
tableId: row.id tableId: row.id
}).then(res => { }).then(res => {
let list = res.message let list = res.message
if(list.startTime){ if (list.startTime) {
startTimeLimit = new Date(list.startTime).getTime() startTimeLimit = new Date(list.startTime).getTime()
}else{ } else {
// , // ,
this.startTimeDisabled = true this.startTimeDisabled = true
} }
if(list.endTime){ if (list.endTime) {
endTimeLimit = new Date(list.endTime).getTime() endTimeLimit = new Date(list.endTime).getTime()
this.timeDefault = list.endTime this.timeDefault = list.endTime
}else{ } else {
// , // ,
this.endTimeDisabled = true this.endTimeDisabled = true
} }
}).catch(res => {}) }).catch(res => { })
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
@ -427,26 +427,26 @@ export default {
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 => {}) }).catch(res => { })
}, },
closeDownload(){ closeDownload() {
this.checkAllFields = false this.checkAllFields = false
this.fields = [] this.fields = []
this.startTime = '' this.startTime = ''
this.endTime = '' this.endTime = ''
this.frequency = '' this.frequency = ''
this.$router.push('/data').catch(err => {}) this.$router.push('/data').catch(err => { })
}, },
confirmDown(){ confirmDown() {
let fields = this.fields let fields = this.fields
if(!fields.length) return util.warningMsg('请选择字段') if (!fields.length) return util.warningMsg('请选择字段')
if(!this.startTime) return util.warningMsg('请选择开始时间') if (!this.startTime) return util.warningMsg('请选择开始时间')
if(!this.endTime) return util.warningMsg('请选择结束时间') if (!this.endTime) return util.warningMsg('请选择结束时间')
if(!this.frequency) return util.warningMsg('请选择数据频率') if (!this.frequency) return util.warningMsg('请选择数据频率')
let invalid = false let invalid = false
if(this.startTime && this.endTime){ if (this.startTime && this.endTime) {
let startTime = new Date(this.startTime) let startTime = new Date(this.startTime)
let endTime = new Date(this.endTime) let endTime = new Date(this.endTime)
let frequency = this.frequency let frequency = this.frequency
@ -454,62 +454,62 @@ export default {
// , // ,
// ,,1~5, // ,,1~5,
// ,,30; // ,,30;
if(frequency == 2){ if (frequency == 2) {
let week = [] let week = []
while(startTime <= endTime){ while (startTime <= endTime) {
let weekNum = startTime.getDay() let weekNum = startTime.getDay()
if(weekNum == 0) weekNum = 7 if (weekNum == 0) weekNum = 7
week.push(weekNum) week.push(weekNum)
startTime.setTime(startTime.getTime() + 86400000) startTime.setTime(startTime.getTime() + 86400000)
} }
// 1~5,, // 1~5,,
for(let i = 1;i <= 5;i++){ for (let i = 1; i <= 5; i++) {
if(!week.includes(i)){ if (!week.includes(i)) {
invalid = true invalid = true
break break
} }
} }
}else if(frequency == 3){ } else if (frequency == 3) {
if((endTime.getTime() - startTime.getTime()) / 86400000 < 30) invalid = true if ((endTime.getTime() - startTime.getTime()) / 86400000 < 30) invalid = true
}else if(frequency == 4){ } else if (frequency == 4) {
if((endTime.getTime() - startTime.getTime()) / 86400000 < 90) invalid = true if ((endTime.getTime() - startTime.getTime()) / 86400000 < 90) invalid = true
}else if(frequency == 5){ } else if (frequency == 5) {
if((endTime.getTime() - startTime.getTime()) / 86400000 < 365) invalid = true if ((endTime.getTime() - startTime.getTime()) / 86400000 < 365) invalid = true
} }
} }
if(invalid) return util.warningMsg('请选择完整区间') if (invalid) return util.warningMsg('请选择完整区间')
let newFields = [] let newFields = []
let fieldsList = this.fieldsList let fieldsList = this.fieldsList
fields.map(n => { fields.map(n => {
newFields.push(fieldsList.find(e => e.comment == n).field) newFields.push(fieldsList.find(e => e.comment == n).field)
}) })
let msgObj = util.successMsg('数据正在生成中,请稍等片刻,生成后会自动下载,您可以先访问其他页面。',5000) let msgObj = util.successMsg('数据正在生成中,请稍等片刻,生成后会自动下载,您可以先访问其他页面。', 5000)
this.downloadVisible = false 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('数据总数为零!')
// excel // excel
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 => { })
// +1 // +1
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()
}) })
@ -526,10 +526,8 @@ export default {
.menu{ .menu{
width: 200px; width: 200px;
border-radius: 8px;
overflow: hidden; overflow: hidden;
&>.el-menu-item,.el-submenu__title{ &>.el-menu-item,.el-submenu__title{
background-color: rgba(228,237,255,.4);
span{ span{
font-size: 15px; font-size: 15px;
color: #3381d2; color: #3381d2;
@ -540,14 +538,13 @@ export default {
} }
.el-submenu.is-active{ .el-submenu.is-active{
.el-submenu__title{ .el-submenu__title{
background-color: rgba(147,184,255,.3);
&+.el-menu .el-submenu__title{ &+.el-menu .el-submenu__title{
background-color: rgba(147,184,255,.15); background-color: rgba(147,184,255,.15);
} }
} }
} }
.el-menu-item.is-active{ .el-menu-item.is-active{
color: $main-color; background-color: #0070FF;
} }
.level-6 { .level-6 {
padding-right: 0; padding-right: 0;

@ -16,7 +16,7 @@
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
width: 5px; width: 5px;
border-radius: 6px; border-radius: 6px;
background: rgba(86,141,242,.7); background: rgba(173,173,173,.7);
} }
.required{ .required{
@ -72,7 +72,6 @@
position: relative; position: relative;
padding: 24px 10px; padding: 24px 10px;
background-color: #fff; background-color: #fff;
border-radius: 8px;
.page-content{ .page-content{
padding: 26px 36px 0; padding: 26px 36px 0;
.tool{ .tool{
@ -163,7 +162,7 @@
} }
.el-table{ .el-table{
border-radius: 8px; border-radius: 4px;
border: 1px solid rgba(0, 0, 0, 0.06); border: 1px solid rgba(0, 0, 0, 0.06);
border-bottom: 0; border-bottom: 0;
.cell{ .cell{
@ -181,7 +180,7 @@
th{ th{
background: $--color-primary !important; background: $--color-primary !important;
.cell{ .cell{
color: #fff; color: #222326;
font-size: 14px; font-size: 14px;
font-weight: normal; font-weight: normal;
.el-checkbox{ .el-checkbox{

@ -1,6 +1,6 @@
/* 改变主题色变量 */ /* 改变主题色变量 */
$--color-primary: #568DF2; $--color-primary: #E6F0FF;
/* 改变 icon 字体路径变量,必需 */ /* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts'; $--font-path: '~element-ui/lib/theme-chalk/fonts';

Loading…
Cancel
Save