横向思维导图前端样式


追溯记录图路上 代码如下 index.vue在这里插入图片描述

<template><div style="margin-left: 5%;margin-top: 6%">
<el-form style="margin-top: -5%; "  :inline="true"><el-form-item label="药品名称"><el-select v-model="drugs_code" placeholder="请选择" filterable clearable @change="changedrugs" ><el-optionv-for="item in drugsList":key="item.drugs_code":label="item.drugs_name +'|' + item.drugs_code  + '|' + item.short_name" :value="item.drugs_code"></el-option></el-select>
</el-form-item><el-form-item label="批号"><el-select v-model="batch_no" placeholder="请选择" filterable clearable  :disabled="isshow"><el-optionv-for="item in batchList":key="item.batch_no":label="item.batch_no" :value="item.batch_no"></el-option></el-select></el-form-item><!-- <el-form-item label="时间"><el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker></el-form-item> --><el-form-item > <el-button type="warning" @click="search"> 搜索</el-button></el-form-item>
</el-form><right-treev-if="list && list.length":list="list":showfields="showFields"></right-tree></div>
</template>
<script>
import RightTree from './RightTree'
import { formatDates, convertDateRange } from '@/api/house/recordinfo'
import { getTableZNMJG, postTableZNMJG } from '@/api/table/tableCommon'
export default {components:{RightTree,},data(){return{dateRange: [],isshow:true,drugs_code:'',drugs_name:'',batch_no:'',list: [],drugsList:[],batchList:[],showFields: [{name: '规格:',key: 'name',},{name: '批号:',key: 'serviceId',},],}},created(){this.getDrugs()},mounted() {const today = new Date()const startOfDay = new Date(today)startOfDay.setHours(0, 0, 0) // 设置为当天的 00:00:00const endOfDay = new Date(today)endOfDay.setHours(23, 59, 59) // 设置为当天的 23:59:59this.dateRange = formatDates([startOfDay, endOfDay])},methods:{search(){let _this = this;let parm = {};parm.drugs_code = this.drugs_code;parm.drugs_name = '';parm.batch_no = this.batch_no;parm.expire_date = '';postTableZNMJG('/AccountBook/Traceability',parm).then(function (res) {if (res.code == 200) {_this.list = res.data;}}).catch(function (e) {_this.list=[];});},changedrugs(){let _this = this;let parm = {};this.batch_no = '';parm.drugs_code=  this.drugs_codepostTableZNMJG('/AccountBook/Batch_noInfo' , parm).then(function (res) {if (res.code == 200) {_this.batchList = res.data;_this.isshow = false;}}).catch(function (e) {_this.batchList=[];});},getDrugs(){let _this = this;let parm = {};parm.drugs_enable = 1;parm.is_bottle = 1;postTableZNMJG('/AccountBook/DrugsWhole',parm).then(function (res) {if (res.code == 200) {_this.drugsList = res.data;}}).catch(function (e) {_this.drugsList=[];});}},}
</script>

RightTree.vue

<template><div class="TreeRight" v-if="showTree"><div class="childs"><div class="child" v-for="(item, index) in list" :key="item.id + '-child-' + index"><div class="child-item" :style="{ marginRight: item.children && item.children.length > 1 ? '20px' : '' }"><div class="childname" :id="item"><div v-if="item.id != '1'" class="content-box" :ref="item.id" :id="item.id"><el-button type="primary" round style="margin-left: 30%"> {{ item.dept_name }}</el-button><!-- <span style="color:blue">  {{}} </span> --><br /><div v-if="item.id == '1'"><span style="color: rgb(134, 143, 152); font-size: 12px">{{ tem.drusg_name }} </span><br /><span style="color: rgb(134, 143, 152); font-size: 12px">规格:{{ item.drugs_specs }}</span><br /><span style="color: rgb(134, 143, 152); font-size: 12px">批号:{{ item.batch_no }}</span></div><div style="display: flex" v-else><span style="margin-left: 8%; color: rgb(134, 143, 152); font-size: 14px">存入:<el-button type="text" @click="details(item.id, item.drugs_code, '入库' ,item.batch_no)"> {{ item.replish_Qty }}</el-button></span><span style="margin-left: 5%; color: rgb(134, 143, 152); font-size: 14px">取出:<el-button type="text" @click="details(item.id, item.drugs_code, '出库' ,  item.batch_no)"> {{ item.pick_Qty }}</el-button></span><span style="margin-left: 5%; color: rgb(134, 143, 152); font-size: 14px">库存:<el-button type="text" @click="details" disabled> {{ item.stock_Qty }}</el-button></span></div><!-- <pv-for="(itemshow,index3) in showfields":key="'itemshow'+index3">{{itemshow.name}}{{item[itemshow.key]}}</p> --></div><div v-else class="content-boxOne" :ref="item.id" :id="item.id"><el-button type="primary" round style="margin-left: 30%"> {{ item.dept_name }}</el-button><!-- <span style="color:blue">  {{}} </span> --><br /><div v-if="item.id == '1'"><br /><span style="margin-left: 8%; color: rgb(134, 143, 152); font-size: 12px; font-weight: bold">{{ item.drusg_name }} </span><br /><br /><span style="margin-left: 8%; color: rgb(134, 143, 152); font-size: 12px">规格:{{ item.drugs_specs }}</span><br /><span style="margin-left: 8%; color: rgb(134, 143, 152); font-size: 12px">批号:{{ item.batch_no }}</span><br /><span style="margin-left: 8%; color: rgb(134, 143, 152); font-size: 12px">存入:<el-button type="text" @click="details(item.id, item.drugs_code, '入库' ,item.batch_no)" > {{ item.replish_Qty }}</el-button></span><span style="margin-left: 5%; color: rgb(134, 143, 152); font-size: 12px">取出:<el-button type="text"  @click="details(item.id, item.drugs_code, '出库' ,item.batch_no)" > {{ item.pick_Qty }}</el-button></span><span style="margin-left: 5%; color: rgb(134, 143, 152); font-size: 12px">库存:<el-button type="text"> {{ item.stock_Qty }}</el-button></span></div><div style="display: flex" v-else><span style="color: rgb(134, 143, 152); font-size: 14px">存入:<el-button type="text"> {{ item.replish_Qty }}</el-button></span><span style="color: rgb(134, 143, 152); font-size: 14px">取出:<el-button type="text"> {{ item.pick_Qty }}</el-button></span><span style="color: rgb(134, 143, 152); font-size: 14px">库存:<el-button type="text" disabled> {{ item.stock_Qty }}</el-button></span></div><!-- <pv-for="(itemshow,index3) in showfields":key="'itemshow'+index3">{{itemshow.name}}{{item[itemshow.key]}}</p> --></div><div style="width: 30px"></div><div class="position-top" v-if="isFirst(item.id) && domready" :style="position_top(item.id, 'top')"></div><div class="position-top" v-if="isLast(item.id)" :style="position_top(item.id, 'bottom')"></div></div><div style="width: 160px"></div></div><!-- 递归组件展示子节点 --><div class="child-children" v-if="item.children && item.children.length"><RightTree :list="item.children" :showfields="showfields" /></div></div></div><el-dialog title="明细" :visible.sync="dialogVisible" width="90%"><el-table:data="tableList"><el-table-column type="index" width="50" label="" prop=""/> <el-table-column  width="" prop="sy_type" label="类型"/>  <el-table-column  width="" prop="real_qty" label="数量"/><!-- <el-table-column  width="" prop="out_qty" label="出库"/>  --><!-- <el-table-column  width="" prop="bussniess_type" label="bussniess_type"/>  --><el-table-column  width="" prop="dept_name" label="科室名称"/> <el-table-column  width="" prop="drugs_code" label="药品编号"/> <el-table-column  width="" prop="drugs_name" label="药品名称"/> <!-- <el-table-column  width="" prop="stock_qty" label="库存"/>  --><el-table-column  width="" prop="stock_totalqty" label="总库存"/> <!-- <el-table-column  width="" label="total_stock" prop="total_stock"/>  --><!-- <el-table-column  width="" prop="bill_qty" label="单据数量"/>  --><!-- <el-table-column  width="" prop="need_qty" label="需取数量"/>  --><!-- <el-table-column  width="" prop="real_qty" label="数量"/>  --><el-table-column  width="" prop="bill_no" label="单号"/> <!-- <el-table-column  width="" label="serial_no" prop="serial_no"/>  --><!-- <el-table-column  width="" label="patient_id" prop="patient_id"/>  --><!-- <el-table-column  width="" prop="patient_name" label="患者姓名"/>  --><!-- <el-table-column  width="" prop="patient_dept_no" label="患者科室号"/>  --><!-- <el-table-column  width="" prop="patient_dept_name" label="患者科室"/>  --><!-- <el-table-column  width="" prop="patient_sex" label="patient_sex"/>  --><!-- <el-table-column  width="" prop="patient_age" label="patient_age"/>  --><!-- <el-table-column  width="" prop="patient_bedno" label="patient_bedno"/>  --><el-table-column  width="" prop="batch_no" label="批号"/> <!-- <template slot-scope="scope"><el-table-column  v-if="scope.row.sy_type == '入库'"  width="" prop="produce_name" label="供应商"/><el-table-column v-if="scope.row.sy_type == '入库'"  width="" prop="produce_date" label="生产日期"/> </template> --><el-table-column  width="" prop="expire_date" label="效期"/> <el-table-column  width="" prop="create_by" label="入库/出库人"/> <el-table-column  width="" prop="last_update_by" label="复核人"/> <el-table-column  width="" prop="drugs_specs" label="规格"/> <!-- <el-table-column  width="" prop="dosage" label=""/>  --><!-- <el-table-column  width="" prop="dose_mode" label="dose_mode"/>  --><!-- <el-table-column  width="" prop="exec_rate" label="exec_rate"/>  --><!-- <el-table-column  width="" prop="produce_date" label="produce_date"/>  --><!-- <el-table-column  width="" prop="bill_type" label="bill_type"/>  --><!-- <el-table-column  width="" prop="qty_h" label="qty_h"/>  --><!-- <el-table-column  width="" prop="qty_l" label="qty_l"/>  --><!-- <el-table-column  width="" prop="dept_no" label="dept_no"/>  --><!-- <el-table-column  width="" prop="batch_no_qty" label="batch_no_qty"/>  --><!-- <el-table-column  width="" prop="mPerson" label="mPerson"/>  --><!-- <el-table-column  prop="package_unit" label="package_unit"/>  --><!-- <el-table-column   prop="package_ratio" label="package_ratio"/>  --><!-- <el-table-column   prop="return_qty" label="return_qty"/>  --><!-- <el-table-column  prop="drugs_flag" label="drugs_flag"/>  --><el-table-column   prop="create_date" label="入库/出库时间"/> <!-- <el-table-column  width="" prop="last_update_date" label="复"/>  --></el-table></el-dialog></div></template><script>
import LeaderLine from 'leader-line-vue'import { getTableByKey, getTable, getTableZNMJG, postTableZNMJG } from '@/api/table/tableCommon'
export default {name: 'RightTree',components: {},data() {return {tableData: {keyName: 'zhuisumap',Data: {},},xxdrugsBatch: '',xxdrugsSpecs: '',xxdrugsName: '',api_url: '',domready: false,dialogVisible: false,lines: [],tableList: [],}},created() {// this.loadTable()},props: {list: {type: Array,default: () => [],},showfields: {type: Array,default: () => [],},},mounted() {this.$nextTick(() => {this.domready = truethis.drawArrowLine()})},computed: {/*** 是否展示树计算属性*/showTree() {return this.list && this.list.length},},beforeDestroy() {/*** 离开页面时销毁所有line*/if (this.lines && this.lines.length) {this.lines.forEach((line) => {line.remove()})}},methods: {loadTable() {getTableByKey(this.tableData.keyName).then((response) => {this.tableData.Data = response.datathis.tableData.Data.columns.forEach((item) => {//    this.getDictsTable(item.dictName)})}).catch((err) => {this.$message.warning('数据表格框架尚未维护,请联系实施人员进行维护')})},// getDictsTable(dictName) {//   if (dictName != null) {//     this.getDicts(dictName).then((response) => {//       this.tableData.Data.columns.forEach((item) => {//         if (item.isDict == 'Y' && item.dictName == dictName) {//           item.rangeKey = response.data//         }//       })//     })//   }// },details(id, drugs_code, type ,batch_no) {let _this = thislet parm = {page: 1,limit: 10,dept_no: id,drugs_code: drugs_code,batch_no : batch_no,sy_type: type,start_time: '2022-01-01',end_time: '2025-01-01',}postTableZNMJG('/AccountBook/TraceabilityShifts', parm).then(function (res) {if (res.code == 200) {_this.tableList = res.data_this.dialogVisible = true}}).catch(function (e) {_this.tableList = []})},/*** 递归绘制箭头*/drawArrowLine() {this.drawLeaderLine(this.list)},/*** 根据上下级关系绘制线条*/drawLeaderLine(list) {list.forEach((element) => {let start = document.getElementById(element.id)if (element.children && element.children.length) {element.children.forEach((child) => {let line = LeaderLine.setLine(start, document.getElementById(child.id))line.color = 'rgba(30, 130, 250, 0.5)'line.path = 'grid'line.size = 3line.setOptions({dash: { animation: true },})this.lines.push(line)})this.drawLeaderLine(element.children)}})},position_top(id, position) {let dom = document.getElementById(id)let heightif (dom) {height = dom.clientHeight}let rtif (position === 'top') {rt = {height: height / 2 - 2 + 'px',top: 0,}}if (position === 'bottom') {rt = {height: height / 2 + 1 + 'px',bottom: 0,}}return rt},isFirst(id) {return this.list.length > 1 && this.list.map((x) => x.id).indexOf(id) === 0},isLast(id) {return this.list.length > 1 && this.list.map((x) => x.id).indexOf(id) === this.list.length - 1},},
}
</script><style lang="scss" scoped>
.TreeRight {p {margin: 0;font-size: 13px;}display: flex;.father {width: 70px;background-color: rgb(127, 92, 223);padding: 100px 10px;}.childs {.child {display: flex;background-color: #fff;.child-item {display: flex;align-items: center;margin: 10px 0;.childname {.content-box {text-align: left;border: 1px solid #777676;padding: 10px;height: 80px;border-radius: 100px;width: 1000%;box-shadow: 0 2px 4px 0 rgba(99, 98, 98, 0.7);}.content-boxOne {text-align: left;border: 1px solid #808080;background-color: rgb(241, 241, 241);padding: 10px;height: 300px;border-radius: 70px;width: 1000%;box-shadow: 0 2px 4px 0 rgba(107, 106, 106, 0.7);}//cursor: pointer;height: 100%;display: flex;align-items: center;width: 220px;text-align: center;justify-content: center;position: relative;padding: 10px 0;.position-arrow {position: absolute;left: -22px;}.position-top {position: absolute;width: 3px;background-color: #fff;left: -23px;height: 10px;}}.childarrow {height: 100%;display: flex;align-items: center;}}}.child-children {display: flex;flex-direction: column;justify-content: center;}}
}
</style>

ition-arrow {
position: absolute;
left: -22px;
}
.position-top {
position: absolute;
width: 3px;
background-color: #fff;
left: -23px;
height: 10px;
}
}
.childarrow {
height: 100%;
display: flex;
align-items: center;
}
}
}
.child-children {
display: flex;
flex-direction: column;
justify-content: center;
}
}
}


本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/60157.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

实验报告6-项目测试与部署

资料下载 实验报告4-实现分页功能 一、实现思路 打包运行商品分页项目。要求&#xff1a; 1、测试项目service层的分页功能&#xff0c; 2、controller层添加first()并测试 3、将项目打为JAR包并运行&#xff0c; 4、将项目打为WAR包并运行。 二、实验步骤 1、测试项目s…

深度学习:微调(Fine-tuning)详解

微调&#xff08;Fine-tuning&#xff09;详解 微调&#xff08;Fine-tuning&#xff09;是机器学习中的一个重要概念&#xff0c;特别是在深度学习和自然语言处理&#xff08;NLP&#xff09;领域。该过程涉及调整预训练模型的参数&#xff0c;以适应特定的任务或数据集。以下…

清华大学提出Mini-Omni2:开源多模态模型,功能与GPT-4o媲美!

&#x1f310; 在人工智能领域&#xff0c;多模态模型的发展正如火如荼。今天&#xff0c;我们要介绍的是由清华大学提出的Mini-Omni2&#xff0c;这是一个开源的多模态语言模型&#xff0c;它在功能上与GPT-4o相媲美&#xff0c;能够理解和生成视觉、听觉和文本内容&#xff0…

简单叙述 Spring 是如何解决循环依赖问题的呢?

文章目录 什么是循环依赖&#xff1f;为什么Spring要解决循环依赖&#xff1f;Spring是如何解决循环依赖的&#xff1f;具体过程是这样的&#xff1a;结论推荐阅读文章 什么是循环依赖&#xff1f; 首先&#xff0c;我们得知道什么是循环依赖。想象一下&#xff0c;如果有两个…

HarmonyOS入门 : 获取网络数据,并渲染到界面上

1. 环境搭建 开发HarmonyOS需要安装DevEco Studio&#xff0c;下载地址 : https://developer.huawei.com/consumer/cn/deveco-studio/ 2. 如何入门 入门HarmonyOS我们可以从一个实际的小例子入手&#xff0c;比如获取网络数据&#xff0c;并将其渲染到界面上。 本文就是基于…

【计网不挂科】计算机网络期末考试(综合)——【选择题&填空题&判断题&简述题】完整试卷

前言 大家好吖&#xff0c;欢迎来到 YY 滴计算机网络 系列 &#xff0c;热烈欢迎&#xff01; 本章主要内容面向接触过C的老铁 本博客主要内容&#xff0c;收纳了一部门基本的计算机网络题目&#xff0c;供yy应对期中考试复习。大家可以参考 本章是去答案版本。带答案的版本在下…

msvcr100.dll丢失怎么解决?高效靠谱的六种解决方法分享

在我们使用电脑的时候&#xff0c;有一种叫动态链接库&#xff08;DLL&#xff09;的文件特别重要。比如&#xff0c;msvcr100.dll是Microsoft Visual C 2010 Redistributable包里的一部分&#xff0c;很多应用程序在运行的时候都需要用到它。但是&#xff0c;有些用户在使用的…

【C++练习】二进制到十进制的转换器

题目&#xff1a;二进制到十进制的转换器 描述 编写一个程序&#xff0c;将用户输入的8位二进制数转换成对应的十进制数并输出。如果用户输入的二进制数不是8位&#xff0c;则程序应提示用户输入无效&#xff0c;并终止运行。 要求 程序应首先提示用户输入一个8位二进制数。…

【SpringBoot】19 文件/图片下载(MySQL + Thymeleaf)

Git仓库 https://gitee.com/Lin_DH/system 介绍 从 MySQL 中&#xff0c;下载保存的 blob 格式的文件。 代码实现 第一步&#xff1a;配置文件 application.yml spring:jackson:date-format: yyyy-MM-dd HH:mm:sstime-zone: GMT8datasource:driver-class-name: com.mysql.…

C++——异常

异常是在程序执行的过程中发生了某种错误&#xff0c;异常的处理机制允许我们讲发生的异常抛出给程序的另外一部分&#xff0c;对这个错误进行处理。这个机制让问题检测的环节和问题处理的环节分离。检测环节只需要负责检测即可&#xff0c;无需关系解决的细节问题。在C语言中处…

Docker 配置镜像加速

docker 拉取代码时出现 ERROR: failed to solve: node:16: unexpected status from HEAD request to https:// xxxxxx.mirror.aliyuncs.com/v2/library/node/m…

Android 文件带进度的下载功能实现与封装

网络框架 现在基本都是okhttp3rotrofit同时你可以加入rxjava3&#xff0c;今天就讲一下这几个结合实现简单的下载功能 先定义接口,下面两个区别就是一个可以断点续传而已 /*** 大文件官方建议用 Streaming 来进行注解&#xff0c;不然会出现IO异常&#xff0c;小文件可以忽略不…

Linux相关概念和易错知识点(19)(HDD、Block group)

目录 1.HDD &#xff08;1&#xff09;HDD存储描述 &#xff08;2&#xff09;HDD结构图 &#xff08;3&#xff09;磁盘管理的分治思想 &#xff08;4&#xff09;硬盘中文件系统的整体划分图 2.Block group &#xff08;1&#xff09;文件管理 ①文件属性的存储 ②in…

Windows上安装与使用 Jupyter Notebook

1. 了解 Jupyter Notebook Jupyter Notebook 是一个交互式计算环境&#xff0c;非常适合进行数据科学和机器学习的研究和实验。可以在 Notebook 中直接编写代码、运行代码块、保存结果&#xff0c;非常直观。 在安装 Jupyter Notebook 时&#xff0c;可以选择全局环境&#x…

WWDC24(Xcode 16)中全新的 Swift Testing 使用进阶

概述 WWDC 24 祭出的全新单元测试系统着实让苹果开发者们眼前一亮。“原来测试还可以这么爽&#xff01;&#xff1f;”&#xff0c;日渐逼近蟋蟀发型的某位码农如是说。 Swift Testing 在简洁性以及灵活性全面超越老大哥 XCTest 的同时&#xff0c;也让秃头码农们真正见识到了…

Spring Boot驱动的多维分类知识管理系统

1 绪论 1.1 研究背景 在这个推荐个性化的时代&#xff0c;采用新技术开发一个多维分类的知识管理系统来分享和展示内容是一个永恒不变的需求。本次设计的多维分类的知识管理系统有管理员和用户两个角色。 管理员可以管理用户信息&#xff0c;知识分类&#xff0c;知识信息等&am…

Linux mint系统推荐软件

最近无意中&#xff0c;找到了多年前的老笔记本电脑&#xff0c;用个windows卡死所以想装个linux玩&#xff0c;感觉用这个来打代码是足够的了&#xff0c;装了linux最明显的特点就是&#xff0c;笔记本风扇不转了&#xff0c;且耗电量明显降低&#xff0c;有些软件可以推荐一下…

k8s-service、endpoints、pod之间是怎么进行网络互通的

k8s-service、endpoints、pod之间是怎么进行网络互通的 1、service2、endpoints3、service、endpoints、pod通信图4、不同服务pod内部间访问 1、service 在K8S中&#xff0c;Service是一种抽象&#xff0c;定义了一组Pod的逻辑集合和访问这些Pod的策略。首先&#xff0c;我们需…

命令行工具PowerShell使用体验

命令行工具PowerShell使用 PowerShell是微软开发的一种面向对象的命令行Shell和脚本语言环境&#xff0c;它允许用户通过命令行的方式管理操作系统。相较于传统CMD&#xff0c;PowerShell增加了面向对象的程序设计框架&#xff0c;拥有更强大的功能和扩展性。使用PowerShell可…

企业IT架构转型之道:阿里巴巴中台战略思想与架构实战感想

文章目录 第一章&#xff1a;数据库水平扩展第二章&#xff1a;中台战略第三章&#xff1a;阿里分布式服务架构HSF&#xff08;high speed Framework&#xff09;、早期Dubbo第四章&#xff1a;共享服务中心建设原则第五章&#xff1a;数据拆分实现数据库能力线性扩展第六章&am…