dev
This commit is contained in:
parent
29c0ff6585
commit
dd3337ca3e
|
|
@ -30,16 +30,16 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Mask :is-show="loading" :width="300" height="150" title="上传数据" :close="false">
|
<Mask :is-show="loading" :width="300" height="150" title="上传数据" :close="false">
|
||||||
{{uploadMsg}}
|
{{ uploadMsg }}
|
||||||
<div class="demo-progress" style="margin-top: 20px">
|
<div class="demo-progress" style="margin-top: 20px">
|
||||||
<el-progress :percentage="uploadNumber" />
|
<el-progress :percentage="uploadNumber"/>
|
||||||
</div>
|
</div>
|
||||||
</Mask>
|
</Mask>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref, onMounted} from 'vue';
|
import {ref, onMounted} from 'vue';
|
||||||
import {type TabsPaneContext} from 'element-plus'
|
import {ElMessage, type TabsPaneContext} from 'element-plus'
|
||||||
import List_3501 from "@/components/social/inventoryUp/List_3501.vue";
|
import List_3501 from "@/components/social/inventoryUp/List_3501.vue";
|
||||||
import List_3502 from "@/components/social/inventoryUp/List_3502.vue";
|
import List_3502 from "@/components/social/inventoryUp/List_3502.vue";
|
||||||
import List_3503 from "@/components/social/inventoryUp/List_3503.vue";
|
import List_3503 from "@/components/social/inventoryUp/List_3503.vue";
|
||||||
|
|
@ -57,15 +57,16 @@ const tabs = ref([
|
||||||
let tableData: any = ref([])
|
let tableData: any = ref([])
|
||||||
let content: any = ref(null);
|
let content: any = ref(null);
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
let uploadMsg= ref('')
|
let uploadMsg = ref('')
|
||||||
const uploadNumber=ref()
|
const uploadNumber = ref()
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
init()
|
init()
|
||||||
});
|
});
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
post("social/upload/getNotDoNumber",).then((res: any) => {
|
post("social/upload/getNotDoNumber",).then((res: any) => {
|
||||||
tabs.value.forEach((tab: any) => {
|
tabs.value.forEach((tab: any) => {
|
||||||
tab.notDoNumber = res['number'+tab.name]
|
tab.notDoNumber = res['number' + tab.name]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -73,33 +74,36 @@ function init() {
|
||||||
let change_tab = (tab: TabsPaneContext, event: Event) => {
|
let change_tab = (tab: TabsPaneContext, event: Event) => {
|
||||||
console.log(current_tab.value)
|
console.log(current_tab.value)
|
||||||
}
|
}
|
||||||
let totalNumber=0;
|
let totalNumber = 0;
|
||||||
// 一键上传
|
// 一键上传
|
||||||
let startUpload = () => {
|
let startUpload = () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
uploadMsg.value="正在初始化上传";
|
uploadMsg.value = "正在初始化上传";
|
||||||
post("social/upload/getNotDoNumber",).then((res: any) => {
|
post("social/upload/getNotDoNumber", {catch_error: true}).then((res: any) => {
|
||||||
totalNumber = res.totalNumber;
|
totalNumber = res.totalNumber;
|
||||||
uploadMsg.value="正在初始化上传,总条数"+totalNumber;
|
uploadMsg.value = "正在初始化上传,总条数" + totalNumber;
|
||||||
console.log(uploadMsg)
|
|
||||||
upload_data()
|
upload_data()
|
||||||
|
}).catch((e: any) => {
|
||||||
|
loading.value = false
|
||||||
|
ElMessage.error(e)
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
let upload_data = () => {
|
let upload_data = () => {
|
||||||
post("social/upload/quickUpload",{},{catch_error: true}).then((res: any) => {
|
post("social/upload/quickUpload", {}, {catch_error: true}).then((res: any) => {
|
||||||
if (res.totalNumber >0) {
|
if (res.totalNumber > 0) {
|
||||||
upload_data()
|
upload_data()
|
||||||
uploadMsg.value="正在上传,进度:"+(totalNumber-res.totalNumber)+"/"+totalNumber;
|
uploadMsg.value = "正在上传,进度:" + (totalNumber - res.totalNumber) + "/" + totalNumber;
|
||||||
uploadNumber.value=Math.round((totalNumber-res.totalNumber)/totalNumber*100)
|
uploadNumber.value = Math.round((totalNumber - res.totalNumber) / totalNumber * 100)
|
||||||
}else{
|
} else {
|
||||||
uploadMsg.value=""
|
uploadMsg.value = ""
|
||||||
loading.value = false
|
loading.value = false
|
||||||
init()
|
init()
|
||||||
}
|
}
|
||||||
}).catch(
|
}).catch(
|
||||||
(err: any) => {
|
(err: any) => {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
ElMessage.error(err)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -118,6 +122,7 @@ let upload_data = () => {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue