|
@@ -1,15 +1,113 @@
|
|
|
+import Vue from "vue";
|
|
|
+
|
|
|
export const core_api = "/api/ecs_core";
|
|
|
export const exam_work_api = "/api/ecs_exam_work";
|
|
|
export const question_api = "/api/ecs_ques";
|
|
|
export const print_api = "/api/ecs_prt";
|
|
|
|
|
|
+export const groupTypeList = [
|
|
|
+ { value: "LEARN_CENTER", label: "学习中心" },
|
|
|
+ { value: "EXAM_SITE", label: "考点" }
|
|
|
+];
|
|
|
+
|
|
|
export const coursePaperStatusList = [
|
|
|
{ value: 0, label: "无" },
|
|
|
{ value: 1, label: "未指定" },
|
|
|
{ value: 2, label: "已有" }
|
|
|
];
|
|
|
|
|
|
-export const groupTypeList = [
|
|
|
- { value: "LEARN_CENTER", label: "学习中心" },
|
|
|
- { value: "EXAM_SITE", label: "考点" }
|
|
|
+export const projectStatisticTypeList = [
|
|
|
+ { value: "NORMAL", label: "常规" },
|
|
|
+ { value: "BACKUP", label: "备份" },
|
|
|
+ { value: "TOTAL", label: "合计" },
|
|
|
+ { value: "OTHER", label: "其他" }
|
|
|
+];
|
|
|
+
|
|
|
+export const templateTypeList = [
|
|
|
+ { id: 1, label: "考生数据表", value: "1", fileUrl: "" },
|
|
|
+ { id: 2, label: "考场数据表", value: "2", fileUrl: "" },
|
|
|
+ { id: 3, label: "卷袋贴模板", value: "3", fileUrl: "" },
|
|
|
+ { id: 4, label: "签到表模板", value: "4", fileUrl: "" },
|
|
|
+ { id: 5, label: "常规题卡模板", value: "5", fileUrl: "" },
|
|
|
+ { id: 6, label: "特殊题卡模板", value: "6", fileUrl: "" },
|
|
|
+ { id: 7, label: "备份卷贴模板", value: "7", fileUrl: "" },
|
|
|
+ { id: 8, label: "试卷袋样式", value: "8", fileUrl: "" }
|
|
|
+];
|
|
|
+
|
|
|
+export const questionTypes = [
|
|
|
+ { value: "SINGLE_ANSWER_QUESTION", label: "单选" },
|
|
|
+ { value: "MULTIPLE_ANSWER_QUESTION", label: "多选" },
|
|
|
+ { value: "BOOL_ANSWER_QUESTION", label: "判断" },
|
|
|
+ { value: "FILL_BLANK_QUESTION", label: "填空" },
|
|
|
+ { value: "TEXT_ANSWER_QUESTION", label: "问答" },
|
|
|
+ { value: "NESTED_ANSWER_QUESTION", label: "套题" }
|
|
|
];
|
|
|
+
|
|
|
+Vue.filter("coursePaperStatusFilter", function(value) {
|
|
|
+ for (let status of coursePaperStatusList) {
|
|
|
+ if (status.value === value) {
|
|
|
+ return status.label;
|
|
|
+ }
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+Vue.filter("questionType", function(value) {
|
|
|
+ for (let questionType of questionTypes) {
|
|
|
+ if (questionType.value === value) {
|
|
|
+ return questionType.label;
|
|
|
+ }
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+Vue.prototype.checkUserRole = function(user) {
|
|
|
+ let roles = user.roleList;
|
|
|
+ for (let role of roles) {
|
|
|
+ if (role.roleCode == "PRINT_SUPER_LEADER") {
|
|
|
+ this.curUserRole.isSuperLeader = true;
|
|
|
+ } else if (role.roleCode == "PRINT_PROJECT_LEADER") {
|
|
|
+ this.curUserRole.isPM = true;
|
|
|
+ } else if (role.roleCode == "PRINT_SUPPLIER") {
|
|
|
+ this.curUserRole.isSupplier = true;
|
|
|
+ } else if (role.roleCode == "PRINT_SCHOOL_LEADER") {
|
|
|
+ this.curUserRole.isSchoolLeader = true;
|
|
|
+ } else {
|
|
|
+ this.curUserRole.isOther = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log("userRole:", userRole);
|
|
|
+};
|
|
|
+
|
|
|
+export const userRole = {
|
|
|
+ /* 是否为印刷总负责人 */
|
|
|
+ isSuperLeader: false,
|
|
|
+ /* 是否为项目经理 */
|
|
|
+ isPM: false,
|
|
|
+ /* 是否为印刷供应商 */
|
|
|
+ isSupplier: false,
|
|
|
+ /* 是否为印刷学校管理员 */
|
|
|
+ isSchoolLeader: false,
|
|
|
+ /* 其它 */
|
|
|
+ isOther: false
|
|
|
+};
|
|
|
+
|
|
|
+Vue.prototype.loadPmInfo = function(user) {
|
|
|
+ this.pmList = [];
|
|
|
+ this.pmList.push({ id: user.userId, name: user.displayName });
|
|
|
+};
|
|
|
+
|
|
|
+Vue.prototype.loadSupplierInfo = function(user) {
|
|
|
+ this.supplierList = [];
|
|
|
+ this.supplierList.push({ id: user.userId, name: user.displayName });
|
|
|
+};
|
|
|
+
|
|
|
+Vue.prototype.searchOrgList = function() {
|
|
|
+ var url = print_api + "/printing/project/org/list";
|
|
|
+ this.$http.post(url).then(
|
|
|
+ response => {
|
|
|
+ this.orgList = response.data;
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+ );
|
|
|
+};
|