Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
legobackend
/
lego-manage-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
a49498f6
authored
2026-01-16 16:38:40 +0800
by
chentao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
隐藏系列
1 parent
830f61f7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
120 additions
and
5 deletions
src/api/legao/block.js
src/lang/package/zh-cn.js
src/views/legao/block/index.vue
src/api/legao/block.js
View file @
a49498f
...
...
@@ -41,3 +41,35 @@ export function delBuildingBlock(id) {
method
:
'DELETE'
,
})
}
// 显示
export
function
displayBuildingBlock
(
id
)
{
return
request
({
url
:
`/core/buildingBlock/display/
${
id
}
`
,
method
:
'put'
,
})
}
// 批量显示
export
function
batchDisplayBuildingBlock
(
ids
)
{
return
request
({
url
:
`/core/buildingBlock/batch/display/
${
ids
}
`
,
method
:
'put'
,
})
}
// 隐藏
export
function
hideBuildingBlock
(
id
)
{
return
request
({
url
:
`/core/buildingBlock/hide/
${
id
}
`
,
method
:
'put'
,
})
}
// 批量隐藏
export
function
batchHideBuildingBlock
(
ids
)
{
return
request
({
url
:
`/core/buildingBlock/batch/hide/
${
ids
}
`
,
method
:
'put'
,
})
}
...
...
src/lang/package/zh-cn.js
View file @
a49498f
...
...
@@ -68,12 +68,16 @@ export default {
typeName
:
'类型'
,
sortName
:
'排序'
,
packName
:
'是否打包'
,
visibleName
:
'状态'
,
groupName
:
'套件'
,
tableControlsName
:
'操作'
,
controlsDelName
:
'删除'
,
controlsEditName
:
'编辑'
,
controlsDisplayName
:
'显示'
,
controlsHideName
:
'隐藏'
,
controlsAddName
:
'新增系列'
,
placeholder
:
'系列名称搜索'
,
// 新增
dialogTitleAdd
:
'新增'
,
dialogTitleEdit
:
'修改'
,
...
...
@@ -100,7 +104,7 @@ export default {
controlsEditName
:
'编辑'
,
controlsDelName
:
'删除'
,
controlsDisplayName
:
'显示'
,
controlsHideName
:
'隐藏'
,
controlsHideName
:
'隐藏'
,
controlsAddName
:
'新增课程'
,
placeholder
:
'课程、套件、系列名称搜索'
,
// 新增
...
...
src/views/legao/block/index.vue
View file @
a49498f
...
...
@@ -15,6 +15,12 @@
/>
</el-form-item>
<el-form-item
label=
""
>
<el-button
type=
"success"
icon=
"Edit"
:disabled=
"multiple"
@
click=
"handleBatchHide"
>
批量隐藏
</el-button>
</el-form-item>
<el-form-item
label=
""
>
<el-button
type=
"primary"
icon=
"Plus"
:disabled=
"multiple"
@
click=
"handleBatchDisplay"
>
批量显示
</el-button>
</el-form-item>
<el-form-item
label=
""
>
<el-button
type=
"primary"
icon=
"Search"
@
click=
"btn_search"
>
查询
</el-button>
</el-form-item>
</el-form>
...
...
@@ -39,7 +45,11 @@
:header-cell-style=
"
{textAlign:'center'}"
:cell-style="{textAlign:'center'}"
border
@selection-change="handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"50"
align=
"center"
/>
<el-table-column
:label=
"$t('block.indexName')"
type=
"index"
width=
"80"
/>
<el-table-column
:label=
"$t('block.blockName')"
prop=
"name"
/>
<el-table-column
:label=
"$t('block.sortName')"
prop=
"sort"
/>
...
...
@@ -51,18 +61,33 @@
></dict-tag>
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('block.visibleName')"
prop=
"display"
/>
<el-table-column
:label=
"$t('block.tableControlsName')"
class-name=
"small-padding fixed-width"
>
<
template
#
default=
"{ row }"
>
<el-button
link
type=
"info"
@
click=
"handleEdit(row)"
>
{{
$t
(
'
course
.controlsEditName'
)
}}
</el-button>
>
{{
$t
(
'
block
.controlsEditName'
)
}}
</el-button>
<el-button
link
type=
"info"
@
click=
"handleDel(row)"
>
{{
$t
(
'course.controlsDelName'
)
}}
</el-button>
>
{{
$t
(
'block.controlsDelName'
)
}}
</el-button>
<el-button
link
type=
"text"
@
click=
"handleDisplay(row)"
:style=
"
{ color:'#00FF00' }"
v-if="!row.visible"
>
{{
$t
(
'block.controlsDisplayName'
)
}}
</el-button>
<el-button
link
type=
"text"
@
click=
"handleHide(row)"
:style=
"
{ color:'#FF0000' }"
v-if="row.visible"
>
{{
$t
(
'block.controlsHideName'
)
}}
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -125,7 +150,7 @@
<
script
setup
name=
"ruleManager"
>
import
{
useTableHeight
}
from
'@/hooks/useTableHeight'
// 导入api接口
import
{
getBuildingBlockList
,
getBuildingBlockLists
,
addBuildingBlock
,
editBuildingBlock
,
delBuildingBlock
}
from
'@/api/legao/block'
import
{
getBuildingBlockList
,
getBuildingBlockLists
,
addBuildingBlock
,
editBuildingBlock
,
delBuildingBlock
,
displayBuildingBlock
,
batchDisplayBuildingBlock
,
hideBuildingBlock
,
batchHideBuildingBlock
}
from
'@/api/legao/block'
import
{
reactive
,
toRefs
}
from
'vue'
;
const
{
windowSize
}
=
useTableHeight
(
'max-height'
)
// 导入字典
...
...
@@ -164,7 +189,9 @@ const data = reactive({
ossId
:
[{
required
:
true
,
message
:
"图片不能为空"
,
trigger
:
"blur"
}]
}
})
const
ids
=
ref
([]);
const
single
=
ref
(
true
);
const
multiple
=
ref
(
true
);
const
{
status
,
queryParams
,
total
,
list
,
showForm
,
rules
,
blockLists
}
=
toRefs
(
data
)
...
...
@@ -246,4 +273,56 @@ function closeDialog() {
form
:
{}
}
}
/** 选择条数 */
function
handleSelectionChange
(
selection
)
{
ids
.
value
=
selection
.
map
(
item
=>
item
.
id
);
single
.
value
=
selection
.
length
!=
1
;
multiple
.
value
=
!
selection
.
length
;
}
function
handleDisplay
(
row
)
{
proxy
.
$modal
.
confirm
(
`确认显示该课程吗?`
).
then
(()
=>
{
return
displayBuildingBlock
(
row
.
id
);
}).
then
(()
=>
{
getList
();
proxy
.
$modal
.
msgSuccess
(
res
.
msg
);
}).
finally
(()
=>
{
});
}
function
handleBatchDisplay
(
row
)
{
const
buildingBlockIds
=
row
.
id
||
ids
.
value
;
proxy
.
$modal
.
confirm
(
`您已选择`
+
buildingBlockIds
.
length
+
`项内容,确认执行批量显示操作吗?`
).
then
(()
=>
{
return
batchDisplayBuildingBlock
(
buildingBlockIds
);
}).
then
(()
=>
{
getList
();
proxy
.
$modal
.
msgSuccess
(
res
.
msg
);
}).
finally
(()
=>
{
});
}
function
handleHide
(
row
)
{
proxy
.
$modal
.
confirm
(
`确认隐藏该课程吗?隐藏后APP端将不可见。`
).
then
(()
=>
{
return
hideBuildingBlock
(
row
.
id
);
}).
then
(()
=>
{
getList
();
proxy
.
$modal
.
msgSuccess
(
res
.
msg
);
}).
finally
(()
=>
{
});
}
function
handleBatchHide
(
row
)
{
const
buildingBlockIds
=
row
.
id
||
ids
.
value
;
proxy
.
$modal
.
confirm
(
`您已选择`
+
buildingBlockIds
.
length
+
`项内容,确认执行批量隐藏操作吗?`
).
then
(()
=>
{
return
batchHideBuildingBlock
(
buildingBlockIds
);
}).
then
(()
=>
{
getList
();
proxy
.
$modal
.
msgSuccess
(
res
.
msg
);
}).
finally
(()
=>
{
});
}
</
script
>
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment