Merge remote-tracking branch 'origin/master'

main
liu.shiyi 2 years ago
commit e8fabb324c

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

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

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

File diff suppressed because it is too large Load Diff

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

@ -15,7 +15,6 @@ import * as echarts from 'echarts'
import commonMixins from 'data-room-ui/js/mixins/commonMixins.js'
import paramsMixins from 'data-room-ui/js/mixins/paramsMixins'
import linkageMixins from 'data-room-ui/js/mixins/linkageMixins'
import { get } from 'data-room-ui/js/utils/http'
export default {
name: 'MapCharts',
mixins: [paramsMixins, commonMixins, linkageMixins],
@ -60,7 +59,7 @@ export default {
},
methods: {
chartInit () {
let config = this.config
const config = this.config
// keycodelist
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 map = await get(decodeURI(mapUrl), {}, true)
const map = await this.$dataRoomAxios.get(decodeURI(mapUrl), {}, true)
echarts.registerMap(config.customize.scope, map)
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 ColorSelect from 'data-room-ui/ColorMultipleSelect/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'
export default {
name: 'BarSetting',
@ -271,9 +270,7 @@ export default {
},
methods: {
getMapList () {
get(
`${window.BS_CONFIG?.httpConfigs?.baseURL}/bigScreen/design/map/list/${this.config.customize.level}`
).then((res) => {
this.$dataRoomAxios.get(`${window.BS_CONFIG?.httpConfigs?.baseURL}/bigScreen/design/map/list/${this.config.customize.level}`).then((res) => {
this.mapList = res
})
},

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

@ -1,37 +1,96 @@
<template>
<el-dialog 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">
<el-dialog
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">
<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="top-search-wrap">
<el-input v-model="searchKey" class="bs-el-input" placeholder="请输入组件名称" 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-input
v-model="searchKey"
class="bs-el-input"
placeholder="请输入组件名称"
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-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>
</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="{
display: gridComputed ? 'grid' : 'flex',
justifyContent: gridComputed ? 'space-around' : 'flex-start'
}">
}"
>
<!-- <div v-if="list.length !== 0"> -->
<div v-for="screen in list" :key="screen.id" 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
v-for="screen in list"
:key="screen.id"
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">
<el-image :src="screen.coverPicture" fit="contain" style="width: 100%; height: 100%">
<div slot="placeholder" class="image-slot">
<el-image
:src="screen.coverPicture"
fit="contain"
style="width: 100%; height: 100%"
>
<div
slot="placeholder"
class="image-slot"
>
加载中···
</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">
{{ screen.name }}
</div>
@ -39,55 +98,122 @@
</el-image>
</div>
<div class="big-screen-bottom">
<div class="left-bigscreen-title" :title="screen.name">
<div
class="left-bigscreen-title"
:title="screen.name"
>
{{ screen.name }}
</div>
</div>
</div>
</div>
</div>
<div v-else class="empty">
<div
v-else
class="empty"
>
暂无数据
</div>
<div class="footer-pagination-wrap">
<div class="bs-pagination">
<el-pagination class="bs-el-pagination" popper-class="bs-el-pagination" 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" />
<el-pagination
class="bs-el-pagination"
popper-class="bs-el-pagination"
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>
</el-tab-pane>
<el-tab-pane label="业务组件" name="bizComponent">
<el-tab-pane
label="业务组件"
name="bizComponent"
>
<div class="big-screen-list-wrap">
<div class="top-search-wrap">
<el-input v-model="name" class="bs-el-input" placeholder="请输入组件名称" 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-input
v-model="name"
class="bs-el-input"
placeholder="请输入组件名称"
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-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>
</div>
<div v-if="bizComponentList.length !== 0" v-loading="loading" class="list-wrap bs-scrollbar"
element-loading-text="加载中" :style="{
<div
v-if="bizComponentList.length !== 0"
v-loading="loading"
class="list-wrap bs-scrollbar"
element-loading-text="加载中"
:style="{
display: bizFridComputed ? 'grid' : 'flex',
justifyContent: bizFridComputed ? 'space-around' : 'flex-start'
}">
}"
>
<!-- <div v-if="list.length !== 0"> -->
<div v-for="screen in bizComponentList" :key="screen.id" 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
v-for="screen in bizComponentList"
:key="screen.id"
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">
<el-image :src="screen.coverPicture" fit="contain" style="width: 100%; height: 100%">
<div slot="placeholder" class="image-slot">
<el-image
:src="screen.coverPicture"
fit="contain"
style="width: 100%; height: 100%"
>
<div
slot="placeholder"
class="image-slot"
>
加载中···
</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">
{{ screen.name }}
</div>
@ -95,71 +221,131 @@
</el-image>
</div>
<div class="big-screen-bottom">
<div class="left-bigscreen-title" :title="screen.name">
<div
class="left-bigscreen-title"
:title="screen.name"
>
{{ screen.name }}
</div>
</div>
</div>
</div>
</div>
<div v-else class="empty">
<div
v-else
class="empty"
>
暂无数据
</div>
<div class="footer-pagination-wrap">
<div class="bs-pagination">
<el-pagination class="bs-el-pagination" popper-class="bs-el-pagination" 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" />
<el-pagination
class="bs-el-pagination"
popper-class="bs-el-pagination"
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>
</el-tab-pane>
<el-tab-pane label="系统组件" name="remote">
<el-tab-pane
label="系统组件"
name="remote"
>
<div class="big-screen-list-wrap">
<div v-if="remoteComponentlist.length !== 0" v-loading="loading" class="list-wrap bs-scrollbar"
element-loading-text="加载中" :style="{
<div
v-if="remoteComponentlist.length !== 0"
v-loading="loading"
class="list-wrap bs-scrollbar"
element-loading-text="加载中"
:style="{
display: remoteComponentsGridComputed ? 'grid' : 'flex',
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'
}" @click="chooseComponent(component)">
<div :class="component.title == focus.title ? 'focus' : ''" class="big-screen-card-inner">
}"
>
<div
v-for="component in remoteComponentlist"
: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">
<el-image :src="component.img" fit="contain" style="width: 100%; height: 100%">
<div slot="placeholder" class="image-slot">
<el-image
:src="component.img"
fit="contain"
style="width: 100%; height: 100%"
>
<div
slot="placeholder"
class="image-slot"
>
加载中···
</div>
</el-image>
</div>
<div class="big-screen-bottom">
<div class="left-bigscreen-title" :title="component.title">
<div
class="left-bigscreen-title"
:title="component.title"
>
{{ component.title }}
</div>
</div>
</div>
</div>
</div>
<div v-else class="empty">
<div
v-else
class="empty"
>
暂无数据
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
<div slot="footer" class="dialog-footer">
<el-button class="bs-el-button-default" @click="dialogVisible = false">
<div
slot="footer"
class="dialog-footer"
>
<el-button
class="bs-el-button-default"
@click="dialogVisible = false"
>
取消
</el-button>
<el-button type="primary" @click="confirm">
<el-button
type="primary"
@click="confirm"
>
确定
</el-button>
<el-button
type="primary"
@click="jumpto"
>
组件管理
</el-button>
</div>
</el-dialog>
</template>
<script>
import { get } from 'data-room-ui/js/utils/http'
import { pageMixins } from 'data-room-ui/js/mixins/page'
import _ from 'lodash'
import innerRemoteComponents, { getRemoteComponents, getRemoteComponentConfig } from 'data-room-ui/RemoteComponents/remoteComponentsList'
@ -168,7 +354,7 @@ export default {
name: 'ComponentDialog',
mixins: [pageMixins],
props: {},
data() {
data () {
return {
dialogVisible: false,
loading: false,
@ -185,30 +371,34 @@ export default {
}
},
computed: {
gridComputed() {
gridComputed () {
return this.list.length > 3
},
remoteComponentsGridComputed() {
remoteComponentsGridComputed () {
return this.remoteComponentlist.length > 3
},
bizFridComputed() {
bizFridComputed () {
return this.bizComponentList.length > 3
}
},
watch: {
activeName() {
activeName () {
this.getCatalogList()
}
},
mounted() {
mounted () {
this.remoteComponentlist = [...innerRemoteComponents, ...getRemoteComponents()]
},
methods: {
chooseComponent(component) {
jumpto () {
const { href } = this.$router.resolve('/big-screen-components?edit=1')
window.open(href, '_blank')
},
chooseComponent (component) {
this.focus = _.cloneDeep(component)
},
close() { },
init() {
close () { },
init () {
this.dialogVisible = true
this.current = 1
this.searchKey = ''
@ -218,7 +408,7 @@ export default {
this.getCatalogList()
},
//
confirm() {
confirm () {
this.dialogVisible = false
if (this.activeName === 'combination') {
if (Object.keys(this.focus).length) {
@ -240,7 +430,7 @@ export default {
this.$emit('setRemoteComponent', config)
}
},
getDataList() {
getDataList () {
this.loading = true
this.$dataRoomAxios.get('/bigScreen/design/page', {
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'
get(url)
this.$dataRoomAxios.get(url)
.then((data) => {
this.options = data
})

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

@ -1,76 +1,158 @@
<template>
<el-dialog 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">
<el-dialog
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="big-screen-list-wrap">
<div class="top-search-wrap">
<el-input v-model="searchKey" class="bs-el-input" placeholder="请输入图片名称" 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-input
v-model="searchKey"
class="bs-el-input"
placeholder="请输入图片名称"
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-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>
</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="{
display: gridComputed ? 'grid' : 'flex',
justifyContent: gridComputed ? 'space-around' : 'flex-start'
}">
}"
>
<!-- <div v-if="list.length !== 0"> -->
<div v-for="screen in list" :key="screen.id" 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
v-for="screen in list"
:key="screen.id"
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">
<el-image :src="screen.url" fit="contain" style="width: 100%; height: 100%">
<div slot="placeholder" class="image-slot">
<el-image
:src="screen.url"
fit="contain"
style="width: 100%; height: 100%"
>
<div
slot="placeholder"
class="image-slot"
>
加载中···
</div>
</el-image>
</div>
<div class="big-screen-bottom">
<div class="left-bigscreen-title" :title="screen.originalName">
<div
class="left-bigscreen-title"
:title="screen.originalName"
>
{{ screen.originalName }}
</div>
</div>
</div>
</div>
</div>
<div v-else class="empty">
<div
v-else
class="empty"
>
暂无数据
</div>
<div class="footer-pagination-wrap">
<div class="bs-pagination">
<el-pagination class="bs-el-pagination" popper-class="bs-el-pagination" 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" />
<el-pagination
class="bs-el-pagination"
popper-class="bs-el-pagination"
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 slot="footer" class="dialog-footer">
<el-button class="bs-el-button-default" @click="dialogVisible = false">
<div
slot="footer"
class="dialog-footer"
>
<el-button
class="bs-el-button-default"
@click="dialogVisible = false"
>
取消
</el-button>
<el-button type="primary" @click="confirm">
<el-button
type="primary"
@click="confirm"
>
确定
</el-button>
<el-button
type="primary"
@click="jumpto"
>
资源管理
</el-button>
</div>
</el-dialog>
</template>
<script>
import { get } from 'data-room-ui/js/utils/http'
import { pageMixins } from 'data-room-ui/js/mixins/page'
import _ from 'lodash'
export default {
name: 'SourceDialog',
mixins: [pageMixins],
props: {},
data() {
data () {
return {
dialogVisible: false,
loading: false,
@ -82,17 +164,21 @@ export default {
}
},
computed: {
gridComputed() {
gridComputed () {
return this.list.length > 3
}
},
mounted() { },
mounted () { },
methods: {
chooseImg(img) {
jumpto () {
const { href } = this.$router.resolve('/big-screen-source?edit=1')
window.open(href, '_blank')
},
chooseImg (img) {
this.focus = _.cloneDeep(img)
},
close() { },
init() {
close () { },
init () {
this.dialogVisible = true
this.current = 1
this.searchKey = ''
@ -101,13 +187,13 @@ export default {
this.getDataList()
this.getCatalogList()
},
confirm() {
confirm () {
this.dialogVisible = false
if (this.focus !== -1) {
this.$emit('getImg', this.focus)
}
},
getDataList() {
getDataList () {
this.loading = true
this.$dataRoomAxios.get('/bigScreen/file', {
module: this.code,
@ -125,7 +211,7 @@ export default {
})
},
//
getCatalogList() {
getCatalogList () {
this.$dataRoomAxios.get('/bigScreen/type/list/resourceCatalog')
.then((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 { getPageType } from './utils'
import _ from 'lodash'
// import axios from 'axios'
// import { post } from 'data-room-ui/js/utils/http'
import IconSvg from 'data-room-ui/SvgIcon'
let dashBoardPageCode = null
export default {

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

@ -198,8 +198,9 @@
</el-button>
<el-button
class="bs-el-button-default"
:loading="scope.row.loading"
:disabled="scope.row.editable === 1 && !appCode"
@click="delDataset(scope.row.id)"
@click="delDataset(scope.row)"
>
删除
</el-button>
@ -231,6 +232,10 @@
:dataset-type-list="datasetTypeList"
@openAddForm="openAddForm"
/>
<checkDatasource
ref="checkDatasource"
:reason-list="reasonList"
/>
<component
:is="componentData.component"
v-if="datasetType"
@ -253,12 +258,13 @@ import JsEditForm from './JsEditForm.vue'
import JsonEditForm from './JsonEditForm.vue'
import table from 'data-room-ui/js/utils/table.js'
import ScriptEditForm from './ScriptEditForm.vue'
import checkDatasource from 'data-room-ui/DataSourceManagement/src/checkDatasource.vue'
import CustomEditForm from './CustomEditForm.vue'
import { pageMixins } from 'data-room-ui/js/mixins/page'
import OriginalEditForm from './OriginalEditForm.vue'
import DatasetTypeDialog from './DatasetTypeDialog.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'
export default {
name: 'DataSetManagement',
@ -273,7 +279,8 @@ export default {
JsonEditForm,
StoredProcedureEditForm,
ScriptEditForm,
JsEditForm
JsEditForm,
checkDatasource
},
mixins: [pageMixins],
props: {
@ -305,6 +312,7 @@ export default {
},
data () {
return {
reasonList: [],
datasetType: null,
isEdit: false,
categoryData: [],
@ -438,18 +446,27 @@ export default {
this.curRow = currentRow
},
//
delDataset (id) {
this.$confirm('确定删除当前数据集吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
customClass: 'bs-el-message-box'
}).then(() => {
datasetRemove(id).then(res => {
this.init(false)
this.$message.success('删除成功')
})
}).catch(() => {
delDataset (row) {
row.loading=true
datasetCheck(row.id).then((res)=>{
row.loading=false
if(res.canDelete){
this.$confirm('确定删除当前数据集吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
customClass: 'bs-el-message-box'
}).then(() => {
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]
}).then((data) => {
this.tableData = data.list
this.tableData.forEach(r => {
this.$set(r, 'loading', false)
})
if (this.isDialog) {
if (this.multiple && this.multipleSelection.length) {
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
class="bs-el-button-default"
:loading="scope.row.loading"
:disabled="scope.row.editable == 1 && !appCode"
@click="handleDelete(scope.row)"
>
@ -128,14 +129,19 @@
:app-code="appCode"
@refreshTable="init"
/>
<checkDatasource
ref="checkDatasource"
:reason-list="reasonList"
/>
</div>
</template>
<script>
import table from 'data-room-ui/js/utils/table.js'
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 checkDatasource from './checkDatasource.vue'
import _ from 'lodash'
import { pageMixins } from 'data-room-ui/js/mixins/page'
export default {
@ -144,7 +150,8 @@ export default {
table //
},
components: {
setDatasource
setDatasource,
checkDatasource
},
// -
beforeRouteLeave (to, from, next) {
@ -179,8 +186,10 @@ export default {
},
data () {
return {
reasonList: [],
testBtnLoading: [],
loadingText: '',
deling:false,
searchLoading: false,
dataSourceList: [],
searchForm: {
@ -248,6 +257,7 @@ export default {
this.dataSourceList = data.list
this.dataSourceList.forEach(r => {
r.status = 0
this.$set(r, 'loading', false)
if (r.id === this.sourceId) {
this.curRow = r
}
@ -272,16 +282,25 @@ export default {
handleDelete (row) {
// eslint-disable-next-line eqeqeq
if (row.editable == 1 && !this.appCode) return
this.$confirm('确定删除当前数据源吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
customClass: 'bs-el-message-box'
}).then(() => {
sourceRemove(row.id).then((r) => {
this.$message.success('删除成功')
this.init()
})
row.loading=true
dataSourceCheck(row.id).then((res)=>{
row.loading=false
if(res.canDelete){
this.$confirm('确定删除当前数据源吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
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) {

@ -39,12 +39,29 @@ export default {
},
computed: {
title () {
if (this.$route.query.edit) return '智能报表平台'
return window?.BS_CONFIG?.starter?.title
},
logo () {
return window?.BS_CONFIG?.starter?.logo || require('./images/logo.png')
},
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 [
{
id: 0,
@ -90,9 +107,16 @@ export default {
created () {},
methods: {
changeTab (tab) {
if (this.$route.query.edit) {
this.$router.push({
path: tab.path,
query: { edit: 1 }
})
}else{
this.$router.push({
path: tab.path
})
}
}
}
}

@ -596,9 +596,9 @@
}
//el-date-picker
.bs-date-popper-class {
background-color: var(--bs-background-1) !important;
.bs-el-date-picker {
left: -115px !important;
background-color: var(--bs-background-1) !important;
.el-picker-panel__footer {
background-color: var(--bs-background-1) !important;
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)
/**
* 删除数据源前查询是否使用
* @param params
* @param flag
* @returns {*}
*/
const dataSourceCheck = (id='-1', flag = false) => Vue.prototype.$dataRoomAxios.post(`/datasource/deleteCheck/${id}`, {}, flag)
/**
* 修改数据源
* @param params
@ -103,5 +111,6 @@ export {
getSourceTable,
getSourceView,
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)
/**
* 删除数据源前查询是否使用
* @param params
* @param flag
* @returns {*}
*/
const datasetCheck = (id='-1', flag = false) => Vue.prototype.$dataRoomAxios.post(`/dataset/deleteCheck/${id}`, {}, flag)
/**
* 数据集列表查询
* @param params
@ -113,5 +122,6 @@ export {
getCategoryTree,
categoryAdd,
categoryUpdate,
categoryRemove
categoryRemove,
datasetCheck
}

Loading…
Cancel
Save