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-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
addUpdateNewsInfo({ if(this.$parent.info!=null){
id: Math.floor((Math.random())*100000000), data = {
id: this.form.id,
title: this.form.title, title: this.form.title,
detail: this.form.introduce, detail: this.form.introduce,
coverImg: this.form.coverImg, coverImg: this.form.coverImg,
content: this.form.content, content: this.form.content,
newsDate: timestamp2Date((new Date()).getTime()), newsDate: timestamp2Date((new Date()).getTime()),
typeId: this.form.region, typeId: this.form.region,
isDel: 0,// 0为未被删除,1为已删除
status: 0, // 默认上传即为下架状态 status: 0, // 默认上传即为下架状态
indexShow: 1, indexShow: 1,
typeName: (this.types.find(ele => ele.value == this.form.region)).label, typeName: (this.types.find(ele => ele.value == this.form.region)).label,
}).then((res) => { }
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(data).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