Merge pull request #637 from dataease/dev

Dev
This commit is contained in:
fit2cloudrd 2021-08-16 18:11:03 +08:00 committed by GitHub
commit ac04e97369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 362 additions and 97 deletions

View File

@ -14,4 +14,12 @@ public class JdbcDTO {
private String dataBase;
private String schema;
private String dataSourceType = "jdbc";
private int initialPoolSize = 5;
private int minPoolSize = 5;
private int maxPoolSize = 50;
private int maxIdleTime = 30;
private int acquireIncrement = 5;
private int idleConnectionTestPeriod = 5;
private int connectTimeout = 5;
}

View File

@ -373,12 +373,12 @@ public class JdbcProvider extends DatasourceProvider {
private void addToPool(DatasourceRequest datasourceRequest) throws PropertyVetoException {
ComboPooledDataSource dataSource;
dataSource = new ComboPooledDataSource();
setCredential(datasourceRequest, dataSource);
dataSource.setMaxIdleTime(30); // 最大空闲时间
dataSource.setAcquireIncrement(5);// 增长数
dataSource.setInitialPoolSize(initPoolSize);// 初始连接数
dataSource.setMinPoolSize(initPoolSize); // 最小连接数
dataSource.setMaxPoolSize(maxConnections); // 最大连接数
JdbcDTO jdbcDTO = setCredential(datasourceRequest, dataSource);
dataSource.setMaxIdleTime(jdbcDTO.getMaxIdleTime()); // 最大空闲时间
dataSource.setAcquireIncrement(jdbcDTO.getAcquireIncrement());// 增长数
dataSource.setInitialPoolSize(jdbcDTO.getInitialPoolSize());// 初始连接数
dataSource.setMinPoolSize(jdbcDTO.getMinPoolSize()); // 最小连接数
dataSource.setMaxPoolSize(jdbcDTO.getMaxPoolSize()); // 最大连接数
dataSource.setAcquireRetryAttempts(30);// 获取连接重试次数
dataSource.setIdleConnectionTestPeriod(60); // 每60s检查数据库空闲连接
dataSource.setMaxStatements(0); // c3p0全局的PreparedStatements缓存的大小
@ -449,8 +449,9 @@ public class JdbcProvider extends DatasourceProvider {
}
private void setCredential(DatasourceRequest datasourceRequest, ComboPooledDataSource dataSource) throws PropertyVetoException {
private JdbcDTO setCredential(DatasourceRequest datasourceRequest, ComboPooledDataSource dataSource) throws PropertyVetoException {
DatasourceTypes datasourceType = DatasourceTypes.valueOf(datasourceRequest.getDatasource().getType());
JdbcDTO jdbcDTO = new JdbcDTO();
switch (datasourceType) {
case mysql:
MysqlConfigration mysqlConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), MysqlConfigration.class);
@ -458,6 +459,7 @@ public class JdbcProvider extends DatasourceProvider {
dataSource.setDriverClass(mysqlConfigration.getDriver());
dataSource.setPassword(mysqlConfigration.getPassword());
dataSource.setJdbcUrl(mysqlConfigration.getJdbc());
jdbcDTO = mysqlConfigration;
break;
case doris:
MysqlConfigration dorisConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), MysqlConfigration.class);
@ -465,6 +467,7 @@ public class JdbcProvider extends DatasourceProvider {
dataSource.setDriverClass(dorisConfigration.getDriver());
dataSource.setPassword(dorisConfigration.getPassword());
dataSource.setJdbcUrl(dorisConfigration.getJdbc());
jdbcDTO = dorisConfigration;
break;
case sqlServer:
SqlServerConfigration sqlServerConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), SqlServerConfigration.class);
@ -472,6 +475,7 @@ public class JdbcProvider extends DatasourceProvider {
dataSource.setDriverClass(sqlServerConfigration.getDriver());
dataSource.setPassword(sqlServerConfigration.getPassword());
dataSource.setJdbcUrl(sqlServerConfigration.getJdbc());
jdbcDTO = sqlServerConfigration;
break;
case oracle:
OracleConfigration oracleConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), OracleConfigration.class);
@ -479,6 +483,7 @@ public class JdbcProvider extends DatasourceProvider {
dataSource.setDriverClass(oracleConfigration.getDriver());
dataSource.setPassword(oracleConfigration.getPassword());
dataSource.setJdbcUrl(oracleConfigration.getJdbc());
jdbcDTO = oracleConfigration;
break;
case pg:
PgConfigration pgConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), PgConfigration.class);
@ -486,10 +491,12 @@ public class JdbcProvider extends DatasourceProvider {
dataSource.setDriverClass(pgConfigration.getDriver());
dataSource.setPassword(pgConfigration.getPassword());
dataSource.setJdbcUrl(pgConfigration.getJdbc());
jdbcDTO = pgConfigration;
break;
default:
break;
}
return jdbcDTO;
}
private String getDatabase(DatasourceRequest datasourceRequest) {

View File

@ -28,6 +28,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.xml.crypto.Data;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -77,7 +78,11 @@ public class DatasourceService {
public List<DatasourceDTO> getDatasourceList(DatasourceUnionRequest request) throws Exception {
request.setSort("update_time desc");
return extDataSourceMapper.queryUnion(request);
List<DatasourceDTO> datasourceDTOS = extDataSourceMapper.queryUnion(request);
datasourceDTOS.forEach(datasourceDTO -> {
datasourceDTO.getType();
});
return datasourceDTOS;
}
public List<DatasourceDTO> gridQuery(BaseGridRequest request) {

View File

@ -1,10 +1,8 @@
package io.dataease.dto.dataset;
import io.dataease.datasource.dto.TableFiled;
import lombok.Data;
import java.util.List;
import java.util.Map;
@Data
public class ExcelFileData {

View File

@ -0,0 +1,19 @@
package io.dataease.job.sechedule;
import com.fit2cloud.quartz.anno.QuartzScheduled;
import io.dataease.service.dataset.DataSetTableService;
public class Schedular {
private DataSetTableService dataSetTableService;
@QuartzScheduled(cron = "0 0/3 * * * ?")
public void updateDatasetTableStatus() {
dataSetTableService.updateDatasetTableStatus();
}
@QuartzScheduled(cron = "0 0/30 * * * ?")
public void updateDatasourceStatus() {
dataSetTableService.updateDatasetTableStatus();
}
}

View File

@ -0,0 +1 @@
ALTER TABLE `datasource` ADD COLUMN `status` VARCHAR(45) NULL COMMENT '状态' AFTER `create_by`;

View File

@ -629,7 +629,7 @@ export default {
elementMouseDown(e) {
// private
this.$store.commit('setClickComponentStatus', true)
if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search' && this.element.component !== 'de-number-range') {
if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search' && this.element.component !== 'de-select-grid' && this.element.component !== 'de-number-range') {
e.preventDefault()
}
//

View File

@ -104,7 +104,7 @@ export default {
elementMouseDown(e) {
// private
this.$store.commit('setClickComponentStatus', true)
if (this.config.component !== 'v-text' && this.config.component !== 'rect-shape' && this.config.component !== 'de-input-search' && this.config.component !== 'de-number-range') {
if (this.config.component !== 'v-text' && this.config.component !== 'rect-shape' && this.config.component !== 'de-input-search' && this.config.component !== 'de-select-grid' && this.config.component !== 'de-number-range') {
e.preventDefault()
}
//

View File

@ -226,7 +226,7 @@ export default {
handleMouseDownOnShape(e) {
this.$store.commit('setClickComponentStatus', true)
if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search' && this.element.component !== 'de-number-range') {
if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search' && this.element.component !== 'de-select-grid' && this.element.component !== 'de-number-range') {
e.preventDefault()
}

View File

@ -296,6 +296,8 @@ export default {
this.drillClickDimensionList = []
if (this.chart.type === 'map') {
this.backToParent(0, length)
const current = this.$refs[this.element.propValue.id]
current && current.registerDynamicMap && current.registerDynamicMap(null)
}
},

View File

@ -4,14 +4,13 @@
<div class="de-select-grid-search">
<el-input v-model="keyWord" :placeholder="$t('deinputsearch.placeholder')" size="mini" prefix-icon="el-icon-search" clearable />
</div>
<div>
<div class="list">
<el-tree
v-if="options!== null && options.attrs!==null"
ref="deSelectGrid"
:data="options.attrs.multiple ? [allNode, ...options.attrs.datas] : options.attrs.datas"
:data="(options.attrs.multiple ? [allNode, ...options.attrs.datas] : options.attrs.datas).filter(node => node.text.includes(keyWord))"
:props="defaultProp"
:indent="0"
:filter-node-method="filterNode"
class="de-filter-tree"
default-expand-all
>
@ -71,7 +70,7 @@ export default {
label: 'text',
children: 'children'
},
keyWord: null,
keyWord: '',
allNode: {
id: (-2 << 16) + '',
text: this.$t('commons.all'),
@ -107,10 +106,11 @@ export default {
sourceValid && Array.isArray(sourceValue) && (this.options.value = sourceValue[0])
!this.inDraw && (this.options.value = null)
}
},
keyWord(val) {
this.$refs.deSelectGrid.filter(val)
}
// keyWord(val) {
// console.log(val)
// this.$refs.deSelectGrid.filter(val)
// }
},
created() {
this.options = this.element.options
@ -206,10 +206,10 @@ export default {
this.options.value = null
this.changeRadioBox()
},
filterNode(value, data) {
if (!value) return true
return data[this.defaultProp.label].indexOf(value) !== -1
},
// filterNode(value, data) {
// if (!value) return true
// return data[this.defaultProp.label].indexOf(value) !== -1
// },
styleChange() {
this.$store.state.styleChangeTimes++
}
@ -246,4 +246,13 @@ export default {
border-radius: 0px;
}
}
.de-select-grid-class {
.list {
overflow-y: auto;
width: 100%;
position: absolute;
top: 30px;
bottom: 0;
}
}
</style>

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1629085981011" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16882" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M637.6 82.3L610.9 643c-1.6 34.1-29.8 61-63.9 61h-70c-34.2 0-62.3-26.8-63.9-61L386.4 82.3c-1.3-27.4 20.5-50.3 48-50.3h155.3c27.4 0 49.2 22.9 47.9 50.3zM640 864c0 35.3-14.3 67.3-37.5 90.5-23.2 23.2-55.2 37.5-90.5 37.5s-67.3-14.3-90.5-37.5C398.3 931.3 384 899.3 384 864c0-70.7 57.3-128 128-128 35.3 0 67.3 14.3 90.5 37.5 23.2 23.2 37.5 55.2 37.5 90.5z" p-id="16883" fill="#d81e06"></path></svg>

After

Width:  |  Height:  |  Size: 769 B

View File

@ -840,7 +840,9 @@ export default {
bubble_symbol: 'Shape',
gap_width: 'Gap Width',
width: 'Width',
height: 'Height'
height: 'Height',
system_case: 'System',
custom_case: 'Custom'
},
dataset: {
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',
@ -1044,7 +1046,21 @@ export default {
get_schema: 'Get Schema',
schema: 'Database Schema',
please_choose_schema: 'Please select Schema',
in_valid: 'Invalid datasource'
in_valid: 'Invalid datasource',
initial_pool_size: 'Initial connections',
min_pool_size: 'Minimum of connections',
max_pool_size: 'Maximum connection',
max_idle_time: 'Maximum idle (seconds)',
acquire_increment: 'Growth number',
connect_timeout: 'Connection timeout (seconds)',
please_input_initial_pool_size: 'Please enter the number of initial connections',
please_input_min_pool_size: 'Please enter the minimum number of connections',
please_input_max_pool_size: 'Please enter the maximum number of connections',
please_input_max_idle_time: 'Please enter the maximum idle (seconds)',
please_input_acquire_increment: 'Please enter the growth number',
please_input_connect_timeout: 'Please enter the connection timeout (seconds)',
no_less_then_0: 'Parameters in advanced settings cannot be less than zero',
priority: 'Advanced setting'
},
pblink: {
key_pwd: 'Please enter the password to open the link',

View File

@ -840,7 +840,9 @@ export default {
bubble_symbol: '圖形',
gap_width: '間隔',
width: '寬度',
height: '高度'
height: '高度',
system_case: '系統方案',
custom_case: '自定義'
},
dataset: {
sheet_warn: '有多個sheet頁面默認抽取第一個',
@ -1044,7 +1046,21 @@ export default {
get_schema: '獲取 Schema',
schema: '數據庫 Schema',
please_choose_schema: '請選擇數據庫 Schema',
in_valid: '無效數據源'
in_valid: '無效數據源',
initial_pool_size: '初始連結數',
min_pool_size: '最小連結數',
max_pool_size: '最大連結數',
max_idle_time: '最大空閒(秒)',
acquire_increment: '增長數',
connect_timeout: '連接超時(秒)',
please_input_initial_pool_size: '請輸入初始連結數',
please_input_min_pool_size: '請輸入最小連結數',
please_input_max_pool_size: '請輸入最大連結數',
please_input_max_idle_time: '請輸入最大空閒(秒)',
please_input_acquire_increment: '請輸入增長數',
please_input_connect_timeout: '請輸入連接超時(秒)',
no_less_then_0: '高級設置中的參數不能小於零',
priority: '高級設置'
},
pblink: {
key_pwd: '請輸入密碼打開鏈接',

View File

@ -840,7 +840,9 @@ export default {
bubble_symbol: '图形',
gap_width: '间隔',
width: '宽度',
height: '高度'
height: '高度',
system_case: '系统方案',
custom_case: '自定义'
},
dataset: {
sheet_warn: '有多个 Sheet 页,默认抽取第一个',
@ -1046,7 +1048,21 @@ export default {
schema: '数据库 Schema',
please_choose_schema: '请选择数据库 Schema',
edit_datasource_msg: '修改数据源信息,可能会导致改数据源下的数据集不可用,确认修改?',
in_valid: '无效数据源'
in_valid: '无效数据源',
initial_pool_size: '初始连接数',
min_pool_size: '最小连接数',
max_pool_size: '最大连接数',
max_idle_time: '最大空闲(秒)',
acquire_increment: '增长数',
connect_timeout: '连接超时(秒)',
please_input_initial_pool_size: '请输入初始连接数',
please_input_min_pool_size: '请输入最小连接数',
please_input_max_pool_size: '请输入最大连接数',
please_input_max_idle_time: '请输入最大空闲(秒)',
please_input_acquire_increment: '请输入增长数',
please_input_connect_timeout: '请输入连接超时(秒)',
no_less_then_0: '高级设置中的参数不能小于零',
priority: '高级设置'
},
pblink: {
key_pwd: '请输入密码打开链接',

View File

@ -215,35 +215,35 @@
margin: 1em 0;
}
.markdown>p,
.markdown>blockquote,
.markdown>.highlight,
.markdown>ol,
.markdown>ul {
.markdown >p,
.markdown >blockquote,
.markdown >.highlight,
.markdown >ol,
.markdown >ul {
width: 80%;
}
.markdown ul>li {
.markdown ul >li {
list-style: circle;
}
.markdown>ul li,
.markdown blockquote ul>li {
.markdown >ul li,
.markdown blockquote ul >li {
margin-left: 20px;
padding-left: 4px;
}
.markdown>ul li p,
.markdown>ol li p {
.markdown >ul li p,
.markdown >ol li p {
margin: 0.6em 0;
}
.markdown ol>li {
.markdown ol >li {
list-style: decimal;
}
.markdown>ol li,
.markdown blockquote ol>li {
.markdown >ol li,
.markdown blockquote ol >li {
margin-left: 20px;
padding-left: 4px;
}
@ -260,7 +260,7 @@
font-weight: 600;
}
.markdown>table {
.markdown >table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
@ -269,14 +269,14 @@
margin-bottom: 24px;
}
.markdown>table th {
.markdown >table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown>table th,
.markdown>table td {
.markdown >table th,
.markdown >table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;

View File

@ -235,6 +235,15 @@ div:focus {
div.el-input-group__append {
width: 10% !important;
}
.de-select-grid-class {
.list {
position: relative !important;
height: 200px !important;
overflow-y: scroll !important;
top: 0px !important;
}
}
}
%field-icon {

View File

@ -48,7 +48,6 @@ export default {
return {
myChart: {},
chartId: uuid.v1(),
currentGeoJson: null,
showTrackBar: true,
trackBarStyle: {
position: 'absolute',
@ -57,7 +56,7 @@ export default {
},
pointParam: null,
downOrUp: false
dynamicAreaCode: null
}
},
@ -144,52 +143,50 @@ export default {
if (chart.type === 'map') {
const customAttr = JSON.parse(chart.customAttr)
if (!customAttr.areaCode) return
if (this.$store.getters.geoMap[customAttr.areaCode]) {
const json = this.$store.getters.geoMap[customAttr.areaCode]
const cCode = this.dynamicAreaCode || customAttr.areaCode
if (this.$store.getters.geoMap[cCode]) {
const json = this.$store.getters.geoMap[cCode]
this.initMapChart(json, chart)
return
}
geoJson(customAttr.areaCode).then(res => {
this.initMapChart(res, chart)
geoJson(cCode).then(res => {
this.$store.dispatch('map/setGeo', {
key: customAttr.areaCode,
key: cCode,
value: res
// value: res.data
}).then(() => {
this.initMapChart(res, chart)
})
this.currentGeoJson = res
})
return
}
this.myEcharts(chart_option)
},
registerDynamicMap(areaCode) {
this.downOrUp = true
if (this.$store.getters.geoMap[areaCode]) {
const json = this.$store.getters.geoMap[areaCode]
this.$echarts.registerMap('MAP', json)
console.log('开始切换地图:' + areaCode)
return
}
geoJson(areaCode).then(res => {
this.$echarts.registerMap('MAP', res)
console.log('开始切换地图:' + areaCode)
this.$store.dispatch('map/setGeo', {
key: areaCode,
value: res
})
}).catch(() => {
this.downOrUp = true
})
this.dynamicAreaCode = areaCode
// if (this.$store.getters.geoMap[areaCode]) {
// const json = this.$store.getters.geoMap[areaCode]
// this.myChart.dispose()
// this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId))
// this.$echarts.registerMap('MAP', json)
// return
// }
// geoJson(areaCode).then(res => {
// this.$store.dispatch('map/setGeo', {
// key: areaCode,
// value: res
// }).then(() => {
// this.myChart.dispose()
// this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId))
// this.$echarts.registerMap('MAP', res)
// })
// }).catch(() => {
// this.downOrUp = true
// })
},
initMapChart(geoJson, chart) {
if (!this.$echarts.getMap('MAP') || !this.downOrUp) {
console.log('开始初始化地图:')
this.$echarts.registerMap('MAP', geoJson)
}
this.$echarts.registerMap('MAP', geoJson)
// this.$echarts.getMap('MAP') || this.$echarts.registerMap('MAP', geoJson)
const base_json = JSON.parse(JSON.stringify(BASE_MAP))
const chart_option = baseMapOption(base_json, chart)

View File

@ -4,14 +4,46 @@
<el-form ref="colorForm" :model="colorForm" label-width="80px" size="mini" :disabled="param && !hasDataPermission('manage',param.privileges)">
<div v-if="sourceType==='view' || sourceType==='panelEchart'">
<el-form-item v-show="chart.type && !chart.type.includes('table') && !chart.type.includes('text')" :label="$t('chart.color_case')" class="form-item">
<el-select v-model="colorForm.value" :placeholder="$t('chart.pls_slc_color_case')" size="mini" @change="changeColorCase">
<el-option v-for="option in colorCases" :key="option.value" :label="option.name" :value="option.value" style="display: flex;align-items: center;">
<div style="float: left">
<span v-for="(c,index) in option.colors" :key="index" :style="{width: '20px',height: '20px',float: 'left',backgroundColor: c}" />
<el-popover
placement="bottom"
width="400"
trigger="click"
:disabled="param && !hasDataPermission('manage',param.privileges)"
>
<div style="padding: 6px 10px;">
<div>
<span class="color-label">{{ $t('chart.system_case') }}</span>
<el-select v-model="colorForm.value" :placeholder="$t('chart.pls_slc_color_case')" size="mini" @change="changeColorCase">
<el-option v-for="option in colorCases" :key="option.value" :label="option.name" :value="option.value" style="display: flex;align-items: center;">
<div style="float: left">
<span v-for="(c,index) in option.colors" :key="index" :style="{width: '20px',height: '20px',float: 'left',backgroundColor: c}" />
</div>
<span style="margin-left: 4px;">{{ option.name }}</span>
</el-option>
</el-select>
<el-button size="mini" type="text" style="margin-left: 2px;" @click="resetCustomColor">{{ $t('commons.reset') }}</el-button>
</div>
<span style="margin-left: 4px;">{{ option.name }}</span>
</el-option>
</el-select>
<div style="display: flex;align-items: center;margin-top: 10px;">
<span class="color-label">{{ $t('chart.custom_case') }}</span>
<span>
<el-radio-group v-model="customColor" class="color-type">
<el-radio v-for="(c,index) in colorForm.colors" :key="index" :label="c" style="padding: 2px;" @change="switchColor(index)">
<span :style="{width: '20px',height: '20px',display:'inline-block',backgroundColor: c}" />
</el-radio>
</el-radio-group>
</span>
</div>
<div style="display: flex;align-items: center;margin-top: 10px;">
<span class="color-label" />
<span>
<el-color-picker v-model="customColor" class="color-picker-style" @change="switchColorCase" />
</span>
</div>
</div>
<div slot="reference" style="cursor: pointer;margin-top: 2px;width: 180px;">
<span v-for="(c,index) in colorForm.colors" :key="index" :style="{width: '20px',height: '20px',display:'inline-block',backgroundColor: c}" />
</div>
</el-popover>
</el-form-item>
<el-form-item v-show="(chart.type && chart.type.includes('text')) || sourceType==='panelTable'" :label="$t('chart.dimension_color')" class="form-item">
@ -149,12 +181,16 @@ export default {
colors: ['#00a3af', '#4da798', '#57baaa', '#62d0bd', '#6ee4d0', '#86e7d6', '#aeede1', '#bde1e6', '#e5e5e5']
}
],
colorForm: JSON.parse(JSON.stringify(DEFAULT_COLOR_CASE))
colorForm: JSON.parse(JSON.stringify(DEFAULT_COLOR_CASE)),
customColor: null,
colorIndex: 0
}
},
watch: {
'chart': {
handler: function() {
this.customColor = null
this.colorIndex = 0
this.init()
}
}
@ -172,6 +208,8 @@ export default {
val.value = items[0].value
val.colors = items[0].colors
this.$emit('onColorChange', val)
this.customColor = null
this.colorIndex = 0
},
init() {
const chart = JSON.parse(JSON.stringify(this.chart))
@ -184,8 +222,26 @@ export default {
}
if (customAttr.color) {
this.colorForm = customAttr.color
if (!this.customColor) {
this.customColor = this.colorForm.colors[0]
this.colorIndex = 0
}
}
}
},
switchColor(index) {
this.colorIndex = index
},
switchColorCase() {
this.colorForm.colors[this.colorIndex] = this.customColor
this.$emit('onColorChange', this.colorForm)
},
resetCustomColor() {
this.customColor = this.colorForm.colors[0]
this.colorIndex = 0
this.changeColorCase()
}
}
}
@ -220,4 +276,22 @@ export default {
cursor: pointer;
z-index: 1003;
}
.color-label{
display: inline-block;
width: 60px;
}
.color-type>>>.el-radio__input{
display: none;
}
.el-radio{
margin:0 2px 0 0!important;
}
.el-radio>>>.el-radio__label{
padding-left: 0;
}
.el-radio.is-checked{
border: 1px solid #0a7be0;
}
</style>

View File

@ -1425,6 +1425,7 @@ export default {
if (this.chart.type === 'map') {
this.backToParent(0, length)
this.currentAcreaNode = null
this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(null)
}
},
drillJump(index) {

View File

@ -116,7 +116,7 @@
<el-dialog
v-if="filterVisible && panelInfo.id"
:title="$t('panel.module')"
:title="(currentWidget && currentWidget.getLeftPanel && currentWidget.getLeftPanel().label ? $t(currentWidget.getLeftPanel().label) : '') + $t('panel.module')"
:visible.sync="filterVisible"
custom-class="de-filter-dialog"
>

View File

@ -39,8 +39,18 @@
@node-click="handleNodeClick"
>
<div slot-scope="{ node, data }" class="custom-tree-node">
<el-button v-if="data.type === 'db'" icon="el-icon-s-data" type="text" size="mini" />
<span class="label-span">{{ node.label }}</span>
<!-- <el-button v-if="data.type === 'db'" icon="el-icon-s-data" type="text" size="mini" /> -->
<span>
<svg-icon v-if="data.type === 'db'" icon-class="ds-db" class="ds-icon-db" />
<svg-icon v-if="data.type === 'sql'" icon-class="ds-sql" class="ds-icon-sql" />
<svg-icon v-if="data.type === 'excel'" icon-class="ds-excel" class="ds-icon-excel" />
<svg-icon v-if="data.type === 'custom'" icon-class="ds-custom" class="ds-icon-custom" />
</span>
<el-tooltip class="item" effect="dark" placement="top">
<div slot="content">{{ node.label }}</div>
<span class="label-span">{{ node.label }}</span>
</el-tooltip>
</div>
</el-tree>

View File

@ -11,8 +11,7 @@
<el-input v-model="form.name" autocomplete="off" />
</el-form-item>
<el-form-item :label="$t('commons.description')" prop="desc">
<el-input v-model="form.desc" autocomplete="off" type="textarea" />
<el-input v-model="form.desc" autocomplete="off" />
</el-form-item>
<el-form-item :label="$t('datasource.type')" prop="type">
<el-select v-model="form.type" :placeholder="$t('datasource.please_choose_type')" class="select-width" :disabled="formType=='modify' || (formType==='add' && params && !!params.type)" @change="changeType()">
@ -62,7 +61,30 @@
/>
</el-select>
</el-form-item>
<el-collapse >
<el-collapse-item :title="$t('datasource.priority')" name="1">
<el-form-item v-if="form.configuration.dataSourceType=='jdbc'" :label="$t('datasource.initial_pool_size')" prop="configuration.initialPoolSize">
<el-input v-model="form.configuration.initialPoolSize" autocomplete="off" type="number" min="0" size="small" />
</el-form-item>
<el-form-item v-if="form.configuration.dataSourceType=='jdbc'" :label="$t('datasource.min_pool_size')" prop="configuration.minPoolSize">
<el-input v-model="form.configuration.minPoolSize" autocomplete="off" type="number" min="0"/>
</el-form-item>
<el-form-item v-if="form.configuration.dataSourceType=='jdbc'" :label="$t('datasource.max_pool_size')" prop="configuration.maxPoolSize">
<el-input v-model="form.configuration.maxPoolSize" autocomplete="off" type="number" min="0"/>
</el-form-item>
<el-form-item v-if="form.configuration.dataSourceType=='jdbc'" :label="$t('datasource.max_idle_time')" prop="configuration.maxIdleTime">
<el-input v-model="form.configuration.maxIdleTime" autocomplete="off" type="number" min="0"/>
</el-form-item>
<el-form-item v-if="form.configuration.dataSourceType=='jdbc'" :label="$t('datasource.acquire_increment')" prop="configuration.acquireIncrement">
<el-input v-model="form.configuration.acquireIncrement" autocomplete="off" type="number" min="0"/>
</el-form-item>
<el-form-item v-if="form.configuration.dataSourceType=='jdbc'" :label="$t('datasource.connect_timeout')" prop="configuration.connectTimeout">
<el-input v-model="form.configuration.connectTimeout" autocomplete="off" type="number" min="0"/>
</el-form-item>
</el-collapse-item>
</el-collapse>
</el-form>
<div v-if="canEdit" slot="footer" class="dialog-footer">
<el-button v-if="formType==='add'?true: hasDataPermission('manage',params.privileges)" @click="validaDatasource">{{ $t('commons.validate') }}</el-button>
@ -92,7 +114,15 @@ export default {
},
data() {
return {
form: { configuration: {}},
form: { configuration: {
initialPoolSize: 5,
minPoolSize: 5,
maxPoolSize: 50,
maxIdleTime: 30,
acquireIncrement: 5,
idleConnectionTestPeriod: 5,
connectTimeout: 5
}},
rule: {
name: [{ required: true, message: this.$t('datasource.input_name'), trigger: 'blur' },
{ min: 2, max: 25, message: this.$t('datasource.input_limit_2_25', [2, 25]), trigger: 'blur' }],
@ -103,7 +133,13 @@ export default {
'configuration.username': [{ required: true, message: this.$t('datasource.please_input_user_name'), trigger: 'blur' }],
'configuration.password': [{ required: true, message: this.$t('datasource.please_input_password'), trigger: 'change' }],
'configuration.host': [{ required: true, message: this.$t('datasource.please_input_host'), trigger: 'change' }],
'configuration.port': [{ required: true, message: this.$t('datasource.please_input_port'), trigger: 'change' }]
'configuration.port': [{ required: true, message: this.$t('datasource.please_input_port'), trigger: 'change' }],
'configuration.initialPoolSize': [{ required: true, message: this.$t('datasource.please_input_initial_pool_size'), trigger: 'change' }],
'configuration.minPoolSize': [{ required: true, message: this.$t('datasource.please_input_min_pool_size'), trigger: 'change' }],
'configuration.maxPoolSize': [{ required: true, message: this.$t('datasource.please_input_max_pool_size'), trigger: 'change' }],
'configuration.maxIdleTime': [{ required: true, message: this.$t('datasource.please_input_max_idle_time'), trigger: 'change' }],
'configuration.acquireIncrement': [{ required: true, message: this.$t('datasource.please_input_acquire_increment'), trigger: 'change' }],
'configuration.connectTimeout': [{ required: true, message: this.$t('datasource.please_input_connect_timeout'), trigger: 'change' }]
},
allTypes: [{ name: 'mysql', label: 'MySQL', type: 'jdbc' },
{ name: 'oracle', label: 'Oracle', type: 'jdbc' },
@ -131,9 +167,16 @@ export default {
methods: {
setType() {
this.form.type = this.params.type
this.form.configuration = {}
this.form.configuration = {
initialPoolSize: 5,
minPoolSize: 5,
maxPoolSize: 50,
maxIdleTime: 30,
acquireIncrement: 5,
idleConnectionTestPeriod: 5,
connectTimeout: 5
}
this.changeType()
console.log(this.form)
},
changeEdit() {
this.canEdit = true
@ -148,16 +191,42 @@ export default {
this.form = Object.assign({}, row)
this.originConfiguration = this.form.configuration
this.form.configuration = JSON.parse(this.form.configuration)
if(!this.form.configuration.initialPoolSize){
this.form.configuration.initialPoolSize = 5
}
if(!this.form.configuration.minPoolSize){
this.form.configuration.minPoolSize = 5
}
if(!this.form.configuration.maxPoolSize){
this.form.configuration.maxPoolSize = 50
}
if(!this.form.configuration.maxIdleTime){
this.form.configuration.maxIdleTime = 30
}
if(!this.form.configuration.acquireIncrement){
this.form.configuration.acquireIncrement = 5
}
if(!this.form.configuration.idleConnectionTestPeriod){
this.form.configuration.idleConnectionTestPeriod = 5
}
if(!this.form.configuration.connectTimeout){
this.form.configuration.connectTimeout = 5
}
},
reset() {
this.$refs.dsForm.resetFields()
},
save() {
if (!this.form.configuration.schema && this.form.type === 'oracle') {
if (!this.form.configuration.schema && (this.form.type === 'oracle' || this.form.type === 'sqlServer')) {
this.$message.error(this.$t('datasource.please_choose_schema'))
return
}
if(this.form.configuration.initialPoolSize < 0 || this.form.configuration.minPoolSize < 0 || this.form.configuration.maxPoolSize < 0 || this.form.configuration.maxIdleTime < 0
|| this.form.configuration.acquireIncrement < 0 || this.form.configuration.idleConnectionTestPeriod < 0 || this.form.configuration.connectTimeout < 0){
this.$message.error(this.$t('datasource.no_less_then_0'))
return
}
this.$refs.dsForm.validate(valid => {
if (valid) {
const method = this.formType === 'add' ? addDs : editDs
@ -244,4 +313,11 @@ export default {
transform: scale(0.85);
}
}
.el-input {
width: 300px;
}
.el-select {
width: 300px;
}
</style>