提交 019d9053 authored 作者: 王鹏飞's avatar 王鹏飞

feat: 添加状态过滤器到班级、专业、学期和课程列表

上级 ea02d53e
......@@ -2,14 +2,14 @@
import PreviewFiles from './PreviewFiles.vue'
let dialogVisible = ref(false)
const protocol = ref(false)
const protocol = ref(true)
const prop = defineProps({
select: Boolean
select: Boolean,
})
const item = {
url: '/center_resource/紫荆教育用户入驻及网络教学资源协议.docx'
url: '/center_resource/紫荆教育用户入驻及网络教学资源协议.docx',
}
const emit = defineEmits(['change'])
......
import httpRequest from '@/utils/axios'
// 获取班级列表
export function getClassList(params?: { name?: string; organ_id?: string; page?: string; 'per-page'?: string }) {
export function getClassList(params?: { name?: string; organ_id?: string; status?: string; page?: string; 'per-page'?: string }) {
return httpRequest.get('/api/resource/v1/learning/class/list', { params })
}
// 添加班级
......
<script setup lang="ts">
import { ElMessage } from 'element-plus'
import { useProjectList } from '@/composables/useGetProjectList'
import { useMapStore } from '@/stores/map'
import AddClass from '../components/AddClass.vue'
import ClassStudents from '../components/ClassStudents.vue'
......@@ -10,6 +11,7 @@ import { getClassList, updateClass } from '../api'
import ImportClass from '../components/ImportClass.vue'
const departmentList: any = useProjectList('', '79806610719731712').departmentList
const store = useMapStore()
// 判断当前用户是不是超级管理员
const user = useUserStore().roles
......@@ -23,10 +25,11 @@ const isShowClassStuDialog = ref(false)
const isRelatingDialog = ref(false)
const listOptions = computed(() => {
return {
remote: { httpRequest: getClassList, params: { name: '', organ_id: '' } },
remote: { httpRequest: getClassList, params: { name: '', organ_id: '', status: '' } },
filters: [
{ type: 'input', prop: 'name', label: '班级名称:', placeholder: '班级名称' },
{ type: 'select', prop: 'organ_id', slots: 'filter-department' }
{ type: 'select', prop: 'organ_id', slots: 'filter-department' },
{ type: 'select', prop: 'status', label: '状态:', options: store.getMapValuesByKey('system_status') },
],
columns: [
{ label: '序号', type: 'index', align: 'center' },
......
import httpRequest from '@/utils/axios'
// 获取专业列表
export function getProList(params?: { name?: string; page?: string; 'per-page'?: string }) {
export function getProList(params?: { name?: string; status?: string; page?: string; 'per-page'?: string }) {
return httpRequest.get('/api/resource/v1/backend/specialty/list', { params })
}
// 创建专业
......
<script setup lang="ts">
import { ElMessage } from 'element-plus'
import { getProList, updatePro } from '../api'
import { useMapStore } from '@/stores/map'
import { useUserStore } from '@/stores/user'
import AddPro from '../components/AddPro.vue'
import ImportPro from '../components/ImportPro.vue'
// 判断当前用户是不是超级管理员
const user = useUserStore().roles
const isAdmin = !!user.find((item: any) => item.name === '超级管理员')
const store = useMapStore()
const appList = ref()
const title = ref('')
const id = ref('')
......@@ -14,8 +16,11 @@ const isEdit = ref('')
const isShowProDialog = ref(false)
const listOptions = computed(() => {
return {
remote: { httpRequest: getProList, params: { name: '' } },
filters: [{ type: 'input', prop: 'name', label: '专业名称:', placeholder: '专业名称' }],
remote: { httpRequest: getProList, params: { name: '', status: '' } },
filters: [
{ type: 'input', prop: 'name', label: '专业名称:', placeholder: '专业名称' },
{ type: 'select', prop: 'status', label: '状态:', options: store.getMapValuesByKey('system_status') },
],
columns: [
{ label: '序号', type: 'index', align: 'center' },
{ label: '专业代码', prop: 'code', align: 'center' },
......
import httpRequest from '@/utils/axios'
// 获取学期列表
export function getSemList(params?: { name?: string; organ_id?: string; page?: number; page_size?: number }) {
export function getSemList(params?: { name?: string; organ_id?: string; status?: string; page?: number; page_size?: number }) {
return httpRequest.get('/api/resource/v1/learning/semester/list', { params })
}
......
......@@ -2,11 +2,13 @@
import { useUserStore } from '@/stores/user'
import { ElMessage } from 'element-plus'
import { useProjectList } from '@/composables/useGetProjectList'
import { useMapStore } from '@/stores/map'
import AddSemester from '../components/AddSemester.vue'
import SemesterCourse from '../components/SemesterCourse.vue'
import ImportSemester from '../components/ImportSemester.vue'
import { getSemList, updateSem } from '../api'
const departmentList: any = useProjectList('', '79806610719731712').departmentList
const store = useMapStore()
// 判断当前用户是不是超级管理员
const user = useUserStore().roles
const isAdmin = !!user.find((item: any) => item.name === '超级管理员')
......@@ -18,10 +20,11 @@ const isShowAddSemDialog = ref(false)
const isShowSemCourseDialog = ref(false)
const listOptions = computed(() => {
return {
remote: { httpRequest: getSemList, params: { name: '', organ_id: '' } },
remote: { httpRequest: getSemList, params: { name: '', organ_id: '', status: '' } },
filters: [
{ type: 'input', prop: 'name', label: '学期名称:', placeholder: '学期名称' },
{ type: 'select', prop: 'organ_id', slots: 'filter-department' },
{ type: 'select', prop: 'status', label: '状态:', options: store.getMapValuesByKey('system_status') },
],
columns: [
{ label: '序号', type: 'index', align: 'center' },
......
......@@ -21,6 +21,7 @@ export function getVideoDetails(params: { id: string }) {
// 获取课程列表
export function getCourseList(params: {
tab: string
status?: string
name?: string
authorized?: string
page?: number
......@@ -129,4 +130,4 @@ export function importTag(data: { course_id: string; file: any }) {
return httpRequest.post('/api/resource/v1/course/course/tag-import', data, {
headers: { 'Content-Type': 'multipart/form-data' }
})
}
\ No newline at end of file
}
......@@ -4,6 +4,7 @@ import { getCourseList } from '../api'
import CardListItem from '../components/CardListItem.vue'
import { PictureFilled } from '@element-plus/icons-vue'
import { useProjectList } from '@/composables/useGetProjectList'
import { useMapStore } from '@/stores/map'
import { useUserStore } from '@/stores/user'
// 统计资源数据整合
......@@ -12,6 +13,7 @@ import Statistics from '../components/Statistics.vue'
// 判断当前用户是不是超级管理员
const user = useUserStore().roles
const isAdmin = !!user.find((item: any) => item.name === '超级管理员')
const store = useMapStore()
// 筛选部门列表
const departmentList: any = useProjectList('', '79806610719731712').departmentList
......@@ -63,6 +65,12 @@ const listOptions = computed(() => {
prop: 'authorized',
slots: 'filter-department',
},
{
type: 'select',
prop: 'status',
label: '状态:',
options: store.getMapValuesByKey('system_status'),
},
],
columns,
}
......
......@@ -69,14 +69,14 @@ const listOptions = computed(() => {
params: { tab: tabValue, status: '', authorized: '', name: '' },
},
filters: [
{ type: 'input', prop: 'name', label: '标题:' },
{ prop: 'classification', label: '类别:', slots: 'filter-type' },
{
type: 'select',
prop: 'status',
label: '状态:',
options: store.getMapValuesByKey('system_status'),
},
{ prop: 'classification', label: '类别:', slots: 'filter-type' },
{ type: 'input', prop: 'name', label: '标题:' },
{
prop: 'authorized',
slots: 'filter-department',
......
......@@ -25,7 +25,7 @@ const form: any = reactive({
knowledge_points: '',
url: '',
type: '',
size: ''
size: '',
})
// 编辑数据回显
......@@ -35,8 +35,8 @@ if (isUpdate.value) {
form.file = [
{
name: res.data.name,
url: res.data.url
}
url: res.data.url,
},
]
})
}
......@@ -46,22 +46,22 @@ let { list: selectTree }: any = useGetCategoryList()
const defaultProps = {
children: 'children',
label: 'category_name',
value: 'id'
value: 'id',
}
// 监听文件上传
watch(
() => form.file,
value => {
(value) => {
form.name = value[0]?.name.slice(0, value[0]?.name.lastIndexOf('.')) || ''
}
},
)
// 表单验证
const rules = {
name: [{ required: true, message: '请输入标题', trigger: 'blur' }],
classification: [{ required: true, message: '请选择分类', trigger: 'change' }],
file: [{ required: true, message: '' }]
file: [{ required: true, message: '' }],
}
// 新建编辑表单提交
const ruleFormRef = ref<FormInstance>()
......@@ -71,7 +71,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
if (!formEl) return
if (!submitFlag) return
submitFlag = false
await formEl.validate(valid => {
await formEl.validate((valid) => {
if (valid) {
if (!protocol.value) {
submitFlag = true
......@@ -106,7 +106,7 @@ const updateResources = (params: any) => {
ElMessage({ message: '更新成功', type: 'success' })
setTimeout(() => {
router.push({
path: '/resource/courseware'
path: '/resource/courseware',
})
}, 1000)
} else {
......@@ -126,7 +126,7 @@ const createResources = (params: any) => {
ElMessage({ message: '创建成功', type: 'success' })
setTimeout(() => {
router.push({
path: '/resource/courseware'
path: '/resource/courseware',
})
}, 1000)
} else {
......@@ -139,7 +139,7 @@ const createResources = (params: any) => {
}
// 协议
const protocol = ref(false)
const protocol = ref(true)
const changeProtocol = (data: any) => {
protocol.value = data.value
......@@ -173,8 +173,7 @@ const changeProtocol = (data: any) => {
:data="selectTree"
placeholder="请选择课件分类"
node-key="id"
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []"
/>
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []" />
</el-form-item>
<el-form-item label="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;知识点:">
<el-input
......@@ -182,8 +181,7 @@ const changeProtocol = (data: any) => {
maxlength="100"
v-model="form.knowledge_points"
:rows="2"
type="textarea"
/>
type="textarea" />
</el-form-item>
</el-form>
<div class="protocol-box">
......
......@@ -69,14 +69,14 @@ const listOptions = computed(() => {
params: { tab: tabValue, status: '', authorized: '', name: '' },
},
filters: [
{ type: 'input', prop: 'name', label: '标题:' },
{ prop: 'classification', label: '类别:', slots: 'filter-type' },
{
type: 'select',
prop: 'status',
label: '状态:',
options: store.getMapValuesByKey('system_status'),
},
{ prop: 'classification', label: '类别:', slots: 'filter-type' },
{ type: 'input', prop: 'name', label: '标题:' },
{
prop: 'authorized',
slots: 'filter-department',
......
......@@ -25,7 +25,7 @@ const form: any = reactive({
knowledge_points: '',
url: '',
type: '',
size: ''
size: '',
})
// 编辑数据回显
......@@ -35,8 +35,8 @@ if (isUpdate.value) {
form.file = [
{
name: res.data.name,
url: res.data.url
}
url: res.data.url,
},
]
})
}
......@@ -46,24 +46,24 @@ let { list: selectTree }: any = useGetCategoryList()
const defaultProps = {
children: 'children',
label: 'category_name',
value: 'id'
value: 'id',
}
// 监听文件上传
watch(
() => form.file,
value => {
(value) => {
if (value[0]?.name.lastIndexOf('.') != -1) {
form.name = value[0]?.name.slice(0, value[0]?.name.lastIndexOf('.')) || ''
}
}
},
)
// 表单验证
const rules = {
name: [{ required: true, message: '请输入标题', trigger: 'blur' }],
classification: [{ required: true, message: '请选择分类', trigger: 'change' }],
file: [{ required: true, message: '' }]
file: [{ required: true, message: '' }],
}
// 新建编辑表单提交
const ruleFormRef = ref<FormInstance>()
......@@ -72,7 +72,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
if (!submitFlag) return
submitFlag = false
if (!formEl) return
await formEl.validate(valid => {
await formEl.validate((valid) => {
if (valid) {
if (!protocol.value) {
submitFlag = true
......@@ -107,7 +107,7 @@ const updateResources = (params: any) => {
ElMessage({ message: '更新成功', type: 'success' })
setTimeout(() => {
router.push({
path: '/resource/lessonplan'
path: '/resource/lessonplan',
})
}, 1000)
} else {
......@@ -127,7 +127,7 @@ const createResources = (params: any) => {
ElMessage({ message: '创建成功', type: 'success' })
setTimeout(() => {
router.push({
path: '/resource/lessonplan'
path: '/resource/lessonplan',
})
}, 1000)
} else {
......@@ -140,7 +140,7 @@ const createResources = (params: any) => {
}
// 协议
const protocol = ref(false)
const protocol = ref(true)
const changeProtocol = (data: any) => {
protocol.value = data.value
......@@ -173,8 +173,7 @@ const changeProtocol = (data: any) => {
v-model="form.classification"
:data="selectTree"
node-key="id"
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []"
/>
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []" />
</el-form-item>
<el-form-item label="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;知识点:">
<el-input
......@@ -182,8 +181,7 @@ const changeProtocol = (data: any) => {
maxlength="100"
v-model="form.knowledge_points"
:rows="2"
type="textarea"
/>
type="textarea" />
</el-form-item>
</el-form>
<div class="protocol-box">
......
......@@ -70,14 +70,14 @@ const listOptions = computed(() => {
params: { tab: tabValue, status: '', authorized: '', name: '' },
},
filters: [
{ type: 'input', prop: 'name', label: '标题:' },
{ prop: 'classification', label: '类别:', slots: 'filter-type' },
{
type: 'select',
prop: 'status',
label: '状态:',
options: store.getMapValuesByKey('system_status'),
},
{ prop: 'classification', label: '类别:', slots: 'filter-type' },
{ type: 'input', prop: 'name', label: '标题:' },
{
prop: 'authorized',
slots: 'filter-department',
......
......@@ -25,7 +25,7 @@ const form: any = reactive({
knowledge_points: '',
url: '',
type: '',
size: ''
size: '',
})
// 编辑数据回显
......@@ -35,8 +35,8 @@ if (isUpdate.value) {
form.file = [
{
name: res.data.name,
url: res.data.url
}
url: res.data.url,
},
]
})
}
......@@ -46,26 +46,26 @@ let { list: selectTree }: any = useGetCategoryList()
const defaultProps = {
children: 'children',
label: 'category_name',
value: 'id'
value: 'id',
}
// 监听文件上传
watch(
() => form.file,
value => {
(value) => {
if (value[0]?.name.includes('.')) {
form.name = value[0]?.name.slice(0, value[0]?.name.lastIndexOf('.'))
} else {
form.name = value[0]?.name || ''
}
}
},
)
// 表单验证
const rules = {
name: [{ required: true, message: '请输入标题', trigger: 'blur' }],
classification: [{ required: true, message: '请选择分类', trigger: 'change' }],
file: [{ required: true, message: '' }]
file: [{ required: true, message: '' }],
}
// 新建编辑表单提交
const ruleFormRef = ref<FormInstance>()
......@@ -74,7 +74,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
if (!submitFlag) return
submitFlag = false
if (!formEl) return
await formEl.validate(valid => {
await formEl.validate((valid) => {
if (valid) {
if (!protocol.value) {
submitFlag = true
......@@ -109,7 +109,7 @@ const updateResources = (params: any) => {
ElMessage({ message: '更新成功', type: 'success' })
setTimeout(() => {
router.push({
path: '/resource/other'
path: '/resource/other',
})
}, 1000)
} else {
......@@ -129,7 +129,7 @@ const createResources = (params: any) => {
ElMessage({ message: '创建成功', type: 'success' })
setTimeout(() => {
router.push({
path: '/resource/other'
path: '/resource/other',
})
}, 1000)
} else {
......@@ -142,7 +142,7 @@ const createResources = (params: any) => {
}
// 协议
const protocol = ref(false)
const protocol = ref(true)
const changeProtocol = (data: any) => {
protocol.value = data.value
......@@ -159,8 +159,7 @@ const changeProtocol = (data: any) => {
<AppUpload
accept=".doc,.docx,.xls,.xlsx,.pdf,.ppt,.pptx,.mp3,.mp4,.png,.jpeg,.jpg,.rar,.zip"
:limit="1"
v-model="form.file"
></AppUpload>
v-model="form.file"></AppUpload>
<div class="upload-btn">本地文件</div>
</div>
</div>
......@@ -180,8 +179,7 @@ const changeProtocol = (data: any) => {
style="width: 100%"
v-model="form.classification"
:data="selectTree"
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []"
/>
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []" />
</el-form-item>
<el-form-item label="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;知识点:">
<el-input
......@@ -189,8 +187,7 @@ const changeProtocol = (data: any) => {
maxlength="100"
v-model="form.knowledge_points"
:rows="2"
type="textarea"
/>
type="textarea" />
</el-form-item>
</el-form>
<div class="protocol-box">
......
......@@ -69,14 +69,14 @@ const listOptions = computed(() => {
params: { tab: tabValue, status: '', authorized: '', name: '' },
},
filters: [
{ type: 'input', prop: 'name', label: '标题:' },
{ prop: 'classification', label: '类别:', slots: 'filter-type' },
{
type: 'select',
prop: 'status',
label: '状态:',
options: store.getMapValuesByKey('system_status'),
},
{ prop: 'classification', label: '类别:', slots: 'filter-type' },
{ type: 'input', prop: 'name', label: '标题:' },
{
prop: 'authorized',
slots: 'filter-department',
......
......@@ -32,13 +32,13 @@ let { list: selectTree }: any = useGetCategoryList()
const defaultProps = {
children: 'children',
label: 'category_name',
value: 'id'
value: 'id',
}
// 视频封面图轮播
const swiperCovers = ref<{ id: string; url: string }[][]>([[]])
// 获取封面
getCoverList().then(res => {
getCoverList().then((res) => {
const filtersData = res.data.list.filter((i: any) => i.type === '1')
let index = 0
while (index < filtersData.length) {
......@@ -61,13 +61,13 @@ const swiperItemHandle = (url: string) => {
// form表单
let form = reactive({
data: { name: '', source: '2', classification: '', knowledge_points: '', cover: '', source_id: '', size: 0 }
data: { name: '', source: '2', classification: '', knowledge_points: '', cover: '', source_id: '', size: 0 },
})
// 表单验证
const rules = {
name: [{ required: true, message: '请输入标题', trigger: 'blur' }],
classification: [{ required: true, message: '请选择分类', trigger: 'change' }],
source_id: [{ required: true, message: '' }]
source_id: [{ required: true, message: '' }],
}
const ruleFormRef = ref<FormInstance>()
let submitFlag = true
......@@ -75,7 +75,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
if (!submitFlag) return
submitFlag = false
if (!formEl) return
await formEl.validate(valid => {
await formEl.validate((valid) => {
if (valid) {
if (!protocol.value) {
submitFlag = true
......@@ -103,7 +103,7 @@ const updateResources = () => {
ElMessage({ message: '更新成功', type: 'success' })
setTimeout(() => {
router.push({
path: '/resource/video'
path: '/resource/video',
})
}, 1000)
} else {
......@@ -123,7 +123,7 @@ const createResources = () => {
ElMessage({ message: '创建成功', type: 'success' })
setTimeout(() => {
router.push({
path: '/resource/video'
path: '/resource/video',
})
}, 1000)
} else {
......@@ -136,7 +136,7 @@ const createResources = () => {
}
// 协议勾选
const protocol = ref(false)
const protocol = ref(true)
// 上传视频成功
const uploadVideo = (data: any) => {
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论