|
@@ -8,12 +8,21 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+ <el-row class="btn_bar" type="flex" justify="end">
|
|
|
+ <el-col :span="2">
|
|
|
+ <el-button type="primary" size="small" @click="eDialog = true">导出</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
<data-table :fields="fields" :data="tableData" :opera="opera" @view="toTaskList"></data-table>
|
|
|
</list-frame>
|
|
|
+ <el-dialog :visible.sync="eDialog" title="导出" width="30%">
|
|
|
+ <export-range :usestudent="false" @toExport="toExport" @close="eDialog = false"></export-range>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import exportRange from '@frame/components/export-range.vue';
|
|
|
import listFrame from '@frame/layout/admin/list-frame';
|
|
|
import dataTable from '@frame/components/data-table';
|
|
|
import _ from 'lodash';
|
|
@@ -21,11 +30,13 @@ import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
const { mapActions: lesson } = createNamespacedHelpers('lesson');
|
|
|
const { mapActions: util } = createNamespacedHelpers('util');
|
|
|
const { mapActions: classes } = createNamespacedHelpers('classes');
|
|
|
+const { mapActions: task } = createNamespacedHelpers('task');
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
|
- components: { listFrame, dataTable },
|
|
|
+ components: { listFrame, dataTable, exportRange },
|
|
|
data: () => ({
|
|
|
+ eDialog: false,
|
|
|
opera: [
|
|
|
{
|
|
|
label: '查看学生作业',
|
|
@@ -60,6 +71,7 @@ export default {
|
|
|
return { title: this.$route.meta.title };
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...task(['export']),
|
|
|
...classes({ getClass: 'query' }),
|
|
|
...lesson({ lessionInfo: 'fetch', lessionList: 'query' }),
|
|
|
...util({ modelFetch: 'fetch' }),
|
|
@@ -103,6 +115,14 @@ export default {
|
|
|
this.$set(this, `classList`, duplicate);
|
|
|
}
|
|
|
},
|
|
|
+ // 导出作业
|
|
|
+ async toExport(range) {
|
|
|
+ let data = { range };
|
|
|
+ const res = await this.export(data);
|
|
|
+ if (this.$checkRes(res, '导出成功', res.errmsg || '导出失败')) {
|
|
|
+ window.open(res.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
defaultOption: {
|