From e680d40a9e07fff8d8f0c337f5bc5f967d7bbcf5 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 11 九月 2023 09:35:59 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.22:9001/r/mom-before
---
src/components/view/standard.vue | 81 ++++++++++++++++++++--------------------
1 files changed, 41 insertions(+), 40 deletions(-)
diff --git a/src/components/view/standard.vue b/src/components/view/standard.vue
index c7bda2b..d799745 100644
--- a/src/components/view/standard.vue
+++ b/src/components/view/standard.vue
@@ -16,7 +16,7 @@
<div class="left">
<el-input v-model="search" suffix-icon="el-icon-search" placeholder="璇疯緭鍏ユ悳绱㈠唴瀹�" size="small" clearable></el-input>
- <el-tree :data="list" ref="tree" :default-expand-all="true" :props="{ children: 'children', label: 'name' }"
+ <el-tree :data="list" ref="tree" default-expand-all :props="{ children: 'children', label: 'name' }"
node-key="id" :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current>
<div class="custom-tree-node" slot-scope="{ node, data }">
<span><i :class="`node_i ${data.code != '[5]' ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i>
@@ -52,18 +52,14 @@
璇�</span></el-button>
</div>
- <div v-if="this.typeselect == 0">
+ <div class="contentTable" v-if="this.typeselect == 0">
<technology :tableType="tableType" :tableData="tableData"></technology>
</div>
- <div v-if="this.typeselect == 1">
- 鎶�鏈寚鏍�
- </div>
+ <div v-if="this.typeselect == 1">鎶�鏈寚鏍�</div>
<div v-if="this.typeselect == 2">
<material :tableType="tableType" :tableData="tableData"></material>
</div>
- <div v-if="this.typeselect == 3">
- 鐢熶骇宸ヨ壓
- </div>
+ <div v-if="this.typeselect == 3">鐢熶骇宸ヨ壓</div>
<!-- <div class="table">
<technology v-if="tableData.length !== 0" :tableType="tableType" :tableData="tableData"></technology>
</div> -->
@@ -77,7 +73,7 @@
<div class="bom-add-model">
<el-dialog title="BOM鏂板" :visible.sync="bomAddModelVisible" width="30%">
<el-form>
-
+
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="bomAddModelVisible = false">鍙� 娑�</el-button>
@@ -104,7 +100,6 @@
checkTreeNode: {},// 鐐瑰嚮閫変腑鏍戣妭鐐�
tableData: [],
bomAddModelVisible: false,// 鎺у埗bom鏂板妯℃�佹鏄惁鏄剧ず
- list: [],
typeselect: 0,
returntree: {
id:28,
@@ -160,7 +155,7 @@
TYPE(val) {//绫诲瀷.鏁版嵁
console.log(val);
this.typeselect = val
-
+
// console.log(this.typeselect);
this.selectVersion()
},
@@ -196,8 +191,11 @@
version: this.character,//鐗堟湰
}
}).then(res => {
- console.log(res.data);
- this.tableData = res.data
+ let arr = res.data;
+ for(var i=0;i<arr.length;i++){
+ arr[i].id = "0" + i;
+ }
+ this.tableData = arr;
})
},
verevent(val) {
@@ -211,9 +209,8 @@
// console.log(newObj);
},
//浜旂骇鏍�
- async selectMaterialTree() {
- let _that=this
- let res=await this.$axios.get(this.$api.url.selectTreeByMaterial).then( res => {
+ selectMaterialTree() {
+ this.$axios.get(this.$api.url.selectTreeByMaterial).then( res => {
_that.list = res.data
this.list.forEach((el, idx, arr) => {
if (idx == 0) {
@@ -224,32 +221,33 @@
}
})
this.selectDataList()
- return _that.list
+ // 榛樿绗竴涓簲绾ц妭鐐规悳绱紝鏂板閰嶇疆椤�
+ const treeOptions = JSON.parse(JSON.stringify(this.list));
+ this.getDefault(treeOptions, 0);
+ this.formTypeOptions = treeOptions;
+ this.$nextTick().then(() => {
+ const firstNode = document.querySelector(
+ ".el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__children .el-tree-node"
+ );
+ try {
+ firstNode.click();
+ } catch (e) {
+ //TODO handle the exception
+ }
+ });
})
- let s= this.filterChildren(res)
- console.log(s);
},
- filterChildren(list){
- let one=list.filter(item=>{
- return item.children!=undefined
- })[0]
- let two=one.children.filter(item=>{
- return item.children!=undefined
- })[0]
- let three=two.children.filter(item=>{
- return item.children!=undefined
- })[0]
- let four=three.children.filter(item=>{
- return item.children!=undefined
- })[0]
- return four.children[0]
- },
- isObject(param) {
- return typeof param === 'object' && param !== null;
- },
- isArray(param) {
- return Array.isArray(param);
-},
+ getDefault(arr, index) {
+ for (const item of arr) {
+ if (item.children && item.children.length > 0) {
+ // 鏈夊瓙鑺傜偣
+ this.getDefault(item.children, index + 1);
+ if (index === 2) {
+ item.children = null;
+ }
+ }
+ }
+ },
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
@@ -298,6 +296,9 @@
<style scoped>
.standard {}
+.standard .contentTable{
+}
+
.standard .title .el-button {
height: 32px;
border: 1px solid rgba(190, 190, 190, 0.44);
--
Gitblit v1.9.3