555c7f5b by xukangle

fix

1 parent e2402a3a
import request from "@/utils/request";
/**
*@description 获取数据产品目录合规信息分页
*@path /dam-catalog-table/compliance-info/page-list
*@method post
*/
export const getComplianceInfoPageList = (params) => {
return request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/compliance-info/page-list`,
method: 'post',
data: params
})
}
/**
* @description 修改数据产品目录合规信息
* @path /dam-catalog-table/compliance-info/update
* @method post
*/
export const updateComplianceInfo = (params) => {
return request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/compliance-info/update`,
method: 'post',
data: params
})
}
......@@ -126,7 +126,6 @@ const getDetailInfo = () => {
if (res.code == proxy.$passCode) {
const data = res.data || {};
costAssessDetail.value = data;
console.log('costAssessDetail', costAssessDetail.value);
evaDetailInfo.value = data;
deploymentId.value = data.approveVO.camundaDeploymentId;
processInstanceId.value = data.approveVO?.camundaInstanceId;
......@@ -973,8 +972,8 @@ const formattedAmount = computed(() => {
</div>
</ContentWrap>
<ContentWrap id="id-qualityEvaluate"
v-if="route.query.type == 'qualityEvaluate' && evaDetailInfo.qualityScore != null" title="质量评价"
description="资产质量评价信息" style="margin: 16px 16px 16px">
v-if="(route.query.type == 'qualityEvaluate' && evaDetailInfo.qualityScore != null) || (route.query.type == 'costAssess' && evaDetailInfo.qualityScore != null)"
title="质量评价" description="资产质量评价信息" style="margin: 16px 16px 16px">
<div class="list_panel">
<div class="list_item">
<span class="item_label">质量得分:</span>
......
......@@ -140,6 +140,27 @@ const getDetailInfo = () => {
tabsInfo.value.tabs.splice(3, 1);
}
}
if (data.qualityScore) {
// 确保"质量评价"标签存在于tabs中,并插入到"价值评估"前面
const qualityTabIndex = tabsInfo.value.tabs.findIndex(tab => tab.name === "qualityEvaluate");
const costAssessTabIndex = tabsInfo.value.tabs.findIndex(tab => tab.name === "costAssess");
if (qualityTabIndex === -1) {
if (costAssessTabIndex > -1) {
// 如果"价值评估"标签存在,插入"质量评价"在它之前
tabsInfo.value.tabs.splice(costAssessTabIndex, 0, { label: "质量评价", name: "qualityEvaluate", description: '质量评估相关信息' });
} else {
// 如果没有"价值评估"标签,插入到最后
tabsInfo.value.tabs.push({ label: "质量评价", name: "qualityEvaluate", description: '质量评估相关信息' });
}
}
evaDetailInfo.value.qualityScore = data.qualityScore;
evaDetailInfo.value.evaluationRangeStart = data.evaluationRangeStart;
evaDetailInfo.value.evaluationRangeEnd = data.evaluationRangeEnd;
evaDetailInfo.value.evaluationNote = data.evaluationNote;
evaDetailInfo.value.evaluationFile = data.evaluationFile;
}
if (fullPath === route.fullPath) {
document.title = `详情-${data.daName}`;
}
......@@ -1690,8 +1711,9 @@ const formattedDate = (dateVal) => {
</div>
</div>
</ContentWrap>
<ContentWrap id="id-qualityEvaluate" v-if="tabsInfo.tabs.find(t => t.name == 'qualityEvaluate')" title="质量评价"
description="资产质量评价信息" expandSwicth style="margin-top: 15px" :isExpand="qualityEvaluateExpand"
<ContentWrap id="id-qualityEvaluate"
v-if="tabsInfo.tabs.find(t => t.name == 'qualityEvaluate') || (route.query.type == 'costAssess' && evaDetailInfo.qualityScore != null)"
title="质量评价" description="资产质量评价信息" expandSwicth style="margin-top: 15px" :isExpand="qualityEvaluateExpand"
@expand="(v) => qualityEvaluateExpand = v">
<div class="list_panel">
<div class="list_item">
......
......@@ -3,7 +3,10 @@
</route>
<script lang="ts" setup name="securityMenu">
import { onUploadFilePreview } from '@/api/modules/common';
import { getComplianceInfoPageList, updateComplianceInfo } from '@/api/modules/securityMenu';
import TableTools from '@/components/Tools/table_tools.vue';
import { ElMessage } from 'element-plus';
const { proxy } = getCurrentInstance() as any;
const dialogLabelFormRef = ref();
......@@ -13,11 +16,7 @@ onBeforeMount(async () => {
});
// 右侧表格配置
const tableDataList = ref([]);
// 删除标签guids
const deleteLabelGuids = ref<any>([]);
// 保存编辑的guid
const editLabelRow = ref<any>('');
const page = ref({
limit: 50,
curr: 1,
......@@ -35,16 +34,41 @@ const tableInfo = ref({
fixedSelection: true,
fields: [
{ label: "序号", type: "index", width: 56, align: "center" },
{ label: "数据产品编号", field: "label", type: 'text_btn', class: 'drawer-detail-cell', width: 160, value: 'detail', columClass: 'text_btn' },
{ label: "数据产品编号", field: "label", width: 140, },
{
label: "数据产品名称", field: "classifyNames", width: 200,
label: "数据产品名称", field: "damName", width: 150,
},
{ label: "数据类型", field: "gradeDetailName", width: 100 },
{ label: "数据类型", field: "damTypeName", width: 100 },
{
label: '权力主体', field: 'bizState', type: 'switch', activeText: '启用', inactiveText: '停用', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 100, align: 'center'
label: '权力主体', field: 'rightMain', width: 100,
},
{ label: "是否公共数据", field: "updateUserName", width: 120 },
{ label: "状态", field: "updateTime", width: 160 },
{
label: "是否公共数据", field: "isPublicData", width: 120, getName: (scope) => {
return scope.isPublicData == "Y" ? '是' : '否';
}
},
{
label: "状态", field: "updateTime", width: 100, getName: (scope) => {
//状态(1:待上传 2:部分上传 3:全部上传 )
return statusList.find((item) => item.value == scope.row.state)?.label || '待上传';
}
},
{
label: "合规评估报告", field: "complianceEvaluateReport", width: 120, type: 'text_btn', value: 'complianceEvaluateReport', columClass: 'text_btn', getName: (scope) => {
return scope.row.complianceEvaluateReport?.length > 0 ? '预览' : '--';
}
},
{
label: "合规法律意见书", field: "complianceLegalOpinion", width: 130, type: 'text_btn', value: 'complianceLegalOpinion', columClass: 'text_btn', getName: (scope) => {
return scope.row.complianceLegalOpinion?.length > 0 ? '预览' : '--';
}
},
{
label: "入表合规方案", field: "entryComplianceProgram", width: 120, type: 'text_btn', value: 'entryComplianceProgram', columClass: 'text_btn', getName: (scope) => {
return scope.row.entryComplianceProgram?.length > 0 ? '预览' : '--';
}
},
{ label: "操作时间", field: "updateTime", width: 120 },
],
data: tableDataList.value,
page: {
......@@ -52,63 +76,91 @@ const tableInfo = ref({
rows: 0,
...page.value,
},
loading: false,
actionInfo: {
label: "操作",
type: "btn",
width: 120,
width: 80,
fixed: 'right',
btns: [
{
label: "编辑", value: "edit", click: async (scope) => {
console.log('编辑', scope);
}
},
{
label: "删除 ", value: "delete", click: (scope) => {
console.log('删除', scope);
}
},
]
btns: (scope) => {
if (scope.row.state == 3) {
return [
{
label: "详情", value: "detail", click: (scope) => {
tableTempValue.value = scope.row;
formItems.value.forEach((item) => {
item.default = scope.row[item.field] || [];
});
dialogInfo.value.visible = true;
},
},
]
} else {
return [
{
label: "上传", value: "upload", click: (scope) => {
tableTempValue.value = scope.row;
formItems.value.forEach((item) => {
item.default = scope.row[item.field] || [];
});
dialogInfo.value.visible = true;
},
},
]
}
},
},
loading: false
});
const tableBtnClick = (scope, btn) => {
const type = btn.value;
const row = scope.row;
if ((type == 'complianceEvaluateReport' && row.complianceEvaluateReport.length > 0)) {
onUploadFilePreview(row.complianceEvaluateReport[0]);
}
else if ((type == 'complianceLegalOpinion' && row.complianceLegalOpinion.length > 0)) {
onUploadFilePreview(row.complianceLegalOpinion[0]);
}
else if ((type == 'entryComplianceProgram' && row.entryComplianceProgram.length > 0)) {
onUploadFilePreview(row.entryComplianceProgram[0]);
}
}
const formItems = ref([
{
label: '附件上传',
label: '合规评估报告',
tip: '支持格式:pdf,单个文件不能超过10MB ',
type: 'upload-file',
accept: '.pdf',
field: 'costAssessmentFile',
field: 'complianceEvaluateReport',
templateUrl: '',
required: true,
required: false,
block: true,
visible: true,
default: [],
},
{
label: '附件上传',
label: '合规法律意见书',
tip: '支持格式:pdf,单个文件不能超过10MB ',
type: 'upload-file',
accept: '.pdf',
field: 'costAssessmentFile1',
field: 'complianceLegalOpinion',
templateUrl: '',
required: true,
required: false,
block: true,
visible: true,
default: [],
},
{
label: '附件上传',
label: '入表合规方案',
tip: '支持格式:pdf,单个文件不能超过10MB ',
type: 'upload-file',
accept: '.pdf',
field: 'costAssessmentFile2',
field: 'entryComplianceProgram',
templateUrl: '',
required: true,
required: false,
block: true,
visible: true,
default: [],
......@@ -116,18 +168,7 @@ const formItems = ref([
]);
const formRules = ref({
registerGuid: [
{ required: true, trigger: 'change', message: "请填写资产名称" }
],
costAssessmentFile: [{
validator: (rule: any, value: any, callback: any) => {
if (!value?.length) {
callback(new Error('请上传数据价值评估附件'))
} else {
callback();
}
}, trigger: 'change'
}]
});
const dialogInfo = ref({
......@@ -135,7 +176,7 @@ const dialogInfo = ref({
size: 510,
direction: "column",
header: {
title: "价值评估发起",
title: "合规信息",
},
type: '',//标识是否是重新提交
contents: [
......@@ -157,22 +198,72 @@ const dialogInfo = ref({
},
});
const dialogBtnClick = () => {
console.log('handleSelectChange');
const tableTempValue = ref<any>('');
const dialogBtnClick = (btn, info) => {
console.log('currTableData', info);
if (btn.value == 'submit') {
tableInfo.value.loading = true;
let params: any = {
damGuid: tableTempValue.value.guid,
complianceEvaluateReport: info.complianceEvaluateReport?.map(file => {
return {
name: file.name,
url: file.url
}
}) || [],
complianceLegalOpinion: info.complianceLegalOpinion?.map(file => {
return {
name: file.name,
url: file.url
}
}) || [],
entryComplianceProgram: info.entryComplianceProgram?.map(file => {
return {
name: file.name,
url: file.url
}
}) || [],
}
updateComplianceInfo(params).then((res: any) => {
tableInfo.value.loading = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
ElMessage.success('上传成功');
dialogInfo.value.visible = false;
getTableData();
} else {
ElMessage.error('上传失败');
}
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
tableInfo.value.loading = false;
});
}
else if (btn.value == 'cancel') {
dialogInfo.value.visible = false;
}
};
//状态(1:待上传 2:部分上传 3:全部上传 )
const statusList = [
{ label: '待上传', value: 1 },
{ label: '部分上传', value: 2 },
{ label: '全部上传', value: 3 },
];
const classSearchItemList = ref<any>([
{
type: 'select',
type: 'input',
multiple: true,
label: '',
field: 'labelName',
default: [],
options: [],
placeholder: '请选择标签名称',
field: 'damName',
default: '',
placeholder: '请输入产品类型',
clearable: true,
filterable: true,
visible: true
},
// 状态,可以编辑。
......@@ -183,43 +274,54 @@ const classSearchItemList = ref<any>([
label: '',
field: 'state',
default: [],
options: [],
placeholder: '状态',
options: statusList,
multiply: true,
placeholder: '请选择状态',
clearable: true,
filterable: true,
visible: true
}
]);
const guids = ref<any>([])
const selectChange = async (val: any, row: any) => {
console.log('selectChange', val, row);
if (val) {
guids.value = val;
}
};
const searchItemValue: any = ref({});
/** 搜索查询分类标准 */
const refCount = ref(0);
const searchClass = async (val: any, clear: boolean = false) => {
console.log('searchClass', val, clear);
const toSearch = (val: any, clear: boolean = false) => {
if (clear) {
classSearchItemList.value.map(item => item.default = '')
guids.value = []
return;
classSearchItemList.value.map((item) => (item.default = ""));
searchItemValue.value = {};
} else {
searchItemValue.value = Object.keys(val).length ? { ...val } : {};
}
if (val?.labelName?.length !== 0 || refCount.value >= 1) {
}
page.value.curr = 1;
tableInfo.value.page.curr = 1;
getTableData();
};
const addNewLabel = () => {
dialogInfo.value.visible = true;
}
const tablePageChange = (info) => {
page.value.curr = Number(info.curr);
page.value.limit = Number(info.limit);
getTableData();
};
const getTableData = () => {
tableInfo.value.loading = true;
getComplianceInfoPageList(
Object.assign({}, searchItemValue.value, {
pageIndex: page.value.curr,
pageSize: page.value.limit,
})
)
.then((res: any) => {
tableInfo.value.loading = false;
tableInfo.value.data = res.data.records || [];
tableInfo.value.page.curr = res.data.pageIndex;
tableInfo.value.page.limit = res.data.pageSize;
tableInfo.value.page.rows = res.data.totalRows;
})
.catch((res) => {
tableInfo.value.loading = false;
});
};
</script>
......@@ -230,16 +332,10 @@ const addNewLabel = () => {
<div class="container_wrap">
<div class="main_wrap">
<div class="main_wrap-top-area">
<TableTools :searchItems="classSearchItemList" :searchId="'template-manage-search'" @search="searchClass"
@select-change="selectChange" />
</div>
<div>
<el-button type="primary" class="v-add" @click="addNewLabel">新增</el-button>
<!-- <el-button class="v-import">导入</el-button>
<el-button>导出</el-button> -->
<TableTools :searchItems="classSearchItemList" :searchId="'template-manage-search'" @search="toSearch" />
</div>
<div class="table_panel_wrap">
<Table :tableInfo="tableInfo" />
<Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
</div>
</div>
</div>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!