Compare commits
3 Commits
projects/l
...
projects/l
| Author | SHA1 | Date | |
|---|---|---|---|
| 21aad8176f | |||
| f208c3c744 | |||
| b05d42cfc8 |
@@ -8,11 +8,8 @@ import { isRelogin } from '@/utils/request'
|
|||||||
|
|
||||||
NProgress.configure({ showSpinner: false })
|
NProgress.configure({ showSpinner: false })
|
||||||
|
|
||||||
/**
|
// 从菜单树中查找第一个可见叶子菜单路径(按接口返回顺序)
|
||||||
* 从菜单树中查找 jumpFlag===1 的默认跳转路径
|
function findFirstLeafPathFromMenus(menus) {
|
||||||
* 若打标在父节点则取其下第一个可见叶子路径;若在叶子则直接返回该路径
|
|
||||||
*/
|
|
||||||
function findDefaultPathFromMenus(menus) {
|
|
||||||
if (!Array.isArray(menus) || menus.length === 0) return null
|
if (!Array.isArray(menus) || menus.length === 0) return null
|
||||||
|
|
||||||
function dfs(list, parentPath = '') {
|
function dfs(list, parentPath = '') {
|
||||||
@@ -22,23 +19,34 @@ function findDefaultPathFromMenus(menus) {
|
|||||||
const currentPath = rawPath.startsWith('/')
|
const currentPath = rawPath.startsWith('/')
|
||||||
? rawPath
|
? rawPath
|
||||||
: `${parentPath}/${rawPath}`.replace(/\/+/g, '/')
|
: `${parentPath}/${rawPath}`.replace(/\/+/g, '/')
|
||||||
|
|
||||||
if (item.jumpFlag === 1) {
|
|
||||||
if (item.children && item.children.length > 0) {
|
|
||||||
const childPath = dfs(item.children, currentPath)
|
|
||||||
return childPath != null ? childPath : currentPath
|
|
||||||
}
|
|
||||||
return currentPath
|
|
||||||
}
|
|
||||||
if (item.children && item.children.length > 0) {
|
if (item.children && item.children.length > 0) {
|
||||||
const found = dfs(item.children, currentPath)
|
const found = dfs(item.children, currentPath)
|
||||||
if (found != null) return found
|
if (found != null) return found
|
||||||
|
} else {
|
||||||
|
return currentPath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
return dfs(menus)
|
return dfs(menus)
|
||||||
}
|
}
|
||||||
|
function findFirstLeafPathFromRoutes(routes) {
|
||||||
|
if (!Array.isArray(routes) || routes.length === 0) return null
|
||||||
|
const stack = [...routes]
|
||||||
|
while (stack.length) {
|
||||||
|
const route = stack.shift()
|
||||||
|
if (!route || route.hidden === true) continue
|
||||||
|
if (Array.isArray(route.children) && route.children.length > 0) {
|
||||||
|
stack.unshift(...route.children)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
const p = route.path || ''
|
||||||
|
if (typeof p === 'string' && p.startsWith('/') && p !== '/404') {
|
||||||
|
return p
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
// 增加三方登陆 update by 芋艿
|
// 增加三方登陆 update by 芋艿
|
||||||
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
|
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
|
||||||
@@ -65,11 +73,16 @@ router.beforeEach((to, from, next) => {
|
|||||||
store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => {
|
store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => {
|
||||||
// 根据 roles 权限生成可访问的路由表
|
// 根据 roles 权限生成可访问的路由表
|
||||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||||
const defaultPath = findDefaultPathFromMenus(userInfo.menus) || '/'
|
const menuDefaultPath = findFirstLeafPathFromMenus(userInfo.menus)
|
||||||
|
const routeFallbackPath = findFirstLeafPathFromRoutes(accessRoutes)
|
||||||
|
const defaultPath = menuDefaultPath || routeFallbackPath || '/'
|
||||||
store.dispatch('SetDefaultPath', defaultPath)
|
store.dispatch('SetDefaultPath', defaultPath)
|
||||||
// 仅当目标为根路径 '/' 时跳默认页;否则保持当前路径(含刷新场景),避免刷新被误判为“未匹配”而跳到默认页
|
// 仅当目标为根路径 '/' 时跳默认页;否则保持当前路径(含刷新场景),避免刷新被误判为“未匹配”而跳到默认页
|
||||||
if (to.path === '/') {
|
if (to.path === '/') {
|
||||||
next({ path: defaultPath, replace: true })
|
const matched = router.match(defaultPath)
|
||||||
|
const hasMatch = matched && Array.isArray(matched.matched) && matched.matched.length > 0
|
||||||
|
const safePath = hasMatch ? defaultPath : (routeFallbackPath || '/')
|
||||||
|
next({ path: safePath, replace: true })
|
||||||
} else {
|
} else {
|
||||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成,当前页刷新时保留 to 的路径
|
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成,当前页刷新时保留 to 的路径
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
</el-upload>
|
</el-upload>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||||
<el-button @click="upload.open = false">取 消</el-button>
|
<el-button @click="cancelBtn">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</Container>
|
</Container>
|
||||||
@@ -512,6 +512,10 @@ export default {
|
|||||||
this.$message.error('上传失败!')
|
this.$message.error('上传失败!')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
cancelBtn() {
|
||||||
|
this.upload.open = false
|
||||||
|
this.$refs.upload.clearFiles();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ font-style: normal;">指标详情</div>
|
|||||||
</el-upload>
|
</el-upload>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||||
<el-button @click="upload.open = false">取 消</el-button>
|
<el-button @click="cancelBtn">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</Container>
|
</Container>
|
||||||
@@ -387,6 +387,10 @@ export default {
|
|||||||
console.error('文件上传出错:', error)
|
console.error('文件上传出错:', error)
|
||||||
this.$message.error('上传失败!')
|
this.$message.error('上传失败!')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
cancelBtn(){
|
||||||
|
this.upload.open = false
|
||||||
|
this.$refs.upload.clearFiles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
'bg-green': item.currentValue >= item.targetValue
|
'bg-green': item.currentValue >= item.targetValue
|
||||||
}" style="font-size: 12px;display: flex;align-items: center;justify-content: flex-end;">
|
}" style="font-size: 12px;display: flex;align-items: center;justify-content: flex-end;">
|
||||||
<div class="title">完成率</div>
|
<div class="title">完成率</div>
|
||||||
<div class="yield" style="font-size: 22px;margin-bottom: 4px;">
|
<div class="yield" style="font-size: 18px;margin-bottom: 4px;">
|
||||||
{{ item.progress }}
|
{{ item.progress }}
|
||||||
</div>
|
</div>
|
||||||
<div class="unit">%</div>
|
<div class="unit">%</div>
|
||||||
@@ -359,12 +359,11 @@ export default {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
margin-top: 10px;
|
margin-top:4px;
|
||||||
height: 12px;
|
height: 12px;
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family: PingFangSC, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-right: 8px;
|
|
||||||
color: #000000;
|
color: #000000;
|
||||||
line-height: 12px;
|
line-height: 12px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@@ -372,7 +371,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.unit {
|
.unit {
|
||||||
margin-top: 10px;
|
margin-top: 4px;
|
||||||
margin-right: 14px;
|
margin-right: 14px;
|
||||||
height: 12px;
|
height: 12px;
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
|||||||
@@ -149,7 +149,6 @@ export default {
|
|||||||
levelId:1,
|
levelId:1,
|
||||||
// timeDim: this.dateData.mode
|
// timeDim: this.dateData.mode
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(res);
|
|
||||||
this.monData = res.data.currentMonthData
|
this.monData = res.data.currentMonthData
|
||||||
this.totalData = res.data.totalMonthData
|
this.totalData = res.data.totalMonthData
|
||||||
// this.totalData = res.data.totalData
|
// this.totalData = res.data.totalData
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ export default {
|
|||||||
// 最终传递给图表的排序后数据
|
// 最终传递给图表的排序后数据
|
||||||
chartD() {
|
chartD() {
|
||||||
const data = this.currentDataSource;
|
const data = this.currentDataSource;
|
||||||
|
console.log('charData+++++++++++++++++++++++++++++',data)
|
||||||
const salesData = {
|
const salesData = {
|
||||||
allPlaceNames: this.locations,
|
allPlaceNames: this.locations,
|
||||||
series: [
|
series: [
|
||||||
@@ -143,7 +144,7 @@ export default {
|
|||||||
{ offset: 1, color: 'rgba(40, 138, 255, 0)' }
|
{ offset: 1, color: 'rgba(40, 138, 255, 0)' }
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
data: data.rate || [],
|
data: data.rates || [],
|
||||||
symbol: 'circle',
|
symbol: 'circle',
|
||||||
symbolSize: 6
|
symbolSize: 6
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ export default {
|
|||||||
meterialName:'',
|
meterialName:'',
|
||||||
materialOptions: [
|
materialOptions: [
|
||||||
{value:'硅砂',label:'硅砂'},
|
{value:'硅砂',label:'硅砂'},
|
||||||
{value:'海砂',label:'海砂'},
|
|
||||||
{value:'纯碱',label:'纯碱'},
|
{value:'纯碱',label:'纯碱'},
|
||||||
{value:'白云石',label:'白云石'},
|
{value:'白云石',label:'白云石'},
|
||||||
{value:'石灰石',label:'石灰石'}
|
{value:'石灰石',label:'石灰石'}
|
||||||
@@ -189,23 +188,23 @@ export default {
|
|||||||
startTime: this.dateData.startTime,
|
startTime: this.dateData.startTime,
|
||||||
endTime: this.dateData.endTime,
|
endTime: this.dateData.endTime,
|
||||||
trendName: '原料' + this.meterialName + this.trendName,
|
trendName: '原料' + this.meterialName + this.trendName,
|
||||||
analysisObject: ['原料' + this.meterialName],
|
analysisObject: [this.meterialName],
|
||||||
levelId: this.factory,
|
levelId: this.factory,
|
||||||
};
|
};
|
||||||
// 调用接口
|
// 调用接口
|
||||||
getSingleMaterialAnalysis(requestParams).then((res) => {
|
getSingleMaterialAnalysis(requestParams).then((res) => {
|
||||||
this.monData = res.data.currentMonthData.find(item => {
|
this.monData = res.data.currentMonthData.find(item => {
|
||||||
return item.name === '原料' + this.meterialName;
|
return item.name === this.meterialName + '成本';
|
||||||
});
|
});
|
||||||
this.totalData = res.data.totalMonthData.find(item => {
|
this.totalData = res.data.totalMonthData.find(item => {
|
||||||
return item.name === '原料' + this.meterialName;
|
return item.name === this.meterialName + '成本';
|
||||||
});
|
});
|
||||||
this.relatedData = {
|
this.relatedData = {
|
||||||
relatedMon: res.data.currentMonthData.filter(item => {
|
relatedMon: res.data.currentMonthData.filter(item => {
|
||||||
return item.name !== '原料' + this.meterialName;
|
return item.name !== this.meterialName + '成本';
|
||||||
}), // 兜底月度数据
|
}), // 兜底月度数据
|
||||||
relatedTotal: res.data.totalMonthData.filter(item => {
|
relatedTotal: res.data.totalMonthData.filter(item => {
|
||||||
return item.name !== '原料' + this.meterialName;
|
return item.name !== this.meterialName + '成本';
|
||||||
}) // 兜底累计数据
|
}) // 兜底累计数据
|
||||||
}
|
}
|
||||||
this.trend = res.data.dataTrend
|
this.trend = res.data.dataTrend
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ export default {
|
|||||||
totalData: {},
|
totalData: {},
|
||||||
trend: [],
|
trend: [],
|
||||||
relatedData: {},
|
relatedData: {},
|
||||||
trendName: '原片原料成本',
|
trendName: '原片原料',
|
||||||
// monthRelatedData: [],
|
// monthRelatedData: [],
|
||||||
// totalRelatedData: [],
|
// totalRelatedData: [],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export default {
|
|||||||
overheadName:'',
|
overheadName:'',
|
||||||
overheadOptions:[
|
overheadOptions:[
|
||||||
{value:'包材',label:'包材'},
|
{value:'包材',label:'包材'},
|
||||||
{value:'备品丶机物料',label:'备品丶机物料'},
|
{value:'备件、机物料',label:'备件、机物料'},
|
||||||
{value:'折旧',label:'折旧'},
|
{value:'折旧',label:'折旧'},
|
||||||
{value:'其他',label:'其他'}
|
{value:'其他',label:'其他'}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
grid-template-columns: 1624px;
|
grid-template-columns: 1624px;
|
||||||
">
|
">
|
||||||
<!-- <monthlyRelatedMetrics :itemData="renderList" :title="'月度·相关指标分析'" /> -->
|
<!-- <monthlyRelatedMetrics :itemData="renderList" :title="'月度·相关指标分析'" /> -->
|
||||||
<relateSingleFuelCostAnalysis :relatedData="relatedData" :title="'相关指标分析'" />
|
<relateSingleFuelCostAnalysis :fuelName='fuelName' :relatedData="relatedData" :title="'相关指标分析'" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -213,7 +213,7 @@ export default {
|
|||||||
// index: this.index,
|
// index: this.index,
|
||||||
// sort: 1,
|
// sort: 1,
|
||||||
trendName: this.trendName,
|
trendName: this.trendName,
|
||||||
analysisObject: [this.fuelName + '成本'],
|
analysisObject: [this.fuelName],
|
||||||
// paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'],
|
// paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'],
|
||||||
levelId: this.factory,
|
levelId: this.factory,
|
||||||
// baseId: Number(this.factory),
|
// baseId: Number(this.factory),
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ export default {
|
|||||||
// index: this.index,
|
// index: this.index,
|
||||||
// sort: 1,
|
// sort: 1,
|
||||||
trendName: this.trendName,
|
trendName: this.trendName,
|
||||||
analysisObject: [this.fuelName + '成本'],
|
analysisObject: [this.fuelName],
|
||||||
// paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'],
|
// paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'],
|
||||||
levelId: this.factory,
|
levelId: this.factory,
|
||||||
// baseId: Number(this.factory),
|
// baseId: Number(this.factory),
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ export default {
|
|||||||
|
|
||||||
const salesData = {
|
const salesData = {
|
||||||
allPlaceNames: this.locations,
|
allPlaceNames: this.locations,
|
||||||
|
unit:'元/㎡',
|
||||||
series: [
|
series: [
|
||||||
// 1. 完成率(折线图)
|
// 1. 完成率(折线图)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<div class="dropdown-options" v-if="isDropdownShow">
|
<div class="dropdown-options" v-if="isDropdownShow">
|
||||||
<div class="dropdown-option" v-for="(item, index) in profitOptions" :key="index"
|
<div class="dropdown-option" v-for="(item, index) in profitOptions" :key="index"
|
||||||
@click.stop="selectProfit(item)">
|
@click.stop="selectProfit(item)">
|
||||||
{{ item }}
|
{{ item.name }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -61,12 +61,22 @@ export default {
|
|||||||
return {
|
return {
|
||||||
isDropdownShow: false,
|
isDropdownShow: false,
|
||||||
selectedProfit: '天然气', // 选中的名称,初始为null
|
selectedProfit: '天然气', // 选中的名称,初始为null
|
||||||
profitOptions: [
|
profitOptions: [{
|
||||||
'天然气',
|
name: '天然气',
|
||||||
'LNG液化天然气',
|
unit:'元/㎡',
|
||||||
'重油',
|
},
|
||||||
'水',
|
{
|
||||||
]
|
name: 'LNG液化天然气',
|
||||||
|
unit:'元/㎡',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '重油',
|
||||||
|
unit:'元/㎡',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '水',
|
||||||
|
unit:'元/㎡',
|
||||||
|
}],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -88,6 +98,7 @@ export default {
|
|||||||
|
|
||||||
const salesData = {
|
const salesData = {
|
||||||
allPlaceNames: this.locations,
|
allPlaceNames: this.locations,
|
||||||
|
unit:'元/㎡',
|
||||||
series: [
|
series: [
|
||||||
// 1. 完成率(折线图)
|
// 1. 完成率(折线图)
|
||||||
{
|
{
|
||||||
@@ -246,9 +257,10 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
selectProfit(item) {
|
selectProfit(item) {
|
||||||
this.selectedProfit = item;
|
this.selectedProfit = item.name;
|
||||||
|
this.unit = item.unit;
|
||||||
this.isDropdownShow = false;
|
this.isDropdownShow = false;
|
||||||
this.$emit('handleGetItemData', item)
|
this.$emit('handleGetItemData', item.name)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ export default {
|
|||||||
profitOptions: [
|
profitOptions: [
|
||||||
'原片制造费用成本',
|
'原片制造费用成本',
|
||||||
'包材',
|
'包材',
|
||||||
'备品丶机物料',
|
'备件、机物料',
|
||||||
'折旧',
|
'折旧',
|
||||||
'其他',
|
'其他',
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -60,9 +60,9 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isDropdownShow: false,
|
isDropdownShow: false,
|
||||||
selectedProfit: '原片原料成本', // 选中的名称,初始为null
|
selectedProfit: '原片原料', // 选中的名称,初始为null
|
||||||
profitOptions: [
|
profitOptions: [
|
||||||
'原片原料成本',
|
'原片原料',
|
||||||
'硅砂',
|
'硅砂',
|
||||||
'海砂',
|
'海砂',
|
||||||
'纯碱',
|
'纯碱',
|
||||||
@@ -90,6 +90,7 @@ export default {
|
|||||||
|
|
||||||
const salesData = {
|
const salesData = {
|
||||||
allPlaceNames: this.locations,
|
allPlaceNames: this.locations,
|
||||||
|
unit:'元/㎡',
|
||||||
series: [
|
series: [
|
||||||
// 1. 完成率(折线图)
|
// 1. 完成率(折线图)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export default {
|
|||||||
selectedProfit: '制造费用', // 选中的名称,初始为null
|
selectedProfit: '制造费用', // 选中的名称,初始为null
|
||||||
profitOptions: [
|
profitOptions: [
|
||||||
'制造费用',
|
'制造费用',
|
||||||
'备品丶机物料',
|
'备件、机物料',
|
||||||
'折旧',
|
'折旧',
|
||||||
'其他',
|
'其他',
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ export default {
|
|||||||
|
|
||||||
const salesData = {
|
const salesData = {
|
||||||
allPlaceNames: this.locations,
|
allPlaceNames: this.locations,
|
||||||
|
unit:'元/㎡',
|
||||||
series: [
|
series: [
|
||||||
// 1. 完成率(折线图)
|
// 1. 完成率(折线图)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<div class="dropdown-options" v-if="isDropdownShow">
|
<div class="dropdown-options" v-if="isDropdownShow">
|
||||||
<div class="dropdown-option" v-for="(item, index) in profitOptions" :key="index"
|
<div class="dropdown-option" v-for="(item, index) in profitOptions" :key="index"
|
||||||
@click.stop="selectProfit(item)">
|
@click.stop="selectProfit(item)">
|
||||||
{{ item }}
|
{{ item.name }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -61,12 +61,23 @@ export default {
|
|||||||
return {
|
return {
|
||||||
isDropdownShow: false,
|
isDropdownShow: false,
|
||||||
selectedProfit: '采购单价', // 选中的名称,初始为null
|
selectedProfit: '采购单价', // 选中的名称,初始为null
|
||||||
profitOptions: [
|
profitOptions: [{
|
||||||
'采购单价',
|
name: '采购单价',
|
||||||
'产量',
|
unit: '元/吨'
|
||||||
'单耗',
|
},
|
||||||
'消耗量',
|
{
|
||||||
]
|
name: '产量',
|
||||||
|
unit: '吨'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '单耗',
|
||||||
|
unit: 'kg/㎡'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '消耗量',
|
||||||
|
unit: '吨'
|
||||||
|
}],
|
||||||
|
unit:'元/吨',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -88,6 +99,7 @@ export default {
|
|||||||
|
|
||||||
const salesData = {
|
const salesData = {
|
||||||
allPlaceNames: this.locations,
|
allPlaceNames: this.locations,
|
||||||
|
unit:this.unit,
|
||||||
series: [
|
series: [
|
||||||
// 1. 完成率(折线图)
|
// 1. 完成率(折线图)
|
||||||
{
|
{
|
||||||
@@ -247,9 +259,10 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
selectProfit(item) {
|
selectProfit(item) {
|
||||||
console.log('aaaaaa',item)
|
console.log('aaaaaa',item)
|
||||||
this.selectedProfit = item;
|
this.selectedProfit = item.name;
|
||||||
this.isDropdownShow = false;
|
this.isDropdownShow = false;
|
||||||
this.$emit('handleGetItemData', item)
|
this.$emit('handleGetItemData', item.name)
|
||||||
|
this.unit = item.unit;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="kpi-content" style="padding: 14px 16px; display: flex; width: 100%;">
|
<div class="kpi-content" style="padding: 14px 16px; display: flex; width: 100%;">
|
||||||
<!-- 新增:topItem 专属包裹容器,统一控制样式和布局(原有行内样式不变) -->
|
<!-- 新增:topItem 专属包裹容器,统一控制样式和布局(原有行内样式不变) -->
|
||||||
<div class="topItem-container" style="display: flex; gap: 8px;">
|
<div class="topItem-container" style="display: flex; gap: 8px;">
|
||||||
<div class="dashboard left" @click="handleDashboardClick('备品丶机物料')">
|
<div class="dashboard left" @click="handleDashboardClick('备件、机物料')">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
备件、机物料·元/㎡
|
备件、机物料·元/㎡
|
||||||
</div>
|
</div>
|
||||||
@@ -76,7 +76,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
// 1. 备件丶机物料数据:精准筛选对应名称数据,兜底值统一
|
// 1. 备件丶机物料数据:精准筛选对应名称数据,兜底值统一
|
||||||
sparePartsData() {
|
sparePartsData() {
|
||||||
return this.relatedData.find(item => (item.name || '').includes('备品丶机物料')) || {
|
return this.relatedData.find(item => (item.name || '').includes('备件、机物料')) || {
|
||||||
targetValue: 0,
|
targetValue: 0,
|
||||||
value: 0,
|
value: 0,
|
||||||
completed: 0,
|
completed: 0,
|
||||||
|
|||||||
@@ -7,28 +7,28 @@
|
|||||||
<div class="topItem-container" style="display: flex; gap: 8px;">
|
<div class="topItem-container" style="display: flex; gap: 8px;">
|
||||||
<!-- 天然气组件:绑定对应筛选数据,点击传递物料名和路由 -->
|
<!-- 天然气组件:绑定对应筛选数据,点击传递物料名和路由 -->
|
||||||
<div class="dashboard left" @click="handleDashboardClick('天然气', 'singleCombustible')">
|
<div class="dashboard left" @click="handleDashboardClick('天然气', 'singleCombustible')">
|
||||||
<div class="title">天然气·元/吨</div>
|
<div class="title">天然气·元/㎡</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<operatingSingleBar :detailData="naturalGasData"></operatingSingleBar>
|
<operatingSingleBar :detailData="naturalGasData"></operatingSingleBar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- LNG液化天然气组件:绑定对应筛选数据 -->
|
<!-- LNG液化天然气组件:绑定对应筛选数据 -->
|
||||||
<div class="dashboard right" @click="handleDashboardClick('LNG液化天然气', 'singleCombustible')">
|
<div class="dashboard right" @click="handleDashboardClick('LNG液化天然气', 'singleCombustible')">
|
||||||
<div class="title">LNG液化天然气·元/吨</div>
|
<div class="title">LNG液化天然气·元/㎡</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<operatingSingleBar :detailData="lngData"></operatingSingleBar>
|
<operatingSingleBar :detailData="lngData"></operatingSingleBar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 重油组件:绑定对应筛选数据 -->
|
<!-- 重油组件:绑定对应筛选数据 -->
|
||||||
<div class="dashboard right" @click="handleDashboardClick('重油', 'singleCombustible')">
|
<div class="dashboard right" @click="handleDashboardClick('重油', 'singleCombustible')">
|
||||||
<div class="title">重油·元/吨</div>
|
<div class="title">重油·元/㎡</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<operatingSingleBar :detailData="heavyOilData"></operatingSingleBar>
|
<operatingSingleBar :detailData="heavyOilData"></operatingSingleBar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 水组件:绑定对应筛选数据 -->
|
<!-- 水组件:绑定对应筛选数据 -->
|
||||||
<div class="dashboard right" @click="handleDashboardClick('水', 'singleCombustible')">
|
<div class="dashboard right" @click="handleDashboardClick('水', 'singleCombustible')">
|
||||||
<div class="title">水·元/吨</div>
|
<div class="title">水·元/㎡</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<operatingSingleBar :detailData="waterData"></operatingSingleBar>
|
<operatingSingleBar :detailData="waterData"></operatingSingleBar>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<operatingSingleBar :detailData="packagingData"></operatingSingleBar>
|
<operatingSingleBar :detailData="packagingData"></operatingSingleBar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dashboard right" @click="handleDashboardClick('备品丶机物料')">
|
<div class="dashboard right" @click="handleDashboardClick('备件、机物料')">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
备件、机物料·元/吨
|
备件、机物料·元/吨
|
||||||
</div>
|
</div>
|
||||||
@@ -110,7 +110,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 2. 备件丶机物料数据:精准筛选
|
// 2. 备件丶机物料数据:精准筛选
|
||||||
sparePartsData() {
|
sparePartsData() {
|
||||||
return this.activeData.find(item => (item.name || '').includes('备品丶机物料')) || {
|
return this.activeData.find(item => (item.name || '').includes('备件、机物料')) || {
|
||||||
targetValue: 0,
|
targetValue: 0,
|
||||||
value: 0,
|
value: 0,
|
||||||
completed: 0,
|
completed: 0,
|
||||||
|
|||||||
@@ -13,12 +13,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 2. 海砂组件:传递对应筛选数据 -->
|
<!-- 2. 海砂组件:传递对应筛选数据 -->
|
||||||
<div class="dashboard right" @click="handleDashboardClick('海砂', 'SIMFRMCostAnalysis')">
|
<!-- <div class="dashboard right" @click="handleDashboardClick('海砂', 'SIMFRMCostAnalysis')">
|
||||||
<div class="title">海砂·元/㎡</div>
|
<div class="title">海砂·元/㎡</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<operatingSingleBar :detailData="seaSandData"></operatingSingleBar>
|
<operatingSingleBar :detailData="seaSandData"></operatingSingleBar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
<!-- 3. 纯碱组件:传递对应筛选数据 -->
|
<!-- 3. 纯碱组件:传递对应筛选数据 -->
|
||||||
<div class="dashboard right" @click="handleDashboardClick('纯碱', 'SIMFRMCostAnalysis')">
|
<div class="dashboard right" @click="handleDashboardClick('纯碱', 'SIMFRMCostAnalysis')">
|
||||||
<div class="title">纯碱·元/㎡</div>
|
<div class="title">纯碱·元/㎡</div>
|
||||||
@@ -203,7 +203,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.dashboard {
|
.dashboard {
|
||||||
width: 310px;
|
width: 390px;
|
||||||
height: 205px;
|
height: 205px;
|
||||||
background: #F9FCFF;
|
background: #F9FCFF;
|
||||||
padding: 16px 0 0 10px;
|
padding: 16px 0 0 10px;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<div class="topItem-container" style="display: flex; gap: 8px;">
|
<div class="topItem-container" style="display: flex; gap: 8px;">
|
||||||
<div class="dashboard left">
|
<div class="dashboard left">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
采购单价·元/m³
|
采购单价·{{fuelName=='天然气'||fuelName=='LNG液化天然气'||fuelName=='水'?'元/m³':'万元'}}
|
||||||
</div>
|
</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<!-- 绑定对应数据:新增数据绑定,样式不变 -->
|
<!-- 绑定对应数据:新增数据绑定,样式不变 -->
|
||||||
@@ -83,6 +83,10 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: '' // 默认空字符串,保持原有配置
|
default: '' // 默认空字符串,保持原有配置
|
||||||
},
|
},
|
||||||
|
fuelName:{
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="dashboard right">
|
<div class="dashboard right">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
单耗·吨
|
单耗·kg/㎡
|
||||||
</div>
|
</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<operatingSingleBar :detailData="unitHaoData"></operatingSingleBar>
|
<operatingSingleBar :detailData="unitHaoData"></operatingSingleBar>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="kpi-content" style="padding: 14px 16px; display: flex; width: 100%;">
|
<div class="kpi-content" style="padding: 14px 16px; display: flex; width: 100%;">
|
||||||
<!-- 新增:topItem 专属包裹容器,统一控制样式和布局(原有行内样式不变) -->
|
<!-- 新增:topItem 专属包裹容器,统一控制样式和布局(原有行内样式不变) -->
|
||||||
<div class="topItem-container" style="display: flex; gap: 8px;">
|
<div class="topItem-container" style="display: flex; gap: 8px;">
|
||||||
<div class="dashboard left" @click="handleDashboardClick('备品丶机物料')">
|
<div class="dashboard left" @click="handleDashboardClick('备件、机物料')">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
备件、机物料·元/㎡
|
备件、机物料·元/㎡
|
||||||
</div>
|
</div>
|
||||||
@@ -76,7 +76,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
// 1. 备件丶机物料数据:精准筛选对应名称数据,兜底值统一
|
// 1. 备件丶机物料数据:精准筛选对应名称数据,兜底值统一
|
||||||
sparePartsData() {
|
sparePartsData() {
|
||||||
return this.relatedData.find(item => (item.name || '').includes('备品丶机物料')) || {
|
return this.relatedData.find(item => (item.name || '').includes('备件、机物料')) || {
|
||||||
targetValue: 0,
|
targetValue: 0,
|
||||||
value: 0,
|
value: 0,
|
||||||
completed: 0,
|
completed: 0,
|
||||||
|
|||||||
@@ -135,9 +135,9 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
let timeArr = []
|
let timeArr = []
|
||||||
if (this.$route.query.startTime && this.$route.query.endTime) {
|
if (this.$route.query.startTime && this.$route.query.endTime) {
|
||||||
timeArr = [moment(Number(this.$route.query.startTime)).format('YYYY-MM'), moment(Number(this.$route.query.endTime)).format('YYYY-MM')]
|
timeArr = [moment(Number(this.$route.query.startTime)).format('YYYY-MM-DD'), moment(Number(this.$route.query.endTime)).format('YYYY-MM-DD')]
|
||||||
}else{
|
}else{
|
||||||
timeArr = [moment().startOf('month').format('YYYY-MM'), moment().endOf('month').format('YYYY-MM')]
|
timeArr = [moment().startOf('month').format('YYYY-MM-DD'), moment().endOf('month').format('YYYY-MM-DD')]
|
||||||
};
|
};
|
||||||
this.$refs.searchBarForm.formInline.timeValMonth = timeArr
|
this.$refs.searchBarForm.formInline.timeValMonth = timeArr
|
||||||
this.listQuery.startTime = moment(timeArr[0]).startOf('day').valueOf();
|
this.listQuery.startTime = moment(timeArr[0]).startOf('day').valueOf();
|
||||||
@@ -195,8 +195,8 @@ export default {
|
|||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 20;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.status = val.status ? val.status : undefined;
|
this.listQuery.status = val.status ? val.status : undefined;
|
||||||
this.listQuery.startTime = moment(val.timeValMonth[0]).startOf('day').valueOf();
|
this.listQuery.startTime = moment(moment(val.timeValMonth[0]).startOf('month').format('YYYY-MM-DD')).startOf('day').valueOf();
|
||||||
this.listQuery.endTime = moment(val.timeValMonth[1]).endOf('day').valueOf();
|
this.listQuery.endTime = moment(moment(val.timeValMonth[1]).endOf('month').format('YYYY-MM-DD')).endOf('day').valueOf();
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
|
|||||||
Reference in New Issue
Block a user