Commit 702d0c87 by zhangquan

车系弹窗添加loading

1 parent a0b3ab93
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
:close-on-click-modal="false" :close-on-click-modal="false"
@onOk="handleConfirm" @onOk="handleConfirm"
@onCancel="handleClose"> @onCancel="handleClose">
<div class="car-container"> <div v-if="loading" class="loading-wrap">
<img class="loading-img" :src="url" alt="">
</div>
<div class="car-container" v-else>
<div class="wrap"> <div class="wrap">
<div class="item son-brand-wrap" v-for="(item, index) in carSeriesData" :key="item.id"> <div class="item son-brand-wrap" v-for="(item, index) in carSeriesData" :key="item.id">
<el-checkbox v-if="!singleChoice" :disabled="!(item.childs && item.childs.length)" :indeterminate="isIndeterminate(item, 1)" :value="isChecked(item, 1)" @change="changeBrandStatus($event, item, index)"></el-checkbox> <el-checkbox v-if="!singleChoice" :disabled="!(item.childs && item.childs.length)" :indeterminate="isIndeterminate(item, 1)" :value="isChecked(item, 1)" @change="changeBrandStatus($event, item, index)"></el-checkbox>
...@@ -33,11 +36,13 @@ ...@@ -33,11 +36,13 @@
</template> </template>
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/loading.png'
export default { export default {
name: 'selectStore', name: 'selectStore',
data() { data() {
return { return {
url,
loading: true,
carSeriesData: [], carSeriesData: [],
sonBrandList: [], sonBrandList: [],
carSeriesList: [], carSeriesList: [],
...@@ -160,7 +165,6 @@ ...@@ -160,7 +165,6 @@
}else{ }else{
this.$set(this.selectdData, rootId , {[parentId]: [{rootId, rootName, parentId, parentName, id: row.id, name: row.name}]}) this.$set(this.selectdData, rootId , {[parentId]: [{rootId, rootName, parentId, parentName, id: row.id, name: row.name}]})
} }
console.log(this.selectdData)
}, },
showSonBrandList(row){ showSonBrandList(row){
if(row.id == this.curBrandInfo.id) return if(row.id == this.curBrandInfo.id) return
...@@ -209,10 +213,11 @@ ...@@ -209,10 +213,11 @@
// 获取数据源 // 获取数据源
getCarSeriesData() { getCarSeriesData() {
this.$apis.case.getCarSeriesApi({needCarSeries:true}).then(res => { this.$apis.case.getCarSeriesApi({needCarSeries:true}).then(res => {
console.log(res)
if(res?.length){ if(res?.length){
this.carSeriesData = res this.carSeriesData = res
} }
}).finally(end =>{
this.loading = false
}) })
}, },
handleConfirm(){ handleConfirm(){
...@@ -227,6 +232,27 @@ ...@@ -227,6 +232,27 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.loading-wrap{
height: 200px;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
.loading-img{
width: 50px;
height: 50px;
animation: loading 2s linear infinite;
}
@keyframes loading {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
}
.car-container{ .car-container{
border: 1px solid #E8E8EA; border: 1px solid #E8E8EA;
height: 476px; height: 476px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!