Commit e711bf96 by wangren

首页部分内容修改

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