This commit is contained in:
那些花儿
2025-09-05 17:55:22 +08:00
parent 91be38bb52
commit a5bdaca670
7 changed files with 457 additions and 123 deletions
@@ -1,5 +1,6 @@
package com.budwk.app.zhgh.democratic.suggestionBox.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
@@ -43,6 +44,14 @@ public class SuggestionBoxMineController {
}
@At(value = "/platform/h5/suggestionBox/mine",top = true)
@Ok("beetl:/platform/zhghh5/democratic/suggestionBox/mine/index.html")
@SaCheckLogin
public void h5Index(){
}
@At
@SaCheckPermission("suggestionBox.mine")
public Result pageData(Integer pageNumber, Integer pageSize, String title, Integer year) {
@@ -46,9 +46,10 @@ public class SuggestionBoxWriteController {
}
@At("")
@At(value = "/platform/h5/suggestionBox/write",top = true)
@Ok("beetl:/platform/zhghh5/democratic/suggestionBox/write/index.html")
@SaCheckPermission("h5.suggestionBox.write")
// @SaCheckPermission("h5.suggestionBox.write")
@SaCheckLogin
public void h5Index(){
}
@@ -104,8 +104,8 @@ body {
font-size: 15px;
color: var(--color-black);
font-weight: 600;
margin: 10px 0 10px 0!important;
padding:10px;
margin: 10px 0 10px 0 !important;
padding: 10px;
position: relative;
line-height: 1.1;
font-family: inherit;
@@ -127,7 +127,7 @@ body {
background-color: unset;
}
.custom-list-loading .van-icon{
.custom-list-loading .van-icon {
font-size: 108px;
}
@@ -140,25 +140,25 @@ body {
box-sizing: border-box;
}
.list-card:not(:last-child){
.list-card:not(:last-child) {
margin-bottom: 10px;
}
.list-card-title{
.list-card-title {
font-weight: bolder;
}
.list-card-body{
.list-card-body {
display: flex;
}
.list-card-body-img{
.list-card-body-img {
flex: 0 0 auto;
width: 130px;
height: 90px;
}
.list-card-body-img img{
.list-card-body-img img {
width: 100%;
height: 100%;
border-radius: 5px;
@@ -166,12 +166,12 @@ body {
}
.list-card-body-content{
.list-card-body-content {
flex: 1;
}
.list-card-footer{
.list-card-footer {
display: flex;
justify-content: flex-end;
gap: 10px;
@@ -179,10 +179,138 @@ body {
flex-wrap: wrap;
}
.list-card-footer .van-button{
.list-card-footer .van-button {
}
/*****************************列表list css********************************/
.table-list-container {
padding: 0;
}
.table-list-container .table-list-item {
background-color: #fff;
border-bottom: 1px solid #eaecef;
padding: 16px;
position: relative;
margin-bottom: 10px;
}
.table-list-container .table-list-item:last-child {
border-bottom: none;
}
.table-list-container .table-list-item .item-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 10px;
}
.table-list-container .table-list-item .item-title {
font-size: 16px;
font-weight: 500;
color: #1f2f3d;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
padding-right: 10px;
}
.table-list-container .table-list-item .item-meta {
display: flex;
color: #606266;
font-size: 14px;
margin-bottom: 5px;
padding: 4px 0;
}
.table-list-container .table-list-item .meta-item {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
}
.table-list-container .table-list-item .meta-item i {
font-size: 14px;
color: #909399;
width: 16px;
text-align: center;
}
.table-list-container .table-list-item .item-content {
color: #606266;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
line-height: 1.5;
}
.table-list-container .table-list-item .item-footer {
display: flex;
justify-content: space-between;
margin-top: 12px;
padding-top: 8px;
border-top: 1px dashed #eaecef;
color: #909399;
font-size: 13px;
}
.table-list-container .table-list-item .item-actions {
display: flex;
column-gap: 20px;
justify-content: end;
margin-top: 15px;
padding-top: 12px;
border-top: 1px solid #eaecef;
}
.table-list-container .table-list-item .action-btn {
display: flex;
align-items: center;
justify-content: end;
font-size: 14px;
color: var(--color-primary);
padding: 4px 0;
}
.table-list-container .table-list-item .action-btn i {
margin-right: 6px;
font-size: 16px;
}
.table-list-container .table-list-item .action-btn.delete {
color: #ff0000;
}
.table-list-container .table-list-item .action-btn.review {
color: #67c23a;
}
.table-list-container .empty-state {
text-align: center;
padding: 60px 20px;
color: #909399;
}
.table-list-container .empty-state i {
font-size: 60px;
margin-bottom: 16px;
color: #dcdee0;
}
.table-list-container .empty-state p {
margin-top: 10px;
font-size: 14px;
}
/*****************************申请表单CSS********************************/
.form-container {
padding-bottom: 80px;
@@ -365,6 +365,7 @@
Vue.component("year-van-dropdown-item", httpVueLoader("/components/plugins/vantMore/yearVanDropDownItem.vue?v=" + new Date().getTime()))
Vue.component("van-text-dialog", httpVueLoader("/components/plugins/vantMore/vantTextDialog.vue?v=" + new Date().getTime()))
Vue.component("enum-tag", httpVueLoader("/components/plugins/sysEnum/EnumTag.vue?v=" + new Date().getTime()))
Vue.component("h5-table-list", httpVueLoader("/components/plugins/h5/h5TableList.vue?v=" + new Date().getTime()))
</script>
</head>
<body>
@@ -3,80 +3,7 @@ layout("/layouts/platform_h5.html"){
#-->
<style>
/*.page-container {*/
/* background-color: #ffffff;*/
/* min-height: 100vh;*/
/* padding-bottom: 80px;*/
/*}*/
/*.form-group {*/
/* margin-bottom: 12px;*/
/*}*/
/*.form-actions {*/
/* position: fixed;*/
/* bottom: 0;*/
/* left: 0;*/
/* right: 0;*/
/* display: flex;*/
/* justify-content: space-around;*/
/* padding: 12px 16px;*/
/* background-color: #ffffff;*/
/* box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);*/
/* z-index: 100;*/
/*}*/
/*.form-actions .van-button {*/
/* flex: 1;*/
/* margin: 0 8px;*/
/* border-radius: 4px;*/
/* height: 40px;*/
/* font-size: 15px;*/
/*}*/
/*.notice-dialog-content {*/
/* max-height: 60vh;*/
/* overflow-y: auto;*/
/*}*/
/*.van-cell-group {*/
/* margin-bottom: 12px;*/
/* overflow: hidden;*/
/*}*/
/*.van-cell-group__title {*/
/* padding: 12px 16px 8px;*/
/* font-size: 15px;*/
/* color: #323233;*/
/* font-weight: bold;*/
/*}*/
/*.van-field__label {*/
/* width: 90px;*/
/* color: #323233;*/
/* font-size: 14px;*/
/*}*/
/*.van-field__value {*/
/* color: #323233;*/
/*}*/
/*.van-cell {*/
/* padding: 12px 16px;*/
/*}*/
/*.van-cell:not(:last-child)::after {*/
/* left: 16px;*/
/* right: 16px;*/
/*}*/
/*.direction-column-field .van-field__body {*/
/* display: block;*/
/*}*/
/*.direction-column-field .van-field__control {*/
/* margin-top: 8px;*/
/*}*/
</style>
<div id="app" v-cloak>
@@ -0,0 +1,274 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style>
/*.list-container {*/
/* padding: 0;*/
/*}*/
/*.list-item {*/
/* background-color: #fff;*/
/* border-bottom: 1px solid #eaecef;*/
/* padding: 16px;*/
/* position: relative;*/
/* margin-bottom: 10px;*/
/*}*/
/*.list-item:last-child {*/
/* border-bottom: none;*/
/*}*/
/*.item-header {*/
/* display: flex;*/
/* justify-content: space-between;*/
/* align-items: flex-start;*/
/* margin-bottom: 10px;*/
/*}*/
/*.item-title {*/
/* font-size: 16px;*/
/* font-weight: 500;*/
/* color: #1f2f3d;*/
/* overflow: hidden;*/
/* text-overflow: ellipsis;*/
/* white-space: nowrap;*/
/* flex: 1;*/
/* padding-right: 10px;*/
/*}*/
/*.item-meta {*/
/* display: flex;*/
/* color: #606266;*/
/* font-size: 14px;*/
/* margin-bottom: 5px;*/
/* padding: 4px 0;*/
/*}*/
/*.meta-item {*/
/* display: flex;*/
/* align-items: center;*/
/* gap: 8px;*/
/* width: 100%;*/
/*}*/
/*.meta-item i {*/
/* font-size: 14px;*/
/* color: #909399;*/
/* width: 16px;*/
/* text-align: center;*/
/*}*/
/*.item-content {*/
/* color: #606266;*/
/* font-size: 14px;*/
/* overflow: hidden;*/
/* text-overflow: ellipsis;*/
/* display: -webkit-box;*/
/* -webkit-line-clamp: 2;*/
/* -webkit-box-orient: vertical;*/
/* line-height: 1.5;*/
/*}*/
/*.item-footer {*/
/* display: flex;*/
/* justify-content: space-between;*/
/* margin-top: 12px;*/
/* padding-top: 8px;*/
/* border-top: 1px dashed #eaecef;*/
/* color: #909399;*/
/* font-size: 13px;*/
/*}*/
/*.item-actions {*/
/* display: flex;*/
/* justify-content: space-around;*/
/* margin-top: 15px;*/
/* padding-top: 12px;*/
/* border-top: 1px solid #eaecef;*/
/*}*/
/*.action-btn {*/
/* display: flex;*/
/* align-items: center;*/
/* justify-content: end;*/
/* font-size: 14px;*/
/* color: var(--color-primary);*/
/* padding: 4px 0;*/
/* flex: 1;*/
/*}*/
/*.action-btn i {*/
/* margin-right: 6px;*/
/* font-size: 16px;*/
/*}*/
/*.action-btn.delete {*/
/* color: #f56c6c;*/
/*}*/
/*.action-btn.review {*/
/* color: #67c23a;*/
/*}*/
/*.empty-state {*/
/* text-align: center;*/
/* padding: 60px 20px;*/
/* color: #909399;*/
/*}*/
/*.empty-state i {*/
/* font-size: 60px;*/
/* margin-bottom: 16px;*/
/* color: #dcdee0;*/
/*}*/
/*.empty-state p {*/
/* margin-top: 10px;*/
/* font-size: 14px;*/
/*}*/
</style>
<div id="app" v-cloak>
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="我的建言献策" placeholder
fixed></van-nav-bar>
<van-pull-refresh v-model="tableRefreshing" @refresh="doSearch" style="min-height: calc(100vh - 90px)">
<van-list v-if="tableData && tableData.length>0" v-model="tableLoading" :finished="tableFinished"
finished-text="" @load="pageData">
<div class="table-list-container">
<div v-if="tableData.length === 0" class="empty-state">
<i class="fa fa-file-alt"></i>
</div>
<div v-for="(item, index) in tableData" :key="index" class="table-list-item">
<div class="item-header" @click="viewDetail(item)">
<div class="item-title">{{ item.title || '无标题' }}</div>
<enum-tag :value="item.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</div>
<div class="item-meta" @click="viewDetail(item)">
<div class="meta-item">
<span><span>申请人:</span>{{ item.userName || '未知' }}</span>
</div>
</div>
<div class="item-meta" @click="viewDetail(item)">
<div class="meta-item">
<span><span>所属单位:</span>{{ item.unitName || '未知' }}</span>
</div>
</div>
<div class="item-meta" @click="viewDetail(item)">
<div class="meta-item">
<span><span>申请时间:</span>{{ item.submitTime || '未知' }}</span>
</div>
</div>
<div class="item-meta" @click="viewDetail(item)">
<div class="meta-item">
<span><span>当前节点:</span>{{ item.taskName || '未知' }}</span>
</div>
</div>
<div class="item-actions">
<div class="action-btn" @click="viewDetail(item)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn" v-if="item.taskKey === 'startTask' || !item.instanceId" @click="onEdit(item)">
<i class="fa fa-edit"></i>
<span>编辑</span>
</div>
<div class="action-btn delete" v-if="item.canRevoke" @click="onRevoke(item)">
<i class="fa fa-undo"></i>
<span>撤回</span>
</div>
<div class="action-btn delete" v-if="item.taskKey === 'startTask' || !item.instanceId" @click="onDelete(item)">
<i class="fa fa-trash"></i>
<span>删除</span>
</div>
</div>
</div>
</div>
</van-list>
</van-pull-refresh>
</div>
<script>
new Vue({
el: '#app',
store,
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
sessionId: null
},
tableData: [],
tableLoading: false,
tableFinished: false,
tableRefreshing: false,
}
},
methods: {
doSearch() {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.tableData = []
this.pageData()
},
pageData() {
$.post('/platform/suggestionBox/mine/pageData', this.pageForm).then((res) => {
if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list)
this.pageForm.totalCount = res.data.totalCount
if (this.tableData.length >= this.pageForm.totalCount) {
this.tableFinished = true
} else {
this.pageForm.pageNumber++
}
this.tableLoading = false
}
})
},
// 查看详情
viewDetail(item) {
window.location.href = '/platform/suggestionBox/detail?id=' + item.id
},
// 审核
reviewItem(item) {
window.location.href = '/platform/suggestionBox/review?id=' + item.id
},
// 删除
deleteItem(item) {
this.$dialog.confirm({
title: '提示',
message: '确定要删除该条建言献策吗?',
}).then(() => {
this.$axios.post('/platform/suggestionBox/delete', {id: item.id}).then(res => {
if (res.code === 0) {
this.$toast.success('删除成功');
this.doSearch();
}
})
}).catch(() => {
// 取消操作
});
},
// 判断是否可以审核
canReview(item) {
// 根据实际业务逻辑判断是否显示审核按钮
// 例如:只有特定状态或当前用户有权限时才显示
return item.instanceState === 'RUNNING' && this.$store.state.user.permissions.includes('suggestion:review');
},
// 判断是否可以删除
canDelete(item) {
// 根据实际业务逻辑判断是否显示删除按钮
// 例如:只有草稿状态或当前用户是创建者时才可删除
return item.instanceState === 'DRAFT' ||
(item.submitterId === this.$store.state.user.id && item.instanceState !== 'COMPLETED');
},
historyBack() {
window.history.back();
}
},
created() {
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -4,13 +4,13 @@ layout("/layouts/platform_h5.html"){
<div id="app" v-cloak>
<van-nav-bar title="填写建言献策" left-text="返回" left-arrow @click-left="historyBack" placeholder fixed></van-nav-bar>
<div class="container">
<van-form @submit="onSubmit">
<van-cell-group inset>
<van-field v-model="formData.userName" label="姓名" readonly />
<van-field v-model="formData.loginName" label="工号" readonly />
<van-field v-model="formData.unitName" label="单位" readonly />
<van-field v-model="formData.unionName" label="工会" readonly />
<div class="form-container">
<van-form ref="formRef">
<van-cell-group title="基本信息">
<van-field v-model="formData.userName" label="姓名" readonly></van-field>
<van-field v-model="formData.loginName" label="工号" readonly></van-field>
<van-field v-model="formData.unitName" label="单位" readonly></van-field>
<van-field v-model="formData.unionName" label="工会" readonly></van-field>
<van-field
v-model="formData.title"
name="title"
@@ -19,7 +19,7 @@ layout("/layouts/platform_h5.html"){
:rules="[{ required: true, message: '请填写标题' }]"
maxlength="100"
show-word-limit
/>
></van-field>
<van-field
v-model="formData.content"
name="content"
@@ -30,18 +30,14 @@ layout("/layouts/platform_h5.html"){
maxlength="500"
show-word-limit
rows="5"
/>
></van-field>
</van-cell-group>
<div style="margin: 16px;">
<van-row gutter="20">
<van-col span="12">
<van-button round block type="info" plain @click="onSave">保存</van-button>
</van-col>
<van-col span="12">
<van-button v-if="!taskId" round block type="info" native-type="submit">提交</van-button>
<van-button v-else round block type="info" @click="onFinishTask">提交</van-button>
</van-col>
</van-row>
<!-- 按钮区域 -->
<div class="form-actions">
<van-button plain type="info" @click="onSave">保存</van-button>
<van-button type="primary" @click="onSubmit" v-if="!taskId">提交</van-button>
<van-button type="primary" @click="onSubmitAgain" v-else>提交</van-button>
</div>
</van-form>
</div>
@@ -64,22 +60,27 @@ layout("/layouts/platform_h5.html"){
},
methods: {
historyBack,
// 保存
onSave() {
async onSave() {
try{
await this.$refs.formRef.validate();
this.$dialog.confirm({
title: '提示',
message: '您确定保存吗?',
title: '提示',
message: '您确定保存吗?',
}).then(() => {
this.$axios.post('/platform/suggestionBox/write/save', {data: JSON.stringify(this.formData)}).then(res => {
if (res.code === 0) {
this.$toast.success("保存成功");
window.location.href = '/platform/suggestionBox/mine';
}
})
this.$axios.post('/platform/suggestionBox/write/save', {data: JSON.stringify(this.formData)}).then(res => {
if (res.code === 0) {
this.$toast.success("保存成功");
}
})
}).catch(() => {
// 取消操作
// 取消操作
});
}catch (e){
// 表单验证失败
console.log('表单验证失败', error);
}
},
// 提交
@@ -149,13 +150,6 @@ layout("/layouts/platform_h5.html"){
}
})
</script>
<style>
.container {
padding: 56px 0 20px;
}
</style>
<!--#
}
#-->