123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- <template>
- <view class="uni-container uni-container-bg">
- <!-- 卡片栏 -->
- <view v-if="tableData.length>0 && isLoaded">
- <view v-for="(item, index) in tableData" :key="index">
- <uni-card>
- <!-- 标题 -->
- <view class="titles">{{ item.jmzzqmc }}</view>
- <!-- 简要内容 -->
- <view class="duanluo">
- <text class="name-align-files">消防安全管理人:</text>
- <text class="conts">{{ item.xfaqglr }}</text>
- </view>
- <view class="duanluo">
- <text class="name-align-files">联系电话:</text>
- <text class="conts">{{ item.lxdh }}</text>
- </view>
- <view class="duanluo">
- <text class="name-align-files">居民人数:</text>
- <text class="conts">{{ item.jmrs }}</text>
- </view>
- <view style="margin-top: 60rpx;">
- <view class="an-niu" @click.native="showModal(item)">
- <view class="detailDel">删除</view>
- </view>
- <view class="an-niu" @click.native="onClick(item)" link><text class="detail">查看详情</text></view>
-
- </view>
- </uni-card>
- </view>
- </view>
- <!-- tableData为空时显示 -->
- <view v-else-if="tableData.length==0 && isLoaded" style="text-align: center;">
- <view class="text-gray" style="padding-top: 20px;" v-if="tableData == 0">
- <img :src="tan90" alt="暂无数据" />
- </view>
- </view>
- <view>
- <image :src="Group" @click="addClick" class="tiantupian"></image>
- </view>
- <u-modal :show="show" @confirm="confirm" @cancel="cancel" @close="close" asyncClose closeOnClickOverlay
- showCancelButton confirmColor="red" :title="title" :content="content" ref="uModal"></u-modal>
- <!-- 加载中 -->
- <isLodingModel></isLodingModel>
- </view>
- </template>
- <script>
- var that = '';
- import {
- getArchive, //获取培训演练信息列表
- delArchive, //删除培训演练信息
- } from '@/api/archive/index1.js';
- import config from '@/config'
- const baseUrlImg = config.baseUrlImg
- export default {
- data() {
- return {
- isLoaded: false,
- Group: `${baseUrlImg}/checkActive/Group.png`,
- showOrg: false,
- actions: [],
- // 数据
- tableData: {},
- title: '是否删除该数据项?',
- content: '确认删除?',
- id: '',
- tan90: `${baseUrlImg}/tan90.png`,
- // 每页数据量
- pageSize: 5,
- // 当前页
- pageNo: 1,
- // 数据总量
- total: 0,
- // tableData数据加载中
- loading: false,
- // 初始化时搜索框的值
- keyword: '',
- // 存放orgid,orgname
- formData: {
- orgName: ''
- },
- show: false,
- showtimeStart: false,
- showtimeEnd: false
- };
- },
- // 在 vue页面,向起始页通过事件传递数据
- watch: {
- loading: {
- handler(newLength, oldLength) {
- this.$modal.isLoadingModel(this.loading)
- },
- immediate: true
- }
- },
- onLoad: function(option) {},
- onShow() {
- this.tableData = []
- this.getData();
- },
- onReady() {},
- mixins: [uni.$u.mixin],
- methods: {
- // 模态框内容
- showModal(val) {
- this.show = true;
- this.id = val.id;
- },
- confirm() {
- this.show = false;
- delArchive({
- id: this.id
- }).then(response => {
- this.loading = true;
- this.isLoaded = false
- this.tableData = []
- this.getData();
- });
- },
- close() {
- this.show = false;
- },
- cancel() {
- this.show = false;
- },
- // 获取数据
- getData() {
- this.loading = true;
- const value = uni.getStorageSync('getUserInfo_key');
- // 获取培训演练信息详细信息
- getArchive({
- pageNo: this.pageNo,
- pageSize: this.pageSize,
- streetId: value.streetInfo ? value.streetInfo.id : ''
- }).then(response => {
- this.isLoaded = true
- this.tableData = [...this.tableData, ...response.data.list]
- this.loading = false
- // this.tableData = response.data.list;
- });
- },
- // 传递数据
- onClick(val) {
- this.isLoaded = false
- uni.navigateTo({
- url: '/pagesA/fire/archive/archive_details/archive_details1?id=' + val.id,
- events: {
- // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
- acceptDataFromOpenedPage: function(val) {
- }
- },
- success: function(res) {
- // 通过eventChannel向被打开页面传送数据
- res.eventChannel.emit('acceptDataFromOpenerPage', val);
- }
- });
- },
- addClick() {
- this.isLoaded = false
- uni.navigateTo({
- url: '/pagesA/fire/archive/add_archive/add_archive1'
- });
- },
- // 触底的事件
- onReachBottom() {
- // 判断是否还有下一页数据
- if (this.pageNo * this.pageSize >= this.total)
- return uni.showToast({
- title: `数据加载完毕`
- });
- // 判断是否正在请求其它数据,如果是,则不发起额外的请求
- if (this.loading) return;
- this.pageNo += 1;
- this.getData(this.pageNo);
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- body {
- background-color: #f5f7f9;
- }
- page {
- background-color: #f5f7f9;
- }
- /deep/ .u-tabs__wrapper[data-v-0de61367],
- /deep/.u-tabs__wrapper.data-v-0de61367,
- /deep/.u-tabs__wrapper {
- width: 99%;
- }
- /deep/.u-tabs__wrapper__nav__item[data-v-0de61367],
- /deep/.u-tabs__wrapper__nav__item.data-v-0de61367,
- /deep/.u-tabs__wrapper__nav__item {
- padding: 0 60rpx;
- }
- .uni-container {
- height: 100vh;
- padding-right: 20upx;
- }
- .addInsp {
- width: 40px;
- position: fixed;
- right: 4px;
- z-index: 99999;
- }
- ::v-deep .u-icon__icon {
- margin-right: 0px !important;
- }
- .an-niu {
- float: right;
- font-size: 10px;
- text-align: center;
- display: flex;
- margin-top: -64upx;
- padding-bottom: 30rpx;
- // margin-top: 50rpx;
- color: #fff;
- .detail {
- width: 60px;
- height: 60rpx;
- padding: 0 20rpx;
- border-radius: 30px;
- background-color: #f7c41e;
- margin-right: 20rpx;
- text-align: center;
- line-height: 60rpx;
- font-size: 27upx;
- }
- .detailDel {
- width: 60px;
- height: 60rpx;
- padding: 0 20rpx;
- border-radius: 30px;
- background-color: #ff2e31;
- color: white;
- margin-right: 20rpx;
- text-align: center;
- line-height: 60rpx;
- font-size: 30upx;
- }
- .solve {
- width: 62px;
- height: 60rpx;
- margin-right: 20rpx;
- border-radius: 30px;
- background-color: #4cb2b6;
- line-height: 60rpx;
- }
- /deep/ .padding-tb-sm {
- padding-top: 0px;
- padding-bottom: 10px;
- }
- .deletes {
- width: 62px;
- height: 60rpx;
- border-radius: 60rpx;
- background-color: red;
- color: #fff;
- line-height: 60rpx;
- }
- }
- /deep/.segmented-control__item--button {
- background-color: rgb(76, 178, 182) !important;
- }
- /deep/.segmented-control__item--button--active {
- background-color: #ffffff !important;
- }
- /deep/.uni-card {
- box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
- border-radius: 30rpx;
- }
- .tiantupian {
- width: 110rpx;
- height: 110rpx;
- position: fixed;
- right: 15px;
- bottom: 80rpx;
- }
- //列表样式
- .titles {
- font-weight: 600;
- margin-bottom: 10rpx;
- color: #1E293B;
- font-size: 30rpx;
- }
- .conts {
- max-width: 470rpx;
- display: -webkit-box;
- /*弹性伸缩盒子模型显示*/
- -webkit-box-orient: vertical;
- /*排列方式*/
- -webkit-line-clamp: 1;
- /*显示文本行数*/
- overflow: hidden;
- /*溢出隐藏*/
- color: #274647;
- text-overflow: ellipsis;
- /*不知道干嘛的*/
- .conts-title {
- margin-right: 10rpx;
- color: #728f90;
- }
- }
- .max-width {
- max-width: 180upx;
- }
- .duanluo {
- display: flex;
- margin-bottom: 20rpx;
- color: #728f90;
- }
- </style>
|