chore: update layout component's style to solve the problem of style dislocation at mobile device; 🐶

master
iczer 5 years ago
parent db25716d9d
commit 6208acc477
  1. 37
      src/components/page/PageHeader.vue
  2. 11
      src/components/tool/AStepItem.vue
  3. 6
      src/components/tool/HeadInfo.vue
  4. 4
      src/layouts/PageView.vue
  5. 3
      src/pages/dashboard/workplace/WorkPlace.vue
  6. 61
      src/pages/detail/AdvancedDetail.vue
  7. 10
      src/pages/list/StandardList.vue

@ -10,15 +10,16 @@
</a-breadcrumb> </a-breadcrumb>
</div> </div>
<div class="detail"> <div class="detail">
<div v-if="avatar" class="avatar"><a-avatar :src="avatar" /></div>
<div class="main"> <div class="main">
<div class="row"> <div class="row">
<img v-if="logo" :src="logo" class="logo" />
<h1 v-if="title" class="title">{{title}}</h1> <h1 v-if="title" class="title">{{title}}</h1>
<div class="action"><slot name="action"></slot></div> <div class="action"><slot name="action"></slot></div>
</div> </div>
<div class="row"> <div class="row">
<div v-if="this.$slots.content" class="content"><slot name="content"></slot></div> <div v-if="this.$slots.content" class="content">
<div v-if="avatar" class="avatar"><a-avatar :src="avatar" :size="72" /></div>
<slot name="content"></slot>
</div>
<div v-if="this.$slots.extra" class="extra"><slot name="extra"></slot></div> <div v-if="this.$slots.extra" class="extra"><slot name="extra"></slot></div>
</div> </div>
</div> </div>
@ -82,45 +83,25 @@ export default {
display: flex; display: flex;
.row { .row {
display: flex; display: flex;
flex-wrap: wrap;
justify-content: space-between;
} }
.avatar { .avatar {
flex: 0 1 72px; margin:0 24px 0 0;
margin:0 24px 8px 0;
& > span {
border-radius: 72px;
display: block;
width: 72px;
height: 72px;
}
} }
.main{ .main{
width: 100%; width: 100%;
.title{ .title{
flex: auto;
font-size: 20px; font-size: 20px;
font-weight: 500;
color: rgba(0,0,0,.85); color: rgba(0,0,0,.85);
margin-bottom: 16px; margin-bottom: 16px;
} }
.logo{
width: 28px;
height: 28px;
border-radius: 4px;
margin-right: 16px;
}
.content{ .content{
flex: 1; display: flex;
flex-wrap: wrap;
} }
.extra{ .extra{
display: flex; display: flex;
margin-left: 88px;
min-width: 420px;
}
.action{
margin-left: 56px;
min-width: 266px;
flex: 0 1 auto;
text-align: right;
} }
} }
} }

@ -12,10 +12,19 @@
<script> <script>
const Group = { const Group = {
name: 'AStepItemGroup', name: 'AStepItemGroup',
props: {
align: {
type: String,
default: 'center',
validator(value) {
return ['left', 'center', 'right'].indexOf(value) != -1
}
}
},
render (h) { render (h) {
return h( return h(
'div', 'div',
{attrs: {style: 'text-align: center; margin-top: 8px'}}, {attrs: {style: `text-align: ${this.align}; margin-top: 8px`}},
[h('div', {attrs: {style: 'text-align: left; display: inline-block;'}}, [this.$slots.default])] [h('div', {attrs: {style: 'text-align: left; display: inline-block;'}}, [this.$slots.default])]
) )
} }

@ -15,8 +15,10 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.head-info{ .head-info{
text-align: center; text-align: center;
padding: 0 32px; padding: 0 24px;
width: 100%; flex-grow: 1;
flex-shrink: 0;
align-self: center;
span{ span{
color: rgba(0,0,0,.45); color: rgba(0,0,0,.45);
display: inline-block; display: inline-block;

@ -1,6 +1,6 @@
<template> <template>
<page-layout :desc="desc" :title="title" :linkList="linkList"> <page-layout :desc="desc" :title="title" :linkList="linkList">
<div slot="extra" class="extraImg"> <div v-if="this.extraImage && !isMobile" slot="extra" class="extraImg">
<img :src="extraImage"/> <img :src="extraImage"/>
</div> </div>
<page-toggle-transition :animate="animate.name" :direction="animate.direction"> <page-toggle-transition :animate="animate.name" :direction="animate.direction">
@ -33,7 +33,7 @@ export default {
let key = this.path.substring(1).replace(new RegExp('/', 'g'), '.') + '.name' let key = this.path.substring(1).replace(new RegExp('/', 'g'), '.') + '.name'
return this.$t(key) return this.$t(key)
}, },
...mapState('setting', ['multiPage', 'animate', 'routesI18n']) ...mapState('setting', ['isMobile', 'multiPage', 'animate', 'routesI18n'])
}, },
created() { created() {
let i18n = this.routesI18n let i18n = this.routesI18n

@ -224,7 +224,4 @@ export default {
} }
} }
} }
.head-info{
display: inline-block;
}
</style> </style>

@ -1,6 +1,6 @@
<template> <template>
<page-layout title="单号:234231029431" logo="https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png"> <page-layout title="单号:234231029431" logo="https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png">
<detail-list size="small" :col="2" slot="headerContent" style="margin-left: 44px;"> <detail-list size="small" :col="2" slot="headerContent">
<detail-list-item term="创建人">曲丽丽</detail-list-item> <detail-list-item term="创建人">曲丽丽</detail-list-item>
<detail-list-item term="订购产品">XX服务</detail-list-item> <detail-list-item term="订购产品">XX服务</detail-list-item>
<detail-list-item term="创建时间">2018-08-07</detail-list-item> <detail-list-item term="创建时间">2018-08-07</detail-list-item>
@ -8,16 +8,10 @@
<detail-list-item term="生效日期">2018-08-07 ~ 2018-12-11</detail-list-item> <detail-list-item term="生效日期">2018-08-07 ~ 2018-12-11</detail-list-item>
<detail-list-item term="备注">请于两个工作日内确认</detail-list-item> <detail-list-item term="备注">请于两个工作日内确认</detail-list-item>
</detail-list> </detail-list>
<a-row style="text-align: right;width: 100%;" slot="extra"> <template slot="extra">
<a-col :xs="24" :sm="12"> <head-info title="状态" content="待审批" />
<div class="text">状态</div> <head-info title="订单金额" content="¥ 568.08" />
<div class="heading">待审批</div> </template>
</a-col>
<a-col :xs="24" :sm="12">
<div class="text">订单金额</div>
<div class="heading">¥ 568.08</div>
</a-col>
</a-row>
<template slot="action"> <template slot="action">
<a-button-group style="margin-right: 8px;"> <a-button-group style="margin-right: 8px;">
<a-button>操作</a-button> <a-button>操作</a-button>
@ -27,15 +21,15 @@
<a-button type="primary" >主操作</a-button> <a-button type="primary" >主操作</a-button>
</template> </template>
<a-card :bordered="false" title="流程进度"> <a-card :bordered="false" title="流程进度">
<a-steps :current="1" progressDot> <a-steps :current="1" progress-dot :direction="isMobile ? 'vertical' : 'horizontal'">
<a-step title="创建项目"> <a-step title="创建项目">
<a-step-item-group slot="description"> <a-step-item-group :align="isMobile ? 'left' : 'center'" slot="description">
<a-step-item link="/dashboard/workplace" title="曲丽丽" icon="dingding-o"/> <a-step-item link="/dashboard/workplace" title="曲丽丽" icon="dingding-o"/>
<a-step-item title="2016-12-12 12:32"/> <a-step-item title="2016-12-12 12:32"/>
</a-step-item-group> </a-step-item-group>
</a-step> </a-step>
<a-step title="部门初审"> <a-step title="部门初审">
<a-step-item-group slot="description"> <a-step-item-group :align="isMobile ? 'left' : 'center'" slot="description">
<a-step-item link="/form/step" title="周毛毛" icon="dingding-o" /> <a-step-item link="/form/step" title="周毛毛" icon="dingding-o" />
<a-step-item link="/result/success" title="催一下" icon="bell"/> <a-step-item link="/result/success" title="催一下" icon="bell"/>
</a-step-item-group> </a-step-item-group>
@ -89,7 +83,7 @@
</a-card> </a-card>
</a-card> </a-card>
<a-card style="margin-top: 24px" :bordered="false" title="用户近半年来电记录"> <a-card style="margin-top: 24px" :bordered="false" title="用户近半年来电记录">
<div class="nodata"><a-icon type="frown-o"/>暂无数据</div> <a-list></a-list>
</a-card> </a-card>
<a-card <a-card
style="margin-top: 24px" style="margin-top: 24px"
@ -121,10 +115,13 @@
</template> </template>
<script> <script>
import PageLayout from '../../layouts/PageLayout' import PageLayout from '@/layouts/PageLayout'
import DetailList from '../../components/tool/DetailList' import DetailList from '@/components/tool/DetailList'
import AStepItem from '../../components/tool/AStepItem' import AStepItem from '@/components/tool/AStepItem'
import {operation1, operation2, operation3, operationColumns} from '../../mock/common/tableData' import {operation1, operation2, operation3, operationColumns} from '@/mock/common/tableData'
import {mapState} from 'vuex'
import HeadInfo from '@/components/tool/HeadInfo';
const DetailListItem = DetailList.Item const DetailListItem = DetailList.Item
const AStepItemGroup = AStepItem.Group const AStepItemGroup = AStepItem.Group
@ -146,6 +143,7 @@ const tabList = [
export default { export default {
name: 'AdvancedDetail', name: 'AdvancedDetail',
components: {HeadInfo, AStepItemGroup, AStepItem, DetailListItem, DetailList, PageLayout},
data () { data () {
return { return {
tabList, tabList,
@ -156,35 +154,16 @@ export default {
activeTabKey: '2' activeTabKey: '2'
} }
}, },
computed: {
...mapState('setting', ['isMobile'])
},
methods: { methods: {
onTabChange (key) { onTabChange (key) {
console.log(key) console.log(key)
} }
}, },
components: {AStepItemGroup, AStepItem, DetailListItem, DetailList, PageLayout}
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.text{
color: rgba(0,0,0,.45);
}
.heading{
color: rgba(0,0,0,.85);
font-size: 28px;
}
.nodata{
color: rgba(0,0,0,.25);
text-align: center;
line-height: 64px;
font-size: 16px;
& :global{
i {
font-size: 24px;
margin-right: 16px;
position: relative;
top: 3px;
}
}
}
</style> </style>

@ -1,17 +1,11 @@
<template> <template>
<div> <div>
<a-card :bordered="false"> <a-card :bordered="false">
<a-row> <div style="display: flex; flex-wrap: wrap">
<a-col :sm="8" :xs="24" class="split-right">
<head-info title="我的待办" content="8个任务" :bordered="true"/> <head-info title="我的待办" content="8个任务" :bordered="true"/>
</a-col>
<a-col :sm="8" :xs="24" class="split-right">
<head-info title="本周任务平均处理时间" content="32分钟" :bordered="true"/> <head-info title="本周任务平均处理时间" content="32分钟" :bordered="true"/>
</a-col>
<a-col :sm="8" :xs="24" class="split-right">
<head-info title="本周完成任务数" content="24个"/> <head-info title="本周完成任务数" content="24个"/>
</a-col> </div>
</a-row>
</a-card> </a-card>
<a-card <a-card
style="margin-top: 24px" style="margin-top: 24px"

Loading…
Cancel
Save