-
-
-
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
<
+
1
+
2
+
3
+
4
+
5
+
...
+
22
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
[-默认参数-]
+
+
+ *当前使用
+ 亮字色主题
+
+
+
+ color5: ■ h , s , l (主色)// 底框填充
+ color1: ■ h , s*1.1 , l + 35 // 表头填充、翻页器选中
+ color2: ■ h , s , l + 50 // 表头字色
+ color3: ■ h , s*1.1 , l + 6 // 默认字色、底框/翻页器描边
+ color4: ■ h , s*1.1 , l + 15 // 行间区分色
+ notecolor: ■ rgba(255, 255, 255, 0.4) // 注释字色
+
+
+
+
+
+ *当前使用
+ 暗字色主题
+
+
+
+ color5: ■ h , s , l (主色)// 底框填充
+ color1: ■ h , s*0.9 , l - 35 // 表头填充、翻页器选中
+ color2: ■ h , s , l - 50 // 表头字色
+ color3: ■ h , s*0.9 , l - 5 // 默认字色、底框/翻页器描边
+ color4: ■ h , s*0.9 , l - 15 // 行间区分色
+ notecolor: ■ rgba(0, 0, 0, 0.4) // 注释字色
+
+
+
[-字段类型-]
+
[-布局规则-]
+
+
@@ -545,7 +729,17 @@
customElements.define('data-hltext1', datahltext1);
customElements.define('data-hltext2', datahltext2);
+
+
window.onload = function() {
+ dataTimeWs()
+ datanameflex()
+ menudisplay()
+ datanamechange()
+ }
+
+ //判断数据数量控制日期换行
+ function dataTimeWs(){
const root = document.documentElement;
var checkboxes = document.getElementsByClassName("checkbox");
var count = 0;
@@ -556,7 +750,7 @@
}
var dataTotal = count
- if (dataTotal > 3 ){
+ if (dataTotal > 2 ){
root.style.setProperty('--dataTimeW', '6ch')
root.style.setProperty('--dataNameTextW', '10ch')
@@ -569,11 +763,7 @@
for (var i = 0; i < elements.length; i++) {
elements[i].id = "data-" + (i + 1);
}
- datanameflex()
- menudisplay()
- datanamechange()
}
-
//判断数据数量、赋予非时间类数据ID
function dataflex(){
@@ -623,68 +813,149 @@
dataname4W.style.width = width4 + "px"
}
+ //控制在最少两项数据
+ function mindata() {
+ var checkboxes = document.getElementsByClassName("checkbox");
+
+ for (var i = 0; i < checkboxes.length; i++) {
+
+ checkboxes[i].addEventListener("click", function() {
+ // 计算已取消选择的复选框数量
+ var uncheckedCount = 0;
+ for (var j = 0; j < checkboxes.length; j++) {
+ if (!checkboxes[j].checked) {
+ uncheckedCount++;
+ }
+ }
+ // 如果已取消选择的复选框数量等于2,则将剩下的未取消选择的复选框设置为不可点击
+ if (uncheckedCount == 2) {
+ for (var k = 0; k < checkboxes.length; k++) {
+ if (checkboxes[k].checked) {
+ checkboxes[k].disabled = true;
+ datachecktips()
+ }
+ }
+ }else{
+ for (var k = 0; k < checkboxes.length; k++) {
+ if (checkboxes[k].checked) {
+ checkboxes[k].disabled = false;
+
+ }
+
+ }
+ }
+ });
+ }
+
+ }
+
//增减数据项操作
function menudisplay(){
var root = document.documentElement;
+ var menu2 = document.getElementById("menu2");
var menu3 = document.getElementById("menu3");
var menu4 = document.getElementById("menu4");
+ var checkbox2 = document.getElementById("datadisplay-2");
var checkbox3 = document.getElementById("datadisplay-3");
var checkbox4 = document.getElementById("datadisplay-4");
-
+ var data1 = document.getElementById("data-1");
var data2 = document.getElementById("data-2");
- var data3 = document.getElementById("data-3");
+ var data3 = document.getElementById("data-3");
+ var data4 = document.getElementById("data-4");
var data5 = document.getElementById("data-5");
var data6 = document.getElementById("data-6");
+ var data7 = document.getElementById("data-7");
var data8 = document.getElementById("data-8");
- var data9 = document.getElementById("data-9");
+ var data9 = document.getElementById("data-9");
+ var data10 = document.getElementById("data-10");
var data11 = document.getElementById("data-11");
var data12 = document.getElementById("data-12");
-
+ var dataname2 = document.getElementById("dataname-2");
var dataname3 = document.getElementById("dataname-3");
var dataname4 = document.getElementById("dataname-4");
+ checkbox2.addEventListener('change', function() {
+ if (checkbox2.checked){
+ menu2.style.pointerEvents = "auto"
+ menu2.style.opacity = "1"
+ data1.style.display = "flex"
+ data4.style.display = "flex"
+ data7.style.display = "flex"
+ data10.style.display = "flex"
+ dataname2.style.display = "block"
+ dataflex()
+ dataTimeWs()
+ mindata()
+ datanameflex()
+ }else{
+ menu2.style.pointerEvents = "none"
+ menu2.style.opacity = "0.5"
+ data1.style.display = "none"
+ data4.style.display = "none"
+ data7.style.display = "none"
+ data10.style.display = "none"
+ dataname2.style.display = "none"
+ dataflex()
+ dataTimeWs()
+ mindata()
+ datanameflex()
+ }
+ });
+
checkbox3.addEventListener('change', function() {
if (checkbox3.checked){
- menu3.style.display = "block"
+ menu3.style.pointerEvents = "auto"
+ menu3.style.opacity = "1"
data2.style.display = "flex"
data5.style.display = "flex"
data8.style.display = "flex"
data11.style.display = "flex"
dataname3.style.display = "block"
dataflex()
- datanameflex()
+ dataTimeWs()
+ mindata()
+ datanameflex()
}else{
- menu3.style.display = "none"
+ menu3.style.pointerEvents = "none"
+ menu3.style.opacity = "0.5"
data2.style.display = "none"
data5.style.display = "none"
data8.style.display = "none"
data11.style.display = "none"
dataname3.style.display = "none"
dataflex()
- datanameflex()
+ dataTimeWs()
+ mindata()
+ datanameflex()
}
});
checkbox4.addEventListener('change', function() {
if (checkbox4.checked){
- menu4.style.display = "block"
+ menu4.style.pointerEvents = "auto"
+ menu4.style.opacity = "1"
data3.style.display = "flex"
data6.style.display = "flex"
data9.style.display = "flex"
data12.style.display = "flex"
dataname4.style.display = "block"
dataflex()
- datanameflex()
+ dataTimeWs()
+ mindata()
+ datanameflex()
}else{
- menu4.style.display = "none"
+ menu4.style.pointerEvents = "none"
+ menu4.style.opacity = "0.5"
data3.style.display = "none"
data6.style.display = "none"
data9.style.display = "none"
data12.style.display = "none"
dataname4.style.display = "none"
dataflex()
- datanameflex()
+ dataTimeWs()
+ mindata()
+ datanameflex()
}
});
}
@@ -715,16 +986,96 @@
}
//数据2类型控制
- function data1check(){
- var check = document.getElementById("dataname-1");
+ function data2check(){
+ var check = document.getElementById("data-check-2");
+ var container1 = document.getElementById("data-1")
+ var container4 = document.getElementById("data-4")
+ var container7 = document.getElementById("data-7")
+ var container10 = document.getElementById("data-10")
var type = check.value
+ container1.innerHTML = type ;
+ container4.innerHTML = type ;
+ container7.innerHTML = type ;
+ container10.innerHTML = type ;
}
//数据3类型控制
+ function data3check(){
+ var check = document.getElementById("data-check-3");
+ var container2 = document.getElementById("data-2")
+ var container5 = document.getElementById("data-5")
+ var container8 = document.getElementById("data-8")
+ var container11 = document.getElementById("data-11")
+ var type = check.value
+ container2.innerHTML = type ;
+ container5.innerHTML = type ;
+ container8.innerHTML = type ;
+ container11.innerHTML = type ;
+ }
//数据4类型控制
+ function data4check(){
+ var check = document.getElementById("data-check-4");
+ var container3 = document.getElementById("data-3")
+ var container6 = document.getElementById("data-6")
+ var container9 = document.getElementById("data-9")
+ var container12 = document.getElementById("data-12")
+ var type = check.value
+ container3.innerHTML = type ;
+ container6.innerHTML = type ;
+ container9.innerHTML = type ;
+ container12.innerHTML = type ;
+ }
+
+ //模块增减控制
+ var oneTabs = document.getElementById('oneTabButton');
+ var twoTabs = document.getElementById('twoTabButton');
+ var pageChecks = document.getElementById('pageCheckButton');
+ var mode1 = document.getElementById('oneTab');
+ var mode2 = document.getElementById('twoTab');
+ var mode3 = document.getElementById('pageCheck');
+ var mode1s = document.getElementById('noTab');
+ var mode3s = document.getElementById('nopageCheck');
+
+ pageChecks.addEventListener('change', function() {
+ if (pageChecks.checked){
+ mode3.style.display = "flex"
+ mode3s.style.display = "none"
+ }else{
+ mode3.style.display = "none"
+ mode3s.style.display = "flex"
+ }
+ });
+
+ oneTabs.addEventListener('change', function() {
+ if (oneTabs.checked){
+ mode1.style.display = "flex"
+ mode1s.style.display = "none"
+ if (twoTabs.checked){
+ twoTabs.checked = false
+ mode2.style.display = "none"
+ }
+ }else if (twoTab.checked = "false"){
+ mode1.style.display = "none"
+ mode1s.style.display = "flex"
+ }
+ });
+
+ twoTabs.addEventListener('change', function() {
+ if (twoTabs.checked){
+ mode2.style.display = "flex"
+ mode1s.style.display = "none"
+ if (oneTabs.checked){
+ oneTabs.checked = false
+ mode1.style.display = "none"
+ }
+ }else{
+ mode2.style.display = "none"
+ mode1s.style.display = "flex"
+ }
+ });
+
-
//更新颜色
const colorPicker = document.getElementById('colorPicker');
@@ -753,11 +1104,13 @@
checkbox.checked = true;
changeColor()
updateColorValue()
+ themeSwitchs()
}else {
var checkbox = document.getElementById("themeSwitch");
checkbox.checked = false;
changeColor()
updateColorValue()
+ themeSwitchs()
}
}else{
@@ -777,6 +1130,7 @@
checkbox.checked = true;
changeColor()
updateColorValue()
+ themeSwitchs()
}
}else {
var checkbox = document.getElementById("themeSwitch");
@@ -789,6 +1143,7 @@
checkbox.checked = false;
changeColor()
updateColorValue()
+ themeSwitchs()
}
}
}
@@ -815,7 +1170,7 @@
root.style.setProperty('--color3', `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l + 50}%)`);
root.style.setProperty('--color4', `hsl(${hsl.h}, ${hsl.s * 1.1 }%, ${hsl.l + 6}%)`);
root.style.setProperty('--color5', `hsl(${hsl.h}, ${hsl.s * 1.1}%, ${hsl.l + 15}%)`);
- root.style.setProperty('--noteColor','rgba(255,255,255,40)');
+ root.style.setProperty('--noteColor','#ffffff69');
}
//暗字色主题
@@ -827,29 +1182,41 @@
root.style.setProperty('--color3', `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l - 50}%)`);
root.style.setProperty('--color4', `hsl(${hsl.h}, ${hsl.s * 0.9 }%, ${hsl.l - 5}%)`);
root.style.setProperty('--color5', `hsl(${hsl.h}, ${hsl.s * 0.9}%, ${hsl.l - 15}%)`);
- root.style.setProperty('--noteColor','rgba(255,255,255,40)');
+ root.style.setProperty('--noteColor','#00000069');
}
//主题切换
const themeSwitch = document.getElementById('themeSwitch');
const safaSwitch = document.getElementById('safaSwitch');
+ const tips1 = document.getElementById('tips1');
+ const tips2 = document.getElementById('tips2');
themeSwitch.addEventListener('change', function() {
- if (this.checked) {
+ themeSwitchs()
+ });
+
+ //判断主题开关
+ function themeSwitchs(){
+ if (themeSwitch.checked) {
document.documentElement.style.setProperty('--switch1','#c6c6c6');
document.documentElement.style.setProperty('--switch2','#505050');
-
+ document.documentElement.style.setProperty('--noteColor','#0000006a');
+ tips1.style.display = "none";
+ tips2.style.display = "block";
colordark()
darktips1()
} else {
document.documentElement.style.setProperty('--switch1','#707070');
- document.documentElement.style.setProperty('--switch2','#fff');
-
+ document.documentElement.style.setProperty('--switch2','#ffffff');
+ document.documentElement.style.setProperty('--noteColor','#ffffff6a');
+ tips1.style.display = "block";
+ tips2.style.display = "none";
colorlight()
lighttips1()
}
- });
+ }
+
//安全模式切换(默认开启)
safaSwitch.addEventListener('change', function() {
if (this.checked) {
@@ -959,6 +1326,16 @@
object.style.display = "none";
},2000);
}
+ //最少数据量提示
+ function datachecktips(){
+ var object = document.getElementById('pickertips');
+ object.style.display = "block";
+ object.style.animation = "tipsPickup 1.8s forwards";
+ object.innerHTML = "至少配置两项数据~";
+ setTimeout(function(){
+ object.style.display = "none";
+ },2000);
+ }
//显示色值
function updateColorValue() {