123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <template>
- <view class="processWrapper exportBody ">
- <view style="height:98rpx"></view>
- <view class="ding">
- <!-- <calendar></calendar> -->
- <view class="example-body">
- <uni-datetime-picker v-model="datetimerange" type="datetimerange" start-placeholder="请选择开始时间"
- end-placeholder="请选择结束时间" start="2000-3-20 12:00:00" end="2021-10-20 20:00:00" rangeSeparator="至" />
- </view>
- </view>
- <block>
- <view class="processList">
- <view class="cu-list menu-avatar">
- <view class="cu-item" v-for="(item,index) in getExportData" :key="index">
- <view class="cu-avatar lg">
-
- <image class="image-bg" :src="item.clzt==0?'/static/process-icon.png':'/static/processed-icon.png'"/>
- <!-- <image class="image-bg"
- :src="item.device_state=='离线'?'/static/device-icon.png':'/static/device-icon.png'" /> -->
- </view>
- <view class="content">
- <view class="pro-title">
- <view class="cut" >{{item.owner_name}}</view>
-
- </view>
- <view class="pro-des ">
- <view class="text-cut">{{item.unitinfo}}</view>
- </view>
- <view class="pro-date ">{{item.time}}</view>
- </view>
- <view class="action" style="z-index:99">
- <view class="unProcess" v-if="item.clzt==0">未处理</view>
- <view class="processed" v-else>已处理</view>
-
- <!-- <view :class="item.device_state=='离线'?'':'processed'">{{item.device_state}}</view> -->
-
- </view>
- </view>
- <view class=" text-center margin-top" v-if="!this.getExportData.length&&this.dataRes">暂无数据...</view>
- </view>
- </view>
- </block>
- <view v-if="this.getExportData.length>0" class="padding-lr padding-bottom-lg bg-white" style="position:fixed;bottom:0;width:100%">
- <view class="btn-area">
- <button class="bg-blue round missReport margin-top" @tap="exportButton()">导 出 </button>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- getExportData: [],
- dataRes: 0,
- datetimerange: ['', ''],
- keyWords:'',
- type:0
- };
- },
- onLoad: function(option) {
- this.type=option.type
- this.getData({
- "company_code": uni.getStorageSync('selectedCode'),
- "type":this.type,
- "start_time": '',
- "end_time": '',
- })
- },
- watch: {
- datetimerange(newval) {
- this.getData({
- "company_code": uni.getStorageSync('selectedCode'),
- "type":this.type,
- "start_time":newval[0],
- "end_time": newval[1],
- })
- }
- },
-
- methods: {
- async getData(params = {}) {
- const res = await this.$myRequest({
- url: 'ComprehensiveAlarm/getIntegratedAlarmList', //综合告警列表渲染
- data: params,
- showLoading: true
- })
- this.getExportData = res.data.data;
- this.dataRes = 1;
- },
- exportButton() {
- //#ifdef H5
- let exportUrl = this.$BASE_URL+
- `ExportModule/getIntegratedAlarmListExpor/start_time/${this.datetimerange[0]}/end_time/${this.datetimerange[1]}/type/${this.type}/company_code/${uni.getStorageSync('selectedCode')}/`
- var ua = window.navigator.userAgent.toLowerCase();
- if (ua.match(/MicroMessenger/i) == 'micromessenger') {
- uni.showModal({
- showCancel: false,
- content: '如需下载,请在默认浏览器中操作',
- success: function(res) {
- window.location.href = exportUrl;
- }
- });
- } else {
- window.location.href = exportUrl;
- }
- //#endif
- }
- }
- }
- </script>
- <style lang="scss">
- </style>
|