module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/dist/"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 584); /******/ }) /************************************************************************/ /******/ ({ /***/ 17: /***/ (function(module, exports) { module.exports = require("echarts/lib/echarts"); /***/ }), /***/ 584: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXTERNAL MODULE: external "echarts/lib/echarts" var echarts_ = __webpack_require__(17); var echarts_default = /*#__PURE__*/__webpack_require__.n(echarts_); // CONCATENATED MODULE: ./packages/c-graph/main.js // import 'echarts/lib/chart/graph'; // import { graph } from './main'; // import Core from 'main/utils/charts/core'; /* harmony default export */ var main = ({ name: 've-graph', props: { width: { type: String, default: '100%' }, height: { type: String, default: '100%' }, options: { type: Object, default: null }, data: { type: Object, default: null } }, data: function data() { return { charts: null }; }, mounted: function mounted() { console.log('mounted:>>>>>>>>'); console.log(this.data); this.renderCharts(); }, methods: { renderCharts: function renderCharts() { var charts = echarts_default.a.init(this.$refs.veGraphContainer); var categories = []; for (var i = 0; i < 2; i++) { categories[i] = { name: '类目' + i }; } var options = this.options || { // 图的标题 title: { text: '拓扑图' }, // 提示框的配置 tooltip: { formatter: function formatter(x) { return x.data.des; } }, // 工具箱 toolbox: { // 显示工具箱 show: true, feature: { mark: { show: true }, // 还原 restore: { show: true }, // 保存为图片 saveAsImage: { show: true } } }, legend: [{ // selectedMode: 'single', data: categories.map(function (a) { return a.name; }) }], series: [{ type: 'graph', // 类型:关系图 layout: 'force', // 图的布局,类型为力导图 symbolSize: 40, // 调整节点的大小 roam: true, // 是否开启鼠标缩放和平移漫游。默认不开启。如果只想要开启缩放或者平移,可以设置成 'scale' 或者 'move'。设置成 true 为都开启 edgeSymbol: ['circle', 'arrow'], edgeSymbolSize: [2, 10], edgeLabel: { normal: { textStyle: { fontSize: 20 } } }, force: { repulsion: 2500, edgeLength: [10, 50] }, draggable: true, lineStyle: { normal: { width: 2, color: '#4b565b' } }, label: { normal: { show: true, textStyle: {} } }, // 数据 data: this.data.nodes, links: this.data.links, categories: categories }] }; charts.setOption(options); this.charts = charts; } }, watch: { options: function options() { this.renderCharts(); } }, render: function render() { var h = arguments[0]; return h( 'div', { 'class': 'v-charts-graph-wrapper', style: { width: this.width, height: this.height } }, [h('div', { 'class': 'v-charts-graph-container', ref: 'veGraphContainer', style: { width: this.width, height: this.height } })] ); } }); // CONCATENATED MODULE: ./packages/c-graph/index.js /* harmony default export */ var c_graph = __webpack_exports__["default"] = (main); /***/ }) /******/ });