deason 2 tahun lalu
induk
melakukan
5f10c9e067

+ 1 - 0
src/main.js

@@ -5,6 +5,7 @@ import store from "./store";
 // import "./registerServiceWorker";
 import "./components/registerComponents";
 import "./modules/basic/components/registerComponents";
+import "./modules/oe/component/registerComponents";
 import "./plugins/element.js";
 import "./plugins/axios";
 import "./plugins/vueAwesome";

+ 38 - 0
src/modules/oe/component/registerComponents.js

@@ -0,0 +1,38 @@
+import Vue from "vue";
+// import upperFirst from "lodash/upperFirst";
+// import camelCase from "lodash/camelCase";
+
+const requireComponent = require.context(
+  // The relative path of the components folder
+  "./",
+  // Whether or not to look in subfolders
+  false,
+  // The regular expression used to match base component filenames
+  /[A-Z]\w+\.(vue|js)$/
+);
+
+requireComponent.keys().forEach((fileName) => {
+  // Get component config
+  const componentConfig = requireComponent(fileName);
+
+  // Get PascalCase name of component
+  const componentName =
+    // upperFirst(
+    //   camelCase(
+    // Gets the file name regardless of folder depth
+    fileName
+      .split("/")
+      .pop()
+      .replace(/\.\w+$/, "");
+  //   )
+  // );
+
+  // Register component globally
+  Vue.component(
+    componentName,
+    // Look for the component options on `.default`, which will
+    // exist if the component was exported with `export default`,
+    // otherwise fall back to module's root.
+    componentConfig.default || componentConfig
+  );
+});

+ 1 - 1
src/modules/oe/views/examPaperDetail.vue

@@ -264,7 +264,7 @@ export default {
       if (examQuestion.studentScore || examQuestion.studentScore === 0) {
         question.studentScore = examQuestion.studentScore + "分";
       } else {
-        question.studentScore = "-- 分";
+        question.studentScore = "--分";
       }
 
       var correctAnswer = question.rightAnswer; //从题中获取正确答案