提交 7241e260 authored 作者: taojinlong's avatar taojinlong

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

......@@ -26,8 +26,8 @@ public class CacheUtils {
public static Object get(String cacheName, Object key) {
if (getCacheManager() instanceof RedisCacheManager) {
org.springframework.cache.Cache cache = getCacheManager().getCache(cacheName);
if (null == cache) return null;
return cache.get(key);
if (null == cache || null == cache.get(key)) return null;
return cache.get(key).get();
}
Element element = cache(cacheName).get(key);
if (null == element) return null;
......@@ -36,9 +36,12 @@ public class CacheUtils {
public static void put(String cacheName, Object key, Object value, Integer ttl, Integer tti) {
if (getCacheManager() instanceof RedisCacheManager) {
RedisTemplate redisTemplate = (RedisTemplate) CommonBeanFactory.getBean("redisTemplate");
/*RedisTemplate redisTemplate = (RedisTemplate) CommonBeanFactory.getBean("redisTemplate");
ValueOperations valueOperations = redisTemplate.opsForValue();
valueOperations.set(cacheName + "::" + key , value );
valueOperations.set(cacheName + "::" + key , value );*/
org.springframework.cache.Cache cache = getCacheManager().getCache(cacheName);
if (null == cache) return;
cache.put(key, value);
return;
}
Element e = new Element(key, value);
......
......@@ -62,7 +62,7 @@ export function baseGaugeOption(chart_option, chart) {
const per = parseFloat(chart.data.series[0].data[0]) / parseFloat(chart_option.series[0].max)
for (let i = 0; i < arr.length; i++) {
const ele = arr[i]
const p = parseInt(ele) / 100
const p = parseFloat(ele) / 100
range.push([p, hexColorToRGBA(customAttr.color.colors[i % customAttr.color.colors.length], customAttr.color.alpha)])
if (!flag && per <= p) {
flag = true
......
......@@ -48,7 +48,7 @@ export function baseGaugeOptionAntV(plot, container, chart, action) {
const arr = threshold.gaugeThreshold.split(',')
for (let i = 0; i < arr.length; i++) {
const ele = arr[i]
const p = parseInt(ele) / 100
const p = parseFloat(ele) / 100
range.push(p)
if (!flag && per <= p) {
flag = true
......
......@@ -9,7 +9,7 @@
<span>,100</span>
<el-tooltip class="item" effect="dark" placement="bottom">
<div slot="content">
阈值设置,决定仪表盘区间颜色,为空则不开启阈值,范围(0-100),仅限整数,且逐级递增
阈值设置,决定仪表盘区间颜色,为空则不开启阈值,范围(0-100),逐级递增
<br>
例如:输入 30,70;表示:分为3段,分别为[0,30],(30,70],(70,100]
</div>
......@@ -129,7 +129,7 @@ export default {
const arr = this.thresholdForm.gaugeThreshold.split(',')
for (let i = 0; i < arr.length; i++) {
const ele = arr[i]
if (ele.indexOf('.') > -1 || parseInt(ele).toString() === 'NaN' || parseInt(ele) < 1 || parseInt(ele) > 99) {
if (parseFloat(ele).toString() === 'NaN' || parseFloat(ele) < 1 || parseFloat(ele) > 99) {
this.$message({
message: this.$t('chart.gauge_threshold_format_error'),
type: 'error',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论