Commit 79fec321 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	enterprise-manager-ui/admin/src/views/company/drawershow.vue
parents ee80ab23 c8bfc69f
# 企业服务平台
## 测试信息
测试环境:http://192.168.0.212:8085
\ No newline at end of file
......@@ -24,9 +24,9 @@ export default {
}
},
methods: {
change() {
change(e) {
this.visible = false;
this.$emit("confirm");
this.$emit("confirm",e);
}
},
data() {
......
......@@ -3,8 +3,8 @@
<el-form-item>
<slot name="prepend"></slot>
<slot>
<el-button v-if="!noSaveBtn" type="primary" @click='$emit("submit")' size='small' icon='el-icon-circle-check-outline'>保存</el-button>
<el-button v-if="!noCancelBtn" @click="$router.go(-1)" size='small' icon='el-icon-circle-close-outline'>取消</el-button>
<el-button v-if="!noSaveBtn" type="primary" @click='$emit("submit")' icon='el-icon-circle-check-outline'>保存</el-button>
<el-button v-if="!noCancelBtn" @click="$router.go(-1)" icon='el-icon-circle-close-outline'>取消</el-button>
</slot>
<slot name="append"></slot>
</el-form-item>
......
<template>
<div class="page">
<LayoutTable :data="tableData" :config="tableConfig">
<LayoutTable :data="tableData" :config="tableConfig" notDel>
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
......
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
:destroy-on-close="true"
size="70%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field :span="20" label="标签名称" prop="labelName" v-model="form.labelName" placeholder="请输入标签名称"/>
<Field :span="20" label="标签描述" prop="labelDesc" v-model="form.labelDesc" placeholder="请输入标签描述"/>
<Field :span="20" label="标签图标"><imageUpload v-model="form.labelLogoPath" prePath="/file/preview"/></Field>
<Field :span="20" label="排序" prop="sort" type="num" v-model="form.sort" placeholder="请输入排序"/>
<Field :span="20" label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/>
</el-row>
<form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn />
</el-form>
</el-drawer>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
:destroy-on-close="true"
size="70%"
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px" style="padding:0 40px;">
<el-row>
<Field
:span="20"
label="标签名称"
prop="labelName"
v-model="form.labelName"
placeholder="请输入标签名称"
/>
<Field
:span="20"
label="标签描述"
prop="labelDesc"
v-model="form.labelDesc"
placeholder="请输入标签描述"
/>
<Field :span="20" label="标签图标">
<imageUpload v-model="form.labelLogoPath" prePath="/file/preview" />
</Field>
<Field
:span="20"
label="排序"
prop="sort"
type="num"
v-model="form.sort"
placeholder="请输入排序"
/>
<Field
:span="20"
label="备注"
prop="remark"
v-model="form.remark"
type="textarea"
placeholder="请输入备注"
/>
</el-row>
<el-form-item v-if="pageInfo.type!='view'" class="formbtns">
<el-button type="primary" @click="submitForm" icon="el-icon-circle-check-outline">保存</el-button>
<el-button @click="open=false" icon="el-icon-circle-close-outline">取消</el-button>
</el-form-item>
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
name: "LabelsDetail",
mixins: [form],
components: {
},
created() {
this.changePath("labels")
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "标注",
// 是否显示弹出层
open: false,
direction:"rtl",
toString:[
],
toDate:[
],
// 表单校验
rules: {
labelName: [
{required: true,message: "请输入标签名称", trigger: "blur" },
{max: 128,message: "最多只能录入128个字符",trigger: "blur",},
],
createTime: [
{required: true,message: "请选择创建时间" },
],
}
};
},
import form from "@/assets/mixins/formdialog";
export default {
name: "LabelsDetail",
mixins: [form],
components: {},
created() {
this.changePath("labels");
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "标注",
// 是否显示弹出层
open: false,
direction: "rtl",
toString: [],
toDate: [],
// 表单校验
rules: {
labelName: [
{ required: true, message: "请输入标签名称", trigger: "blur" },
{ max: 128, message: "最多只能录入128个字符", trigger: "blur" }
],
createTime: [{ required: true, message: "请选择创建时间" }]
}
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="labels/edit";
this.getData();
this.pageInfo.type="edit"
this.title = "修改标注";
},
/** 新增 */
add(row) {
this.reset()
this.urls.currUrl = "labels/add";
this.getData();
this.pageInfo.type="add"
this.title = "新增标注";
},
/** 查看*/
view(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="labels/view";
this.getData();
this.pageInfo.type="view"
this.title = "标注详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
methods: {
/** 编辑 */
edit(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "labels/edit";
this.getData();
this.pageInfo.type = "edit";
this.title = "修改标注";
},
/** 新增 */
add(row) {
this.reset();
this.urls.currUrl = "labels/add";
this.getData();
this.pageInfo.type = "add";
this.title = "新增标注";
},
/** 查看*/
view(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "labels/view";
this.getData();
this.pageInfo.type = "view";
this.title = "标注详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
labelName : "",
labelDesc : "",
labelLogoPath : "",
sort : 0,
remark : "",
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
// 表单重置
reset() {
this.form = {
labelName: "",
labelDesc: "",
labelLogoPath: "",
sort: 0,
remark: ""
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
}
}
};
</script>
<style lang="less" scoped>
.formbtns {
display: flex;
justify-content: flex-end;
align-items: center;
height: 60px;
margin-top: 30px;
}
</style>
......@@ -28,6 +28,11 @@
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.rabbitmq.host>192.168.0.251</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>root_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>xhx@2022</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.log.level>info</profiles.log.level>
<profiles.publish.path>/home/publish</profiles.publish.path>
......
......@@ -18,6 +18,6 @@ public class NewsReq extends BaseReq {
/**
* 分类id
*/
private Long categoryId;
private Long newsCategoryId;
}
......@@ -13,6 +13,8 @@ import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.busiz.applets.req.NewsReq;
import com.mortals.xhx.busiz.applets.rsp.NewsListInfo;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.category.model.CategoryQuery;
import com.mortals.xhx.module.category.service.CategoryService;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.news.model.NewsCategoryQuery;
......@@ -21,6 +23,7 @@ import com.mortals.xhx.module.news.model.NewsQuery;
import com.mortals.xhx.module.news.service.NewsCategoryService;
import com.mortals.xhx.module.news.service.NewsService;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
......@@ -60,6 +63,7 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
@Autowired
private UserService userService;
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "top", paramService.getParamBySecondOrganize("News", "top"));
this.addDict(model, "viewNums", paramService.getParamBySecondOrganize("News", "viewNums"));
......@@ -69,10 +73,27 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
}
/**
* 新闻频道分类
*/
@PostMapping(value = "categoryList")
public Rest<Object> categoryList(){
String busiDesc = "新闻频道";
Rest<Object> rest = Rest.ok();
try {
rest.setData(newsCategoryService.find(new NewsCategoryQuery()));
}catch (Exception e) {
log.error(busiDesc, e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
/**
* 新闻列表
*/
@PostMapping(value = "list")
@PostMapping(value = "newsList")
public Rest<Object> newsList(@RequestBody NewsReq newsReq) {
String busiDesc = "新闻列表";
log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(newsReq));
......@@ -86,8 +107,8 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
PageInfo pageInfo = buildPageInfo(newsReq);
NewsQuery query = new NewsQuery();
if(!ObjectUtils.isEmpty(newsReq.getCategoryId())){
query.setCategoryId(newsReq.getCategoryId());
if(!ObjectUtils.isEmpty(newsReq.getNewsCategoryId())){
query.setCategoryId(newsReq.getNewsCategoryId());
}
query.setOrderColList(Arrays.asList(new OrderCol("createTime", OrderCol.DESCENDING)));
......@@ -113,7 +134,7 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
/**
* 新闻详细
*/
@PostMapping(value = "info")
@PostMapping(value = "newsInfo")
public Rest<NewsEntity> appealInfo(@RequestBody NewsReq newsReq) {
String busiDesc = "新闻详细";
log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(newsReq));
......
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