+
+ 搜索
+ 刷新重置
@@ -87,7 +101,11 @@
data() {
return {
type:null,
- videoList: "",
+ videoList: [],
+ queryParams:{
+ pageoff:true,
+ search:""
+ },
typeOptions: [],
hasLowerLevel:false,
subTypeOptions:[],
@@ -110,9 +128,10 @@
}
let bigHeight = document.getElementsByClassName('app-main')[0].clientHeight;
let topHeight = document.getElementsByClassName('typesButtons')[0].clientHeight;
- console.log(topHeight);
+ let headerHeight = document.getElementsByClassName('el-header')[0].clientHeight;
+ // console.log(topHeight);
debugger;
- let domHeight = bigHeight-200-topHeight;
+ let domHeight = bigHeight-topHeight-headerHeight-80;
document.getElementById('videoListWrap').style.height = domHeight + 'px';
// document.getElementById('videoListWrap').style.paddingTop = topHeight + 'px';
},
@@ -121,14 +140,23 @@
getList() {
this.type = null;
this.listLoading = true;
- getVideoList({pageoff: true}).then((response) => {
+ getVideoList(this.queryParams).then((response) => {
if (response.data) {
this.videoList = response.data;
}
this.listLoading = false;
});
},
-
+ handleSearch() {
+ this.getList();
+ },
+ resetFilter() {
+ this.queryParams = {
+ pageoff:true,
+ search: '',
+ };
+ this.getList();
+ },
getListtype(a) {
this.type = a.id;
if(a.children){
@@ -165,7 +193,7 @@
getTypeAll() {
getDictList({type__code: "data_video",is_used:true}).then((res) => {
this.typeOptions = genTree(res.data);
- console.log(this.typeOptions);
+ // console.log(this.typeOptions);
});
},
@@ -286,7 +314,7 @@
background-color: #ffffff;
color: #333;
text-align: center;
- margin-top: 130px;
+ margin-top: 140px;
}
diff --git a/server/apps/edu/views.py b/server/apps/edu/views.py
index 63e5c41..22e6c7c 100644
--- a/server/apps/edu/views.py
+++ b/server/apps/edu/views.py
@@ -136,3 +136,28 @@ class CertificateViewSet(CreateUpdateCustomMixin, ModelViewSet):
make_img_x(obj)
print(f"生成---{obj.姓名}---的证书")
return Response()
+
+ @action(detail=False, methods=['post'], url_path='batch-update', perms_map={"post": "certificate"})
+ def batch_update(self, request):
+ data = request.data
+ ids = data.get('ids', [])
+ updates = data.get('updates', {})
+
+ if not ids or not updates:
+ raise ParseError("Invalid data")
+
+ # Fetch the objects to update
+ objects = Certificate.objects.filter(id__in=ids)
+ if not objects.exists():
+ raise ParseError("No objects found")
+
+ # Update the objects
+ for obj in objects:
+ # for field, value in updates.items():
+ # setattr(obj, field, value)
+ # obj.save()
+ serializer = CertificateSerializer(obj, data=updates, partial=True)
+ serializer.is_valid(raise_exception=True)
+ serializer.save()
+
+ return Response()
\ No newline at end of file