|
@@ -61,9 +61,14 @@
|
|
>
|
|
>
|
|
<el-table-column label="课程名称" width="200" prop="name" />
|
|
<el-table-column label="课程名称" width="200" prop="name" />
|
|
<el-table-column label="课程代码" min-width="100" prop="code" />
|
|
<el-table-column label="课程代码" min-width="100" prop="code" />
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="设置任务数"
|
|
|
|
+ min-width="100"
|
|
|
|
+ prop="limitCount"
|
|
|
|
+ />
|
|
<el-table-column
|
|
<el-table-column
|
|
label="已评数量"
|
|
label="已评数量"
|
|
- min-width="200"
|
|
|
|
|
|
+ min-width="100"
|
|
prop="markedCount"
|
|
prop="markedCount"
|
|
sortable
|
|
sortable
|
|
/>
|
|
/>
|
|
@@ -81,6 +86,19 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+ <el-table-column :context="_self" width="250" label="操作">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div class="pull-left">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ size="mini"
|
|
|
|
+ plain
|
|
|
|
+ @click="openStepModel(scope.row)"
|
|
|
|
+ >设置任务数</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
<div class="page pull-right">
|
|
<div class="page pull-right">
|
|
<el-pagination
|
|
<el-pagination
|
|
@@ -95,6 +113,37 @@
|
|
></el-pagination>
|
|
></el-pagination>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="设置任务数"
|
|
|
|
+ width="500px"
|
|
|
|
+ :visible.sync="stepModel"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ @close="closeStepModel"
|
|
|
|
+ >
|
|
|
|
+ <el-form
|
|
|
|
+ ref="stepForm"
|
|
|
|
+ :key="stepModelKey"
|
|
|
|
+ :inline="true"
|
|
|
|
+ :model="stepForm"
|
|
|
|
+ :rules="stepRules"
|
|
|
|
+ >
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-form-item label="设置任务数" prop="limitCount">
|
|
|
|
+ <el-input v-model="stepForm.limitCount" size="mini"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-row>
|
|
|
|
+ <div style="margin-bottom: 20px"></div>
|
|
|
|
+ <el-row class="pull-center">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ :loading="stepForm.loading"
|
|
|
|
+ @click="subStep"
|
|
|
|
+ >确定</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button @click="closeStepModel">取消</el-button>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-form>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
@@ -104,6 +153,15 @@
|
|
import { MARKING_API } from "@/constants/constants";
|
|
import { MARKING_API } from "@/constants/constants";
|
|
import { mapState } from "vuex";
|
|
import { mapState } from "vuex";
|
|
import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
|
|
import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
|
|
|
|
+
|
|
|
|
+let reg = /^[1-9][0-9]*$/;
|
|
|
|
+let validateLimitCount = (rule, value, callback) => {
|
|
|
|
+ if (value && !reg.test(value)) {
|
|
|
|
+ callback(new Error("设置任务数必须是正整数"));
|
|
|
|
+ } else {
|
|
|
|
+ callback();
|
|
|
|
+ }
|
|
|
|
+};
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
LinkTitlesCustom,
|
|
LinkTitlesCustom,
|
|
@@ -122,6 +180,23 @@ export default {
|
|
loading: true,
|
|
loading: true,
|
|
workId: "",
|
|
workId: "",
|
|
courseCode: "",
|
|
courseCode: "",
|
|
|
|
+ stepModel: false,
|
|
|
|
+ stepModelKey: Math.random(),
|
|
|
|
+ stepForm: {
|
|
|
|
+ workId: null,
|
|
|
|
+ courseCode: null,
|
|
|
|
+ limitCount: null,
|
|
|
|
+ loading: false,
|
|
|
|
+ },
|
|
|
|
+ stepRules: {
|
|
|
|
+ limitCount: [
|
|
|
|
+ {
|
|
|
|
+ required: false,
|
|
|
|
+ validator: validateLimitCount,
|
|
|
|
+ trigger: "change",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -129,11 +204,48 @@ export default {
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.workId = this.$route.params.workId;
|
|
this.workId = this.$route.params.workId;
|
|
- this.userName = this.$route.params.userName;
|
|
|
|
this.userId = this.$route.params.markerId;
|
|
this.userId = this.$route.params.markerId;
|
|
this.initSetting();
|
|
this.initSetting();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ openStepModel(row) {
|
|
|
|
+ this.stepForm.limitCount = row.limitCount;
|
|
|
|
+ this.stepForm.workId = row.workId;
|
|
|
|
+ this.stepForm.courseCode = row.code;
|
|
|
|
+ this.stepModel = true;
|
|
|
|
+ },
|
|
|
|
+ closeStepModel() {
|
|
|
|
+ this.stepModel = false;
|
|
|
|
+ this.stepModelKey = Math.random();
|
|
|
|
+ },
|
|
|
|
+ async subStep() {
|
|
|
|
+ let res = await this.$refs.stepForm.validate();
|
|
|
|
+ if (!res) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.stepForm.loading = true;
|
|
|
|
+ var url =
|
|
|
|
+ MARKING_API +
|
|
|
|
+ "/markCourses/task-limit?workId=" +
|
|
|
|
+ this.stepForm.workId +
|
|
|
|
+ "&courseCode=" +
|
|
|
|
+ this.stepForm.courseCode +
|
|
|
|
+ "&userId=" +
|
|
|
|
+ this.userId +
|
|
|
|
+ "&limitCount=" +
|
|
|
|
+ this.stepForm.limitCount;
|
|
|
|
+ this.$httpWithMsg
|
|
|
|
+ .put(url)
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "设置成功!",
|
|
|
|
+ });
|
|
|
|
+ this.closeStepModel();
|
|
|
|
+ this.initSetting();
|
|
|
|
+ })
|
|
|
|
+ .finally(() => (this.stepForm.loading = false));
|
|
|
|
+ },
|
|
exportIt() {
|
|
exportIt() {
|
|
var key = this.user.key;
|
|
var key = this.user.key;
|
|
var token = this.user.token;
|
|
var token = this.user.token;
|