MCPcopy
hub / github.com/ChinaGodMan/UserScripts / createReportUI

Function createReportUI

missav-explorer/missav-explorer.user.js:1136–1404  ·  view source on GitHub ↗
(data, itemsPerPage)

Source from the content-addressed store, hash-verified

1134 // 创建JSONindex
1135
1136 function createReportUI(data, itemsPerPage) {
1137 temporaryData = data
1138 // 创建全屏遮罩层
1139 const overlay = document.createElement('div')
1140 overlay.className = 'overlay'
1141 overlay.style.cssText = `
1142 position: fixed;
1143 top: 0;
1144 left: 0;
1145 width: 100%;
1146 height: 100%;
1147 background-color: rgba(0, 0, 0, 1); /* 全黑不透明背景 */
1148 z-index: 9999; /* 确保遮罩层位于所有内容之上 */
1149 `
1150 // document.body.appendChild(overlay);
1151
1152 const modalContainer = document.createElement('div')
1153 modalContainer.className = 'modal-container'
1154 modalContainer.style.cssText = `
1155 position: fixed;
1156 top: 50%;
1157 left: 50%;
1158 transform: translate(-50%, -50%);
1159 background-color: rgba(255, 255, 255, 1);
1160 border-radius: 8px;
1161 box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
1162 z-index: 10000; /* 确保弹出框位于遮罩层之上 */
1163 padding: 20px;
1164 width: 80%;
1165 max-width: 800px;
1166 `
1167 const title = document.createElement('h2')
1168 title.textContent = `当前共有片单数量: ${temporaryData.length}`
1169
1170 title.style.textAlign = 'center'
1171 modalContainer.appendChild(title)
1172
1173 const closeButton = document.createElement('button')
1174 closeButton.textContent = '×'
1175 closeButton.style.position = 'absolute'
1176 closeButton.style.top = '10px'
1177 closeButton.style.right = '10px'
1178 closeButton.style.backgroundColor = 'transparent'
1179 closeButton.style.border = 'none'
1180 closeButton.style.fontSize = '24px'
1181 closeButton.style.cursor = 'pointer'
1182 modalContainer.appendChild(closeButton)
1183
1184 closeButton.addEventListener('click', () => {
1185
1186 // document.body.removeChild(overlay); // 移除遮罩层
1187 document.body.removeChild(modalContainer) // 移除模态框
1188 })
1189
1190 const tableContainer = document.createElement('div')
1191 tableContainer.style.cssText = `
1192 max-height: 60vh;
1193 overflow-y: auto;

Callers 1

fetchJsonDataFunction · 0.85

Calls 4

generateTableDataFunction · 0.85
updatePageIndicatorFunction · 0.85
updatePaginationButtonsFunction · 0.85
processUrlsFunction · 0.85

Tested by

no test coverage detected