Commit 7cb05221 authored by rencs's avatar rencs

Merge branch 'dev_ren' into 'master'

1.4 上传源文件

See merge request !22
parents 486550b3 0b6d7446
...@@ -35,26 +35,76 @@ ...@@ -35,26 +35,76 @@
@input="(val, info) => getSrc('coverImg', val)" @input="(val, info) => getSrc('coverImg', val)"
></my-upload> ></my-upload>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="上传源文件">
label="上传源文件" <!-- :prop="'imageInfoRelationList.url' && 'imageInfoRelationList.price'" -->
:prop="'imageInfoRelationList.url' && 'imageInfoRelationList.price'"
>
<!-- 上传 --> <!-- 上传 -->
<my-upload <!-- <my-upload
refName="upload2" refName="upload2"
:value="ruleForm.imageInfoRelationList.url" :value="ruleForm.imageInfoRelationList.url"
@input="(val, info) => getSrc('imageInfoRelationList', val, info)" @input="(val, info) => getSrc('imageInfoRelationList', val, info)"
></my-upload> ></my-upload> -->
<div v-if="ruleForm.imageInfoRelationList.fileWidth"> <!-- <div v-if="ruleForm.imageInfoRelationList.fileWidth">
尺寸大小:{{ ruleForm.imageInfoRelationList.fileWidth }} 尺寸大小:{{ ruleForm.imageInfoRelationList.fileWidth }}
</div> </div> -->
<el-input <!-- <el-input
class="half-width" class="half-width"
size="small" size="small"
v-model="ruleForm.imageInfoRelationList.price" v-model="ruleForm.imageInfoRelationList.price"
placeholder="请输入价格" placeholder="请输入价格"
></el-input> ></el-input> -->
<el-upload
class="upload-demo"
:action="BASE_API + '/api/datacenter/bg/gtdata/upload'"
:on-success="handleDataUpSuccess"
:headers="getHeaderWithToken"
:show-file-list="false"
>
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
<el-row
style="
display: flex;
align-items: center;
margin-top: 10px;
box-sizing:border-box;
margin-bottom:5px
border-bottom: 1px solid #f4f4f5;
"
v-for="(item, idx) in ruleForm.imageInfoRelationList"
:key="idx"
>
<el-col :span="3" style="display: flex; align-items: center">
<span>{{ item.url | filterUrl }}</span>
</el-col>
<el-col :span="6" style="display: flex; align-items: center">
<label>尺寸:&nbsp;</label>
<el-input
v-model="item.fileWidth"
placeholder="请输入尺寸大小"
style="width: 60%"
></el-input>
</el-col>
<el-col :span="6" style="display: flex; align-items: center">
<label>价格:&nbsp;</label>
<el-input-number
style="width: 80%"
v-model="item.price"
:min="0"
:step="0.01"
:precision="2"
></el-input-number>
</el-col>
<el-col :span="4">
<el-button
@click="del_dataImgItem(idx)"
type="primary"
icon="el-icon-delete"
>删除</el-button
>
</el-col>
</el-row>
</el-form-item> </el-form-item>
<el-alert <el-alert
...@@ -206,11 +256,20 @@ import MyUpload from "@/components/Upload/singleImageX"; //上传组件 ...@@ -206,11 +256,20 @@ import MyUpload from "@/components/Upload/singleImageX"; //上传组件
import { update, getAll, getDetail } from "@/api/website/imageLibrary"; import { update, getAll, getDetail } from "@/api/website/imageLibrary";
import KindEditor from "@/components/Kindeditor"; import KindEditor from "@/components/Kindeditor";
import { getToken } from "utils/auth";
export default { export default {
components: { components: {
MyUpload, MyUpload,
KindEditor, KindEditor,
}, },
filters: {
filterUrl: function (val) {
if (val) {
let idx = val.lastIndexOf("/");
return val.substring(idx + 1, val.length);
}
},
},
data() { data() {
let checkNumber = function (rule, value, callback) { let checkNumber = function (rule, value, callback) {
if (value === "") { if (value === "") {
...@@ -224,6 +283,7 @@ export default { ...@@ -224,6 +283,7 @@ export default {
} }
}; };
return { return {
BASE_API: process.env.BASE_API,
//1--影像美图 2--专题图 3--遥感成果图 //1--影像美图 2--专题图 3--遥感成果图
imageTypes: { imageTypes: {
1: "影像美图", 1: "影像美图",
...@@ -233,12 +293,7 @@ export default { ...@@ -233,12 +293,7 @@ export default {
ruleForm: { ruleForm: {
name: "", name: "",
coverImg: "", coverImg: "",
imageInfoRelationList: { imageInfoRelationList: [],
url: "",
price: null,
fileWidth: "",
fileSize: "",
},
intro: "", intro: "",
type: "", type: "",
relatedIds: "", relatedIds: "",
...@@ -258,13 +313,6 @@ export default { ...@@ -258,13 +313,6 @@ export default {
coverImg: [ coverImg: [
{ required: true, message: "请上传缩略图", trigger: "change" }, { required: true, message: "请上传缩略图", trigger: "change" },
], ],
"imageInfoRelationList.url": [
{ required: true, message: "请上传源文件", trigger: "change" },
],
"imageInfoRelationList.price": [
{ required: true, message: "请输入价格", trigger: "blur" },
{ validator: checkNumber, trigger: "blur" }, //校验是否是数字
],
type: [ type: [
{ required: true, message: "请选择影像类型", trigger: "change" }, { required: true, message: "请选择影像类型", trigger: "change" },
], ],
...@@ -316,6 +364,11 @@ export default { ...@@ -316,6 +364,11 @@ export default {
}, },
}; };
}, },
computed: {
getHeaderWithToken() {
return { Authorization: getToken() };
},
},
mounted() { mounted() {
//获取所有相似图像 //获取所有相似图像
this.getAllImages(); this.getAllImages();
...@@ -325,6 +378,30 @@ export default { ...@@ -325,6 +378,30 @@ export default {
this.$bus.$off("imageLibrary-edit-renderData"); this.$bus.$off("imageLibrary-edit-renderData");
}, },
methods: { methods: {
del_dataImgItem(idx) {
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.ruleForm.imageInfoRelationList.splice(idx, 1);
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
handleDataUpSuccess(res, file) {
this.ruleForm.imageInfoRelationList.push({
url: res.data.path,
price: 0,
fileWidth: "",
fileSize: res.data.size,
});
},
afterChange() {}, afterChange() {},
onContentChange(val) { onContentChange(val) {
this.ruleForm.intro = val; this.ruleForm.intro = val;
...@@ -387,10 +464,10 @@ export default { ...@@ -387,10 +464,10 @@ export default {
let val = params; let val = params;
let afterFormat = this.filterParams(val); let afterFormat = this.filterParams(val);
let data = JSON.parse(JSON.stringify(afterFormat)); let data = JSON.parse(JSON.stringify(afterFormat));
console.log(data);
// data.paramJson = JSON.parse(data.paramJson); // data.paramJson = JSON.parse(data.paramJson);
//注意:imageInfoRelationListParse为imageInfoRelationList参数的最后一项,赋值显示 //注意:imageInfoRelationListParse为imageInfoRelationList参数的最后一项,赋值显示
data.imageInfoRelationList = data.imageInfoRelationListParse[0]; data.imageInfoRelationList = data.imageInfoRelationListParse;
data.coverImg = data.coverImg || ""; data.coverImg = data.coverImg || "";
this.ruleForm = data; this.ruleForm = data;
this.images.selects = this.ruleForm.relatedIds.split(","); //相似图片转为数组格式 this.images.selects = this.ruleForm.relatedIds.split(","); //相似图片转为数组格式
...@@ -415,7 +492,7 @@ export default { ...@@ -415,7 +492,7 @@ export default {
for (let key in obj) { for (let key in obj) {
if (!b.includes(key)) { if (!b.includes(key)) {
if (key === "imageInfoRelationList") { if (key === "imageInfoRelationList") {
let temp = this.filterParams(obj[key][0]); let temp = this.filterParams(obj[key]);
obj[key] = [temp]; obj[key] = [temp];
} }
...@@ -442,8 +519,9 @@ export default { ...@@ -442,8 +519,9 @@ export default {
let params = JSON.parse(JSON.stringify(this.ruleForm)); let params = JSON.parse(JSON.stringify(this.ruleForm));
params.paramJson = JSON.stringify(params.paramJson); params.paramJson = JSON.stringify(params.paramJson);
params.imageInfoRelationList = [params.imageInfoRelationList]; // params.imageInfoRelationList = [params.imageInfoRelationList];
// console.log(params)
console.log(params);
//执行方法 //执行方法
update(params).then((res) => { update(params).then((res) => {
if (res.status == 200) { if (res.status == 200) {
...@@ -491,4 +569,9 @@ export default { ...@@ -491,4 +569,9 @@ export default {
.half-width { .half-width {
width: 50%; width: 50%;
} }
.dataImg {
width: 80px;
height: 80px;
border-radius: 5px;
}
</style> </style>
...@@ -9,29 +9,72 @@ ...@@ -9,29 +9,72 @@
<el-form :inline="true" :model="searchForm" class="demo-form-inline"> <el-form :inline="true" :model="searchForm" class="demo-form-inline">
<el-form-item label="所有状态"> <el-form-item label="所有状态">
<el-select v-model="searchForm.status" clearable> <el-select v-model="searchForm.status" clearable>
<el-option v-for="(item, index) in bannerStatus" :key="index" :label="item" :value="~~index"></el-option> <el-option
v-for="(item, index) in bannerStatus"
:key="index"
:label="item"
:value="~~index"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="影像分类"> <el-form-item label="影像分类">
<el-select v-model="searchForm.type" clearable> <el-select v-model="searchForm.type" clearable>
<el-option v-for="(item, index) in imageTypes" :key="index" :label="item" :value="~~index"></el-option> <el-option
v-for="(item, index) in imageTypes"
:key="index"
:label="item"
:value="~~index"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="卫星名称"> <el-form-item label="卫星名称">
<el-input v-model="searchForm.title" placeholder="请输入卫星名称"></el-input> <el-input
v-model="searchForm.title"
placeholder="请输入卫星名称"
></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" plain @click="search">搜索</el-button> <el-button type="primary" plain @click="search">搜索</el-button>
<el-button type="primary" plain @click="clearFilterData">清除搜索</el-button> <el-button type="primary" plain @click="clearFilterData"
>清除搜索</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<el-table :data="list" v-loading.body="listLoading" border fit highlight-current-row style="width: 100%"> <el-table
<el-table-column align="center" label="序号" prop="index" width="65"></el-table-column> :data="list"
<el-table-column align="center" label="产品名称" prop="name"></el-table-column> v-loading.body="listLoading"
<el-table-column align="center" label="产品类型" prop="paramJson.productType"></el-table-column> border
<el-table-column align="center" label="尺寸" prop="imageInfoRelationListParse[0].fileWidth"></el-table-column> fit
<el-table-column align="center" label="价格" prop="imageInfoRelationListParse[0].price"></el-table-column> highlight-current-row
style="width: 100%"
>
<el-table-column
align="center"
label="序号"
prop="index"
width="65"
></el-table-column>
<el-table-column
align="center"
label="产品名称"
prop="name"
></el-table-column>
<el-table-column
align="center"
label="产品类型"
prop="paramJson.productType"
></el-table-column>
<el-table-column
align="center"
label="尺寸"
prop="imageInfoRelationListParse[0].fileWidth"
></el-table-column>
<el-table-column
align="center"
label="价格"
prop="imageInfoRelationListParse[0].price"
></el-table-column>
<el-table-column align="center" label="状态"> <el-table-column align="center" label="状态">
<template slot-scope="scope"> <template slot-scope="scope">
{{ getStatus(scope.row.status) }} {{ getStatus(scope.row.status) }}
...@@ -39,9 +82,21 @@ ...@@ -39,9 +82,21 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="250"> <el-table-column align="center" label="操作" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" size="mini" @click="edit(scope.row)">编辑</el-button> <el-button type="primary" size="mini" @click="edit(scope.row)"
<el-button :type="scope.row.status === 1 ? 'info': 'warning'" size="mini" @click="changeParams(scope.row, 'status')">{{scope.row.status === 1 ? '下架': '上架'}}</el-button> >编辑</el-button
<el-button type="danger" size="mini" @click="changeParams(scope.row, 'isDel')">删除</el-button> >
<el-button
:type="scope.row.status === 1 ? 'info' : 'warning'"
size="mini"
@click="changeParams(scope.row, 'status')"
>{{ scope.row.status === 1 ? "下架" : "上架" }}</el-button
>
<el-button
type="danger"
size="mini"
@click="changeParams(scope.row, 'isDel')"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -54,7 +109,8 @@ ...@@ -54,7 +109,8 @@
:page-sizes="[10, 20, 30, 40]" :page-sizes="[10, 20, 30, 40]"
:page-size="listQuery.limit" :page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="~~total"> :total="~~total"
>
</el-pagination> </el-pagination>
<!-- <el-pagination <!-- <el-pagination
background background
...@@ -64,65 +120,63 @@ ...@@ -64,65 +120,63 @@
@current-change="currentChange"> @current-change="currentChange">
</el-pagination> --> </el-pagination> -->
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { satelliteIntroduction } from "@/utils/formDatas.js" import { satelliteIntroduction } from "@/utils/formDatas.js";
import { page, update } from "@/api/website/imageLibrary" import { page, update } from "@/api/website/imageLibrary";
export default { export default {
name: "satelliteIntroduction", name: "satelliteIntroduction",
data() { data() {
return { return {
data: null,//原数据 data: null, //原数据
list: [],//赋值数据 | 过滤数据 list: [], //赋值数据 | 过滤数据
total: 100, total: 100,
listLoading: true,//请求加载状态 listLoading: true, //请求加载状态
//请求参数。页码页数等 //请求参数。页码页数等
listQuery: this.$parent.pageInfo, listQuery: this.$parent.pageInfo,
//搜索表单 //搜索表单
searchForm: { searchForm: {
status: this.$parent.pageInfo.status, status: this.$parent.pageInfo.status,
type: this.$parent.pageInfo.type, type: this.$parent.pageInfo.type,
title: this.$parent.pageInfo.title title: this.$parent.pageInfo.title,
}, },
//添加banner与修改banner的form对象 //添加banner与修改banner的form对象
editForm: satelliteIntroduction.init(),//提交的表单参数 editForm: satelliteIntroduction.init(), //提交的表单参数
editFormInfo: satelliteIntroduction.formInfo,//表单项。 editFormInfo: satelliteIntroduction.formInfo, //表单项。
editFormRules: satelliteIntroduction.rules,//表单规则 editFormRules: satelliteIntroduction.rules, //表单规则
//是否启用,1、启用,2、禁用 //是否启用,1、启用,2、禁用
bannerStatus: { bannerStatus: {
// 0: '全部', // 0: '全部',
1: '启用', 1: "启用",
2: '禁用', 2: "禁用",
}, },
imageTypes: { imageTypes: {
//1--影像美图 2--专题图 3--遥感成果图 //1--影像美图 2--专题图 3--遥感成果图
// 0: '全部', // 0: '全部',
1: '影像美图', 1: "影像美图",
2: '专题图', 2: "专题图",
3: '遥感成果图', 3: "遥感成果图",
}, },
dialogVisible: false, dialogVisible: false,
dialogTitle: "新增卫星" dialogTitle: "新增卫星",
} };
}, },
mounted() { mounted() {
this.getList() this.getList();
}, },
methods: { methods: {
handleSizeChange(val) { handleSizeChange(val) {
this.listQuery.limit = val this.listQuery.limit = val;
this.getList(); this.getList();
}, },
changePageInfo(page) { changePageInfo(page) {
// this.listQuery = page; // this.listQuery = page;
this.$emit('recordPageInfo', page) this.$emit("recordPageInfo", page);
}, },
//搜索按钮 //搜索按钮
search() { search() {
...@@ -131,39 +185,40 @@ export default { ...@@ -131,39 +185,40 @@ export default {
type: this.searchForm.type || null, type: this.searchForm.type || null,
name: this.searchForm.title, name: this.searchForm.title,
page: 1, page: 1,
limit: 10 limit: 10,
} };
this.changePageInfo(this.listQuery) this.changePageInfo(this.listQuery);
this.getList(); this.getList();
}, },
//清除搜索 //清除搜索
clearFilterData() { clearFilterData() {
this.searchForm = { this.searchForm = {
status: 0, status: 0,
title: "" title: "",
} };
this.listQuery = { this.listQuery = {
status: this.searchForm.status || null, status: this.searchForm.status || null,
type: this.searchForm.type || null, type: this.searchForm.type || null,
name: this.searchForm.title, name: this.searchForm.title,
page: 1, page: 1,
limit: 10 limit: 10,
} };
this.changePageInfo(this.listQuery) this.changePageInfo(this.listQuery);
this.getList() this.getList();
}, },
//切换页码 //切换页码
currentChange(val) { currentChange(val) {
this.listQuery.page = val; this.listQuery.page = val;
this.changePageInfo(this.listQuery) this.changePageInfo(this.listQuery);
this.getList(); this.getList();
}, },
//编辑 //编辑
edit(row) { edit(row) {
this.$emit('change', 'Edit', row) console.log(row);
this.$emit("change", "Edit", row);
}, },
//校验表单 //校验表单
submitForm() { submitForm() {
...@@ -172,21 +227,21 @@ export default { ...@@ -172,21 +227,21 @@ export default {
if (valid) { if (valid) {
_this.updateFunc(); _this.updateFunc();
} else { } else {
console.log('error submit!!'); console.log("error submit!!");
return false; return false;
} }
}); });
}, },
//更新方法 //更新方法
updateFunc() { updateFunc() {
update(this.editForm).then(res => { update(this.editForm).then((res) => {
if (res.status == 200) { if (res.status == 200) {
this.dialogVisible = false; this.dialogVisible = false;
this.getList(); this.getList();
} else { } else {
this.$message.error(res.message); this.$message.error(res.message);
} }
}) });
}, },
//取消表单 //取消表单
resetForm() { resetForm() {
...@@ -195,21 +250,21 @@ export default { ...@@ -195,21 +250,21 @@ export default {
}, },
//新增banner //新增banner
addItem() { addItem() {
this.$emit('change', 'edit') this.$emit("change", "edit");
}, },
//获取状态 //获取状态
getStatus(val) { getStatus(val) {
return this.bannerStatus[val] return this.bannerStatus[val];
}, },
//上下架、删除更新 //上下架、删除更新
changeParams(row, key) { changeParams(row, key) {
this.$confirm('确定继续执行该操作吗?', '提示', { this.$confirm("确定继续执行该操作吗?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning",
}).then(() => { }).then(() => {
this.editForm = row; this.editForm = row;
if (key == 'isDel') { if (key == "isDel") {
this.editForm[key] = row[key] == 0 ? 1 : 0; this.editForm[key] = row[key] == 0 ? 1 : 0;
} else { } else {
this.editForm[key] = row[key] == 1 ? 2 : 1; this.editForm[key] = row[key] == 1 ? 2 : 1;
...@@ -217,34 +272,39 @@ export default { ...@@ -217,34 +272,39 @@ export default {
//更新专题 //更新专题
this.updateFunc(); this.updateFunc();
}) });
}, },
//获取banner列表 //获取banner列表
getList() { getList() {
this.listLoading = true; this.listLoading = true;
page(this.listQuery).then(res => { page(this.listQuery)
this.data = res.data.data; .then((res) => {
this.total = res.data.totalCount; this.data = res.data.data;
this.listLoading = false; this.total = res.data.totalCount;
this.list = res.data.data; this.listLoading = false;
this.list.forEach((element,index) => { this.list = res.data.data;
element.index = ((this.listQuery.page-1)*this.listQuery.limit)+(index+1) this.list.forEach((element, index) => {
}); element.index =
this.list = this.list.map(v => { (this.listQuery.page - 1) * this.listQuery.limit + (index + 1);
let len = v.imageInfoRelationList.length; });
//注意:imageInfoRelationList参数后端返回的是数组,编辑后的源文件图片被放在最后一项。所以取数组的最后一项 this.list = this.list.map((v) => {
v.imageInfoRelationListParse = len > 0 ? [v.imageInfoRelationList[v.imageInfoRelationList.length - 1]] : [] let len = v.imageInfoRelationList.length;
v.paramJson = JSON.parse(v.paramJson) //注意:imageInfoRelationList参数后端返回的是数组,编辑后的源文件图片被放在最后一项。所以取数组的最后一项
return v v.imageInfoRelationListParse = v.imageInfoRelationList;
// len > 0
// ? [v.imageInfoRelationList[v.imageInfoRelationList.length - 1]]
// : [];
v.paramJson = JSON.parse(v.paramJson);
return v;
});
}) })
.catch((err) => {
}).catch(err => { console.log("error", err);
console.log("error",err) this.listLoading = false;
this.listLoading = false; });
}) },
} },
} };
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -156,6 +156,31 @@ ...@@ -156,6 +156,31 @@
<!-- <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>
<el-form-item label="上传源文件" prop="sourceFile">
<el-upload
class="upload-demo"
:action="BASE_API + '/api/datacenter/bg/gtdata/upload'"
:on-success="handleDataUpSuccess"
:headers="getHeaderWithToken"
:show-file-list="false"
>
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
<el-row
style="
display: flex;
align-items: center;
margin-top: 10px;
box-sizing:border-box;
margin-bottom:5px
border-bottom: 1px solid #f4f4f5;
"
>
<el-col :span="3" style="display: flex; align-items: center">
<span>{{ form.sourceFile | filterUrl }}</span>
</el-col>
</el-row>
</el-form-item>
</div> </div>
</div> </div>
<div class="item"> <div class="item">
...@@ -197,6 +222,7 @@ import { ...@@ -197,6 +222,7 @@ import {
getAllApplicationType, getAllApplicationType,
addUpdateApplicationInfo, addUpdateApplicationInfo,
} from "api/website/industryApplication/index"; } from "api/website/industryApplication/index";
import { getToken } from "utils/auth";
export default { export default {
name: "addApp", name: "addApp",
components: { components: {
...@@ -204,8 +230,17 @@ export default { ...@@ -204,8 +230,17 @@ export default {
KindEditor, KindEditor,
ElImageViewer, ElImageViewer,
}, },
filters: {
filterUrl: function (val) {
if (val) {
let idx = val.lastIndexOf("/");
return val.substring(idx + 1, val.length);
}
},
},
data() { data() {
return { return {
BASE_API: process.env.BASE_API,
rules: { rules: {
type: [{ required: true, message: "请选择应用类别", trigger: "blur" }], type: [{ required: true, message: "请选择应用类别", trigger: "blur" }],
title: [{ required: true, message: "请输入应用名称", trigger: "blur" }], title: [{ required: true, message: "请输入应用名称", trigger: "blur" }],
...@@ -237,6 +272,9 @@ export default { ...@@ -237,6 +272,9 @@ export default {
{ required: true, message: "是否提供定制", trigger: "blur" }, { required: true, message: "是否提供定制", trigger: "blur" },
], ],
fileList: [{ required: true, message: "请上传样例", trigger: "blur" }], fileList: [{ required: true, message: "请上传样例", trigger: "blur" }],
sourceFile: [
{ required: true, message: "请上传源文件", trigger: "blur" },
],
introduction: [ introduction: [
{ required: true, message: "请输入产品简介", trigger: "blur" }, { required: true, message: "请输入产品简介", trigger: "blur" },
], ],
...@@ -256,6 +294,7 @@ export default { ...@@ -256,6 +294,7 @@ export default {
isCustomized: "是", // 是否定制 isCustomized: "是", // 是否定制
fileList: [], // 样例图片路径集合 fileList: [], // 样例图片路径集合
introduction: "", // 简介 introduction: "", // 简介
sourceFile: "", //源文件路径
}, },
currentIcon: { currentIcon: {
showPreview: false, showPreview: false,
...@@ -275,6 +314,11 @@ export default { ...@@ -275,6 +314,11 @@ export default {
}, },
}, },
}, },
computed: {
getHeaderWithToken() {
return { Authorization: getToken() };
},
},
mounted() { mounted() {
this.pullAllApplicationType(); this.pullAllApplicationType();
if (!!this.$parent.info) { if (!!this.$parent.info) {
...@@ -287,7 +331,7 @@ export default { ...@@ -287,7 +331,7 @@ export default {
this.form.detailImg = info.icon.url; this.form.detailImg = info.icon.url;
console.log(info); console.log(info);
this.form.price = info.price; this.form.price = info.price;
this.form.sourceFile = info.sourceFile;
this.form.industry = attribute.industry; this.form.industry = attribute.industry;
this.form.region = attribute.area; this.form.region = attribute.area;
this.form.collectTime = attribute.date; this.form.collectTime = attribute.date;
...@@ -321,6 +365,9 @@ export default { ...@@ -321,6 +365,9 @@ export default {
this.$bus.$emit("hideThreeRoute", true); this.$bus.$emit("hideThreeRoute", true);
}, },
methods: { methods: {
handleDataUpSuccess(res, file) {
this.form.sourceFile = res.data.path;
},
// 获取所有应用类型 // 获取所有应用类型
pullAllApplicationType() { pullAllApplicationType() {
this.firstTypes = []; this.firstTypes = [];
...@@ -460,6 +507,7 @@ export default { ...@@ -460,6 +507,7 @@ export default {
coverImg: this.form.coverImg, coverImg: this.form.coverImg,
detailImg: this.form.detailImg, detailImg: this.form.detailImg,
price: this.form.price, price: this.form.price,
sourceFile: this.form.sourceFile,
introduction: this.form.introduction, introduction: this.form.introduction,
attribute: JSON.stringify({ attribute: JSON.stringify({
industry: this.form.industry, industry: this.form.industry,
...@@ -496,6 +544,7 @@ export default { ...@@ -496,6 +544,7 @@ export default {
detailImg: this.form.detailImg, detailImg: this.form.detailImg,
introduction: this.form.introduction, introduction: this.form.introduction,
price: this.form.price, price: this.form.price,
sourceFile: this.form.sourceFile,
attribute: JSON.stringify({ attribute: JSON.stringify({
industry: this.form.industry, industry: this.form.industry,
area: this.form.region, area: this.form.region,
......
...@@ -302,6 +302,7 @@ export default { ...@@ -302,6 +302,7 @@ export default {
id: element.id, id: element.id,
attribute: element.attribute, attribute: element.attribute,
price: element.price, price: element.price,
sourceFile: element.sourceFile,
examples: element.examples, examples: element.examples,
examplesJson: element.examplesJson, examplesJson: element.examplesJson,
indexShow: element.indexShow, indexShow: element.indexShow,
......
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