diff --git a/src/api/index.js b/src/api/index.js index affc7ae..f84a422 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -52,6 +52,7 @@ export default { deleteArticle: `/iasf/sysContent/batchDeletion`, findArticle: `/iasf/sysContent/findById`, queryArticle: `/iasf/sysContent/pagingQuery`, + queryArticlesByColumnType: `/iasf/sysColumn/queryArticlesByColumnType`, articleEnableOrDisable: `/iasf/sysContent/articleEnableOrDisable`, saveArticle: `/iasf/sysContent/save`, updateArticle: `/iasf/sysContent/update`, diff --git a/src/components/modules/content.vue b/src/components/modules/content.vue index 827c5cf..78471cd 100644 --- a/src/components/modules/content.vue +++ b/src/components/modules/content.vue @@ -54,6 +54,7 @@
+ 清除 设置链接
diff --git a/src/components/modules/history.vue b/src/components/modules/history.vue index ce1d85d..ced5be9 100644 --- a/src/components/modules/history.vue +++ b/src/components/modules/history.vue @@ -1,87 +1,52 @@ @@ -159,11 +124,12 @@ export default { \ No newline at end of file diff --git a/src/components/modules/module.vue b/src/components/modules/module.vue index 6afab49..a98604c 100644 --- a/src/components/modules/module.vue +++ b/src/components/modules/module.vue @@ -63,7 +63,8 @@ - +

上传图片

@@ -94,13 +95,14 @@ 您的浏览器不支持 video 标签。 - +
- + + 清除 设置链接
{ - auth.find(n => n.includes(e.siteName)) && result.push(e) - }) - return result - }, - //返回格式化时间,传参例如:"yyyy-MM-dd hh:mm:ss" - formatDate(fmt, date) { - var date = date ? date : new Date(); - 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() //毫秒 - }; - if (/(y+)/.test(fmt)) { - fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length)); - } - for (var k in o) { - if (new RegExp("(" + k + ")").test(fmt)) { - fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); - } - } - return fmt; - }, - // 传入文件后缀判断是否是视频 - isVideo(ext) { - if (exts.video.includes(ext)) return true; - return false; - }, - // 传入文件后缀判断是否是音频 - isAudio(ext) { - if (exts.audio.includes(ext)) return true; - return false; - }, - // 传入文件后缀判断是否是图片 - isImg(ext) { - if (exts.img.includes(ext.toLowerCase())) return true; - return false; - }, - // 传入文件后缀判断是否是pdf以外的文档 - isDoc(ext) { - if (exts.doc.includes(ext)) return true; - return false; - }, - // 传入文件名和路径,下载图片视频,支持跨域,a标签加download不支持跨域 - downloadFile(fileName, url) { - var x = new XMLHttpRequest(); - x.open("GET", url, true); - x.responseType = "blob"; - x.onload = function(e) { - var url = window.URL.createObjectURL(x.response); - var a = document.createElement("a"); - a.href = url; - a.download = fileName; - a.click(); - }; - x.send(); - }, - // 传入文件名和数据,下载文件 - downloadFileDirect(fileName, data) { - if ("download" in document.createElement("a")) { // 非IE下载 - const elink = document.createElement("a"); - elink.download = fileName; - elink.style.display = "none"; - elink.href = URL.createObjectURL(data); - document.body.appendChild(elink); - elink.click(); - URL.revokeObjectURL(elink.href); // 释放URL 对象 - document.body.removeChild(elink); - } else { // IE10+下载 - navigator.msSaveBlob(data, fileName); - } - }, - // 成功提示 - successMsg(message, duration = 3000) { - Message.closeAll(); - return Message.success({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration }); - }, - // 警告提示 - warningMsg(message, duration = 3000) { - Message.closeAll(); - return Message.warning({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration }); - }, - // 错误提示 - errorMsg(message, duration = 3000) { - Message.closeAll(); - return Message.error({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration }); - }, + local: _local, + // 筛选出有权限的站点 + getSite (list) { + const result = [] + const auth = store.state.auth.btns + list.map(e => { + auth.find(n => n.includes(e.siteName)) && result.push(e) + }) + return result + }, + //返回格式化时间,传参例如:"yyyy-MM-dd hh:mm:ss" + formatDate (fmt, date) { + var date = date ? date : new Date(); + 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() //毫秒 + }; + if (/(y+)/.test(fmt)) { + fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length)); + } + for (var k in o) { + if (new RegExp("(" + k + ")").test(fmt)) { + fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); + } + } + return fmt; + }, + // 传入文件后缀判断是否是视频 + isVideo (ext) { + if (exts.video.includes(ext)) return true; + return false; + }, + // 传入文件后缀判断是否是音频 + isAudio (ext) { + if (exts.audio.includes(ext)) return true; + return false; + }, + // 传入文件后缀判断是否是图片 + isImg (ext) { + if (exts.img.includes(ext.toLowerCase())) return true; + return false; + }, + // 传入文件后缀判断是否是pdf以外的文档 + isDoc (ext) { + if (exts.doc.includes(ext)) return true; + return false; + }, + // 传入文件名和路径,下载图片视频,支持跨域,a标签加download不支持跨域 + downloadFile (fileName, url) { + var x = new XMLHttpRequest(); + x.open("GET", url, true); + x.responseType = "blob"; + x.onload = function (e) { + var url = window.URL.createObjectURL(x.response); + var a = document.createElement("a"); + a.href = url; + a.download = fileName; + a.click(); + }; + x.send(); + }, + // 传入文件名和数据,下载文件 + downloadFileDirect (fileName, data) { + if ("download" in document.createElement("a")) { // 非IE下载 + const elink = document.createElement("a"); + elink.download = fileName; + elink.style.display = "none"; + elink.href = URL.createObjectURL(data); + document.body.appendChild(elink); + elink.click(); + URL.revokeObjectURL(elink.href); // 释放URL 对象 + document.body.removeChild(elink); + } else { // IE10+下载 + navigator.msSaveBlob(data, fileName); + } + }, + // 成功提示 + successMsg (message, duration = 3000) { + Message.closeAll(); + return Message.success({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration }); + }, + // 警告提示 + warningMsg (message, duration = 3000) { + Message.closeAll(); + return Message.warning({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration }); + }, + // 错误提示 + errorMsg (message, duration = 3000) { + Message.closeAll(); + return Message.error({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration }); + }, + // 去掉html里的标签及空格 + removeTag (list, prop = 'mainBody') { + list.map(e => { + // 有摘要取摘要,没有摘要就去掉正文里的标签空格(也可以通过正则去除html标签,不过富文本里会有插入IE注释的情况下,直接创建一个元素取text比较简单) + const text = e.summary || e[prop].replace(/(

[^>]+<\/p>)|(( )+)/g, '') + const el = document.createElement('div') + el.innerHTML = text + // e.mainBody = e.summary || e[prop].replace(/(

[^>]+<\/p>)|(<\!--[^-->]+-->)|(<[^>]+>)|(( )+)/g , '') + e.mainBody = el.innerText + e.releaseTime = e.releaseTime.split(' ')[0] + }) + return list + }, }; export default util; \ No newline at end of file diff --git a/src/mixins/page/index.js b/src/mixins/page/index.js index 3f09dd2..2ff085d 100644 --- a/src/mixins/page/index.js +++ b/src/mixins/page/index.js @@ -83,7 +83,8 @@ export default { } }) this.originModules = JSON.stringify(this.modules) // 原始json,用以页面离开的时候判断是否需要提示保存 - console.log("🚀 ~ file: index.js:85 ~ this.$post ~ list:", this.modules) + this.getArticles && this.getArticles() + console.log("🚀 ~ file: index.js:85 ~ this.$post ~ list:", this.modules, this.getArticles) } }).catch(err => { }) } else { @@ -184,6 +185,10 @@ export default { leave || this.$router.back() }).catch(err => { }) }, + // 关联栏目专用,获取栏目标题 + getColumnTitle (form) { + return form.columnTitle == 1 ? form.columnName : form.columnTitleCustom + }, // 返回 back () { this.pass = true diff --git a/src/pages/column/page/iasf.vue b/src/pages/column/page/iasf.vue index c1928a9..16f091d 100644 --- a/src/pages/column/page/iasf.vue +++ b/src/pages/column/page/iasf.vue @@ -62,77 +62,70 @@

点击更换标题与描述
-
- +
+
-
IASF is driven to serve the Science and industry, and solve grand challenges through research and - innovation. We are open and creative
-
Innovation centers are distributed in the bay areas, such as the San Francisco Bay - area, the - New York Bay area, and the Tokyo Bay area in Japan. And the Guangdong-Hong Kong-Macao Greater Bay -
-

2022-07-24 | Research

+
{{ articles[0].title }}
+
+

{{ articles[0].releaseTime }} {{ articles[0].classificationName && ' | ' + + articles[0].classificationName }}

    -
  • - -
    -

    2022-07-24 | 综合新闻

    -
    X射线自由电子激光已经成为了化学、生物、物理等领域不可或缺的研究手段
    - -
    -
  • -
  • - -
    -

    2022-07-24 | 建设进展

    -
    自由电子激光装置调试及运行过程中提供稳定可靠的单发辐射脉冲纵向信息
    - -
    -
  • -
  • - -
    -

    2022-07-24 | 学术动态

    -
    基于上海软X射线自由电子激光试验装置,科研人员对这一方法进行了实验验证
    - -
    -
  • +
关联栏目
-
+

{{ modules[3].form.title }}

{{ modules[3].form.des }}

diff --git a/src/styles/page/page.scss b/src/styles/page/page.scss index b5b018c..3f94ee5 100644 --- a/src/styles/page/page.scss +++ b/src/styles/page/page.scss @@ -30,7 +30,7 @@ } } .inner { - width: 1400px; + width: 1200px; margin: 0 auto; &.lg { width: 1505px; @@ -104,6 +104,9 @@ background-color: rgba(0, 0, 0, .7); } } +.des { + @include mul-ellipsis(3); +} /deep/.module { .el-table.module-table td { .cell {