|
@@ -91,13 +91,39 @@
|
|
@click="toImport"
|
|
@click="toImport"
|
|
>导入</el-button
|
|
>导入</el-button
|
|
>
|
|
>
|
|
- <el-button
|
|
|
|
- v-if="checkPrivilege('button', 'import')"
|
|
|
|
- type="primary"
|
|
|
|
- icon="el-icon-s-order"
|
|
|
|
- @click="toDataTask"
|
|
|
|
- >导入结果查询</el-button
|
|
|
|
|
|
+ <template
|
|
|
|
+ v-if="
|
|
|
|
+ checkPrivilege('button', 'import') ||
|
|
|
|
+ checkPrivilege('button', 'ImportTeacher')
|
|
|
|
+ "
|
|
>
|
|
>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="taskTypes.length === 1"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-s-order"
|
|
|
|
+ @click="toDataTask"
|
|
|
|
+ >
|
|
|
|
+ 导入结果查询
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-dropdown v-if="taskTypes.length > 1" @command="handleTaskType">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-s-order"
|
|
|
|
+ style="margin: 0 10px"
|
|
|
|
+ >
|
|
|
|
+ 导入结果查询 <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
|
+ <el-dropdown-item command="BASIC_EXAM_STUDENT_IMPORT"
|
|
|
|
+ >考生导入</el-dropdown-item
|
|
|
|
+ >
|
|
|
|
+ <el-dropdown-item command="BASIC_EXAM_STUDENT_TEACHER_IMPORT"
|
|
|
|
+ >任课老师导入</el-dropdown-item
|
|
|
|
+ >
|
|
|
|
+ </el-dropdown-menu>
|
|
|
|
+ </el-dropdown>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
<el-button
|
|
<el-button
|
|
v-if="checkPrivilege('button', 'add')"
|
|
v-if="checkPrivilege('button', 'add')"
|
|
type="primary"
|
|
type="primary"
|
|
@@ -296,9 +322,12 @@
|
|
></import-file>
|
|
></import-file>
|
|
<!-- data-task-dialog -->
|
|
<!-- data-task-dialog -->
|
|
<data-task-dialog
|
|
<data-task-dialog
|
|
- v-if="checkPrivilege('button', 'import')"
|
|
|
|
|
|
+ v-if="
|
|
|
|
+ checkPrivilege('button', 'import') ||
|
|
|
|
+ checkPrivilege('button', 'ImportTeacher')
|
|
|
|
+ "
|
|
ref="DataTaskDialog"
|
|
ref="DataTaskDialog"
|
|
- task-type="BASIC_EXAM_STUDENT_IMPORT"
|
|
|
|
|
|
+ :task-type="curTaskType"
|
|
></data-task-dialog>
|
|
></data-task-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -343,6 +372,8 @@ export default {
|
|
curRow: {},
|
|
curRow: {},
|
|
loading: false,
|
|
loading: false,
|
|
download: false,
|
|
download: false,
|
|
|
|
+ curTaskType: "BASIC_EXAM_STUDENT_IMPORT",
|
|
|
|
+ taskTypes: [],
|
|
// import
|
|
// import
|
|
uploadUrl: "/api/admin/basic/exam_student/import",
|
|
uploadUrl: "/api/admin/basic/exam_student/import",
|
|
dfilename: "考生导入模板.xlsx",
|
|
dfilename: "考生导入模板.xlsx",
|
|
@@ -351,6 +382,17 @@ export default {
|
|
teacherDfilename: "任课老师导入模板.xlsx",
|
|
teacherDfilename: "任课老师导入模板.xlsx",
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ mounted() {
|
|
|
|
+ const taskTypes = [];
|
|
|
|
+ if (this.checkPrivilege("button", "import")) {
|
|
|
|
+ taskTypes.push("BASIC_EXAM_STUDENT_IMPORT");
|
|
|
|
+ }
|
|
|
|
+ if (this.checkPrivilege("button", "ImportTeacher")) {
|
|
|
|
+ taskTypes.push("BASIC_EXAM_STUDENT_TEACHER_IMPORT");
|
|
|
|
+ }
|
|
|
|
+ if (taskTypes.length === 1) this.curTaskType = taskTypes[0];
|
|
|
|
+ this.taskTypes = taskTypes;
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
async getList() {
|
|
async getList() {
|
|
if (!this.checkPrivilege("list", "list")) return;
|
|
if (!this.checkPrivilege("list", "list")) return;
|
|
@@ -463,6 +505,10 @@ export default {
|
|
toDataTask() {
|
|
toDataTask() {
|
|
this.$refs.DataTaskDialog.open();
|
|
this.$refs.DataTaskDialog.open();
|
|
},
|
|
},
|
|
|
|
+ handleTaskType(val) {
|
|
|
|
+ this.curTaskType = val;
|
|
|
|
+ this.$refs.DataTaskDialog.open();
|
|
|
|
+ },
|
|
validError(errorData) {
|
|
validError(errorData) {
|
|
this.$message.error(errorData.message);
|
|
this.$message.error(errorData.message);
|
|
},
|
|
},
|