大屏组件开发
This commit is contained in:
		@@ -17,10 +17,11 @@ import Border2 from "./borders/border2";
 | 
			
		||||
import Border3 from "./borders/border3";
 | 
			
		||||
import Border4 from "./borders/border4";
 | 
			
		||||
import Border5 from "./borders/border5";
 | 
			
		||||
import border6 from "./borders/border6";
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: "AiDvPanel",
 | 
			
		||||
  components: { Border0, Border1, Border2, Border3, Border4, Border5 },
 | 
			
		||||
  components: { Border0, Border1, Border2, Border3, Border4, Border5, border6 },
 | 
			
		||||
  props: {
 | 
			
		||||
    title: {default: "请传入标题"},
 | 
			
		||||
    border: {default: "border0"}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								components/layout/AiDvPanel/asset/title6.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								components/layout/AiDvPanel/asset/title6.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 3.2 KiB  | 
							
								
								
									
										53
									
								
								components/layout/AiDvPanel/borders/border6.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								components/layout/AiDvPanel/borders/border6.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,53 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <section class="border6">
 | 
			
		||||
    <h2>{{ title }}</h2>
 | 
			
		||||
    <div class="slot">
 | 
			
		||||
      <slot/>
 | 
			
		||||
    </div>
 | 
			
		||||
  </section>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'border6',
 | 
			
		||||
  props: {
 | 
			
		||||
    title: String
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.border6 {
 | 
			
		||||
  height: 100%;
 | 
			
		||||
 | 
			
		||||
  h2 {
 | 
			
		||||
    position: relative;
 | 
			
		||||
    height: 40px;
 | 
			
		||||
    line-height: 26px;
 | 
			
		||||
    padding: 4px 0 0 22px;
 | 
			
		||||
    color: #fff;
 | 
			
		||||
    font-size: 22px;
 | 
			
		||||
    background-image: url(../asset/title6.png);
 | 
			
		||||
    background-position: bottom;
 | 
			
		||||
    background-size: 100% 7px;
 | 
			
		||||
    background-repeat: no-repeat;
 | 
			
		||||
 | 
			
		||||
    &:after {
 | 
			
		||||
      position: absolute;
 | 
			
		||||
      top: 16px;
 | 
			
		||||
      left: 0;
 | 
			
		||||
      z-index: 1;
 | 
			
		||||
      width: 6px;
 | 
			
		||||
      height: 6px;
 | 
			
		||||
      border-radius: 50%;
 | 
			
		||||
      background: #52575aff;
 | 
			
		||||
      content: '';
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  .slot {
 | 
			
		||||
    height: calc(100% - 40px);
 | 
			
		||||
    padding-top: 19px;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -17,6 +17,7 @@
 | 
			
		||||
  import Summary9 from './components/Summary9'
 | 
			
		||||
  import Summary10 from './components/Summary10'
 | 
			
		||||
  import Summary11 from './components/Summary11'
 | 
			
		||||
  import Summary12 from './components/Summary12'
 | 
			
		||||
 | 
			
		||||
  export default {
 | 
			
		||||
    name: 'AiDvSummary',
 | 
			
		||||
@@ -33,7 +34,8 @@
 | 
			
		||||
      Summary8,
 | 
			
		||||
      Summary9,
 | 
			
		||||
      Summary10,
 | 
			
		||||
      Summary11
 | 
			
		||||
      Summary11,
 | 
			
		||||
      Summary12
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    props: {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										76
									
								
								components/layout/AiDvSummary/components/Summary12.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								components/layout/AiDvSummary/components/Summary12.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,76 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="summary12">
 | 
			
		||||
    <div class="summary12-item" v-for="(item, index) in data" :key="index" v-if="index < 4">
 | 
			
		||||
      <h2>{{ item[keys] }}</h2>
 | 
			
		||||
      <p>{{ item[value] }}</p>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
  export default {
 | 
			
		||||
    name: 'summary6',
 | 
			
		||||
 | 
			
		||||
    props: {
 | 
			
		||||
      data: {
 | 
			
		||||
        type: Array,
 | 
			
		||||
        default: () => []
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      keys: {
 | 
			
		||||
        type: String,
 | 
			
		||||
        default: 'key'
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      value: {
 | 
			
		||||
        type: String,
 | 
			
		||||
        default: 'value'
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    data () {
 | 
			
		||||
      return {
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    methods: {
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
  .summary12 {
 | 
			
		||||
    display: flex;
 | 
			
		||||
    flex-wrap: wrap;
 | 
			
		||||
    justify-content: space-between;
 | 
			
		||||
    align-items: center;
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    height: 100%;
 | 
			
		||||
 | 
			
		||||
    div {
 | 
			
		||||
      box-sizing: border-box;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .summary12-item {
 | 
			
		||||
      display: flex;
 | 
			
		||||
      flex-direction: column;
 | 
			
		||||
      justify-content: center;
 | 
			
		||||
      text-align: left;
 | 
			
		||||
 | 
			
		||||
      h2 {
 | 
			
		||||
        line-height: 20px;
 | 
			
		||||
        margin-bottom: 12px;
 | 
			
		||||
        color: #C4D8DB;
 | 
			
		||||
        font-size: 16px;
 | 
			
		||||
        font-weight: normal;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      p {
 | 
			
		||||
        font-size: 44px;
 | 
			
		||||
        color: #02FEFF;
 | 
			
		||||
        font-weight: 700;
 | 
			
		||||
        text-align: left;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										117
									
								
								components/layout/AiDvTable/AiDvTable.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										117
									
								
								components/layout/AiDvTable/AiDvTable.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,117 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="aiDvTable">
 | 
			
		||||
    <div class="header">
 | 
			
		||||
      <span v-for="(item, index) in header" :key="index">{{ item }}</span>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="body">
 | 
			
		||||
      <div class="row" v-for="(item, index) in body" :key="index">
 | 
			
		||||
        <span v-for="(column, i) in item" :key="i">{{ column }}</span>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
  export default {
 | 
			
		||||
    name: 'AiDvTable',
 | 
			
		||||
 | 
			
		||||
    props: {
 | 
			
		||||
      data: {
 | 
			
		||||
        type: Array,
 | 
			
		||||
        default: () => []
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    data () {
 | 
			
		||||
      return {
 | 
			
		||||
        header: [],
 | 
			
		||||
        body: []
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    watch: {
 | 
			
		||||
      data: {
 | 
			
		||||
        handler (v) {
 | 
			
		||||
          this.init(v)
 | 
			
		||||
        },
 | 
			
		||||
        deep: true,
 | 
			
		||||
        immediate: true
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    mounted () {
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    methods: {
 | 
			
		||||
      init (value) {
 | 
			
		||||
        if (!value.length) {
 | 
			
		||||
          this.header = []
 | 
			
		||||
          this.body = []
 | 
			
		||||
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const headerKey = Object.keys(value[0])[0]
 | 
			
		||||
        const bodyKey = Object.keys(value[0]).filter(v => v !== headerKey)
 | 
			
		||||
        this.header = this.data.map(v => v[headerKey])
 | 
			
		||||
        this.body = bodyKey.map(v => {
 | 
			
		||||
          return value.map(e => e[v])
 | 
			
		||||
        })
 | 
			
		||||
        console.log(this.body)
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
  .aiDvTable {
 | 
			
		||||
    .header {
 | 
			
		||||
      display: flex;
 | 
			
		||||
      align-items: center;
 | 
			
		||||
      width: 100%;
 | 
			
		||||
      height: 40px;
 | 
			
		||||
      padding: 0 20px;
 | 
			
		||||
      background: #252525;
 | 
			
		||||
 | 
			
		||||
      span {
 | 
			
		||||
        flex: 1;
 | 
			
		||||
        font-size: 16px;
 | 
			
		||||
        text-align: center;
 | 
			
		||||
        color: #bfc0bb;
 | 
			
		||||
        overflow: hidden;
 | 
			
		||||
        white-space: nowrap;
 | 
			
		||||
        text-overflow: ellipsis;
 | 
			
		||||
        -o-text-overflow:ellipsis;
 | 
			
		||||
 | 
			
		||||
        &:first-child {
 | 
			
		||||
          text-align: left;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .body {
 | 
			
		||||
      padding: 10px;
 | 
			
		||||
      .row {
 | 
			
		||||
        display: flex;
 | 
			
		||||
        align-items: center;
 | 
			
		||||
        width: 100%;
 | 
			
		||||
        height: 52px;
 | 
			
		||||
 | 
			
		||||
        span {
 | 
			
		||||
          flex: 1;
 | 
			
		||||
          font-size: 16px;
 | 
			
		||||
          text-align: center;
 | 
			
		||||
          color: #ffffff;
 | 
			
		||||
          overflow: hidden;
 | 
			
		||||
          white-space: nowrap;
 | 
			
		||||
          text-overflow: ellipsis;
 | 
			
		||||
          -o-text-overflow:ellipsis;
 | 
			
		||||
 | 
			
		||||
          &:first-child {
 | 
			
		||||
            text-align: left;
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
</style>
 | 
			
		||||
		Reference in New Issue
	
	Block a user