权限修复

xuhongjie
许宏杰 1 year ago
parent 5758e256ad
commit 9c77ad1ee0

@ -0,0 +1,136 @@
<template>
<div class="app-container" ref="main">
<div class="search" ref="search">
<MyInput v-model="queryParams.name" @clickSearch="handleSearch" />
</div>
<ul class="book-main" :style="listStyle">
<li
v-for="(item, index) in certificatesList"
:key="item.id"
:style="{ marginBottom: isLastRow(index) ? '0px' : '' }"
>
<div class="integral-num">积分50</div>
<el-image
style="width: 100%; height: 87%"
:src="baseUrl + item.cover"
fit="fill"
:preview-src-list="[`${baseUrl + item.cover}`]"
>
</el-image>
<div class="operate">
<div class="integral">
{{ item.name }}
</div>
<div class="operate-child">
<div class="exchange-btn" @click="conversion(item)"> </div>
</div>
</div>
</li>
</ul>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listCertificates } from "@/api/volunteer/gxhzs/gxhzsgl/index.js";
export default {
data() {
return {
listStyle: {
height: 0,
overflowY: "auto",
},
baseUrl: process.env.VUE_APP_BASE_API,
certificatesList: [],
loading: false,
tableData: [],
total: 0,
queryParams: {
name: undefined,
pageNum: 1,
pageSize: 10,
},
form: {},
rules: {},
};
},
created() {
// //
this.$nextTick(() => {
this.listStyle.height =
this.$refs.main.offsetHeight -
40 -
this.$refs.search.offsetHeight -
42 +
"px";
this.getList();
});
},
methods: {
isLastRow(index) {
const rowCount = Math.ceil(this.certificatesList.length / 5);
const row = Math.floor(index / 5);
return row === rowCount - 1;
},
/**兑换 */
conversion(item) {
console.log(item);
},
/**搜索 */
handleSearch(keyWord) {
this.queryParams = {
name: keyWord,
pageNum: 1,
pageSize: 10,
};
this.getList();
},
/** 查询证书管理列表 */
getList() {
this.loading = true;
listCertificates(this.queryParams).then((response) => {
this.certificatesList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
reset() {
this.form = {
id: null,
name: null,
type: null,
cover: null,
content: null,
datetime: null,
serviceDuration: null,
createId: null,
createBy: null,
createTime: null,
updateId: null,
updateBy: null,
updateTime: null,
remark: null,
userId: null,
deptId: null,
};
this.resetForm("form");
},
//
cancel() {
this.open = false;
this.reset();
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/styles/myTable.scss";
</style>

@ -2,13 +2,7 @@
<div class="app-container" ref="main">
<div ref="search" class="search">
<MyInput v-model="queryParams.name" @clickSearch="handleSearch" />
<el-button
v-hasPermi="['system:certificates:add']"
type="primary"
size="small"
@click="handleAdd"
>新增</el-button
>
<el-button type="primary" size="small" @click="handleAdd"></el-button>
</div>
<ul class="book-main" :style="listStyle">
@ -42,11 +36,9 @@
size="mini"
style="color: #e6a23c; margin: 0 10px"
@click="handleUpdate(item)"
v-hasPermi="['system:certificates:edit']"
>修改</el-button
>
<el-button
v-hasPermi="['system:certificates:remove']"
type="text"
size="mini"
style="color: #f56c6c; margin: 0"

Loading…
Cancel
Save