forked from github/dataease
Merge remote-tracking branch 'origin/dev-v2' into dev-v2
This commit is contained in:
commit
c65b979651
@ -1,9 +1,9 @@
|
||||
package io.dataease.home;
|
||||
|
||||
import io.dataease.license.utils.LicenseUtil;
|
||||
import io.dataease.home.manage.DeIndexManage;
|
||||
import io.dataease.utils.ModelUtils;
|
||||
import io.dataease.utils.RsaUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
@ -13,8 +13,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping
|
||||
public class RestIndexController {
|
||||
|
||||
@Value("${dataease.xpack-front-distributed:false}")
|
||||
private boolean xpackFrontDistributed;
|
||||
|
||||
@Resource
|
||||
private DeIndexManage deIndexManage;
|
||||
|
||||
@GetMapping("/dekey")
|
||||
@ResponseBody
|
||||
@ -31,8 +32,8 @@ public class RestIndexController {
|
||||
|
||||
@GetMapping("/xpackModel")
|
||||
@ResponseBody
|
||||
public boolean xpackModel() {
|
||||
return xpackFrontDistributed && LicenseUtil.licenseValid();
|
||||
public Boolean xpackModel() {
|
||||
return deIndexManage.xpackModel();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,13 @@
|
||||
package io.dataease.home.manage;
|
||||
|
||||
import io.dataease.license.config.XpackInteract;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class DeIndexManage {
|
||||
|
||||
@XpackInteract(value = "deIndexManage", replace = true)
|
||||
public Boolean xpackModel() {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -12,6 +12,7 @@ import * as vueRouter from 'vue-router'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import request from '@/config/axios'
|
||||
const { wsCache } = useCache()
|
||||
import { isNull } from '@/utils/utils'
|
||||
|
||||
const plugin = ref()
|
||||
|
||||
@ -103,11 +104,15 @@ onMounted(async () => {
|
||||
let distributed = false
|
||||
if (wsCache.get(key) === null) {
|
||||
const res = await xpackModelApi()
|
||||
wsCache.set('xpack-model-distributed', res.data)
|
||||
wsCache.set('xpack-model-distributed', isNull(res.data) ? 'null' : res.data)
|
||||
distributed = res.data
|
||||
} else {
|
||||
distributed = wsCache.get(key)
|
||||
}
|
||||
if (isNull(distributed)) {
|
||||
emits('loadFail')
|
||||
return
|
||||
}
|
||||
if (distributed) {
|
||||
const moduleName = getModuleName()
|
||||
if (window[moduleName]) {
|
||||
|
@ -12,6 +12,7 @@ import * as echarts from 'echarts'
|
||||
import router from '@/router'
|
||||
import tinymce from 'tinymce/tinymce'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import { isNull } from '@/utils/utils'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
|
||||
@ -107,11 +108,16 @@ onMounted(async () => {
|
||||
let distributed = false
|
||||
if (wsCache.get(key) === null) {
|
||||
const res = await xpackModelApi()
|
||||
wsCache.set('xpack-model-distributed', res.data)
|
||||
const resData = isNull(res.data) ? 'null' : res.data
|
||||
wsCache.set('xpack-model-distributed', resData)
|
||||
distributed = res.data
|
||||
} else {
|
||||
distributed = wsCache.get(key)
|
||||
}
|
||||
if (isNull(distributed)) {
|
||||
emits('loadFail')
|
||||
return
|
||||
}
|
||||
if (distributed) {
|
||||
if (window['DEXPack']) {
|
||||
const xpack = await window['DEXPack'].mapping[attrs.jsname]
|
||||
|
@ -204,6 +204,7 @@ watch(
|
||||
canEdit.value = false
|
||||
reShow()
|
||||
myValue.value = assignment(element.value.propValue.textValue)
|
||||
console.log('===myValue.value=' + myValue.value)
|
||||
ed.setContent(myValue.value)
|
||||
}
|
||||
}
|
||||
@ -263,6 +264,23 @@ const initCurFieldsChange = () => {
|
||||
}
|
||||
}
|
||||
|
||||
const jumpTargetAdaptor = () => {
|
||||
setTimeout(() => {
|
||||
const paragraphs = document.querySelectorAll('p')
|
||||
paragraphs.forEach(p => {
|
||||
// 如果 p 标签已经有 onclick 且包含 event.stopPropagation,则跳过
|
||||
if (
|
||||
p.getAttribute('onclick') &&
|
||||
p.getAttribute('onclick').includes('event.stopPropagation()')
|
||||
) {
|
||||
return // 已经有 stopPropagation,跳过
|
||||
}
|
||||
// 否则添加 onclick 事件
|
||||
p.setAttribute('onclick', 'event.stopPropagation()')
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
const assignment = content => {
|
||||
const on = content.match(/\[(.+?)\]/g)
|
||||
if (on) {
|
||||
@ -288,8 +306,10 @@ const assignment = content => {
|
||||
//De 本地跳转失效问题
|
||||
content = content.replace(/href="#\//g, 'href="/#/')
|
||||
content = content.replace(/href=\\"#\//g, 'href=\\"/#/')
|
||||
content = content.replace(/href=\\"#\//g, 'href=\\"/#/')
|
||||
resetSelect()
|
||||
initFontFamily(content)
|
||||
jumpTargetAdaptor()
|
||||
return content
|
||||
}
|
||||
const initFontFamily = htmlText => {
|
||||
|
@ -51,7 +51,8 @@ const removeCache = () => {
|
||||
if (
|
||||
key.startsWith('de-plugin-') ||
|
||||
key === 'de-platform-client' ||
|
||||
key === 'pwd-validity-period'
|
||||
key === 'pwd-validity-period' ||
|
||||
key === 'xpack-model-distributed'
|
||||
) {
|
||||
wsCache.delete(key)
|
||||
}
|
||||
|
@ -184,3 +184,7 @@ export function cutTargetTree(tree: BusiTreeNode[], targetId: string | number) {
|
||||
export const isLink = () => {
|
||||
return window.location.hash.startsWith('#/de-link/')
|
||||
}
|
||||
|
||||
export const isNull = arg => {
|
||||
return typeof arg === 'undefined' || arg === null || arg === 'null'
|
||||
}
|
||||
|
@ -87,6 +87,7 @@ const removeDistributeModule = () => {
|
||||
localStorage.removeItem(key)
|
||||
}
|
||||
const importLic = file => {
|
||||
removeDistributeModule()
|
||||
const reader = new FileReader()
|
||||
reader.onload = function (e) {
|
||||
const licKey = e.target.result
|
||||
@ -97,7 +98,6 @@ const importLic = file => {
|
||||
reader.readAsText(file)
|
||||
}
|
||||
const validateHandler = (param, success) => {
|
||||
removeDistributeModule()
|
||||
validateApi(param).then(success)
|
||||
}
|
||||
const getLicense = result => {
|
||||
|
@ -249,7 +249,10 @@ const quickCalc = param => {
|
||||
break
|
||||
case 'setting':
|
||||
// 选择占比外,设置自动
|
||||
resetValueFormatter(item.value)
|
||||
// 指标卡不需要重置数值格式
|
||||
if (chart.value.type !== 'indicator') {
|
||||
resetValueFormatter(item.value)
|
||||
}
|
||||
editCompare()
|
||||
break
|
||||
case 'percent':
|
||||
|
@ -97,6 +97,7 @@ export class Bar extends G2PlotChartView<ColumnOptions, Column> {
|
||||
async drawChart(drawOptions: G2PlotDrawOptions<Column>): Promise<Column> {
|
||||
const { chart, container, action } = drawOptions
|
||||
if (!chart?.data?.data?.length) {
|
||||
chart.container = container
|
||||
clearExtremum(chart)
|
||||
return
|
||||
}
|
||||
|
@ -98,6 +98,7 @@ export class Area extends G2PlotChartView<AreaOptions, G2Area> {
|
||||
async drawChart(drawOptions: G2PlotDrawOptions<G2Area>): Promise<G2Area> {
|
||||
const { chart, container, action } = drawOptions
|
||||
if (!chart.data?.data?.length) {
|
||||
chart.container = container
|
||||
clearExtremum(chart)
|
||||
return
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ export class Line extends G2PlotChartView<LineOptions, G2Line> {
|
||||
async drawChart(drawOptions: G2PlotDrawOptions<G2Line>): Promise<G2Line> {
|
||||
const { chart, action, container } = drawOptions
|
||||
if (!chart.data?.data?.length) {
|
||||
chart.container = container
|
||||
clearExtremum(chart)
|
||||
return
|
||||
}
|
||||
|
2
de-xpack
2
de-xpack
@ -1 +1 @@
|
||||
Subproject commit d415457510f49faf552ad2bfe51030f8c228e736
|
||||
Subproject commit 686ee95e622fbd16e04cf0847d0a84dbe9a59488
|
Loading…
Reference in New Issue
Block a user