Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
2411944d
提交
2411944d
authored
6月 09, 2022
作者:
lihuihui
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://gitlab-pro.ezijing.com/ezijing-web/center-resource
上级
159f0327
dd24a303
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
169 行增加
和
80 行删除
+169
-80
List.vue
src/modules/admin/category/views/List.vue
+103
-3
Detail.vue
src/modules/admin/teacher/views/Detail.vue
+1
-3
List.vue
src/modules/admin/teacher/views/List.vue
+5
-7
List.vue
src/modules/resource/video/views/List.vue
+1
-2
List.vue
src/modules/system/cover/views/List.vue
+1
-3
List.vue
src/modules/system/dictionary/views/List.vue
+39
-41
rowList.vue
src/modules/system/dictionary/views/rowList.vue
+19
-21
没有找到文件。
src/modules/admin/category/views/List.vue
浏览文件 @
2411944d
<
script
setup
lang=
"ts"
>
//
import Sortable from 'sortablejs'
import
Sortable
from
'sortablejs'
import
AddDialog
from
'../component/AddDialog.vue'
import
{
Operation
}
from
'@element-plus/icons-vue'
import
{
getCategoryList
,
delCategory
,
createCategory
,
updateCategory
}
from
'../api'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
const
tableKey
=
ref
(
0
)
const
loading
=
ref
(
false
)
const
prevCategoryName
=
ref
(
''
)
const
title
=
ref
(
''
)
...
...
@@ -98,6 +99,95 @@ const getParent = (node: string, tree: any) => {
// }
// })
// }
// 行拖拽 排序
const
rowDrop
=
()
=>
{
// 获取表格节点
nextTick
(()
=>
{
const
el
=
document
.
querySelector
(
'.el-table__body-wrapper tbody'
)
as
HTMLElement
let
activeRows
:
any
=
[]
if
(
!
el
)
{
return
}
// 插件调用函数
Sortable
.
create
(
el
,
{
animation
:
300
,
onMove
(
dragged
:
any
,
related
:
any
)
{
// onMove() {
tableData
=
arrayTreeSetLevel
(
tableData
)
// 树形结构数据添加level
activeRows
=
treeToTile
(
tableData
)
// 把树形的结构转为列表再进行拖拽
console
.
log
(
dragged
,
'123'
,
related
,
tableData
,
activeRows
)
const
oldRow
=
activeRows
[
dragged
.
rowIndex
]
const
newRow
=
activeRows
[
related
.
rowIndex
]
console
.
log
(
oldRow
,
newRow
)
// if (oldRow.level !== newRow.level && oldRow.pid !== newRow.pid) {
// //不能跨级拖拽
// return false
// }
},
onEnd
(
data
)
{
const
oldIndex
=
data
.
oldIndex
as
number
const
newIndex
=
data
.
newIndex
as
number
console
.
log
(
oldIndex
,
newIndex
)
const
oldRow
=
activeRows
[
oldIndex
]
// 移动的那个元素
const
newRow
=
activeRows
[
newIndex
]
// 新的元素
if
(
oldIndex
!==
newIndex
&&
oldRow
.
level
===
newRow
.
level
&&
oldRow
.
pid
===
newRow
.
pid
)
{
const
modelProperty
=
activeRows
[
oldIndex
]
const
changeIndex
=
newIndex
-
oldIndex
const
index
=
activeRows
.
indexOf
(
modelProperty
)
if
(
index
<
0
)
{
return
}
activeRows
.
splice
(
index
,
1
)
activeRows
.
splice
(
index
+
changeIndex
,
0
,
modelProperty
)
console
.
log
(
111
)
sortMenuData
()
}
}
})
})
}
const
sortMenuData
=
()
=>
{
tableKey
.
value
=
Math
.
random
()
//狠狠的刷新dom
rowDrop
()
// 再把拖拽的功能塞入
}
// 给树形的数据去添加每一层的层级
const
arrayTreeSetLevel
=
(
array
:
any
,
levelName
=
'level'
,
childrenName
=
'children'
)
=>
{
if
(
!
Array
.
isArray
(
array
))
{
return
[]
}
const
recursive
=
(
array
:
any
,
level
=
0
)
=>
{
level
++
return
array
.
map
((
v
:
any
)
=>
{
v
[
levelName
]
=
level
const
child
=
v
[
childrenName
]
if
(
child
&&
child
.
length
)
{
recursive
(
child
,
level
)
}
return
v
})
}
return
recursive
(
array
)
}
const
treeToTile
=
(
treeData
:
any
,
childKey
=
'children'
)
=>
{
// 将树数据转化为平铺数据
const
arr
:
any
=
[]
const
expanded
=
(
data
:
any
)
=>
{
if
(
data
&&
data
.
length
>
0
)
{
data
.
filter
((
d
:
any
)
=>
d
)
.
forEach
((
e
:
any
)
=>
{
arr
.
push
(
e
)
expanded
(
e
[
childKey
]
||
[])
})
}
}
expanded
(
treeData
)
return
arr
}
// 获取分类列表
const
handleCategoryList
=
()
=>
{
const
params
=
{
type
:
'tree'
}
...
...
@@ -175,9 +265,14 @@ const rebuildData = (value: any, arr: any) => {
}
onMounted
(()
=>
{
// sortable('t1', tableData) // 参数分别为table的class名称,table的数据data
rowDrop
()
handleCategoryList
()
})
// let move: any = {}
// const click = (obj: any) => {
// console.log(111)
// move = obj
// }
</
script
>
<
template
>
<AppCard
title=
"类别管理"
>
...
...
@@ -202,9 +297,14 @@ onMounted(() => {
:tree-props=
"
{ children: 'children', hasChildren: 'hasChildren' }"
highlight-current-row
v-loading="loading"
:key="tableKey"
>
<el-table-column
type=
"index"
align=
"center"
class-name=
"handle
"
>
<el-table-column
align=
"center
"
>
<el-icon><Operation
/></el-icon>
<!--
<template
#
default=
"scope"
>
<el-icon
@
mousedown=
"click(scope.row)"
><Operation
/></el-icon>
</
template
>
-->
</el-table-column>
<el-table-column
prop=
"category_name"
label=
"类别名称"
align=
"center"
class-name=
"handle"
/>
<el-table-column
prop=
"depth"
label=
"层级"
align=
"center"
/>
...
...
src/modules/admin/teacher/views/Detail.vue
浏览文件 @
2411944d
...
...
@@ -26,8 +26,7 @@ const rules = reactive<FormRules>({
name
:
[{
required
:
true
,
message
:
'请输入讲师姓名'
,
trigger
:
'blur'
}],
title
:
[{
required
:
true
,
message
:
' 请输入职位'
,
trigger
:
'blur'
}]
})
const
listOptions
=
$computed
(()
=>
{
return
{
const
listOptions
=
{
remote
:
{
params
:
{
type
:
''
}
},
...
...
@@ -45,7 +44,6 @@ const listOptions = $computed(() => {
{
label
:
'操作'
,
slots
:
'table-operate'
,
width
:
300
,
align
:
'center'
}
]
}
})
const
handleDelete
=
(
row
:
any
)
=>
{
console
.
log
(
'删除'
,
row
)
...
...
src/modules/admin/teacher/views/List.vue
浏览文件 @
2411944d
<
script
setup
lang=
"ts"
>
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
getTeacherList
,
deleteTeacher
}
from
'../api'
const
router
=
useRouter
()
const
appList
=
ref
()
const
listOptions
=
$computed
(()
=>
{
return
{
const
listOptions
=
{
remote
:
{
httpRequest
:
getTeacherList
,
params
:
{
type
:
''
}
...
...
@@ -26,14 +25,13 @@ const listOptions = $computed(() => {
{
label
:
'操作'
,
slots
:
'table-operate'
,
width
:
230
,
align
:
'center'
}
]
}
})
// 删除讲师
const
handleDelete
=
(
row
:
any
)
=>
{
ElMessageBox
.
confirm
(
'确定要删除吗?'
,
'提示'
).
then
(()
=>
{
deleteTeacher
({
id
:
row
.
id
}).
then
(()
=>
{
ElMessage
.
success
(
'删除成功'
)
appList
.
value
.
refetch
()
})
ElMessage
.
success
(
'删除成功'
)
appList
.
value
.
refetch
()
})
})
}
// 更新讲师
...
...
src/modules/resource/video/views/List.vue
浏览文件 @
2411944d
...
...
@@ -5,8 +5,7 @@ import { Expand, Search } from '@element-plus/icons-vue'
const
appList
=
ref
()
const
isCard
=
ref
(
true
)
const
isCard
=
ref
(
false
)
const
listOptions
=
{
remote
:
{
httpRequest
:
getVideoList
,
...
...
src/modules/system/cover/views/List.vue
浏览文件 @
2411944d
...
...
@@ -7,8 +7,7 @@ const appList = ref()
const
isShowDialog
=
ref
(
false
)
const
isEdit
=
ref
(
false
)
const
editData
=
ref
({})
const
listOptions
=
$computed
(()
=>
{
return
{
const
listOptions
=
{
remote
:
{
httpRequest
:
getCoverList
,
params
:
{
type
:
''
}
...
...
@@ -27,7 +26,6 @@ const listOptions = $computed(() => {
{
label
:
'操作'
,
slots
:
'table-operate'
,
width
:
230
,
align
:
'center'
}
]
}
})
// 删除
const
handleDelete
=
(
row
:
any
)
=>
{
ElMessageBox
.
confirm
(
'确定要删除吗?'
,
'提示'
).
then
(()
=>
{
...
...
src/modules/system/dictionary/views/List.vue
浏览文件 @
2411944d
...
...
@@ -13,48 +13,46 @@ const store = useMapStore()
// 状态
//表单每行数据
const
listOptions
=
$computed
(()
=>
{
return
{
remote
:
{
httpRequest
:
getDictionaryList
,
params
:
{
type
:
''
,
created_time_start
:
''
,
created_time_end
:
''
}
const
listOptions
=
{
remote
:
{
httpRequest
:
getDictionaryList
,
params
:
{
type
:
''
,
created_time_start
:
''
,
created_time_end
:
''
}
},
filters
:
[
{
type
:
'input'
,
prop
:
'name'
,
label
:
'字典名称:'
},
{
type
:
'input'
,
prop
:
'key'
,
label
:
'字典类型:'
},
{
type
:
'select'
,
prop
:
'status'
,
label
:
'字典状态:'
,
options
:
store
.
mapList
?.
filter
((
item
:
any
)
=>
item
.
key
===
'system_status'
)[
0
]?.
values
||
[]
},
filters
:
[
{
type
:
'input'
,
prop
:
'name'
,
label
:
'字典名称:'
},
{
type
:
'input'
,
prop
:
'key'
,
label
:
'字典类型:'
},
{
type
:
'select'
,
prop
:
'status'
,
label
:
'字典状态:'
,
options
:
store
.
mapList
?.
filter
((
item
:
any
)
=>
item
.
key
===
'system_status'
)[
0
]?.
values
||
[]
},
{
type
:
'input'
,
label
:
'创建时间:'
,
slots
:
'created_time_start'
,
prop
:
'created_time_start'
},
{
slots
:
'created_time_end'
,
prop
:
'created_time_end'
}
],
columns
:
[
{
label
:
'字典主键'
,
prop
:
'id'
,
width
:
224
,
align
:
'center'
},
{
label
:
'字典名称'
,
prop
:
'name'
,
align
:
'center'
},
{
label
:
'字典类型'
,
prop
:
'key'
,
align
:
'center'
},
{
label
:
'状态'
,
prop
:
'status_name'
,
align
:
'center'
},
{
label
:
'备注 '
,
prop
:
'remark'
,
align
:
'center'
},
{
label
:
'创建时间'
,
prop
:
'created_time'
,
align
:
'center'
},
{
label
:
'操作'
,
slots
:
'table-operate'
,
align
:
'center'
,
width
:
300
}
]
}
})
{
type
:
'input'
,
label
:
'创建时间:'
,
slots
:
'created_time_start'
,
prop
:
'created_time_start'
},
{
slots
:
'created_time_end'
,
prop
:
'created_time_end'
}
],
columns
:
[
{
label
:
'字典主键'
,
prop
:
'id'
,
width
:
224
,
align
:
'center'
},
{
label
:
'字典名称'
,
prop
:
'name'
,
align
:
'center'
},
{
label
:
'字典类型'
,
prop
:
'key'
,
align
:
'center'
},
{
label
:
'状态'
,
prop
:
'status_name'
,
align
:
'center'
},
{
label
:
'备注 '
,
prop
:
'remark'
,
align
:
'center'
},
{
label
:
'创建时间'
,
prop
:
'created_time'
,
align
:
'center'
},
{
label
:
'操作'
,
slots
:
'table-operate'
,
align
:
'center'
,
width
:
300
}
]
}
// 新增弹窗
const
handleAdd
=
()
=>
{
isShowDialog
.
value
=
true
...
...
src/modules/system/dictionary/views/rowList.vue
浏览文件 @
2411944d
...
...
@@ -10,28 +10,26 @@ const title = ref('')
const
type
=
route
.
query
.
type
as
string
const
isEdit
=
ref
(
false
)
const
isListAddDialog
=
ref
(
false
)
const
listOptions
=
$computed
(()
=>
{
return
{
remote
:
{
httpRequest
:
getDictionaryItemList
,
params
:
{
data_dictionary_id
:
route
.
query
.
id
}
},
const
listOptions
=
{
remote
:
{
httpRequest
:
getDictionaryItemList
,
params
:
{
data_dictionary_id
:
route
.
query
.
id
}
},
columns
:
[
{
label
:
'字典编码'
,
prop
:
'data_dictionary_id'
,
align
:
'center'
},
{
label
:
'字典标签'
,
prop
:
'label'
,
align
:
'center'
},
{
label
:
'字典键值'
,
prop
:
'value'
,
align
:
'center'
},
{
label
:
'状态'
,
prop
:
'status_name'
,
align
:
'center'
},
{
label
:
'备注 '
,
prop
:
'remark'
,
align
:
'center'
},
{
label
:
'创建时间'
,
prop
:
'created_time'
,
align
:
'center'
},
{
label
:
'操作'
,
slots
:
'table-operate'
,
align
:
'center'
,
minWidth
:
180
}
]
}
})
columns
:
[
{
label
:
'字典编码'
,
prop
:
'data_dictionary_id'
,
align
:
'center'
},
{
label
:
'字典标签'
,
prop
:
'label'
,
align
:
'center'
},
{
label
:
'字典键值'
,
prop
:
'value'
,
align
:
'center'
},
{
label
:
'状态'
,
prop
:
'status_name'
,
align
:
'center'
},
{
label
:
'备注 '
,
prop
:
'remark'
,
align
:
'center'
},
{
label
:
'创建时间'
,
prop
:
'created_time'
,
align
:
'center'
},
{
label
:
'操作'
,
slots
:
'table-operate'
,
align
:
'center'
,
minWidth
:
180
}
]
}
const
handleAdd
=
()
=>
{
isListAddDialog
.
value
=
true
isEdit
.
value
=
false
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论