From 8d95350531dd2319c9158efc35ee635bb42a447b Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 25 Sep 2024 16:29:05 +0800 Subject: [PATCH] fix --- src/components/TestPanel.vue | 2 +- src/components/tinymceConfig.js | 175 +++++++++++++------------- src/config/index.js | 4 +- src/views/Report.vue | 217 +++++++++++++------------------- 4 files changed, 181 insertions(+), 217 deletions(-) diff --git a/src/components/TestPanel.vue b/src/components/TestPanel.vue index 15f5c49..55a3b70 100644 --- a/src/components/TestPanel.vue +++ b/src/components/TestPanel.vue @@ -676,7 +676,7 @@ export default { let href = location.origin if (this.$config.isTest) href += '/student' if (this.$config.isDev) href = `http://${location.hostname}:8082` - href += `/#/record/show?python=1&reportId=${reportId}` + href += `/#/record/trialReport?python=1&reportId=${reportId}` // 练习 if (this.projectPermissions == 0) { href += `&curriculumId=${this.courseId}&projectId=${this.projectId}` diff --git a/src/components/tinymceConfig.js b/src/components/tinymceConfig.js index 7a551ef..af36d33 100644 --- a/src/components/tinymceConfig.js +++ b/src/components/tinymceConfig.js @@ -2,9 +2,9 @@ import Oss from '@/components/upload/upload.js' import { Loading } from 'element-ui' export default { //skin:'oxide-dark', - language:'zh_CN', + language: 'zh_CN', language_url: './styles/tinymce/langs/zh_CN.js', - plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave autoresize', + plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autoresize', toolbar: 'code undo redo restoredraft | cut copy pastetext | forecolor backcolor headings fontsize lineHeight bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify | \ styleselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \ table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | indent2em', @@ -20,40 +20,40 @@ export default { { title: '行高', items: [{ - title: '1', - styles: { - 'line-height': '1' - }, - inline: 'span' + title: '1', + styles: { + 'line-height': '1' }, - { - title: '1.5', - styles: { - 'line-height': '1.5' - }, - inline: 'span' + inline: 'span' + }, + { + title: '1.5', + styles: { + 'line-height': '1.5' }, - { - title: '2', - styles: { - 'line-height': '2' - }, - inline: 'span' + inline: 'span' + }, + { + title: '2', + styles: { + 'line-height': '2' }, - { - title: '2.5', - styles: { - 'line-height': '2.5' - }, - inline: 'span' + inline: 'span' + }, + { + title: '2.5', + styles: { + 'line-height': '2.5' }, - { - title: '3', - styles: { - 'line-height': '3' - }, - inline: 'span' - } + inline: 'span' + }, + { + title: '3', + styles: { + 'line-height': '3' + }, + inline: 'span' + } ] }, //默认的配置 @@ -186,33 +186,34 @@ export default { fontsize_formats: '12px 14px 16px 19px 24px 36px 48px 56px 72px', font_formats: '苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats;知乎配置=BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;小米配置=Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif', link_list: [ - { title: '预置链接1', value: 'http://www.tinymce.com' }, - { title: '预置链接2', value: 'http://tinymce.ax-z.cn' } + { title: '预置链接1', value: 'http://www.tinymce.com' }, + { title: '预置链接2', value: 'http://tinymce.ax-z.cn' } ], image_list: [ - { title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' }, - { title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' } + { title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' }, + { title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' } ], image_class_list: [ - { title: 'None', value: '' }, - { title: 'Some class', value: 'class-name' } + { title: 'None', value: '' }, + { title: 'Some class', value: 'class-name' } ], //importcss_append: true, //自定义文件选择器的回调内容 file_picker_callback: function (callback, value, meta) { - if (meta.filetype === 'file') { - callback('https://www.baidu.com/img/bd_logo1.png', { text: 'My text' }); - } - if (meta.filetype === 'image') { - callback('https://www.baidu.com/img/bd_logo1.png', { alt: 'My alt text' }); - } - if (meta.filetype === 'media') { - callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.baidu.com/img/bd_logo1.png' }); - } + if (meta.filetype === 'file') { + callback('https://www.baidu.com/img/bd_logo1.png', { text: 'My text' }); + } + if (meta.filetype === 'image') { + callback('https://www.baidu.com/img/bd_logo1.png', { alt: 'My alt text' }); + } + if (meta.filetype === 'media') { + callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.baidu.com/img/bd_logo1.png' }); + } }, //为内容模板插件提供预置模板 templates: [ - { title: '个股分析报告', description: '', content: ` + { + title: '个股分析报告', description: '', content: `

个股分析报告

1.引言
@@ -268,10 +269,11 @@ export default {
  • 列出用于报告的参考文献和数据来源
  • - ` - }, - - { title: '行业数据分析报告', description: '', content: ` + ` + }, + + { + title: '行业数据分析报告', description: '', content: `

    行业数据分析报告

    1.引言
    @@ -341,10 +343,11 @@ export default {
  • 列出用于报告的参考文献和数据来源
  • - ` - }, - - { title: '宏观数据分析报告', description: '', content: ` + ` + }, + + { + title: '宏观数据分析报告', description: '', content: `

    宏观数据分析报告

    1.引言
    @@ -400,10 +403,11 @@ export default {
  • 列出用于报告的参考文献和数据来源
  • - ` - }, - - { title: '可视化报告', description: '', content: ` + ` + }, + + { + title: '可视化报告', description: '', content: `

    可视化报告

    1.封面
    @@ -471,10 +475,11 @@ export default {
  • 提供其他补充信息和参考资料
  • - ` - }, - - { title: '数据分析报告', description: '', content: ` + ` + }, + + { + title: '数据分析报告', description: '', content: `

    数据分析报告

    1.引言
    @@ -548,8 +553,8 @@ export default {
  • 提供其他补充信息和参考资料
  • - ` - }, + ` + }, ], // content_security_policy: "https://cdn.tiny.cloud/1/rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda/tinymce/6/tinymce.min.js", // extended_valid_elements:'script[src]', @@ -557,7 +562,7 @@ export default { // template_cdate_format: '[CDATE: %m/%d/%Y : %H:%M:%S]', // template_mdate_format: '[MDATE: %m/%d/%Y : %H:%M:%S]', // autosave_ask_before_unload: false, - toolbar_mode : 'wrap', + toolbar_mode: 'wrap', // automatic_uploads: true, // images_upload_base_path: '/demo', // images_upload_url: 'http://10.10.11.7:10000/iasf/sysFiles/upload', @@ -567,15 +572,15 @@ export default { powerpaste_html_import: 'clean', // 自定义上传 images_upload_handler: function (blobInfo, succFun, failFun) { - const blob = blobInfo.blob() - // blob转换为file - const file = new File([blob], blobInfo.filename(), { - type: 'application/json', - lastModified: Date.now() - }); - Oss.upload(file).then(res => { - succFun(res.url) - }) + const blob = blobInfo.blob() + // blob转换为file + const file = new File([blob], blobInfo.filename(), { + type: 'application/json', + lastModified: Date.now() + }); + Oss.upload(file).then(res => { + succFun(res.url) + }) }, //自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发 file_picker_callback: function (callback, value, meta) { @@ -591,23 +596,23 @@ export default { let input = document.createElement('input');//创建一个隐藏的input input.setAttribute('type', 'file'); input.setAttribute("accept", ".mp4"); - input.onchange = function(){ + input.onchange = function () { let file = this.files[0]; const load = Loading.service() - Oss.upload(file).then(res => { - load.close() - callback(res.url) - }).catch(e => { - load.close() - }) + Oss.upload(file).then(res => { + load.close() + callback(res.url) + }).catch(e => { + load.close() + }) } //触发点击 input.click(); } }, // 初始化事件 - setup: function(editor) { - editor.on('init', function(ed) { + setup: function (editor) { + editor.on('init', function (ed) { // 设置默认字体 ed.target.editorCommands.execCommand("fontName", false, "Microsoft Yahei") ed.target.editorCommands.execCommand("fontSize", false, "19px") diff --git a/src/config/index.js b/src/config/index.js index b174c5d..b17bcdb 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -6,7 +6,7 @@ const isTest = url.includes('121.37.12.51') //测试服 const isHh = url.includes('10.196.131.73') //是否是河海版本 const isPro = url.includes('occupationlab.com') //是否职站生产 const isZxy = url.includes('izhixinyun.com') //是否智信云 -let vscodeUrl = 'http://10.60.32.77:8888' +let vscodeUrl = 'https://vscode.izhixinyun.com' let host = location.origin + '/' // let host = `https://izhixinyun.com/` @@ -14,7 +14,7 @@ let bankPath = `${location.origin}/banksystem` // 银行系统 // 121.37.12.51 | 192.168.31.151 if (isDev) { host = 'http://192.168.31.217:9000/' - host = 'http://121.37.12.217:9000/' + // host = 'http://121.37.12.217:9000/' // host = 'https://occupationlab.com/' bankPath = `http://${location.hostname}:8093` } else if (isPro) { diff --git a/src/views/Report.vue b/src/views/Report.vue index e594c2a..73de3c2 100644 --- a/src/views/Report.vue +++ b/src/views/Report.vue @@ -2,218 +2,144 @@
    -
    -
    - +
    +
    + {{ editing ? "保存" : "编辑" }} - 导出报告 + 导出报告
    标准实验报告
    - + 基本信息
    -
      +
      • - + {{ infoData.userName }}
      • - + {{ infoData.workNumber }}
      • - + {{ infoData.submitTime }}
      • - -
        + +
        {{ infoData.score }} - +
      • - + {{ infoData.className }}
      • - + {{ infoData.instructor }}
      • - + {{ infoData.period }}
      - + 实验项目名称
      - -
      + +
      - + 实验目的
      - -
      + +
      - + 实验数据
      - - + + - - + + - + - + - + - - + +
      - + 实验总结与体会
      - -
      + +
    @@ -272,17 +198,19 @@ export default { purpose: form.purpose, summarize: form.summarize } - const data = report.data - this.userScores = userScores + let { data } = report // 如果没有data,则添加,否则,直接使用 if (!data) { + this.userScores = userScores this.handleList(userScores) this.$post(this.api.editExperimentalData, { reportId, data: JSON.stringify(userScores) }).then(res => { }).catch(err => { }) } else { - this.handleList(userScores.find(e => e.lcRuleRecords) ? userScores : JSON.parse(data)) + data = JSON.parse(data) + this.userScores = data + this.handleList(data) } }).catch(res => { }) }, @@ -359,12 +287,15 @@ export default {