From 538cb677c7cd304bc8a348c261c74694a06ec8e6 Mon Sep 17 00:00:00 2001
From: lxp <1928192722@qq.com>
Date: 星期六, 15 三月 2025 16:59:44 +0800
Subject: [PATCH] 统计图表 、 任务展示代码搬迁
---
src/components/Table/lims-table.vue | 38 ++++++++++++++++++++++++++------------
1 files changed, 26 insertions(+), 12 deletions(-)
diff --git a/src/components/Table/lims-table.vue b/src/components/Table/lims-table.vue
index 3f88767..74628ad 100644
--- a/src/components/Table/lims-table.vue
+++ b/src/components/Table/lims-table.vue
@@ -1,7 +1,8 @@
<template>
<div>
<!-- 琛ㄦ牸 -->
- <el-table ref="multipleTable" v-loading="tableLoading" :border="border" :data="tableData"
+ <el-table ref="multipleTable" v-loading="tableLoading" element-loading-text="鍔犺浇涓�..."
+ element-loading-spinner="el-icon-loading" :border="border" :data="tableData"
:header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" :height="height"
:highlight-current-row="highlightCurrentRow" :row-class-name="rowClassName" :row-style="rowStyle"
:row-key="rowKey" :span-method="spanMethod" :stripe="stripe" style="width: 100%" tooltip-effect="dark"
@@ -72,16 +73,13 @@
@click="o.clickFun(scope.row)" :key="key">
{{ o.name }}
</el-button>
- <el-upload :action="javaApi +
- o.url +
- '?id=' +
- (o.uploadIdFun ? o.uploadIdFun(scope.row) : scope.row.id)
- " size="mini" ref="upload" :multiple="o.multiple ? o.multiple : false" :limit="1"
+ <el-upload :action="javaApi + o.url" size="mini" ref="upload" :multiple="o.multiple ? o.multiple : false"
:disabled="o.disabled ? o.disabled(scope.row) : false" :accept="o.accept
? o.accept
: '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'
" v-if="o.type == 'upload' && o.url" style="display: inline-block; width: 50px"
- v-show="o.showHide ? o.showHide(scope.row) : true" :headers="uploadHeader" :on-error="onError"
+ :data="o.data ? o.data(scope.row) : {}" :before-upload="o.beforeUpload ? o.beforeUpload(scope.row) : () => true
+ " v-show="o.showHide ? o.showHide(scope.row) : true" :headers="uploadHeader" :on-error="onError"
:on-exceed="onExceed" :on-success="handleSuccessUp" :show-file-list="false" :key="key">
<el-button :size="o.size ? o.size : 'small'" type="text"
:disabled="o.disabled ? o.disabled(scope.row) : false">{{ o.name }}</el-button>
@@ -193,7 +191,7 @@
props: {
isSelection: {
type: Boolean,
- default: false,
+ default: undefined,
},
height: {
type: String,
@@ -261,7 +259,7 @@
},
rowKey: {
type: String,
- default: undefined,
+ default: "id",
},
page: {
type: Object,
@@ -278,16 +276,30 @@
data() {
return {
spanList: [],
- btnWidth: '120px'
+ btnWidth: "120px",
};
+ },
+ watch: {
+ // column(val) {
+ // this.doLayout();
+ // },
+ },
+ updated() {
+ this.$nextTick(() => {
+ this.$refs.multipleTable.doLayout();
+ });
},
mounted() {
this.calculateSpanInfo();
},
methods: {
+ doLayout() {
+ this.$nextTick(() => {
+ this.$refs.multipleTable && this.$refs.multipleTable.doLayout();
+ });
+ },
getWidth(row, row0) {
let count = 0;
- console.log(2222, row)
row.forEach((a) => {
if (a.showHide !== undefined && a.showHide(row0)) {
count += a.name.length;
@@ -295,7 +307,7 @@
count += a.name.length;
}
});
- this.btnWidth = count * 15 + 70 + "px"
+ this.btnWidth = count * 15 + 70 + "px";
return count * 15 + 70 + "px";
},
iconFn(row) {
@@ -335,6 +347,7 @@
this.$message.success("涓婁紶鎴愬姛");
}
}
+ this.$refs.upload.clearFiles();
},
onError(err, file, fileList) {
this.$message.error("涓婁紶澶辫触");
@@ -356,6 +369,7 @@
if (!linkEvent) {
return this.$message.warning("璇烽厤缃甽ingk浜嬩欢");
}
+ console.log(linkEvent);
linkEvent.vueComponent[linkEvent.method](row);
},
// 鍚堝苟鍗曞厓鏍�
--
Gitblit v1.9.3