huangtao 4 gadi atpakaļ
vecāks
revīzija
6d74426cab

+ 12 - 4
src/App.vue

@@ -1,15 +1,23 @@
 <template>
-  <div id="app">
-    <router-view />
-  </div>
+  <a-config-provider :locale="locale">
+    <div id="app">
+      <router-view />
+    </div>
+  </a-config-provider>
 </template>
 
 <script>
+import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN';
+import moment from 'moment';
+import 'moment/locale/zh-cn';
+moment.locale('zh-cn');
 export default {
   name: 'App',
   components: {},
   data() {
-    return {};
+    return {
+      locale: zhCN,
+    };
   },
   created() {
     this.initDataFun(); // 初始化数据

+ 40 - 26
src/components/echarts/EchartsBar.vue

@@ -67,37 +67,51 @@ export default {
       // 基于准备好的dom,初始化echarts实例
       let myChart = echarts.init(this.$refs.myChartBar);
       // 绘制图表
-      myChart.setOption({
-        // title: { text: barData.title },
-        tooltip: {},
-        xAxis: {
-          type: 'category',
-          data: barData.xAxis.data,
-        },
-        yAxis: {
-          type: 'value',
-          // min: barData.yAxis.min,
-          // max: barData.yAxis.max,
-        },
-        series: [
-          {
-            type: 'bar',
-            data: barData.series.data,
-            showBackground: true,
-            backgroundStyle: {
-              color: 'rgba(180, 180, 180, 0.2)',
+      if (!barData) {
+        myChart.setOption({
+          title: {
+            text: '暂无数据',
+            x: 'center',
+            y: 'center',
+            textStyle: {
+              color: '#999',
+              fontWeight: 'normal',
+              fontSize: 24,
             },
-            itemStyle: {
-              color: '#1890FF',
-            },
-            emphasis: {
+          },
+        });
+      } else {
+        myChart.setOption({
+          tooltip: {},
+          xAxis: {
+            type: 'category',
+            data: barData.xAxis || [],
+          },
+          yAxis: {
+            type: 'value',
+            // min: barData.yAxis.min,
+            // max: barData.yAxis.max,
+          },
+          series: [
+            {
+              type: 'bar',
+              data: barData.series || [],
+              showBackground: true,
+              backgroundStyle: {
+                color: 'rgba(180, 180, 180, 0.2)',
+              },
               itemStyle: {
                 color: '#1890FF',
               },
+              emphasis: {
+                itemStyle: {
+                  color: '#1890FF',
+                },
+              },
             },
-          },
-        ],
-      });
+          ],
+        });
+      }
     },
     // 根据窗口大小 初始化echarts图表大小
     resizeByWindowFun() {

+ 12 - 2
src/components/layout/components/NavTop.vue

@@ -52,8 +52,18 @@ export default {
     },
     // 操作:注销
     handleLogout() {
-      this.$store.commit('user/SET_LOGOUT'); // 存用户信息
-      this.$router.push({ name: 'login' });
+      let that = this;
+      that.$confirm({
+        title: '注销',
+        content: `确认注销登录吗?`,
+        okText: '确认',
+        cancelText: '取消',
+        onOk() {
+          that.$store.commit('user/SET_LOGOUT'); // 存用户信息
+          that.$router.push({ name: 'login' });
+        },
+        onCancel() {},
+      });
     },
   },
 };

+ 98 - 92
src/components/tinymce/TinymceEditor.vue

@@ -1,122 +1,128 @@
 <template>
   <div class="tinymce-editor">
-    <Editor :id="tinymceId" :init="init" :disabled="disabled" v-model="myValue" @onClick="onClick"></Editor>
+    <Editor
+      :id="tinymceId"
+      :init="init"
+      :disabled="disabled"
+      v-model="myValue"
+      @onClick="onClick"
+    ></Editor>
   </div>
 </template>
 
 <script>
 // import axios from "axios";
-import tinymce from "tinymce/tinymce"; //tinymce默认hidden,不引入不显示
-import Editor from "@tinymce/tinymce-vue"; //编辑器引入
-import "tinymce/themes/silver/theme"; //编辑器主题
+import tinymce from 'tinymce/tinymce'; //tinymce默认hidden,不引入不显示
+import Editor from '@tinymce/tinymce-vue'; //编辑器引入
+import 'tinymce/themes/silver/theme'; //编辑器主题
 // 引入编辑器插件(基本免费插件都在这儿了)
-import "tinymce/plugins/advlist"; //高级列表
-import "tinymce/plugins/autolink"; //自动链接
-import "tinymce/plugins/link"; //超链接
-import "tinymce/plugins/image"; //插入编辑图片
-import "tinymce/plugins/lists"; //列表插件
-import "tinymce/plugins/charmap"; //特殊字符
-import "tinymce/plugins/media"; //插入编辑媒体
-import "tinymce/plugins/wordcount"; // 字数统计
+import 'tinymce/plugins/advlist'; //高级列表
+import 'tinymce/plugins/autolink'; //自动链接
+import 'tinymce/plugins/link'; //超链接
+import 'tinymce/plugins/image'; //插入编辑图片
+import 'tinymce/plugins/lists'; //列表插件
+import 'tinymce/plugins/charmap'; //特殊字符
+import 'tinymce/plugins/media'; //插入编辑媒体
+import 'tinymce/plugins/wordcount'; // 字数统计
 // import Cookies from "js-cookie";
 
 const fonts = [
-  "宋体=宋体",
-  "微软雅黑=微软雅黑",
-  "新宋体=新宋体",
-  "黑体=黑体",
-  "楷体=楷体",
-  "隶书=隶书",
-  "Courier New=courier new,courier",
-  "AkrutiKndPadmini=Akpdmi-n",
-  "Andale Mono=andale mono,times",
-  "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",
-  "Trebuchet MS=trebuchet ms,geneva",
-  "Verdana=verdana,geneva",
-  "Webdings=webdings",
-  "Wingdings=wingdings,zapf dingbats"
+  '宋体=宋体',
+  '微软雅黑=微软雅黑',
+  '新宋体=新宋体',
+  '黑体=黑体',
+  '楷体=楷体',
+  '隶书=隶书',
+  'Courier New=courier new,courier',
+  'AkrutiKndPadmini=Akpdmi-n',
+  'Andale Mono=andale mono,times',
+  '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',
+  'Trebuchet MS=trebuchet ms,geneva',
+  'Verdana=verdana,geneva',
+  'Webdings=webdings',
+  'Wingdings=wingdings,zapf dingbats',
 ];
 export default {
-  name: "TinymceEditor",
+  name: 'TinymceEditor',
   components: {
-    Editor
+    Editor,
   },
   props: {
     //内容
     value: {
       type: String,
-      default: ""
+      default: '',
     },
     //是否禁用
     disabled: {
       type: Boolean,
-      default: false
+      default: false,
     },
     //插件
     plugins: {
       type: [String, Array],
-      default: "advlist autolink link image lists charmap  media wordcount"
+      default: 'advlist image lists  wordcount', // autolink link charmap  media
     },
     //工具栏
     toolbar: {
       type: [String, Array],
       default:
-        "undo redo |  formatselect | colorpicker | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | lists image media table"
-    }
+        'undo redo |  formatselect | colorpicker | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent', //  | lists image media table
+    },
   },
   data() {
     return {
       //初始化配置
-      tinymceId: "tinymce",
+      tinymceId: 'tinymce',
       myValue: this.value,
       init: {
-        selector: "#tinymce",
-        language_url: "/tinymce/langs/zh_CN.js", //汉化路径是自定义的,一般放在public或static里面
-        language: "zh_CN",
-        skin_url: "/tinymce/skins/ui/oxide", //皮肤
-        icons_url: "/tinymce/icons/default/icons.min.js", //图标
+        selector: '#tinymce',
+        language_url: '/tinymce/langs/zh_CN.js', //汉化路径是自定义的,一般放在public或static里面
+        language: 'zh_CN',
+        skin_url: '/tinymce/skins/ui/oxide', //皮肤
+        icons_url: '/tinymce/icons/default/icons.min.js', //图标
         plugins: this.plugins, //插件
         //工具栏
         toolbar: this.toolbar,
-        toolbar_location: "/",
+        toolbar_location: '/',
         fontsize_formats:
-          "12px 14px 16px 18px 20px 22px 24px 28px 32px 36px 48px 56px 72px", //字体大小
-        font_formats: fonts.join(";"),
+          '12px 14px 16px 18px 20px 22px 24px 28px 32px 36px 48px 56px 72px', //字体大小
+        font_formats: fonts.join(';'),
 
         height: 500, //高度
-        placeholder: "在这里输入文字",
+        placeholder: '在这里输入文字',
 
         branding: false, //隐藏右下角技术支持
         //图片上传
         images_upload_handler: function(blobInfo, success, failure) {
           //文件上传的formData传递,忘记为什么要用这个了
           const isAccord =
-            blobInfo.blob().type === "image/jpeg" ||
-            blobInfo.blob().type === "image/png" ||
-            blobInfo.blob().type === "image/GIF" ||
-            blobInfo.blob().type === "image/jpg" ||
-            blobInfo.blob().type === "image/BMP";
+            blobInfo.blob().type === 'image/jpeg' ||
+            blobInfo.blob().type === 'image/png' ||
+            blobInfo.blob().type === 'image/GIF' ||
+            blobInfo.blob().type === 'image/jpg' ||
+            blobInfo.blob().type === 'image/BMP';
           if (blobInfo.blob().size / 1024 / 1024 > 2) {
-            failure("上传失败,图片大小请控制在 2M 以内");
+            failure('上传失败,图片大小请控制在 2M 以内');
           } else if (blobInfo.blob().type == isAccord) {
-            failure("图片格式错误");
+            failure('图片格式错误');
           } else {
             let formData = new FormData();
             // 服务端接收文件的参数名,文件数据,文件名
-            formData.append("image-file", blobInfo.blob(), blobInfo.filename());
-            window.$_http.post("/image/upload", formData).then(res => {
-              console.log("--upload--" + JSON.stringify(res));
+            formData.append('image-file', blobInfo.blob(), blobInfo.filename());
+            window.$_http.post('/image/upload', formData).then((res) => {
+              console.log('--upload--' + JSON.stringify(res));
               success(res.data.url);
             });
           }
@@ -124,26 +130,26 @@ export default {
         file_picker_callback: function(callback, value, meta, failure) {
           //文件分类
           var filetype =
-            ".pdf, .txt, .zip, .rar, .7z, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .mp3, .mp4";
+            '.pdf, .txt, .zip, .rar, .7z, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .mp3, .mp4';
           //后端接收上传文件的地址
-          var upurl = "/demo/upfile.php";
+          var upurl = '/demo/upfile.php';
           //为不同插件指定文件类型及后端地址
           switch (meta.filetype) {
-            case "image":
-              filetype = ".jpg, .jpeg, .png, .gif";
-              upurl = "upimg.php";
+            case 'image':
+              filetype = '.jpg, .jpeg, .png, .gif';
+              upurl = 'upimg.php';
               break;
-            case "media":
-              filetype = ".mp3, .mp4";
-              upurl = "upfile.php";
+            case 'media':
+              filetype = '.mp3, .mp4';
+              upurl = 'upfile.php';
               break;
-            case "file":
+            case 'file':
             default:
           }
           //模拟出一个input用于添加本地文件
-          var input = document.createElement("input");
-          input.setAttribute("type", "file");
-          input.setAttribute("accept", filetype);
+          var input = document.createElement('input');
+          input.setAttribute('type', 'file');
+          input.setAttribute('accept', filetype);
           input.click();
           input.onchange = function() {
             var file = this.files[0];
@@ -152,56 +158,56 @@ export default {
             console.log(file.name);
             xhr = new XMLHttpRequest();
             xhr.withCredentials = false;
-            xhr.open("POST", upurl);
+            xhr.open('POST', upurl);
             xhr.onload = function() {
               var json;
               if (xhr.status != 200) {
-                failure("HTTP Error: " + xhr.status);
+                failure('HTTP Error: ' + xhr.status);
                 return;
               }
               json = JSON.parse(xhr.responseText);
-              if (!json || typeof json.location != "string") {
-                failure("Invalid JSON: " + xhr.responseText);
+              if (!json || typeof json.location != 'string') {
+                failure('Invalid JSON: ' + xhr.responseText);
                 return;
               }
               callback(json.location);
             };
             formData = new FormData();
-            formData.append("file", file, file.name);
+            formData.append('file', file, file.name);
             xhr.send(formData);
           };
-        }
-      }
+        },
+      },
     };
   },
   watch: {
     //监听内容变化
     value(newValue) {
-      this.myValue = newValue == null ? "" : newValue;
+      this.myValue = newValue == null ? '' : newValue;
     },
     myValue(newValue) {
       if (this.triggerChange) {
-        this.$emit("change", newValue);
+        this.$emit('change', newValue);
       } else {
-        this.$emit("input", newValue);
+        this.$emit('input', newValue);
       }
-    }
+    },
   },
   mounted() {
     tinymce.init({});
   },
   methods: {
     onClick(e) {
-      this.$emit("onClick", e, tinymce);
+      this.$emit('onClick', e, tinymce);
     },
     //清空内容
     clear() {
-      this.myValue = "";
-    }
-  }
+      this.myValue = '';
+    },
+  },
 };
 </script>
 
 <style lang="less" scoped>
-@import "~@/styles/common/variable.less";
+@import '~@/styles/common/variable.less';
 </style>

+ 31 - 2
src/filters/index.js

@@ -120,7 +120,7 @@ export function formatDateTimeT(date) {
   return date.replace('T', ' ');
 }
 
-// 格式化日期
+// 格式化日期为YYYY-MM-DD
 export function formatDate(date) {
   let temp = date;
   if (!isDataType(date, 'Date')) {
@@ -132,7 +132,7 @@ export function formatDate(date) {
   return moment(date).format('YYYY-MM-DD');
 }
 
-// 格式化日期
+// 格式化日期为YYYY-MM
 export function formatMonth(date) {
   let temp = date;
   if (!isDataType(date, 'Date')) {
@@ -144,6 +144,35 @@ export function formatMonth(date) {
   return moment(date).format('YYYY-MM');
 }
 
+/**
+ * 格式化日期YYYYMMDD为YYYY-MM-DD
+ * @param {
+ *   dateString: YYYYMMDD
+ * } 
+ * @returns 
+ */
+export function formateStringDate(dateString) {
+   return dateString.replace(/^(\d{4})(\d{2})(\d{2})$/, '$1-$2-$3')
+}
+
+/**
+ * 格式化日期YYYY-MM-DD为YYYYMMDD
+ * @param {
+ *   date: YYYY-MM-DD
+ * } obj 
+ * @returns 
+ */
+ export function formateDateToString(date) {
+  const noramlDate = new Date(date);
+  const year = noramlDate.getFullYear();
+  const curMonth = noramlDate.getMonth() + 1;
+  const month = curMonth >= 10 ? "" + curMonth : "0" + curMonth;
+  const day = noramlDate.getDate() >= 10 ? "" + noramlDate.getDate() : "0" + noramlDate.getDate();
+  const todayStr = year + month + day;
+  return todayStr;
+}
+
+
 // 升序排序
 export function objKeySort(obj) {
   if (!obj || Array.isArray(obj)) {

+ 7 - 46
src/views/Home.vue

@@ -87,11 +87,11 @@ export default {
         { id: 3, title: '本年', code: 'year' },
       ], // 统计图的tab栏
       barTabChecked: 'week', // 当前选中的tab栏ID
-      barData: {}, // 统计图数据
+      barData: null, // 统计图数据
       // 扇形-文章类型占比
-      articlesProportion: {},
+      articlesProportion: null,
       // 扇形-试题类型占比
-      examsProportion: {},
+      examsProportion: null,
     };
   },
   created() {},
@@ -222,47 +222,8 @@ export default {
           });
           if (xAxis.length > 0 && series.length > 0) {
             this.barData = {
-              xAxis: {
-                data: xAxis,
-              },
-              series: {
-                data: series,
-              },
-            };
-          } else {
-            this.barData = {
-              xAxis: {
-                data: [
-                  '期终考试',
-                  '期中考试',
-                  '期末考试',
-                  '4月',
-                  '5月',
-                  '6月',
-                  '7月',
-                  '8月',
-                  '9月',
-                  '10月',
-                  '11月',
-                  '12月',
-                ],
-              }, // x轴数据
-              series: {
-                data: [
-                  1113,
-                  823,
-                  1140,
-                  1110,
-                  405,
-                  813,
-                  823,
-                  389,
-                  678,
-                  407,
-                  1178,
-                  789,
-                ],
-              }, // 移入提示数据
+              xAxis: xAxis,
+              series: series,
             };
           }
           this.loading2 = false;
@@ -298,13 +259,13 @@ export default {
         .get(this.$_API.INTERFACE_GET_COUNT_QUESTIONS_PROPORTION)
         .then((res) => {
           let dataArr = this.formateResDataToEcharts(res.data); // 格式化数据结构为echarts所需要的结构
-          this.articlesProportion = {
+          this.examsProportion = {
             title: '试题总计',
             seriesLabel: '试题类别占比',
             count: this.basicList[1].count,
             data: dataArr,
           };
-          this.$refs.echartsPieTwoRef.initDataFun(this.articlesProportion);
+          this.$refs.echartsPieTwoRef.initDataFun(this.examsProportion);
           this.loading3 = false;
         })
         .catch(() => {

+ 27 - 17
src/views/answerManagement/answerManagementDay.vue

@@ -145,23 +145,33 @@ export default {
         this.$message.error('请输入大于零的试题数量(数字)');
         return;
       }
-      let findCondition = this.formatQuestionTypeConditionChooseValue(
-        this.checkedQuestionTypeConditionChildren
-      ); // 获取试题类型信息-子类
-      let params = {
-        ruleType: ANSWER_MANAGEMENT_RULE_TYPE.DAY.ruleType,
-        questionCategories: findCondition ? [findCondition] : [],
-        totalQuestionNum: this.questionsNum,
-      };
-      this.$_http
-        .post(this.$_API.INTERFACE_POST_ANSWER_RULE_ADD, params)
-        .then(() => {
-          this.$message.success('创建每日答题成功');
-          this.loading = false;
-        })
-        .catch(() => {
-          this.loading = false;
-        });
+      let that = this;
+      that.$confirm({
+        title: '提交',
+        content: `确认提交每日答题规则吗?`,
+        okText: '确认',
+        cancelText: '取消',
+        onOk() {
+          let findCondition = that.formatQuestionTypeConditionChooseValue(
+            that.checkedQuestionTypeConditionChildren
+          ); // 获取试题类型信息-子类
+          let params = {
+            ruleType: ANSWER_MANAGEMENT_RULE_TYPE.DAY.ruleType,
+            questionCategories: findCondition ? [findCondition] : [],
+            totalQuestionNum: that.questionsNum,
+          };
+          that.$_http
+            .post(that.$_API.INTERFACE_POST_ANSWER_RULE_ADD, params)
+            .then(() => {
+              that.$message.success('配置每日答题规则成功');
+              that.loading = false;
+            })
+            .catch(() => {
+              that.loading = false;
+            });
+        },
+        onCancel() {},
+      });
     },
     // 获取试题类型信息-子类
     formatQuestionTypeConditionChooseValue(id) {

+ 33 - 20
src/views/answerManagement/answerManagementSpecial.vue

@@ -530,26 +530,39 @@ export default {
     },
     // 操作:发布
     handleSubmitAll() {
-      this.loading = true;
-      let params = {
-        name: this.specialName,
-        questionList: this.current_tableData,
-        engineerTypeId: [this.engineeringWork],
-      };
-      this.$_http
-        .post(
-          formateUrlParams(this.$_API.INTERFACE_POST_ANSWER_RULE_ADD_SPECIAL, {
-            engineertypeid: this.engineeringWork,
-          }),
-          params
-        )
-        .then(() => {
-          this.loading = false;
-          this.$message.success('添加专项答题成功');
-        })
-        .catch(() => {
-          this.loading = false;
-        });
+      let that = this;
+      that.$confirm({
+        title: '发布',
+        content: `发布专项答题之后不能修改,确认发布吗?`,
+        okText: '确认',
+        cancelText: '取消',
+        onOk() {
+          that.loading = true;
+          let params = {
+            name: that.specialName,
+            questionList: that.current_tableData,
+            engineerTypeId: [that.engineeringWork],
+          };
+          that.$_http
+            .post(
+              formateUrlParams(
+                that.$_API.INTERFACE_POST_ANSWER_RULE_ADD_SPECIAL,
+                {
+                  engineertypeid: that.engineeringWork,
+                }
+              ),
+              params
+            )
+            .then(() => {
+              that.loading = false;
+              that.$message.success('发布专项答题成功');
+            })
+            .catch(() => {
+              that.loading = false;
+            });
+        },
+        onCancel() {},
+      });
     },
   },
 };

+ 27 - 17
src/views/answerManagement/answerManagementWeek.vue

@@ -145,23 +145,33 @@ export default {
         this.$message.error('请输入大于零的试题数量(数字)');
         return;
       }
-      let findCondition = this.formatQuestionTypeConditionChooseValue(
-        this.checkedQuestionTypeConditionChildren
-      ); // 获取试题类型信息-子类
-      let params = {
-        ruleType: ANSWER_MANAGEMENT_RULE_TYPE.WEEK.ruleType,
-        questionCategories: findCondition ? [findCondition] : [],
-        totalQuestionNum: this.questionsNum,
-      };
-      this.$_http
-        .post(this.$_API.INTERFACE_POST_ANSWER_RULE_ADD, params)
-        .then(() => {
-          this.$message.success('创建每周答题成功');
-          this.loading = false;
-        })
-        .catch(() => {
-          this.loading = false;
-        });
+      let that = this;
+      that.$confirm({
+        title: '提交',
+        content: `确认提交每周答题规则吗?`,
+        okText: '确认',
+        cancelText: '取消',
+        onOk() {
+          let findCondition = that.formatQuestionTypeConditionChooseValue(
+            that.checkedQuestionTypeConditionChildren
+          ); // 获取试题类型信息-子类
+          let params = {
+            ruleType: ANSWER_MANAGEMENT_RULE_TYPE.WEEK.ruleType,
+            questionCategories: findCondition ? [findCondition] : [],
+            totalQuestionNum: that.questionsNum,
+          };
+          that.$_http
+            .post(that.$_API.INTERFACE_POST_ANSWER_RULE_ADD, params)
+            .then(() => {
+              that.$message.success('配置每周答题规则成功');
+              that.loading = false;
+            })
+            .catch(() => {
+              that.loading = false;
+            });
+        },
+        onCancel() {},
+      });
     },
     // 获取试题类型信息-子类
     formatQuestionTypeConditionChooseValue(id) {

+ 13 - 3
src/views/articleManagement/articleCreate.vue

@@ -159,7 +159,11 @@
 </template>
 
 <script>
-import { formatePathParams } from '@/filters';
+import {
+  formatePathParams,
+  formateStringDate,
+  formateDateToString,
+} from '@/filters';
 import TinymceEditor from '@/components/tinymce/TinymceEditor'; // 富文本编辑组件
 export default {
   name: 'articleCreate',
@@ -322,7 +326,8 @@ export default {
       }
       let learnDate = item.tags.length > 0 ? item.tags[0] : '';
       // 必学日期
-      this.learnDateChoose(null, learnDate);
+      this.learnDate = learnDate ? formateStringDate(learnDate) : '';
+      console.log('编辑初始化时间为YYYY-MM-DD', this.learnDate, learnDate);
       // 文章内容
       this.content = item.contents;
     },
@@ -401,10 +406,15 @@ export default {
                 description: values.description,
                 type: 'ARTICLE',
                 contents: that.content,
-                tags: [that.learnDate],
+                tags: [formateDateToString(that.learnDate)],
                 engineerTypes: [that.engineerType.id],
                 links: [],
               };
+              console.log(
+                '保存修改日期格式为YYYYMMDD',
+                bodyParams.tags,
+                that.learnDate
+              );
               that.$_http
                 .put(
                   formatePathParams(

+ 74 - 54
src/views/examManagement/examAutomaticVolumeFormation.vue

@@ -836,37 +836,47 @@ export default {
       e.preventDefault();
       this.loginForm.validateFields((err, values) => {
         if (!err) {
-          let urlParams = {
-            engineertypeid: values.engineeringWorkChooseValue, // 工种
-          };
-          let params = {
-            name: values.name, // 考试名称
-            description: values.content, // 内容
-            duration: formateSeconds(
-              values.examTimeLong.hours,
-              values.examTimeLong.minutes
-            ), // 考试持续时间
-            startTime: this.examDateTime.replace(' ', 'T'), // 开始日期
-            deadline: formateDateTimeToAfter(
-              this.examDateTime,
-              values.examTimeLong.hours,
-              values.examTimeLong.minutes
-            ).replace(' ', 'T'), // 结束日期
-            tages: [],
-            engineerTypes: [values.engineeringWorkChooseValue], // 信息集合:工种
-            examCategory: values.examTypeChooseValue, // 考试类别
-            totalPoints:
-              this.questionInfo.singleNum * this.questionInfo.singleGrade +
-              this.questionInfo.multiNum * this.questionInfo.multiGrade +
-              this.questionInfo.trueFalseNum *
-                this.questionInfo.trueFalseGrade +
-              this.questionInfo.gapFillingNum *
-                this.questionInfo.gapFillingGrade, // 总分
-          };
-          if (this.examDetailData.id) {
-            params.id = this.examDetailData.id;
-          }
-          this.httpQuestFun(urlParams, params);
+          let that = this;
+          that.$confirm({
+            title: '预组卷',
+            content: `确认预组卷吗?`,
+            okText: '确认',
+            cancelText: '取消',
+            onOk() {
+              let urlParams = {
+                engineertypeid: values.engineeringWorkChooseValue, // 工种
+              };
+              let params = {
+                name: values.name, // 考试名称
+                description: values.content, // 内容
+                duration: formateSeconds(
+                  values.examTimeLong.hours,
+                  values.examTimeLong.minutes
+                ), // 考试持续时间
+                startTime: that.examDateTime.replace(' ', 'T'), // 开始日期
+                deadline: formateDateTimeToAfter(
+                  that.examDateTime,
+                  values.examTimeLong.hours,
+                  values.examTimeLong.minutes
+                ).replace(' ', 'T'), // 结束日期
+                tages: [],
+                engineerTypes: [values.engineeringWorkChooseValue], // 信息集合:工种
+                examCategory: values.examTypeChooseValue, // 考试类别
+                totalPoints:
+                  that.questionInfo.singleNum * that.questionInfo.singleGrade +
+                  that.questionInfo.multiNum * that.questionInfo.multiGrade +
+                  that.questionInfo.trueFalseNum *
+                    that.questionInfo.trueFalseGrade +
+                  that.questionInfo.gapFillingNum *
+                    that.questionInfo.gapFillingGrade, // 总分
+              };
+              if (that.examDetailData.id) {
+                params.id = that.examDetailData.id;
+              }
+              that.httpQuestFun(urlParams, params);
+            },
+            onCancel() {},
+          });
         }
       });
     },
@@ -979,30 +989,40 @@ export default {
     },
     // 表单提交请求:题目
     httpQuestAddQuestionsFun() {
-      this.loading = true;
-      let dataArr = [];
-      this.current_tableData.forEach((item) => {
-        let obj = {
-          examId: this.examId,
-          questionId: item.id,
-          questionPoints: Number(item.points),
-        };
-        dataArr.push(obj);
+      let that = this;
+      that.$confirm({
+        title: '发布',
+        content: `确认发布考试吗?`,
+        okText: '确认',
+        cancelText: '取消',
+        onOk() {
+          that.loading = true;
+          let dataArr = [];
+          that.current_tableData.forEach((item) => {
+            let obj = {
+              examId: that.examId,
+              questionId: item.id,
+              questionPoints: Number(item.points),
+            };
+            dataArr.push(obj);
+          });
+          that.$_http
+            .post(
+              formatePathParams(that.$_API.INTERFACE_POST_EXAM_ADD_QUESTIONS, {
+                examId: that.examId,
+              }),
+              dataArr
+            )
+            .then(() => {
+              that.$message.success('添加考试成功');
+              that.loading = false;
+            })
+            .catch(() => {
+              that.loading = false;
+            });
+        },
+        onCancel() {},
       });
-      this.$_http
-        .post(
-          formatePathParams(this.$_API.INTERFACE_POST_EXAM_ADD_QUESTIONS, {
-            examId: this.examId,
-          }),
-          dataArr
-        )
-        .then(() => {
-          this.$message.success('添加考试成功');
-          this.loading = false;
-        })
-        .catch(() => {
-          this.loading = false;
-        });
     },
   },
 };

+ 1 - 1
src/views/examManagement/examManagementList.vue

@@ -332,7 +332,7 @@ export default {
       let that = this;
       this.$confirm({
         title: '删除',
-        content: `确认删除编号为 ${record.examCode} 的考试吗?`,
+        content: `确认删除考试名为 ${record.name} 的考试吗?`,
         okText: '确认',
         cancelText: '取消',
         onOk() {

+ 35 - 25
src/views/examManagement/examManualVolumeFormation.vue

@@ -1189,31 +1189,41 @@ export default {
       e.preventDefault();
       this.loginForm.validateFields((err, values) => {
         if (!err) {
-          let urlParams = {
-            engineertypeid: values.engineeringWorkChooseValue, // 工种
-          };
-          let params = {
-            name: values.name, // 考试名称
-            description: values.content, // 内容
-            duration: formateSeconds(
-              values.examTimeLong.hours,
-              values.examTimeLong.minutes
-            ), // 考试持续时间
-            startTime: this.examDateTime.replace(' ', 'T'), // 开始日期
-            deadline: formateDateTimeToAfter(
-              this.examDateTime,
-              values.examTimeLong.hours,
-              values.examTimeLong.minutes
-            ).replace(' ', 'T'), // 结束日期
-            tages: [],
-            engineerTypes: [values.engineeringWorkChooseValue], // 信息集合:工种
-            examCategory: values.examTypeChooseValue, // 考试类别
-            totalPoints: this.current_tableGradesCount, // 总分
-          };
-          if (this.examDetailData.id) {
-            params.id = this.examDetailData.id;
-          }
-          this.httpQuestFun(urlParams, params);
+          let that = this;
+          that.$confirm({
+            title: '发布',
+            content: `确认发布考试吗?`,
+            okText: '确认',
+            cancelText: '取消',
+            onOk() {
+              let urlParams = {
+                engineertypeid: values.engineeringWorkChooseValue, // 工种
+              };
+              let params = {
+                name: values.name, // 考试名称
+                description: values.content, // 内容
+                duration: formateSeconds(
+                  values.examTimeLong.hours,
+                  values.examTimeLong.minutes
+                ), // 考试持续时间
+                startTime: that.examDateTime.replace(' ', 'T'), // 开始日期
+                deadline: formateDateTimeToAfter(
+                  that.examDateTime,
+                  values.examTimeLong.hours,
+                  values.examTimeLong.minutes
+                ).replace(' ', 'T'), // 结束日期
+                tages: [],
+                engineerTypes: [values.engineeringWorkChooseValue], // 信息集合:工种
+                examCategory: values.examTypeChooseValue, // 考试类别
+                totalPoints: that.current_tableGradesCount, // 总分
+              };
+              if (that.examDetailData.id) {
+                params.id = that.examDetailData.id;
+              }
+              that.httpQuestFun(urlParams, params);
+            },
+            onCancel() {},
+          });
         }
       });
     },

+ 1 - 1
src/views/examQuestionManagement/examQuestionList.vue

@@ -436,7 +436,7 @@ export default {
       let that = this;
       this.$confirm({
         title: '删除',
-        content: `确认删除编号为 ${record.id} 的试题吗?`,
+        content: `确认删除试题吗?`,
         okText: '确认',
         cancelText: '取消',
         onOk() {

+ 20 - 0
src/views/examQuestionManagement/examQusetionCreateGapFilling.vue

@@ -61,6 +61,24 @@
               />
             </a-form-item>
           </div>
+          <a-form-item
+            label="答案解析"
+            :label-col="labelCol"
+            :wrapper-col="wrapperCol"
+          >
+            <a-textarea
+              placeholder="解析内容"
+              :auto-size="{ minRows: 3, maxRows: 5 }"
+              :maxLength="1000"
+              v-decorator="[
+                'answerAnalysis',
+                {
+                  rules: [{ required: true, message: '请输入答案解析内容!' }],
+                  initialValue: examQuestionDetail.answerAnalysis,
+                },
+              ]"
+            />
+          </a-form-item>
           <div class="create-select-div">
             <span>试题类型:</span>
             <div class="create-select-row">
@@ -177,6 +195,7 @@ export default {
         engineerTypes: [], // 信息集合:工种
         type: '', // 试题类型ID
         answers: [], // 选项
+        answerAnalysis: '', // 答案解析
         rootQuestionCategory: '', // 试题类型-父类
         questionCategory: '', // 试题类型-子类
       }, // 题目的信息
@@ -311,6 +330,7 @@ export default {
             finalAnswer: this.formatQuestionAnswersArr(values), // 正确答案
             engineerTypes: [values.engineeringWorkChooseValue], // 工种信息集合
             type: this.questionType, // 试题类型ID
+            answerAnalysis: values.answerAnalysis, // 答案解析
             answers: [], // 选项
           };
           if (this.examQuestionDetail.id) {

+ 20 - 0
src/views/examQuestionManagement/examQusetionCreateMultiple.vue

@@ -86,6 +86,24 @@
             </a-select>
           </a-form-item>
 
+          <a-form-item
+            label="答案解析"
+            :label-col="labelCol"
+            :wrapper-col="wrapperCol"
+          >
+            <a-textarea
+              placeholder="解析内容"
+              :auto-size="{ minRows: 3, maxRows: 5 }"
+              :maxLength="1000"
+              v-decorator="[
+                'answerAnalysis',
+                {
+                  rules: [{ required: true, message: '请输入答案解析内容!' }],
+                  initialValue: examQuestionDetail.answerAnalysis,
+                },
+              ]"
+            />
+          </a-form-item>
           <div class="create-select-div">
             <span>试题类型:</span>
             <div class="create-select-row">
@@ -203,6 +221,7 @@ export default {
         engineerTypes: [], // 信息集合:工种
         type: '', // 试题类型ID
         answers: [], // 选项
+        answerAnalysis: '', // 答案解析
         rootQuestionCategory: '', // 试题类型-父类
         questionCategory: '', // 试题类型-子类
       }, // 题目的信息
@@ -339,6 +358,7 @@ export default {
             ), // 正确答案
             engineerTypes: [values.engineeringWorkChooseValue], // 工种信息集合
             type: this.questionType, // 试题类型ID
+            answerAnalysis: values.answerAnalysis, // 答案解析
             answers: this.formatQuestionAnswersArr(values), // 选项
           };
           if (this.examQuestionDetail.id) {

+ 20 - 0
src/views/examQuestionManagement/examQusetionCreateSingle.vue

@@ -101,6 +101,24 @@
               ]"
             />
           </a-form-item> -->
+          <a-form-item
+            label="答案解析"
+            :label-col="labelCol"
+            :wrapper-col="wrapperCol"
+          >
+            <a-textarea
+              placeholder="解析内容"
+              :auto-size="{ minRows: 3, maxRows: 5 }"
+              :maxLength="1000"
+              v-decorator="[
+                'answerAnalysis',
+                {
+                  rules: [{ required: true, message: '请输入答案解析内容!' }],
+                  initialValue: examQuestionDetail.answerAnalysis,
+                },
+              ]"
+            />
+          </a-form-item>
           <div class="create-select-div">
             <span>试题类型:</span>
             <div class="create-select-row">
@@ -219,6 +237,7 @@ export default {
         engineerTypes: [], // 信息集合:工种
         type: '', // 试题类型ID
         answers: [], // 选项
+        answerAnalysis: '', // 答案解析
         rootQuestionCategory: '', // 试题类型-父类
         questionCategory: '', // 试题类型-子类
       }, // 题目的信息
@@ -364,6 +383,7 @@ export default {
             engineerTypes: [values.engineeringWorkChooseValue], // 信息集合:工种
             type: this.questionType, // 试题类型ID
             // tages: [this.answerDate], // 日期
+            answerAnalysis: values.answerAnalysis, // 答案解析
             answers: this.formatQuestionAnswersArr(values), // 选项
           };
           if (this.examQuestionDetail.id) {

+ 20 - 0
src/views/examQuestionManagement/examQusetionCreateTrueOrFalse.vue

@@ -77,6 +77,24 @@
               </a-select-option>
             </a-select>
           </a-form-item>
+          <a-form-item
+            label="答案解析"
+            :label-col="labelCol"
+            :wrapper-col="wrapperCol"
+          >
+            <a-textarea
+              placeholder="解析内容"
+              :auto-size="{ minRows: 3, maxRows: 5 }"
+              :maxLength="1000"
+              v-decorator="[
+                'answerAnalysis',
+                {
+                  rules: [{ required: true, message: '请输入答案解析内容!' }],
+                  initialValue: examQuestionDetail.answerAnalysis,
+                },
+              ]"
+            />
+          </a-form-item>
           <div class="create-select-div">
             <span>试题类型:</span>
             <div class="create-select-row">
@@ -194,6 +212,7 @@ export default {
         engineerTypes: [], // 信息集合:工种
         type: '', // 试题类型ID
         answers: [], // 选项
+        answerAnalysis: '', // 答案解析
         rootQuestionCategory: '', // 试题类型-父类
         questionCategory: '', // 试题类型-子类
       }, // 题目的信息
@@ -322,6 +341,7 @@ export default {
             ), // 正确答案
             engineerTypes: [values.engineeringWorkChooseValue], // 工种信息集合
             type: this.questionType, // 试题类型ID
+            answerAnalysis: values.answerAnalysis, // 答案解析
             answers: this.formatQuestionAnswersArr(values), // 选项
           };
           if (this.examQuestionDetail.id) {