From 9ec0ae766b3290264f7619e30298ced191e9a344 Mon Sep 17 00:00:00 2001 From: xulili <xulili@wisenergy.cn> Date: Wed, 31 Mar 2021 12:22:06 +0800 Subject: [PATCH] index --- src/config/menu.js | 12 +- src/page/accounts/statistical.vue | 363 +++++++++++++++++++++--------- src/page/accounts/users.vue | 2 +- src/page/index/index.vue | 62 ++--- src/style/menu.less | 13 +- 5 files changed, 285 insertions(+), 167 deletions(-) diff --git a/src/config/menu.js b/src/config/menu.js index 79926ec..cff185d 100644 --- a/src/config/menu.js +++ b/src/config/menu.js @@ -61,14 +61,14 @@ export const menuList = [ children: [ { name: 'è§†é¢‘å®¡æ ¸', icon: 'icon-video', color: 'index-blue', url: '/checkVideo' }, { name: '展æ¿å®¡æ ¸', icon: 'icon-screen', color: 'index-green', url: '/checkDisplay' }, - { name: 'å¹³å°å¦ä¹ å†…å®¹å®¡æ ¸', icon: 'icon-magnifier', color: 'index-pink', url: '/checkLearn' }, + { name: 'å¦ä¹ å†…å®¹å®¡æ ¸', icon: 'icon-magnifier', color: 'index-pink', url: '/checkLearn' }, { name: 'è´¦å·ç¦ç”¨å®¡æ ¸', icon: 'icon-disable', color: 'index-red', url: '/checkLearn' } ] } ] }, { - title: 'å•ä½ç”¨æˆ·ç®¡ç†', + name: 'å•ä½ç”¨æˆ·ç®¡ç†', icon: 'icon-headUser', avatar: 'user_head_picture.png', color: '', @@ -81,7 +81,7 @@ export const menuList = [ color: '', url: '', children: [ - { label: '互动管ç†', icon: 'icon-interaction', color: 'index-purple', url: '/interactive' } + { name: '互动管ç†', icon: 'icon-interaction', color: 'index-purple', url: '/interactive' } ] }, { @@ -91,7 +91,7 @@ export const menuList = [ color: '', url: '', children: [ - { label: 'è´¦å·ç®¡ç†', icon: 'icon-account', color: 'index-blue', url: '/unitAdmin' } + { name: 'è´¦å·ç®¡ç†', icon: 'icon-account', color: 'index-blue', url: '/unitAdmin' } ] } ] @@ -134,7 +134,7 @@ export const menuList = [ avatar: 'statistics_head_picture.png', color: '', url: '', - menu: [ + children: [ { name: '统计图表', icon: '', @@ -165,7 +165,7 @@ export const menuList = [ avatar: 'system_head_picture.png', color: '', url: '', - menu: [ + children: [ { name: '机构åŠä¿¡æ¯ç®¡ç†', icon: '', diff --git a/src/page/accounts/statistical.vue b/src/page/accounts/statistical.vue index 1748111..b305d32 100644 --- a/src/page/accounts/statistical.vue +++ b/src/page/accounts/statistical.vue @@ -1,125 +1,268 @@ <template> - <!-- ç»Ÿè®¡ç”¨æˆ·ç®¡ç† --> + <!-- ç»Ÿè®¡ç”¨æˆ·ç®¡ç† --> <div class="user-wrapper height100"> - <div class="search-container"> - <el-form :inline="true" :model="form"> - <el-form-item> - <el-input - v-model="form.user" - placeholder="请输入用户å" - suffix-icon="el-icon-search" - ></el-input> - </el-form-item> - <el-form-item> - <el-select - v-model="form.status" - placeholder="请选择账å·çжæ€" - clearable - > - <el-option - v-for="item in options" - :key="item.value" - :label="item.label" - :value="item.value" - ></el-option> - </el-select> - </el-form-item> - <el-form-item> - <div class="btn-group"> - <el-button type="primary" @click="handleSubmit">查询</el-button> - <el-button @click="handleReset">é‡ç½®</el-button> - </div> - </el-form-item> - </el-form> - <div class="page-tip"> - <span class="page-tip-title">页é¢è¯´æ˜Ž:</span> - <span class="page-tips">坿Œ‰æŒ‰ç…§ç”¨æˆ·ååŠè´¦å·çжæ€è¿›è¡Œä¿¡æ¯ç›é€‰ã€‚坿–°å¢žç»Ÿè®¡è´¦å·ï¼Œâ€œ*â€ä¸ºå¿…填项。</span> - </div> - </div> - <div class="table-content"> + <div class="search-container"> + <el-form :inline="true" :model="form"> + <el-form-item> + <el-input + v-model="form.userName" + placeholder="请输入用户å" + suffix-icon="el-icon-search" + ></el-input> + </el-form-item> + <el-form-item> + <el-select + v-model="form.status" + placeholder="请选择账å·çжæ€" + clearable + > + <el-option + v-for="item in statusOption" + :key="item.value" + :label="item.label" + :value="item.value" + ></el-option> + </el-select> + </el-form-item> + <el-form-item> <div class="btn-group"> - <el-button type="primary">新建统计账户</el-button> + <el-button type="primary" @click="handleSubmit">查询</el-button> + <el-button @click="handleReset">é‡ç½®</el-button> </div> - <!-- <party-table :feildList="feildList" :list="list"></party-table> --> - <account-table - :feildList="feildList" - :list="list" - @action="handleAction" - /> - <party-pagination/> + </el-form-item> + </el-form> + <div class="page-tip"> + <span class="page-tip-title">页é¢è¯´æ˜Ž:</span> + <span class="page-tips" + >坿Œ‰æŒ‰ç…§ç”¨æˆ·ååŠè´¦å·çжæ€è¿›è¡Œä¿¡æ¯ç›é€‰ã€‚坿–°å¢žç»Ÿè®¡è´¦å·ï¼Œâ€œ*â€ä¸ºå¿…填项。</span + > + </div> + </div> + <div class="table-content"> + <div class="btn-group"> + <el-button type="primary">新建统计账户</el-button> </div> - <!-- <user-dialog/> --> + <account-table + :feildList="feildList" + :list="list" + @action="handleAction" + /> + <party-pagination :page="page" @changePage="handleChangeCurrent" /> + </div> </div> </template> <script> -import { partyPagination } from '@/components/index' -import accountTable from './components/accountTable' -// import userDialog from './userDialog/index' +import { partyPagination } from "@/components/index"; +import accountTable from "./components/accountTable"; +import msgDialog from "./msgDialog.vue"; export default { - data(){ - return{ - form:{ - user:'', - status:'' - }, - addForm:{ - - }, - options:[ - {label:'待激活',value:0}, - {label:'活跃',value:1}, - {label:'ç¦ç”¨å¾…å®¡æ ¸',value:2}, - {label:'ç¦ç”¨',value:3}, - ], - feildList:[ - {prop:'username',label:'å¹³å°ç”¨æˆ·å'}, - {prop:'org',label:'所在机构'}, - {prop:'endTime',label:'到期时间'}, - {prop:'type',label:'è´¦å·ç±»åž‹'}, - {prop:'status',label:'è´¦å·çжæ€'}, - {prop:'',label:'æ“作',isEdit:true, width:280}, - ], - list: [ - { username: '䏿™“晓', org:'北京市政府',type:'系统管ç†å‘˜',endTime:'永久有效', status:'活跃'}, - { username: '䏿™“晓', org:'北京市政府',type:'系统管ç†å‘˜',endTime:'永久有效', status:'活跃'}, - { username: '䏿™“晓', org:'北京市政府',type:'系统管ç†å‘˜',endTime:'永久有效', status:'活跃'}, - { username: '䏿™“晓', org:'北京市政府',type:'系统管ç†å‘˜',endTime:'永久有效', status:'活跃'}, - { username: '䏿™“晓', org:'北京市政府',type:'系统管ç†å‘˜',endTime:'永久有效', status:'活跃'}, - { username: '䏿™“晓', org:'北京市政府',type:'系统管ç†å‘˜',endTime:'永久有效', status:'活跃'}, - { username: '䏿™“晓', org:'北京市政府',type:'系统管ç†å‘˜',endTime:'永久有效', status:'活跃'}, - { username: '䏿™“晓', org:'北京市政府',type:'系统管ç†å‘˜',endTime:'永久有效', status:'活跃'}, - { username: '䏿™“晓', org:'北京市政府',type:'系统管ç†å‘˜',endTime:'永久有效', status:'活跃'}, - { username: '䏿™“晓', org:'北京市政府',type:'系统管ç†å‘˜',endTime:'永久有效', status:'活跃'}, - { username: '䏿™“晓', org:'北京市政府',type:'系统管ç†å‘˜',endTime:'永久有效', status:'活跃'}, - { username: '䏿™“晓', org:'北京市政府',type:'系统管ç†å‘˜',endTime:'永久有效', status:'活跃'}, - ] - } + data() { + return { + form: { + userName: "", + status: "", + type: 5, //1.ç”¨æˆ·è´¦å· 2.å¹³å°å•ä½å•ä½ç®¡ç†å‘˜è´¦å· 3.æœºé¡¶ç›’è´¦å· 4.è¿ç»´è´¦å· 5. ç»Ÿè®¡è´¦å· + }, + statusOption: [ + { label: "活跃", value: 1 }, + { label: "ç¦ç”¨", value: 2 }, + { label: "å¾…å®¡æ ¸", value: 3 }, + ], + feildList: [ + { prop: "username", label: "统计用户å" }, + { prop: "org", label: "所属å•ä½" }, + { prop: "exiredDate", label: "到期时间" }, + { prop: "statusName", label: "è´¦å·çжæ€" }, + { prop: "", label: "æ“作", isEdit: true, width: 280 }, + ], + list: [], + page: { + _index: 1, + _size: 10, + total: 0, + }, + activeRow: {}, + msgInfo: {}, + }; + }, + components: { + partyPagination, + accountTable, + // addDialog, + // editDialog, + msgDialog, + }, + mounted() { + this.getFirstPageList(); + }, + methods: { + handleSubmit() { + this.getFirstPageList(); }, - components:{ partyPagination, accountTable}, - mounted(){ - + handleReset() { + this.form.userName = ""; + this.form.user = ""; + this.getFirstPageList(); }, - methods:{ - handleSubmit(){ - - }, - handleReset(){ - this.form.user = '' - }, - // å¼¹çª—å…³é— - handleClose(){ - this.$confirm('确认关é—?') - .then(_ => { - done(); - }) - .catch(_ => {}); + getFirstPageList() { + this.page._index = 1; + this.getPageList(); + }, + getPageList() { + let requestParams = {}; + requestParams._index = this.page._index; + requestParams._size = this.page._size; + requestParams.type = this.form.type; + if (this.form.userName) { + requestParams.userName = this.form.userName; + } + if (this.form.status) { + requestParams.status = this.form.status; + } + this.$https( + { + method: "get", + url: "tUser/getPageList", + authType: this.backToken, }, - handleAction(params){ - console.log(params.type) - } - } -} + requestParams + ) + .then((res) => { + if (res.status != 200) { + this.getResWithOutData(); + } else { + if (res.data.resultCode == 200) { + this.list = res.data.data.records; + this.page._size = res.data.data.size; + this.page.total = res.data.data.total; + } else { + this.getResWithOutData(); + } + } + }) + .catch((err) => { + console.log(err); + }); + }, + // æ–°å¢žè´¦å· + handleAdd() { + this.$refs.addDialog.dialogVisible = true; + }, + // 编辑 + handleEdit() { + this.$refs.editDialog.id = this.activeRow.id; + this.$refs.editDialog.getDetailById(); + this.$refs.editDialog.dialogVisible = true; + }, + // é‡ç½®å¯†ç + handleResetPwd() { + let _this = this; + this.$https({ + method: "put", + url: `tUser/resetPassword?userId=${this.activeRow.id}`, + authType: this.backToken, + }) + .then((res) => { + if (res.status != 200) { + _this.$message.error(res.data.message); + } else { + if (res.data.resultCode == 200) { + _this.msgInfo = { + type: "success", + des: `用户${this.activeRow.userName}密ç å·²é‡ç½®ï¼`, + }; + _this.$refs.msgDilaog.dialogVisible = true; + } else { + _this.$message.error(res.data.message); + } + } + }) + .catch((err) => { + console.log(err); + }); + }, + // ç¦ç”¨ + handleDisable() { + let _this = this; + this.$https({ + method: "put", + url: `tUser/disable?userId=${this.activeRow.id}`, + authType: this.backToken, + }) + .then((res) => { + if (res.status != 200) { + _this.$message.error(res.data.message); + } else { + if (res.data.resultCode == 200) { + _this.msgInfo = { + type: "wait", + des: `${this.activeRow.userName}è´¦å·ç¦ç”¨ç”³è¯·å·²æäº¤ï¼Œå¾…å®¡æ ¸â€¦`, + }; + _this.$refs.msgDilaog.dialogVisible = true; + _this.getPageList(); + } else { + _this.$message.error(res.data.message); + } + } + }) + .catch((err) => { + console.log(err); + }); + }, + // 激活 + handleActive() { + let _this = this; + this.$https({ + method: "put", + url: `tUser/disable?userId=${this.activeRow.id}`, + authType: this.backToken, + }) + .then((res) => { + if (res.status != 200) { + _this.$message.error(res.data.message); + } else { + if (res.data.resultCode == 200) { + _this.msgInfo = { + type: "success", + des: `用户${this.activeRow.userName}è´¦å·æ¿€æ´»æˆåŠŸï¼`, + }; + _this.$refs.msgDilaog.dialogVisible = true; + _this.getPageList(); + } else { + this.$message.error(res.data.message); + } + } + }) + .catch((err) => { + console.log(err); + }); + }, + handleAction(params) { + this.activeRow = params.row; + switch (params.type) { + case "enable": + this.handleActive(); + break; + case "disable": + this.handleDisable(); + break; + case "reset": + this.handleResetPwd(); + break; + case "edit": + this.handleEdit(); + break; + default: + break; + } + }, + // 翻页 + handleChangeCurrent() { + this.page._index = val; + this.getPageList(); + }, + }, +}; </script> <style lang="less" scoped> - </style> \ No newline at end of file diff --git a/src/page/accounts/users.vue b/src/page/accounts/users.vue index 81621b4..1df1e4e 100644 --- a/src/page/accounts/users.vue +++ b/src/page/accounts/users.vue @@ -50,7 +50,7 @@ export default { return { form: { userName: "", - type: 1, //1.ç”¨æˆ·è´¦å· 2.å¹³å°å•ä½å•ä½ç®¡ç†å‘˜è´¦å· 3.æœºé¡¶ç›’è´¦å· 4.è¿ç»´è´¦å· + type: 1, //1.ç”¨æˆ·è´¦å· 2.å¹³å°å•ä½å•ä½ç®¡ç†å‘˜è´¦å· 3.æœºé¡¶ç›’è´¦å· 4.è¿ç»´è´¦å· 5. ç»Ÿè®¡è´¦å· }, feildList: [ { prop: "userName", label: "å¹³å°ç”¨æˆ·å" }, diff --git a/src/page/index/index.vue b/src/page/index/index.vue index 000e889..8c220d8 100644 --- a/src/page/index/index.vue +++ b/src/page/index/index.vue @@ -17,9 +17,10 @@ <span class="panel-box-sub-title_name">{{subItem.name}}</span> </div> <ul > - <li v-for="(menu,mIndex) in subItem.children" :key="mIndex" @click="goPage(menu.url)" :class="menu.color"> - - <i :class="menu.icon" class="icon-memu"></i> + <li v-for="(menu,mIndex) in subItem.children" :key="mIndex" @click="goPage(menu.url)" > + <div :class="menu.color" class="icon-div"> + <i :class="menu.icon" class="icon-memu"></i> + </div> <span class="menu-label">{{menu.name}}</span> </li> </ul> @@ -54,37 +55,13 @@ export default{ <style lang="less" scoped> @import '~@/style/menu.less'; @media screen and (max-width: 1440px) { - .index-container{ - width: 100%; - } - .panel-sub-box ul li{ - padding:1.25vw 10px; - .menu-label{ - font-size: 14px; - } - } + .index-container{ width: 100%; } } @media (min-width:1441px) and (max-width:1680px) { - .index-container{ - width: 96%; - } - .panel-sub-box ul li{ - padding:1.25vw 20px; - .menu-label{ - font-size: 14px; - } - } + .index-container{ width: 96%; } } @media (min-width:1681px){ - .index-container{ - width: 92%; - } - .panel-sub-box ul li{ - padding:1.25vw; - .menu-label{ - font-size: 16px; - } - } + .index-container{ width: 92%; } } .index-container{ margin: 0 auto; @@ -163,6 +140,7 @@ export default{ ul{ display: flex; padding-top: 20px; + margin-left: -20px; li{ width: 6.67vw; height:8.33vw ; @@ -171,26 +149,22 @@ export default{ text-align: center; border-radius: 8px; color: @font-color; + cursor: pointer; &:not(:first-child){ margin-left: 20px; } - &.active,&:hover{ - background: @party-red; - box-shadow: 0 8px 4px -4px rgba(155,30,35,0.40); - border-radius: 8px; - border-radius: 8px; - color: @party-white; - cursor: pointer; - color:@party-white; + .icon-div{ + padding-top: 0.94vw; + height: 4.79vw; + width: 4.79vw; + border-radius: 16px; + margin: 0 auto 0.8vw ; } .icon-memu{ display: block; - width: 2.08vw; - height: 2.08vw; - border-radius:50%; - margin: 0 auto 0.83vw; - background-image: linear-gradient(180deg, #FFF7E8 0%, #FFEDCC 100%); - box-shadow: 0 4px 8px 0 rgba(0,0,0,0.20); + margin: 0 auto; + width: 2.91vw; + height: 2.91vw; } .menu-label{ line-height: 24px; diff --git a/src/style/menu.less b/src/style/menu.less index 3fcfff8..3bd77e5 100644 --- a/src/style/menu.less +++ b/src/style/menu.less @@ -2,7 +2,9 @@ @party-pink:#CF6BA4; @party-blue:#5E8DE5; @party-green:#3DD0C6; -@colors: purple, pink, blue, green,red; +@party-red:#B93838; +@colors: @party-purple, @party-pink, @party-blue, @party-green,@party-red; +@colorName:-purple,-pink,-blue,-green,-red; @iconList:headContent,copyrights,classify,content,plane, pen,data,headAudit,video,screen,magnifier,disable,headUser,interaction, account,headStb,radio,message,gear,appversion,interface,headStatistics,overview,tend, @@ -16,9 +18,8 @@ } }); - each(@colors, { - // .index-@{value}{ - // background-color: @{party-@{value}} - // } - + each(@colorName, { + .index@{value}{ + background-color: extract(@colors, @index); + } }); \ No newline at end of file -- 2.18.1