|
@@ -428,6 +428,7 @@ import axios from 'axios';
|
|
import { debounce } from '@/services/debouce';
|
|
import { debounce } from '@/services/debouce';
|
|
import { getPenTree, typeOptions } from '@/services/common';
|
|
import { getPenTree, typeOptions } from '@/services/common';
|
|
import { updatePen } from './pen';
|
|
import { updatePen } from './pen';
|
|
|
|
+import { getter, setter } from '@meta2d/core/src/utils/object';
|
|
|
|
|
|
import CodeEditor from '@/views/components/common/CodeEditor.vue';
|
|
import CodeEditor from '@/views/components/common/CodeEditor.vue';
|
|
import Actions from './Actions.vue';
|
|
import Actions from './Actions.vue';
|
|
@@ -735,6 +736,8 @@ const onSelectBindsChange = (value: string[], options: any) => {
|
|
|
|
|
|
dataBindDialog.selectedIds = value;
|
|
dataBindDialog.selectedIds = value;
|
|
dataBindDialog.data.binds = toRaw(options.selectedRowData[0]);
|
|
dataBindDialog.data.binds = toRaw(options.selectedRowData[0]);
|
|
|
|
+ doBindInit();
|
|
|
|
+ //
|
|
} else if (options.type === 'uncheck') {
|
|
} else if (options.type === 'uncheck') {
|
|
// if (options.currentRowKey === 'CHECK_ALL_BOX') {
|
|
// if (options.currentRowKey === 'CHECK_ALL_BOX') {
|
|
// for (const data of dataBindDialog.dataSet) {
|
|
// for (const data of dataBindDialog.dataSet) {
|
|
@@ -758,6 +761,25 @@ const onSelectBindsChange = (value: string[], options: any) => {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+const doBindInit = () => {
|
|
|
|
+ let { key } = dataBindDialog.data;
|
|
|
|
+ if (props.pen.name === 'echarts' && key.includes('echarts.option.series')) {
|
|
|
|
+ const { replaceMode } = props.pen.echarts;
|
|
|
|
+ const { xAxis } = props.pen.echarts.option;
|
|
|
|
+
|
|
|
|
+ let beforeV = getter(props.pen, key);
|
|
|
|
+ if (Array.isArray(beforeV) && replaceMode === 0) {
|
|
|
|
+ //追加
|
|
|
|
+ setter(props.pen, key, []);
|
|
|
|
+ let _key = 'echarts.option.xAxis.data';
|
|
|
|
+ if (Array.isArray(xAxis) && xAxis.length) {
|
|
|
|
+ _key = 'echarts.option.xAxis.0.data';
|
|
|
|
+ }
|
|
|
|
+ setter(props.pen, _key, []);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
const dataBindonConfirm = () => {
|
|
const dataBindonConfirm = () => {
|
|
dataBindDialog.show = false;
|
|
dataBindDialog.show = false;
|
|
meta2d.initBinds();
|
|
meta2d.initBinds();
|