| | |
| | | "axios": "0.24.0", |
| | | "clipboard": "2.0.8", |
| | | "core-js": "3.25.3", |
| | | "d3": "^7.8.5", |
| | | "echarts": "5.4.0", |
| | | "element-ui": "2.15.12", |
| | | "file-saver": "2.0.5", |
| | |
| | | }) |
| | | } |
| | | |
| | | // 获取家根网所有成员 |
| | | // 获取所有用户 |
| | | export function listRootAll(query) { |
| | | |
| | | return request({ |
| | |
| | | :http-request="requestUpload" |
| | | :file-list="fileList" |
| | | > |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <i v-if="!uploading" slot="default" class="el-icon-plus"></i> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | :show-file-list="true" |
| | | > |
| | | <el-button type="primary">点击上传</el-button> |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | </div> |
| | |
| | | :http-request="requestUpload" |
| | | :file-list="fileList" |
| | | > |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <i v-if="!uploading" slot="default" class="el-icon-plus"></i> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | :show-file-list="true" |
| | | > |
| | | <el-button type="primary">点击上传</el-button> |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | </div> |
| | |
| | | :http-request="requestUpload" |
| | | :file-list="fileList" |
| | | > |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <i v-if="!uploading" slot="default" class="el-icon-plus"></i> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | :show-file-list="true" |
| | | > |
| | | <el-button type="primary">点击上传</el-button> |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | </div> |
| | |
| | | :http-request="requestUpload" |
| | | :file-list="fileList" |
| | | > |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <i v-if="!uploading" slot="default" class="el-icon-plus"></i> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | :http-request="requestUpload" |
| | | :show-file-list="true" |
| | | > |
| | | <el-button type="primary">上传</el-button> |
| | | <el-button type="primary">点击上传</el-button> |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | </div> |
| | |
| | | :http-request="requestUpload" |
| | | :file-list="fileList" |
| | | > |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <i v-if="!uploading" slot="default" class="el-icon-plus"></i> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | :show-file-list="true" |
| | | > |
| | | <el-button type="primary">点击上传</el-button> |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | </div> |
| | |
| | | :http-request="requestUpload" |
| | | :file-list="fileList" |
| | | > |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <i v-if="!uploading" slot="default" class="el-icon-plus"></i> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | :http-request="requestUpload" |
| | | :show-file-list="true" |
| | | > |
| | | <el-button type="primary">上传</el-button> |
| | | <el-button type="primary">点击上传</el-button> |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | </div> |
| | |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | //问候(时间判断) |
| | | setGreeting() { |
| | | const currentTime = new Date(); |
| | | const currentHour = currentTime.getHours(); |
| | |
| | | this.greeting = "晚上好"; |
| | | } |
| | | }, |
| | | |
| | | //问候(获取用户名称) |
| | | getUser() { |
| | | getUserProfile().then(response => { |
| | | this.user = response.data; |
| | |
| | | :http-request="requestUpload" |
| | | :file-list="fileList" |
| | | > |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <i v-if="!uploading" slot="default" class="el-icon-plus"></i> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | :show-file-list="true" |
| | | > |
| | | <el-button type="primary">点击上传</el-button> |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | </div> |
| | |
| | | <div class="image-container"> |
| | | <img class="top-image" src="../../assets/images/zhang.png" alt="Top Image"> |
| | | <img class="bottom-image" src="../../assets/images/bkg.png" alt="Bottom Image"> |
| | | |
| | | <el-card class="mind-map-container "> |
| | | <div id="mind-map"> |
| | | |
| | | </div> |
| | | </el-card> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getUserProfile } from "@/api/system/user"; |
| | | import { listRootAll } from "@/api/root/index"; |
| | | import { listRootAll ,listRoot} from "@/api/root/index"; |
| | | import * as d3 from 'd3'; |
| | | |
| | | export default { |
| | | name: "index", |
| | | data() { |
| | |
| | | getUserProfile().then(response => { |
| | | this.user = response.data; |
| | | }); |
| | | listRootAll().then(response =>{ |
| | | listRoot(4).then(response =>{ |
| | | this.rootList =response.data; |
| | | console.log(this.rootList) |
| | | console.log(this.rootList); |
| | | this.drawMindMap(); |
| | | }) |
| | | |
| | | } |
| | | } |
| | | }, |
| | | drawMindMap() { |
| | | const mindMapData = this.rootList[0]; // 从rootList中获取数据 |
| | | |
| | | // 清除现有的SVG元素 |
| | | d3.select("#mind-map svg").remove(); |
| | | |
| | | // 创建SVG元素,设置宽度和高度 |
| | | const svg = d3.select("#mind-map") |
| | | .append("svg") |
| | | .attr("width", "100%") |
| | | .attr("height", "100%"); |
| | | |
| | | // 创建根节点 |
| | | const root = d3.hierarchy(mindMapData); |
| | | const treeLayout = d3.tree().size([500, 400]); // 设置树状布局的尺寸 |
| | | treeLayout(root); |
| | | |
| | | // 创建链接线 |
| | | svg.selectAll(".link") |
| | | .data(root.descendants().slice(1)) |
| | | .enter() |
| | | .append("path") |
| | | .attr("class", "link") |
| | | .attr("d", d => { |
| | | return "M" + d.x + "," + d.y + "C" + (d.x + d.parent.x) / 2 + "," + d.y + " " + |
| | | (d.x + d.parent.x) / 2 + "," + d.parent.y + " " + d.parent.x + "," + d.parent.y; |
| | | }); |
| | | |
| | | // 创建节点 |
| | | const nodes = svg.selectAll(".node") |
| | | .data(root.descendants()) |
| | | .enter() |
| | | .append("g") |
| | | .attr("class", "node") |
| | | .attr("transform", d => "translate(" + d.x + "," + d.y + ")"); |
| | | |
| | | nodes.append("circle") |
| | | .attr("r", 10); |
| | | |
| | | nodes.append("text") |
| | | .attr("dx", 12) |
| | | .attr("dy", 5) |
| | | .text(d => d.data.nickName); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | height: 100%; |
| | | } |
| | | |
| | | |
| | | .mind-map-container{ |
| | | z-index: 3; |
| | | } |
| | | .top-image { |
| | | width: 50%; |
| | | /*height: 100%;*/ |
| | |
| | | :http-request="requestUpload" |
| | | :file-list="fileList" |
| | | > |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <i v-if="!uploading" slot="default" class="el-icon-plus"></i> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | :show-file-list="true" |
| | | > |
| | | <el-button type="primary">点击上传</el-button> |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | </div> |
| | |
| | | :http-request="requestUpload" |
| | | :file-list="fileList" |
| | | > |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <i v-if="!uploading" slot="default" class="el-icon-plus"></i> |
| | | <!-- <div v-if="uploading" class="upload-status">正在上传...</div>--> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | :http-request="requestUpload" |
| | | :file-list="fileListOther" |
| | | > |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <i v-if="!uploading" slot="default" class="el-icon-plus"></i> |
| | | <!-- <div v-if="uploading" class="upload-status">正在上传...</div>--> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | :http-request="requestUpload" |
| | | :file-list="fileList" |
| | | > |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <i v-if="!uploading" slot="default" class="el-icon-plus"></i> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | :http-request="requestUpload" |
| | | :show-file-list="true" |
| | | > |
| | | <el-button type="primary">上传</el-button> |
| | | <el-button type="primary">点击上传</el-button> |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | </div> |
| | |
| | | :show-file-list="true" |
| | | > |
| | | <el-button type="primary">点击上传</el-button> |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | </div> |
| | |
| | | ], |
| | | dsb:true, |
| | | btn:false, |
| | | uploading: false, |
| | | fit:['fill'], |
| | | keyword:'', |
| | | formDat: { |
| | |
| | | var formData = new FormData(); |
| | | formData.append('uploadFile', file); |
| | | let _this = this |
| | | |
| | | this.uploading = true; |
| | | uploadPic(formData).then(response => { |
| | | let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length) |
| | | |
| | | this.uploading = false; |
| | | this.$modal.msgSuccess("上传成功"); |
| | | if(_this.fot.includes(pth) === true) |
| | | { |
| | | _this.fileList.push({name:response.data.fileName, "url":response.data.url}) |
| | |
| | | :http-request="requestUpload" |
| | | :file-list="fileList" |
| | | > |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <i v-if="!uploading" slot="default" class="el-icon-plus"></i> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | :show-file-list="true" |
| | | > |
| | | <el-button type="primary">点击上传</el-button> |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | </div> |
| | |
| | | :http-request="requestUpload" |
| | | :file-list="fileList" |
| | | > |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <i v-if="!uploading" slot="default" class="el-icon-plus"></i> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | :show-file-list="true" |
| | | > |
| | | <el-button type="primary">点击上传</el-button> |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | </div> |