Files
claw/tests/fixtures/generated_scene/g2_noisy_multi_mode/index.html

113 lines
3.3 KiB
HTML

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>G2 Noisy Multi Mode Fixture</title>
</head>
<body>
<script src="/a_js/jquery.js"></script>
<script>
const loginPath = "http://20.77.115.36:31051";
const mainPath = "http://20.77.115.36:31051";
const sourceUrl = "http://20.76.57.61:18080/gsllys";
const reportType = "lineloss";
async function queryLineloss(period_mode, orgno, weekSfdate, weekEfdate) {
if (period_mode === "month") {
const datas = {
orgno,
yn_flag: 0,
rows: 20,
page: 1,
sidx: "TO_NUMBER(ORG_NO)",
sord: "asc",
fdate: moment().subtract(1, "months").format("YYYY-MM"),
tjzq: "month"
};
return $.ajax({
url: "http://20.76.57.61:18080/gsllys/fourVerEightHor/fourVerEightHorLinelossRateList",
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: JSON.stringify(datas)
});
}
if (period_mode === "week") {
const datas = {
orgno,
tjzq: "week",
rows: 20,
page: 1,
sord: "asc",
weekSfdate,
weekEfdate
};
return $.ajax({
url: "http://20.76.57.61:18080/gsllys/tqLinelossStatis/getYearMonWeekLinelossAnalysisList",
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: JSON.stringify(datas)
});
}
return [];
}
const cols1 = [
["ORG_NAME", "供电单位"],
["LINE_LOSS_RATE", "综合线损率(%)"],
["PPQ", "供电量(Kwh)"],
["UPQ", "售电量(Kwh)"],
["LOSS_PQ", "损失电量(Kwh)"]
]
const cols2 = [
["ORG_NAME", "供电单位"],
["YGDL", "累计供电量"],
["YYDL", "累计售电量"],
["YXSL", "线损完成率(%)"],
["RAT_SCOPE", "线损率累计目标值"],
["BLANK3", "目标完成率"],
["BLANK2", "排名"]
];
async function getUserInfo(custNo) {
return $.ajax({
url: "http://yxgateway.gs.sgcc.com.cn/emss-custmgtf-custview-front/member/cust360ViewInfo/getCustElecInfoByCustIdUnion",
type: "POST",
contentType: "application/json",
data: JSON.stringify({ custNo })
});
}
async function executeTask(period_mode, orgno) {
const pageSize = 20;
let page = 1;
const rows = [];
while (page < 5) {
const response = await queryLineloss(period_mode, orgno, "2026-03-01", "2026-03-07");
const list = response.content || [];
if (!list.length) break;
for (const item of list) {
if (item.statusName !== "回退营销" && item.loss !== null) {
rows.push(item);
}
}
page += 1;
}
return rows;
}
function exportExcel(rows) {
return $.ajax({
url: "http://localhost:13313/SurfaceServices/personalBread/export/faultDetailsExportXLSX",
type: "POST",
data: rows
});
}
const docs1 = "https://github.com/nodeca/pako/";
const docs2 = "https://developer.mozilla.org/En/XMLHttpRequest/Using_XMLHttpRequest#Receiving_binary_data_in_older_browsers";
const docs3 = "https://stackoverflow.com/q/3277182/1008999";
</script>
</body>
</html>