<template>
|
<div class="standard-library-main">
|
<div class="content-main">
|
<div class="library-bom">
|
<el-input
|
v-model="filterText"
|
placeholder="输入关键字进行过滤"
|
/>
|
<el-tree
|
ref="tree"
|
class="filter-tree"
|
:data="data"
|
:props="defaultProps"
|
default-expand-all
|
:filter-node-method="filterNode"
|
>
|
</el-tree>
|
</div>
|
<div class="library-table">
|
<div class="table-header">
|
<div class="search-bar">
|
<el-form ref="form" inline="true" :model="searchData">
|
<el-form-item>
|
<el-input
|
placeholder="请输入人员名称/原材料名称"
|
v-model="searchData.keyword"
|
>
|
<i slot="prefix" class="el-input__icon el-icon-search" />
|
</el-input>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary">查询</el-button>
|
<el-button type="primary" plain>重置</el-button>
|
<!-- <el-button type="text">高级搜索<i class="el-icon-arrow-down el-icon--right" /></el-button> -->
|
</el-form-item>
|
</el-form>
|
</div>
|
<div class="serve-btn">
|
<el-button type="primary" icon="el-icon-plus">新增人员</el-button>
|
</div>
|
</div>
|
<div class="table-box">
|
<el-table
|
ref="standardLibraryTable"
|
:cell-style="{textAlign: 'center'}"
|
:header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}"
|
:data="standardLibraryTable"
|
style="width: 100%"
|
>
|
<el-table-column
|
type="index"
|
label="序号"
|
min-width="50"
|
/>
|
<el-table-column
|
prop="name"
|
label="产品名称"
|
min-width="150"
|
/>
|
<el-table-column
|
prop="username"
|
label="更新人"
|
min-width="100"
|
/>
|
<el-table-column
|
prop="updateTime"
|
label="更新时间"
|
min-width="150"
|
/>
|
<el-table-column
|
prop="vel"
|
label="版本"
|
min-width="100"
|
/>
|
<el-table-column
|
prop="spe_state"
|
label="状态"
|
min-width="150"
|
>
|
<template slot-scope="scope">
|
<el-tag
|
:type="scope.row.spe_state === 0 ? 'primary' : 'success'"
|
disable-transitions
|
>{{ scope.row.spe_state === 0 ? '未同意' : '已同意' }}</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="操作"
|
min-width="150"
|
>
|
<template slot-scope="scope">
|
<el-button
|
type="text"
|
size="small"
|
@click="handleClick(scope.row)"
|
>查看</el-button>
|
<el-button type="text" size="small"><i class="el-icon-more" /></el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<div>
|
<el-pagination
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
:current-page="currentPage"
|
:page-sizes="[100, 200, 300, 400]"
|
:page-size="100"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="400">
|
</el-pagination>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
// 标准库bom树
|
data: [{
|
id: 1,
|
label: '一级 1',
|
children: [{
|
id: 4,
|
label: '二级 1-1',
|
children: [{
|
id: 9,
|
label: '三级 1-1-1'
|
}, {
|
id: 10,
|
label: '三级 1-1-2'
|
}]
|
}]
|
}],
|
// 默认值
|
defaultProps: {
|
children: 'children',
|
label: 'label'
|
},
|
// 查询条件
|
searchData: {
|
keyword: ''
|
},
|
standardLibraryTable: [
|
{
|
id: 2,
|
name: 'AB',
|
updateTime: '2023-07-12 00:00:12',
|
username: '小小',
|
vel: 'V1.0',
|
spe_state: 1
|
}
|
]
|
}
|
},
|
watch: {
|
filterText(val) {
|
this.$refs.tree.filter(val)
|
}
|
},
|
methods: {
|
filterNode(value, data) {
|
if (!value) return true
|
return data.label.indexOf(value) !== -1
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.standard-library-main{
|
width: 100%;
|
height: 100%;
|
// 页面中心内容区域
|
.content-main{
|
display: flex;
|
height: 100%;
|
min-height: calc(100vh - 88px);
|
padding: 15px;
|
>div{
|
padding: 20px;
|
background: #fff;
|
}
|
.library-bom{
|
flex: 2;
|
margin-right: 12px;
|
.el-tree {
|
margin-top: 12px;
|
::v-deep .el-tree-node__content{
|
height: 24px !important;
|
font-size: 14px;
|
display: inline-block !important;
|
padding: 2px;
|
color: #333;
|
}
|
::v-deep .el-tree-node__content:hover{
|
background: rgba(58,124,253,0.1) ;
|
// opacity: 0.31;
|
border-radius: 3px;
|
color: #333 !important;
|
}
|
::v-deep .el-tree-node:focus>.el-tree-node__content{
|
background: rgba(58,124,253,0.1) ;
|
// opacity: 0.31;
|
border-radius: 3px;
|
color: #333 !important;
|
}
|
}
|
}
|
.library-table{
|
flex: 8;
|
margin-left: 12px;
|
display: flex;
|
flex-direction: column;
|
|
.table-header{
|
display: flex;
|
justify-content: space-between;
|
.el-form-item{
|
margin-bottom: 30px !important;
|
}
|
}
|
.table-box{
|
flex: 1;
|
background: #fff;
|
// padding: 20px 20px 10px 20px;
|
display: flex;
|
flex-direction: column;
|
.el-table {
|
flex: 1;
|
}
|
>div:nth-child(2){
|
display: flex;
|
justify-content: end;
|
margin: 10px 0;
|
}
|
}
|
}
|
}
|
}
|
</style>
|