This commit is contained in:
=
2026-04-17 17:13:42 +08:00
parent 423cb1fd61
commit b1708d55a4
7 changed files with 639 additions and 194 deletions
@@ -57,6 +57,6 @@ public class SysUserAllRenewJob implements Job {
param.setUpdateMode(SysDataUpdateMode.ALL.name());
param.setConditionGroup(conditionGroup);
// sysDataUserUpdateService.update(param);
sysDataUserUpdateService.update(param);
}
}
@@ -60,19 +60,25 @@ public class ProposalPositiveSecondedController {
@At("")
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/positiveSeconded/index.html")
@SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR)
@SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR)
public void index() {
}
@At("/h5")
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/positiveSeconded/index.html")
@SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR)
@SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR)
public void h5Index() {
}
@At
@SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR)
@SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR)
public Result pageData(@Valid ProposalSearchParam pageForm, boolean approval) {
// 主动附议查询规则:
// 1. 受邀附议的提案不能出现在主动附议中;
// 2. 自己发起的提案不能出现在主动附议“未附议”中;
// 3. 主动附议“未附议”只展示:未被邀请、不是自己写、自己还没主动附议过的提案;
// 4. 主动附议“已附议”只展示:本人已经主动附议过的提案,不混入受邀附议记录;
// 5. 受邀附议识别同时兼容 proposal_second.mode=1 的新数据和 second 节点办理人的历史流程数据。
Sql sql = Sqls.create("""
SELECT
info.*,
@@ -104,7 +110,34 @@ public class ProposalPositiveSecondedController {
cnd.and("ps.seconderId", "=", SecurityUtil.getUserId());
cnd.and("ps.mode", "=", false);
cnd.and("ps.isAgree", "is not", null);
// 已附议列表也排除“被邀请附议”的提案,保证这里只展示主动附议记录。
cnd.and(new Static("info.id not in (select proposalId from proposal_second where seconderId = '%s' and mode = 1)".formatted(SecurityUtil.getUserId())));
cnd.and(new Static("""
info.id not in (
select ins2.businessNo
from wf_process_instance ins2
inner join wf_process_task t2 on t2.processInstanceId = ins2.id and t2.taskName = 'second'
inner join wf_process_task_actor ta2 on ta2.processTaskId = t2.id
where ta2.actorId = '%s'
)
""".formatted(SecurityUtil.getUserId())));
} else {
// 未附议列表中排除自己发起的提案,已附议列表保留本人已主动附议记录。
cnd.and("info.createdBy", "!=", SecurityUtil.getUserId());
// 主动附议列表只查询当前用户可主动附议的提案。
// 这里同时兼容两类受邀附议识别方式:
// 1. proposal_second.mode = 1 的新数据;
// 2. 流程中存在当前用户的 second 节点办理记录的历史数据。
cnd.and(new Static("info.id not in (select proposalId from proposal_second where seconderId = '%s' and mode = 1)".formatted(SecurityUtil.getUserId())));
cnd.and(new Static("""
info.id not in (
select ins2.businessNo
from wf_process_instance ins2
inner join wf_process_task t2 on t2.processInstanceId = ins2.id and t2.taskName = 'second'
inner join wf_process_task_actor ta2 on ta2.processTaskId = t2.id
where ta2.actorId = '%s'
)
""".formatted(SecurityUtil.getUserId())));
cnd.and(new Static("info.id not in (select proposalId from proposal_second where seconderId = '%s' and isAgree is not null)".formatted(SecurityUtil.getUserId())));
}
@@ -119,7 +152,7 @@ public class ProposalPositiveSecondedController {
@Aop(TransAop.READ_COMMITTED)
@ApiOperation("主动附议")
@SLog(tag = "提案管理系统-主动附议", msg = "主动附议")
@SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR)
@SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR)
public Result handle(@Param("proposalId") String proposalId,
@Param("opinion") String opinion,
@Param("submitType") Integer submitType) {
@@ -158,14 +191,14 @@ public class ProposalPositiveSecondedController {
}
@At
@SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR)
@SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR)
public Result listPositiveSeconded(String bizId) {
List<ProposalSecond> list = dao.query(ProposalSecond.class, Cnd.where(ProposalSecond::getProposalId, "=", bizId).and(ProposalSecond::getMode, "=", false));
return Result.success(list);
}
@At
@SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR)
@SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR)
public Result validateTime() {
ProposalConfig config = dao.fetch(ProposalConfig.class, Cnd.NEW());
if(System.currentTimeMillis() < config.getSecondedStartTime().getTime()) {
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.budwk.app.base.annotation.SLog;
@@ -60,19 +61,24 @@ public class ProposalSecondedController {
@At("")
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/seconded/index.html")
@SaCheckPermission("proposal.seconded")
@SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR)
public void index() {
}
@At("/h5")
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/seconded/index.html")
@SaCheckPermission("proposal.seconded")
@SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR)
public void h5Index() {
}
@At
@SaCheckPermission("proposal.seconded")
@SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR)
public Result pageData(@Valid ProposalSearchParam pageForm, boolean approval) {
// 受邀附议查询规则:
// 1. 只查询流程中的 second 节点任务,即“被邀请附议”的提案;
// 2. 未附议:查询当前用户待办中的 second 任务;
// 3. 已附议:查询当前用户已办/中断的 second 任务;
// 4. 这里不处理主动附议口径,主动附议由 positiveSeconded 独立查询。
Sql sql = Sqls.create("""
SELECT
info.*,
@@ -134,7 +140,7 @@ public class ProposalSecondedController {
}
@At
@SaCheckPermission("proposal.seconded")
@SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR)
@Aop(TransAop.READ_COMMITTED)
@ApiOperation("修改提案附议信息")
@SLog(tag = "提案管理系统-附议提案", msg = "修改提案附议信息")
@@ -1,26 +1,51 @@
<!--#
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app">
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<search @search="doSearch">
<search-item label="教代会">
<el-select @change="meetingChange" clearable filterable placeholder="所属教代会"
<el-select @change="meetingChange" clearable filterable :placeholder="searchPlaceholder.session"
v-model="pageForm.sessionId">
<el-option :key="item.id" :label="item.fullName" :value="item.id"
v-for="item in sessionOptions"></el-option>
</el-select>
</search-item>
<search-item label="提案名称">
<el-input v-model="pageForm.name" placeholder="提案名称" @keyup.enter.native="doSearch" clearable
<el-input v-model="pageForm.name" :placeholder="searchPlaceholder.name" @keyup.enter.native="doSearch" clearable
style="width: 100%"></el-input>
</search-item>
<!-- <search-item label="姓名/工号" v-if="activeTab === 'positiveSeconded'">-->
<!-- <el-input clearable placeholder="请输入姓名或工号" v-model="pageForm.createUserKeyword"-->
<!-- @keyup.enter.native="doSearch"></el-input>-->
<!-- </search-item>-->
<search-item label="代表团" v-if="activeTab === 'positiveSeconded'">
<el-select clearable filterable placeholder="请选择所属代表团" v-model="pageForm.delegationId">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in delegationOptions"></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card shadow="never">
<el-tabs v-model="activeTab" type="card" @tab-click="tabChange">
<el-tab-pane name="inviteSeconded">
<span slot="label">
<i class="el-icon-message"></i>
受邀附议
</span>
</el-tab-pane>
<el-tab-pane name="positiveSeconded">
<span slot="label">
<i class="el-icon-edit-outline"></i>
主动附议
</span>
</el-tab-pane>
</el-tabs>
<table-tool :columns.sync="tableColumns">
<el-radio-group v-model="pageForm.approval" size="small" @change="doSearch">
<el-radio-button :label="true">已附议</el-radio-button>
@@ -54,10 +79,7 @@ layout("/layouts/platform.html"){
<el-table-column label="操作" fixed="right" width="300px">
<template slot-scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.taskState === 10" @click="openAudit(row)" size="mini" type="primary">附议
</el-button>
<!-- <el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回-->
<!-- </el-button>-->
<el-button v-if="showAuditButton(row)" @click="openAudit(row)" size="mini" type="primary">附议</el-button>
</template>
</el-table-column>
</el-table>
@@ -68,7 +90,7 @@ layout("/layouts/platform.html"){
<proposal-info ref="proposalInfoRef">
<div v-if="showApprovalForm">
<div class="process-title">
{{formData.taskName}}
{{approvalTitle}}
</div>
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=""
class="flow-task-form">
@@ -98,122 +120,274 @@ layout("/layouts/platform.html"){
components: {
"proposal-info": PROPOSAL_INFO
},
data() {
data: function () {
return {
tableColumns: [
activeTab: "inviteSeconded",
inviteColumns: [
{label: "提案编号", prop: "code"},
{label: "提案名称", prop: "name", width: "200px"},
{label: "提案人", prop: "createUserName"},
{label: "提案类别", prop: "typeName"},
{label: "代表团", prop: "delegationName"},
{label: "附议人", prop: "taskActorName"},
// {label: "附议人", prop: "taskActorName"},
{label: "当前节点", prop: "curTaskName"},
{label: "流程状态", prop: "instanceState"}
],
positiveColumns: [
{label: "提案编号", prop: "code"},
{label: "提案名称", prop: "name", width: "200px"},
{label: "提案人", prop: "createUserName"},
{label: "提案类别", prop: "typeName"},
{label: "代表团", prop: "delegationName"},
{label: "当前节点", prop: "taskName"},
{label: "流程状态", prop: "instanceState"}
],
tableColumns: [],
pageForm: {
approval: false
approval: false,
name: "",
sessionId: null,
createUserKeyword: "",
delegationId: null,
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
showApprovalForm: false,
sessionOptions: [],
delegationOptions: [],
row: {},
row: {}
}
},
computed: {
approvalTitle: function () {
if (this.activeTab === "inviteSeconded") {
return this.formData.taskName
}
return "主动附议"
},
searchPlaceholder: function () {
if (this.activeTab === "inviteSeconded") {
return {
session: "所属教代会",
name: "提案名称"
}
}
return {
session: "请选择所属教代会",
name: "请输入提案名称"
}
}
},
methods: {
openView(row) {
// 根据当前页签切换表头,避免和公共 mixin 中同名字段冲突。
syncTableColumns: function () {
if (this.activeTab === "inviteSeconded") {
this.$set(this, "tableColumns", this.inviteColumns)
} else {
this.$set(this, "tableColumns", this.positiveColumns)
}
},
currentPageDataUrl: function () {
if (this.activeTab === "inviteSeconded") {
return "/platform/proposal/seconded/pageData"
}
return "/platform/proposal/positiveSeconded/pageData"
},
// 切换附议类型时,保留顶部搜索卡片和列表卡片,只刷新当前页签数据。
tabChange: function () {
this.syncTableColumns()
this.$set(this, "tableData", [])
if (this.activeTab !== "positiveSeconded") {
this.$set(this.pageForm, "createUserKeyword", "")
this.$set(this.pageForm, "delegationId", null)
}
this.doSearch()
},
doSearch: function () {
this.tableKey = new Date().getTime()
this.$set(this.pageForm, "pageNumber", 1)
this.pageData()
},
pageOrder: function (column) {
this.$set(this.pageForm, "pageOrderName", column.prop)
this.$set(this.pageForm, "pageOrderBy", column.order)
this.pageData()
},
pageNumberChange: function (val) {
this.$set(this.pageForm, "pageNumber", val)
this.pageData()
},
pageSizeChange: function (val) {
this.$set(this.pageForm, "pageSize", val)
this.pageData()
},
pageData: function () {
this.tableLoading = true
this.$axios.post(this.currentPageDataUrl(), this.pageForm).then((res) => {
this.tableLoading = false
if (res.code === 0) {
this.$set(this, "tableData", res.data.list)
this.$set(this.pageForm, "totalCount", res.data.totalCount)
}
})
},
showAuditButton: function (row) {
if (this.activeTab === "inviteSeconded") {
return row.taskState === 10
}
return row.count === 0
},
openView: function (row) {
this.$refs.guava.edit(() => {
this.showApprovalForm = false
this.$set(this, "showApprovalForm", false)
this.$refs.proposalInfoRef.onOpen(row)
})
},
openAudit(row) {
this.row = row
openAudit: async function (row) {
if (this.activeTab === "positiveSeconded") {
var validatePass = await this.validatePositiveTime()
if (!validatePass) {
return
}
}
this.$set(this, "row", row)
this.$refs.guava.edit(() => {
this.showApprovalForm = true
this.formData = {
processTaskId: row.taskId,
sessionId: row.sessionId,
delegationId: row.delegationId,
taskName: row.curTaskName,
tf_opinion: "同意该提案"
this.$set(this, "showApprovalForm", true)
if (this.activeTab === "inviteSeconded") {
this.$set(this, "formData", {
processTaskId: row.taskId,
sessionId: row.sessionId,
delegationId: row.delegationId,
taskName: row.curTaskName,
tf_opinion: "同意该提案"
})
} else {
this.$set(this, "formData", {
processTaskId: row.taskId,
taskName: row.curTaskName,
tf_opinion: "同意该提案"
})
}
this.$refs.proposalInfoRef.onOpen(row)
})
},
handleTaskAction(val) {
this.$refs.formRef.validate(valid => {
handleTaskAction: function (val) {
this.$refs.formRef.validate((valid) => {
if (!valid) return
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
this.updateSecond(val)
}
})
})
})
},
updateSecond(submitType) {
this.$axios.post("/platform/proposal/seconded/updateInfo", {
proposalId: this.row.id,
taskActorUserId: this.row.taskActorUserId,
opinion: this.formData.tf_opinion,
submitType: submitType,
})
},
onRevoke(row) {
this.$confirm("您确定要撤回吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then(() => {
this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
if (this.activeTab === "inviteSeconded") {
this.handleInviteSeconded(val)
} else {
this.handlePositiveSeconded(val)
}
})
})
},
// 教代会
async meetingChange(val) {
this.formData.delegationId = null
this.formData.committeeId = null
// 受邀附议需要先执行流程任务,再同步附议结果。
handleInviteSeconded: function (val) {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.updateInviteSeconded(val)
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
},
updateInviteSeconded: function (submitType) {
this.$axios.post("/platform/proposal/seconded/updateInfo", {
proposalId: this.row.id,
taskActorUserId: this.row.taskActorUserId,
opinion: this.formData.tf_opinion,
submitType: submitType
})
},
// 主动附议走独立业务接口处理。
handlePositiveSeconded: function (val) {
this.$axios.post("/platform/proposal/positiveSeconded/handle", {
proposalId: this.row.id,
opinion: this.formData.tf_opinion,
submitType: val
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
},
validatePositiveTime: function () {
return this.$axios.post("/platform/proposal/positiveSeconded/validateTime").then((res) => {
if (res.code !== 0) {
this.$message.error(res.msg)
return false
}
return true
})
},
meetingChange: function () {
if (this.activeTab === "positiveSeconded") {
this.$set(this.pageForm, "delegationId", null)
this.listDelegation()
}
this.doSearch()
},
// 查询开启的教代会
listOpenSession() {
listOpenSession: function () {
this.$axios.post("/platform/proposal/common/listOpenSession").then((res) => {
if (res.code === 0) {
this.sessionOptions = res.data
if (this.sessionOptions) {
this.$set(this, "sessionOptions", res.data)
if (this.sessionOptions && this.sessionOptions.length > 0) {
this.$set(this.pageForm, "sessionId", this.sessionOptions[0].id)
this.pageData()
this.listDelegation()
}
}
})
}
},
listDelegation: function () {
if (!this.pageForm.sessionId) {
this.$set(this, "delegationOptions", [])
return
}
this.$axios.post("/platform/proposal/common/listDelegation", {sessionId: this.pageForm.sessionId}).then((res) => {
if (res.code === 0) {
this.$set(this, "delegationOptions", res.data)
}
})
}
},
created() {
this.pageData()
created: function () {
this.syncTableColumns()
this.listOpenSession()
}
})
@@ -153,7 +153,7 @@ layout("/layouts/platform.html"){
<!-- </el-form-item>-->
</el-form>
<template slot="footer" v-if="isWriteTime">
<template slot="footer" >
<el-button type="primary" @click="onSave">保存</el-button>
<el-button type="primary" @click="onSubmit" v-if="!taskId">提交</el-button>
<el-button type="primary" @click="onSubmitAgain" v-else>提交</el-button>
@@ -397,11 +397,82 @@ layout("/layouts/platform.html"){
diff: 0
},
memberPercentage: "--",
unionMember: []
unionMember: [],
chartResizeTimer: null,
chartResizeObserver: null
}
},
methods: {
// 等图表容器尺寸稳定后再初始化,避免 Chrome 首次布局时宽高为 0 导致图表偶发不显示。
waitChartContainerReady(containerId, callback, retryTimes = 0) {
this.$nextTick(() => {
requestAnimationFrame(() => {
const container = document.getElementById(containerId)
if (container && container.clientWidth > 0 && container.clientHeight > 0) {
callback(container)
return
}
if (retryTimes < 10) {
setTimeout(() => {
this.waitChartContainerReady(containerId, callback, retryTimes + 1)
}, 100)
}
})
})
},
resizeChart(chartInstance, containerId) {
const container = document.getElementById(containerId)
if (!chartInstance || !container || container.clientWidth <= 0 || container.clientHeight <= 0) {
return
}
if (typeof chartInstance.changeSize === "function") {
chartInstance.changeSize(container.clientWidth, container.clientHeight)
return
}
if (typeof chartInstance.forceFit === "function") {
chartInstance.forceFit()
return
}
if (typeof chartInstance.render === "function") {
chartInstance.render()
}
},
resizeAllCharts() {
this.resizeChart(chart.growthTrendChart, "growthTrendChart")
this.resizeChart(chart.memberPercentageChart, "memberPercentageChart")
this.resizeChart(chart.memberSexPercentageChart, "memberSexPercentageChart")
this.resizeChart(chart.unionMemberChart, "unionMemberChart")
this.resizeChart(chart.personTypeMemberChart, "personTypeMemberChart")
},
handleChartResize() {
if (this.chartResizeTimer) {
clearTimeout(this.chartResizeTimer)
}
this.chartResizeTimer = setTimeout(() => {
this.resizeAllCharts()
}, 100)
},
registerChartResize() {
window.addEventListener("resize", this.handleChartResize)
document.addEventListener("visibilitychange", this.handleChartResize)
if (typeof ResizeObserver !== "undefined") {
this.chartResizeObserver = new ResizeObserver(() => {
this.handleChartResize()
})
;["memberPercentageChart", "memberSexPercentageChart"].forEach((containerId) => {
const container = document.getElementById(containerId)
if (container) {
this.chartResizeObserver.observe(container)
}
})
}
},
/**
* 会员数
* @returns {Promise<void>}
@@ -437,47 +508,51 @@ layout("/layouts/platform.html"){
const values = data.map((v) => v.value)
if (chart.growthTrendChart) {
chart.growthTrendChart.changeData(values)
this.handleChartResize()
return
}
chart.growthTrendChart = new G2Plot.TinyArea("growthTrendChart", {
autoFit: true,
data: values,
smooth: true,
this.waitChartContainerReady("growthTrendChart", () => {
chart.growthTrendChart = new G2Plot.TinyArea("growthTrendChart", {
autoFit: true,
data: values,
smooth: true,
// 核心配色方案
color: '#217050', // 主色线
areaStyle: {
fill: 'l(270) 0:#e8f5eb 1:#217050', // 线性渐变填充
opacity: 0.8
},
line: {
color: '#134330', // 深绿色线条
size: 2
},
// 核心配色方案
color: '#217050', // 主色线
areaStyle: {
fill: 'l(270) 0:#e8f5eb 1:#217050', // 线性渐变填充
opacity: 0.8
},
line: {
color: '#134330', // 深绿色线条
size: 2
},
// 数据点样式
point: {
size: 3,
style: {
fill: '#fff',
stroke: '#217050',
lineWidth: 2
}
},
// 数据点样式
point: {
size: 3,
style: {
fill: '#fff',
stroke: '#217050',
lineWidth: 2
}
},
showContent: true,
showContent: true,
tooltip: {
customContent: function (i, data) {
if (labels[i]) {
return labels[i] + "-" + data[0]?.data?.y + "人"
tooltip: {
customContent: function (i, data) {
if (labels[i]) {
return labels[i] + "-" + data[0]?.data?.y + "人"
}
return ""
}
return ""
}
}
})
chart.growthTrendChart.render()
this.handleChartResize()
})
chart.growthTrendChart.render()
} else {
this.$message.warning(resp.msg)
}
@@ -496,29 +571,34 @@ layout("/layouts/platform.html"){
this.memberPercentage = data.toFixed(2)
if (chart.memberPercentageChart) {
chart.memberPercentageChart.changeData(data)
this.handleChartResize()
return
}
chart.memberPercentageChart = new G2Plot.Liquid("memberPercentageChart", {
outline: {
border: 4,
distance: 8
},
wave: {
length: 128
},
autoFit: true,
percent: data,
color: '#217050',
statistic: {
content: {
style: {
fontSize: 16,
fill: '#fff', // 白色文字
this.waitChartContainerReady("memberPercentageChart", () => {
chart.memberPercentageChart = new G2Plot.Liquid("memberPercentageChart", {
outline: {
border: 4,
distance: 8
},
wave: {
length: 128
},
autoFit: true,
percent: data,
color: '#217050',
statistic: {
content: {
style: {
fontSize: 16,
fill: '#fff', // 白色文字
}
}
}
}
})
chart.memberPercentageChart.render()
this.handleChartResize()
})
chart.memberPercentageChart.render()
} else {
this.$message.warning(resp.msg)
}
@@ -536,32 +616,36 @@ layout("/layouts/platform.html"){
const { data } = resp
if (chart.memberSexPercentageChart) {
chart.memberSexPercentageChart.changeData(data)
this.handleChartResize()
return
}
chart.memberSexPercentageChart = new G2Plot.Pie("memberSexPercentageChart", {
data,
angleField: "value",
colorField: "type",
legend: false,
label: {
type: 'inner',
offset: '-30%',
style: {
fontSize: 14,
fontWeight: 'bold',
fill: '#fff', // 白色文字
textShadow: '0 1px 2px rgba(0,0,0,0.5)' // 增强可读性
this.waitChartContainerReady("memberSexPercentageChart", () => {
chart.memberSexPercentageChart = new G2Plot.Pie("memberSexPercentageChart", {
data,
angleField: "value",
colorField: "type",
legend: false,
label: {
type: 'inner',
offset: '-30%',
style: {
fontSize: 14,
fontWeight: 'bold',
fill: '#fff', // 白色文字
textShadow: '0 1px 2px rgba(0,0,0,0.5)' // 增强可读性
},
formatter: (datum) => (datum.percent * 100).toFixed(1)
},
formatter: (datum) => (datum.percent * 100).toFixed(1)
},
// 交互效果
interactions: [
{ type: 'element-active' },
],
color: ['#217050', '#f0a35c']
// 交互效果
interactions: [
{ type: 'element-active' },
],
color: ['#217050', '#f0a35c']
})
chart.memberSexPercentageChart.render()
this.handleChartResize()
})
chart.memberSexPercentageChart.render()
} else {
this.$message.warning(resp.msg)
}
@@ -893,6 +977,17 @@ layout("/layouts/platform.html"){
},
mounted() {
this.initData()
this.registerChartResize()
},
beforeDestroy() {
window.removeEventListener("resize", this.handleChartResize)
document.removeEventListener("visibilitychange", this.handleChartResize)
if (this.chartResizeTimer) {
clearTimeout(this.chartResizeTimer)
}
if (this.chartResizeObserver) {
this.chartResizeObserver.disconnect()
}
}
})
</script>
@@ -14,16 +14,27 @@ layout("/layouts/platform_h5.html"){
></van-search>
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<van-dropdown-item v-model="pageForm.sessionId" :options="sessionOptions" :multiple="false"
@change="doSearch"></van-dropdown-item>
@change="sessionChange"></van-dropdown-item>
<van-dropdown-item
v-if="activeTab === 'positiveSeconded'"
v-model="pageForm.delegationId"
:options="delegationOptions"
@change="doSearch"
></van-dropdown-item>
</van-dropdown-menu>
<van-tabs v-model="pageForm.approvalText"
@change="(val)=>{this.pageForm.approval = val==='1';this.doSearch();}">
<van-tabs v-model="activeTab" @change="tabChange">
<van-tab title="受邀附议" name="inviteSeconded"></van-tab>
<van-tab title="主动附议" name="positiveSeconded"></van-tab>
</van-tabs>
<van-tabs v-model="pageForm.approvalText" @change="approvalTabChange">
<van-tab title="已附议" name="1"></van-tab>
<van-tab title="未附议" name="0"></van-tab>
</van-tabs>
</van-sticky>
<table-list api="/platform/proposal/seconded/pageData" :page_form.sync="pageForm" @ready="onReady"
<table-list :api="currentApi" :page_form.sync="pageForm" @ready="onReady"
ref="tableListRef"
title="name">
<template v-slot="{index,row}">
@@ -31,14 +42,14 @@ layout("/layouts/platform_h5.html"){
<table-column label="提案类别">{{row.typeName}}</table-column>
<table-column label="提案人">{{row.createUserName}}</table-column>
<table-column label="代表团">{{row.delegationName}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
<table-column label="当前节点">{{ currentTaskName(row) }}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn" v-if="row.taskState === 10" @click="onApproval(row)">
<div class="action-btn" v-if="showApprovalButton(row)" @click="onApproval(row)">
<i class="fa fa-edit"></i>
<span>附议</span>
</div>
@@ -83,6 +94,7 @@ layout("/layouts/platform_h5.html"){
store,
data() {
return {
activeTab: "inviteSeconded",
pageForm: {
pageNumber: 1,
pageSize: 10,
@@ -90,10 +102,17 @@ layout("/layouts/platform_h5.html"){
name: null,
sessionId: null,
approvalText: "0",
approval: false
approval: false,
delegationId: null
},
sessionOptions: [],
delegationOptions: [
{
text: "全部代表团",
value: null
}
],
formData: {},
showApprovalForm: false,
rules: {
@@ -105,65 +124,152 @@ layout("/layouts/platform_h5.html"){
components: {
"proposal-info": PROPOSAL_INFO
},
computed: {
currentApi() {
if (this.activeTab === "inviteSeconded") {
return "/platform/proposal/seconded/pageData"
}
return "/platform/proposal/positiveSeconded/pageData"
}
},
methods: {
onReady() {
this.listSession()
},
// H5 端页签切换逻辑与 PC 保持一致:受邀附议与主动附议共用一个页面,根据当前页签切换接口与筛选项。
tabChange(val) {
this.activeTab = val
if (this.activeTab !== "positiveSeconded") {
this.$set(this.pageForm, "delegationId", null)
}
if (this.activeTab === "positiveSeconded" && this.pageForm.sessionId) {
this.listDelegation()
}
this.doSearch()
},
approvalTabChange(val) {
this.$set(this.pageForm, "approvalText", val)
this.$set(this.pageForm, "approval", val === "1")
this.doSearch()
},
sessionChange() {
this.$set(this.pageForm, "delegationId", null)
if (this.activeTab === "positiveSeconded" && this.pageForm.sessionId) {
this.listDelegation()
} else {
this.$set(this, "delegationOptions", [
{
text: "全部代表团",
value: null
}
])
}
this.doSearch()
},
listDelegation() {
if (!this.pageForm.sessionId) {
this.$set(this, "delegationOptions", [
{
text: "全部代表团",
value: null
}
])
return
}
this.$axios.post("/platform/proposal/common/listDelegation", {sessionId: this.pageForm.sessionId}).then((res) => {
if (res.code === 0) {
this.$set(this, "delegationOptions", [
{
text: "全部代表团",
value: null
}
].concat(res.data.map((v) => ({text: v.name, value: v.id}))))
}
})
},
listSession() {
this.$axios.post("/platform/proposal/common/listSession").then((res) => {
if (res.code === 0) {
this.sessionOptions = [
this.$set(this, "sessionOptions", [
{
text: "全部届次",
value: null
}
].concat(res.data.map((v) => ({text: v.fullName, value: v.id})))
].concat(res.data.map((v) => ({text: v.fullName, value: v.id}))))
if (this.sessionOptions.length > 0) {
this.pageForm.sessionId = this.sessionOptions[0].value
this.$set(this.pageForm, "sessionId", this.sessionOptions[0].value)
this.doSearch()
}
}
})
},
currentTaskName(row) {
if (this.activeTab === "inviteSeconded") {
return row.curTaskName
}
return row.taskName
},
showApprovalButton(row) {
if (this.activeTab === "inviteSeconded") {
return row.taskState === 10
}
return row.count === 0
},
onView(row) {
this.showApprovalForm = false
this.$set(this, "showApprovalForm", false)
this.$refs.proposalInfoRef.onOpen(row)
},
onApproval(row) {
this.row = row
this.showApprovalForm = true
this.$refs.proposalInfoRef.onOpen(row)
this.formData = {
processTaskId: row.taskId,
sessionId: row.sessionId,
delegationId: row.delegationId,
taskName: row.curTaskName,
tf_opinion: "同意该提案"
async onApproval(row) {
if (this.activeTab === "positiveSeconded") {
const validatePass = await this.validatePositiveTime()
if (!validatePass) {
return
}
}
this.$set(this, "row", row)
this.$set(this, "showApprovalForm", true)
this.$refs.proposalInfoRef.onOpen(row)
if (this.activeTab === "inviteSeconded") {
this.$set(this, "formData", {
processTaskId: row.taskId,
sessionId: row.sessionId,
delegationId: row.delegationId,
taskName: row.curTaskName,
tf_opinion: "同意该提案"
})
} else {
this.$set(this, "formData", {
processTaskId: row.taskId,
taskName: row.curTaskName,
tf_opinion: "同意该提案"
})
}
},
validatePositiveTime() {
return this.$axios.post("/platform/proposal/positiveSeconded/validateTime").then((res) => {
if (res.code !== 0) {
this.$toast(res.msg)
return false
}
return true
})
},
async handleTaskAction(val) {
try {
await this.$refs.formRef.validate();
await this.$refs.formRef.validate()
this.$dialog.confirm({
title: "提示",
message: "您确定要提交吗?"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$refs.proposalInfoRef.onClose()
this.$toast.success(res.msg)
this.doSearch()
this.updateSecond(val)
}
})
if (this.activeTab === "inviteSeconded") {
this.handleInviteSeconded(val)
} else {
this.handlePositiveSeconded(val)
}
}).catch(() => {
})
@@ -172,6 +278,37 @@ layout("/layouts/platform_h5.html"){
}
},
// 受邀附议先走流程任务提交,再回写附议结果,与 PC 端保持一致。
handleInviteSeconded(val) {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$refs.proposalInfoRef.onClose()
this.$toast.success(res.msg)
this.doSearch()
this.updateSecond(val)
}
})
},
handlePositiveSeconded(val) {
this.$axios.post("/platform/proposal/positiveSeconded/handle", {
proposalId: this.row.id,
opinion: this.formData.tf_opinion,
submitType: val
}).then((res) => {
if (res.code === 0) {
this.$refs.proposalInfoRef.onClose()
this.$toast.success(res.msg)
this.doSearch()
}
})
},
updateSecond(submitType) {
this.$axios.post("/platform/proposal/seconded/updateInfo", {
proposalId: this.row.id,
@@ -183,8 +320,8 @@ layout("/layouts/platform_h5.html"){
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$set(this.pageForm, "pageNumber", 1)
this.$set(this.pageForm, "totalCount", 0)
this.$refs.tableListRef.doSearch()
})
},