Commit e711bf96 by wangren

首页部分内容修改

parent e098cc0f
<template> <template>
<div class="self-header"> <div class="self-header">
<div style="display: inline-block;margin: 5px 15px 5px 0;height: 50px;"> <div style="display: inline-block; margin: 5px 15px 5px 0; height: 50px">
<img src="../../assets/logo.png" alt="" style="height: 100%;" /> <img src="../../assets/logo_guangda.png" alt="" style="height: 100%" />
</div> </div>
<div class="self_header_label"> <div class="self_header_label">
<h2>新押汇系统</h2> <h2>光大银行国际结算系统</h2>
</div> </div>
<div class="header-tool"> <div class="header-tool">
<div class="header-subInstName"> <div class="header-subInstName">
...@@ -26,46 +26,50 @@ ...@@ -26,46 +26,50 @@
<div class="header-tool-userdetail"> <div class="header-tool-userdetail">
<div>{{ user.userName }}</div> <div>{{ user.userName }}</div>
<div class="long-text" :title="user.userId"> <div class="long-text" :title="user.userId">
<i class="el-icon-user" style="padding:0px 5px;"></i> <i class="el-icon-user" style="padding: 0px 5px"></i>
<span style="letter-spacing:1px;">{{ user.userId }}</span> <span style="letter-spacing: 1px">{{ user.userId }}</span>
</div> </div>
<div class="long-text" :title="user.instName"> <div class="long-text" :title="user.instName">
<i class="el-icon-office-building" style="padding:0px 5px;"></i> <i class="el-icon-office-building" style="padding: 0px 5px"></i>
{{ user.instName }} {{ user.instName }}
</div> </div>
<div class="long-text" :title="user.roleName"> <div class="long-text" :title="user.roleName">
<i class="el-icon-collection-tag" style="padding:0px 5px;"></i> <i class="el-icon-collection-tag" style="padding: 0px 5px"></i>
{{ user.roleName }} {{ user.roleName }}
</div> </div>
<el-row class="header-tool-userdetail-action"> <el-row class="header-tool-userdetail-action">
<el-button @click="showChgPwdDialog" size="small" style="width:100%"
>修改密码</el-button
>
<el-button <el-button
@click="showHomeCellSettingDialog" @click="showHomeCellSettingDialog"
size="small" size="small"
style="width:100%;margin-left:0px;margin-top:5px" style="width: 100%; margin-left: 0px; margin-top: 5px"
>首页组件</el-button >首页组件</el-button
> >
<el-button <el-button
@click="showChgPwdDialog"
size="small"
style="width: 100%; margin-left: 0px; margin-top: 5px"
>修改密码</el-button
>
<el-button
@click="showLogoutDialog(false)" @click="showLogoutDialog(false)"
size="small" size="small"
style="width:100%;margin-left:0px;margin-top:5px" style="width: 100%; margin-left: 0px; margin-top: 5px"
>用户签退</el-button >用户签退</el-button
> >
<el-button <!-- <el-button
@click="showLogoutDialog(true)" @click="showLogoutDialog(true)"
size="small" size="small"
style="width:100%;margin-left:0px;margin-top:5px" style="width:100%;margin-left:0px;margin-top:5px"
>强制签退</el-button >强制签退</el-button
> > -->
</el-row> </el-row>
</div> </div>
<div class="header-tool-item" slot="reference"> <div class="header-tool-item" slot="reference">
<div> <div>
<i class="el-icon-user"></i> <i class="el-icon-user"></i>
<span class="header-tool-item-text">{{ user.userName }}</span> <span class="header-tool-item-text">{{ user.userName }}</span>
<i class="el-icon-arrow-down" style="font-size: 12px;"></i> <i class="el-icon-arrow-down" style="font-size: 12px"></i>
</div> </div>
</div> </div>
</el-popover> </el-popover>
...@@ -86,9 +90,9 @@ ...@@ -86,9 +90,9 @@
</li> </li>
</ul> </ul>
<div class="header-tool-item header-tool-item-text" slot="reference"> <div class="header-tool-item header-tool-item-text" slot="reference">
<i class="el-icon-setting" style="font-size:14px;"></i> <i class="el-icon-setting" style="font-size: 14px"></i>
{{ displayLangName }} {{ displayLangName }}
<i class="el-icon-arrow-down" style="font-size:12px;"></i> <i class="el-icon-arrow-down" style="font-size: 12px"></i>
</div> </div>
</el-popover> </el-popover>
<el-popover placement="bottom" width="450" trigger="hover"> <el-popover placement="bottom" width="450" trigger="hover">
...@@ -98,7 +102,7 @@ ...@@ -98,7 +102,7 @@
<c-page title="公告"> <c-page title="公告">
<c-table :data="noticeboardData"> <c-table :data="noticeboardData">
<el-table-column <el-table-column
label="公告内容" label="通知内容"
prop="noticeContent" prop="noticeContent"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
...@@ -116,7 +120,7 @@ ...@@ -116,7 +120,7 @@
</div> </div>
<div class="header-tool-item" slot="reference"> <div class="header-tool-item" slot="reference">
<i class="el-icon-bell"></i> <i class="el-icon-bell"></i>
<span class="header-tool-item-text" style="padding-left:7px;" <span class="header-tool-item-text" style="padding-left: 7px"
>通知</span >通知</span
> >
</div> </div>
...@@ -124,25 +128,34 @@ ...@@ -124,25 +128,34 @@
<span class="header-tool-item-text">会计日期: {{ accDate }}</span> <span class="header-tool-item-text">会计日期: {{ accDate }}</span>
</div> </div>
<el-dialog custom-class="homeSetting" <el-dialog
:visible="homeSettingDialog" custom-class="homeSetting"
title="首页小组件设置" :visible="homeSettingDialog"
width="60%" title="首页小组件设置"
width="60%"
:before-close="handleCloseHomeSettingDialog" :before-close="handleCloseHomeSettingDialog"
> >
<div style="padding: 0 20px;"> <div style="padding: 0 20px">
<div class="clear"> <div class="clear">
<c-col :span="24" style="margin-bottom: 10px;"> <c-col :span="24" style="margin-bottom: 10px">
选择行数: 选择行数:
<c-select v-model="homeSetting.rows" :clearable="false" @change="updateDisplayArr"> <c-select
v-model="homeSetting.rows"
:clearable="false"
@change="updateDisplayArr"
>
<el-option label="1" :value="1"></el-option> <el-option label="1" :value="1"></el-option>
<el-option label="2" :value="2"></el-option> <el-option label="2" :value="2"></el-option>
<el-option label="3" :value="3"></el-option> <el-option label="3" :value="3"></el-option>
</c-select> </c-select>
</c-col> </c-col>
<c-col :span="24" style="margin-bottom: 10px;"> <c-col :span="24" style="margin-bottom: 10px">
选择列数: 选择列数:
<c-select v-model="homeSetting.cols" :clearable="false" @change="updateDisplayArr"> <c-select
v-model="homeSetting.cols"
:clearable="false"
@change="updateDisplayArr"
>
<el-option label="1" :value="1"></el-option> <el-option label="1" :value="1"></el-option>
<el-option label="2" :value="2"></el-option> <el-option label="2" :value="2"></el-option>
<el-option label="3" :value="3"></el-option> <el-option label="3" :value="3"></el-option>
...@@ -152,10 +165,29 @@ ...@@ -152,10 +165,29 @@
</div> </div>
<div> <div>
<div class="setting-grid-row" v-for="row in getCellRows()" :key="row"> <div class="setting-grid-row" v-for="row in getCellRows()" :key="row">
<div class="setting-grid-col" v-for="col in getCellCols()" :key="col" :style="{ width: 100 / getCellCols() + '%', height: '50px'}"> <div
class="setting-grid-col"
v-for="col in getCellCols()"
:key="col"
:style="{ width: 100 / getCellCols() + '%', height: '50px' }"
>
<div class="cell-item"> <div class="cell-item">
<div>{{ homeSetting.displayArray[row - 1][col - 1].title ? '标题:' + homeSetting.displayArray[row - 1][col - 1].title : '' }}</div> <div>
<div>{{ homeSetting.displayArray[row - 1][col - 1].description ? '描述:' + homeSetting.displayArray[row - 1][col - 1].description : '' }}</div> {{
homeSetting.displayArray[row - 1][col - 1].title
? "标题:" +
homeSetting.displayArray[row - 1][col - 1].title
: ""
}}
</div>
<div>
{{
homeSetting.displayArray[row - 1][col - 1].description
? "描述:" +
homeSetting.displayArray[row - 1][col - 1].description
: ""
}}
</div>
</div> </div>
<div class="cell-operate"> <div class="cell-operate">
<el-dropdown trigger="click"> <el-dropdown trigger="click">
...@@ -163,8 +195,9 @@ ...@@ -163,8 +195,9 @@
设置&nbsp;&nbsp;<i class="el-icon-edit"></i> 设置&nbsp;&nbsp;<i class="el-icon-edit"></i>
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item <el-dropdown-item
v-for="(item,idx) in $store.state.UserContext.homeCellsSetting.defaultCells" v-for="(item, idx) in $store.state.UserContext
.homeCellsSetting.defaultCells"
:key="idx" :key="idx"
@click.native="setCell(row, col, item)" @click.native="setCell(row, col, item)"
> >
...@@ -221,8 +254,8 @@ export default { ...@@ -221,8 +254,8 @@ export default {
homeSetting: { homeSetting: {
rows: null, rows: null,
cols: null, cols: null,
displayArray: [] displayArray: [],
} },
}; };
}, },
computed: { computed: {
...@@ -252,50 +285,62 @@ export default { ...@@ -252,50 +285,62 @@ export default {
// window.location.href = "/#/login" // window.location.href = "/#/login"
}, },
async handleLang(lang) { async handleLang(lang) {
const data = { const data = {
lang: lang lang: lang,
} };
let rtnmsg = await changeLang(data) let rtnmsg = await changeLang(data);
if (rtnmsg.respCode == SUCCESS) { if (rtnmsg.respCode == SUCCESS) {
this.$i18n.locale = lang; this.$i18n.locale = lang;
this.$store.dispatch("I18n/setLang", lang); this.$store.dispatch("I18n/setLang", lang);
this.langSelectVisible = false; this.langSelectVisible = false;
} }
}, },
showLogoutDialog(flg) { showLogoutDialog(flg) {
// this.$refs.logoutform.show(flg); // this.$refs.logoutform.show(flg);
this.$store.dispatch("TagsView/delAllViews").then(() => this.$router.push("/login")) this.$store
.dispatch("TagsView/delAllViews")
.then(() => this.$router.push("/login"));
}, },
showChgPwdDialog() { showChgPwdDialog() {
this.$refs["chgPwdForm"].dialogOpen = true; this.$refs["chgPwdForm"].dialogOpen = true;
}, },
showHomeCellSettingDialog() { showHomeCellSettingDialog() {
this.homeSettingDialog = true; this.homeSettingDialog = true;
this.homeSetting.rows = this.$store.state.UserContext.homeCellsSetting.cellRows this.homeSetting.rows =
this.homeSetting.cols = this.$store.state.UserContext.homeCellsSetting.cellCols this.$store.state.UserContext.homeCellsSetting.cellRows;
this.homeSetting.displayArray = this.$store.state.UserContext.homeCellsSetting.cellNames.map(cellNameRows => { this.homeSetting.cols =
return cellNameRows.map(cellName => { this.$store.state.UserContext.homeCellsSetting.cellCols;
return Object.assign({}, this.$store.state.UserContext.homeCellsSetting.defaultCells.find(cell => cell.name === cellName)) this.homeSetting.displayArray =
}) this.$store.state.UserContext.homeCellsSetting.cellNames.map(
}) (cellNameRows) => {
return cellNameRows.map((cellName) => {
return Object.assign(
{},
this.$store.state.UserContext.homeCellsSetting.defaultCells.find(
(cell) => cell.name === cellName
)
);
});
}
);
}, },
saveHomeSetting() { saveHomeSetting() {
if (!this.homeSetting.rows || !this.homeSetting.cols) { if (!this.homeSetting.rows || !this.homeSetting.cols) {
this.$message.warning('请选择正确的行列数!') this.$message.warning("请选择正确的行列数!");
return return;
} }
const cellNames = this.homeSetting.displayArray.map(row => { const cellNames = this.homeSetting.displayArray.map((row) => {
return row.map(col => col.name) return row.map((col) => col.name);
}) });
if (cellNames.some(row => row.some(cellName => !cellName))) { if (cellNames.some((row) => row.some((cellName) => !cellName))) {
this.$message.warning('请配置全部的格子组件!') this.$message.warning("请配置全部的格子组件!");
return return;
} }
this.$store.commit('UserContext/setHomeCellsSetting', { this.$store.commit("UserContext/setHomeCellsSetting", {
cellRows: this.homeSetting.rows, cellRows: this.homeSetting.rows,
cellCols: this.homeSetting.cols, cellCols: this.homeSetting.cols,
cellNames: cellNames cellNames: cellNames,
}) });
this.homeSettingDialog = false; this.homeSettingDialog = false;
}, },
cancelHomeSetting() { cancelHomeSetting() {
...@@ -306,31 +351,40 @@ export default { ...@@ -306,31 +351,40 @@ export default {
done(); done();
}, },
getCellRows() { getCellRows() {
return this.homeSetting.rows ? this.homeSetting.rows : this.homeSetting.cols ? 1 : 0 return this.homeSetting.rows
? this.homeSetting.rows
: this.homeSetting.cols
? 1
: 0;
}, },
getCellCols() { getCellCols() {
return this.homeSetting.cols ? this.homeSetting.cols : this.homeSetting.rows ? 1 : 0 return this.homeSetting.cols
? this.homeSetting.cols
: this.homeSetting.rows
? 1
: 0;
}, },
updateDisplayArr() { updateDisplayArr() {
const rArr = [] const rArr = [];
for (let i = 0; i < this.getCellRows(); i++) { for (let i = 0; i < this.getCellRows(); i++) {
const cArr = [] const cArr = [];
for (let j = 0; j < this.getCellCols(); j++) { for (let j = 0; j < this.getCellCols(); j++) {
cArr.push({ cArr.push({
title: null, title: null,
name: null, name: null,
description: null description: null,
}) });
} }
rArr.push(cArr) rArr.push(cArr);
} }
this.homeSetting.displayArray = rArr this.homeSetting.displayArray = rArr;
}, },
setCell(row, col, item) { setCell(row, col, item) {
this.homeSetting.displayArray[row - 1][col - 1].title = item.title this.homeSetting.displayArray[row - 1][col - 1].title = item.title;
this.homeSetting.displayArray[row - 1][col - 1].name = item.name this.homeSetting.displayArray[row - 1][col - 1].name = item.name;
this.homeSetting.displayArray[row - 1][col - 1].description = item.description this.homeSetting.displayArray[row - 1][col - 1].description =
} item.description;
},
}, },
}; };
</script> </script>
...@@ -499,6 +553,6 @@ export default { ...@@ -499,6 +553,6 @@ export default {
} }
.homeSetting .setting-grid-col .cell-operate .el-dropdown-link { .homeSetting .setting-grid-col .cell-operate .el-dropdown-link {
cursor: pointer; cursor: pointer;
color: #409EFF; color: #409eff;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment