| | |
| | | <el-form ref="form" :model="tableList" :show-message="false" label-position="right"> |
| | | <el-table |
| | | ref="fromTable" |
| | | :border="isBorder" |
| | | :data="tableList.tableData" |
| | | :show-summary="showSummary.show" |
| | | :summary-method="getSummaries" |
| | |
| | | :label="item.label" |
| | | :width="item.width" |
| | | :min-width="item.min" |
| | | v-if="item.isShowColumn" |
| | | align="center" |
| | | > |
| | | <!-- 表头样式 --> |
| | |
| | | </el-table-column> |
| | | <slot name="tableButton" /> |
| | | </el-table> |
| | | <div class="styleBtn"> |
| | | <i @click="checkCol()" class="label">...</i> |
| | | <el-checkbox-group v-model="showcol" v-show="iscolopen" class="checkbox-group" @change="selectCheckBoxList"> |
| | | <el-checkbox v-for="item in tableList.allcol" :label="item" :key="item">{{ item }} </el-checkbox> |
| | | </el-checkbox-group> |
| | | </div> |
| | | </el-form> |
| | | <div v-if="!detailEnter" style="margin: 10px"> |
| | | <el-button size="small" type="primary" :disabled="!isOperate" @click="add">新增</el-button> |
| | |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | isBorder:{ |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | productTableList: { |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | tableData: [], // 接口返回数据 |
| | | isReturn: false, |
| | | allcol: [], |
| | | showcol: [], |
| | | tableColumn: [ |
| | | // table表单 |
| | | { label: "", prop: "", min: 200, tooltip: true } |
| | |
| | | infomation: {} |
| | | }, |
| | | productIndex: 0, |
| | | isRecalculate: true |
| | | isRecalculate: true, |
| | | iscolopen: false, |
| | | showcol: [] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getTableInfo() |
| | | }, |
| | | immediate: true |
| | | }, |
| | | "productTableList.showcol": { |
| | | handler(newVal) { |
| | | this.showcol = newVal |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | | checkCol() { |
| | | this.iscolopen = !this.iscolopen |
| | | }, |
| | | selectCheckBoxList(val) { |
| | | this.$emit("selTableCol", val) |
| | | }, |
| | | getTableInfo(){ |
| | | this.tableList = this.productTableList |
| | | if (this.tableList.tableData.length === 1 && this.tableList.tableData[0].name === "") { |
| | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .page-view { |
| | | position: relative; |
| | | .el-form-item { |
| | | margin-bottom: 0; |
| | | .custom-name { |
| | |
| | | // text-align: left; |
| | | text-align: center !important; |
| | | } |
| | | .styleBtn { |
| | | position: absolute; |
| | | width: 30px; |
| | | height: 36px; |
| | | // line-height: 26px; |
| | | // background: #06c062; |
| | | top: 0; |
| | | right: -6px; |
| | | z-index: 11; |
| | | .label { |
| | | position: absolute; |
| | | top: 6px; |
| | | font-size: 20px; |
| | | // line-height: 5px; |
| | | cursor: pointer; |
| | | color: #000; |
| | | transform: rotate(-90deg); |
| | | } |
| | | .checkbox-group { |
| | | width: 160px; |
| | | height: 300px; |
| | | overflow: auto; |
| | | display: flex; |
| | | flex-direction: column; |
| | | line-height: 25px; |
| | | background: #ffffff; |
| | | border-radius: 16px; |
| | | padding: 12px; |
| | | position: absolute; |
| | | right: 0; |
| | | top: 30px; |
| | | z-index: 99; |
| | | box-shadow: 0 0 2px 2px #f8f8f8; |
| | | } |
| | | } |
| | | } |
| | | </style> |