Merge branch 'dev' into pr@dev_one_dot_x

This commit is contained in:
dataeaseShu 2023-11-13 10:31:30 +08:00
commit 57fc50e641
62 changed files with 1041 additions and 366 deletions

View File

@ -196,6 +196,11 @@ public class AuthServer implements AuthApi {
}
if (user.getIsAdmin() && user.getPassword().equals("40b8893ea9ebc2d631c4bb42bb1e8996")) {
result.put("passwordModified", false);
result.put("defaultPwd", "dataease");
}
if (!user.getIsAdmin() && user.getPassword().equals("83d923c9f1d8fcaa46cae0ed2aaa81b5")) {
result.put("passwordModified", false);
result.put("defaultPwd", DEFAULT_PWD);
}
}

View File

@ -17,6 +17,7 @@ public class ApiDefinition {
private List<DatasetTableFieldDTO> fields;
private ApiDefinitionRequest request;
private String dataPath;
private Integer queryTimeout;
private String status;
private List<Map<String,String>> data = new ArrayList<>();
private List<JSONObject> jsonFields = new ArrayList<>();

View File

@ -58,7 +58,7 @@ public class SysPluginController {
@RequiresPermissions("plugin:upload")
public Map<String, Object> update(@PathVariable("pluginId") Long pluginId, @RequestParam("file") MultipartFile file) throws Exception {
DeFileUtils.validateFile(file);
if (pluginService.uninstall(pluginId)) {
if (pluginService.uninstallForUpdate(pluginId, true)) {
return pluginService.localInstall(file);
}
return null;

View File

@ -37,14 +37,10 @@ public class ApiProvider extends Provider {
private static String path = "['%s']";
@Resource
private SystemParameterService systemParameterService;
@Override
public List<String[]> getData(DatasourceRequest datasourceRequest) throws Exception {
BasicInfo basicInfo = systemParameterService.basicInfo();
ApiDefinition apiDefinition = checkApiDefinition(datasourceRequest);
String response = execHttpRequest(apiDefinition, StringUtils.isNotBlank(basicInfo.getFrontTimeOut()) ? Integer.parseInt(basicInfo.getFrontTimeOut()) : 10);
String response = execHttpRequest(apiDefinition, apiDefinition.getQueryTimeout() == null || apiDefinition.getQueryTimeout()<=0 ? 30 : apiDefinition.getQueryTimeout());
return fetchResult(response, apiDefinition);
}
@ -68,12 +64,11 @@ public class ApiProvider extends Provider {
}
public Map<String, List> fetchResultAndField(DatasourceRequest datasourceRequest) throws Exception {
BasicInfo basicInfo = systemParameterService.basicInfo();
Map<String, List> result = new HashMap<>();
List<String[]> dataList = new ArrayList<>();
List<TableField> fieldList = new ArrayList<>();
ApiDefinition apiDefinition = checkApiDefinition(datasourceRequest);
String response = execHttpRequest(apiDefinition, StringUtils.isNotBlank(basicInfo.getFrontTimeOut()) ? Integer.parseInt(basicInfo.getFrontTimeOut()) : 10);
String response = execHttpRequest(apiDefinition, apiDefinition.getQueryTimeout() == null || apiDefinition.getQueryTimeout()<=0 ? 30 : apiDefinition.getQueryTimeout());
fieldList = getTableFields(apiDefinition);
result.put("fieldList", fieldList);

View File

@ -73,7 +73,7 @@ public class DorisDDLProvider extends DDLProviderImpl {
break;
case 3:
if(datasetTableField.getType().equalsIgnoreCase("DECIMAL") && datasetTableField.getAccuracy() != 0){
Column_Fields.append("DECIMAL(" + datasetTableField.getSize() + "," + datasetTableField.getAccuracy() + ")").append(",`");
Column_Fields.append("DecimalV3(" + datasetTableField.getSize() + "," + datasetTableField.getAccuracy() + ")").append(",`");
}else {
Column_Fields.append("DOUBLE").append(",`");
}

View File

@ -218,9 +218,7 @@ public class DataSetTableService {
excelSheetDataList.forEach(excelSheetData -> {
String[] fieldArray = excelSheetData.getFields().stream().map(TableField::getFieldName)
.toArray(String[]::new);
if (checkIsRepeat(fieldArray)) {
DataEaseException.throwException(Translator.get("i18n_excel_field_repeat"));
}
checkIsRepeat(fieldArray);
excelSheetData.setData(null);
excelSheetData.setJsonArray(null);
});
@ -254,9 +252,7 @@ public class DataSetTableService {
for (ExcelSheetData sheet : datasetTable.getSheets()) {
String[] fieldArray = sheet.getFields().stream().map(TableField::getFieldName)
.toArray(String[]::new);
if (checkIsRepeat(fieldArray)) {
DataEaseException.throwException(Translator.get("i18n_excel_field_repeat"));
}
checkIsRepeat(fieldArray);
}
for (ExcelSheetData sheet : datasetTable.getSheets()) {
@ -304,9 +300,7 @@ public class DataSetTableService {
}
String[] fieldArray = sheet.getFields().stream().map(TableField::getFieldName).toArray(String[]::new);
if (checkIsRepeat(fieldArray)) {
DataEaseException.throwException(Translator.get("i18n_excel_field_repeat"));
}
checkIsRepeat(fieldArray);
sheet.setData(null);
sheet.setJsonArray(null);
excelSheetDataList.add(sheet);
@ -1221,9 +1215,7 @@ public class DataSetTableService {
List<String[]> data = result.get("dataList");
List<TableField> fields = result.get("fieldList");
String[] fieldArray = fields.stream().map(TableField::getFieldName).toArray(String[]::new);
if (checkIsRepeat(fieldArray)) {
DataEaseException.throwException(Translator.get("i18n_excel_field_repeat"));
}
checkIsRepeat(fieldArray);
List<Map<String, Object>> jsonArray = new ArrayList<>();
if (CollectionUtils.isNotEmpty(data)) {
jsonArray = data.stream().map(ele -> {
@ -1305,9 +1297,7 @@ public class DataSetTableService {
List<String[]> data = result.get("dataList");
List<TableField> fields = result.get("fieldList");
String[] fieldArray = fields.stream().map(TableField::getFieldName).toArray(String[]::new);
if (checkIsRepeat(fieldArray)) {
DataEaseException.throwException(Translator.get("i18n_excel_field_repeat"));
}
checkIsRepeat(fieldArray);
List<Map<String, Object>> jsonArray = new ArrayList<>();
if (CollectionUtils.isNotEmpty(data)) {
jsonArray = data.stream().map(ele -> {
@ -2755,15 +2745,22 @@ public class DataSetTableService {
/*
* 判断数组中是否有重复的值
*/
public static boolean checkIsRepeat(String[] array) {
public static void checkIsRepeat(String[] array) {
HashSet<String> hashSet = new HashSet<>();
HashSet<String> repeat = new HashSet<>();
for (String s : array) {
if (StringUtils.isEmpty(s)) {
throw new RuntimeException(Translator.get("i18n_excel_empty_column"));
}
hashSet.add(s);
if(hashSet.contains(s)){
repeat.add(s);
}else {
hashSet.add(s);
}
}
if(CollectionUtils.isNotEmpty(repeat)){
DataEaseException.throwException(Translator.get("i18n_excel_field_repeat") + ": " + String.valueOf(repeat));
}
return hashSet.size() != array.length;
}
public DatasetTable syncDatasetTableField(String id) throws Exception {

View File

@ -221,6 +221,10 @@ public class PluginService {
* @return
*/
public Boolean uninstall(Long pluginId) {
return uninstallForUpdate(pluginId, false);
}
public Boolean uninstallForUpdate(Long pluginId, boolean forUpdate) {
MyPlugin myPlugin = myPluginMapper.selectByPrimaryKey(pluginId);
if (ObjectUtils.isEmpty(myPlugin)) {
String msg = "当前插件不存在";
@ -232,7 +236,7 @@ public class PluginService {
CacheUtils.removeAll(AuthConstants.USER_ROLE_CACHE_NAME);
CacheUtils.removeAll(AuthConstants.USER_PERMISSION_CACHE_NAME);
if (myPlugin.getCategory().equalsIgnoreCase("datasource")) {
if (myPlugin.getCategory().equalsIgnoreCase("datasource") && !forUpdate) {
if (CollectionUtils.isNotEmpty(datasourceService.selectByType(myPlugin.getDsType()))) {
DEException.throwException(Translator.get("i18n_plugin_not_allow_delete"));
}

View File

@ -92,7 +92,7 @@ i18n_sql_add_not_matching=The data column of incremental SQL does not match the
i18n_sql_delete_not_matching=The data column of incremental delete SQL does not match the dataset,
i18n_cst_ds_tb_or_field_deleted=Custom dataset union data is deleted or field changed,can not display
i18n_no_all_delete_privilege_folder=This folder have sources which have no manage or view privilege,Can Not Be Deleted.
i18n_excel_field_repeat=Duplicate fields exist, please modify and try again.
i18n_excel_field_repeat=Duplicate fields exist:
i18n_schema_is_empty=Database schema is empty
\u7AD9\u5185\u6D88\u606F=Messages Center
\u6240\u6709\u6D88\u606F=All Messages

View File

@ -92,7 +92,7 @@ i18n_sql_add_not_matching=\u589E\u91CF\u6DFB\u52A0 SQL \u7684\u6570\u636E\u5217\
i18n_sql_delete_not_matching=\u589E\u91CF\u5220\u9664 SQL \u7684\u6570\u636E\u5217\u4E0E\u6570\u636E\u96C6\u4E0D\u5339\u914D,
i18n_cst_ds_tb_or_field_deleted=\u81EA\u5B9A\u4E49\u6570\u636E\u96C6\u6240\u5173\u8054\u6570\u636E\u88AB\u5220\u9664\u6216\u5B57\u6BB5\u53D1\u751F\u53D8\u5316\uFF0C\u65E0\u6CD5\u6B63\u5E38\u663E\u793A
i18n_no_all_delete_privilege_folder=\u8BE5\u76EE\u5F55\u4E0B\u5B58\u5728\u6CA1\u6709\u7BA1\u7406\u6743\u9650\u6216\u67E5\u770B\u6743\u9650\u7684\u8D44\u6E90\uFF0C\u65E0\u6CD5\u5220\u9664
i18n_excel_field_repeat=\u5B58\u5728\u91CD\u590D\u5B57\u6BB5\uFF0C\u8BF7\u4FEE\u6539\u540E\u91CD\u8BD5
i18n_excel_field_repeat=\u5b58\u5728\u91cd\u590d\u5b57\u6bb5\uff1a
i18n_schema_is_empty=\u6570\u636E\u5E93 Schema \u4E3A\u7A7A
\u7AD9\u5185\u6D88\u606F=\u6D88\u606F\u4E2D\u5FC3
\u6240\u6709\u6D88\u606F=\u6240\u6709\u6D88\u606F

View File

@ -92,7 +92,7 @@ i18n_sql_add_not_matching=\u589E\u91CF\u6DFB\u52A0 sql \u7684\u6578\u64DA\u5217\
i18n_sql_delete_not_matching=\u589E\u91CF\u522A\u9664 sql \u7684\u6578\u64DA\u5217\u8207\u6578\u64DA\u96C6\u4E0D\u5339\u914D,
i18n_cst_ds_tb_or_field_deleted=\u81EA\u5B9A\u7FA9\u6578\u64DA\u96C6\u6240\u95DC\u806F\u6578\u64DA\u88AB\u522A\u9664\u6216\u5B57\u6BB5\u767C\u751F\u8B8A\u5316\uFF0C\u7121\u6CD5\u6B63\u5E38\u986F\u793A
i18n_no_all_delete_privilege_folder=\u8A72\u76EE\u9304\u4E0B\u5B58\u5728\u6C92\u6709\u7BA1\u7406\u6B0A\u9650\u6216\u67E5\u770B\u6B0A\u9650\u7684\u8CC7\u6E90\uFF0C\u7121\u6CD5\u522A\u9664
i18n_excel_field_repeat=\u5B58\u5728\u91CD\u5FA9\u5B57\u6BB5\uFF0C\u8ACB\u4FEE\u6539\u5F8C\u91CD\u8BD5
i18n_excel_field_repeat=\u5b58\u5728\u91cd\u5fa9\u5b57\u6bb5\uff1a
i18n_schema_is_empty=\u6578\u64DA\u5EAB Schema \u70BA\u7A7A
\u7AD9\u5185\u6D88\u606F=\u6D88\u606F\u4E2D\u5FC3
\u6240\u6709\u6D88\u606F=\u6240\u6709\u6D88\u606F

View File

@ -13,7 +13,7 @@
:title="$t('user.change_password')"
:show-close="false"
>
<PasswordUpdateForm old-pwd="dataease" />
<PasswordUpdateForm :old-pwd=defaultPwd />
</el-dialog>
</div>
</template>
@ -28,7 +28,8 @@ export default {
components: { PluginCom, PasswordUpdateForm },
data() {
return {
showPasswordModifiedDialog: false
showPasswordModifiedDialog: false,
defaultPwd: 'dataease'
}
},
computed: {
@ -46,6 +47,7 @@ export default {
},
mounted() {
const passwordModified = JSON.parse(localStorage.getItem('passwordModified'))
this.defaultPwd = localStorage.getItem('defaultPwd')
if (typeof passwordModified === 'boolean') {
this.$store.commit('user/SET_PASSWORD_MODIFIED', passwordModified)
}

View File

@ -48,6 +48,7 @@
:h="config.style.height"
:search-count="searchCount"
:canvas-id="canvasId"
@filter-loaded="filterLoaded"
/>
<component
:is="config.component"
@ -235,6 +236,9 @@ export default {
runAnimation(this.$el, this.config.animations)
},
methods: {
filterLoaded(p) {
this.$emit('filter-loaded', p)
},
getComponentId() {
return this.config.id
},

View File

@ -80,6 +80,7 @@
:out-style="getShapeStyleInt(item.style)"
:active="item === curComponent"
:h="getShapeStyleIntDeDrag(item.style,'height')"
@filter-loaded="filterLoaded"
/>
<component
:is="item.component"
@ -170,7 +171,7 @@ import DeOutWidget from '@/components/dataease/DeOutWidget'
import DragShadow from '@/components/deDrag/Shadow'
import bus from '@/utils/bus'
import LinkJumpSet from '@/views/panel/linkJumpSet'
import { buildFilterMap, buildViewKeyMap, formatCondition, valueValid, viewIdMatch } from '@/utils/conditionUtil'
import { buildFilterMap, buildViewKeyMap, formatCondition, valueValid, viewIdMatch, buildAfterFilterLoaded } from '@/utils/conditionUtil'
//
import _ from 'lodash'
import _jq from 'jquery'
@ -1143,6 +1144,9 @@ export default {
created() {
},
methods: {
filterLoaded(p) {
buildAfterFilterLoaded(this.filterMap, p)
},
getWrapperChildRefs() {
return this.$refs['wrapperChild']
},
@ -1254,7 +1258,10 @@ export default {
}
param = wrapperChild.getCondition && wrapperChild.getCondition()
const condition = formatCondition(param)
const vValid = valueValid(condition)
let vValid = valueValid(condition)
const required = element.options.attrs.required
condition.requiredInvalid = required && !vValid
vValid = vValid || required
const filterComponentId = condition.componentId
const conditionCanvasId = wrapperChild.getCanvasId && wrapperChild.getCanvasId()
Object.keys(result).forEach(viewId => {

View File

@ -59,6 +59,7 @@
:screen-shot="screenShot"
:canvas-style-data="canvasStyleData"
:show-position="showPosition"
@filter-loaded="filterLoaded"
/>
</div>
</div>
@ -155,7 +156,7 @@ import eventBus from '@/components/canvas/utils/eventBus'
import elementResizeDetectorMaker from 'element-resize-detector'
import CanvasOptBar from '@/components/canvas/components/editor/CanvasOptBar'
import bus from '@/utils/bus'
import { buildFilterMap, buildViewKeyMap, formatCondition, valueValid, viewIdMatch } from '@/utils/conditionUtil'
import { buildFilterMap, buildViewKeyMap, formatCondition, valueValid, viewIdMatch, buildAfterFilterLoaded } from '@/utils/conditionUtil'
import { hasDataPermission } from '@/utils/permission'
import { activeWatermark } from '@/components/canvas/tools/watermark'
import { proxyUserLoginInfo, userLoginInfo } from '@/api/systemInfo/userLogin'
@ -461,6 +462,9 @@ export default {
bus.$off('trigger-reset-button', this.triggerResetButton)
},
methods: {
filterLoaded(p) {
buildAfterFilterLoaded(this.filterMap, p)
},
getWrapperChildRefs() {
return this.$refs['viewWrapperChild']
},
@ -589,7 +593,10 @@ export default {
}
param = wrapperChild.getCondition && wrapperChild.getCondition()
const condition = formatCondition(param)
const vValid = valueValid(condition)
let vValid = valueValid(condition)
const required = element.options.attrs.required
condition.requiredInvalid = required && !vValid
vValid = vValid || required
const filterComponentId = condition.componentId
const conditionCanvasId = wrapperChild.getCanvasId && wrapperChild.getCanvasId()
Object.keys(result).forEach(viewId => {

View File

@ -220,13 +220,11 @@ export default {
},
linkJumpSetShow() {
return this.curComponent.type === 'view' &&
!this.jumpExcludeViewType.includes(this.curComponent.propValue.innerType) &&
!(this.curComponent.propValue.innerType?.includes('table') && this.curComponent.propValue.render === 'echarts')
!this.jumpExcludeViewType.includes(this.curComponent.propValue.innerType)
},
linkageSettingShow() {
return this.curComponent.type === 'view' &&
!this.linkageExcludeViewType.includes(this.curComponent.propValue.innerType) &&
!(this.curComponent.propValue.innerType?.includes('table') && this.curComponent.propValue.render === 'echarts')
!this.linkageExcludeViewType.includes(this.curComponent.propValue.innerType)
},
panelInfo() {
return this.$store.state.panel.panelInfo

View File

@ -28,8 +28,18 @@
{{ $t('chart.chart_error_tips') }}
</div>
</div>
<div
v-if="view && view.unReadyMsg"
class="chart-error-class"
>
<div class="chart-error-message-class">
{{ view.unReadyMsg }},{{ $t('chart.chart_show_error') }}
<br>
{{ $t('chart.chart_error_tips') }}
</div>
</div>
<plugin-com
v-if="chart.isPlugin"
v-else-if="chart.isPlugin"
:ref="element.propValue.id"
:component-name="chart.type + '-view'"
:obj="{active, chart, trackMenu, searchCount, terminalType: scaleCoefficientType}"
@ -100,7 +110,10 @@
:ref="element.propValue.id"
:show-summary="chart.type === 'table-normal'"
:chart="chart"
:track-menu="trackMenu"
class="table-class"
@onChartClick="chartClick"
@onJumpClick="jumpClick"
@onPageChange="pageClick"
/>
<label-normal
@ -598,12 +611,48 @@ export default {
created() {
this.refId = uuid.v1
if (this.element && this.element.propValue && this.element.propValue.viewId) {
// watch.filters
const group = this.groupFilter(this.filters)
const unReadyList = group.unReady
const readyList = group.ready
if (unReadyList.length) {
Promise.all(this.filters.filter(f => f instanceof Promise)).then(fList => {
this.filter.filter = readyList.concat(fList)
this.getData(this.element.propValue.viewId, false)
})
return
}
this.getData(this.element.propValue.viewId, false)
}
},
methods: {
groupFilter(filters) {
const result = {
ready: [],
unReady: []
}
filters.forEach(f => {
if (f instanceof Promise) {
result.unReady.push(f)
} else {
result.ready.push(f)
}
})
return result
},
groupRequiredInvalid(filters) {
const result = {
ready: [],
unReady: []
}
filters.forEach(f => {
if (f.requiredInvalid) {
result.unReady.push(f)
} else {
result.ready.push(f)
}
})
return result
},
equalsAny,
tabSwitch(tabCanvasId) {
if (this.charViewS2ShowFlag && tabCanvasId === this.canvasId && this.$refs[this.element.propValue.id]) {
@ -734,7 +783,7 @@ export default {
clearPanelLinkage(param) {
if (param.viewId === 'all' || param.viewId === this.element.propValue.viewId) {
try {
this.$refs[this.element.propValue.id]?.reDrawView()
this.$refs[this.element.propValue.id]?.reDrawView?.()
} catch (e) {
console.error('reDrawView-error', this.element.propValue.id)
}
@ -773,6 +822,15 @@ export default {
},
getData(id, cache = true, dataBroadcast = false) {
if (id) {
const filters = this.filter.filter
const group = this.groupRequiredInvalid(filters)
if (group.unReady?.length) {
this.view.unReadyMsg = '请先完成必填项过滤器!'
this.getDataLoading = false
return
} else {
this.view.unReadyMsg = ''
}
if (this.getDataLoading || Vue.prototype.$currentHttpRequestList.get(`/chart/view/getData/${id}/${this.panelInfo.id}`)) {
const url = `/chart/view/getData/${id}/${this.panelInfo.id}`
Vue.prototype.$cancelRequest(url)
@ -794,6 +852,7 @@ export default {
if (!token && linkToken) {
method = viewInfo
}
const requestInfo = {
...this.filter,
cache: cache,

View File

@ -26,9 +26,12 @@
<div
ref="deContentContainer"
class="condition-content"
:class="(element.options.attrs.showTitle && element.options.attrs.title) ? '' : 'condition-content-default'"
:class="{'condition-content-default' : !(element.options.attrs.showTitle && element.options.attrs.title)}"
>
<div class="condition-content-container">
<div
class="condition-content-container"
:class="{'widget-required' : element.options.attrs.required}"
>
<div class="first-element">
<div
:class="element.component === 'de-select-grid' ? 'first-element-grid-container': ''"
@ -49,11 +52,18 @@
:element="element"
:in-draw="inDraw"
:in-screen="inScreen"
@filter-loaded="filterLoaded"
/>
</div>
</div>
</div>
<div
v-if="element.options.attrs.required"
class="widget-required-symbol"
>
<span>*</span>
</div>
</div>
</div>
</div>
@ -180,6 +190,9 @@ export default {
this.$set(this.element.style, 'innerBgColor', innerBgColor || '')
},
methods: {
filterLoaded(p) {
this.$emit('filter-loaded', p)
},
getComponentId() {
return this.element.id
},
@ -266,6 +279,16 @@ export default {
overflow: auto hidden;
letter-spacing: 0px !important;
width: 100%;
.widget-required {
width: calc(100% - 10px) !important;
float: left !important;
}
.widget-required-symbol {
color: #f54a45;
height: 40px;
line-height: 40px;
float: right;
}
}
.condition-content-container {

View File

@ -14,7 +14,7 @@
export default {
name: 'DataeaseTabs',
props: {
hideTitle: Boolean,
fontColor: String,
activeColor: String,
borderColor: String,
@ -43,7 +43,8 @@ export default {
this.fontColor && 'fontColor',
this.activeColor && 'activeColor',
this.noBorder ? 'noBorder' : this.borderColor && 'borderColor',
this.borderActiveColor && 'borderActiveColor'
this.borderActiveColor && 'borderActiveColor',
this.hideTitle && 'no-header'
]
return classes
},

View File

@ -7,14 +7,14 @@
popper-class="VisualSelects coustom-de-select"
no-match-text=" "
reserve-keyword
clearable
:clearable="clearable"
v-bind="$attrs"
v-on="$listeners"
@change="visualChange"
@visible-change="popChange"
>
<p
v-if="startIndex === 0 && $attrs.multiple"
v-if="startIndex === 0 && $attrs.multiple && !itemDisabled"
class="select-all"
>
<el-checkbox
@ -32,6 +32,7 @@
:label="item.text"
:value="item.id"
:class="setSelect(item.id)"
:disabled="itemDisabled"
>
<span :title="item.text">{{ item.text }}</span>
</el-option>
@ -76,6 +77,14 @@ export default {
keyWord: {
type: String,
default: ''
},
itemDisabled: {
type: Boolean,
default: false
},
clearable: {
type: Boolean,
default: true
}
},
data() {

View File

@ -13,5 +13,6 @@ export class Condition {
this.viewIds = viewIds
this.parameters = parameters
this.isTree = isTree || false
this.requiredInvalid = false
}
}

View File

@ -226,7 +226,11 @@ export default {
},
watch: {
'values': function(val, old) {
if (!this.inDraw) {
this.$emit('widget-value-changed', val)
}
},
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.setCondition()

View File

@ -66,6 +66,11 @@ export default {
}
},
watch: {
'value': function(val, old) {
if (!this.inDraw) {
this.$emit('widget-value-changed', val)
}
},
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.setCondition()

View File

@ -105,6 +105,16 @@ export default {
}
},
watch: {
'form.min': function(val, old) {
if (!this.inDraw) {
this.$emit('widget-value-changed', val)
}
},
'form.max': function(val, old) {
if (!this.inDraw) {
this.$emit('widget-value-changed', val)
}
},
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.setCondition()

View File

@ -6,15 +6,17 @@
v-model="value"
:class-id="'visual-' + element.id + '-' + inDraw + '-' + inScreen"
:collapse-tags="showNumber"
:clearable="!element.options.attrs.multiple"
:clearable="!element.options.attrs.multiple && (inDraw || !selectFirst)"
:multiple="element.options.attrs.multiple"
:placeholder="$t(element.options.attrs.placeholder) + placeholderSuffix"
:popper-append-to-body="inScreen"
:size="size"
:filterable="true"
:filterable="inDraw || !selectFirst"
:filter-method="filterMethod"
:item-disabled="!inDraw && selectFirst"
:key-word="keyWord"
popper-class="coustom-de-select"
:class="{'disabled-close': !inDraw && selectFirst && element.options.attrs.multiple}"
:list="data"
:is-config="isConfig"
:custom-style="customStyle"
@ -31,6 +33,7 @@
:style="{width:selectOptionWidth}"
:label="item[element.options.attrs.label]"
:value="item[element.options.attrs.value]"
:disabled="!inDraw && selectFirst"
>
<span
:title="item[element.options.attrs.label]"
@ -133,12 +136,21 @@ export default {
},
isCustomSortWidget() {
return this.element.serviceName === 'textSelectWidget'
},
selectFirst() {
return this.element.serviceName === 'textSelectWidget' && this.element.options.attrs.selectFirst
}
},
watch: {
'value': function(val, old) {
if (!this.inDraw) {
this.$emit('widget-value-changed', val)
}
},
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.fillFirstValue()
this.setCondition()
},
'defaultValueStr': function(value, old) {
@ -164,12 +176,23 @@ export default {
this.element.options.attrs.fieldId.length > 0 &&
method(param).then(res => {
this.data = this.optionData(res.data)
this.clearDefault(this.data)
this.fillFirstValue()
bus.$emit('valid-values-change', true)
}).catch(e => {
bus.$emit('valid-values-change', false)
}) || (this.element.options.value = '')
},
'selectFirst': function(value, old) {
if (value === old) return
if (value) {
this.fillFirstValue()
} else {
this.value = ''
this.firstChange(this.value)
}
},
'element.options.attrs.multiple': function(value, old) {
if (typeof old === 'undefined' || value === old) return
if (!this.inDraw) {
@ -179,6 +202,7 @@ export default {
this.show = false
this.$nextTick(() => {
this.fillFirstValue()
this.show = true
this.handleCoustomStyle()
})
@ -195,6 +219,9 @@ export default {
if (!token && linkToken) {
method = linkMultFieldValues
}
if (!this.element.options.attrs.fieldId) {
return
}
const param = { fieldIds: this.element.options.attrs.fieldId.split(this.separator), sort: this.element.options.attrs.sort }
if (this.panelInfo.proxy) {
param.userId = this.panelInfo.proxy
@ -204,6 +231,7 @@ export default {
method(param).then(res => {
this.data = this.optionData(res.data)
this.$nextTick(() => {
this.fillFirstValue()
this.show = true
this.handleCoustomStyle()
})
@ -271,6 +299,11 @@ export default {
},
resetDefaultValue(id) {
if (this.inDraw && this.manualModify && this.element.id === id) {
if (this.selectFirst) {
this.fillFirstValue()
this.firstChange(this.value)
return
}
this.value = this.fillValueDerfault()
this.changeValue(this.value)
}
@ -285,17 +318,26 @@ export default {
}, 500)
},
initLoad() {
this.value = this.fillValueDerfault()
this.initOptions()
if (this.element.options.value) {
// this.value = this.fillValueDerfault()
this.initOptions(this.fillFirstSelected)
if (this.element.options.value && !this.selectFirst) {
this.value = this.fillValueDerfault()
this.changeValue(this.value)
}
},
fillFirstSelected() {
if (this.selectFirst && this.data?.length) {
this.fillFirstValue()
this.$emit('filter-loaded', {
componentId: this.element.id,
val: (this.value && Array.isArray(this.value)) ? this.value.join(',') : this.value
})
}
},
refreshLoad() {
this.initOptions()
},
initOptions() {
initOptions(cb) {
this.data = []
if (this.element.options.attrs.fieldId) {
let method = multFieldValues
@ -310,6 +352,7 @@ export default {
}).then(res => {
this.data = this.optionData(res.data)
bus.$emit('valid-values-change', true)
cb && cb()
}).catch(e => {
bus.$emit('valid-values-change', false)
})
@ -338,6 +381,10 @@ export default {
this.setCondition()
this.handleShowNumber()
},
firstChange(value) {
this.setCondition()
this.handleShowNumber()
},
handleShowNumber() {
this.showNumber = false
@ -377,6 +424,20 @@ export default {
}
return this.value.split(',')
},
fillFirstValue() {
if (!this.selectFirst) {
return
}
const defaultV = this.data[0].id
if (this.element.options.attrs.multiple) {
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return []
this.value = defaultV.split(this.separator)
} else {
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return null
this.value = defaultV.split(this.separator)[0]
}
this.firstChange(this.value)
},
fillValueDerfault() {
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
if (this.element.options.attrs.multiple) {
@ -415,13 +476,15 @@ export default {
}
</script>
<style lang="scss" scoped>
.disabled-close ::v-deep .el-icon-close {
display: none !important;
}
</style>
<style lang="scss">
.coustom-de-select {
background-color: var(--BgSelectColor, #FFFFFF) !important;
border-color: var(--BrSelectColor, #E4E7ED) !important;
// .popper__arrow::after{
// border-bottom-color: var(--BgSelectColor, #FFFFFF) !important;
// }
.popper__arrow,
.popper__arrow::after {

View File

@ -148,6 +148,11 @@ export default {
}
},
watch: {
'value': function(val, old) {
if (!this.inDraw) {
this.$emit('widget-value-changed', val)
}
},
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.setCondition()

View File

@ -122,6 +122,11 @@ export default {
},
watch: {
'value': function(val, old) {
if (!this.inDraw) {
this.$emit('widget-value-changed', val)
}
},
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.setCondition()

View File

@ -14,6 +14,7 @@
style-type="radioGroup"
class="de-tabs-height"
:class="isCurrentEdit ? 'de-tabs-edit' : ''"
:hide-title="hideTitle"
:font-color="fontColor"
:active-color="activeColor"
:border-color="borderColor"
@ -391,6 +392,13 @@ export default {
return 'none'
}
},
hideTitle() {
if (this.element && this.element.style && this.element.style.titleHide && typeof this.element.style.titleHide === 'boolean') {
return this.element.style.titleHide
} else {
return false
}
},
titleValid() {
return !!this.textarea && !!this.textarea.trim()
},

View File

@ -10,6 +10,12 @@
size="small"
class="de-form-item"
>
<el-form-item
label="选项卡标题"
prop="titleShow"
>
<el-checkbox v-model="styleInfo.titleHide">隐藏</el-checkbox>
</el-form-item>
<el-form-item
label="头部字体颜色"
prop="headFrontColor"

View File

@ -87,8 +87,13 @@ class TextSelectServiceImpl extends WidgetService {
})
}
getParam(element) {
const value = this.fillValueDerfault(element)
getParam(element, val) {
let value = null
if (!val) {
value = this.fillValueDerfault(element)
} else {
value = [val]
}
const param = {
component: element,
value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','),

View File

@ -766,6 +766,8 @@ export default {
can_not_move: `Can't be removed, keep at least one administrator`,
manage_can_not_move: 'Administrator is a preset role of the system. By default, he has all the permissions of system management and cannot be deleted',
manage_can_not_update: 'Administrator is a preset role of the system. By default, he has all the permissions of system management and cannot be edit',
inner_can_not_move: 'System built-in roles,cannot be deleted',
inner_can_not_update: 'System built-in roles,cannot be edit',
role_description: 'Role description',
editer_role: 'Edit role',
add_role: 'Add role',
@ -1147,6 +1149,7 @@ export default {
table_header_font_color: 'Header Font',
table_item_font_color: 'Table Font',
table_show_index: 'Show Index',
table_show_table_header: 'Show Table Header',
stripe: 'Zebra pattern',
start_angle: 'Start Angle',
end_angle: 'End Angle',
@ -2024,6 +2027,7 @@ export default {
back_parent: 'Back to previous'
},
panel: {
first_item: 'First item',
forbidden_copy: 'Forbidden copy',
url_check_error: 'Jump error, Illegal URL',
view_style: 'View Style',

View File

@ -765,6 +765,8 @@ export default {
can_not_move: '不可移除,至少保留一位管理員',
manage_can_not_move: '管理員是系統預置角色,默認擁有系統管理全部權限,無法刪除',
manage_can_not_update: '管理員是系統預置角色,默認擁有系統管理全部權限,無法編輯',
inner_can_not_move: '系統預置角色,無法刪除',
inner_can_not_update: '系統預置角色,無法編輯',
role_description: '角色描述',
editer_role: '編輯角色',
add_role: '添加角色',
@ -1146,6 +1148,7 @@ export default {
table_header_font_color: '表頭字體',
table_item_font_color: '表格字體',
table_show_index: '顯示序號',
table_show_table_header: '顯示表頭',
stripe: '斑馬紋',
start_angle: '起始角度',
end_angle: '結束角度',
@ -2018,6 +2021,7 @@ export default {
back_parent: '返回上一級'
},
panel: {
first_item: '首項',
forbidden_copy: '當前組件不允許復製',
url_check_error: '跳轉錯誤URL不合法',
view_style: '視圖樣式',

View File

@ -764,6 +764,8 @@ export default {
can_not_move: '不可移除,至少保留一位管理员',
manage_can_not_move: '管理员是系统预置角色,默认拥有系统管理全部权限,无法删除',
manage_can_not_update: '管理员是系统预置角色,默认拥有系统管理全部权限,无法编辑',
inner_can_not_move: '系统预置角色,无法删除',
inner_can_not_update: '系统预置角色,无法编辑',
role_description: '角色描述',
editer_role: '编辑角色',
add_role: '添加角色',
@ -1145,6 +1147,7 @@ export default {
table_header_font_color: '表头字体',
table_item_font_color: '表格字体',
table_show_index: '显示序号',
table_show_table_header: '显示表头',
stripe: '斑马纹',
start_angle: '起始角度',
end_angle: '结束角度',
@ -2018,6 +2021,7 @@ export default {
back_parent: '返回上一级'
},
panel: {
first_item: '首项',
forbidden_copy: '当前组件不允许复制',
url_check_error: '跳转错误URL不合法',
view_style: '视图样式',

View File

@ -307,8 +307,11 @@ const data = {
},
addViewFilter(state, data) {
const required = data.component.options.attrs.required
const condition = formatCondition(data)
const vValid = valueValid(condition)
let vValid = valueValid(condition)
condition.requiredInvalid = required && !vValid
vValid = vValid || required
// 1.根据componentId过滤
const filterComponentId = condition.componentId
const canvasId = data.canvasId

View File

@ -86,6 +86,9 @@ const actions = {
if (Object.prototype.hasOwnProperty.call(data, 'passwordModified')) {
passwordModified = data.passwordModified
}
if (Object.prototype.hasOwnProperty.call(data, 'defaultPwd')) {
localStorage.setItem('defaultPwd', data.defaultPwd)
}
commit('SET_PASSWORD_MODIFIED', passwordModified)
localStorage.setItem('passwordModified', passwordModified)
resolve()

View File

@ -3,128 +3,134 @@
@import "./variables";
.de-tabs {
&.no-header {
.el-tabs__header {
display: none;
}
}
&.fontColor {
.el-tabs__item {
color: var(--font-color);
&.is-active {
color: $--color-primary;
}
&:hover {
color: $--color-primary;
}
}
}
&.activeColor {
.el-tabs__item {
&.is-active {
color: var(--active-color);
}
&:hover {
color: var(--active-color);
}
}
.el-tabs__active-bar {
background-color: var(--active-color);
}
}
// card样式的边框
&.noBorder.el-tabs--card {
>.el-tabs__header {
border-bottom: none;
.el-tabs__nav {
border: none;
}
.el-tabs__item {
border-left: none;
}
.el-tabs__item.is-active {
border-bottom: none;
}
}
}
&.borderActiveColor.el-tabs--card {
>.el-tabs__header .el-tabs__item.is-active {
border-bottom-color: var(--border-active-color);
}
}
&.borderColor.el-tabs--card {
>.el-tabs__header {
border-bottom-color: var(--border-color);
.el-tabs__nav {
border-color: var(--border-color);
}
.el-tabs__item {
border-left-color: var(--border-color);
}
}
.el-tabs__item {
&.is-active {
color: var(--active-color);
}
&:hover {
color: var(--active-color);
}
}
.el-tabs__active-bar {
background-color: var(--active-color);
}
}
// 简洁样式的边框
&.noBorder {
.el-tabs__nav-wrap::after {
background: none;
}
}
&.borderColor {
.el-tabs__nav-wrap::after {
background: var(--border-color);
}
}
// radioGroup 类型
&.radioGroup.borderColor.el-tabs--card {
>.el-tabs__header {
border-bottom: none;
.el-tabs__nav {
border: none;
}
.el-tabs__item {
border: 1px solid var(--border-color);
border-right: 0;
&:first-child {
border-left: 1px solid var(--border-color);
border-radius: 4px 0 0 4px;
}
&:last-child {
border-right: 1px solid var(--border-color);
border-radius: 0 4px 4px 0;
}
&.is-active {
border: 1px solid var(--border-active-color);
&+.el-tabs__item {
border-left: 0;
}
@ -133,4 +139,3 @@
}
}
}

View File

@ -70,6 +70,9 @@ export const buildViewKeyMap = panelItems => {
return result
}
const cacheCondition = (cb, obj) => {
obj.cb = cb
}
export const buildViewKeyFilters = (panelItems, result) => {
if (!(panelItems && panelItems.length > 0)) {
return result
@ -79,6 +82,7 @@ export const buildViewKeyFilters = (panelItems, result) => {
if (element.type !== 'custom') {
return true
}
const selectFirst = element.serviceName === 'textSelectWidget' && element.options.attrs.selectFirst
let param = null
const widget = ApplicationContext.getService(element.serviceName)
@ -88,15 +92,28 @@ export const buildViewKeyFilters = (panelItems, result) => {
const filterComponentId = condition.componentId
Object.keys(result).forEach(viewId => {
const vidMatch = viewIdMatch(condition.viewIds, viewId)
const viewFilters = result[viewId]
let j = viewFilters.length
while (j--) {
const filter = viewFilters[j]
if (filter.componentId === filterComponentId) {
viewFilters.splice(j, 1)
if (vidMatch && selectFirst) {
const obj = {}
const promise = new Promise(resolve => {
cacheCondition(cbParam => {
const newCondition = getCondition(element, cbParam)
resolve(newCondition)
}, obj)
})
promise.componentId = filterComponentId
promise.cacheObj = obj
result[viewId].push(promise)
} else {
const viewFilters = result[viewId]
let j = viewFilters.length
while (j--) {
const filter = viewFilters[j]
if (filter.componentId === filterComponentId) {
viewFilters.splice(j, 1)
}
}
vidMatch && vValid && viewFilters.push(condition)
}
vidMatch && vValid && viewFilters.push(condition)
})
})
return result
@ -108,6 +125,26 @@ export const buildFilterMap = panelItems => {
return result
}
const getCondition = (element, p) => {
const widget = ApplicationContext.getService(element.serviceName)
const param = widget.getParam(element, p?.val)
const condition = formatCondition(param)
return condition
}
export const buildAfterFilterLoaded = (originMap, p) => {
const componentId = p.componentId
Object.keys(originMap).forEach(viewId => {
const conditions = originMap[viewId]
if (conditions?.length) {
conditions.forEach(condition => {
if (condition instanceof Promise && condition.componentId === componentId && condition.cacheObj?.cb) {
condition.cacheObj.cb(p)
}
})
}
})
}
export const fillElementsFilter = (panelItems, filterMap) => {
panelItems.forEach(element => {
if (element.type === 'view') {

View File

@ -1,4 +1,5 @@
export const DEFAULT_TAB_COLOR_CASE_DARK = {
titleHide: false,
headFontColor: '#FFFFFF',
headFontActiveColor: '#FFFFFF',
headBorderColor: '#131E42',
@ -7,6 +8,7 @@ export const DEFAULT_TAB_COLOR_CASE_DARK = {
}
export const DEFAULT_TAB_COLOR_CASE_LIGHT = {
titleHide: false,
headFontColor: '#OOOOOO',
headFontActiveColor: '#OOOOOO',
headBorderColor: '#OOOOOO',
@ -154,7 +156,8 @@ export const DEFAULT_SIZE = {
mapLineAnimateInterval: 1,
mapLineAnimateTrailLength: 1,
wordSizeRange: [8, 32],
wordSpacing: 6
wordSpacing: 6,
showTableHeader: true
}
export const DEFAULT_SUSPENSION = {
show: true

View File

@ -111,6 +111,15 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
return new DataCell(viewMeta, viewMeta?.spreadsheet)
}
}
// 隐藏表头,保留顶部的分割线, 禁用表头横向 resize
if (customAttr.size.showTableHeader === false) {
s2Options.style.colCfg.height = 1
s2Options.interaction = {
resize: {
colCellVertical: false
}
}
}
// 开始渲染
if (s2) {
@ -284,6 +293,15 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
}
}
}
// 隐藏表头,保留顶部的分割线, 禁用表头横向 resize
if (customAttr.size.showTableHeader === false) {
s2Options.style.colCfg.height = 1
s2Options.interaction = {
resize: {
colCellVertical: false
}
}
}
// 开始渲染
if (s2) {

View File

@ -63,7 +63,8 @@ export const TYPE_CONFIGS = [
'tableColumnMode',
'showIndex',
'indexLabel',
'tableColTooltip'
'tableColTooltip',
'showTableHeader'
],
'title-selector-ant-v': [
'show',
@ -113,7 +114,8 @@ export const TYPE_CONFIGS = [
'tableColumnMode',
'showIndex',
'indexLabel',
'tableColTooltip'
'tableColTooltip',
'showTableHeader'
],
'title-selector-ant-v': [
'show',
@ -1987,7 +1989,8 @@ export const TYPE_CONFIGS = [
'tableColumnWidth',
'showIndex',
'indexLabel',
'tableAutoBreakLine'
'tableAutoBreakLine',
'showTableHeader'
],
'title-selector': [
'show',
@ -2031,7 +2034,8 @@ export const TYPE_CONFIGS = [
'tableColumnWidth',
'showIndex',
'indexLabel',
'tableAutoBreakLine'
'tableAutoBreakLine',
'showTableHeader'
],
'title-selector': [
'show',

View File

@ -467,6 +467,25 @@ export default {
}
}
const chart_option = baseMapOption(base_json, geoJson, chart, this.buttonTextColor, curAreaCode, this.currentSeriesId)
if (chart_option.series?.length) {
const dataNames = []
chart_option.series.filter(se => se.type === 'map').forEach(se => {
se.data.forEach(d => {
if (d?.name) {
dataNames.push(d.name)
}
})
})
for (const key in chart_option.geo.nameMap) {
if (Object.hasOwnProperty.call(chart_option.geo.nameMap, key)) {
const element = chart_option.geo.nameMap[key]
if (element && !dataNames.includes(element)) {
chart_option.geo.nameMap[key] = key
}
}
}
}
this.myEcharts(chart_option)
const opt = this.myChart.getOption()
if (opt && opt.series) {

View File

@ -171,6 +171,8 @@ export default {
// color threshold
this.colorThreshold(customAttr.color.quotaColor)
}
//
this.colorThreshold(null, true)
if (customAttr.size) {
this.dimensionShow = customAttr.size.dimensionShow
this.quotaShow = customAttr.size.quotaShow
@ -201,6 +203,7 @@ export default {
}
if (this.chart.customStyle) {
const customStyle = JSON.parse(this.chart.customStyle)
console.log(customStyle)
if (customStyle.text) {
this.title_show = customStyle.text.show
this.title_class.fontSize = customStyle.text.fontSize + 'px'
@ -214,7 +217,9 @@ export default {
this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
}
if (customStyle.background) {
this.bg_class.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
//
this.colorThreshold(hexColorToRGBA(customStyle.background.color, customStyle.background.alpha), true)
// this.bg_class.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
}
}
},
@ -223,7 +228,8 @@ export default {
this.calcHeight()
},
colorThreshold(valueColor) {
colorThreshold(valueColor, setBg) {
console.log(valueColor, setBg)
if (this.chart.senior) {
const senior = JSON.parse(this.chart.senior)
if (senior.threshold && senior.threshold.labelThreshold && senior.threshold.labelThreshold.length > 0) {
@ -232,52 +238,89 @@ export default {
let flag = false
const t = senior.threshold.labelThreshold[i]
const tv = parseFloat(t.value)
console.log(t)
if (t.term === 'eq') {
if (value === tv) {
this.label_content_class.color = t.color
if (!setBg) {
this.label_content_class.color = t.color
} else {
this.bg_class.background = t.backgroundColor ? t.backgroundColor : valueColor
}
flag = true
}
} else if (t.term === 'not_eq') {
if (value !== tv) {
this.label_content_class.color = t.color
if (!setBg) {
this.label_content_class.color = t.color
} else {
this.bg_class.background = t.backgroundColor ? t.backgroundColor : valueColor
}
flag = true
}
} else if (t.term === 'lt') {
if (value < tv) {
this.label_content_class.color = t.color
if (!setBg) {
this.label_content_class.color = t.color
} else {
this.bg_class.background = t.backgroundColor ? t.backgroundColor : valueColor
}
flag = true
}
} else if (t.term === 'gt') {
if (value > tv) {
this.label_content_class.color = t.color
if (!setBg) {
this.label_content_class.color = t.color
} else {
this.bg_class.background = t.backgroundColor ? t.backgroundColor : valueColor
}
flag = true
}
} else if (t.term === 'le') {
if (value <= tv) {
this.label_content_class.color = t.color
if (!setBg) {
this.label_content_class.color = t.color
} else {
this.bg_class.background = t.backgroundColor ? t.backgroundColor : valueColor
}
flag = true
}
} else if (t.term === 'ge') {
if (value >= tv) {
this.label_content_class.color = t.color
if (!setBg) {
this.label_content_class.color = t.color
} else {
this.bg_class.background = t.backgroundColor ? t.backgroundColor : valueColor
}
flag = true
}
} else if (t.term === 'between') {
const min = parseFloat(t.min)
const max = parseFloat(t.max)
if (min <= value && value <= max) {
this.label_content_class.color = t.color
if (!setBg) {
this.label_content_class.color = t.color
} else {
this.bg_class.background = t.backgroundColor ? t.backgroundColor : valueColor
}
flag = true
}
}
if (flag) {
break
} else if (i === senior.threshold.labelThreshold.length - 1) {
this.label_content_class.color = valueColor
if (!setBg) {
this.label_content_class.color = valueColor
} else {
this.bg_class.background = valueColor
}
}
}
} else {
this.label_content_class.color = valueColor
if (!setBg) {
this.label_content_class.color = valueColor
} else {
this.bg_class.background = valueColor
}
}
}
},

View File

@ -227,7 +227,9 @@ export default {
}
features.forEach(feature => {
this.mappingForm[cCode][feature.properties.name || feature.properties.NAME] = null
if (feature.properties.name || feature.properties.NAME) {
this.mappingForm[cCode][feature.properties.name || feature.properties.NAME] = null
}
})
}
const cCode = this.currentAreaCode

View File

@ -196,9 +196,18 @@
{{ item.min }}&nbsp;{{ $t('chart.drag_block_label_value') }}&nbsp;{{ item.max }}
</span>
</el-col>
<el-col :span="6">
<el-col
:span="3"
:title="$t('chart.textColor')"
>
<span :style="{width:'14px', height:'14px', backgroundColor: item.color, border: 'solid 1px #e1e4e8'}" />
</el-col>
<el-col
:span="3"
:title="$t('chart.backgroundColor')"
>
<span :style="{width:'14px', height:'14px', backgroundColor: item.backgroundColor, border: 'solid 1px #e1e4e8'}" />
</el-col>
</el-row>
</el-col>
</el-col>

View File

@ -34,7 +34,7 @@
</el-select>
</el-col>
<el-col
:span="14"
:span="12"
style="text-align: center;"
>
<el-input
@ -72,6 +72,20 @@
>
<el-color-picker
v-model="item.color"
:title="$t('chart.textColor')"
show-alpha
class="color-picker-style"
:predefine="predefineColors"
@change="changeThreshold"
/>
</el-col>
<el-col
:span="2"
style="text-align: center;"
>
<el-color-picker
v-model="item.backgroundColor"
:title="$t('chart.backgroundColor')"
show-alpha
class="color-picker-style"
:predefine="predefineColors"

View File

@ -242,7 +242,42 @@
</el-form-item>
<!--radar-end-->
<!--table-begin-->
<el-form-item
v-show="showProperty('tableItemFontSize')"
label-width="100px"
:label="$t('chart.table_item_fontsize')"
class="form-item"
>
<el-select
v-model="sizeForm.tableItemFontSize"
:placeholder="$t('chart.table_item_fontsize')"
@change="changeBarSizeCase('tableItemFontSize')"
>
<el-option
v-for="option in fontSize"
:key="option.value"
:label="option.name"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-show="showProperty('tableItemHeight')"
label-width="100px"
:label="$t('chart.table_item_height')"
class="form-item form-item-slider"
>
<el-slider
v-model="sizeForm.tableItemHeight"
:disabled="sizeForm.tableAutoBreakLine"
:min="36"
:max="100"
show-input
:show-input-controls="false"
input-size="mini"
@change="changeBarSizeCase('tableItemHeight')"
/>
</el-form-item>
<el-form-item
v-show="showProperty('tablePageMode')"
label-width="100px"
@ -283,6 +318,22 @@
/>
</el-select>
</el-form-item>
<el-form-item
v-show="showProperty('tableColumnWidth')"
label-width="100px"
:label="$t('chart.table_column_width_config')"
class="form-item form-item-slider"
>
<el-slider
v-model="sizeForm.tableColumnWidth"
:min="10"
:max="1000"
show-input
:show-input-controls="false"
input-size="mini"
@change="changeBarSizeCase('tableColumnWidth')"
/>
</el-form-item>
<el-form-item
v-show="showProperty('tableAutoBreakLine')"
label-width="100px"
@ -303,97 +354,10 @@
</div>
<i
class="el-icon-info"
style="cursor: pointer;color: gray;font-size: 12px;"
style="cursor: pointer;color: grey;font-size: 12px;"
/>
</el-tooltip>
</el-form-item>
<el-form-item
v-show="showProperty('tableTitleFontSize')"
label-width="100px"
:label="$t('chart.table_title_fontsize')"
class="form-item"
>
<el-select
v-model="sizeForm.tableTitleFontSize"
:placeholder="$t('chart.table_title_fontsize')"
@change="changeBarSizeCase('tableTitleFontSize')"
>
<el-option
v-for="option in fontSize"
:key="option.value"
:label="option.name"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-show="showProperty('tableItemFontSize')"
label-width="100px"
:label="$t('chart.table_item_fontsize')"
class="form-item"
>
<el-select
v-model="sizeForm.tableItemFontSize"
:placeholder="$t('chart.table_item_fontsize')"
@change="changeBarSizeCase('tableItemFontSize')"
>
<el-option
v-for="option in fontSize"
:key="option.value"
:label="option.name"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-show="showProperty('tableTitleHeight')"
label-width="100px"
:label="$t('chart.table_title_height')"
class="form-item form-item-slider"
>
<el-slider
v-model="sizeForm.tableTitleHeight"
:min="36"
:max="100"
show-input
:show-input-controls="false"
input-size="mini"
@change="changeBarSizeCase('tableTitleHeight')"
/>
</el-form-item>
<el-form-item
v-show="showProperty('tableItemHeight')"
label-width="100px"
:label="$t('chart.table_item_height')"
class="form-item form-item-slider"
>
<el-slider
v-model="sizeForm.tableItemHeight"
:disabled="sizeForm.tableAutoBreakLine"
:min="36"
:max="100"
show-input
:show-input-controls="false"
input-size="mini"
@change="changeBarSizeCase('tableItemHeight')"
/>
</el-form-item>
<el-form-item
v-show="showProperty('tableColumnWidth')"
label-width="100px"
:label="$t('chart.table_column_width_config')"
class="form-item form-item-slider"
>
<el-slider
v-model="sizeForm.tableColumnWidth"
:min="10"
:max="1000"
show-input
:show-input-controls="false"
input-size="mini"
@change="changeBarSizeCase('tableColumnWidth')"
/>
</el-form-item>
<el-form-item
v-show="showProperty('showIndex')"
label-width="100px"
@ -421,6 +385,59 @@
@blur="changeBarSizeCase('indexLabel')"
/>
</el-form-item>
<el-divider v-show="includesAny(chart.type ,'table')" />
<el-form-item
v-show="showProperty('showTableHeader')"
label-width="100px"
:label="$t('chart.table_show_table_header')"
class="form-item"
>
<el-radio-group
v-model="sizeForm.showTableHeader"
@change="changeBarSizeCase('showTableHeader')"
>
<el-radio :label="true">{{ $t('commons.yes') }}</el-radio>
<el-radio :label="false">{{ $t('commons.no') }}</el-radio>
</el-radio-group>
</el-form-item>
<div v-show="showProperty('showTableHeader') && sizeForm.showTableHeader">
<el-form-item
v-show="showProperty('tableTitleFontSize')"
label-width="100px"
:label="$t('chart.table_title_fontsize')"
class="form-item"
>
<el-select
v-model="sizeForm.tableTitleFontSize"
:placeholder="$t('chart.table_title_fontsize')"
@change="changeBarSizeCase('tableTitleFontSize')"
>
<el-option
v-for="option in fontSize"
:key="option.value"
:label="option.name"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-show="showProperty('tableTitleHeight')"
label-width="100px"
:label="$t('chart.table_title_height')"
class="form-item form-item-slider"
>
<el-slider
v-model="sizeForm.tableTitleHeight"
:min="36"
:max="100"
show-input
:show-input-controls="false"
input-size="mini"
@change="changeBarSizeCase('tableTitleHeight')"
/>
</el-form-item>
</div>
<!--table-end-->
<!--gauge-begin-->
@ -1055,6 +1072,7 @@
<script>
import { CHART_FONT_FAMILY, CHART_FONT_LETTER_SPACE, DEFAULT_SIZE } from '../../chart/chart'
import { includesAny } from '@/utils/StringUtils'
export default {
name: 'SizeSelector',
props: {
@ -1118,6 +1136,7 @@ export default {
this.initData()
},
methods: {
includesAny,
initData() {
const chart = JSON.parse(JSON.stringify(this.chart))
if (chart.customAttr) {
@ -1145,6 +1164,7 @@ export default {
this.sizeForm.tablePageSize = this.sizeForm.tablePageSize ? this.sizeForm.tablePageSize : DEFAULT_SIZE.tablePageSize
this.sizeForm.showIndex = this.sizeForm.showIndex ? this.sizeForm.showIndex : DEFAULT_SIZE.showIndex
this.sizeForm.showTableHeader = this.sizeForm.showTableHeader !== false
if (this.sizeForm.indexLabel === null || this.sizeForm.indexLabel === undefined) {
this.sizeForm.indexLabel = DEFAULT_SIZE.indexLabel
}

View File

@ -162,7 +162,60 @@
</el-form-item>
<!--radar-end-->
<!--table-begin-->
<el-form-item
v-show="showProperty('tableItemFontSize')"
label-width="100px"
:label="$t('chart.table_item_fontsize')"
class="form-item"
>
<el-select
v-model="sizeForm.tableItemFontSize"
:placeholder="$t('chart.table_item_fontsize')"
@change="changeBarSizeCase('tableItemFontSize')"
>
<el-option
v-for="option in fontSize"
:key="option.value"
:label="option.name"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-show="showProperty('tableItemAlign')"
label-width="100px"
:label="$t('chart.table_item_align')"
class="form-item"
>
<el-select
v-model="sizeForm.tableItemAlign"
:placeholder="$t('chart.table_item_align')"
@change="changeBarSizeCase('tableItemAlign')"
>
<el-option
v-for="option in alignOptions"
:key="option.value"
:label="option.name"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-show="showProperty('tableItemHeight')"
label-width="100px"
:label="$t('chart.table_item_height')"
class="form-item form-item-slider"
>
<el-slider
v-model="sizeForm.tableItemHeight"
:min="20"
:max="100"
show-input
:show-input-controls="false"
input-size="mini"
@change="changeBarSizeCase('tableItemHeight')"
/>
</el-form-item>
<el-form-item
v-show="showProperty('tablePageMode')"
label-width="100px"
@ -203,114 +256,6 @@
/>
</el-select>
</el-form-item>
<el-form-item
v-show="showProperty('tableTitleFontSize')"
label-width="100px"
:label="$t('chart.table_title_fontsize')"
class="form-item"
>
<el-select
v-model="sizeForm.tableTitleFontSize"
:placeholder="$t('chart.table_title_fontsize')"
@change="changeBarSizeCase('tableTitleFontSize')"
>
<el-option
v-for="option in fontSize"
:key="option.value"
:label="option.name"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-show="showProperty('tableItemFontSize')"
label-width="100px"
:label="$t('chart.table_item_fontsize')"
class="form-item"
>
<el-select
v-model="sizeForm.tableItemFontSize"
:placeholder="$t('chart.table_item_fontsize')"
@change="changeBarSizeCase('tableItemFontSize')"
>
<el-option
v-for="option in fontSize"
:key="option.value"
:label="option.name"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-show="showProperty('tableHeaderAlign')"
label-width="100px"
:label="$t('chart.table_header_align')"
class="form-item"
>
<el-select
v-model="sizeForm.tableHeaderAlign"
:placeholder="$t('chart.table_header_align')"
@change="changeBarSizeCase('tableHeaderAlign')"
>
<el-option
v-for="option in alignOptions"
:key="option.value"
:label="option.name"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-show="showProperty('tableItemAlign')"
label-width="100px"
:label="$t('chart.table_item_align')"
class="form-item"
>
<el-select
v-model="sizeForm.tableItemAlign"
:placeholder="$t('chart.table_item_align')"
@change="changeBarSizeCase('tableItemAlign')"
>
<el-option
v-for="option in alignOptions"
:key="option.value"
:label="option.name"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-show="showProperty('tableTitleHeight')"
label-width="100px"
:label="$t('chart.table_title_height')"
class="form-item form-item-slider"
>
<el-slider
v-model="sizeForm.tableTitleHeight"
:min="20"
:max="100"
show-input
:show-input-controls="false"
input-size="mini"
@change="changeBarSizeCase('tableTitleHeight')"
/>
</el-form-item>
<el-form-item
v-show="showProperty('tableItemHeight')"
label-width="100px"
:label="$t('chart.table_item_height')"
class="form-item form-item-slider"
>
<el-slider
v-model="sizeForm.tableItemHeight"
:min="20"
:max="100"
show-input
:show-input-controls="false"
input-size="mini"
@change="changeBarSizeCase('tableItemHeight')"
/>
</el-form-item>
<el-form-item
v-show="showProperty('tableColumnMode')"
label-width="100px"
@ -384,29 +329,100 @@
@blur="changeBarSizeCase('indexLabel')"
/>
</el-form-item>
<el-divider v-show="equalsAny(chart.type, 'table-info', 'table-normal')" />
<el-form-item
v-show="showProperty('tableRowTooltip')"
v-show="showProperty('showTableHeader')"
label-width="100px"
:label="$t('chart.table_row_tooltip')"
:label="$t('chart.table_show_table_header')"
class="form-item"
>
<el-checkbox
v-model="sizeForm.tableRowTooltip.show"
@change="changeBarSizeCase('tableRowTooltip')"
/>
<el-radio-group
v-model="sizeForm.showTableHeader"
@change="changeBarSizeCase('showTableHeader')"
>
<el-radio :label="true">{{ $t('commons.yes') }}</el-radio>
<el-radio :label="false">{{ $t('commons.no') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
v-show="showProperty('tableColTooltip')"
label-width="100px"
:label="$t('chart.table_col_tooltip')"
class="form-item"
>
<el-checkbox
v-model="sizeForm.tableColTooltip.show"
@change="changeBarSizeCase('tableColTooltip')"
/>
</el-form-item>
<div v-show="showProperty('showTableHeader') && sizeForm.showTableHeader">
<el-form-item
v-show="showProperty('tableTitleFontSize')"
label-width="100px"
:label="$t('chart.table_title_fontsize')"
class="form-item"
>
<el-select
v-model="sizeForm.tableTitleFontSize"
:placeholder="$t('chart.table_title_fontsize')"
@change="changeBarSizeCase('tableTitleFontSize')"
>
<el-option
v-for="option in fontSize"
:key="option.value"
:label="option.name"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-show="showProperty('tableHeaderAlign')"
label-width="100px"
:label="$t('chart.table_header_align')"
class="form-item"
>
<el-select
v-model="sizeForm.tableHeaderAlign"
:placeholder="$t('chart.table_header_align')"
@change="changeBarSizeCase('tableHeaderAlign')"
>
<el-option
v-for="option in alignOptions"
:key="option.value"
:label="option.name"
:value="option.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-show="showProperty('tableTitleHeight')"
label-width="100px"
:label="$t('chart.table_title_height')"
class="form-item form-item-slider"
>
<el-slider
v-model="sizeForm.tableTitleHeight"
:min="20"
:max="100"
show-input
:show-input-controls="false"
input-size="mini"
@change="changeBarSizeCase('tableTitleHeight')"
/>
</el-form-item>
<el-form-item
v-show="showProperty('tableRowTooltip')"
label-width="100px"
:label="$t('chart.table_row_tooltip')"
class="form-item"
>
<el-checkbox
v-model="sizeForm.tableRowTooltip.show"
@change="changeBarSizeCase('tableRowTooltip')"
/>
</el-form-item>
<el-form-item
v-show="showProperty('tableColTooltip')"
label-width="100px"
:label="$t('chart.table_col_tooltip')"
class="form-item"
>
<el-checkbox
v-model="sizeForm.tableColTooltip.show"
@change="changeBarSizeCase('tableColTooltip')"
/>
</el-form-item>
</div>
<!--table-end-->
<!--chart-mix-start-->
<span v-show="showProperty('mix')">
<el-divider
@ -1427,7 +1443,7 @@
<script>
import { CHART_FONT_FAMILY, CHART_FONT_LETTER_SPACE, DEFAULT_SIZE } from '../../chart/chart'
import { equalsAny } from '@/utils/StringUtils'
import { equalsAny, includesAny } from '@/utils/StringUtils'
import { mapState } from 'vuex'
export default {
@ -1537,6 +1553,8 @@ export default {
this.initData()
},
methods: {
equalsAny,
includesAny,
initField() {
this.quotaData = this.quotaFields.filter(ele => !ele.chartId && ele.id !== 'count')
if (this.sizeForm.gaugeMinField.id) {
@ -1590,6 +1608,7 @@ export default {
this.sizeForm.tableColTooltip = this.sizeForm.tableColTooltip ?? DEFAULT_SIZE.tableColTooltip
this.sizeForm.showIndex = this.sizeForm.showIndex ? this.sizeForm.showIndex : DEFAULT_SIZE.showIndex
this.sizeForm.showTableHeader = this.sizeForm.showTableHeader !== false
if (this.sizeForm.indexLabel === null || this.sizeForm.indexLabel === undefined) {
this.sizeForm.indexLabel = DEFAULT_SIZE.indexLabel
}

View File

@ -2,8 +2,15 @@
<div
ref="tableContainer"
:style="bg_class"
style="padding: 8px;width: 100%;height: 100%;overflow: hidden;"
style="padding: 8px;width: 100%;height: 100%;overflow: hidden;position: relative;"
>
<view-track-bar
ref="viewTrack"
:track-menu="trackMenu"
:style="trackBarStyle"
class="track-bar"
@trackClick="trackClick"
/>
<el-row
style="height: 100%;"
:style="cssVars"
@ -16,18 +23,20 @@
<ux-grid
ref="plxTable"
size="mini"
class="table-class"
:style="tableStyle"
:height="height"
:checkbox-config="{highlight: true}"
:width-resize="true"
:header-row-style="table_header_class"
:row-style="getRowStyle"
class="table-class"
:class="chart.id"
:merge-cells="mergeCells"
:show-summary="showSummary"
:summary-method="summaryMethod"
:index-config="{seqMethod}"
:show-header="showHeader"
@cell-click="cellClick"
>
<ux-table-column
type="index"
@ -95,13 +104,13 @@
<script>
import { hexColorToRGBA } from '../../chart/util'
import eventBus from '@/components/canvas/utils/eventBus'
import { DEFAULT_COLOR_CASE, DEFAULT_SCROLL, DEFAULT_SIZE, NOT_SUPPORT_PAGE_DATASET } from '@/views/chart/chart/chart'
import { mapState } from 'vuex'
import DePagination from '@/components/deCustomCm/pagination.js'
import ViewTrackBar from '@/components/canvas/components/editor/ViewTrackBar.vue'
export default {
name: 'TableNormal',
components: { DePagination },
components: { ViewTrackBar, DePagination },
props: {
chart: {
type: Object,
@ -123,6 +132,18 @@ export default {
type: Boolean,
required: false,
default: true
},
trackMenu: {
type: Array,
required: false,
default: function() {
return ['drill']
}
},
searchCount: {
type: Number,
required: false,
default: 0
}
},
data() {
@ -174,6 +195,7 @@ export default {
scrollTop: 0,
showIndex: false,
indexLabel: '序号',
showHeader: true,
scrollBarColor: DEFAULT_COLOR_CASE.tableScrollBarColor,
scrollBarHoverColor: DEFAULT_COLOR_CASE.tableScrollBarHoverColor,
totalStyle: {
@ -186,7 +208,13 @@ export default {
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
}
},
trackBarStyle: {
position: 'absolute',
left: '0px',
top: '0px'
},
pointParam: null
}
},
computed: {
@ -234,11 +262,8 @@ export default {
},
mounted() {
this.init()
//
eventBus.$on('resizing', this.chartResize)
},
beforeDestroy() {
eventBus.$off('resizing', this.chartResize)
clearInterval(this.scrollTimer)
window.removeEventListener('resize', this.calcHeightDelay)
},
@ -428,6 +453,11 @@ export default {
} else {
this.indexLabel = customAttr.size.indexLabel
}
if (customAttr.size.showTableHeader === false) {
this.showHeader = false
} else {
this.showHeader = true
}
const autoBreakLine = customAttr.size.tableAutoBreakLine ? customAttr.size.tableAutoBreakLine : DEFAULT_SIZE.tableAutoBreakLine
if (autoBreakLine) {
@ -614,6 +644,83 @@ export default {
})
}, senior.scrollCfg.interval)
}
},
cellClick(row, col, cell, ev) {
const nameIdMap = this.chart.data.fields.reduce((pre, next) => {
pre[next['dataeaseName']] = next['id']
return pre
}, {})
const dimensionList = []
for (const key in row) {
if (nameIdMap[key]) {
dimensionList.push({ id: nameIdMap[key], value: row[key] })
}
}
const parent = cell.offsetParent
//
const y = cell.offsetTop - parent.scrollTop + parent.offsetTop + ev.offsetY
const position = {
x: cell.offsetLeft + ev.offsetX,
y
}
this.antVActionPost(dimensionList, nameIdMap[col.property] || 'null', position)
},
antVActionPost(dimensionList, name, param) {
this.pointParam = {
data: {
dimensionList: dimensionList,
quotaList: [],
name: name,
sourceType: this.chart.type
}
}
if (this.trackMenu.length < 2) { //
this.trackClick(this.trackMenu[0])
} else { //
this.trackBarStyle.left = param.x + 'px'
this.trackBarStyle.top = (param.y + 10) + 'px'
this.$refs.viewTrack.trackButtonClick()
}
},
trackClick(trackAction) {
const param = this.pointParam
if (!param?.data?.dimensionList) {
//
if (this.chart.type === 'map') {
this.$warning(this.$t('panel.no_drill_field'))
}
return
}
const linkageParam = {
option: 'linkage',
name: this.pointParam.data.name,
viewId: this.chart.id,
dimensionList: this.pointParam.data.dimensionList,
quotaList: this.pointParam.data.quotaList
}
const jumpParam = {
option: 'jump',
name: this.pointParam.data.name,
viewId: this.chart.id,
dimensionList: this.pointParam.data.dimensionList,
quotaList: this.pointParam.data.quotaList,
sourceType: this.pointParam.data.sourceType
}
switch (trackAction) {
case 'drill':
this.currentPage.page = 1
this.$emit('onChartClick', this.pointParam)
break
case 'linkage':
this.$store.commit('addViewTrackFilter', linkageParam)
break
case 'jump':
this.$emit('onJumpClick', jumpParam)
break
default:
break
}
}
}
}

View File

@ -68,10 +68,9 @@
@node-click="handleNodeClick"
@check-change="handleCheckChange"
>
<span
slot-scope="{ data }"
<span class="custom-tree-node"
slot-scope="{ node, data}"
:title="data.excelLabel"
class="custom-tree-node"
>
<span class="label">{{ data.excelLabel }}</span>
<span
@ -87,6 +86,16 @@
class="ds-icon-scene"
/>
</span>
<span>
<el-button
v-show="!data.sheet"
type="text"
size="mini"
@click="() => remove(node, data)">
{{ $t('dataset.delete') }}
</el-button>
</span>
</span>
</el-tree>
</div>
@ -465,7 +474,12 @@ export default {
store.dispatch('user/refreshToken', refreshToken)
}
},
remove(node, data) {
const parent = node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex(d => d.id === data.id);
children.splice(index, 1);
},
save() {
var validate = true
var selectedSheet = []

View File

@ -267,6 +267,7 @@
<filter-head
:element="currentElement"
@dataset-name="dataSetName"
@required-change="requiredChange"
/>
<filter-control
@ -278,7 +279,11 @@
:active-name="activeName"
/>
<filter-foot :element="currentElement" />
<filter-foot
:element="currentElement"
:control-attrs="myAttrs"
@widget-value-changed="widgetValChange"
/>
</div>
</de-main-container>
@ -388,13 +393,18 @@ export default {
datasetParams: [],
currentElement: null,
tempTreeData: null,
showTips: false
showTips: false,
widgetValue: null,
required: false
}
},
computed: {
isTree() {
return this.widget && this.widget.isTree
},
requiredMatch() {
return !this.required || !!this.widgetValue?.length
},
...mapState([
'componentData'
])
@ -405,7 +415,6 @@ export default {
if (values && values.length > 0) {
const fieldIds = values.map(val => val.id)
this.myAttrs.fieldId = fieldIds.join()
// this.myAttrs.dragItems = values
this.myAttrs.activeName = this.activeName
this.myAttrs.fieldsParent = this.fieldsParent
} else if (this.myAttrs && this.myAttrs.fieldId) {
@ -414,7 +423,9 @@ export default {
}
this.enableSureButton()
},
requiredMatch(val) {
this.enableSureButton()
},
keyWord(val) {
this.expandedArray = []
if (this.showDomType === 'field') {
@ -446,6 +457,7 @@ export default {
created() {
this.widget = this.widgetInfo
this.currentElement = JSON.parse(JSON.stringify(this.element))
this.required = !!this.currentElement.options.attrs.required
this.myAttrs = this.currentElement.options.attrs
this.treeNode(this.groupForm)
this.loadViews()
@ -464,6 +476,16 @@ export default {
bus.$off('valid-values-change', this.validateFilterValue)
},
methods: {
widgetValChange(val) {
if (val === null) {
this.widgetValue = null
return
}
this.widgetValue = val.toString()
},
requiredChange(val) {
this.required = val
},
dataSetName(tableId, callback) {
let result = null
if (tableId) {
@ -911,24 +933,26 @@ export default {
enableSureButton() {
let valid = true
const enable =
this.currentElement.options.attrs.dragItems && this.currentElement.options.attrs.dragItems
.length > 0
if (this.widget.validDynamicValue) {
valid = this.widget.validDynamicValue(this.currentElement)
}
this.$emit('sure-button-status', enable && valid)
this.$emit('sure-button-status', enable && valid && this.requiredMatch)
},
getElementInfo() {
if (this.currentElement.options.attrs.selectFirst) {
this.currentElement.options.value = ''
}
return this.currentElement
},
validateFilterValue(valid) {
const enable = this.currentElement.options.attrs.dragItems && this.currentElement.options.attrs.dragItems
.length > 0
this.$emit('sure-button-status', enable && valid)
this.$emit('sure-button-status', enable && valid && this.requiredMatch)
}
}

View File

@ -138,6 +138,7 @@
:style="element.style"
:element="element"
:in-draw="false"
@widget-value-changed="widgetValChanged"
/>
</el-form-item>
@ -195,11 +196,26 @@ export default {
return 2
}
},
watch: {
'dval': function(val, old) {
if (this.element.options.attrs.default.isDynamic) {
this.$emit('widget-value-changed', val)
}
}
},
created() {
this.setDval()
},
methods: {
widgetValChanged(val) {
if (!this.element.options.attrs.default.isDynamic) {
this.$emit('widget-value-changed', val)
}
},
dynamicChange(value) {
if (!value) {
this.$emit('widget-value-changed', this.element.options.value)
}
this.setDval()
},
dkeyChange(value) {

View File

@ -275,6 +275,7 @@
:element="element"
class="relative-time"
:in-draw="false"
@widget-value-changed="widgetValChanged"
/>
</el-form-item>
@ -334,12 +335,27 @@ export default {
return result
}
},
watch: {
'dval': function(val, old) {
if (this.element.options.attrs.default.isDynamic) {
this.$emit('widget-value-changed', val)
}
}
},
created() {
this.fillEmptySuffixTime()
this.setDval()
},
methods: {
widgetValChanged(val) {
if (!this.element.options.attrs.default.isDynamic) {
this.$emit('widget-value-changed', val)
}
},
dynamicChange(value) {
if (!value) {
this.$emit('widget-value-changed', this.element.options.value)
}
this.setDval()
},
dkeyChange(value) {

View File

@ -368,7 +368,7 @@ export default {
this.showParams = true
this.isRangeParamWidget = this.widget.isRangeParamWidget && this.widget.isRangeParamWidget()
}
if ('timeYearWidget,timeMonthWidget,timeDateWidget,textSelectWidget,numberSelectWidget'.indexOf(this.widget.name) !== -1) {
if ('textInputWidget,timeYearWidget,timeMonthWidget,timeDateWidget,textSelectWidget,numberSelectWidget'.indexOf(this.widget.name) !== -1) {
this.showParams = true
}
},

View File

@ -8,6 +8,15 @@
>
<div style="margin-bottom: 10px;">
<span>{{ $t('dynamic_time.set_default') }}</span>
<el-checkbox
v-if="element.serviceName === 'textSelectWidget'"
v-model="element.options.attrs.selectFirst"
class="select-first-check"
@change="selectFirstChange"
>
{{ $t('panel.first_item') }}
</el-checkbox>
</div>
<div class="custom-component-class">
<component
@ -18,6 +27,7 @@
is-config
:element="element"
:in-draw="false"
@widget-value-changed="widgetValChange"
/>
</div>
@ -30,6 +40,7 @@
<de-date-default
v-if="element.component === 'de-date' && element.serviceName !== 'timeDateRangeWidget'"
:element="element"
@widget-value-changed="widgetValChange"
/>
</el-card>
@ -40,6 +51,7 @@
<de-date-range-default
v-if="element.component === 'de-date' && element.serviceName === 'timeDateRangeWidget'"
:element="element"
@widget-value-changed="widgetValChange"
/>
</el-card>
@ -67,12 +79,17 @@ export default {
},
data() {
return {
attrs: null
}
},
created() {
},
methods: {
selectFirstChange(val) {
},
widgetValChange(val) {
this.$emit('widget-value-changed', val)
}
}
}
@ -91,5 +108,8 @@ export default {
max-height: 100%;
overflow-y: scroll;
}
.select-first-check {
margin-left: 25px;
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<el-row>
<el-col :span="24">
<el-col :span="20">
<div class="filter-field">
<div class="field-content">
@ -38,6 +38,14 @@
</div>
</div>
</el-col>
<el-col :span="4">
<div class="de-filter-required">
<el-checkbox
v-model="element.options.attrs.required"
@change="requiredChange"
>{{ $t('commons.required') }}</el-checkbox>
</div>
</el-col>
</el-row>
</template>
@ -71,10 +79,12 @@ export default {
},
methods: {
requiredChange(val) {
this.$emit('required-change', val)
},
getTableName(tableId) {
let tableName = null
this.$emit('dataset-name', tableId, t => { tableName = t })
console.log(tableName)
return tableName
},
onMove(e, originalEvent) {
@ -95,6 +105,11 @@ export default {
</script>
<style lang="scss" scoped>
.de-filter-required {
height: 40px;
line-height: 40px;
float: right;
}
.filter-field {
border-radius: 4px;
height: 40px;

View File

@ -83,7 +83,16 @@
style="margin-right: 10px"
@select="panelNodeClick"
@input="inputVal"
/>
>
<label
slot="option-label"
slot-scope="{ node, labelClassName }"
:class="labelClassName"
:title="node.label"
>
{{ node.label }}
</label>
</treeselect>
</el-col>
</el-row>
<el-row style="margin-top: 10px;height: 30px">

View File

@ -292,7 +292,6 @@ export default {
this.outerParamsInfo.targetViewInfoList.forEach((targetViewInfo) => {
viewIds.push(targetViewInfo.targetViewId)
})
console.log('viewIds=' + JSON.stringify(viewIds))
return viewIds
},
...mapState([

View File

@ -4,6 +4,7 @@ import { deepCopy } from '@/components/canvas/utils/utils'
import { COMMON_BACKGROUND } from '@/components/canvas/customComponent/component-list'
export const TAB_COMMON_STYLE = {
titleHide: false,
headFontColor: '#000000',
headFontActiveColor: '#000000',
headBorderColor: '#ffffff',

View File

@ -525,6 +525,20 @@
</el-input>
</el-form-item>
<el-form-item
:label="$t('datasource.query_timeout')"
prop="apiQueryTimeout"
>
<el-input
v-model="apiItem.queryTimeout"
autocomplete="off"
type="number"
:min="0"
>
<template slot="append">{{ $t('panel.second') }}</template>
</el-input>
</el-form-item>
<div v-loading="loading">
<div class="row-rules mr40">
<span>{{ $t('datasource.req_param') }}</span>
@ -981,6 +995,13 @@ export default {
trigger: 'blur'
}
],
'apiQueryTimeout': [
{
required: true,
message: i18n.t('datasource.please_input_query_timeout'),
trigger: 'blur'
}
],
dataPath: [
{
required: true,
@ -1001,6 +1022,7 @@ export default {
name: '',
url: '',
method: 'GET',
queryTimeout: 30,
request: {
headers: [{}],
arguments: [],
@ -1018,6 +1040,7 @@ export default {
url: '',
method: 'GET',
dataPath: '',
queryTimeout: 30,
request: {
headers: [],
arguments: [],

View File

@ -114,7 +114,6 @@ export default {
})
},
initLoad() {
console.log('map load ...')
queryMapKey().then(res => {
this.key = res.data
this.loadMap()

View File

@ -307,9 +307,6 @@ export default {
this.addGlobalImage()
this.drawView()
this.myChart.on('click', ev => {
this.$emit('trigger-edit-click', ev.originEvent)
})
})
} else {
this.loading = false

View File

@ -60,7 +60,7 @@ function _healthcheck() {
container_name=$(grep "container_name" $DE_BASE/dataease/docker-compose.yml | awk -F': ' '{print $2}')
sleep 1
if [ -z $(docker ps --filter "name=$container_name" -q) ];then
echo "未找到容器 $container_name,请检查配置文件。"
echo "未找到容器 $container_name。"
exit 1
fi

View File

@ -15,7 +15,7 @@ public enum DatasourceTypes {
pg("pg", "PostgreSQL", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, null, null,true, DatabaseClassification.OLTP),
kingbase("kingbase", "KingBase", "\"", "\"", "\"", "\"", "", false, DatasourceCalculationMode.DIRECT, null,null,true, DatabaseClassification.OLTP),
sqlServer("sqlServer", "SQL Server", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, null, null,true, DatabaseClassification.OLTP),
oracle("oracle", "Oracle", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, Arrays.asList("Default", "GBK", "BIG5", "ISO-8859-1", "UTF-8", "UTF-16", "CP850", "EUC_JP", "EUC_KR"), Arrays.asList("Default", "GBK", "UTF-8"),true, DatabaseClassification.OLTP),
oracle("oracle", "Oracle", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, Arrays.asList("Default", "GBK", "BIG5", "ISO-8859-1", "UTF-8", "UTF-16", "CP850", "EUC_JP", "EUC_KR", "US7ASCII", "AL32UTF8"), Arrays.asList("Default", "GBK", "UTF-8"),true, DatabaseClassification.OLTP),
mongo("mongo", "MongoDB", "`", "`", "\"", "\"", "rebuildschema=true&authSource=admin", true, DatasourceCalculationMode.DIRECT, null, null,true, DatabaseClassification.OLTP),
ck("ck", "ClickHouse", "`", "`", "", "", "", true, DatasourceCalculationMode.DIRECT, null, null,true, DatabaseClassification.OLAP),
db2("db2", "Db2", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, null, null,true, DatabaseClassification.OLTP),