|
|
@@ -1,20 +1,388 @@
|
|
|
<template>
|
|
|
<Layout>
|
|
|
<Title title="能力树模型"></Title>
|
|
|
- TODO
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ style="width: 100%; margin-bottom: 20px"
|
|
|
+ row-key="name"
|
|
|
+ border
|
|
|
+ height="780"
|
|
|
+ :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
+ >
|
|
|
+ <el-table-column prop="name" label="名称(Name)" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ content="点击进行相关题目推荐.."
|
|
|
+ placement="right"
|
|
|
+ >
|
|
|
+ <a href="#" @click="recommend(scope.row.name)" class="recommend"
|
|
|
+ >{{ scope.row.name }} 💁♂️</a
|
|
|
+ >
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="score" label="得分(Score)" width="120">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="分数组成(Score-Composition)">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <Chart
|
|
|
+ height="350px"
|
|
|
+ width="410px"
|
|
|
+ :option="getPieOption(scope.row.children)"
|
|
|
+ ></Chart>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="skills" label="技能(Skills)">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <Chart
|
|
|
+ height="350px"
|
|
|
+ :option="getRadarOption(scope.row.skills)"
|
|
|
+ ></Chart>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="disposition" label="态度(Disposition)">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <Chart
|
|
|
+ height="350px"
|
|
|
+ width="420px"
|
|
|
+ :option="getBarOption(scope.row.disposition, null)"
|
|
|
+ ></Chart>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</Layout>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import Layout from "@/components/content/Layout";
|
|
|
import Title from "@/components/content/Title";
|
|
|
+ import Chart from "@/components/content/Chart";
|
|
|
export default {
|
|
|
components: {
|
|
|
- Layout,
|
|
|
- Title
|
|
|
+ Layout,
|
|
|
+ Title,
|
|
|
+ Chart,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tableData: [
|
|
|
+ {
|
|
|
+ name: "软件工程",
|
|
|
+ score: 57,
|
|
|
+ skills: [1, 2, 3, 4, 5, 6],
|
|
|
+ disposition: [
|
|
|
+ { name: "细心", score: 45 },
|
|
|
+ { name: "责任心", score: 55 },
|
|
|
+ { name: "耐心", score: 25 },
|
|
|
+ { name: "合作能力", score: 75 },
|
|
|
+ ],
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ name: "需求",
|
|
|
+ score: 19,
|
|
|
+ skills: [1, 2, 3, 4, 5, 6],
|
|
|
+ disposition: [
|
|
|
+ { name: "细心", score: 45 },
|
|
|
+ { name: "责任心", score: 55 },
|
|
|
+ { name: "耐心", score: 25 },
|
|
|
+ { name: "合作能力", score: 75 },
|
|
|
+ ],
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ name: "需求基础",
|
|
|
+ score: 19,
|
|
|
+ skills: [1, 2, 3, 4, 5, 6],
|
|
|
+ disposition: [
|
|
|
+ { name: "细心", score: 45 },
|
|
|
+ { name: "责任心", score: 55 },
|
|
|
+ { name: "耐心", score: 25 },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "需求XX",
|
|
|
+ score: 19,
|
|
|
+ skills: [1, 2, 3, 4, 5, 6],
|
|
|
+ disposition: [
|
|
|
+ { name: "细心", score: 45 },
|
|
|
+ { name: "责任心", score: 55 },
|
|
|
+ { name: "耐心", score: 25 },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "设计",
|
|
|
+ score: 19,
|
|
|
+ skills: [1, 2, 3, 4, 5, 6],
|
|
|
+ disposition: [
|
|
|
+ { name: "细心", score: 45 },
|
|
|
+ { name: "责任心", score: 55 },
|
|
|
+ { name: "耐心", score: 25 },
|
|
|
+ ],
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ name: "设计1",
|
|
|
+ score: 19,
|
|
|
+ skills: [1, 2, 3, 4, 5, 6],
|
|
|
+ disposition: [
|
|
|
+ { name: "细心", score: 45 },
|
|
|
+ { name: "责任心", score: 55 },
|
|
|
+ { name: "耐心", score: 25 },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "设计2",
|
|
|
+ score: 19,
|
|
|
+ skills: [1, 2, 3, 4, 5, 6],
|
|
|
+ disposition: [
|
|
|
+ { name: "细心", score: 45 },
|
|
|
+ { name: "责任心", score: 55 },
|
|
|
+ { name: "耐心", score: 25 },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "设计3",
|
|
|
+ score: 19,
|
|
|
+ skills: [1, 2, 3, 4, 5, 6],
|
|
|
+ disposition: [
|
|
|
+ { name: "细心", score: 45 },
|
|
|
+ { name: "责任心", score: 55 },
|
|
|
+ { name: "耐心", score: 25 },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "测试",
|
|
|
+ score: 19,
|
|
|
+ skills: [1, 2, 3, 4, 5, 6],
|
|
|
+ disposition: [
|
|
|
+ { name: "细心", score: 45 },
|
|
|
+ { name: "责任心", score: 55 },
|
|
|
+ { name: "耐心", score: 25 },
|
|
|
+ ],
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ name: "黑盒测试",
|
|
|
+ score: 19,
|
|
|
+ skills: [1, 2, 3, 4, 5, 6],
|
|
|
+ disposition: [
|
|
|
+ { name: "细心", score: 45 },
|
|
|
+ { name: "责任心", score: 55 },
|
|
|
+ { name: "耐心", score: 25 },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "白盒测试",
|
|
|
+ score: 19,
|
|
|
+ skills: [1, 2, 3, 4, 5, 6],
|
|
|
+ disposition: [
|
|
|
+ { name: "细心", score: 45 },
|
|
|
+ { name: "责任心", score: 55 },
|
|
|
+ { name: "耐心", score: 25 },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "验收测试",
|
|
|
+ score: 19,
|
|
|
+ skills: [1, 2, 3, 4, 5, 6],
|
|
|
+ disposition: [
|
|
|
+ { name: "细心", score: 45 },
|
|
|
+ { name: "责任心", score: 55 },
|
|
|
+ { name: "耐心", score: 25 },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleNodeClick(data) {
|
|
|
+ console.log(data);
|
|
|
+ },
|
|
|
+ recommend(knowledge) {
|
|
|
+ alert("推荐"+knowledge+"相关题目...")
|
|
|
+ },
|
|
|
+ getBarOption(disposition) {
|
|
|
+ // console.log("秒啊");
|
|
|
+ let tmp = {
|
|
|
+ name: [],
|
|
|
+ score: [],
|
|
|
+ };
|
|
|
+ for (let d of disposition) {
|
|
|
+ tmp.name.push(d.name);
|
|
|
+ tmp.score.push(d.score);
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ tooltip: {
|
|
|
+ trigger: "item",
|
|
|
+ formatter: "{c} ({b})",
|
|
|
+ },
|
|
|
+ itemStyle: {
|
|
|
+ color: "#83a2ff",
|
|
|
+ shadowBlur: 200,
|
|
|
+ shadowColor: "rgba(23,48,103,0.5)",
|
|
|
+ },
|
|
|
+ xAxis: {
|
|
|
+ type: "category",
|
|
|
+ data: tmp.name,
|
|
|
+ },
|
|
|
+ yAxis: {
|
|
|
+ type: "value",
|
|
|
+ // show: false,
|
|
|
+ axisLine: {
|
|
|
+ lineStyle: {
|
|
|
+ color: "#555",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ splitLine: {
|
|
|
+ show: false,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ data: tmp.score,
|
|
|
+ type: "bar",
|
|
|
+ barMaxWidth: 40,
|
|
|
+ showBackground: true,
|
|
|
+ backgroundStyle: {
|
|
|
+ color: "rgba(220, 220, 220, 0.8)",
|
|
|
+ },
|
|
|
+ itemStyle: {
|
|
|
+ color: "#a17be3",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ getRadarOption(skills, max = [10, 10, 10, 10, 10, 10]) {
|
|
|
+ return {
|
|
|
+ tooltip: {
|
|
|
+ trigger: "item",
|
|
|
+ },
|
|
|
+ color: ["#67F9D8", "#FFE434", "#56A3F1", "#FF917C"],
|
|
|
+ radar: [
|
|
|
+ {
|
|
|
+ indicator: [
|
|
|
+ { text: "Remember", max: max[0] },
|
|
|
+ { text: "Understand", max: max[1] },
|
|
|
+ { text: "Apply", max: max[2] },
|
|
|
+ { text: "Analyze", max: max[3] },
|
|
|
+ { text: "Evaluation", max: max[4] },
|
|
|
+ { text: "Create", max: max[5] },
|
|
|
+ ],
|
|
|
+ center: ["35%", "50%"],
|
|
|
+ radius: 120,
|
|
|
+ startAngle: 90,
|
|
|
+ splitNumber: 4,
|
|
|
+ shape: "circle",
|
|
|
+ axisName: {
|
|
|
+ formatter: "【{value}】",
|
|
|
+ color: "#428BD4",
|
|
|
+ },
|
|
|
+ splitArea: {
|
|
|
+ areaStyle: {
|
|
|
+ color: ["#77EADF", "#26C3BE", "#64AFE9", "#428BD4"],
|
|
|
+ shadowBlur: 200,
|
|
|
+ shadowColor: "rgba(23,48,103,0.5)",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ axisLine: {
|
|
|
+ lineStyle: {
|
|
|
+ color: () => "?",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ splitLine: {
|
|
|
+ lineStyle: {
|
|
|
+ color: "rgba(211, 253, 250, 0.8)",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ type: "radar",
|
|
|
+ emphasis: {
|
|
|
+ lineStyle: {
|
|
|
+ width: 4,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ value: skills,
|
|
|
+ name: "Skills",
|
|
|
+ areaStyle: {
|
|
|
+ color: "rgba(255, 228, 52, 0.6)",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ getPieOption(pieData) {
|
|
|
+ // console.log("piedata", pieData)
|
|
|
+ return {
|
|
|
+ tooltip: {
|
|
|
+ trigger: "item",
|
|
|
+ formatter: "{b} : {c} ({d}%)",
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ // name: '访问来源',
|
|
|
+ type: "pie",
|
|
|
+ radius: "55%",
|
|
|
+ center: ["50%", "50%"],
|
|
|
+ data: pieData
|
|
|
+ ? pieData.map((item) => {
|
|
|
+ return {
|
|
|
+ value: item.score,
|
|
|
+ name: item.name,
|
|
|
+ };
|
|
|
+ })
|
|
|
+ : [],
|
|
|
+ roseType: "radius",
|
|
|
+ label: {
|
|
|
+ color: "#999999",
|
|
|
+ },
|
|
|
+ labelLine: {
|
|
|
+ lineStyle: {
|
|
|
+ color: "#999999",
|
|
|
+ },
|
|
|
+ smooth: 0.2,
|
|
|
+ length: 10,
|
|
|
+ length2: 20,
|
|
|
+ },
|
|
|
+ itemStyle: {
|
|
|
+ color: "#83a2ff",
|
|
|
+ shadowBlur: 200,
|
|
|
+ shadowColor: "rgba(23,48,103,0.5)",
|
|
|
+ },
|
|
|
+
|
|
|
+ animationType: "scale",
|
|
|
+ animationEasing: "elasticOut",
|
|
|
+ animationDelay: function (idx) {
|
|
|
+ return Math.random() * 200;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+ ::v-deep .el-tree-node__content {
|
|
|
+ height: fit-content;
|
|
|
+ }
|
|
|
+ .recommend:hover {
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
</style>
|