Merge pull request '1' (#128) from pc-master into portal

Reviewed-on: #128
portal
xiaomeng 2024-03-06 07:31:35 +00:00
commit ed746c51dd
2 changed files with 23 additions and 0 deletions

View File

@ -90,6 +90,12 @@ export default {
this.dateRange = [start, end] this.dateRange = [start, end]
}, },
dataInit() { dataInit() {
this.loading = this.$loading({
lock: true,
text: '加载中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
if (this.active == 0) { if (this.active == 0) {
this.timeInit() this.timeInit()
} else if (this.active == 1) { } else if (this.active == 1) {
@ -129,6 +135,7 @@ export default {
isEquipment: store.equipmentList[index - 1].deviceName == 30 ? 1 : 0 isEquipment: store.equipmentList[index - 1].deviceName == 30 ? 1 : 0
} }
this.api.selFsTime(data).then(res => { this.api.selFsTime(data).then(res => {
this.loading.close()
if (res.data.code == 200) { if (res.data.code == 200) {
var chartsData = res.data.data.data.map(item => { var chartsData = res.data.data.data.map(item => {
return { return {

View File

@ -59,6 +59,7 @@
</div> </div>
</template> </template>
<script> <script>
import { Loading } from 'element-ui';
export default { export default {
data() { data() {
return { return {
@ -69,6 +70,7 @@ export default {
pageSize: 10, pageSize: 10,
tableList: [], tableList: [],
total: 0, total: 0,
loading:null,
} }
}, },
watch: { watch: {
@ -102,6 +104,12 @@ export default {
return formattedTime return formattedTime
}, },
dataInit() { dataInit() {
this.loading = this.$loading({
lock: true,
text: '加载中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
if (this.active == 0) { if (this.active == 0) {
this.timeInit() this.timeInit()
} else if (this.active == 1) { } else if (this.active == 1) {
@ -114,6 +122,12 @@ export default {
}, 0); }, 0);
}, },
download() { download() {
this.loading = this.$loading({
lock: true,
text: '加载中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
var store = this.$store.state var store = this.$store.state
var index = store.equipmentIndex; var index = store.equipmentIndex;
var data = { var data = {
@ -126,6 +140,7 @@ export default {
} }
this.api.loadHistorydata(data).then(res => { this.api.loadHistorydata(data).then(res => {
// blob // blob
this.loading.close()
const blob = new Blob([res.data], { type: 'text/csv' }); const blob = new Blob([res.data], { type: 'text/csv' });
// a // a
@ -157,6 +172,7 @@ export default {
isEquipment: store.equipmentList[index - 1].deviceName == 30 ? 1 : 0 isEquipment: store.equipmentList[index - 1].deviceName == 30 ? 1 : 0
} }
this.api.selFsTime(data).then(res => { this.api.selFsTime(data).then(res => {
this.loading.close()
if (res.data.code == 200) { if (res.data.code == 200) {
this.tableList = [] this.tableList = []
this.tableData = [] this.tableData = []