|
@@ -1,82 +1,37 @@
|
|
import Vue from "vue";
|
|
import Vue from "vue";
|
|
|
|
|
|
|
|
+/* 基础信息平台-API */
|
|
export const core_api = "/api/ecs_core";
|
|
export const core_api = "/api/ecs_core";
|
|
-export const exam_work_api = "/api/ecs_exam_work";
|
|
|
|
-export const question_api = "/api/ecs_ques";
|
|
|
|
|
|
+/* 印刷平台-API */
|
|
export const print_api = "/api/ecs_prt";
|
|
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 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.isEmptyStr = function(str) {
|
|
|
|
+ if (str == undefined || String(str).length < 1) {
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
-});
|
|
|
|
|
|
+ return false;
|
|
|
|
+};
|
|
|
|
|
|
-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;
|
|
|
|
- }
|
|
|
|
|
|
+/* 是否为空数字 */
|
|
|
|
+Vue.prototype.isEmptyNumber = function(number) {
|
|
|
|
+ let reg = /^[0-9]+$/;
|
|
|
|
+ if (!reg.test(number)) {
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
- console.log("userRole:", userRole);
|
|
|
|
|
|
+ return false;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+/* 角色-印刷供应商 */
|
|
|
|
+export const role_print_supplier = "PRINT_SUPPLIER";
|
|
|
|
+/* 角色-印刷学校管理员 */
|
|
|
|
+export const role_print_school_leader = "PRINT_SCHOOL_LEADER";
|
|
|
|
+/* 角色-印刷总负责人 */
|
|
|
|
+export const role_print_super_leader = "PRINT_SUPER_LEADER";
|
|
|
|
+/* 角色-项目经理 */
|
|
|
|
+export const role_print_project_leader = "PRINT_PROJECT_LEADER";
|
|
|
|
+
|
|
|
|
+/* 用户角色信息 */
|
|
export const userRole = {
|
|
export const userRole = {
|
|
/* 是否为印刷总负责人 */
|
|
/* 是否为印刷总负责人 */
|
|
isSuperLeader: false,
|
|
isSuperLeader: false,
|
|
@@ -90,17 +45,56 @@ export const userRole = {
|
|
isOther: false
|
|
isOther: false
|
|
};
|
|
};
|
|
|
|
|
|
-Vue.prototype.loadPmInfo = function(user) {
|
|
|
|
|
|
+Vue.prototype.loadUserRole = function(loginUser) {
|
|
|
|
+ let roles = loginUser.roleList;
|
|
|
|
+ for (let role of roles) {
|
|
|
|
+ let roleCode = role.roleCode;
|
|
|
|
+ if (roleCode == role_print_supplier) {
|
|
|
|
+ this.curUserRole.isSupplier = true;
|
|
|
|
+ } else if (roleCode == role_print_school_leader) {
|
|
|
|
+ this.curUserRole.isSchoolLeader = true;
|
|
|
|
+ } else if (roleCode == role_print_super_leader) {
|
|
|
|
+ this.curUserRole.isSuperLeader = true;
|
|
|
|
+ } else if (roleCode == role_print_project_leader) {
|
|
|
|
+ this.curUserRole.isPM = true;
|
|
|
|
+ } else {
|
|
|
|
+ this.curUserRole.isOther = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ console.log("curUserRole:", this.curUserRole);
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+/* 单独备份袋设置-归集类型 */
|
|
|
|
+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 questionTypeList = [
|
|
|
|
+ { value: "SINGLE_ANSWER_QUESTION", label: "单选" },
|
|
|
|
+ { value: "MULTIPLE_ANSWER_QUESTION", label: "多选" },
|
|
|
|
+ { value: "BOOL_ANSWER_QUESTION", label: "判断" }
|
|
|
|
+];
|
|
|
|
+
|
|
|
|
+Vue.prototype.loadPmInfo = function(loginUser) {
|
|
this.pmList = [];
|
|
this.pmList = [];
|
|
- this.pmList.push({ id: user.userId, name: user.displayName });
|
|
|
|
|
|
+ this.pmList.push({ id: loginUser.userId, name: loginUser.displayName });
|
|
};
|
|
};
|
|
|
|
|
|
-Vue.prototype.loadSupplierInfo = function(user) {
|
|
|
|
|
|
+Vue.prototype.loadSupplierInfo = function(loginUser) {
|
|
this.supplierList = [];
|
|
this.supplierList = [];
|
|
- this.supplierList.push({ id: user.userId, name: user.displayName });
|
|
|
|
|
|
+ this.supplierList.push({ id: loginUser.userId, name: loginUser.displayName });
|
|
};
|
|
};
|
|
|
|
|
|
-Vue.prototype.searchOrgList = function() {
|
|
|
|
|
|
+Vue.prototype.loadOrgList = function() {
|
|
var url = print_api + "/printing/project/org/list";
|
|
var url = print_api + "/printing/project/org/list";
|
|
this.$http.post(url).then(
|
|
this.$http.post(url).then(
|
|
response => {
|
|
response => {
|
|
@@ -111,21 +105,3 @@ Vue.prototype.searchOrgList = function() {
|
|
}
|
|
}
|
|
);
|
|
);
|
|
};
|
|
};
|
|
-
|
|
|
|
-Vue.prototype.isEmptyString = function(str) {
|
|
|
|
- if (!str || str.length == 0) {
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- return false;
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-Vue.prototype.isEmptyNumber = function(number) {
|
|
|
|
- if (!number && number != 0) {
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- let reg = /^[0-9]+$/;
|
|
|
|
- if (!reg.test(number)) {
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- return false;
|
|
|
|
-};
|
|
|