develoop
aaaa 6 months ago
parent 855904b53d
commit f8720256b6
  1. 1
      .eslintrc.cjs
  2. 1
      package.json
  3. 6225
      pnpm-lock.yaml
  4. 2
      src/main.ts
  5. 65
      src/views/portal/LearningPathRecommendations.vue
  6. 13
      vite.config.ts

@ -6,6 +6,7 @@ module.exports = {
es2021: true, es2021: true,
node: true, node: true,
jest: true, jest: true,
jquery: true,
}, },
globals: { globals: {
VANTA: 'readonly', //VANTA 已经cdn引入 这里拒绝eslint报错 全局声明一下 VANTA: 'readonly', //VANTA 已经cdn引入 这里拒绝eslint报错 全局声明一下

@ -22,6 +22,7 @@
"axios": "^1.6.8", "axios": "^1.6.8",
"echarts": "^5.5.0", "echarts": "^5.5.0",
"element-plus": "^2.6.0", "element-plus": "^2.6.0",
"jquery": "^3.7.1",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"vue": "^3.4.19", "vue": "^3.4.19",

File diff suppressed because it is too large Load Diff

@ -22,6 +22,8 @@ const app = createApp(App)
import gloablComponent from '@/components/index' import gloablComponent from '@/components/index'
import 'echarts' import 'echarts'
import ECharts from 'vue-echarts'; import ECharts from 'vue-echarts';
// 导入jquery
import $ from 'jquery'
app.use(gloablComponent) app.use(gloablComponent)
// 注册仓库 // 注册仓库
app.use(pinia) app.use(pinia)

@ -4,22 +4,59 @@
<!-- 学习路径推荐 --> <!-- 学习路径推荐 -->
<script lang="ts" setup> <script lang="ts" setup>
// import echarts from 'echarts/types/dist/echarts';
import { ref } from 'vue'; import { ref } from 'vue';
const option = ref({ // import * as echarts from 'echarts';
xAxis: { import 'echarts'
type: 'category', import ECharts from 'vue-echarts';
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] var ROOT_PATH = 'https://echarts.apache.org/examples';
}, var chartDom = document.getElementById('main');
yAxis: { var myChart = echarts.init(chartDom);
type: 'value' var option;
},
series: [ myChart.showLoading();
{ $.getJSON(ROOT_PATH + '/data/asset/data/les-miserables.json', function (graph) {
data: [150, 230, 224, 218, 135, 147, 260], myChart.hideLoading();
type: 'line' const option = ref({
} tooltip: {},
] legend: [
{
data: graph.categories.map(function (a) {
return a.name;
})
}
],
series: [
{
name: 'Les Miserables',
type: 'graph',
layout: 'none',
data: graph.nodes,
links: graph.links,
categories: graph.categories,
roam: true,
label: {
show: true,
position: 'right',
formatter: '{b}'
},
labelLayout: {
hideOverlap: true
},
scaleLimit: {
min: 0.4,
max: 2
},
lineStyle: {
color: 'source',
curveness: 0.3
}
}
]
});
myChart.setOption(option);
}); });
option && myChart.setOption(option);
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -36,3 +36,16 @@ export default ({ command }: any) => {
}, },
} }
} }
// const webpack = require('webpack')
// module.exports = {
// configureWebpack: {
// plugins: [
// new webpack.ProvidePlugin({
// $: 'jquery',
// jQuery: 'jquery',
// 'windows.jQuery': 'jquery'
// })
// ]
// }
// }
Loading…
Cancel
Save