大屏组件开发

This commit is contained in:
yanran200730
2023-03-08 15:45:56 +08:00
parent 0770065a43
commit 54bcd5979a
10 changed files with 281 additions and 7 deletions

View File

@@ -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 => {

View File

@@ -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">
@@ -166,8 +166,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'},

View File

@@ -488,6 +488,30 @@ 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,
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}
]
}
]
}