From 602c616d1655e85995ab49bb29c2ea1b50219e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BC=9F=E5=BA=9A?= Date: Sat, 2 Apr 2022 11:10:14 +0800 Subject: [PATCH] =?UTF-8?q?up=20=E5=BC=80=E5=8F=91=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/doc-width-nav.vue | 66 +++++++++++++++-- .../technical-support/doc-manage/detail.vue | 70 +++++++++++++++++-- src/pages/technical-support/doc/detail.vue | 4 ++ src/services/helper.js | 19 +++++ 4 files changed, 148 insertions(+), 11 deletions(-) diff --git a/src/components/doc-width-nav.vue b/src/components/doc-width-nav.vue index 9c43c82..9090a98 100644 --- a/src/components/doc-width-nav.vue +++ b/src/components/doc-width-nav.vue @@ -8,11 +8,21 @@
-
-
附件:脚接交接军军军军军军军
+ v-html="content" + ref="docContent" + > +
+
+

附件: + + + {{helper.downloadFileFormatNew(e)}} +
+
+
+ 暂无 +

+
@@ -42,6 +44,7 @@ export default { title: "", update_time: "", content: "", + doc_file: "" }; }, computed: { @@ -85,6 +88,7 @@ export default { if (data.data.content) { this.content = data.data.content; } + this.doc_file = data.data.doc_file || "" } }); }, diff --git a/src/services/helper.js b/src/services/helper.js index 5b10000..c850ab9 100644 --- a/src/services/helper.js +++ b/src/services/helper.js @@ -35,6 +35,25 @@ module.exports.dateFormat = function (fmt, timestamp) { return fmt; } +module.exports.downloadFileFormatNew = function (fileUrl) { + /* + input: /apaas/static/docs/image/images/1234_qq234ewr123.png + output: 1234.png + */ + if (fileUrl != "") { + var temp = fileUrl.split('/')[fileUrl.split('/').length - 1] + var name = temp.split('_')[0] + var type = temp.split('_')[temp.split('_').length - 1].split('.')[1] + if (temp.indexOf('_') == -1) { + return name + } else { + return name + '.' + type + } + } else { + return ""; + } +} + module.exports.dateStringTransform = function (date) { /* input: 2020-06-12T16:38:11+08:00 -- 2.26.0