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 = '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 VUE_CLI_BABEL_TRANSPILE_MODULES = true

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

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

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

@ -30,42 +30,48 @@
</div> </div>
<div class="book-main" :style="{ height: tableHeigth + 'px' }"> <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">
<el-image <div>
style="width: 100%; height: 87%" <el-image
src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" style="width: 100%; height: 87%"
fit="cover" :src="baseUrl + item.cover"
></el-image> fit="cover"
<div ></el-image>
class="operate" <div
style="font-size: 14px; color: #4d4949; font-weight: bold" class="operate"
> style="font-size: 14px; color: #4d4949; font-weight: bold"
<div>高级</div> >
<div class="right-operate"> <div>高级</div>
<div class="operate-item"> <div class="right-operate">
<el-button type="text" size="mini" style="color: #909399" <div class="operate-item">
>查看</el-button <el-button
> type="text"
</div> size="mini"
<div class="operate-item"> style="color: #909399"
<el-button @click="handleInfo(item)"
type="text" >查看</el-button
size="mini" >
style="color: #e6a23c; margin: 0 10px" </div>
@click="handleUpdate" <div class="operate-item">
v-hasPermi="['system:certificates:edit']" <el-button
>修改</el-button type="text"
> size="mini"
</div> style="color: #e6a23c; margin: 0 10px"
<div class="operate-item"> @click="handleUpdate(item)"
<el-button v-hasPermi="['system:certificates:edit']"
v-hasPermi="['system:certificates:remove']" >修改</el-button
type="text" >
size="mini" </div>
style="color: #f56c6c" <div class="operate-item">
@click="handleDelete" <el-button
>删除</el-button v-hasPermi="['system:certificates:remove']"
> type="text"
size="mini"
style="color: #f56c6c"
@click="handleDelete(item)"
>删除</el-button
>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -121,6 +127,39 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </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> </div>
</template> </template>
@ -135,18 +174,21 @@ import {
export default { export default {
data() { data() {
return { return {
baseUrl: process.env.VUE_APP_BASE_API,
certificatesList: [],
tableHeigth: 0, tableHeigth: 0,
queryParams: {}, queryParams: {},
loading: false, loading: false,
tableData: [], tableData: [],
total: 1, total: 0,
queryParams: { queryParams: {
pageNum: 0, pageNum: 1,
pageSize: 10, pageSize: 10,
}, },
form: {}, form: {},
rules: {}, rules: {},
open: false, open: false,
openInfo: false,
title: "", title: "",
fileList: [], fileList: [],
}; };
@ -156,11 +198,19 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.tableHeigth = this.tableHeigth =
this.$refs.main.offsetHeight - this.$refs.search.offsetHeight - 80; this.$refs.main.offsetHeight - this.$refs.search.offsetHeight - 80;
console.log(this.$refs.search.offsetHeight, "高度"); this.getList();
}); });
}, },
methods: { methods: {
getList() {}, /** 查询证书管理列表 */
getList() {
this.loading = true;
listCertificates(this.queryParams).then((response) => {
this.certificatesList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// //
reset() { reset() {
this.form = { this.form = {
@ -194,6 +244,15 @@ export default {
this.open = true; this.open = true;
this.title = "添加证书管理"; this.title = "添加证书管理";
}, },
/**详情 */
handleInfo(row) {
this.reset();
const id = row.id;
getCertificates(id).then((response) => {
this.form = response.data;
this.openInfo = true;
});
},
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
@ -264,33 +323,38 @@ export default {
} }
} }
.book-main { .book-main {
box-sizing: border-box;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
& > div { .child-box {
flex-basis: calc(20% - 20px); height: 50%;
margin: 10px; /* 设置元素之间的间距 */ width: 20%;
display: flex; box-sizing: border-box;
flex-direction: column; padding: 10px;
box-shadow: 0px 3px 15px 0px rgba(184, 184, 184, 0.22); & > div {
border-radius: 10px; height: 100%;
overflow: hidden; width: 100%;
.operate {
flex: 1;
display: flex; display: flex;
align-items: center; flex-direction: column;
justify-content: space-between; box-shadow: 0px 3px 15px 0px rgba(184, 184, 184, 0.22);
padding: 0 10px; border-radius: 10px;
.right-operate { overflow: hidden;
.operate {
flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: space-between;
} padding: 0 10px;
.operate-item { .right-operate {
text-align: center; display: flex;
font-size: 14px; align-items: center;
color: #8a8585; justify-content: center;
cursor: pointer; }
.operate-item {
text-align: center;
font-size: 14px;
color: #8a8585;
cursor: pointer;
}
} }
} }
} }
@ -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> </style>

Loading…
Cancel
Save