fix: exam/view 修改删除

This commit is contained in:
zty 2024-06-14 14:53:49 +08:00
parent a4b7c5f897
commit e289c3f453
5 changed files with 46 additions and 7 deletions

View File

@ -201,10 +201,8 @@
let that =this; let that =this;
if (res.code == 201){ if (res.code == 201){
that.impForm.doc_path = res.data.path; that.impForm.doc_path = res.data.path;
console.log(that.impForm)
UploadPaper(that.impForm).then(res => { UploadPaper(that.impForm).then(res => {
if (res.code == 200) { if (res.code == 200) {
console.log(res.data)
that.questions = res.data; that.questions = res.data;
that.$message({ that.$message({
@ -258,10 +256,11 @@
this.questions.splice(val, 1); this.questions.splice(val, 1);
}, },
handleDelete2(item, val){ handleDelete2(item, val){
let that = this
deleteQuestion(item.id).then(res=>{ deleteQuestion(item.id).then(res=>{
if (res.code == 200) { if (res.code == 200) {
this.questions.splice(val, 1); that.questions.splice(val, 1);
this.$message({ that.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!"
}); });

View File

@ -1,5 +1,5 @@
from django.db import models from django.db import models
from apps.system.models import CommonAModel, CommonBModel, CommonBDModel from apps.system.models import CommonAModel, CommonADModel, CommonBDModel
from django.contrib.postgres.fields import JSONField from django.contrib.postgres.fields import JSONField
from utils.model import BaseModel from utils.model import BaseModel
from apps.edu.models import Course from apps.edu.models import Course
@ -20,7 +20,7 @@ class Questioncat(CommonAModel):
return self.questioncat.count() return self.questioncat.count()
class Question(CommonAModel): class Question(CommonADModel):
type_choices = ( type_choices = (
('单选', '单选'), ('单选', '单选'),
('多选', '多选'), ('多选', '多选'),

View File

@ -94,6 +94,6 @@ def interpret_text(start:int, excel_path:str, doc_path:str, field=None):
if __name__ == '__main__': if __name__ == '__main__':
doc_path = "C:\code\data\\test.docx" doc_path = "C:\code\data\\判断题.docx"
excel_path = "C:\code\data\question.xlsx" excel_path = "C:\code\data\question.xlsx"
interpret_text(3, excel_path, doc_path) interpret_text(3, excel_path, doc_path)

View File

@ -0,0 +1,20 @@
# Generated by Django 3.2.12 on 2024-06-14 05:35
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('information', '0050_alter_qualification_change_date'),
]
operations = [
migrations.AlterField(
model_name='qualification',
name='change_date',
field=models.DateField(blank=True, default=datetime.datetime(2024, 6, 14, 5, 35, 33, 230280, tzinfo=utc), null=True, verbose_name='变更日期'),
),
]

View File

@ -0,0 +1,20 @@
# Generated by Django 3.2.12 on 2024-06-14 06:51
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('information', '0051_alter_qualification_change_date'),
]
operations = [
migrations.AlterField(
model_name='qualification',
name='change_date',
field=models.DateField(blank=True, default=datetime.datetime(2024, 6, 14, 6, 51, 53, 747831, tzinfo=utc), null=True, verbose_name='变更日期'),
),
]