fix : 修复需求征集界面样式及提示

This commit is contained in:
2024-06-01 14:36:03 +08:00
parent 7501c37379
commit 80ecad0864
4 changed files with 89 additions and 69 deletions

View File

@@ -4,12 +4,12 @@
<div class="fv-table-btn" v-if="tableConfig.btns"> <div class="fv-table-btn" v-if="tableConfig.btns">
<div class="table-head-btn"> <div class="table-head-btn">
<el-button <el-button
v-for="btn in tableConfig.btns" v-for="btn in tableConfig.btns"
:key="btn.key" :key="btn.key"
:type="btn.type || ''" :type="btn.type || ''"
:color="btn.color || ''" :color="btn.color || ''"
v-perm="btn.auth || ['*:*:*']" v-perm="btn.auth || ['*:*:*']"
@click="handleClickBtns(btn.key)" @click="handleClickBtns(btn.key)"
> >
{{ btn.name }} {{ btn.name }}
</el-button> </el-button>
@@ -19,7 +19,9 @@
<div v-if="isSettingCol" style="float: right"> <div v-if="isSettingCol" style="float: right">
<el-tooltip effect="dark" content="列配置" placement="bottom"> <el-tooltip effect="dark" content="列配置" placement="bottom">
<el-button ref="buttonRef" link> <el-button ref="buttonRef" link>
<el-icon size="18"><Setting /></el-icon> <el-icon size="18">
<Setting/>
</el-icon>
</el-button> </el-button>
</el-tooltip> </el-tooltip>
<el-popover <el-popover
@@ -30,7 +32,8 @@
virtual-triggering virtual-triggering
trigger="click"> trigger="click">
<div class="col-setting-checkall"> <div class="col-setting-checkall">
<el-checkbox label="列展示" v-model="localData.allColShow" :indeterminate="localData.indeterminate" @change="changeIsShowAll"></el-checkbox> <el-checkbox label="列展示" v-model="localData.allColShow" :indeterminate="localData.indeterminate"
@change="changeIsShowAll"></el-checkbox>
</div> </div>
<div class="col-setting-list"> <div class="col-setting-list">
<el-checkbox-group v-model="localData.checkGroup" @change="changeColShow"> <el-checkbox-group v-model="localData.checkGroup" @change="changeColShow">
@@ -49,19 +52,19 @@
<!-- 表格部分 --> <!-- 表格部分 -->
<div class="fv-table"> <div class="fv-table">
<el-table <el-table
:data="localData.list" :data="localData.list"
v-loading="localData.loading" v-loading="localData.loading"
:row-key="tableConfig?.rowKey || 'id'" :row-key="tableConfig?.rowKey || 'id'"
v-bind="$attrs" v-bind="$attrs"
table-layout="auto" table-layout="auto"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
highlight-current-row highlight-current-row
@selection-change="selectionChange" @selection-change="selectionChange"
@row-click="rowClick" @row-click="rowClick"
@row-dblclick="rowDblclick" @row-dblclick="rowDblclick"
@cell-click="cellClick" @cell-click="cellClick"
v-tabh v-tabh
ref="tableInstance" ref="tableInstance"
> >
<template #default> <template #default>
<fvTableColumn v-for="column in localData.columns" :key="column.prop" :columns="column"> <fvTableColumn v-for="column in localData.columns" :key="column.prop" :columns="column">
@@ -82,22 +85,22 @@
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<fvPagination <fvPagination
v-if="pagination" v-if="pagination"
:current-page="localData.query.pageNum" :current-page="localData.query.pageNum"
:page-size="localData.query.pageSize" :page-size="localData.query.pageSize"
:page-sizes="[10, 20, 30, 40,50]" :page-sizes="[10, 20, 30, 40,50]"
:total="localData.total" :total="localData.total"
@changeSize="handleSizeChange" @changeSize="handleSizeChange"
@goPage="handleCurrentChange" @goPage="handleCurrentChange"
> >
</fvPagination> </fvPagination>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import { ElMessage } from 'element-plus'; import {ElNotification} from 'element-plus';
import { requestList } from '../../api/common'; import {requestList} from '../../api/common';
const props = defineProps({ const props = defineProps({
//表格配置 //表格配置
@@ -148,8 +151,8 @@ const handleClickBtns = (key) => {
} }
const filterColumns = () => { const filterColumns = () => {
localData.columns = props.tableConfig.columns.map(item=>{ localData.columns = props.tableConfig.columns.map(item => {
if(item.prop) { if (item.prop) {
return { return {
...item ...item
} }
@@ -158,10 +161,10 @@ const filterColumns = () => {
} }
const changeIsShowAll = (val) => { const changeIsShowAll = (val) => {
if(val) { if (val) {
filterColumns() filterColumns()
localData.indeterminate = false localData.indeterminate = false
localData.checkGroup = props.tableConfig.columns.map(item=>item.prop) localData.checkGroup = props.tableConfig.columns.map(item => item.prop)
} else { } else {
localData.columns.length = 0 localData.columns.length = 0
localData.checkGroup.length = 0 localData.checkGroup.length = 0
@@ -170,10 +173,10 @@ const changeIsShowAll = (val) => {
} }
const changeColShow = (val) => { const changeColShow = (val) => {
if(val.length == props.tableConfig.columns.length) { if (val.length == props.tableConfig.columns.length) {
localData.indeterminate = false localData.indeterminate = false
localData.allColShow = true localData.allColShow = true
} else if(val.length !== props.tableConfig.columns.length && val.length != 0) { } else if (val.length !== props.tableConfig.columns.length && val.length != 0) {
localData.allColShow = false localData.allColShow = false
localData.indeterminate = true localData.indeterminate = true
} else { } else {
@@ -181,9 +184,9 @@ const changeColShow = (val) => {
localData.allColShow = false localData.allColShow = false
} }
const template = [] const template = []
props.tableConfig.columns.forEach(item=>{ props.tableConfig.columns.forEach(item => {
val.forEach(v=>{ val.forEach(v => {
if(item.prop == v) { if (item.prop == v) {
template.push(item) template.push(item)
} }
}) })
@@ -194,22 +197,31 @@ const changeColShow = (val) => {
filterColumns() filterColumns()
const getList = async () => { const getList = async () => {
const { api, params } = props.tableConfig const {api, params} = props.tableConfig
const queryParmas = {...localData.query, ...params} const queryParmas = {...localData.query, ...params}
if(api) { if (api) {
localData.loading = true localData.loading = true
try { try {
const { code, data, msg } = await requestList(api, queryParmas) const {code, data, msg} = await requestList(api, queryParmas)
if ( code === 1000 ) {
if (code === 1000) {
localData.list = data.rows localData.list = data.rows
localData.total = data.total localData.total = data.total
localData.loading = false localData.loading = false
} else { } else {
ElMessage.error(msg) ElNotification({
title: '提示',
message: msg,
type: 'error'
})
localData.loading = false localData.loading = false
} }
} catch (error) { } catch (error) {
ElMessage.error('请求数据失败') ElNotification({
title: '提示',
message: '请求数据失败',
type: 'error'
})
localData.loading = false localData.loading = false
} }
} else { } else {
@@ -246,13 +258,13 @@ const handleCurrentChange = (val) => {
getList() getList()
} }
watchEffect(()=>{ watchEffect(() => {
if(localData.allColShow) { if (localData.allColShow) {
localData.checkGroup = props.tableConfig.columns.map(item=>item.prop) localData.checkGroup = props.tableConfig.columns.map(item => item.prop)
} }
}) })
//刷新 //刷新
const refresh = ({resetPage=false}={}) => { const refresh = ({resetPage = false} = {}) => {
resetPage ? localData.query.pageNum = 1 : null resetPage ? localData.query.pageNum = 1 : null
getList() getList()
} }
@@ -265,7 +277,7 @@ const getQuery = () => {
return localData.query return localData.query
} }
defineExpose({ refresh, updateLoading, getQuery, tableInstance }) defineExpose({refresh, updateLoading, getQuery, tableInstance})
onMounted(() => { onMounted(() => {
getList() getList()
@@ -277,20 +289,24 @@ onMounted(() => {
.col-setting-checkall { .col-setting-checkall {
border-bottom: 1px solid rgb(210, 210, 213); border-bottom: 1px solid rgb(210, 210, 213);
} }
.col-setting-list { .col-setting-list {
max-height: 45vh; max-height: 45vh;
overflow-y: auto; overflow-y: auto;
} }
.table-head-btn { .table-head-btn {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
} }
.fv-table-btn { .fv-table-btn {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-content: center; align-content: center;
} }
.fv-table { .fv-table {
:deep(.el-tooltip) { :deep(.el-tooltip) {
width: 100% !important; width: 100% !important;

View File

@@ -57,7 +57,7 @@
v-model:value="formData.collectExplain" /> v-model:value="formData.collectExplain" />
<baseTitle title="申请文件"></baseTitle> <baseTitle title="申请文件"></baseTitle>
<file-upload v-if="checkFormPrem('fileList')" @getFile="getFile"/> <file-upload v-if="checkFormPrem('fileList')" @getFile="getFile"/>
<fvTable style="width: 100%;max-height: 650px;" v-if="showTable" <fvTable style="width: 100%;max-height: 600px;height: 600px" v-if="showTable"
:tableConfig="tableConfig" :data="formData.fileList" :tableConfig="tableConfig" :data="formData.fileList"
:isSettingCol="false" :pagination="false"> :isSettingCol="false" :pagination="false">
<template #empty> <template #empty>

View File

@@ -40,7 +40,7 @@
<baseTitle title="附件列表"></baseTitle> <baseTitle title="附件列表"></baseTitle>
<el-col :span="24" v-if="checkFormPrem('collectExplain')"> <el-col :span="24" v-if="checkFormPrem('collectExplain')">
<el-form-item> <el-form-item>
<fvTable style="width: 100%;max-height: 200px" v-if="showTable" :tableConfig="tableConfig" <fvTable style="width: 100%;max-height: 600px;height: 600px" v-if="showTable" :tableConfig="tableConfig"
:data="formData.fileList" :isSettingCol="false" :pagination="false"> :data="formData.fileList" :isSettingCol="false" :pagination="false">
<template #empty> <template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/> <el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
@@ -86,7 +86,7 @@ import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.v
import {useProcessStore} from '@/stores/processStore.js'; import {useProcessStore} from '@/stores/processStore.js';
import {getInfo, agreeTask, rejectTask, downloadFile} from "@/api/project-demand/index.js"; import {getInfo, agreeTask, rejectTask, downloadFile} from "@/api/project-demand/index.js";
import {getSubCompOpt} from '@/api/user/user.js' import {getSubCompOpt} from '@/api/user/user.js'
import {ElMessage} from "element-plus"; import {ElNotification} from "element-plus";
import {useTagsView} from '@/stores/tagsview.js' import {useTagsView} from '@/stores/tagsview.js'
import {matterTree} from '@/utils/matterTree.js'; import {matterTree} from '@/utils/matterTree.js';
import {getFundOption} from "@/api/special-fund"; import {getFundOption} from "@/api/special-fund";
@@ -170,14 +170,16 @@ const handleSubmit = () => {
formData: formData.value formData: formData.value
} }
agreeTask(approve).then(res => { agreeTask(approve).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) { if (res.code === 1000) {
ElMessage.success(res.msg)
tagsViewStore.delVisitedViews(router.currentRoute.value.path) tagsViewStore.delVisitedViews(router.currentRoute.value.path)
router.push({ router.push({
name: 'Requirement' name: 'Requirement'
}) })
} else {
ElMessage.error(res.msg)
} }
}) })
} }
@@ -190,14 +192,16 @@ const handleReject = (instance) => {
auditOpinion: formData.value.auditOpinion, auditOpinion: formData.value.auditOpinion,
} }
rejectTask(approve).then(res => { rejectTask(approve).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) { if (res.code === 1000) {
ElMessage.success(res.msg)
tagsViewStore.delVisitedViews(router.currentRoute.value.path) tagsViewStore.delVisitedViews(router.currentRoute.value.path)
router.push({ router.push({
name: 'Requirement' name: 'Requirement'
}) })
} else {
ElMessage.error(res.msg)
} }
}) })
}) })

View File

@@ -11,7 +11,7 @@
import {useAuthStore} from '@/stores/userstore.js' import {useAuthStore} from '@/stores/userstore.js'
import Tag from '@/components/Tag.vue' import Tag from '@/components/Tag.vue'
import fvSelect from '@/fvcomponents/fvSelect/index.vue' import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import {ElMessage, ElNotification} from "element-plus"; import { ElNotification} from "element-plus";
import {deleteDemand} from "@/api/project-demand"; import {deleteDemand} from "@/api/project-demand";
const authStore = useAuthStore() const authStore = useAuthStore()
@@ -115,9 +115,9 @@ const tableConfig = reactive({
// if (buttons.has("delete")) { // if (buttons.has("delete")) {
// btn.push({label: '删除',prem: ['mosr:requirement:del'], func: () => handleDelete(row), type: 'primary'}) // btn.push({label: '删除',prem: ['mosr:requirement:del'], func: () => handleDelete(row), type: 'primary'})
// } // }
if (buttons.has("report")) { // if (buttons.has("report")) {
btn.push({label: '需求上报', prem: ['mosr:requirement:info'], func: () => handleReport(row), type: 'primary'}) btn.push({label: '需求上报', prem: ['mosr:requirement:info'], func: () => handleReport(row), type: 'primary'})
} // }
return ( return (
<div style={{width: '100%'}}> <div style={{width: '100%'}}>
{ {
@@ -173,12 +173,12 @@ const handleEdit = (row) => {
} }
const handleDelete = (row) => { const handleDelete = (row) => {
deleteDemand(row.requirementId).then(res => { deleteDemand(row.requirementId).then(res => {
if (res.code === 1000) { ElNotification({
ElMessage.success(res.msg) title: '提示',
tableIns.value.refresh() message: res.msg,
} else { type: res.code === 1000 ? 'success' : 'error'
ElMessage.error(res.msg) })
} tableIns.value.refresh()
}) })
} }
const handleDetail = (row) => { const handleDetail = (row) => {