@ecan-bi/datav 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +51 -55
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +51 -55
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +8 -8
- package/package.json +1 -1
- package/types/table/table/Table.vue.d.ts +8 -2
- package/types/table/table/index.d.ts +8 -2
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @ecan-bi/datav@1.1.
|
|
1
|
+
/*! @ecan-bi/datav@1.1.2 */
|
|
2
2
|
var _a, _b, _c, _d;
|
|
3
3
|
import { watch, inject, computed, unref, watchEffect, defineComponent, shallowRef, toRefs, onMounted, onUnmounted, h, nextTick, createVNode, resolveComponent, openBlock, createElementBlock, createBlock, renderSlot, withCtx, ref, normalizeStyle, createCommentVNode, provide, onBeforeUnmount, toDisplayString, Fragment, renderList, createElementVNode, normalizeClass, pushScopeId, popScopeId, createSlots, resolveDynamicComponent, mergeProps, withModifiers, withDirectives, vShow } from "vue";
|
|
4
4
|
import { throttle, init, use, registerMap } from "echarts/core";
|
|
@@ -1560,7 +1560,6 @@ const BASE_URL = ((_c = window == null ? void 0 : window.config) == null ? void
|
|
|
1560
1560
|
const ERD_URL = ((_d = window == null ? void 0 : window.config) == null ? void 0 : _d.erdURL) || "";
|
|
1561
1561
|
const useOnEvent = (props2, events) => {
|
|
1562
1562
|
watch(() => props2.id, (id, oldId) => {
|
|
1563
|
-
console.log(id, oldId);
|
|
1564
1563
|
const eventBus = inject(EVENT_BUS, {
|
|
1565
1564
|
onEvent: (i, e) => void 0,
|
|
1566
1565
|
offEvent: (i) => void 0
|
|
@@ -1677,8 +1676,6 @@ const useVariablesInText = (formatter = "", data = {}, { useNewline = false, use
|
|
|
1677
1676
|
const usedVariable = data[textVariable];
|
|
1678
1677
|
if (usedVariable != null) {
|
|
1679
1678
|
statement = statement.replace(textVariable, usedVariable);
|
|
1680
|
-
} else {
|
|
1681
|
-
statement = statement.replace(textVariable, "");
|
|
1682
1679
|
}
|
|
1683
1680
|
}
|
|
1684
1681
|
try {
|
|
@@ -3150,7 +3147,7 @@ const _hoisted_2$2 = {
|
|
|
3150
3147
|
key: 0,
|
|
3151
3148
|
class: "ranking"
|
|
3152
3149
|
};
|
|
3153
|
-
const _hoisted_3$
|
|
3150
|
+
const _hoisted_3$2 = {
|
|
3154
3151
|
key: 1,
|
|
3155
3152
|
class: "ecan-list-content"
|
|
3156
3153
|
};
|
|
@@ -3198,7 +3195,7 @@ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3198
3195
|
], 4);
|
|
3199
3196
|
}), 128))
|
|
3200
3197
|
])) : createCommentVNode("", true),
|
|
3201
|
-
_ctx.dataSource.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
3198
|
+
_ctx.dataSource.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
|
|
3202
3199
|
_ctx.useTitle ? (openBlock(), createElementBlock("div", {
|
|
3203
3200
|
key: 0,
|
|
3204
3201
|
class: "title-placeholder",
|
|
@@ -6213,7 +6210,7 @@ const Border_vue_vue_type_style_index_0_scoped_f3fc1305_lang = "";
|
|
|
6213
6210
|
const _withScopeId = (n) => (pushScopeId("data-v-f3fc1305"), n = n(), popScopeId(), n);
|
|
6214
6211
|
const _hoisted_1$5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "top-left border-item" }, null, -1));
|
|
6215
6212
|
const _hoisted_2$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "top-right border-item" }, null, -1));
|
|
6216
|
-
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "bottom-left border-item" }, null, -1));
|
|
6213
|
+
const _hoisted_3$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "bottom-left border-item" }, null, -1));
|
|
6217
6214
|
const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "bottom-right border-item" }, null, -1));
|
|
6218
6215
|
const _hoisted_5 = { class: "title-item-wrapper" };
|
|
6219
6216
|
const _hoisted_6 = { class: "title-item" };
|
|
@@ -6249,7 +6246,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6249
6246
|
_ctx.useBorderModify ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
6250
6247
|
_hoisted_1$5,
|
|
6251
6248
|
_hoisted_2$1,
|
|
6252
|
-
_hoisted_3,
|
|
6249
|
+
_hoisted_3$1,
|
|
6253
6250
|
_hoisted_4
|
|
6254
6251
|
], 64)) : createCommentVNode("", true)
|
|
6255
6252
|
], 4)) : createCommentVNode("", true),
|
|
@@ -6808,13 +6805,13 @@ const _sfc_main$1 = defineComponent({
|
|
|
6808
6805
|
const x = computed(() => props2.scrollX);
|
|
6809
6806
|
const y = computed(() => parseFloat(props2.height) - unref(splitY));
|
|
6810
6807
|
const myColumns = ref([]);
|
|
6811
|
-
const myDataSource = ref(
|
|
6808
|
+
const myDataSource = ref([]);
|
|
6812
6809
|
const tableColumns = ref([]);
|
|
6813
6810
|
const tableDataSource = ref([]);
|
|
6814
6811
|
const total = ref(0);
|
|
6815
6812
|
const pageNum = ref(1);
|
|
6816
6813
|
const pageSize = computed(() => props2.paginationPageSize);
|
|
6817
|
-
const handleChildrenColumns = (_columns) => {
|
|
6814
|
+
const handleChildrenColumns = (_columns = []) => {
|
|
6818
6815
|
if (Array.isArray(_columns) && _columns.length > 0) {
|
|
6819
6816
|
const len = _columns.length;
|
|
6820
6817
|
const columnsFixedNum = props2.columnsFixedNum;
|
|
@@ -6859,25 +6856,22 @@ const _sfc_main$1 = defineComponent({
|
|
|
6859
6856
|
}
|
|
6860
6857
|
};
|
|
6861
6858
|
const handleColumns = (columns = []) => {
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
if (isUseSeq) {
|
|
6865
|
-
_columns.push({
|
|
6859
|
+
if (props2.isUseSeq) {
|
|
6860
|
+
columns.unshift({
|
|
6866
6861
|
title: "\u5E8F\u53F7",
|
|
6867
6862
|
dataIndex: "SEQ",
|
|
6868
6863
|
align: "center"
|
|
6869
6864
|
});
|
|
6870
6865
|
}
|
|
6871
|
-
_columns = _columns.concat(cloneDeep(columns));
|
|
6872
6866
|
if (props2.isUseAction) {
|
|
6873
|
-
|
|
6867
|
+
columns.push({
|
|
6874
6868
|
title: "\u64CD\u4F5C",
|
|
6875
6869
|
dataIndex: "ACTION",
|
|
6876
6870
|
width: props2.actionColumnWidth
|
|
6877
6871
|
});
|
|
6878
6872
|
}
|
|
6879
|
-
handleChildrenColumns(
|
|
6880
|
-
|
|
6873
|
+
handleChildrenColumns(columns);
|
|
6874
|
+
return columns;
|
|
6881
6875
|
};
|
|
6882
6876
|
watch(() => [
|
|
6883
6877
|
props2.columns,
|
|
@@ -6888,7 +6882,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
6888
6882
|
props2.cellBackgroundColor,
|
|
6889
6883
|
props2.borderColor
|
|
6890
6884
|
], () => {
|
|
6891
|
-
handleColumns(props2.columns);
|
|
6885
|
+
myColumns.value = handleColumns(cloneDeep(props2.columns));
|
|
6892
6886
|
}, {
|
|
6893
6887
|
immediate: true,
|
|
6894
6888
|
deep: true
|
|
@@ -6897,6 +6891,21 @@ const _sfc_main$1 = defineComponent({
|
|
|
6897
6891
|
if (dataType !== "static")
|
|
6898
6892
|
return;
|
|
6899
6893
|
myDataSource.value = data;
|
|
6894
|
+
}, {
|
|
6895
|
+
immediate: true
|
|
6896
|
+
});
|
|
6897
|
+
watch(() => [props2.isReverse, myColumns.value, myDataSource.value], () => {
|
|
6898
|
+
if (props2.isReverse) {
|
|
6899
|
+
const { columns, dataSource } = handleReverseTable(cloneDeep(unref(myColumns)), cloneDeep(unref(myDataSource)));
|
|
6900
|
+
tableColumns.value = columns;
|
|
6901
|
+
tableDataSource.value = dataSource;
|
|
6902
|
+
} else {
|
|
6903
|
+
tableColumns.value = unref(myColumns);
|
|
6904
|
+
tableDataSource.value = unref(myDataSource);
|
|
6905
|
+
}
|
|
6906
|
+
}, {
|
|
6907
|
+
immediate: true,
|
|
6908
|
+
flush: "post"
|
|
6900
6909
|
});
|
|
6901
6910
|
const handleReverseTable = (columns, dataSource) => {
|
|
6902
6911
|
const firstColumns = columns[0];
|
|
@@ -6931,19 +6940,6 @@ const _sfc_main$1 = defineComponent({
|
|
|
6931
6940
|
dataSource: _dataSource
|
|
6932
6941
|
};
|
|
6933
6942
|
};
|
|
6934
|
-
watch(() => [props2.isReverse, myColumns.value, myDataSource.value], () => {
|
|
6935
|
-
if (props2.isReverse) {
|
|
6936
|
-
const { columns, dataSource } = handleReverseTable(unref(myColumns), unref(myDataSource));
|
|
6937
|
-
tableColumns.value = columns;
|
|
6938
|
-
tableDataSource.value = dataSource;
|
|
6939
|
-
} else {
|
|
6940
|
-
tableColumns.value = cloneDeep(unref(myColumns));
|
|
6941
|
-
tableDataSource.value = cloneDeep(unref(myDataSource));
|
|
6942
|
-
}
|
|
6943
|
-
}, {
|
|
6944
|
-
deep: true,
|
|
6945
|
-
immediate: true
|
|
6946
|
-
});
|
|
6947
6943
|
const orderCondition = ref("");
|
|
6948
6944
|
const requestData = useRequestData(props2);
|
|
6949
6945
|
const loading = ref(false);
|
|
@@ -7044,7 +7040,8 @@ const _sfc_main$1 = defineComponent({
|
|
|
7044
7040
|
});
|
|
7045
7041
|
const handleIndicatorDataset = (dataColumns = [], dataRows = []) => {
|
|
7046
7042
|
const _columns = dataColumns.map((column) => ({ title: column, dataIndex: column, key: column }));
|
|
7047
|
-
handleColumns(_columns);
|
|
7043
|
+
const columns = handleColumns(_columns);
|
|
7044
|
+
myColumns.value = columns;
|
|
7048
7045
|
myDataSource.value = dataRows;
|
|
7049
7046
|
};
|
|
7050
7047
|
const indicatorData = useIndicatorData(props2);
|
|
@@ -7086,16 +7083,17 @@ const _sfc_main$1 = defineComponent({
|
|
|
7086
7083
|
});
|
|
7087
7084
|
const summaryList = computed(() => {
|
|
7088
7085
|
const columns = unref(tableColumns);
|
|
7089
|
-
|
|
7090
|
-
if (props2.isUseSeq) {
|
|
7091
|
-
columns.shift();
|
|
7092
|
-
summaryList2 = [{ total: "\u5C0F\u8BA1" }];
|
|
7093
|
-
}
|
|
7086
|
+
const summaryList2 = [];
|
|
7094
7087
|
let calcTotalCount = 0;
|
|
7095
7088
|
for (let i = 0; i < columns.length; i++) {
|
|
7096
7089
|
const column = columns[i];
|
|
7097
7090
|
const { isCalcTotal } = column;
|
|
7098
|
-
if (
|
|
7091
|
+
if (props2.isUseSeq && i === 0) {
|
|
7092
|
+
summaryList2.push({
|
|
7093
|
+
...column,
|
|
7094
|
+
total: "\u5C0F\u8BA1"
|
|
7095
|
+
});
|
|
7096
|
+
} else if (isCalcTotal) {
|
|
7099
7097
|
summaryList2.push({
|
|
7100
7098
|
...column,
|
|
7101
7099
|
index: i,
|
|
@@ -7172,24 +7170,27 @@ const _sfc_main$1 = defineComponent({
|
|
|
7172
7170
|
formatFn,
|
|
7173
7171
|
contrastClass,
|
|
7174
7172
|
tableChange,
|
|
7175
|
-
|
|
7176
|
-
|
|
7173
|
+
myColumns,
|
|
7174
|
+
myDataSource,
|
|
7177
7175
|
summaryList,
|
|
7178
7176
|
loading,
|
|
7179
7177
|
onTouchHrefEvent,
|
|
7180
7178
|
handleHref,
|
|
7181
7179
|
handleHrefTarget,
|
|
7182
|
-
useRowIndex
|
|
7180
|
+
useRowIndex,
|
|
7181
|
+
tableColumns,
|
|
7182
|
+
tableDataSource
|
|
7183
7183
|
};
|
|
7184
7184
|
}
|
|
7185
7185
|
});
|
|
7186
|
-
const
|
|
7186
|
+
const Table_vue_vue_type_style_index_0_scoped_292c12ab_lang = "";
|
|
7187
7187
|
const Table_vue_vue_type_style_index_1_lang = "";
|
|
7188
|
-
const _hoisted_1$1 = {
|
|
7188
|
+
const _hoisted_1$1 = { key: 0 };
|
|
7189
|
+
const _hoisted_2 = {
|
|
7189
7190
|
key: 1,
|
|
7190
7191
|
class: "action-list"
|
|
7191
7192
|
};
|
|
7192
|
-
const
|
|
7193
|
+
const _hoisted_3 = ["href", "target", "onClick"];
|
|
7193
7194
|
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7194
7195
|
const _component_a_table_summary_cell = resolveComponent("a-table-summary-cell");
|
|
7195
7196
|
const _component_a_table_summary_row = resolveComponent("a-table-summary-row");
|
|
@@ -7230,13 +7231,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7230
7231
|
}, toDisplayString(column.title), 5)
|
|
7231
7232
|
]),
|
|
7232
7233
|
bodyCell: withCtx(({ column, index: index2, text, record }) => [
|
|
7233
|
-
column.dataIndex === "SEQ" ? (openBlock(), createElementBlock("span",
|
|
7234
|
-
|
|
7235
|
-
style: normalizeStyle({
|
|
7236
|
-
fontSize: _ctx.fontSize,
|
|
7237
|
-
fontWeight: _ctx.fontWeight
|
|
7238
|
-
})
|
|
7239
|
-
}, toDisplayString(index2 + 1), 5)) : column.dataIndex === "ACTION" ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
7234
|
+
column.dataIndex === "SEQ" ? (openBlock(), createElementBlock("span", _hoisted_1$1, toDisplayString(index2 + 1), 1)) : createCommentVNode("", true),
|
|
7235
|
+
column.dataIndex === "ACTION" ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
7240
7236
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.actionList, (action, index22) => {
|
|
7241
7237
|
return openBlock(), createElementBlock("div", {
|
|
7242
7238
|
class: "action",
|
|
@@ -7251,7 +7247,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7251
7247
|
fontWeight: _ctx.fontWeight
|
|
7252
7248
|
}),
|
|
7253
7249
|
onClick: ($event) => _ctx.onTouchHrefEvent(action.target, _ctx.handleHref(action.href, record))
|
|
7254
|
-
}, toDisplayString(action.title), 13,
|
|
7250
|
+
}, toDisplayString(action.title), 13, _hoisted_3)
|
|
7255
7251
|
]);
|
|
7256
7252
|
}), 128))
|
|
7257
7253
|
])) : (openBlock(), createElementBlock("div", {
|
|
@@ -7261,7 +7257,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7261
7257
|
fontSize: _ctx.fontSize,
|
|
7262
7258
|
fontWeight: _ctx.fontWeight
|
|
7263
7259
|
})
|
|
7264
|
-
}, toDisplayString(
|
|
7260
|
+
}, toDisplayString(column.format != null ? _ctx.formatFn(text, column.format) : text), 7))
|
|
7265
7261
|
]),
|
|
7266
7262
|
summary: withCtx(() => [
|
|
7267
7263
|
_ctx.summaryList.length > 0 ? (openBlock(), createBlock(_component_a_table_summary, { key: 0 }, {
|
|
@@ -7305,7 +7301,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
7305
7301
|
}, 8, ["loading"])
|
|
7306
7302
|
], 4);
|
|
7307
7303
|
}
|
|
7308
|
-
const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-
|
|
7304
|
+
const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-292c12ab"]]);
|
|
7309
7305
|
const EcanTable = withInstall(Table);
|
|
7310
7306
|
const mapProps = {
|
|
7311
7307
|
...props,
|