<td><a href="tel:62501" class="phone-link"><i class="fas fa-phone"></i>62501</a></td>
<td class="notes-cell"></td>
</tr>
<tr>
<td>热工采购科</td>
<td>热工采购科巴</td>
<td>一级巴</td>
<td><span class="role-tag role-bazhang">巴长</span></td>
<td>王青.20142689</td>
<td><a href="tel:62111" class="phone-link"><i class="fas fa-phone"></i>62111</a></td>
<td class="notes-cell"></td>
</tr>
<tr>
<td>热工采购科</td>
<td>热工采购科巴</td>
<td>一级巴</td>
<td><span class="role-tag role-bazhu">巴助</span></td>
<td>柴雪.20160837</td>
<td><a href="tel:663216" class="phone-link"><i class="fas fa-phone"></i>663216</a></td>
<td class="notes-cell"></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="footer">
<p>化工装备事业部 © 2025 阿米巴交易平台 | 更新日期: 2025年9月11日</p>
</div>
</main>
</div>
</div>
</div>
</div>
<script>
// ======================================
// 1. 初始化AmazeUI选项卡(关键修复:自动初始化)
// ======================================
$(document).ready(function() {
// AmazeUI自动初始化data-am-tabs组件
$('[data-am-tabs]').tabs();
});
// ======================================
// 2. 数据分析页面:模拟数据(保持不变)
// ======================================
const dept1Data = {
name: "化工装备生产一部",
amebas: [
{ name: "生产一部综合巴", target: 850000, actual: 820000, rate: 96 },
{ name: "碳化硅技术组巴", target: 620000, actual: 640000, rate: 103 },
{ name: "换热器车间巴", target: 780000, actual: 730000, rate: 94 },
{ name: "特材车间巴", target: 920000, actual: 980000, rate: 107 },
{ name: "成型车间巴", target: 710000, actual: 680000, rate: 96 }
]
};
const dept2Data = {
name: "化工装备生产二部",
amebas: [
{ name: "生产二部综合巴", target: 760000, actual: 730000, rate: 96 },
{ name: "列管换热器巴", target: 580000, actual: 550000, rate: 95 },
{ name: "绕管换热器巴", target: 820000, actual: 850000, rate: 104 },
{ name: "热工无缝管巴", target: 650000, actual: 620000, rate: 95 },
{ name: "下料车间巴", target: 790000, actual: 750000, rate: 95 }
]
};
const weeklyData = {
name: "周目标达成情况",
amebas: [
{ name: "生产一部综合巴", target: 195000, actual: 188000 },
{ name: "碳化硅技术组巴", target: 145000, actual: 152000 },
{ name: "换热器车间巴", target: 175000, actual: 168000 },
{ name: "特材车间巴", target: 205000, actual: 215000 },
{ name: "成型车间巴", target: 160000, actual: 155000 }
]
};
const dailyData = {
name: "日目标达成情况",
amebas: [
{ name: "生产一部综合巴", target: 38000, actual: 36000 },
{ name: "碳化硅技术组巴", target: 28000, actual: 29000 },
{ name: "换热器车间巴", target: 34000, actual: 32000 },
{ name: "特材车间巴", target: 40000, actual: 42000 },
{ name: "成型车间巴", target: 31000, actual: 30000 }
]
};
// ======================================
// 3. 初始化数据分析表格(保持不变)
// ======================================
function initTables() {
// 生产一部表格
const dept1TableBody = document.getElementById('dept1-table-body');
dept1Data.amebas.forEach(ameba => {
const row = document.createElement('tr');
row.innerHTML = `
<td>${ameba.name}</td>
<td>¥${ameba.target.toLocaleString()}</td>
<td>¥${ameba.actual.toLocaleString()}</td>
<td class="${ameba.rate >= 100 ? 'rate-success' : 'rate-warning'}">${ameba.rate}%</td>
`;
dept1TableBody.appendChild(row);
});
// 生产二部表格
const dept2TableBody = document.getElementById('dept2-table-body');
dept2Data.amebas.forEach(ameba => {
const row = document.createElement('tr');
row.innerHTML = `
<td>${ameba.name}</td>
<td>¥${ameba.target.toLocaleString()}</td>
<td>¥${ameba.actual.toLocaleString()}</td>
<td class="${ameba.rate >= 100 ? 'rate-success' : 'rate-warning'}">${ameba.rate}%</td>
`;
dept2TableBody.appendChild(row);
});
}
// ======================================
// 4. 初始化ECharts图表(保持不变)
// ======================================
function initCharts() {
// 生产一部图表
const dept1Chart = echarts.init(document.getElementById('dept1-chart'));
dept1Chart.setOption({
tooltip: { trigger: 'axis' },
grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
xAxis: {
type: 'category',
data: dept1Data.amebas.map(a => a.name),
axisLabel: { rotate: 30 }
},
yAxis: { type: 'value', name: '金额(元)' },
series: [
{ name: '目标收入', type: 'bar', data: dept1Data.amebas.map(a => a.target), itemStyle: { color: '#3498db' } },
{ name: '实际收入', type: 'bar', data: dept1Data.amebas.map(a => a.actual), itemStyle: { color: '#2ecc71' } }
]
});
// 生产二部图表
const dept2Chart = echarts.init(document.getElementById('dept2-chart'));
dept2Chart.setOption({
tooltip: { trigger: 'axis' },
grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
xAxis: {
type: 'category',
data: dept2Data.amebas.map(a => a.name),
axisLabel: { rotate: 30 }
},
yAxis: { type: 'value', name: '金额(元)' },
series: [
{ name: '目标收入', type: 'bar', data: dept2Data.amebas.map(a => a.target), itemStyle: { color: '#3498db' } },
{ name: '实际收入', type: 'bar', data: dept2Data.amebas.map(a => a.actual), itemStyle: { color: '#2ecc71' } }
]
});
// 周目标图表
const weeklyChart = echarts.init(document.getElementById('weekly-chart'));
weeklyChart.setOption({
tooltip: { trigger: 'axis' },
legend: { data: ['目标', '实际'], top: 0 },
grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
xAxis: {
type: 'category',
data: weeklyData.amebas.map(a => a.name),
axisLabel: { rotate: 30 }
},
yAxis: { type: 'value', name: '金额(元)' },
series: [
{ name: '目标收入', type: 'bar', data: weeklyData.amebas.map(a => a.target), itemStyle: { color: '#9b59b6' } },
{ name: '实际收入', type: 'bar', data: weeklyData.amebas.map(a => a.actual), itemStyle: { color: '#1abc9c' } }
]
});
// 日目标图表
const dailyChart = echarts.init(document.getElementById('daily-chart'));
dailyChart.setOption({
tooltip: { trigger: 'axis' },
legend: { data: ['目标', '实际'], top: 0 },
grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
xAxis: {
type: 'category',
data: dailyData.amebas.map(a => a.name),
axisLabel: { rotate: 30 }
},
yAxis: { type: 'value', name: '金额(元)' },
series: [
{ name: '目标收入', type: 'bar', data: dailyData.amebas.map(a => a.target), itemStyle: { color: '#e67e22' } },
{ name: '实际收入', type: 'bar', data: dailyData.amebas.map(a => a.actual), itemStyle: { color: '#f1c40f' } }
]
});
// 窗口resize时重绘图表
window.addEventListener('resize', () => {
dept1Chart.resize();
dept2Chart.resize();
weeklyChart.resize();
dailyChart.resize();
});
}
// ======================================
// 5. 联系人页面功能(保持不变)
// ======================================
function initContactFunctions() {
// 导航点击效果
document.querySelectorAll('.nav-link').forEach(link => {
link.addEventListener('click', function(e) {
// 移除所有active类
document.querySelectorAll('.nav-link').forEach(item => {
item.classList.remove('active');
});
// 为当前点击项添加active类
this.classList.add('active');
// 平滑滚动到目标位置
const targetId = this.getAttribute('href');
const targetElement = document.querySelector(targetId);
if (targetElement) {
window.scrollTo({
top: targetElement.offsetTop - 100,
behavior: 'smooth'
});
}
});
});
// 搜索功能
const searchInput = document.querySelector('.search-box input');
searchInput.addEventListener('input', function() {
const searchTerm = this.value.toLowerCase().trim();
document.querySelectorAll('.baba-table tbody tr').forEach(row => {
row.style.display = row.textContent.toLowerCase().includes(searchTerm) ? '' : 'none';
});
});
}
// ======================================
// 6. 页面加载完成后初始化所有功能
// ======================================
document.addEventListener('DOMContentLoaded', function() {
initTables();
initCharts();
initContactFunctions();
});
</script>
</body>
</html>上述是我一个前端的页面,现在想把数据分析页面的数据从sqlserver数据库获取,前端四个数据表需要获取不同的数据:1、获取Scb为化工装备生产一部 各阿米巴Amoeba的月目标收入、月实际收入 2、获取Scb为化工装备生产二部 各阿米巴Amoeba的月目标收入、月实际收入 3、获取各阿米巴周目标收入、周实际收入 4、获取各阿米巴日目标收入、日实际收入 我的数据类如下 ///<summary>
///阿米巴收入目标配置表
///</summary>
[SugarTable("AmoebaTarget")]
public partial class AmoebaTarget
{
public AmoebaTarget(){
}
/// <summary>
/// Description:
/// DefaultValue:
/// Nullable:False
/// <summary>
// [Browsable(false)]
[DisplayName("")]
[SugarColumn(IsPrimaryKey=true,IsIdentity=true)]
public int ID {get;set;}
/// <summary>
/// Description:阿米巴
/// DefaultValue:
/// Nullable:True
/// <summary>
// [Browsable(false)]
[DisplayName("阿米巴")]
public string Amoeba {get;set;}
/// <summary>
/// Description:所属部门
/// DefaultValue:
/// Nullable:True
/// <summary>
// [Browsable(false)]
[DisplayName("所属部门")]
public string Dpt {get;set;}
/// <summary>
/// Description:所属生产部
/// DefaultValue:
/// Nullable:True
/// <summary>
// [Browsable(false)]
[DisplayName("所属生产部")]
public string Scb {get;set;}
/// <summary>
/// Description:月目标收入
/// DefaultValue:
/// Nullable:True
/// <summary>
// [Browsable(false)]
[DisplayName("月目标收入")]
public decimal? TargetIncome_Monthly {get;set;}
/// <summary>
/// Description:周目标收入
/// DefaultValue:
/// Nullable:True
/// <summary>
// [Browsable(false)]
[DisplayName("周目标收入")]
public decimal? TargetIncome_Weekly {get;set;}
/// <summary>
/// Description:日目标收入
/// DefaultValue:
/// Nullable:True
/// <summary>
// [Browsable(false)]
[DisplayName("日目标收入")]
public decimal? TargetIncome_Dayily {get;set;}
/// <summary>
/// Description:月实际收入
/// DefaultValue:
/// Nullable:True
/// <summary>
// [Browsable(false)]
[DisplayName("月实际收入")]
public decimal? ActualIncome_Monthly {get;set;}
/// <summary>
/// Description:周实际收入
/// DefaultValue:
/// Nullable:True
/// <summary>
// [Browsable(false)]
[DisplayName("周实际收入")]
public decimal? ActualIncome_Weekly {get;set;}
/// <summary>
/// Description:日实际收入
/// DefaultValue:
/// Nullable:True
/// <summary>
// [Browsable(false)]
[DisplayName("日实际收入")]
public decimal? ActualIncome_Dayily {get;set;}
/// <summary>
/// Description:创建人
/// DefaultValue:
/// Nullable:True
/// <summary>
// [Browsable(false)]
[DisplayName("创建人")]
public string Creator {get;set;}
/// <summary>
/// Description:创建时间
/// DefaultValue:
/// Nullable:True
/// <summary>
// [Browsable(false)]
[DisplayName("创建时间")]
public DateTime? CreateTime {get;set;}
/// <summary>
/// Description:更新人
/// DefaultValue:
/// Nullable:True
/// <summary>
// [Browsable(false)]
[DisplayName("更新人")]
public string Updater {get;set;}
/// <summary>
/// Description:更新时间
/// DefaultValue:
/// Nullable:True
/// <summary>
// [Browsable(false)]
[DisplayName("更新时间")]
public DateTime? UpdateTime {get;set;}
}
最新发布