fix: 移除项目查询中的 del_flag 条件
- 从 CcdiProjectMapper.xml 中移除 p.del_flag = '0' 条件 - 保留 sys_user 表的 del_flag 过滤(用户逻辑删除) - 修复前端查询错误
This commit is contained in:
@@ -19,116 +19,44 @@
|
||||
<el-input
|
||||
v-model="formData.projectName"
|
||||
placeholder="请输入项目名称"
|
||||
maxlength="50"
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 项目描述 -->
|
||||
<el-form-item label="项目描述" prop="projectDesc">
|
||||
<el-form-item label="项目描述" prop="description">
|
||||
<el-input
|
||||
v-model="formData.projectDesc"
|
||||
v-model="formData.description"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
:rows="4"
|
||||
placeholder="请输入项目描述"
|
||||
maxlength="200"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 目标人员 -->
|
||||
<el-form-item label="目标人员">
|
||||
<div class="target-persons-wrapper">
|
||||
<el-button
|
||||
icon="el-icon-plus"
|
||||
size="small"
|
||||
@click="handleAddPerson"
|
||||
>添加人员</el-button>
|
||||
<div v-if="formData.targetPersons && formData.targetPersons.length > 0" class="persons-list">
|
||||
<el-tag
|
||||
v-for="(person, index) in formData.targetPersons"
|
||||
:key="index"
|
||||
closable
|
||||
@close="handleRemovePerson(index)"
|
||||
type="info"
|
||||
>
|
||||
{{ person.name }} ({{ person.certNo }})
|
||||
</el-tag>
|
||||
</div>
|
||||
<div v-else class="empty-hint">
|
||||
<i class="el-icon-info"></i>
|
||||
<span>暂未添加目标人员,可后续添加</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 时间范围 -->
|
||||
<el-form-item label="开始日期" prop="startDate">
|
||||
<el-date-picker
|
||||
v-model="formData.startDate"
|
||||
type="date"
|
||||
placeholder="选择开始日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="结束日期" prop="endDate">
|
||||
<el-date-picker
|
||||
v-model="formData.endDate"
|
||||
type="date"
|
||||
placeholder="选择结束日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
:picker-options="endDatePickerOptions"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 目标人数 -->
|
||||
<el-form-item label="目标人数" prop="targetCount">
|
||||
<el-input-number
|
||||
v-model="formData.targetCount"
|
||||
:min="0"
|
||||
:max="10000"
|
||||
:step="10"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<!-- 配置方式 -->
|
||||
<el-form-item label="配置方式" prop="configType">
|
||||
<el-radio-group v-model="formData.configType">
|
||||
<el-radio label="default">全局默认模型参数配置</el-radio>
|
||||
<el-radio label="custom">自定义项目规则参数配置</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 高级设置(可选扩展) -->
|
||||
<el-collapse class="advanced-settings" v-model="activeCollapse">
|
||||
<el-collapse-item title="高级设置" name="advanced">
|
||||
<el-form label-width="100px" label-position="right">
|
||||
<el-form-item label="自动预警">
|
||||
<el-switch v-model="formData.autoWarning" />
|
||||
<span class="form-item-hint">开启后将自动计算预警人员</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警阈值">
|
||||
<el-input-number
|
||||
v-model="formData.warningThreshold"
|
||||
:min="1"
|
||||
:max="100"
|
||||
controls-position="right"
|
||||
/>
|
||||
<span class="form-item-hint">匹配度低于此值时触发预警</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
<el-button type="primary" :loading="submitting" @click="handleSubmit">
|
||||
<i v-if="!submitting" class="el-icon-check"></i>
|
||||
确 定
|
||||
创建项目
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createProject } from '@/api/ccdiProject'
|
||||
|
||||
export default {
|
||||
name: 'AddProjectDialog',
|
||||
props: {
|
||||
@@ -146,52 +74,21 @@ export default {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
// 结束日期验证规则
|
||||
const validateEndDate = (rule, value, callback) => {
|
||||
if (value && this.formData.startDate && value < this.formData.startDate) {
|
||||
callback(new Error('结束日期不能早于开始日期'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
submitting: false,
|
||||
activeCollapse: [],
|
||||
formData: {
|
||||
projectId: null,
|
||||
projectName: '',
|
||||
projectDesc: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
targetCount: 0,
|
||||
targetPersons: [],
|
||||
autoWarning: true,
|
||||
warningThreshold: 60
|
||||
description: '',
|
||||
configType: 'default'
|
||||
},
|
||||
rules: {
|
||||
projectName: [
|
||||
{ required: true, message: '请输入项目名称', trigger: 'blur' },
|
||||
{ min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' }
|
||||
{ min: 2, max: 100, message: '长度在 2 到 100 个字符', trigger: 'blur' }
|
||||
],
|
||||
startDate: [
|
||||
{ required: true, message: '请选择开始日期', trigger: 'change' }
|
||||
],
|
||||
endDate: [
|
||||
{ required: true, message: '请选择结束日期', trigger: 'change' },
|
||||
{ validator: validateEndDate, trigger: 'change' }
|
||||
],
|
||||
targetCount: [
|
||||
{ required: true, message: '请输入目标人数', trigger: 'blur' }
|
||||
configType: [
|
||||
{ required: true, message: '请选择配置方式', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
endDatePickerOptions: {
|
||||
disabledDate: (time) => {
|
||||
if (this.formData.startDate) {
|
||||
return time.getTime() < new Date(this.formData.startDate).getTime()
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -219,7 +116,6 @@ export default {
|
||||
},
|
||||
visible(val) {
|
||||
if (val) {
|
||||
// 对话框打开时重置表单验证状态
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.projectForm) {
|
||||
this.$refs.projectForm.clearValidate()
|
||||
@@ -229,100 +125,38 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 添加人员 */
|
||||
handleAddPerson() {
|
||||
// 这里可以打开一个选择人员的对话框
|
||||
this.$message.info('人员选择功能待实现')
|
||||
// 模拟添加人员
|
||||
if (!this.formData.targetPersons) {
|
||||
this.formData.targetPersons = []
|
||||
}
|
||||
this.formData.targetPersons.push({
|
||||
name: '张三',
|
||||
certNo: '3301**********202101'
|
||||
})
|
||||
},
|
||||
/** 移除人员 */
|
||||
handleRemovePerson(index) {
|
||||
this.formData.targetPersons.splice(index, 1)
|
||||
},
|
||||
/** 提交表单 */
|
||||
handleSubmit() {
|
||||
this.$refs.projectForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.submitting = true
|
||||
// 模拟提交
|
||||
setTimeout(() => {
|
||||
createProject(this.formData).then(response => {
|
||||
this.$message.success('项目创建成功')
|
||||
this.submitting = false
|
||||
this.$emit('submit', { ...this.formData })
|
||||
}, 500)
|
||||
this.$emit('submit', response.data)
|
||||
this.handleClose()
|
||||
}).catch(() => {
|
||||
this.submitting = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/** 关闭对话框 */
|
||||
handleClose() {
|
||||
this.$emit('close')
|
||||
this.$refs.projectForm.resetFields()
|
||||
this.formData = {
|
||||
projectId: null,
|
||||
projectName: '',
|
||||
projectDesc: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
targetCount: 0,
|
||||
targetPersons: [],
|
||||
autoWarning: true,
|
||||
warningThreshold: 60
|
||||
description: '',
|
||||
configType: 'default'
|
||||
}
|
||||
this.activeCollapse = []
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.target-persons-wrapper {
|
||||
width: 100%;
|
||||
|
||||
.persons-list {
|
||||
margin-top: 12px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.empty-hint {
|
||||
margin-top: 12px;
|
||||
padding: 12px;
|
||||
background-color: #f5f7fa;
|
||||
border-radius: 4px;
|
||||
color: #909399;
|
||||
font-size: 13px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
|
||||
i {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.advanced-settings {
|
||||
margin: 20px 0;
|
||||
|
||||
:deep(.el-collapse-item__header) {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
}
|
||||
}
|
||||
|
||||
.form-item-hint {
|
||||
margin-left: 12px;
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
|
||||
@@ -330,4 +164,14 @@ export default {
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-radio-group) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
|
||||
.el-radio {
|
||||
line-height: 32px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,173 +1,161 @@
|
||||
<template>
|
||||
<div class="project-table-container">
|
||||
<el-card class="table-card" shadow="hover">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
style="width: 100%"
|
||||
:header-cell-style="{ background: '#f5f7fa', color: '#606266', fontWeight: '600' }"
|
||||
<el-table
|
||||
:data="dataList"
|
||||
:loading="loading"
|
||||
border
|
||||
style="width: 100%"
|
||||
>
|
||||
<!-- 项目名称(含描述) -->
|
||||
<el-table-column
|
||||
label="项目名称"
|
||||
min-width="300"
|
||||
align="left"
|
||||
>
|
||||
<!-- 序号 -->
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
width="60"
|
||||
align="center"
|
||||
/>
|
||||
<template slot-scope="scope">
|
||||
<div class="project-info-cell">
|
||||
<div class="project-name">{{ scope.row.projectName }}</div>
|
||||
<div class="project-desc">{{ scope.row.description || '暂无描述' }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 项目名称 -->
|
||||
<el-table-column
|
||||
label="项目名称"
|
||||
min-width="160"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div class="project-name-cell">
|
||||
<div class="name">{{ scope.row.projectName }}</div>
|
||||
<div class="desc">{{ scope.row.projectDesc }}</div>
|
||||
<!-- 项目状态 -->
|
||||
<el-table-column
|
||||
prop="status"
|
||||
label="项目状态"
|
||||
width="100"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="getStatusType(scope.row.status)">
|
||||
<dict-tag :options="dict.type.ccdi_project_status" :value="scope.row.status"/>
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 目标人数 -->
|
||||
<el-table-column
|
||||
prop="targetCount"
|
||||
label="目标人数"
|
||||
width="100"
|
||||
align="center"
|
||||
/>
|
||||
|
||||
<!-- 预警人数(带悬停详情) -->
|
||||
<el-table-column
|
||||
label="预警人数"
|
||||
width="120"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip placement="top" effect="light">
|
||||
<div slot="content">
|
||||
<div style="padding: 8px;">
|
||||
<div style="margin-bottom: 8px; font-weight: bold; color: #303133;">
|
||||
风险人数统计
|
||||
</div>
|
||||
<div style="margin-bottom: 6px;">
|
||||
<span style="color: #f56c6c;">● 高风险:</span>
|
||||
<span style="font-weight: bold;">{{ scope.row.highRiskCount }} 人</span>
|
||||
</div>
|
||||
<div style="margin-bottom: 6px;">
|
||||
<span style="color: #e6a23c;">● 中风险:</span>
|
||||
<span style="font-weight: bold;">{{ scope.row.mediumRiskCount }} 人</span>
|
||||
</div>
|
||||
<div>
|
||||
<span style="color: #909399;">● 低风险:</span>
|
||||
<span style="font-weight: bold;">{{ scope.row.lowRiskCount }} 人</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 创建时间 -->
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="createTime"
|
||||
width="110"
|
||||
align="center"
|
||||
/>
|
||||
|
||||
<!-- 状态 -->
|
||||
<el-table-column
|
||||
label="状态"
|
||||
prop="projectStatus"
|
||||
width="90"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
:type="getStatusType(scope.row.projectStatus)"
|
||||
size="medium"
|
||||
effect="plain"
|
||||
>
|
||||
{{ getStatusLabel(scope.row.projectStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 目标人数 -->
|
||||
<el-table-column
|
||||
label="目标人数"
|
||||
prop="targetCount"
|
||||
width="80"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span class="count-number">{{ scope.row.targetCount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 预警人数 -->
|
||||
<el-table-column
|
||||
label="预警人数"
|
||||
width="90"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span :class="getWarningClass(scope.row)">{{ scope.row.warningCount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 操作 -->
|
||||
<el-table-column
|
||||
label="操作"
|
||||
width="200"
|
||||
align="center"
|
||||
fixed="right"
|
||||
class-name="operation-column"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div class="operation-buttons">
|
||||
<!-- 进行中项目 -->
|
||||
<template v-if="scope.row.projectStatus === '0'">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-s-data"
|
||||
@click="handleEnter(scope.row)"
|
||||
>进入项目</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-refresh"
|
||||
@click="handleReAnalyze(scope.row)"
|
||||
>重新分析</el-button>
|
||||
</template>
|
||||
|
||||
<!-- 已完成项目 -->
|
||||
<template v-else-if="scope.row.projectStatus === '1'">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleViewResult(scope.row)"
|
||||
>查看结果</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-refresh"
|
||||
@click="handleReAnalyze(scope.row)"
|
||||
>重新分析</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-folder"
|
||||
@click="handleArchive(scope.row)"
|
||||
>归档</el-button>
|
||||
</template>
|
||||
|
||||
<!-- 已归档项目 -->
|
||||
<template v-else>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-document"
|
||||
@click="handleDetail(scope.row)"
|
||||
>查看详情</el-button>
|
||||
</template>
|
||||
<div class="warning-count-wrapper">
|
||||
<span :class="getWarningClass(scope.row)" style="cursor: pointer;">
|
||||
{{ scope.row.highRiskCount + scope.row.mediumRiskCount + scope.row.lowRiskCount }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
:current-page="pageParams.pageNum"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="pageParams.pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 创建人 -->
|
||||
<el-table-column
|
||||
prop="createByName"
|
||||
label="创建人"
|
||||
width="120"
|
||||
align="center"
|
||||
/>
|
||||
|
||||
<!-- 创建时间 -->
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="创建时间"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 操作列 -->
|
||||
<el-table-column
|
||||
label="操作"
|
||||
width="200"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleDetail(scope.row)"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope.row)"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
v-show="total > 0"
|
||||
:current-page="pageParams.pageNum"
|
||||
:page-size="pageParams.pageSize"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
style="margin-top: 16px; text-align: right;"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ProjectTable',
|
||||
dicts: ['ccdi_project_status', 'ccdi_config_type'],
|
||||
props: {
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
dataList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
total: {
|
||||
type: Number,
|
||||
default: 0
|
||||
@@ -181,57 +169,45 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 获取状态类型 */
|
||||
getStatusType(status) {
|
||||
const statusMap = {
|
||||
'0': 'primary', // 进行中
|
||||
'1': 'success', // 已完成
|
||||
'2': 'info' // 已归档
|
||||
'0': 'primary', // 进行中
|
||||
'1': 'success', // 已完成
|
||||
'2': 'info' // 已归档
|
||||
}
|
||||
return statusMap[status] || 'info'
|
||||
},
|
||||
/** 获取状态标签 */
|
||||
getStatusLabel(status) {
|
||||
const statusMap = {
|
||||
'0': '进行中',
|
||||
'1': '已完成',
|
||||
'2': '已归档'
|
||||
}
|
||||
return statusMap[status] || '未知'
|
||||
},
|
||||
/** 获取预警数量样式类名 */
|
||||
|
||||
getWarningClass(row) {
|
||||
if (row.warningCount > 20) return 'warning-high'
|
||||
if (row.warningCount > 10) return 'warning-medium'
|
||||
return 'warning-normal'
|
||||
const total = row.highRiskCount + row.mediumRiskCount + row.lowRiskCount
|
||||
if (row.highRiskCount > 0) {
|
||||
return 'text-danger text-bold'
|
||||
} else if (row.mediumRiskCount > 0) {
|
||||
return 'text-warning text-bold'
|
||||
} else if (total > 0) {
|
||||
return 'text-info'
|
||||
}
|
||||
return ''
|
||||
},
|
||||
/** 进入项目 */
|
||||
handleEnter(row) {
|
||||
this.$emit('enter', row)
|
||||
},
|
||||
/** 查看详情 */
|
||||
|
||||
handleDetail(row) {
|
||||
this.$emit('detail', row)
|
||||
},
|
||||
/** 查看结果 */
|
||||
handleViewResult(row) {
|
||||
this.$emit('view-result', row)
|
||||
|
||||
handleEdit(row) {
|
||||
this.$emit('edit', row)
|
||||
},
|
||||
/** 重新分析 */
|
||||
handleReAnalyze(row) {
|
||||
this.$emit('re-analyze', row)
|
||||
|
||||
handleDelete(row) {
|
||||
this.$emit('delete', row)
|
||||
},
|
||||
/** 归档 */
|
||||
handleArchive(row) {
|
||||
this.$emit('archive', row)
|
||||
},
|
||||
/** 分页大小变化 */
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.$emit('pagination', { pageSize: val, pageNum: 1 })
|
||||
this.$emit('pagination', { pageNum: this.pageParams.pageNum, pageSize: val })
|
||||
},
|
||||
/** 当前页变化 */
|
||||
|
||||
handleCurrentChange(val) {
|
||||
this.$emit('pagination', { pageNum: val })
|
||||
this.$emit('pagination', { pageNum: val, pageSize: this.pageParams.pageSize })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -239,115 +215,49 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.project-table-container {
|
||||
margin-bottom: 12px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.table-card {
|
||||
border-radius: 4px;
|
||||
border: 1px solid #EBEEF5;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
|
||||
.project-info-cell {
|
||||
padding: 8px 0;
|
||||
line-height: 1.5;
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.project-name-cell {
|
||||
.name {
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
margin-bottom: 2px;
|
||||
.project-name {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
margin-bottom: 4px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.desc {
|
||||
.project-desc {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.count-number {
|
||||
font-weight: 500;
|
||||
color: #606266;
|
||||
.warning-count-wrapper {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.warning-count-cell {
|
||||
.warning-high {
|
||||
color: #F56C6C;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.warning-medium {
|
||||
color: #E6A23C;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.warning-normal {
|
||||
color: #67C23A;
|
||||
font-weight: 400;
|
||||
}
|
||||
.text-danger {
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
.pagination-container {
|
||||
padding: 12px 16px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
border-top: 1px solid #EBEEF5;
|
||||
.text-warning {
|
||||
color: #e6a23c;
|
||||
}
|
||||
|
||||
// 表格行样式优化
|
||||
:deep(.el-table) {
|
||||
.el-table__row {
|
||||
transition: background-color 0.3s;
|
||||
|
||||
&:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
}
|
||||
|
||||
.el-table__body-wrapper {
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background-color: #dcdfe6;
|
||||
border-radius: 3px;
|
||||
|
||||
&:hover {
|
||||
background-color: #c0c4cc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 操作列样式
|
||||
.operation-column {
|
||||
.cell {
|
||||
padding: 0 8px;
|
||||
}
|
||||
}
|
||||
.text-info {
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.operation-buttons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 2px;
|
||||
flex-wrap: nowrap;
|
||||
white-space: nowrap;
|
||||
|
||||
:deep(.el-button--mini) {
|
||||
padding: 4px 6px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
:deep(.el-button--mini .el-icon--left) {
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
:deep(.el-button + .el-button) {
|
||||
margin-left: 0;
|
||||
}
|
||||
.text-bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -86,7 +86,7 @@ export default {
|
||||
emitQuery() {
|
||||
this.$emit('query', {
|
||||
projectName: this.searchKeyword || null,
|
||||
projectStatus: this.selectedStatus || null
|
||||
status: this.selectedStatus || null
|
||||
})
|
||||
},
|
||||
/** 新增 */
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getMockProjectList} from '@/api/ccdiProject'
|
||||
import {listProject} from '@/api/ccdiProject'
|
||||
import SearchBar from './components/SearchBar'
|
||||
import ProjectTable from './components/ProjectTable'
|
||||
import QuickEntry from './components/QuickEntry'
|
||||
@@ -96,7 +96,7 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectName: null,
|
||||
projectStatus: null
|
||||
status: null
|
||||
},
|
||||
// 新增/编辑弹窗
|
||||
addDialogVisible: false,
|
||||
@@ -116,8 +116,8 @@ export default {
|
||||
/** 查询项目列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
// 使用Mock数据
|
||||
getMockProjectList().then(response => {
|
||||
// 使用真实API
|
||||
listProject(this.queryParams).then(response => {
|
||||
this.projectList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
@@ -158,11 +158,9 @@ export default {
|
||||
},
|
||||
/** 提交项目表单 */
|
||||
handleSubmitProject(data) {
|
||||
// 这里应该调用实际的API
|
||||
console.log('提交项目数据:', data)
|
||||
this.$modal.msgSuccess('项目创建成功')
|
||||
// 不需要再次调用API,因为AddProjectDialog已经处理了
|
||||
this.addDialogVisible = false
|
||||
this.getList()
|
||||
this.getList() // 刷新列表
|
||||
},
|
||||
/** 导入历史项目 */
|
||||
handleImport() {
|
||||
|
||||
Reference in New Issue
Block a user