| | |
| | | height: calc(100% - 30px); |
| | | overflow-y: scroll; |
| | | scrollbar-width: none; |
| | | " @node-click="handleNodeClick" @node-expand="nodeOpen" @node-collapse="nodeClose" @node-drop="handleDrop"> |
| | | " @node-click="handleNodeClick" |
| | | @node-drop="handleDrop"> |
| | | <div slot-scope="{ node, data }" class="custom-tree-node"> |
| | | <el-row style="width: 100%"> |
| | | <el-col :class="{ sort: node.level > 3 }" :span="19" :title="data.label" style="text-align: left"> |
| | |
| | | } |
| | | } |
| | | }, |
| | | filterNode(value, data) { |
| | | if (!value) return true; |
| | | return data.label.indexOf(value) !== -1; |
| | | // 调用tree过滤方法 中文英过滤 |
| | | filterNode (value, data, node) { |
| | | if (!value) { //如果数据为空,则返回true,显示所有的数据项 |
| | | return true |
| | | } |
| | | // 查询列表是否有匹配数据,将值小写,匹配英文数据 |
| | | let val = value.toLowerCase() |
| | | return this.chooseNode(val, data, node) // 调用过滤二层方法 |
| | | }, |
| | | // 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符. |
| | | chooseNode (value, data, node) { |
| | | if (data.label.indexOf(value) !== -1) { |
| | | return true |
| | | } |
| | | const level = node.level |
| | | // 如果传入的节点本身就是一级节点就不用校验了 |
| | | if (level === 1) { |
| | | return false |
| | | } |
| | | // 先取当前节点的父节点 |
| | | let parentData = node.parent |
| | | // 遍历当前节点的父节点 |
| | | let index = 0 |
| | | while (index < level - 1) { |
| | | // 如果匹配到直接返回,此处name值是中文字符,enName是英文字符。判断匹配中英文过滤 |
| | | if (parentData.data.label.indexOf(value) !== -1) { |
| | | return true |
| | | } |
| | | // 否则的话再往上一层做匹配 |
| | | parentData = parentData.parent |
| | | index++ |
| | | } |
| | | // 没匹配到返回false |
| | | return false |
| | | }, |
| | | |
| | | searchFilter() { |
| | | this.$refs.tree.filter(this.search); |
| | | }, |
| | |
| | | } |
| | | this.selectTree = data2.replace(" - ", ""); |
| | | delStandardTree({ tree: this.selectTree }).then((res) => { |
| | | if (res.code == 201) return; |
| | | this.$message.success("已删除"); |
| | | let arr = this.selectTree.split(" - "); |
| | | this.deleteStandard(this.list, arr[arr.length - 1]); |
| | |
| | | item.children && this.deleteStandard(item.children, label); |
| | | } |
| | | }); |
| | | }, |
| | | nodeOpen(data, node, el) { |
| | | $($(el.$el).find(".node_i")[0]).attr( |
| | | "class", |
| | | "node_i el-icon-folder-opened" |
| | | ); |
| | | }, |
| | | nodeClose(data, node, el) { |
| | | $($(el.$el).find(".node_i")[0]).attr("class", "node_i el-icon-folder"); |
| | | }, |
| | | selectEnumByCategoryForFactory() { |
| | | this.getConfigKey("sys_factory").then((response) => { |
| | |
| | | this.addLoad = true; |
| | | addStandardTree(this.addOb) |
| | | .then((res) => { |
| | | if (res.code === 201) { |
| | | this.addLoad = false; |
| | | return; |
| | | } |
| | | this.$message.success("添加成功"); |
| | | this.addDia = false; |
| | | this.list |
| | |
| | | this.updateLoad = true; |
| | | updateStandardTree(this.addOb) |
| | | .then((res) => { |
| | | if (res.code === 201) { |
| | | this.updateLoad = false; |
| | | return; |
| | | } |
| | | this.$message.success("添加成功"); |
| | | this.$tab.refreshPage(); |
| | | // this.selectStandardTreeList(); |
| | |
| | | ask: value, |
| | | }), |
| | | }).then((res) => { |
| | | if (res.code == 201) { |
| | | this.$message.error("未保存"); |
| | | return; |
| | | } |
| | | this.$message.success("已保存"); |
| | | }); |
| | | }, |
| | |
| | | tell: value, |
| | | }), |
| | | }).then((res) => { |
| | | if (res.code == 201) { |
| | | this.$message.error("未保存"); |
| | | return; |
| | | } |
| | | this.$message.success("已保存"); |
| | | }); |
| | | }, |
| | |
| | | methodS: value, |
| | | }), |
| | | }).then((res) => { |
| | | if (res.code == 201) { |
| | | this.$message.error("未保存"); |
| | | return; |
| | | } |
| | | this.$message.success("已保存"); |
| | | }); |
| | | }, |
| | |
| | | radius: value, |
| | | }), |
| | | }).then((res) => { |
| | | if (res.code == 201) { |
| | | this.$message.error("未保存"); |
| | | return; |
| | | } |
| | | this.$message.success("已保存"); |
| | | }); |
| | | }, |
| | |
| | | price: value, |
| | | }), |
| | | }).then((res) => { |
| | | if (res.code == 201) { |
| | | this.$message.error("未保存"); |
| | | return; |
| | | } |
| | | this.$message.success("已保存"); |
| | | }); |
| | | }, |
| | |
| | | manHour: value, |
| | | }), |
| | | }).then((res) => { |
| | | if (res.code == 201) { |
| | | this.$message.error("未保存"); |
| | | return; |
| | | } |
| | | this.$message.success("已保存"); |
| | | }); |
| | | }, |
| | |
| | | templateId: value, |
| | | }), |
| | | }).then((res) => { |
| | | if (res.code == 201) { |
| | | this.$message.error("未保存"); |
| | | return; |
| | | } |
| | | this.$message.success("已保存"); |
| | | }); |
| | | }, |
| | |
| | | state: row.state, |
| | | }), |
| | | }).then((res) => { |
| | | if (res.code == 201) { |
| | | this.$message.error("未保存"); |
| | | return; |
| | | } |
| | | // this.$message.success('已保存') |
| | | this.$message.success('已保存') |
| | | }); |
| | | }, |
| | | filterHandler(value) { |
| | |
| | | }), |
| | | }).then((res) => { |
| | | this.sectionLoad = false; |
| | | if (res.code == 201) { |
| | | this.$message.error("未保存"); |
| | | return; |
| | | } |
| | | this.$message.success("已保存"); |
| | | this.sectionUpDia = false; |
| | | }); |
| | |
| | | }, |
| | | }).then((res) => { |
| | | this.sectionLoad = false; |
| | | if (res.code == 201) { |
| | | this.$message.error("未保存"); |
| | | return; |
| | | } |
| | | this.$message.success("已保存"); |
| | | this.sectionUpDia = false; |
| | | this.currentPage0 = 1; |