mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-15 05:46:45 +08:00
feat:修改面授课
This commit is contained in:
@@ -1,51 +1,61 @@
|
||||
<template>
|
||||
<div class="CommonStudent">
|
||||
<a-drawer
|
||||
:visible="visiable"
|
||||
class="drawerStyle ProjCheckship"
|
||||
placement="right"
|
||||
width="40%"
|
||||
:visible="visiable"
|
||||
class="drawerStyle ProjCheckship"
|
||||
placement="right"
|
||||
width="40%"
|
||||
>
|
||||
<div class="drawerMain" id="ProjCheckship" style="">
|
||||
<div class="header">
|
||||
<div class="headerTitle">
|
||||
权限名单
|
||||
</div>
|
||||
<div class="headerTitle">权限名单</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
/>
|
||||
</div>
|
||||
<div class="TableStudent">
|
||||
<a-row
|
||||
type="flex"
|
||||
gutter="12"
|
||||
style="padding-left: 20px; margin-right: 0px"
|
||||
type="flex"
|
||||
gutter="12"
|
||||
style="padding-left: 20px; margin-right: 0px"
|
||||
>
|
||||
<a-col>
|
||||
<a-form-item title="姓名:">
|
||||
<a-input
|
||||
class="cus-input"
|
||||
v-model:value="searchName"
|
||||
placeholder="请输入姓名"
|
||||
class="cus-input"
|
||||
v-model:value="searchName"
|
||||
placeholder="请输入姓名"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col>
|
||||
<a-button
|
||||
class="cus-btn"
|
||||
style="background: #4ea6ff; color: #fff; width: 100px"
|
||||
@click="search"
|
||||
class="cus-btn"
|
||||
style="background: #4ea6ff; color: #fff; width: 100px"
|
||||
@click="search"
|
||||
>
|
||||
<template #icon><img style="margin-right: 10px" src="../../assets/images/courseManage/search0.png"/>
|
||||
<template #icon
|
||||
><img
|
||||
style="margin-right: 10px"
|
||||
src="../../assets/images/courseManage/search0.png"
|
||||
/>
|
||||
</template>
|
||||
搜索
|
||||
</a-button>
|
||||
</a-col>
|
||||
<a-col :span="2">
|
||||
<a-button class="cus-btn white" style="width: 100px" @click="reset">
|
||||
<template #icon><img style="margin-right: 10px" src="../../assets/images/leveladd/reset.png"/>
|
||||
<a-button
|
||||
class="cus-btn white"
|
||||
style="width: 100px"
|
||||
@click="reset"
|
||||
>
|
||||
<template #icon
|
||||
><img
|
||||
style="margin-right: 10px"
|
||||
src="../../assets/images/leveladd/reset.png"
|
||||
/>
|
||||
</template>
|
||||
重置
|
||||
</a-button>
|
||||
@@ -53,16 +63,26 @@
|
||||
</a-row>
|
||||
<div style="margin-top: 20px">
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="studentList"
|
||||
:pagination="stuPagination"
|
||||
:loading="loading"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:data-source="studentList"
|
||||
:pagination="stuPagination"
|
||||
:loading="loading"
|
||||
row-key="id"
|
||||
>
|
||||
<template #action="{ record }">
|
||||
<a-space :size="2">
|
||||
<slot name="extension" v-bind:data="{ record }"></slot>
|
||||
<a-button v-if="record.type!==6 && record.type!==9 && record.type!==12" @click="del(record.id)" type="link" danger>删除</a-button>
|
||||
<a-button
|
||||
v-if="
|
||||
record.type !== 6 &&
|
||||
record.type !== 9 &&
|
||||
record.type !== 12
|
||||
"
|
||||
@click="del(record.id)"
|
||||
type="link"
|
||||
danger
|
||||
>删除</a-button
|
||||
>
|
||||
</a-space>
|
||||
</template>
|
||||
</a-table>
|
||||
@@ -78,12 +98,19 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {computed, createVNode, defineProps, defineExpose, ref, watch} from "vue";
|
||||
import {usePage} from "@/api/request";
|
||||
import {STUDENT_LIST} from "@/api/apis";
|
||||
import {delStudentList} from "@/api/index1";
|
||||
import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
|
||||
import {Modal} from "ant-design-vue";
|
||||
import {
|
||||
computed,
|
||||
createVNode,
|
||||
defineProps,
|
||||
defineExpose,
|
||||
ref,
|
||||
watch,
|
||||
} from "vue";
|
||||
import { usePage } from "@/api/request";
|
||||
import { STUDENT_LIST } from "@/api/apis";
|
||||
import { delStudentList } from "@/api/index1";
|
||||
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
||||
import { Modal } from "ant-design-vue";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
@@ -104,13 +131,13 @@ const initParams = {
|
||||
studentName: "",
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
type: props.type || '',
|
||||
type: props.type || "",
|
||||
types: props.types,
|
||||
pid: props.id || '',
|
||||
}
|
||||
pid: props.id || "",
|
||||
};
|
||||
|
||||
const searchParams = ref(initParams)
|
||||
const searchName = ref('')
|
||||
const searchParams = ref(initParams);
|
||||
const searchName = ref("");
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
@@ -143,7 +170,18 @@ const columns = ref([
|
||||
key: "type",
|
||||
width: 30,
|
||||
align: "center",
|
||||
customRender: ({record: {type}}) => ({4: "查看权", 5: "管理权", 6: "归属权",7: "查看权", 8: "管理权", 9: "归属权",10: "查看权", 11: "管理权", 12: "归属权"}[type])
|
||||
customRender: ({ record: { type } }) =>
|
||||
({
|
||||
4: "查看权",
|
||||
5: "管理权",
|
||||
6: "归属权",
|
||||
7: "查看权",
|
||||
8: "管理权",
|
||||
9: "归属权",
|
||||
10: "查看权",
|
||||
11: "管理权",
|
||||
12: "归属权",
|
||||
}[type]),
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
@@ -151,18 +189,23 @@ const columns = ref([
|
||||
key: "operation",
|
||||
width: 50,
|
||||
align: "center",
|
||||
slots: {customRender: "action"},
|
||||
slots: { customRender: "action" },
|
||||
},
|
||||
])
|
||||
]);
|
||||
|
||||
const {data: studentList, fetch: searchStu, total, loading} = usePage(STUDENT_LIST, searchParams)
|
||||
const {
|
||||
data: studentList,
|
||||
fetch: searchStu,
|
||||
total,
|
||||
loading,
|
||||
} = usePage(STUDENT_LIST, searchParams);
|
||||
|
||||
const stuPagination = computed(() => ({
|
||||
total:total.value,
|
||||
total: total.value,
|
||||
showSizeChanger: false,
|
||||
current: searchParams.value.pageNo,
|
||||
pageSize: searchParams.value.pageSize,
|
||||
onChange: changePagination
|
||||
onChange: changePagination,
|
||||
}));
|
||||
|
||||
const openDrawer = () => {
|
||||
@@ -173,22 +216,22 @@ const changePagination = (page) => {
|
||||
searchParams.value.pageNo = page;
|
||||
};
|
||||
|
||||
function search(){
|
||||
searchParams.value.studentName = searchName.value
|
||||
searchParams.value.pageNo = 1
|
||||
function search() {
|
||||
searchParams.value.studentName = searchName.value;
|
||||
searchParams.value.pageNo = 1;
|
||||
}
|
||||
function del(id) {
|
||||
Modal.confirm({
|
||||
title: () => '确定删除?',
|
||||
title: () => "确定删除?",
|
||||
icon: () => createVNode(ExclamationCircleOutlined),
|
||||
content: () => '数据删除后不可恢复!',
|
||||
okText: () => '确定',
|
||||
okType: 'danger',
|
||||
cancelText: () => '取消',
|
||||
content: () => "数据删除后不可恢复!",
|
||||
okText: () => "确定",
|
||||
okType: "danger",
|
||||
cancelText: () => "取消",
|
||||
onOk() {
|
||||
if(id){
|
||||
loading.value = true
|
||||
delStudentList({ids: [id]}).then(() => searchStu())
|
||||
if (id) {
|
||||
loading.value = true;
|
||||
delStudentList({ ids: [id] }).then(() => searchStu());
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -198,20 +241,20 @@ const closeDrawer = () => {
|
||||
visiable.value = false;
|
||||
};
|
||||
|
||||
function reset(){
|
||||
searchParams.value = initParams
|
||||
searchName.value=''
|
||||
function reset() {
|
||||
searchParams.value = initParams;
|
||||
searchName.value = "";
|
||||
}
|
||||
|
||||
watch(visiable, () => {
|
||||
visiable.value && searchStu()
|
||||
searchParams.value = initParams
|
||||
visiable.value && searchStu();
|
||||
searchParams.value = initParams;
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
searchStu,
|
||||
loading
|
||||
})
|
||||
loading,
|
||||
});
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.cus-btn {
|
||||
|
||||
Reference in New Issue
Block a user