制造成本分析配合后端修改&添加顶部账号显示

This commit is contained in:
2026-04-20 13:02:19 +08:00
parent 8105e74122
commit 835d4efd5b
29 changed files with 258 additions and 111 deletions

View File

@@ -12,9 +12,9 @@ VUE_APP_TITLE = 洛玻集团驾驶舱
# 杨姗姗 # 杨姗姗
# VUE_APP_BASE_API = 'http://172.16.20.218:7070' # VUE_APP_BASE_API = 'http://172.16.20.218:7070'
# 小田 # 小田
# VUE_APP_BASE_API = 'http://172.16.19.232:7070' VUE_APP_BASE_API = 'http://172.16.19.232:7070'
# 测试 # 测试
VUE_APP_BASE_API = 'http://192.168.0.35:8080' # VUE_APP_BASE_API = 'http://192.168.0.35:8080'
# 闫阳 # 闫阳
# VUE_APP_BASE_API = 'http://172.16.19.131:7070' # VUE_APP_BASE_API = 'http://172.16.19.131:7070'

View File

@@ -14,15 +14,16 @@
<i class="el-icon-caret-bottom" /> <i class="el-icon-caret-bottom" />
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<router-link to="/user/profile"> <!-- <router-link to="/user/profile">
<el-dropdown-item>个人中心</el-dropdown-item> <el-dropdown-item>个人中心</el-dropdown-item>
</router-link> </router-link> -->
<!-- <el-dropdown-item @click.native="setting = true"> <!-- <el-dropdown-item @click.native="setting = true">
<span>布局设置</span> <span>布局设置</span>
</el-dropdown-item> --> </el-dropdown-item> -->
<el-dropdown-item divided @click.native="logout"> <el-dropdown-item @click.native="logout">
<span>退出登录</span> <span>退出登录</span>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item divided @click.native='handleToggle'>切换账号</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
@@ -97,7 +98,12 @@ export default {
checkPermi(permissions) { checkPermi(permissions) {
return this.$auth.hasPermi(permissions) return this.$auth.hasPermi(permissions)
return true; return true;
} },
handleToggle() {
this.$store.dispatch('LogOut').then(() => {
location.href = getPath('/index');
})
},
} }
} }
</script> </script>

View File

@@ -8,13 +8,17 @@
<!-- 右侧区域全屏按钮 --> <!-- 右侧区域全屏按钮 -->
<div class="right-content"> <div class="right-content">
<el-dropdown trigger="click"> <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<el-button type="text" class="logout-btn" :title="'退出'"> <div class="avatar-wrapper">
<svg-icon style="color: #0B58FF;" icon-class="logout" /> <img :src="require(`../../../assets/images/choicepart/avatar.png`)" class="user-avatar">
</el-button> <span v-if="nickname" class="user-nickname">{{ nickname }}</span>
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native='logout'>退出登录</el-dropdown-item> <el-dropdown-item @click.native="logout">
<el-dropdown-item @click.native='handleToggle'>切换账号</el-dropdown-item> <span>退出登录</span>
</el-dropdown-item>
<el-dropdown-item divided @click.native='handleToggle'>切换账号</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<el-button type="text" class="screen-btn" @click="changeHomeSider"> <el-button type="text" class="screen-btn" @click="changeHomeSider">
@@ -44,6 +48,7 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
import moment from 'moment' import moment from 'moment'
import {getPath} from "@/utils/ruoyi"; import {getPath} from "@/utils/ruoyi";
export default { export default {
@@ -57,6 +62,9 @@ export default {
default: () => ({}) default: () => ({})
}, },
}, },
computed:{
...mapGetters(['nickname']),
},
data() { data() {
return { return {
currentTime: '', currentTime: '',
@@ -371,13 +379,34 @@ export default {
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
.avatar-container {
margin-right: 30px;
.logout-btn { .avatar-wrapper {
width: 30px; display: flex;
height: 30px; justify-content: center;
font-size: 30px; align-items: center;
padding: 0; position: relative;
margin-top: 2px;
.user-avatar {
cursor: pointer;
width: 32px;
height: 32px;
border-radius: 50%;
}
.user-nickname{
margin-left: 5px;
font-size: 14px;
}
.el-icon-caret-bottom {
cursor: pointer;
position: absolute;
right: -20px;
top: 10px;
font-size: 12px;
}
}
} }
} }

View File

@@ -7,13 +7,17 @@
<!-- 右侧区域全屏按钮 --> <!-- 右侧区域全屏按钮 -->
<div class="right-content"> <div class="right-content">
<el-dropdown trigger="click"> <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<el-button type="text" class="logout-btn" :title="'退出'"> <div class="avatar-wrapper">
<svg-icon style="color: #0B58FF;" icon-class="logout" /> <img :src="require(`../../../assets/images/choicepart/avatar.png`)" class="user-avatar">
</el-button> <span v-if="nickname" class="user-nickname">{{ nickname }}</span>
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native='logout'>退出登录</el-dropdown-item> <el-dropdown-item @click.native="logout">
<el-dropdown-item @click.native='handleToggle'>切换账号</el-dropdown-item> <span>退出登录</span>
</el-dropdown-item>
<el-dropdown-item divided @click.native='handleToggle'>切换账号</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<el-button type="text" class="return-btn" :title="'返回'" @click="handleReturn"> <el-button type="text" class="return-btn" :title="'返回'" @click="handleReturn">
@@ -43,6 +47,7 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
import moment from 'moment'; // 引入moment import moment from 'moment'; // 引入moment
import {getPath} from "@/utils/ruoyi"; import {getPath} from "@/utils/ruoyi";
export default { export default {
@@ -57,6 +62,9 @@ export default {
}, },
isBudget: { type: Boolean, default: false }, isBudget: { type: Boolean, default: false },
}, },
computed:{
...mapGetters(['nickname']),
},
data() { data() {
return { return {
currentTime: '', currentTime: '',
@@ -360,11 +368,34 @@ export default {
padding: 0; padding: 0;
} }
.logout-btn { .avatar-container {
width: 28px; margin-right: 30px;
height: 28px;
font-size: 28px; .avatar-wrapper {
padding: 0; display: flex;
justify-content: center;
align-items: center;
position: relative;
.user-avatar {
cursor: pointer;
width: 32px;
height: 32px;
border-radius: 50%;
}
.user-nickname{
margin-left: 5px;
font-size: 14px;
}
.el-icon-caret-bottom {
cursor: pointer;
position: absolute;
right: -20px;
top: 10px;
font-size: 12px;
}
}
} }
} }

View File

@@ -7,13 +7,17 @@
<!-- 右侧区域全屏按钮 --> <!-- 右侧区域全屏按钮 -->
<div class="right-content"> <div class="right-content">
<el-dropdown trigger="click"> <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<el-button type="text" class="logout-btn" :title="'退出'"> <div class="avatar-wrapper">
<svg-icon style="color: #0B58FF;" icon-class="logout" /> <img :src="require(`../../../assets/images/choicepart/avatar.png`)" class="user-avatar">
</el-button> <span v-if="nickname" class="user-nickname">{{ nickname }}</span>
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native='logout'>退出登录</el-dropdown-item> <el-dropdown-item @click.native="logout">
<el-dropdown-item @click.native='handleToggle'>切换账号</el-dropdown-item> <span>退出登录</span>
</el-dropdown-item>
<el-dropdown-item divided @click.native='handleToggle'>切换账号</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<el-button type="text" class="return-btn" :title="'返回'" @click="handleReturn"> <el-button type="text" class="return-btn" :title="'返回'" @click="handleReturn">
@@ -39,6 +43,7 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
import moment from 'moment'; // 引入moment import moment from 'moment'; // 引入moment
import {getPath} from "@/utils/ruoyi"; import {getPath} from "@/utils/ruoyi";
export default { export default {
@@ -64,6 +69,9 @@ export default {
activeTime: 1, // 默认月维度0=日1=月2=年) activeTime: 1, // 默认月维度0=日1=月2=年)
} }
}, },
computed:{
...mapGetters(['nickname']),
},
watch: { watch: {
activeTime(newVal, oldVal) { activeTime(newVal, oldVal) {
if (newVal !== oldVal) { if (newVal !== oldVal) {
@@ -346,11 +354,34 @@ export default {
padding: 0; padding: 0;
} }
.logout-btn { .avatar-container {
width: 28px; margin-right: 30px;
height: 28px;
font-size: 28px; .avatar-wrapper {
padding: 0; display: flex;
justify-content: center;
align-items: center;
position: relative;
.user-avatar {
cursor: pointer;
width: 32px;
height: 32px;
border-radius: 50%;
}
.user-nickname{
margin-left: 5px;
font-size: 14px;
}
.el-icon-caret-bottom {
cursor: pointer;
position: absolute;
right: -20px;
top: 10px;
font-size: 12px;
}
}
} }
} }

View File

@@ -152,7 +152,7 @@ export default {
yAxis: [ yAxis: [
{ {
type: 'value', type: 'value',
name: '元', name: '元',
nameTextStyle: { nameTextStyle: {
color: 'rgba(0, 0, 0, 0.45)', color: 'rgba(0, 0, 0, 0.45)',
fontSize: 12, fontSize: 12,

View File

@@ -98,7 +98,7 @@ export default {
// 左侧Y轴营业收入、成本单位万元 // 左侧Y轴营业收入、成本单位万元
{ {
type: 'value', type: 'value',
name: '元', name: '元',
nameTextStyle: { nameTextStyle: {
color: 'rgba(0, 0, 0, 0.45)', color: 'rgba(0, 0, 0, 0.45)',
fontSize: 12, fontSize: 12,

View File

@@ -95,7 +95,7 @@ export default {
meterialName:'', meterialName:'',
materialOptions: [ materialOptions: [
{value:'氢氧化铝',label:'氢氧化铝'}, {value:'氢氧化铝',label:'氢氧化铝'},
{value:'碎玻璃',label:'碎玻璃'}, {value:'碎玻璃(外购)',label:'碎玻璃'},
{value:'助熔剂',label:'助熔剂'}, {value:'助熔剂',label:'助熔剂'},
{value:'白云石',label:'白云石'}, {value:'白云石',label:'白云石'},
{value:'石灰石',label:'石灰石'}, {value:'石灰石',label:'石灰石'},
@@ -196,6 +196,7 @@ export default {
trendName: '原料' + this.meterialName + this.trendName, trendName: '原料' + this.meterialName + this.trendName,
analysisObject: [this.meterialName], analysisObject: [this.meterialName],
levelId: this.factory, levelId: this.factory,
isOriginal:0,//0:原片 1:加工
}; };
// 调用接口 // 调用接口
getSingleMaterialAnalysis(requestParams).then((res) => { getSingleMaterialAnalysis(requestParams).then((res) => {

View File

@@ -89,9 +89,7 @@ export default {
totalData: {}, totalData: {},
trend: [], trend: [],
relatedData: {}, relatedData: {},
trendName: '天然气', trendName: '原片燃料成本'
// monthRelatedData: [],
// totalRelatedData: [],
}; };
}, },
@@ -183,8 +181,7 @@ export default {
const requestParams = { const requestParams = {
startTime: this.dateData.startTime, startTime: this.dateData.startTime,
endTime: this.dateData.endTime, endTime: this.dateData.endTime,
// index: this.index, isOriginal:0,//0:原片 1:加工
// sort: 1,
trendName: this.trendName +'成本', trendName: this.trendName +'成本',
analysisObject: [ analysisObject: [
"原片燃料成本", "原片燃料成本",

View File

@@ -181,8 +181,7 @@ export default {
const requestParams = { const requestParams = {
startTime: this.dateData.startTime, startTime: this.dateData.startTime,
endTime: this.dateData.endTime, endTime: this.dateData.endTime,
// index: this.index, isOriginal:0,//0:原片 1:加工
// sort: 1,
trendName: this.trendName, trendName: this.trendName,
analysisObject: [ analysisObject: [
"原片原料成本", "原片原料成本",

View File

@@ -183,6 +183,7 @@ export default {
startTime: this.dateData.startTime, startTime: this.dateData.startTime,
endTime: this.dateData.endTime, endTime: this.dateData.endTime,
trendName: this.trendName, trendName: this.trendName,
isOriginal:0,//0:原片 1:加工
analysisObject: [ analysisObject: [
"原片制造费用成本", "原片制造费用成本",
], ],

View File

@@ -180,8 +180,9 @@ export default {
startTime: this.dateData.startTime, startTime: this.dateData.startTime,
endTime: this.dateData.endTime, endTime: this.dateData.endTime,
trendName: this.trendName, trendName: this.trendName,
analysisObject: [this.overheadName + '成本'], analysisObject: [this.overheadName],
levelId: this.factory, levelId: this.factory,
isOriginal:0,//0:原片 1:加工
}; };
// 调用接口 // 调用接口
getSingleMaterialCostAnalysis(requestParams).then((res) => { getSingleMaterialCostAnalysis(requestParams).then((res) => {

View File

@@ -183,8 +183,7 @@ export default {
const requestParams = { const requestParams = {
startTime: this.dateData.startTime, startTime: this.dateData.startTime,
endTime: this.dateData.endTime, endTime: this.dateData.endTime,
// index: this.index, isOriginal:0,//0:原片 1:加工
// sort: 1,
trendName: this.trendName, trendName: this.trendName,
analysisObject: [ analysisObject: [
"原片成本", "原片成本",

View File

@@ -77,7 +77,7 @@ export default {
totalData: {}, totalData: {},
trend: [], trend: [],
relatedData: {}, relatedData: {},
trendName: '人工成本', trendName: '原片人工成本',
}; };
}, },
@@ -170,8 +170,9 @@ export default {
startTime: this.dateData.startTime, startTime: this.dateData.startTime,
endTime: this.dateData.endTime, endTime: this.dateData.endTime,
trendName: this.trendName, trendName: this.trendName,
isOriginal:0,//0:原片 1:加工
analysisObject: [ analysisObject: [
'人工成本' '原片人工成本'
], ],
levelId: this.factory, levelId: this.factory,
}; };

View File

@@ -181,6 +181,7 @@ export default {
startTime: this.dateData.startTime, startTime: this.dateData.startTime,
endTime: this.dateData.endTime, endTime: this.dateData.endTime,
trendName: this.trendName, trendName: this.trendName,
isOriginal:0,//0:原片 1:加工
analysisObject: [ analysisObject: [
"原片电成本", "原片电成本",
], ],

View File

@@ -183,6 +183,7 @@ export default {
startTime: this.dateData.startTime, startTime: this.dateData.startTime,
endTime: this.dateData.endTime, endTime: this.dateData.endTime,
trendName: this.trendName, trendName: this.trendName,
isOriginal:1,//0:原片 1:加工
analysisObject: [ analysisObject: [
"加工辅料成本", "加工辅料成本",
], ],

View File

@@ -186,6 +186,7 @@ export default {
"加工制造费用成本", "加工制造费用成本",
], ],
levelId: this.factory, levelId: this.factory,
isOriginal:1,//0:原片 1:加工
}; };
// 调用接口 // 调用接口
getCostAnalysisData(requestParams).then((res) => { getCostAnalysisData(requestParams).then((res) => {

View File

@@ -175,6 +175,7 @@ export default {
'包材成本' '包材成本'
], ],
levelId: this.factory, levelId: this.factory,
isOriginal:1,//0:原片 1:加工
}; };
// 调用接口 // 调用接口
getSingleMaterialCostAnalysis(requestParams).then((res) => { getSingleMaterialCostAnalysis(requestParams).then((res) => {

View File

@@ -184,6 +184,7 @@ export default {
startTime: this.dateData.startTime, startTime: this.dateData.startTime,
endTime: this.dateData.endTime, endTime: this.dateData.endTime,
trendName: this.trendName, trendName: this.trendName,
isOriginal:1,//0:原片 1:加工
analysisObject: [ analysisObject: [
"加工成本", "加工成本",
], ],

View File

@@ -182,6 +182,7 @@ export default {
startTime: this.dateData.startTime, startTime: this.dateData.startTime,
endTime: this.dateData.endTime, endTime: this.dateData.endTime,
trendName: this.trendName, trendName: this.trendName,
isOriginal:1,//0:原片 1:加工
analysisObject: [ analysisObject: [
"加工燃料成本", "加工燃料成本",
], ],

View File

@@ -170,6 +170,7 @@ export default {
startTime: this.dateData.startTime, startTime: this.dateData.startTime,
endTime: this.dateData.endTime, endTime: this.dateData.endTime,
trendName: this.trendName, trendName: this.trendName,
isOriginal:1,//0:原片 1:加工
analysisObject: [ analysisObject: [
'加工人工成本' '加工人工成本'
], ],

View File

@@ -221,8 +221,7 @@ export default {
const requestParams = { const requestParams = {
startTime: this.dateData.startTime, startTime: this.dateData.startTime,
endTime: this.dateData.endTime, endTime: this.dateData.endTime,
// index: this.index, isOriginal:0,//0:原片 1:加工
// sort: 1,
trendName: this.trendName, trendName: this.trendName,
analysisObject: [this.fuelName], analysisObject: [this.fuelName],
// paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'], // paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'],

View File

@@ -190,9 +190,10 @@ export default {
const requestParams = { const requestParams = {
startTime: this.dateData.startTime, startTime: this.dateData.startTime,
endTime: this.dateData.endTime, endTime: this.dateData.endTime,
trendName: this.auxMatName + '成本' + this.trendName, trendName: this.auxMatName + this.trendName,
analysisObject: [this.auxMatName + '成本'], analysisObject: [this.auxMatName],
levelId: this.factory, levelId: this.factory,
isOriginal:1,//0:原片 1:加工
}; };
// 调用接口 // 调用接口
getSingleMaterialAnalysis(requestParams).then((res) => { getSingleMaterialAnalysis(requestParams).then((res) => {

View File

@@ -82,7 +82,7 @@ export default {
trendName: '', trendName: '',
overheadName:'', overheadName:'',
overheadOptions: [ overheadOptions: [
{value:'备件机物料',label:'备件机物料'}, {value:'备件机物料',label:'备件机物料'},
{value:'折旧',label:'折旧'}, {value:'折旧',label:'折旧'},
{value:'其他',label:'其他'} {value:'其他',label:'其他'}
] ]
@@ -151,7 +151,7 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.overheadName = this.$route.query.name ? this.$route.query.name : '备件机物料' this.overheadName = this.$route.query.name ? this.$route.query.name : '备件机物料'
if(this.$route.query.factory){ if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory) this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) { }else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
@@ -169,15 +169,16 @@ export default {
trendName: this.overheadName+'成本', trendName: this.overheadName+'成本',
analysisObject: ['加工制造费用成本'], analysisObject: ['加工制造费用成本'],
levelId: this.factory, levelId: this.factory,
isOriginal:1,//0:原片 1:加工
}; };
// 调用接口 // 调用接口
getSingleMaterialCostAnalysis(requestParams).then((res) => { getSingleMaterialCostAnalysis(requestParams).then((res) => {
this.monData = res.data.currentMonthData.find(item => { this.monData = res.data.currentMonthData.find(item => {
return item.name === "加工制造费用成本"; return item.name === this.overheadName+'成本';
}); });
this.totalData = res.data.totalMonthData.find(item => { this.totalData = res.data.totalMonthData.find(item => {
return item.name === "加工制造费用成本"; return item.name === this.overheadName+'成本';
}); });
this.trend = res.data.dataTrend this.trend = res.data.dataTrend
}); });

View File

@@ -191,6 +191,7 @@ export default {
trendName: this.trendName, trendName: this.trendName,
analysisObject: [this.fuelName], analysisObject: [this.fuelName],
levelId: this.factory, levelId: this.factory,
isOriginal:1,//0:原片 1:加工
}; };
// 调用接口 // 调用接口
getSingleMaterialAnalysis(requestParams).then((res) => { getSingleMaterialAnalysis(requestParams).then((res) => {

View File

@@ -60,25 +60,36 @@ export default {
data() { data() {
return { return {
isDropdownShow: false, isDropdownShow: false,
selectedProfit: '采购单价', // 选中的名称初始为null selectedProfit: '', // 初始化为空,由 watch 填充
unit:'元/度' unit: '' // 初始化为空,由 watch 填充
}; };
}, },
watch: { watch: {
// 监听 fuelName 变化,动态设置默认选中项和单位
fuelName: { fuelName: {
handler(newVal) { handler(newVal) {
this.profitOptions.forEach(item => { if (newVal === '电') {
if (item.name === this.selectedProfit) { this.selectedProfit = '原片电成本';
this.unit = item.unit this.unit = '元/㎡';
} else {
this.selectedProfit = '采购单价';
this.unit = '元/m³'; // 注意:原代码非电情况下单位逻辑可能需要确认,这里暂定为 m³ 或根据 profitOptions 动态获取
// 更严谨的做法是根据 profitOptions 查找默认项的单位
const defaultOption = this.profitOptions.find(item => item.name === this.selectedProfit);
if (defaultOption) {
this.unit = defaultOption.unit;
} }
})
} }
},
immediate: true // 组件创建时立即执行一次,解决初始化取值问题
} }
}, },
computed: { computed: {
profitOptions() { profitOptions() {
if (this.fuelName === '电') { if (this.fuelName === '电') {
return [ return [
{ name: '原片电成本', unit: '元/㎡' },
{ name: '采购单价', unit: '元/度' }, { name: '采购单价', unit: '元/度' },
{ name: '产量', unit: '㎡' }, { name: '产量', unit: '㎡' },
{ name: '单耗', unit: '度/㎡' }, { name: '单耗', unit: '度/㎡' },

View File

@@ -7,13 +7,17 @@
<!-- 右侧区域全屏按钮 --> <!-- 右侧区域全屏按钮 -->
<div class="right-content"> <div class="right-content">
<el-dropdown trigger="click"> <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<el-button type="text" class="logout-btn" :title="'退出'"> <div class="avatar-wrapper">
<svg-icon style="color: #0B58FF;" icon-class="logout" /> <img :src="require(`../../../assets/images/choicepart/avatar.png`)" class="user-avatar">
</el-button> <span v-if="nickname" class="user-nickname">{{ nickname }}</span>
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native='logout'>退出登录</el-dropdown-item> <el-dropdown-item @click.native="logout">
<el-dropdown-item @click.native='handleToggle'>切换账号</el-dropdown-item> <span>退出登录</span>
</el-dropdown-item>
<el-dropdown-item divided @click.native='handleToggle'>切换账号</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<el-button type="text" class="return-btn" :title="'返回'" @click="handleReturn"> <el-button type="text" class="return-btn" :title="'返回'" @click="handleReturn">
@@ -51,6 +55,7 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
import moment from 'moment'; // 引入moment import moment from 'moment'; // 引入moment
import {getPath} from "@/utils/ruoyi"; import {getPath} from "@/utils/ruoyi";
export default { export default {
@@ -76,6 +81,9 @@ export default {
default: () => [] default: () => []
} }
}, },
computed:{
...mapGetters(['nickname']),
},
data() { data() {
return { return {
currentTime: '', currentTime: '',
@@ -414,11 +422,34 @@ export default {
padding: 0; padding: 0;
} }
.logout-btn { .avatar-container {
width: 28px; margin-right: 30px;
height: 28px;
font-size: 28px; .avatar-wrapper {
padding: 0; display: flex;
justify-content: center;
align-items: center;
position: relative;
.user-avatar {
cursor: pointer;
width: 32px;
height: 32px;
border-radius: 50%;
}
.user-nickname{
margin-left: 5px;
font-size: 14px;
}
.el-icon-caret-bottom {
cursor: pointer;
position: absolute;
right: -20px;
top: 10px;
font-size: 12px;
}
}
} }
} }

View File

@@ -67,18 +67,18 @@ export default {
computed: { computed: {
indicatorDefs() { indicatorDefs() {
return [ return [
{ key: 'naturalGas', name: '天然气', unit: '元/㎡',route:'singleCombustible'}, { key: 'naturalGas', name: '天然气', label:'天然气成本',unit: '元/㎡',route:'singleCombustible'},
{ key: 'lng', name: 'LNG液化天然气', unit: '元/㎡',route:'singleCombustible'}, { key: 'lng', name: 'LNG液化天然气', label:'LNG液化天然气成本', unit: '元/㎡',route:'singleCombustible'},
{ key: 'heavyOil', name: '重油', unit: '元/㎡',route:'singleCombustible'}, { key: 'heavyOil', name: '重油', label:'重油成本', unit: '元/㎡',route:'singleCombustible'},
{ key: 'water', name: '水', unit: '元/m³',route:'singleCombustible'} { key: 'water', name: '水', label:'水成本', unit: '元/m³',route:'singleCombustible'}
] ]
}, },
indicators() { indicators() {
const fallback = { targetValue: 0, value: 0, completed: 0, diffValue: 0 } const fallback = { targetValue: 0, value: 0, completed: 0, diffValue: 0 }
const list = (Array.isArray(this.activeData) ? this.activeData : []) const list = (Array.isArray(this.activeData) ? this.activeData : [])
console.log('数据集:', list);
return this.indicatorDefs.map(def => { return this.indicatorDefs.map(def => {
const data = list.find(item => item && item.name.includes(def.name)) || fallback const data = list.find(item => item.name === def.label) || fallback;
return { return {
...def, ...def,
data, data,

View File

@@ -68,11 +68,11 @@ export default {
computed: { computed: {
indicatorDefs() { indicatorDefs() {
return [ return [
{ key: 'rawMaterialCost', name: '原料成本', unit: '元/㎡', route: 'fuelCostAnalysis/fuelCostAnalysis'}, { key: 'rawMaterialCost', name: '原料成本',label:'原料成本', unit: '元/㎡', route: 'fuelCostAnalysis/fuelCostAnalysis'},
{ key: 'fuelCost', name: '燃料成本', unit: '元/㎡', route: 'combustible/combustible'}, { key: 'fuelCost', name: '燃料成本',label:'原片燃料成本', unit: '元/㎡', route: 'combustible/combustible'},
{ key: 'electricityCost', name: '电成本', unit: '元/㎡', route: 'osElectricityCostAnalysis'}, { key: 'electricityCost', name: '电成本',label:'原片电成本', unit: '元/㎡', route: 'osElectricityCostAnalysis'},
{ key: 'laborCost', name: '人工成本', unit: '元/㎡', route: 'originalSheetLabor'}, { key: 'laborCost', name: '人工成本',label:'人工成本', unit: '元/㎡', route: 'originalSheetLabor'},
{ key: 'manufacturingCost', name: '制造成本', unit: '元/㎡', route: 'mfgOverheadCostAnalysis/mfgOverheadCostAnalysis'}, { key: 'manufacturingCost', name: '制造成本',label:'制造成本', unit: '元/㎡', route: 'mfgOverheadCostAnalysis/mfgOverheadCostAnalysis'},
] ]
}, },
indicators() { indicators() {
@@ -80,7 +80,7 @@ export default {
const list = (Array.isArray(this.activeData) ? this.activeData : []) const list = (Array.isArray(this.activeData) ? this.activeData : [])
return this.indicatorDefs.map(def => { return this.indicatorDefs.map(def => {
const data = list.find(item => item && item.name === def.name) || fallback const data = list.find(item => item && item.name === def.label) || fallback
return { return {
...def, ...def,
data, data,