Commit 16096425 authored by obt's avatar obt

星空动态完成代码更新

parent cf0c03e4
/* /*
* @Author: Jenkins * @Author: Jenkins
* @Date: 2020-12-02 09:18:01 * @Date: 2020-12-02 09:18:01
* @LastEditTime: 2020-12-07 16:03:52 * @LastEditTime: 2020-12-08 10:57:37
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 星云动态页请求接口 * @Description: 星云动态页请求接口
* @FilePath: \rs-cloud-platform-ui\src\api\wsmanagement\newsCategory\index.js * @FilePath: \rs-cloud-platform-ui\src\api\wsmanagement\newsCategory\index.js
...@@ -26,6 +26,7 @@ export function getAllnewsType(){ ...@@ -26,6 +26,7 @@ export function getAllnewsType(){
*/ */
export function getListnewsType(obj){ export function getListnewsType(obj){
return fetch({ return fetch({
// url: '/api/website/newsType/getList',
url: '/api/website/newsType/getList', url: '/api/website/newsType/getList',
method: 'get', method: 'get',
params: obj params: obj
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2020-12-01 09:54:12 * @Date: 2020-12-01 09:54:12
* @LastEditTime: 2020-12-07 18:31:07 * @LastEditTime: 2020-12-08 09:59:45
* @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\newsCategory\index.vue * @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\newsCategory\index.vue
...@@ -26,7 +26,8 @@ export default { ...@@ -26,7 +26,8 @@ export default {
data(){ data(){
return { return {
componentName: 'nebulaDynamics', componentName: 'nebulaDynamics',
regions:[] regions:[],
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-07 20:59:50 * @LastEditTime: 2020-12-08 14:24:04
* @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
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 类型管理弹框 --> <!-- 类型管理弹框 -->
<el-dialog title="类型管理" :visible.sync="typeManagerVisible" append-to-body> <el-dialog title="类型管理" :visible.sync="typeManagerVisible" append-to-body>
<div id="typeManager"> <div id="typeManager">
...@@ -59,15 +60,16 @@ ...@@ -59,15 +60,16 @@
<span> <span>
<div class="operators"> <div class="operators">
<div class="edit" @click.stop="clickTypeEditor(scope.row)">编辑</div> <div class="edit" @click.stop="clickTypeEditor(scope.row)">编辑</div>
<div class="offshelf" v-if="scope.row.status==1">下架</div> <div class="offshelf" v-if="scope.row.status==1" @click.stop="changeTypeStatus(scope.row)">下架</div>
<div class="upshelf" v-else>上架</div> <div class="upshelf" v-else @click.stop="changeTypeStatus(scope.row)">上架</div>
<div class="delete">删除</div> <div class="delete" @click.stop="delType(scope.row)">删除</div>
</div> </div>
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="typePagination"> <div class="typePagination">
<el-pagination <el-pagination
@size-change="changeHandleSize" @size-change="changeHandleSize"
...@@ -257,9 +259,9 @@ ...@@ -257,9 +259,9 @@
<span> <span>
<div class="operators"> <div class="operators">
<div class="edit" @click.stop="editorInfo(scope.row)">编辑</div> <div class="edit" @click.stop="editorInfo(scope.row)">编辑</div>
<div class="offshelf" v-if="scope.row.status == 1">下架</div> <div class="offshelf" v-if="scope.row.status == 1" @click.stop="changeInfoStatus(scope.row)">下架</div>
<div class="upshelf" v-else>上架</div> <div class="upshelf" v-else @click.stop="changeInfoStatus(scope.row)">上架</div>
<div class="delete">删除</div> <div class="delete" @click.stop="delInfo(scope.row)">删除</div>
</div> </div>
</span> </span>
</template> </template>
...@@ -277,11 +279,11 @@ ...@@ -277,11 +279,11 @@
:total="infoPagination.total"> :total="infoPagination.total">
</el-pagination> </el-pagination>
</div> </div>
<el-dialog title="资讯编辑" :visible.sync="infoEditorVisible" append-to-body> <!-- <el-dialog title="资讯编辑" :visible.sync="infoEditorVisible" append-to-body>
<div id="infoEditor"> <div id="infoEditor">
</div> </div>
</el-dialog> </el-dialog> -->
<!-- 使用图片查看器预览当前缩略图 --> <!-- 使用图片查看器预览当前缩略图 -->
<el-image-viewer v-if="currentIcon.showPreview" :on-close="closePreview" :url-list="[currentIcon.url]"/> <el-image-viewer v-if="currentIcon.showPreview" :on-close="closePreview" :url-list="[currentIcon.url]"/>
</div> </div>
...@@ -296,6 +298,7 @@ import { ...@@ -296,6 +298,7 @@ import {
getListnewsType, getListnewsType,
addUpdateNewsType, addUpdateNewsType,
getListNewsInfo, getListNewsInfo,
addUpdateNewsInfo,
} from "@/api/website/newsCategory/index"; } from "@/api/website/newsCategory/index";
export default { export default {
name: "nebulaDynamics", name: "nebulaDynamics",
...@@ -372,7 +375,7 @@ export default { ...@@ -372,7 +375,7 @@ export default {
}, },
], ],
canPull: false, canPull: false,
infoEditorVisible: false, // infoEditorVisible: false,
// 表格数据 // 表格数据
tableData: [ tableData: [
// { // {
...@@ -448,47 +451,106 @@ export default { ...@@ -448,47 +451,106 @@ export default {
this.pullListNewsInfo() this.pullListNewsInfo()
} }
}, },
// 关闭当前类型弹框时重新加载资讯
typeManagerVisible(newVal){
!newVal && (this.pullListNewsInfo())
},
// 类型表格筛选页码改变 // 类型表格筛选页码改变
"typePagination.currentPage": { "typePagination.currentPage": {
deep: true, deep: true,
handler(){ handler(){
this.changeTableType() // this.changeTableType()
this.pullListNewsType()
} }
}, },
// 类型表格筛选数量改变 // 类型表格筛选数量改变
"typePagination.pageSize": { "typePagination.pageSize": {
deep: true, deep: true,
handler(){ handler(){
this.changeTableType() // this.changeTableType()
this.pullListNewsType()
} }
} }
}, },
mounted() { mounted() {
// 获取所有新闻类型 // 获取所有新闻类型
this.pullAllNewsType() this.pullAllNewsType()
// // 获取分页新闻类型
// getListnewsType({
// page: "0",
// limit: "10",
// name: "",
// }).then((res) => {
// console.log("获取分页新闻类型=>", res);
// });
// // 新增或更新新闻类型
// addUpdateNewsType({
// nameCn: "行业创新",
// nameEn: "News creation",
// rank: 0,
// status: 1,
// id: "11",
// }).then((res) => {
// console.log("新增或更新新闻类型=>", res);
// });
}, },
methods: { methods: {
// 删除新闻信息
delInfo(info){
this.$confirm('确定继续执行该操作吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
info.isDel = 1
// 删除资讯
addUpdateNewsInfo({
id: info.id,
title: info.title,
detail: info.introduce,
coverImg: info.icon.url,
content: info.title,
newsDate: info.newsDate,
typeId: info.typeId,
status: info.status,
indexShow: info.indexShow,
typeName: info.type,
isDel: info.isDel,
}).then(res => {
if(res.status==200){
this.$message({
message: "删除成功!!!",
type: 'success'
})
this.pullListNewsInfo()
}else{
this.$message.error('操作失败,请稍后重试!!!');
}
})
})
},
// 更改资讯状态
changeInfoStatus(info){
let message = ""
if(info.status==1){// 当前为启用
info.status = 2
message = "下架成功!!!"
}else{
info.status = 1
message = "上架成功"
}
// 更新资讯
addUpdateNewsInfo({
id: info.id,
title: info.title,
detail: info.introduce,
coverImg: info.icon.url,
content: info.title,
newsDate: info.newsDate,
typeId: info.typeId,
status: info.status,
indexShow: info.indexShow,
typeName: info.type,
isDel: info.isDel,
}).then(res => {
if(res.status==200){
this.$message({
message: message,
type: 'success'
})
}else{
this.$message.error('操作失败,请稍后重试!!!');
}
})
},
// 编辑资讯
editorInfo(info){ editorInfo(info){
console.log("Info=>",info) console.log("Info=>",info)
this.infoEditorVisible = true this.$parent.componentName = "newsCreator";
this.$parent.regions = this.typesState
this.$parent.info = info
}, },
handleSizeChange(val) { handleSizeChange(val) {
// console.log(`每页 ${val} 条`); // console.log(`每页 ${val} 条`);
...@@ -501,7 +563,10 @@ export default { ...@@ -501,7 +563,10 @@ export default {
// 获取所有的新闻类型 // 获取所有的新闻类型
pullAllNewsType(isInit = true){ pullAllNewsType(isInit = true){
this.typesState = [] this.typesState = []
this.types = [] this.types = [{
value: "",
label: "全部",
}]
// 获取所有新闻类型 // 获取所有新闻类型
getAllnewsType().then((res) => { getAllnewsType().then((res) => {
// console.log("所有的新闻类型=>",res) // console.log("所有的新闻类型=>",res)
...@@ -530,6 +595,10 @@ export default { ...@@ -530,6 +595,10 @@ export default {
} }
}); });
console.log("获取到的所有类型=>",this.typesState) console.log("获取到的所有类型=>",this.typesState)
// 改变类型表格数据
// this.changeTableType()
// 拉取分页表格数据
this.pullListNewsType()
this.canPull = isInit this.canPull = isInit
} }
}); });
...@@ -548,9 +617,10 @@ export default { ...@@ -548,9 +617,10 @@ export default {
res.data.data.forEach(element => { res.data.data.forEach(element => {
// 缓存当前的表格数据 // 缓存当前的表格数据
this.tableDataState.push(element) this.tableDataState.push(element)
// 将缓存的数据作进一步的筛选
this.screenTableData()
}) })
console.log("tableDataState",this.tableDataState)
// 将缓存的数据作进一步的筛选
this.screenTableData()
} }
console.log("获取分页新闻资讯=>", res); console.log("获取分页新闻资讯=>", res);
}); });
...@@ -563,6 +633,7 @@ export default { ...@@ -563,6 +633,7 @@ export default {
this.tableDataState.forEach((element,index) => { this.tableDataState.forEach((element,index) => {
// 未被删除则显示 // 未被删除则显示
if(element.isDel == 0){ if(element.isDel == 0){
let type = (this.typesState.find(ele => ele.id == element.typeId))
this.tableData.push({ this.tableData.push({
id: element.id, id: element.id,
title: element.title, title: element.title,
...@@ -571,10 +642,14 @@ export default { ...@@ -571,10 +642,14 @@ export default {
showPreview: false, showPreview: false,
}, },
introduce: element.detail, introduce: element.detail,
type: (this.typesState.find(ele => ele.id == element.typeId)).nameCn, content: element.content,// 富文本内容
newsDate: element.newsDate,
type: type?type.nameCn:"",
typeId: element.typeId, typeId: element.typeId,
sort: index+1, sort: index+1,
status: element.status, status: element.status,
indexShow: element.indexShow,
isDel: element.isDel,
}); });
} }
}) })
...@@ -623,43 +698,134 @@ export default { ...@@ -623,43 +698,134 @@ export default {
this.typeManagerVisible = true; this.typeManagerVisible = true;
// 将获取到的所有新闻类型按字段放入到弹框表格中 // 将获取到的所有新闻类型按字段放入到弹框表格中
// console.log("所有新闻类型缓存数据=>",this.typesState) // console.log("所有新闻类型缓存数据=>",this.typesState)
this.changeTableType() // this.changeTableType()
// 拉取分页数据
this.pullListNewsType()
} else { } else {
this.$parent.componentName = "newsCreator"; this.$parent.componentName = "newsCreator";
this.$parent.regions = this.typesState this.$parent.regions = this.typesState
this.$parent.info = null
} }
}, },
// 更改类型表格 // 获取类型分页的表格数据
changeTableType(){ pullListNewsType(){
// 先将当前类型表格数据清空
this.tableType = [] this.tableType = []
let startIndex = (this.typePagination.currentPage * this.typePagination.pageSize) - this.typePagination.pageSize; // 开始截取的索引位置 // 获取分页新闻类型
let endIndex = startIndex + this.typePagination.pageSize // 结束截取的索引位置 getListnewsType({
this.typePagination.total = this.typesState.length page: this.typePagination.currentPage,
this.typesState.slice(startIndex,endIndex).forEach((element,index) => { limit: this.typePagination.pageSize,
// 未被删除的类型 name: "",
if(element.isDel==0){ }).then((res) => {
this.tableType.push({ console.log("获取分页新闻类型=>", res);
id: element.id, if(res.status==200){
name: element.nameCn, this.typePagination.total = res.data.totalCount
nameEn: element.nameEn, res.data.data.forEach(element => {
sort: element.rank, // 未被删除的类型
status: element.status if(element.isDel==0){
this.tableType.push({
id: element.id,
name: element.nameCn,
nameEn: element.nameEn,
sort: element.rank,
status: element.status,
isDel: element.isDel
})
}
}) })
} }
}); });
this.typesState.sort((obj1,obj2)=>{ },
let val1 = parseInt((obj1.id+"")) // 更改类型表格
let val2 = parseInt((obj2.id+"")) // changeTableType(){
if(val1<val2){ // this.tableType = []
return -1 // let startIndex = (this.typePagination.currentPage * this.typePagination.pageSize) - this.typePagination.pageSize; // 开始截取的索引位置
}else if(val1>val2){ // let endIndex = startIndex + this.typePagination.pageSize // 结束截取的索引位置
return 1 // this.typePagination.total = this.typesState.length
// this.typesState.slice(startIndex,endIndex).forEach((element,index) => {
// // 未被删除的类型
// if(element.isDel==0){
// this.tableType.push({
// id: element.id,
// name: element.nameCn,
// nameEn: element.nameEn,
// sort: element.rank,
// status: element.status,
// isDel: element.isDel
// })
// }
// });
// this.typesState.sort((obj1,obj2)=>{
// let val1 = parseInt((obj1.id+""))
// let val2 = parseInt((obj2.id+""))
// if(val1<val2){
// return -1
// }else if(val1>val2){
// return 1
// }else{
// return 0
// }
// });
// console.log("类型表格数据改变=>",this.tableType)
// },
// 上下架类型
changeTypeStatus(type){
let message = ""
if(type.status==1){// 当前为启用
type.status=2
message = "下架成功"
}else{// 当前为弃用
type.status=1
message = "上架成功"
}
addUpdateNewsType({
id: type.id+'',
nameCn: type.name,
nameEn: type.nameEn,
rank: type.sort,
status: type.status,
isDel: type.isDel+'', // 0为不删除,1为删除
}).then(res => {
if(res.status == 200){
this.$message({
message: message,
type: 'success'
})
this.pullAllNewsType(false)
}else{ }else{
return 0 this.$message.error('操作失败,请稍后重试!!!');
} }
})
},
// 删除类型
delType(type){
this.$confirm('确定继续执行该操作吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
type.isDel = 1
addUpdateNewsType({
id: type.id+'',
nameCn: type.name,
nameEn: type.nameEn,
rank: type.sort,
status: type.status,
isDel: type.isDel+'', // 0为不删除,1为删除
}).then(res => {
if(res.status == 200){
this.$message({
message: "删除成功",
type: 'success'
})
this.pullAllNewsType(false)
}else{
this.$message.error('操作失败,请稍后重试!!!');
}
})
}); });
console.log("类型表格数据改变=>",this.tableType)
}, },
// 添加类型
createType(){ createType(){
if(this.newType&&this.newSort){ if(this.newType&&this.newSort){
// 必须是中文名称 // 必须是中文名称
...@@ -669,15 +835,16 @@ export default { ...@@ -669,15 +835,16 @@ export default {
nameCn: this.newType, nameCn: this.newType,
nameEn: "", nameEn: "",
rank: this.newSort, rank: this.newSort,
status: 1 // 创建即启用 status: 1, // 创建即启用
isDel: "0", // 0为不删除,1为删除
}).then(res => { }).then(res => {
if(res.status == 200){ if(res.status == 200){
this.$message({ this.$message({
message: '创建成功!!!', message: '创建成功!!!',
type: 'success' type: 'success'
}) })
this.typeCreatorVisible = false
this.pullAllNewsType(false) this.pullAllNewsType(false)
this.typeCreatorVisible = false
} }
}) })
}else{ }else{
...@@ -686,7 +853,6 @@ export default { ...@@ -686,7 +853,6 @@ export default {
}else{ }else{
this.$message.error('请输入中文名称!!!'); this.$message.error('请输入中文名称!!!');
} }
}else{ }else{
this.$message.error('必填框有缺乏值,请完善输入!!!'); this.$message.error('必填框有缺乏值,请完善输入!!!');
} }
...@@ -695,6 +861,7 @@ export default { ...@@ -695,6 +861,7 @@ export default {
this.typeEditorVisible = true this.typeEditorVisible = true
this.editorType = type this.editorType = type
}, },
// 修改类型
confirmEditor(){ confirmEditor(){
// 中文对应 // 中文对应
if(/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/.test(this.editorType.name)){ if(/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/.test(this.editorType.name)){
...@@ -702,7 +869,18 @@ export default { ...@@ -702,7 +869,18 @@ export default {
if(!/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/.test(this.editorType.nameEn)){ if(!/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/.test(this.editorType.nameEn)){
if(this.editorType.sort>=0&&this.editorType.sort<10000){ if(this.editorType.sort>=0&&this.editorType.sort<10000){
// 上传修改 // 上传修改
addUpdateNewsType({
id: this.editorType.id,
nameCn: this.editorType.name,
nameEn: this.editorType.nameEn,
rank: this.editorType.sort,
status: this.editorType.status,// 1启用,2不启用
isDel: this.editorType.isDel,// 0不删除,1删除
});
this.$message({
message: '修改成功!!!',
type: 'success'
})
this.typeEditorVisible = false this.typeEditorVisible = false
}else{ }else{
this.$message.error('排序值不在指定范围,请输入正确的排序值!!!'); this.$message.error('排序值不在指定范围,请输入正确的排序值!!!');
......
<!-- <!--
* @Author: Jenkins * @Author: Jenkins
* @Date: 2020-12-02 14:49:10 * @Date: 2020-12-02 14:49:10
* @LastEditTime: 2020-12-07 21:04:06 * @LastEditTime: 2020-12-08 14:18:46
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 创建新闻 * @Description: 创建新闻
* @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\newsCategory\newsCreator\index.vue * @FilePath: \rs-cloud-platform-ui\src\views\webSiteManagement\newsCategory\newsCreator\index.vue
...@@ -101,6 +101,15 @@ export default { ...@@ -101,6 +101,15 @@ export default {
}) })
} }
}); });
if(this.$parent.info!=null){
this.form.id = this.$parent.info.id
this.form.title = this.$parent.info.title
this.form.coverImg = this.$parent.info.icon.url
this.form.introduce = this.$parent.info.introduce
this.form.region = this.$parent.info.typeId
this.form.sort = this.$parent.info.sort
this.form.content = this.$parent.info.content
}
}, },
methods: { methods: {
onContentChange (val) { onContentChange (val) {
...@@ -126,28 +135,49 @@ export default { ...@@ -126,28 +135,49 @@ export default {
}else if(this.form.content==""){ }else if(this.form.content==""){
this.$message.error('请输入资讯详情!!!'); this.$message.error('请输入资讯详情!!!');
}else{ }else{
let data,message
if(this.$parent.info!=null){
data = {
id: this.form.id,
title: this.form.title,
detail: this.form.introduce,
coverImg: this.form.coverImg,
content: this.form.content,
newsDate: timestamp2Date((new Date()).getTime()),
typeId: this.form.region,
isDel: 0,// 0为未被删除,1为已删除
status: 0, // 默认上传即为下架状态
indexShow: 1,
typeName: (this.types.find(ele => ele.value == this.form.region)).label,
}
message = "修改成功!!!"
}else{
data = {
title: this.form.title,
detail: this.form.introduce,
coverImg: this.form.coverImg,
content: this.form.content,
newsDate: timestamp2Date((new Date()).getTime()),
typeId: this.form.region,
isDel: 0,// 0为未被删除,1为已删除
status: 2, // 默认上传即为下架状态(后端规定1为启用2为禁用)
indexShow: 1,
typeName: (this.types.find(ele => ele.value == this.form.region)).label,
}
message = "创建成功!!!"
}
// 新增新闻资讯 // 新增新闻资讯
addUpdateNewsInfo({ addUpdateNewsInfo(data).then((res) => {
id: Math.floor((Math.random())*100000000),
title: this.form.title,
detail: this.form.introduce,
coverImg: this.form.coverImg,
content: this.form.content,
newsDate: timestamp2Date((new Date()).getTime()),
typeId: this.form.region,
status: 0, // 默认上传即为下架状态
indexShow: 1,
typeName: (this.types.find(ele => ele.value == this.form.region)).label,
}).then((res) => {
if(res.status==200){ if(res.status==200){
let _this = this let _this = this
this.$message({ this.$message({
message: '创建成功!!!', message: message,
type: 'success', type: 'success',
duration: 2000, duration: 2000,
}); });
setTimeout(()=>{ setTimeout(()=>{
_this.componentName = "nebulaDynamics" _this.$parent.componentName = "nebulaDynamics"
_this.$parent.info = null
},2100); },2100);
} }
}); });
......
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