123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <template>
- <view class="content" v-if="list.length>0">
- <view class="info">
- <scroll-view scroll-y="true" class="scroll-view">
- <view class="list-scroll-view">
- <view class="list" v-for="(item, index) in list" :key="index">
- <view v-for="(i, indexs) in fields" :key="indexs">
- <view class="name textOver" v-if="i.is_name">{{item[i.model]||'暂无'}}</view>
- <view class="other" v-else>
- <view class="status textOne" v-if="i.is_status">
- <text>{{i.label}}:</text>{{item[i.model]||'暂无'}}
- </view>
- <view class="other_1 textOne" v-else>
- <text>{{i.label}}:</text>{{item[i.model]||'暂无'}}
- </view>
- </view>
- </view>
- <view class="button">
- <button class="primary" size="mini" type="primary" @tap.stop="toView(item)">查看</button>
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- <view class="total">
- <uni-pagination :current="page" :pageSize="pageSize" :total="total" @change="toPage" />
- </view>
- </view>
- </template>
- <script>
- export default {
- props: {
- fields: {
- type: Array,
- },
- list: {
- type: Array,
- default: []
- },
- page: {
- type: Number,
- default: 1
- },
- total: {
- type: Number,
- default: 0
- },
- pageSize: {
- type: Number,
- default: 5
- }
- },
- data() {
- return {
- };
- },
- methods: {
- // 分页
- toPage(e) {
- const that = this;
- const page = e.current - 1;
- const skip = page * that.pageSize;
- that.$emit('toPage', {
- page: e.current,
- skip: skip
- })
- },
- // 文件预览
- toView(item) {
- const that = this;
- that.$emit('toView', item)
- }
- }
- }
- </script>
- <style lang="scss">
- .content {
- margin: 2vw 0 0 0;
- display: flex;
- flex-direction: column;
- box-sizing: border-box;
- width: 100vw;
- height: 90vh;
- .info {
- position: relative;
- flex-grow: 1;
- .list {
- background-color: var(--mainColor);
- border: 1px solid var(--f5Color);
- padding: 2vw;
- margin: 0 2vw 2vw 2vw;
- border-radius: 5px;
- .name {
- font-size: var(--font14Size);
- font-weight: bold;
- }
- .other {
- font-size: var(--font12Size);
- color: var(--f85Color);
- .other_1 {
- margin: 1vw 0 0 0;
- }
- }
- .status {
- margin: 1vw 0 0 0;
- font-size: var(--font12Size);
- color: var(--fF0Color);
- }
- .button {
- margin: 1vw 0 0 0;
- text-align: center;
- .primary {
- background: var(--f3CColor);
- }
- button {
- margin: 0 1vw 0 0;
- }
- }
- }
- }
- .total {
- overflow: hidden;
- background-color: var(--fffColor);
- padding: 2vw;
- border-top: 1px solid var(--f1Color);
- }
- }
- .scroll-view {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- .list-scroll-view {
- display: flex;
- flex-direction: column;
- }
- }
- </style>
|