Merge branch 'dev' into pr@dev_memory_component

This commit is contained in:
dataeaseShu 2023-02-28 10:46:18 +08:00
commit 4c68054b09
5 changed files with 16 additions and 6 deletions

View File

@ -808,7 +808,8 @@ public class MysqlQueryProvider extends QueryProvider {
}
return stringBuilder.toString();
}).toArray(String[]::new);
return MessageFormat.format("SELECT {0} FROM {1} LIMIT DE_OFFSET, DE_PAGE_SIZE ", StringUtils.join(array, ","), String.format(MySQLConstants.KEYWORD_TABLE, table));
table = table.trim().startsWith("(") ? table : String.format(MySQLConstants.KEYWORD_TABLE, table);
return MessageFormat.format("SELECT {0} FROM {1} LIMIT DE_OFFSET, DE_PAGE_SIZE ", StringUtils.join(array, ","), table);
}
public String getTotalCount(boolean isTable, String sql, Datasource ds) {
@ -821,7 +822,7 @@ public class MysqlQueryProvider extends QueryProvider {
@Override
public String createRawQuerySQLAsTmp(String sql, List<DatasetTableField> fields) {
return createRawQuerySQL(" (" + sqlFix(sql) + ") AS DE_TEMP", fields, null);
return createRawQuerySQL("(" + sqlFix(sql) + ") AS DE_TEMP", fields, null);
}
public String transTreeItem(SQLObj tableObj, DatasetRowPermissionsTreeItem item) {

View File

@ -650,6 +650,9 @@ public class DatasourceService {
public void updateDemoDs() {
Datasource datasource = datasourceMapper.selectByPrimaryKey("76026997-94f9-4a35-96ca-151084638969");
if(datasource == null){
return;
}
MysqlConfiguration mysqlConfiguration = new Gson().fromJson(datasource.getConfiguration(), MysqlConfiguration.class);
Pattern WITH_SQL_FRAGMENT = Pattern.compile("jdbc:mysql://(.*):(\\d+)/(.*)");
Matcher matcher = WITH_SQL_FRAGMENT.matcher(env.getProperty("spring.datasource.url"));

View File

@ -37,7 +37,6 @@ import 'tinymce/plugins/nonbreaking'
import 'tinymce/plugins/pagebreak'
import { mapState } from 'vuex'
import Vue from 'vue'
import xssCheck from 'xss'
export default {
name: 'DeRichText',
@ -78,7 +77,7 @@ export default {
canEdit: false,
//
tinymceId: 'tinymce-' + this.element.id,
myValue: xssCheck(this.propValue),
myValue: this.propValue,
init: {
selector: '#tinymce-' + this.element.id,
toolbar_items_size: 'small',

View File

@ -38,7 +38,6 @@ import 'tinymce/plugins/pagebreak'
import { mapState } from 'vuex'
import bus from '@/utils/bus'
import { uuid } from 'vue-uuid'
import xssCheck from 'xss'
export default {
name: 'DeRichTextView',
@ -140,6 +139,10 @@ export default {
}
},
myValue(newValue) {
if (this.canEdit) {
const ed = tinymce.editors[this.tinymceId]
this.element.propValue.textValue = ed.getContent()
}
this.initReady && this.$store.commit('canvasChange')
}
},
@ -153,7 +156,7 @@ export default {
viewInit() {
bus.$on('fieldSelect-' + this.element.propValue.viewId, this.fieldSelect)
tinymce.init({})
this.myValue = xssCheck(this.assignment(this.element.propValue.textValue))
this.myValue = this.assignment(this.element.propValue.textValue)
bus.$on('initCurFields-' + this.element.id, this.initCurFieldsChange)
this.$nextTick(() => {
this.initReady = true

View File

@ -10,6 +10,7 @@ import { uuid } from 'vue-uuid'
import store from '@/store'
import { AIDED_DESIGN, MOBILE_SETTING, PAGE_LINE_DESIGN, PANEL_CHART_INFO, TAB_COMMON_STYLE } from '@/views/panel/panel'
import html2canvas from 'html2canvasde'
import xssCheck from 'xss'
export function deepCopy(target) {
if (typeof target === 'object' && target !== null) {
@ -101,6 +102,9 @@ export function panelDataPrepare(componentData, componentStyle, callback) {
componentStyle.chartCommonStyle = deepCopy(COMMON_BACKGROUND)
}
componentData.forEach((item, index) => {
if (item.component && item.component === 'v-text') {
item.propValue = xssCheck(item.propValue)
}
if (item.component && item.component === 'de-date') {
const widget = ApplicationContext.getService(item.serviceName)
if (item.options.attrs &&