src/components/view/standard-table/material.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/components/view/standard-table/target.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/components/view/standard-table/technology.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/components/view/standard.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/components/view/standard-table/material.vue
@@ -1,8 +1,8 @@ <template> <div class="standard"> <div> <el-table :data="tableData" style="width: 100%;margin-bottom: 20px;" row-key="id" border @selection-change="handleSelectionChange" default-expand-all <el-table :data="tableData" max-height="675" style="width: 100%;margin-bottom: 20px;" row-key="rowId" border @selection-change="handleSelectionChange" default-expand-all :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> <el-table-column type="selection" width="55"> </el-table-column> @@ -10,21 +10,29 @@ </el-table-column> <el-table-column prop="father" label="å·¥åº" sortable width="200px"> <template slot-scope="scope"> <el-tag v-if="scope.row.children" type="primary">01</el-tag> <span style="color: #000000"> {{ scope.row.father }} </span> <el-tag v-if="scope.row.father != null" type="primary">01</el-tag> <span style="color: #000000"> {{ scope.row.father }} </span> </template> </el-table-column> <el-table-column prop="name" sortable label="å·¥èºåç§°"> <el-table-column prop="tname" sortable label="å·¥èºåç§°"> <template slot-scope="scope"> <el-tag type="success" v-if="!scope.row.children">02</el-tag> <span style="color: black"> {{ scope.row.name }} </span> </template> <el-tag type="success" v-if="scope.row.tname != null">02</el-tag> <span style="color: black"> {{ scope.row.tname }} </span> </template> </el-table-column> <el-table-column prop="mname" label="ææåç§°"> <template slot-scope="scope"> <el-tag type="info" color="#faf2ff" v-if="scope.row.mname != null"> <span style="color: #e1affb">03</span> </el-tag> <span> {{scope.row.mname}} </span> </template> </el-table-column> <el-table-column prop="specifications" label="è§æ ¼"> </el-table-column> @@ -41,6 +49,7 @@ export default { data() { return { hasChildren:true, selects: [] } }, src/components/view/standard-table/target.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,105 @@ <template> <div class="standard"> <div> <el-table ref="table" :data="tableData" row-key="rowId" border max-height="675" @selection-change="handleSelectionChange" default-expand-all :tree-props="{children: 'children', hasChildren: 'hasChildren'}"> <el-table-column type="selection" width="55"></el-table-column> <el-table-column type="index" width="60" label="åºå·"></el-table-column> <el-table-column prop="tfather" label="å·¥åº"> <template slot-scope="scope"> <el-tag type="primay" v-if="scope.row.tfather != null">01</el-tag> <span>{{scope.row.tfather}}</span> </template> </el-table-column> <el-table-column prop="tname" label="å·¥èºåç§°"> <template slot-scope="scope"> <el-tag type="success" v-if="scope.row.tname != null">02</el-tag> <span>{{scope.row.tname}}</span> </template> </el-table-column> <el-table-column prop="pname" label="ææ åç§°"> <template slot-scope="scope"> <el-tag type="info" color="#faf2ff" v-if="scope.row.pname != null"> <span style="color: #e1affb">03</span> </el-tag> <span>{{scope.row.pname}}</span> </template> </el-table-column> <el-table-column prop="unit" label="åä½"></el-table-column> <el-table-column prop="internal" label="å æ§å¼"></el-table-column> <el-table-column prop="required" label="æ åå¼"></el-table-column> </el-table> </div> </div> </template> <script> export default { data() { return { selects: [], } }, props:['tableData','tableType'], created() {}, mounted() {}, methods: { handleSelectionChange(val) { this.selects = val; }, aaaa(){ console.log("aaaaa----",this.targetData); } } } </script> <style scoped> .expand-button { cursor: pointer; color: #1890ff; } .standard { width: 100%; height: 100%; } </style> <style> .standard * { font-size: 14px; } .standard .has-gutter .el-table__cell { background-color: #F0F1F5 !important; color: #333; } .standard .has-gutter .el-table__cell .cell { font-size: 16px; font-weight: 500; } .standard .cell { color: #333; padding-left: 17px !important; } .standard { width: 100%; height: 100%; overflow: auto; } /* .standard .el-table__body-wrapper { height: 100%; } */ /* .standard .el-table__body { height: 100%; } */ .standard .el-table .el-table__row:not([class*="el-table__row--level-"]) td:nth-child(3){ padding-left: 23px !important; } </style> src/components/view/standard-table/technology.vue
@@ -1,7 +1,7 @@ <template> <div class="standard"> <div> <el-table :data="tableData" height="800" row-key="id" border <el-table :data="tableData" max-height="675" row-key="rowId" border :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'left'}" @selection-change="handleSelectionChange" default-expand-all :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> @@ -89,13 +89,13 @@ overflow: auto; } .standard .el-table__body-wrapper { /* .standard .el-table__body-wrapper { height: 100%; } } */ .standard .el-table__body { /* .standard .el-table__body { height: 100%; } } */ .standard .el-table .el-table__row:not([class*="el-table__row--level-"]) td:nth-child(3){ padding-left: 23px !important; } src/components/view/standard.vue
@@ -55,17 +55,13 @@ <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"> <target :tableType="tableType" :tableData="tableData"></target> </div> <div v-if="this.typeselect == 2"> <material :tableType="tableType" :tableData="tableData"></material> </div> <div v-if="this.typeselect == 3">ç产工èº</div> <!-- <div class="table"> <technology v-if="tableData.length !== 0" :tableType="tableType" :tableData="tableData"></technology> </div> --> <!-- <div class="table"> <technology v-if="tableData.length !== 0" :tableType="tableType" :tableData="tableData"></technology> </div> --> </div> </div> @@ -87,9 +83,9 @@ <script> import technology from "./standard-table/technology.vue" import material from "./standard-table/material.vue" import target from "./standard-table/target.vue" export default { components: { technology,material }, components: { technology,material,target }, data() { return { // BOMæ æ°æ®ç»æ @@ -155,7 +151,6 @@ TYPE(val) {//ç±»å.æ°æ® console.log(val); this.typeselect = val // console.log(this.typeselect); this.selectVersion() }, @@ -192,11 +187,18 @@ } }).then(res => { let arr = res.data; for(var i=0;i<arr.length;i++){ arr[i].id = "0" + i; } this.formatData(arr) this.tableData = arr; }) }, formatData(data){ let arr = data; for(var i=0;i<arr.length;i++){ arr[i].rowId = Math.random(); if(arr[i].children != undefined){ this.formatData(arr[i].children); } } }, verevent(val) { console.log(val); @@ -211,7 +213,7 @@ //äºçº§æ selectMaterialTree() { this.$axios.get(this.$api.url.selectTreeByMaterial).then( res => { _that.list = res.data this.list = res.data this.list.forEach((el, idx, arr) => { if (idx == 0) { arr[idx].name = 'æå'