Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
7f55cfea
提交
7f55cfea
authored
6月 10, 2022
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
4ce86113
全部展开
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
51 行增加
和
280 行删除
+51
-280
.eslintrc-auto-import.json
.eslintrc-auto-import.json
+0
-247
auto-imports.d.ts
auto-imports.d.ts
+0
-0
api.ts
src/modules/resource/video/api.ts
+7
-7
CardListItem.vue
src/modules/resource/video/components/CardListItem.vue
+1
-1
List.vue
src/modules/resource/video/views/List.vue
+8
-12
Update.vue
src/modules/resource/video/views/Update.vue
+34
-6
vite.config.ts
vite.config.ts
+1
-7
没有找到文件。
.eslintrc-auto-import.json
浏览文件 @
7f55cfea
{
"globals"
:
{
"$"
:
true
,
"$$"
:
true
,
"$computed"
:
true
,
"$customRef"
:
true
,
"$ref"
:
true
,
"$shallowRef"
:
true
,
"$toRef"
:
true
,
"EffectScope"
:
true
,
"asyncComputed"
:
true
,
"autoResetRef"
:
true
,
"computed"
:
true
,
"computedAsync"
:
true
,
"computedEager"
:
true
,
"computedInject"
:
true
,
"computedWithControl"
:
true
,
"controlledComputed"
:
true
,
"controlledRef"
:
true
,
"createApp"
:
true
,
"createEventHook"
:
true
,
"createGlobalState"
:
true
,
"createInjectionState"
:
true
,
"createReactiveFn"
:
true
,
"createSharedComposable"
:
true
,
"createUnrefFn"
:
true
,
"customRef"
:
true
,
"debouncedRef"
:
true
,
"debouncedWatch"
:
true
,
"defineAsyncComponent"
:
true
,
"defineComponent"
:
true
,
"eagerComputed"
:
true
,
"effectScope"
:
true
,
"extendRef"
:
true
,
"getCurrentInstance"
:
true
,
"getCurrentScope"
:
true
,
"h"
:
true
,
"ignorableWatch"
:
true
,
"inject"
:
true
,
"isDefined"
:
true
,
"isProxy"
:
true
,
"isReactive"
:
true
,
"isReadonly"
:
true
,
"isRef"
:
true
,
"logicAnd"
:
true
,
"logicNot"
:
true
,
"logicOr"
:
true
,
"makeDestructurable"
:
true
,
"markRaw"
:
true
,
"nextTick"
:
true
,
"onActivated"
:
true
,
"onBeforeMount"
:
true
,
"onBeforeUnmount"
:
true
,
"onBeforeUpdate"
:
true
,
"onClickOutside"
:
true
,
"onDeactivated"
:
true
,
"onErrorCaptured"
:
true
,
"onKeyStroke"
:
true
,
"onLongPress"
:
true
,
"onMounted"
:
true
,
"onRenderTracked"
:
true
,
"onRenderTriggered"
:
true
,
"onScopeDispose"
:
true
,
"onServerPrefetch"
:
true
,
"onStartTyping"
:
true
,
"onUnmounted"
:
true
,
"onUpdated"
:
true
,
"pausableWatch"
:
true
,
"provide"
:
true
,
"reactify"
:
true
,
"reactifyObject"
:
true
,
"reactive"
:
true
,
"reactiveComputed"
:
true
,
"reactiveOmit"
:
true
,
"reactivePick"
:
true
,
"readonly"
:
true
,
"ref"
:
true
,
"refAutoReset"
:
true
,
"refDebounced"
:
true
,
"refDefault"
:
true
,
"refThrottled"
:
true
,
"refWithControl"
:
true
,
"resolveComponent"
:
true
,
"shallowReactive"
:
true
,
"shallowReadonly"
:
true
,
"shallowRef"
:
true
,
"syncRef"
:
true
,
"syncRefs"
:
true
,
"templateRef"
:
true
,
"throttledRef"
:
true
,
"throttledWatch"
:
true
,
"toRaw"
:
true
,
"toReactive"
:
true
,
"toRef"
:
true
,
"toRefs"
:
true
,
"triggerRef"
:
true
,
"tryOnBeforeMount"
:
true
,
"tryOnBeforeUnmount"
:
true
,
"tryOnMounted"
:
true
,
"tryOnScopeDispose"
:
true
,
"tryOnUnmounted"
:
true
,
"unref"
:
true
,
"unrefElement"
:
true
,
"until"
:
true
,
"useActiveElement"
:
true
,
"useAsyncQueue"
:
true
,
"useAsyncState"
:
true
,
"useAttrs"
:
true
,
"useBase64"
:
true
,
"useBattery"
:
true
,
"useBreakpoints"
:
true
,
"useBroadcastChannel"
:
true
,
"useBrowserLocation"
:
true
,
"useCached"
:
true
,
"useClamp"
:
true
,
"useClipboard"
:
true
,
"useColorMode"
:
true
,
"useConfirmDialog"
:
true
,
"useCounter"
:
true
,
"useCssModule"
:
true
,
"useCssVar"
:
true
,
"useCssVars"
:
true
,
"useCurrentElement"
:
true
,
"useCycleList"
:
true
,
"useDark"
:
true
,
"useDateFormat"
:
true
,
"useDebounce"
:
true
,
"useDebounceFn"
:
true
,
"useDebouncedRefHistory"
:
true
,
"useDeviceMotion"
:
true
,
"useDeviceOrientation"
:
true
,
"useDevicePixelRatio"
:
true
,
"useDevicesList"
:
true
,
"useDisplayMedia"
:
true
,
"useDocumentVisibility"
:
true
,
"useDraggable"
:
true
,
"useElementBounding"
:
true
,
"useElementByPoint"
:
true
,
"useElementHover"
:
true
,
"useElementSize"
:
true
,
"useElementVisibility"
:
true
,
"useEventBus"
:
true
,
"useEventListener"
:
true
,
"useEventSource"
:
true
,
"useEyeDropper"
:
true
,
"useFavicon"
:
true
,
"useFetch"
:
true
,
"useFileSystemAccess"
:
true
,
"useFocus"
:
true
,
"useFocusWithin"
:
true
,
"useFps"
:
true
,
"useFullscreen"
:
true
,
"useGamepad"
:
true
,
"useGeolocation"
:
true
,
"useIdle"
:
true
,
"useInfiniteScroll"
:
true
,
"useIntersectionObserver"
:
true
,
"useInterval"
:
true
,
"useIntervalFn"
:
true
,
"useKeyModifier"
:
true
,
"useLastChanged"
:
true
,
"useLocalStorage"
:
true
,
"useMagicKeys"
:
true
,
"useManualRefHistory"
:
true
,
"useMediaControls"
:
true
,
"useMediaQuery"
:
true
,
"useMemoize"
:
true
,
"useMemory"
:
true
,
"useMounted"
:
true
,
"useMouse"
:
true
,
"useMouseInElement"
:
true
,
"useMousePressed"
:
true
,
"useMutationObserver"
:
true
,
"useNavigatorLanguage"
:
true
,
"useNetwork"
:
true
,
"useNow"
:
true
,
"useOffsetPagination"
:
true
,
"useOnline"
:
true
,
"usePageLeave"
:
true
,
"useParallax"
:
true
,
"usePermission"
:
true
,
"usePointer"
:
true
,
"usePointerSwipe"
:
true
,
"usePreferredColorScheme"
:
true
,
"usePreferredDark"
:
true
,
"usePreferredLanguages"
:
true
,
"useRafFn"
:
true
,
"useRefHistory"
:
true
,
"useResizeObserver"
:
true
,
"useRoute"
:
true
,
"useRouter"
:
true
,
"useScreenOrientation"
:
true
,
"useScreenSafeArea"
:
true
,
"useScriptTag"
:
true
,
"useScroll"
:
true
,
"useScrollLock"
:
true
,
"useSessionStorage"
:
true
,
"useShare"
:
true
,
"useSlots"
:
true
,
"useSpeechRecognition"
:
true
,
"useSpeechSynthesis"
:
true
,
"useStorage"
:
true
,
"useStorageAsync"
:
true
,
"useStyleTag"
:
true
,
"useSwipe"
:
true
,
"useTemplateRefsList"
:
true
,
"useTextSelection"
:
true
,
"useThrottle"
:
true
,
"useThrottleFn"
:
true
,
"useThrottledRefHistory"
:
true
,
"useTimeAgo"
:
true
,
"useTimeout"
:
true
,
"useTimeoutFn"
:
true
,
"useTimeoutPoll"
:
true
,
"useTimestamp"
:
true
,
"useTitle"
:
true
,
"useToggle"
:
true
,
"useTransition"
:
true
,
"useUrlSearchParams"
:
true
,
"useUserMedia"
:
true
,
"useVModel"
:
true
,
"useVModels"
:
true
,
"useVibrate"
:
true
,
"useVirtualList"
:
true
,
"useWakeLock"
:
true
,
"useWebNotification"
:
true
,
"useWebSocket"
:
true
,
"useWebWorker"
:
true
,
"useWebWorkerFn"
:
true
,
"useWindowFocus"
:
true
,
"useWindowScroll"
:
true
,
"useWindowSize"
:
true
,
"watch"
:
true
,
"watchAtMost"
:
true
,
"watchDebounced"
:
true
,
"watchEffect"
:
true
,
"watchIgnorable"
:
true
,
"watchOnce"
:
true
,
"watchPausable"
:
true
,
"watchPostEffect"
:
true
,
"watchSyncEffect"
:
true
,
"watchThrottled"
:
true
,
"watchWithFilter"
:
true
,
"whenever"
:
true
}
}
\ No newline at end of file
auto-imports.d.ts
浏览文件 @
7f55cfea
差异被折叠。
点击展开。
src/modules/resource/video/api.ts
浏览文件 @
7f55cfea
...
...
@@ -20,17 +20,17 @@ export function getCoverList() {
return
httpRequest
.
get
(
'/api/resource/v1/util/get-cover-list'
)
}
// 更新视频
export
function
updateVideo
(
data
:
{
id
:
string
;
course_name
:
string
;
cover_page
:
string
;
type
:
string
;
weight
?:
string
})
{
return
httpRequest
.
post
(
'/api/resource/backend/video/update'
,
data
)
}
// 获取视频详情
export
function
getVideo
(
params
:
{
id
:
string
})
{
return
httpRequest
.
get
(
'/api/resource/
backend
/video/view'
,
{
params
})
export
function
getVideo
Details
(
params
:
{
id
:
string
})
{
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
})
{
return
httpRequest
.
post
(
'/api/resource/v1/resource/video/update'
,
data
)
}
src/modules/resource/video/components/CardListItem.vue
浏览文件 @
7f55cfea
...
...
@@ -9,7 +9,7 @@ const props:any = defineProps<{ data: object }>()
<!--
<img
:src=
"props.data.cover"
/>
-->
<div
class=
"cover-img"
:style=
"`background-image:url($
{props.data.cover})`">
</div>
<div
class=
"tool-pop-btn"
>
<router-link
to=
"/resource/video/update
"
>
<router-link
:to=
"`/resource/video/update?id=$
{props.data.id}`
">
<div
class=
"edit-btn"
>
编辑
</div>
</router-link>
<router-link
to=
"/resource/video/view"
>
...
...
src/modules/resource/video/views/List.vue
浏览文件 @
7f55cfea
...
...
@@ -2,9 +2,6 @@
import
{
getVideoList
,
getProjectList
,
getCategoryList
}
from
'../api'
import
CardListItem
from
'../components/CardListItem.vue'
import
{
Expand
,
Search
}
from
'@element-plus/icons-vue'
// import { useMapStore } from '@/stores/map'
// const store= useMapStore()
// console.log(store, 'store')
// 筛选项目列表
let
projectList
:
any
=
$ref
([])
...
...
@@ -12,7 +9,7 @@ getProjectList({ organization_id: '' }).then(res => {
projectList
=
res
.
data
.
departments
})
// tab触发
//
资源出处
tab触发
const
tabValue
=
ref
(
'1'
)
const
tabChange
=
()
=>
{
appList
.
value
.
refetch
()
...
...
@@ -23,6 +20,7 @@ const appList = ref()
// 列表切换
const
isCard
=
ref
(
false
)
// table 数据
const
listOptions
=
$computed
(()
=>
{
return
{
remote
:
{
...
...
@@ -46,7 +44,6 @@ const listOptions = $computed(() => {
{
type
:
'select'
,
prop
:
'authorized'
,
label
:
'项目'
,
options
:
projectList
,
labelKey
:
'name'
,
valueKey
:
'id'
},
{
prop
:
'classification'
,
label
:
'类别'
,
slots
:
'filter-type'
},
{
prop
:
'title'
,
slots
:
'filter-search'
}
// { type: 'input', prop: 'category_id', prefixIcon: 'Search' }
],
columns
:
[
{
label
:
'视频标题'
,
prop
:
'name'
,
align
:
'center'
},
...
...
@@ -63,16 +60,16 @@ const listOptions = $computed(() => {
}
})
// 下拉选择tree 视频分类
let
selectTree
=
$ref
([])
getCategoryList
({
type
:
'tree'
}).
then
((
res
)
=>
{
// 下拉选择tree 视频分类
let
selectTree
=
$ref
([])
getCategoryList
({
type
:
'tree'
}).
then
((
res
)
=>
{
selectTree
=
res
.
data
})
const
defaultProps
=
{
})
const
defaultProps
=
{
children
:
'children'
,
label
:
'category_name'
,
value
:
'id'
}
}
</
script
>
<
template
>
...
...
@@ -118,7 +115,6 @@ const listOptions = $computed(() => {
<CardListItem
v-for=
"(item, index) in data"
:data=
"item"
:key=
"index"
></CardListItem>
</div>
<el-empty
v-else
description=
"description"
/>
<!--
<div
class=
"resource-video-item"
v-for=
"item in data"
:key=
"item.id"
>
{{
item
.
title
}}
</div>
-->
</
template
>
</AppList>
</AppCard>
...
...
src/modules/resource/video/views/Update.vue
浏览文件 @
7f55cfea
...
...
@@ -5,7 +5,7 @@
import
Upload
from
'../components/Upload.vue'
import
UploadAuth
from
'@/components/base/UploadAuth.vue'
// import { useMapStore } from '@/stores/map'
import
{
getCategoryList
,
getCoverList
,
createVideo
}
from
'../api'
import
{
getCategoryList
,
getCoverList
,
createVideo
,
getVideoDetails
,
updateVideo
}
from
'../api'
// const store= useMapStore()
// console.log(store)
// const statusList = store.mapList.filter((item: any) => item.key === 'system_status')[0].values
...
...
@@ -14,15 +14,15 @@
const
router
=
useRouter
()
// 下拉选择tree 视频分类
let
selectTree
=
$ref
([])
getCategoryList
({
type
:
'tree'
}).
then
((
res
)
=>
{
selectTree
=
res
.
data
})
const
defaultProps
=
{
children
:
'children'
,
label
:
'category_name'
,
value
:
'id'
}
let
selectTree
=
$ref
([])
getCategoryList
({
type
:
'tree'
}).
then
((
res
)
=>
{
selectTree
=
res
.
data
})
// 视频封面图轮播
let
swiperCovers
:
[{
id
:
string
,
url
:
string
}[]]
=
$ref
([[]])
...
...
@@ -71,6 +71,20 @@
ElMessage
(
'请勾选用户协议'
)
return
}
const
id
=
router
.
currentRoute
.
value
.
query
.
id
as
string
if
(
id
!==
''
&&
id
)
{
const
params
=
Object
.
assign
({
id
:
id
},
form
)
updateVideo
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
0
)
{
ElMessage
({
message
:
'更新成功'
,
type
:
'success'
})
setTimeout
(()
=>
{
router
.
push
({
path
:
'/resource/video'
})
},
1000
)
}
})
}
else
{
createVideo
(
form
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
0
)
{
ElMessage
({
message
:
'创建成功'
,
type
:
'success'
})
...
...
@@ -81,6 +95,8 @@
},
1000
)
}
})
}
}
else
{
ElMessage
(
'请完善信息'
)
console
.
log
(
'error submit!'
,
fields
)
...
...
@@ -103,6 +119,18 @@
videoUpload
.
progress
=
0
form
.
source_id
=
videoId
}
// 判断编辑还是新建
const
id
=
router
.
currentRoute
.
value
.
query
.
id
as
string
console
.
log
(
id
)
if
(
id
!==
''
&&
id
)
{
getVideoDetails
({
id
:
id
}).
then
(
res
=>
{
const
key
=
[
'name'
,
'classification'
,
'knowledge_points'
,
'cover'
,
'source_id'
]
key
.
forEach
(
item
=>
{
form
[
item
]
=
res
.
data
[
item
]
})
})
}
</
script
>
<
template
>
...
...
@@ -114,7 +142,7 @@
<div
class=
"btn-item"
>
更改负责人
</div>
</div>
<el-form
ref=
"ruleFormRef"
:model=
"form"
:rules=
"rules"
style=
"width: 70%"
>
<el-form-item
label=
"视频文件:"
prop=
"source_id"
>
<el-form-item
label=
"视频文件:"
prop=
"source_id"
v-if=
"id == '' || id == undefined"
>
<div>
<div
class=
"upload-video"
>
<div
class=
"upload-btn"
>
...
...
vite.config.ts
浏览文件 @
7f55cfea
...
...
@@ -26,13 +26,7 @@ export default defineConfig(({ mode }) => ({
cert
:
fs
.
readFileSync
(
path
.
join
(
__dirname
,
'./https/dev.ezijing.com.pem'
))
},
proxy
:
{
'/api/resource'
:
{
// target: 'http://localhost-activity-frontend.ezijing.com',
target
:
'http://localhost-resource-backend.ezijing.com'
,
changeOrigin
:
true
,
rewrite
:
path
=>
path
.
replace
(
/^
\/
api
\/
resource/
,
''
)
},
'/api'
:
'https://learn-api.ezijing.com'
'/api'
:
'https://resource-center.ezijing.com'
}
},
resolve
:
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论