Commit f016900e authored by 铭飞's avatar 铭飞 Committed by Gitee

!223 添加IE兼容

Merge pull request !223 from 灰色DT/master
parents c27af1cf 5d045428
...@@ -535,7 +535,7 @@ INSERT INTO `model` VALUES (265, '自定义页面', '20010000', 264, 'mdiy/page/ ...@@ -535,7 +535,7 @@ INSERT INTO `model` VALUES (265, '自定义页面', '20010000', 264, 'mdiy/page/
INSERT INTO `model` VALUES (266, '修改', '20010004', 269, 'mdiy:form:update', '2018-09-06 09:38:51', NULL, 0, 0, 0, '264,269', NULL); INSERT INTO `model` VALUES (266, '修改', '20010004', 269, 'mdiy:form:update', '2018-09-06 09:38:51', NULL, 0, 0, 0, '264,269', NULL);
INSERT INTO `model` VALUES (267, '新增', '20010002', 269, 'mdiy:form:save', '2018-09-06 09:38:51', NULL, 0, 0, 0, '264,269', NULL); INSERT INTO `model` VALUES (267, '新增', '20010002', 269, 'mdiy:form:save', '2018-09-06 09:38:51', NULL, 0, 0, 0, '264,269', NULL);
INSERT INTO `model` VALUES (268, '查看', '20010001', 269, 'mdiy:form:view', '2018-09-06 09:38:51', NULL, 0, 0, 0, '264,269', NULL); INSERT INTO `model` VALUES (268, '查看', '20010001', 269, 'mdiy:form:view', '2018-09-06 09:38:51', NULL, 0, 0, 0, '264,269', NULL);
INSERT INTO `model` VALUES (269, '自定义表单', '20020000', 264, 'mdiy/form/index.do', '2018-09-06 09:38:51', NULL, 0, 0, 1, '264', NULL); INSERT INTO `model` VALUES (269, '自定义表单', '20020000', 264, 'mdiy/post/index.do', '2018-09-06 09:38:51', NULL, 0, 0, 1, '264', NULL);
INSERT INTO `model` VALUES (280, '自定义字典', '20050000', 264, 'mdiy/dict/index.do', '2018-09-06 09:38:53', NULL, 0, 0, 1, '264', NULL); INSERT INTO `model` VALUES (280, '自定义字典', '20050000', 264, 'mdiy/dict/index.do', '2018-09-06 09:38:53', NULL, 0, 0, 1, '264', NULL);
INSERT INTO `model` VALUES (281, '删除', '20050003', 280, 'mdiy:dict:del', '2018-09-06 09:38:53', NULL, 0, 0, 0, '264,280', NULL); INSERT INTO `model` VALUES (281, '删除', '20050003', 280, 'mdiy:dict:del', '2018-09-06 09:38:53', NULL, 0, 0, 0, '264,280', NULL);
INSERT INTO `model` VALUES (282, '修改', '20050004', 280, 'mdiy:dict:update', '2018-09-06 09:38:53', NULL, 0, 0, 0, '264,280', NULL); INSERT INTO `model` VALUES (282, '修改', '20050004', 280, 'mdiy:dict:update', '2018-09-06 09:38:53', NULL, 0, 0, 0, '264,280', NULL);
......
...@@ -78,76 +78,88 @@ ...@@ -78,76 +78,88 @@
</html> </html>
<script> <script>
var indexVue = new Vue({ "use strict";
var indexVue = new Vue({
el: '#index', el: '#index',
data:{ data: {
dataList: [], //分类列表 dataList: [],
selectionList:[],//分类列表选中 //分类列表
loading: true,//加载状态 selectionList: [],
emptyText:'',//提示文字 //分类列表选中
loading: true,
//加载状态
emptyText: '',
//提示文字
manager: ms.manager, manager: ms.manager,
loadState:false, loadState: false,
categoryTypeOptions:[{"value":"1","label":"列表"},{"value":"2","label":"封面"}], categoryTypeOptions: [{
"value": "1",
"label": "列表"
}, {
"value": "2",
"label": "封面"
}],
//搜索表单 //搜索表单
form:{ form: {
// 栏目管理名称 // 栏目管理名称
categoryTitle:'', categoryTitle: '',
// 所属栏目 // 所属栏目
categoryId:'', categoryId: '',
// 栏目管理属性 // 栏目管理属性
categoryType:'2', categoryType: '2',
// 自定义顺序 // 自定义顺序
categorySort:0, categorySort: 0,
// 列表模板 // 列表模板
categoryListUrl:'', categoryListUrl: '',
// 内容模板 // 内容模板
categoryUrl:'', categoryUrl: '',
// 栏目管理关键字 // 栏目管理关键字
categoryKeyword:'', categoryKeyword: '',
// 栏目管理描述 // 栏目管理描述
categoryDescrip:'', categoryDescrip: '',
// 缩略图 // 缩略图
categoryImg: [], categoryImg: [],
// 自定义链接 // 自定义链接
categoryDiyUrl:'', categoryDiyUrl: '',
// 栏目管理的内容模型id // 栏目管理的内容模型id
mdiyModelId:'', mdiyModelId: ''
}, }
}, },
methods:{ methods: {
//查询列表 //查询列表
list: function() { list: function () {
var that = this; var that = this;
this.loadState = false; this.loadState = false;
this.loading = true; this.loading = true;
ms.http.get(ms.manager+"/cms/category/list.do",{ ms.http.get(ms.manager + "/cms/category/list.do", {
pageSize:999, pageSize: 999
}).then( }).then(function (res) {
function(res) { if (that.loadState) {
if(that.loadState){
that.loading = false; that.loading = false;
}else { } else {
that.loadState = true that.loadState = true;
} }
if (!res.result||res.data.total <= 0) {
that.emptyText = '暂无数据' if (!res.result || res.data.total <= 0) {
that.emptyText = '暂无数据';
that.dataList = []; that.dataList = [];
} else { } else {
that.emptyText = ''; that.emptyText = '';
that.dataList = ms.util.treeData(res.data.rows,'id','categoryId','children'); that.dataList = ms.util.treeData(res.data.rows, 'id', 'categoryId', 'children');
} }
}).catch(function(err) { }).catch(function (err) {
console.log(err); console.log(err);
}); });
setTimeout(()=>{ setTimeout(function () {
if(that.loadState){ if (that.loadState) {
that.loading = false; that.loading = false;
}else { } else {
that.loadState = true that.loadState = true;
} }
}, 500); }, 500);
}, },
copyUrl: function(){ copyUrl: function () {
var clipboard = new ClipboardJS('.copyBtn'); var clipboard = new ClipboardJS('.copyBtn');
var self = this; var self = this;
clipboard.on('success', function (e) { clipboard.on('success', function (e) {
...@@ -160,31 +172,30 @@ var indexVue = new Vue({ ...@@ -160,31 +172,30 @@ var indexVue = new Vue({
}); });
}, },
//分类列表选中 //分类列表选中
handleSelectionChange:function(val){ handleSelectionChange: function (val) {
this.selectionList = val; this.selectionList = val;
}, },
//删除 //删除
del: function(row){ del: function (row) {
var that = this; var that = this;
that.$confirm('此操作将永久删除所选内容, 是否继续?', '提示', { that.$confirm('此操作将永久删除所选内容, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(function () {
ms.http.post(ms.manager+"/cms/category/delete.do", row.length?row:[row],{ ms.http.post(ms.manager + "/cms/category/delete.do", row.length ? row : [row], {
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
} }
}).then( }).then(function (res) {
function(res){
if (res.result) { if (res.result) {
that.$notify({ that.$notify({
type: 'success', type: 'success',
message: '删除成功!' message: '删除成功!'
}); }); //删除成功,刷新列表
//删除成功,刷新列表
that.list(); that.list();
}else { } else {
that.$notify({ that.$notify({
title: '失败', title: '失败',
message: res.msg, message: res.msg,
...@@ -192,7 +203,7 @@ var indexVue = new Vue({ ...@@ -192,7 +203,7 @@ var indexVue = new Vue({
}); });
} }
}); });
}).catch(() => { }).catch(function () {
that.$notify({ that.$notify({
type: 'info', type: 'info',
message: '已取消删除' message: '已取消删除'
...@@ -200,35 +211,38 @@ var indexVue = new Vue({ ...@@ -200,35 +211,38 @@ var indexVue = new Vue({
}); });
}, },
//表格数据转换 //表格数据转换
categoryTypeFormat(row, column, cellValue, index){ categoryTypeFormat: function (row, column, cellValue, index) {
var value=""; var value = "";
if(cellValue){
var data = this.categoryTypeOptions.find(function(value){ if (cellValue) {
return value.value==cellValue; var data = this.categoryTypeOptions.find(function (value) {
}) return value.value == cellValue;
if(data&&data.label){ });
if (data && data.label) {
value = data.label; value = data.label;
} }
} }
return value; return value;
}, },
//新增 //新增
save:function(id){ save: function (id) {
if(id){ if (id) {
location.href=this.manager+"/cms/category/form.do?id="+id; location.href = this.manager + "/cms/category/form.do?id=" + id;
}else { } else {
location.href=this.manager+"/cms/category/form.do"; location.href = this.manager + "/cms/category/form.do";
} }
}, },
//重置表单 //重置表单
rest(){ rest: function () {
this.$refs.searchForm.resetFields(); this.$refs.searchForm.resetFields();
}
}, },
}, created: function () {
created(){
/* this.categoryListUrlOptionsGet(); /* this.categoryListUrlOptionsGet();
this.categoryUrlOptionsGet();*/ this.categoryUrlOptionsGet();*/
this.list(); this.list();
}, }
}) });
</script> </script>
...@@ -25,75 +25,78 @@ ...@@ -25,75 +25,78 @@
var indexVue = new Vue({ var indexVue = new Vue({
el: "#index", el: "#index",
data: { data: {
action:"", //跳转页面 action: "",
//跳转页面
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'categoryTitle' label: 'categoryTitle'
}, },
treeData:[], treeData: [],
loading:true, loading: true,
emptyText:'', emptyText: ''
}, },
methods:{ methods: {
handleNodeClick: function(data){ handleNodeClick: function (data) {
if(data.categoryType == '1'){ if (data.categoryType == '1') {
this.action = ms.manager +"/cms/content/main.do?categoryId="+data.id; this.action = ms.manager + "/cms/content/main.do?categoryId=" + data.id;
} else if(data.categoryType == '2'){ } else if (data.categoryType == '2') {
this.action = ms.manager +"/cms/content/form.do?categoryId="+data.id+"&type=2"; this.action = ms.manager + "/cms/content/form.do?categoryId=" + data.id + "&type=2";
} else{ } else {
this.action = ms.manager +"/cms/content/main.do"; this.action = ms.manager + "/cms/content/main.do";
} }
}, },
treeList: function(){ treeList: function () {
var that = this; var that = this;
this.loadState = false; this.loadState = false;
this.loading = true; this.loading = true;
ms.http.get(ms.manager+"/cms/category/list.do",{ ms.http.get(ms.manager + "/cms/category/list.do", {
pageSize:999, pageSize: 999
}).then( }).then(function (res) {
function(res) { if (that.loadState) {
if(that.loadState){
that.loading = false; that.loading = false;
}else { } else {
that.loadState = true that.loadState = true;
} }
if (!res.result||res.data.total <= 0) {
if (!res.result || res.data.total <= 0) {
that.emptyText = '暂无数据'; that.emptyText = '暂无数据';
that.treeData = []; that.treeData = [];
} else { } else {
that.emptyText = ''; that.emptyText = '';
that.treeData = ms.util.treeData(res.data.rows,'id','categoryId','children'); that.treeData = ms.util.treeData(res.data.rows, 'id', 'categoryId', 'children');
that.treeData = [{ that.treeData = [{
id:0, id: 0,
categoryTitle:'全部', categoryTitle: '全部',
children: that.treeData, children: that.treeData
}] }];
} }
}).catch(function(err) { }).catch(function (err) {
console.log(err); console.log(err);
}); });
setTimeout(()=>{ setTimeout(function () {
if(that.loadState){ if (that.loadState) {
that.loading = false; that.loading = false;
}else { } else {
that.loadState = true that.loadState = true;
} }
}, 500); }, 500);
}
}, },
}, mounted: function () {
mounted(){ this.action = ms.manager + "/cms/content/main.do";
this.action = ms.manager +"/cms/content/main.do";
this.treeList(); this.treeList();
} }
}) });
</script> </script>
<style> <style>
#index .index-menu { #index .index-menu {
height: 100vh;
min-height: 100vh; min-height: 100vh;
min-width: 140px; min-width: 140px;
} }
#index .ms-iframe-style { #index .ms-iframe-style {
width: 100%; width: 100%;
height: 100%;
border: 0; border: 0;
} }
......
...@@ -119,119 +119,163 @@ ...@@ -119,119 +119,163 @@
</body> </body>
</html> </html>
<script> <script>
"use strict";
var app = new Vue({ var app = new Vue({
el: '#app', el: '#app',
watch:{ watch: {},
},
data: { data: {
homeLoading:false, homeLoading: false,
articleLoading:false, articleLoading: false,
columnLoading:false, columnLoading: false,
template:'',//主题模板 template: '',
templateOptions:[], //主题模板
position:'index', //位置 templateOptions: [],
contentSection:'0', //文章栏目 position: 'index',
section:'0', //栏目 //位置
time:ms.util.date.fmt(new Date(),"yyyy-MM-dd"), contentSection: '0',
treeList:[{ //文章栏目
id:'0', section: '0',
categoryTitle:'顶级栏目', //栏目
children:[], time: ms.util.date.fmt(new Date(), "yyyy-MM-dd"),
}], treeList: [{
id: '0',
categoryTitle: '顶级栏目',
children: []
}]
}, },
methods: { methods: {
//更新主页 //更新主页
updataIndex(){ updataIndex: function () {
var that = this; var that = this;
if(!that.position || that.position == ''){ if (!that.position || that.position == '') {
this.$notify({ title: '请输入主页位置!', type: 'warning' }); this.$notify({
title: '请输入主页位置!',
type: 'warning'
});
return; return;
} }
that.homeLoading = true; that.homeLoading = true;
ms.http.post(ms.manager+'/cms/generate//generateIndex.do', {url:that.template,position:that.position}).then(function (data) { ms.http.post(ms.manager + '/cms/generate//generateIndex.do', {
if(data.result){ url: that.template,
that.$notify({ title: '更新成功!', type: 'success' }); position: that.position
}else { }).then(function (data) {
that.$notify({ title: '更新失败!',message: "错误", type: 'error' }); if (data.result) {
that.$notify({
title: '更新成功!',
type: 'success'
});
} else {
that.$notify({
title: '更新失败!',
message: "错误",
type: 'error'
});
} }
}).catch(function (err) { }).catch(function (err) {
that.$notify({ title: '更新失败!',message: err, type: 'error' }); that.$notify({
title: '更新失败!',
message: err,
type: 'error'
});
console.log(err); console.log(err);
}).finally(()=>{ }).finally(function () {
that.homeLoading = false; that.homeLoading = false;
}); });
}, },
//预览主页 //预览主页
viewIndex(){ viewIndex: function () {
if(!this.position || this.position == ''){ if (!this.position || this.position == '') {
this.$notify({ title: '请输入主页位置!', type: 'warning' }); this.$notify({
title: '请输入主页位置!',
type: 'warning'
});
return; 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; var that = this;
that.columnLoading = true; that.columnLoading = true;
ms.http.get(ms.manager+'/cms/generate/'+(that.section?that.section:0)+'/genernateColumn.do').then(function (data) { ms.http.get(ms.manager + '/cms/generate/' + (that.section ? that.section : 0) + '/genernateColumn.do').then(function (data) {
if(data.result){ if (data.result) {
that.$notify({ title: '更新成功!', type: 'success' }); that.$notify({
title: '更新成功!',
type: 'success'
});
} }
}).catch(function (err) { }).catch(function (err) {
that.$notify({ title: '更新失败!',message: err, type: 'error' }); that.$notify({
title: '更新失败!',
message: err,
type: 'error'
});
console.log(err); console.log(err);
}).finally(()=>{ }).finally(function () {
that.columnLoading = false; that.columnLoading = false;
}); });
}, },
//生成文章栏目 //生成文章栏目
updateArticle(){ updateArticle: function () {
var that = this; var that = this;
that.articleLoading = true; that.articleLoading = true;
ms.http.post(ms.manager+'/cms/generate/'+(that.contentSection?that.contentSection:0)+'/generateArticle.do', {dateTime:that.time}).then(function (data) { ms.http.post(ms.manager + '/cms/generate/' + (that.contentSection ? that.contentSection : 0) + '/generateArticle.do', {
if(data.result){ dateTime: that.time
that.$notify({ title: '更新成功!', type: 'success' }); }).then(function (data) {
if (data.result) {
that.$notify({
title: '更新成功!',
type: 'success'
});
} }
}).catch(function (err) { }).catch(function (err) {
that.$notify({ title: '更新失败!',message: err, type: 'error' }); that.$notify({
title: '更新失败!',
message: err,
type: 'error'
});
console.log(err); console.log(err);
}).finally(()=>{ }).finally(function () {
that.articleLoading = false; that.articleLoading = false;
}); });
}, },
//获取主题模板数据源 //获取主题模板数据源
templateOptionsGet() { templateOptionsGet: function () {
var that = this; var that = this;
ms.http.get(ms.manager+'/template/queryTemplateFileForColumn.do', {pageSize:99999}).then(function (data) { ms.http.get(ms.manager + '/template/queryTemplateFileForColumn.do', {
that.templateOptions = data.data; pageSize: 99999
//寻找主页 }).then(function (data) {
that.templateOptions = data.data; //寻找主页
var template = that.templateOptions.find(function (x) { var template = that.templateOptions.find(function (x) {
return x.indexOf("index")!=-1||x.indexOf("default")!=-1; return x.indexOf("index") != -1 || x.indexOf("default") != -1;
}) }); //没有就找其他的
//没有就找其他的
that.template = template||(that.templateOptions.length>0?that.templateOptions[0]:""); that.template = template || (that.templateOptions.length > 0 ? that.templateOptions[0] : "");
}).catch(function (err) { }).catch(function (err) {
console.log(err); console.log(err);
}); });
}, },
getTree(){ getTree: function () {
var that = this; var that = this;
ms.http.get(ms.manager+"/cms/category/list.do",{pageSize:9999}).then(function(res){ ms.http.get(ms.manager + "/cms/category/list.do", {
if(res.result){ pageSize: 9999
}).then(function (res) {
if (res.result) {
//res.data.rows.push({id:0,categoryId: null,categoryTitle:'顶级栏目管理'}); //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); console.log(err);
}); });
}
}, },
}, created: function () {
created(){
this.getTree(); this.getTree();
this.templateOptionsGet(); this.templateOptionsGet();
} }
}) });
</script> </script>
<style> <style>
input{ input{
......
...@@ -427,92 +427,115 @@ ...@@ -427,92 +427,115 @@
<script> <script>
var app = new Vue({ var app = new Vue({
el: '#app', el: '#app',
watch:{ watch: {},
},
data: { data: {
base:ms.base, base: ms.base,
msNewsLast: '', msNewsLast: '',
msNewsPath: '' msNewsPath: ''
}, },
methods: { methods: {
jumpArtcleManager(){ jumpArtcleManager: function () {
window.parent.indexVue.openMenu({modelId:706,modelTitle:'文章管理',modelIcon: "icon-neirongguanli"}); window.parent.indexVue.openMenu({
modelId: 706,
modelTitle: '文章管理',
modelIcon: "icon-neirongguanli"
});
}, },
//栏目管理 //栏目管理
jumpCategorymanager(){ jumpCategorymanager: function () {
window.parent.indexVue.open({"modelId":708,"modelTitle":"栏目管理","modelModelId":706,"modelUrl":"cms/category/index.do"}); window.parent.indexVue.open({
"modelId": 708,
"modelTitle": "栏目管理",
"modelModelId": 706,
"modelUrl": "cms/category/index.do"
});
}, },
//静态化 //静态化
jumpStaticManager(){ jumpStaticManager: function () {
window.parent.indexVue.open({"modelId":709,"modelTitle":"静态化","modelModelId":706,"modelUrl":"cms/generate/index.do"}); window.parent.indexVue.open({"modelId":709,"modelTitle":"静态化","modelModelId":706,"modelUrl":"cms/generate/index.do"});
}, },
//管理员管理 //管理员管理
jumpAdmininstatorManager(){ jumpAdmininstatorManager: function () {
window.parent.indexVue.open({"modelId":411,"modelTitle":"管理员管理","modelModelId":23,"modelUrl":"basic/manager/index.do"}); window.parent.indexVue.open({
"modelId": 411,
"modelTitle": "管理员管理",
"modelModelId": 23,
"modelUrl": "basic/manager/index.do"
});
}, },
//角色管理 //角色管理
jumpUserManager(){ jumpUserManager: function () {
window.parent.indexVue.open({"modelId":406,"modelTitle":"角色管理","modelModelId":23,"modelUrl":"basic/role/index.do"}); window.parent.indexVue.open({
"modelId": 406,
"modelTitle": "角色管理",
"modelModelId": 23,
"modelUrl": "basic/role/index.do"
});
}, },
//菜单管理 //菜单管理
jumpMenuManager(){ jumpMenuManager: function () {
window.parent.indexVue.open({"modelId":183,"modelTitle":"菜单管理","modelModelId":23,"modelUrl":"model/index.do"}); window.parent.indexVue.open({
"modelId": 183,
"modelTitle": "菜单管理",
"modelModelId": 23,
"modelUrl": "model/index.do"
});
}, },
//模板管理 //模板管理
jumpTemplateManager(){ jumpTemplateManager: function () {
window.parent.indexVue.open({"modelId":87,"modelTitle":"模板管理","modelModelId":84,"modelUrl":"template/index.do"}); window.parent.indexVue.open({
"modelId": 87,
"modelTitle": "模板管理",
"modelModelId": 84,
"modelUrl": "template/index.do"
});
}, },
//应用管理 //应用管理
jumpApplicationManager(){ jumpApplicationManager: function () {
window.parent.indexVue.open({"modelId":86,"modelTitle":"应用管理","modelModelId":84,"modelUrl":"app/-1/edit.do"}); 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/"); window.open("http://doc.ms.mingsoft.net/plugs-cms/");
}, },
enterQQOneGroup(){ enterQQOneGroup: function () {
window.open("https://shang.qq.com/wpa/qunwpa?idkey=ebf251dc9758de6b9c78c499956431cba73e28b3f0b72c0fc28242e98b20fca2"); window.open("https://shang.qq.com/wpa/qunwpa?idkey=ebf251dc9758de6b9c78c499956431cba73e28b3f0b72c0fc28242e98b20fca2");
}, },
enterQQTwoGroup(){ enterQQTwoGroup: function () {
window.open("http://shang.qq.com/wpa/qunwpa?idkey=cfb32b0f47d89d7ef1c3a9493984d4ffbdfe14049fdedd90c517a072e90d68b9"); window.open("http://shang.qq.com/wpa/qunwpa?idkey=cfb32b0f47d89d7ef1c3a9493984d4ffbdfe14049fdedd90c517a072e90d68b9");
}, },
enterQQThreeGroup(){ enterQQThreeGroup: function () {
window.open("http://shang.qq.com/wpa/qunwpa?idkey=5dd11fdb492c4ded090fa1f78a166583978e33c4a61301b136d31e9e3eb7df72"); window.open("http://shang.qq.com/wpa/qunwpa?idkey=5dd11fdb492c4ded090fa1f78a166583978e33c4a61301b136d31e9e3eb7df72");
}, },
enterQQFourGroup(){ enterQQFourGroup: function () {
window.open("http://shang.qq.com/wpa/qunwpa?idkey=565f1e4c4fabeee42947f6c6b96ac7ca4853dece16559d3d78e944ca2931b7f5"); 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"); window.open("http://wpa.qq.com/msgrd?v=3&uin=3336073455&site=qq&menu=yes");
}, },
//打开铭飞消息页面 //打开铭飞消息页面
openMCMSNews(){ openMCMSNews: function () {
window.open(this.msNewsPath); window.open(this.msNewsPath);
}, },
getNewsLast(){ getNewsLast: function () {
var that = this; var that = this;
axios.create({ axios.create({
withCredentials: true 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.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(){ created: function () {
this.getNewsLast() this.getNewsLast();
} }
}) });
</script> </script>
<style> <style>
.custom-body { .custom-body {
......
if (typeof Object.assign != 'function') {
Object.assign = function(target) {
'use strict';
if (target == null) {
throw new TypeError('Cannot convert undefined or null to object');
}
target = Object(target);
for (var index = 1; index < arguments.length; index++) {
var source = arguments[index];
if (source != null) {
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
}
return target;
};
}
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
function(config) { function(config) {
config.headers = { config.headers = {
'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded',
'Cache-Control': 'no-cache',
'Pragma': 'no-cache',
'X-Requested-With': 'XMLHttpRequest' 'X-Requested-With': 'XMLHttpRequest'
} }
if (config.method === 'post' && config.headers["Content-Type"] === "application/x-www-form-urlencoded") { if (config.method === 'post' && config.headers["Content-Type"] === "application/x-www-form-urlencoded") {
......
...@@ -21,22 +21,26 @@ ...@@ -21,22 +21,26 @@
} }
} }
//树形数据组织 //树形数据组织
function treeData (source, id, parentId, children) { function treeData(source, id, parentId, children) {
let cloneData = JSON.parse(JSON.stringify(source)) var cloneData = JSON.parse(JSON.stringify(source));
return cloneData.filter(father => { return cloneData.filter(function (father) {
let branchArr = cloneData.filter(child => father[id] == child[parentId]); var branchArr = cloneData.filter(function (child) {
branchArr.length > 0 ? father[children] = branchArr : '' return father[id] == child[parentId];
return !father[parentId]||father[parentId]=='0' // 如果第一层不是parentId=0,请自行修改 });
}) branchArr.length > 0 ? father[children] = branchArr : '';
return !father[parentId] || father[parentId] == '0'; // 如果第一层不是parentId=0,请自行修改
});
} }
//验证是否为子集 //验证是否为子集
function childValidate (sourceList,id,parentId,key,parentKey){ function childValidate(sourceList, id, parentId, key, parentKey) {
var data=sourceList.find(x=>x[key]==parentId); var data = sourceList.find(function (x) {
if(data&&data[parentKey]!='0'&&data[parentKey]){ return x[key] == parentId;
if(id==data[parentKey]){ });
return false 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; return true;
} }
...@@ -44,9 +48,8 @@ ...@@ -44,9 +48,8 @@
//日期处理 //日期处理
var date = { var date = {
//格式化时间 //格式化时间
fmt: function(date, fmt) { fmt: function(de, fmt) {
var date = new Date(date); var date = new Date(typeof de == "string"?de.replace(/-/g, "/"):de);
log(fmt);
if (!fmt) { if (!fmt) {
fmt = "yyyy-mm-dd"; fmt = "yyyy-mm-dd";
} }
......
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