commit
3968e2ae02
@ -2,17 +2,16 @@ package io.dataease.auth.filter;
|
|||||||
|
|
||||||
import io.dataease.auth.entity.ASKToken;
|
import io.dataease.auth.entity.ASKToken;
|
||||||
import io.dataease.auth.entity.JWTToken;
|
import io.dataease.auth.entity.JWTToken;
|
||||||
|
|
||||||
import io.dataease.auth.handler.ApiKeyHandler;
|
import io.dataease.auth.handler.ApiKeyHandler;
|
||||||
|
import io.dataease.commons.license.DefaultLicenseService;
|
||||||
|
import io.dataease.commons.license.F2CLicenseResponse;
|
||||||
|
import io.dataease.commons.utils.CommonBeanFactory;
|
||||||
import io.dataease.commons.utils.LogUtil;
|
import io.dataease.commons.utils.LogUtil;
|
||||||
import io.dataease.commons.utils.TokenCacheUtils;
|
import io.dataease.commons.utils.TokenCacheUtils;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.shiro.authc.AuthenticationException;
|
import org.apache.shiro.authc.AuthenticationException;
|
||||||
import org.apache.shiro.subject.Subject;
|
import org.apache.shiro.subject.Subject;
|
||||||
import org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter;
|
import org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter;
|
||||||
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
|
||||||
@ -26,6 +25,7 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
|
|||||||
|
|
||||||
|
|
||||||
public final static String expireMessage = "Login token is expire.";
|
public final static String expireMessage = "Login token is expire.";
|
||||||
|
public final static String licMessage = "license invalid";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,6 +49,17 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
|
|||||||
|
|
||||||
if (ApiKeyHandler.isApiKeyCall(httpServletRequest)) {
|
if (ApiKeyHandler.isApiKeyCall(httpServletRequest)) {
|
||||||
|
|
||||||
|
DefaultLicenseService licenseService = CommonBeanFactory.getBean(DefaultLicenseService.class);
|
||||||
|
F2CLicenseResponse licenseResponse = null;
|
||||||
|
try {
|
||||||
|
licenseResponse = licenseService.validateLicense();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new AuthenticationException(licMessage);
|
||||||
|
}
|
||||||
|
if (licenseResponse.getStatus() != F2CLicenseResponse.Status.valid) {
|
||||||
|
throw new AuthenticationException(licMessage);
|
||||||
|
}
|
||||||
|
|
||||||
ASKToken askToken = ApiKeyHandler.buildToken(httpServletRequest);
|
ASKToken askToken = ApiKeyHandler.buildToken(httpServletRequest);
|
||||||
|
|
||||||
getSubject(request, response).login(askToken);
|
getSubject(request, response).login(askToken);
|
||||||
@ -87,6 +98,8 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
|
|||||||
LogUtil.error(e);
|
LogUtil.error(e);
|
||||||
if (e instanceof AuthenticationException && StringUtils.equals(e.getMessage(), expireMessage)) {
|
if (e instanceof AuthenticationException && StringUtils.equals(e.getMessage(), expireMessage)) {
|
||||||
responseExpire(request, response, e);
|
responseExpire(request, response, e);
|
||||||
|
} else if (StringUtils.equals(licMessage, e.getMessage())) {
|
||||||
|
responseLicError(request, response, e);
|
||||||
} else {
|
} else {
|
||||||
tokenError(request, response, e);
|
tokenError(request, response, e);
|
||||||
}
|
}
|
||||||
@ -127,4 +140,10 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
|
|||||||
httpServletResponse.setHeader("authentication-status", "login_expire");
|
httpServletResponse.setHeader("authentication-status", "login_expire");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void responseLicError(ServletRequest req, ServletResponse resp, Exception e1) {
|
||||||
|
HttpServletResponse httpServletResponse = (HttpServletResponse) resp;
|
||||||
|
httpServletResponse.addHeader("Access-Control-Expose-Headers", "authentication-status");
|
||||||
|
httpServletResponse.setHeader("authentication-status", licMessage);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,8 @@ public interface ExtPanelGroupMapper {
|
|||||||
//会级联删除pid 下的所有数据
|
//会级联删除pid 下的所有数据
|
||||||
int deleteCircle(@Param("pid") String pid, @Param("nodeType") String nodeType);
|
int deleteCircle(@Param("pid") String pid, @Param("nodeType") String nodeType);
|
||||||
|
|
||||||
|
int deleteLinkDefaultCircle(@Param("pid") String pid);
|
||||||
|
|
||||||
int deleteCircleView(@Param("pid") String pid, @Param("nodeType") String nodeType);
|
int deleteCircleView(@Param("pid") String pid, @Param("nodeType") String nodeType);
|
||||||
|
|
||||||
int deleteCircleViewCache(@Param("pid") String pid, @Param("nodeType") String nodeType);
|
int deleteCircleViewCache(@Param("pid") String pid, @Param("nodeType") String nodeType);
|
||||||
|
|||||||
@ -202,6 +202,10 @@
|
|||||||
ORDER BY panel_group.node_type desc, CONVERT(panel_group.name using gbk)
|
ORDER BY panel_group.node_type desc, CONVERT(panel_group.name using gbk)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<delete id="deleteLinkDefaultCircle">
|
||||||
|
delete from panel_group where FIND_IN_SET(panel_group.source, GET_PANEL_GROUP_WITH_CHILDREN(#{pid}))
|
||||||
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteCircle">
|
<delete id="deleteCircle">
|
||||||
delete
|
delete
|
||||||
from panel_group
|
from panel_group
|
||||||
@ -211,7 +215,6 @@
|
|||||||
panel_group.source = #{pid}
|
panel_group.source = #{pid}
|
||||||
<if test="nodeType == 'folder'">
|
<if test="nodeType == 'folder'">
|
||||||
or FIND_IN_SET(panel_group.id, GET_PANEL_GROUP_WITH_CHILDREN(#{pid}))
|
or FIND_IN_SET(panel_group.id, GET_PANEL_GROUP_WITH_CHILDREN(#{pid}))
|
||||||
or FIND_IN_SET(panel_group.source, GET_PANEL_GROUP_WITH_CHILDREN(#{pid}))
|
|
||||||
</if>
|
</if>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|||||||
@ -725,7 +725,9 @@ public class ChartViewService {
|
|||||||
xAxis = xAxis.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.keySet().contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
|
xAxis = xAxis.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.keySet().contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
|
||||||
yAxis = yAxis.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.keySet().contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
|
yAxis = yAxis.stream().filter(item -> chartViewFieldNameList.contains(item.getDataeaseName()) || (!desensitizationList.keySet().contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
Map<String, ChartViewFieldDTO> chartFieldMap = Stream.of(xAxisBase, xAxisExt, extStack)
|
||||||
|
.flatMap(Collection::stream)
|
||||||
|
.collect(Collectors.toMap(ChartViewFieldDTO::getId, o -> o, ((p, n) -> p)));
|
||||||
// 过滤来自仪表板的条件
|
// 过滤来自仪表板的条件
|
||||||
List<ChartExtFilterRequest> extFilterList = new ArrayList<>();
|
List<ChartExtFilterRequest> extFilterList = new ArrayList<>();
|
||||||
//组件过滤条件
|
//组件过滤条件
|
||||||
@ -834,6 +836,14 @@ public class ChartViewService {
|
|||||||
if (!desensitizationList.keySet().contains(datasetTableField.getDataeaseName()) && dataeaseNames.contains(datasetTableField.getDataeaseName())) {
|
if (!desensitizationList.keySet().contains(datasetTableField.getDataeaseName()) && dataeaseNames.contains(datasetTableField.getDataeaseName())) {
|
||||||
request.setDatasetTableField(datasetTableField);
|
request.setDatasetTableField(datasetTableField);
|
||||||
if (StringUtils.equalsIgnoreCase(datasetTableField.getTableId(), view.getTableId())) {
|
if (StringUtils.equalsIgnoreCase(datasetTableField.getTableId(), view.getTableId())) {
|
||||||
|
// 设置日期格式,以视图字段设置的格式为准,先不处理组件的条件,因为格式无法统一。
|
||||||
|
if (request.getDatasetTableField() != null) {
|
||||||
|
ChartViewFieldDTO chartViewFieldDTO = chartFieldMap.get(request.getDatasetTableField().getId());
|
||||||
|
if (chartViewFieldDTO != null) {
|
||||||
|
request.setDatePattern(chartViewFieldDTO.getDatePattern());
|
||||||
|
request.setDateStyle(chartViewFieldDTO.getDateStyle());
|
||||||
|
}
|
||||||
|
}
|
||||||
if (CollectionUtils.isNotEmpty(request.getViewIds())) {
|
if (CollectionUtils.isNotEmpty(request.getViewIds())) {
|
||||||
if (request.getViewIds().contains(view.getId())) {
|
if (request.getViewIds().contains(view.getId())) {
|
||||||
extFilterList.add(request);
|
extFilterList.add(request);
|
||||||
@ -883,9 +893,6 @@ public class ChartViewService {
|
|||||||
ChartDrillRequest head = drillRequestList.get(0);
|
ChartDrillRequest head = drillRequestList.get(0);
|
||||||
Map<String, String> dimValMap = new HashMap<>();
|
Map<String, String> dimValMap = new HashMap<>();
|
||||||
head.getDimensionList().forEach(item -> dimValMap.put(item.getId(), item.getValue()));
|
head.getDimensionList().forEach(item -> dimValMap.put(item.getId(), item.getValue()));
|
||||||
Map<String, ChartViewFieldDTO> fieldMap = Stream.of(xAxisBase, xAxisExt, extStack)
|
|
||||||
.flatMap(Collection::stream)
|
|
||||||
.collect(Collectors.toMap(ChartViewFieldDTO::getId, o -> o, ((p, n) -> p)));
|
|
||||||
for (int i = 0; i < drillRequestList.size(); i++) {
|
for (int i = 0; i < drillRequestList.size(); i++) {
|
||||||
ChartDrillRequest request = drillRequestList.get(i);
|
ChartDrillRequest request = drillRequestList.get(i);
|
||||||
ChartViewFieldDTO chartViewFieldDTO = drill.get(i);
|
ChartViewFieldDTO chartViewFieldDTO = drill.get(i);
|
||||||
@ -896,7 +903,7 @@ public class ChartViewService {
|
|||||||
fieldsToFilter.add(chartViewFieldDTO);
|
fieldsToFilter.add(chartViewFieldDTO);
|
||||||
dimValMap.put(requestDimension.getId(), requestDimension.getValue());
|
dimValMap.put(requestDimension.getId(), requestDimension.getValue());
|
||||||
if (!checkDrillExist(xAxis, extStack, requestDimension.getId(), view)) {
|
if (!checkDrillExist(xAxis, extStack, requestDimension.getId(), view)) {
|
||||||
fieldMap.put(chartViewFieldDTO.getId(), chartViewFieldDTO);
|
chartFieldMap.put(chartViewFieldDTO.getId(), chartViewFieldDTO);
|
||||||
xAxis.add(chartViewFieldDTO);
|
xAxis.add(chartViewFieldDTO);
|
||||||
}
|
}
|
||||||
if (i == drillRequestList.size() - 1) {
|
if (i == drillRequestList.size() - 1) {
|
||||||
@ -916,8 +923,8 @@ public class ChartViewService {
|
|||||||
DatasetTableField datasetTableField = dataSetTableFieldsService.get(tmpField.getId());
|
DatasetTableField datasetTableField = dataSetTableFieldsService.get(tmpField.getId());
|
||||||
tmpFilter.setDatasetTableField(datasetTableField);
|
tmpFilter.setDatasetTableField(datasetTableField);
|
||||||
tmpFilter.setOperator("in");
|
tmpFilter.setOperator("in");
|
||||||
tmpFilter.setDateStyle(fieldMap.get(tmpField.getId()).getDateStyle());
|
tmpFilter.setDateStyle(chartFieldMap.get(tmpField.getId()).getDateStyle());
|
||||||
tmpFilter.setDatePattern(fieldMap.get(tmpField.getId()).getDatePattern());
|
tmpFilter.setDatePattern(chartFieldMap.get(tmpField.getId()).getDatePattern());
|
||||||
tmpFilter.setFieldId(tmpField.getId());
|
tmpFilter.setFieldId(tmpField.getId());
|
||||||
tmpFilter.setValue(Collections.singletonList(dimValMap.get(tmpField.getId())));
|
tmpFilter.setValue(Collections.singletonList(dimValMap.get(tmpField.getId())));
|
||||||
extFilterList.add(tmpFilter);
|
extFilterList.add(tmpFilter);
|
||||||
|
|||||||
@ -1070,7 +1070,7 @@ public class DataSetTableService {
|
|||||||
defaultsSqlVariableDetail.getDefaultValueScope().equals(SqlVariableDetails.DefaultValueScope.ALLSCOPE) && StringUtils.isNotEmpty(defaultsSqlVariableDetail.getDefaultValue())) {
|
defaultsSqlVariableDetail.getDefaultValueScope().equals(SqlVariableDetails.DefaultValueScope.ALLSCOPE) && StringUtils.isNotEmpty(defaultsSqlVariableDetail.getDefaultValue())) {
|
||||||
sql = sql.replace(matcher.group(), defaultsSqlVariableDetail.getDefaultValue());
|
sql = sql.replace(matcher.group(), defaultsSqlVariableDetail.getDefaultValue());
|
||||||
}
|
}
|
||||||
if (isEdit && defaultsSqlVariableDetail != null && StringUtils.isNotEmpty(defaultsSqlVariableDetail.getDefaultValue())){
|
if (isEdit && defaultsSqlVariableDetail != null && StringUtils.isNotEmpty(defaultsSqlVariableDetail.getDefaultValue())) {
|
||||||
sql = sql.replace(matcher.group(), defaultsSqlVariableDetail.getDefaultValue());
|
sql = sql.replace(matcher.group(), defaultsSqlVariableDetail.getDefaultValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1170,7 +1170,7 @@ public class DataSetTableService {
|
|||||||
if (binaryExpression != null) {
|
if (binaryExpression != null) {
|
||||||
if (!(binaryExpression.getLeftExpression() instanceof BinaryExpression) && !(binaryExpression.getLeftExpression() instanceof InExpression) && hasVariable(binaryExpression.getRightExpression().toString())) {
|
if (!(binaryExpression.getLeftExpression() instanceof BinaryExpression) && !(binaryExpression.getLeftExpression() instanceof InExpression) && hasVariable(binaryExpression.getRightExpression().toString())) {
|
||||||
stringBuilder.append(SubstitutedSql);
|
stringBuilder.append(SubstitutedSql);
|
||||||
}else {
|
} else {
|
||||||
expr.accept(getExpressionDeParser(stringBuilder));
|
expr.accept(getExpressionDeParser(stringBuilder));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1257,7 +1257,7 @@ public class DataSetTableService {
|
|||||||
throw new Exception(Translator.get("i18n_invalid_ds"));
|
throw new Exception(Translator.get("i18n_invalid_ds"));
|
||||||
}
|
}
|
||||||
String tmpSql = removeVariables(sql, ds.getType());
|
String tmpSql = removeVariables(sql, ds.getType());
|
||||||
if(!realData){
|
if (!realData) {
|
||||||
tmpSql.replaceAll(SubstitutedSql, SubstitutedSqlVirtualData);
|
tmpSql.replaceAll(SubstitutedSql, SubstitutedSqlVirtualData);
|
||||||
}
|
}
|
||||||
if (dataSetTableRequest.getMode() == 1 && (tmpSql.contains(SubstitutedParams) || tmpSql.contains(SubstitutedSql.trim()))) {
|
if (dataSetTableRequest.getMode() == 1 && (tmpSql.contains(SubstitutedParams) || tmpSql.contains(SubstitutedSql.trim()))) {
|
||||||
@ -2021,7 +2021,9 @@ public class DataSetTableService {
|
|||||||
// custom 创建doris视图
|
// custom 创建doris视图
|
||||||
createDorisView(TableUtils.tableName(datasetTable.getId()), sql);
|
createDorisView(TableUtils.tableName(datasetTable.getId()), sql);
|
||||||
|
|
||||||
datasourceRequest.setQuery(sql);
|
// getQuerySql to get field
|
||||||
|
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||||
|
datasourceRequest.setQuery(qp.createSQLPreview(sql, null));
|
||||||
fields = datasourceProvider.fetchResultField(datasourceRequest);
|
fields = datasourceProvider.fetchResultField(datasourceRequest);
|
||||||
for (DatasetTableField field : fieldList) {
|
for (DatasetTableField field : fieldList) {
|
||||||
for (TableField tableField : fields) {
|
for (TableField tableField : fields) {
|
||||||
@ -2044,8 +2046,9 @@ public class DataSetTableService {
|
|||||||
String sql = (String) sqlMap.get("sql");
|
String sql = (String) sqlMap.get("sql");
|
||||||
List<DatasetTableField> fieldList = (List<DatasetTableField>) sqlMap.get("field");
|
List<DatasetTableField> fieldList = (List<DatasetTableField>) sqlMap.get("field");
|
||||||
|
|
||||||
|
// getQuerySql to get field
|
||||||
datasourceRequest.setQuery(sql);
|
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||||
|
datasourceRequest.setQuery(qp.createSQLPreview(sql, null));
|
||||||
fields = datasourceProvider.fetchResultField(datasourceRequest);
|
fields = datasourceProvider.fetchResultField(datasourceRequest);
|
||||||
|
|
||||||
for (DatasetTableField field : fieldList) {
|
for (DatasetTableField field : fieldList) {
|
||||||
|
|||||||
@ -305,6 +305,7 @@ public class PanelGroupService {
|
|||||||
extPanelGroupMapper.deleteCircleView(id, nodeType);
|
extPanelGroupMapper.deleteCircleView(id, nodeType);
|
||||||
extPanelGroupMapper.deleteCircleViewCache(id, nodeType);
|
extPanelGroupMapper.deleteCircleViewCache(id, nodeType);
|
||||||
// 同时会删除对应默认仪表盘
|
// 同时会删除对应默认仪表盘
|
||||||
|
extPanelGroupMapper.deleteLinkDefaultCircle(id);
|
||||||
extPanelGroupMapper.deleteCircle(id, nodeType);
|
extPanelGroupMapper.deleteCircle(id, nodeType);
|
||||||
storeService.removeByPanelId(id);
|
storeService.removeByPanelId(id);
|
||||||
shareService.delete(id, null);
|
shareService.delete(id, null);
|
||||||
|
|||||||
@ -447,12 +447,13 @@ export default {
|
|||||||
this.currentElement = JSON.parse(JSON.stringify(this.element))
|
this.currentElement = JSON.parse(JSON.stringify(this.element))
|
||||||
this.myAttrs = this.currentElement.options.attrs
|
this.myAttrs = this.currentElement.options.attrs
|
||||||
this.treeNode(this.groupForm)
|
this.treeNode(this.groupForm)
|
||||||
|
this.loadViews()
|
||||||
if (this.myAttrs && this.myAttrs.dragItems) {
|
if (this.myAttrs && this.myAttrs.dragItems) {
|
||||||
this.enableSureButton()
|
this.enableSureButton()
|
||||||
}
|
}
|
||||||
|
|
||||||
this.initWithField()
|
this.initWithField()
|
||||||
this.loadViews()
|
|
||||||
this.ProhibitMultiple()
|
this.ProhibitMultiple()
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -462,7 +463,29 @@ export default {
|
|||||||
bus.$off('valid-values-change', this.validateFilterValue)
|
bus.$off('valid-values-change', this.validateFilterValue)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
checkSuperior(list) {
|
||||||
|
let fieldValid = false
|
||||||
|
const fieldId = this.myAttrs?.fieldId
|
||||||
|
if (fieldId && list?.length) {
|
||||||
|
const stack = [...list]
|
||||||
|
while (stack.length) {
|
||||||
|
const item = stack.pop()
|
||||||
|
if (item.id === fieldId) {
|
||||||
|
fieldValid = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if (item.children?.length) {
|
||||||
|
item.children.forEach(kid => stack.push(kid))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!fieldValid) {
|
||||||
|
this.myAttrs.fieldId = null
|
||||||
|
this.myAttrs.dragItems = []
|
||||||
|
this.myAttrs.fieldsParent = null
|
||||||
|
}
|
||||||
|
return fieldValid
|
||||||
|
},
|
||||||
treeNode(cache) {
|
treeNode(cache) {
|
||||||
const modelInfo = localStorage.getItem('dataset-tree')
|
const modelInfo = localStorage.getItem('dataset-tree')
|
||||||
const userCache = (modelInfo && cache)
|
const userCache = (modelInfo && cache)
|
||||||
@ -471,6 +494,7 @@ export default {
|
|||||||
const results = this.buildTree(this.tData)
|
const results = this.buildTree(this.tData)
|
||||||
this.defaultData = JSON.parse(JSON.stringify(results))
|
this.defaultData = JSON.parse(JSON.stringify(results))
|
||||||
this.treeData = JSON.parse(JSON.stringify(results))
|
this.treeData = JSON.parse(JSON.stringify(results))
|
||||||
|
return
|
||||||
}
|
}
|
||||||
queryAuthModel({ modelType: 'dataset' }, !userCache).then(res => {
|
queryAuthModel({ modelType: 'dataset' }, !userCache).then(res => {
|
||||||
localStorage.setItem('dataset-tree', JSON.stringify(res.data))
|
localStorage.setItem('dataset-tree', JSON.stringify(res.data))
|
||||||
@ -488,8 +512,8 @@ export default {
|
|||||||
if (this.myAttrs.fieldsParent) {
|
if (this.myAttrs.fieldsParent) {
|
||||||
this.fieldsParent = this.myAttrs.fieldsParent
|
this.fieldsParent = this.myAttrs.fieldsParent
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.activeName === 'dataset' && this.showFieldData(this.fieldsParent)
|
this.activeName === 'dataset' && this.showFieldData(this.fieldsParent, true)
|
||||||
this.activeName !== 'dataset' && this.comShowFieldData(this.fieldsParent)
|
this.activeName !== 'dataset' && this.comShowFieldData(this.fieldsParent, true)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -692,7 +716,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
removeTail(bread) {
|
removeTail(bread) {
|
||||||
if (!bread.id) {
|
if (!bread?.id) {
|
||||||
this.dataSetBreads = this.dataSetBreads.slice(0, 1)
|
this.dataSetBreads = this.dataSetBreads.slice(0, 1)
|
||||||
this.dataSetBreads[this.dataSetBreads.length - 1]['link'] = false
|
this.dataSetBreads[this.dataSetBreads.length - 1]['link'] = false
|
||||||
return
|
return
|
||||||
@ -718,7 +742,7 @@ export default {
|
|||||||
this.expandedArray = []
|
this.expandedArray = []
|
||||||
this.keyWord = ''
|
this.keyWord = ''
|
||||||
this.isTreeSearch = false
|
this.isTreeSearch = false
|
||||||
if (bread.id) {
|
if (bread?.id) {
|
||||||
const node = this.getNode(bread.id, this.treeData)
|
const node = this.getNode(bread.id, this.treeData)
|
||||||
if (node) {
|
if (node) {
|
||||||
this.tempTreeData = node.children
|
this.tempTreeData = node.children
|
||||||
@ -736,15 +760,17 @@ export default {
|
|||||||
this.comRemoveTail()
|
this.comRemoveTail()
|
||||||
},
|
},
|
||||||
|
|
||||||
loadField(tableId) {
|
async loadField(tableId, init) {
|
||||||
fieldListWithPermission(tableId).then(res => {
|
const res = await fieldListWithPermission(tableId)
|
||||||
let data = res.data
|
let data = res.data || []
|
||||||
if (this.widget && this.widget.filterFieldMethod) {
|
if (init && !this.checkSuperior(data)) {
|
||||||
data = this.widget.filterFieldMethod(data)
|
this.backToLink()
|
||||||
}
|
}
|
||||||
this.originFieldData = data
|
if (this.widget && this.widget.filterFieldMethod) {
|
||||||
this.fieldData = JSON.parse(JSON.stringify(data))
|
data = this.widget.filterFieldMethod(data)
|
||||||
})
|
}
|
||||||
|
this.originFieldData = data
|
||||||
|
this.fieldData = JSON.parse(JSON.stringify(data))
|
||||||
},
|
},
|
||||||
loadDatasetParams(tableId) {
|
loadDatasetParams(tableId) {
|
||||||
var type = 'TEXT'
|
var type = 'TEXT'
|
||||||
@ -758,22 +784,24 @@ export default {
|
|||||||
this.datasetParams = res.data || []
|
this.datasetParams = res.data || []
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
comLoadField(tableId) {
|
async comLoadField(tableId, init) {
|
||||||
fieldListWithPermission(tableId).then(res => {
|
const res = await fieldListWithPermission(tableId)
|
||||||
let data = res.data
|
let data = res.data || []
|
||||||
if (this.widget && this.widget.filterFieldMethod) {
|
if (init && !this.checkSuperior(data)) {
|
||||||
data = this.widget.filterFieldMethod(data)
|
this.comBackLink()
|
||||||
}
|
}
|
||||||
this.originComFieldData = data
|
if (this.widget && this.widget.filterFieldMethod) {
|
||||||
this.comFieldData = JSON.parse(JSON.stringify(data))
|
data = this.widget.filterFieldMethod(data)
|
||||||
})
|
}
|
||||||
|
this.originComFieldData = data
|
||||||
|
this.comFieldData = JSON.parse(JSON.stringify(data))
|
||||||
},
|
},
|
||||||
showFieldData(row) {
|
showFieldData(row, init) {
|
||||||
this.keyWord = ''
|
this.keyWord = ''
|
||||||
this.showDomType = 'field'
|
this.showDomType = 'field'
|
||||||
this.addQueue(row)
|
this.addQueue(row)
|
||||||
this.fieldsParent = row
|
this.fieldsParent = row
|
||||||
this.loadField(row.id)
|
this.loadField(row.id, init)
|
||||||
this.loadDatasetParams(row.id)
|
this.loadDatasetParams(row.id)
|
||||||
},
|
},
|
||||||
showNextGroup(row) {
|
showNextGroup(row) {
|
||||||
@ -782,13 +810,13 @@ export default {
|
|||||||
this.showDomType = 'tree'
|
this.showDomType = 'tree'
|
||||||
this.addQueue(row)
|
this.addQueue(row)
|
||||||
},
|
},
|
||||||
comShowFieldData(row) {
|
comShowFieldData(row, init) {
|
||||||
this.viewKeyWord = ''
|
this.viewKeyWord = ''
|
||||||
this.comShowDomType = 'field'
|
this.comShowDomType = 'field'
|
||||||
this.comSetTailLink(row)
|
this.comSetTailLink(row)
|
||||||
this.comAddTail(row)
|
this.comAddTail(row)
|
||||||
this.fieldsParent = row
|
this.fieldsParent = row
|
||||||
this.comLoadField(row.tableId)
|
this.comLoadField(row.tableId, init)
|
||||||
},
|
},
|
||||||
onMove(e, originalEvent) {
|
onMove(e, originalEvent) {
|
||||||
this.showTips = false
|
this.showTips = false
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
style="border-bottom: 1px solid;border-bottom-color:#E6E6E6;"
|
style="border-bottom: 1px solid;border-bottom-color:#E6E6E6;"
|
||||||
>
|
>
|
||||||
<div style="height: 100%;">
|
<div style="height: 100%;">
|
||||||
<share-head />
|
<share-head/>
|
||||||
</div>
|
</div>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row
|
<el-row
|
||||||
@ -29,21 +29,26 @@
|
|||||||
<div style="height: 100%;">
|
<div style="height: 100%;">
|
||||||
<el-col
|
<el-col
|
||||||
:span="12"
|
:span="12"
|
||||||
style="text-overflow:ellipsis;overflow: hidden;white-space: nowrap;font-size: 14px"
|
style="font-size: 14px;display: flex"
|
||||||
>
|
>
|
||||||
<span class="panel-name">{{ panelInfo.name || '测试仪表板' }}</span>
|
<div :title="showName" style="text-overflow:ellipsis;overflow: hidden;white-space: nowrap;font-size: 14px;max-width: 300px"><span
|
||||||
<span
|
class="panel-name"
|
||||||
v-if="panelInfo.isDefault"
|
|
||||||
style="color: green;font-size: 12px"
|
|
||||||
>({{ $t('panel.default_panel_name') }}:{{ panelInfo.defaultPanelName }})</span>
|
|
||||||
<span
|
|
||||||
v-if="panelInfo.sourcePanelName"
|
|
||||||
style="color: green;font-size: 12px"
|
|
||||||
> ({{ $t('panel.source_panel_name') }}:{{ panelInfo.sourcePanelName }})</span>
|
|
||||||
<span
|
|
||||||
v-if="!hasStar && panelInfo && showType !== 1&&panelInfo.status==='publish'"
|
|
||||||
style="margin-left: 9px"
|
|
||||||
>
|
>
|
||||||
|
{{ panelInfo.name || '测试仪表板' }}</span>
|
||||||
|
<span
|
||||||
|
v-if="panelInfo.isDefault"
|
||||||
|
style="color: green;font-size: 12px"
|
||||||
|
>({{ $t('panel.default_panel_name') }}:{{ panelInfo.defaultPanelName }})</span>
|
||||||
|
<span
|
||||||
|
v-if="panelInfo.sourcePanelName"
|
||||||
|
style="color: green;font-size: 12px"
|
||||||
|
> ({{ $t('panel.source_panel_name') }}:{{ panelInfo.sourcePanelName }})</span>
|
||||||
|
</div>
|
||||||
|
<div style="width: 200px">
|
||||||
|
<span
|
||||||
|
v-if="!hasStar && panelInfo && showType !== 1&&panelInfo.status==='publish'"
|
||||||
|
style="margin-left: 9px"
|
||||||
|
>
|
||||||
<el-tooltip :content="$t('panel.store')">
|
<el-tooltip :content="$t('panel.store')">
|
||||||
<i
|
<i
|
||||||
class="el-icon-star-off"
|
class="el-icon-star-off"
|
||||||
@ -51,10 +56,10 @@
|
|||||||
/>
|
/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
v-if="hasStar && panelInfo && showType !== 1&&panelInfo.status==='publish'"
|
v-if="hasStar && panelInfo && showType !== 1&&panelInfo.status==='publish'"
|
||||||
style="margin-left: 9px"
|
style="margin-left: 9px"
|
||||||
>
|
>
|
||||||
<el-tooltip :content="$t('commons.cancel') + $t('panel.store')">
|
<el-tooltip :content="$t('commons.cancel') + $t('panel.store')">
|
||||||
<i
|
<i
|
||||||
class="el-icon-star-on"
|
class="el-icon-star-on"
|
||||||
@ -62,23 +67,27 @@
|
|||||||
/>
|
/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</span>
|
</span>
|
||||||
<template v-if="panelInfo.creatorName">
|
<template v-if="panelInfo.creatorName">
|
||||||
<el-divider
|
<el-divider
|
||||||
style="margin: 0 16px;"
|
style="margin: 0 16px;"
|
||||||
direction="vertical"
|
direction="vertical"
|
||||||
/>
|
/>
|
||||||
<span class="panel-create">
|
<span class="panel-create">
|
||||||
{{ $t('panel.create_by') + ':' + panelInfo.creatorName }}
|
{{ $t('panel.create_by') + ':' + panelInfo.creatorName }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="right-start"
|
placement="right-start"
|
||||||
width="400"
|
width="400"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
>
|
>
|
||||||
<panel-detail-info />
|
<panel-detail-info/>
|
||||||
<svg-icon slot="reference" style="margin-left: 4px;cursor: pointer;font-size: 14px;" class="icon-class" icon-class="icon_info_outlined" />
|
<svg-icon slot="reference" style="margin-left: 4px;cursor: pointer;font-size: 14px;" class="icon-class"
|
||||||
</el-popover>
|
icon-class="icon_info_outlined"
|
||||||
|
/>
|
||||||
|
</el-popover>
|
||||||
|
</div>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
||||||
@ -427,6 +436,17 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
showName(){
|
||||||
|
let name = this.panelInfo.name || '测试仪表板'
|
||||||
|
if(this.panelInfo.isDefault){
|
||||||
|
name = name +'('+ this.$t('panel.default_panel_name') +':'+ this.panelInfo.defaultPanelName +')'
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.panelInfo.sourcePanelName){
|
||||||
|
name = name +'('+ this.$t('panel.source_panel_name') +':'+ this.panelInfo.sourcePanelName +')'
|
||||||
|
}
|
||||||
|
return name
|
||||||
|
},
|
||||||
mainCanvasComponentData() {
|
mainCanvasComponentData() {
|
||||||
return getNowCanvasComponentData(this.canvasId)
|
return getNowCanvasComponentData(this.canvasId)
|
||||||
},
|
},
|
||||||
@ -841,6 +861,7 @@ export default {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
|
flex: 1;
|
||||||
color: var(--deTextPrimary, #1F2329);
|
color: var(--deTextPrimary, #1F2329);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user