大屏项目初始化
This commit is contained in:
296
screen-vue/src/views/screen/Erp/components/ChartV01.vue
Normal file
296
screen-vue/src/views/screen/Erp/components/ChartV01.vue
Normal file
@@ -0,0 +1,296 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">余额结构分析</span>
|
||||
<span class="total-amount">合计:¥{{ formatAmount(totalAmount) }}</span>
|
||||
</div>
|
||||
<div class="pie-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
|
||||
<teleport to="body">
|
||||
<div v-if="modalVisible" class="modal-overlay" @click.self="closeModal">
|
||||
<div class="modal-content">
|
||||
<IndexV01
|
||||
:account-data="selectedAccountData"
|
||||
@close="closeModal"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</teleport>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getErpAccountList } from '@/api/bizApi'
|
||||
import IndexV01 from './detail/indexV01.vue'
|
||||
|
||||
const vList = ref([])
|
||||
const totalAmount = ref(0)
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
const modalVisible = ref(false)
|
||||
const selectedAccountData = ref({})
|
||||
|
||||
const formatAmount = (amount) => {
|
||||
return Number(amount).toFixed(2)
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const res = await getErpAccountList()
|
||||
vList.value = res || []
|
||||
calculateTotalAmount(vList.value)
|
||||
initPieChart()
|
||||
} catch (error) {
|
||||
console.error('获取余额数据失败:', error)
|
||||
vList.value = []
|
||||
totalAmount.value = 0
|
||||
}
|
||||
}
|
||||
|
||||
function calculateTotalAmount(data) {
|
||||
if (!Array.isArray(data)) {
|
||||
totalAmount.value = 0
|
||||
return
|
||||
}
|
||||
totalAmount.value = data.reduce((sum, item) => {
|
||||
const value = Number(item.currentBalance) || 0
|
||||
return sum + value
|
||||
}, 0)
|
||||
}
|
||||
|
||||
const closeModal = () => {
|
||||
modalVisible.value = false
|
||||
selectedAccountData.value = {}
|
||||
}
|
||||
|
||||
const initPieChart = () => {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
}
|
||||
|
||||
chartInstance = echarts.init(el)
|
||||
|
||||
const pieData = vList.value.map(item => ({
|
||||
name: item.accountName || '未知账户',
|
||||
value: (Number(item.currentBalance) || 0) / 10000,
|
||||
originalValue: Number(item.currentBalance) || 0,
|
||||
rawData: item
|
||||
})).filter(item => item.value > 0)
|
||||
|
||||
const colorList = [
|
||||
'#409EFF', '#36CFc9', '#67C23A', '#E6A23C', '#F56C6C',
|
||||
'#909399', '#722ED1', '#EB2F96', '#1890FF', '#52C41A',
|
||||
'#FAAD14', '#F5222D', '#8C8C8C', '#A062D4', '#F7BA1E'
|
||||
]
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70', fontSize: 12 },
|
||||
padding: [10, 15],
|
||||
borderRadius: 6,
|
||||
formatter: function(params) {
|
||||
return `账户:${params.name}<br/>余额:${Number(params.data.originalValue).toFixed(2)}元<br/>占比:${params.percent.toFixed(2)}%`
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
orient: 'horizontal',
|
||||
top: '10%',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 11, color: '#e0e6ff' },
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
itemGap: 10,
|
||||
pageIconColor: '#409EFF',
|
||||
pageTextStyle: { color: '#e0e6ff', fontSize: 10 },
|
||||
pageButtonItemGap: 6,
|
||||
pageButtonGap: 10,
|
||||
type: 'scroll'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '余额',
|
||||
type: 'pie',
|
||||
radius: ['30%', '55%'],
|
||||
center: ['50%', '65%'],
|
||||
avoidLabelOverlap: true,
|
||||
itemStyle: {
|
||||
borderRadius: 4,
|
||||
borderColor: 'rgba(15, 52, 96, 0.9)',
|
||||
borderWidth: 1
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'outside',
|
||||
fontSize: 10,
|
||||
color: '#e0e6ff',
|
||||
formatter: function(params) {
|
||||
return `${params.name} ${Number(params.value).toFixed(2)}万元 (${params.percent.toFixed(2)}%)`
|
||||
},
|
||||
overflow: 'truncate',
|
||||
ellipsis: '...',
|
||||
distance: 8
|
||||
},
|
||||
labelLine: {
|
||||
show: true,
|
||||
length: 12,
|
||||
length2: 8,
|
||||
lineStyle: { color: '#e0e6ff', width: 1 },
|
||||
smooth: 0.2,
|
||||
minTurnAngle: 45
|
||||
},
|
||||
data: pieData,
|
||||
color: colorList
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
chartInstance.setOption(option)
|
||||
|
||||
chartInstance.on('click', (params) => {
|
||||
selectedAccountData.value = {
|
||||
name: params.name,
|
||||
originalValue: params.data.originalValue,
|
||||
value: params.data.value,
|
||||
percent: params.percent,
|
||||
rawData: params.data.rawData
|
||||
}
|
||||
modalVisible.value = true
|
||||
})
|
||||
|
||||
chartInstance.on('legendselectchanged', (params) => {
|
||||
const selectedNames = Object.keys(params.selected).filter(name => params.selected[name])
|
||||
const selectedData = vList.value.filter(item => {
|
||||
const accountName = item.accountName || '未知账户'
|
||||
return selectedNames.includes(accountName)
|
||||
})
|
||||
calculateTotalAmount(selectedData)
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await getList()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.total-amount {
|
||||
font-size: 14px;
|
||||
color: #e0e6ff;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.pie-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
:global(.modal-overlay) {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
:global(.modal-content) {
|
||||
width: 90vw;
|
||||
height: 90vh;
|
||||
max-width: 1400px;
|
||||
max-height: 800px;
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
:deep(.echarts-tooltip) {
|
||||
background-color: rgba(145, 200, 255, 0.9) !important;
|
||||
border-color: #409EFF !important;
|
||||
color: #0a3b70 !important;
|
||||
border-radius: 6px !important;
|
||||
}
|
||||
|
||||
:deep(.echarts-legend-scroll) {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
:deep(.echarts-legend-scroll-text) {
|
||||
color: #e0e6ff !important;
|
||||
font-size: 11px !important;
|
||||
}
|
||||
|
||||
:deep(.echarts-legend-scroll-button) {
|
||||
border-color: #1a508b !important;
|
||||
}
|
||||
|
||||
:deep(.echarts-legend-scroll-button-icon) {
|
||||
color: #409EFF !important;
|
||||
}
|
||||
|
||||
:deep(.ec-label) {
|
||||
z-index: 9999 !important;
|
||||
white-space: nowrap !important;
|
||||
font-size: 10px !important;
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
|
||||
:deep(.ec-label-line) {
|
||||
stroke: #e0e6ff !important;
|
||||
stroke-width: 1px !important;
|
||||
}
|
||||
</style>
|
||||
236
screen-vue/src/views/screen/Erp/components/ChartV02.vue
Normal file
236
screen-vue/src/views/screen/Erp/components/ChartV02.vue
Normal file
@@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">年度收支分析</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
|
||||
const resizeHandler = () => {
|
||||
chartInstance?.resize()
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
itemCode: 'ERP_YEARPMOM_M001',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
function initChart() {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (!chartInstance) {
|
||||
chartInstance = echarts.init(el)
|
||||
}
|
||||
|
||||
const xData = vList.value.map(item => item.xaxis || '')
|
||||
const index01Yuan = vList.value.map(item => item.index01 || 0)
|
||||
const index02Yuan = vList.value.map(item => item.index02 || 0)
|
||||
const index03 = vList.value.map(item => item.index03 || 0)
|
||||
const index04 = vList.value.map(item => item.index04 || 0)
|
||||
|
||||
const index01Wan = index01Yuan.map(val => (val / 10000).toFixed(2))
|
||||
const index02Wan = index02Yuan.map(val => (val / 10000).toFixed(2))
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { type: 'cross' },
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70' },
|
||||
padding: [8, 12],
|
||||
borderRadius: 6,
|
||||
formatter: params => {
|
||||
const idx = params[0].dataIndex
|
||||
return `
|
||||
<div style="text-align:center;font-weight:bold;margin-bottom:6px">${params[0].axisValue}</div>
|
||||
<table style="width:100%;border-collapse:collapse;text-align:center">
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF;padding:4px;font-weight:bold">收入(元)</td>
|
||||
<td style="border:1px solid #409EFF;padding:4px;font-weight:bold">支出(元)</td>
|
||||
<td style="border:1px solid #409EFF;padding:4px;font-weight:bold">利润率(%)</td>
|
||||
<td style="border:1px solid #409EFF;padding:4px;font-weight:bold">占比(%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF;padding:4px">${index01Yuan[idx]}</td>
|
||||
<td style="border:1px solid #409EFF;padding:4px">${index02Yuan[idx]}</td>
|
||||
<td style="border:1px solid #409EFF;padding:4px">${index03[idx]}</td>
|
||||
<td style="border:1px solid #409EFF;padding:4px">${index04[idx]}</td>
|
||||
</tr>
|
||||
</table>`
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
top: '10',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 12, color: '#e0e6ff' },
|
||||
data: ['收入', '支出', '利润率', '占比']
|
||||
},
|
||||
grid: {
|
||||
left: '5%',
|
||||
right: '5%',
|
||||
bottom: '10%',
|
||||
top: '15%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [{
|
||||
type: 'category',
|
||||
data: xData,
|
||||
axisLabel: { fontSize: 11, interval: 0, color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
boundaryGap: true
|
||||
}],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '金额 (万元)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value}', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.3)' } }
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '比率 (%)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value} %', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.2)' } },
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
scale: true
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '收入',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: index01Wan,
|
||||
barWidth: '10%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0,0,0,1,[
|
||||
{ offset:0, color:'#85E868' },
|
||||
{ offset:1, color:'#67C23A' }
|
||||
]),
|
||||
borderRadius: [8,8,0,0]
|
||||
},
|
||||
label: { show:true, position:'top', fontSize:10, color:'#fff', formatter:'{c}' }
|
||||
},
|
||||
{
|
||||
name: '支出',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: index02Wan,
|
||||
barWidth: '10%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0,0,0,1,[
|
||||
{ offset:0, color:'#FF8A8A' },
|
||||
{ offset:1, color:'#F56C6C' }
|
||||
]),
|
||||
borderRadius: [8,8,0,0]
|
||||
},
|
||||
label: { show:true, position:'top', fontSize:10, color:'#fff', formatter:'{c}' }
|
||||
},
|
||||
{
|
||||
name: '利润率',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: index03,
|
||||
smooth: true,
|
||||
lineStyle: { width:1.5, color:'#FCC367' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
label: { show:true, position:'outside', fontSize:10, color:'#FCC367', formatter:'{c}', offset:[0,-5] },
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0,0,0,1,[
|
||||
{ offset:0, color:'rgba(252,195,103,0.3)' },
|
||||
{ offset:1, color:'rgba(252,195,103,0)' }
|
||||
])
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '占比',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: index04,
|
||||
smooth: true,
|
||||
lineStyle: { width:1.5, color:'#409EFF' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
label: { show:true, position:'outside', fontSize:10, color:'#409EFF', formatter:'{c}', offset:[0,-5] },
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0,0,0,1,[
|
||||
{ offset:0, color:'rgba(64,158,255,0.3)' },
|
||||
{ offset:1, color:'rgba(64,158,255,0)' }
|
||||
])
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
chartInstance.setOption(option, true)
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await getList()
|
||||
initChart()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
chartInstance?.dispose()
|
||||
chartInstance = null
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
283
screen-vue/src/views/screen/Erp/components/ChartV03.vue
Normal file
283
screen-vue/src/views/screen/Erp/components/ChartV03.vue
Normal file
@@ -0,0 +1,283 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">账户收支分析</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
...props.formParams,
|
||||
itemCode: 'ERP_ACCOUNT_Y001',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
function initChart() {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (!chartInstance) {
|
||||
chartInstance = echarts.init(el)
|
||||
}
|
||||
|
||||
const baseOption = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { type: 'cross' },
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70' },
|
||||
padding: [8, 12],
|
||||
borderRadius: 6
|
||||
},
|
||||
legend: {
|
||||
top: '10',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 12, color: '#e0e6ff' },
|
||||
data: ['收入', '支出', '净利润']
|
||||
},
|
||||
grid: {
|
||||
left: '5%',
|
||||
right: '5%',
|
||||
bottom: '10%',
|
||||
top: '15%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: [],
|
||||
axisLabel: {
|
||||
fontSize: 11,
|
||||
interval: 0,
|
||||
color: '#b4c7e7'
|
||||
},
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
boundaryGap: true
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '金额 (万元)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value}', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.3)' } }
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '净利润 (万元)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value}', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.2)' } },
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
scale: true
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '收入',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
barWidth: '12%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#85E868' },
|
||||
{ offset: 1, color: '#67C23A' }
|
||||
]),
|
||||
borderRadius: [8, 8, 0, 0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
fontSize: 10,
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '支出',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
barWidth: '12%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#FF8A8A' },
|
||||
{ offset: 1, color: '#F56C6C' }
|
||||
]),
|
||||
borderRadius: [8, 8, 0, 0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
fontSize: 10,
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '净利润',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#409EFF' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
label: {
|
||||
show: true,
|
||||
position: 'outside',
|
||||
fontSize: 10,
|
||||
color: '#409EFF',
|
||||
formatter: '{c}',
|
||||
offset: [0, -5]
|
||||
},
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(64, 158, 255, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(64, 158, 255, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
if (vList.value.length > 0) {
|
||||
const xData = vList.value.map(item => {
|
||||
const xaxis = item.xaxis || ''
|
||||
return xaxis;
|
||||
})
|
||||
const index01Yuan = vList.value.map(item => item.index01 || 0)
|
||||
const index02Yuan = vList.value.map(item => item.index02 || 0)
|
||||
const index03Yuan = vList.value.map(item => item.index03 || 0)
|
||||
|
||||
const index01Wan = index01Yuan.map(val => (val / 10000).toFixed(2))
|
||||
const index02Wan = index02Yuan.map(val => (val / 10000).toFixed(2))
|
||||
const index03Wan = index03Yuan.map(val => (val / 10000).toFixed(2))
|
||||
|
||||
baseOption.tooltip.formatter = function (params) {
|
||||
const title = params[0].axisValue
|
||||
const idx = params[0].dataIndex
|
||||
const incomeVal = index01Yuan[idx]
|
||||
const expenseVal = index02Yuan[idx]
|
||||
const netProfitVal = index03Yuan[idx]
|
||||
return `
|
||||
<div style="text-align:center; font-weight:bold; margin-bottom:6px">${title}</div>
|
||||
<table style="width:100%; border-collapse:collapse; text-align:center">
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">收入(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">支出(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">净利润(元)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${incomeVal}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${expenseVal}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${netProfitVal}</td>
|
||||
</tr>
|
||||
</table>
|
||||
`
|
||||
}
|
||||
|
||||
baseOption.xAxis[0].data = xData
|
||||
baseOption.series[0].data = index01Wan
|
||||
baseOption.series[1].data = index02Wan
|
||||
baseOption.series[2].data = index03Wan
|
||||
}
|
||||
|
||||
chartInstance.setOption(baseOption, true)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
() => {
|
||||
getList()
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
watch(vList, () => {
|
||||
nextTick(() => initChart())
|
||||
}, { deep: true })
|
||||
|
||||
onMounted(() => {
|
||||
initChart()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
224
screen-vue/src/views/screen/Erp/components/ChartV04.vue
Normal file
224
screen-vue/src/views/screen/Erp/components/ChartV04.vue
Normal file
@@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">支出结构分析</span>
|
||||
</div>
|
||||
<div class="pie-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, watch } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
...props.formParams,
|
||||
itemCode: 'ERP_CATEGORY_Y001',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取支出数据失败:', error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
const initPieChart = () => {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
}
|
||||
|
||||
chartInstance = echarts.init(el)
|
||||
|
||||
const pieData = vList.value.map(item => {
|
||||
const originalValue = item.index01 || 0
|
||||
const wanValue = (originalValue / 10000).toFixed(2)
|
||||
return {
|
||||
name: item.xaxis || '未知分类',
|
||||
value: Number(wanValue),
|
||||
originalValue: originalValue
|
||||
}
|
||||
}).filter(item => item.value > 0)
|
||||
|
||||
const colorList = [
|
||||
'#409EFF', '#36CFc9', '#67C23A', '#E6A23C', '#F56C6C',
|
||||
'#909399', '#722ED1', '#EB2F96', '#1890FF', '#52C41A',
|
||||
'#FAAD14', '#F5222D', '#8C8C8C', '#A062D4', '#F7BA1E'
|
||||
]
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70', fontSize: 12 },
|
||||
padding: [10, 15],
|
||||
borderRadius: 6,
|
||||
formatter: function(params) {
|
||||
return `分类:${params.name}<br/>支出:${params.data.originalValue}元<br/>占比:${params.percent.toFixed(1)}%`
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
orient: 'horizontal',
|
||||
top: '10%',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 11, color: '#e0e6ff' },
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
itemGap: 10,
|
||||
pageIconColor: '#409EFF',
|
||||
pageTextStyle: { color: '#e0e6ff', fontSize: 10 },
|
||||
pageButtonItemGap: 6,
|
||||
pageButtonGap: 10,
|
||||
type: 'scroll'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '支出',
|
||||
type: 'pie',
|
||||
radius: ['30%', '55%'],
|
||||
center: ['50%', '65%'],
|
||||
avoidLabelOverlap: true,
|
||||
itemStyle: {
|
||||
borderRadius: 4,
|
||||
borderColor: 'rgba(15, 52, 96, 0.9)',
|
||||
borderWidth: 1
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'outside',
|
||||
fontSize: 10,
|
||||
color: '#e0e6ff',
|
||||
formatter: '{b} {c}万元 ({d}%)',
|
||||
overflow: 'truncate',
|
||||
ellipsis: '...',
|
||||
distance: 8
|
||||
},
|
||||
labelLine: {
|
||||
show: true,
|
||||
length: 12,
|
||||
length2: 8,
|
||||
lineStyle: { color: '#e0e6ff', width: 1 },
|
||||
smooth: 0.2,
|
||||
minTurnAngle: 45
|
||||
},
|
||||
data: pieData,
|
||||
color: colorList
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
chartInstance.setOption(option)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
() => {
|
||||
getList()
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
watch(vList, () => {
|
||||
initPieChart()
|
||||
}, { deep: true })
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.pie-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
:deep(.echarts-tooltip) {
|
||||
background-color: rgba(145, 200, 255, 0.9) !important;
|
||||
border-color: #409EFF !important;
|
||||
color: #0a3b70 !important;
|
||||
border-radius: 6px !important;
|
||||
}
|
||||
|
||||
:deep(.echarts-legend-scroll) {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
:deep(.echarts-legend-scroll-text) {
|
||||
color: #e0e6ff !important;
|
||||
font-size: 11px !important;
|
||||
}
|
||||
:deep(.echarts-legend-scroll-button) {
|
||||
border-color: #1a508b !important;
|
||||
}
|
||||
:deep(.echarts-legend-scroll-button-icon) {
|
||||
color: #409EFF !important;
|
||||
}
|
||||
|
||||
:deep(.ec-label) {
|
||||
z-index: 9999 !important;
|
||||
white-space: nowrap !important;
|
||||
font-size: 10px !important;
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
|
||||
:deep(.ec-label-line) {
|
||||
stroke: #e0e6ff !important;
|
||||
stroke-width: 1px !important;
|
||||
}
|
||||
</style>
|
||||
224
screen-vue/src/views/screen/Erp/components/ChartV05.vue
Normal file
224
screen-vue/src/views/screen/Erp/components/ChartV05.vue
Normal file
@@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">收入来源分析</span>
|
||||
</div>
|
||||
<div class="pie-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, watch } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
...props.formParams,
|
||||
itemCode: 'ERP_CATEGORY_Y002',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取收入数据失败:', error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
const initPieChart = () => {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
}
|
||||
|
||||
chartInstance = echarts.init(el)
|
||||
|
||||
const pieData = vList.value.map(item => {
|
||||
const originalValue = item.index01 || 0
|
||||
const wanValue = (originalValue / 10000).toFixed(2)
|
||||
return {
|
||||
name: item.xaxis || '未知分类',
|
||||
value: Number(wanValue),
|
||||
originalValue: originalValue
|
||||
}
|
||||
}).filter(item => item.value > 0)
|
||||
|
||||
const colorList = [
|
||||
'#409EFF', '#36CFc9', '#67C23A', '#E6A23C', '#F56C6C',
|
||||
'#909399', '#722ED1', '#EB2F96', '#1890FF', '#52C41A',
|
||||
'#FAAD14', '#F5222D', '#8C8C8C', '#A062D4', '#F7BA1E'
|
||||
]
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70', fontSize: 12 },
|
||||
padding: [10, 15],
|
||||
borderRadius: 6,
|
||||
formatter: function(params) {
|
||||
return `分类:${params.name}<br/>收入:${params.data.originalValue}元<br/>占比:${params.percent.toFixed(1)}%`
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
orient: 'horizontal',
|
||||
top: '10%',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 11, color: '#e0e6ff' },
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
itemGap: 10,
|
||||
pageIconColor: '#409EFF',
|
||||
pageTextStyle: { color: '#e0e6ff', fontSize: 10 },
|
||||
pageButtonItemGap: 6,
|
||||
pageButtonGap: 10,
|
||||
type: 'scroll'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '收入',
|
||||
type: 'pie',
|
||||
radius: ['30%', '55%'],
|
||||
center: ['50%', '65%'],
|
||||
avoidLabelOverlap: true,
|
||||
itemStyle: {
|
||||
borderRadius: 4,
|
||||
borderColor: 'rgba(15, 52, 96, 0.9)',
|
||||
borderWidth: 1
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'outside',
|
||||
fontSize: 10,
|
||||
color: '#e0e6ff',
|
||||
formatter: '{b} {c}万元 ({d}%)',
|
||||
overflow: 'truncate',
|
||||
ellipsis: '...',
|
||||
distance: 8
|
||||
},
|
||||
labelLine: {
|
||||
show: true,
|
||||
length: 12,
|
||||
length2: 8,
|
||||
lineStyle: { color: '#e0e6ff', width: 1 },
|
||||
smooth: 0.2,
|
||||
minTurnAngle: 45
|
||||
},
|
||||
data: pieData,
|
||||
color: colorList
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
chartInstance.setOption(option)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
() => {
|
||||
getList()
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
watch(vList, () => {
|
||||
initPieChart()
|
||||
}, { deep: true })
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.pie-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
:deep(.echarts-tooltip) {
|
||||
background-color: rgba(145, 200, 255, 0.9) !important;
|
||||
border-color: #409EFF !important;
|
||||
color: #0a3b70 !important;
|
||||
border-radius: 6px !important;
|
||||
}
|
||||
|
||||
:deep(.echarts-legend-scroll) {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
:deep(.echarts-legend-scroll-text) {
|
||||
color: #e0e6ff !important;
|
||||
font-size: 11px !important;
|
||||
}
|
||||
:deep(.echarts-legend-scroll-button) {
|
||||
border-color: #1a508b !important;
|
||||
}
|
||||
:deep(.echarts-legend-scroll-button-icon) {
|
||||
color: #409EFF !important;
|
||||
}
|
||||
|
||||
:deep(.ec-label) {
|
||||
z-index: 9999 !important;
|
||||
white-space: nowrap !important;
|
||||
font-size: 10px !important;
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
|
||||
:deep(.ec-label-line) {
|
||||
stroke: #e0e6ff !important;
|
||||
stroke-width: 1px !important;
|
||||
}
|
||||
</style>
|
||||
314
screen-vue/src/views/screen/Erp/components/ChartV06.vue
Normal file
314
screen-vue/src/views/screen/Erp/components/ChartV06.vue
Normal file
@@ -0,0 +1,314 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">月度收支分析</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
});
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
...props.formParams,
|
||||
itemCode: 'ERP_YEARPSAV_M001',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
function initChart() {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (!chartInstance) {
|
||||
chartInstance = echarts.init(el)
|
||||
}
|
||||
|
||||
const baseOption = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { type: 'cross' },
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70' },
|
||||
padding: [8, 12],
|
||||
borderRadius: 6
|
||||
},
|
||||
legend: {
|
||||
top: '10',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 12, color: '#e0e6ff' },
|
||||
data: ['收入', '支出', '利润率', '净利润']
|
||||
},
|
||||
grid: {
|
||||
left: '5%',
|
||||
right: '5%',
|
||||
bottom: '10%',
|
||||
top: '15%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: [],
|
||||
axisLabel: {
|
||||
fontSize: 11,
|
||||
interval: 0,
|
||||
color: '#b4c7e7'
|
||||
},
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
boundaryGap: true
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '金额 (万元)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value}', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.3)' } }
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '利润率 (%)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value} %', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.2)' } },
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
scale: true
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '收入',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
barWidth: '12%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#85E868' },
|
||||
{ offset: 1, color: '#67C23A' }
|
||||
]),
|
||||
borderRadius: [8, 8, 0, 0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
fontSize: 10,
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '支出',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
barWidth: '12%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#FF8A8A' },
|
||||
{ offset: 1, color: '#F56C6C' }
|
||||
]),
|
||||
borderRadius: [8, 8, 0, 0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
fontSize: 10,
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '利润率',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#409EFF' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
label: {
|
||||
show: true,
|
||||
position: 'outside',
|
||||
fontSize: 10,
|
||||
color: '#409EFF',
|
||||
formatter: '{c}',
|
||||
offset: [0, -5]
|
||||
},
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(64, 158, 255, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(64, 158, 255, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '净利润',
|
||||
type: 'line',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#FF9D28' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
label: {
|
||||
show: true,
|
||||
fontSize: 10,
|
||||
color: '#FF9D28',
|
||||
formatter: '{c}'
|
||||
},
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(255, 157, 40, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(255, 157, 40, 0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
if (vList.value.length > 0) {
|
||||
const xData = vList.value.map(item => {
|
||||
const xaxis = item.xaxis || ''
|
||||
return xaxis.includes('月') ? xaxis : `${xaxis}月`;
|
||||
})
|
||||
const index01Yuan = vList.value.map(item => item.index01 || 0)
|
||||
const index02Yuan = vList.value.map(item => item.index02 || 0)
|
||||
const index03 = vList.value.map(item => item.index03 || 0)
|
||||
const index04Yuan = vList.value.map(item => item.index04 || 0)
|
||||
|
||||
const index01Wan = index01Yuan.map(val => (val / 10000).toFixed(2))
|
||||
const index02Wan = index02Yuan.map(val => (val / 10000).toFixed(2))
|
||||
const index04Wan = index04Yuan.map(val => (val / 10000).toFixed(2))
|
||||
|
||||
baseOption.tooltip.formatter = function (params) {
|
||||
const title = params[0].axisValue
|
||||
const idx = params[0].dataIndex
|
||||
const incomeVal = index01Yuan[idx]
|
||||
const expenseVal = index02Yuan[idx]
|
||||
const rateVal = index03[idx]
|
||||
const profitVal = index04Yuan[idx]
|
||||
return `
|
||||
<div style="text-align:center; font-weight:bold; margin-bottom:6px">${title}</div>
|
||||
<table style="width:100%; border-collapse:collapse; text-align:center">
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">收入(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">支出(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">利润率(%)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">净利润(元)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${incomeVal}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${expenseVal}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${rateVal}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${profitVal}</td>
|
||||
</tr>
|
||||
</table>
|
||||
`
|
||||
}
|
||||
|
||||
baseOption.xAxis[0].data = xData
|
||||
baseOption.series[0].data = index01Wan
|
||||
baseOption.series[1].data = index02Wan
|
||||
baseOption.series[2].data = index03
|
||||
baseOption.series[3].data = index04Wan
|
||||
}
|
||||
|
||||
chartInstance.setOption(baseOption, true)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
() => {
|
||||
getList()
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
watch(vList, () => {
|
||||
nextTick(() => initChart())
|
||||
}, { deep: true })
|
||||
|
||||
onMounted(() => {
|
||||
initChart()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
204
screen-vue/src/views/screen/Erp/components/ChartV07.vue
Normal file
204
screen-vue/src/views/screen/Erp/components/ChartV07.vue
Normal file
@@ -0,0 +1,204 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">支出排名分析</span>
|
||||
</div>
|
||||
<div class="rank-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, watch } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
...props.formParams,
|
||||
itemCode: 'ERP_YEARRANK_Y001',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
const initRankChart = () => {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
}
|
||||
|
||||
chartInstance = echarts.init(el)
|
||||
|
||||
const sortedList = [...vList.value]
|
||||
.sort((a, b) => Number(b.index01 || 0) - Number(a.index01 || 0))
|
||||
.slice(0, 10)
|
||||
|
||||
const yData = sortedList.map((item, index) => `${index + 1}. ${item.xaxis || '未知'}`)
|
||||
const valueData = sortedList.map(item => Number((Number(item.index01 || 0) / 10000).toFixed(2)) || 0)
|
||||
const percentData = sortedList.map(item => Number(Number(item.index02 || 0).toFixed(2)) || 0)
|
||||
const originalData = sortedList.map(item => Number(item.index01 || 0))
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { type: 'shadow' },
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70' },
|
||||
padding: [8, 12],
|
||||
borderRadius: 6,
|
||||
formatter: params => {
|
||||
const idx = params[0].dataIndex
|
||||
const name = params[0].name
|
||||
const amount = originalData[idx]
|
||||
const rate = percentData[idx]
|
||||
return `
|
||||
<div style="text-align:center; font-weight:bold; margin-bottom:6px">${name}</div>
|
||||
<table style="width:100%; border-collapse:collapse; text-align:center">
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">支出(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">占比(%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${amount}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${rate}</td>
|
||||
</tr>
|
||||
</table>
|
||||
`
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
grid: {
|
||||
left: '5%',
|
||||
right: '15%',
|
||||
bottom: '10%',
|
||||
top: '15%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
axisLabel: { fontSize: 11, color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.3)' } }
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: yData,
|
||||
axisLabel: { fontSize: 11, color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
inverse: true
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '支出',
|
||||
type: 'bar',
|
||||
barWidth: '12%',
|
||||
data: valueData,
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
|
||||
{ offset: 0, color: '#409EFF' },
|
||||
{ offset: 0, color: '#409EFF' },
|
||||
{ offset: 1, color: '#1890FF' }
|
||||
])
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'right',
|
||||
fontSize: 10,
|
||||
color: '#e0e6ff',
|
||||
formatter: params => `${params.value} 万元 (${percentData[params.dataIndex]}%)`
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
chartInstance.setOption(option)
|
||||
}
|
||||
|
||||
watch(() => props.formParams, () => {
|
||||
getList()
|
||||
}, { deep: true, immediate: true })
|
||||
|
||||
watch(vList, () => {
|
||||
initRankChart()
|
||||
}, { deep: true })
|
||||
|
||||
onMounted(() => {
|
||||
initRankChart()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.rank-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
|
||||
:deep(.echarts-tooltip) {
|
||||
background-color: rgba(145, 200, 255, 0.9) !important;
|
||||
border-color: #409EFF !important;
|
||||
color: #0a3b70 !important;
|
||||
border-radius: 6px !important;
|
||||
}
|
||||
</style>
|
||||
282
screen-vue/src/views/screen/Erp/components/ChartV08.vue
Normal file
282
screen-vue/src/views/screen/Erp/components/ChartV08.vue
Normal file
@@ -0,0 +1,282 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">季度收支分析</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
});
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
...props.formParams,
|
||||
itemCode: 'ERP_YEARQUAR_Y001',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
function initChart() {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (!chartInstance) {
|
||||
chartInstance = echarts.init(el)
|
||||
}
|
||||
|
||||
const baseOption = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { type: 'cross' },
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70' },
|
||||
padding: [8, 12],
|
||||
borderRadius: 6
|
||||
},
|
||||
legend: {
|
||||
top: '10',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 12, color: '#e0e6ff' },
|
||||
data: ['收入', '支出', '占比']
|
||||
},
|
||||
grid: {
|
||||
left: '5%',
|
||||
right: '5%',
|
||||
bottom: '10%',
|
||||
top: '15%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: [],
|
||||
axisLabel: {
|
||||
fontSize: 11,
|
||||
interval: 0,
|
||||
color: '#b4c7e7'
|
||||
},
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
boundaryGap: true
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '金额 (万元)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value}', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.3)' } }
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '占比 (%)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value} %', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.2)' } },
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
scale: true
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '收入',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
barWidth: '12%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#85E868' },
|
||||
{ offset: 1, color: '#67C23A' }
|
||||
]),
|
||||
borderRadius: [8, 8, 0, 0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
fontSize: 10,
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '支出',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
barWidth: '12%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#FF8A8A' },
|
||||
{ offset: 1, color: '#F56C6C' }
|
||||
]),
|
||||
borderRadius: [8, 8, 0, 0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
fontSize: 10,
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '占比',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#409EFF' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
label: {
|
||||
show: true,
|
||||
position: 'outside',
|
||||
fontSize: 10,
|
||||
color: '#409EFF',
|
||||
formatter: '{c}',
|
||||
offset: [0, -5]
|
||||
},
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(64, 158, 255, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(64, 158, 255, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
if (vList.value.length > 0) {
|
||||
const xData = vList.value.map(item => {
|
||||
const xaxis = item.xaxis || ''
|
||||
return xaxis;
|
||||
})
|
||||
const index01Yuan = vList.value.map(item => item.index01 || 0)
|
||||
const index02Yuan = vList.value.map(item => item.index02 || 0)
|
||||
const index03 = vList.value.map(item => item.index03 || 0)
|
||||
|
||||
const index01Wan = index01Yuan.map(val => (val / 10000).toFixed(2))
|
||||
const index02Wan = index02Yuan.map(val => (val / 10000).toFixed(2))
|
||||
|
||||
baseOption.tooltip.formatter = function (params) {
|
||||
const title = params[0].axisValue
|
||||
const idx = params[0].dataIndex
|
||||
const incomeVal = index01Yuan[idx]
|
||||
const expenseVal = index02Yuan[idx]
|
||||
const rateVal = index03[idx]
|
||||
return `
|
||||
<div style="text-align:center; font-weight:bold; margin-bottom:6px">${title}</div>
|
||||
<table style="width:100%; border-collapse:collapse; text-align:center">
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">收入(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">支出(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">占比(%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${incomeVal}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${expenseVal}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${rateVal}</td>
|
||||
</tr>
|
||||
</table>
|
||||
`
|
||||
}
|
||||
|
||||
baseOption.xAxis[0].data = xData
|
||||
baseOption.series[0].data = index01Wan
|
||||
baseOption.series[1].data = index02Wan
|
||||
baseOption.series[2].data = index03
|
||||
}
|
||||
|
||||
chartInstance.setOption(baseOption, true)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
() => {
|
||||
getList()
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
watch(vList, () => {
|
||||
nextTick(() => initChart())
|
||||
}, { deep: true })
|
||||
|
||||
onMounted(() => {
|
||||
initChart()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
412
screen-vue/src/views/screen/Erp/components/ChartV09.vue
Normal file
412
screen-vue/src/views/screen/Erp/components/ChartV09.vue
Normal file
@@ -0,0 +1,412 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">环比收支分析</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
});
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
...props.formParams,
|
||||
itemCode: 'ERP_YEARDATA_M001',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
function initChart() {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
}
|
||||
chartInstance = echarts.init(el)
|
||||
|
||||
const baseOption = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { type: 'cross' },
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70' },
|
||||
padding: [8, 12],
|
||||
borderRadius: 6
|
||||
},
|
||||
legend: {
|
||||
top: '10',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 12, color: '#e0e6ff' },
|
||||
data: ['收入', '支出', '占比', '上月收入', '上月支出', '收入环比', '支出环比', '本月净利润']
|
||||
},
|
||||
grid: {
|
||||
left: '5%',
|
||||
right: '5%',
|
||||
bottom: '10%',
|
||||
top: '15%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: [],
|
||||
axisLabel: {
|
||||
fontSize: 11,
|
||||
interval: 0,
|
||||
color: '#b4c7e7'
|
||||
},
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
boundaryGap: true
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '金额 (万元)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value}', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.3)' } }
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '占比/环比 (%)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value} %', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.2)' } },
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
scale: true
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '收入',
|
||||
type: 'line',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#67C23A' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(103, 194, 58, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(103, 194, 58, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '支出',
|
||||
type: 'line',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#F56C6C' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(245, 108, 108, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(245, 108, 108, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '占比',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#409EFF' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(64, 158, 255, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(64, 158, 255, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '上月收入',
|
||||
type: 'line',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#36CFc9' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(54, 207, 201, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(54, 207, 201, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '上月支出',
|
||||
type: 'line',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#E6A23C' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(230, 162, 60, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(230, 162, 60, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '收入环比',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#722ED1' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(114, 46, 209, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(114, 46, 209, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '支出环比',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#EB2F96' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(235, 47, 150, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(235, 47, 150, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '本月净利润',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
barWidth: '12%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#FF9D28' },
|
||||
{ offset: 1, color: '#FAAD14' }
|
||||
]),
|
||||
borderRadius: [8, 8, 0, 0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
fontSize: 10,
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
if (vList.value.length > 0) {
|
||||
const xData = vList.value.map(item => {
|
||||
const xaxis = item.xaxis || ''
|
||||
return xaxis.includes('月') ? xaxis : `${xaxis}月`;
|
||||
})
|
||||
const incomeYuan = vList.value.map(item => Number(item.index01 || 0))
|
||||
const expenseYuan = vList.value.map(item => Number(item.index02 || 0))
|
||||
const rate = vList.value.map(item => Number(item.index03 || 0).toFixed(2))
|
||||
const lastMonthIncomeYuan = vList.value.map(item => Number(item.index04 || 0))
|
||||
const lastMonthExpenseYuan = vList.value.map(item => Number(item.index05 || 0))
|
||||
const netProfitYuan = vList.value.map(item => (Number(item.index01 || 0) - Number(item.index02 || 0)).toFixed(2))
|
||||
|
||||
const incomeRingRatio = vList.value.map((item, idx) => {
|
||||
const lastVal = lastMonthIncomeYuan[idx]
|
||||
const currVal = incomeYuan[idx] || 0
|
||||
return lastVal === 0 ? '0.00' : ((currVal - lastVal) / lastVal * 100).toFixed(2)
|
||||
})
|
||||
const expenseRingRatio = vList.value.map((item, idx) => {
|
||||
const lastVal = lastMonthExpenseYuan[idx]
|
||||
const currVal = expenseYuan[idx] || 0
|
||||
return lastVal === 0 ? '0.00' : ((currVal - lastVal) / lastVal * 100).toFixed(2)
|
||||
})
|
||||
|
||||
const incomeWan = incomeYuan.map(val => (val / 10000).toFixed(2))
|
||||
const expenseWan = expenseYuan.map(val => (val / 10000).toFixed(2))
|
||||
const lastMonthIncomeWan = lastMonthIncomeYuan.map(val => (val / 10000).toFixed(2))
|
||||
const lastMonthExpenseWan = lastMonthExpenseYuan.map(val => (val / 10000).toFixed(2))
|
||||
const netProfitWan = netProfitYuan.map(val => (val / 10000).toFixed(2))
|
||||
|
||||
baseOption.tooltip.formatter = function (params) {
|
||||
const title = params[0].axisValue
|
||||
const idx = params[0].dataIndex
|
||||
return `
|
||||
<div style="text-align:center; font-weight:bold; margin-bottom:6px">${title}</div>
|
||||
<table style="width:100%; border-collapse:collapse; text-align:center">
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">本月收入(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">本月支出(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">上月收入(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">上月支出(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">收入环比(%)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">支出环比(%)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">占比(%)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">净利润(元)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${incomeYuan[idx]}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${expenseYuan[idx]}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${lastMonthIncomeYuan[idx]}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${lastMonthExpenseYuan[idx]}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${incomeRingRatio[idx]}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${expenseRingRatio[idx]}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${rate[idx]}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${netProfitYuan[idx]}</td>
|
||||
</tr>
|
||||
</table>
|
||||
`
|
||||
}
|
||||
|
||||
baseOption.xAxis[0].data = xData
|
||||
baseOption.series[0].data = incomeWan
|
||||
baseOption.series[1].data = expenseWan
|
||||
baseOption.series[2].data = rate
|
||||
baseOption.series[3].data = lastMonthIncomeWan
|
||||
baseOption.series[4].data = lastMonthExpenseWan
|
||||
baseOption.series[5].data = incomeRingRatio
|
||||
baseOption.series[6].data = expenseRingRatio
|
||||
baseOption.series[7].data = netProfitWan
|
||||
}
|
||||
|
||||
chartInstance.setOption(baseOption, true)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
() => {
|
||||
getList()
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
watch(vList, () => {
|
||||
nextTick(() => initChart())
|
||||
}, { deep: true })
|
||||
|
||||
onMounted(() => {
|
||||
initChart()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
|
||||
:deep(.echarts-tooltip) {
|
||||
background-color: rgba(145, 200, 255, 0.9) !important;
|
||||
border-color: #409EFF !important;
|
||||
color: #0a3b70 !important;
|
||||
border-radius: 6px !important;
|
||||
white-space: nowrap !important;
|
||||
max-width: none !important;
|
||||
}
|
||||
</style>
|
||||
508
screen-vue/src/views/screen/Erp/components/detail/indexV01.vue
Normal file
508
screen-vue/src/views/screen/Erp/components/detail/indexV01.vue
Normal file
@@ -0,0 +1,508 @@
|
||||
<template>
|
||||
<div class="detail-container">
|
||||
<div class="detail-header">
|
||||
<h3>{{ accountData.name }}详情</h3>
|
||||
<button class="close-btn" @click="handleClose">×</button>
|
||||
</div>
|
||||
<div class="split-line"></div>
|
||||
<div class="detail-body">
|
||||
<el-form :model="searchForm" class="search-form">
|
||||
<div class="form-items-wrapper">
|
||||
<el-form-item label="交易名称:" class="form-item">
|
||||
<el-input
|
||||
v-model="searchForm.flowName"
|
||||
placeholder="请输入交易名称"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="交易类型:" class="form-item">
|
||||
<el-select
|
||||
v-model="searchForm.transactionType"
|
||||
placeholder="请选择交易类型"
|
||||
clearable
|
||||
class="custom-select"
|
||||
teleport="body"
|
||||
popper-class="theme-select-popper"
|
||||
:popper-append-to-body="true"
|
||||
@change="getTranTypes"
|
||||
>
|
||||
<el-option label="收入" value="2" />
|
||||
<el-option label="支出" value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="交易分类:" class="form-item">
|
||||
<el-select
|
||||
v-model="searchForm.categoryId"
|
||||
placeholder="请选择交易分类"
|
||||
clearable
|
||||
class="custom-select"
|
||||
teleport="body"
|
||||
popper-class="theme-select-popper"
|
||||
:popper-append-to-body="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in tranTypes"
|
||||
:key="item.categoryId"
|
||||
:label="item.categoryName"
|
||||
:value="item.categoryId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item class="form-btn-group">
|
||||
<el-button type="primary" @click="handleSearch">查询</el-button>
|
||||
<el-button type="default" @click="handleReset" class="reset-btn">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
:data="tableData"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
empty-text="暂无相关交易数据"
|
||||
class="data-table"
|
||||
v-loading="loading"
|
||||
:header-cell-style="{
|
||||
background: 'rgba(10, 30, 60, 0.8)',
|
||||
color: '#a0cfff',
|
||||
border: 'none',
|
||||
borderBottom: '1px solid rgba(64, 158, 255, 0.3)'
|
||||
}"
|
||||
:row-style="{
|
||||
background: 'transparent',
|
||||
color: '#a0cfff',
|
||||
border: 'none'
|
||||
}"
|
||||
:cell-style="{
|
||||
border: 'none',
|
||||
borderBottom: '1px solid rgba(64, 158, 255, 0.2)'
|
||||
}"
|
||||
>
|
||||
<el-table-column prop="flowId" label="交易编号" />
|
||||
<el-table-column prop="flowName" label="交易名称" />
|
||||
<el-table-column prop="categoryName" label="交易分类" />
|
||||
<el-table-column prop="tranType" label="交易类型" />
|
||||
<el-table-column prop="amount" label="交易金额">
|
||||
<template #default="scope">
|
||||
¥{{ scope.row.amount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="交易备注" />
|
||||
<el-table-column prop="transactionTime" label="交易时间" />
|
||||
</el-table>
|
||||
|
||||
<div class="pagination-wrapper">
|
||||
<el-pagination
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[20,50,99]"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
class="custom-pagination"
|
||||
teleport="body"
|
||||
popper-class="theme-pagination-popper"
|
||||
:popper-append-to-body="true"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { defineProps, defineEmits, ref, onMounted, reactive } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getErpCategoryList, getErpTransactionFlowList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
accountData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['close'])
|
||||
const handleClose = () => emit('close')
|
||||
|
||||
const tranTypes = ref();
|
||||
const loading = ref(false);
|
||||
|
||||
const searchForm = reactive({
|
||||
flowName: '',
|
||||
transactionType: '',
|
||||
categoryId: '',
|
||||
})
|
||||
|
||||
const tableData = ref([]);
|
||||
const currentPage = ref(1);
|
||||
const pageSize = ref(20);
|
||||
const total = ref(0);
|
||||
|
||||
const handleSearch = () => {
|
||||
getList();
|
||||
}
|
||||
|
||||
const handleReset = () => {
|
||||
Object.assign(searchForm, {
|
||||
flowName: '',
|
||||
transactionType: '',
|
||||
categoryId: '',
|
||||
})
|
||||
currentPage.value = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
const handleSizeChange = (val) => {
|
||||
pageSize.value = val;
|
||||
getList();
|
||||
}
|
||||
const handleCurrentChange = (val) => {
|
||||
currentPage.value = val;
|
||||
getList();
|
||||
}
|
||||
|
||||
async function getTranTypes(){
|
||||
try {
|
||||
const params = {
|
||||
categoryType: searchForm.transactionType,
|
||||
}
|
||||
const res = await getErpCategoryList(params);
|
||||
tranTypes.value = res || [];
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error);
|
||||
tranTypes.value = [];
|
||||
}
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const reqParmas = {
|
||||
... searchForm,
|
||||
pageNum: currentPage.value, // 当前页
|
||||
pageSize: pageSize.value, // 每页条数
|
||||
accountId: props.accountData.rawData?.accountId || '',
|
||||
}
|
||||
const res = await getErpTransactionFlowList(reqParmas);
|
||||
total.value = res.total;
|
||||
tableData.value = res.list || [];
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error);
|
||||
tableData.value = [];
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await getList();
|
||||
await getTranTypes();
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.detail-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 12px;
|
||||
color: #e0e6ff;
|
||||
background: url('@/assets/images/border.png') no-repeat center center;
|
||||
background-size: 100% 100%;
|
||||
background-color: transparent !important;
|
||||
border: none !important;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
z-index: 10001;
|
||||
}
|
||||
|
||||
.detail-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.detail-header h3 {
|
||||
margin: 0;
|
||||
color: #409EFF;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
|
||||
font-size: 18px;
|
||||
}
|
||||
.close-btn {
|
||||
background: transparent;
|
||||
border: none;
|
||||
font-size: 24px;
|
||||
color: #e0e6ff;
|
||||
cursor: pointer;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: color 0.2s;
|
||||
z-index: 10002;
|
||||
}
|
||||
.close-btn:hover {
|
||||
color: #409EFF;
|
||||
}
|
||||
|
||||
.split-line {
|
||||
height: 1px;
|
||||
background-color: #409EFF;
|
||||
opacity: 0.6;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.detail-body {
|
||||
width: 100%;
|
||||
height: calc(100% - 80px);
|
||||
border: 1px solid #409EFF;
|
||||
border-radius: 6px;
|
||||
padding: 16px;
|
||||
background-color: rgba(10, 30, 60, 0.2);
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
overflow: visible;
|
||||
position: relative;
|
||||
z-index: 10001;
|
||||
}
|
||||
|
||||
.search-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding-bottom: 16px;
|
||||
border-bottom: 1px solid rgba(64, 158, 255, 0.3);
|
||||
flex-wrap: wrap;
|
||||
position: relative;
|
||||
z-index: 10001;
|
||||
}
|
||||
.form-items-wrapper {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
gap: 20px;
|
||||
min-width: 0;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.form-item {
|
||||
flex: 1;
|
||||
margin-bottom: 0 !important;
|
||||
min-width: 180px;
|
||||
}
|
||||
.date-range-item {
|
||||
min-width: 280px !important;
|
||||
}
|
||||
.form-btn-group {
|
||||
margin-left: 20px;
|
||||
margin-bottom: 0 !important;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.data-table {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
z-index: 10001;
|
||||
}
|
||||
|
||||
.pagination-wrapper {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid rgba(64, 158, 255, 0.2);
|
||||
background-color: rgba(10, 30, 60, 0.2);
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
z-index: 10001;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__label) {
|
||||
color: #e0e6ff !important;
|
||||
font-size: 14px;
|
||||
}
|
||||
:deep(.el-input__wrapper),
|
||||
:deep(.el-select__wrapper),
|
||||
:deep(.el-date-editor__wrapper) {
|
||||
background-color: rgba(0, 0, 0, 0.2) !important;
|
||||
border: 1px solid #409EFF !important;
|
||||
box-shadow: none !important;
|
||||
width: 100% !important;
|
||||
position: relative;
|
||||
z-index: 10001;
|
||||
}
|
||||
:deep(.el-input__inner),
|
||||
:deep(.el-select__inner),
|
||||
:deep(.el-date-editor input) {
|
||||
color: #e0e6ff !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
:deep(.el-input__placeholder),
|
||||
:deep(.el-date-editor__placeholder) {
|
||||
color: rgba(224, 230, 255, 0.6) !important;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination) {
|
||||
--el-pagination-text-color: #e0e6ff;
|
||||
--el-pagination-button-color: #e0e6ff;
|
||||
--el-pagination-button-hover-color: #409EFF;
|
||||
--el-pagination-button-active-color: #409EFF;
|
||||
--el-pagination-border-color: #409EFF;
|
||||
--el-pagination-bg-color: rgba(10, 30, 60, 0.2) !important;
|
||||
z-index: 10001;
|
||||
}
|
||||
:deep(.el-pagination button) {
|
||||
background-color: rgba(0, 0, 0, 0.2) !important;
|
||||
border-color: #409EFF !important;
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
:deep(.el-pagination .el-pager li) {
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
:deep(.el-pagination .el-pager li.active) {
|
||||
color: #409EFF !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
:deep(.el-table) {
|
||||
--el-table-text-color: #a0cfff;
|
||||
--el-table-header-text-color: #a0cfff;
|
||||
--el-table-row-hover-bg-color: rgba(64, 158, 255, 0.2);
|
||||
--el-table-border-color: transparent !important;
|
||||
--el-table-stripe-row-bg-color: rgba(10, 30, 60, 0.3);
|
||||
background-color: transparent !important;
|
||||
border: none !important;
|
||||
z-index: 10001;
|
||||
}
|
||||
:deep(.el-table th) {
|
||||
border: none !important;
|
||||
border-bottom: 1px solid rgba(64, 158, 255, 0.3) !important;
|
||||
background-color: rgba(10, 30, 60, 0.8) !important;
|
||||
color: #a0cfff !important;
|
||||
}
|
||||
:deep(.el-table td) {
|
||||
border: none !important;
|
||||
border-bottom: 1px solid rgba(64, 158, 255, 0.2) !important;
|
||||
background-color: transparent !important;
|
||||
color: #a0cfff !important;
|
||||
}
|
||||
:deep(.el-table--striped .el-table__row--striped td) {
|
||||
background-color: rgba(10, 30, 60, 0.3) !important;
|
||||
border-bottom-color: rgba(64, 158, 255, 0.2) !important;
|
||||
}
|
||||
:deep(.el-table__row:hover > td) {
|
||||
background-color: rgba(64, 158, 255, 0.2) !important;
|
||||
border-bottom-color: rgba(64, 158, 255, 0.3) !important;
|
||||
}
|
||||
:deep(.el-table tr:last-child td) {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
:deep(.el-table-empty-text) {
|
||||
color: #a0cfff !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
:deep(.el-button) {
|
||||
--el-button-text-color: #e0e6ff !important;
|
||||
--el-button-border-color: #409EFF !important;
|
||||
--el-button-hover-text-color: #fff !important;
|
||||
--el-button-hover-border-color: #409EFF !important;
|
||||
--el-button-hover-bg-color: rgba(64, 158, 255, 0.2) !important;
|
||||
height: 32px;
|
||||
padding: 0 16px;
|
||||
z-index: 10001;
|
||||
}
|
||||
:deep(.el-button--primary) {
|
||||
--el-button-text-color: #fff !important;
|
||||
--el-button-bg-color: rgba(64, 158, 255, 0.8) !important;
|
||||
--el-button-border-color: #409EFF !important;
|
||||
--el-button-hover-bg-color: #409EFF !important;
|
||||
}
|
||||
:deep(.reset-btn) {
|
||||
background-color: rgba(0, 0, 0, 0.2) !important;
|
||||
border-color: #409EFF !important;
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
:deep(.reset-btn:hover) {
|
||||
background-color: rgba(64, 158, 255, 0.2) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
:deep(.el-loading-mask) {
|
||||
background-color: rgba(10, 30, 60, 0.8) !important;
|
||||
z-index: 10002;
|
||||
}
|
||||
:deep(.el-table__loading-wrapper) {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
:deep(.el-loading-spinner .path) {
|
||||
stroke: #409EFF !important;
|
||||
}
|
||||
:deep(.el-loading-text) {
|
||||
color: #a0cfff !important;
|
||||
}
|
||||
|
||||
.detail-body::-webkit-scrollbar,
|
||||
:deep(.el-table__body-wrapper)::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
.detail-body::-webkit-scrollbar-track {
|
||||
background: rgba(10, 30, 60, 0.1);
|
||||
border-radius: 3px;
|
||||
}
|
||||
.detail-body::-webkit-scrollbar-thumb {
|
||||
background: rgba(64, 158, 255, 0.5);
|
||||
border-radius: 3px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
|
||||
.theme-select-popper {
|
||||
background-color: rgba(10, 30, 60, 0.95) !important;
|
||||
border: 1px solid #409EFF !important;
|
||||
color: #e0e6ff !important;
|
||||
z-index: 99999 !important;
|
||||
pointer-events: auto !important;
|
||||
position: fixed !important;
|
||||
}
|
||||
.theme-select-popper .el-select-dropdown__item {
|
||||
color: #e0e6ff !important;
|
||||
background-color: transparent !important;
|
||||
padding: 6px 12px !important;
|
||||
}
|
||||
.theme-select-popper .el-select-dropdown__item:hover {
|
||||
background-color: rgba(64, 158, 255, 0.2) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
.theme-select-popper .el-select-dropdown__item.selected {
|
||||
background-color: rgba(64, 158, 255, 0.5) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.theme-pagination-popper {
|
||||
background-color: rgba(10, 30, 60, 0.95) !important;
|
||||
border: 1px solid #409EFF !important;
|
||||
color: #e0e6ff !important;
|
||||
z-index: 99999 !important;
|
||||
pointer-events: auto !important;
|
||||
position: fixed !important;
|
||||
}
|
||||
.theme-pagination-popper .el-pagination__sizes-option {
|
||||
color: #e0e6ff !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
.theme-pagination-popper .el-pagination__sizes-option:hover {
|
||||
background-color: rgba(64, 158, 255, 0.2) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.modal-overlay {
|
||||
pointer-events: auto !important;
|
||||
}
|
||||
.modal-overlay .modal-content {
|
||||
pointer-events: auto !important;
|
||||
}
|
||||
</style>
|
||||
278
screen-vue/src/views/screen/Erp/index.vue
Normal file
278
screen-vue/src/views/screen/Erp/index.vue
Normal file
@@ -0,0 +1,278 @@
|
||||
<template>
|
||||
<div class="erp-layout-container">
|
||||
<div class="erp-section erp-top-header">
|
||||
<div class="erp-card full-card">
|
||||
<h3>ERP页面顶部区域 (10%)</h3>
|
||||
<p>可放置筛选、标题、概览数据等</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="erp-section erp-upper-section">
|
||||
<div class="erp-col erp-col-1-3">
|
||||
<div class="erp-card">
|
||||
<ChartV01 :formParams="props.formParams" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="erp-col erp-col-1-3">
|
||||
<div class="erp-card">
|
||||
<ChartV02 :formParams="props.formParams" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="erp-col erp-col-1-3">
|
||||
<div class="erp-card">
|
||||
<ChartV03 :formParams="props.formParams" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="erp-section erp-middle-section">
|
||||
<div class="erp-col erp-col-1-2">
|
||||
<div class="erp-inner-layout">
|
||||
<div class="erp-col erp-col-1-2">
|
||||
<div class="erp-card">
|
||||
<ChartV04 :formParams="props.formParams" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="erp-col erp-col-1-2">
|
||||
<div class="erp-card">
|
||||
<ChartV05 :formParams="props.formParams" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="erp-col erp-col-1-2">
|
||||
<div class="erp-card">
|
||||
<ChartV06 :formParams="props.formParams" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="erp-section erp-lower-section">
|
||||
<div class="erp-col erp-col-1-2">
|
||||
<div class="erp-inner-layout">
|
||||
<div class="erp-col erp-col-1-2">
|
||||
<div class="erp-card">
|
||||
<ChartV07 :formParams="props.formParams" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="erp-col erp-col-1-2">
|
||||
<div class="erp-card">
|
||||
<ChartV08 :formParams="props.formParams" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="erp-col erp-col-1-2">
|
||||
<div class="erp-card">
|
||||
<ChartV09 :formParams="props.formParams" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import ChartV01 from './components/ChartV01.vue';
|
||||
import ChartV02 from './components/ChartV02.vue';
|
||||
import ChartV03 from './components/ChartV03.vue';
|
||||
import ChartV04 from './components/ChartV04.vue';
|
||||
import ChartV05 from './components/ChartV05.vue';
|
||||
import ChartV06 from './components/ChartV06.vue';
|
||||
import ChartV07 from './components/ChartV07.vue';
|
||||
import ChartV08 from './components/ChartV08.vue';
|
||||
import ChartV09 from './components/ChartV09.vue';
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.erp-layout-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
padding: 8px;
|
||||
margin: 0 !important;
|
||||
box-sizing: border-box;
|
||||
background-color: transparent;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.erp-section {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.erp-top-header {
|
||||
height: 10%;
|
||||
}
|
||||
|
||||
.erp-upper-section,
|
||||
.erp-middle-section,
|
||||
.erp-lower-section {
|
||||
height: 30%;
|
||||
}
|
||||
|
||||
.erp-col {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.erp-col-1-3 {
|
||||
width: calc((100% - 12px) / 3);
|
||||
}
|
||||
|
||||
.erp-col-1-2 {
|
||||
width: calc((100% - 6px) / 2);
|
||||
}
|
||||
|
||||
.erp-inner-layout {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.erp-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(15, 52, 96, 0.9);
|
||||
border: 1px solid #1a508b;
|
||||
border-radius: 8px;
|
||||
padding: 2px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #e0e6ff;
|
||||
backdrop-filter: blur(4px);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.full-card {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.erp-card:hover {
|
||||
box-shadow: 0 4px 12px rgba(60, 156, 255, 0.3);
|
||||
border-color: #3c9cff;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.erp-card h3 {
|
||||
font-size: 16px;
|
||||
margin-bottom: 8px;
|
||||
letter-spacing: 1px;
|
||||
background: #3c9cff;
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.erp-card p {
|
||||
font-size: 13px;
|
||||
opacity: 0.75;
|
||||
color: #b4c7e7;
|
||||
text-align: center;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@media (max-width: 1600px) {
|
||||
.erp-layout-container {
|
||||
padding: 6px;
|
||||
gap: 4px;
|
||||
}
|
||||
.erp-section {
|
||||
gap: 4px;
|
||||
}
|
||||
.erp-col-1-3 {
|
||||
width: calc((100% - 8px) / 3);
|
||||
}
|
||||
.erp-col-1-2 {
|
||||
width: calc((100% - 4px) / 2);
|
||||
}
|
||||
.erp-inner-layout {
|
||||
gap: 4px;
|
||||
}
|
||||
.erp-card {
|
||||
padding: 10px;
|
||||
}
|
||||
.erp-card h3 {
|
||||
font-size: 14px;
|
||||
}
|
||||
.erp-card p {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.erp-layout-container {
|
||||
flex-direction: column;
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
padding: 6px;
|
||||
gap: 6px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.erp-section {
|
||||
flex-direction: column;
|
||||
height: auto !important;
|
||||
min-height: 120px;
|
||||
gap: 6px;
|
||||
}
|
||||
.erp-col-1-3,
|
||||
.erp-col-1-2 {
|
||||
width: 100%;
|
||||
height: calc((100% - 12px) / 3);
|
||||
}
|
||||
.erp-inner-layout {
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
.erp-card {
|
||||
padding: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 900px) {
|
||||
.erp-layout-container {
|
||||
padding: 6px;
|
||||
gap: 4px;
|
||||
}
|
||||
.erp-section {
|
||||
gap: 4px;
|
||||
}
|
||||
.erp-card {
|
||||
padding: 8px;
|
||||
}
|
||||
.erp-card h3 {
|
||||
font-size: 14px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.erp-card p {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
288
screen-vue/src/views/screen/Home/components/user/form.vue
Normal file
288
screen-vue/src/views/screen/Home/components/user/form.vue
Normal file
@@ -0,0 +1,288 @@
|
||||
<template>
|
||||
<el-form
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
ref="formRef"
|
||||
label-width="100px"
|
||||
class="dialog-form-container"
|
||||
>
|
||||
<div class="form-row">
|
||||
<div class="form-col">
|
||||
<el-form-item label="登录账户" prop="userName">
|
||||
<el-input
|
||||
v-model="formData.userName"
|
||||
placeholder="请输入登录账户"
|
||||
clearable
|
||||
:disabled="isEdit"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="form-col">
|
||||
<el-form-item label="用户名称" prop="uname">
|
||||
<el-input
|
||||
v-model="formData.uname"
|
||||
placeholder="请输入用户名称"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-col">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-select
|
||||
v-model="formData.sex"
|
||||
placeholder="请选择性别"
|
||||
clearable
|
||||
popper-class="theme-select-popper"
|
||||
>
|
||||
<el-option label="男" value="男" />
|
||||
<el-option label="女" value="女" />
|
||||
<el-option label="未知" value="未知" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="form-col">
|
||||
<el-form-item label="电子邮箱" prop="email">
|
||||
<el-input
|
||||
v-model="formData.email"
|
||||
placeholder="请输入电子邮箱"
|
||||
clearable
|
||||
type="email"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-col">
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input
|
||||
v-model="formData.phone"
|
||||
placeholder="请输入联系电话"
|
||||
clearable
|
||||
type="tel"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="form-col">
|
||||
<el-form-item label="用户角色" prop="roleId">
|
||||
<el-select
|
||||
v-model="formData.roleId"
|
||||
placeholder="请选择用户角色"
|
||||
clearable
|
||||
popper-class="theme-select-popper"
|
||||
>
|
||||
<el-option label="管理员" value="0" />
|
||||
<el-option label="普通用户" value="1" />
|
||||
<el-option label="访客" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-col">
|
||||
<el-form-item label="系统模块" prop="groupModuleId">
|
||||
<el-select
|
||||
v-model="formData.groupModuleId"
|
||||
placeholder="请选择系统模块"
|
||||
clearable
|
||||
popper-class="theme-select-popper"
|
||||
>
|
||||
<el-option label="模块A" value="0" />
|
||||
<el-option label="模块B" value="1" />
|
||||
<el-option label="模块C" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="form-col">
|
||||
<el-form-item label="登录状态" prop="ustatus">
|
||||
<el-select
|
||||
v-model="formData.ustatus"
|
||||
placeholder="请选择登录状态"
|
||||
clearable
|
||||
popper-class="theme-select-popper"
|
||||
>
|
||||
<el-option label="停用" value="0" />
|
||||
<el-option label="在用" value="1" />
|
||||
<el-option label="锁定" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
formData: {
|
||||
type: Object,
|
||||
required: true,
|
||||
default: () => ({
|
||||
uname: '',
|
||||
userName: '',
|
||||
sex: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
roleId : '',
|
||||
groupModuleId: '',
|
||||
ustatus: '1',
|
||||
})
|
||||
},
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
const formRef = ref(null)
|
||||
|
||||
const formRules = {
|
||||
uname: [ { required: true, message: '请输入用户名称', trigger: 'blur' } ],
|
||||
userName: [ { required: true, message: '请输入登录账户', trigger: 'blur' } ],
|
||||
sex: [ { required: true, message: '请选择性别', trigger: 'change' } ],
|
||||
roleId: [ { required: true, message: '请选择用户角色', trigger: 'change' } ],
|
||||
groupModuleId: [ { required: true, message: '请选择系统模块', trigger: 'change' } ],
|
||||
ustatus: [ { required: true, message: '请选择登录状态', trigger: 'change' } ],
|
||||
}
|
||||
|
||||
const validate = async () => {
|
||||
if (!formRef.value) return false
|
||||
try {
|
||||
const valid = await formRef.value.validate()
|
||||
return valid
|
||||
} catch (error) {
|
||||
console.error('表单验证失败:', error)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
const resetForm = () => {
|
||||
if (formRef.value) formRef.value.resetFields()
|
||||
}
|
||||
|
||||
defineExpose({ validate, resetForm })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 表单容器 - 带边框,不溢出 */
|
||||
.dialog-form-container {
|
||||
width: 100%;
|
||||
padding: 16px;
|
||||
margin: 0;
|
||||
border: 1px solid rgba(64, 158, 255, 0.15);
|
||||
border-radius: 8px;
|
||||
background-color: rgba(10, 30, 60, 0.08);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 布局样式 */
|
||||
.form-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
margin: 0 0 16px 0;
|
||||
gap: 20px;
|
||||
}
|
||||
.form-row:last-child { margin-bottom: 0; }
|
||||
.form-col { flex: 1; min-width: 180px; }
|
||||
|
||||
/* 表单标签 */
|
||||
:deep(.el-form-item) { margin-bottom: 0 !important; }
|
||||
:deep(.el-form-item__label) {
|
||||
color: #e0e6ff !important;
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
}
|
||||
:deep(.el-form-item__error) {
|
||||
color: #f56c6c !important;
|
||||
font-size: 12px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
/* ========== 终极统一输入框/下拉框样式 ========== */
|
||||
:deep(.el-input__wrapper),
|
||||
:deep(.el-select__wrapper) {
|
||||
background-color: rgba(10, 30, 60, 0.6) !important;
|
||||
border: 1px solid rgba(64, 158, 255, 0.3) !important;
|
||||
box-shadow: none !important;
|
||||
border-radius: 4px !important;
|
||||
background-image: none !important;
|
||||
opacity: 1 !important;
|
||||
transition: all 0s ease 0s !important; /* 彻底禁用过渡动画 */
|
||||
--el-input-border-color: rgba(64, 158, 255, 0.3) !important;
|
||||
--el-input-hover-border-color: rgba(64, 158, 255, 0.3) !important;
|
||||
--el-input-focus-border-color: rgba(64, 158, 255, 0.3) !important;
|
||||
--el-input-focus-box-shadow: none !important;
|
||||
--el-input-text-color: #e0e6ff !important;
|
||||
--el-input-placeholder-color: rgba(224, 230, 255, 0.6) !important;
|
||||
}
|
||||
|
||||
/* 强制覆盖所有状态,包括伪类和内置类名 */
|
||||
:deep(.el-input__wrapper:hover),
|
||||
:deep(.el-select__wrapper:hover),
|
||||
:deep(.el-input__wrapper.is-focus),
|
||||
:deep(.el-select__wrapper.is-focus),
|
||||
:deep(.el-input__wrapper:focus-within),
|
||||
:deep(.el-select__wrapper:focus-within),
|
||||
:deep(.el-input__wrapper.el-input__wrapper--focus),
|
||||
:deep(.el-select__wrapper.el-select__wrapper--focus),
|
||||
:deep(.el-input__wrapper:active),
|
||||
:deep(.el-select__wrapper:active) {
|
||||
background-color: rgba(10, 30, 60, 0.6) !important;
|
||||
border-color: rgba(64, 158, 255, 0.3) !important;
|
||||
box-shadow: none !important;
|
||||
outline: none !important;
|
||||
transition: all 0s ease 0s !important;
|
||||
}
|
||||
|
||||
/* 内部输入框/选择器彻底透明化 */
|
||||
:deep(.el-select),
|
||||
:deep(.el-select .el-input),
|
||||
:deep(.el-input),
|
||||
:deep(.el-input__inner),
|
||||
:deep(.el-select__inner) {
|
||||
background-color: transparent !important;
|
||||
color: #e0e6ff !important;
|
||||
box-shadow: none !important;
|
||||
outline: none !important;
|
||||
border: none !important;
|
||||
transition: all 0s ease 0s !important;
|
||||
}
|
||||
|
||||
/* 占位符样式 */
|
||||
:deep(.el-input__placeholder),
|
||||
:deep(.el-select__placeholder) {
|
||||
color: rgba(224, 230, 255, 0.6) !important;
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
/* 图标样式 */
|
||||
:deep(.el-icon) {
|
||||
color: #e0e6ff !important;
|
||||
background-color: transparent !important;
|
||||
transition: all 0s ease 0s !important;
|
||||
}
|
||||
|
||||
/* 禁用状态 */
|
||||
:deep(.el-input.is-disabled .el-input__wrapper),
|
||||
:deep(.el-select.is-disabled .el-select__wrapper) {
|
||||
background-color: rgba(10, 30, 60, 0.4) !important;
|
||||
border-color: rgba(64, 158, 255, 0.2) !important;
|
||||
color: rgba(224, 230, 255, 0.5) !important;
|
||||
--el-input-disabled-bg-color: rgba(10, 30, 60, 0.4) !important;
|
||||
transition: all 0s ease 0s !important;
|
||||
}
|
||||
|
||||
/* 错误状态 */
|
||||
:deep(.el-form-item.is-error .el-input__wrapper),
|
||||
:deep(.el-form-item.is-error .el-select__wrapper) {
|
||||
border-color: #f56c6c !important;
|
||||
--el-input-border-color: #f56c6c !important;
|
||||
transition: all 0s ease 0s !important;
|
||||
}
|
||||
</style>
|
||||
751
screen-vue/src/views/screen/Home/components/user/index.vue
Normal file
751
screen-vue/src/views/screen/Home/components/user/index.vue
Normal file
@@ -0,0 +1,751 @@
|
||||
<template>
|
||||
<div class="data-container">
|
||||
<div class="search-border-container">
|
||||
<el-form :model="searchForm" class="search-form">
|
||||
<div class="form-items-wrapper">
|
||||
<el-form-item label="用户名称:" class="form-item">
|
||||
<el-input
|
||||
v-model="searchForm.uname"
|
||||
placeholder="请输入用户名称"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="登录账户:" class="form-item">
|
||||
<el-input
|
||||
v-model="searchForm.userName"
|
||||
placeholder="请输入登录账户"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="登录状态:" class="form-item">
|
||||
<el-select
|
||||
v-model="searchForm.ustatus"
|
||||
placeholder="请选择登录状态"
|
||||
clearable
|
||||
class="custom-select"
|
||||
popper-class="theme-select-popper"
|
||||
>
|
||||
<el-option label="停用" value="0" />
|
||||
<el-option label="再用" value="1" />
|
||||
<el-option label="锁定" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item class="form-btn-group">
|
||||
<el-button type="primary" @click="handleSearch">
|
||||
<el-icon><Search /></el-icon>
|
||||
查询
|
||||
</el-button>
|
||||
<el-button type="default" @click="handleReset" class="reset-btn">
|
||||
<el-icon><Refresh /></el-icon>
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="main-content-container">
|
||||
<div class="table-toolbar">
|
||||
<el-button type="primary" @click="handleAdd">
|
||||
<el-icon><Plus /></el-icon>
|
||||
新增
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<div class="table-wrapper">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
stripe
|
||||
style="width: 100%; height: 100%"
|
||||
empty-text="暂无相关数据"
|
||||
class="data-table"
|
||||
v-loading="loading"
|
||||
loading-text="正在加载数据..."
|
||||
:header-cell-style="{
|
||||
background: 'rgba(10, 30, 60, 0.8)',
|
||||
color: '#a0cfff',
|
||||
border: 'none',
|
||||
borderBottom: '1px solid rgba(64, 158, 255, 0.3)'
|
||||
}"
|
||||
:row-style="{
|
||||
background: 'transparent',
|
||||
color: '#a0cfff',
|
||||
border: 'none'
|
||||
}"
|
||||
:cell-style="{
|
||||
border: 'none',
|
||||
borderBottom: '1px solid rgba(64, 158, 255, 0.2)'
|
||||
}"
|
||||
>
|
||||
<el-table-column prop="createTime" label="记录日期" />
|
||||
<el-table-column prop="userName" label="登录账户" />
|
||||
<el-table-column prop="uname" label="用户名称" />
|
||||
<el-table-column prop="sex" label="性别" />
|
||||
<el-table-column prop="email" label="电子邮箱" />
|
||||
<el-table-column prop="phone" label="联系电话" />
|
||||
<el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
width="180"
|
||||
:header-cell-style="{
|
||||
padding: '0 10px',
|
||||
textAlign: 'center'
|
||||
}"
|
||||
:cell-style="{
|
||||
padding: '0 10px',
|
||||
textAlign: 'center'
|
||||
}"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleEdit(scope.row)"
|
||||
icon="Edit"
|
||||
circle
|
||||
/>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
@click="handleDelete(scope.row)"
|
||||
icon="Delete"
|
||||
circle
|
||||
/>
|
||||
<el-button
|
||||
type="warning"
|
||||
size="small"
|
||||
@click="handleStatusChange(scope.row)"
|
||||
icon="Switch"
|
||||
circle
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<div class="pagination-wrapper">
|
||||
<el-pagination
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[20, 50, 99]"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
class="custom-pagination"
|
||||
popper-class="theme-pagination-popper"
|
||||
:teleported="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="80%"
|
||||
class="custom-dialog"
|
||||
:close-on-click-modal="false"
|
||||
:destroy-on-close="true"
|
||||
>
|
||||
<VForm
|
||||
ref="formRef"
|
||||
:form-data="formData"
|
||||
:is-edit="isEdit"
|
||||
/>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false" class="dialog-cancel-btn">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">保存</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, reactive } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Plus, Search, Refresh, Edit, Delete, Switch } from '@element-plus/icons-vue'
|
||||
import { getHomeUserList } from '@/api/bizUser'
|
||||
import VForm from './form.vue';
|
||||
|
||||
const loading = ref(false)
|
||||
|
||||
const searchForm = reactive({
|
||||
uname: '',
|
||||
ustatus: '',
|
||||
userName: ''
|
||||
})
|
||||
|
||||
const tableData = ref([])
|
||||
|
||||
const currentPage = ref(1)
|
||||
const pageSize = ref(20)
|
||||
const total = ref(0)
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const dialogTitle = ref('')
|
||||
const isEdit = ref(false)
|
||||
const formData = ref({})
|
||||
const formRef = ref(null)
|
||||
|
||||
const handleAdd = () => {
|
||||
dialogTitle.value = '新增用户'
|
||||
isEdit.value = false
|
||||
formData.value = {
|
||||
uname: '',
|
||||
userName: '',
|
||||
sex: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
roleId: '',
|
||||
groupModuleId: '',
|
||||
ustatus: '1'
|
||||
}
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
const handleEdit = (row) => {
|
||||
dialogTitle.value = '编辑用户'
|
||||
isEdit.value = true
|
||||
formData.value = { ...row }
|
||||
dialogVisible.value = true
|
||||
console.log('点击编辑按钮', row)
|
||||
}
|
||||
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
// 调用子组件的表单验证
|
||||
const isValid = await formRef.value.validate()
|
||||
if (!isValid) return
|
||||
|
||||
if (isEdit.value) {
|
||||
console.log('编辑用户提交数据:', formData.value)
|
||||
} else {
|
||||
console.log('新增用户提交数据:', formData.value)
|
||||
}
|
||||
|
||||
dialogVisible.value = false
|
||||
await getList()
|
||||
ElMessage.success(isEdit.value ? '编辑成功' : '新增成功')
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error)
|
||||
ElMessage.error(isEdit.value ? '编辑失败' : '新增失败')
|
||||
}
|
||||
}
|
||||
|
||||
const handleDelete = (row) => {
|
||||
console.log('点击删除按钮', row)
|
||||
}
|
||||
|
||||
const handleStatusChange = (row) => {
|
||||
console.log('点击状态切换按钮', row)
|
||||
}
|
||||
|
||||
const handleSearch = () => {
|
||||
getList();
|
||||
}
|
||||
|
||||
const handleReset = () => {
|
||||
Object.assign(searchForm, {
|
||||
uname: '',
|
||||
ustatus: '',
|
||||
userName: ''
|
||||
})
|
||||
currentPage.value = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
const handleSizeChange = (val) => {
|
||||
pageSize.value = val
|
||||
getList()
|
||||
}
|
||||
|
||||
const handleCurrentChange = (val) => {
|
||||
currentPage.value = val
|
||||
getList()
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const reqParmas = {
|
||||
... searchForm,
|
||||
pageNum: currentPage.value,
|
||||
pageSize: pageSize.value,
|
||||
}
|
||||
const res = await getHomeUserList(reqParmas);
|
||||
total.value = res.total;
|
||||
tableData.value = res.list || [];
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error);
|
||||
tableData.value = [];
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await getList();
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.data-container {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
min-height: 500px;
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
background-color: rgba(10, 30, 60, 0.05);
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
overflow: hidden;
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
.search-border-container {
|
||||
border: 1px solid rgba(64, 158, 255, 0.15);
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
background-color: rgba(10, 30, 60, 0.08);
|
||||
flex-shrink: 0;
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
.search-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.form-items-wrapper {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
gap: 20px;
|
||||
min-width: 0;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
flex: 1;
|
||||
margin-bottom: 0 !important;
|
||||
min-width: 180px;
|
||||
}
|
||||
|
||||
.form-btn-group {
|
||||
margin-left: 20px;
|
||||
margin-bottom: 0 !important;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.main-content-container {
|
||||
border: 1px solid rgba(64, 158, 255, 0.15);
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
background-color: rgba(10, 30, 60, 0.08);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
.table-toolbar {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.table-wrapper {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
min-height: 200px;
|
||||
background-color: rgba(10, 30, 60, 0.08);
|
||||
}
|
||||
|
||||
.data-table {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.pagination-wrapper {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding-top: 8px;
|
||||
border-top: 1px solid rgba(64, 158, 255, 0.1);
|
||||
background-color: transparent !important;
|
||||
flex-shrink: 0;
|
||||
margin: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* ========== 终极统一输入框/下拉框样式 ========== */
|
||||
:deep(.el-input__wrapper),
|
||||
:deep(.el-select__wrapper) {
|
||||
background-color: rgba(10, 30, 60, 0.6) !important;
|
||||
border: 1px solid rgba(64, 158, 255, 0.3) !important;
|
||||
box-shadow: none !important;
|
||||
border-radius: 4px !important;
|
||||
background-image: none !important;
|
||||
opacity: 1 !important;
|
||||
transition: all 0s ease 0s !important; /* 彻底禁用过渡动画 */
|
||||
--el-input-border-color: rgba(64, 158, 255, 0.3) !important;
|
||||
--el-input-hover-border-color: rgba(64, 158, 255, 0.3) !important;
|
||||
--el-input-focus-border-color: rgba(64, 158, 255, 0.3) !important;
|
||||
--el-input-focus-box-shadow: none !important;
|
||||
--el-input-bg-color: transparent !important;
|
||||
--el-select-bg-color: transparent !important;
|
||||
--el-input-text-color: #e0e6ff !important;
|
||||
--el-input-placeholder-color: rgba(224, 230, 255, 0.6) !important;
|
||||
}
|
||||
|
||||
/* 强制覆盖所有状态,包括伪类和内置类名 */
|
||||
:deep(.el-input__wrapper:hover),
|
||||
:deep(.el-select__wrapper:hover),
|
||||
:deep(.el-input__wrapper.is-focus),
|
||||
:deep(.el-select__wrapper.is-focus),
|
||||
:deep(.el-input__wrapper:focus-within),
|
||||
:deep(.el-select__wrapper:focus-within),
|
||||
:deep(.el-input__wrapper.el-input__wrapper--focus),
|
||||
:deep(.el-select__wrapper.el-select__wrapper--focus),
|
||||
:deep(.el-input__wrapper:active),
|
||||
:deep(.el-select__wrapper:active) {
|
||||
background-color: rgba(10, 30, 60, 0.6) !important;
|
||||
border-color: rgba(64, 158, 255, 0.3) !important;
|
||||
box-shadow: none !important;
|
||||
outline: none !important;
|
||||
transition: all 0s ease 0s !important;
|
||||
}
|
||||
|
||||
/* 内部输入框/选择器彻底透明化 */
|
||||
:deep(.el-select),
|
||||
:deep(.el-select .el-input),
|
||||
:deep(.el-select .el-input__wrapper),
|
||||
:deep(.el-input),
|
||||
:deep(.el-input__inner),
|
||||
:deep(.el-select__inner),
|
||||
:deep(.el-select-v2__inner) {
|
||||
background-color: transparent !important;
|
||||
color: #e0e6ff !important;
|
||||
box-shadow: none !important;
|
||||
outline: none !important;
|
||||
border: none !important;
|
||||
transition: all 0s ease 0s !important;
|
||||
}
|
||||
|
||||
/* 占位符样式 */
|
||||
:deep(.el-input__placeholder),
|
||||
:deep(.el-select__placeholder) {
|
||||
color: rgba(224, 230, 255, 0.6) !important;
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
/* 图标样式 */
|
||||
:deep(.el-select__suffix-inner>.el-icon),
|
||||
:deep(.el-input__suffix-inner>.el-icon),
|
||||
:deep(.el-input__clear),
|
||||
:deep(.el-select__clear) {
|
||||
color: #e0e6ff !important;
|
||||
background-color: transparent !important;
|
||||
transition: all 0s ease 0s !important;
|
||||
}
|
||||
|
||||
/* 禁用状态 */
|
||||
:deep(.el-input.is-disabled .el-input__wrapper),
|
||||
:deep(.el-select.is-disabled .el-select__wrapper) {
|
||||
background-color: rgba(10, 30, 60, 0.4) !important;
|
||||
border-color: rgba(64, 158, 255, 0.2) !important;
|
||||
color: rgba(224, 230, 255, 0.5) !important;
|
||||
--el-input-disabled-bg-color: rgba(10, 30, 60, 0.4) !important;
|
||||
transition: all 0s ease 0s !important;
|
||||
}
|
||||
|
||||
/* ========== 原有样式 ========== */
|
||||
:deep(.el-table .el-button--small) {
|
||||
margin: 0 2px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
padding: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
:deep(.el-table__fixed-right) {
|
||||
background-color: transparent !important;
|
||||
border-left: 1px solid rgba(64, 158, 255, 0.2) !important;
|
||||
}
|
||||
|
||||
:deep(.el-table__fixed-right::before) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__label) {
|
||||
color: #e0e6ff !important;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination) {
|
||||
--el-pagination-text-color: #e0e6ff;
|
||||
--el-pagination-button-color: #e0e6ff;
|
||||
--el-pagination-button-hover-color: #409EFF;
|
||||
--el-pagination-button-active-color: #409EFF;
|
||||
--el-pagination-border-color: #409EFF;
|
||||
--el-pagination-bg-color: transparent !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
:deep(.el-pagination) {
|
||||
--el-pagination-hover-border-color: #409EFF !important;
|
||||
--el-pagination-active-border-color: #409EFF !important;
|
||||
}
|
||||
|
||||
:deep(.el-pagination button) {
|
||||
background-color: rgba(10, 30, 60, 0.6) !important;
|
||||
border: 1px solid rgba(64, 158, 255, 0.3) !important;
|
||||
color: #e0e6ff !important;
|
||||
outline: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
:deep(.el-pagination .el-pager li) {
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
|
||||
:deep(.el-pagination .el-pager li.active) {
|
||||
color: #409EFF !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
:deep(.theme-pagination-popper) {
|
||||
background-color: rgba(10, 30, 60, 0.85) !important;
|
||||
border: 1px solid rgba(64, 158, 255, 0.3) !important;
|
||||
color: #e0e6ff !important;
|
||||
z-index: 99999 !important;
|
||||
position: absolute !important;
|
||||
top: auto !important;
|
||||
bottom: calc(100% + 8px) !important;
|
||||
right: 0 !important;
|
||||
left: auto !important;
|
||||
margin: 0 !important;
|
||||
transform: none !important;
|
||||
width: auto !important;
|
||||
min-width: 80px !important;
|
||||
outline: none !important;
|
||||
box-shadow: none !important;
|
||||
border-radius: 4px !important;
|
||||
box-sizing: border-box !important;
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
|
||||
:deep(.theme-pagination-popper * ) {
|
||||
border: none !important;
|
||||
outline: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
:deep(.theme-pagination-popper .el-pagination__sizes-option) {
|
||||
color: #e0e6ff !important;
|
||||
padding: 6px 12px !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
:deep(.theme-pagination-popper .el-pagination__sizes-option:hover) {
|
||||
background-color: rgba(64, 158, 255, 0.2) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
:deep(.el-table) {
|
||||
--el-table-text-color: #a0cfff;
|
||||
--el-table-header-text-color: #a0cfff;
|
||||
--el-table-row-hover-bg-color: rgba(64, 158, 255, 0.2);
|
||||
--el-table-border-color: transparent !important;
|
||||
--el-table-stripe-row-bg-color: rgba(10, 30, 60, 0.3);
|
||||
background-color: transparent !important;
|
||||
border: none !important;
|
||||
--el-loading-background-color: rgba(10, 30, 60, 0.8) !important;
|
||||
--el-loading-text-color: #a0cfff !important;
|
||||
}
|
||||
|
||||
:deep(.el-table th) {
|
||||
border: none !important;
|
||||
border-bottom: 1px solid rgba(64, 158, 255, 0.3) !important;
|
||||
background-color: rgba(10, 30, 60, 0.8) !important;
|
||||
color: #a0cfff !important;
|
||||
}
|
||||
|
||||
:deep(.el-table td) {
|
||||
border: none !important;
|
||||
border-bottom: 1px solid rgba(64, 158, 255, 0.2) !important;
|
||||
background-color: transparent !important;
|
||||
color: #a0cfff !important;
|
||||
}
|
||||
|
||||
:deep(.el-table--striped .el-table__row--striped td) {
|
||||
background-color: rgba(10, 30, 60, 0.3) !important;
|
||||
}
|
||||
|
||||
:deep(.el-table__row:hover > td) {
|
||||
background-color: rgba(64, 158, 255, 0.2) !important;
|
||||
}
|
||||
|
||||
:deep(.el-table tr:last-child td) {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
:deep(.el-table-empty-text) {
|
||||
color: #a0cfff !important;
|
||||
}
|
||||
|
||||
:deep(.el-button) {
|
||||
--el-button-text-color: #e0e6ff !important;
|
||||
--el-button-border-color: rgba(64, 158, 255, 0.3) !important;
|
||||
--el-button-hover-text-color: #fff !important;
|
||||
--el-button-hover-border-color: #409EFF !important;
|
||||
--el-button-hover-bg-color: rgba(64, 158, 255, 0.2) !important;
|
||||
height: 32px;
|
||||
padding: 0 16px;
|
||||
outline: none !important;
|
||||
box-shadow: none !important;
|
||||
border-radius: 4px !important;
|
||||
transition: all 0.2s ease !important;
|
||||
}
|
||||
|
||||
:deep(.el-button .el-icon) {
|
||||
margin-right: 6px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
:deep(.el-button--primary) {
|
||||
--el-button-text-color: #fff !important;
|
||||
--el-button-bg-color: rgba(64, 158, 255, 0.6) !important;
|
||||
--el-button-border-color: rgba(64, 158, 255, 0.4) !important;
|
||||
--el-button-hover-bg-color: #409EFF !important;
|
||||
}
|
||||
|
||||
:deep(.reset-btn) {
|
||||
background-color: rgba(10, 30, 60, 0.6) !important;
|
||||
border: 1px solid rgba(64, 158, 255, 0.3) !important;
|
||||
color: #e0e6ff !important;
|
||||
--el-button-hover-bg-color: rgba(64, 158, 255, 0.2) !important;
|
||||
--el-button-hover-border-color: #409EFF !important;
|
||||
--el-button-hover-text-color: #fff !important;
|
||||
}
|
||||
|
||||
:deep(.custom-dialog) {
|
||||
--el-dialog-bg-color: rgba(10, 30, 60, 0.9) !important;
|
||||
--el-dialog-border-color: rgba(64, 158, 255, 0.3) !important;
|
||||
--el-dialog-title-color: #e0e6ff !important;
|
||||
--el-dialog-text-color: #e0e6ff !important;
|
||||
backdrop-filter: blur(4px);
|
||||
border-radius: 8px !important;
|
||||
}
|
||||
|
||||
:deep(.el-dialog__header) {
|
||||
border-bottom: 1px solid rgba(64, 158, 255, 0.2) !important;
|
||||
padding-bottom: 12px !important;
|
||||
}
|
||||
|
||||
:deep(.el-dialog__body) {
|
||||
padding: 20px !important;
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
|
||||
:deep(.el-dialog__footer) {
|
||||
border-top: 1px solid rgba(64, 158, 255, 0.2) !important;
|
||||
padding-top: 12px !important;
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
:deep(.dialog-cancel-btn) {
|
||||
background-color: rgba(10, 30, 60, 0.8) !important;
|
||||
border: 1px solid rgba(100, 116, 139, 0.5) !important;
|
||||
color: #94a3b8 !important;
|
||||
--el-button-hover-bg-color: rgba(10, 30, 60, 0.9) !important;
|
||||
--el-button-hover-border-color: rgba(148, 163, 184, 0.8) !important;
|
||||
--el-button-hover-text-color: #cbd5e1 !important;
|
||||
}
|
||||
|
||||
/* 修复Loading样式 - 核心修复 */
|
||||
:deep(.el-loading-mask) {
|
||||
background-color: rgba(10, 30, 60, 0.8) !important;
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
:deep(.el-loading-spinner) {
|
||||
--el-loading-color: #409EFF !important;
|
||||
}
|
||||
|
||||
:deep(.el-loading-spinner .el-loading-text) {
|
||||
color: #a0cfff !important;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.data-container::-webkit-scrollbar,
|
||||
:deep(.el-table__body-wrapper)::-webkit-scrollbar,
|
||||
.table-wrapper::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
.data-container::-webkit-scrollbar-track,
|
||||
:deep(.el-table__body-wrapper)::-webkit-scrollbar-track,
|
||||
.table-wrapper::-webkit-scrollbar-track {
|
||||
background: rgba(10, 30, 60, 0.1);
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.data-container::-webkit-scrollbar-thumb,
|
||||
:deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb,
|
||||
.table-wrapper::-webkit-scrollbar-thumb {
|
||||
background: rgba(64, 158, 255, 0.4);
|
||||
border-radius: 6px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
/* 全局下拉菜单样式(父子组件共用) */
|
||||
.theme-select-popper {
|
||||
background-color: rgba(10, 30, 60, 0.85) !important;
|
||||
border: 1px solid rgba(64, 158, 255, 0.3) !important;
|
||||
color: #e0e6ff !important;
|
||||
z-index: 99999 !important;
|
||||
outline: none !important;
|
||||
box-shadow: none !important;
|
||||
border-radius: 4px !important;
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
|
||||
.theme-select-popper * {
|
||||
border: none !important;
|
||||
outline: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.theme-select-popper .el-select-dropdown__item {
|
||||
color: #e0e6ff !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.theme-select-popper .el-select-dropdown__item:hover {
|
||||
background-color: rgba(64, 158, 255, 0.2) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.theme-select-popper .el-select-dropdown__item.selected {
|
||||
background-color: rgba(64, 158, 255, 0.3) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
</style>
|
||||
350
screen-vue/src/views/screen/Home/index.vue
Normal file
350
screen-vue/src/views/screen/Home/index.vue
Normal file
@@ -0,0 +1,350 @@
|
||||
<template>
|
||||
<div class="layout-container">
|
||||
<div class="left-panel">
|
||||
<div class="panel-header">
|
||||
<h3 class="panel-title">功能菜单</h3>
|
||||
</div>
|
||||
<div class="menu-wrap">
|
||||
<div class="menu-container">
|
||||
<div
|
||||
class="menu-item"
|
||||
v-for="menu in menuList"
|
||||
:key="menu.id"
|
||||
:class="{ active: activeMenuId === menu.id }"
|
||||
@click="switchMenu(menu.id)"
|
||||
>
|
||||
<component :is="menu.icon" class="menu-icon" />
|
||||
<span class="menu-text">{{ menu.name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="right-panel">
|
||||
<div class="content-container">
|
||||
<!-- 核心修改:给content-item添加full-height类 -->
|
||||
<div v-if="activeMenuId === 1" class="content-item full-height">
|
||||
<UserIndex />
|
||||
</div>
|
||||
<div v-else-if="activeMenuId === 2" class="content-item default-content">
|
||||
<h2>业务分析</h2>
|
||||
<p>这里展示各业务线详细数据、业务流程、异常预警等内容,支持按维度筛选和查看。</p>
|
||||
</div>
|
||||
<div v-else-if="activeMenuId === 3" class="content-item default-content">
|
||||
<h2>用户管理</h2>
|
||||
<p>这里展示用户列表、权限配置、操作日志、用户画像等用户相关管理内容。</p>
|
||||
</div>
|
||||
<div v-else-if="activeMenuId === 4" class="content-item default-content">
|
||||
<h2>系统设置</h2>
|
||||
<p>这里展示参数配置、模板管理、备份恢复、系统日志等系统级配置内容。</p>
|
||||
</div>
|
||||
<div v-else-if="activeMenuId === 5" class="content-item default-content">
|
||||
<h2>数据报表</h2>
|
||||
<p>这里展示各类数据报表、导出、打印等功能,支持自定义报表模板。</p>
|
||||
</div>
|
||||
<div v-else class="content-item default-content">
|
||||
<h2>欢迎使用数字化管理平台</h2>
|
||||
<p>请点击左侧菜单,查看对应的功能模块内容</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
|
||||
import UserIndex from './components/user/index.vue';
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
});
|
||||
|
||||
const menuList = ref([
|
||||
{ id: 1, name: '用户管理', icon: ElementPlusIconsVue.User },
|
||||
{ id: 2, name: '系统设置', icon: ElementPlusIconsVue.Setting },
|
||||
{ id: 3, name: '数据报表', icon: ElementPlusIconsVue.Document },
|
||||
{ id: 4, name: '日志管理', icon: ElementPlusIconsVue.Files },
|
||||
{ id: 5, name: '权限配置', icon: ElementPlusIconsVue.Lock },
|
||||
]);
|
||||
|
||||
const activeMenuId = ref(0);
|
||||
|
||||
const switchMenu = (id) => {
|
||||
activeMenuId.value = id;
|
||||
console.log(`切换到菜单:${menuList.value.find(item => item.id === id)?.name}`);
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
(newVal) => {
|
||||
console.log('表单参数更新:', newVal);
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.layout-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: transparent;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 左侧15%面板 */
|
||||
.left-panel {
|
||||
width: 15%;
|
||||
height: 100%;
|
||||
background-color: rgba(15, 52, 96, 0.9);
|
||||
border-right: 1px solid #1a508b;
|
||||
border-radius: 11px 0 0 11px;
|
||||
padding: 16px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.left-panel::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.panel-header {
|
||||
padding: 12px;
|
||||
border: 1px solid #1a508b;
|
||||
border-radius: 8px;
|
||||
background-color: rgba(21, 69, 128, 0.6);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.panel-title {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
color: #3c9cff;
|
||||
text-align: center;
|
||||
letter-spacing: 1px;
|
||||
margin: 0;
|
||||
text-shadow: 0 0 8px rgba(60, 156, 255, 0.3);
|
||||
}
|
||||
|
||||
.menu-wrap {
|
||||
flex: 1;
|
||||
border: 1px solid #1a508b;
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
background-color: rgba(15, 52, 96, 0.5);
|
||||
overflow-y: auto;
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: #3c9cff rgba(15, 52, 96, 0.5);
|
||||
}
|
||||
|
||||
.menu-wrap::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
.menu-wrap::-webkit-scrollbar-track {
|
||||
background: rgba(15, 52, 96, 0.5);
|
||||
border-radius: 3px;
|
||||
}
|
||||
.menu-wrap::-webkit-scrollbar-thumb {
|
||||
background-color: #3c9cff;
|
||||
border-radius: 6px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.menu-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 12px 16px;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
background-color: rgba(21, 69, 128, 0.5);
|
||||
color: #e0e6ff;
|
||||
font-size: 16px;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.menu-item:hover {
|
||||
background-color: rgba(21, 69, 128, 0.8);
|
||||
box-shadow: 0 2px 6px rgba(60, 156, 255, 0.2);
|
||||
}
|
||||
|
||||
.menu-item.active {
|
||||
background: linear-gradient(90deg, #1a508b, #3c9cff);
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
box-shadow: 0 2px 8px rgba(60, 156, 255, 0.4);
|
||||
}
|
||||
|
||||
.menu-icon {
|
||||
font-size: 18px;
|
||||
width: 24px;
|
||||
text-align: center;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.menu-text {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.right-panel {
|
||||
width: 85%;
|
||||
height: 100%;
|
||||
background-color: rgba(15, 52, 96, 0.9);
|
||||
border-left: 1px solid #1a508b;
|
||||
border-radius: 0 11px 11px 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.right-panel::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.content-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
color: #e0e6ff;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.full-height {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.default-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
max-width: 80%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.default-content h2 {
|
||||
font-size: 28px;
|
||||
opacity: 0.95;
|
||||
letter-spacing: 1px;
|
||||
font-weight: 600;
|
||||
margin: 0 0 20px 0;
|
||||
background: linear-gradient(90deg, #3c9cff, #82b9ff);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
|
||||
.default-content p {
|
||||
font-size: 18px;
|
||||
opacity: 0.75;
|
||||
color: #b4c7e7;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
/* 响应式适配 */
|
||||
@media (max-width: 1600px) {
|
||||
.left-panel {
|
||||
padding: 12px;
|
||||
}
|
||||
.panel-title {
|
||||
font-size: 18px;
|
||||
}
|
||||
.menu-item {
|
||||
padding: 10px 14px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.menu-icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
.default-content h2 {
|
||||
font-size: 24px;
|
||||
}
|
||||
.default-content p {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.layout-container {
|
||||
flex-direction: column;
|
||||
}
|
||||
.left-panel {
|
||||
width: 100%;
|
||||
height: 30%;
|
||||
border-right: none;
|
||||
border-bottom: 1px solid #1a508b;
|
||||
border-radius: 11px 11px 0 0;
|
||||
flex-direction: row;
|
||||
align-items: stretch;
|
||||
gap: 8px;
|
||||
padding: 8px;
|
||||
}
|
||||
.panel-header {
|
||||
width: 20%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 8px;
|
||||
}
|
||||
.panel-title {
|
||||
font-size: 16px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.menu-wrap {
|
||||
flex: 1;
|
||||
padding: 4px;
|
||||
}
|
||||
.menu-container {
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
}
|
||||
.menu-item {
|
||||
padding: 6px 10px;
|
||||
font-size: 13px;
|
||||
gap: 6px;
|
||||
flex: 0 0 calc(33.33% - 4px);
|
||||
justify-content: center;
|
||||
}
|
||||
.right-panel {
|
||||
width: 100%;
|
||||
height: 70%;
|
||||
border-left: none;
|
||||
border-top: 1px solid #1a508b;
|
||||
border-radius: 0 0 11px 11px;
|
||||
}
|
||||
.default-content h2 {
|
||||
font-size: 20px;
|
||||
}
|
||||
.default-content p {
|
||||
font-size: 14px;
|
||||
max-width: 90%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
262
screen-vue/src/views/screen/Work/index.vue
Normal file
262
screen-vue/src/views/screen/Work/index.vue
Normal file
@@ -0,0 +1,262 @@
|
||||
<template>
|
||||
<div class="work-layout-container">
|
||||
<div class="work-section work-top-header">
|
||||
<div class="work-card full-card">
|
||||
<h3>Work页面顶部区域 (10%)</h3>
|
||||
<p>可放置工作概览、筛选条件、操作按钮等</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="work-main-container">
|
||||
<div class="work-col">
|
||||
<div class="work-inner-section work-inner-one-third">
|
||||
<div class="work-card">
|
||||
<h3>左侧上部</h3>
|
||||
<p>工作列表1</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="work-inner-section work-inner-one-third">
|
||||
<div class="work-card">
|
||||
<h3>左侧中部</h3>
|
||||
<p>工作列表2</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="work-inner-section work-inner-one-third">
|
||||
<div class="work-card">
|
||||
<h3>左侧下部</h3>
|
||||
<p>工作列表3</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="work-col">
|
||||
<div class="work-inner-section work-inner-two-third">
|
||||
<div class="work-card">
|
||||
<h3>中间上部 (60%)</h3>
|
||||
<p>核心工作内容/进度展示</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="work-inner-section work-inner-one-third">
|
||||
<div class="work-card">
|
||||
<h3>中间下部 (30%)</h3>
|
||||
<p>工作统计/快捷操作</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="work-col">
|
||||
<div class="work-inner-section work-inner-one-third">
|
||||
<div class="work-card">
|
||||
<h3>右侧上部</h3>
|
||||
<p>工作图表/数据可视化1</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="work-inner-section work-inner-one-third">
|
||||
<div class="work-card">
|
||||
<h3>右侧中部</h3>
|
||||
<p>工作图表/数据可视化2</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="work-inner-section work-inner-one-third">
|
||||
<div class="work-card">
|
||||
<h3>右侧下部</h3>
|
||||
<p>待办/提醒/通知</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.work-layout-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
padding: 8px;
|
||||
margin: 0 !important;
|
||||
box-sizing: border-box;
|
||||
background-color: transparent;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.work-top-header {
|
||||
width: 100%;
|
||||
height: 10%;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.work-main-container {
|
||||
width: 100%;
|
||||
height: 90%;
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.work-col {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.work-inner-one-third {
|
||||
flex: 1;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.work-inner-two-third {
|
||||
flex: 2;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.work-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(15, 52, 96, 0.9);
|
||||
border: 1px solid #1a508b;
|
||||
border-radius: 8px;
|
||||
padding: 2px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #e0e6ff;
|
||||
backdrop-filter: blur(4px);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.full-card {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-card:hover {
|
||||
box-shadow: 0 4px 12px rgba(60, 156, 255, 0.3);
|
||||
border-color: #3c9cff;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.work-card h3 {
|
||||
font-size: 16px;
|
||||
margin-bottom: 8px;
|
||||
letter-spacing: 1px;
|
||||
background: #3c9cff;
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.work-card p {
|
||||
font-size: 13px;
|
||||
opacity: 0.75;
|
||||
color: #b4c7e7;
|
||||
text-align: center;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@media (max-width: 1600px) {
|
||||
.work-layout-container {
|
||||
padding: 6px;
|
||||
gap: 4px;
|
||||
}
|
||||
.work-main-container {
|
||||
gap: 4px;
|
||||
}
|
||||
.work-col {
|
||||
gap: 4px;
|
||||
}
|
||||
.work-card {
|
||||
padding: 10px;
|
||||
}
|
||||
.work-card h3 {
|
||||
font-size: 14px;
|
||||
}
|
||||
.work-card p {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.work-layout-container {
|
||||
flex-direction: column;
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
padding: 6px;
|
||||
gap: 6px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.work-top-header {
|
||||
height: auto;
|
||||
min-height: 80px;
|
||||
}
|
||||
.work-main-container {
|
||||
flex-direction: column;
|
||||
height: auto;
|
||||
min-height: calc(100% - 80px);
|
||||
gap: 6px;
|
||||
}
|
||||
.work-col {
|
||||
width: 100%;
|
||||
height: 33%;
|
||||
gap: 6px;
|
||||
}
|
||||
.work-card {
|
||||
padding: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 900px) {
|
||||
.work-layout-container {
|
||||
padding: 6px;
|
||||
gap: 4px;
|
||||
}
|
||||
.work-main-container {
|
||||
gap: 4px;
|
||||
}
|
||||
.work-col {
|
||||
gap: 4px;
|
||||
}
|
||||
.work-card {
|
||||
padding: 8px;
|
||||
}
|
||||
.work-card h3 {
|
||||
font-size: 14px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.work-card p {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
356
screen-vue/src/views/screen/index.vue
Normal file
356
screen-vue/src/views/screen/index.vue
Normal file
@@ -0,0 +1,356 @@
|
||||
<template>
|
||||
<div class="big-screen-container">
|
||||
<header class="screen-header">
|
||||
<div class="title-center">
|
||||
<h1 class="main-title">{{ screenTitle }}</h1>
|
||||
</div>
|
||||
<div class="tabs-container">
|
||||
<div class="tabs-left">
|
||||
<div
|
||||
class="tab-item"
|
||||
v-for="tab in allTabs"
|
||||
:key="tab.moduleCode"
|
||||
:class="{ active: activeTab === tab.moduleCode }"
|
||||
@click="switchTab(tab.moduleCode)"
|
||||
>
|
||||
<span>{{ tab.moduleName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="query-group">
|
||||
<el-date-picker
|
||||
type="year"
|
||||
v-model="queryDate"
|
||||
popper-class="dark-date-popper"
|
||||
value-format="YYYY"
|
||||
></el-date-picker>
|
||||
<button class="query-btn" @click="handleQuery">查询</button>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="screen-content">
|
||||
<div v-if="activeTab === 'home'" class="screen-page">
|
||||
<HomeIndex :formParams="FormValues" />
|
||||
</div>
|
||||
<div v-else-if="activeTab === 'work'" class="screen-page">
|
||||
<WorkIndex :formParams="FormValues" />
|
||||
</div>
|
||||
<div v-else-if="activeTab === 'werp'" class="screen-page">
|
||||
<ErpIndex :formParams="FormValues" />
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import HomeIndex from './Home/index.vue';
|
||||
import ErpIndex from './Erp/index.vue';
|
||||
import WorkIndex from './Work/index.vue';
|
||||
|
||||
import { getHomeModuleList } from '@/api/bizApi'
|
||||
|
||||
const screenTitle = ref('个人数字化可视化看板');
|
||||
const currentYear = new Date().getFullYear().toString();
|
||||
|
||||
const FormValues = ref({
|
||||
reqParam: currentYear
|
||||
});
|
||||
|
||||
const allTabs = ref([])
|
||||
|
||||
const activeTab = ref('home')
|
||||
const queryDate = ref();
|
||||
|
||||
const switchTab = (key) => {
|
||||
activeTab.value = key
|
||||
}
|
||||
|
||||
const handleQuery = () => {
|
||||
FormValues.value.reqParam = queryDate.value;
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const res = await getHomeModuleList()
|
||||
allTabs.value = res || []
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
const initApp = () =>{
|
||||
queryDate.value = currentYear;
|
||||
getList();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
initApp();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.dark-date-popper {
|
||||
z-index: 9999 !important;
|
||||
background-color: #0f3460 !important;
|
||||
border: 1px solid #1a508b !important;
|
||||
}
|
||||
.dark-date-popper .el-picker-panel,
|
||||
.dark-date-popper .el-date-range-picker,
|
||||
.dark-date-popper .el-date-range-picker__header,
|
||||
.dark-date-popper .el-date-table,
|
||||
.dark-date-popper .el-date-table th,
|
||||
.dark-date-popper .el-date-table td {
|
||||
background-color: #0f3460 !important;
|
||||
color: #e0e6ff !important;
|
||||
border-color: #1a508b !important;
|
||||
}
|
||||
.dark-date-popper .el-date-range-picker__content .el-date-range-picker__header {
|
||||
background-color: #154580 !important;
|
||||
}
|
||||
.dark-date-popper .el-date-range-picker__content {
|
||||
background-color: #0f3460 !important;
|
||||
}
|
||||
.dark-date-popper .el-date-table td.current,
|
||||
.dark-date-popper .el-date-table td.start-date,
|
||||
.dark-date-popper .el-date-table td.end-date {
|
||||
background-color: #3c9cff !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
.dark-date-popper .el-date-table td.in-range {
|
||||
background-color: rgba(60, 156, 255, 0.25) !important;
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
.dark-date-popper .el-date-table-cell {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
.dark-date-popper .el-date-table-cell::before,
|
||||
.dark-date-popper .el-date-table-cell::after {
|
||||
background-color: transparent !important;
|
||||
opacity: 0 !important;
|
||||
}
|
||||
.dark-date-popper .el-date-table td.in-range .el-date-table-cell::before {
|
||||
background-color: rgba(60, 156, 255, 0.25) !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.big-screen-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background-color: #0a1929;
|
||||
background-image: inherit;
|
||||
background-size: cover;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.big-screen-container::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(15, 52, 96, 0.85);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.screen-header {
|
||||
height: 75px;
|
||||
padding: 0 2vw;
|
||||
border-bottom: 1px solid #1a508b;
|
||||
background: url('@/assets/images/biaoti.png') no-repeat center center,
|
||||
linear-gradient(90deg, rgba(15, 52, 96, 0.8), rgba(21, 69, 128, 0.8));
|
||||
background-size: cover;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.title-center {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 9999 !important;
|
||||
padding: 4px 20px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.main-title {
|
||||
font-size: 32px;
|
||||
font-weight: 720;
|
||||
background: linear-gradient(90deg, #3c9cff, #82b9ff);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
white-space: nowrap;
|
||||
z-index: 9999 !important;
|
||||
letter-spacing: 2px;
|
||||
text-shadow: 0 0 8px rgba(60, 156, 255, 0.8);
|
||||
}
|
||||
|
||||
.tabs-container {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
padding: 0 2vw;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
z-index: 10;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.tabs-left {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
padding: 0 20px;
|
||||
border-radius: 8px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
background: url('@/assets/images/button1.png') no-repeat center center;
|
||||
background-size: 100% 100%;
|
||||
color: #e0e6ff;
|
||||
text-align: center;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.tab-item:hover {
|
||||
background: url('@/assets/images/button1.png') no-repeat center center;
|
||||
background-size: 100% 100%;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tab-item.active {
|
||||
background: url('@/assets/images/button2.png') no-repeat center center;
|
||||
background-size: 100% 100%;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
box-shadow: 0 2px 8px rgba(60, 156, 255, 0.4);
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.query-group {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
:deep(.el-input),
|
||||
:deep(.el-input__wrapper),
|
||||
:deep(.el-input__inner) {
|
||||
background-color: #0f3460 !important;
|
||||
color: #e0e6ff !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
:deep(.el-input.is-focus .el-input__wrapper) {
|
||||
box-shadow: 0 0 0 1px #3c9cff inset !important;
|
||||
}
|
||||
|
||||
:deep(.el-date-editor .el-range-input) {
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
|
||||
:deep(.el-date-editor .el-range-separator) {
|
||||
color: #e0e6ff !important;
|
||||
margin-bottom: 5px !important;
|
||||
}
|
||||
|
||||
.query-btn {
|
||||
height: 36px;
|
||||
padding: 0 20px;
|
||||
border-radius: 8px;
|
||||
background: linear-gradient(90deg, #1a508b, #3c9cff);
|
||||
border: 1px solid #1a508b;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.query-btn:hover {
|
||||
box-shadow: 0 2px 8px rgba(60, 156, 255, 0.6);
|
||||
background: linear-gradient(90deg, #154580, #2b8ed8);
|
||||
}
|
||||
|
||||
.screen-content {
|
||||
flex: 1;
|
||||
padding: 12px;
|
||||
display: block;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
overflow: hidden;
|
||||
height: calc(100vh - 75px);
|
||||
}
|
||||
|
||||
.screen-page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
background: rgba(15, 52, 96, 0.8);
|
||||
border: 1px solid #1a508b;
|
||||
border-radius: 12px;
|
||||
backdrop-filter: blur(8px);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@media (max-width: 1600px) {
|
||||
.main-title {
|
||||
font-size: 24px;
|
||||
}
|
||||
.tab-item {
|
||||
padding: 0 18px;
|
||||
font-size: 14px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
.query-btn {
|
||||
height: 32px;
|
||||
font-size: 14px;
|
||||
padding: 0 18px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 900px) {
|
||||
.screen-header {
|
||||
height: 65px;
|
||||
}
|
||||
.tabs-container {
|
||||
height: 36px;
|
||||
}
|
||||
.tab-item {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
.query-btn {
|
||||
height: 32px;
|
||||
}
|
||||
.screen-content {
|
||||
padding: 10px;
|
||||
height: calc(100vh - 65px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user