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

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

...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
and panel_group.level = #{level} and panel_group.level = #{level}
</if> </if>
</where> </where>
ORDER BY CONVERT(panel_group.name using gbk) ORDER BY panel_group.node_type desc, CONVERT(panel_group.name using gbk)
</select> </select>
<delete id="deleteCircle"> <delete id="deleteCircle">
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
`sys_auth`.`id` = `sys_auth_detail`.`auth_id` `sys_auth`.`id` = `sys_auth_detail`.`auth_id`
))) )))
WHERE WHERE
sys_auth_detail.privilege_value = #{request.userId} sys_auth_detail.privilege_value = 1
AND sys_auth.auth_source_type = #{request.modelType} AND sys_auth.auth_source_type = #{request.modelType}
AND ( AND (
( (
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
) authInfo ON v_auth_model.id = authInfo.auth_source ) authInfo ON v_auth_model.id = authInfo.auth_source
WHERE WHERE
FIND_IN_SET( v_auth_model.id, cids ) FIND_IN_SET( v_auth_model.id, cids )
ORDER BY CONVERT(v_auth_model.label using gbk) asc ORDER BY v_auth_model.node_type desc, CONVERT(v_auth_model.label using gbk) asc
</select> </select>
</mapper> </mapper>
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -80,8 +80,6 @@ CREATE TABLE `sys_menu` ( ...@@ -80,8 +80,6 @@ CREATE TABLE `sys_menu` (
`create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期',
`update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`menu_id`) USING BTREE, PRIMARY KEY (`menu_id`) USING BTREE,
UNIQUE KEY `uniq_title` (`title`),
UNIQUE KEY `uniq_name` (`name`),
KEY `inx_pid` (`pid`) KEY `inx_pid` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci AUTO_INCREMENT=53 ROW_FORMAT=COMPACT COMMENT='系统菜单'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci AUTO_INCREMENT=53 ROW_FORMAT=COMPACT COMMENT='系统菜单';
...@@ -103,10 +101,6 @@ CREATE TABLE `sys_user` ( ...@@ -103,10 +101,6 @@ CREATE TABLE `sys_user` (
`update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间',
`language` varchar(20) DEFAULT NULL COMMENT '语言', `language` varchar(20) DEFAULT NULL COMMENT '语言',
PRIMARY KEY (`user_id`) USING BTREE, PRIMARY KEY (`user_id`) USING BTREE,
UNIQUE KEY `UK_kpubos9gc2cvtkb0thktkbkes` (`email`) USING BTREE,
UNIQUE KEY `username` (`username`) USING BTREE,
UNIQUE KEY `uniq_username` (`username`),
UNIQUE KEY `uniq_email` (`email`),
KEY `FK5rwmryny6jthaaxkogownknqp` (`dept_id`) USING BTREE, KEY `FK5rwmryny6jthaaxkogownknqp` (`dept_id`) USING BTREE,
KEY `inx_enabled` (`enabled`) KEY `inx_enabled` (`enabled`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci AUTO_INCREMENT=3 ROW_FORMAT=COMPACT COMMENT='系统用户'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci AUTO_INCREMENT=3 ROW_FORMAT=COMPACT COMMENT='系统用户';
...@@ -119,23 +113,19 @@ CREATE TABLE `sys_role` ( ...@@ -119,23 +113,19 @@ CREATE TABLE `sys_role` (
`update_by` varchar(255) DEFAULT NULL COMMENT '更新者', `update_by` varchar(255) DEFAULT NULL COMMENT '更新者',
`create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期',
`update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`role_id`) USING BTREE, PRIMARY KEY (`role_id`)
UNIQUE KEY `uniq_name` (`name`),
KEY `role_name_index` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci AUTO_INCREMENT=3 ROW_FORMAT=COMPACT COMMENT='角色表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci AUTO_INCREMENT=3 ROW_FORMAT=COMPACT COMMENT='角色表';
CREATE TABLE `sys_roles_menus` ( CREATE TABLE `sys_roles_menus` (
`menu_id` bigint(20) NOT NULL COMMENT '菜单ID', `menu_id` bigint(20) NOT NULL COMMENT '菜单ID',
`role_id` bigint(20) NOT NULL COMMENT '角色ID', `role_id` bigint(20) NOT NULL COMMENT '角色ID',
PRIMARY KEY (`menu_id`,`role_id`) USING BTREE, PRIMARY KEY (`menu_id`,`role_id`)
KEY `FKcngg2qadojhi3a651a5adkvbq` (`role_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='角色菜单关联'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='角色菜单关联';
CREATE TABLE `sys_users_roles` ( CREATE TABLE `sys_users_roles` (
`user_id` bigint(20) NOT NULL COMMENT '用户ID', `user_id` bigint(20) NOT NULL COMMENT '用户ID',
`role_id` bigint(20) NOT NULL COMMENT '角色ID', `role_id` bigint(20) NOT NULL COMMENT '角色ID',
PRIMARY KEY (`user_id`,`role_id`) USING BTREE, PRIMARY KEY (`user_id`,`role_id`)
KEY `FKq4eq273l04bpu4efj0jd0jb98` (`role_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='用户角色关联'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='用户角色关联';
CREATE TABLE `my_plugin` ( CREATE TABLE `my_plugin` (
...@@ -184,9 +174,7 @@ CREATE TABLE IF NOT EXISTS `dataset_table_field` ( ...@@ -184,9 +174,7 @@ CREATE TABLE IF NOT EXISTS `dataset_table_field` (
`checked` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否选中', `checked` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否选中',
`column_index` int(10) NOT NULL COMMENT '列位置', `column_index` int(10) NOT NULL COMMENT '列位置',
`last_sync_time` bigint(13) DEFAULT NULL COMMENT '同步时间', `last_sync_time` bigint(13) DEFAULT NULL COMMENT '同步时间',
PRIMARY KEY (`id`), PRIMARY KEY (`id`)
KEY `IDX_TABLE_ID` (`table_id`),
KEY `IDX_DE_TYPE` (`de_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;
CREATE TABLE IF NOT EXISTS `dataset_table_task`( CREATE TABLE IF NOT EXISTS `dataset_table_task`(
...@@ -200,8 +188,7 @@ CREATE TABLE IF NOT EXISTS `dataset_table_task`( ...@@ -200,8 +188,7 @@ CREATE TABLE IF NOT EXISTS `dataset_table_task`(
`end` varchar(50) NOT NULL COMMENT '结束限制 0 无限制 1 设定结束时间', `end` varchar(50) NOT NULL COMMENT '结束限制 0 无限制 1 设定结束时间',
`end_time` bigint(13) COMMENT '结束时间', `end_time` bigint(13) COMMENT '结束时间',
`create_time` bigint(13) COMMENT '创建时间', `create_time` bigint(13) COMMENT '创建时间',
PRIMARY KEY (`id`), PRIMARY KEY (`id`)
KEY `IDX_TABLE_ID` (`table_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;
CREATE TABLE IF NOT EXISTS `dataset_table_task_log` ( CREATE TABLE IF NOT EXISTS `dataset_table_task_log` (
...@@ -213,8 +200,7 @@ CREATE TABLE IF NOT EXISTS `dataset_table_task_log` ( ...@@ -213,8 +200,7 @@ CREATE TABLE IF NOT EXISTS `dataset_table_task_log` (
`status` varchar(50) NOT NULL COMMENT '执行状态', `status` varchar(50) NOT NULL COMMENT '执行状态',
`info` longtext COMMENT '错误信息', `info` longtext COMMENT '错误信息',
`create_time` bigint(13) DEFAULT NULL COMMENT '创建时间', `create_time` bigint(13) DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`), PRIMARY KEY (`id`)
KEY `IDX_TABLE_ID` (`task_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;
-- chart start -- chart start
...@@ -246,8 +232,7 @@ CREATE TABLE `chart_view` ( ...@@ -246,8 +232,7 @@ CREATE TABLE `chart_view` (
`update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间',
`snapshot` longtext COMMENT '缩略图 ', `snapshot` longtext COMMENT '缩略图 ',
`style_priority` varchar(255) DEFAULT 'panel' COMMENT '样式优先级 panel 仪表板 view 视图', `style_priority` varchar(255) DEFAULT 'panel' COMMENT '样式优先级 panel 仪表板 view 视图',
PRIMARY KEY (`id`), PRIMARY KEY (`id`)
KEY `IDX_TABLE_ID` (`table_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;
-- chart end -- chart end
...@@ -300,8 +285,7 @@ CREATE TABLE `panel_store` ( ...@@ -300,8 +285,7 @@ CREATE TABLE `panel_store` (
`panel_group_id` varchar(50) NOT NULL COMMENT '仪表板ID', `panel_group_id` varchar(50) NOT NULL COMMENT '仪表板ID',
`user_id` bigint(20) NOT NULL COMMENT '用户ID', `user_id` bigint(20) NOT NULL COMMENT '用户ID',
`create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期',
PRIMARY KEY (`store_id`) USING BTREE, PRIMARY KEY (`store_id`)
KEY `UK_store_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci AUTO_INCREMENT=7 ROW_FORMAT=COMPACT COMMENT='仪表板收藏'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci AUTO_INCREMENT=7 ROW_FORMAT=COMPACT COMMENT='仪表板收藏';
...@@ -311,10 +295,7 @@ CREATE TABLE `panel_share` ( ...@@ -311,10 +295,7 @@ CREATE TABLE `panel_share` (
`target_id` bigint(20) DEFAULT NULL COMMENT '目标ID', `target_id` bigint(20) DEFAULT NULL COMMENT '目标ID',
`create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期',
`type` int(8) DEFAULT NULL COMMENT '类型0:user,1:role,2dept', `type` int(8) DEFAULT NULL COMMENT '类型0:user,1:role,2dept',
PRIMARY KEY (`share_id`) USING BTREE, PRIMARY KEY (`share_id`)
KEY `UK_share_arget_id` (`target_id`) ,
KEY `UK_share_panel_group_id` (`panel_group_id`) ,
KEY `UK_share_type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci AUTO_INCREMENT=7 ROW_FORMAT=COMPACT COMMENT='仪表板分享'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci AUTO_INCREMENT=7 ROW_FORMAT=COMPACT COMMENT='仪表板分享';
CREATE TABLE `panel_link` ( CREATE TABLE `panel_link` (
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
"less-loader": "^5.0.0", "less-loader": "^5.0.0",
"mockjs": "1.0.1-beta3", "mockjs": "1.0.1-beta3",
"runjs": "^4.1.3", "runjs": "^4.1.3",
"sass": "^1.32.5", "sass": "^1.33.0",
"sass-loader": "^7.1.0", "sass-loader": "^7.1.0",
"script-ext-html-webpack-plugin": "2.1.3", "script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "^0.7.2", "script-loader": "^0.7.2",
......
<template> <template>
<div v-loading="dataLoading" class="bg"> <div v-loading="dataLoading" class="bg">
<Preview v-show="!dataLoading" /> <Preview v-if="!dataLoading" />
</div> </div>
</template> </template>
<script> <script>
...@@ -53,8 +53,10 @@ export default { ...@@ -53,8 +53,10 @@ export default {
sourceFieldId: jumpParam.sourceFieldId, sourceFieldId: jumpParam.sourceFieldId,
targetPanelId: this.panelId targetPanelId: this.panelId
} }
this.dataLoading = true
// 刷新跳转目标仪表板联动信息 // 刷新跳转目标仪表板联动信息
queryTargetPanelJumpInfo(jumpRequestParam).then(rsp => { queryTargetPanelJumpInfo(jumpRequestParam).then(rsp => {
this.dataLoading = false
this.$store.commit('setNowTargetPanelJumpInfo', rsp.data) this.$store.commit('setNowTargetPanelJumpInfo', rsp.data)
this.$store.commit('addViewTrackFilter', jumpParam) this.$store.commit('addViewTrackFilter', jumpParam)
}) })
......
...@@ -78,12 +78,12 @@ ...@@ -78,12 +78,12 @@
<el-input v-model="styleInfo.margin" type="number" size="mini" min="0" max="99" @change="styleChange" /> <el-input v-model="styleInfo.margin" type="number" size="mini" min="0" max="99" @change="styleChange" />
</div> </div>
<el-tooltip v-if="attrShow('time_margin')" :content="$t('panel.margin')"> <el-tooltip v-if="attrShow('padding')" :content="$t('panel.margin')">
<i style="float: left;margin-top: 3px;margin-left: 2px;" class="icon iconfont icon-margin" /> <i style="float: left;margin-top: 3px;margin-left: 2px;" class="icon iconfont icon-margin" />
</el-tooltip> </el-tooltip>
<div v-if="attrShow('time_margin')" style="width: 70px;float: left;margin-top: 2px;margin-left: 2px;"> <div v-if="attrShow('padding')" style="width: 70px;float: left;margin-top: 2px;margin-left: 2px;">
<el-input v-model="styleInfo.time_margin" type="number" size="mini" min="0" max="99" @change="styleChange" /> <el-input v-model="styleInfo.padding" type="number" size="mini" min="0" max="99" @change="styleChange" />
</div> </div>
<el-tooltip v-if="attrShow('opacity')" :content="$t('panel.opacity')"> <el-tooltip v-if="attrShow('opacity')" :content="$t('panel.opacity')">
...@@ -268,7 +268,8 @@ export default { ...@@ -268,7 +268,8 @@ export default {
'color', 'color',
'backgroundColor', 'backgroundColor',
'date-format', 'date-format',
'time_margin' 'time_margin',
'padding'
/* 'margin' */ /* 'margin' */
], ],
// 文本组件显示的属性 // 文本组件显示的属性
......
...@@ -11,9 +11,6 @@ ...@@ -11,9 +11,6 @@
</span> </span>
</div> </div>
<div v-else class="toolbar"> <div v-else class="toolbar">
<el-tooltip :content="'移动端布局'">
<el-button class="icon iconfont-tb icon-yidongduan" size="mini" circle @click="openMobileLayout" />
</el-tooltip>
<el-tooltip v-if="!canvasStyleData.auxiliaryMatrix" :content="$t('panel.new_element_distribution')+':'+$t('panel.suspension')"> <el-tooltip v-if="!canvasStyleData.auxiliaryMatrix" :content="$t('panel.new_element_distribution')+':'+$t('panel.suspension')">
<el-button class="icon iconfont-tb icon-xuanfuanniu" size="mini" circle @click="auxiliaryMatrixChange" /> <el-button class="icon iconfont-tb icon-xuanfuanniu" size="mini" circle @click="auxiliaryMatrixChange" />
</el-tooltip> </el-tooltip>
......
...@@ -307,8 +307,8 @@ const list = [ ...@@ -307,8 +307,8 @@ const list = [
borderStyle: 'solid', borderStyle: 'solid',
borderColor: '#000000', borderColor: '#000000',
borderRadius: 0, borderRadius: 0,
/* margin: 10, */ time_margin: 0,
time_margin: 0 padding: 10
}, },
formatInfo: { formatInfo: {
openMode: '0', openMode: '0',
......
...@@ -10,7 +10,8 @@ export function getStyle(style, filter = []) { ...@@ -10,7 +10,8 @@ export function getStyle(style, filter = []) {
'borderWidth', 'borderWidth',
'letterSpacing', 'letterSpacing',
'borderRadius', 'borderRadius',
'margin' 'margin',
'padding'
] ]
const result = {} const result = {}
...@@ -75,7 +76,7 @@ export function colorRgb(color, opacity) { ...@@ -75,7 +76,7 @@ export function colorRgb(color, opacity) {
} }
// 处理六位的颜色值 // 处理六位的颜色值
var sColorChange = [] var sColorChange = []
for (var i = 1; i < 7; i += 2) { for (let i = 1; i < 7; i += 2) {
sColorChange.push(parseInt('0x' + sColor.slice(i, i + 2))) sColorChange.push(parseInt('0x' + sColor.slice(i, i + 2)))
} }
if (opacity || opacity === 0) { if (opacity || opacity === 0) {
......
...@@ -162,11 +162,11 @@ export default { ...@@ -162,11 +162,11 @@ export default {
height: 100%; height: 100%;
} }
.first-element-contaner { .first-element-contaner {
width: calc(100% - 10px); width: 100%;
background: initial; background: initial;
position:absolute; position:absolute;
bottom: 5px; bottom: 0px;
margin: 0 4px; margin: 0 0px;
div { div {
width: 100%; width: 100%;
} }
...@@ -174,7 +174,7 @@ export default { ...@@ -174,7 +174,7 @@ export default {
.first-element-grid-contaner { .first-element-grid-contaner {
background: #fff; background: #fff;
border: 1px solid #d7dae2; border: 1px solid #d7dae2;
top: 5px; top: 0px;
} }
.condition-main-line { .condition-main-line {
height: 40px !important; height: 40px !important;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<span style="display: flex;flex: 1;width: 0;"> <span style="display: flex;flex: 1;width: 0;">
<el-radio v-if="!options.attrs.multiple" v-model="options.value" :label="data.id" @change="changeRadioBox"><span> {{ node.label }} </span></el-radio> <el-radio v-if="!options.attrs.multiple" v-model="options.value" :label="data.id" @change="changeRadioBox"><span> {{ node.label }} </span></el-radio>
<el-checkbox v-if="options.attrs.multiple && data.id !== allNode.id" v-model="data.checked" :label="data.id" @change="changeCheckBox(data)"><span> {{ node.label }} </span></el-checkbox> <el-checkbox v-if="options.attrs.multiple && data.id !== allNode.id" v-model="data.checked" :label="data.id" @change="changeCheckBox(data)"><span> {{ node.label }} </span></el-checkbox>
<el-checkbox v-if="inDraw && options.attrs.multiple && data.id === allNode.id" v-model="data.checked" :indeterminate="data.indeterminate" :label="data.id" @change="allCheckChange(data)"><span> {{ node.label }} </span></el-checkbox> <el-checkbox v-if="options.attrs.multiple && data.id === allNode.id" v-model="data.checked" :indeterminate="data.indeterminate" :label="data.id" @change="allCheckChange(data)"><span> {{ node.label }} </span></el-checkbox>
</span> </span>
<span v-if="!options.attrs.multiple && options.value && options.value === data.id" class="child"> <span v-if="!options.attrs.multiple && options.value && options.value === data.id" class="child">
<span style="margin-left: 12px;" @click.stop> <span style="margin-left: 12px;" @click.stop>
...@@ -100,7 +100,7 @@ export default { ...@@ -100,7 +100,7 @@ export default {
this.allNode.indeterminate = false this.allNode.indeterminate = false
this.allNode.checked = false this.allNode.checked = false
} }
this.setMutiBox() // this.setMutiBox()
} else { } else {
!sourceValid && (this.options.value = null) !sourceValid && (this.options.value = null)
sourceValid && Array.isArray(sourceValue) && (this.options.value = sourceValue[0]) sourceValid && Array.isArray(sourceValue) && (this.options.value = sourceValue[0])
...@@ -169,6 +169,14 @@ export default { ...@@ -169,6 +169,14 @@ export default {
if (index >= 0 && !data.checked) { if (index >= 0 && !data.checked) {
values.splice(index, 1) values.splice(index, 1)
} }
const datas = JSON.parse(JSON.stringify(this.options.attrs.datas))
this.options.attrs.datas = []
datas.forEach(item => {
if (item.id === data.id) {
item.checked = data.checked
}
})
this.options.attrs.datas = datas
this.setAllNodeStatus() this.setAllNodeStatus()
...@@ -194,13 +202,15 @@ export default { ...@@ -194,13 +202,15 @@ export default {
allCheckChange(data) { allCheckChange(data) {
data.indeterminate = false data.indeterminate = false
const values = [] const values = []
// this.options.value = [] this.options.value = []
this.options.attrs.datas.forEach(item => { const datas = JSON.parse(JSON.stringify(this.options.attrs.datas))
this.options.attrs.datas = []
datas.forEach(item => {
item.checked = data.checked item.checked = data.checked
// data.checked && this.options.value.push(item.id) // data.checked && this.options.value.push(item.id)
data.checked && values.push(item.id) data.checked && values.push(item.id)
}) })
this.options.attrs.datas = datas
this.options.value = values this.options.value = values
this.setCondition() this.setCondition()
}, },
......
...@@ -12,14 +12,6 @@ ...@@ -12,14 +12,6 @@
<app-main /> <app-main />
</de-main-container> </de-main-container>
</de-container> </de-container>
<!-- <de-main-container>
<app-main />
</de-main-container> -->
<!-- <div :class="{sidebarHide: sidebar.hide}" class="main-container">
<app-main />
</div> -->
</div> </div>
</template> </template>
...@@ -62,7 +54,7 @@ export default { ...@@ -62,7 +54,7 @@ export default {
return this.$store.state.settings.showSettings return this.$store.state.settings.showSettings
}, },
fullHeightFlag() { fullHeightFlag() {
return this.componentName === 'PanelEdit' || this.componentName === 'ChartEdit' return this.$route.path.indexOf('panel') > -1 && (this.componentName === 'PanelEdit' || this.componentName === 'ChartEdit')
}, },
mainStyle() { mainStyle() {
if (this.fullHeightFlag) { if (this.fullHeightFlag) {
......
<template> <template>
<el-col class="tree-style"> <el-col class="tree-style">
<!-- group --> <!-- group -->
<el-col v-if="!sceneMode"> <el-col>
<el-row class="title-css"> <el-row class="title-css">
<span class="title-text"> <span class="title-text">
{{ $t('dataset.datalist') }} {{ $t('dataset.datalist') }}
...@@ -10,36 +10,44 @@ ...@@ -10,36 +10,44 @@
</el-row> </el-row>
<el-divider /> <el-divider />
<el-row> <el-row style="margin-bottom: 10px">
<el-form> <el-col :span="16">
<el-form-item class="form-item"> <el-input
<el-input v-model="filterText"
v-model="search" size="mini"
size="mini" :placeholder="$t('commons.search')"
:placeholder="$t('dataset.search')" prefix-icon="el-icon-search"
prefix-icon="el-icon-search" clearable
clearable class="main-area-input"
class="main-area-input" />
/> </el-col>
</el-form-item> <el-col :span="8">
</el-form> <el-dropdown>
<el-button size="mini" type="primary">
{{ searchMap[searchType] }}<i class="el-icon-arrow-down el-icon--right" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="searchTypeClick('all')">{{ $t('commons.all') }}</el-dropdown-item>
<el-dropdown-item @click.native="searchTypeClick('folder')">{{ this.$t('commons.folder') }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-col>
</el-row> </el-row>
<el-col class="custom-tree-container"> <el-col class="custom-tree-container">
<div class="block"> <div class="block">
<el-tree <el-tree
ref="asyncTree" ref="datasetTreeRef"
:default-expanded-keys="expandedArray" :default-expanded-keys="expandedArray"
:data="tData" :data="tData"
node-key="id" node-key="id"
:expand-on-click-node="true"
:load="loadNode"
lazy
:props="treeProps"
highlight-current highlight-current
:expand-on-click-node="true"
:filter-node-method="filterNode"
@node-click="nodeClick" @node-click="nodeClick"
> >
<span v-if="data.type === 'group'" slot-scope="{ node, data }" class="custom-tree-node father"> <span v-if="data.modelInnerType === 'group'" slot-scope="{ node, data }" class="custom-tree-node father">
<span style="display: flex;flex: 1;width: 0;"> <span style="display: flex;flex: 1;width: 0;">
<span> <span>
<i class="el-icon-folder" /> <i class="el-icon-folder" />
...@@ -47,7 +55,7 @@ ...@@ -47,7 +55,7 @@
<span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" :title="data.name">{{ data.name }}</span> <span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" :title="data.name">{{ data.name }}</span>
</span> </span>
<span v-if="hasDataPermission('manage',data.privileges)" class="child"> <span v-if="hasDataPermission('manage',data.privileges)" class="child">
<span v-if="data.type ==='group'" @click.stop> <span v-if="data.modelInnerType ==='group'" @click.stop>
<el-dropdown trigger="click" size="small" @command="clickAdd"> <el-dropdown trigger="click" size="small" @command="clickAdd">
<span class="el-dropdown-link"> <span class="el-dropdown-link">
<el-button <el-button
...@@ -86,10 +94,10 @@ ...@@ -86,10 +94,10 @@
{{ $t('dataset.custom_data') }} {{ $t('dataset.custom_data') }}
</el-dropdown-item> </el-dropdown-item>
<!--此处菜单暂时隐藏,后续功能完整后再放开--> <!--此处菜单暂时隐藏,后续功能完整后再放开-->
<!-- <el-dropdown-item :command="beforeClickAddData('union',data)">--> <!-- <el-dropdown-item :command="beforeClickAddData('union',data)">-->
<!-- <svg-icon icon-class="ds-union" class="ds-icon-union" />--> <!-- <svg-icon icon-class="ds-union" class="ds-icon-union" />-->
<!-- {{ $t('dataset.union_data') }}--> <!-- {{ $t('dataset.union_data') }}-->
<!-- </el-dropdown-item>--> <!-- </el-dropdown-item>-->
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</el-dropdown-item> </el-dropdown-item>
...@@ -123,12 +131,12 @@ ...@@ -123,12 +131,12 @@
<span v-else slot-scope="{ node, data }" class="custom-tree-node-list father"> <span v-else slot-scope="{ node, data }" class="custom-tree-node-list father">
<span style="display: flex;flex: 1;width: 0;"> <span style="display: flex;flex: 1;width: 0;">
<span> <span>
<svg-icon v-if="data.type === 'db'" icon-class="ds-db" class="ds-icon-db" /> <svg-icon v-if="data.modelInnerType === '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.modelInnerType === '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.modelInnerType === 'excel'" icon-class="ds-excel" class="ds-icon-excel" />
<svg-icon v-if="data.type === 'custom'" icon-class="ds-custom" class="ds-icon-custom" /> <svg-icon v-if="data.modelInnerType === 'custom'" icon-class="ds-custom" class="ds-icon-custom" />
</span> </span>
<span v-if="data.type === 'db' || data.type === 'sql'"> <span v-if="data.modelInnerType === 'db' || data.modelInnerType === 'sql'">
<span v-if="data.mode === 0" style="margin-left: 6px"><i class="el-icon-s-operation" /></span> <span v-if="data.mode === 0" style="margin-left: 6px"><i class="el-icon-s-operation" /></span>
<span v-if="data.mode === 1" style="margin-left: 6px"><i class="el-icon-alarm-clock" /></span> <span v-if="data.mode === 1" style="margin-left: 6px"><i class="el-icon-alarm-clock" /></span>
</span> </span>
...@@ -216,6 +224,7 @@ ...@@ -216,6 +224,7 @@
import { loadTable, getScene, addGroup, delGroup, delTable, post, isKettleRunning, alter } from '@/api/dataset/dataset' import { loadTable, getScene, addGroup, delGroup, delTable, post, isKettleRunning, alter } from '@/api/dataset/dataset'
import GroupMoveSelector from './GroupMoveSelector' import GroupMoveSelector from './GroupMoveSelector'
import DsMoveSelector from './DsMoveSelector' import DsMoveSelector from './DsMoveSelector'
import { queryAuthModel } from '@/api/authModel/authModel'
export default { export default {
name: 'Group', name: 'Group',
...@@ -287,25 +296,29 @@ export default { ...@@ -287,25 +296,29 @@ export default {
parentId: 'pid' parentId: 'pid'
}, },
isTreeSearch: false, isTreeSearch: false,
kettleRunning: false kettleRunning: false,
searchPids: [], // 查询命中的pid
filterText: '',
searchType: 'all',
searchMap: {
all: this.$t('commons.all'),
folder: this.$t('commons.folder')
}
} }
}, },
computed: { computed: {
}, },
watch: { watch: {
search(val) {
this.$emit('switchComponent', { name: '' })
this.tData = []
this.expandedArray = []
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
this.getTreeData(val)
}, (val && val !== '') ? 500 : 0)
},
saveStatus() { saveStatus() {
this.refreshNodeBy(this.saveStatus.sceneId) this.treeNode()
},
filterText(val) {
this.searchPids = []
this.$refs.datasetTreeRef.filter(val)
},
searchType(val) {
this.searchPids = []
this.$refs.datasetTreeRef.filter(this.filterText)
} }
}, },
created() { created() {
...@@ -337,7 +350,7 @@ export default { ...@@ -337,7 +350,7 @@ export default {
clickMore(param) { clickMore(param) {
switch (param.type) { switch (param.type) {
case 'rename': case 'rename':
this.add(param.data.type) this.add(param.data.modelInnerType)
this.groupForm = JSON.parse(JSON.stringify(param.data)) this.groupForm = JSON.parse(JSON.stringify(param.data))
break break
case 'move': case 'move':
...@@ -393,7 +406,8 @@ export default { ...@@ -393,7 +406,8 @@ export default {
type: 'success', type: 'success',
showClose: true showClose: true
}) })
this.refreshNodeBy(group.pid) this.expandedArray.push(group.pid)
this.treeNode(group.pid)
}) })
} else { } else {
return false return false
...@@ -403,6 +417,7 @@ export default { ...@@ -403,6 +417,7 @@ export default {
saveTable(table) { saveTable(table) {
table.mode = parseInt(table.mode) table.mode = parseInt(table.mode)
const _this = this
this.$refs['tableForm'].validate((valid) => { this.$refs['tableForm'].validate((valid) => {
if (valid) { if (valid) {
table.isRename = true table.isRename = true
...@@ -413,7 +428,9 @@ export default { ...@@ -413,7 +428,9 @@ export default {
type: 'success', type: 'success',
showClose: true showClose: true
}) })
this.refreshNodeBy(table.sceneId) _this.expandedArray.push(response.data.sceneId)
_this.$refs.datasetTreeRef.setCurrentKey(response.data.id)
_this.treeNode()
this.$store.dispatch('dataset/setTable', new Date().getTime()) this.$store.dispatch('dataset/setTable', new Date().getTime())
}) })
} else { } else {
...@@ -434,7 +451,7 @@ export default { ...@@ -434,7 +451,7 @@ export default {
message: this.$t('dataset.delete_success'), message: this.$t('dataset.delete_success'),
showClose: true showClose: true
}) })
this.refreshNodeBy(data.pid) this.treeNode(data.pid)
}) })
}).catch(() => { }).catch(() => {
}) })
...@@ -452,7 +469,7 @@ export default { ...@@ -452,7 +469,7 @@ export default {
message: this.$t('dataset.delete_success'), message: this.$t('dataset.delete_success'),
showClose: true showClose: true
}) })
this.refreshNodeBy(data.sceneId) this.treeNode(data.sceneId)
this.$store.dispatch('dataset/setTable', new Date().getTime()) this.$store.dispatch('dataset/setTable', new Date().getTime())
}) })
}).catch(() => { }).catch(() => {
...@@ -480,7 +497,7 @@ export default { ...@@ -480,7 +497,7 @@ export default {
}, },
treeNode(group) { treeNode(group) {
post('/dataset/group/treeNode', group).then(res => { queryAuthModel({ modelType: 'dataset' }).then(res => {
this.tData = res.data this.tData = res.data
}) })
}, },
...@@ -500,9 +517,17 @@ export default { ...@@ -500,9 +517,17 @@ export default {
}, },
nodeClick(data, node) { nodeClick(data, node) {
if (data.type !== 'group') { if (data.modelInnerType !== 'group') {
this.$emit('switchComponent', { name: 'ViewTable', param: data }) this.$emit('switchComponent', { name: 'ViewTable', param: data })
} }
if (node.expanded) {
this.expandedArray.push(data.id)
} else {
const index = this.expandedArray.indexOf(data.id)
if (index > -1) {
this.expandedArray.splice(index, 1)
}
}
}, },
back() { back() {
...@@ -588,7 +613,7 @@ export default { ...@@ -588,7 +613,7 @@ export default {
this.groupForm.pid = this.tGroup.id this.groupForm.pid = this.tGroup.id
addGroup(this.groupForm).then(res => { addGroup(this.groupForm).then(res => {
this.closeMoveGroup() this.closeMoveGroup()
this.refreshNodeBy(this.groupForm.pid) this.treeNode()
}) })
}, },
targetGroup(val) { targetGroup(val) {
...@@ -612,14 +637,13 @@ export default { ...@@ -612,14 +637,13 @@ export default {
} }
}, },
saveMoveDs() { saveMoveDs() {
const oldSceneId = this.dsForm.sceneId
const newSceneId = this.tDs.id const newSceneId = this.tDs.id
this.dsForm.sceneId = newSceneId this.dsForm.sceneId = newSceneId
this.dsForm.isRename = true this.dsForm.isRename = true
alter(this.dsForm).then(res => { alter(this.dsForm).then(res => {
this.closeMoveDs() this.closeMoveDs()
this.refreshNodeBy(oldSceneId) this.expandedArray.push(newSceneId)
this.refreshNodeBy(newSceneId) this.treeNode()
}) })
}, },
targetDs(val) { targetDs(val) {
...@@ -652,69 +676,6 @@ export default { ...@@ -652,69 +676,6 @@ export default {
} }
}, },
refreshNodeBy(id) {
if (this.isTreeSearch) {
this.tData = []
this.expandedArray = []
this.searchTree(this.search)
} else {
if (!id || id === '0') {
this.treeNode(this.groupForm)
} else {
const node = this.$refs.asyncTree.getNode(id) // 通过节点id找到对应树节点对象
node.loaded = false
node.expand() // 主动调用展开节点方法,重新查询该节点下的所有子节点
}
}
},
searchTree(val) {
const queryCondition = {
name: val
}
post('/dataset/table/search', queryCondition).then(res => {
this.tData = this.buildTree(res.data)
})
},
buildTree(arrs) {
const idMapping = arrs.reduce((acc, el, i) => {
acc[el[this.treeProps.id]] = i
return acc
}, {})
const roots = []
arrs.forEach(el => {
// 判断根节点 ###
if (el[this.treeProps.parentId] === null || el[this.treeProps.parentId] === 0 || el[this.treeProps.parentId] === '0') {
roots.push(el)
return
}
// 用映射表找到父元素
const parentEl = arrs[idMapping[el[this.treeProps.parentId]]]
// 把当前元素添加到父元素的`children`数组中
parentEl.children = [...(parentEl.children || []), el]
// 设置展开节点 如果没有子节点则不进行展开
if (parentEl.children.length > 0) {
this.expandedArray.push(parentEl[this.treeProps.id])
}
})
return roots
},
// 高亮显示搜索内容
highlights(data) {
if (data && this.search && this.search.length > 0) {
const replaceReg = new RegExp(this.search, 'g')// 匹配关键字正则
const replaceString = '<span style="color: #0a7be0">' + this.search + '</span>' // 高亮替换v-html值
data.forEach(item => {
item.name = item.name.replace(replaceReg, replaceString) // 开始替换
item.label = item.label.replace(replaceReg, replaceString) // 开始替换
})
}
},
getTreeData(val) { getTreeData(val) {
if (val) { if (val) {
this.isTreeSearch = true this.isTreeSearch = true
...@@ -723,6 +684,27 @@ export default { ...@@ -723,6 +684,27 @@ export default {
this.isTreeSearch = false this.isTreeSearch = false
this.treeNode(this.groupForm) this.treeNode(this.groupForm)
} }
},
filterNode(value, data) {
if (!value) return true
if (this.searchType === 'folder') {
if (data.modelInnerType === 'group' && data.label.indexOf(value) !== -1) {
this.searchPids.push(data.id)
return true
}
if (this.searchPids.indexOf(data.pid) !== -1) {
if (data.modelInnerType === 'group') {
this.searchPids.push(data.id)
}
return true
}
} else {
return data.label.indexOf(value) !== -1
}
return false
},
searchTypeClick(searchTypeInfo) {
this.searchType = searchTypeInfo
} }
} }
} }
......
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
}, },
computed: { computed: {
fullHeightFlag() { fullHeightFlag() {
return this.componentName === 'PanelEdit' || this.componentName === 'ChartEdit' return this.$route.path.indexOf('panel') > -1 && (this.componentName === 'PanelEdit' || this.componentName === 'ChartEdit')
} }
}, },
watch: { watch: {
...@@ -49,6 +49,7 @@ export default { ...@@ -49,6 +49,7 @@ export default {
}) })
}, },
created() { created() {
bus.$emit('PanelSwitchComponent', { name: 'PanelMain' })
this.$store.dispatch('app/toggleSideBarHide', true) this.$store.dispatch('app/toggleSideBarHide', true)
const routerParam = this.$router.currentRoute.params const routerParam = this.$router.currentRoute.params
this.toMsgShare(routerParam) this.toMsgShare(routerParam)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论