@@ -836,6 +836,8 @@ exports.default = void 0;
836
836
837
837
var _defineProperty2 = _interopRequireDefault(__webpack_require__("279f"));
838
838
839
+ var _typeof2 = _interopRequireDefault(__webpack_require__("7ae5"));
840
+
839
841
var _toConsumableArray2 = _interopRequireDefault(__webpack_require__("4066"));
840
842
841
843
__webpack_require__("f840");
@@ -1136,6 +1138,8 @@ var _default2 = {
1136
1138
1137
1139
},
1138
1140
mounted: function mounted() {
1141
+ var _this = this;
1142
+
1139
1143
// 设置echarts实例
1140
1144
this.smChart = this.$refs[this.chartId]; // 派发echart所有事件
1141
1145
@@ -1159,6 +1163,9 @@ var _default2 = {
1159
1163
!this._isRequestData && this.autoPlay && this._handlePieAutoPlay(); // 请求数据, 合并echartopiton, 设置echartOptions
1160
1164
1161
1165
this._isRequestData && this._setEchartOptions(this.dataset, this.datasetOptions, this.options);
1166
+ this.smChart.$on('mouseout', function (params) {
1167
+ _this._initHighlight();
1168
+ });
1162
1169
1163
1170
this._initHighlight();
1164
1171
},
@@ -1172,13 +1179,15 @@ var _default2 = {
1172
1179
if (this.autoresize) {
1173
1180
(0, _resizeDetector.removeListener)(this.$el, this.__resizeHandler);
1174
1181
}
1182
+
1183
+ this.smChart.$off('mouseout');
1175
1184
},
1176
1185
methods: {
1177
1186
_initAutoResize: function _initAutoResize() {
1178
- var _this = this;
1187
+ var _this2 = this;
1179
1188
1180
1189
this.__resizeHandler = (0, _debounce.default)(function () {
1181
- _this .resize();
1190
+ _this2 .resize();
1182
1191
}, 100, {
1183
1192
leading: true
1184
1193
});
@@ -1189,10 +1198,10 @@ var _default2 = {
1189
1198
}
1190
1199
},
1191
1200
_initDataZoom: function _initDataZoom() {
1192
- var _this2 = this;
1201
+ var _this3 = this;
1193
1202
1194
1203
this.dataZoomHandler = (0, _debounce.default)(function () {
1195
- _this2 ._dataZoomChanged();
1204
+ _this3 ._dataZoomChanged();
1196
1205
}, 500, {
1197
1206
leading: true
1198
1207
});
@@ -1230,7 +1239,7 @@ var _default2 = {
1230
1239
}
1231
1240
},
1232
1241
setPieAutoPlay: function setPieAutoPlay(echartsNode) {
1233
- var _this3 = this;
1242
+ var _this4 = this;
1234
1243
1235
1244
var i = -1;
1236
1245
this.pieAutoPlay = setInterval(function () {
@@ -1241,7 +1250,7 @@ var _default2 = {
1241
1250
});
1242
1251
i++;
1243
1252
1244
- if (i >= _this3 ._chartOptions.legend.data.length) {
1253
+ if (i >= _this4 ._chartOptions.legend.data.length) {
1245
1254
i = 0;
1246
1255
}
1247
1256
@@ -1264,21 +1273,21 @@ var _default2 = {
1264
1273
}
1265
1274
},
1266
1275
timing: function timing() {
1267
- var _this4 = this;
1276
+ var _this5 = this;
1268
1277
1269
1278
this.echartsDataService && this.echartsDataService.getDataOption(this.dataset, this.xBar).then(function (options) {
1270
- _this4 .hideLoading(); // 缓存dataSeriesCache,请求后格式化成echart的数据
1279
+ _this5 .hideLoading(); // 缓存dataSeriesCache,请求后格式化成echart的数据
1271
1280
1272
1281
1273
- _this4 .dataSeriesCache = Object.assign({}, options);
1274
- _this4 .datasetChange = false; // 设置echartOptions
1282
+ _this5 .dataSeriesCache = Object.assign({}, options);
1283
+ _this5 .datasetChange = false; // 设置echartOptions
1275
1284
1276
- _this4 .echartOptions = _this4 ._optionsHandler(_this4 .options, options);
1285
+ _this5 .echartOptions = _this5 ._optionsHandler(_this5 .options, options);
1277
1286
});
1278
1287
},
1279
1288
// 请求数据,设置echartOptions
1280
1289
_setEchartOptions: function _setEchartOptions(dataset, datasetOptions, echartOptions) {
1281
- var _this5 = this;
1290
+ var _this6 = this;
1282
1291
1283
1292
this.echartsDataService = null;
1284
1293
this.dataSeriesCache = null;
@@ -1295,17 +1304,17 @@ var _default2 = {
1295
1304
1296
1305
this.echartsDataService = new _EchartsDataService.default(dataset, datasetOptions);
1297
1306
this.echartsDataService.getDataOption(dataset, this.xBar).then(function (options) {
1298
- _this5 .hideLoading(); // 缓存dataSeriesCache,请求后格式化成echart的数据
1307
+ _this6 .hideLoading(); // 缓存dataSeriesCache,请求后格式化成echart的数据
1299
1308
1300
1309
1301
- _this5 .dataSeriesCache = Object.assign({}, options);
1302
- _this5 .datasetChange = false; // 设置echartOptions
1310
+ _this6 .dataSeriesCache = Object.assign({}, options);
1311
+ _this6 .datasetChange = false; // 设置echartOptions
1303
1312
1304
- _this5 .echartOptions = _this5 ._optionsHandler(echartOptions, options);
1313
+ _this6 .echartOptions = _this6 ._optionsHandler(echartOptions, options);
1305
1314
});
1306
1315
},
1307
1316
_optionsHandler: function _optionsHandler(options, dataOptions, dataZoomChanged) {
1308
- var _this6 = this;
1317
+ var _this7 = this;
1309
1318
1310
1319
dataOptions = dataOptions && (0, _lodash4.default)(dataOptions); // clone 避免引起重复刷新
1311
1320
@@ -1369,7 +1378,7 @@ var _default2 = {
1369
1378
}
1370
1379
1371
1380
if (dataZoomChanged) {
1372
- var _ref = _this6 .smChart.chart.getOption().dataZoom[0] || {},
1381
+ var _ref = _this7 .smChart.chart.getOption().dataZoom[0] || {},
1373
1382
startValue = _ref.startValue,
1374
1383
endValue = _ref.endValue;
1375
1384
@@ -1475,8 +1484,14 @@ var _default2 = {
1475
1484
series.forEach(function (serie) {
1476
1485
// 对pie处理数据颜色分段
1477
1486
if (serie.type === 'pie') {
1478
- if (serie.data && serie.data.length > _this6.colorGroupsData.length) {
1479
- var colorGroup = SuperMap.ColorsPickerUtil.getGradientColors(_this6.colorGroupsData, serie.data.length, 'RANGE');
1487
+ if (serie.data && serie.data.length > _this7.colorGroupsData.length) {
1488
+ var colorGroup;
1489
+
1490
+ if ((0, _typeof2.default)(_this7.colorGroupsData[0]) === 'object') {
1491
+ colorGroup = (0, _chart.handleMultiGradient)(_this7.colorGroupsData, serie.data.length);
1492
+ } else {
1493
+ colorGroup = SuperMap.ColorsPickerUtil.getGradientColors(_this7.colorGroupsData, serie.data.length, 'RANGE');
1494
+ }
1480
1495
1481
1496
if (serie.itemStyle) {
1482
1497
serie.itemStyle.color = function (_ref4) {
@@ -1659,7 +1674,7 @@ var _default2 = {
1659
1674
}
1660
1675
},
1661
1676
showDetailInfo: function showDetailInfo(feature) {
1662
- var _this7 = this;
1677
+ var _this8 = this;
1663
1678
1664
1679
var coordinates = ((feature || {}).geometry || {}).coordinates;
1665
1680
var hasCoordinates = coordinates && !!coordinates.length;
@@ -1672,7 +1687,7 @@ var _default2 = {
1672
1687
var propsData = this.generateTableData(properties);
1673
1688
this.tablePopupProps = _objectSpread({}, propsData);
1674
1689
this.$nextTick(function () {
1675
- _this7 .viewModel.setPopupContent(_coordinates, _this7 .$refs.chartTablePopup.$el, _this7 .changePopupArrowStyle);
1690
+ _this8 .viewModel.setPopupContent(_coordinates, _this8 .$refs.chartTablePopup.$el, _this8 .changePopupArrowStyle);
1676
1691
});
1677
1692
} else {
1678
1693
var mapNotLoaded = this.mapNotLoadedTip();
@@ -8599,21 +8614,59 @@ exports.default = _default;
8599
8614
"use strict";
8600
8615
8601
8616
8617
+ var _interopRequireDefault = __webpack_require__("8e6d");
8618
+
8602
8619
Object.defineProperty(exports, "__esModule", {
8603
8620
value: true
8604
8621
});
8605
- exports.chartThemeUtil = void 0;
8622
+ exports.chartThemeUtil = exports.handleMultiGradient = void 0;
8623
+
8624
+ var _typeof2 = _interopRequireDefault(__webpack_require__("7ae5"));
8606
8625
8607
8626
var _util = __webpack_require__("1448");
8608
8627
8628
+ var _lodash = _interopRequireDefault(__webpack_require__("25a2"));
8629
+
8630
+ var handleMultiGradient = function handleMultiGradient(colorGroupsData, dataLength) {
8631
+ var startColors = [];
8632
+ var endColors = [];
8633
+ var startColorGroups = [];
8634
+ var endColorGroups = [];
8635
+ var results = [];
8636
+ colorGroupsData.forEach(function (colorInfo) {
8637
+ startColors.push(colorInfo.colorStops[0].color);
8638
+ endColors.push(colorInfo.colorStops[1].color);
8639
+ });
8640
+ startColorGroups = SuperMap.ColorsPickerUtil.getGradientColors(startColors, dataLength, 'RANGE');
8641
+ endColorGroups = SuperMap.ColorsPickerUtil.getGradientColors(endColors, dataLength, 'RANGE');
8642
+
8643
+ for (var i = 0; i < dataLength; i++) {
8644
+ var colorGroupDataCopy = (0, _lodash.default)(colorGroupsData[0]);
8645
+ colorGroupDataCopy.colorStops = [{
8646
+ offset: 0,
8647
+ color: startColorGroups[i]
8648
+ }, {
8649
+ offset: 1,
8650
+ color: endColorGroups[i]
8651
+ }];
8652
+ results.push(colorGroupDataCopy);
8653
+ }
8654
+
8655
+ return results;
8656
+ };
8657
+
8658
+ exports.handleMultiGradient = handleMultiGradient;
8659
+
8609
8660
var chartThemeUtil = function chartThemeUtil() {
8610
8661
var background = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgba(255, 255, 255, 0.6)';
8611
8662
var textColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#333';
8612
8663
var colorGroup = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ['#3fb1e3', '#6be6c1', '#626c91', '#a0a7e6', '#c4ebad', '#96dee8'];
8613
8664
var dataNumber = arguments.length > 3 ? arguments[3] : undefined;
8614
8665
8615
8666
// 是否需要产生分段颜色值
8616
- if (dataNumber >= 5) {
8667
+ if (colorGroup && dataNumber > colorGroup.length && (0, _typeof2.default)(colorGroup[0]) === 'object') {
8668
+ colorGroup = handleMultiGradient(colorGroup, dataNumber);
8669
+ } else {
8617
8670
colorGroup = SuperMap.ColorsPickerUtil.getGradientColors(colorGroup, dataNumber, 'RANGE');
8618
8671
}
8619
8672
@@ -9154,7 +9207,7 @@ module.exports = _iterableToArrayLimit;
9154
9207
9155
9208
"use strict";
9156
9209
__webpack_require__.r(__webpack_exports__);
9157
- /* harmony import */ var _ChartMixin_vue_vue_type_template_id_0bb3b3ba___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8d58 ");
9210
+ /* harmony import */ var _ChartMixin_vue_vue_type_template_id_f0db6a9c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("bc57 ");
9158
9211
/* harmony import */ var _ChartMixin_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("d83d");
9159
9212
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _ChartMixin_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _ChartMixin_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
9160
9213
/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("b429");
@@ -9167,8 +9220,8 @@ __webpack_require__.r(__webpack_exports__);
9167
9220
9168
9221
var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(
9169
9222
_ChartMixin_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
9170
- _ChartMixin_vue_vue_type_template_id_0bb3b3ba___WEBPACK_IMPORTED_MODULE_0__ [/* render */ "a"],
9171
- _ChartMixin_vue_vue_type_template_id_0bb3b3ba___WEBPACK_IMPORTED_MODULE_0__ [/* staticRenderFns */ "b"],
9223
+ _ChartMixin_vue_vue_type_template_id_f0db6a9c___WEBPACK_IMPORTED_MODULE_0__ [/* render */ "a"],
9224
+ _ChartMixin_vue_vue_type_template_id_f0db6a9c___WEBPACK_IMPORTED_MODULE_0__ [/* staticRenderFns */ "b"],
9172
9225
false,
9173
9226
null,
9174
9227
null,
@@ -31569,23 +31622,6 @@ function config (name) {
31569
31622
31570
31623
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("698d")))
31571
31624
31572
- /***/ }),
31573
-
31574
- /***/ "8d58":
31575
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
31576
-
31577
- "use strict";
31578
-
31579
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/common/chart/ChartMixin.vue?vue&type=template&id=0bb3b3ba&
31580
- var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('sm-card',{directives:[{name:"show",rawName:"v-show",value:(_vm.isShow),expression:"isShow"}],staticClass:"sm-component-chart",attrs:{"icon-class":_vm.iconClass,"icon-position":_vm.position,"header-name":_vm.headerName,"auto-rotate":_vm.autoRotate,"collapsed":_vm.collapsed}},[_c('v-chart',{ref:_vm.chartId,style:(_vm._chartStyle),attrs:{"id":_vm.chartId,"options":_vm._chartOptions,"initOptions":_vm.initOptions,"group":_vm.group,"manual-update":_vm.manualUpdate,"theme":_vm.theme || _vm.chartTheme},on:{"datazoom":_vm.dataZoomHandler}}),_vm._v(" "),_c('TablePopup',_vm._b({directives:[{name:"show",rawName:"v-show",value:(false),expression:"false"}],ref:"chartTablePopup",attrs:{"text-color":_vm.textColor,"background":_vm.background}},'TablePopup',_vm.tablePopupProps,false))],1)}
31581
- var staticRenderFns = []
31582
-
31583
-
31584
- // CONCATENATED MODULE: ./src/common/chart/ChartMixin.vue?vue&type=template&id=0bb3b3ba&
31585
- /* concated harmony reexport render */__webpack_require__.d(__webpack_exports__, "a", function() { return render; });
31586
- /* concated harmony reexport staticRenderFns */__webpack_require__.d(__webpack_exports__, "b", function() { return staticRenderFns; });
31587
-
31588
-
31589
31625
/***/ }),
31590
31626
31591
31627
/***/ "8e6d":
@@ -39289,6 +39325,23 @@ exports.Transform = __webpack_require__("b556");
39289
39325
exports.PassThrough = __webpack_require__("e525");
39290
39326
39291
39327
39328
+ /***/ }),
39329
+
39330
+ /***/ "bc57":
39331
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
39332
+
39333
+ "use strict";
39334
+
39335
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/common/chart/ChartMixin.vue?vue&type=template&id=f0db6a9c&
39336
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('sm-card',{directives:[{name:"show",rawName:"v-show",value:(_vm.isShow),expression:"isShow"}],staticClass:"sm-component-chart",attrs:{"icon-class":_vm.iconClass,"icon-position":_vm.position,"header-name":_vm.headerName,"auto-rotate":_vm.autoRotate,"collapsed":_vm.collapsed}},[_c('v-chart',{ref:_vm.chartId,style:(_vm._chartStyle),attrs:{"id":_vm.chartId,"options":_vm._chartOptions,"initOptions":_vm.initOptions,"group":_vm.group,"manual-update":_vm.manualUpdate,"theme":_vm.theme || _vm.chartTheme},on:{"datazoom":_vm.dataZoomHandler}}),_vm._v(" "),_c('TablePopup',_vm._b({directives:[{name:"show",rawName:"v-show",value:(false),expression:"false"}],ref:"chartTablePopup",attrs:{"text-color":_vm.textColor,"background":_vm.background}},'TablePopup',_vm.tablePopupProps,false))],1)}
39337
+ var staticRenderFns = []
39338
+
39339
+
39340
+ // CONCATENATED MODULE: ./src/common/chart/ChartMixin.vue?vue&type=template&id=f0db6a9c&
39341
+ /* concated harmony reexport render */__webpack_require__.d(__webpack_exports__, "a", function() { return render; });
39342
+ /* concated harmony reexport staticRenderFns */__webpack_require__.d(__webpack_exports__, "b", function() { return staticRenderFns; });
39343
+
39344
+
39292
39345
/***/ }),
39293
39346
39294
39347
/***/ "be3f":
0 commit comments