First Commit
This commit is contained in:
116
src/main/resources/webpage/admin/v1/manage/indexInfo/index.html
Normal file
116
src/main/resources/webpage/admin/v1/manage/indexInfo/index.html
Normal file
@@ -0,0 +1,116 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head th:replace="~{admin/v1/include::head}">
|
||||
</head>
|
||||
<style>
|
||||
.layui-elem-quote-warning {
|
||||
border-left: 5px solid #d8a900;
|
||||
}
|
||||
.layui-form-mid {
|
||||
float: none;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<ul th:replace="~{admin/v1/include::nav}"></ul>
|
||||
|
||||
<div class="manage-body">
|
||||
<div>
|
||||
<h1 class="manage-title">
|
||||
<b>指标配置</b>
|
||||
<a href="#" class="help"><i class="layui-icon layui-icon-help"></i></a>
|
||||
<a href="javascript:openUpdateForm()" class="operate">更新</a>
|
||||
</h1>
|
||||
</div>
|
||||
<div>
|
||||
<table class="layui-table" id="indexInfos" lay-filter="indexInfos">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/html" id="operationTpl">
|
||||
<div class="layui-btn-group">
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a>
|
||||
</div>
|
||||
</script>
|
||||
<div th:replace="~{admin/v1/include::feet}"></div>
|
||||
<th:block th:replace="~{admin/v1/include::head-script}"></th:block>
|
||||
|
||||
<script>
|
||||
layui.use(function(){
|
||||
const form = layui.form, layer = layui.layer, table = layui.table;
|
||||
const help = document.querySelector('.help');
|
||||
|
||||
help.addEventListener('click', (e) => {
|
||||
e.preventDefault();
|
||||
layer.open({
|
||||
title: '帮助',
|
||||
shadeClose: !0,
|
||||
content:
|
||||
[
|
||||
'益盟操盘手指标配置,一般需要从 APK 包中获取 <span>config_ind_online.json</span> 文件',
|
||||
'该界面提供可视化查看指标信息的功能,并允许用户从云端拉取、编辑配置文件',
|
||||
'此处的指标配置决定了任务能够更新的指标和细节,包括指标参数限制、数据粒度限制等'
|
||||
].join('<br/>')
|
||||
})
|
||||
})
|
||||
|
||||
document.querySelectorAll('[lay-skin="switch"]').forEach(check => {
|
||||
form.on(`switch(${check.getAttribute('lay-filter')})`, (data) => {
|
||||
var el = data.elem;
|
||||
el.value = !!el.checked;
|
||||
});
|
||||
})
|
||||
|
||||
table.render({
|
||||
elem: '#indexInfos',
|
||||
url: '/admin/v1/manage/indexInfo/configIndOnline',
|
||||
skin: 'line',
|
||||
cols: [ [
|
||||
{field: 'indexCode', title: '指标代码'},
|
||||
{field: 'indexName', title: '指标名称'},
|
||||
{field: 'isCalc', title: '是否传统算法', templet: (d) => {
|
||||
return d.isCalc ?
|
||||
'<i class="op-green fa-solid fa-circle-check"></i>' :
|
||||
'<i class="op-red fa-solid fa-circle-exclamation"></i>';
|
||||
}},
|
||||
{field:'operation', title: '操作', toolbar: '#operationTpl'}
|
||||
]],
|
||||
where: {
|
||||
fields: 'configIndOnline'
|
||||
},
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
parseData: (json) => {
|
||||
console.log(json)
|
||||
const jo = json.data, indMap = jo.indMap;
|
||||
const data = [];
|
||||
Object.keys(indMap).forEach(key => {
|
||||
const indInfo = indMap[key];
|
||||
const row = {
|
||||
indexCode: key,
|
||||
indexName: jo.indIdNameConfig[key],
|
||||
isCalc: indInfo.isCalc,
|
||||
indInfo: indInfo
|
||||
};
|
||||
data.push(row)
|
||||
})
|
||||
return {
|
||||
code: json.ok ? 0 : 1,
|
||||
msg: json.message,
|
||||
data: data,
|
||||
count: data.length
|
||||
}
|
||||
}
|
||||
})
|
||||
table.on('tool(indexInfos)', (obj) => {
|
||||
if (obj.event == 'detail') {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
</script>
|
||||
<th:block th:replace="~{admin/v1/manage/indexInfo/updateForm::indexInfoUpdateForm}"></th:block>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user