author.vue
4.16 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<template>
<div class="contentBox">
<div class="content">
<div class="headerbox">
<span class="addbox">
<el-button type="primary" @click="addAuthor">添加授权</el-button>
</span>
</div>
<div class="mt10">
<el-table
height="574"
:data="tableData"
stripe
border
style="width: 100%"
>
<el-table-column
type="index"
align="center"
label="#"
width="40"
></el-table-column>
<el-table-column align="center" prop="code_unid" label="模板名称">
</el-table-column>
<el-table-column prop="code" align="center" label="授权路数">
</el-table-column>
<el-table-column align="center" prop="name" label="已使用路数">
</el-table-column>
<el-table-column align="center" prop="name" label="备注">
</el-table-column>
<el-table-column align="center" prop="operation" label="操作">
<template slot-scope="scope">
<el-tooltip
content="详情"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<span
class="iconfont el-icon-info"
@click="showDetail(scope.$index, scope.row)"
></span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<div style="margin-top: 28px;">
<el-pagination
style="float: right;"
background
prev-text="上一页"
next-text="下一页"
:page-sizes="[20, 30, 50, 100, 200]"
layout="prev, pager, next,sizes"
:current-page="page"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:total="total"
>
</el-pagination>
<div style="clear: both;"></div>
</div>
</div>
</div>
<el-dialog title="上传授权文件" :visible.sync="detailVisible" width="400px">
<el-upload
class="upload-demo"
ref="upload"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList"
:auto-upload="false"
>
<el-button slot="trigger" size="small" type="primary"
>选取文件</el-button
>
<el-button
style="margin-left: 10px;"
size="small"
type="success"
@click="submitUpload"
>上传到服务器</el-button
>
<div slot="tip" class="el-upload__tip">
只能上传jpg/png文件,且不超过500kb
</div>
</el-upload>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="detailVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="saveCode"
>确 定</el-button
>
</span>
</el-dialog>
<div>
<authordetail ref="detail"></authordetail>
</div>
</div>
</template>
<script>
import authordetail from "./authorDetail";
export default {
data() {
return {
detailData: [],
total: 0,
page: 1,
curCateUnid: "",
pageSize: 20,
tableData: [],
catesData: [],
selectDevs: "",
detailVisible: false,
codeStatus: 0,
codeData: {}
};
},
components: {
authordetail
},
created() {
},
methods: {
submitUpload() {
this.$refs.upload.submit();
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
showDetail(index, row) {
this.$refs.detail.initahthor(row);
},
addAuthor() {
this.codeStatus = 0;
this.detailVisible = true;
},
handleSizeChange(val) {
this.pageSize = val;
},
handleCurrentChange(val) {
this.page = val;
}
}
};
</script>
<style lang="scss" scoped>
.headerbox {
overflow: hidden;
}
.addbox {
float: right;
margin-right: 10px;
}
</style>