提交 1145c4b9 authored 作者: lihuihui's avatar lihuihui

公共筛选提取修改

上级 05ffa360
...@@ -134,6 +134,7 @@ ...@@ -134,6 +134,7 @@
"useDisplayMedia": true, "useDisplayMedia": true,
"useDocumentVisibility": true, "useDocumentVisibility": true,
"useDraggable": true, "useDraggable": true,
"useDropZone": true,
"useElementBounding": true, "useElementBounding": true,
"useElementByPoint": true, "useElementByPoint": true,
"useElementHover": true, "useElementHover": true,
......
...@@ -135,6 +135,7 @@ declare global { ...@@ -135,6 +135,7 @@ declare global {
const useDisplayMedia: typeof import('@vueuse/core')['useDisplayMedia'] const useDisplayMedia: typeof import('@vueuse/core')['useDisplayMedia']
const useDocumentVisibility: typeof import('@vueuse/core')['useDocumentVisibility'] const useDocumentVisibility: typeof import('@vueuse/core')['useDocumentVisibility']
const useDraggable: typeof import('@vueuse/core')['useDraggable'] const useDraggable: typeof import('@vueuse/core')['useDraggable']
const useDropZone: typeof import('@vueuse/core')['useDropZone']
const useElementBounding: typeof import('@vueuse/core')['useElementBounding'] const useElementBounding: typeof import('@vueuse/core')['useElementBounding']
const useElementByPoint: typeof import('@vueuse/core')['useElementByPoint'] const useElementByPoint: typeof import('@vueuse/core')['useElementByPoint']
const useElementHover: typeof import('@vueuse/core')['useElementHover'] const useElementHover: typeof import('@vueuse/core')['useElementHover']
......
...@@ -53,3 +53,8 @@ export function updateAuth(data: { source_id: string }) { ...@@ -53,3 +53,8 @@ export function updateAuth(data: { source_id: string }) {
export function getCategoryList(params: { type: string; category_name?: string }) { export function getCategoryList(params: { type: string; category_name?: string }) {
return httpRequest.get('/api/resource/v1/backend/category/list', { params }) return httpRequest.get('/api/resource/v1/backend/category/list', { params })
} }
// 获取项目列表
export function getProjectList(params: { organization_id: string }) {
return httpRequest.get('/api/resource/v1/util/members', { params })
}
\ No newline at end of file
import { getCategoryList } from '@/api/base' import { getCategoryList } from '@/api/base'
export function useCategory() { export function useGetCategoryList() {
const list = ref([]) const list = ref([])
onMounted(() => { onMounted(() => {
getCategoryList({ type: 'tree' }).then((res: any) => { getCategoryList({ type: 'tree' }).then((res: any) => {
......
import { getProjectList } from '@/api/base'
export function useProjectList(id?: string) {
const list = ref([])
onMounted(() => {
getProjectList({ organization_id: id || '' }).then((res: any) => {
list.value = res.data.departments
})
})
return { list }
}
\ No newline at end of file
...@@ -23,11 +23,6 @@ export function createCourse(data: { ...@@ -23,11 +23,6 @@ export function createCourse(data: {
return httpRequest.post('/api/resource/v1/resource/courseware/create', data) return httpRequest.post('/api/resource/v1/resource/courseware/create', data)
} }
// 获取分类列表
export function getCategoryList(params: { type: string; category_name?: string }) {
return httpRequest.get('/api/resource/v1/backend/category/list', { params })
}
// 更新课件 // 更新课件
export function updateCourse(data: { export function updateCourse(data: {
id: string id: string
...@@ -43,10 +38,7 @@ export function updateCourse(data: { ...@@ -43,10 +38,7 @@ export function updateCourse(data: {
export function getCourseDetails(params: { id: string }) { export function getCourseDetails(params: { id: string }) {
return httpRequest.get('/api/resource/v1/resource/courseware/view', { params }) return httpRequest.get('/api/resource/v1/resource/courseware/view', { params })
} }
// 获取项目列表
export function getProjectList(params: { organization_id: string }) {
return httpRequest.get('/api/resource/v1/util/members', { params })
}
// 部门共享 // 部门共享
export function setDepartment(data: { id: string }) { export function setDepartment(data: { id: string }) {
return httpRequest.post('/api/resource/v1/resource/courseware/set-department', data) return httpRequest.post('/api/resource/v1/resource/courseware/set-department', data)
......
<script setup lang="ts"> <script setup lang="ts">
import { setDepartment, setPlatform, setStatus, getProjectList, setBelong } from '../api' import { setDepartment, setPlatform, setStatus, setBelong } from '../api'
import { useProjectList } from '@/composables/useGetProjectList'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
...@@ -103,9 +104,7 @@ const dialogFormVisible = ref(false) ...@@ -103,9 +104,7 @@ const dialogFormVisible = ref(false)
// 人员列表 // 人员列表
let members: any = ref([]) let members: any = ref([])
const getMembers = () => { const getMembers = () => {
getProjectList({ organization_id: props.data.organ_id }).then((res: any) => { members.value = useProjectList(props.data.organ_id)
members.value = res.data.members
})
} }
// 点击更改负责人按钮弹窗 // 点击更改负责人按钮弹窗
const handleMembers = () => { const handleMembers = () => {
......
<script setup lang="ts"> <script setup lang="ts">
import { getCourseList, getProjectList, getCategoryList } from '../api' import { getCourseList } from '../api'
import CardListItem from '@/components/base/CardListItem.vue' import CardListItem from '@/components/base/CardListItem.vue'
import { Expand, Search } from '@element-plus/icons-vue' import { Expand, Search } from '@element-plus/icons-vue'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
import { useGetCategoryList } from '@/composables/useGetCategoryList'
import { useProjectList } from '@/composables/useGetProjectList'
const store = useMapStore() const store = useMapStore()
const appList = ref() const appList = ref()
...@@ -16,20 +18,16 @@ const tabChange = () => { ...@@ -16,20 +18,16 @@ const tabChange = () => {
} }
// 筛选项目列表 // 筛选项目列表
let projectList: any = $ref([]) let { list: projectList } = useProjectList()
getProjectList({ organization_id: '' }).then((res: any) => {
projectList = res.data.departments
})
// 下拉选择tree 视频分类 // 下拉选择tree 视频分类
let selectTree = $ref([]) let { list: selectTree } = useGetCategoryList()
getCategoryList({ type: 'tree' }).then((res: any) => {
selectTree = res.data
})
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
label: 'category_name', label: 'category_name',
value: 'id' value: 'id'
} }
const listOptions = $computed(() => { const listOptions = $computed(() => {
return { return {
remote: { remote: {
...@@ -47,7 +45,7 @@ const listOptions = $computed(() => { ...@@ -47,7 +45,7 @@ const listOptions = $computed(() => {
label: '状态', label: '状态',
options: store.mapList?.filter((item: any) => item.key === 'system_status')[0]?.values options: store.mapList?.filter((item: any) => item.key === 'system_status')[0]?.values
}, },
{ type: 'select', prop: 'authorized', label: '项目', options: projectList, labelKey: 'name', valueKey: 'id' }, { type: 'select', prop: 'authorized', label: '项目', options: projectList.value, labelKey: 'name', valueKey: 'id' },
{ prop: 'classification', label: '类别', slots: 'filter-type' }, { prop: 'classification', label: '类别', slots: 'filter-type' },
{ prop: 'search', slots: 'filter-search' } { prop: 'search', slots: 'filter-search' }
// { type: 'input', prop: 'category_id', prefixIcon: 'Search' } // { type: 'input', prop: 'category_id', prefixIcon: 'Search' }
......
<script setup lang="ts"> <script setup lang="ts">
import { createCourse, updateCourse, getCategoryList, getCourseDetails } from '../api' import { createCourse, updateCourse, getCourseDetails } from '../api'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import UploadAuth from '@/components/base/UploadAuth.vue' import UploadAuth from '@/components/base/UploadAuth.vue'
import type { FormInstance, FormRules } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus'
import { useGetCategoryList } from '@/composables/useGetCategoryList'
// 路由 // 路由
const router = useRouter() const router = useRouter()
const ruleFormRef = ref<FormInstance>() const ruleFormRef = ref<FormInstance>()
...@@ -38,16 +39,13 @@ const upload = (res: any) => { ...@@ -38,16 +39,13 @@ const upload = (res: any) => {
videoUpload.progress = 0 videoUpload.progress = 0
} }
// 下拉选择tree 课件分类 // 下拉选择tree 视频分类
let { list: selectTree } = useGetCategoryList()
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
label: 'category_name', label: 'category_name',
value: 'id' value: 'id'
} }
let selectTree = $ref([])
getCategoryList({ type: 'tree' }).then(res => {
selectTree = res.data
})
const handleConfirm = async (formEl: FormInstance | undefined) => { const handleConfirm = async (formEl: FormInstance | undefined) => {
if (!formEl) return if (!formEl) return
......
...@@ -12,15 +12,6 @@ export function getLessonList(params?: { ...@@ -12,15 +12,6 @@ export function getLessonList(params?: {
return httpRequest.get('/api/resource/v1/resource/lesson-plan/list', { params }) return httpRequest.get('/api/resource/v1/resource/lesson-plan/list', { params })
} }
// 获取项目列表
export function getProjectList(params: { organization_id: string }) {
return httpRequest.get('/api/resource/v1/util/members', { params })
}
// 获取分类列表
export function getCategoryList(params: { type: string; category_name?: string }) {
return httpRequest.get('/api/resource/v1/backend/category/list', { params })
}
// 创建教案 // 创建教案
export function createLessonPlan(data: { name: string; source: string; classification: string; knowledge_points: string; url: string; type: string; size: string }) { export function createLessonPlan(data: { name: string; source: string; classification: string; knowledge_points: string; url: string; type: string; size: string }) {
return httpRequest.post('/api/resource/v1/resource/lesson-plan/create', data) return httpRequest.post('/api/resource/v1/resource/lesson-plan/create', data)
......
<script setup lang="ts"> <script setup lang="ts">
import { getLessonList, getProjectList, getCategoryList } from '../api' import { getLessonList } from '../api'
import CardListItem from '@/components/base/CardListItem.vue' import CardListItem from '@/components/base/CardListItem.vue'
import { Expand, Search } from '@element-plus/icons-vue' import { Expand, Search } from '@element-plus/icons-vue'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
import { useGetCategoryList } from '@/composables/useGetCategoryList'
import { useProjectList } from '@/composables/useGetProjectList'
const store = useMapStore() const store = useMapStore()
const appList = ref() const appList = ref()
...@@ -14,20 +17,15 @@ const tabChange = () => { ...@@ -14,20 +17,15 @@ const tabChange = () => {
appList.value.refetch() appList.value.refetch()
} }
// 筛选项目列表 // 筛选项目列表
let projectList: any = $ref([]) let { list: projectList } = useProjectList()
getProjectList({ organization_id: '' }).then((res: any) => {
projectList = res.data.departments
})
// 下拉选择tree 视频分类 // 下拉选择tree 视频分类
let selectTree = $ref([]) let { list: selectTree } = useGetCategoryList()
getCategoryList({ type: 'tree' }).then((res: any) => {
selectTree = res.data
})
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
label: 'category_name', label: 'category_name',
value: 'id' value: 'id'
} }
const listOptions = $computed(() => { const listOptions = $computed(() => {
return { return {
remote: { remote: {
...@@ -45,7 +43,7 @@ const listOptions = $computed(() => { ...@@ -45,7 +43,7 @@ const listOptions = $computed(() => {
label: '状态', label: '状态',
options: store.mapList?.filter((item: any) => item.key === 'system_status')[0]?.values options: store.mapList?.filter((item: any) => item.key === 'system_status')[0]?.values
}, },
{ type: 'select', prop: 'authorized', label: '项目', options: projectList, labelKey: 'name', valueKey: 'id' }, { type: 'select', prop: 'authorized', label: '项目', options: projectList.value, labelKey: 'name', valueKey: 'id' },
{ prop: 'classification', label: '类别', slots: 'filter-type' }, { prop: 'classification', label: '类别', slots: 'filter-type' },
{ prop: 'search', slots: 'filter-search' } { prop: 'search', slots: 'filter-search' }
// { type: 'input', prop: 'category_id', prefixIcon: 'Search' } // { type: 'input', prop: 'category_id', prefixIcon: 'Search' }
......
<script setup lang="ts"> <script setup lang="ts">
import AppUpload from '@/components/base/AppUpload.vue' import AppUpload from '@/components/base/AppUpload.vue'
import { getCategoryList } from '@/api/base' import type { FormInstance } from 'element-plus'
import type { FormInstance } from 'element-plus' import { ElMessage } from 'element-plus'
import { ElMessage } from 'element-plus' import { createLessonPlan } from '../api'
import { createLessonPlan } from '../api' import { useGetCategoryList } from '@/composables/useGetCategoryList'
// 路由 // 路由
const router = useRouter() const router = useRouter()
// 下拉选择tree 视频分类 // 下拉选择tree 视频分类
const defaultProps = { let { list: selectTree } = useGetCategoryList()
const defaultProps = {
children: 'children', children: 'children',
label: 'category_name', label: 'category_name',
value: 'id' value: 'id'
} }
let selectTree = $ref([])
getCategoryList({ type: 'tree' }).then((res: any) => {
selectTree = res.data
})
// form表单 // form表单
const form:any = reactive({ file: [], name: '', source: '2', classification: '', knowledge_points: '', url: '', type: '', size: '' }) const form: any = reactive({
// 表单验证 file: [],
const rules = { name: '',
source: '2',
classification: '',
knowledge_points: '',
url: '',
type: '',
size: ''
})
// 表单验证
const rules = {
name: [{ required: true, message: '请输入标题', trigger: 'blur' }], name: [{ required: true, message: '请输入标题', trigger: 'blur' }],
classification: [{ required: true, message: '请选择分类', trigger: 'change' }], classification: [{ required: true, message: '请选择分类', trigger: 'change' }],
file: [{ required: true, message: '' }] file: [{ required: true, message: '' }]
} }
// 新建编辑表单提交 // 新建编辑表单提交
const ruleFormRef = ref<FormInstance>() const ruleFormRef = ref<FormInstance>()
const submitForm = async (formEl: FormInstance | undefined) => { const submitForm = async (formEl: FormInstance | undefined) => {
if (!formEl) return if (!formEl) return
await formEl.validate((valid, fields) => { await formEl.validate((valid, fields) => {
console.log(valid, 'valid', fields) console.log(valid, 'valid', fields)
...@@ -58,7 +64,7 @@ ...@@ -58,7 +64,7 @@
// } // }
// }) // })
} else { } else {
createLessonPlan(params).then((res:any) => { createLessonPlan(params).then((res: any) => {
if (res.code === 0) { if (res.code === 0) {
ElMessage({ message: '创建成功', type: 'success' }) ElMessage({ message: '创建成功', type: 'success' })
setTimeout(() => { setTimeout(() => {
...@@ -69,15 +75,14 @@ ...@@ -69,15 +75,14 @@
} }
}) })
} }
} else { } else {
ElMessage('请完善信息') ElMessage('请完善信息')
console.log('error submit!', fields) console.log('error submit!', fields)
} }
}) })
} }
// 协议 // 协议
const protocol = ref(false) const protocol = ref(false)
</script> </script>
<template> <template>
...@@ -94,9 +99,7 @@ ...@@ -94,9 +99,7 @@
<div class="upload-video"> <div class="upload-video">
<div class="upload-box"> <div class="upload-box">
<AppUpload :limit="1" v-model="form.file"></AppUpload> <AppUpload :limit="1" v-model="form.file"></AppUpload>
<div class="upload-btn"> <div class="upload-btn">本地文件</div>
本地文件
</div>
</div> </div>
</div> </div>
<div class="tips">课件支持格式包含:doc docx pdf ppt pptx,大小不超过50M</div> <div class="tips">课件支持格式包含:doc docx pdf ppt pptx,大小不超过50M</div>
...@@ -106,14 +109,10 @@ ...@@ -106,14 +109,10 @@
<el-input v-model="form.name" /> <el-input v-model="form.name" />
</el-form-item> </el-form-item>
<el-form-item label="教案分类:" prop="classification"> <el-form-item label="教案分类:" prop="classification">
<el-tree-select :props="defaultProps" style="width:100%" v-model="form.classification" :data="selectTree" /> <el-tree-select :props="defaultProps" style="width: 100%" v-model="form.classification" :data="selectTree" />
</el-form-item> </el-form-item>
<el-form-item label="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;知识点:"> <el-form-item label="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;知识点:">
<el-input <el-input v-model="form.knowledge_points" :rows="2" type="textarea" />
v-model="form.knowledge_points"
:rows="2"
type="textarea"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="protocol-box"> <div class="protocol-box">
...@@ -128,67 +127,67 @@ ...@@ -128,67 +127,67 @@
</AppCard> </AppCard>
</template> </template>
<style lang="scss"> <style lang="scss">
.upload-box{ .upload-box {
position: relative; position: relative;
.app-upload-btn{ .app-upload-btn {
position: relative; position: relative;
z-index: 99; z-index: 99;
opacity: 0.0001 !important; opacity: 0.0001 !important;
} }
} }
.tips{ .tips {
font-size: 12px; font-size: 12px;
line-height: 100%; line-height: 100%;
color: #999999; color: #999999;
margin-top: 8px; margin-top: 8px;
} }
.tool-btn-box{ .tool-btn-box {
display: flex; display: flex;
justify-content: right; justify-content: right;
.btn-item{ .btn-item {
width: 127px; width: 127px;
line-height: 36px; line-height: 36px;
background: #AA1941; background: #aa1941;
border-radius: 20px; border-radius: 20px;
margin-right: 10px; margin-right: 10px;
font-size: 14px; font-size: 14px;
color: #FFFFFF; color: #ffffff;
text-align: center; text-align: center;
} }
} }
.demo-progress{ .demo-progress {
width: 350px; width: 350px;
} }
.video-cover{ .video-cover {
display: flex; display: flex;
.img-box{ .img-box {
width: 208px; width: 208px;
height: 130px; height: 130px;
border-radius: 4px; border-radius: 4px;
background: #F7F7F7; background: #f7f7f7;
font-size: 20px; font-size: 20px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
img{ img {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: block; display: block;
} }
} }
.video-cover_right{ .video-cover_right {
margin-left: 20px; margin-left: 20px;
.list{ .list {
.item{ .item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 12px; margin-top: 12px;
img{ img {
width: 9px; width: 9px;
display: block; display: block;
margin-right: 5px; margin-right: 5px;
} }
.text{ .text {
font-size: 12px; font-size: 12px;
color: #999999; color: #999999;
line-height: 100%; line-height: 100%;
...@@ -197,29 +196,29 @@ ...@@ -197,29 +196,29 @@
} }
} }
} }
.swiper-box{ .swiper-box {
min-width: 660px; min-width: 660px;
margin-top: 20px; margin-top: 20px;
padding: 0 40px; padding: 0 40px;
position: relative; position: relative;
.arrow{ .arrow {
position: absolute; position: absolute;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
font-size: 30px; font-size: 30px;
color: #D5D5D5; color: #d5d5d5;
cursor: pointer; cursor: pointer;
&.left{ &.left {
left: 0; left: 0;
} }
&.right{ &.right {
right: 10px; right: 10px;
} }
} }
.cover-list{ .cover-list {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
.cover-list_item{ .cover-list_item {
display: block; display: block;
width: 155px; width: 155px;
height: 96px; height: 96px;
...@@ -229,26 +228,26 @@ ...@@ -229,26 +228,26 @@
} }
} }
} }
:deep(.el-carousel__indicators--horizontal){ :deep(.el-carousel__indicators--horizontal) {
display: none; display: none;
} }
.protocol-box{ .protocol-box {
font-size: 14px; font-size: 14px;
line-height: 24px; line-height: 24px;
padding-left: 90px; padding-left: 90px;
padding-top: 20px; padding-top: 20px;
color: #666666; color: #666666;
span{ span {
color: #AA1941; color: #aa1941;
} }
} }
.btn-box{ .btn-box {
display: flex; display: flex;
margin-top: 20px; margin-top: 20px;
margin-left: 90px; margin-left: 90px;
.confirm{ .confirm {
width: 94px; width: 94px;
background: #AA1941; background: #aa1941;
border-radius: 20px; border-radius: 20px;
text-align: center; text-align: center;
line-height: 36px; line-height: 36px;
...@@ -256,44 +255,44 @@ ...@@ -256,44 +255,44 @@
margin-right: 26px; margin-right: 26px;
cursor: pointer; cursor: pointer;
} }
.cancel{ .cancel {
width: 94px; width: 94px;
line-height: 36px; line-height: 36px;
border: 1px solid #AA1941; border: 1px solid #aa1941;
border-radius: 20px; border-radius: 20px;
text-align: center; text-align: center;
color: #AA1941; color: #aa1941;
cursor: pointer; cursor: pointer;
} }
} }
.upload-video{ .upload-video {
display: flex; display: flex;
align-items: center; align-items: center;
.upload-btn{ .upload-btn {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 94px; width: 94px;
line-height: 36px; line-height: 36px;
background: rgba(250, 223, 230, 0.39); background: rgba(250, 223, 230, 0.39);
border: 1px solid #AA1941; border: 1px solid #aa1941;
border-radius: 20px; border-radius: 20px;
font-size: 14px; font-size: 14px;
color: #AA1941; color: #aa1941;
margin-right: 30px; margin-right: 30px;
text-align: center; text-align: center;
} }
.video-info{ .video-info {
display: flex; display: flex;
.name{ .name {
color: #333333; color: #333333;
font-size: 16px; font-size: 16px;
line-height: 100%; line-height: 100%;
} }
.view{ .view {
font-size: 16px; font-size: 16px;
line-height: 100%; line-height: 100%;
color: #399EE8; color: #399ee8;
margin-left: 20px; margin-left: 20px;
cursor: pointer; cursor: pointer;
} }
......
...@@ -16,14 +16,6 @@ export function getOtherDetails(params: { id: string }) { ...@@ -16,14 +16,6 @@ export function getOtherDetails(params: { id: string }) {
return httpRequest.get('/api/resource/v1/resource/other-information/view', { params }) return httpRequest.get('/api/resource/v1/resource/other-information/view', { params })
} }
// 获取项目列表
export function getProjectList(params: { organization_id: string }) {
return httpRequest.get('/api/resource/v1/util/members', { params })
}
// 获取分类列表
export function getCategoryList(params: { type: string; category_name?: string }) {
return httpRequest.get('/api/resource/v1/backend/category/list', { params })
}
// 部门共享 // 部门共享
export function setDepartment(data: { id: string }) { export function setDepartment(data: { id: string }) {
return httpRequest.post('/api/resource/v1/resource/other-information/set-department', data) return httpRequest.post('/api/resource/v1/resource/other-information/set-department', data)
......
<script setup lang="ts"> <script setup lang="ts">
import { setDepartment, setPlatform, setStatus, getProjectList, setBelong } from '../api' import { setDepartment, setPlatform, setStatus, setBelong } from '../api'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
import { useProjectList } from '@/composables/useGetProjectList'
const store = useMapStore() const store = useMapStore()
console.log(store) console.log(store)
...@@ -102,9 +103,7 @@ const dialogFormVisible = ref(false) ...@@ -102,9 +103,7 @@ const dialogFormVisible = ref(false)
// 人员列表 // 人员列表
let members: any = ref([]) let members: any = ref([])
const getMembers = () => { const getMembers = () => {
getProjectList({ organization_id: props.data.organ_id }).then((res: any) => { members.value = useProjectList(props.data.organ_id)
members.value = res.data.members
})
} }
// 点击更改负责人按钮弹窗 // 点击更改负责人按钮弹窗
const handleMembers = () => { const handleMembers = () => {
......
<script setup lang="ts"> <script setup lang="ts">
import { getOtherList, getProjectList, getCategoryList } from '../api' import { getOtherList } from '../api'
import CardListItem from '@/components/base/CardListItem.vue' import CardListItem from '@/components/base/CardListItem.vue'
import { Expand, Search } from '@element-plus/icons-vue' import { Expand, Search } from '@element-plus/icons-vue'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
import { useProjectList } from '@/composables/useGetProjectList'
// 下拉选择tree 视频分类
import { useGetCategoryList } from '@/composables/useGetCategoryList'
const store = useMapStore() const store = useMapStore()
const appList = ref() const appList = ref()
...@@ -16,20 +19,16 @@ const tabChange = () => { ...@@ -16,20 +19,16 @@ const tabChange = () => {
} }
// 筛选项目列表 // 筛选项目列表
let projectList: any = $ref([]) let { list: projectList } = useProjectList()
getProjectList({ organization_id: '' }).then((res: any) => {
projectList = res.data.departments
})
// 下拉选择tree 视频分类 // 下拉选择tree 视频分类
let selectTree = $ref([]) let { list: selectTree } = useGetCategoryList()
getCategoryList({ type: 'tree' }).then((res: any) => {
selectTree = res.data
})
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
label: 'category_name', label: 'category_name',
value: 'id' value: 'id'
} }
const listOptions = $computed(() => { const listOptions = $computed(() => {
return { return {
remote: { remote: {
...@@ -47,7 +46,7 @@ const listOptions = $computed(() => { ...@@ -47,7 +46,7 @@ const listOptions = $computed(() => {
label: '状态', label: '状态',
options: store.mapList?.filter((item: any) => item.key === 'system_status')[0]?.values options: store.mapList?.filter((item: any) => item.key === 'system_status')[0]?.values
}, },
{ type: 'select', prop: 'authorized', label: '项目', options: projectList, labelKey: 'name', valueKey: 'id' }, { type: 'select', prop: 'authorized', label: '项目', options: projectList.value, labelKey: 'name', valueKey: 'id' },
{ prop: 'classification', label: '类别', slots: 'filter-type' }, { prop: 'classification', label: '类别', slots: 'filter-type' },
{ prop: 'search', slots: 'filter-search' } { prop: 'search', slots: 'filter-search' }
// { type: 'input', prop: 'category_id', prefixIcon: 'Search' } // { type: 'input', prop: 'category_id', prefixIcon: 'Search' }
......
...@@ -20,11 +20,6 @@ export function getVideoDetails(params: { id: string }) { ...@@ -20,11 +20,6 @@ export function getVideoDetails(params: { id: string }) {
return httpRequest.get('/api/resource/v1/resource/video/view', { params }) return httpRequest.get('/api/resource/v1/resource/video/view', { params })
} }
// 获取项目列表
export function getProjectList(params: { organization_id: string }) {
return httpRequest.get('/api/resource/v1/util/members', { params })
}
// 更新视频 // 更新视频
export function updateVideo(data: { id: string; name: string; classification: string; knowledge_points?: string; cover?: string }) { export function updateVideo(data: { id: string; name: string; classification: string; knowledge_points?: string; cover?: string }) {
return httpRequest.post('/api/resource/v1/resource/video/update', data) return httpRequest.post('/api/resource/v1/resource/video/update', data)
......
<script setup lang="ts"> <script setup lang="ts">
import { setDepartment, setPlatform, setStatus, getProjectList, setBelong } from '../api' import { setDepartment, setPlatform, setStatus, setBelong } from '../api'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
const store= useMapStore() import { useProjectList } from '@/composables/useGetProjectList'
const store = useMapStore()
console.log(store) console.log(store)
const router = useRouter() const router = useRouter()
...@@ -16,17 +18,21 @@ console.log(path, 'path') ...@@ -16,17 +18,21 @@ console.log(path, 'path')
const id = router.currentRoute.value.query.id as string const id = router.currentRoute.value.query.id as string
// 设置部门共享 // 设置部门共享
const handleDepartment = () => { const handleDepartment = () => {
ElMessageBox.confirm(` ElMessageBox.confirm(
`
${ ${
props.data.status == 0 props.data.status == 0
? `该操作将会使本视频资源在您所在的部门“${props.data.organ_id_name}”内部共享,管理者不变,其余人员只能共享使用该资源,确认部门共享吗?` ? `该操作将会使本视频资源在您所在的部门“${props.data.organ_id_name}”内部共享,管理者不变,其余人员只能共享使用该资源,确认部门共享吗?`
: `该操作将会取消本视频资源在您所在的部门“${props.data.organ_id_name}”内部共享,部门其余人员将不能再看到该共享资源,确认取消部门共享吗?` : `该操作将会取消本视频资源在您所在的部门“${props.data.organ_id_name}”内部共享,部门其余人员将不能再看到该共享资源,确认取消部门共享吗?`
} }
`, '提示', { `,
'提示',
{
confirmButtonText: '确认', confirmButtonText: '确认',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning'
}).then(() => { }
).then(() => {
setDepartment({ id: id }).then((res: any) => { setDepartment({ id: id }).then((res: any) => {
if (res.code === 0) { if (res.code === 0) {
ElMessage({ message: '更改成功', type: 'success' }) ElMessage({ message: '更改成功', type: 'success' })
...@@ -40,17 +46,21 @@ const handleDepartment = () => { ...@@ -40,17 +46,21 @@ const handleDepartment = () => {
// 设置平台共享 // 设置平台共享
const handlePlatform = () => { const handlePlatform = () => {
ElMessageBox.confirm(` ElMessageBox.confirm(
`
${ ${
props.data.platform_public == 0 props.data.platform_public == 0
? '该操作将会使本视频资源在e-SaaS平台中公开共享供所有老师使用,资源的管理者不变,其余人员只能共享使用该资源,确认公开该资源吗?' ? '该操作将会使本视频资源在e-SaaS平台中公开共享供所有老师使用,资源的管理者不变,其余人员只能共享使用该资源,确认公开该资源吗?'
: '该操作将会取消本视频资源在e-SaaS平台中公开共享,平台所有人员将不能再看到该共享资源,确认取消平台共享吗?' : '该操作将会取消本视频资源在e-SaaS平台中公开共享,平台所有人员将不能再看到该共享资源,确认取消平台共享吗?'
} }
`, '提示', { `,
'提示',
{
confirmButtonText: '确认', confirmButtonText: '确认',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning'
}).then(() => { }
).then(() => {
setPlatform({ id: id }).then((res: any) => { setPlatform({ id: id }).then((res: any) => {
if (res.code === 0) { if (res.code === 0) {
ElMessage({ message: '更改成功', type: 'success' }) ElMessage({ message: '更改成功', type: 'success' })
...@@ -64,17 +74,17 @@ const handlePlatform = () => { ...@@ -64,17 +74,17 @@ const handlePlatform = () => {
// 上下线设置 // 上下线设置
const handleStatus = () => { const handleStatus = () => {
ElMessageBox.confirm(` ElMessageBox.confirm(
${ `
props.data.status == 0 ${props.data.status == 0 ? '已下线的资源将不能被关联到课程使用,确认下线该资源吗?' : '确认再次上线该资源吗?'}
? '已下线的资源将不能被关联到课程使用,确认下线该资源吗?' `,
: '确认再次上线该资源吗?' '提示',
} {
`, '提示', {
confirmButtonText: '确认', confirmButtonText: '确认',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning'
}).then(() => { }
).then(() => {
setStatus({ id: id }).then((res: any) => { setStatus({ id: id }).then((res: any) => {
if (res.code === 0) { if (res.code === 0) {
ElMessage({ message: '更改成功', type: 'success' }) ElMessage({ message: '更改成功', type: 'success' })
...@@ -91,13 +101,13 @@ const form = reactive({ ...@@ -91,13 +101,13 @@ const form = reactive({
members: '' members: ''
}) })
const dialogFormVisible = ref(false) const dialogFormVisible = ref(false)
// 人员列表 // 人员列表
let members:any = ref([]) let members: any = ref([])
const getMembers = () => { const getMembers = () => {
getProjectList({ organization_id: props.data.organ_id }).then((res: any) => { members.value = useProjectList(props.data.organ_id)
members.value = res.data.members
})
} }
// 点击更改负责人按钮弹窗 // 点击更改负责人按钮弹窗
const handleMembers = () => { const handleMembers = () => {
getMembers() getMembers()
...@@ -117,7 +127,7 @@ const handlesetBelong = () => { ...@@ -117,7 +127,7 @@ const handlesetBelong = () => {
</script> </script>
<template> <template>
<div class="tool-btn-box" v-if="$route.query.id" style="margin-bottom: 20px;"> <div class="tool-btn-box" v-if="$route.query.id" style="margin-bottom: 20px">
<template v-if="path === '/resource/video/view'"> <template v-if="path === '/resource/video/view'">
<router-link :to="`/resource/video/update?id=${id}`"> <router-link :to="`/resource/video/update?id=${id}`">
<div class="btn-item">编辑视频信息</div> <div class="btn-item">编辑视频信息</div>
...@@ -126,59 +136,65 @@ const handlesetBelong = () => { ...@@ -126,59 +136,65 @@ const handlesetBelong = () => {
<div class="btn-item">编辑视频课件</div> <div class="btn-item">编辑视频课件</div>
</router-link> </router-link>
</template> </template>
<div class="btn-item" @click="handleDepartment">{{ props.data.department_public == 0 ? '部门共享' : '取消部门共享' }}</div> <div class="btn-item" @click="handleDepartment">
<div class="btn-item" @click="handlePlatform">{{ props.data.platform_public == 0 ? '平台共享' : '取消平台共享' }}</div> {{ props.data.department_public == 0 ? '部门共享' : '取消部门共享' }}
</div>
<div class="btn-item" @click="handlePlatform">
{{ props.data.platform_public == 0 ? '平台共享' : '取消平台共享' }}
</div>
<div class="btn-item" @click="handleStatus">{{ props.data.status == 0 ? '资源上线' : '资源下线' }}</div> <div class="btn-item" @click="handleStatus">{{ props.data.status == 0 ? '资源上线' : '资源下线' }}</div>
<div class="btn-item" @click="handleMembers">更改负责人</div> <div class="btn-item" @click="handleMembers">更改负责人</div>
</div> </div>
<el-dialog v-model="dialogFormVisible" title="更改负责人" center> <el-dialog v-model="dialogFormVisible" title="更改负责人" center>
<el-form :model="form"> <el-form :model="form">
<el-form-item> <el-form-item>
<div style="width:500px"> <div style="width: 500px">
<el-row> <el-row>
<el-col :span="12"><div class="grid-content ep-bg-purple" /> <el-col :span="12"
><div class="grid-content ep-bg-purple" />
资源创建人: {{ props.data.created_operator_name }} 资源创建人: {{ props.data.created_operator_name }}
</el-col> </el-col>
<el-col :span="12"><div class="grid-content ep-bg-purple-light" /> <el-col :span="12"
><div class="grid-content ep-bg-purple-light" />
创建时间: {{ props.data.created_time }} 创建时间: {{ props.data.created_time }}
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"><div class="grid-content ep-bg-purple" /> <el-col :span="12"
><div class="grid-content ep-bg-purple" />
资源负责人: {{ props.data.belong_operator_name }} 资源负责人: {{ props.data.belong_operator_name }}
</el-col> </el-col>
<el-col :span="12"><div class="grid-content ep-bg-purple-light" /> <el-col :span="12"
><div class="grid-content ep-bg-purple-light" />
更新时间: {{ props.data.updated_time }} 更新时间: {{ props.data.updated_time }}
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<el-select style="width:500px;margin-top:20px;" v-model="form.members" placeholder="请选择新的资源负责人"> <el-select style="width: 500px; margin-top: 20px" v-model="form.members" placeholder="请选择新的资源负责人">
<el-option v-for="item in members" :label="item.name" :value="item.id" :key="item.id"/> <el-option v-for="item in members" :label="item.name" :value="item.id" :key="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="dialogFormVisible = false">取消</el-button> <el-button @click="dialogFormVisible = false">取消</el-button>
<el-button type="primary" @click="handlesetBelong" <el-button type="primary" @click="handlesetBelong">确认</el-button>
>确认</el-button
>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.tool-btn-box{ .tool-btn-box {
display: flex; display: flex;
justify-content: right; justify-content: right;
.btn-item{ .btn-item {
width: 127px; width: 127px;
line-height: 36px; line-height: 36px;
background: #AA1941; background: #aa1941;
border-radius: 20px; border-radius: 20px;
margin-right: 10px; margin-right: 10px;
font-size: 14px; font-size: 14px;
color: #FFFFFF; color: #ffffff;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
} }
......
<script setup lang="ts"> <script setup lang="ts">
import { getVideoList, getProjectList } from '../api' import { getVideoList } from '../api'
// import { getCategoryList } from '@/api/base'
import CardListItem from '../components/CardListItem.vue' import CardListItem from '../components/CardListItem.vue'
import { Expand, Search } from '@element-plus/icons-vue' import { Expand, Search } from '@element-plus/icons-vue'
import { useCategory } from '@/composables/useCategory' import { useGetCategoryList } from '@/composables/useGetCategoryList'
import { useProjectList } from '@/composables/useGetProjectList'
// 筛选项目列表 // 筛选项目列表
let projectList: any = $ref([]) let { list: projectList } = useProjectList()
getProjectList({ organization_id: '' }).then(res => {
projectList = res.data.departments
})
// 资源出处 tab触发 // 资源出处 tab触发
const tabValue = ref('1') const tabValue = ref('1')
...@@ -42,7 +39,14 @@ const listOptions = $computed(() => { ...@@ -42,7 +39,14 @@ const listOptions = $computed(() => {
{ label: '失效', value: '0' } { label: '失效', value: '0' }
] ]
}, },
{ type: 'select', prop: 'authorized', label: '项目', options: projectList, labelKey: 'name', valueKey: 'id' }, {
type: 'select',
prop: 'authorized',
label: '项目',
options: projectList.value,
labelKey: 'name',
valueKey: 'id'
},
{ prop: 'classification', label: '类别', slots: 'filter-type' }, { prop: 'classification', label: '类别', slots: 'filter-type' },
{ prop: 'title', slots: 'filter-search' } { prop: 'title', slots: 'filter-search' }
], ],
...@@ -62,11 +66,7 @@ const listOptions = $computed(() => { ...@@ -62,11 +66,7 @@ const listOptions = $computed(() => {
}) })
// 下拉选择tree 视频分类 // 下拉选择tree 视频分类
let { list: selectTree } = useCategory() let { list: selectTree } = useGetCategoryList()
console.log(selectTree)
// getCategoryList({ type: 'tree' }).then((res: any) => {
// selectTree = res.data
// })
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
label: 'category_name', label: 'category_name',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论