From 1cd0b6a91bda57e9f99fdbe2b5faff144d64a477 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期三, 27 三月 2024 09:32:20 +0800
Subject: [PATCH] 完成表格参数项参数值获取
---
src/components/tool/value-table.vue | 54 ++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 38 insertions(+), 16 deletions(-)
diff --git a/src/components/tool/value-table.vue b/src/components/tool/value-table.vue
index c8bce0f..fbd1c28 100644
--- a/src/components/tool/value-table.vue
+++ b/src/components/tool/value-table.vue
@@ -36,30 +36,30 @@
}
</style>
<style>
- .value-table .highlight-warning-row-border td {
+ /* .value-table .highlight-warning-row-border td {
border-top: 2px solid #ffcd29;
border-bottom: 2px solid #ffcd29;
- }
+ } */
.value-table .highlight-warning-row-border td:first-child {
- border-left: 2px solid #ffcd29;
+ border-left: 4px solid #ffcd29;
}
.value-table .highlight-warning-row-border td:last-child {
- border-right: 2px solid #ffcd29;
+ border-right: 4px solid #ffcd29;
}
- .value-table .highlight-danger-row-border td {
+ /* .value-table .highlight-danger-row-border td {
border-top: 2px solid red;
border-bottom: 2px solid red;
- }
+ } */
.value-table .highlight-danger-row-border td:first-child {
- border-left: 2px solid red;
+ border-left: 4px solid #f56c6c;
}
.value-table .highlight-danger-row-border td:last-child {
- border-right: 2px solid red;
+ border-right: 4px solid #f56c6c;
}
.value-table .el-upload {
@@ -73,11 +73,14 @@
<template>
<div class="value-table">
- <div class="table">
- <el-table ref="eltable" :data="tableData" style="width: 100%;" height="100%" tooltip-effect="dark" border
+ <div class="table" :style="data.isPage!=undefined&&data.isPage!=true?'height:100%':''">
+ <el-table ref="eltable" :data="tableData" style="width: 100%;" height="100%"
+ tooltip-effect="dark" border
@selection-change="selectChange" @select="select" v-loading="loading" @sort-change="sortChange"
@row-click="rowClick" :show-summary="data.countFleid!=undefined && data.countFleid.length > 0"
- :summary-method="getSummaries" :row-class-name="tableRowClassName">
+ :summary-method="getSummaries" :row-class-name="tableRowClassName"
+ :row-key="record=>record.id" :current-row-key="data.currentId"
+ highlight-current-row>
<el-table-column type="selection" width="65" v-if="data.showSelect" :key="Math.random()">
</el-table-column>
<el-table-column type="index" align="center" label="搴忓彿" width="70" v-if="data.isIndex" :key="Math.random()">
@@ -112,10 +115,10 @@
</el-table-column>
</el-table>
</div>
- <div class="page">
+ <div class="page" v-if="data.isPage==undefined||data.isPage">
<el-pagination @size-change="sizeChange" @current-change="currentChange" :current-page="page.current"
:page-sizes="[10, 20, 30, 50, 100]" :page-size="page.size" layout="total, sizes, prev, pager, next, jumper"
- :total="total">
+ :total="total" >
</el-pagination>
</div>
<el-dialog title="缂栬緫" :visible.sync="upDia" :width="data.row==1?'500px':500+data.row * 200 + 'px'">
@@ -231,6 +234,7 @@
import {
Page
} from 'iview';
+import { data } from 'jquery';
export default {
props: {
tableRowClassName: {
@@ -311,12 +315,14 @@
showSelect: false,
select: true,
row: 1,
+ isPage:true,//
do: [{
font: '鍒犻櫎',
type: 'text'
}],
type: [],
- uploadStr: ""
+ uploadStr: "",
+ currentId:'',//褰撳墠楂樹寒鐨処D
},
tableHead: [],
tableData: [],
@@ -340,6 +346,7 @@
uploadDia: false,
token: null,
fileList: [],
+ init: true
}
},
watch: {
@@ -355,7 +362,9 @@
mounted() {
this.data = this.componentData
this.dataCopy = this.HaveJson(this.componentData)
- this.selectList()
+ if(this.data.init===undefined||this.data.init===true){
+ this.selectList()
+ }
this.token = {
'token': sessionStorage.getItem('token')
}
@@ -367,6 +376,13 @@
} else {
this.multipleSelection = val[val.length - 1];
}
+ if(this.data.selectMethod!=undefined){
+ if(this.$parent.$el.className.indexOf('el-')==0){
+ this.$parent.$parent[this.data.selectMethod](val)
+ }else{
+ this.$parent[this.data.selectMethod](val)
+ }
+ }
},
select(val, row) {
if (!this.data.select) {
@@ -392,6 +408,12 @@
},
selectList() {
this.loading = true
+ if(this.data.isPage!=undefined&&this.data.isPage!=true){
+ this.page = {
+ current: -1,
+ size: -1,
+ }
+ }
this.$axios.post(this.url, {
page: this.page,
entity: this.data.entity
@@ -583,7 +605,7 @@
}
}
val.field.forEach(a => {
- if (JSON.stringify(this.upData[a]) == undefined) {
+ if (JSON.stringify(this.upData[a]) === undefined) {
this.upHead.push({
value: a.split('=')[0],
label: a.split('=')[1]
--
Gitblit v1.9.3