123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <template>
- <basic-container class="list">
- <div class="flexBetween">
- <el-button
- type="primary"
- size="mini"
- class="el-icon-plus"
- @click="pushRouter()"
- >新增</el-button>
- <el-select
- v-model="value"
- filterable
- placeholder="请选择"
- @change="projectChange"
- >
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.projectName"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </div>
- <el-table
- class="martop20"
- :data="tableData"
- header-color='red'
- style="width: 100%"
- >
- <el-table-column
- type="index"
- label="序号"
- width="180"
- >
- </el-table-column>
- <el-table-column
- prop="name"
- label="证书所有者"
- width="180"
- >
- </el-table-column>
- <el-table-column
- prop="address"
- label="证书ID"
- >
- </el-table-column>
- <el-table-column
- prop="address"
- label="证书类型"
- >
- </el-table-column>
- <el-table-column
- prop="address"
- label="注册"
- >
- <template slot-scope="scope">
- <el-button
- type="text"
- @click="register(scope.row)"
- >注册</el-button>
- <el-button
- type="text"
- disabled
- >已注册</el-button>
- </template>
- </el-table-column>
- <el-table-column
- prop="address"
- label="操作"
- >
- <template slot-scope="scope">
- <el-button type="text">编辑</el-button>
- <el-button
- type="text"
- @click="deleteList(scope.row)"
- style="color:rgba(240, 99, 10, 1);"
- >删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- style="float:right"
- background
- class="martop20 marbottom20"
- layout="prev, pager, next"
- :total="total"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page.sync="pageindex"
- :page-size="pagesize"
- >
- </el-pagination>
- </basic-container>
- </template>
- <script>
- import { queryProjectList, listpage, goRegister } from "@/api/certificate/list";
- export default {
- data () {
- return {
- value: '',
- options: [],
- tableData: [{}],
- total: 0,
- pageindex: 1,
- pagesize: 20,
- }
- },
- methods: {
- //#region 页码
- handleSizeChange (val) {
- this.pagesize = val
- this.listpage()
- },
- handleCurrentChange (val) {
- this.pageindex = val
- this.listpage()
- },
- //#endregion
- //#region 列表接口
- projectChange () {
- this.listpage()
- },
- register () {//注册按钮
- },
- deleteList () {//删除按钮
- },
- async queryProjectList () {//获取所有项目
- const { data: res } = await queryProjectList()
- console.log(res);
- if (res.code == 200) {
- this.options = res.data
- }
- },
- async listpage () {//分页获取证书列表数据
- const { data: res } = await listpage({
- current: this.pageindex,
- size: this.pagesize,
- projectId: this.value,
- })
- console.log(res);
- if (res.code == 200) {
- this.tableData = res.data.records
- this.total = res.data.total
- }
- },
- async goRegister () {//注册
- const { data: res } = await goRegister({ id: '' })
- },
- //#endregion
- },
- created () {
- // this.queryProjectList()
- this.listpage()
- },
- }
- </script>
- <style lang="scss" scoped>
- </style>
|