提交 fa8d4598 authored 作者: taojinlong's avatar taojinlong

Merge branch 'dev' of github.com:dataease/dataease into dev

...@@ -187,11 +187,11 @@ ...@@ -187,11 +187,11 @@
`senior`, `senior`,
`data_from`) `data_from`)
SELECT #{newChartId}, SELECT #{newChartId},
`name`, GET_CHART_VIEW_COPY_NAME(#{oldChartId},#{panelId}) as `name`,
#{panelId}, #{panelId},
`table_id`, `table_id`,
`type`, `type`,
`title`, GET_CHART_VIEW_COPY_NAME(#{oldChartId},#{panelId}) as `title`,
`x_axis`, `x_axis`,
`x_axis_ext`, `x_axis_ext`,
`y_axis`, `y_axis`,
......
...@@ -116,6 +116,13 @@ public class ChartViewService { ...@@ -116,6 +116,13 @@ public class ChartViewService {
public ChartViewWithBLOBs newOne(ChartViewWithBLOBs chartView) { public ChartViewWithBLOBs newOne(ChartViewWithBLOBs chartView) {
long timestamp = System.currentTimeMillis(); long timestamp = System.currentTimeMillis();
// 校验名称
ChartViewExample queryExample = new ChartViewExample();
queryExample.createCriteria().andSceneIdEqualTo(chartView.getSceneId()).andNameEqualTo(chartView.getName());
List<ChartView> result = chartViewMapper.selectByExample(queryExample);
if(CollectionUtils.isNotEmpty(result)){
DEException.throwException(Translator.get("theme_name_repeat"));
}
chartView.setUpdateTime(timestamp); chartView.setUpdateTime(timestamp);
chartView.setId(UUID.randomUUID().toString()); chartView.setId(UUID.randomUUID().toString());
chartView.setCreateBy(AuthUtils.getUser().getUsername()); chartView.setCreateBy(AuthUtils.getUser().getUsername());
......
...@@ -250,7 +250,7 @@ END ...@@ -250,7 +250,7 @@ END
;; ;;
delimiter ; delimiter ;
INSERT INTO `my_plugin`(`plugin_id`, `name`, `store`, `free`, `cost`, `category`, `descript`, `version`, `install_type`, `creator`, `load_mybatis`, `release_time`, `install_time`, `module_name`, `icon`) VALUES (3, 'tabs插件', 'default', 0, 20000, 'panel', 'tabs插件', '1.0-SNAPSHOT', NULL, 'fit2cloud-chenyw', 0, NULL, NULL, 'dataease-extensions-tabs-backend', NULL); INSERT INTO `my_plugin`(`plugin_id`, `name`, `store`, `free`, `cost`, `category`, `descript`, `version`, `install_type`, `creator`, `load_mybatis`, `release_time`, `install_time`, `module_name`, `icon`) VALUES (3, '选项卡插件', 'default', 0, 20000, 'panel', '选项卡插件', '1.0-SNAPSHOT', NULL, 'fit2cloud-chenyw', 0, NULL, NULL, 'dataease-extensions-tabs-backend', NULL);
ALTER TABLE `panel_link_jump_info` ALTER TABLE `panel_link_jump_info`
ADD COLUMN `attach_params` tinyint(1) NULL COMMENT '是否附加点击参数' AFTER `checked`; ADD COLUMN `attach_params` tinyint(1) NULL COMMENT '是否附加点击参数' AFTER `checked`;
...@@ -259,3 +259,36 @@ ADD COLUMN `attach_params` tinyint(1) NULL COMMENT '是否附加点击参数' AF ...@@ -259,3 +259,36 @@ ADD COLUMN `attach_params` tinyint(1) NULL COMMENT '是否附加点击参数' AF
update `sys_menu` set menu_id = 100 where title = '首页'; update `sys_menu` set menu_id = 100 where title = '首页';
INSERT INTO `sys_menu` VALUES (101, 1, 4, 1, '插件管理', 'system-plugin', 'system/plugin/index', 1002, 'peoples', 'plugin', b'0', b'0', b'0', 'plugin:read', NULL, NULL, NULL, 1620281952752); INSERT INTO `sys_menu` VALUES (101, 1, 4, 1, '插件管理', 'system-plugin', 'system/plugin/index', 1002, 'peoples', 'plugin', b'0', b'0', b'0', 'plugin:read', NULL, NULL, NULL, 1620281952752);
DROP FUNCTION IF EXISTS `GET_CHART_VIEW_COPY_NAME`;
delimiter ;;
CREATE FUNCTION `GET_CHART_VIEW_COPY_NAME`(chartId varchar(255),pid varchar(255))
RETURNS varchar(255) CHARSET utf8mb4
READS SQL DATA
BEGIN
DECLARE chartName varchar(255);
DECLARE regexpInfo varchar(255);
DECLARE chartNameCount INTEGER;
select `name` into chartName from chart_view where id =chartId;
/**
因为名称存在()等特殊字符,所以不能直接用REGEXP进行查找,qrtz_locks
1.用like 'chartName%' 过滤可能的数据项
2.REPLACE(name,chartName,'') REGEXP '-copy\\(([0-9])+\\)$' 过滤去掉chartName后的字符以 -copy(/d) 结尾的数据
3.(LENGTH(REPLACE(name,chartName,''))-LENGTH(replace(REPLACE(name,chartName,''),'-',''))=1) 确定只出现一次 ‘-’ 防止多次copy
**/
select (count(1)+1) into chartNameCount from chart_view
where (LENGTH(REPLACE(name,chartName,''))-LENGTH(replace(REPLACE(name,chartName,''),'-',''))=1)
and REPLACE(name,chartName,'') REGEXP '-copy\\(([0-9])+\\)$' and name like CONCAT(chartName,'%') and chart_view.scene_id=pid ;
RETURN concat(chartName,'-copy(',chartNameCount,')');
END
;;
delimiter ;
update `my_plugin` set `name` = 'X-Pack默认插件' where `plugin_id` = 1;
update `my_plugin` set `module_name` = 'view-bubblemap-backend' where `plugin_id` = 2;
...@@ -140,7 +140,7 @@ export default { ...@@ -140,7 +140,7 @@ export default {
}, },
data() { data() {
return { return {
tagType: getItemType(this.dimensionData, this.quotaData, this.item) tagType: 'success'
} }
}, },
watch: { watch: {
......
...@@ -120,7 +120,7 @@ export default { ...@@ -120,7 +120,7 @@ export default {
}, },
data() { data() {
return { return {
tagType: getItemType(this.dimensionData, this.quotaData, this.item) tagType: 'success'
} }
}, },
watch: { watch: {
......
...@@ -56,7 +56,7 @@ export default { ...@@ -56,7 +56,7 @@ export default {
}, },
data() { data() {
return { return {
tagType: getItemType(this.dimensionData, this.quotaData, this.item) tagType: 'success'
} }
}, },
watch: { watch: {
......
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
}, },
data() { data() {
return { return {
tagType: getItemType(this.dimensionData, this.quotaData, this.item) tagType: 'success'
} }
}, },
watch: { watch: {
......
...@@ -148,7 +148,7 @@ export default { ...@@ -148,7 +148,7 @@ export default {
return { return {
compareItem: compareItem, compareItem: compareItem,
disableEditCompare: false, disableEditCompare: false,
tagType: getItemType(this.dimensionData, this.quotaData, this.item) tagType: 'success'
} }
}, },
watch: { watch: {
......
...@@ -148,7 +148,7 @@ export default { ...@@ -148,7 +148,7 @@ export default {
return { return {
compareItem: compareItem, compareItem: compareItem,
disableEditCompare: false, disableEditCompare: false,
tagType: getItemType(this.dimensionData, this.quotaData, this.item) tagType: 'success'
} }
}, },
watch: { watch: {
......
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-show="chart.type" :label="$t('chart.space_split')" class="form-item"> <el-form-item v-show="chart.type" :label="$t('chart.space_split')" class="form-item">
<el-input-number v-model="sizeForm.spaceSplit" size="mini" @change="changeBarSizeCase" /> <el-input-number v-model="sizeForm.spaceSplit" min="0" size="mini" @change="changeBarSizeCase" />
</el-form-item> </el-form-item>
</el-form> </el-form>
......
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-show="chart.type" :label="$t('chart.space_split')" class="form-item"> <el-form-item v-show="chart.type" :label="$t('chart.space_split')" class="form-item">
<el-input-number v-model="sizeForm.spaceSplit" size="mini" @change="changeBarSizeCase" /> <el-input-number v-model="sizeForm.spaceSplit" min="0" size="mini" @change="changeBarSizeCase" />
</el-form-item> </el-form-item>
</el-form> </el-form>
......
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
<span style="float: right;"> <span style="float: right;">
<el-select v-model="view.render" class="render-select" style="width: 70px" size="mini"> <el-select v-model="view.render" class="render-select" style="width: 70px" size="mini">
<el-option <el-option
v-for="item in renderOptions" v-for="item in pluginRenderOptions"
:key="item.value" :key="item.value"
:value="item.value" :value="item.value"
:label="item.name" :label="item.name"
...@@ -429,6 +429,13 @@ export default { ...@@ -429,6 +429,13 @@ export default {
}, },
panelInfo() { panelInfo() {
return this.$store.state.panel.panelInfo return this.$store.state.panel.panelInfo
},
pluginRenderOptions() {
const plugins = localStorage.getItem('plugin-views') && JSON.parse(localStorage.getItem('plugin-views')) || []
const pluginOptions = plugins.filter(plugin => !this.renderOptions.some(option => option.value === plugin.render)).map(plugin => {
return { name: plugin.render, value: plugin.render }
})
return [...this.renderOptions, ...pluginOptions]
} }
}, },
watch: { watch: {
...@@ -783,7 +790,7 @@ export default { ...@@ -783,7 +790,7 @@ export default {
view.extBubble = JSON.stringify([]) view.extBubble = JSON.stringify([])
this.setChartDefaultOptions(view) this.setChartDefaultOptions(view)
const _this = this const _this = this
post('/chart/view/newOne/' + this.panelInfo.id, view,true).then(response => { post('/chart/view/newOne/' + this.panelInfo.id, view, true).then(response => {
this.closeCreateChart() this.closeCreateChart()
this.$store.dispatch('chart/setTableId', null) this.$store.dispatch('chart/setTableId', null)
this.$store.dispatch('chart/setTableId', this.table.id) this.$store.dispatch('chart/setTableId', this.table.id)
......
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
@change="changeChartType()" @change="changeChartType()"
> >
<el-option <el-option
v-for="item in renderOptions" v-for="item in pluginRenderOptions"
:key="item.value" :key="item.value"
:value="item.value" :value="item.value"
:label="item.name" :label="item.name"
...@@ -877,7 +877,7 @@ ...@@ -877,7 +877,7 @@
@onLegendChange="onLegendChange" @onLegendChange="onLegendChange"
/> />
</el-collapse-item> </el-collapse-item>
<el-collapse-item v-if="chart.customStyle.background" name="background" :title="$t('chart.background')"> <el-collapse-item v-if="chart.customStyle && chart.customStyle.background" name="background" :title="$t('chart.background')">
<background-color-selector <background-color-selector
:param="param" :param="param"
class="attr-selector" class="attr-selector"
...@@ -1378,7 +1378,14 @@ export default { ...@@ -1378,7 +1378,14 @@ export default {
}, },
...mapState([ ...mapState([
'panelViewEditInfo' 'panelViewEditInfo'
]) ]),
pluginRenderOptions() {
const plugins = localStorage.getItem('plugin-views') && JSON.parse(localStorage.getItem('plugin-views')) || []
const pluginOptions = plugins.filter(plugin => !this.renderOptions.some(option => option.value === plugin.render)).map(plugin => {
return { name: plugin.render, value: plugin.render }
})
return [...this.renderOptions, ...pluginOptions]
}
}, },
watch: { watch: {
'param': function(val) { 'param': function(val) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<el-row v-if="editPanel.optType==='new' && editPanel.panelInfo.nodeType==='panel'"> <el-row v-if="editPanel.optType==='new' && editPanel.panelInfo.nodeType==='panel'">
<el-col :span="18" style="height: 40px"> <el-col :span="18" style="height: 40px">
<el-radio v-model="inputType" label="new"> {{ $t('panel.custom') }}</el-radio> <el-radio v-model="inputType" label="new"> {{ $t('panel.custom') }}</el-radio>
<!-- <el-radio v-model="inputType" label="new_outer_template">{{ $t('panel.import_template') }} </el-radio>--> <el-radio v-model="inputType" label="new_outer_template">{{ $t('panel.import_template') }} </el-radio>
<el-radio v-model="inputType" label="new_inner_template" @click.native="getTree">{{ $t('panel.copy_template') }} </el-radio> <el-radio v-model="inputType" label="new_inner_template" @click.native="getTree">{{ $t('panel.copy_template') }} </el-radio>
</el-col> </el-col>
<el-col v-if="inputType==='new_outer_template'" :span="6"> <el-col v-if="inputType==='new_outer_template'" :span="6">
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</el-col> </el-col>
<el-col :span="16" :style="classBackground" class="preview-show" /> <el-col :span="16" :style="classBackground" class="preview-show" />
</el-row> </el-row>
<!-- <el-row v-if="inputType==='import'" class="preview" :style="classBackground" />--> <el-row v-if="inputType==='new_outer_template'" class="preview" :style="classBackground" />
<el-row class="root-class"> <el-row class="root-class">
<el-button size="mini" @click="cancel()">{{ $t('commons.cancel') }}</el-button> <el-button size="mini" @click="cancel()">{{ $t('commons.cancel') }}</el-button>
<el-button type="primary" size="mini" @click="save()">{{ $t('commons.confirm') }}</el-button> <el-button type="primary" size="mini" @click="save()">{{ $t('commons.confirm') }}</el-button>
...@@ -168,6 +168,7 @@ export default { ...@@ -168,6 +168,7 @@ export default {
this.editPanel.panelInfo.name = this.importTemplateInfo.name this.editPanel.panelInfo.name = this.importTemplateInfo.name
this.editPanel.panelInfo.panelStyle = this.importTemplateInfo.panelStyle this.editPanel.panelInfo.panelStyle = this.importTemplateInfo.panelStyle
this.editPanel.panelInfo.panelData = this.importTemplateInfo.panelData this.editPanel.panelInfo.panelData = this.importTemplateInfo.panelData
this.editPanel.panelInfo.dynamicData = this.importTemplateInfo.dynamicData
} }
reader.readAsText(file) reader.readAsText(file)
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论