| | |
| | | <div class="scrollable-container"> |
| | | <div class="content"> |
| | | <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false" |
| | | :filter-node-method="filterNode" ref="tree" node-key="id" :default-expanded-keys="treeId" |
| | | highlight-current @node-click="handleNodeClick" :render-content="renderContent" /> |
| | | :filter-node-method="filterNode" ref="tree" node-key="id" :default-expanded-keys="treeId" |
| | | highlight-current @node-click="handleNodeClick" :render-content="renderContent" v-loading="loadings"/> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | |
| | | import IconSelect from "@/components/IconSelect"; |
| | | import { listConsumables } from "@/api/hosp/consumables"; |
| | | import { Message } from "element-ui"; |
| | | import cnchar from 'cnchar'; |
| | | import { |
| | | listSfxm, |
| | | getSfxm, |
| | |
| | | ChangeList: [], |
| | | // 遮罩层 |
| | | loading: true, |
| | | loadings: false, |
| | | key: "", |
| | | // 选中数组 |
| | | ids: [], |
| | |
| | | }; |
| | | getAllChildListById(data).then((response) => { |
| | | this.projectList = response.data.list; |
| | | console.log("进来了列表并且获取到了值", this.projectList); |
| | | // console.log("进来了列表并且获取到了值", this.projectList); |
| | | |
| | | this.loading = false; |
| | | }); |
| | |
| | | deptTree111().then((response) => { |
| | | this.deptOptions = response.data; |
| | | this.treeId.push(this.treeDate.id); |
| | | console.log(this.treeId) |
| | | }); |
| | | |
| | | }, |
| | |
| | | // 筛选节点 |
| | | filterNode(value, data) { |
| | | if (!value) return true; |
| | | return data.label.indexOf(value) !== -1; |
| | | const input = value.toLowerCase(); |
| | | const label = data.label; |
| | | |
| | | // 1. 直接中文匹配 |
| | | if (label.includes(input)) return true; |
| | | |
| | | // 2. 全拼匹配(支持大小写) |
| | | const fullPinyin = cnchar.spell(label, 'low', 'array').join(''); |
| | | if (fullPinyin.includes(input)) return true; |
| | | |
| | | // 3. 首字母简拼匹配 |
| | | const simplePinyin = cnchar.spell(label, 'first', 'low').replace(/\s+/g, ''); |
| | | if (simplePinyin.includes(input)) return true; |
| | | |
| | | // 4. 带空格的全拼匹配(如:zhang san) |
| | | const spacedPinyin = cnchar.spell(label, 'low', ' ').replace(/\s+/g, ' '); |
| | | if (spacedPinyin.includes(input)) return true; |
| | | |
| | | return false; |
| | | }, |
| | | |
| | | // 节点单击事件 |
| | | handleNodeClick(date) { |
| | | |
| | | console.log("调用了handleNodeClick ", date.id, this.id) |
| | | // console.log("调用了handleNodeClick ", date.id, this.id) |
| | | this.treeDate = date; |
| | | if (date.qf == "0") { |
| | | this.xiugais = true; |