This commit is contained in:
parent
efb0f4d99a
commit
7b70b95d49
40
index.html
40
index.html
|
|
@ -15,9 +15,9 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var dark = localStorage.getItem('APP_DARK');
|
var dark = localStorage.getItem('APP_DARK');
|
||||||
if (dark) {
|
if (dark) {
|
||||||
if (dark == 'dark') {
|
if (dark === 'dark') {
|
||||||
document.documentElement.classList.add("dark")
|
document.documentElement.classList.add("dark")
|
||||||
}else if (dark == 'follow') {
|
}else if (dark === 'follow') {
|
||||||
var systemTheme = window.matchMedia('(prefers-color-scheme: dark)')
|
var systemTheme = window.matchMedia('(prefers-color-scheme: dark)')
|
||||||
if (systemTheme.matches) {
|
if (systemTheme.matches) {
|
||||||
document.documentElement.classList.add("dark")
|
document.documentElement.classList.add("dark")
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
<img src="/images/logo.png"/>
|
<img src="/images/logo.png"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="app-loading__loader"></div>
|
<div class="app-loading__loader"></div>
|
||||||
<div class="app-loading__title">%VITE_APP_TITLE%</div>
|
<div class="app-loading__title"></div>
|
||||||
</div>
|
</div>
|
||||||
<style>
|
<style>
|
||||||
.app-loading {
|
.app-loading {
|
||||||
|
|
@ -91,6 +91,30 @@
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.app-loading__title span {
|
||||||
|
display: inline-block;
|
||||||
|
animation: wave 1.6s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes wave {
|
||||||
|
0% {
|
||||||
|
transform: translateY(0);
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
30% {
|
||||||
|
transform: translateY(-10px);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
60% {
|
||||||
|
transform: translateY(-3px);
|
||||||
|
opacity: 0.85;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: translateY(0);
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.dark .app-loading {
|
.dark .app-loading {
|
||||||
background: #222225;
|
background: #222225;
|
||||||
}
|
}
|
||||||
|
|
@ -177,6 +201,16 @@
|
||||||
document.getElementById('versionCheck-type').innerHTML = getBrowerInfo().type;
|
document.getElementById('versionCheck-type').innerHTML = getBrowerInfo().type;
|
||||||
document.getElementById('versionCheck-version').innerHTML = getBrowerInfo().version;
|
document.getElementById('versionCheck-version').innerHTML = getBrowerInfo().version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const text = `%VITE_APP_TITLE%`
|
||||||
|
const container = document.querySelector('.app-loading__title')
|
||||||
|
text.split('').forEach((char, index) => {
|
||||||
|
const span = document.createElement('span')
|
||||||
|
span.innerText = char
|
||||||
|
// 控制每个字的延迟,形成依次跳动
|
||||||
|
span.style.animationDelay = `${index * 0.16}s`
|
||||||
|
container.appendChild(span)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<script type="module" src="/src/main.ts"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,7 @@ const props = defineProps({
|
||||||
pageSize: {type: Number, default: config.pageSize},
|
pageSize: {type: Number, default: config.pageSize},
|
||||||
pageSizes: {type: Array, default: config.pageSizes},
|
pageSizes: {type: Array, default: config.pageSizes},
|
||||||
rowKey: {type: String, default: ""},
|
rowKey: {type: String, default: ""},
|
||||||
|
primaryKey: {type: String, default: "id"},
|
||||||
summaryMethod: {type: Function, default: null},
|
summaryMethod: {type: Function, default: null},
|
||||||
column: {
|
column: {
|
||||||
type: Object, default: () => {
|
type: Object, default: () => {
|
||||||
|
|
@ -271,13 +272,13 @@ async function getData() {
|
||||||
emptyText.value = response.msg;
|
emptyText.value = response.msg;
|
||||||
} else {
|
} else {
|
||||||
emptyText.value = "暂无数据";
|
emptyText.value = "暂无数据";
|
||||||
if (props.hidePagination) {
|
|
||||||
tableData.value = response.data || [];
|
tableData.value = response.data || [];
|
||||||
} else {
|
|
||||||
tableData.value = response.rows || [];
|
|
||||||
}
|
|
||||||
if (props.rowKey) {
|
if (props.rowKey) {
|
||||||
tableData.value = tools.makeTreeData(tableData.value, 0, props.rowKey)
|
tableData.value = tools.makeTreeData(tableData.value, 0, props.primaryKey, props.rowKey)
|
||||||
|
// 适配搜索显示
|
||||||
|
if (response.data.length > 0 && tableData.value.length === 0) {
|
||||||
|
tableData.value = response.data
|
||||||
|
}
|
||||||
}
|
}
|
||||||
total.value = response.total || 0;
|
total.value = response.total || 0;
|
||||||
summary.value = response.summary || {};
|
summary.value = response.summary || {};
|
||||||
|
|
@ -465,7 +466,6 @@ function toggleRowSelection(row, selected) {
|
||||||
piTableRef.value.toggleRowSelection(row, selected)
|
piTableRef.value.toggleRowSelection(row, selected)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function toggleAllSelection() {
|
function toggleAllSelection() {
|
||||||
piTableRef.value.toggleAllSelection()
|
piTableRef.value.toggleAllSelection()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ export default {
|
||||||
parseData: function (res) { //数据分析
|
parseData: function (res) { //数据分析
|
||||||
return {
|
return {
|
||||||
data: res.data, //分析无分页的数据字段结构
|
data: res.data, //分析无分页的数据字段结构
|
||||||
rows: res.data, //分析行数据字段结构
|
|
||||||
total: res.count, //分析总数字段结构
|
total: res.count, //分析总数字段结构
|
||||||
summary: res.summary, //分析合计行字段结构
|
summary: res.summary, //分析合计行字段结构
|
||||||
msg: res.msg, //分析描述字段结构
|
msg: res.msg, //分析描述字段结构
|
||||||
|
|
@ -28,11 +27,11 @@ export default {
|
||||||
*/
|
*/
|
||||||
columnSettingSave: function (tableName, column) {
|
columnSettingSave: function (tableName, column) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
//这里为了演示使用了session和setTimeout演示,开发时应用数据请求
|
//这里为了演示使用了session和setTimeout演示,开发时应用数据请求
|
||||||
tools.data.set(tableName, column)
|
tools.data.set(tableName, column)
|
||||||
resolve(true)
|
resolve(true)
|
||||||
},1000)
|
}, 1000)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
@ -44,9 +43,9 @@ export default {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
//这里为了演示使用了session和setTimeout演示,开发时应用数据请求
|
//这里为了演示使用了session和setTimeout演示,开发时应用数据请求
|
||||||
const userColumn = tools.data.get(tableName)
|
const userColumn = tools.data.get(tableName)
|
||||||
if(userColumn){
|
if (userColumn) {
|
||||||
resolve(userColumn)
|
resolve(userColumn)
|
||||||
}else{
|
} else {
|
||||||
resolve(column)
|
resolve(column)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -59,10 +58,10 @@ export default {
|
||||||
columnSettingReset: function (tableName, column) {
|
columnSettingReset: function (tableName, column) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
//这里为了演示使用了session和setTimeout演示,开发时应用数据请求
|
//这里为了演示使用了session和setTimeout演示,开发时应用数据请求
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
tools.data.remove(tableName)
|
tools.data.remove(tableName)
|
||||||
resolve(column)
|
resolve(column)
|
||||||
},1000)
|
}, 1000)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ const tools = {
|
||||||
}
|
}
|
||||||
return fmt;
|
return fmt;
|
||||||
},
|
},
|
||||||
makeTreeData: function (data, pid = 0, key = "id", parent = "pid") {
|
makeTreeData: function (data, pid = 0, key = "id", parent = "parent_id") {
|
||||||
const arr = [];
|
const arr = [];
|
||||||
for (let item of data) {
|
for (let item of data) {
|
||||||
if (item[parent] == pid) {
|
if (item[parent] == pid) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue