Merge branch 'dev' into pr@dev_station_msg

This commit is contained in:
dataeaseShu 2022-08-31 18:41:38 +08:00
commit 1ba1c30355
15 changed files with 78 additions and 26 deletions

View File

@ -21,4 +21,8 @@ public class AuthConstants {
public final static String DEPT_DATASET_NAME = "dept_dataset";
public final static String DEPT_PANEL_NAME = "dept_panel";
public static final String DE_DOWN_ERROR_KEY = "de-down-error-msg";
}

View File

@ -1,7 +1,7 @@
package io.dataease.plugins.server;
import io.dataease.commons.exception.DEException;
import io.dataease.i18n.Translator;
import io.dataease.commons.constants.AuthConstants;
import io.dataease.commons.utils.LogUtil;
import io.dataease.plugins.config.SpringContextUtil;
import io.dataease.plugins.xpack.user.service.UserXpackService;
import io.swagger.annotations.Api;
@ -31,23 +31,24 @@ public class XUserServer {
@ApiOperation("导入")
@PostMapping("/upload")
public void upload(@RequestPart(value = "file", required = true) MultipartFile file, HttpServletResponse response) throws Exception{
public void upload(@RequestPart(value = "file", required = true) MultipartFile file, HttpServletResponse response) {
if (file.getSize() > MAXSIZE) {
String msgKey = "i18n_max_user_import_size";
String msg = Translator.get(msgKey);
DEException.throwException(msg);
response.addHeader("Access-Control-Expose-Headers", AuthConstants.DE_DOWN_ERROR_KEY);
response.setHeader(AuthConstants.DE_DOWN_ERROR_KEY, msgKey);
return;
}
UserXpackService userXpackService = SpringContextUtil.getBean(UserXpackService.class);
try{
userXpackService.upload(file, response);
}catch (Exception e) {
response.addHeader("Access-Control-Expose-Headers", AuthConstants.DE_DOWN_ERROR_KEY);
if (StringUtils.contains(e.getMessage(), "template file error")) {
DEException.throwException(Translator.get("I18N_USER_TEMPLATE_ERROR"));
response.setHeader(AuthConstants.DE_DOWN_ERROR_KEY, "I18N_USER_TEMPLATE_ERROR");
}else {
DEException.throwException(e.getMessage());
response.setHeader(AuthConstants.DE_DOWN_ERROR_KEY, e.getMessage());
}
LogUtil.error(e.getMessage());
}
}
}

View File

@ -374,7 +374,7 @@ public class ApiProvider extends Provider {
for (int i = 0; i < jsonPaths.size(); i++) {
List<String> datas = new ArrayList<>();
Object object = JsonPath.read(result, jsonPaths.get(i));
if (object instanceof List) {
if (object instanceof List && jsonPaths.get(i).contains("[*]")) {
datas = (List<String>) object;
} else {
if (object != null) {
@ -390,7 +390,7 @@ public class ApiProvider extends Provider {
}
for (int i = 0; i < columnDataList.size(); i++) {
for (int j = 0; j < columnDataList.get(i).size(); j++) {
dataList.get(j)[i] = String.valueOf(columnDataList.get(i).get(j));
dataList.get(j)[i] = Optional.ofNullable(columnDataList.get(i).get(j)).orElse("").replaceAll("\n", " ").replaceAll("\r", " ");
}
}
}

View File

@ -1032,7 +1032,7 @@ public class DataSetTableService {
}
Expression expr = plainSelect.getWhere();
if (expr == null) {
return plainSelect.toString();
return handleWith(plainSelect, select);
}
StringBuilder stringBuilder = new StringBuilder();
BinaryExpression binaryExpression = null;
@ -1046,7 +1046,10 @@ public class DataSetTableService {
expr.accept(getExpressionDeParser(stringBuilder));
}
plainSelect.setWhere(CCJSqlParserUtil.parseCondExpression(stringBuilder.toString()));
return handleWith(plainSelect, select);
}
private String handleWith(PlainSelect plainSelect, Select select)throws Exception{
StringBuilder builder = new StringBuilder();
if (CollectionUtils.isNotEmpty(select.getWithItemsList())) {
builder.append("WITH");
@ -1063,7 +1066,6 @@ public class DataSetTableService {
builder.append(" " + plainSelect);
return builder.toString();
}
public Map<String, Object> getSQLPreview(DataSetTableRequest dataSetTableRequest) throws Exception {
Datasource ds = datasourceMapper.selectByPrimaryKey(dataSetTableRequest.getDataSourceId());
if (ds == null) {

View File

@ -83,4 +83,10 @@ WHERE
BEGIN;
DELETE from `sys_menu` where `menu_id` = 55;
DELETE from `sys_menu` where `menu_id` = 56;
COMMIT;
BEGIN;
UPDATE `my_plugin` set cost = '60000', `creator` = 'DATAEASE' WHERE `module_name` = 'deplugin-xpack-backend';
UPDATE `my_plugin` set cost = '0', `creator` = 'DATAEASE' WHERE `module_name` = 'view-bubblemap-backend';
UPDATE `my_plugin` set cost = '0', `creator` = 'DATAEASE' WHERE `module_name` = 'view-symbolmap-backend';
COMMIT;

View File

@ -4,10 +4,10 @@
<span v-if="isEdit" :title="$t('panel.edit')">
<i class="icon iconfont icon-edit" @click.stop="edit" />
</span>
<span :title="$t('panel.details')">
<span v-show="detailsShow" :title="$t('panel.details')">
<i class="icon iconfont icon-chakan" @click.stop="showViewDetails('details')" />
</span>
<span :title="$t('panel.enlarge')">
<span v-show="enlargeShow" :title="$t('panel.enlarge')">
<i class="icon iconfont icon-fangda" @click.stop="showViewDetails('enlarge')" />
</span>
</div>
@ -63,6 +63,12 @@ export default {
}
},
computed: {
detailsShow(){
return this.element.propValue.innerType !== 'richTextView'
},
enlargeShow(){
return this.element.propValue.innerType !== 'richTextView'
},
// gapStyle() {
// return {
// 'right': this.curGap + 'px!important'

View File

@ -74,7 +74,7 @@
<el-dropdown-item>
<span class="icon iconfont icon-icon_dialpad_outlined icon16" />
<span class="text14 margin-left8">{{ $t('panel.aided_grid') }}</span>
<el-switch v-model="showGridSwitch" class="margin-left8" size="mini" @change="showGridChange" />
<el-switch v-model="showGridSwitch" :class="[{['grid-active']: showGridSwitch},'margin-left8']" size="mini" @change="showGridChange" />
</el-dropdown-item>
<el-dropdown-item @click.native="openOuterParamsSet">
<span class="icon iconfont icon-icon-quicksetting icon16" />
@ -600,10 +600,14 @@ export default {
::v-deep .el-switch__core::after {
width: 14px;
height: 14px;
margin-top: -1px;
margin-top: -1.3px;
margin-bottom: 2px;
}
.grid-active ::v-deep .el-switch__core::after {
margin-left: -14.5px;
}
.iconfont-tb {
font-family: "iconfont" !important;
font-size: 12px;

View File

@ -2219,7 +2219,7 @@ export default {
i18n_msg_type_all: 'All type',
i18n_msg_type_ds_invalid: 'Datasource invalid',
channel_inner_msg: 'On site news',
channel_email_msg: 'Email reminder'
channel_email_msg: 'Mail notification'
},
denumberrange: {
label: 'Number range',
@ -2459,5 +2459,8 @@ export default {
attr: 'Attribute',
empty: 'Empty',
please_select_map: 'Please select a range of map'
}
},
'I18N_USER_TEMPLATE_ERROR': 'Template file error',
'i18n_max_user_import_size': 'File size exceeds 10M'
}

View File

@ -2460,5 +2460,7 @@ export default {
attr: '屬性',
empty: '無數據',
please_select_map: '請先選擇地圖範圍'
}
},
'I18N_USER_TEMPLATE_ERROR': '模版錯誤',
'i18n_max_user_import_size': '文件最大不能超過10M'
}

View File

@ -2460,5 +2460,7 @@ export default {
attr: '属性',
empty: '无数据',
please_select_map: '请先选择地图范围'
}
},
'I18N_USER_TEMPLATE_ERROR': '模版错误',
'i18n_max_user_import_size': '文件最大不能超过10M'
}

View File

@ -7,6 +7,7 @@ module.exports = {
IdTokenKey: 'IdToken',
AccessTokenKey: 'AccessToken',
CASSESSION: 'JSESSIONID',
DownErrorKey: 'de-down-error-msg',
/**
* @type {boolean} true | false

View File

@ -1262,6 +1262,7 @@ div:focus {
}
}
}
.btn {
border-radius: 4px;
padding: 5px 26px 5px 26px;
@ -1311,4 +1312,11 @@ div:focus {
.user-popper.dept {
height: 400px;
overflow: auto;
}
.upload-user{
margin-bottom: 5px;
.el-upload{
width: 100%;
}
}

View File

@ -11,6 +11,7 @@ import Vue from 'vue'
const TokenKey = Config.TokenKey
const RefreshTokenKey = Config.RefreshTokenKey
const LinkTokenKey = Config.LinkTokenKey
const DownErrorKey = Config.DownErrorKey
import Cookies from 'js-cookie'
const getTimeOut = () => {
@ -98,6 +99,9 @@ service.interceptors.response.use(response => {
response.config.loading && tryHideLoading(store.getters.currentPath)
checkAuth(response)
Vue.prototype.$currentHttpRequestList.delete(response.config.url)
if (checkDownError(response)) {
return response
}
return response.data
}, error => {
const config = error.response && error.response.config || error.config
@ -114,7 +118,14 @@ service.interceptors.response.use(response => {
!config.hideMsg && (!headers['authentication-status']) && $error(msg)
return Promise.reject(error)
})
const checkDownError = response => {
if (response.request && response.request.responseType && response.request.responseType === 'blob' && response.headers && response.headers['de-down-error-msg']) {
const msg = i18n.t(response.headers[DownErrorKey])
$error(msg)
return true
}
return false
}
const checkAuth = response => {
if (response.headers['authentication-status'] === 'login_expire') {
const message = i18n.t('login.expires')

View File

@ -132,7 +132,7 @@
import { queryBackground } from '@/api/background/background'
import BackgroundItem from '@/views/background/BackgroundItem'
import { mapState } from 'vuex'
import { deepCopy } from '@/components/canvas/utils/utils'
import {deepCopy, imgUrlTrans} from '@/components/canvas/utils/utils'
import { COLOR_PANEL } from '@/views/chart/chart/chart'
import { uploadFileResult } from '@/api/staticResource/staticResource'
import { COMMON_BACKGROUND_NONE } from '@/components/canvas/custom-component/component-list'
@ -171,7 +171,7 @@ export default {
methods: {
init() {
if (this.curComponent && this.curComponent.commonBackground && this.curComponent.commonBackground.outerImage && typeof (this.curComponent.commonBackground.outerImage) === 'string') {
this.fileList.push({ url: this.curComponent.commonBackground.outerImage })
this.fileList.push({ url: imgUrlTrans(this.curComponent.commonBackground.outerImage) })
}
this.backgroundOrigin = deepCopy(this.curComponent.commonBackground ? this.curComponent.commonBackground : COMMON_BACKGROUND_NONE)
this.queryBackground()

View File

@ -52,6 +52,8 @@ import { mapState } from 'vuex'
import { deepCopy } from '@/components/canvas/utils/utils'
import { COLOR_PANEL } from '@/views/chart/chart/chart'
import { uploadFileResult } from '@/api/staticResource/staticResource'
import {imgUrlTrans} from "@/components/canvas/utils/utils";
export default {
name: 'BackgroundSelector',
@ -77,7 +79,7 @@ export default {
//
this.panel = this.canvasStyleData.panel
if (this.panel.imageUrl && typeof (this.panel.imageUrl) === 'string') {
this.fileList.push({ url: this.panel.imageUrl })
this.fileList.push({ url: imgUrlTrans(this.panel.imageUrl) })
}
},
methods: {
@ -111,7 +113,7 @@ export default {
uploadFileResult(file.file, (fileUrl) => {
_this.$store.commit('canvasChange')
_this.panel.imageUrl = fileUrl
_this.fileList = [{ url: this.panel.imageUrl }]
_this.fileList = [{ url: imgUrlTrans(this.panel.imageUrl) }]
_this.commitStyle()
})
},