|
@@ -248,6 +248,45 @@
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="离线答题纸模板" prop="ANSWERS_TEMPLATE">
|
|
|
|
+ <el-upload
|
|
|
|
+ ref="uploadAnswer"
|
|
|
|
+ class="upload-width"
|
|
|
|
+ accept=".zip"
|
|
|
|
+ :action="uploadAnswer"
|
|
|
|
+ :headers="uploadHeaders"
|
|
|
|
+ :data="uploadData"
|
|
|
|
+ :before-upload="beforeUploadAnswer"
|
|
|
|
+ :on-progress="uploadProgress"
|
|
|
|
+ :on-success="uploadAnswerSuccess"
|
|
|
|
+ :on-error="uploadError"
|
|
|
|
+ :on-remove="handleAnswerRemove"
|
|
|
|
+ :file-list="answerFileList"
|
|
|
|
+ :auto-upload="false"
|
|
|
|
+ :multiple="false"
|
|
|
|
+ :limit="1"
|
|
|
|
+ :on-exceed="handleAnswerExceed"
|
|
|
|
+ list-type="zip"
|
|
|
|
+ >
|
|
|
|
+ <el-button slot="trigger" size="small" type="primary"
|
|
|
|
+ >选择文件</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="success"
|
|
|
|
+ @click="submitUploadAnswer"
|
|
|
|
+ >确认上传</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button size="small" type="danger" @click="removeAnswerFile"
|
|
|
|
+ >清空文件</el-button
|
|
|
|
+ >
|
|
|
|
+ <div slot="tip" class="el-upload__tip">上传的格式为ZIP格式</div>
|
|
|
|
+ </el-upload>
|
|
|
|
+ <el-input
|
|
|
|
+ v-show="false"
|
|
|
|
+ v-model="ruleForm.ANSWERS_TEMPLATE"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
</el-tabs>
|
|
</el-tabs>
|
|
</el-form>
|
|
</el-form>
|
|
@@ -403,6 +442,7 @@ export default {
|
|
orgId: null,
|
|
orgId: null,
|
|
OE_STUDENT_SYS_NAME: "",
|
|
OE_STUDENT_SYS_NAME: "",
|
|
LOGO_FILE_URL: "",
|
|
LOGO_FILE_URL: "",
|
|
|
|
+ ANSWERS_TEMPLATE: "",
|
|
LOGIN_TYPE: "",
|
|
LOGIN_TYPE: "",
|
|
PREVENT_CHEATING_CONFIG: "",
|
|
PREVENT_CHEATING_CONFIG: "",
|
|
STUDENT_CLIENT_VERSION: "",
|
|
STUDENT_CLIENT_VERSION: "",
|
|
@@ -416,6 +456,7 @@ export default {
|
|
properties: {
|
|
properties: {
|
|
OE_STUDENT_SYS_NAME: "",
|
|
OE_STUDENT_SYS_NAME: "",
|
|
LOGO_FILE_URL: "",
|
|
LOGO_FILE_URL: "",
|
|
|
|
+ ANSWERS_TEMPLATE: "",
|
|
LOGIN_TYPE: "",
|
|
LOGIN_TYPE: "",
|
|
PREVENT_CHEATING_CONFIG: "",
|
|
PREVENT_CHEATING_CONFIG: "",
|
|
STUDENT_CLIENT_VERSION: "",
|
|
STUDENT_CLIENT_VERSION: "",
|
|
@@ -434,6 +475,7 @@ export default {
|
|
},
|
|
},
|
|
logoDialog: false,
|
|
logoDialog: false,
|
|
uploadAction: "",
|
|
uploadAction: "",
|
|
|
|
+ uploadAnswer: "",
|
|
uploadHeaders: {},
|
|
uploadHeaders: {},
|
|
uploadData: {},
|
|
uploadData: {},
|
|
fileList: [],
|
|
fileList: [],
|
|
@@ -543,6 +585,7 @@ export default {
|
|
uploadMenuLogoHeaders: {},
|
|
uploadMenuLogoHeaders: {},
|
|
uploadMenuLogoData: {},
|
|
uploadMenuLogoData: {},
|
|
menuLogoFileList: [],
|
|
menuLogoFileList: [],
|
|
|
|
+ answerFileList: [],
|
|
originalCusMenuForm: {},
|
|
originalCusMenuForm: {},
|
|
cusMenuTreeDialog: {
|
|
cusMenuTreeDialog: {
|
|
show: false,
|
|
show: false,
|
|
@@ -643,6 +686,8 @@ export default {
|
|
this.originalRuleForm.IDENTITY_NUMBER_LOGIN_ALIAS &&
|
|
this.originalRuleForm.IDENTITY_NUMBER_LOGIN_ALIAS &&
|
|
newForm.IS_CUSTOM_MENU_LOGO ==
|
|
newForm.IS_CUSTOM_MENU_LOGO ==
|
|
this.originalRuleForm.IS_CUSTOM_MENU_LOGO &&
|
|
this.originalRuleForm.IS_CUSTOM_MENU_LOGO &&
|
|
|
|
+ newForm.ANSWERS_TEMPLATE ==
|
|
|
|
+ this.originalRuleForm.ANSWERS_TEMPLATE &&
|
|
newForm.CUS_MENU_LOGO_FILE_URL ==
|
|
newForm.CUS_MENU_LOGO_FILE_URL ==
|
|
this.originalRuleForm.CUS_MENU_LOGO_FILE_URL
|
|
this.originalRuleForm.CUS_MENU_LOGO_FILE_URL
|
|
);
|
|
);
|
|
@@ -804,6 +849,8 @@ export default {
|
|
|
|
|
|
async initForm() {
|
|
async initForm() {
|
|
this.uploadAction = CORE_API + "/org/importLogo/" + this.ruleForm.orgId;
|
|
this.uploadAction = CORE_API + "/org/importLogo/" + this.ruleForm.orgId;
|
|
|
|
+ this.uploadAnswer =
|
|
|
|
+ CORE_API + "/org/importAnswers/" + this.ruleForm.orgId;
|
|
this.ruleForm.STUDENT_CLIENT_DEFAULT_SIZE = "1400*900";
|
|
this.ruleForm.STUDENT_CLIENT_DEFAULT_SIZE = "1400*900";
|
|
this.ruleForm.relatedPropertyGroupIdList = ["studentClientConfig"];
|
|
this.ruleForm.relatedPropertyGroupIdList = ["studentClientConfig"];
|
|
|
|
|
|
@@ -817,6 +864,12 @@ export default {
|
|
}
|
|
}
|
|
console.log(file);
|
|
console.log(file);
|
|
},
|
|
},
|
|
|
|
+ beforeUploadAnswer(file) {
|
|
|
|
+ if (!this.checkUploadAnswer()) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ console.log(file);
|
|
|
|
+ },
|
|
uploadProgress() {
|
|
uploadProgress() {
|
|
console.log("uploadProgress");
|
|
console.log("uploadProgress");
|
|
},
|
|
},
|
|
@@ -838,6 +891,24 @@ export default {
|
|
this.logoDialog = false;
|
|
this.logoDialog = false;
|
|
// this.removeFile();
|
|
// this.removeFile();
|
|
},
|
|
},
|
|
|
|
+ uploadAnswerSuccess(response) {
|
|
|
|
+ console.log("uploadSuccess");
|
|
|
|
+ console.log(response);
|
|
|
|
+ if (response && response.length > 0) {
|
|
|
|
+ this.$notify({
|
|
|
|
+ message: "上传成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ let fileUrl = response;
|
|
|
|
+
|
|
|
|
+ this.ruleForm.ANSWERS_TEMPLATE = this.ruleForm.properties.ANSWERS_TEMPLATE = fileUrl;
|
|
|
|
+ } else {
|
|
|
|
+ this.errDialog = true;
|
|
|
|
+ }
|
|
|
|
+ this.fileLoading = false;
|
|
|
|
+ this.logoDialog = false;
|
|
|
|
+ // this.removeFile();
|
|
|
|
+ },
|
|
uploadError(response) {
|
|
uploadError(response) {
|
|
let json = JSON.parse(response.message);
|
|
let json = JSON.parse(response.message);
|
|
if (response.status == 500) {
|
|
if (response.status == 500) {
|
|
@@ -949,6 +1020,9 @@ export default {
|
|
this.ruleForm.LOGO_FILE_URL =
|
|
this.ruleForm.LOGO_FILE_URL =
|
|
this.ruleForm.properties.LOGO_FILE_URL ||
|
|
this.ruleForm.properties.LOGO_FILE_URL ||
|
|
this.ruleForm.LOGO_FILE_URL;
|
|
this.ruleForm.LOGO_FILE_URL;
|
|
|
|
+ this.ruleForm.ANSWERS_TEMPLATE =
|
|
|
|
+ this.ruleForm.properties.ANSWERS_TEMPLATE ||
|
|
|
|
+ this.ruleForm.ANSWERS_TEMPLATE;
|
|
this.ruleForm.LOGIN_TYPE =
|
|
this.ruleForm.LOGIN_TYPE =
|
|
this.ruleForm.properties.LOGIN_TYPE || this.ruleForm.LOGIN_TYPE;
|
|
this.ruleForm.properties.LOGIN_TYPE || this.ruleForm.LOGIN_TYPE;
|
|
this.ruleForm.LOGIN_SUPPORT =
|
|
this.ruleForm.LOGIN_SUPPORT =
|
|
@@ -1025,6 +1099,7 @@ export default {
|
|
this.ruleForm.studentClientVersion = defaultValue;
|
|
this.ruleForm.studentClientVersion = defaultValue;
|
|
// console.log(defaultValue);
|
|
// console.log(defaultValue);
|
|
}
|
|
}
|
|
|
|
+
|
|
let fileUrl = response.data.LOGO_FILE_URL;
|
|
let fileUrl = response.data.LOGO_FILE_URL;
|
|
let fname = "";
|
|
let fname = "";
|
|
if (fileUrl) {
|
|
if (fileUrl) {
|
|
@@ -1036,6 +1111,19 @@ export default {
|
|
this.fileList = [];
|
|
this.fileList = [];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ let answersUrl = response.data.ANSWERS_TEMPLATE;
|
|
|
|
+ let answersName = "";
|
|
|
|
+ if (answersUrl) {
|
|
|
|
+ let lastIndex = answersUrl.lastIndexOf("/");
|
|
|
|
+ let len = answersUrl.length;
|
|
|
|
+ answersName = answersUrl.substr(lastIndex + 1, len - lastIndex);
|
|
|
|
+ this.answerFileList = [
|
|
|
|
+ { name: answersName, url: this.ruleForm.ANSWERS_TEMPLATE },
|
|
|
|
+ ];
|
|
|
|
+ } else {
|
|
|
|
+ this.answerFileList = [];
|
|
|
|
+ }
|
|
|
|
+
|
|
this.uploadMenuLogoAction =
|
|
this.uploadMenuLogoAction =
|
|
CORE_API + "/org/importCusMenuLogo/" + this.ruleForm.orgId;
|
|
CORE_API + "/org/importCusMenuLogo/" + this.ruleForm.orgId;
|
|
|
|
|
|
@@ -1205,6 +1293,63 @@ export default {
|
|
}
|
|
}
|
|
this.fileLoading = false;
|
|
this.fileLoading = false;
|
|
},
|
|
},
|
|
|
|
+ //确定上传
|
|
|
|
+ submitUploadAnswer() {
|
|
|
|
+ if (!this.checkUploadAnswer()) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ this.$refs.uploadAnswer.submit();
|
|
|
|
+ this.fileLoading = true;
|
|
|
|
+ },
|
|
|
|
+ checkUploadAnswer() {
|
|
|
|
+ let fileList = this.$refs.uploadAnswer.uploadFiles;
|
|
|
|
+ if (fileList.length == 0) {
|
|
|
|
+ this.$notify({
|
|
|
|
+ message: "上传文件不能为空",
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (fileList.length > 1) {
|
|
|
|
+ this.$notify({
|
|
|
|
+ message: "每次只能上传一个文件",
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ for (let file of fileList) {
|
|
|
|
+ let fileName = file.name;
|
|
|
|
+ if (!fileName.endsWith(".zip")) {
|
|
|
|
+ this.$notify({
|
|
|
|
+ message: "上传文件格式必须为[zip]",
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ this.menuLogoFileList = [];
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ },
|
|
|
|
+ //清空文件
|
|
|
|
+ removeAnswerFile() {
|
|
|
|
+ this.answerFileList = [];
|
|
|
|
+ this.ruleForm.ANSWERS_TEMPLATE = this.ruleForm.properties.ANSWERS_TEMPLATE =
|
|
|
|
+ "";
|
|
|
|
+ if (this.$refs.uploadAnswer) {
|
|
|
|
+ this.$refs.uploadAnswer.clearFiles();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleAnswerRemove(file, fileList) {
|
|
|
|
+ console.log(file, fileList);
|
|
|
|
+ this.removeAnswerFile();
|
|
|
|
+ },
|
|
|
|
+ handleAnswerExceed() {
|
|
|
|
+ this.$notify({
|
|
|
|
+ message: "当前限制选择 1 个文件,请先清空文件再试",
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
//确定上传
|
|
//确定上传
|
|
submitUploadMenuLogo() {
|
|
submitUploadMenuLogo() {
|
|
if (!this.checkUploadMenuLogo()) {
|
|
if (!this.checkUploadMenuLogo()) {
|