Commit 0a2f344b authored by 信 赵's avatar 信 赵

Merge branch '5.0.1' of https://gitee.com/mingSoft/MCMS into 5.0.1

 Conflicts:
	pom.xml
	src/main/webapp/static/plugins/ms/1.0.0/compatible.js
parents ef542c34 db98d5aa
......@@ -24,9 +24,12 @@
</p>
<p align="center">
铭飞平台:<a href="https://ms.mingsoft.net">https://ms.mingsoft.net/</a> <br/>
演示:<a href="http://demo.cms.mingsoft.net/ms/login.do">http://demo.cms.mingsoft.net/ms/login.do</a><br/>
<a href="http://file.mingsoft.net/ms-runner-4.7.2.zip">一键运行版本</a>
<a href="https://ms.mingsoft.net" target="_blank">铭飞平台</a>
<a href="http://demo.cms.mingsoft.net/ms/login.do" target="_blank">在线演示</a>
<a href="http://doc.ms.mingsoft.net/plugs-cms/" target="_blank">在线使用手册</a>
<a href="https://mingsoft.ke.qq.com/?tuin=383187f3#tab=1&category=-1" target="_blank">腾讯课堂在线视频</a><br/>
<a href="https://ke.qq.com/course/478498" target="_blank">代码生成器视频教程</a><br/>
<a href="http://file.mingsoft.net/ms-runner-5.0.0.zip" target="_blank">Windows一键运行版本\Linux一键运行版本</a>
</p>
-------------------------------------------------------------------------------
......
This diff is collapsed.
......@@ -99,6 +99,7 @@ public class CategoryAction extends BaseAction{
BaseEntity categoryEntity = categoryBiz.getEntity(Integer.parseInt(category.getId()));
model.addAttribute("categoryEntity",categoryEntity);
}
model.addAttribute("appId",BasicUtil.getAppId());
return "/cms/category/form";
}
......
......@@ -102,6 +102,7 @@ public class ContentAction extends BaseAction{
BaseEntity contentEntity = contentBiz.getEntity(Integer.parseInt(content.getId()));
model.addAttribute("contentEntity",contentEntity);
}
model.addAttribute("appId",BasicUtil.getAppId());
return "/cms/content/form";
}
......
......@@ -24,7 +24,6 @@ package net.mingsoft.cms.action;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.io.FileUtil;
import net.mingsoft.basic.action.BaseAction;
import net.mingsoft.basic.biz.IModelBiz;
import net.mingsoft.basic.entity.AppEntity;
import net.mingsoft.basic.util.BasicUtil;
......@@ -52,12 +51,12 @@ import java.util.ArrayList;
import java.util.List;
/**
*
*
* @ClassName: GeneraterAction
* @Description:TODO 生成器
* @author: 铭飞开发团队
* @date: 2018年1月31日 下午2:52:07
*
*
* @Copyright: 2018 www.mingsoft.net Inc. All rights reserved.
*/
@Controller("cmsGenerater")
......@@ -92,7 +91,7 @@ public class GeneraterAction extends BaseAction {
/**
* 更新主页
*
*
* @return
*/
@RequestMapping("/index")
......@@ -102,7 +101,7 @@ public class GeneraterAction extends BaseAction {
/**
* 生成主页
*
*
* @param request
* @param response
*/
......@@ -114,7 +113,7 @@ public class GeneraterAction extends BaseAction {
String tmpFileName = request.getParameter("url");
// 生成后的文件名称
String generateFileName = request.getParameter("position");
// 获取文件所在路径 首先判断用户输入的模版文件是否存在
if (!FileUtil.exist(ParserUtil.buildTempletPath())) {
this.outJson(response, false, getResString("templet.file"));
......@@ -128,12 +127,12 @@ public class GeneraterAction extends BaseAction {
}
}
}
/**
* 生成列表的静态页面
*
*
* @param request
* @param response
* @param CategoryId
......@@ -194,7 +193,7 @@ public class GeneraterAction extends BaseAction {
/**
* 根据栏目id更新所有的文章
*
*
* @param request
* @param response
* @param columnId
......@@ -219,12 +218,12 @@ public class GeneraterAction extends BaseAction {
this.outJson(response, false);
}
}
/**
* 用户预览主页
*
*
* @param request
* @return
*/
......@@ -236,4 +235,4 @@ public class GeneraterAction extends BaseAction {
+ File.separator + position + ParserUtil.HTML_SUFFIX;
return "redirect:" + indexPosition;
}
}
\ No newline at end of file
}
......@@ -33,3 +33,4 @@ category.id=\u6240\u5C5E\u680F\u76EE
content.sort=\u81EA\u5B9A\u4E49\u987A\u5E8F
category.diy.url=\u81EA\u5B9A\u4E49\u94FE\u63A5
content.keyword=\u5173\u952E\u5B57
templet.file=\u672A\u627E\u5230\u6A21\u677F\u6587\u4EF6
......@@ -33,3 +33,4 @@ category.id=\u6240\u5C5E\u680F\u76EE
content.sort=\u81EA\u5B9A\u4E49\u987A\u5E8F
category.diy.url=\u81EA\u5B9A\u4E49\u94FE\u63A5
content.keyword=\u5173\u952E\u5B57
templet.file=\u672A\u627E\u5230\u6A21\u677F\u6587\u4EF6
package net.mingsoft.config;
import java.util.LinkedHashMap;
import java.util.Map;
import net.mingsoft.basic.security.BaseAuthRealm;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
......@@ -11,9 +9,9 @@ import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreato
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import net.mingsoft.basic.security.BaseAuthRealm;
import java.util.LinkedHashMap;
import java.util.Map;
@Configuration
public class ShiroConfig {
......@@ -21,6 +19,29 @@ public class ShiroConfig {
@Value("${ms.manager.path}")
private String managerPath;
/**
* 开启Shiro的注解(如@RequiresRoles , @RequiresPermissions),需借助SspringAOP扫描使用Sshiro注解的类,并在必要时进行安全逻辑验证
* 配置以下两个bean(Defaul tAdvisorAutoProxyCreator和uthorizat ionAttributeSourceAdvisor)即可实现此功能
*/
@Bean
public DefaultAdvisorAutoProxyCreator advisorAutoProxyCreator(){
DefaultAdvisorAutoProxyCreator advisorAutoProxyCreator = new DefaultAdvisorAutoProxyCreator();
advisorAutoProxyCreator.setProxyTargetClass(true);
return advisorAutoProxyCreator;
}
/**
* 开启shiro aop注解支持
* 使用代理方式;所以需要开启代码支持
* @param securityManager
*/
@Bean
public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager){
AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor = new AuthorizationAttributeSourceAdvisor();
authorizationAttributeSourceAdvisor.setSecurityManager(securityManager);
return authorizationAttributeSourceAdvisor;
}
@Bean
public AuthorizationAttributeSourceAdvisor getAuthorizationAttributeSourceAdvisor(
DefaultWebSecurityManager securityManager) {
......
......@@ -72,163 +72,177 @@
</template>
</el-table-column>
</el-table>
</el-main>
</el-main>
</div>
</body>
</html>
<script>
var indexVue = new Vue({
el: '#index',
data:{
dataList: [], //分类列表
selectionList:[],//分类列表选中
loading: true,//加载状态
emptyText:'',//提示文字
manager: ms.manager,
loadState:false,
categoryTypeOptions:[{"value":"1","label":"列表"},{"value":"2","label":"封面"}],
//搜索表单
form:{
// 栏目管理名称
categoryTitle:'',
// 所属栏目
categoryId:'',
// 栏目管理属性
categoryType:'2',
// 自定义顺序
categorySort:0,
// 列表模板
categoryListUrl:'',
// 内容模板
categoryUrl:'',
// 栏目管理关键字
categoryKeyword:'',
// 栏目管理描述
categoryDescrip:'',
// 缩略图
categoryImg: [],
// 自定义链接
categoryDiyUrl:'',
// 栏目管理的内容模型id
mdiyModelId:'',
"use strict";
var indexVue = new Vue({
el: '#index',
data: {
dataList: [],
//分类列表
selectionList: [],
//分类列表选中
loading: true,
//加载状态
emptyText: '',
//提示文字
manager: ms.manager,
loadState: false,
categoryTypeOptions: [{
"value": "1",
"label": "列表"
}, {
"value": "2",
"label": "封面"
}],
//搜索表单
form: {
// 栏目管理名称
categoryTitle: '',
// 所属栏目
categoryId: '',
// 栏目管理属性
categoryType: '2',
// 自定义顺序
categorySort: 0,
// 列表模板
categoryListUrl: '',
// 内容模板
categoryUrl: '',
// 栏目管理关键字
categoryKeyword: '',
// 栏目管理描述
categoryDescrip: '',
// 缩略图
categoryImg: [],
// 自定义链接
categoryDiyUrl: '',
// 栏目管理的内容模型id
mdiyModelId: ''
}
},
},
methods:{
//查询列表
list: function() {
var that = this;
this.loadState = false;
this.loading = true;
ms.http.get(ms.manager+"/cms/category/list.do",{
pageSize:999,
}).then(
function(res) {
if(that.loadState){
that.loading = false;
}else {
that.loadState = true
methods: {
//查询列表
list: function () {
var that = this;
this.loadState = false;
this.loading = true;
ms.http.get(ms.manager + "/cms/category/list.do", {
pageSize: 999
}).then(function (res) {
if (that.loadState) {
that.loading = false;
} else {
that.loadState = true;
}
if (!res.result || res.data.total <= 0) {
that.emptyText = '暂无数据';
that.dataList = [];
} else {
that.emptyText = '';
that.dataList = ms.util.treeData(res.data.rows, 'id', 'categoryId', 'children');
}
}).catch(function (err) {
console.log(err);
});
setTimeout(function () {
if (that.loadState) {
that.loading = false;
} else {
that.loadState = true;
}
}, 500);
},
copyUrl: function () {
var clipboard = new ClipboardJS('.copyBtn');
var self = this;
clipboard.on('success', function (e) {
self.$notify({
title: '提示',
message: "链接地址已保存到剪切板",
type: 'success'
});
clipboard.destroy();
});
},
//分类列表选中
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/category/delete.do", row.length ? row : [row], {
headers: {
'Content-Type': 'application/json'
}
if (!res.result||res.data.total <= 0) {
that.emptyText = '暂无数据'
that.dataList = [];
}).then(function (res) {
if (res.result) {
that.$notify({
type: 'success',
message: '删除成功!'
}); //删除成功,刷新列表
that.list();
} else {
that.emptyText = '';
that.dataList = ms.util.treeData(res.data.rows,'id','categoryId','children');
that.$notify({
title: '失败',
message: res.msg,
type: 'warning'
});
}
}).catch(function(err) {
console.log(err);
});
setTimeout(()=>{
if(that.loadState){
that.loading = false;
}else {
that.loadState = true
}
}, 500);
},
copyUrl: function(){
var clipboard = new ClipboardJS('.copyBtn');
var self = this;
clipboard.on('success', function (e) {
self.$notify({
title: '提示',
message: "链接地址已保存到剪切板",
type: 'success'
});
}).catch(function () {
that.$notify({
type: 'info',
message: '已取消删除'
});
});
clipboard.destroy();
});
},
//分类列表选中
handleSelectionChange:function(val){
this.selectionList = val;
},
//删除
del: function(row){
var that = this;
that.$confirm('此操作将永久删除所选内容, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
ms.http.post(ms.manager+"/cms/category/delete.do", row.length?row:[row],{
headers: {
'Content-Type': 'application/json'
}
}).then(
function(res){
if (res.result) {
that.$notify({
type: 'success',
message: '删除成功!'
});
//删除成功,刷新列表
that.list();
}else {
that.$notify({
title: '失败',
message: res.msg,
type: 'warning'
});
}
});
}).catch(() => {
that.$notify({
type: 'info',
message: '已取消删除'
});
});
},
//表格数据转换
categoryTypeFormat(row, column, cellValue, index){
var value="";
if(cellValue){
var data = this.categoryTypeOptions.find(function(value){
return value.value==cellValue;
})
if(data&&data.label){
value = data.label;
},
//表格数据转换
categoryTypeFormat: function (row, column, cellValue, index) {
var value = "";
if (cellValue) {
var data = this.categoryTypeOptions.find(function (value) {
return value.value == cellValue;
});
if (data && data.label) {
value = data.label;
}
}
return value;
},
//新增
save: function (id) {
if (id) {
location.href = this.manager + "/cms/category/form.do?id=" + id;
} else {
location.href = this.manager + "/cms/category/form.do";
}
},
//重置表单
rest: function () {
this.$refs.searchForm.resetFields();
}
return value;
},
//新增
save:function(id){
if(id){
location.href=this.manager+"/cms/category/form.do?id="+id;
}else {
location.href=this.manager+"/cms/category/form.do";
}
},
//重置表单
rest(){
this.$refs.searchForm.resetFields();
},
},
created(){
/* this.categoryListUrlOptionsGet();
this.categoryUrlOptionsGet();*/
this.list();
},
})
</script>
\ No newline at end of file
created: function () {
/* this.categoryListUrlOptionsGet();
this.categoryUrlOptionsGet();*/
this.list();
}
});
</script>
......@@ -25,75 +25,78 @@
var indexVue = new Vue({
el: "#index",
data: {
action:"", //跳转页面
action: "",
//跳转页面
defaultProps: {
children: 'children',
label: 'categoryTitle'
},
treeData:[],
loading:true,
emptyText:'',
treeData: [],
loading: true,
emptyText: ''
},
methods:{
handleNodeClick: function(data){
if(data.categoryType == '1'){
this.action = ms.manager +"/cms/content/main.do?categoryId="+data.id;
} else if(data.categoryType == '2'){
this.action = ms.manager +"/cms/content/form.do?categoryId="+data.id+"&type=2";
} else{
this.action = ms.manager +"/cms/content/main.do";
}
methods: {
handleNodeClick: function (data) {
if (data.categoryType == '1') {
this.action = ms.manager + "/cms/content/main.do?categoryId=" + data.id;
} else if (data.categoryType == '2') {
this.action = ms.manager + "/cms/content/form.do?categoryId=" + data.id + "&type=2";
} else {
this.action = ms.manager + "/cms/content/main.do";
}
},
treeList: function(){
treeList: function () {
var that = this;
this.loadState = false;
this.loading = true;
ms.http.get(ms.manager+"/cms/category/list.do",{
pageSize:999,
}).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 = ms.util.treeData(res.data.rows,'id','categoryId','children');
that.treeData = [{
id:0,
categoryTitle:'全部',
children: that.treeData,
}]
}
}).catch(function(err) {
ms.http.get(ms.manager + "/cms/category/list.do", {
pageSize: 999
}).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 = ms.util.treeData(res.data.rows, 'id', 'categoryId', 'children');
that.treeData = [{
id: 0,
categoryTitle: '全部',
children: that.treeData
}];
}
}).catch(function (err) {
console.log(err);
});
setTimeout(()=>{
if(that.loadState){
setTimeout(function () {
if (that.loadState) {
that.loading = false;
}else {
that.loadState = true
} else {
that.loadState = true;
}
}, 500);
},
}
},
mounted(){
this.action = ms.manager +"/cms/content/main.do";
mounted: function () {
this.action = ms.manager + "/cms/content/main.do";
this.treeList();
}
})
});
</script>
<style>
#index .index-menu {
height: 100vh;
min-height: 100vh;
min-width: 140px;
}
#index .ms-iframe-style {
width: 100%;
height: 100%;
border: 0;
}
......
......@@ -119,113 +119,163 @@
</body>
</html>
<script>
"use strict";
var app = new Vue({
el: '#app',
watch:{
},
watch: {},
data: {
homeLoading:false,
articleLoading:false,
columnLoading:false,
template:'index.htm',//主题模板
templateOptions:[],
position:'index', //位置
contentSection:'0', //文章栏目
section:'0', //栏目
time:ms.util.date.fmt(new Date(),"yyyy-MM-dd"),
treeList:[{
id:'0',
categoryTitle:'顶级栏目',
children:[],
}],
homeLoading: false,
articleLoading: false,
columnLoading: false,
template: '',
//主题模板
templateOptions: [],
position: 'index',
//位置
contentSection: '0',
//文章栏目
section: '0',
//栏目
time: ms.util.date.fmt(new Date(), "yyyy-MM-dd"),
treeList: [{
id: '0',
categoryTitle: '顶级栏目',
children: []
}]
},
methods: {
//更新主页
updataIndex(){
updataIndex: function () {
var that = this;
if(!that.position || that.position == ''){
this.$notify({ title: '请输入主页位置!', type: 'warning' });
if (!that.position || that.position == '') {
this.$notify({
title: '请输入主页位置!',
type: 'warning'
});
return;
}
that.homeLoading = true;
ms.http.post(ms.manager+'/cms/generate//generateIndex.do', {url:that.template,position:that.position}).then(function (data) {
if(data.result){
that.$notify({ title: '更新成功!', type: 'success' });
}else {
that.$notify({ title: '更新失败!',message: "错误", type: 'error' });
ms.http.post(ms.manager + '/cms/generate//generateIndex.do', {
url: that.template,
position: that.position
}).then(function (data) {
if (data.result) {
that.$notify({
title: '更新成功!',
type: 'success'
});
} else {
that.$notify({
title: '更新失败!',
message: "错误",
type: 'error'
});
}
}).catch(function (err) {
that.$notify({ title: '更新失败!',message: err, type: 'error' });
that.$notify({
title: '更新失败!',
message: err,
type: 'error'
});
console.log(err);
}).finally(()=>{
}).finally(function () {
that.homeLoading = false;
});
},
//预览主页
viewIndex(){
if(!this.position || this.position == ''){
this.$notify({ title: '请输入主页位置!', type: 'warning' });
viewIndex: function () {
if (!this.position || this.position == '') {
this.$notify({
title: '请输入主页位置!',
type: 'warning'
});
return;
}
window.open(ms.manager+"/cms/generate/"+this.position+"/viewIndex.do");
window.open(ms.manager + "/cms/generate/" + this.position + "/viewIndex.do");
},
//更新栏目
updateColumn(){
updateColumn: function () {
var that = this;
that.columnLoading = true;
ms.http.get(ms.manager+'/cms/generate/'+(that.section?that.section:0)+'/genernateColumn.do').then(function (data) {
if(data.result){
that.$notify({ title: '更新成功!', type: 'success' });
ms.http.get(ms.manager + '/cms/generate/' + (that.section ? that.section : 0) + '/genernateColumn.do').then(function (data) {
if (data.result) {
that.$notify({
title: '更新成功!',
type: 'success'
});
}
}).catch(function (err) {
that.$notify({ title: '更新失败!',message: err, type: 'error' });
that.$notify({
title: '更新失败!',
message: err,
type: 'error'
});
console.log(err);
}).finally(()=>{
}).finally(function () {
that.columnLoading = false;
});
},
//生成文章栏目
updateArticle(){
updateArticle: function () {
var that = this;
that.articleLoading = true;
ms.http.post(ms.manager+'/cms/generate/'+(that.contentSection?that.contentSection:0)+'/generateArticle.do', {dateTime:that.time}).then(function (data) {
if(data.result){
that.$notify({ title: '更新成功!', type: 'success' });
ms.http.post(ms.manager + '/cms/generate/' + (that.contentSection ? that.contentSection : 0) + '/generateArticle.do', {
dateTime: that.time
}).then(function (data) {
if (data.result) {
that.$notify({
title: '更新成功!',
type: 'success'
});
}
}).catch(function (err) {
that.$notify({ title: '更新失败!',message: err, type: 'error' });
that.$notify({
title: '更新失败!',
message: err,
type: 'error'
});
console.log(err);
}).finally(()=>{
}).finally(function () {
that.articleLoading = false;
});
},
//获取主题模板数据源
templateOptionsGet() {
templateOptionsGet: function () {
var that = this;
ms.http.get(ms.manager+'/template/queryTemplateFileForColumn.do', {pageSize:99999}).then(function (data) {
that.templateOptions = data.data;
ms.http.get(ms.manager + '/template/queryTemplateFileForColumn.do', {
pageSize: 99999
}).then(function (data) {
that.templateOptions = data.data; //寻找主页
var template = that.templateOptions.find(function (x) {
return x.indexOf("index") != -1 || x.indexOf("default") != -1;
}); //没有就找其他的
that.template = template || (that.templateOptions.length > 0 ? that.templateOptions[0] : "");
}).catch(function (err) {
console.log(err);
});
},
getTree(){
getTree: function () {
var that = this;
ms.http.get(ms.manager+"/cms/category/list.do",{pageSize:9999}).then(function(res){
if(res.result){
ms.http.get(ms.manager + "/cms/category/list.do", {
pageSize: 9999
}).then(function (res) {
if (res.result) {
//res.data.rows.push({id:0,categoryId: null,categoryTitle:'顶级栏目管理'});
that.treeList[0].children = ms.util.treeData(res.data.rows,'id','categoryId','children');
that.treeList[0].children = ms.util.treeData(res.data.rows, 'id', 'categoryId', 'children');
}
}).catch(function(err){
}).catch(function (err) {
console.log(err);
});
},
}
},
created(){
created: function () {
this.getTree();
this.templateOptionsGet();
}
})
});
</script>
<style>
input{
......@@ -702,4 +752,4 @@
.el-date-editor{
width: 100%;
}
</style>
\ No newline at end of file
</style>
......@@ -427,92 +427,115 @@
<script>
var app = new Vue({
el: '#app',
watch:{
},
watch: {},
data: {
base:ms.base,
base: ms.base,
msNewsLast: '',
msNewsPath: ''
},
methods: {
jumpArtcleManager(){
window.parent.indexVue.openMenu({modelId:706,modelTitle:'文章管理',modelIcon: "icon-neirongguanli"});
jumpArtcleManager: function () {
window.parent.indexVue.openMenu({
modelId: 706,
modelTitle: '文章管理',
modelIcon: "icon-neirongguanli"
});
},
//栏目管理
jumpCategorymanager(){
window.parent.indexVue.open({"modelId":708,"modelTitle":"栏目管理","modelModelId":706,"modelUrl":"cms/category/index.do"});
jumpCategorymanager: function () {
window.parent.indexVue.open({
"modelId": 708,
"modelTitle": "栏目管理",
"modelModelId": 706,
"modelUrl": "cms/category/index.do"
});
},
//静态化
jumpStaticManager(){
window.parent.indexVue.open({"modelId":406,"modelTitle":"静态化","modelModelId":23,"modelUrl":"cms/generate/index.do"});
jumpStaticManager: function () {
window.parent.indexVue.open({"modelId":709,"modelTitle":"静态化","modelModelId":706,"modelUrl":"cms/generate/index.do"});
},
//管理员管理
jumpAdmininstatorManager(){
window.parent.indexVue.open({"modelId":411,"modelTitle":"管理员管理","modelModelId":23,"modelUrl":"basic/manager/index.do"});
jumpAdmininstatorManager: function () {
window.parent.indexVue.open({
"modelId": 411,
"modelTitle": "管理员管理",
"modelModelId": 23,
"modelUrl": "basic/manager/index.do"
});
},
//角色管理
jumpUserManager(){
window.parent.indexVue.open({"modelId":406,"modelTitle":"角色管理","modelModelId":23,"modelUrl":"basic/role/index.do"});
jumpUserManager: function () {
window.parent.indexVue.open({
"modelId": 406,
"modelTitle": "角色管理",
"modelModelId": 23,
"modelUrl": "basic/role/index.do"
});
},
//菜单管理
jumpMenuManager(){
window.parent.indexVue.open({"modelId":183,"modelTitle":"菜单管理","modelModelId":23,"modelUrl":"model/index.do"});
jumpMenuManager: function () {
window.parent.indexVue.open({
"modelId": 183,
"modelTitle": "菜单管理",
"modelModelId": 23,
"modelUrl": "model/index.do"
});
},
//模板管理
jumpTemplateManager(){
window.parent.indexVue.open({"modelId":87,"modelTitle":"模板管理","modelModelId":84,"modelUrl":"template/index.do"});
jumpTemplateManager: function () {
window.parent.indexVue.open({
"modelId": 87,
"modelTitle": "模板管理",
"modelModelId": 84,
"modelUrl": "template/index.do"
});
},
//应用管理
jumpApplicationManager(){
window.parent.indexVue.open({"modelId":86,"modelTitle":"应用管理","modelModelId":84,"modelUrl":"app/-1/edit.do"});
jumpApplicationManager: function () {
window.parent.indexVue.open({
"modelId": 86,
"modelTitle": "应用管理",
"modelModelId": 84,
"modelUrl": "app/-1/edit.do"
});
},
//铭飞开发文档
jumpMCMSDocument(){
jumpMCMSDocument: function () {
window.open("http://doc.ms.mingsoft.net/plugs-cms/");
},
enterQQOneGroup(){
enterQQOneGroup: function () {
window.open("https://shang.qq.com/wpa/qunwpa?idkey=ebf251dc9758de6b9c78c499956431cba73e28b3f0b72c0fc28242e98b20fca2");
},
enterQQTwoGroup(){
enterQQTwoGroup: function () {
window.open("http://shang.qq.com/wpa/qunwpa?idkey=cfb32b0f47d89d7ef1c3a9493984d4ffbdfe14049fdedd90c517a072e90d68b9");
},
enterQQThreeGroup(){
enterQQThreeGroup: function () {
window.open("http://shang.qq.com/wpa/qunwpa?idkey=5dd11fdb492c4ded090fa1f78a166583978e33c4a61301b136d31e9e3eb7df72");
},
enterQQFourGroup(){
enterQQFourGroup: function () {
window.open("http://shang.qq.com/wpa/qunwpa?idkey=565f1e4c4fabeee42947f6c6b96ac7ca4853dece16559d3d78e944ca2931b7f5");
},
addBusinessQQ(){
addBusinessQQ: function () {
window.open("http://wpa.qq.com/msgrd?v=3&uin=3336073455&site=qq&menu=yes");
},
//打开铭飞消息页面
openMCMSNews(){
openMCMSNews: function () {
window.open(this.msNewsPath);
},
getNewsLast(){
getNewsLast: function () {
var that = this;
axios.create({
withCredentials: true
}).get("https://ms.mingsoft.net/cms/content/list.do?contentCategoryId=202").then(function (res){
}).get("https://ms.mingsoft.net/cms/content/list.do?contentCategoryId=202").then(function (res) {
that.msNewsLast = res.data.data.rows[0].contentTitle.toString();
that.msNewsPath = 'https://ms.mingsoft.net/html/1/203/202/'+res.data.data.rows[0].id+'.html'
})
that.msNewsPath = 'https://ms.mingsoft.net/html/1/203/202/' + res.data.data.rows[0].id + '.html';
});
}
},
created(){
this.getNewsLast()
created: function () {
this.getNewsLast();
}
})
});
</script>
<style>
.custom-body {
......@@ -2844,4 +2867,4 @@
#app{
overflow-x: hidden;
}
</style>
\ No newline at end of file
</style>
//ie的兼容
//Object.assign 对ie对支持
if (typeof Object.assign != 'function') {
Object.assign = function(target) {
'use strict';
......@@ -17,4 +20,4 @@ if (typeof Object.assign != 'function') {
}
return target;
};
}
}
\ No newline at end of file
......@@ -9,6 +9,8 @@
function(config) {
config.headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Cache-Control': 'no-cache',
'Pragma': 'no-cache',
'X-Requested-With': 'XMLHttpRequest'
}
if (config.method === 'post' && config.headers["Content-Type"] === "application/x-www-form-urlencoded") {
......@@ -171,4 +173,4 @@
}
window.ms.http = http;
window.ms.isLoginRedirect = true;
}());
\ No newline at end of file
}());
/**
* 通用工具类
* 通用工具类
*/
(function() {
......@@ -20,23 +20,38 @@
log(e.message);
}
}
//树形数据组织
function treeData (source, id, parentId, children) {
let cloneData = JSON.parse(JSON.stringify(source))
return cloneData.filter(father => {
let branchArr = cloneData.filter(child => father[id] == child[parentId]);
branchArr.length > 0 ? father[children] = branchArr : ''
return !father[parentId]||father[parentId]=='0' // 如果第一层不是parentId=0,请自行修改
})
/**
* 列表数据转化为树形结构的列表
* @param source 数据源list
* @param id 编号
* @param parentId 父级编号
* @param children 树形子集变量
* @returns {*}
* 支持父级编号为 0或null
* 原始数据[{id:1,titile:"标题",pid:0},{id:2,titile:"标题",pid:1}]
* 转化树形数据:[{id:1,titile:"标题",pid:0,children:[{id:2,titile:"标题",pid:1}]}]
*/
function treeData(source, id, parentId, children) {
var cloneData = JSON.parse(JSON.stringify(source));
return cloneData.filter(function (father) {
var branchArr = cloneData.filter(function (child) {
return father[id] == child[parentId];
});
branchArr.length > 0 ? father[children] = branchArr : '';
return !father[parentId] || father[parentId] == '0' || father[parentId] == null ;
});
}
//验证是否为子集
function childValidate (sourceList,id,parentId,key,parentKey){
var data=sourceList.find(x=>x[key]==parentId);
if(data&&data[parentKey]!='0'&&data[parentKey]){
if(id==data[parentKey]){
return false
function childValidate(sourceList, id, parentId, key, parentKey) {
var data = sourceList.find(function (x) {
return x[key] == parentId;
});
if (data && data[parentKey] != '0' && data[parentKey]) {
if (id == data[parentKey]) {
return false;
}
return childValidate(sourceList,id,data[parentKey],key,parentKey)
return childValidate(sourceList, id, data[parentKey], key, parentKey);
}
return true;
}
......@@ -44,20 +59,19 @@
//日期处理
var date = {
//格式化时间
fmt: function(date, fmt) {
var date = new Date(date);
log(fmt);
fmt: function(de, fmt) {
var date = new Date(typeof de == "string"?de.replace(/-/g, "/"):de);
if (!fmt) {
fmt = "yyyy-mm-dd";
}
var o = {
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
......@@ -226,4 +240,4 @@
}
window.ms.util = util;
window.ms.debug = false
}());
\ No newline at end of file
}());
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