调整大屏展示内容
This commit is contained in:
56
components/AiDvDialog.vue
Normal file
56
components/AiDvDialog.vue
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<script>
|
||||||
|
import AiDrag from "./AiDrag.vue";
|
||||||
|
import AiDvSvg from "./layout/AiDvSvg/AiDvSvg.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AiDvDialog",
|
||||||
|
components: {AiDvSvg, AiDrag},
|
||||||
|
props: {
|
||||||
|
title: {default: "弹窗"},
|
||||||
|
tableData: {default: () => []},
|
||||||
|
columns: {type: [Array, Object]}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialog: false,
|
||||||
|
detail: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
colConfigs() {
|
||||||
|
let config = []
|
||||||
|
if (!Array.isArray(this.columns)) {
|
||||||
|
config = Object.entries(this.columns).map(([key, value]) => {
|
||||||
|
return {...value, prop: key}
|
||||||
|
})
|
||||||
|
} else config = this.columns
|
||||||
|
return config
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AiDvDialog">
|
||||||
|
<ai-drag v-if="dialog" :resizable="false">
|
||||||
|
<ai-dv-svg :title="title" @close="dialog=false">
|
||||||
|
<slot v-if="$slots.default"/>
|
||||||
|
<el-table v-else class="simple" :data="tableData">
|
||||||
|
<el-table-column v-for="item in colConfigs" :key="item.prop" :prop="item.prop" :label="item.label"/>
|
||||||
|
</el-table>
|
||||||
|
</ai-dv-svg>
|
||||||
|
</ai-drag>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
@import "dv";
|
||||||
|
|
||||||
|
.AiDvDialog {
|
||||||
|
position: fixed;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
z-index: 999;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
:theme="theme"
|
:theme="theme"
|
||||||
:isShowIndex="data.isShowIndex"
|
:isShowIndex="data.isShowIndex"
|
||||||
:config="dvTableConfig"
|
:config="dvTableConfig"
|
||||||
:data="values">
|
:data="values" :simple="data.simple==1">
|
||||||
</AiDvTable>
|
</AiDvTable>
|
||||||
<AiRanking
|
<AiRanking
|
||||||
v-else-if="currentType === 'AiRanking'"
|
v-else-if="currentType === 'AiRanking'"
|
||||||
|
|||||||
62
components/dv.scss
Normal file
62
components/dv.scss
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
:deep(.el-table.simple) {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #fff;
|
||||||
|
background-color: transparent !important;
|
||||||
|
|
||||||
|
.el-table__header {
|
||||||
|
background: rgba(33, 180, 253, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.el-table__row--striped td {
|
||||||
|
background: rgba(33, 180, 253, 0.1) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-table th.el-table__cell {
|
||||||
|
background: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-table__header tr th:first-child .cell {
|
||||||
|
padding-left: 20px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-table__header tr th.is-right .cell {
|
||||||
|
padding-right: 20px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-table__body tr td.is-right .cell {
|
||||||
|
padding-right: 20px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-table__body tr td:first-child .cell {
|
||||||
|
padding-left: 20px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
|
||||||
|
background-color: rgba(33, 180, 253, 0.1) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.el-table__cell, th.el-table__cell.is-leaf {
|
||||||
|
border-bottom: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
th.el-table__cell {
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr {
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-table__cell {
|
||||||
|
padding: 7px 0;
|
||||||
|
color: #d0e1e8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-table__header tr .cell {
|
||||||
|
color: #02FEFF !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,9 @@
|
|||||||
const w = 12, h = 10, r = 200
|
const w = 12, h = 10, r = 200
|
||||||
export default {
|
export default {
|
||||||
name: "AiDvSvg",
|
name: "AiDvSvg",
|
||||||
|
props: {
|
||||||
|
title: {default: "慧智会言"},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
border: "",
|
border: "",
|
||||||
@@ -18,7 +21,7 @@ export default {
|
|||||||
this.width = width
|
this.width = width
|
||||||
this.height = height
|
this.height = height
|
||||||
this.getBorder(width, height)
|
this.getBorder(width, height)
|
||||||
const vv = width - w, hh = height - h
|
const vv = width - w
|
||||||
this.box = {
|
this.box = {
|
||||||
top: `m${vv - r + 33},${13 + h}l7,0l-2.5,-3l-7,0l2.5,3zm-1.5,0l-4.5,-5.5l-7,0l4.5,5.5l7,0zm-21,-7l6,7l7,0l-6,-7l-7,0z`,
|
top: `m${vv - r + 33},${13 + h}l7,0l-2.5,-3l-7,0l2.5,3zm-1.5,0l-4.5,-5.5l-7,0l4.5,5.5l7,0zm-21,-7l6,7l7,0l-6,-7l-7,0z`,
|
||||||
leftBottom: `m46.5,${height + 10}l7,0l-2.5,-3l-7,0l2.5,3zm-1.5,0l-4.5,-5.5l-7,0l4.5,5.5l7,0zm-21,-7l6,7l7,0l-6,-7l-7,0z`,
|
leftBottom: `m46.5,${height + 10}l7,0l-2.5,-3l-7,0l2.5,3zm-1.5,0l-4.5,-5.5l-7,0l4.5,5.5l7,0zm-21,-7l6,7l7,0l-6,-7l-7,0z`,
|
||||||
@@ -96,7 +99,7 @@ export default {
|
|||||||
</svg>
|
</svg>
|
||||||
<div class="close" @click="$emit('close')"/>
|
<div class="close" @click="$emit('close')"/>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="header">慧智会言</div>
|
<div class="header" v-text="title"/>
|
||||||
<slot/>
|
<slot/>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="aiDvTable" :class="'aiDvTable-' + theme + ' aiDvTable-' + size">
|
<section class="AiDvTable">
|
||||||
|
<el-table v-if="simple" class="simple" :data="tableData">
|
||||||
|
<el-table-column v-for="item in columns" :key="item.prop" v-bind="item"/>
|
||||||
|
</el-table>
|
||||||
|
<div v-else class="aiDvTable" :class="'aiDvTable-' + theme + ' aiDvTable-' + size">
|
||||||
<div class="header" :style="headerStyle">
|
<div class="header" :style="headerStyle">
|
||||||
<span
|
<span
|
||||||
v-for="(item, index) in header"
|
v-for="(item, index) in header"
|
||||||
@@ -36,6 +40,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -70,7 +75,8 @@
|
|||||||
|
|
||||||
headerStyle: {
|
headerStyle: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {}
|
default: () => {
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
isShowIndex: {
|
isShowIndex: {
|
||||||
@@ -96,7 +102,8 @@
|
|||||||
size: {
|
size: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'small'
|
default: 'small'
|
||||||
}
|
},
|
||||||
|
simple: Boolean
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
@@ -105,7 +112,25 @@
|
|||||||
body: []
|
body: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
columns: v => v.header.map((e, i) => {
|
||||||
|
let item = {}
|
||||||
|
Object.values(e).forEach(label => {
|
||||||
|
const {align} = v.config[i]
|
||||||
|
item.align = align
|
||||||
|
item.prop = `col${i}`
|
||||||
|
item.label = label
|
||||||
|
})
|
||||||
|
return item
|
||||||
|
}),
|
||||||
|
tableData: v => v.body.map(arr => {
|
||||||
|
const item = {}
|
||||||
|
Object.values(arr).forEach((value, i) => {
|
||||||
|
item[`col${i}`] = value
|
||||||
|
})
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
data: {
|
data: {
|
||||||
handler(v) {
|
handler(v) {
|
||||||
@@ -115,10 +140,6 @@
|
|||||||
immediate: true
|
immediate: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted () {
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
init(value) {
|
init(value) {
|
||||||
if (!value.length) {
|
if (!value.length) {
|
||||||
@@ -148,12 +169,14 @@
|
|||||||
if (config.click && typeof config.click === 'function') {
|
if (config.click && typeof config.click === 'function') {
|
||||||
return config.click.call(this, e)
|
return config.click.call(this, e)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@import "../../dv";
|
||||||
|
|
||||||
.aiDvTable {
|
.aiDvTable {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -206,6 +229,7 @@
|
|||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -289,6 +313,7 @@
|
|||||||
::-webkit-scrollbar-track {
|
::-webkit-scrollbar-track {
|
||||||
box-shadow: 1px 1px 5px rgba(50, 181, 108, 0.5) inset;
|
box-shadow: 1px 1px 5px rgba(50, 181, 108, 0.5) inset;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
background: rgba(226, 121, 81, 0.2);
|
background: rgba(226, 121, 81, 0.2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,6 +103,15 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</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.simple" placeholder="请选择" clearable>
|
||||||
|
<el-option label="是" value="1"/>
|
||||||
|
<el-option label="否" value="0"/>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="layout-config__item" v-if="config.type !== 'AiDvTable'">
|
<div class="layout-config__item" v-if="config.type !== 'AiDvTable'">
|
||||||
<label>表格行数</label>
|
<label>表格行数</label>
|
||||||
<div class="layout-config__item--right">
|
<div class="layout-config__item--right">
|
||||||
@@ -207,12 +216,25 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="layout-right__content--wrapper">
|
||||||
|
<div class="layout-config__group">
|
||||||
|
<h2>进阶设置</h2>
|
||||||
|
<config-item label="设置弹窗">
|
||||||
|
<config-item label="标题">
|
||||||
|
<!-- <el-input v-model="config.dialog.title" clearable/>-->
|
||||||
|
</config-item>
|
||||||
|
</config-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import ConfigItem from "./configItem.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'componentConfig',
|
name: 'componentConfig',
|
||||||
|
components: {ConfigItem},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
config: {default: () => ({})},
|
config: {default: () => ({})},
|
||||||
|
|||||||
@@ -426,8 +426,9 @@ const components = [{
|
|||||||
}]
|
}]
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
type: 'table', label: '表格', list: [{
|
label: '表格', list: [
|
||||||
label: '表格', type: 'table', list: [{
|
{
|
||||||
|
label: '单表格', list: [{
|
||||||
type: 'table',
|
type: 'table',
|
||||||
label: '表格',
|
label: '表格',
|
||||||
title: '表格',
|
title: '表格',
|
||||||
@@ -495,7 +496,8 @@ const components = [{
|
|||||||
dynamicData: [],
|
dynamicData: [],
|
||||||
staticData: [{name: '列1', value: 23}, {name: '列2', value: 12}, {name: '列2', value: 12}]
|
staticData: [{name: '列1', value: 23}, {name: '列2', value: 12}, {name: '列2', value: 12}]
|
||||||
}]
|
}]
|
||||||
}]
|
},
|
||||||
|
]
|
||||||
}, {
|
}, {
|
||||||
type: 'ai3d', label: "3D", list: [{
|
type: 'ai3d', label: "3D", list: [{
|
||||||
label: "3D楼栋", type: 'building', list: [{
|
label: "3D楼栋", type: 'building', list: [{
|
||||||
|
|||||||
Reference in New Issue
Block a user