Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
shop-vite-main
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
front-base-project
shop-vite-main
Commits
643495bc
提交
643495bc
authored
12月 19, 2024
作者:
郁骅焌
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
公告
上级
fb93521c
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
432 行增加
和
1 行删除
+432
-1
components.d.ts
library/build/unplugin/components.d.ts
+1
-0
noticeManagement.ts
src/api/noticeManagement.ts
+44
-0
index.vue
src/views/system/configManagement/index.vue
+1
-1
index.vue
src/views/system/noticeManagement/index.vue
+257
-0
NoticeManagementEdit.vue
...ticeManagement/vabAutoComponents/NoticeManagementEdit.vue
+129
-0
没有找到文件。
library/build/unplugin/components.d.ts
浏览文件 @
643495bc
...
@@ -148,6 +148,7 @@ declare module 'vue' {
...
@@ -148,6 +148,7 @@ declare module 'vue' {
MenuManagementEdit
:
typeof
import
(
'./../../../src/views/setting/menuManagement/vabAutoComponents/MenuManagementEdit.vue'
)[
'default'
]
MenuManagementEdit
:
typeof
import
(
'./../../../src/views/setting/menuManagement/vabAutoComponents/MenuManagementEdit.vue'
)[
'default'
]
MenuManagementEdit2
:
typeof
import
(
'./../../../src/views/system/menuManagement/vabAutoComponents/MenuManagementEdit2.vue'
)[
'default'
]
MenuManagementEdit2
:
typeof
import
(
'./../../../src/views/system/menuManagement/vabAutoComponents/MenuManagementEdit2.vue'
)[
'default'
]
NodePanel
:
typeof
import
(
'./../../../src/views/other/workflow/vabAutoComponents/lFComponents/NodePanel.vue'
)[
'default'
]
NodePanel
:
typeof
import
(
'./../../../src/views/other/workflow/vabAutoComponents/lFComponents/NodePanel.vue'
)[
'default'
]
NoticeManagementEdit
:
typeof
import
(
'./../../../src/views/system/noticeManagement/vabAutoComponents/NoticeManagementEdit.vue'
)[
'default'
]
PageHeader
:
typeof
import
(
'./../../../src/views/index/vabAutoComponents/PageHeader.vue'
)[
'default'
]
PageHeader
:
typeof
import
(
'./../../../src/views/index/vabAutoComponents/PageHeader.vue'
)[
'default'
]
Pending
:
typeof
import
(
'./../../../src/views/index/vabAutoComponents/Pending.vue'
)[
'default'
]
Pending
:
typeof
import
(
'./../../../src/views/index/vabAutoComponents/Pending.vue'
)[
'default'
]
PortalDivider
:
typeof
import
(
'./../../../src/views/portal/vabAutoComponents/PortalDivider.vue'
)[
'default'
]
PortalDivider
:
typeof
import
(
'./../../../src/views/portal/vabAutoComponents/PortalDivider.vue'
)[
'default'
]
...
...
src/api/noticeManagement.ts
0 → 100755
浏览文件 @
643495bc
import
request
from
'/@/utils/request'
/** 查询公告列表 */
export
function
getList
(
params
?:
any
)
{
return
request
({
url
:
'/system/notice/list'
,
method
:
'get'
,
params
,
})
}
/** 新增公告 */
export
const
doAdd
=
(
data
:
any
)
=>
{
return
request
({
url
:
'/system/notice'
,
method
:
'post'
,
data
,
})
}
/** 修改公告 */
export
const
doEdit
=
(
data
:
any
)
=>
{
return
request
({
url
:
'/system/notice'
,
method
:
'put'
,
data
,
})
}
/** 删除公告 */
export
const
doDelete
=
(
noticeId
:
any
)
=>
{
return
request
({
url
:
`/system/notice/
${
noticeId
}
`
,
method
:
'delete'
,
})
}
/** 查询公告详细 */
export
function
getNotice
(
noticeId
:
any
)
{
return
request
({
url
:
`/system/notice/
${
noticeId
}
`
,
method
:
'get'
,
})
}
src/views/system/configManagement/index.vue
浏览文件 @
643495bc
<
template
>
<
template
>
<div
class=
"
xxx
-container auto-height-container"
:class=
"
{ 'fullscreen-container': isFullscreen }">
<div
class=
"
configManagement
-container auto-height-container"
:class=
"
{ 'fullscreen-container': isFullscreen }">
<vab-query-form>
<vab-query-form>
<vab-query-form-top-panel>
<vab-query-form-top-panel>
<el-form
ref=
"queryRef"
inline
label-width=
"70px"
:model=
"queryForm"
@
submit
.
prevent
>
<el-form
ref=
"queryRef"
inline
label-width=
"70px"
:model=
"queryForm"
@
submit
.
prevent
>
...
...
src/views/system/noticeManagement/index.vue
0 → 100644
浏览文件 @
643495bc
<
template
>
<div
class=
"noticeManagement-container auto-height-container"
:class=
"
{ 'fullscreen-container': isFullscreen }">
<vab-query-form>
<vab-query-form-top-panel>
<el-form
ref=
"queryRef"
inline
label-width=
"70px"
:model=
"queryForm"
@
submit
.
prevent
>
<el-form-item
label=
"公告标题"
prop=
"noticeTitle"
>
<el-input
v-model=
"queryForm.noticeTitle"
clearable
placeholder=
"请输入公告标题"
style=
"width: 200px"
@
keyup
.
enter=
"handleQuery"
/>
</el-form-item>
<el-form-item
v-show=
"!fold"
label=
"操作人员"
prop=
"createBy"
>
<el-input
v-model=
"queryForm.createBy"
clearable
placeholder=
"请输入操作人员"
style=
"width: 200px"
@
keyup
.
enter=
"handleQuery"
/>
</el-form-item>
<el-form-item
v-show=
"!fold"
label=
"类型"
prop=
"noticeType"
>
<el-select
v-model=
"queryForm.noticeType"
clearable
placeholder=
"公告类型"
style=
"width: 200px"
>
<el-option
v-for=
"dict in sys_notice_type"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
icon=
"Search"
:loading=
"listLoading"
native-type=
"submit"
type=
"primary"
@
click=
"handleQuery"
>
查询
</el-button>
<el-button
icon=
"Refresh"
@
click=
"resetQuery"
>
重置
</el-button>
<el-button
class=
"hidden-xs-only"
text
type=
"primary"
@
click=
"handleFold"
>
<span
v-if=
"fold"
>
展开
</span>
<span
v-else
>
合并
</span>
<vab-icon
class=
"vab-dropdown"
:class=
"
{ 'vab-dropdown-active': fold }" icon="arrow-up-s-line" />
</el-button>
</el-form-item>
</el-form>
</vab-query-form-top-panel>
<vab-query-form-left-panel>
<el-button
icon=
"Plus"
type=
"primary"
@
click=
"handleAdd"
>
添加
</el-button>
<el-button
icon=
"Delete"
type=
"danger"
@
click=
"handleDelete"
>
删除
</el-button>
</vab-query-form-left-panel>
<vab-query-form-right-panel>
<div
class=
"custom-table-right-tools"
>
<el-button
@
click=
"handleQuery"
>
<vab-icon
icon=
"refresh-line"
/>
</el-button>
<el-button
@
click=
"clickFullScreen"
>
<vab-icon
:icon=
"isFullscreen ? 'fullscreen-exit-fill' : 'fullscreen-fill'"
/>
</el-button>
<el-popover
popper-class=
"custom-table-checkbox"
>
<template
#
reference
>
<el-button>
<vab-icon
icon=
"settings-line"
/>
</el-button>
</
template
>
<vab-draggable
v-model=
"columns"
:animation=
"600"
target=
".el-checkbox-group"
>
<el-checkbox-group
v-model=
"checkList"
>
<el-checkbox
v-for=
"item in columns"
:key=
"item.label"
:disabled=
"item.disableCheck"
:label=
"item.label"
:value=
"item.label"
>
{{ item.label }}
</el-checkbox>
</el-checkbox-group>
</vab-draggable>
</el-popover>
</div>
</vab-query-form-right-panel>
</vab-query-form>
<el-table
ref=
"tableRef"
v-loading=
"listLoading"
border
:data=
"list"
@
selection-change=
"setSelectRows"
>
<el-table-column
align=
"center"
type=
"selection"
width=
"50"
/>
<el-table-column
v-for=
"(item, index) in finallyColumns"
:key=
"index"
align=
"center"
:fixed=
"item.fixed"
:label=
"item.label"
:min-width=
"item.minWidth || 160"
:prop=
"item.prop"
show-overflow-tooltip
:sortable=
"item.sortable"
>
<
template
#
default=
"scope"
>
<span
v-if=
"item.label === '状态'"
>
<dict-tag
:options=
"sys_notice_status"
:value=
"scope.row.status"
/>
</span>
<span
v-else-if=
"item.label === '公告类型'"
>
<dict-tag
:options=
"sys_notice_type"
:value=
"scope.row.noticeType"
/>
</span>
<span
v-else
>
{{
scope
.
row
[
item
.
prop
]
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
fixed=
"right"
label=
"操作"
min-width=
"160"
>
<
template
#
default=
"scope"
>
<el-button
icon=
"Edit"
link
type=
"primary"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
<el-button
icon=
"Delete"
link
type=
"primary"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</
template
>
</el-table-column>
<
template
#
empty
>
<el-empty
class=
"vab-data-empty"
description=
"暂无数据"
/>
</
template
>
</el-table>
<vab-pagination
:current-page=
"queryForm.pageNum"
:page-size=
"queryForm.pageSize"
:total=
"total"
@
current-change=
"handleCurrentChange"
@
size-change=
"handleSizeChange"
/>
<notice-management-edit
ref=
"editRef"
@
fetch-data=
"fetchData"
/>
</div>
</template>
<
script
lang=
"ts"
setup
>
import
type
{
TableInstance
}
from
'element-plus'
import
{
VueDraggable
as
VabDraggable
}
from
'vue-draggable-plus'
import
{
doDelete
,
getList
}
from
'/@/api/noticeManagement'
defineOptions
({
name
:
'NoticeManagement'
,
})
const
{
proxy
}
=
getCurrentInstance
()
as
any
const
{
sys_notice_type
,
sys_notice_status
}
=
proxy
.
useDict
(
'sys_notice_type'
,
'sys_notice_status'
)
const
{
exit
,
enter
,
isFullscreen
:
_isFullscreen
}
=
useFullscreen
()
const
isFullscreen
=
ref
<
boolean
>
(
false
)
const
fold
=
ref
<
boolean
>
(
true
)
const
tableRef
=
ref
<
TableInstance
>
()
const
editRef
=
ref
<
any
>
(
null
)
const
list
=
ref
<
any
>
([])
const
listLoading
=
ref
<
boolean
>
(
true
)
const
total
=
ref
<
number
>
(
0
)
const
selectRows
=
ref
<
any
>
([])
const
checkList
=
ref
<
any
>
([])
const
queryForm
=
reactive
<
any
>
({
pageNum
:
1
,
pageSize
:
10
,
noticeTitle
:
undefined
,
createBy
:
undefined
,
status
:
undefined
,
})
const
columns
=
ref
<
any
>
([
{
label
:
'序号'
,
prop
:
'noticeId'
,
minWidth
:
50
,
checked
:
true
},
{
label
:
'公告标题'
,
prop
:
'noticeTitle'
,
minWidth
:
200
,
checked
:
true
},
{
label
:
'公告类型'
,
prop
:
'noticeType'
,
minWidth
:
100
,
checked
:
true
},
{
label
:
'状态'
,
prop
:
'status'
,
minWidth
:
120
,
checked
:
true
},
{
label
:
'创建者'
,
prop
:
'createBy'
,
minWidth
:
120
,
checked
:
true
},
{
label
:
'创建时间'
,
prop
:
'createTime'
,
minWidth
:
160
,
checked
:
true
},
])
const
finallyColumns
=
computed
(()
=>
columns
.
value
.
filter
((
item
:
any
)
=>
checkList
.
value
.
includes
(
item
.
label
)))
watch
(
_isFullscreen
,
()
=>
{
if
(
_isFullscreen
.
value
)
isFullscreen
.
value
=
true
else
isFullscreen
.
value
=
false
},
{
immediate
:
true
}
)
onActivated
(()
=>
{
tableRef
.
value
?.
doLayout
()
})
onBeforeMount
(()
=>
{
columns
.
value
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
checked
)
checkList
.
value
.
push
(
item
.
label
)
})
fetchData
()
})
/** 点击全屏 */
const
clickFullScreen
=
()
=>
{
isFullscreen
.
value
=
!
isFullscreen
.
value
isFullscreen
.
value
?
enter
()
:
exit
()
}
/** 搜索条件折叠 */
const
handleFold
=
()
=>
{
fold
.
value
=
!
fold
.
value
}
/** 查询用户列表 */
const
fetchData
=
async
()
=>
{
listLoading
.
value
=
true
const
pp
=
Object
.
assign
({},
queryForm
)
const
{
rows
,
total
:
_total
}
=
(
await
getList
(
pp
))
as
any
list
.
value
=
rows
total
.
value
=
_total
listLoading
.
value
=
false
}
/** 搜索按钮操作 */
function
handleQuery
()
{
queryForm
.
pageNum
=
1
fetchData
()
}
/** 重置按钮操作 */
function
resetQuery
()
{
proxy
.
resetForm
(
'queryRef'
)
handleQuery
()
}
const
handleSizeChange
=
(
value
:
number
)
=>
{
queryForm
.
pageNum
=
1
queryForm
.
pageSize
=
value
fetchData
()
}
const
handleCurrentChange
=
(
value
:
number
)
=>
{
queryForm
.
pageNum
=
value
fetchData
()
}
const
setSelectRows
=
(
value
:
string
)
=>
{
selectRows
.
value
=
value
}
/** 新增按钮操作 */
const
handleAdd
=
()
=>
{
editRef
.
value
.
showEdit
()
}
/** 修改按钮操作 */
function
handleUpdate
(
row
:
any
)
{
editRef
.
value
.
showEdit
(
row
)
}
/** 删除按钮操作 */
const
handleDelete
=
(
row
:
any
=
{})
=>
{
if
(
row
.
noticeId
)
{
$baseConfirm
(
`您确定要删除公告编号为“
${
row
.
noticeId
}
”的数据项吗`
,
null
,
async
()
=>
{
const
{
msg
}:
any
=
await
doDelete
(
row
.
noticeId
)
$baseMessage
(
msg
,
'success'
,
'hey'
)
await
fetchData
()
})
}
else
{
if
(
selectRows
.
value
.
length
>
0
)
{
const
ids
=
selectRows
.
value
.
map
((
item
:
{
noticeId
:
any
})
=>
item
.
noticeId
)
$baseConfirm
(
'您确定要删除选中项吗'
,
null
,
async
()
=>
{
const
{
msg
}:
any
=
await
doDelete
(
ids
)
$baseMessage
(
msg
,
'success'
,
'hey'
)
await
fetchData
()
})
}
else
{
$baseMessage
(
'您未选中任何行'
,
'warning'
,
'hey'
)
}
}
}
</
script
>
src/views/system/noticeManagement/vabAutoComponents/NoticeManagementEdit.vue
0 → 100644
浏览文件 @
643495bc
<
template
>
<vab-dialog
v-model=
"dialogFormVisible"
append-to-body
:title=
"title"
width=
"780px"
@
close=
"close"
>
<el-form
ref=
"formRef"
label-width=
"80px"
:model=
"form"
:rules=
"rules"
>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"公告标题"
prop=
"noticeTitle"
>
<el-input
v-model=
"form.noticeTitle"
placeholder=
"请输入公告标题"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"公告类型"
prop=
"noticeType"
>
<el-select
v-model=
"form.noticeType"
placeholder=
"请选择"
>
<el-option
v-for=
"dict in sys_notice_type"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"24"
>
<el-form-item
label=
"状态"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio
v-for=
"dict in sys_notice_status"
:key=
"dict.value"
:value=
"dict.value"
>
{{
dict
.
label
}}
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col
:span=
"24"
>
<el-form-item
label=
"内容"
>
<editor
v-model=
"form.noticeContent"
:min-height=
"192"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template
#
footer
>
<el-button
type=
"primary"
@
click=
"save"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</
template
>
</vab-dialog>
</template>
<
script
lang=
"ts"
setup
>
import
type
{
FormInstance
}
from
'element-plus'
import
{
doAdd
,
doEdit
,
getNotice
}
from
'/@/api/noticeManagement'
defineOptions
({
name
:
'NoticeManagementEdit'
,
})
const
{
proxy
}
=
getCurrentInstance
()
as
any
const
{
sys_notice_type
,
sys_notice_status
}
=
proxy
.
useDict
(
'sys_notice_type'
,
'sys_notice_status'
)
const
emit
=
defineEmits
([
'fetch-data'
])
const
formRef
=
ref
<
FormInstance
>
()
const
form
=
ref
<
any
>
({
noticeId
:
undefined
,
noticeTitle
:
undefined
,
noticeType
:
undefined
,
noticeContent
:
undefined
,
status
:
'0'
,
})
const
rules
=
reactive
<
any
>
({
noticeTitle
:
[{
required
:
true
,
message
:
'公告标题不能为空'
,
trigger
:
'blur'
}],
noticeType
:
[{
required
:
true
,
message
:
'公告类型不能为空'
,
trigger
:
'change'
}],
})
const
title
=
ref
<
string
>
(
''
)
const
dialogFormVisible
=
ref
<
boolean
>
(
false
)
const
showEdit
=
(
row
?:
any
)
=>
{
reset
()
if
(
row
&&
row
.
noticeId
)
{
title
.
value
=
'编辑'
getNotice
(
row
.
noticeId
).
then
((
response
:
any
)
=>
{
form
.
value
=
response
.
data
dialogFormVisible
.
value
=
true
})
}
else
{
title
.
value
=
'添加'
dialogFormVisible
.
value
=
true
}
}
/** 表单重置 */
function
reset
()
{
form
.
value
=
{
noticeId
:
undefined
,
noticeTitle
:
undefined
,
noticeType
:
undefined
,
noticeContent
:
undefined
,
status
:
'0'
,
}
proxy
.
resetForm
(
'formRef'
)
}
const
close
=
()
=>
{
formRef
.
value
?.
clearValidate
()
formRef
.
value
?.
resetFields
()
emit
(
'fetch-data'
)
}
const
cancel
=
()
=>
{
close
()
dialogFormVisible
.
value
=
false
}
const
save
=
()
=>
{
formRef
.
value
?.
validate
(
async
(
valid
:
any
)
=>
{
if
(
valid
)
{
if
(
form
.
value
.
noticeId
)
{
await
doEdit
(
form
.
value
)
await
$baseMessage
(
'修改成功'
,
'success'
,
'hey'
)
}
else
{
await
doAdd
(
form
.
value
)
await
$baseMessage
(
'添加成功'
,
'success'
,
'hey'
)
}
cancel
()
}
})
}
defineExpose
({
showEdit
,
})
</
script
>
<
style
lang=
"scss"
scoped
>
:deep
()
{
.el-select
{
width
:
100%
;
}
}
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论