feat(P4): precompute移植+app.js sources双向回填+回归1003/1003+验收体积/文件/data.json
Deploy to GitHub Pages / deploy (push) Failing after 16s
Regression / regression (push) Failing after 15m2s

This commit is contained in:
aurora-admin
2026-09-12 14:18:41 +08:00
parent 16f365a045
commit c65a69c34e
401 changed files with 22932 additions and 140 deletions
+56
View File
@@ -0,0 +1,56 @@
<template>
<div class="aa-upload">
<div class="aa-upload-drop" :class="{ 'is-over': over }" @click="$refs.file.click()" @dragover.prevent="over = true" @dragleave="over = false" @drop.prevent="onDrop">
<span class="aa-upload-icon">⬆️</span>
<div class="aa-upload-hint">将文件拖到此处,或 <b>点击选择</b></div>
</div>
<input ref="file" type="file" multiple style="display:none" @change="onChange" />
<div class="aa-upload-list">
<div v-for="it in files" :key="it.id" class="aa-upload-item">
<div class="aa-upload-thumb"><img v-if="it.thumb" :src="it.thumb" /><span v-else>文件</span></div>
<div class="aa-upload-meta">
<div class="aa-upload-name">{{ it.name }}</div>
<div class="aa-upload-bar"><i :style="{ width: it.progress + '%' }"></i></div>
</div>
<div class="aa-upload-status">{{ it.done ? '已完成' : Math.round(it.progress) + '%' }}</div>
<button class="aa-upload-del" @click="remove(it.id)">×</button>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'AaDragUpload',
data() {
return { files: [], over: false };
},
methods: {
addFiles(flist) {
var self = this;
Array.prototype.forEach.call(flist, function (f) {
var id = 'f' + Date.now() + Math.random().toString(36).slice(2, 6);
var item = { id: id, name: f.name, progress: 0, done: false, thumb: '' };
if (/^image\//.test(f.type) && f.size < 2 * 1024 * 1024) {
var reader = new FileReader();
reader.onload = function (e) { item.thumb = e.target.result; };
reader.readAsDataURL(f);
}
self.files.push(item);
self.simulate(item);
});
},
onChange(e) { this.addFiles(e.target.files); e.target.value = ''; },
onDrop(e) { this.over = false; this.addFiles(e.dataTransfer.files); },
simulate(item) {
var t = setInterval(function () {
item.progress = Math.min(100, item.progress + Math.random() * 22);
if (item.progress >= 100) { item.progress = 100; item.done = true; clearInterval(t); }
}, 220);
},
remove(id) { this.files = this.files.filter(function (x) { return x.id !== id; }); }
}
};
</script>
<style src="./DragUpload.css"></style>