Merge remote-tracking branch 'origin/master'

main
liu.shiyi 2 years ago
commit e8fabb324c

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.gccloud</groupId> <groupId>com.gccloud</groupId>
<artifactId>dataroom</artifactId> <artifactId>dataroom</artifactId>
<version>1.0.1.2023071901.Alpha</version> <version>1.0.1.2023072001.Alpha</version>
</parent> </parent>
<artifactId>dataroom-core</artifactId> <artifactId>dataroom-core</artifactId>
@ -18,7 +18,7 @@
</properties> </properties>
<dependencies> <dependencies>
<!-- 数据集插件 --> <!-- 数据集插件 开源地址https://github.com/gcpaas/dataset -->
<dependency> <dependency>
<groupId>com.gccloud</groupId> <groupId>com.gccloud</groupId>
<artifactId>dataset-core</artifactId> <artifactId>dataset-core</artifactId>

@ -0,0 +1,47 @@
package com.gccloud.dataroom.core.module.manage.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gccloud.dataroom.core.module.basic.entity.PageEntity;
import com.gccloud.dataroom.core.module.manage.service.IDataRoomPageService;
import com.gccloud.dataset.extend.dataset.IDatasetExtendService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @author hongyang
* @version 1.0
* @date 2023/7/20 10:33
*/
@Order(101)
@Service("dataroomDatasetExtendService")
public class DatasetExtendServiceImpl implements IDatasetExtendService {
@Resource
private IDataRoomPageService pageService;
@Override
public String deleteCheck(String id) {
if (StringUtils.isBlank(id)) {
return null;
}
LambdaQueryWrapper<PageEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.select(PageEntity::getId, PageEntity::getName);
// "businessKey":"id",
queryWrapper.like(PageEntity::getConfig, "\"businessKey\":\"" + id + "\"");
queryWrapper.orderByDesc(PageEntity::getUpdateDate);
List<PageEntity> list = pageService.list(queryWrapper);
if (list == null || list.isEmpty()) {
return null;
}
String msg = "数据集已被以下大屏页面引用,无法删除:";
for (PageEntity page : list) {
msg += page.getName() + "、";
}
msg = msg.substring(0, msg.length() - 1);
return msg;
}
}

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.gccloud</groupId> <groupId>com.gccloud</groupId>
<artifactId>dataroom</artifactId> <artifactId>dataroom</artifactId>
<version>1.0.1.2023071901.Alpha</version> <version>1.0.1.2023072001.Alpha</version>
</parent> </parent>
<artifactId>dataroom-server</artifactId> <artifactId>dataroom-server</artifactId>
@ -22,7 +22,7 @@
<dependency> <dependency>
<groupId>com.gccloud</groupId> <groupId>com.gccloud</groupId>
<artifactId>dataroom-core</artifactId> <artifactId>dataroom-core</artifactId>
<version>1.0.1.2023071901.Alpha</version> <version>1.0.1.2023072001.Alpha</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>

@ -12,7 +12,7 @@
<groupId>com.gccloud</groupId> <groupId>com.gccloud</groupId>
<artifactId>dataroom</artifactId> <artifactId>dataroom</artifactId>
<version>1.0.1.2023071901.Alpha</version> <version>1.0.1.2023072001.Alpha</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<description>基于G2Plot、Echarts的大屏设计服务端具备设计、预览能力支持MySQL、Oracle、PostgreSQL、Groovy等数据集接入 <description>基于G2Plot、Echarts的大屏设计服务端具备设计、预览能力支持MySQL、Oracle、PostgreSQL、Groovy等数据集接入
@ -60,7 +60,7 @@
<clickhouse.version>0.3.2</clickhouse.version> <clickhouse.version>0.3.2</clickhouse.version>
<commons-io.version>2.2</commons-io.version> <commons-io.version>2.2</commons-io.version>
<okhttp3.version>4.9.1</okhttp3.version> <okhttp3.version>4.9.1</okhttp3.version>
<dataset.core.version>1.0.1.2023071901.Alpha</dataset.core.version> <dataset.core.version>1.0.1.2023072001.Alpha</dataset.core.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>

@ -368,5 +368,6 @@ GitHub.sublime-settings
lib lib
data-room-ui data-room-ui
dataRoomUi
bigScreen bigScreen
bigScreen.zip bigScreen.zip

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
{ {
"name": "@gcpaas/data-room-ui", "name": "@gcpaas/data-room-ui",
"version": "1.0.1-2023071901-Alpha", "version": "1.0.1-2023072003-Alpha",
"description": "自定义大屏", "description": "自定义大屏",
"author": "gcpaas", "author": "gcpaas",
"license": "MIT", "license": "MIT",
@ -53,6 +53,7 @@
"@amap/amap-jsapi-loader": "^1.0.1", "@amap/amap-jsapi-loader": "^1.0.1",
"@antv/g2plot": "2.4.0", "@antv/g2plot": "2.4.0",
"@jiaminghi/data-view": "2.10.0", "@jiaminghi/data-view": "2.10.0",
"@wjjj/utils": "^0.1.5",
"axios": "0.18.1", "axios": "0.18.1",
"babel-polyfill": "6.26.0", "babel-polyfill": "6.26.0",
"echarts": "^5.2.2", "echarts": "^5.2.2",

@ -15,7 +15,6 @@ import * as echarts from 'echarts'
import commonMixins from 'data-room-ui/js/mixins/commonMixins.js' import commonMixins from 'data-room-ui/js/mixins/commonMixins.js'
import paramsMixins from 'data-room-ui/js/mixins/paramsMixins' import paramsMixins from 'data-room-ui/js/mixins/paramsMixins'
import linkageMixins from 'data-room-ui/js/mixins/linkageMixins' import linkageMixins from 'data-room-ui/js/mixins/linkageMixins'
import { get } from 'data-room-ui/js/utils/http'
export default { export default {
name: 'MapCharts', name: 'MapCharts',
mixins: [paramsMixins, commonMixins, linkageMixins], mixins: [paramsMixins, commonMixins, linkageMixins],
@ -60,7 +59,7 @@ export default {
}, },
methods: { methods: {
chartInit () { chartInit () {
let config = this.config const config = this.config
// keycodelist // keycodelist
if (this.config.code === this.config.key || this.isPreview) { if (this.config.code === this.config.key || this.isPreview) {
// //
@ -255,20 +254,9 @@ export default {
} }
} }
const mapUrl = `${window.BS_CONFIG?.httpConfigs?.baseURL}/static/chinaMap/${config.customize.level}/${config.customize.dataMap}` const mapUrl = `${window.BS_CONFIG?.httpConfigs?.baseURL}/static/chinaMap/${config.customize.level}/${config.customize.dataMap}`
const map = await get(decodeURI(mapUrl), {}, true) const map = await this.$dataRoomAxios.get(decodeURI(mapUrl), {}, true)
echarts.registerMap(config.customize.scope, map) echarts.registerMap(config.customize.scope, map)
this.charts.setOption(option) this.charts.setOption(option)
// this.charts.on('click', (params) => {
// get(
// `${window.BS_CONFIG?.httpConfigs?.baseURL}/static/chinaMap/province/${params.name}.json`,
// {},
// true
// ).then((res) => {
// option.geo.map = params.name
// echarts.registerMap(params.name, res)
// this.charts.setOption(option, true)
// })
// })
} }
} }
} }

@ -227,7 +227,6 @@ import SettingTitle from 'data-room-ui/SettingTitle/index.vue'
import { chartSettingMixins } from 'data-room-ui/js/mixins/chartSettingMixins' import { chartSettingMixins } from 'data-room-ui/js/mixins/chartSettingMixins'
import ColorSelect from 'data-room-ui/ColorMultipleSelect/index.vue' import ColorSelect from 'data-room-ui/ColorMultipleSelect/index.vue'
import ColorPicker from 'data-room-ui/ColorPicker/index.vue' import ColorPicker from 'data-room-ui/ColorPicker/index.vue'
import { get } from 'data-room-ui/js/utils/http'
import PosWhSetting from 'data-room-ui/BigScreenDesign/RightSetting/PosWhSetting.vue' import PosWhSetting from 'data-room-ui/BigScreenDesign/RightSetting/PosWhSetting.vue'
export default { export default {
name: 'BarSetting', name: 'BarSetting',
@ -271,9 +270,7 @@ export default {
}, },
methods: { methods: {
getMapList () { getMapList () {
get( this.$dataRoomAxios.get(`${window.BS_CONFIG?.httpConfigs?.baseURL}/bigScreen/design/map/list/${this.config.customize.level}`).then((res) => {
`${window.BS_CONFIG?.httpConfigs?.baseURL}/bigScreen/design/map/list/${this.config.customize.level}`
).then((res) => {
this.mapList = res this.mapList = res
}) })
}, },

@ -66,6 +66,7 @@
> >
<el-date-picker <el-date-picker
v-model="config.endTime" v-model="config.endTime"
style="position: relative;"
popper-class="bs-el-date-picker" popper-class="bs-el-date-picker"
type="datetime" type="datetime"
align="left" align="left"

@ -1,37 +1,96 @@
<template> <template>
<el-dialog title="组件库" :visible.sync="dialogVisible" width="80%" :modal="true" :modal-append-to-body="false" <el-dialog
:appen-to-body="true" class="bs-dialog-wrap bs-el-dialog" @closed="close"> title="组件库"
:visible.sync="dialogVisible"
width="80%"
:modal="true"
:modal-append-to-body="false"
:appen-to-body="true"
class="bs-dialog-wrap bs-el-dialog"
@closed="close"
>
<div class="content"> <div class="content">
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane label="自定义组件" name="combination"> <el-tab-pane
label="自定义组件"
name="combination"
>
<div class="big-screen-list-wrap"> <div class="big-screen-list-wrap">
<div class="top-search-wrap"> <div class="top-search-wrap">
<el-input v-model="searchKey" class="bs-el-input" placeholder="请输入组件名称" prefix-icon="el-icon-search" <el-input
clearable @clear="reSearch" @keyup.enter.native="reSearch" /> v-model="searchKey"
<el-select v-model="code" class="bs-el-select" popper-class="bs-el-select" placeholder="请选择分组" clearable class="bs-el-input"
@change="reSearch"> placeholder="请输入组件名称"
<el-option v-for="item in options" :key="item.code" :label="item.name" :value="item.code" /> prefix-icon="el-icon-search"
clearable
@clear="reSearch"
@keyup.enter.native="reSearch"
/>
<el-select
v-model="code"
class="bs-el-select"
popper-class="bs-el-select"
placeholder="请选择分组"
clearable
@change="reSearch"
>
<el-option
v-for="item in options"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select> </el-select>
<el-button size="small" style="margin-right: 20px" type="primary" @click="reSearch"> <el-button
size="small"
style="margin-right: 20px"
type="primary"
@click="reSearch"
>
搜索 搜索
</el-button> </el-button>
</div> </div>
<div v-if="list.length !== 0" v-loading="loading" class="list-wrap bs-scrollbar" element-loading-text="" <div
v-if="list.length !== 0"
v-loading="loading"
class="list-wrap bs-scrollbar"
element-loading-text="加载中"
:style="{ :style="{
display: gridComputed ? 'grid' : 'flex', display: gridComputed ? 'grid' : 'flex',
justifyContent: gridComputed ? 'space-around' : 'flex-start' justifyContent: gridComputed ? 'space-around' : 'flex-start'
}"> }"
>
<!-- <div v-if="list.length !== 0"> --> <!-- <div v-if="list.length !== 0"> -->
<div v-for="screen in list" :key="screen.id" class="big-screen-card-wrap" :style="{ <div
width: gridComputed ? 'auto' : '290px' v-for="screen in list"
}" @click="chooseComponent(screen)"> :key="screen.id"
<div :class="focus.id == screen.id ? 'focus' : ''" class="big-screen-card-inner"> class="big-screen-card-wrap"
:style="{
width: gridComputed ? 'auto' : '290px'
}"
@click="chooseComponent(screen)"
>
<div
:class="focus.id == screen.id ? 'focus' : ''"
class="big-screen-card-inner"
>
<div class="big-screen-card-img"> <div class="big-screen-card-img">
<el-image :src="screen.coverPicture" fit="contain" style="width: 100%; height: 100%"> <el-image
<div slot="placeholder" class="image-slot"> :src="screen.coverPicture"
fit="contain"
style="width: 100%; height: 100%"
>
<div
slot="placeholder"
class="image-slot"
>
加载中··· 加载中···
</div> </div>
<div slot="error" class="image-slot" style="font-size: 20px"> <div
slot="error"
class="image-slot"
style="font-size: 20px"
>
<div class="error-img-text"> <div class="error-img-text">
{{ screen.name }} {{ screen.name }}
</div> </div>
@ -39,55 +98,122 @@
</el-image> </el-image>
</div> </div>
<div class="big-screen-bottom"> <div class="big-screen-bottom">
<div class="left-bigscreen-title" :title="screen.name"> <div
class="left-bigscreen-title"
:title="screen.name"
>
{{ screen.name }} {{ screen.name }}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div v-else class="empty"> <div
v-else
class="empty"
>
暂无数据 暂无数据
</div> </div>
<div class="footer-pagination-wrap"> <div class="footer-pagination-wrap">
<div class="bs-pagination"> <div class="bs-pagination">
<el-pagination class="bs-el-pagination" popper-class="bs-el-pagination" background <el-pagination
layout="total, prev, pager, next, sizes" :page-size="size" prev-text="上一页" next-text="下一页" class="bs-el-pagination"
:total="totalCount" :page-sizes="[10, 20, 50, 100]" :current-page="current" popper-class="bs-el-pagination"
@current-change="currentChangeHandle" @size-change="sizeChangeHandle" /> background
layout="total, prev, pager, next, sizes"
:page-size="size"
prev-text="上一页"
next-text="下一页"
:total="totalCount"
:page-sizes="[10, 20, 50, 100]"
:current-page="current"
@current-change="currentChangeHandle"
@size-change="sizeChangeHandle"
/>
</div> </div>
</div> </div>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="业务组件" name="bizComponent"> <el-tab-pane
label="业务组件"
name="bizComponent"
>
<div class="big-screen-list-wrap"> <div class="big-screen-list-wrap">
<div class="top-search-wrap"> <div class="top-search-wrap">
<el-input v-model="name" class="bs-el-input" placeholder="请输入组件名称" prefix-icon="el-icon-search" clearable <el-input
@clear="reSearch" @keyup.enter.native="reSearch" /> v-model="name"
<el-select v-model="code" class="bs-el-select" popper-class="bs-el-select" placeholder="请选择分组" clearable class="bs-el-input"
@change="reSearch"> placeholder="请输入组件名称"
<el-option v-for="item in options" :key="item.code" :label="item.name" :value="item.code" /> prefix-icon="el-icon-search"
clearable
@clear="reSearch"
@keyup.enter.native="reSearch"
/>
<el-select
v-model="code"
class="bs-el-select"
popper-class="bs-el-select"
placeholder="请选择分组"
clearable
@change="reSearch"
>
<el-option
v-for="item in options"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select> </el-select>
<el-button size="small" style="margin-right: 20px" type="primary" @click="reSearch"> <el-button
size="small"
style="margin-right: 20px"
type="primary"
@click="reSearch"
>
搜索 搜索
</el-button> </el-button>
</div> </div>
<div v-if="bizComponentList.length !== 0" v-loading="loading" class="list-wrap bs-scrollbar" <div
element-loading-text="加载中" :style="{ v-if="bizComponentList.length !== 0"
v-loading="loading"
class="list-wrap bs-scrollbar"
element-loading-text="加载中"
:style="{
display: bizFridComputed ? 'grid' : 'flex', display: bizFridComputed ? 'grid' : 'flex',
justifyContent: bizFridComputed ? 'space-around' : 'flex-start' justifyContent: bizFridComputed ? 'space-around' : 'flex-start'
}"> }"
>
<!-- <div v-if="list.length !== 0"> --> <!-- <div v-if="list.length !== 0"> -->
<div v-for="screen in bizComponentList" :key="screen.id" class="big-screen-card-wrap" :style="{ <div
width: bizFridComputed ? 'auto' : '290px' v-for="screen in bizComponentList"
}" @click="chooseComponent(screen)"> :key="screen.id"
<div :class="focus.id == screen.id ? 'focus' : ''" class="big-screen-card-inner"> class="big-screen-card-wrap"
:style="{
width: bizFridComputed ? 'auto' : '290px'
}"
@click="chooseComponent(screen)"
>
<div
:class="focus.id == screen.id ? 'focus' : ''"
class="big-screen-card-inner"
>
<div class="big-screen-card-img"> <div class="big-screen-card-img">
<el-image :src="screen.coverPicture" fit="contain" style="width: 100%; height: 100%"> <el-image
<div slot="placeholder" class="image-slot"> :src="screen.coverPicture"
fit="contain"
style="width: 100%; height: 100%"
>
<div
slot="placeholder"
class="image-slot"
>
加载中··· 加载中···
</div> </div>
<div slot="error" class="image-slot" style="font-size: 20px"> <div
slot="error"
class="image-slot"
style="font-size: 20px"
>
<div class="error-img-text"> <div class="error-img-text">
{{ screen.name }} {{ screen.name }}
</div> </div>
@ -95,71 +221,131 @@
</el-image> </el-image>
</div> </div>
<div class="big-screen-bottom"> <div class="big-screen-bottom">
<div class="left-bigscreen-title" :title="screen.name"> <div
class="left-bigscreen-title"
:title="screen.name"
>
{{ screen.name }} {{ screen.name }}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div v-else class="empty"> <div
v-else
class="empty"
>
暂无数据 暂无数据
</div> </div>
<div class="footer-pagination-wrap"> <div class="footer-pagination-wrap">
<div class="bs-pagination"> <div class="bs-pagination">
<el-pagination class="bs-el-pagination" popper-class="bs-el-pagination" background <el-pagination
layout="total, prev, pager, next, sizes" :page-size="size" prev-text="上一页" next-text="下一页" class="bs-el-pagination"
:total="totalCount" :page-sizes="[10, 20, 50, 100]" :current-page="current" popper-class="bs-el-pagination"
@current-change="currentChangeHandle" @size-change="sizeChangeHandle" /> background
layout="total, prev, pager, next, sizes"
:page-size="size"
prev-text="上一页"
next-text="下一页"
:total="totalCount"
:page-sizes="[10, 20, 50, 100]"
:current-page="current"
@current-change="currentChangeHandle"
@size-change="sizeChangeHandle"
/>
</div> </div>
</div> </div>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="系统组件" name="remote"> <el-tab-pane
label="系统组件"
name="remote"
>
<div class="big-screen-list-wrap"> <div class="big-screen-list-wrap">
<div v-if="remoteComponentlist.length !== 0" v-loading="loading" class="list-wrap bs-scrollbar" <div
element-loading-text="加载中" :style="{ v-if="remoteComponentlist.length !== 0"
v-loading="loading"
class="list-wrap bs-scrollbar"
element-loading-text="加载中"
:style="{
display: remoteComponentsGridComputed ? 'grid' : 'flex', display: remoteComponentsGridComputed ? 'grid' : 'flex',
justifyContent: remoteComponentsGridComputed ? 'space-around' : 'flex-start' justifyContent: remoteComponentsGridComputed ? 'space-around' : 'flex-start'
}"> }"
<div v-for="component in remoteComponentlist" :key="component.title" class="big-screen-card-wrap" :style="{ >
width: remoteComponentsGridComputed ? 'auto' : '290px' <div
}" @click="chooseComponent(component)"> v-for="component in remoteComponentlist"
<div :class="component.title == focus.title ? 'focus' : ''" class="big-screen-card-inner"> :key="component.title"
class="big-screen-card-wrap"
:style="{
width: remoteComponentsGridComputed ? 'auto' : '290px'
}"
@click="chooseComponent(component)"
>
<div
:class="component.title == focus.title ? 'focus' : ''"
class="big-screen-card-inner"
>
<div class="big-screen-card-img"> <div class="big-screen-card-img">
<el-image :src="component.img" fit="contain" style="width: 100%; height: 100%"> <el-image
<div slot="placeholder" class="image-slot"> :src="component.img"
fit="contain"
style="width: 100%; height: 100%"
>
<div
slot="placeholder"
class="image-slot"
>
加载中··· 加载中···
</div> </div>
</el-image> </el-image>
</div> </div>
<div class="big-screen-bottom"> <div class="big-screen-bottom">
<div class="left-bigscreen-title" :title="component.title"> <div
class="left-bigscreen-title"
:title="component.title"
>
{{ component.title }} {{ component.title }}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div v-else class="empty"> <div
v-else
class="empty"
>
暂无数据 暂无数据
</div> </div>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<div slot="footer" class="dialog-footer"> <div
<el-button class="bs-el-button-default" @click="dialogVisible = false"> slot="footer"
class="dialog-footer"
>
<el-button
class="bs-el-button-default"
@click="dialogVisible = false"
>
取消 取消
</el-button> </el-button>
<el-button type="primary" @click="confirm"> <el-button
type="primary"
@click="confirm"
>
确定 确定
</el-button> </el-button>
<el-button
type="primary"
@click="jumpto"
>
组件管理
</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { get } from 'data-room-ui/js/utils/http'
import { pageMixins } from 'data-room-ui/js/mixins/page' import { pageMixins } from 'data-room-ui/js/mixins/page'
import _ from 'lodash' import _ from 'lodash'
import innerRemoteComponents, { getRemoteComponents, getRemoteComponentConfig } from 'data-room-ui/RemoteComponents/remoteComponentsList' import innerRemoteComponents, { getRemoteComponents, getRemoteComponentConfig } from 'data-room-ui/RemoteComponents/remoteComponentsList'
@ -168,7 +354,7 @@ export default {
name: 'ComponentDialog', name: 'ComponentDialog',
mixins: [pageMixins], mixins: [pageMixins],
props: {}, props: {},
data() { data () {
return { return {
dialogVisible: false, dialogVisible: false,
loading: false, loading: false,
@ -185,30 +371,34 @@ export default {
} }
}, },
computed: { computed: {
gridComputed() { gridComputed () {
return this.list.length > 3 return this.list.length > 3
}, },
remoteComponentsGridComputed() { remoteComponentsGridComputed () {
return this.remoteComponentlist.length > 3 return this.remoteComponentlist.length > 3
}, },
bizFridComputed() { bizFridComputed () {
return this.bizComponentList.length > 3 return this.bizComponentList.length > 3
} }
}, },
watch: { watch: {
activeName() { activeName () {
this.getCatalogList() this.getCatalogList()
} }
}, },
mounted() { mounted () {
this.remoteComponentlist = [...innerRemoteComponents, ...getRemoteComponents()] this.remoteComponentlist = [...innerRemoteComponents, ...getRemoteComponents()]
}, },
methods: { methods: {
chooseComponent(component) { jumpto () {
const { href } = this.$router.resolve('/big-screen-components?edit=1')
window.open(href, '_blank')
},
chooseComponent (component) {
this.focus = _.cloneDeep(component) this.focus = _.cloneDeep(component)
}, },
close() { }, close () { },
init() { init () {
this.dialogVisible = true this.dialogVisible = true
this.current = 1 this.current = 1
this.searchKey = '' this.searchKey = ''
@ -218,7 +408,7 @@ export default {
this.getCatalogList() this.getCatalogList()
}, },
// //
confirm() { confirm () {
this.dialogVisible = false this.dialogVisible = false
if (this.activeName === 'combination') { if (this.activeName === 'combination') {
if (Object.keys(this.focus).length) { if (Object.keys(this.focus).length) {
@ -240,7 +430,7 @@ export default {
this.$emit('setRemoteComponent', config) this.$emit('setRemoteComponent', config)
} }
}, },
getDataList() { getDataList () {
this.loading = true this.loading = true
this.$dataRoomAxios.get('/bigScreen/design/page', { this.$dataRoomAxios.get('/bigScreen/design/page', {
parentCode: this.code || null, parentCode: this.code || null,
@ -270,9 +460,9 @@ export default {
}) })
}, },
// //
getCatalogList() { getCatalogList () {
const url = this.activeName === 'combination' ? '/bigScreen/type/list/componentCatalog' : '/bigScreen/type/list/bizComponentCatalog' const url = this.activeName === 'combination' ? '/bigScreen/type/list/componentCatalog' : '/bigScreen/type/list/bizComponentCatalog'
get(url) this.$dataRoomAxios.get(url)
.then((data) => { .then((data) => {
this.options = data this.options = data
}) })

@ -82,7 +82,6 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { get } from 'data-room-ui/js/utils/http'
export default { export default {
name: 'BgImgDialog', name: 'BgImgDialog',
props: { props: {

@ -1,76 +1,158 @@
<template> <template>
<el-dialog title="资源库" :visible.sync="dialogVisible" width="80%" :modal="true" :modal-append-to-body="false" <el-dialog
:appen-to-body="true" class="bs-dialog-wrap bs-el-dialog" @closed="close"> title="资源库"
:visible.sync="dialogVisible"
width="80%"
:modal="true"
:modal-append-to-body="false"
:appen-to-body="true"
class="bs-dialog-wrap bs-el-dialog"
@closed="close"
>
<div class="content"> <div class="content">
<div class="big-screen-list-wrap"> <div class="big-screen-list-wrap">
<div class="top-search-wrap"> <div class="top-search-wrap">
<el-input v-model="searchKey" class="bs-el-input" placeholder="请输入图片名称" prefix-icon="el-icon-search" clearable <el-input
@clear="reSearch" @keyup.enter.native="reSearch" /> v-model="searchKey"
<el-select v-model="code" class="bs-el-select" popper-class="bs-el-select" placeholder="请选择类型" clearable class="bs-el-input"
@change="reSearch"> placeholder="请输入图片名称"
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.code" /> prefix-icon="el-icon-search"
clearable
@clear="reSearch"
@keyup.enter.native="reSearch"
/>
<el-select
v-model="code"
class="bs-el-select"
popper-class="bs-el-select"
placeholder="请选择类型"
clearable
@change="reSearch"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.code"
/>
</el-select> </el-select>
<el-button size="small" style="margin-right: 20px" type="primary" @click="reSearch"> <el-button
size="small"
style="margin-right: 20px"
type="primary"
@click="reSearch"
>
搜索 搜索
</el-button> </el-button>
</div> </div>
<div v-if="list.length !== 0" v-loading="loading" class="list-wrap bs-scrollbar" element-loading-text="" <div
v-if="list.length !== 0"
v-loading="loading"
class="list-wrap bs-scrollbar"
element-loading-text="加载中"
:style="{ :style="{
display: gridComputed ? 'grid' : 'flex', display: gridComputed ? 'grid' : 'flex',
justifyContent: gridComputed ? 'space-around' : 'flex-start' justifyContent: gridComputed ? 'space-around' : 'flex-start'
}"> }"
>
<!-- <div v-if="list.length !== 0"> --> <!-- <div v-if="list.length !== 0"> -->
<div v-for="screen in list" :key="screen.id" class="big-screen-card-wrap" :style="{ <div
width: gridComputed ? 'auto' : '290px' v-for="screen in list"
}" @click="chooseImg(screen)"> :key="screen.id"
<div :class="focus.id == screen.id ? 'focus' : ''" class="big-screen-card-inner"> class="big-screen-card-wrap"
:style="{
width: gridComputed ? 'auto' : '290px'
}"
@click="chooseImg(screen)"
>
<div
:class="focus.id == screen.id ? 'focus' : ''"
class="big-screen-card-inner"
>
<div class="big-screen-card-img"> <div class="big-screen-card-img">
<el-image :src="screen.url" fit="contain" style="width: 100%; height: 100%"> <el-image
<div slot="placeholder" class="image-slot"> :src="screen.url"
fit="contain"
style="width: 100%; height: 100%"
>
<div
slot="placeholder"
class="image-slot"
>
加载中··· 加载中···
</div> </div>
</el-image> </el-image>
</div> </div>
<div class="big-screen-bottom"> <div class="big-screen-bottom">
<div class="left-bigscreen-title" :title="screen.originalName"> <div
class="left-bigscreen-title"
:title="screen.originalName"
>
{{ screen.originalName }} {{ screen.originalName }}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div v-else class="empty"> <div
v-else
class="empty"
>
暂无数据 暂无数据
</div> </div>
<div class="footer-pagination-wrap"> <div class="footer-pagination-wrap">
<div class="bs-pagination"> <div class="bs-pagination">
<el-pagination class="bs-el-pagination" popper-class="bs-el-pagination" background <el-pagination
layout="total, prev, pager, next, sizes" :page-size="size" prev-text="上一页" next-text="下一页" class="bs-el-pagination"
:total="totalCount" :page-sizes="[10, 20, 50, 100]" :current-page="current" popper-class="bs-el-pagination"
@current-change="currentChangeHandle" @size-change="sizeChangeHandle" /> background
layout="total, prev, pager, next, sizes"
:page-size="size"
prev-text="上一页"
next-text="下一页"
:total="totalCount"
:page-sizes="[10, 20, 50, 100]"
:current-page="current"
@current-change="currentChangeHandle"
@size-change="sizeChangeHandle"
/>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div slot="footer" class="dialog-footer"> <div
<el-button class="bs-el-button-default" @click="dialogVisible = false"> slot="footer"
class="dialog-footer"
>
<el-button
class="bs-el-button-default"
@click="dialogVisible = false"
>
取消 取消
</el-button> </el-button>
<el-button type="primary" @click="confirm"> <el-button
type="primary"
@click="confirm"
>
确定 确定
</el-button> </el-button>
<el-button
type="primary"
@click="jumpto"
>
资源管理
</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { get } from 'data-room-ui/js/utils/http'
import { pageMixins } from 'data-room-ui/js/mixins/page' import { pageMixins } from 'data-room-ui/js/mixins/page'
import _ from 'lodash' import _ from 'lodash'
export default { export default {
name: 'SourceDialog', name: 'SourceDialog',
mixins: [pageMixins], mixins: [pageMixins],
props: {}, props: {},
data() { data () {
return { return {
dialogVisible: false, dialogVisible: false,
loading: false, loading: false,
@ -82,17 +164,21 @@ export default {
} }
}, },
computed: { computed: {
gridComputed() { gridComputed () {
return this.list.length > 3 return this.list.length > 3
} }
}, },
mounted() { }, mounted () { },
methods: { methods: {
chooseImg(img) { jumpto () {
const { href } = this.$router.resolve('/big-screen-source?edit=1')
window.open(href, '_blank')
},
chooseImg (img) {
this.focus = _.cloneDeep(img) this.focus = _.cloneDeep(img)
}, },
close() { }, close () { },
init() { init () {
this.dialogVisible = true this.dialogVisible = true
this.current = 1 this.current = 1
this.searchKey = '' this.searchKey = ''
@ -101,13 +187,13 @@ export default {
this.getDataList() this.getDataList()
this.getCatalogList() this.getCatalogList()
}, },
confirm() { confirm () {
this.dialogVisible = false this.dialogVisible = false
if (this.focus !== -1) { if (this.focus !== -1) {
this.$emit('getImg', this.focus) this.$emit('getImg', this.focus)
} }
}, },
getDataList() { getDataList () {
this.loading = true this.loading = true
this.$dataRoomAxios.get('/bigScreen/file', { this.$dataRoomAxios.get('/bigScreen/file', {
module: this.code, module: this.code,
@ -125,7 +211,7 @@ export default {
}) })
}, },
// //
getCatalogList() { getCatalogList () {
this.$dataRoomAxios.get('/bigScreen/type/list/resourceCatalog') this.$dataRoomAxios.get('/bigScreen/type/list/resourceCatalog')
.then((data) => { .then((data) => {
this.options = data this.options = data

@ -239,8 +239,6 @@ import BigScreenRun from 'data-room-ui/BigScreenRun/index.vue'
import Icon from 'data-room-ui/assets/images/pageIcon/export' import Icon from 'data-room-ui/assets/images/pageIcon/export'
import { getPageType } from './utils' import { getPageType } from './utils'
import _ from 'lodash' import _ from 'lodash'
// import axios from 'axios'
// import { post } from 'data-room-ui/js/utils/http'
import IconSvg from 'data-room-ui/SvgIcon' import IconSvg from 'data-room-ui/SvgIcon'
let dashBoardPageCode = null let dashBoardPageCode = null
export default { export default {

@ -34,7 +34,6 @@
<NotPermission v-else /> <NotPermission v-else />
</template> </template>
<script> <script>
import { get } from 'data-room-ui/js/utils/http'
import RenderCard from 'data-room-ui/Render/RenderCard.vue' import RenderCard from 'data-room-ui/Render/RenderCard.vue'
import { mapActions, mapMutations, mapState } from 'vuex' import { mapActions, mapMutations, mapState } from 'vuex'
import { getThemeConfig } from 'data-room-ui/js/api/bigScreenApi' import { getThemeConfig } from 'data-room-ui/js/api/bigScreenApi'

@ -198,8 +198,9 @@
</el-button> </el-button>
<el-button <el-button
class="bs-el-button-default" class="bs-el-button-default"
:loading="scope.row.loading"
:disabled="scope.row.editable === 1 && !appCode" :disabled="scope.row.editable === 1 && !appCode"
@click="delDataset(scope.row.id)" @click="delDataset(scope.row)"
> >
删除 删除
</el-button> </el-button>
@ -231,6 +232,10 @@
:dataset-type-list="datasetTypeList" :dataset-type-list="datasetTypeList"
@openAddForm="openAddForm" @openAddForm="openAddForm"
/> />
<checkDatasource
ref="checkDatasource"
:reason-list="reasonList"
/>
<component <component
:is="componentData.component" :is="componentData.component"
v-if="datasetType" v-if="datasetType"
@ -253,12 +258,13 @@ import JsEditForm from './JsEditForm.vue'
import JsonEditForm from './JsonEditForm.vue' import JsonEditForm from './JsonEditForm.vue'
import table from 'data-room-ui/js/utils/table.js' import table from 'data-room-ui/js/utils/table.js'
import ScriptEditForm from './ScriptEditForm.vue' import ScriptEditForm from './ScriptEditForm.vue'
import checkDatasource from 'data-room-ui/DataSourceManagement/src/checkDatasource.vue'
import CustomEditForm from './CustomEditForm.vue' import CustomEditForm from './CustomEditForm.vue'
import { pageMixins } from 'data-room-ui/js/mixins/page' import { pageMixins } from 'data-room-ui/js/mixins/page'
import OriginalEditForm from './OriginalEditForm.vue' import OriginalEditForm from './OriginalEditForm.vue'
import DatasetTypeDialog from './DatasetTypeDialog.vue' import DatasetTypeDialog from './DatasetTypeDialog.vue'
import StoredProcedureEditForm from './StoredProcedureEditForm.vue' import StoredProcedureEditForm from './StoredProcedureEditForm.vue'
import { datasetPage, datasetRemove } from 'data-room-ui/js/utils/datasetConfigService' import { datasetPage, datasetRemove, datasetCheck } from 'data-room-ui/js/utils/datasetConfigService'
import { getLabelList } from 'data-room-ui/js/utils/LabelConfigService' import { getLabelList } from 'data-room-ui/js/utils/LabelConfigService'
export default { export default {
name: 'DataSetManagement', name: 'DataSetManagement',
@ -273,7 +279,8 @@ export default {
JsonEditForm, JsonEditForm,
StoredProcedureEditForm, StoredProcedureEditForm,
ScriptEditForm, ScriptEditForm,
JsEditForm JsEditForm,
checkDatasource
}, },
mixins: [pageMixins], mixins: [pageMixins],
props: { props: {
@ -305,6 +312,7 @@ export default {
}, },
data () { data () {
return { return {
reasonList: [],
datasetType: null, datasetType: null,
isEdit: false, isEdit: false,
categoryData: [], categoryData: [],
@ -438,18 +446,27 @@ export default {
this.curRow = currentRow this.curRow = currentRow
}, },
// //
delDataset (id) { delDataset (row) {
this.$confirm('确定删除当前数据集吗?', '提示', { row.loading=true
confirmButtonText: '确定', datasetCheck(row.id).then((res)=>{
cancelButtonText: '取消', row.loading=false
type: 'warning', if(res.canDelete){
customClass: 'bs-el-message-box' this.$confirm('确定删除当前数据集吗?', '提示', {
}).then(() => { confirmButtonText: '确定',
datasetRemove(id).then(res => { cancelButtonText: '取消',
this.init(false) type: 'warning',
this.$message.success('删除成功') customClass: 'bs-el-message-box'
}) }).then(() => {
}).catch(() => { datasetRemove(row.id).then(res => {
this.init(false)
this.$message.success('删除成功')
})
}).catch(() => {
})
} else {
this.reasonList = res.reasons
this.$refs.checkDatasource.checkDatasourceVisible = true
}
}) })
}, },
// //
@ -559,6 +576,9 @@ export default {
datasetType: this.queryForm.datasetType === '' ? [...this.allType] : [this.queryForm.datasetType] datasetType: this.queryForm.datasetType === '' ? [...this.allType] : [this.queryForm.datasetType]
}).then((data) => { }).then((data) => {
this.tableData = data.list this.tableData = data.list
this.tableData.forEach(r => {
this.$set(r, 'loading', false)
})
if (this.isDialog) { if (this.isDialog) {
if (this.multiple && this.multipleSelection.length) { if (this.multiple && this.multipleSelection.length) {
this.toggleRowSelection() this.toggleRowSelection()

@ -0,0 +1,68 @@
<template>
<el-dialog
width="700px"
title="提示"
:visible.sync="checkDatasourceVisible"
:append-to-body="true"
:close-on-click-modal="false"
:before-close="handleClose"
class="bs-dialog-wrap bs-el-dialog"
>
<div class="text-style">
<div
v-for="(item,index) in reasonList"
:key="index"
class="item"
>
<span v-if="reasonList.length>1"> {{ index+1 }}</span>{{ item }}
</div>
</div>
<span
slot="footer"
class="dialog-footer"
>
<el-button
type="primary"
@click="handleClose"
>
确定
</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
reasonList: {
type: Array,
default: () => []
}
},
data () {
return {
checkDatasourceVisible: false
}
},
methods: {
handleClose () {
this.checkDatasourceVisible = false
}
}
}
</script>
<style lang="scss" scoped>
@import '../../assets/style/bsTheme.scss';
/deep/ .el-dialog__body{
min-height: 0 !important;
}
.item{
padding: 8px 0;
}
.text-style{
padding-right: 80px;
color: var(--bs-el-text);
}
</style>

@ -96,6 +96,7 @@
</el-button> </el-button>
<el-button <el-button
class="bs-el-button-default" class="bs-el-button-default"
:loading="scope.row.loading"
:disabled="scope.row.editable == 1 && !appCode" :disabled="scope.row.editable == 1 && !appCode"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
> >
@ -128,14 +129,19 @@
:app-code="appCode" :app-code="appCode"
@refreshTable="init" @refreshTable="init"
/> />
<checkDatasource
ref="checkDatasource"
:reason-list="reasonList"
/>
</div> </div>
</template> </template>
<script> <script>
import table from 'data-room-ui/js/utils/table.js' import table from 'data-room-ui/js/utils/table.js'
import '../style/index.scss' import '../style/index.scss'
import { sourceLinkTest, datasourcePage, sourceRemove } from 'data-room-ui/js/utils/dataSourceService' import { sourceLinkTest, datasourcePage, sourceRemove, dataSourceCheck } from 'data-room-ui/js/utils/dataSourceService'
import setDatasource from './setDatasource.vue' import setDatasource from './setDatasource.vue'
import checkDatasource from './checkDatasource.vue'
import _ from 'lodash' import _ from 'lodash'
import { pageMixins } from 'data-room-ui/js/mixins/page' import { pageMixins } from 'data-room-ui/js/mixins/page'
export default { export default {
@ -144,7 +150,8 @@ export default {
table // table //
}, },
components: { components: {
setDatasource setDatasource,
checkDatasource
}, },
// - // -
beforeRouteLeave (to, from, next) { beforeRouteLeave (to, from, next) {
@ -179,8 +186,10 @@ export default {
}, },
data () { data () {
return { return {
reasonList: [],
testBtnLoading: [], testBtnLoading: [],
loadingText: '', loadingText: '',
deling:false,
searchLoading: false, searchLoading: false,
dataSourceList: [], dataSourceList: [],
searchForm: { searchForm: {
@ -248,6 +257,7 @@ export default {
this.dataSourceList = data.list this.dataSourceList = data.list
this.dataSourceList.forEach(r => { this.dataSourceList.forEach(r => {
r.status = 0 r.status = 0
this.$set(r, 'loading', false)
if (r.id === this.sourceId) { if (r.id === this.sourceId) {
this.curRow = r this.curRow = r
} }
@ -272,16 +282,25 @@ export default {
handleDelete (row) { handleDelete (row) {
// eslint-disable-next-line eqeqeq // eslint-disable-next-line eqeqeq
if (row.editable == 1 && !this.appCode) return if (row.editable == 1 && !this.appCode) return
this.$confirm('确定删除当前数据源吗?', '提示', { row.loading=true
confirmButtonText: '确定', dataSourceCheck(row.id).then((res)=>{
cancelButtonText: '取消', row.loading=false
type: 'warning', if(res.canDelete){
customClass: 'bs-el-message-box' this.$confirm('确定删除当前数据源吗?', '提示', {
}).then(() => { confirmButtonText: '确定',
sourceRemove(row.id).then((r) => { cancelButtonText: '取消',
this.$message.success('删除成功') type: 'warning',
this.init() customClass: 'bs-el-message-box'
}) }).then(() => {
sourceRemove(row.id).then((r) => {
this.$message.success('删除成功')
this.init()
})
})
} else {
this.reasonList = res.reasons
this.$refs.checkDatasource.checkDatasourceVisible = true
}
}) })
}, },
sourceLinkTest (row) { sourceLinkTest (row) {

@ -39,12 +39,29 @@ export default {
}, },
computed: { computed: {
title () { title () {
if (this.$route.query.edit) return '智能报表平台'
return window?.BS_CONFIG?.starter?.title return window?.BS_CONFIG?.starter?.title
}, },
logo () { logo () {
return window?.BS_CONFIG?.starter?.logo || require('./images/logo.png') return window?.BS_CONFIG?.starter?.logo || require('./images/logo.png')
}, },
tabList () { tabList () {
if (this.$route.query.edit) {
return [
{
id: 1,
name: '资源库',
path: window?.BS_CONFIG?.routers?.sourceUrl || '/big-screen-source',
icon: 'icon-tupian'
},
{
id: 2,
name: '组件库',
path: window?.BS_CONFIG?.routers?.componentUrl || '/big-screen-components',
icon: 'icon-zujian1'
}
]
}
return [ return [
{ {
id: 0, id: 0,
@ -90,9 +107,16 @@ export default {
created () {}, created () {},
methods: { methods: {
changeTab (tab) { changeTab (tab) {
if (this.$route.query.edit) {
this.$router.push({
path: tab.path,
query: { edit: 1 }
})
}else{
this.$router.push({ this.$router.push({
path: tab.path path: tab.path
}) })
}
} }
} }
} }

@ -596,9 +596,9 @@
} }
//el-date-picker //el-date-picker
.bs-date-popper-class { .bs-el-date-picker {
background-color: var(--bs-background-1) !important;
left: -115px !important; left: -115px !important;
background-color: var(--bs-background-1) !important;
.el-picker-panel__footer { .el-picker-panel__footer {
background-color: var(--bs-background-1) !important; background-color: var(--bs-background-1) !important;
border-top: 1px solid var(--bs-background-2); border-top: 1px solid var(--bs-background-2);

@ -10,6 +10,14 @@ import Vue from 'vue'
*/ */
const add = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.post('/datasource/add', params, flag) const add = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.post('/datasource/add', params, flag)
/**
* 删除数据源前查询是否使用
* @param params
* @param flag
* @returns {*}
*/
const dataSourceCheck = (id='-1', flag = false) => Vue.prototype.$dataRoomAxios.post(`/datasource/deleteCheck/${id}`, {}, flag)
/** /**
* 修改数据源 * 修改数据源
* @param params * @param params
@ -103,5 +111,6 @@ export {
getSourceTable, getSourceTable,
getSourceView, getSourceView,
getTableFieldList, getTableFieldList,
getViewFieldList getViewFieldList,
dataSourceCheck
} }

@ -11,6 +11,15 @@ import Vue from 'vue'
*/ */
const datasetPage = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.get('/dataset/page', params, flag) const datasetPage = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.get('/dataset/page', params, flag)
/**
* 删除数据源前查询是否使用
* @param params
* @param flag
* @returns {*}
*/
const datasetCheck = (id='-1', flag = false) => Vue.prototype.$dataRoomAxios.post(`/dataset/deleteCheck/${id}`, {}, flag)
/** /**
* 数据集列表查询 * 数据集列表查询
* @param params * @param params
@ -113,5 +122,6 @@ export {
getCategoryTree, getCategoryTree,
categoryAdd, categoryAdd,
categoryUpdate, categoryUpdate,
categoryRemove categoryRemove,
datasetCheck
} }

Loading…
Cancel
Save