提交 296c9f9e 编写于 作者: 刘英杰's avatar 刘英杰

初版

上级 45a0e119
流水线 #35459 已通过 ,包含阶段
in 1 minute 和 48 second
......@@ -8,7 +8,7 @@ stages:
build:
stage: publish
script:
- remove-item -Force -Recurse D:/ASC_web/A00051/devicesManagement/pc*
# - remove-item -Force -Recurse D:/ASC_web/A00051/devicesManagement/pc*
- xcopy "dist" "D:\ASC_web\A00051\devicesManagement\pc\" /s/e/y/
only:
- pc
\ No newline at end of file
- pc
export default [
{
path: '/taskManage',
title: '任务管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/permissionManage',
title: '权限管理',
auth: [0],
icon: 'md-key'
}
]
\ No newline at end of file
export default [
{
path: '/taskManage',
title: '任务管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/permissionManage',
title: '权限管理',
auth: [0],
icon: 'md-key',
children: [
{
path: '/permissionManage/user',
title: '用户管理',
auth: [0],
}
]
}
]
\ No newline at end of file
export default [
{
path: '/taskManage',
title: '首页',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/taskManage',
title: '申请申领',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/taskManage',
title: '审核审批',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/taskManage',
title: '设备管理',
auth: [0,1],
icon: 'md-list-box',
children: [
{
path: '/taskManage',
title: '设备管理',
auth: [0,1],
}
]
},
{
path: '/taskManage',
title: '耗材管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/taskManage',
title: '分类管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/taskManage',
title: '状态查询',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/taskManage',
title: '预警管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/permissionManage',
title: '系统配置',
auth: [0],
icon: 'md-key',
children: [
{
path: '/permissionManage',
title: '消息推送模版',
auth: [0],
},
{
path: '/permissionManage',
title: '用户权限',
auth: [0],
}
]
}
]
\ No newline at end of file
export default [
{
path: '/taskManage',
title: '首页',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/taskManage',
title: '申请申领',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/taskManage',
title: '审核审批',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/taskManage',
title: '设备管理',
auth: [0,1],
icon: 'md-list-box',
children: [
{
path: '/taskManage',
title: '设备管理',
auth: [0,1],
},
{
path: '/taskManage',
title: '耗材管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/taskManage',
title: '分类管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/taskManage',
title: '状态查询',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/taskManage',
title: '预警管理',
auth: [0,1],
icon: 'md-list-box',
},
]
},
{
path: '/permissionManage',
title: '系统配置',
auth: [0],
icon: 'md-key',
children: [
{
path: '/permissionManage',
title: '消息推送模版',
auth: [0],
},
{
path: '/permissionManage',
title: '用户权限',
auth: [0],
}
]
}
]
\ No newline at end of file
export default [
{
path: '/homePage',
title: '首页',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/applicationClaim',
title: '申请申领',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/reviewApproval',
title: '审核审批',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/equipmentManagement',
title: '设备管理',
auth: [0,1],
icon: 'md-list-box',
children: [
{
path: '/equipmentManagement',
title: '设备管理',
auth: [0,1],
},
{
path: '/consumablesManagement',
title: '耗材管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/categoryManagement',
title: '分类管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/statusQuery',
title: '状态查询',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/alertManagement',
title: '预警管理',
auth: [0,1],
icon: 'md-list-box',
},
]
},
{
path: '/systemConfiguration',
title: '系统配置',
auth: [0],
icon: 'md-key',
children: [
{
path: '/messagePushTemplate',
title: '消息推送模版',
auth: [0],
},
{
path: '/userPermission',
title: '用户权限',
auth: [0],
}
]
}
]
\ No newline at end of file
export default [
{
path: '/homePage',
title: '首页',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/applicationClaim',
title: '申请申领',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/reviewApproval',
title: '审核审批',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/equipmentManagement',
title: '设备管理',
auth: [0,1],
},
{
path: '/consumablesManagement',
title: '耗材管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/categoryManagement',
title: '分类管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/statusQuery',
title: '状态查询',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/alertManagement',
title: '预警管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/systemConfiguration',
title: '系统配置',
auth: [0],
icon: 'md-key',
children: [
{
path: '/messagePushTemplate',
title: '消息推送模版',
auth: [0],
},
{
path: '/userPermission',
title: '用户权限',
auth: [0],
}
]
}
]
\ No newline at end of file
export default [
{
path: '/homePage',
title: '首页',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/applicationClaim',
title: '申请申领',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/reviewApproval',
title: '审核审批',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/statusQuery',
title: '状态查询',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/equipmentManagement',
title: '设备管理',
auth: [0,1],
},
{
path: '/consumablesManagement',
title: '耗材管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/categoryManagement',
title: '分类管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/alertManagement',
title: '预警管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/systemConfiguration',
title: '系统配置',
auth: [0],
icon: 'md-key',
children: [
{
path: '/messagePushTemplate',
title: '消息推送模版',
auth: [0],
},
{
path: '/userPermission',
title: '用户权限',
auth: [0],
}
]
}
]
\ No newline at end of file
export default [
{
path: '/homePage',
title: '首页',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/applicationClaim',
title: '申请申领',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/reviewApproval',
title: '审核审批',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/statusQuery',
title: '状态查询',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/equipmentManagement',
title: '设备管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/consumablesManagement',
title: '耗材管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/categoryManagement',
title: '分类管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/alertManagement',
title: '预警管理',
auth: [0,1],
icon: 'md-list-box',
},
{
path: '/systemConfiguration',
title: '系统配置',
auth: [0],
icon: 'md-key',
children: [
{
path: '/messagePushTemplate',
title: '消息推送模版',
auth: [0],
},
{
path: '/userPermission',
title: '用户权限',
auth: [0],
}
]
}
]
\ No newline at end of file
export default [
{
path: '/homePage',
title: '首页',
auth: [0,1],
icon: 'md-home',
},
{
path: '/applicationClaim',
title: '申请申领',
auth: [0,1],
icon: 'md-document',
},
{
path: '/reviewApproval',
title: '审核审批',
auth: [0,1],
icon: 'md-checkmark-circle',
},
{
path: '/statusQuery',
title: '状态查询',
auth: [0,1],
icon: 'md-search',
},
{
path: '/equipmentManagement',
title: '设备管理',
auth: [0,1],
icon: 'md-build',
},
{
path: '/consumablesManagement',
title: '耗材管理',
auth: [0,1],
icon: 'md-cube',
},
{
path: '/categoryManagement',
title: '分类管理',
auth: [0,1],
icon: 'md-folder',
},
{
path: '/alertManagement',
title: '预警管理',
auth: [0,1],
icon: 'md-alert',
},
{
path: '/systemConfiguration',
title: '系统配置',
auth: [0],
icon: 'md-settings',
children: [
{
path: '/messagePushTemplate',
title: '消息推送模版',
auth: [0],
icon: 'md-mail',
},
{
path: '/userPermission',
title: '用户权限',
auth: [0],
icon: 'md-lock',
}
]
}
]
\ No newline at end of file
export default [
{
path: '/homePage',
title: '首页',
auth: [0,1],
icon: 'md-home',
},
{
path: '/applicationClaim',
title: '申请申领',
auth: [0,1],
icon: 'md-document',
},
{
path: '/reviewApproval',
title: '审核审批',
auth: [0,1],
icon: 'md-checkmark-circle',
},
{
path: '/statusQuery',
title: '状态查询',
auth: [0,1],
icon: 'md-search',
},
{
path: '/equipmentManagement',
title: '设备管理',
auth: [0,1],
icon: 'md-build',
},
{
path: '/consumablesManagement',
title: '耗材管理',
auth: [0,1],
icon: 'md-cube',
},
{
path: '/categoryManagement',
title: '分类管理',
auth: [0,1],
icon: 'md-folder',
},
{
path: '/alertManagement',
title: '预警管理',
auth: [0,1],
icon: 'md-alert',
},
{
path: '/systemConfiguration',
title: '系统配置',
auth: [0,1],
icon: 'md-settings',
children: [
{
path: '/messagePushTemplate',
title: '消息推送模版',
auth: [0,1],
icon: 'md-mail',
},
{
path: '/userPermission',
title: '用户权限',
auth: [0,1],
icon: 'md-lock',
}
]
}
]
\ No newline at end of file
<template>
<div class="dashboard-container">
<!-- 顶部统计卡片 -->
<Row :gutter="16" class="stat-cards">
<i-col span="8">
<Card>
<div class="stat-item">
<h3>库存总量</h3>
<Count-up :end="totalInventory" />
<p>当前库存总数</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item warning">
<h3>近效期耗材</h3>
<Count-up :end="expiringItems" />
<p>有效期不足30天</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item danger">
<h3>低库存预警</h3>
<Count-up :end="lowStockItems" />
<p>低于安全库存</p>
</div>
</Card>
</i-col>
</Row>
<!-- 设备使用分析 -->
<Card class="chart-card">
<p slot="title">设备使用率分析</p>
<div class="chart-container">
<v-chart :options="deviceUsageOptions" />
</div>
</Card>
<!-- 耗材消耗趋势 -->
<Row :gutter="16">
<i-col span="12">
<Card class="chart-card">
<p slot="title">耗材消耗趋势</p>
<div class="chart-container">
<v-chart :options="consumptionTrendOptions" />
</div>
</Card>
</i-col>
<i-col span="12">
<Card class="chart-card">
<p slot="title">部门耗材对比</p>
<div class="chart-container">
<v-chart :options="departmentComparisonOptions" />
</div>
</Card>
</i-col>
</Row>
<!-- 近效期耗材列表 -->
<Card class="table-card">
<p slot="title">近效期耗材清单</p>
<Table :columns="expiringColumns" :data="expiringData">
<template slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="handleExport(row)">导出</Button>
</template>
</Table>
</Card>
</div>
</template>
<script>
import CountUp from 'vue-countup-v2'
import ECharts from 'vue-echarts'
import 'echarts/lib/chart/bar'
import 'echarts/lib/chart/line'
import 'echarts/lib/component/tooltip'
import 'echarts/lib/component/title'
import 'echarts/lib/component/legend'
export default {
name: 'Dashboard',
components: {
CountUp,
'v-chart': ECharts
},
data() {
return {
// 模拟数据
totalInventory: 2580,
expiringItems: 15,
lowStockItems: 8,
// 近效期耗材表格配置
expiringColumns: [
{ title: '耗材名称', key: 'name' },
{ title: '库存数量', key: 'quantity' },
{ title: '有效期至', key: 'expireDate' },
{ title: '剩余天数', key: 'daysLeft' },
{ title: '操作', slot: 'action' }
],
expiringData: [
{
name: '水性笔',
quantity: 50,
expireDate: '2024-02-15',
daysLeft: 25
}
// 更多数据...
],
// 图表配置
deviceUsageOptions: {
title: { text: '设备使用频率统计' },
tooltip: {},
xAxis: {
data: ['打印机A', '打印机B', '复印机', '扫描仪']
},
yAxis: {},
series: [{
type: 'bar',
data: [120, 200, 150, 80]
}]
},
consumptionTrendOptions: {
title: { text: '耗材消耗趋势预测' },
tooltip: {},
legend: {
data: ['实际消耗', '预测消耗']
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月']
},
yAxis: {},
series: [
{
name: '实际消耗',
type: 'line',
data: [120, 132, 101, 134, 90, 230]
},
{
name: '预测消耗',
type: 'line',
data: [220, 182, 191, 234, 290, 330]
}
]
},
departmentComparisonOptions: {
title: { text: '部门耗材使用对比' },
tooltip: {},
legend: {},
xAxis: {
data: ['办公室', '研发部', '销售部', '人事部']
},
yAxis: {},
series: [{
type: 'bar',
data: [150, 230, 180, 120]
}]
}
}
},
methods: {
handleExport(row) {
// 导出功能实现
this.$Message.success('导出成功')
}
}
}
</script>
<style lang="less" scoped>
.dashboard-container {
padding: 20px;
.stat-cards {
margin-bottom: 20px;
.stat-item {
text-align: center;
padding: 20px;
h3 {
margin-bottom: 10px;
color: #17233d;
}
&.warning {
color: #ff9900;
}
&.danger {
color: #ed4014;
}
}
}
.chart-card {
margin-bottom: 20px;
.chart-container {
height: 300px;
}
}
.table-card {
margin-bottom: 20px;
}
}
</style>
<template>
<div class="dashboard-container">
<!-- 顶部统计卡片 -->
<Row :gutter="16" class="stat-cards">
<i-col span="8">
<Card>
<div class="stat-item">
<h3>库存总量</h3>
<div class="count">{{totalInventory}}</div>
<p>当前库存总数</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item warning">
<h3>近效期耗材</h3>
<div class="count">{{expiringItems}}</div>
<p>有效期不足30天</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item danger">
<h3>低库存预警</h3>
<div class="count">{{lowStockItems}}</div>
<p>低于安全库存</p>
</div>
</Card>
</i-col>
</Row>
<!-- 设备使用分析 -->
<Card class="chart-card">
<p slot="title">设备使用率分析</p>
<div class="chart-container" ref="deviceUsageChart"></div>
</Card>
<!-- 耗材消耗趋势 -->
<Row :gutter="16">
<i-col span="12">
<Card class="chart-card">
<p slot="title">耗材消耗趋势</p>
<div class="chart-container" ref="consumptionTrendChart"></div>
</Card>
</i-col>
<i-col span="12">
<Card class="chart-card">
<p slot="title">部门耗材对比</p>
<div class="chart-container" ref="departmentComparisonChart"></div>
</Card>
</i-col>
</Row>
<!-- 近效期耗材列表 -->
<Card class="table-card">
<p slot="title">近效期耗材清单</p>
<Table :columns="expiringColumns" :data="expiringData">
<template slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="handleExport(row)">导出</Button>
</template>
</Table>
</Card>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'Dashboard',
data() {
return {
// 模拟数据
totalInventory: 2580,
expiringItems: 15,
lowStockItems: 8,
// 近效期耗材表格配置
expiringColumns: [
{ title: '耗材名称', key: 'name' },
{ title: '库存数量', key: 'quantity' },
{ title: '有效期至', key: 'expireDate' },
{ title: '剩余天数', key: 'daysLeft' },
{ title: '操作', slot: 'action' }
],
expiringData: [
{
name: '水性笔',
quantity: 50,
expireDate: '2024-02-15',
daysLeft: 25
}
// 更多数据...
],
// 图表配置
deviceUsageOptions: {
title: { text: '设备使用频率统计' },
tooltip: {},
xAxis: {
data: ['打印机A', '打印机B', '复印机', '扫描仪']
},
yAxis: {},
series: [{
type: 'bar',
data: [120, 200, 150, 80]
}]
},
consumptionTrendOptions: {
title: { text: '耗材消耗趋势预测' },
tooltip: {},
legend: {
data: ['实际消耗', '预测消耗']
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月']
},
yAxis: {},
series: [
{
name: '实际消耗',
type: 'line',
data: [120, 132, 101, 134, 90, 230]
},
{
name: '预测消耗',
type: 'line',
data: [220, 182, 191, 234, 290, 330]
}
]
},
departmentComparisonOptions: {
title: { text: '部门耗材使用对比' },
tooltip: {},
legend: {},
xAxis: {
data: ['办公室', '研发部', '销售部', '人事部']
},
yAxis: {},
series: [{
type: 'bar',
data: [150, 230, 180, 120]
}]
}
}
},
mounted() {
this.initCharts()
},
methods: {
initCharts() {
// 初始化设备使用率图表
const deviceUsageChart = echarts.init(this.$refs.deviceUsageChart)
deviceUsageChart.setOption(this.deviceUsageOptions)
// 初始化耗材消耗趋势图表
const consumptionTrendChart = echarts.init(this.$refs.consumptionTrendChart)
consumptionTrendChart.setOption(this.consumptionTrendOptions)
// 初始化部门耗材对比图表
const departmentComparisonChart = echarts.init(this.$refs.departmentComparisonChart)
departmentComparisonChart.setOption(this.departmentComparisonOptions)
// 监听窗口大小变化
window.addEventListener('resize', () => {
deviceUsageChart.resize()
consumptionTrendChart.resize()
departmentComparisonChart.resize()
})
},
handleExport(row) {
// 导出功能实现
this.$Message.success('导出成功')
}
}
}
</script>
<style lang="less" scoped>
.dashboard-container {
padding: 20px;
.stat-cards {
margin-bottom: 20px;
.stat-item {
text-align: center;
padding: 20px;
h3 {
margin-bottom: 10px;
color: #17233d;
}
.count {
font-size: 24px;
font-weight: bold;
margin: 10px 0;
}
&.warning {
color: #ff9900;
}
&.danger {
color: #ed4014;
}
}
}
.chart-card {
margin-bottom: 20px;
.chart-container {
height: 300px;
}
}
.table-card {
margin-bottom: 20px;
}
}
</style>
<template>
<div class="dashboard-container">
<!-- 顶部统计卡片 -->
<Row :gutter="16" class="stat-cards">
<i-col span="8">
<Card>
<div class="stat-item">
<h3>库存总量</h3>
<div class="count">{{ totalInventory }}</div>
<p>当前库存总数</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item warning">
<h3>近效期耗材</h3>
<div class="count">{{ expiringItems }}</div>
<p>有效期不足30天</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item danger">
<h3>低库存预警</h3>
<div class="count">{{ lowStockItems }}</div>
<p>低于安全库存</p>
</div>
</Card>
</i-col>
</Row>
<!-- 设备使用分析 -->
<Card class="chart-card">
<p slot="title">设备使用率分析</p>
<div class="chart-container" ref="deviceUsageChart"></div>
</Card>
<!-- 耗材消耗趋势 -->
<Row :gutter="16">
<i-col span="12">
<Card class="chart-card">
<p slot="title">耗材消耗趋势</p>
<div class="chart-container" ref="consumptionTrendChart"></div>
</Card>
</i-col>
<i-col span="12">
<Card class="chart-card">
<p slot="title">部门耗材对比</p>
<div class="chart-container" ref="departmentComparisonChart"></div>
</Card>
</i-col>
</Row>
<!-- 近效期耗材列表 -->
<Card class="table-card">
<p slot="title">近效期耗材清单</p>
<Table :columns="expiringColumns" :data="expiringData">
<template slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="handleExport(row)">导出</Button>
</template>
</Table>
</Card>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'Dashboard',
data() {
return {
// 模拟数据
totalInventory: 2580,
expiringItems: 15,
lowStockItems: 8,
// 近效期耗材表格配置
expiringColumns: [
{ title: '耗材名称', key: 'name' },
{ title: '库存数量', key: 'quantity' },
{ title: '有效期至', key: 'expireDate' },
{ title: '剩余天数', key: 'daysLeft' },
{ title: '操作', slot: 'action' }
],
expiringData: [
{
name: '水性笔',
quantity: 50,
expireDate: '2024-02-15',
daysLeft: 25
}
// 更多数据...
],
// 图表配置
deviceUsageOptions: {
title: { text: '设备使用频率统计' },
tooltip: {},
xAxis: {
data: ['打印机A', '打印机B', '复印机', '扫描仪']
},
yAxis: {},
series: [{
type: 'bar',
data: [120, 200, 150, 80]
}]
},
consumptionTrendOptions: {
title: { text: '耗材消耗趋势预测' },
tooltip: {},
legend: {
data: ['实际消耗', '预测消耗']
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月']
},
yAxis: {},
series: [
{
name: '实际消耗',
type: 'line',
data: [120, 132, 101, 134, 90, 230]
},
{
name: '预测消耗',
type: 'line',
data: [220, 182, 191, 234, 290, 330]
}
]
},
departmentComparisonOptions: {
title: { text: '部门耗材使用对比' },
tooltip: {},
legend: {},
xAxis: {
data: ['办公室', '研发部', '销售部', '人事部']
},
yAxis: {},
series: [{
type: 'bar',
data: [150, 230, 180, 120]
}]
}
}
},
mounted() {
this.initCharts()
},
methods: {
initCharts() {
// 初始化设备使用率图表
const deviceUsageChart = echarts.init(this.$refs.deviceUsageChart)
deviceUsageChart.setOption(this.deviceUsageOptions)
// 初始化耗材消耗趋势图表
const consumptionTrendChart = echarts.init(this.$refs.consumptionTrendChart)
consumptionTrendChart.setOption(this.consumptionTrendOptions)
// 初始化部门耗材对比图表
const departmentComparisonChart = echarts.init(this.$refs.departmentComparisonChart)
departmentComparisonChart.setOption(this.departmentComparisonOptions)
// 监听窗口大小变化
window.addEventListener('resize', this.handleResize)
},
handleResize() {
// 重新调整图表大小
const deviceUsageChart = echarts.getInstanceByDom(this.$refs.deviceUsageChart)
const consumptionTrendChart = echarts.getInstanceByDom(this.$refs.consumptionTrendChart)
const departmentComparisonChart = echarts.getInstanceByDom(this.$refs.departmentComparisonChart)
if (deviceUsageChart) deviceUsageChart.resize()
if (consumptionTrendChart) consumptionTrendChart.resize()
if (departmentComparisonChart) departmentComparisonChart.resize()
},
handleExport(row) {
// 导出功能实现
this.$Message.success('导出成功')
}
},
beforeDestroy() {
// 移除窗口大小变化监听
window.removeEventListener('resize', this.handleResize)
}
}
</script>
<style lang="less" scoped>
.dashboard-container {
padding: 20px;
.stat-cards {
margin-bottom: 20px;
.stat-item {
text-align: center;
padding: 20px;
h3 {
margin-bottom: 10px;
color: #17233d;
}
.count {
font-size: 24px;
font-weight: bold;
margin: 10px 0;
}
&.warning {
color: #ff9900;
}
&.danger {
color: #ed4014;
}
}
}
.chart-card {
margin-bottom: 20px;
.chart-container {
height: 300px;
}
}
.table-card {
margin-bottom: 20px;
}
}
</style>
<template>
<div class="dashboard-container">
<!-- 顶部统计卡片 -->
<Row :gutter="16" class="stat-cards">
<i-col span="8">
<Card>
<div class="stat-item">
<h3>库存总量</h3>
<div class="count">{{ totalInventory }}</div>
<p>当前库存总数</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item warning">
<h3>近效期耗材</h3>
<div class="count">{{ expiringItems }}</div>
<p>有效期不足30天</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item danger">
<h3>低库存预警</h3>
<div class="count">{{ lowStockItems }}</div>
<p>低于安全库存</p>
</div>
</Card>
</i-col>
</Row>
<!-- 设备使用分析 -->
<Card class="chart-card">
<p slot="title">设备使用率分析</p>
<div class="chart-container" ref="deviceUsageChart"></div>
</Card>
<!-- 耗材消耗趋势 -->
<Row :gutter="16">
<i-col span="12">
<Card class="chart-card">
<p slot="title">耗材消耗趋势</p>
<div class="chart-container" ref="consumptionTrendChart"></div>
</Card>
</i-col>
<i-col span="12">
<Card class="chart-card">
<p slot="title">部门耗材对比</p>
<div class="chart-container" ref="departmentComparisonChart"></div>
</Card>
</i-col>
</Row>
<!-- 近效期耗材列表 -->
<Card class="table-card">
<p slot="title">近效期耗材清单</p>
<Table :columns="expiringColumns" :data="expiringData">
<template slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="handleExport(row)">导出</Button>
</template>
</Table>
</Card>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'Dashboard',
data() {
return {
// 模拟数据
totalInventory: 2580,
expiringItems: 15,
lowStockItems: 8,
// 近效期耗材表格配置
expiringColumns: [
{ title: '耗材名称', key: 'name' },
{ title: '库存数量', key: 'quantity' },
{ title: '有效期至', key: 'expireDate' },
{ title: '剩余天数', key: 'daysLeft' },
{ title: '操作', slot: 'action' }
],
expiringData: [
{
name: '水性笔',
quantity: 50,
expireDate: '2024-02-15',
daysLeft: 25
}
// 更多数据...
],
// 图表配置
deviceUsageOptions: {
title: { text: '设备使用频率统计' },
tooltip: {},
xAxis: {
data: ['打印机A', '打印机B', '复印机', '扫描仪']
},
yAxis: {},
series: [{
type: 'bar',
data: [120, 200, 150, 80]
}]
},
consumptionTrendOptions: {
title: { text: '耗材消耗趋势预测' },
tooltip: {},
legend: {
data: ['实际消耗', '预测消耗']
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月']
},
yAxis: {},
series: [
{
name: '实际消耗',
type: 'line',
data: [120, 132, 101, 134, 90, 230]
},
{
name: '预测消耗',
type: 'line',
data: [220, 182, 191, 234, 290, 330]
}
]
},
departmentComparisonOptions: {
title: { text: '部门耗材使用对比' },
tooltip: {},
legend: {},
xAxis: {
data: ['办公室', '研发部', '销售部', '人事部']
},
yAxis: {},
series: [{
type: 'bar',
data: [150, 230, 180, 120]
}]
}
}
},
mounted() {
this.initCharts()
},
methods: {
initCharts() {
// 初始化设备使用率图表
const deviceUsageChart = echarts.init(this.$refs.deviceUsageChart)
deviceUsageChart.setOption(this.deviceUsageOptions)
// 初始化耗材消耗趋势图表
const consumptionTrendChart = echarts.init(this.$refs.consumptionTrendChart)
consumptionTrendChart.setOption(this.consumptionTrendOptions)
// 初始化部门耗材对比图表
const departmentComparisonChart = echarts.init(this.$refs.departmentComparisonChart)
departmentComparisonChart.setOption(this.departmentComparisonOptions)
// 监听窗口大小变化
window.addEventListener('resize', this.handleResize)
},
handleResize() {
// 重新调整图表大小
const deviceUsageChart = echarts.getInstanceByDom(this.$refs.deviceUsageChart)
const consumptionTrendChart = echarts.getInstanceByDom(this.$refs.consumptionTrendChart)
const departmentComparisonChart = echarts.getInstanceByDom(this.$refs.departmentComparisonChart)
if (deviceUsageChart) deviceUsageChart.resize()
if (consumptionTrendChart) consumptionTrendChart.resize()
if (departmentComparisonChart) departmentComparisonChart.resize()
},
handleExport(row) {
// 导出功能实现
this.$Message.success('导出成功')
}
},
beforeDestroy() {
// 移除窗口大小变化监听
window.removeEventListener('resize', this.handleResize)
}
}
</script>
<style lang="less" scoped>
.dashboard-container {
.stat-cards {
margin-bottom: 20px;
.stat-item {
text-align: center;
padding: 20px;
h3 {
margin-bottom: 10px;
color: #17233d;
}
.count {
font-size: 24px;
font-weight: bold;
margin: 10px 0;
}
&.warning {
color: #ff9900;
}
&.danger {
color: #ed4014;
}
}
}
.chart-card {
margin-bottom: 20px;
.chart-container {
height: 300px;
}
}
.table-card {
margin-bottom: 20px;
}
}
</style>
<template>
<div class="dashboard-container">
<!-- 顶部统计卡片 -->
<Row :gutter="16" class="stat-cards">
<i-col span="8">
<Card>
<div class="stat-item">
<h3>库存总量</h3>
<div class="count">{{ totalInventory }}</div>
<p>当前库存总数</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item warning">
<h3>近效期耗材</h3>
<div class="count">{{ expiringItems }}</div>
<p>有效期不足30天</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item danger">
<h3>低库存预警</h3>
<div class="count">{{ lowStockItems }}</div>
<p>低于安全库存</p>
</div>
</Card>
</i-col>
</Row>
<!-- 设备使用分析 -->
<Card class="chart-card">
<p slot="title">设备使用率分析</p>
<div class="chart-container" ref="deviceUsageChart"></div>
</Card>
<!-- 耗材消耗分析 -->
<Row :gutter="16">
<i-col span="12">
<Card class="chart-card">
<p slot="title">耗材消耗趋势</p>
<div class="chart-container" ref="consumptionTrendChart"></div>
</Card>
</i-col>
<i-col span="12">
<Card class="chart-card">
<p slot="title">部门耗材对比</p>
<div class="chart-container" ref="departmentComparisonChart"></div>
</Card>
</i-col>
</Row>
<!-- 近效期耗材列表 -->
<Card class="table-card">
<p slot="title">近效期耗材清单</p>
<Table :columns="expiringColumns" :data="expiringData">
<template slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="handleExport(row)">导出</Button>
</template>
</Table>
</Card>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'Dashboard',
data() {
return {
// 模拟数据
totalInventory: 2580,
expiringItems: 15,
lowStockItems: 8,
// 近效期耗材表格配置
expiringColumns: [
{ title: '耗材名称', key: 'name' },
{ title: '库存数量', key: 'quantity' },
{ title: '有效期至', key: 'expireDate' },
{ title: '剩余天数', key: 'daysLeft' },
{ title: '操作', slot: 'action' }
],
expiringData: [
{
name: '水性笔',
quantity: 50,
expireDate: '2024-02-15',
daysLeft: 25
}
// 更多数据...
],
// 图表配置
deviceUsageOptions: {
title: { text: '设备使用频率统计' },
tooltip: {},
xAxis: {
data: ['打印机A', '打印机B', '复印机', '扫描仪']
},
yAxis: {},
series: [{
type: 'bar',
data: [120, 200, 150, 80]
}]
},
consumptionTrendOptions: {
title: { text: '耗材消耗趋势预测' },
tooltip: {},
legend: {
data: ['实际消耗', '预测消耗']
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月']
},
yAxis: {},
series: [
{
name: '实际消耗',
type: 'line',
data: [120, 132, 101, 134, 90, 230]
},
{
name: '预测消耗',
type: 'line',
data: [220, 182, 191, 234, 290, 330]
}
]
},
departmentComparisonOptions: {
title: { text: '部门耗材使用对比' },
tooltip: {},
legend: {},
xAxis: {
data: ['办公室', '研发部', '销售部', '人事部']
},
yAxis: {},
series: [{
type: 'bar',
data: [150, 230, 180, 120]
}]
}
}
},
mounted() {
this.initCharts()
},
methods: {
initCharts() {
// 初始化设备使用率图表
const deviceUsageChart = echarts.init(this.$refs.deviceUsageChart)
deviceUsageChart.setOption(this.deviceUsageOptions)
// 初始化耗材消耗趋势图表
const consumptionTrendChart = echarts.init(this.$refs.consumptionTrendChart)
consumptionTrendChart.setOption(this.consumptionTrendOptions)
// 初始化部门耗材对比图表
const departmentComparisonChart = echarts.init(this.$refs.departmentComparisonChart)
departmentComparisonChart.setOption(this.departmentComparisonOptions)
// 监听窗口大小变化
window.addEventListener('resize', this.handleResize)
},
handleResize() {
// 重新调整图表大小
const deviceUsageChart = echarts.getInstanceByDom(this.$refs.deviceUsageChart)
const consumptionTrendChart = echarts.getInstanceByDom(this.$refs.consumptionTrendChart)
const departmentComparisonChart = echarts.getInstanceByDom(this.$refs.departmentComparisonChart)
if (deviceUsageChart) deviceUsageChart.resize()
if (consumptionTrendChart) consumptionTrendChart.resize()
if (departmentComparisonChart) departmentComparisonChart.resize()
},
handleExport(row) {
// 导出功能实现
this.$Message.success('导出成功')
}
},
beforeDestroy() {
// 移除窗口大小变化监听
window.removeEventListener('resize', this.handleResize)
}
}
</script>
<style lang="less" scoped>
.dashboard-container {
.stat-cards {
margin-bottom: 20px;
.stat-item {
text-align: center;
padding: 20px;
h3 {
margin-bottom: 10px;
color: #17233d;
}
.count {
font-size: 24px;
font-weight: bold;
margin: 10px 0;
}
&.warning {
color: #ff9900;
}
&.danger {
color: #ed4014;
}
}
}
.chart-card {
margin-bottom: 20px;
.chart-container {
height: 300px;
}
}
.table-card {
margin-bottom: 20px;
}
}
</style>
<template>
<div class="dashboard-container">
<!-- 顶部统计卡片 -->
<Row :gutter="16" class="stat-cards">
<i-col span="8">
<Card>
<div class="stat-item">
<h3>库存总量</h3>
<div class="count">{{ totalInventory }}</div>
<p>当前库存总数</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item warning">
<h3>近效期耗材</h3>
<div class="count">{{ expiringItems }}</div>
<p>有效期不足30天</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item danger">
<h3>低库存预警</h3>
<div class="count">{{ lowStockItems }}</div>
<p>低于安全库存</p>
</div>
</Card>
</i-col>
</Row>
<!-- 设备使用分析 -->
<Card class="chart-card">
<p slot="title">设备使用率分析</p>
<div class="chart-container" ref="deviceUsageChart"></div>
</Card>
<!-- 耗材消耗分析 -->
<Row :gutter="16">
<i-col span="12">
<Card class="chart-card">
<p slot="title">耗材消耗趋势</p>
<div class="chart-container" ref="consumptionTrendChart"></div>
</Card>
</i-col>
<i-col span="12">
<Card class="chart-card">
<p slot="title">部门耗材对比</p>
<div class="chart-container" ref="departmentComparisonChart"></div>
</Card>
</i-col>
</Row>
<!-- 近效期耗材列表 -->
<Card class="table-card">
<p slot="title">近效期耗材清单</p>
<Table :columns="expiringColumns" :data="expiringData">
<template slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="handleExport(row)">导出</Button>
</template>
</Table>
</Card>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'Dashboard',
data() {
return {
// 模拟数据
totalInventory: 2580,
expiringItems: 15,
lowStockItems: 8,
// 近效期耗材表格配置
expiringColumns: [
{ title: '耗材名称', key: 'name' },
{ title: '库存数量', key: 'quantity' },
{ title: '有效期至', key: 'expireDate' },
{ title: '剩余天数', key: 'daysLeft' },
{ title: '操作', slot: 'action' }
],
expiringData: [
{
name: '水性笔',
quantity: 50,
expireDate: '2024-02-15',
daysLeft: 25
}
// 更多数据...
],
// 图表配置
deviceUsageOptions: {
title: { text: '设备使用频率统计' },
tooltip: {},
xAxis: {
data: ['打印机A', '打印机B', '复印机', '扫描仪']
},
yAxis: {},
series: [{
type: 'bar',
data: [120, 200, 150, 80]
}]
},
consumptionTrendOptions: {
title: { text: '耗材消耗趋势预测' },
tooltip: {},
legend: {
data: ['实际消耗', '预测消耗']
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月']
},
yAxis: {},
series: [
{
name: '实际消耗',
type: 'line',
data: [120, 132, 101, 134, 90, 230]
},
{
name: '预测消耗',
type: 'line',
data: [220, 182, 191, 234, 290, 330]
}
]
},
departmentComparisonOptions: {
title: { text: '部门耗材使用对比' },
tooltip: {},
legend: {},
xAxis: {
data: ['办公室', '研发部', '销售部', '人事部']
},
yAxis: {},
series: [{
type: 'bar',
data: [150, 230, 180, 120]
}]
}
}
},
mounted() {
this.initCharts()
},
methods: {
initCharts() {
// 初始化设备使用率图表
const deviceUsageChart = echarts.init(this.$refs.deviceUsageChart)
deviceUsageChart.setOption(this.deviceUsageOptions)
// 初始化耗材消耗趋势图表
const consumptionTrendChart = echarts.init(this.$refs.consumptionTrendChart)
consumptionTrendChart.setOption(this.consumptionTrendOptions)
// 初始化部门耗材对比图表
const departmentComparisonChart = echarts.init(this.$refs.departmentComparisonChart)
departmentComparisonChart.setOption(this.departmentComparisonOptions)
// 监听窗口大小变化
window.addEventListener('resize', this.handleResize)
},
handleResize() {
// 重新调整图表大小
const deviceUsageChart = echarts.getInstanceByDom(this.$refs.deviceUsageChart)
const consumptionTrendChart = echarts.getInstanceByDom(this.$refs.consumptionTrendChart)
const departmentComparisonChart = echarts.getInstanceByDom(this.$refs.departmentComparisonChart)
if (deviceUsageChart) deviceUsageChart.resize()
if (consumptionTrendChart) consumptionTrendChart.resize()
if (departmentComparisonChart) departmentComparisonChart.resize()
},
handleExport(row) {
// 导出功能实现
this.$Message.success('导出成功')
}
},
beforeDestroy() {
// 移除窗口大小变化监听
window.removeEventListener('resize', this.handleResize)
}
}
</script>
<style lang="less" scoped>
.dashboard-container {
.stat-cards {
margin-bottom: 20px;
.stat-item {
text-align: center;
padding: 20px;
h3 {
margin-bottom: 10px;
color: #17233d;
}
.count {
font-size: 24px;
font-weight: bold;
margin: 10px 0;
}
&.warning {
color: #ffcc80;
}
&.danger {
color: #ff9999;
}
}
}
.chart-card {
margin-bottom: 20px;
.chart-container {
height: 300px;
}
}
.table-card {
margin-bottom: 20px;
}
}
</style>
<template>
<div class="dashboard-container">
<!-- 顶部统计卡片 -->
<Row :gutter="16" class="stat-cards">
<i-col span="8">
<Collapse simple>
<Panel>
<div class="stat-item" slot="content">
<h3>库存总量</h3>
<div class="count">{{ totalInventory }}</div>
<p>当前库存总数</p>
</div>
<div slot="header" class="stat-header">
<h3>库存总量</h3>
<div class="count">{{ totalInventory }}</div>
</div>
</Panel>
</Collapse>
</i-col>
<i-col span="8">
<Collapse simple>
<Panel>
<div class="stat-item warning" slot="content">
<h3>近效期耗材</h3>
<div class="count">{{ expiringItems }}</div>
<p>有效期不足30天</p>
</div>
<div slot="header" class="stat-header warning">
<h3>近效期耗材</h3>
<div class="count">{{ expiringItems }}</div>
</div>
</Panel>
</Collapse>
</i-col>
<i-col span="8">
<Collapse simple>
<Panel>
<div class="stat-item danger" slot="content">
<h3>低库存预警</h3>
<div class="count">{{ lowStockItems }}</div>
<p>低于安全库存</p>
</div>
<div slot="header" class="stat-header danger">
<h3>低库存预警</h3>
<div class="count">{{ lowStockItems }}</div>
</div>
</Panel>
</Collapse>
</i-col>
</Row>
<!-- 设备使用分析 -->
<Card class="chart-card">
<p slot="title">设备使用率分析</p>
<div class="chart-container" ref="deviceUsageChart"></div>
</Card>
<!-- 耗材消耗分析 -->
<Row :gutter="16">
<i-col span="12">
<Card class="chart-card">
<p slot="title">耗材消耗趋势</p>
<div class="chart-container" ref="consumptionTrendChart"></div>
</Card>
</i-col>
<i-col span="12">
<Card class="chart-card">
<p slot="title">部门耗材对比</p>
<div class="chart-container" ref="departmentComparisonChart"></div>
</Card>
</i-col>
</Row>
<!-- 近效期耗材列表 -->
<Card class="table-card">
<p slot="title">近效期耗材清单</p>
<Table :columns="expiringColumns" :data="expiringData">
<template slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="handleExport(row)">导出</Button>
</template>
</Table>
</Card>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'Dashboard',
data() {
return {
// 模拟数据
totalInventory: 2580,
expiringItems: 15,
lowStockItems: 8,
// 近效期耗材表格配置
expiringColumns: [
{ title: '耗材名称', key: 'name' },
{ title: '库存数量', key: 'quantity' },
{ title: '有效期至', key: 'expireDate' },
{ title: '剩余天数', key: 'daysLeft' },
{ title: '操作', slot: 'action' }
],
expiringData: [
{
name: '水性笔',
quantity: 50,
expireDate: '2024-02-15',
daysLeft: 25
}
// 更多数据...
],
// 图表配置
deviceUsageOptions: {
title: { text: '设备使用频率统计' },
tooltip: {},
xAxis: {
data: ['打印机A', '打印机B', '复印机', '扫描仪']
},
yAxis: {},
series: [{
type: 'bar',
data: [120, 200, 150, 80]
}]
},
consumptionTrendOptions: {
title: { text: '耗材消耗趋势预测' },
tooltip: {},
legend: {
data: ['实际消耗', '预测消耗']
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月']
},
yAxis: {},
series: [
{
name: '实际消耗',
type: 'line',
data: [120, 132, 101, 134, 90, 230]
},
{
name: '预测消耗',
type: 'line',
data: [220, 182, 191, 234, 290, 330]
}
]
},
departmentComparisonOptions: {
title: { text: '部门耗材使用对比' },
tooltip: {},
legend: {},
xAxis: {
data: ['办公室', '研发部', '销售部', '人事部']
},
yAxis: {},
series: [{
type: 'bar',
data: [150, 230, 180, 120]
}]
}
}
},
mounted() {
this.initCharts()
},
methods: {
initCharts() {
// 初始化设备使用率图表
const deviceUsageChart = echarts.init(this.$refs.deviceUsageChart)
deviceUsageChart.setOption(this.deviceUsageOptions)
// 初始化耗材消耗趋势图表
const consumptionTrendChart = echarts.init(this.$refs.consumptionTrendChart)
consumptionTrendChart.setOption(this.consumptionTrendOptions)
// 初始化部门耗材对比图表
const departmentComparisonChart = echarts.init(this.$refs.departmentComparisonChart)
departmentComparisonChart.setOption(this.departmentComparisonOptions)
// 监听窗口大小变化
window.addEventListener('resize', this.handleResize)
},
handleResize() {
// 重新调整图表大小
const deviceUsageChart = echarts.getInstanceByDom(this.$refs.deviceUsageChart)
const consumptionTrendChart = echarts.getInstanceByDom(this.$refs.consumptionTrendChart)
const departmentComparisonChart = echarts.getInstanceByDom(this.$refs.departmentComparisonChart)
if (deviceUsageChart) deviceUsageChart.resize()
if (consumptionTrendChart) consumptionTrendChart.resize()
if (departmentComparisonChart) departmentComparisonChart.resize()
},
handleExport(row) {
// 导出功能实现
this.$Message.success('导出成功')
}
},
beforeDestroy() {
// 移除窗口大小变化监听
window.removeEventListener('resize', this.handleResize)
}
}
</script>
<style lang="less" scoped>
.dashboard-container {
.stat-cards {
margin-bottom: 20px;
.stat-item {
text-align: center;
padding: 20px;
h3 {
margin-bottom: 10px;
color: #17233d;
}
.count {
font-size: 24px;
font-weight: bold;
margin: 10px 0;
}
&.warning {
color: #ffcc80;
}
&.danger {
color: #ff9999;
}
}
.stat-header {
text-align: center;
h3 {
margin-bottom: 5px;
color: #17233d;
}
.count {
font-size: 20px;
font-weight: bold;
}
&.warning {
color: #ffcc80;
}
&.danger {
color: #ff9999;
}
}
}
.chart-card {
margin-bottom: 20px;
.chart-container {
height: 300px;
}
}
.table-card {
margin-bottom: 20px;
}
}
</style>
<template>
<div class="dashboard-container">
<!-- 顶部统计卡片 -->
<Row :gutter="16" class="stat-cards">
<i-col span="8">
<Card>
<Collapse simple>
<Panel name="1">
<div slot="header" class="stat-header">
<h3>库存总量</h3>
<div class="count">{{ totalInventory }}</div>
</div>
<div class="stat-item">
<p>当前库存总数</p>
</div>
</Panel>
</Collapse>
</Card>
</i-col>
<i-col span="8">
<Card>
<Collapse simple>
<Panel name="2">
<div slot="header" class="stat-header warning">
<h3>近效期耗材</h3>
<div class="count">{{ expiringItems }}</div>
</div>
<div class="stat-item warning">
<p>有效期不足30天</p>
</div>
</Panel>
</Collapse>
</Card>
</i-col>
<i-col span="8">
<Card>
<Collapse simple>
<Panel name="3">
<div slot="header" class="stat-header danger">
<h3>低库存预警</h3>
<div class="count">{{ lowStockItems }}</div>
</div>
<div class="stat-item danger">
<p>低于安全库存</p>
</div>
</Panel>
</Collapse>
</Card>
</i-col>
</Row>
<!-- 设备使用分析 -->
<Card class="chart-card">
<p slot="title">设备使用率分析</p>
<div class="chart-container" ref="deviceUsageChart"></div>
</Card>
<!-- 耗材消耗分析 -->
<Row :gutter="16">
<i-col span="12">
<Card class="chart-card">
<p slot="title">耗材消耗趋势</p>
<div class="chart-container" ref="consumptionTrendChart"></div>
</Card>
</i-col>
<i-col span="12">
<Card class="chart-card">
<p slot="title">部门耗材对比</p>
<div class="chart-container" ref="departmentComparisonChart"></div>
</Card>
</i-col>
</Row>
<!-- 近效期耗材列表 -->
<Card class="table-card">
<p slot="title">近效期耗材清单</p>
<Table :columns="expiringColumns" :data="expiringData">
<template slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="handleExport(row)">导出</Button>
</template>
</Table>
</Card>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'Dashboard',
data() {
return {
// 模拟数据
totalInventory: 2580,
expiringItems: 15,
lowStockItems: 8,
// 近效期耗材表格配置
expiringColumns: [
{ title: '耗材名称', key: 'name' },
{ title: '库存数量', key: 'quantity' },
{ title: '有效期至', key: 'expireDate' },
{ title: '剩余天数', key: 'daysLeft' },
{ title: '操作', slot: 'action' }
],
expiringData: [
{
name: '水性笔',
quantity: 50,
expireDate: '2024-02-15',
daysLeft: 25
}
// 更多数据...
],
// 图表配置
deviceUsageOptions: {
title: { text: '设备使用频率统计' },
tooltip: {},
xAxis: {
data: ['打印机A', '打印机B', '复印机', '扫描仪']
},
yAxis: {},
series: [{
type: 'bar',
data: [120, 200, 150, 80]
}]
},
consumptionTrendOptions: {
title: { text: '耗材消耗趋势预测' },
tooltip: {},
legend: {
data: ['实际消耗', '预测消耗']
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月']
},
yAxis: {},
series: [
{
name: '实际消耗',
type: 'line',
data: [120, 132, 101, 134, 90, 230]
},
{
name: '预测消耗',
type: 'line',
data: [220, 182, 191, 234, 290, 330]
}
]
},
departmentComparisonOptions: {
title: { text: '部门耗材使用对比' },
tooltip: {},
legend: {},
xAxis: {
data: ['办公室', '研发部', '销售部', '人事部']
},
yAxis: {},
series: [{
type: 'bar',
data: [150, 230, 180, 120]
}]
}
}
},
mounted() {
this.initCharts()
},
methods: {
initCharts() {
// 初始化设备使用率图表
const deviceUsageChart = echarts.init(this.$refs.deviceUsageChart)
deviceUsageChart.setOption(this.deviceUsageOptions)
// 初始化耗材消耗趋势图表
const consumptionTrendChart = echarts.init(this.$refs.consumptionTrendChart)
consumptionTrendChart.setOption(this.consumptionTrendOptions)
// 初始化部门耗材对比图表
const departmentComparisonChart = echarts.init(this.$refs.departmentComparisonChart)
departmentComparisonChart.setOption(this.departmentComparisonOptions)
// 监听窗口大小变化
window.addEventListener('resize', this.handleResize)
},
handleResize() {
// 重新调整图表大小
const deviceUsageChart = echarts.getInstanceByDom(this.$refs.deviceUsageChart)
const consumptionTrendChart = echarts.getInstanceByDom(this.$refs.consumptionTrendChart)
const departmentComparisonChart = echarts.getInstanceByDom(this.$refs.departmentComparisonChart)
if (deviceUsageChart) deviceUsageChart.resize()
if (consumptionTrendChart) consumptionTrendChart.resize()
if (departmentComparisonChart) departmentComparisonChart.resize()
},
handleExport(row) {
// 导出功能实现
this.$Message.success('导出成功')
}
},
beforeDestroy() {
// 移除窗口大小变化监听
window.removeEventListener('resize', this.handleResize)
}
}
</script>
<style lang="less" scoped>
.dashboard-container {
.stat-cards {
margin-bottom: 20px;
.stat-item {
text-align: center;
padding: 10px;
p {
color: #515a6e;
margin: 0;
}
&.warning p {
color: #ffcc80;
}
&.danger p {
color: #ff9999;
}
}
.stat-header {
text-align: center;
h3 {
margin-bottom: 5px;
color: #17233d;
}
.count {
font-size: 24px;
font-weight: bold;
}
&.warning .count {
color: #ffcc80;
}
&.danger .count {
color: #ff9999;
}
}
/deep/ .ivu-collapse {
background-color: transparent;
border: none;
}
/deep/ .ivu-collapse-simple {
border-radius: 0;
}
/deep/ .ivu-collapse-header {
background-color: transparent;
border: none;
padding: 10px !important;
}
/deep/ .ivu-collapse-content {
padding: 0;
background-color: transparent;
}
}
.chart-card {
margin-bottom: 20px;
.chart-container {
height: 300px;
}
}
.table-card {
margin-bottom: 20px;
}
}
</style>
<template>
<div class="dashboard-container">
<!-- 顶部统计卡片 -->
<Row :gutter="16" class="stat-cards">
<i-col span="8">
<Card>
<div class="stat-item">
<h3>库存总量</h3>
<div class="count">{{ totalInventory }}</div>
<p>当前库存总数</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item warning">
<h3>近效期耗材</h3>
<div class="count">{{ expiringItems }}</div>
<p>有效期不足30天</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item danger">
<h3>低库存预警</h3>
<div class="count">{{ lowStockItems }}</div>
<p>低于安全库存</p>
</div>
</Card>
</i-col>
</Row>
<!-- 设备使用分析 -->
<Card class="chart-card">
<p slot="title">设备使用率分析</p>
<div class="chart-container" ref="deviceUsageChart"></div>
</Card>
<!-- 耗材消耗分析 -->
<Row :gutter="16">
<i-col span="12">
<Card class="chart-card">
<p slot="title">耗材消耗趋势</p>
<div class="chart-container" ref="consumptionTrendChart"></div>
</Card>
</i-col>
<i-col span="12">
<Card class="chart-card">
<p slot="title">部门耗材对比</p>
<div class="chart-container" ref="departmentComparisonChart"></div>
</Card>
</i-col>
</Row>
<!-- 近效期耗材列表 -->
<Card class="table-card">
<p slot="title">近效期耗材清单</p>
<Table :columns="expiringColumns" :data="expiringData">
<template slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="handleExport(row)">导出</Button>
</template>
</Table>
</Card>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'Dashboard',
data() {
return {
// 模拟数据
totalInventory: 2580,
expiringItems: 15,
lowStockItems: 8,
// 近效期耗材表格配置
expiringColumns: [
{ title: '耗材名称', key: 'name' },
{ title: '库存数量', key: 'quantity' },
{ title: '有效期至', key: 'expireDate' },
{ title: '剩余天数', key: 'daysLeft' },
{ title: '操作', slot: 'action' }
],
expiringData: [
{
name: '水性笔',
quantity: 50,
expireDate: '2024-02-15',
daysLeft: 25
}
// 更多数据...
],
// 图表配置
deviceUsageOptions: {
title: { text: '设备使用频率统计' },
tooltip: {},
xAxis: {
data: ['打印机A', '打印机B', '复印机', '扫描仪']
},
yAxis: {},
series: [{
type: 'bar',
data: [120, 200, 150, 80]
}]
},
consumptionTrendOptions: {
title: { text: '耗材消耗趋势预测' },
tooltip: {},
legend: {
data: ['实际消耗', '预测消耗']
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月']
},
yAxis: {},
series: [
{
name: '实际消耗',
type: 'line',
data: [120, 132, 101, 134, 90, 230]
},
{
name: '预测消耗',
type: 'line',
data: [220, 182, 191, 234, 290, 330]
}
]
},
departmentComparisonOptions: {
title: { text: '部门耗材使用对比' },
tooltip: {},
legend: {},
xAxis: {
data: ['办公室', '研发部', '销售部', '人事部']
},
yAxis: {},
series: [{
type: 'bar',
data: [150, 230, 180, 120]
}]
}
}
},
mounted() {
this.initCharts()
},
methods: {
initCharts() {
// 初始化设备使用率图表
const deviceUsageChart = echarts.init(this.$refs.deviceUsageChart)
deviceUsageChart.setOption(this.deviceUsageOptions)
// 初始化耗材消耗趋势图表
const consumptionTrendChart = echarts.init(this.$refs.consumptionTrendChart)
consumptionTrendChart.setOption(this.consumptionTrendOptions)
// 初始化部门耗材对比图表
const departmentComparisonChart = echarts.init(this.$refs.departmentComparisonChart)
departmentComparisonChart.setOption(this.departmentComparisonOptions)
// 监听窗口大小变化
window.addEventListener('resize', this.handleResize)
},
handleResize() {
// 重新调整图表大小
const deviceUsageChart = echarts.getInstanceByDom(this.$refs.deviceUsageChart)
const consumptionTrendChart = echarts.getInstanceByDom(this.$refs.consumptionTrendChart)
const departmentComparisonChart = echarts.getInstanceByDom(this.$refs.departmentComparisonChart)
if (deviceUsageChart) deviceUsageChart.resize()
if (consumptionTrendChart) consumptionTrendChart.resize()
if (departmentComparisonChart) departmentComparisonChart.resize()
},
handleExport(row) {
// 导出功能实现
this.$Message.success('导出成功')
}
},
beforeDestroy() {
// 移除窗口大小变化监听
window.removeEventListener('resize', this.handleResize)
}
}
</script>
<style lang="less" scoped>
.dashboard-container {
.stat-cards {
margin-bottom: 20px;
.stat-item {
text-align: center;
padding: 20px;
h3 {
margin-bottom: 10px;
color: #17233d;
}
.count {
font-size: 24px;
font-weight: bold;
margin: 10px 0;
}
&.warning {
color: #ffcc80;
}
&.danger {
color: #ff9999;
}
}
}
.chart-card {
margin-bottom: 20px;
.chart-container {
height: 300px;
}
}
.table-card {
margin-bottom: 20px;
}
}
</style>
<template>
<div class="dashboard-container">
<!-- 顶部统计卡片 -->
<Row :gutter="16" class="stat-cards">
<i-col span="8">
<Card>
<div class="stat-item">
<h3>库存总量</h3>
<div class="count">{{ totalInventory }}</div>
<p>当前库存总数</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item warning">
<h3>近效期耗材</h3>
<div class="count">{{ expiringItems }}</div>
<p>有效期不足30天</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item danger">
<h3>低库存预警</h3>
<div class="count">{{ lowStockItems }}</div>
<p>低于安全库存</p>
</div>
</Card>
</i-col>
</Row>
<!-- 设备使用分析 -->
<Card class="chart-card">
<p slot="title">设备使用率分析</p>
<div class="chart-container" ref="deviceUsageChart"></div>
</Card>
<!-- 耗材消耗分析 -->
<Row :gutter="16">
<i-col span="12">
<Card class="chart-card">
<p slot="title">耗材消耗趋势</p>
<div class="chart-container" ref="consumptionTrendChart"></div>
</Card>
</i-col>
<i-col span="12">
<Card class="chart-card">
<p slot="title">部门耗材对比</p>
<div class="chart-container" ref="departmentComparisonChart"></div>
</Card>
</i-col>
</Row>
<!-- 近效期耗材列表 -->
<Card class="table-card">
<p slot="title">近效期耗材清单</p>
<Table :columns="expiringColumns" :data="expiringData">
<template slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="handleExport(row)">导出</Button>
</template>
</Table>
</Card>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'Dashboard',
data() {
return {
// 模拟数据
totalInventory: 2580,
expiringItems: 15,
lowStockItems: 8,
// 近效期耗材表格配置
expiringColumns: [
{ title: '耗材名称', key: 'name' },
{ title: '库存数量', key: 'quantity' },
{ title: '有效期至', key: 'expireDate' },
{ title: '剩余天数', key: 'daysLeft' },
{ title: '操作', slot: 'action' }
],
expiringData: [
{
name: '水性笔',
quantity: 50,
expireDate: '2024-02-15',
daysLeft: 25
}
// 更多数据...
],
// 图表配置
deviceUsageOptions: {
title: { text: '设备使用频率统计' },
tooltip: {},
legend: {
data: ['使用频率']
},
xAxis: {
data: ['打印机A', '打印机B', '复印机', '扫描仪']
},
yAxis: {},
series: [{
name: '使用频率',
type: 'bar',
data: [120, 200, 150, 80]
}]
},
consumptionTrendOptions: {
title: { text: '耗材消耗趋势预测' },
tooltip: {},
legend: {
data: ['实际消耗', '预测消耗'],
selectedMode: true
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月']
},
yAxis: {},
series: [
{
name: '实际消耗',
type: 'line',
data: [120, 132, 101, 134, 90, 230]
},
{
name: '预测消耗',
type: 'line',
data: [220, 182, 191, 234, 290, 330]
}
]
},
departmentComparisonOptions: {
title: { text: '部门耗材使用对比' },
tooltip: {},
legend: {
data: ['使用量'],
selectedMode: true
},
xAxis: {
data: ['办公室', '研发部', '销售部', '人事部']
},
yAxis: {},
series: [{
name: '使用量',
type: 'bar',
data: [150, 230, 180, 120]
}]
}
}
},
mounted() {
this.initCharts()
},
methods: {
initCharts() {
// 初始化设备使用率图表
const deviceUsageChart = echarts.init(this.$refs.deviceUsageChart)
deviceUsageChart.setOption(this.deviceUsageOptions)
// 初始化耗材消耗趋势图表
const consumptionTrendChart = echarts.init(this.$refs.consumptionTrendChart)
consumptionTrendChart.setOption(this.consumptionTrendOptions)
// 初始化部门耗材对比图表
const departmentComparisonChart = echarts.init(this.$refs.departmentComparisonChart)
departmentComparisonChart.setOption(this.departmentComparisonOptions)
// 监听窗口大小变化
window.addEventListener('resize', this.handleResize)
},
handleResize() {
// 重新调整图表大小
const deviceUsageChart = echarts.getInstanceByDom(this.$refs.deviceUsageChart)
const consumptionTrendChart = echarts.getInstanceByDom(this.$refs.consumptionTrendChart)
const departmentComparisonChart = echarts.getInstanceByDom(this.$refs.departmentComparisonChart)
if (deviceUsageChart) deviceUsageChart.resize()
if (consumptionTrendChart) consumptionTrendChart.resize()
if (departmentComparisonChart) departmentComparisonChart.resize()
},
handleExport(row) {
// 导出功能实现
this.$Message.success('导出成功')
}
},
beforeDestroy() {
// 移除窗口大小变化监听
window.removeEventListener('resize', this.handleResize)
}
}
</script>
<style lang="less" scoped>
.dashboard-container {
.stat-cards {
margin-bottom: 20px;
.stat-item {
text-align: center;
padding: 20px;
h3 {
margin-bottom: 10px;
color: #17233d;
}
.count {
font-size: 24px;
font-weight: bold;
margin: 10px 0;
}
&.warning {
color: #ffcc80;
}
&.danger {
color: #ff9999;
}
}
}
.chart-card {
margin-bottom: 20px;
.chart-container {
height: 300px;
}
}
.table-card {
margin-bottom: 20px;
}
}
</style>
<template>
<div class="dashboard-container">
<!-- 顶部统计卡片 -->
<Row :gutter="16" class="stat-cards">
<i-col span="8">
<Card>
<div class="stat-item">
<h3>库存总量</h3>
<div class="count">{{ totalInventory }}</div>
<p>当前库存总数</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item warning">
<h3>近效期耗材</h3>
<div class="count">{{ expiringItems }}</div>
<p>有效期不足30天</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item danger">
<h3>低库存预警</h3>
<div class="count">{{ lowStockItems }}</div>
<p>低于安全库存</p>
</div>
</Card>
</i-col>
</Row>
<!-- 设备使用分析 -->
<Card class="chart-card">
<p slot="title">设备使用率分析</p>
<div class="chart-container" ref="deviceUsageChart"></div>
</Card>
<!-- 耗材消耗分析 -->
<Row :gutter="16">
<i-col span="12">
<Card class="chart-card">
<p slot="title">耗材消耗趋势</p>
<div class="chart-container" ref="consumptionTrendChart"></div>
</Card>
</i-col>
<i-col span="12">
<Card class="chart-card">
<p slot="title">部门耗材对比</p>
<div class="chart-container" ref="departmentComparisonChart"></div>
</Card>
</i-col>
</Row>
<!-- 近效期耗材列表 -->
<Card class="table-card">
<p slot="title">近效期耗材清单</p>
<Table :columns="expiringColumns" :data="expiringData">
<template :slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="handleExport(row)">导出</Button>
</template>
</Table>
</Card>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'Dashboard',
data() {
return {
// 模拟数据
totalInventory: 2580,
expiringItems: 15,
lowStockItems: 8,
// 近效期耗材表格配置
expiringColumns: [
{ title: '耗材名称', key: 'name' },
{ title: '库存数量', key: 'quantity' },
{ title: '有效期至', key: 'expireDate' },
{ title: '剩余天数', key: 'daysLeft' },
{ title: '操作', slot: 'action' }
],
expiringData: [
{
name: '水性笔',
quantity: 50,
expireDate: '2024-02-15',
daysLeft: 25
}
// 更多数据...
],
// 图表配置
deviceUsageOptions: {
title: { text: '设备使用频率统计' },
tooltip: {},
legend: {
data: ['使用频率']
},
xAxis: {
data: ['打印机A', '打印机B', '复印机', '扫描仪']
},
yAxis: {},
series: [{
name: '使用频率',
type: 'bar',
data: [120, 200, 150, 80]
}]
},
consumptionTrendOptions: {
title: { text: '耗材消耗趋势预测' },
tooltip: {},
legend: {
data: ['实际消耗', '预测消耗'],
selectedMode: true
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月']
},
yAxis: {},
series: [
{
name: '实际消耗',
type: 'line',
data: [120, 132, 101, 134, 90, 230]
},
{
name: '预测消耗',
type: 'line',
data: [220, 182, 191, 234, 290, 330]
}
]
},
departmentComparisonOptions: {
title: { text: '部门耗材使用对比' },
tooltip: {},
legend: {
data: ['使用量'],
selectedMode: true
},
xAxis: {
data: ['办公室', '研发部', '销售部', '人事部']
},
yAxis: {},
series: [{
name: '使用量',
type: 'bar',
data: [150, 230, 180, 120]
}]
}
}
},
mounted() {
this.initCharts()
},
methods: {
initCharts() {
// 初始化设备使用率图表
const deviceUsageChart = echarts.init(this.$refs.deviceUsageChart)
deviceUsageChart.setOption(this.deviceUsageOptions)
// 初始化耗材消耗趋势图表
const consumptionTrendChart = echarts.init(this.$refs.consumptionTrendChart)
consumptionTrendChart.setOption(this.consumptionTrendOptions)
// 初始化部门耗材对比图表
const departmentComparisonChart = echarts.init(this.$refs.departmentComparisonChart)
departmentComparisonChart.setOption(this.departmentComparisonOptions)
// 监听窗口大小变化
window.addEventListener('resize', this.handleResize)
},
handleResize() {
// 重新调整图表大小
const deviceUsageChart = echarts.getInstanceByDom(this.$refs.deviceUsageChart)
const consumptionTrendChart = echarts.getInstanceByDom(this.$refs.consumptionTrendChart)
const departmentComparisonChart = echarts.getInstanceByDom(this.$refs.departmentComparisonChart)
if (deviceUsageChart) deviceUsageChart.resize()
if (consumptionTrendChart) consumptionTrendChart.resize()
if (departmentComparisonChart) departmentComparisonChart.resize()
},
handleExport(row) {
// 导出功能实现
this.$Message.success('导出成功')
}
},
beforeDestroy() {
// 移除窗口大小变化监听
window.removeEventListener('resize', this.handleResize)
}
}
</script>
<style lang="less" scoped>
.dashboard-container {
.stat-cards {
margin-bottom: 20px;
.stat-item {
text-align: center;
padding: 20px;
h3 {
margin-bottom: 10px;
color: #17233d;
}
.count {
font-size: 24px;
font-weight: bold;
margin: 10px 0;
}
&.warning {
color: #ffcc80;
}
&.danger {
color: #ff9999;
}
}
}
.chart-card {
margin-bottom: 20px;
.chart-container {
height: 300px;
}
}
.table-card {
margin-bottom: 20px;
}
}
</style>
<template>
<div class="dashboard-container">
<!-- 顶部统计卡片 -->
<Row :gutter="16" class="stat-cards">
<i-col span="8">
<Card>
<div class="stat-item">
<h3>库存总量</h3>
<div class="count">{{ totalInventory }}</div>
<p>当前库存总数</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item warning">
<h3>近效期耗材</h3>
<div class="count">{{ expiringItems }}</div>
<p>有效期不足30天</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item danger">
<h3>低库存预警</h3>
<div class="count">{{ lowStockItems }}</div>
<p>低于安全库存</p>
</div>
</Card>
</i-col>
</Row>
<!-- 设备使用分析 -->
<Card class="chart-card">
<p slot="title">设备使用率分析</p>
<div class="chart-container" ref="deviceUsageChart"></div>
</Card>
<!-- 耗材消耗分析 -->
<Row :gutter="16">
<i-col span="12">
<Card class="chart-card">
<p slot="title">耗材消耗趋势</p>
<div class="chart-container" ref="consumptionTrendChart"></div>
</Card>
</i-col>
<i-col span="12">
<Card class="chart-card">
<p slot="title">部门耗材对比</p>
<div class="chart-container" ref="departmentComparisonChart"></div>
</Card>
</i-col>
</Row>
<!-- 近效期耗材列表 -->
<Card class="table-card">
<p slot="title">近效期耗材清单</p>
<Table :columns="expiringColumns" :data="expiringData">
<template :slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="handleExport(row)">导出</Button>
</template>
</Table>
</Card>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'Dashboard',
data() {
return {
// 模拟数据
totalInventory: 2580,
expiringItems: 15,
lowStockItems: 8,
// 近效期耗材表格配置
expiringColumns: [
{ title: '耗材名称', key: 'name' },
{ title: '库存数量', key: 'quantity' },
{ title: '有效期至', key: 'expireDate' },
{ title: '剩余天数', key: 'daysLeft' },
{ title: '操作', slot: 'action' }
],
expiringData: [
{
name: '水性笔',
quantity: 50,
expireDate: '2024-02-15',
daysLeft: 25
}
// 更多数据...
],
// 图表配置
deviceUsageOptions: {
title: { text: '设备使用频率统计' },
tooltip: {},
legend: {
data: ['使用频率']
},
xAxis: {
data: ['打印机A', '打印机B', '复印机', '扫描仪']
},
yAxis: {},
series: [{
name: '使用频率',
type: 'bar',
data: [120, 200, 150, 80]
}]
},
consumptionTrendOptions: {
title: { text: '耗材消耗趋势预测' },
tooltip: {},
legend: {
data: ['实际消耗', '预测消耗'],
selectedMode: true
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月']
},
yAxis: {},
series: [
{
name: '实际消耗',
type: 'line',
data: [120, 132, 101, 134, 90, 230]
},
{
name: '预测消耗',
type: 'line',
data: [220, 182, 191, 234, 290, 330]
}
]
},
departmentComparisonOptions: {
title: { text: '部门耗材使用对比' },
tooltip: {},
legend: {
data: ['使用量'],
selectedMode: true
},
xAxis: {
data: ['办公室', '研发部', '销售部', '人事部']
},
yAxis: {},
series: [{
name: '使用量',
type: 'bar',
data: [150, 230, 180, 120]
}]
}
}
},
mounted() {
this.initCharts()
},
methods: {
initCharts() {
// 初始化设备使用率图表
const deviceUsageChart = echarts.init(this.$refs.deviceUsageChart)
deviceUsageChart.setOption(this.deviceUsageOptions)
// 初始化耗材消耗趋势图表
const consumptionTrendChart = echarts.init(this.$refs.consumptionTrendChart)
consumptionTrendChart.setOption(this.consumptionTrendOptions)
// 初始化部门耗材对比图表
const departmentComparisonChart = echarts.init(this.$refs.departmentComparisonChart)
departmentComparisonChart.setOption(this.departmentComparisonOptions)
// 监听窗口大小变化
window.addEventListener('resize', this.handleResize)
},
handleResize() {
// 重新调整图表大小
const deviceUsageChart = echarts.getInstanceByDom(this.$refs.deviceUsageChart)
const consumptionTrendChart = echarts.getInstanceByDom(this.$refs.consumptionTrendChart)
const departmentComparisonChart = echarts.getInstanceByDom(this.$refs.departmentComparisonChart)
if (deviceUsageChart) deviceUsageChart.resize()
if (consumptionTrendChart) consumptionTrendChart.resize()
if (departmentComparisonChart) departmentComparisonChart.resize()
},
handleExport(row) {
// 导出功能实现
this.$Message.success('导出成功')
}
},
beforeDestroy() {
// 移除窗口大小变化监听
window.removeEventListener('resize', this.handleResize)
}
}
</script>
<style lang="less" scoped>
.dashboard-container {
.stat-cards {
margin-bottom: 20px;
.stat-item {
text-align: center;
padding: 20px;
h3 {
margin-bottom: 10px;
color: #17233d;
}
.count {
font-size: 24px;
font-weight: bold;
margin: 10px 0;
}
&.warning {
color: #ffcc80;
}
&.danger {
color: #ff9999;
}
}
}
.chart-card {
margin-bottom: 20px;
.chart-container {
height: 300px;
}
}
.table-card {
margin-bottom: 20px;
}
}
</style>
<template>
<div class="dashboard-container">
<!-- 顶部统计卡片 -->
<Row :gutter="16" class="stat-cards">
<i-col span="8">
<Card>
<div class="stat-item">
<h3>库存总量</h3>
<div class="count">{{ totalInventory }}</div>
<p>当前库存总数</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item warning">
<h3>近效期耗材</h3>
<div class="count">{{ expiringItems }}</div>
<p>有效期不足30天</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item danger">
<h3>低库存预警</h3>
<div class="count">{{ lowStockItems }}</div>
<p>低于安全库存</p>
</div>
</Card>
</i-col>
</Row>
<!-- 设备使用分析 -->
<Card class="chart-card">
<p slot="title">设备使用率分析</p>
<div class="chart-container" ref="deviceUsageChart"></div>
</Card>
<!-- 耗材消耗分析 -->
<Row :gutter="16">
<i-col span="12">
<Card class="chart-card">
<p slot="title">耗材消耗趋势</p>
<div class="chart-container" ref="consumptionTrendChart"></div>
</Card>
</i-col>
<i-col span="12">
<Card class="chart-card">
<p slot="title">部门耗材对比</p>
<div class="chart-container" ref="departmentComparisonChart"></div>
</Card>
</i-col>
</Row>
<!-- 近效期耗材列表 -->
<Card class="table-card">
<Button type="primary" size="small" @click="handleExport(row)">导出</Button>
<p slot="title">近效期耗材清单</p>
<Table :columns="expiringColumns" :data="expiringData">
<template :slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="handleExport(row)">导出</Button>
</template>
</Table>
</Card>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'Dashboard',
data() {
return {
// 模拟数据
totalInventory: 2580,
expiringItems: 15,
lowStockItems: 8,
// 近效期耗材表格配置
expiringColumns: [
{ title: '耗材名称', key: 'name' },
{ title: '库存数量', key: 'quantity' },
{ title: '有效期至', key: 'expireDate' },
{ title: '剩余天数', key: 'daysLeft' },
{ title: '操作', slot: 'action' }
],
expiringData: [
{
name: '水性笔',
quantity: 50,
expireDate: '2024-02-15',
daysLeft: 25
}
// 更多数据...
],
// 图表配置
deviceUsageOptions: {
title: { text: '设备使用频率统计' },
tooltip: {},
legend: {
data: ['使用频率']
},
xAxis: {
data: ['打印机A', '打印机B', '复印机', '扫描仪']
},
yAxis: {},
series: [{
name: '使用频率',
type: 'bar',
data: [120, 200, 150, 80]
}]
},
consumptionTrendOptions: {
title: { text: '耗材消耗趋势预测' },
tooltip: {},
legend: {
data: ['实际消耗', '预测消耗'],
selectedMode: true
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月']
},
yAxis: {},
series: [
{
name: '实际消耗',
type: 'line',
data: [120, 132, 101, 134, 90, 230]
},
{
name: '预测消耗',
type: 'line',
data: [220, 182, 191, 234, 290, 330]
}
]
},
departmentComparisonOptions: {
title: { text: '部门耗材使用对比' },
tooltip: {},
legend: {
data: ['使用量'],
selectedMode: true
},
xAxis: {
data: ['办公室', '研发部', '销售部', '人事部']
},
yAxis: {},
series: [{
name: '使用量',
type: 'bar',
data: [150, 230, 180, 120]
}]
}
}
},
mounted() {
this.initCharts()
},
methods: {
initCharts() {
// 初始化设备使用率图表
const deviceUsageChart = echarts.init(this.$refs.deviceUsageChart)
deviceUsageChart.setOption(this.deviceUsageOptions)
// 初始化耗材消耗趋势图表
const consumptionTrendChart = echarts.init(this.$refs.consumptionTrendChart)
consumptionTrendChart.setOption(this.consumptionTrendOptions)
// 初始化部门耗材对比图表
const departmentComparisonChart = echarts.init(this.$refs.departmentComparisonChart)
departmentComparisonChart.setOption(this.departmentComparisonOptions)
// 监听窗口大小变化
window.addEventListener('resize', this.handleResize)
},
handleResize() {
// 重新调整图表大小
const deviceUsageChart = echarts.getInstanceByDom(this.$refs.deviceUsageChart)
const consumptionTrendChart = echarts.getInstanceByDom(this.$refs.consumptionTrendChart)
const departmentComparisonChart = echarts.getInstanceByDom(this.$refs.departmentComparisonChart)
if (deviceUsageChart) deviceUsageChart.resize()
if (consumptionTrendChart) consumptionTrendChart.resize()
if (departmentComparisonChart) departmentComparisonChart.resize()
},
handleExport(row) {
// 导出功能实现
this.$Message.success('导出成功')
}
},
beforeDestroy() {
// 移除窗口大小变化监听
window.removeEventListener('resize', this.handleResize)
}
}
</script>
<style lang="less" scoped>
.dashboard-container {
.stat-cards {
margin-bottom: 20px;
.stat-item {
text-align: center;
padding: 20px;
h3 {
margin-bottom: 10px;
color: #17233d;
}
.count {
font-size: 24px;
font-weight: bold;
margin: 10px 0;
}
&.warning {
color: #ffcc80;
}
&.danger {
color: #ff9999;
}
}
}
.chart-card {
margin-bottom: 20px;
.chart-container {
height: 300px;
}
}
.table-card {
margin-bottom: 20px;
}
}
</style>
<template>
<div class="dashboard-container">
<!-- 顶部统计卡片 -->
<Row :gutter="16" class="stat-cards">
<i-col span="8">
<Card>
<div class="stat-item">
<h3>库存总量</h3>
<div class="count">{{ totalInventory }}</div>
<p>当前库存总数</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item warning">
<h3>近效期耗材</h3>
<div class="count">{{ expiringItems }}</div>
<p>有效期不足30天</p>
</div>
</Card>
</i-col>
<i-col span="8">
<Card>
<div class="stat-item danger">
<h3>低库存预警</h3>
<div class="count">{{ lowStockItems }}</div>
<p>低于安全库存</p>
</div>
</Card>
</i-col>
</Row>
<!-- 设备使用分析 -->
<Card class="chart-card">
<p slot="title">设备使用率分析</p>
<div class="chart-container" ref="deviceUsageChart"></div>
</Card>
<!-- 耗材消耗分析 -->
<Row :gutter="16">
<i-col span="12">
<Card class="chart-card">
<p slot="title">耗材消耗趋势</p>
<div class="chart-container" ref="consumptionTrendChart"></div>
</Card>
</i-col>
<i-col span="12">
<Card class="chart-card">
<p slot="title">部门耗材对比</p>
<div class="chart-container" ref="departmentComparisonChart"></div>
</Card>
</i-col>
</Row>
<!-- 近效期耗材列表 -->
<Card class="table-card">
<span>近效期耗材清单</span>
</Card>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'Dashboard',
data() {
return {
// 模拟数据
totalInventory: 2580,
expiringItems: 15,
lowStockItems: 8,
// 近效期耗材表格配置
expiringColumns: [
{ title: '耗材名称', key: 'name' },
{ title: '库存数量', key: 'quantity' },
{ title: '有效期至', key: 'expireDate' },
{ title: '剩余天数', key: 'daysLeft' },
{ title: '操作', slot: 'action' }
],
expiringData: [
{
name: '水性笔',
quantity: 50,
expireDate: '2024-02-15',
daysLeft: 25
}
// 更多数据...
],
// 图表配置
deviceUsageOptions: {
title: { text: '设备使用频率统计' },
tooltip: {},
legend: {
data: ['使用频率']
},
xAxis: {
data: ['打印机A', '打印机B', '复印机', '扫描仪']
},
yAxis: {},
series: [{
name: '使用频率',
type: 'bar',
data: [120, 200, 150, 80]
}]
},
consumptionTrendOptions: {
title: { text: '耗材消耗趋势预测' },
tooltip: {},
legend: {
data: ['实际消耗', '预测消耗'],
selectedMode: true
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月']
},
yAxis: {},
series: [
{
name: '实际消耗',
type: 'line',
data: [120, 132, 101, 134, 90, 230]
},
{
name: '预测消耗',
type: 'line',
data: [220, 182, 191, 234, 290, 330]
}
]
},
departmentComparisonOptions: {
title: { text: '部门耗材使用对比' },
tooltip: {},
legend: {
data: ['使用量'],
selectedMode: true
},
xAxis: {
data: ['办公室', '研发部', '销售部', '人事部']
},
yAxis: {},
series: [{
name: '使用量',
type: 'bar',
data: [150, 230, 180, 120]
}]
}
}
},
mounted() {
this.initCharts()
},
methods: {
initCharts() {
// 初始化设备使用率图表
const deviceUsageChart = echarts.init(this.$refs.deviceUsageChart)
deviceUsageChart.setOption(this.deviceUsageOptions)
// 初始化耗材消耗趋势图表
const consumptionTrendChart = echarts.init(this.$refs.consumptionTrendChart)
consumptionTrendChart.setOption(this.consumptionTrendOptions)
// 初始化部门耗材对比图表
const departmentComparisonChart = echarts.init(this.$refs.departmentComparisonChart)
departmentComparisonChart.setOption(this.departmentComparisonOptions)
// 监听窗口大小变化
window.addEventListener('resize', this.handleResize)
},
handleResize() {
// 重新调整图表大小
const deviceUsageChart = echarts.getInstanceByDom(this.$refs.deviceUsageChart)
const consumptionTrendChart = echarts.getInstanceByDom(this.$refs.consumptionTrendChart)
const departmentComparisonChart = echarts.getInstanceByDom(this.$refs.departmentComparisonChart)
if (deviceUsageChart) deviceUsageChart.resize()
if (consumptionTrendChart) consumptionTrendChart.resize()
if (departmentComparisonChart) departmentComparisonChart.resize()
},
handleExport(row) {
// 导出功能实现
this.$Message.success('导出成功')
}
},
beforeDestroy() {
// 移除窗口大小变化监听
window.removeEventListener('resize', this.handleResize)
}
}
</script>
<style lang="less" scoped>
.dashboard-container {
.stat-cards {
margin-bottom: 20px;
.stat-item {
text-align: center;
padding: 20px;
h3 {
margin-bottom: 10px;
color: #17233d;
}
.count {
font-size: 24px;
font-weight: bold;
margin: 10px 0;
}
&.warning {
color: #ffcc80;
}
&.danger {
color: #ff9999;
}
}
}
.chart-card {
margin-bottom: 20px;
.chart-container {
height: 300px;
}
}
.table-card {
margin-bottom: 20px;
}
}
</style>
<!doctype html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><link rel="shortcut icon" href="./favicon.ico"><title></title><script type="module" crossorigin src="./js/index-7cb7939c.js"></script><link rel="modulepreload" crossorigin href="./js/vendor-4c4a9438.js"><link rel="stylesheet" href="./css/index-f8faa558.css"></head><body><noscript><strong>请开启 JavaScript 功能来使用 。</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
<!doctype html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><link rel="shortcut icon" href="./favicon.ico"><title></title><script type="module" crossorigin src="./js/index-7d2d32d3.js"></script><link rel="modulepreload" crossorigin href="./js/vendor-6fd91fc2.js"><link rel="stylesheet" href="./css/index-f8faa558.css"></head><body><noscript><strong>请开启 JavaScript 功能来使用 。</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
......@@ -7,11 +7,10 @@
<TabPane label="申请耗材" style="width: 100%;height: 100%;">
<ApplyFor v-if="init.tabsChange == 0"/>
</TabPane>
<TabPane label="申领记录" >
<TabPane label="领用记录">
<TakeOver v-if="init.tabsChange == 1"/>
</TabPane>
</Tabs>
</div>
</div>
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或