Merge remote-tracking branch 'origin/build' into build
This commit is contained in:
@@ -30,6 +30,18 @@
|
||||
:limitArea="data.limitArea === '1'"
|
||||
:is3dAround="data.is3dAround === '1'">
|
||||
</ai-q-map> -->
|
||||
<AiDvTable
|
||||
v-else-if="data.type === 'AiDvTable'"
|
||||
:heigth="'100%'"
|
||||
:stripe="data.stripe"
|
||||
:isShowIndex="data.isShowIndex"
|
||||
:data="values">
|
||||
</AiDvTable>
|
||||
<AiRanking
|
||||
v-else-if="data.type === 'AiRanking'"
|
||||
:heigth="'100%'"
|
||||
:data="values">
|
||||
</AiRanking>
|
||||
<ai-map v-else-if="data.type=='map'" :mask="data.mask === '1'" :areaId="data.areaId" :is3d="data.is3d==1" :is3dAround="data.is3dAround === '1'"
|
||||
:map-style="`amap://styles/${data.mapStyle}`" :pulseLines="data.pulseLines==1" :map.sync="map" :lib.sync="lib" :onlyShowArea="data.limitArea==1"/>
|
||||
<ai-monitor :src="data.src" v-else-if="data.type === 'monitor'" :type="data.monitorType"/>
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
zIndex: item.zIndex,
|
||||
transform: `scale(${scale})`
|
||||
}"
|
||||
v-for="(item, index) in componentList"
|
||||
:key="index">
|
||||
v-for="(item, index) in componentList"
|
||||
:key="index">
|
||||
<ai-dv-render :instance="instance" :data="item" :index="index" :theme="dashboard.theme"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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>
|
||||
200
components/layout/AiDvTable/AiDvTable.vue
Normal file
200
components/layout/AiDvTable/AiDvTable.vue
Normal file
@@ -0,0 +1,200 @@
|
||||
<template>
|
||||
<div class="aiDvTable">
|
||||
<div class="header">
|
||||
<span
|
||||
v-for="(item, index) in header"
|
||||
:key="index"
|
||||
:style="{
|
||||
width: item.width + 'px',
|
||||
textAlign: item.align,
|
||||
flex: item.width ? 'inherit' : 1
|
||||
}">
|
||||
{{ item.v }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="body">
|
||||
<div class="row" v-for="(item, index) in body" :class="[stripe === '1' ? 'stripe' : '']" :key="index">
|
||||
<div
|
||||
v-for="(column, i) in item"
|
||||
:key="i"
|
||||
:style="{
|
||||
color: column.color,
|
||||
textAlign: column.align,
|
||||
width: column.width + 'px',
|
||||
flex: column.width ? 'inherit' : 1
|
||||
}">
|
||||
<i v-if="isShowIndex === '1' && i === 0">{{ index + 1 }}</i>
|
||||
<span>{{ column.v }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'AiDvTable',
|
||||
|
||||
props: {
|
||||
data: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
|
||||
isShowIndex: {
|
||||
type: String,
|
||||
default: '0'
|
||||
},
|
||||
|
||||
stripe: {
|
||||
type: String,
|
||||
default: '1'
|
||||
}
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
header: [],
|
||||
body: [],
|
||||
colorIndex: ''
|
||||
}
|
||||
},
|
||||
|
||||
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 => {
|
||||
return v !== headerKey && v !== 'color' && v !== 'width'
|
||||
})
|
||||
|
||||
this.header = value.map(v => {
|
||||
return {
|
||||
v: v[headerKey],
|
||||
align: v.align,
|
||||
width: Number(v.width || 0) ? (Number(v.width || 0) + (this.isShowIndex === '1' ? 0 : 0)) : ''
|
||||
}
|
||||
})
|
||||
|
||||
this.body = bodyKey.map(v => {
|
||||
return value.map(e => {
|
||||
return {
|
||||
v: e[v],
|
||||
color: e.color,
|
||||
align: e.align,
|
||||
width: e.width || ''
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.aiDvTable {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
padding: 0 20px;
|
||||
background: rgba(70, 70, 70, 0.35);
|
||||
|
||||
span {
|
||||
flex: 1;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow:ellipsis;
|
||||
|
||||
&:first-child {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.body {
|
||||
height: calc(100% - 40px);
|
||||
padding: 10px 0;
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
.row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 52px;
|
||||
padding: 0 20px;
|
||||
box-sizing: border-box;
|
||||
|
||||
&.stripe:nth-of-type(2n) {
|
||||
background: rgba(48, 48, 48, 0.4);
|
||||
}
|
||||
|
||||
div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow:ellipsis;
|
||||
|
||||
span {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow:ellipsis;
|
||||
}
|
||||
|
||||
i {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
margin-right: 10px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color: #18FEFE;
|
||||
font-style: normal;
|
||||
background: url(./asset/rankbg.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
justify-content: start;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
BIN
components/layout/AiDvTable/asset/rankbg.png
Normal file
BIN
components/layout/AiDvTable/asset/rankbg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 284 B |
142
components/layout/AiRanking/AiRanking.vue
Normal file
142
components/layout/AiRanking/AiRanking.vue
Normal file
@@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<div class="AiRanking">
|
||||
<div class="AiRanking-item" v-for="(item, index) in list" :key="index">
|
||||
<i>{{ index + 1 }}</i>
|
||||
<h2>{{ item.name }}</h2>
|
||||
<span>{{ item.value }}</span>
|
||||
<div class="AiRanking-item__rate" :style="{width: item.rate + '%'}">
|
||||
<div class="bar">
|
||||
<span></span>
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'AiRanking',
|
||||
|
||||
props: {
|
||||
data: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
data: {
|
||||
handler (v) {
|
||||
this.init(v)
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
list: []
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
init (v) {
|
||||
if (!v.length) {
|
||||
this.list = []
|
||||
return false
|
||||
}
|
||||
|
||||
const total = this.sum(v.map(v => v.value))
|
||||
this.list = v.map(e => {
|
||||
return {
|
||||
...e,
|
||||
rate: ((Number(e.value) / total) * 100).toFixed(2)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
sum (arr) {
|
||||
return arr.reduce((x, y) => x + y)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AiRanking {
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.AiRanking-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 36px;
|
||||
margin-bottom: 16px;
|
||||
padding-right: 18px;
|
||||
background: url(./asset/ranking1.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
|
||||
.AiRanking-item__rate {
|
||||
position: relative;
|
||||
|
||||
.bar {
|
||||
position: relative;
|
||||
width: calc(100% - 6px);
|
||||
height: 6px;
|
||||
background: linear-gradient(90deg, #ffbb45ff 0%, #76f7b8ff 98%);
|
||||
|
||||
i {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 50%;
|
||||
z-index: 12;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border: 1px solid #596269;
|
||||
border-radius: 50%;
|
||||
transform: translate(50%, -50%);
|
||||
}
|
||||
|
||||
span {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 50%;
|
||||
z-index: 11;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
background: #e1ffee;
|
||||
box-shadow: 0 0 10px 0 #26F0F7;
|
||||
transform: translate(50%, -50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
i {
|
||||
width: 40px;
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
h2 {
|
||||
width: 90px;
|
||||
margin-left: 20px;
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
span {
|
||||
width: 90px;
|
||||
text-align: left;
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
BIN
components/layout/AiRanking/asset/ranking1.png
Normal file
BIN
components/layout/AiRanking/asset/ranking1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
BIN
components/layout/AiRanking/asset/ranking2.png
Normal file
BIN
components/layout/AiRanking/asset/ranking2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
BIN
components/layout/AiRanking/asset/ranking3.png
Normal file
BIN
components/layout/AiRanking/asset/ranking3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
BIN
components/layout/AiRanking/asset/ranking4.png
Normal file
BIN
components/layout/AiRanking/asset/ranking4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -224,7 +224,7 @@ export default {
|
||||
this.instance.post(this.options.api).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data.length) {
|
||||
if (this.options.type === 'table') {
|
||||
if (this.options.type === 'table' || this.options.type === 'AiDvTable') {
|
||||
const keys = Object.keys(res.data[0])
|
||||
const list = res.data
|
||||
this.options.apiData = keys.map(v => {
|
||||
@@ -286,7 +286,7 @@ export default {
|
||||
this.instance.post(`/app/appdiylargescreen/statisticsByLsid?id=${e}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data.length) {
|
||||
if (this.options.type === 'table') {
|
||||
if (this.options.type === 'table' || this.options.type === 'AiDvTable') {
|
||||
const keys = Object.keys(res.data[0])
|
||||
const list = res.data
|
||||
this.options.dynamicData = keys.map(v => {
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="config.type === 'table'">
|
||||
<template v-if="config.type === 'table' || config.type === 'AiDvTable'">
|
||||
<div class="layout-config__item">
|
||||
<label>显示排名</label>
|
||||
<div class="layout-config__item--right">
|
||||
@@ -78,6 +78,21 @@
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layout-config__item" v-if="config.type === 'AiDvTable'">
|
||||
<label>斑马纹</label>
|
||||
<div class="layout-config__item--right">
|
||||
<el-select size="mini" v-model="config.stripe" placeholder="请选择" clearable>
|
||||
<el-option
|
||||
label="是"
|
||||
value="1">
|
||||
</el-option>
|
||||
<el-option
|
||||
label="否"
|
||||
value="0">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layout-config__item">
|
||||
<label>表格行数</label>
|
||||
<div class="layout-config__item--right">
|
||||
@@ -166,8 +181,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
borderList: ['border0', 'border1', 'border2', 'border3', 'border4', 'border5'],//边框待选项
|
||||
summaryList: ['summary0', 'summary1', 'summary2', 'summary3', 'summary4', 'summary6', 'summary5', 'summary7', 'summary8', 'summary9', 'summary10', 'summary11'],//汇总待选项
|
||||
borderList: ['border0', 'border1', 'border2', 'border3', 'border4', 'border5', 'border6'],//边框待选项
|
||||
summaryList: ['summary0', 'summary1', 'summary2', 'summary3', 'summary4', 'summary6', 'summary5', 'summary7', 'summary8', 'summary9', 'summary10', 'summary11', 'summary12'],//汇总待选项
|
||||
//是否显示排名
|
||||
tableStatus: [
|
||||
{label: '是', value: '1'},
|
||||
|
||||
@@ -51,5 +51,23 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.preview {
|
||||
::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-corner {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
min-height: 20px;
|
||||
background-clip: content-box;
|
||||
box-shadow: 0 0 0 5px rgba(116, 148, 170, 0.5) inset;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
box-shadow: 1px 1px 5px rgba(116, 148, 170, 0.5) inset;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -488,6 +488,56 @@ const components = [
|
||||
{name: '列2', v: 12, v2: 4},
|
||||
{name: '列2', v: 12, v2: 4}
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'AiDvTable',
|
||||
label: '新版表格',
|
||||
title: '新版表格',
|
||||
border: 'border6',
|
||||
width: 650,
|
||||
height: 400,
|
||||
zIndex: 1,
|
||||
thumb: 'https://cdn.cunwuyun.cn/dvcp/dv/tpl/table.png',
|
||||
dataX: '',
|
||||
dataY: [],
|
||||
rowNum: 7,
|
||||
stripe: '1',
|
||||
isShowIndex: '1',
|
||||
sourceDataId: '',
|
||||
api: '',
|
||||
apiData: [],
|
||||
dataType: 'staticData',
|
||||
dynamicData: [],
|
||||
staticData: [
|
||||
{name: '列1', v: 23, v2: 3},
|
||||
{name: '列2', v: 12, v2: 4},
|
||||
{name: '列2', v: 12, v2: 4}
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'AiRanking',
|
||||
label: '排行榜',
|
||||
title: '排行榜',
|
||||
border: 'border6',
|
||||
width: 523,
|
||||
height: 400,
|
||||
zIndex: 1,
|
||||
thumb: 'https://cdn.cunwuyun.cn/dvcp/dv/tpl/table.png',
|
||||
dataX: '',
|
||||
dataY: [],
|
||||
rowNum: 7,
|
||||
stripe: '1',
|
||||
isShowIndex: '1',
|
||||
sourceDataId: '',
|
||||
api: '',
|
||||
apiData: [],
|
||||
dataType: 'staticData',
|
||||
dynamicData: [],
|
||||
staticData: [
|
||||
{ name: '列1', value: 23 },
|
||||
{ name: '列2', value: 12 },
|
||||
{ name: '列2', value: 12 }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user