Commit 37612864 authored by obt's avatar obt

接口修复

parent 5109062d
...@@ -66,7 +66,6 @@ export default { ...@@ -66,7 +66,6 @@ export default {
onUploadRequest(data) { onUploadRequest(data) {
this.uploading = true; this.uploading = true;
let fileObj = data.file; let fileObj = data.file;
//获取图片详情信息 //获取图片详情信息
let imgInfo = {}; let imgInfo = {};
let temp = URL.createObjectURL(fileObj) let temp = URL.createObjectURL(fileObj)
...@@ -78,8 +77,6 @@ export default { ...@@ -78,8 +77,6 @@ export default {
} }
imgInfo.size = fileObj.size; imgInfo.size = fileObj.size;
imgInfo.type = fileObj.type; imgInfo.type = fileObj.type;
// FormData 对象 // FormData 对象
let form = new FormData(); let form = new FormData();
// 文件对象 // 文件对象
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2020-12-02 10:27:53 * @Date: 2020-12-02 10:27:53
* @LastEditTime: 2020-12-08 17:56:34 * @LastEditTime: 2020-12-09 11:24:17
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 类别管理 * @Description: 类别管理
* @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\industryApplication\applicationList\index.vue * @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\industryApplication\applicationList\index.vue
...@@ -446,10 +446,11 @@ export default { ...@@ -446,10 +446,11 @@ export default {
message: "删除成功!!!", message: "删除成功!!!",
type: 'success' type: 'success'
}); });
let index = this.tableData.findIndex(ele => ele.id == type.id) this.pullListApplicationType()
if(index!=-1){ // let index = this.tableData.findIndex(ele => ele.id == type.id)
this.tableData.splice(index,1) // if(index!=-1){
} // this.tableData.splice(index,1)
// }
}else{ }else{
this.$message.error('操作失败,请稍后重试!!!'); this.$message.error('操作失败,请稍后重试!!!');
} }
...@@ -483,6 +484,7 @@ export default { ...@@ -483,6 +484,7 @@ export default {
message: message, message: message,
type: 'success' type: 'success'
}); });
this.pullAllApplicationType()
}else{ }else{
this.$message.error('操作失败,请稍后重试!!!'); this.$message.error('操作失败,请稍后重试!!!');
} }
...@@ -491,10 +493,12 @@ export default { ...@@ -491,10 +493,12 @@ export default {
changeHandleSize(val) { changeHandleSize(val) {
// console.log(`每页 ${val} 条`); // console.log(`每页 ${val} 条`);
this.typePagination.pageSize = val this.typePagination.pageSize = val
this.pullListApplicationType()
}, },
changeHandleCurrent(val) { changeHandleCurrent(val) {
// console.log(`当前页: ${val}`); // console.log(`当前页: ${val}`);
this.typePagination.currentPage = val this.typePagination.currentPage = val
this.pullListApplicationType()
}, },
onPreview(url){ onPreview(url){
this.form.coverImg = url this.form.coverImg = url
...@@ -648,6 +652,7 @@ export default { ...@@ -648,6 +652,7 @@ export default {
width: 50px; width: 50px;
height: 50px; height: 50px;
object-fit: cover; object-fit: cover;
cursor: pointer;
} }
.operators { .operators {
width: 300px; width: 300px;
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2020-12-04 09:09:37 * @Date: 2020-12-04 09:09:37
* @LastEditTime: 2020-12-04 13:59:25 * @LastEditTime: 2020-12-09 11:34:15
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\industryApplication\applicationList\addApp\index.vue * @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\industryApplication\applicationList\addApp\index.vue
...@@ -15,19 +15,19 @@ ...@@ -15,19 +15,19 @@
</div> </div>
</div> </div>
<div class="content"> <div class="content">
<el-form ref="form" :model="form" label-width="120px"> <el-form ref="form" :rules="rules" :model="form" label-width="120px">
<div class="item"> <div class="item">
<div class="title">基本信息</div> <div class="title">基本信息</div>
<div class="form"> <div class="form">
<el-form-item label="*应用名称"> <el-form-item label="应用名称" prop="title">
<el-col :span="12"> <el-col :span="12">
<el-input v-model="form.name" placeholder="请输入应用名称"></el-input> <el-input v-model="form.title" placeholder="请输入应用名称"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="*封面图"> <el-form-item label="封面图" prop="coverImg">
<singleImageX :value="form.coverImg" @input="onCoverPreview"></singleImageX> <singleImageX :value="form.coverImg" @input="onCoverPreview"></singleImageX>
</el-form-item> </el-form-item>
<el-form-item label="*详情图"> <el-form-item label="详情图" prop="detailImg">
<singleImageX :value="form.detailImg" @input="onDetailPreview"></singleImageX> <singleImageX :value="form.detailImg" @input="onDetailPreview"></singleImageX>
</el-form-item> </el-form-item>
</div> </div>
...@@ -35,53 +35,53 @@ ...@@ -35,53 +35,53 @@
<div class="item"> <div class="item">
<div class="title">应用参数</div> <div class="title">应用参数</div>
<div class="form"> <div class="form">
<el-form-item label="*行业"> <el-form-item label="行业" prop="industry">
<el-col :span="12"> <el-col :span="12">
<el-input v-model="form.industry" placeholder="请输入行业"></el-input> <el-input v-model="form.industry" placeholder="请输入行业"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="*地区"> <el-form-item label="地区" prop="region">
<el-col :span="12"> <el-col :span="12">
<el-input v-model="form.region" placeholder="请输入地区"></el-input> <el-input v-model="form.region" placeholder="请输入地区"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="*数据采集时间"> <el-form-item label="数据采集时间" prop="collectTime">
<el-col :span="12"> <el-col :span="12">
<el-input v-model="form.collectTime" placeholder="请输入数据采集时间"></el-input> <el-input v-model="form.collectTime" placeholder="请输入数据采集时间"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="*数据来源"> <el-form-item label="数据来源" prop="origin">
<el-col :span="12"> <el-col :span="12">
<el-input v-model="form.origin" placeholder="请输入数据来源"></el-input> <el-input v-model="form.origin" placeholder="请输入数据来源"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="*成果形式"> <el-form-item label="成果形式" prop="achievement">
<el-col :span="12"> <el-col :span="12">
<el-input v-model="form.achievement" placeholder="请输入成果形式"></el-input> <el-input v-model="form.achievement" placeholder="请输入成果形式"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="*分辨率"> <el-form-item label="分辨率" prop="resolvpower">
<el-col :span="12"> <el-col :span="12">
<el-input v-model="form.resolvpower" placeholder="请输入分辨率"></el-input> <el-input v-model="form.resolvpower" placeholder="请输入分辨率"></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="*是否提供样例"> <el-form-item label="是否提供样例" prop="isSample">
<el-radio-group v-model="form.isSample"> <el-radio-group v-model="form.isSample">
<el-radio-button label="是"></el-radio-button> <el-radio-button label="是"></el-radio-button>
<el-radio-button label="否"></el-radio-button> <el-radio-button label="否"></el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="*是否提供定制"> <el-form-item label="是否提供定制" prop="isCustomized">
<el-radio-group v-model="form.isCustomized"> <el-radio-group v-model="form.isCustomized">
<el-radio-button label="是"></el-radio-button> <el-radio-button label="是"></el-radio-button>
<el-radio-button label="否"></el-radio-button> <el-radio-button label="否"></el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="*上传样例"> <el-form-item label="上传样例" prop="fileList">
<el-upload class="upload-demo" action="#" :auto-upload="false" :on-preview="handlePreview" :on-remove="handleRemove" <el-upload class="upload-demo" action="#" :auto-upload="false" :on-preview="handlePreview" :on-remove="handleRemove"
:before-remove="beforeRemove" multiple :limit="100" :on-exceed="handleExceed" :http-request="onUploadRequest" :file-list="form.fileList"> :before-remove="beforeRemove" multiple :limit="100" :on-exceed="handleExceed" :http-request="onUploadRequest" :file-list="form.fileList">
<el-button size="small" type="primary">点击上传</el-button> <el-button size="small" type="primary">上传文件</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</div> </div>
...@@ -89,8 +89,8 @@ ...@@ -89,8 +89,8 @@
<div class="item"> <div class="item">
<div class="title">应用简介</div> <div class="title">应用简介</div>
<div class="form"> <div class="form">
<el-form-item label="*产品简介"> <el-form-item label="产品简介" prop="introduction">
<kind-editor id="editor_id" :content.sync="form.editorText" :afterChange="afterChange()" :loadStyleMode="false"@on-content-change="onContentChange"></kind-editor> <kind-editor id="editor_id" :content.sync="form.introduction" :afterChange="afterChange()" :loadStyleMode="false" @on-content-change="onContentChange"></kind-editor>
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
...@@ -106,6 +106,9 @@ ...@@ -106,6 +106,9 @@
<script> <script>
import singleImageX from '@/components/Upload/singleImageX'; import singleImageX from '@/components/Upload/singleImageX';
import KindEditor from "@/components/Kindeditor"; import KindEditor from "@/components/Kindeditor";
import {
addUpdateApplicationInfo
} from "api/website/industryApplication/index";
export default { export default {
name: 'addApp', name: 'addApp',
components: { components: {
...@@ -114,24 +117,74 @@ export default { ...@@ -114,24 +117,74 @@ export default {
}, },
data(){ data(){
return { return {
rules:{
//title coverImg detailImg industry region collectTime origin achievement resolvpower isSample isCustomized fileList introduction
title: [{ required: true, message: '请输入应用名称', trigger: 'blur' }],
coverImg: [{ required: true, message: '请上传封面图', trigger: 'blur' }],
detailImg: [{ required: true, message: '请上传详情图', trigger: 'blur' }],
industry: [{ required: true, message: '请输入行业', trigger: 'blur' }],
region: [{ required: true, message: '请输入地区', trigger: 'blur' }],
collectTime: [{ required: true, message: '请输入数据采集时间', trigger: 'blur' }],
origin: [{ required: true, message: '请输入数据来源', trigger: 'blur' }],
achievement: [{ required: true, message: '请输入成果形式', trigger: 'blur' }],
resolvpower: [{ required: true, message: '请输入分辨率', trigger: 'blur' }],
isSample: [{ required: true, message: '是否提供样例', trigger: 'blur' }],
isCustomized: [{ required: true, message: '是否提供定制', trigger: 'blur' }],
fileList: [{ required: true, message: '请上传样例', trigger: 'blur' }],
introduction: [{ required: true, message: '请输入产品简介', trigger: 'blur' }],
},
form: { form: {
name: '', title: '',// 应用名称
coverImg: '', coverImg: '',// 封面图
detailImg: '', detailImg: '',// 详情图
industry: '', industry: '',// 行业
region: '', region: '',// 地区
collectTime: '', collectTime: '',// 采集时间
origin: '', origin: '',// 数据来源
achievement: '', achievement: '',// 成果形式
resolvpower: '', resolvpower: '',// 分辨率
isSample: '是', isSample: '是',// 是否提供样例
isCustomized: '是', isCustomized: '是',// 是否定制
fileList: [], fileList: [],// 样例图片路径集合
editorText: '', // 双向同步的变量 introduction: '', // 简介
} }
} }
}, },
mounted() { mounted() {
if(!!this.$parent.info){
let info = this.$parent.info
let attribute = eval("(" + info.attribute + ")")
console.log("info=>",info)
console.log("获取到的编辑数据=>",attribute)
this.form.title = info.title
this.form.coverImg = info.coverImg
this.form.detailImg = info.icon.url
this.form.industry = attribute.industry
this.form.region = attribute.area
this.form.collectTime = attribute.date
this.form.origin = attribute.source
this.form.achievement = attribute.achievements
this.form.resolvpower = attribute.ratio
this.form.isSample = info.examples==0?"否":"是"
this.form.fileList = info.examples!=0?eval("("+info.examplesJson+")"):[]
this.form.introduction = info.introduction
this.form.isCustomized = info.customized==1?"是":"否"
// this.form = {
// title: info.title,// 应用名称
// coverImg: info.coverImg,// 封面图
// detailImg: info.icon.url,// 详情图
// industry: attribute.industry,// 行业
// region: attribute.area,// 地区
// collectTime: attribute.date,// 采集时间
// origin: attribute.source,// 数据来源
// achievement: attribute.achievements,// 成果形式
// resolvpower: attribute.ratio,// 分辨率
// isCustomized: '是',// 是否定制
// isSample: info.examples==0?"是":"否",// 是否提供样例
// fileList: info.examples==0?eval("("+info.examplesJson+")"):[],// 样例图片路径集合
// introduction: info.introduction, // 简介
// }
}
this.$bus.$emit('hideThreeRoute',false) this.$bus.$emit('hideThreeRoute',false)
}, },
beforeDestroy(){ beforeDestroy(){
...@@ -148,30 +201,126 @@ export default { ...@@ -148,30 +201,126 @@ export default {
this.$parent.componentName='appList' this.$parent.componentName='appList'
this.$bus.$emit('hideThreeRoute',true) this.$bus.$emit('hideThreeRoute',true)
}, },
// 上传样例 // 上传样例Begin
handlePreview(file) {
console.log("handlePreview=>",file);
},
handleRemove(file, fileList) {
console.log("handleRemove=>",file);
console.log("handleRemove=>",fileList);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${ file.name }?`);
},
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
},
onUploadRequest(data) { onUploadRequest(data) {
console.log("uploadData=>",data) console.log("uploadData=>",data)
}, },
// 上传样例End
onCoverPreview(url){ onCoverPreview(url){
this.form.coverImg = url this.form.coverImg = url
}, },
onDetailPreview(url){ onDetailPreview(url){
this.form.detailImg = url this.form.detailImg = url
}, },
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${ file.name }?`);
},
onSubmit() { onSubmit() {
console.log('submit!'); if(this.form.title==''){
this.$message.error('请输入应用名称!!!');
}else if(this.form.coverImg==''){
this.$message.error('请上传封面图!!!');
}else if(this.detailImg==''){
this.$message.error('请上传详情图!!!');
}else if(this.form.introduction==''){
this.$message.error('请输入产品简介!!!');
}else if(this.form.industry==''){
this.$message.error('请输入行业!!!');
}else if(this.form.region==''){
this.$message.error('请输入地区!!!');
}else if(this.form.achievement==''){
this.$message.error('请输入成果形式!!!');
}else if(this.form.origin==''){
this.$message.error('请输入数据来源!!!');
}else if(this.form.collectTime==''){
this.$message.error('请输入数据采集时间!!!');
}else if(this.form.resolvpower==''){
this.$message.error('请输入分辨率!!!');
}else if(this.form.isSample=="是"&&this.form.fileList.length==0){
this.$message.error('请上传样例!!!');
}else{
let data,message
if(this.$parent.info){
data = {
id: this.$parent.info.id,
title: this.form.title,
coverImg: this.form.coverImg,
detailImg: this.form.detailImg,
introduction: this.form.introduction,
attribute: JSON.stringify({
industry: this.form.industry,
area: this.form.region,
achievements: this.form.achievement,
source: this.form.origin,
date: this.form.collectTime,
ratio: this.form.resolvpower
}),
examples: this.form.isSample=="是" ? 1 : 0,
examplesJson: JSON.stringify(this.form.fileList),
protection: this.$parent.protection,
rank: this.$parent.info.rank,
status: this.$parent.info.status,
firstTypeId: this.$parent.info.firstTypeId,
firstTitle: this.$parent.info.firstTitle,
secondTypeId: this.$parent.info.secondTypeId,
secondTitle: this.$parent.info.secondTitle,
indexShow: this.$parent.info.indexShow,
isDel: this.$parent.info.isDel,
customized: this.form.isCustomized=="是"?1:2,
}
message = "修改成功!!!"
}else {
data = {
title: this.form.title,
coverImg: this.form.coverImg,
detailImg: this.form.detailImg,
introduction: this.form.introduction,
attribute: JSON.stringify({
industry: this.form.industry,
area: this.form.region,
achievements: this.form.achievement,
source: this.form.origin,
date: this.form.collectTime,
ratio: this.form.resolvpower
}),
examples: this.form.isSample=="是" ? 1 : 0,
examplesJson: JSON.stringify(this.form.fileList),
protection: "",
indexShow: 1,
isDel: 0,
status: 1,
rank: 0,
firstTypeId: 0,
firstTitle: "",
secondTypeId: 0,
secondTitle: "",
customized: this.form.isCustomized=="是" ? 1 : 2
}
message = "添加成功!!!"
}
addUpdateApplicationInfo(data).then(res => {
if(res.status==200){
this.$message({
message: message,
type: 'success'
});
this.$parent.componentName = "appList"
this.$parent.info = null
}else{
this.$message.error('操作失败,请稍后重试!!!');
}
});
}
} }
}, },
} }
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2020-12-02 10:27:53 * @Date: 2020-12-02 10:27:53
* @LastEditTime: 2020-12-04 09:49:19 * @LastEditTime: 2020-12-09 11:14:00
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\industryApplication\applicationList\index.vue * @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\industryApplication\applicationList\index.vue
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</div> </div>
</div> </div>
<div class="addApp"> <div class="addApp">
<div class="add" @click="$parent.componentName = 'addApp'"> <div class="add" @click.stop="addApp">
新增应用 新增应用
</div> </div>
</div> </div>
...@@ -69,12 +69,12 @@ ...@@ -69,12 +69,12 @@
</el-table-column> </el-table-column>
<el-table-column label="应用类别" width="200" align="center"> <el-table-column label="应用类别" width="200" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.type }}</span> <span>{{ getAttributeIndustry(scope.row.attribute) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="应用名称" align="center"> <el-table-column label="应用名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="introduce">{{ scope.row.name }}</span> <span class="introduce">{{ scope.row.title }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="详情图" align="center"> <el-table-column label="详情图" align="center">
...@@ -90,12 +90,12 @@ ...@@ -90,12 +90,12 @@
</el-table-column> </el-table-column>
<el-table-column label="发布时间" width="150" align="center"> <el-table-column label="发布时间" width="150" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.date }}</span> <span>{{ scope.row.crtTime }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" width="150" align="center"> <el-table-column label="状态" width="150" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.status }}</span> <span>{{ scope.row.status==1?"上架":"下架" }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="150" align="center"> <el-table-column label="操作" width="150" align="center">
...@@ -103,15 +103,27 @@ ...@@ -103,15 +103,27 @@
<!-- <span>{{scope.row.operator}}</span> --> <!-- <span>{{scope.row.operator}}</span> -->
<span> <span>
<div class="operators"> <div class="operators">
<div class="edit">编辑</div> <div class="edit" @click.stop="editApp(scope.row)">编辑</div>
<div class="offshelf">下架</div> <div class="offshelf" v-if="scope.row.status==1" @click.stop="changeInfoStatus(scope.row)">下架</div>
<div class="delete">删除</div> <div class="upshelf" v-else @click.stop="changeInfoStatus(scope.row)">上架</div>
<div class="delete" @click.stop="delInfo(scope.row)">删除</div>
</div> </div>
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="infoPagination" v-show="infoPagination">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="infoPagination.currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="infoPagination.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="infoPagination.total">
</el-pagination>
</div>
<!-- 使用图片查看器预览当前缩略图 --> <!-- 使用图片查看器预览当前缩略图 -->
<el-image-viewer <el-image-viewer
v-if="currentIcon.showPreview" v-if="currentIcon.showPreview"
...@@ -130,6 +142,8 @@ import { ...@@ -130,6 +142,8 @@ import {
getAllApplicationType, getAllApplicationType,
getListApplicationType, getListApplicationType,
addUpdateApplicationType, addUpdateApplicationType,
getListApplicationInfo,
addUpdateApplicationInfo
} from "api/website/industryApplication/index"; } from "api/website/industryApplication/index";
export default { export default {
name: "ApplicationList", name: "ApplicationList",
...@@ -153,51 +167,204 @@ export default { ...@@ -153,51 +167,204 @@ export default {
//所有状态 //所有状态
status: [ status: [
{ {
value: "1", value: "",
label: "全部", label: "全部",
}, },
{ {
value: "2", value: "1",
label: "上架", label: "上架",
}, },
{ {
value: "3", value: "2",
label: "下架", label: "下架",
}, },
], ],
currentStatus: "",
// 所有类别 // 所有类别
types: [ types: [
{ {
value: "1", value: "",
label: "全部", label: "全部",
}, },
{
value: "2",
label: "数字农业",
},
], ],
currentType: "全部", currentType: "",
currentStatus: "全部",
// 表格数据 // 表格数据
tableDataCache: [],
tableData: [ tableData: [
{ // {
id: "1", // id: "1",
type: "类别", // type: "类别",
name: "名称", // name: "名称",
icon: { // icon: {
url: "https://onemap.obtdata.com/wx/download/world.png", // url: "https://onemap.obtdata.com/wx/download/world.png",
showPreview: false, // showPreview: false,
}, // },
date: "发布时间", // date: "发布时间",
status: "状态", // status: "状态",
}, // },
], ],
infoPagination: {
currentPage: 1,// 当前页码
pageSize: 10,// 每页查询数量
total: 0,// 总记录数量
},
}; };
}, },
mounted() {}, mounted() {
this.pullListApplicationInfo()
},
methods: { methods: {
getAttributeIndustry(attribute){
return eval("("+attribute+")").industry
},
editApp(info){
this.$parent.componentName = 'addApp'
this.$parent.info = info
},
addApp(){
this.$parent.componentName = 'addApp'
this.$parent.info = null
},
// 分页获取应用详情数据
pullListApplicationInfo(){
getListApplicationInfo({
page: this.infoPagination.currentPage,
limit: this.infoPagination.pageSize
}).then(res => {
if(res.status==200){
console.log("分页获取到的数据=>",res)
this.tableDataCache = []
this.tableData = []
this.infoPagination.total = res.data.totalCount
res.data.data.forEach(element => {
this.tableDataCache.push(element)
});
this.tableDataCache.forEach(element => {
// 未被删除的
if(element.isDel==0){
this.tableData.push({
attribute:element.attribute,
examples:element.examples,
examplesJson: element.examplesJson,
id: element.id,
indexShow:element.indexShow,
introduction:element.introduction,
isDel:element.isDel,
protection:element.protection,
rank: element.rank,
firstTypeId:element.firstTypeId,
firstTitle: element.firstTitle,
secondTypeId:element.secondTypeId,
secondTitle:element.secondTitle,
title: element.title,
coverImg:element.coverImg,
icon: {
url: element.detailImg,
showPreview: false,
},
crtTime: element.crtTime,
status: element.status,
updTime: element.updTime,
customized: element.customized,
});
}
});
}
})
},
// 删除应用详情
delInfo(info){
this.$confirm('确定继续执行该操作吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let data = {
id: info.id,
title: info.title,
coverImg: info.coverImg,
detailImg: info.icon.url,
introduction: info.introduction,
attribute: info.attribute,
examples: info.examples,
examplesJson: info.examplesJson,
protection: info.protection,
rank: info.rank,
status: info.status,
firstTypeId: info.firstTypeId,
secondTypeId: info.secondTypeId,
indexShow: info.indexShow,
firstTitle: info.firstTitle,
secondTitle: info.secondTitle,
isDel: "1",
customized: info.customized,
}
console.log("删除data=>",data)
addUpdateApplicationInfo(data).then(res => {
if(res.status==200){
this.$message({
message: "删除成功!!!",
type: 'success'
});
this.pullListApplicationInfo()
}else{
this.$message.error('操作失败,请稍后重试!!!');
}
});
})
},
// 上下架数据
changeInfoStatus(info){
console.log("info=>",info)
let message = ""
if(info.status==1){// 当前为上架
info.status=2
message = "下架成功!!!"
}else{
info.status=1
message = "上架成功!!!"
}
addUpdateApplicationInfo({
id: info.id,
title: info.title,
coverImg: info.coverImg,
detailImg: info.icon.url,
introduction: info.introduction,
attribute: info.attribute,
examples: info.examples,
examplesJson: info.examplesJson,
protection: info.protection,
rank: info.rank,
status: info.status,
firstTypeId: info.firstTypeId,
secondTypeId: info.secondTypeId,
indexShow: info.indexShow,
firstTitle: info.firstTitle,
secondTitle: info.secondTitle,
customized: info.customized,
}).then(res => {
if(res.status==200){
this.$message({
message: message,
type: 'success'
});
}else{
this.$message.error('操作失败,请稍后重试!!!');
}
});
},
handleSizeChange(val) {
// console.log(`每页 ${val} 条`);
this.infoPagination.pageSize = val
this.pullListApplicationInfo()
},
handleCurrentChange(val) {
// console.log(`当前页: ${val}`);
this.infoPagination.currentPage = val
this.pullListApplicationInfo()
},
onPreview(url){ onPreview(url){
this.form.coverImg = url this.form.coverImg = url
}, },
showPreview(icon) { showPreview(icon) {
this.currentIcon = icon; this.currentIcon = icon;
...@@ -297,6 +464,7 @@ export default { ...@@ -297,6 +464,7 @@ export default {
width: 50px; width: 50px;
height: 50px; height: 50px;
object-fit: cover; object-fit: cover;
cursor: pointer;
} }
.operators { .operators {
width: 300px; width: 300px;
...@@ -306,6 +474,7 @@ export default { ...@@ -306,6 +474,7 @@ export default {
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
.edit, .edit,
.upshelf,
.offshelf, .offshelf,
.delete { .delete {
width: auto; width: auto;
...@@ -316,15 +485,22 @@ export default { ...@@ -316,15 +485,22 @@ export default {
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
} }
.edit, .edit,.upshelf{
.offshelf {
color: #1890ff; color: #1890ff;
} }
.offshelf {
color: #A6A9AD;
}
.delete { .delete {
color: #fe4066; color: #fe4066;
} }
} }
} }
} }
.infoPagination{
margin: 1% 1% 0 1%;
width: 98%;
height: auto;
}
} }
</style> </style>
\ No newline at end of file
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2020-12-02 10:27:53 * @Date: 2020-12-02 10:27:53
* @LastEditTime: 2020-12-08 14:32:42 * @LastEditTime: 2020-12-09 09:43:51
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 应用详情 * @Description: 应用详情
* @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\industryApplication\applicationList\index.vue * @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\industryApplication\applicationList\index.vue
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<script> <script>
import appList from './appList/index' import appList from './appList/index'
import addApp from './addApp/index' import addApp from './addUpApp/index'
export default { export default {
name: 'Container', name: 'Container',
components: { components: {
...@@ -26,6 +26,7 @@ export default { ...@@ -26,6 +26,7 @@ export default {
data(){ data(){
return { return {
componentName: "appList", componentName: "appList",
info: null,
} }
}, },
mounted() { mounted() {
......
<!-- <!--
* @Author: Jenkins * @Author: Jenkins
* @Date: 2020-12-01 09:54:12 * @Date: 2020-12-01 09:54:12
* @LastEditTime: 2020-12-08 14:24:04 * @LastEditTime: 2020-12-09 11:14:35
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 星云动态 * @Description: 星云动态
* @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\newsCategory\index.vue * @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\newsCategory\index.vue
...@@ -1031,6 +1031,7 @@ export default { ...@@ -1031,6 +1031,7 @@ export default {
width: 50px; width: 50px;
height: 50px; height: 50px;
object-fit: cover; object-fit: cover;
cursor: pointer;
} }
.operators { .operators {
width: 300px; width: 300px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment