修改图片和视频接口

This commit is contained in:
闵宪瑞 2025-01-03 14:08:22 +08:00
parent 59566ffc61
commit 0af6c362b2
3 changed files with 106 additions and 54 deletions

View File

@ -2,10 +2,7 @@
ENV = 'development' ENV = 'development'
# base api # base api
VUE_APP_BASE_API = 'https://syy.xunyingcloud.cn' VUE_APP_BASE_API = 'https://0511syy.cn'
# VUE_APP_BASE_API = 'http://121.37.139.13:8080'
#VUE_APP_BASE_API = 'http://localhost:20010/'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled. # to control whether the babel-plugin-dynamic-import-node plugin is enabled.
# It only does one thing by converting all import() to require(). # It only does one thing by converting all import() to require().

View File

@ -2,5 +2,5 @@
ENV = 'production' ENV = 'production'
# base api # base api
VUE_APP_BASE_API = 'https://syy.xunyingcloud.cn' VUE_APP_BASE_API = 'https://0511syy.cn'

View File

@ -1,4 +1,4 @@
<template> <template>
<div> <div>
<el-row :gutter="30"> <el-row :gutter="30">
<el-col v-bind="grid"> <el-col v-bind="grid">
@ -34,12 +34,12 @@
<span <span
class="custom-tree-node-label" class="custom-tree-node-label"
:title="node.label" :title="node.label"
>{{ node.label }}</span >{{ node.label }}</span
> >
<span <span
v-if="data.space_property_name" v-if="data.space_property_name"
style="font-size: 11px; color: #3889b1" style="font-size: 11px; color: #3889b1"
>{{ data.name }}</span >{{ data.name }}</span
> >
</div> </div>
<span class="el-ic"> <span class="el-ic">
@ -51,7 +51,7 @@
<el-dropdown-item <el-dropdown-item
@click.native="onAdd(data.id)" @click.native="onAdd(data.id)"
v-if="checkPermi(['admin:category:save'])" v-if="checkPermi(['admin:category:save'])"
>添加分类</el-dropdown-item >添加分类</el-dropdown-item
> >
<el-dropdown-item <el-dropdown-item
v-if=" v-if="
@ -59,7 +59,7 @@
checkPermi(['admin:category:update']) checkPermi(['admin:category:update'])
" "
@click.native="onEdit(data.id)" @click.native="onEdit(data.id)"
>编辑分类</el-dropdown-item >编辑分类</el-dropdown-item
> >
<el-dropdown-item <el-dropdown-item
v-if=" v-if="
@ -67,7 +67,7 @@
checkPermi(['admin:category:delete']) checkPermi(['admin:category:delete'])
" "
@click.native="handleDelete(data.id)" @click.native="handleDelete(data.id)"
>删除分类</el-dropdown-item >删除分类</el-dropdown-item
> >
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
@ -88,7 +88,8 @@
type="primary" type="primary"
class="mr15 mb20" class="mr15 mb20"
@click="checkPics" @click="checkPics"
>使用选中图片</el-button >使用选中图片
</el-button
> >
<div class="mb20"> <div class="mb20">
<el-tooltip <el-tooltip
@ -140,9 +141,7 @@
:show-file-list="false" :show-file-list="false"
multiple multiple
> >
<el-button class="mr10" type="primary" v-if="pictureType" <el-button class="mr10" type="primary" v-if="pictureType">上传{{typeDate =='pic'?'图片':'视频'}}</el-button>
>上传图片</el-button
>
</el-upload> </el-upload>
<div> <div>
<el-button <el-button
@ -150,7 +149,8 @@
type="danger" type="danger"
@click.stop="editPicList('图片')" @click.stop="editPicList('图片')"
v-if="pictureType" v-if="pictureType"
>删除图片</el-button >删除{{typeDate =='pic'?'图片':'视频'}}
</el-button
> >
</div> </div>
<el-select <el-select
@ -179,9 +179,9 @@
</el-option> </el-option>
</el-select> </el-select>
<div class="abs_video"> <div class="abs_video">
<el-radio-group v-model="typeDate" @change="radioChange" size="small"> <el-radio-group v-model="typeDate" @change="radioChange" size="small">
<el-radio-button label="pic">图片</el-radio-button> <el-radio-button label="pic">图片</el-radio-button>
<el-radio-button label="video">视频</el-radio-button> <el-radio-button label="video">视频</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
</div> </div>
@ -202,7 +202,7 @@
:key="index" :key="index"
class="gridPic" class="gridPic"
> >
<span class="num_badge" v-if="item.num > 0">{{item.num}}</span> <span class="num_badge" v-if="item.num > 0">{{ item.num }}</span>
<img <img
style="object-fit: contain;" style="object-fit: contain;"
v-lazy="item.sattDir ? item.sattDir : localImg" v-lazy="item.sattDir ? item.sattDir : localImg"
@ -278,14 +278,15 @@
}, },
]" ]"
> >
<el-input v-model="editPram.name" placeholder="分类名称" /> <el-input v-model="editPram.name" placeholder="分类名称"/>
</el-form-item> </el-form-item>
<el-form-item label="排序"> <el-form-item label="排序">
<el-input-number v-model="editPram.sort" /> <el-input-number v-model="editPram.sort"/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handlerSubmit('editPram')" <el-button type="primary" @click="handlerSubmit('editPram')"
>确定</el-button >确定
</el-button
> >
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -306,10 +307,10 @@ import {
fileImageApi, fileImageApi,
fileListApi, fileListApi,
fileDeleteApi, fileDeleteApi,
attachmentMoveApi, attachmentMoveApi, fileFileApi,
} from "@/api/systemSetting"; } from "@/api/systemSetting";
import { getToken } from "@/utils/auth"; import {getToken} from "@/utils/auth";
import { checkPermi } from "@/utils/permission"; // import {checkPermi} from "@/utils/permission"; //
export default { export default {
name: "Upload", name: "Upload",
props: { props: {
@ -388,7 +389,7 @@ export default {
attType: "jpg,jpeg,gif,png,bmp,PNG,JPG", attType: "jpg,jpeg,gif,png,bmp,PNG,JPG",
}, },
classifyId: 0, classifyId: 0,
myHeaders: { "X-Token": getToken() }, myHeaders: {"X-Token": getToken()},
treeFrom: { treeFrom: {
status: -1, status: -1,
type: 2, type: 2,
@ -410,7 +411,7 @@ export default {
}, },
localImg: "", localImg: "",
videoStatus: false, videoStatus: false,
typeDate:"pic", typeDate: "pic",
}; };
}, },
watch: { watch: {
@ -460,15 +461,15 @@ export default {
if (this.editPram.pid == 10000) this.editPram.pid = 0; if (this.editPram.pid == 10000) this.editPram.pid = 0;
this.bizTitle === "添加分类" this.bizTitle === "添加分类"
? addCategroy(this.editPram).then((data) => { ? addCategroy(this.editPram).then((data) => {
this.$message.success("创建成功"); this.$message.success("创建成功");
this.visible = false; this.visible = false;
this.getList(); this.getList();
}) })
: updateCategroy(this.editPram).then((data) => { : updateCategroy(this.editPram).then((data) => {
this.$message.success("编辑成功"); this.$message.success("编辑成功");
this.visible = false; this.visible = false;
this.getList(); this.getList();
}); });
} else { } else {
return false; return false;
} }
@ -524,7 +525,7 @@ export default {
if (id === 10000) id = 0; if (id === 10000) id = 0;
this.bizTitle = "编辑分类"; this.bizTitle = "编辑分类";
this.loading = true; this.loading = true;
infoCategroy({ id: id }).then((res) => { infoCategroy({id: id}).then((res) => {
this.editPram = res; this.editPram = res;
this.loading = false; this.loading = false;
}); });
@ -534,7 +535,7 @@ export default {
handleDelete(id) { handleDelete(id) {
if (id === 10000) id = 0; if (id === 10000) id = 0;
this.$modalSure().then(() => { this.$modalSure().then(() => {
deleteCategroy({ id: id }).then(() => { deleteCategroy({id: id}).then(() => {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.getList(); this.getList();
}); });
@ -559,16 +560,28 @@ export default {
spinner: "el-icon-loading", spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)", background: "rgba(0, 0, 0, 0.7)",
}); });
fileImageApi(formData, data)
.then((res) => { if (this.typeDate =='pic'){
loading.close(); fileImageApi(formData, data)
this.$message.success("上传成功"); .then((res) => {
this.tableData.page = 1; loading.close();
this.getFileList(); this.$message.success("上传成功");
}) this.tableData.page = 1;
.catch((res) => { this.getFileList();
}).catch((res) => {
loading.close(); loading.close();
}); });
}else {
fileFileApi(formData, data)
.then((res) => {
loading.close();
this.$message.success("上传成功");
this.tableData.page = 1;
this.getFileList();
}).catch((res) => {
loading.close();
});
}
}, },
// //
getFileList() { getFileList() {
@ -707,10 +720,10 @@ export default {
this.getFileList(); this.getFileList();
} }
}, },
radioChange(val){ radioChange(val) {
if(val === 'video'){ if (val === 'video') {
this.videoChange(true) this.videoChange(true)
}else{ } else {
this.videoChange(false) this.videoChange(false)
} }
} }
@ -729,26 +742,32 @@ export default {
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
} }
.temp { .temp {
height: 0; height: 0;
margin-bottom: 0; margin-bottom: 0;
border: none; border: none;
padding: 0; padding: 0;
} }
.selectTreeClass { .selectTreeClass {
background: #d5e8fc; background: #d5e8fc;
} }
.treeBox { .treeBox {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.upload-demo { .upload-demo {
display: inline-block !important; display: inline-block !important;
float: left; float: left;
} }
.tree_w { .tree_w {
padding: 20px 30px; padding: 20px 30px;
} }
.custom-tree-node { .custom-tree-node {
flex: 1; flex: 1;
display: flex; display: flex;
@ -758,6 +777,7 @@ export default {
padding-right: 8px; padding-right: 8px;
color: #4386c6; color: #4386c6;
} }
.custom-tree-node-label { .custom-tree-node-label {
display: block; display: block;
width: 125px; width: 125px;
@ -765,97 +785,119 @@ export default {
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.el-ic { .el-ic {
display: none; display: none;
i, i,
span { span {
/*padding: 0 14px;*/ /*padding: 0 14px;*/
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
} }
.svg-icon { .svg-icon {
color: #4386c6; color: #4386c6;
} }
} }
.el-tree-node__content { .el-tree-node__content {
height: 38px; height: 38px;
} }
.el-tree-node__expand-icon { .el-tree-node__expand-icon {
color: #428bca; color: #428bca;
/*padding: 10px 10px 0px 10px !important;*/ /*padding: 10px 10px 0px 10px !important;*/
} }
.el-tree-node__content:hover .el-ic { .el-tree-node__content:hover .el-ic {
color: #428bca !important; color: #428bca !important;
display: inline-block; display: inline-block;
} }
.el-tree-node__content:hover { .el-tree-node__content:hover {
font-weight: bold; font-weight: bold;
} }
.el-tree--highlight-current .el-tree--highlight-current
.el-tree-node.is-current .el-tree-node.is-current
> .el-tree-node__content > .el-tree-node__content
:hover { :hover {
.el-tree-node__expand-icon.is-leaf { .el-tree-node__expand-icon.is-leaf {
color: transparent; color: transparent;
cursor: default; cursor: default;
} }
/*background-color: #3998d9;*/ /*background-color: #3998d9;*/
.custom-tree-node { .custom-tree-node {
font-weight: bold; font-weight: bold;
} }
.el-tree-node__expand-icon { .el-tree-node__expand-icon {
font-weight: bold; font-weight: bold;
} }
} }
.el-dialog__body { .el-dialog__body {
.upload-container .image-preview .image-preview-wrapper img { .upload-container .image-preview .image-preview-wrapper img {
height: 100px; height: 100px;
} }
.el-dialog .el-collapse-item__wrap { .el-dialog .el-collapse-item__wrap {
padding-top: 0px; padding-top: 0px;
} }
.spatial_img { .spatial_img {
.el-collapse-item__wrap { .el-collapse-item__wrap {
margin-bottom: 0; margin-bottom: 0;
padding-top: 0px; padding-top: 0px;
} }
} }
.upload-container .image-preview .image-preview-wrapper { .upload-container .image-preview .image-preview-wrapper {
width: 120px; width: 120px;
} }
.upload-container .image-preview .image-preview-action { .upload-container .image-preview .image-preview-action {
line-height: 100px; line-height: 100px;
height: 100px; height: 100px;
} }
} }
.trees-coadd { .trees-coadd {
width: 100%; width: 100%;
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
.scollhide { .scollhide {
overflow-x: hidden; overflow-x: hidden;
overflow-y: scroll; overflow-y: scroll;
padding: 10px 0 10px 0; padding: 10px 0 10px 0;
box-sizing: border-box; box-sizing: border-box;
.trees { .trees {
width: 100%; width: 100%;
} }
} }
.scollhide::-webkit-scrollbar { .scollhide::-webkit-scrollbar {
display: none; display: none;
} }
} }
.conters { .conters {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
/*max-height: 296px;*/ /*max-height: 296px;*/
overflow: auto; overflow: auto;
} }
.conters:after { .conters:after {
content: ""; content: "";
width: 410px !important; width: 410px !important;
} }
.gridPic { .gridPic {
margin-right: 15px; margin-right: 15px;
margin-bottom: 10px; margin-bottom: 10px;
@ -863,16 +905,19 @@ export default {
height: 110px; height: 110px;
position: relative; position: relative;
cursor: pointer; cursor: pointer;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: block; display: block;
} }
video { video {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: block; display: block;
} }
.num_badge { .num_badge {
position: absolute; position: absolute;
bottom: 6px; bottom: 6px;
@ -888,31 +933,38 @@ export default {
line-height: 20px; line-height: 20px;
} }
} }
.conter { .conter {
width: 99%; width: 99%;
height: 100%; height: 100%;
.bnt { .bnt {
width: 100%; width: 100%;
padding: 0 13px 10px 7px; padding: 0 13px 10px 7px;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
} }
.pictrueList { .pictrueList {
/*padding-left: 15px;*/ /*padding-left: 15px;*/
width: 100%; width: 100%;
el-image { el-image {
width: 100%; width: 100%;
border: 2px solid #fff; border: 2px solid #fff;
} }
.on { .on {
border: 2px solid #1890FF; border: 2px solid #1890FF;
} }
} }
.el-image { .el-image {
width: 110px; width: 110px;
height: 110px; height: 110px;
cursor: pointer; cursor: pointer;
} }
.imagesNo { .imagesNo {
width: 100%; width: 100%;
display: flex; display: flex;
@ -920,6 +972,7 @@ export default {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
margin: 65px 0; margin: 65px 0;
.imagesNo_sp { .imagesNo_sp {
font-size: 13px; font-size: 13px;
color: #dbdbdb; color: #dbdbdb;
@ -927,10 +980,12 @@ export default {
} }
} }
} }
.relative{
.relative {
position: relative; position: relative;
} }
.abs_video{
.abs_video {
position: absolute; position: absolute;
right: 20px; right: 20px;
top: 0; top: 0;