1
This commit is contained in:
parent
662eb19a09
commit
34f060c1a4
@ -34,6 +34,7 @@ function sendGetRequest(url, data) {
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function sendUploadRequest(url, data) {
|
||||
// 一个状态为resolve(包裹的是数据)
|
||||
// 或者状态为reject (包裹的是错误信息)
|
||||
@ -743,4 +744,50 @@ getIccid(data){
|
||||
code_getplant(data){
|
||||
return sendGetRequest(`/code/getplant`, data)
|
||||
},
|
||||
|
||||
//官网接口
|
||||
// 轮播图
|
||||
website_getows(data){
|
||||
return sendGetRequest(`/website/getowsManagement`, data)
|
||||
},
|
||||
website_addows(data){
|
||||
return sendPostRequest(`/website/addows`, data)
|
||||
},
|
||||
website_updateows(data){
|
||||
return sendPutRequest(`/website/updateows`, data)
|
||||
},
|
||||
website_delows(data){
|
||||
return sendDelRequest(`/website/delows`, data)
|
||||
},
|
||||
|
||||
//产品展示
|
||||
website_getowp(data){
|
||||
return sendGetRequest(`/website/getowp`, data)
|
||||
},
|
||||
website_getowpManagement(data){
|
||||
return sendGetRequest(`/website/getowpManagement`, data)
|
||||
},
|
||||
// 综合 产品/案例/新闻列表
|
||||
website_getowpabyowpidMan(data){
|
||||
return sendGetRequest(`/website/getowpabyowpidMan`, data)
|
||||
},
|
||||
website_addops(data){
|
||||
return sendPostRequest(`/website/addops`, data)
|
||||
},
|
||||
website_updateops(data){
|
||||
return sendPutRequest(`/website/updateops`, data)
|
||||
},
|
||||
website_delops(data){
|
||||
return sendDelRequest(`/website/delops`, data)
|
||||
},
|
||||
|
||||
//案例介绍
|
||||
website_getcaseintroduction(data){
|
||||
return sendGetRequest(`/website/getcaseintroduction`, data)
|
||||
},
|
||||
//管理官网页面上传图片
|
||||
websiteUploadImage(data) {
|
||||
return sendUploadRequest(`/website/uploadows`, data)
|
||||
},
|
||||
|
||||
};
|
||||
|
@ -20,6 +20,7 @@
|
||||
cursor: pointer;
|
||||
background: #0294E2;
|
||||
border: 3px solid #013769;
|
||||
color: #0077b1;
|
||||
}
|
||||
|
||||
.scroll::-webkit-scrollbar-thumb:hover, .el-dropdown-menu::-webkit-scrollbar-thumb:hover, .index .index-content > .left::-webkit-scrollbar-thumb:hover, .index .index-content > .right.right-page .page-content::-webkit-scrollbar-thumb:hover, .formula .page-content::-webkit-scrollbar-thumb:hover, .realTime::-webkit-scrollbar-thumb:hover, .realTime .page-content .realTime-bottom.weather .left-view-new::-webkit-scrollbar-thumb:hover, .history .page-content .el-table--scrollable-x .el-table__body-wrapper::-webkit-scrollbar-thumb:hover, .vrcode-model .el-dialog::-webkit-scrollbar-thumb:hover, .el-table .el-table__body-wrapper::-webkit-scrollbar-thumb:hover {
|
||||
@ -3292,6 +3293,34 @@ textarea {
|
||||
color: #92B1D0;
|
||||
}
|
||||
|
||||
.m-t-34 {
|
||||
margin-top: 34px;
|
||||
}
|
||||
|
||||
.manage-textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.manage-textarea .input-title {
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
color: #FFFFFF;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.manage-textarea textarea {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
height: 110px;
|
||||
background: rgba(0, 186, 255, 0.15);
|
||||
border: 2px solid rgba(0, 186, 255, 0.4);
|
||||
padding-left: 15px;
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.vrcode-input-sel {
|
||||
margin-right: 30px;
|
||||
margin-bottom: 15px;
|
||||
@ -3482,6 +3511,10 @@ textarea {
|
||||
position: relative;
|
||||
background: rgba(0, 132, 255, 0.15);
|
||||
border: 2px solid rgba(0, 132, 255, 0.35);
|
||||
min-height: 200px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
@ -3491,6 +3524,13 @@ textarea {
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
.vrcode-model.manage-model .manage-right .manage-img .upload-img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
min-height: unset;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.vrcode-model.manage-model .manage-right .manage-img #sel-img {
|
||||
width: 0;
|
||||
height: 0;
|
||||
|
@ -21,6 +21,7 @@
|
||||
cursor: pointer;
|
||||
background: #0294E2;
|
||||
border: 3px solid #013769;
|
||||
color: #0077b1;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb:hover {
|
||||
@ -3493,6 +3494,30 @@ textarea{
|
||||
}
|
||||
}
|
||||
}
|
||||
.m-t-34{
|
||||
margin-top: 34px;
|
||||
}
|
||||
.manage-textarea{
|
||||
width: 100%;
|
||||
.input-title {
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
color: #FFFFFF;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
textarea{
|
||||
width: 100%;
|
||||
padding:10px;
|
||||
height: 110px;
|
||||
background: rgba(0, 186, 255, 0.15);
|
||||
border: 2px solid rgba(0, 186, 255, 0.4);
|
||||
padding-left: 15px;
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
.vrcode-input-sel {
|
||||
margin-right: 30px;
|
||||
@ -3682,13 +3707,21 @@ textarea{
|
||||
// height: 290px;
|
||||
background: rgba(0, 132, 255, 0.15);
|
||||
border: 2px solid rgba(0, 132, 255, 0.35);
|
||||
|
||||
min-height: 200px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
img {
|
||||
width: 360px;
|
||||
height: auto;
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
.upload-img{
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
min-height: unset;
|
||||
cursor: pointer;
|
||||
}
|
||||
padding: 10px;
|
||||
|
||||
#sel-img {
|
||||
@ -3715,7 +3748,7 @@ textarea{
|
||||
font-size: 14px;
|
||||
color: #00C0F7;
|
||||
}
|
||||
|
||||
|
||||
.manage-img-small {
|
||||
width: 240px;
|
||||
height: 160px;
|
||||
|
BIN
src/assets/img/upload-img.png
Normal file
BIN
src/assets/img/upload-img.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
@ -96,7 +96,7 @@ const routes = [
|
||||
path: '/systemManage',
|
||||
name: 'systemManage',
|
||||
component: () => import('../views/page/systemManage.vue')
|
||||
},{
|
||||
},{//管理页面
|
||||
path: '/manage',
|
||||
name: 'manage',
|
||||
component: () => import('../views/manage/index.vue'),
|
||||
@ -137,7 +137,20 @@ const routes = [
|
||||
path: '/videoManage',
|
||||
name: 'videoManage',
|
||||
component: () => import('../views/manage/videoManage.vue')
|
||||
},]
|
||||
},
|
||||
// 官网修改
|
||||
{
|
||||
path: '/officialWebsiteBanner',
|
||||
name: 'officialWebsiteBanner',
|
||||
component: () => import('../views/officialWebsite/banner.vue')
|
||||
},
|
||||
// 官网修改
|
||||
{
|
||||
path: '/officialWebsiteCase',
|
||||
name: 'officialWebsiteCase',
|
||||
component: () => import('../views/officialWebsite/case.vue')
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/control',
|
||||
|
@ -104,7 +104,7 @@ export default {
|
||||
// { name: '设备菜单', router: '', routerList: [], img: require('../assets/image/header-img5.png') },
|
||||
//systemManage systemManage
|
||||
// manage
|
||||
{ name: '管理', router: 'manage', routerList: ['manage','dataDevice','deviceStatusSet','deviceSet','deviceInfoManage','weatherData','mobileControl','userInfoControl','deviceManage','videoManage'], img: require('../assets/image/header-img6.png') },
|
||||
{ name: '管理', router: 'manage', routerList: ['manage','dataDevice','deviceStatusSet','officialWebsiteBanner','officialWebsiteCase','deviceSet','deviceInfoManage','weatherData','mobileControl','userInfoControl','deviceManage','videoManage'], img: require('../assets/image/header-img6.png') },
|
||||
|
||||
{ name: '大数据', router: 'largeScreen', routerList: ['largeScreen'], img: require('../assets/image/header-img8.png') }
|
||||
],
|
||||
@ -137,8 +137,10 @@ export default {
|
||||
'dataDevice',
|
||||
'mobileControl',
|
||||
'userInfoControl',
|
||||
'officialWebsiteCase',
|
||||
'deviceManage',
|
||||
'videoManage',],
|
||||
'videoManage',
|
||||
'officialWebsiteBanner',],
|
||||
activeNames1: [3,2],
|
||||
routerNow: 'realTime',
|
||||
deviceName: 1,
|
||||
@ -404,6 +406,8 @@ export default {
|
||||
{ name: '管理员管理', routerList: [''], img: require('../assets/image/left-img0.png'), list: [
|
||||
{deviceTypeName:'用户信息管理',router:'userInfoControl',index:6},
|
||||
{deviceTypeName:'设备管理',router:'deviceManage',index:7},
|
||||
{deviceTypeName:'官网顶部轮播图管理',router:'officialWebsiteBanner',index:8},
|
||||
{deviceTypeName:'官网案例管理',router:'officialWebsiteCase',index:9},
|
||||
// {deviceTypeName:'摄像头信息管理',router:'videoManage',index:8},
|
||||
] },
|
||||
]
|
||||
|
297
src/views/officialWebsite/banner.vue
Normal file
297
src/views/officialWebsite/banner.vue
Normal file
@ -0,0 +1,297 @@
|
||||
<template>
|
||||
<div class="videoManage manage-page">
|
||||
<div class="flex-view flex-title">
|
||||
<div class="table-title">官网顶部轮播图</div>
|
||||
<div class="table-title-btn blue" @click="openModel({}, 0)">
|
||||
<img src="../../assets/manageImg/add-btn.png" alt="" />添加
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-view">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:row-class-name="tableRowClassName"
|
||||
height="620"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column prop="homepageSort" label="排序">
|
||||
</el-table-column>
|
||||
<el-table-column prop="homepageName" label="轮播图名字">
|
||||
</el-table-column>
|
||||
<el-table-column prop="homepageEnname" label="轮播图英文名字">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<div class="table-flex">
|
||||
<div class="table-operate blue" @click="openModel(scope.row, 1)">
|
||||
<img src="../../assets/manageImg/table-edit.png" alt="" />编辑
|
||||
</div>
|
||||
<el-popconfirm
|
||||
@confirm="confirmDel(scope.row)"
|
||||
title="这一段内容确定删除吗?"
|
||||
icon-color="red"
|
||||
>
|
||||
<div class="table-operate red" slot="reference">
|
||||
<img
|
||||
src="../../assets/manageImg/table-delete.png"
|
||||
alt=""
|
||||
/>删除
|
||||
</div>
|
||||
</el-popconfirm>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
title="提示"
|
||||
top="10vh"
|
||||
:visible.sync="addModel"
|
||||
width="700px"
|
||||
class="vrcode-model manage-model"
|
||||
:append-to-body="true"
|
||||
>
|
||||
<div class="vrcode-model-title">
|
||||
{{ modelName }}
|
||||
</div>
|
||||
<div class="vrcode-content" v-if="nowData">
|
||||
<div class="manage-left">
|
||||
<div class="manage-input">
|
||||
<div class="input-title">轮播图名字</div>
|
||||
<input
|
||||
type="text"
|
||||
v-model="nowData.homepageName"
|
||||
placeholder="请输入轮播图名字"
|
||||
/>
|
||||
</div>
|
||||
<div class="manage-input">
|
||||
<div class="input-title">轮播图文字字号大小</div>
|
||||
<input
|
||||
type="text"
|
||||
v-model="nowData.homepageNameSize"
|
||||
placeholder="请输入轮播图文字字号大小"
|
||||
/>
|
||||
</div>
|
||||
<div class="manage-input">
|
||||
<div class="input-title">轮播图英文名字</div>
|
||||
<input
|
||||
type="text"
|
||||
v-model="nowData.homepageEnname"
|
||||
placeholder="请输入轮播图英文名字"
|
||||
/>
|
||||
</div>
|
||||
<div class="manage-input">
|
||||
<div class="input-title">轮播图英文文字字号大小</div>
|
||||
<input
|
||||
type="text"
|
||||
v-model="nowData.homepageEnnameSize"
|
||||
placeholder="请输入轮播图英文文字字号大小"
|
||||
/>
|
||||
</div>
|
||||
<div class="manage-input">
|
||||
<div class="input-title">轮播图间隔时间(毫秒)</div>
|
||||
<input
|
||||
type="number"
|
||||
v-model="nowData.homepageTime"
|
||||
placeholder="请输入轮播图间隔时间(毫秒)"
|
||||
/>
|
||||
</div>
|
||||
<div class="manage-input">
|
||||
<div class="input-title">排序</div>
|
||||
<input
|
||||
type="number"
|
||||
v-model="nowData.homepageSort"
|
||||
placeholder="请输入排序"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="manage-right">
|
||||
<div class="manage-input">
|
||||
<div class="input-title">轮播图图片(图片大小不能超过2MB)</div>
|
||||
</div>
|
||||
<div class="manage-img" v-loading="loading">
|
||||
<label for="sel-img">
|
||||
<img
|
||||
v-show="nowData.homepaeImage"
|
||||
class=""
|
||||
:src="nowData.homepaeImage"
|
||||
alt="轮播图图片"
|
||||
/>
|
||||
<img
|
||||
class="upload-img"
|
||||
v-show="!nowData.homepaeImage"
|
||||
src="../../assets/img/upload-img.png"
|
||||
alt=""
|
||||
/>
|
||||
</label>
|
||||
<input
|
||||
ref="fileInput"
|
||||
type="file"
|
||||
:multiple="false"
|
||||
id="sel-img"
|
||||
accept="image/*"
|
||||
@change="handleImageChange($event, 0)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<div class="vrcode-btn blue-btn w-100" @click="changeAddModel">
|
||||
确定
|
||||
</div>
|
||||
<div class="vrcode-btn cancle-btn w-100" @click="addModel = false">
|
||||
取消
|
||||
</div>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
addModel: false,
|
||||
nowData: {
|
||||
homepaeImage: "",
|
||||
homepageEnname: "",
|
||||
homepageEnnameSize: 0,
|
||||
homepageName: "",
|
||||
homepageNameSize: 0,
|
||||
homepageSort: "",
|
||||
homepageTime: 3000,
|
||||
},
|
||||
modelName: "添加",
|
||||
typeSelList: [],
|
||||
TypeSel: "",
|
||||
selId: "",
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.dataInit();
|
||||
},
|
||||
methods: {
|
||||
dataInit() {
|
||||
this.api.website_getows().then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.tableData = res.data.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
openModel(item, type) {
|
||||
if (type == 0) {
|
||||
this.modelName = "添加";
|
||||
this.addModel = true;
|
||||
this.nowData = {
|
||||
homepaeImage: "",
|
||||
homepageEnname: "",
|
||||
homepageEnnameSize: 0,
|
||||
homepageName: "",
|
||||
homepageNameSize: 0,
|
||||
homepageSort: "",
|
||||
homepageTime: 3000,
|
||||
};
|
||||
} else {
|
||||
this.modelName = "编辑";
|
||||
this.nowData = JSON.parse(JSON.stringify(item));
|
||||
this.addModel = true;
|
||||
}
|
||||
},
|
||||
changeAddModel() {
|
||||
this.Addloading = this.$loading({
|
||||
lock: true,
|
||||
text: "加载中",
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
});
|
||||
|
||||
if (this.modelName == "编辑") {
|
||||
var data = { ...this.nowData,id:this.nowData.id.toString() };
|
||||
this.api.website_updateows(data).then((res) => {
|
||||
this.Addloading.close();
|
||||
if (res.data.code == 200) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.dataInit();
|
||||
this.addModel = false;
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
this.addModel = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
var data = { ...this.nowData};
|
||||
this.api.website_addows(data).then((res) => {
|
||||
this.Addloading.close();
|
||||
if (res.data.code == 200) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.dataInit();
|
||||
this.addModel = false;
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
this.addModel = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleImageChange(event, type) {
|
||||
this.loading = true;
|
||||
if (event.target.files.length === 0) {
|
||||
// 用户点击了取消
|
||||
this.loading = false;
|
||||
return;
|
||||
}
|
||||
const file = event.target.files[0];
|
||||
|
||||
const reader = new FileReader();
|
||||
const maxSize = 2 * 1024 * 1024; // 2MB in bytes
|
||||
if (file.size > maxSize) {
|
||||
this.$message.error("图片大小不能超过2MB");
|
||||
this.$refs.fileInput.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
reader.onload = (e) => {
|
||||
const imageData = e.target.result;
|
||||
const convertedFile = new File([imageData], file.name, {
|
||||
type: file.type,
|
||||
});
|
||||
// 处理转换后的文件...
|
||||
|
||||
var data = { file: convertedFile };
|
||||
this.api.websiteUploadImage(data).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.data.code == 200) {
|
||||
this.nowData.homepaeImage = res.data.msg;
|
||||
this.$refs.fileInput.value = "";
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
});
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
},
|
||||
|
||||
confirmDel(item) {
|
||||
var data = { id: item.id.toString() };
|
||||
this.api.website_delows(data).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.dataInit();
|
||||
this.$message.success(res.data.msg);
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
if (rowIndex % 2 == 1) {
|
||||
return "warning-row";
|
||||
} else if (rowIndex % 2 == 0) {
|
||||
return "success-row";
|
||||
}
|
||||
return "";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss"></style>
|
284
src/views/officialWebsite/case.vue
Normal file
284
src/views/officialWebsite/case.vue
Normal file
@ -0,0 +1,284 @@
|
||||
<template>
|
||||
<div class="videoManage manage-page">
|
||||
<div class="flex-view flex-title">
|
||||
<div class="table-title">官网案例管理</div>
|
||||
<div class="table-title-btn blue" @click="openModel({}, 0)">
|
||||
<img src="../../assets/manageImg/add-btn.png" alt="" />添加
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-view">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:row-class-name="tableRowClassName"
|
||||
height="620"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column prop="detailedIntroductionSort" label="排序">
|
||||
</el-table-column>
|
||||
<el-table-column prop="detailedIntroductionName" label="案例名字">
|
||||
</el-table-column>
|
||||
<el-table-column prop="detailedIntroductionEnName" label="案例英文名字">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<div class="table-flex">
|
||||
<div class="table-operate blue" @click="openModel(scope.row, 1)">
|
||||
<img src="../../assets/manageImg/table-edit.png" alt="" />编辑
|
||||
</div>
|
||||
<el-popconfirm
|
||||
@confirm="confirmDel(scope.row)"
|
||||
title="这一段内容确定删除吗?"
|
||||
icon-color="red"
|
||||
>
|
||||
<div class="table-operate red" slot="reference">
|
||||
<img
|
||||
src="../../assets/manageImg/table-delete.png"
|
||||
alt=""
|
||||
/>删除
|
||||
</div>
|
||||
</el-popconfirm>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
title="提示"
|
||||
top="10vh"
|
||||
:visible.sync="addModel"
|
||||
width="700px"
|
||||
class="vrcode-model manage-model"
|
||||
:append-to-body="true"
|
||||
>
|
||||
<div class="vrcode-model-title">
|
||||
{{ modelName }}
|
||||
</div>
|
||||
<div class="vrcode-content" v-if="nowData">
|
||||
<div class="manage-left">
|
||||
<div class="manage-input">
|
||||
<div class="input-title">案例名字</div>
|
||||
<input
|
||||
type="text"
|
||||
v-model="nowData.detailedIntroductionName"
|
||||
placeholder="请输入案例名字"
|
||||
/>
|
||||
</div>
|
||||
<div class="manage-input">
|
||||
<div class="input-title">案例英文名字</div>
|
||||
<input
|
||||
type="text"
|
||||
v-model="nowData.detailedIntroductionEnName"
|
||||
placeholder="请输入案例英文名字"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="manage-input">
|
||||
<div class="input-title">排序</div>
|
||||
<input
|
||||
type="number"
|
||||
v-model="nowData.detailedIntroductionSort"
|
||||
placeholder="请输入排序"
|
||||
/>
|
||||
</div>
|
||||
<div class="manage-textarea">
|
||||
<div class="input-title">案例中文特点(以回车键换行)</div>
|
||||
<textarea v-model="nowData.detailedIntroductionText" name="" id="" cols="30" rows="10"></textarea>
|
||||
</div>
|
||||
<div class="manage-textarea">
|
||||
<div class="input-title">案例英文特点(以回车键换行)</div>
|
||||
<textarea v-model="nowData.detailedIntroductionEnText" name="" id="" cols="30" rows="10"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="manage-right">
|
||||
<div class="manage-input">
|
||||
<div class="input-title">案例图片(图片大小不能超过2MB)</div>
|
||||
</div>
|
||||
<div class="manage-img" v-loading="loading">
|
||||
<label for="sel-img">
|
||||
<img
|
||||
v-show="nowData.detailedIntroductionImage"
|
||||
class=""
|
||||
:src="nowData.detailedIntroductionImage"
|
||||
alt="案例图片"
|
||||
/>
|
||||
<img
|
||||
class="upload-img"
|
||||
v-show="!nowData.detailedIntroductionImage"
|
||||
src="../../assets/img/upload-img.png"
|
||||
alt=""
|
||||
/>
|
||||
</label>
|
||||
<input
|
||||
ref="fileInput"
|
||||
type="file"
|
||||
:multiple="false"
|
||||
id="sel-img"
|
||||
accept="image/*"
|
||||
@change="handleImageChange($event, 0)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<div class="vrcode-btn blue-btn w-100" @click="changeAddModel">
|
||||
确定
|
||||
</div>
|
||||
<div class="vrcode-btn cancle-btn w-100" @click="addModel = false">
|
||||
取消
|
||||
</div>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
addModel: false,
|
||||
nowData: {
|
||||
detailedIntroductionImage: "",
|
||||
detailedIntroductionEnName: "",
|
||||
detailedIntroductionEnText: "",
|
||||
detailedIntroductionText: "",
|
||||
detailedIntroductionName: "",
|
||||
detailedIntroductionSort: "",
|
||||
type:2,
|
||||
},
|
||||
modelName: "添加",
|
||||
typeSelList: [],
|
||||
TypeSel: "",
|
||||
selId: "",
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.dataInit();
|
||||
},
|
||||
methods: {
|
||||
dataInit() {
|
||||
this.api.website_getowpabyowpidMan().then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.tableData = res.data.data.filter(item => item && item.type === 2);
|
||||
}
|
||||
});
|
||||
},
|
||||
openModel(item, type) {
|
||||
if (type == 0) {
|
||||
this.modelName = "添加";
|
||||
this.addModel = true;
|
||||
this.nowData = {
|
||||
detailedIntroductionImage: "",
|
||||
detailedIntroductionEnName: "",
|
||||
detailedIntroductionEnText: "",
|
||||
detailedIntroductionText: "",
|
||||
detailedIntroductionName: "",
|
||||
detailedIntroductionSort: "",
|
||||
type:2,
|
||||
};
|
||||
} else {
|
||||
this.modelName = "编辑";
|
||||
this.nowData = JSON.parse(JSON.stringify(item));
|
||||
this.addModel = true;
|
||||
}
|
||||
},
|
||||
changeAddModel() {
|
||||
this.Addloading = this.$loading({
|
||||
lock: true,
|
||||
text: "加载中",
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
});
|
||||
|
||||
if (this.modelName == "编辑") {
|
||||
var data = { ...this.nowData,id:this.nowData.id.toString() };
|
||||
this.api.website_updateops(data).then((res) => {
|
||||
this.Addloading.close();
|
||||
if (res.data.code == 200) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.dataInit();
|
||||
this.addModel = false;
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
this.addModel = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
var data = { ...this.nowData };
|
||||
this.api.website_addops(data).then((res) => {
|
||||
this.Addloading.close();
|
||||
if (res.data.code == 200) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.dataInit();
|
||||
this.addModel = false;
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
this.addModel = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleImageChange(event, type) {
|
||||
this.loading = true;
|
||||
if (event.target.files.length === 0) {
|
||||
// 用户点击了取消
|
||||
this.loading = false;
|
||||
return;
|
||||
}
|
||||
const file = event.target.files[0];
|
||||
|
||||
const reader = new FileReader();
|
||||
const maxSize = 2 * 1024 * 1024; // 2MB in bytes
|
||||
if (file.size > maxSize) {
|
||||
this.$message.error("图片大小不能超过2MB");
|
||||
this.$refs.fileInput.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
reader.onload = (e) => {
|
||||
const imageData = e.target.result;
|
||||
const convertedFile = new File([imageData], file.name, {
|
||||
type: file.type,
|
||||
});
|
||||
// 处理转换后的文件...
|
||||
|
||||
var data = { file: convertedFile };
|
||||
this.api.websiteUploadImage(data).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.data.code == 200) {
|
||||
this.nowData.detailedIntroductionImage = res.data.msg;
|
||||
this.$refs.fileInput.value = "";
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
});
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
},
|
||||
|
||||
confirmDel(item) {
|
||||
var data = { id: item.id.toString() };
|
||||
this.api.website_delops(data).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.dataInit();
|
||||
this.$message.success(res.data.msg);
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
if (rowIndex % 2 == 1) {
|
||||
return "warning-row";
|
||||
} else if (rowIndex % 2 == 0) {
|
||||
return "success-row";
|
||||
}
|
||||
return "";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss"></style>
|
284
src/views/officialWebsite/new.vue
Normal file
284
src/views/officialWebsite/new.vue
Normal file
@ -0,0 +1,284 @@
|
||||
<template>
|
||||
<div class="videoManage manage-page">
|
||||
<div class="flex-view flex-title">
|
||||
<div class="table-title">官网案例管理</div>
|
||||
<div class="table-title-btn blue" @click="openModel({}, 0)">
|
||||
<img src="../../assets/manageImg/add-btn.png" alt="" />添加
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-view">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:row-class-name="tableRowClassName"
|
||||
height="620"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column prop="detailedIntroductionSort" label="排序">
|
||||
</el-table-column>
|
||||
<el-table-column prop="detailedIntroductionName" label="案例名字">
|
||||
</el-table-column>
|
||||
<el-table-column prop="detailedIntroductionEnName" label="案例英文名字">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<div class="table-flex">
|
||||
<div class="table-operate blue" @click="openModel(scope.row, 1)">
|
||||
<img src="../../assets/manageImg/table-edit.png" alt="" />编辑
|
||||
</div>
|
||||
<el-popconfirm
|
||||
@confirm="confirmDel(scope.row)"
|
||||
title="这一段内容确定删除吗?"
|
||||
icon-color="red"
|
||||
>
|
||||
<div class="table-operate red" slot="reference">
|
||||
<img
|
||||
src="../../assets/manageImg/table-delete.png"
|
||||
alt=""
|
||||
/>删除
|
||||
</div>
|
||||
</el-popconfirm>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
title="提示"
|
||||
top="10vh"
|
||||
:visible.sync="addModel"
|
||||
width="700px"
|
||||
class="vrcode-model manage-model"
|
||||
:append-to-body="true"
|
||||
>
|
||||
<div class="vrcode-model-title">
|
||||
{{ modelName }}
|
||||
</div>
|
||||
<div class="vrcode-content" v-if="nowData">
|
||||
<div class="manage-left">
|
||||
<div class="manage-input">
|
||||
<div class="input-title">案例名字</div>
|
||||
<input
|
||||
type="text"
|
||||
v-model="nowData.detailedIntroductionName"
|
||||
placeholder="请输入案例名字"
|
||||
/>
|
||||
</div>
|
||||
<div class="manage-input">
|
||||
<div class="input-title">案例英文名字</div>
|
||||
<input
|
||||
type="text"
|
||||
v-model="nowData.detailedIntroductionEnName"
|
||||
placeholder="请输入案例英文名字"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="manage-input">
|
||||
<div class="input-title">排序</div>
|
||||
<input
|
||||
type="number"
|
||||
v-model="nowData.detailedIntroductionSort"
|
||||
placeholder="请输入排序"
|
||||
/>
|
||||
</div>
|
||||
<div class="manage-textarea">
|
||||
<div class="input-title">案例中文特点(以回车键换行)</div>
|
||||
<textarea v-model="nowData.detailedIntroductionText" name="" id="" cols="30" rows="10"></textarea>
|
||||
</div>
|
||||
<div class="manage-textarea">
|
||||
<div class="input-title">案例英文特点(以回车键换行)</div>
|
||||
<textarea v-model="nowData.detailedIntroductionEnText" name="" id="" cols="30" rows="10"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="manage-right">
|
||||
<div class="manage-input">
|
||||
<div class="input-title">案例图片(图片大小不能超过2MB)</div>
|
||||
</div>
|
||||
<div class="manage-img" v-loading="loading">
|
||||
<label for="sel-img">
|
||||
<img
|
||||
v-show="nowData.detailedIntroductionImage"
|
||||
class=""
|
||||
:src="nowData.detailedIntroductionImage"
|
||||
alt="案例图片"
|
||||
/>
|
||||
<img
|
||||
class="upload-img"
|
||||
v-show="!nowData.detailedIntroductionImage"
|
||||
src="../../assets/img/upload-img.png"
|
||||
alt=""
|
||||
/>
|
||||
</label>
|
||||
<input
|
||||
ref="fileInput"
|
||||
type="file"
|
||||
:multiple="false"
|
||||
id="sel-img"
|
||||
accept="image/*"
|
||||
@change="handleImageChange($event, 0)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<div class="vrcode-btn blue-btn w-100" @click="changeAddModel">
|
||||
确定
|
||||
</div>
|
||||
<div class="vrcode-btn cancle-btn w-100" @click="addModel = false">
|
||||
取消
|
||||
</div>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
addModel: false,
|
||||
nowData: {
|
||||
detailedIntroductionImage: "",
|
||||
detailedIntroductionEnName: "",
|
||||
detailedIntroductionEnText: "",
|
||||
detailedIntroductionText: "",
|
||||
detailedIntroductionName: "",
|
||||
detailedIntroductionSort: "",
|
||||
type:2,
|
||||
},
|
||||
modelName: "添加",
|
||||
typeSelList: [],
|
||||
TypeSel: "",
|
||||
selId: "",
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.dataInit();
|
||||
},
|
||||
methods: {
|
||||
dataInit() {
|
||||
this.api.website_getowpabyowpidMan().then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.tableData = res.data.data.filter(item => item && item.type === 2);
|
||||
}
|
||||
});
|
||||
},
|
||||
openModel(item, type) {
|
||||
if (type == 0) {
|
||||
this.modelName = "添加";
|
||||
this.addModel = true;
|
||||
this.nowData = {
|
||||
detailedIntroductionImage: "",
|
||||
detailedIntroductionEnName: "",
|
||||
detailedIntroductionEnText: "",
|
||||
detailedIntroductionText: "",
|
||||
detailedIntroductionName: "",
|
||||
detailedIntroductionSort: "",
|
||||
type:2,
|
||||
};
|
||||
} else {
|
||||
this.modelName = "编辑";
|
||||
this.nowData = JSON.parse(JSON.stringify(item));
|
||||
this.addModel = true;
|
||||
}
|
||||
},
|
||||
changeAddModel() {
|
||||
this.Addloading = this.$loading({
|
||||
lock: true,
|
||||
text: "加载中",
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
});
|
||||
|
||||
if (this.modelName == "编辑") {
|
||||
var data = { ...this.nowData,id:this.nowData.id.toString() };
|
||||
this.api.website_updateops(data).then((res) => {
|
||||
this.Addloading.close();
|
||||
if (res.data.code == 200) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.dataInit();
|
||||
this.addModel = false;
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
this.addModel = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
var data = { ...this.nowData };
|
||||
this.api.website_addops(data).then((res) => {
|
||||
this.Addloading.close();
|
||||
if (res.data.code == 200) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.dataInit();
|
||||
this.addModel = false;
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
this.addModel = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleImageChange(event, type) {
|
||||
this.loading = true;
|
||||
if (event.target.files.length === 0) {
|
||||
// 用户点击了取消
|
||||
this.loading = false;
|
||||
return;
|
||||
}
|
||||
const file = event.target.files[0];
|
||||
|
||||
const reader = new FileReader();
|
||||
const maxSize = 2 * 1024 * 1024; // 2MB in bytes
|
||||
if (file.size > maxSize) {
|
||||
this.$message.error("图片大小不能超过2MB");
|
||||
this.$refs.fileInput.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
reader.onload = (e) => {
|
||||
const imageData = e.target.result;
|
||||
const convertedFile = new File([imageData], file.name, {
|
||||
type: file.type,
|
||||
});
|
||||
// 处理转换后的文件...
|
||||
|
||||
var data = { file: convertedFile };
|
||||
this.api.websiteUploadImage(data).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.data.code == 200) {
|
||||
this.nowData.detailedIntroductionImage = res.data.msg;
|
||||
this.$refs.fileInput.value = "";
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
});
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
},
|
||||
|
||||
confirmDel(item) {
|
||||
var data = { id: item.id.toString() };
|
||||
this.api.website_delops(data).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.dataInit();
|
||||
this.$message.success(res.data.msg);
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
if (rowIndex % 2 == 1) {
|
||||
return "warning-row";
|
||||
} else if (rowIndex % 2 == 0) {
|
||||
return "success-row";
|
||||
}
|
||||
return "";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss"></style>
|
284
src/views/officialWebsite/productList.vue
Normal file
284
src/views/officialWebsite/productList.vue
Normal file
@ -0,0 +1,284 @@
|
||||
<template>
|
||||
<div class="videoManage manage-page">
|
||||
<div class="flex-view flex-title">
|
||||
<div class="table-title">官网案例管理</div>
|
||||
<div class="table-title-btn blue" @click="openModel({}, 0)">
|
||||
<img src="../../assets/manageImg/add-btn.png" alt="" />添加
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-view">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:row-class-name="tableRowClassName"
|
||||
height="620"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column prop="detailedIntroductionSort" label="排序">
|
||||
</el-table-column>
|
||||
<el-table-column prop="detailedIntroductionName" label="案例名字">
|
||||
</el-table-column>
|
||||
<el-table-column prop="detailedIntroductionEnName" label="案例英文名字">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<div class="table-flex">
|
||||
<div class="table-operate blue" @click="openModel(scope.row, 1)">
|
||||
<img src="../../assets/manageImg/table-edit.png" alt="" />编辑
|
||||
</div>
|
||||
<el-popconfirm
|
||||
@confirm="confirmDel(scope.row)"
|
||||
title="这一段内容确定删除吗?"
|
||||
icon-color="red"
|
||||
>
|
||||
<div class="table-operate red" slot="reference">
|
||||
<img
|
||||
src="../../assets/manageImg/table-delete.png"
|
||||
alt=""
|
||||
/>删除
|
||||
</div>
|
||||
</el-popconfirm>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
title="提示"
|
||||
top="10vh"
|
||||
:visible.sync="addModel"
|
||||
width="700px"
|
||||
class="vrcode-model manage-model"
|
||||
:append-to-body="true"
|
||||
>
|
||||
<div class="vrcode-model-title">
|
||||
{{ modelName }}
|
||||
</div>
|
||||
<div class="vrcode-content" v-if="nowData">
|
||||
<div class="manage-left">
|
||||
<div class="manage-input">
|
||||
<div class="input-title">案例名字</div>
|
||||
<input
|
||||
type="text"
|
||||
v-model="nowData.detailedIntroductionName"
|
||||
placeholder="请输入案例名字"
|
||||
/>
|
||||
</div>
|
||||
<div class="manage-input">
|
||||
<div class="input-title">案例英文名字</div>
|
||||
<input
|
||||
type="text"
|
||||
v-model="nowData.detailedIntroductionEnName"
|
||||
placeholder="请输入案例英文名字"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="manage-input">
|
||||
<div class="input-title">排序</div>
|
||||
<input
|
||||
type="number"
|
||||
v-model="nowData.detailedIntroductionSort"
|
||||
placeholder="请输入排序"
|
||||
/>
|
||||
</div>
|
||||
<div class="manage-textarea">
|
||||
<div class="input-title">案例中文特点(以回车键换行)</div>
|
||||
<textarea v-model="nowData.detailedIntroductionText" name="" id="" cols="30" rows="10"></textarea>
|
||||
</div>
|
||||
<div class="manage-textarea">
|
||||
<div class="input-title">案例英文特点(以回车键换行)</div>
|
||||
<textarea v-model="nowData.detailedIntroductionEnText" name="" id="" cols="30" rows="10"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="manage-right">
|
||||
<div class="manage-input">
|
||||
<div class="input-title">案例图片(图片大小不能超过2MB)</div>
|
||||
</div>
|
||||
<div class="manage-img" v-loading="loading">
|
||||
<label for="sel-img">
|
||||
<img
|
||||
v-show="nowData.detailedIntroductionImage"
|
||||
class=""
|
||||
:src="nowData.detailedIntroductionImage"
|
||||
alt="案例图片"
|
||||
/>
|
||||
<img
|
||||
class="upload-img"
|
||||
v-show="!nowData.detailedIntroductionImage"
|
||||
src="../../assets/img/upload-img.png"
|
||||
alt=""
|
||||
/>
|
||||
</label>
|
||||
<input
|
||||
ref="fileInput"
|
||||
type="file"
|
||||
:multiple="false"
|
||||
id="sel-img"
|
||||
accept="image/*"
|
||||
@change="handleImageChange($event, 0)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<div class="vrcode-btn blue-btn w-100" @click="changeAddModel">
|
||||
确定
|
||||
</div>
|
||||
<div class="vrcode-btn cancle-btn w-100" @click="addModel = false">
|
||||
取消
|
||||
</div>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
addModel: false,
|
||||
nowData: {
|
||||
detailedIntroductionImage: "",
|
||||
detailedIntroductionEnName: "",
|
||||
detailedIntroductionEnText: "",
|
||||
detailedIntroductionText: "",
|
||||
detailedIntroductionName: "",
|
||||
detailedIntroductionSort: "",
|
||||
type:2,
|
||||
},
|
||||
modelName: "添加",
|
||||
typeSelList: [],
|
||||
TypeSel: "",
|
||||
selId: "",
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.dataInit();
|
||||
},
|
||||
methods: {
|
||||
dataInit() {
|
||||
this.api.website_getowpabyowpidMan().then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.tableData = res.data.data.filter(item => item && item.type === 2);
|
||||
}
|
||||
});
|
||||
},
|
||||
openModel(item, type) {
|
||||
if (type == 0) {
|
||||
this.modelName = "添加";
|
||||
this.addModel = true;
|
||||
this.nowData = {
|
||||
detailedIntroductionImage: "",
|
||||
detailedIntroductionEnName: "",
|
||||
detailedIntroductionEnText: "",
|
||||
detailedIntroductionText: "",
|
||||
detailedIntroductionName: "",
|
||||
detailedIntroductionSort: "",
|
||||
type:2,
|
||||
};
|
||||
} else {
|
||||
this.modelName = "编辑";
|
||||
this.nowData = JSON.parse(JSON.stringify(item));
|
||||
this.addModel = true;
|
||||
}
|
||||
},
|
||||
changeAddModel() {
|
||||
this.Addloading = this.$loading({
|
||||
lock: true,
|
||||
text: "加载中",
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
});
|
||||
|
||||
if (this.modelName == "编辑") {
|
||||
var data = { ...this.nowData,id:this.nowData.id.toString() };
|
||||
this.api.website_updateops(data).then((res) => {
|
||||
this.Addloading.close();
|
||||
if (res.data.code == 200) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.dataInit();
|
||||
this.addModel = false;
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
this.addModel = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
var data = { ...this.nowData };
|
||||
this.api.website_addops(data).then((res) => {
|
||||
this.Addloading.close();
|
||||
if (res.data.code == 200) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.dataInit();
|
||||
this.addModel = false;
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
this.addModel = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleImageChange(event, type) {
|
||||
this.loading = true;
|
||||
if (event.target.files.length === 0) {
|
||||
// 用户点击了取消
|
||||
this.loading = false;
|
||||
return;
|
||||
}
|
||||
const file = event.target.files[0];
|
||||
|
||||
const reader = new FileReader();
|
||||
const maxSize = 2 * 1024 * 1024; // 2MB in bytes
|
||||
if (file.size > maxSize) {
|
||||
this.$message.error("图片大小不能超过2MB");
|
||||
this.$refs.fileInput.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
reader.onload = (e) => {
|
||||
const imageData = e.target.result;
|
||||
const convertedFile = new File([imageData], file.name, {
|
||||
type: file.type,
|
||||
});
|
||||
// 处理转换后的文件...
|
||||
|
||||
var data = { file: convertedFile };
|
||||
this.api.websiteUploadImage(data).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.data.code == 200) {
|
||||
this.nowData.detailedIntroductionImage = res.data.msg;
|
||||
this.$refs.fileInput.value = "";
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
});
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
},
|
||||
|
||||
confirmDel(item) {
|
||||
var data = { id: item.id.toString() };
|
||||
this.api.website_delops(data).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.dataInit();
|
||||
this.$message.success(res.data.msg);
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
if (rowIndex % 2 == 1) {
|
||||
return "warning-row";
|
||||
} else if (rowIndex % 2 == 0) {
|
||||
return "success-row";
|
||||
}
|
||||
return "";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss"></style>
|
@ -41,8 +41,10 @@ module.exports = {
|
||||
// https:true,
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: 'https://api.lihe-control.com', //地址
|
||||
// target: 'https://api.lihe-control.com', //地址
|
||||
// target: 'http://jiaxingtest.a1.luyouxia.net:21114', //地址
|
||||
target: 'http://jiaxingtest.a1.luyouxia.net:25762', //地址
|
||||
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
"^/api": "",
|
||||
|
Loading…
x
Reference in New Issue
Block a user