代码提交

master
sunjianxi 2 years ago
parent 423b46c741
commit eef228aabb
  1. 130
      src/main/java/net/mingsoft/cms/action/CmsSignAction.java
  2. 43
      src/main/java/net/mingsoft/cms/action/ContentAction.java
  3. 63
      src/main/java/net/mingsoft/cms/biz/impl/CmsSignBizImpl.java
  4. 91
      src/main/java/net/mingsoft/cms/entity/CmsSignEntity.java
  5. 13
      src/main/java/net/mingsoft/cms/entity/ContentEntity.java
  6. 561
      src/main/webapp/WEB-INF/manager/cms/content/check-main.ftl
  7. 157
      src/main/webapp/WEB-INF/manager/cms/content/check.ftl
  8. 102
      src/main/webapp/template/1/default/chuhuijiyao-detail.htm
  9. 51
      src/main/webapp/template/1/default/chuhuijiyao-list.htm
  10. 6
      src/main/webapp/template/1/default/css/css.css

@ -0,0 +1,130 @@
/**
* The MIT License (MIT)
* Copyright (c) 2012-present 铭软科技(mingsoft.net)
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package net.mingsoft.cms.action;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import net.mingsoft.base.entity.ResultData;
import net.mingsoft.basic.annotation.LogAnn;
import net.mingsoft.basic.biz.IManagerBiz;
import net.mingsoft.basic.constant.e.BusinessTypeEnum;
import net.mingsoft.basic.entity.ManagerEntity;
import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.cms.biz.ICmsSignBiz;
import net.mingsoft.cms.entity.CmsSignEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 分类管理控制层
* @author 铭飞开发团队
* 创建日期2019-11-28 15:12:32<br/>
* 历史修订<br/>
*/
@Api(tags={"后端-文章签收接口"})
@Controller("cmsSignAction")
@RequestMapping("/${ms.manager.path}/cms/sign")
public class CmsSignAction extends BaseAction{
/**
* 注入分类业务层
*/
@Autowired
private ICmsSignBiz cmsSignBiz;
@Autowired
private IManagerBiz managerBiz;
/**
* 保存文章牵手
* @param cmsSign 文章实体
*/
@ApiOperation(value = "保存文章列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "contentId", value = "文章关联id", required =true,paramType="query"),
@ApiImplicitParam(name = "managerName", value = "用户名", required =false,paramType="query"),
})
@PostMapping("/save")
@ResponseBody
@LogAnn(title = "保存文章签收", businessType = BusinessTypeEnum.INSERT)
public ResultData save(@ModelAttribute @ApiIgnore CmsSignEntity cmsSign) {
cmsSign.setCreateDate(new Date());
cmsSign.setCreateBy(BasicUtil.getManager().getId());
cmsSignBiz.save(cmsSign);
return ResultData.build().success("保存成功!");
}
/**
* 查询签收列表接口
* @param cmsSign
* @return
*/
@ApiOperation(value = "查询签收列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "文章id", required =false,paramType="query"),
@ApiImplicitParam(name = "contentId", value = "关联文章id", required =false,paramType="query"),
@ApiImplicitParam(name = "managerName", value = "用户名", required =false,paramType="query"),
@ApiImplicitParam(name = "isSign", value = "是否签收", required =false,paramType="query"),
})
@RequestMapping(value = "/list",method = {RequestMethod.GET,RequestMethod.POST})
@ResponseBody
public ResultData list(@ModelAttribute @ApiIgnore CmsSignEntity cmsSign) {
//查询已经签收的部门用户
LambdaQueryWrapper<CmsSignEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CmsSignEntity::getContentId,cmsSign.getContentId());
List<CmsSignEntity> contentList = cmsSignBiz.list(wrapper);
List<String> singList = contentList.stream().map(CmsSignEntity::getManagerName).collect(Collectors.toList());
//查询所有部门用户
List<ManagerEntity> managerList = managerBiz.list();
List<String> managers = managerList.stream().map(ManagerEntity::getManagerNickName).collect(Collectors.toList());
List<CmsSignEntity> list = new ArrayList<>();
for(String manager : managers){
if(manager.equals("msopen")){
continue;
}
CmsSignEntity entity = new CmsSignEntity();
entity.setManagerName(manager);
if(singList.contains(manager)){
entity.setIsSign("1");
}else{
entity.setIsSign("0");
}
list.add(entity);
}
return ResultData.build().success(list);
}
}

@ -22,6 +22,7 @@
package net.mingsoft.cms.action;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@ -36,8 +37,10 @@ import net.mingsoft.basic.util.StringUtil;
import net.mingsoft.cms.bean.ContentBean;
import net.mingsoft.cms.biz.ICategoryBiz;
import net.mingsoft.cms.biz.IContentBiz;
import net.mingsoft.cms.biz.IDutyStandbyBiz;
import net.mingsoft.cms.entity.CategoryEntity;
import net.mingsoft.cms.entity.ContentEntity;
import net.mingsoft.cms.entity.DutyStandbyEntity;
import net.mingsoft.mdiy.biz.IModelBiz;
import net.mingsoft.mdiy.entity.ModelEntity;
import org.apache.commons.lang3.StringUtils;
@ -80,6 +83,9 @@ public class ContentAction extends BaseAction {
@Resource(name="mdiyModelBizImpl")
private IModelBiz modelBiz;
@Autowired
private IDutyStandbyBiz dutyStandbyBiz;
/**
* 返回主界面index
*/
@ -89,6 +95,24 @@ public class ContentAction extends BaseAction {
return "/cms/content/index";
}
/**
* 返回审核主界面index
*/
@ApiIgnore
@GetMapping("/check")
public String check(){
return "/cms/content/check";
}
/**
* 返回审核主界面index
*/
@ApiIgnore
@GetMapping("/checkMain")
public String checkMain(){
return "/cms/content/check-main";
}
/**
* 返回主界面main
*/
@ -217,7 +241,16 @@ public class ContentAction extends BaseAction {
if(StringUtil.isBlank(content.getContentDatetime())){
return ResultData.build().error(getResString("err.empty", this.getResString("content.datetime")));
}
contentBiz.save(content);
//值班备勤需要将文章Id存到值班备勤表中
if("1773193604170002434".equals(content.getCategoryId())){
List<DutyStandbyEntity> dutyStandbyEntityList = dutyStandbyBiz.list(new LambdaQueryWrapper<DutyStandbyEntity>().eq(DutyStandbyEntity::getFilePath,content.getFilePath()));
for(DutyStandbyEntity dutyStandbyEntity : dutyStandbyEntityList){
dutyStandbyEntity.setContentId(content.getId());
dutyStandbyBiz.updateById(dutyStandbyEntity);
}
}
return ResultData.build().success(content);
}
@ -252,6 +285,8 @@ public class ContentAction extends BaseAction {
}
contentBiz.removeByIds(ids);
//如果是值班备勤,删除对应值班备勤数据
dutyStandbyBiz.deleteByContentIds(ids);
return ResultData.build().success();
}
@ -303,6 +338,14 @@ public class ContentAction extends BaseAction {
return ResultData.build().error(getResString("err.empty", this.getResString("content.datetime")));
}
contentBiz.saveOrUpdate(content);
//值班备勤需要将文章Id存到值班备勤表中
if("1773193604170002434".equals(content.getCategoryId())){
List<DutyStandbyEntity> dutyStandbyEntityList = dutyStandbyBiz.list(new LambdaQueryWrapper<DutyStandbyEntity>().eq(DutyStandbyEntity::getFilePath,content.getFilePath()));
for(DutyStandbyEntity dutyStandbyEntity : dutyStandbyEntityList){
dutyStandbyEntity.setContentId(content.getId());
dutyStandbyBiz.updateById(dutyStandbyEntity);
}
}
return ResultData.build().success(content);
}

@ -0,0 +1,63 @@
/**
* The MIT License (MIT)
* Copyright (c) 2012-present 铭软科技(mingsoft.net)
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package net.mingsoft.cms.biz.impl;
import net.mingsoft.base.biz.impl.BaseBizImpl;
import net.mingsoft.base.dao.IBaseDao;
import net.mingsoft.cms.biz.ICmsSignBiz;
import net.mingsoft.cms.biz.IPhoneContactsBiz;
import net.mingsoft.cms.dao.ICmsSignDao;
import net.mingsoft.cms.dao.IPhoneContactsDao;
import net.mingsoft.cms.entity.CmsSignEntity;
import net.mingsoft.cms.entity.PhoneContactsEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 分类管理持久化层
* @author 铭飞开发团队
* 创建日期2019-11-28 15:12:32<br/>
* 历史修订<br/>
*/
@Service("cmsSignBizImpl")
@Transactional(rollbackFor = RuntimeException.class)
public class CmsSignBizImpl extends BaseBizImpl<ICmsSignDao, CmsSignEntity> implements ICmsSignBiz {
@Autowired
private ICmsSignDao cmsSignDao;
@Override
protected IBaseDao getDao() {
// TODO Auto-generated method stub
return cmsSignDao;
}
}

@ -0,0 +1,91 @@
/**
* The MIT License (MIT)
* Copyright (c) 2012-present 铭软科技(mingsoft.net)
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package net.mingsoft.cms.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import net.mingsoft.base.entity.BaseEntity;
/**
* 文章签收表
* @author 铭飞开发团队
* 创建日期2024-03-20 15:12:32<br/>
* 历史修订<br/>
*/
@TableName("cms_sign")
public class CmsSignEntity extends BaseEntity {
private static final long serialVersionUID = 1574925152617L;
private String id;
/**
* 关联文章Id
*/
private String contentId;
/**
* 用户名
*/
private String managerName;
/**
* 是否签收
*/
@TableField(exist = false)
private String isSign;
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
public String getContentId() {
return contentId;
}
public void setContentId(String contentId) {
this.contentId = contentId;
}
public String getManagerName() {
return managerName;
}
public void setManagerName(String managerName) {
this.managerName = managerName;
}
public String getIsSign() {
return isSign;
}
public void setIsSign(String isSign) {
this.isSign = isSign;
}
}

@ -23,6 +23,7 @@
package net.mingsoft.cms.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -134,6 +135,10 @@ private static final long serialVersionUID = 1574925152617L;
*/
private Integer hasListHtml;
@TableField(exist = false)
private String filePath;
public Integer getContentHit() {
return contentHit;
}
@ -362,6 +367,14 @@ private static final long serialVersionUID = 1574925152617L;
this.hasListHtml = hasListHtml;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public String getUrl(){
// categoryPath 做占位符
return "/" + MSProperties.diy.htmlDir + "/" + BasicUtil.getApp().getAppDir() + "/categoryPath/" + id+".html";

@ -0,0 +1,561 @@
<!DOCTYPE html>
<html>
<head>
<title>文章主体</title>
<#include "../../include/head-file.ftl">
</head>
<body>
<div id="main" class="ms-index" v-cloak>
<ms-search ref="search" @search="search" :condition-data="conditionList" :conditions="conditions"></ms-search>
<el-header class="ms-header" height="50px">
<el-col :span=12>
<el-button v-if="leaf==true" type="primary" icon="el-icon-plus" size="mini" @click="pass(selectionList)" :disabled="!selectionList.length">通过</el-button>
</el-col>
</el-header>
<div class="ms-search">
<el-row>
<el-form :model="form" ref="searchForm" label-width="120px" size="mini">
<el-row>
<el-col :span=8>
<el-form-item label="文章标题" prop="contentTitle">
<el-input v-model="form.contentTitle"
:disabled="false"
:style="{width: '100%'}"
:clearable="true"
placeholder="请输入文章标题">
</el-input>
</el-form-item>
</el-col>
<el-col :span=8>
<el-form-item label="文章类型" prop="contentType">
<el-select v-model="form.contentType"
:style="{width: '100%'}"
:filterable="false"
:disabled="false"
:multiple="true" :clearable="true"
placeholder="请选择文章类型">
<el-option v-for='item in contentTypeOptions' :key="item.dictValue" :value="item.dictValue"
:label="item.dictLabel"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span=8 style="text-align: right;padding-right: 10px;">
<el-button type="primary" icon="el-icon-search" size="mini" @click="form.sqlWhere=null;currentPage=1;list()">查询</el-button>
<el-button @click="rest" icon="el-icon-refresh" size="mini">重置</el-button>
<el-button type="primary" size="mini" @click="$refs.search.open()"><i class="iconfont icon-shaixuan"></i>筛选</el-button>
</el-col>
</el-row>
</el-form>
</el-row>
</div>
<el-main class="ms-container">
<el-table height="calc(100vh - 68px)" v-loading="loading" ref="multipleTable" border :data="dataList" tooltip-effect="dark" @selection-change="handleSelectionChange">
<template slot="empty">
{{emptyText}}
</template>
<el-table-column type="selection" width="40"></el-table-column>
<el-table-column label="编号" width="200" prop="id">
<template slot='header'>编号
<el-popover placement="top-start" title="提示" trigger="hover" >
标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html#%E6%96%87%E7%AB%A0%E5%88%97%E8%A1%A8-msarclist" target="_blank">${'$'}{field.id}</a>
<i class="el-icon-question" slot="reference"></i>
</el-popover>
</template>
</el-table-column>
<el-table-column label="栏目名" align="left" prop="categoryId" :formatter="contentCategoryIdFormat" width="180">
</el-table-column>
<el-table-column label="文章标题" align="left" prop="contentTitle" show-overflow-tooltip>
</el-table-column>
<el-table-column label="文章副标题" align="left" prop="contentShortTitle" show-overflow-tooltip>
</el-table-column>
<el-table-column label="文章链接" align="left" prop="categoryId" :formatter="contentCategoryPathFormat" width="240">
</el-table-column>
<el-table-column label="作者" align="left" prop="contentAuthor" width="100" show-overflow-tooltip>
</el-table-column>
<el-table-column label="排序" width="55" align="right" prop="contentSort">
</el-table-column>
<el-table-column label="点击量" width="90" align="right" prop="contentHit">
<template slot='header'>点击量
<el-popover placement="top-start" title="提示" trigger="hover" >
标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html#%E6%96%87%E7%AB%A0%E5%88%97%E8%A1%A8-msarclist" target="_blank">${'$'}{field.hit}</a>
<i class="el-icon-question" slot="reference"></i>
</el-popover>
</template>
<template slot-scope="scope">
{{scope.row.contentHit?scope.row.contentHit:0}}
</template>
</el-table-column>
<el-table-column label="发布时间" align="center" prop="contentDatetime" :formatter="dateFormat" width="120">
</el-table-column>
<el-table-column label="操作" width="120" align="center">
<template slot-scope="scope">
<@shiro.hasPermission name="cms:content:update">
<el-link type="primary" :underline="false" @click="save(scope.row.id)">编辑</el-link>
</@shiro.hasPermission>
<@shiro.hasPermission name="cms:content:del">
<el-link type="primary" :underline="false" @click="del([scope.row])">删除</el-link>
</@shiro.hasPermission>
</template>
</el-table-column>
</el-table>
<el-pagination
background
:page-sizes="[10,20,30,40,50,100]"
layout="total, sizes, prev, pager, next, jumper"
:current-page="currentPage"
:page-size="pageSize"
:total="total"
class="ms-pagination"
@current-change='currentChange'
@size-change="sizeChange">
</el-pagination>
</el-main>
</div>
</body>
</html>
<script>
var indexVue = new Vue({
el: '#main',
data: function () {
return {
conditionList: [{
action: 'and',
field: 'content_title',
el: 'eq',
model: 'contentTitle',
name: '文章标题',
type: 'input'
}, {
action: 'and',
field: 'content_short_title',
el: 'eq',
model: 'contentShortTitle',
name: '文章副标题',
type: 'input'
}, {
action: 'and',
field: 'category_id',
el: 'eq',
model: 'categoryId',
name: '所属栏目',
key: 'id',
title: 'categoryTitle',
type: 'cascader',
multiple: false
}, {
action: 'and',
field: 'content_type',
el: 'eq',
model: 'contentType',
name: '文章类型',
key: 'dictValue',
title: 'dictLabel',
type: 'checkbox',
label: false,
multiple: true
}, {
action: 'and',
field: 'content_display',
el: 'eq',
model: 'contentDisplay',
name: '是否显示',
key: 'value',
title: 'label',
type: 'radio',
label: true,
multiple: false
}, {
action: 'and',
field: 'content_author',
el: 'eq',
model: 'contentAuthor',
name: '文章作者',
type: 'input'
}, {
action: 'and',
field: 'content_source',
el: 'eq',
model: 'contentSource',
name: '文章来源',
type: 'input'
}, {
action: 'and',
field: 'ct.content_datetime',
model: 'contentDatetime',
el: 'gt',
name: '发布时间',
type: 'date'
}, {
action: 'and',
field: 'content_sort',
el: 'eq',
model: 'contentSort',
name: '自定义顺序',
type: 'number'
}, {
action: 'and',
field: 'content_description',
el: 'eq',
model: 'contentDescription',
name: '描述',
type: 'textarea'
}, {
action: 'and',
field: 'content_keyword',
el: 'eq',
model: 'contentKeyword',
name: '关键字',
type: 'textarea'
}, {
action: 'and',
field: 'content_details',
el: 'like',
model: 'contentDetails',
name: '文章内容',
type: 'input'
}, {
action: 'and',
field: 'content_url',
el: 'eq',
model: 'contentUrl',
name: '文章跳转链接地址',
type: 'input'
}, {
action: 'and',
field: 'ct.create_date',
el: 'eq',
model: 'createDate',
name: '创建时间',
type: 'date'
}, {
action: 'and',
field: 'ct.update_date',
el: 'eq',
model: 'updateDate',
name: '修改时间',
type: 'date'
}],
conditions: [],
contentCategoryIdOptions: [],
dataList: [],
//文章列表
selectionList: [],
//文章列表选中
total: 0,
//总记录数量
pageSize: 10,
//页面数量
currentPage: 1,
//初始页
manager: ms.manager,
loadState: false,
loading: true,
//加载状态
emptyText: '',
//提示文字
contentTypeOptions: [],
contentDisplayOptions: [{
"value": "0",
"label": "是"
}, {
"value": "1",
"label": "否"
}],
//搜索表单
form: {
sqlWhere: null,
// 文章标题
contentTitle: null,
// 文章类型
contentType: null,
categoryId: ''
},
leaf: true
}
},
methods: {
//查询列表
list: function () {
var that = this;
that.loading = true;
that.loadState = false;
var page = {
pageNo: that.currentPage,
pageSize: that.pageSize
};
var form = JSON.parse(JSON.stringify(that.form));
if (form.contentType!=null && form.contentType.length > 0) {
form.contentType = form.contentType.join(',');
}
for (var key in form) {
if (!form[key]) {
delete form[key];
}
}
history.replaceState({
form: form,
page: page
}, "");
//筛选栏目类型,1=列表
that.form.categoryType = '1';
ms.http.post(ms.manager + "/cms/content/list.do", form.sqlWhere ? Object.assign({}, {
categoryType: '1',
sqlWhere: form.sqlWhere,
contentDisplay:'1'
}, page) : Object.assign({}, {...form,contentDisplay:'1'}, page,)).then(function (res) {
if (that.loadState) {
that.loading = false;
} else {
that.loadState = true;
}
if (!res.result || res.data.total <= 0) {
that.emptyText = '暂无数据';
that.dataList = [];
that.total = 0;
} else {
that.emptyText = '';
that.total = res.data.total;
that.dataList = res.data.rows;
}
}).finally(function () {
that.loading = false;
});
setTimeout(function () {
if (that.loadState) {
that.loading = false;
} else {
that.loadState = true;
}
}, 500);
},
//文章列表选中
handleSelectionChange: function (val) {
this.selectionList = val;
},
//删除
del: function (row) {
var that = this;
that.$confirm('此操作将永久删除所选内容, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
ms.http.post(ms.manager + "/cms/content/delete.do", row.length ? row : [row], {
headers: {
'Content-Type': 'application/json'
}
}).then(function (res) {
if (res.result) {
that.$notify({
title:'成功',
type: 'success',
message: '删除成功!'
}); //删除成功,刷新列表
that.list();
} else {
that.$notify({
title: '失败',
message: res.msg,
type: 'warning'
});
}
});
})
},
//审批通过
pass: function (row) {
var that = this;
that.$confirm('此操作将发布所选内容, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
ms.http.post(ms.manager + "/cms/content/pass.do", row.length ? row : [row], {
headers: {
'Content-Type': 'application/json'
}
}).then(function (res) {
if (res.result) {
that.$notify({
title:'成功',
type: 'success',
message: '发布通过'
}); //删除成功,刷新列表
debugger
that.list();
} else {
that.$notify({
title: '失败',
message: res.msg,
type: 'warning'
});
}
});
})
},
//新增
save: function (id) {
//id有值时编辑
if (id) {
// location.href = this.manager + "/cms/content/form.do?id=" + id;
ms.util.openSystemUrl("/cms/content/form.do?id=" + id);
}else {
//根据当前栏目新增时自动选中栏目
var categoryId = this.form.categoryId;
if (categoryId) {
// location.href = this.manager + "/cms/content/form.do?categoryId=" + this.form.categoryId;
ms.util.openSystemUrl("/cms/content/form.do?categoryId=" + this.form.categoryId);
}else {
//如果栏目id没有值就单纯的新增,不自动选定栏目
// location.href = this.manager + "/cms/content/form.do";
ms.util.openSystemUrl("/cms/content/form.do");
}
}
},
// 表格数据转换 id->name
contentCategoryIdFormat: function (row, column, cellValue, index) {
var value = "";
if (cellValue) {
var data = this.contentCategoryIdOptions.find(function (value) {
return value.id == cellValue;
});
if (data && data.categoryTitle) {
value = data.categoryTitle;
}
}
return value;
},
// 表格数据转换 id->path
contentCategoryPathFormat: function (row, column, cellValue, index) {
var path = "";
if (cellValue) {
var data = this.contentCategoryIdOptions.find(function (value) {
return value.id == cellValue;
});
if (data && data.categoryPath) {
// row.url /html/web/categoryPath/文章id.html categoryPath做占位符
if (data.categoryType === "2"){
path = row.url.replace("categoryPath/"+row.id,data.categoryPinyin+"/index");
}else {
path = row.url.replace("categoryPath",data.categoryPath);
}
}else {
path = row.url;
}
}
return path;
},
dateFormat: function (row, column, cellValue, index) {
if (cellValue) {
return ms.util.date.fmt(cellValue, 'yyyy-MM-dd');
} else {
return '';
}
},
contentDisplayFormat: function (row, column, cellValue, index) {
var value = "";
if (cellValue) {
var data = this.contentDisplayOptions.find(function (value) {
return value.value == cellValue;
});
if (data && data.label) {
value = data.label;
}
}
return value;
},
//pageSize改变时会触发
sizeChange: function (pagesize) {
this.loading = true;
this.pageSize = pagesize;
this.list();
},
//currentPage改变时会触发
currentChange: function (currentPage) {
this.loading = true;
this.currentPage = currentPage;
this.list();
},
search: function (data) {
this.form.sqlWhere = JSON.stringify(data);
this.list();
},
//重置表单
rest: function () {
this.form.sqlWhere = null;
this.$refs.searchForm.resetFields();
this.list();
},
//获取contentCategoryId数据源
contentCategoryIdOptionsGet: function () {
var that = this;
ms.http.get(ms.manager + "/cms/category/list.do").then(function (res) {
if (res.result) {
that.contentCategoryIdOptions = res.data.rows;
}else {
that.$notify({
title: '失败',
message: res.msg,
type: 'warning'
});
}
that.list();
});
},
//获取contentType数据源
contentTypeOptionsGet: function () {
var that = this;
ms.http.get(ms.base + '/mdiy/dict/list.do', {
dictType: '文章属性',
pageSize: 99999
}).then(function (data) {
if(data.result){
data = data.data;
that.contentTypeOptions = data.rows;
}
});
}
},
mounted: function () {
console.log(this,'thisthisthisthisthisthis')
console.log(window)
console.log(document)
this.contentCategoryIdOptionsGet();
this.contentTypeOptionsGet();
this.form.categoryId = ms.util.getParameter("categoryId");
this.leaf = ms.util.getParameter("leaf")==null?true:JSON.parse(ms.util.getParameter("leaf"));
if (history.hasOwnProperty("state")) {
this.form = history.state.form;
this.currentPage = history.state.page.pageNo;
this.pageSize = history.state.page.pageSize;
}
}
});
</script>
<style>
#main .ms-search {
padding: 20px 0 0;
}
#main .ms-container {
height: calc(100vh - 141px);
}
#main {
height: 100vh
}
body{
overflow: hidden;
}
</style>

@ -0,0 +1,157 @@
<html>
<head>
<meta charset="UTF-8">
<title>文章</title>
<#include "../../include/head-file.ftl">
</head>
<body style="overflow: hidden">
<div id="index" v-cloak>
<!--左侧-->
<el-container class="index-menu">
<div class="left-tree" style="position:relative;">
<el-scrollbar style="height: 100%;">
<el-tree
:indent="5"
v-loading="loading"
highlight-current
:expand-on-click-node="false"
default-expand-all
:empty-text="emptyText"
:data="treeData"
:props="defaultProps"
@node-click="handleNodeClick"
style="padding: 10px;height: 100%;">
<span class="custom-tree-node" slot-scope="{ node, data }" >
<span :style="data.categoryType == '3' ? 'color: #dcdfe6' : ''" :title="data.categoryTitle">{{ data.categoryTitle }}</span>
</span>
</el-tree>
</el-scrollbar>
</div>
<iframe :src="action" :key="iframeKey" class="ms-iframe-style" style="background:url('${base}/static/images/loading.gif') no-repeat center;">
</iframe>
</el-container>
</div>
</body>
</html>
<script>
var indexVue = new Vue({
el: "#index",
data: function () {
return {
iframeKey:'',
action: "",
//跳转页面
defaultProps: {
children: 'children',
label: 'categoryTitle'
},
treeData: [],
loading: true,
emptyText: ''
}
},
methods: {
handleNodeClick: function (data) {
this.iframeKey = new Date().getTime();
if (data.categoryType == '1') {
this.action = ms.manager + "/cms/content/checkMain.do?categoryId=" + data.id+"&leaf="+data.leaf;
} else if (data.categoryType == '2') {
this.action = ms.manager + "/cms/content/form.do?categoryId=" + data.id + "&type=2";
//id=0时为最顶级节点全部节点
} else if (data.id == 0){
this.action = ms.manager + "/cms/content/checkMain.do?leaf=false";
}
},
treeList: function () {
var that = this;
this.loadState = false;
this.loading = true;
ms.http.get(ms.manager + "/cms/category/list.do").then(function (res) {
if (that.loadState) {
that.loading = false;
} else {
that.loadState = true;
}
if (!res.result || res.data.total <= 0) {
that.emptyText = '暂无数据';
that.treeData = [];
} else {
that.emptyText = '';
// 过滤掉栏目类型为链接属性
that.treeData = res.data.rows;
that.treeData = ms.util.treeData(that.treeData, 'id', 'categoryId', 'children');
that.treeData = [{
id: 0,
categoryTitle: '全部',
children: that.treeData
}];
}
});
setTimeout(function () {
if (that.loadState) {
that.loading = false;
} else {
that.loadState = true;
}
}, 500);
}
},
mounted: function () {
this.action = ms.manager + "/cms/content/checkMain.do";
this.treeList();
}
});
</script>
<style>
#index .index-menu {
height: 100vh;
min-height: 100vh;
min-width: 140px;
}
#index .ms-iframe-style {
width: 100%;
height: 100vh;
border: 0;
}
/*脚手架需要此样式*/
#index >>> .ms-iframe-style {
height: 92vh;
}
#index >>> .ms-index {
height: 100vh;
}
#index .index-menu .el-main {
padding: 0;
}
#index .left-tree{
min-height: 100vh;
background: #fff;
width: 220px;
border-right: solid 1px #e6e6e6;
}
#index .index-menu .el-main .index-menu-menu .el-menu-item {
min-width: 140px;
width: 100%;
}
#index .index-menu .el-main .index-material-item {
min-width: 100% !important
}
#index .index-menu-menu-item , .el-submenu__title {
height: 40px !important;
line-height: 46px !important;
}
#index .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
background-color: rgb(137 140 145);
color: #fff;
border-radius: 2px;
}
body{
overflow: hidden;
}
</style>

@ -23,6 +23,7 @@
</head>
<body>
<div>
<#include "header.htm" />
<div class="o_big">
<h1>${field.typedescrip}</h1>
@ -34,21 +35,93 @@
<div class="index-contentbox">
<div class="wrap">
<div class="pagebreadcrumb">
<a href='http://192.168.1.104:8080/html/web/index.html'>首页<a>><a
href='http://192.168.1.104:8080/html/web/index.html'>${field.typetitle}</a>
<a href='/html/web/index.html'>首页</a>><a
href='/html/web/index.html'>${field.typetitle}</a>
</div>
<h1 class="chuhuijiyao_title">${field.typetitle}</h1>
<div class="about_x anim anim-2">
<div class="show_t">${field.title}</div>
<div class="show_t" style="font-size:22px;color:#000;font-weight:bold">${field.title}</div>
<div class="con_line" style="font-size:18px;">
发布时间:${field.date?string("yyyy-MM-dd")}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发布科室:${field.author}
</div>
<div class="con_id">
<div>${field.content}</div>
<div >${field.content}</div>
</div>
<#if field.typetitle == '会议通知' || field.typetitle == '通知公告'>
<div style="border-bottom:1px #c8c8c8 dashed"></div>
</#if>
<#if field.typetitle == '会议通知' || field.typetitle == '通知公告'>
<div id="signed">
<div class="signed">
<span>已签收:</span>{{signedStr}}
</div>
<div class="unsigned">
<span>未签收:</span>{{unSignedStr}}
</div>
<div style="display:flex;justify-content:center">
<button class="signBtn" style="width:150px;height:50px;background:#004ebd;color:#fff;font-size:18px;margin-bottom:50px;cursor:pointer" @click="handleSign(${field.id})" data-fieldid="${field.id}" v-if="signBtnFlag">点击签收</button>
</div>
</div>
</#if>
{ms:arclist tableName="MDIY_MODEL_NEWS"}
<div id="myList"></div>
{/ms:arclist}
<div>
</div>
<script>
var app = new Vue({
el: '#signed',
data: {
signedStr:'',
unSignedStr:'',
signBtnFlag:true,
},
methods:{
handleSign(contentId){
axios.get('/ms/checkLogin.do').then(res=>{
if(res.data.code == 200 && res.data.result){
axios.post('/ms/cms/sign/save.do',{contentId:String(contentId),managerName:res.data.data.managerNickName}, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res2=>{
if(res2.data.code == 200){
alert('签收成功')
location.reload()
}else{
alert('签收失败请联系管理员')
}
})
}else{
alert('请登录');
}
})
}
},
mounted(){
axios.post('/ms/cms/sign/list.do',{contentId: ${field.id}}, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res=>{
res.data.data.map(i=>{
if(i.isSign == '1'){
this.signedStr += i.managerName + '、'
}else{
this.unSignedStr += i.managerName + '、'
}
})
this.signedStr = this.signedStr.substr(0,this.signedStr.length-1)
this.unSignedStr = this.unSignedStr.substr(0,this.unSignedStr.length-1)
axios.get('/ms/checkLogin.do').then(res2=>{
if(res.data.data.some(i=>i.isSign == '1' && i.managerName == res2.data.data.managerNickName )){
this.signBtnFlag = false
}
})
})
}
})
</script>
<script>
var images = ${ field.IMGS };
@ -65,6 +138,7 @@
// 将<img>元素添加到页面上的指定位置(此处假设目标容器id为"container")
document.getElementById("myList").appendChild(imgElement);
}
</script>
</div>
</div>
@ -72,6 +146,24 @@
<!--正文end-->
<#include "footer.htm" />
<script language="javascript" src="/{ms:global.style/}js/foot.js"></script><!--尾部end-->
</div>
</body>
<style>
.signed{
color:#999999;
font-size:18px;
margin:50px 0 30px 0;
}
.signed span{
font-weight:bold
}
.unsigned{
color:#df1f00;
font-size:18px;
margin-bottom:50px;
}
.unsigned span{
font-weight:bold
}
</style>
</html>

@ -26,41 +26,62 @@
<body>
<#include "header.htm" />
<div class="index-contentbox">
<div class="pagebreadcrumb">
<a href='/html/web/index.html'>首页<a>><a
href=`/html/web/field.typelink`>${field.typetitle}</a>
<a href='/html/web/index.html'>首页</a>><span>${field.typetitle}</span>
</div>
<h1 class="chuhuijiyao_title">${field.typetitle}</h1>
<ul>
{ms:arclist size=14 ispaging=true}
<ul class="pageNum" data-pagenum={ms:page.cur/}>
{ms:arclist size=12 ispaging=true}
<li class="chuhuijiyao_li">
<a href="{ms:global.html/}${field.link}">
<div class="chuhuijiyao_li_div">
<div class="chuhuijiyao_li_div_div">
<#if field.index < 8>
<div class="chuhuijiyao_new">NEW</div>
<#else>
<div style="width:6px;height:6px;background:red;margin-right:15px"></div>
</#if>
<div class="chuhuijiyao_new" data-time="${field.date?string('yyyy-MM-dd')}">NEW</div>
<div class="chuhuijiyao_old" data-time="${field.date?string('yyyy-MM-dd')}" style="width:6px;height:6px;background:red;margin:0 15px 0 1px"></div>
<h3 class="chuhuijiyao_title2">${field.title}</h3>
</div>
<label class="chuhuijiyao_date">${field.date?string("yyyy-MM-dd")}</label>
</div>
</a>
<#if field.index==7>
<div class="chuhuijiyao_line" />
</#if>
<#if field.index == 5>
<div class="chuhuijiyao_line2"></div>
</#if>
</li>
{/ms:arclist}
</ul>
<#include "pagination.htm" />
<#include "pagination.htm" />
</div>
<!--正文end-->
<#include "footer.htm" />
<script language="javascript" src="/{ms:global.style/}js/foot.js"></script><!--尾部end-->
<script>
var currentTime = window.moment().format('YYYY-MM-DD');
$('.chuhuijiyao_new').each(function (i, p) {
if ($(p).data('time') != currentTime) {
$(p).hide()
}
})
$('.chuhuijiyao_old').each(function (i, p) {
if ($(p).data('time') == currentTime) {
$(p).hide()
}
});
$('.chuhuijiyao_line').each(function (i, p) {
if ($(p).data('time') != currentTime) {
$(p).remove()
}
});
let max = document.getElementsByClassName('chuhuijiyao_line').length
$('.chuhuijiyao_line').each(function (i, p) {
if (i != max-1) {
$(p).remove()
}
});
</script>
</body>
</html>

@ -286,11 +286,11 @@
}
.about_x .show_t {
line-height: 36px;
font-size: 24px;
color: #333;
font-size: 22px;
color: #333333 ;
text-align: center;
margin-bottom: 15px;
font-weight: normal;
font-weight: bold;
}
.about_x .con_line {
height: 40px;

Loading…
Cancel
Save