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

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

...@@ -74,9 +74,9 @@ public class ScheduleManager { ...@@ -74,9 +74,9 @@ public class ScheduleManager {
triggerBuilder.withIdentity(triggerKey); triggerBuilder.withIdentity(triggerKey);
Date nTimeByCron = getNTimeByCron(cron, startTime); Date nTimeByCron = getNTimeByCron(cron, startTime);
if (startTime.before(new Date())) { // if (startTime.before(new Date())) {
triggerBuilder.startAt(nTimeByCron); triggerBuilder.startAt(nTimeByCron);
} // }
if (endTime != null) { if (endTime != null) {
if (endTime.before(nTimeByCron)) { if (endTime.before(nTimeByCron)) {
...@@ -157,9 +157,9 @@ public class ScheduleManager { ...@@ -157,9 +157,9 @@ public class ScheduleManager {
triggerBuilder.withIdentity(triggerKey);// 触发器名,触发器组 triggerBuilder.withIdentity(triggerKey);// 触发器名,触发器组
Date nTimeByCron = getNTimeByCron(cron, startTime); Date nTimeByCron = getNTimeByCron(cron, startTime);
if (startTime.before(new Date())) { // if (startTime.before(new Date())) {
triggerBuilder.startAt(nTimeByCron); triggerBuilder.startAt(nTimeByCron);
} // }
if (endTime != null) { if (endTime != null) {
if (endTime.before(nTimeByCron)) { if (endTime.before(nTimeByCron)) {
......
...@@ -4,6 +4,7 @@ import io.dataease.commons.constants.AuthConstants; ...@@ -4,6 +4,7 @@ import io.dataease.commons.constants.AuthConstants;
import io.dataease.commons.license.DefaultLicenseService; import io.dataease.commons.license.DefaultLicenseService;
import io.dataease.commons.license.F2CLicenseResponse; import io.dataease.commons.license.F2CLicenseResponse;
import io.dataease.commons.utils.CommonBeanFactory; import io.dataease.commons.utils.CommonBeanFactory;
import io.dataease.commons.utils.DateUtils;
import io.dataease.commons.utils.LogUtil; import io.dataease.commons.utils.LogUtil;
import io.dataease.listener.util.CacheUtils; import io.dataease.listener.util.CacheUtils;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
...@@ -27,11 +28,17 @@ public class AboutService { ...@@ -27,11 +28,17 @@ public class AboutService {
F2CLicenseResponse f2CLicenseResponse = defaultLicenseService.updateLicense(product, licenseKey); F2CLicenseResponse f2CLicenseResponse = defaultLicenseService.updateLicense(product, licenseKey);
Optional.ofNullable(f2CLicenseResponse).ifPresent(resp -> { Optional.ofNullable(f2CLicenseResponse).ifPresent(resp -> {
if (resp.getStatus() == F2CLicenseResponse.Status.valid){ if (resp.getStatus() == F2CLicenseResponse.Status.valid){
CacheUtils.updateLicCache(new Date(f2CLicenseResponse.getLicense().getExpired())); String dateStr = f2CLicenseResponse.getLicense().getExpired();
LogUtil.info("update valid lic, expired date is {}", dateStr);
CacheUtils.removeAll(AuthConstants.USER_CACHE_NAME); try {
CacheUtils.removeAll(AuthConstants.USER_ROLE_CACHE_NAME); Date date = DateUtils.getDate(dateStr);
CacheUtils.removeAll(AuthConstants.USER_PERMISSION_CACHE_NAME); CacheUtils.updateLicCache(date);
CacheUtils.removeAll(AuthConstants.USER_CACHE_NAME);
CacheUtils.removeAll(AuthConstants.USER_ROLE_CACHE_NAME);
CacheUtils.removeAll(AuthConstants.USER_PERMISSION_CACHE_NAME);
} catch (Exception e) {
LogUtil.error(e);
}
} }
}); });
return f2CLicenseResponse; return f2CLicenseResponse;
......
...@@ -56,7 +56,7 @@ SET FOREIGN_KEY_CHECKS = 0; ...@@ -56,7 +56,7 @@ SET FOREIGN_KEY_CHECKS = 0;
-- View structure for v_auth_model -- View structure for v_auth_model
-- ---------------------------- -- ----------------------------
DROP VIEW IF EXISTS `v_auth_model`; DROP VIEW IF EXISTS `v_auth_model`;
CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_auth_model` AS select `sys_user`.`user_id` AS `id`,`sys_user`.`username` AS `name`,`sys_user`.`username` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'user' AS `model_type`,'user' AS `model_inner_type`,'target' AS `auth_type`,`sys_user`.`create_by` AS `create_by` from `sys_user` union all select `sys_role`.`role_id` AS `id`,`sys_role`.`name` AS `name`,`sys_role`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'role' AS `model_type`,'role' AS `model_inner_type`,'target' AS `auth_type`,`sys_role`.`create_by` AS `create_by` from `sys_role` union all select `sys_dept`.`dept_id` AS `id`,`sys_dept`.`name` AS `name`,`sys_dept`.`name` AS `lable`,cast(`sys_dept`.`pid` as char charset utf8mb4) AS `pid`,if((`sys_dept`.`sub_count` = 0),'leaf','spine') AS `node_type`,'dept' AS `model_type`,'dept' AS `model_inner_type`,'target' AS `auth_type`,`sys_dept`.`create_by` AS `create_by` from `sys_dept` union all select `datasource`.`id` AS `id`,`datasource`.`name` AS `NAME`,`datasource`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'link' AS `model_type`,`datasource`.`type` AS `model_inner_type`,'source' AS `auth_type`,`datasource`.`create_by` AS `create_by` from `datasource` union all select `dataset_group`.`id` AS `id`,`dataset_group`.`name` AS `NAME`,`dataset_group`.`name` AS `lable`,if(isnull(`dataset_group`.`pid`),'0',`dataset_group`.`pid`) AS `pid`,'spine' AS `node_type`,'dataset' AS `model_type`,`dataset_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_group`.`create_by` AS `create_by` from `dataset_group` union all select `dataset_table`.`id` AS `id`,`dataset_table`.`name` AS `NAME`,`dataset_table`.`name` AS `lable`,`dataset_table`.`scene_id` AS `pid`,'leaf' AS `node_type`,'dataset' AS `model_type`,`dataset_table`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_table`.`create_by` AS `create_by` from `dataset_table` union all select `chart_group`.`id` AS `id`,`chart_group`.`name` AS `name`,`chart_group`.`name` AS `label`,if(isnull(`chart_group`.`pid`),'0',`chart_group`.`pid`) AS `pid`,'spine' AS `node_type`,'chart' AS `model_type`,`chart_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_group`.`create_by` AS `create_by` from `chart_group` union all select `chart_view`.`id` AS `id`,`chart_view`.`name` AS `name`,`chart_view`.`name` AS `label`,`chart_view`.`scene_id` AS `pid`,'leaf' AS `node_type`,'chart' AS `model_type`,`chart_view`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_view`.`create_by` AS `create_by` from `chart_view` union all select `panel_group`.`id` AS `id`,`panel_group`.`name` AS `NAME`,`panel_group`.`name` AS `label`,(case `panel_group`.`id` when 'panel_list' then '0' when 'default_panel' then '0' else `panel_group`.`pid` end) AS `pid`,if((`panel_group`.`node_type` = 'folder'),'spine','leaf') AS `node_type`,'panel' AS `model_type`,`panel_group`.`panel_type` AS `model_inner_type`,'source' AS `auth_type`,`panel_group`.`create_by` AS `create_by` from `panel_group` union all select `sys_menu`.`menu_id` AS `menu_id`,`sys_menu`.`title` AS `name`,`sys_menu`.`title` AS `label`,`sys_menu`.`pid` AS `pid`,if((`sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`sys_menu`.`create_by` AS `create_by` from `sys_menu` where ((`sys_menu`.`hidden` = 0) and ((`sys_menu`.`name` <> 'panel') or isnull(`sys_menu`.`name`))) union all select `plugin_sys_menu`.`menu_id` AS `menu_id`,`plugin_sys_menu`.`title` AS `name`,`plugin_sys_menu`.`title` AS `label`,`plugin_sys_menu`.`pid` AS `pid`,if((`plugin_sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `plugin_sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`plugin_sys_menu`.`create_by` AS `create_by` from `plugin_sys_menu` where (`plugin_sys_menu`.`hidden` = 0); CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_auth_model` AS select `sys_user`.`user_id` AS `id`,`sys_user`.`username` AS `name`,`sys_user`.`username` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'user' AS `model_type`,'user' AS `model_inner_type`,'target' AS `auth_type`,`sys_user`.`create_by` AS `create_by` from `sys_user` where (`sys_user`.`is_admin` <> 1) union all select `sys_role`.`role_id` AS `id`,`sys_role`.`name` AS `name`,`sys_role`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'role' AS `model_type`,'role' AS `model_inner_type`,'target' AS `auth_type`,`sys_role`.`create_by` AS `create_by` from `sys_role` union all select `sys_dept`.`dept_id` AS `id`,`sys_dept`.`name` AS `name`,`sys_dept`.`name` AS `lable`,cast(`sys_dept`.`pid` as char charset utf8mb4) AS `pid`,if((`sys_dept`.`sub_count` = 0),'leaf','spine') AS `node_type`,'dept' AS `model_type`,'dept' AS `model_inner_type`,'target' AS `auth_type`,`sys_dept`.`create_by` AS `create_by` from `sys_dept` union all select `datasource`.`id` AS `id`,`datasource`.`name` AS `NAME`,`datasource`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'link' AS `model_type`,`datasource`.`type` AS `model_inner_type`,'source' AS `auth_type`,`datasource`.`create_by` AS `create_by` from `datasource` union all select `dataset_group`.`id` AS `id`,`dataset_group`.`name` AS `NAME`,`dataset_group`.`name` AS `lable`,if(isnull(`dataset_group`.`pid`),'0',`dataset_group`.`pid`) AS `pid`,'spine' AS `node_type`,'dataset' AS `model_type`,`dataset_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_group`.`create_by` AS `create_by` from `dataset_group` union all select `dataset_table`.`id` AS `id`,`dataset_table`.`name` AS `NAME`,`dataset_table`.`name` AS `lable`,`dataset_table`.`scene_id` AS `pid`,'leaf' AS `node_type`,'dataset' AS `model_type`,`dataset_table`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_table`.`create_by` AS `create_by` from `dataset_table` union all select `chart_group`.`id` AS `id`,`chart_group`.`name` AS `name`,`chart_group`.`name` AS `label`,if(isnull(`chart_group`.`pid`),'0',`chart_group`.`pid`) AS `pid`,'spine' AS `node_type`,'chart' AS `model_type`,`chart_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_group`.`create_by` AS `create_by` from `chart_group` union all select `chart_view`.`id` AS `id`,`chart_view`.`name` AS `name`,`chart_view`.`name` AS `label`,`chart_view`.`scene_id` AS `pid`,'leaf' AS `node_type`,'chart' AS `model_type`,`chart_view`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_view`.`create_by` AS `create_by` from `chart_view` union all select `panel_group`.`id` AS `id`,`panel_group`.`name` AS `NAME`,`panel_group`.`name` AS `label`,(case `panel_group`.`id` when 'panel_list' then '0' when 'default_panel' then '0' else `panel_group`.`pid` end) AS `pid`,if((`panel_group`.`node_type` = 'folder'),'spine','leaf') AS `node_type`,'panel' AS `model_type`,`panel_group`.`panel_type` AS `model_inner_type`,'source' AS `auth_type`,`panel_group`.`create_by` AS `create_by` from `panel_group` union all select `sys_menu`.`menu_id` AS `menu_id`,`sys_menu`.`title` AS `name`,`sys_menu`.`title` AS `label`,`sys_menu`.`pid` AS `pid`,if((`sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`sys_menu`.`create_by` AS `create_by` from `sys_menu` where ((`sys_menu`.`hidden` = 0) and ((`sys_menu`.`name` <> 'panel') or isnull(`sys_menu`.`name`))) union all select `plugin_sys_menu`.`menu_id` AS `menu_id`,`plugin_sys_menu`.`title` AS `name`,`plugin_sys_menu`.`title` AS `label`,`plugin_sys_menu`.`pid` AS `pid`,if((`plugin_sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `plugin_sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`plugin_sys_menu`.`create_by` AS `create_by` from `plugin_sys_menu` where (`plugin_sys_menu`.`hidden` = 0);
-- ---------------------------- -- ----------------------------
-- View structure for v_auth_privilege -- View structure for v_auth_privilege
...@@ -395,11 +395,12 @@ SELECT ...@@ -395,11 +395,12 @@ SELECT
sys_auth.auth_target_type = 'role' sys_auth.auth_target_type = 'role'
AND sys_auth.auth_target in ( SELECT role_id FROM sys_users_roles WHERE user_id = userId ) AND sys_auth.auth_target in ( SELECT role_id FROM sys_users_roles WHERE user_id = userId )
) )
OR (1 = ( SELECT is_admin FROM sys_user WHERE user_id = userId ))
) )
GROUP BY GROUP BY
sys_auth.auth_source_type, sys_auth.auth_source_type,
sys_auth.auth_source sys_auth.auth_source
having sum( sys_auth_detail.privilege_value )> 0) temp; having (sum( sys_auth_detail.privilege_value )> 0 or 1 = ( SELECT is_admin FROM sys_user WHERE user_id = 1 ))) temp;
select GROUP_CONCAT(id) into oTempAllIds from (select GET_V_AUTH_MODEL_WITH_PARENT ( oTempLeafIds ,modelType) cids) t, v_auth_model where v_auth_model.model_type=modelType and FIND_IN_SET(v_auth_model.id,cids); select GROUP_CONCAT(id) into oTempAllIds from (select GET_V_AUTH_MODEL_WITH_PARENT ( oTempLeafIds ,modelType) cids) t, v_auth_model where v_auth_model.model_type=modelType and FIND_IN_SET(v_auth_model.id,cids);
......
...@@ -48,13 +48,14 @@ export default { ...@@ -48,13 +48,14 @@ export default {
watch: { watch: {
'options.attrs.multiple': function(value) { 'options.attrs.multiple': function(value) {
const sourceValue = this.options.value const sourceValue = this.options.value
const sourceValid = !!sourceValue && Object.keys(sourceValue).length > 0
if (value) { if (value) {
!sourceValue && (this.options.value = []) !sourceValid && (this.options.value = [])
sourceValue && !Array.isArray(sourceValue) && (this.options.value = sourceValue.split(',')) sourceValid && !Array.isArray(sourceValue) && (this.options.value = sourceValue.split(','))
!this.inDraw && (this.options.value = []) !this.inDraw && (this.options.value = [])
} else { } else {
!sourceValue && (this.options.value = null) !sourceValid && (this.options.value = null)
sourceValue && Array.isArray(sourceValue) && (this.options.value = sourceValue[0]) sourceValid && Array.isArray(sourceValue) && (this.options.value = sourceValue[0])
!this.inDraw && (this.options.value = null) !this.inDraw && (this.options.value = null)
} }
} }
...@@ -68,7 +69,7 @@ export default { ...@@ -68,7 +69,7 @@ export default {
// this.$nextTick(() => { // this.$nextTick(() => {
// this.options && this.options.value && this.changeValue(this.options.value) // this.options && this.options.value && this.changeValue(this.options.value)
// }) // })
this.options && this.options.value && this.changeValue(this.options.value) this.options && this.options.value && Object.keys(this.options.value).length > 0 && this.changeValue(this.options.value)
}, },
methods: { methods: {
changeValue(value) { changeValue(value) {
......
...@@ -27,7 +27,6 @@ Vue.use(VueClipboard) ...@@ -27,7 +27,6 @@ Vue.use(VueClipboard)
Vue.use(widgets) Vue.use(widgets)
Vue.prototype.$api = api Vue.prototype.$api = api
import * as echarts from 'echarts' import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts Vue.prototype.$echarts = echarts
...@@ -73,6 +72,9 @@ Vue.component('Treeselect', Treeselect) ...@@ -73,6 +72,9 @@ Vue.component('Treeselect', Treeselect)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.hasDataPermission = function(pTarget, pSource) { Vue.prototype.hasDataPermission = function(pTarget, pSource) {
if (this.$store.state.user.user.isAdmin) {
return true
}
if (pSource && pTarget) { if (pSource && pTarget) {
return pSource.indexOf(pTarget) > -1 return pSource.indexOf(pTarget) > -1
} }
......
...@@ -9,6 +9,9 @@ export function checkPermission(pers) { ...@@ -9,6 +9,9 @@ export function checkPermission(pers) {
} }
export function hasDataPermission(pTarget, pSource) { export function hasDataPermission(pTarget, pSource) {
if (store.state.user.user.isAdmin) {
return true
}
if (pSource && pTarget) { if (pSource && pTarget) {
return pSource.indexOf(pTarget) > -1 return pSource.indexOf(pTarget) > -1
} }
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
id="label-content" id="label-content"
:style="content_class" :style="content_class"
> >
<p v-if="dimensionShow" :style="label_class"> <p v-for="item in chart.data.series" :key="item.name" :style="label_content_class">
<!-- {{ chart.data.x[0] }}--> {{ item.data[0] }}
{{ chart.data.series[0].name }}
</p> </p>
<span v-if="quotaShow" :style="label_space"> <span v-if="quotaShow" :style="label_space">
<p v-for="item in chart.data.series" :key="item.name" :style="label_content_class"> <p v-if="dimensionShow" :style="label_class">
{{ item.data[0] }} <!-- {{ chart.data.x[0] }}-->
{{ chart.data.series[0].name }}
</p> </p>
</span> </span>
</div> </div>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论