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 {

@ -23,8 +23,12 @@
<!-- 上传提示 --> <!-- 上传提示 -->
<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>
@ -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,9 +93,9 @@ 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 };
@ -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,7 +173,7 @@ 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,9 +208,9 @@ 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">
@ -218,9 +224,9 @@ export default {
transition: all 0s; transition: all 0s;
} }
::v-deep .el-list-enter, .el-list-leave-active { ::v-deep .el-list-enter,
.el-list-leave-active {
opacity: 0; opacity: 0;
transform: translateY(0); transform: translateY(0);
} }
</style> </style>

@ -30,10 +30,11 @@
</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">
<div>
<el-image <el-image
style="width: 100%; height: 87%" style="width: 100%; height: 87%"
src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" :src="baseUrl + item.cover"
fit="cover" fit="cover"
></el-image> ></el-image>
<div <div
@ -43,7 +44,11 @@
<div>高级</div> <div>高级</div>
<div class="right-operate"> <div class="right-operate">
<div class="operate-item"> <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 >查看</el-button
> >
</div> </div>
@ -52,7 +57,7 @@
type="text" type="text"
size="mini" size="mini"
style="color: #e6a23c; margin: 0 10px" style="color: #e6a23c; margin: 0 10px"
@click="handleUpdate" @click="handleUpdate(item)"
v-hasPermi="['system:certificates:edit']" v-hasPermi="['system:certificates:edit']"
>修改</el-button >修改</el-button
> >
@ -63,7 +68,7 @@
type="text" type="text"
size="mini" size="mini"
style="color: #f56c6c" style="color: #f56c6c"
@click="handleDelete" @click="handleDelete(item)"
>删除</el-button >删除</el-button
> >
</div> </div>
@ -71,6 +76,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
:total="total" :total="total"
@ -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,12 +323,16 @@ export default {
} }
} }
.book-main { .book-main {
box-sizing: border-box;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
.child-box {
height: 50%;
width: 20%;
box-sizing: border-box;
padding: 10px;
& > div { & > div {
flex-basis: calc(20% - 20px); height: 100%;
margin: 10px; /* 设置元素之间的间距 */ width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
box-shadow: 0px 3px 15px 0px rgba(184, 184, 184, 0.22); box-shadow: 0px 3px 15px 0px rgba(184, 184, 184, 0.22);
@ -295,6 +358,7 @@ export default {
} }
} }
} }
}
::v-deep .el-dialog__header { ::v-deep .el-dialog__header {
background: #f7f5f5; background: #f7f5f5;
.dialog-title { .dialog-title {
@ -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