1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<template>
<InnerView class="flex-col" style="overflow: hidden;">
<ScrollView>
<pub-table
:headers="headers"
:fetcher="fetcher"
:params="params"
:pagination="false"
ref="table"
>
</pub-table>
</ScrollView>
</InnerView>
</template>
<script>
import { mapState } from "vuex";
// import * as api from "@/api";
export default {
name: "enterpriseMaterialsMain",
meta: {
sort: 0,
title: "企业材料",
activeName: "enterpriseMaterials",
hidden: true,
keepAlive: true,
},
components: {},
data() {
return {
headers: [
{
field: "index",
fieldName: "序号",
type: "index",
},
{
field: "materialName",
fieldName: "材料名称",
},
{
field: "opdateTime",
fieldName: "上传时间",
},
{
field: "handle",
fieldName: "操作",
width: 136,
renderFun: (e) => this.renderBtns(e),
},
],
params: [
{
label: "材料名称",
key: "materialName",
placeholder: "请输入",
},
],
fetcher: async () => {
// console.log(this);
// console.log(params);
// let res = await api.publicEquipment.getBiogasDeviceInfoPage(params);
let res = {
total: this.testData.length,
data: this.testData,
};
return res;
},
};
},
computed: {
// import { mapState } from "vuex";
...mapState({
testData: (state) => state.tabledata.enterpriseMaterials,
}),
},
watch: {},
methods: {
renderBtns(e) {
let that = this;
return (
<div>
<el-button
onClick={() => that.openDetail(e.row)}
size="mini"
plain
type="primary"
>
详情
</el-button>
</div>
);
},
openDetail(row) {
this.$router.push(`/enterpriseMaterials/materiaDetail?id=${row.id}`);
},
},
};
</script>
<style lang="scss" scoped></style>