duhanyu
许宏杰 2 years ago
parent dbcd95edd0
commit 512685138d

@ -6,7 +6,7 @@ ENV = 'development'
# 若依管理系统/开发环境
# VUE_APP_BASE_API = 'https://vue.ruoyi.vip/prod-api'
VUE_APP_BASE_API = 'http://39.101.188.84:9034'
VUE_APP_BASE_API = 'http://192.168.0.108:9034'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

@ -3,7 +3,7 @@ import request from "@/utils/request";
// 查询证书管理列表
export function listCertificates(query) {
return request({
url: "/system/certificates/list",
url: "/zhiyuanzhe/certificates/list",
method: "get",
params: query,
});
@ -12,7 +12,7 @@ export function listCertificates(query) {
// 查询证书管理详细
export function getCertificates(id) {
return request({
url: "/system/certificates/" + id,
url: "/zhiyuanzhe/certificates/" + id,
method: "get",
});
}
@ -20,7 +20,7 @@ export function getCertificates(id) {
// 新增证书管理
export function addCertificates(data) {
return request({
url: "/system/certificates",
url: "/zhiyuanzhe/certificates",
method: "post",
data: data,
});
@ -29,7 +29,7 @@ export function addCertificates(data) {
// 修改证书管理
export function updateCertificates(data) {
return request({
url: "/system/certificates",
url: "/zhiyuanzhe/certificates",
method: "put",
data: data,
});
@ -38,7 +38,7 @@ export function updateCertificates(data) {
// 删除证书管理
export function delCertificates(id) {
return request({
url: "/system/certificates/" + id,
url: "/zhiyuanzhe/certificates/" + id,
method: "delete",
});
}

@ -19,16 +19,16 @@ export default {
props: {
src: {
type: String,
default: ""
default: "",
},
width: {
type: [Number, String],
default: ""
default: "",
},
height: {
type: [Number, String],
default: ""
}
default: "",
},
},
computed: {
realSrc() {
@ -47,7 +47,7 @@ export default {
}
let real_src_list = this.src.split(",");
let srcList = [];
real_src_list.forEach(item => {
real_src_list.forEach((item) => {
if (isExternal(item)) {
return srcList.push(item);
}
@ -60,14 +60,14 @@ export default {
},
realHeight() {
return typeof this.height == "string" ? this.height : `${this.height}px`;
}
},
},
};
</script>
<style lang="scss" scoped>
.el-image {
border-radius: 5px;
// border-radius: 5px;
background-color: #ebeef5;
box-shadow: 0 0 5px 1px #ccc;
::v-deep .el-image__inner {

@ -15,7 +15,7 @@
:headers="headers"
:file-list="fileList"
:on-preview="handlePictureCardPreview"
:class="{hide: this.fileList.length >= this.limit}"
:class="{ hide: this.fileList.length >= this.limit }"
>
<i class="el-icon-plus"></i>
</el-upload>
@ -23,8 +23,12 @@
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip">
请上传
<template v-if="fileSize"> <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
<template v-if="fileType"> <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
<template v-if="fileSize">
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
</template>
<template v-if="fileType">
格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
</template>
的文件
</div>
@ -66,8 +70,8 @@ export default {
//
isShowTip: {
type: Boolean,
default: true
}
default: true,
},
},
data() {
return {
@ -81,7 +85,7 @@ export default {
headers: {
Authorization: "Bearer " + getToken(),
},
fileList: []
fileList: [],
};
},
watch: {
@ -89,9 +93,9 @@ export default {
handler(val) {
if (val) {
//
const list = Array.isArray(val) ? val : this.value.split(',');
const list = Array.isArray(val) ? val : this.value.split(",");
//
this.fileList = list.map(item => {
this.fileList = list.map((item) => {
if (typeof item === "string") {
if (item.indexOf(this.baseUrl) === -1) {
item = { name: this.baseUrl + item, url: this.baseUrl + item };
@ -107,8 +111,8 @@ export default {
}
},
deep: true,
immediate: true
}
immediate: true,
},
},
computed: {
//
@ -125,7 +129,7 @@ export default {
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
isImg = this.fileType.some(type => {
isImg = this.fileType.some((type) => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
@ -135,7 +139,9 @@ export default {
}
if (!isImg) {
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
this.$modal.msgError(
`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`
);
return false;
}
if (this.fileSize) {
@ -167,8 +173,8 @@ export default {
},
//
handleDelete(file) {
const findex = this.fileList.map(f => f.name).indexOf(file.name);
if(findex > -1) {
const findex = this.fileList.map((f) => f.name).indexOf(file.name);
if (findex > -1) {
this.fileList.splice(findex, 1);
this.$emit("input", this.listToString(this.fileList));
}
@ -202,9 +208,9 @@ export default {
strs += list[i].url.replace(this.baseUrl, "") + separator;
}
}
return strs != '' ? strs.substr(0, strs.length - 1) : '';
}
}
return strs != "" ? strs.substr(0, strs.length - 1) : "";
},
},
};
</script>
<style scoped lang="scss">
@ -218,9 +224,9 @@ export default {
transition: all 0s;
}
::v-deep .el-list-enter, .el-list-leave-active {
::v-deep .el-list-enter,
.el-list-leave-active {
opacity: 0;
transform: translateY(0);
}
</style>

@ -30,10 +30,11 @@
</div>
<div class="book-main" :style="{ height: tableHeigth + 'px' }">
<div v-for="(item, index) in 10" :key="index">
<div class="child-box" v-for="item in certificatesList" :key="item.id">
<div>
<el-image
style="width: 100%; height: 87%"
src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
:src="baseUrl + item.cover"
fit="cover"
></el-image>
<div
@ -43,7 +44,11 @@
<div>高级</div>
<div class="right-operate">
<div class="operate-item">
<el-button type="text" size="mini" style="color: #909399"
<el-button
type="text"
size="mini"
style="color: #909399"
@click="handleInfo(item)"
>查看</el-button
>
</div>
@ -52,7 +57,7 @@
type="text"
size="mini"
style="color: #e6a23c; margin: 0 10px"
@click="handleUpdate"
@click="handleUpdate(item)"
v-hasPermi="['system:certificates:edit']"
>修改</el-button
>
@ -63,7 +68,7 @@
type="text"
size="mini"
style="color: #f56c6c"
@click="handleDelete"
@click="handleDelete(item)"
>删除</el-button
>
</div>
@ -71,6 +76,7 @@
</div>
</div>
</div>
</div>
<pagination
v-show="total > 0"
:total="total"
@ -121,6 +127,39 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 详情 -->
<el-dialog :visible.sync="openInfo" width="950px" append-to-body>
<div slot="title" class="dialog-title">
<span class="title-line"></span>
详情
</div>
<div class="info-box">
<div>
<div class="info-item">
<div class="item-lable">证书名称:</div>
<div class="item-value">{{ form.name }}</div>
</div>
<div class="info-item">
<div class="item-lable">证书时间:</div>
<div class="item-value">{{ form.datetime }}</div>
</div>
<div class="info-item">
<div class="item-lable">服务时长:</div>
<div class="item-value">{{ form.serviceDuration }}</div>
</div>
<div class="info-item">
<div class="item-lable">证书内容:</div>
<div class="item-value">{{ form.content }}</div>
</div>
<div class="info-item">
<div class="item-lable">证书封面:</div>
<div class="item-value">
<ImagePreview :src="form.cover" width="269px" height="192px" />
</div>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
@ -135,18 +174,21 @@ import {
export default {
data() {
return {
baseUrl: process.env.VUE_APP_BASE_API,
certificatesList: [],
tableHeigth: 0,
queryParams: {},
loading: false,
tableData: [],
total: 1,
total: 0,
queryParams: {
pageNum: 0,
pageNum: 1,
pageSize: 10,
},
form: {},
rules: {},
open: false,
openInfo: false,
title: "",
fileList: [],
};
@ -156,11 +198,19 @@ export default {
this.$nextTick(() => {
this.tableHeigth =
this.$refs.main.offsetHeight - this.$refs.search.offsetHeight - 80;
console.log(this.$refs.search.offsetHeight, "高度");
this.getList();
});
},
methods: {
getList() {},
/** 查询证书管理列表 */
getList() {
this.loading = true;
listCertificates(this.queryParams).then((response) => {
this.certificatesList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
reset() {
this.form = {
@ -194,6 +244,15 @@ export default {
this.open = true;
this.title = "添加证书管理";
},
/**详情 */
handleInfo(row) {
this.reset();
const id = row.id;
getCertificates(id).then((response) => {
this.form = response.data;
this.openInfo = true;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
@ -264,12 +323,16 @@ export default {
}
}
.book-main {
box-sizing: border-box;
display: flex;
flex-wrap: wrap;
.child-box {
height: 50%;
width: 20%;
box-sizing: border-box;
padding: 10px;
& > div {
flex-basis: calc(20% - 20px);
margin: 10px; /* 设置元素之间的间距 */
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
box-shadow: 0px 3px 15px 0px rgba(184, 184, 184, 0.22);
@ -294,6 +357,7 @@ export default {
}
}
}
}
}
::v-deep .el-dialog__header {
background: #f7f5f5;
@ -313,4 +377,29 @@ export default {
}
}
}
//
.info-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.info-item {
display: flex;
// align-items: center;
margin-bottom: 20px;
.item-lable {
width: 80px;
font-size: 16px;
font-family: "Alibaba-PuHuiTi-Regular";
font-weight: 400;
color: #4c4949;
}
.item-value {
font-size: 16px;
font-family: "Alibaba-PuHuiTi-Regular";
font-weight: 400;
color: #807a7a;
}
}
}
</style>

Loading…
Cancel
Save