Commit 5c9fb340 authored by wenyi.chen's avatar wenyi.chen

增加指标完整页面

parent c7009759
......@@ -35,6 +35,13 @@ export function normApi() {
data,
});
},
normPartDetail: (data) => {
return request({
url: '/api/norm/partDetail',
method: 'post',
data,
});
},
normEdit: (data) => {
return request({
url: '/api/norm/edit',
......
......@@ -100,7 +100,7 @@ const state = reactive({
const getInfo = ()=>{
state.loading = true
// 清空数据
normApi().normDetail(state.apiData).then(res => {
normApi().normPartDetail(state.apiData).then(res => {
let addItem = res.data.addItem;
let custom = res.data.custom;
// 数据详情
......
......@@ -9,14 +9,12 @@
</el-page-header>
</div>
</div>
<div class="page-main" ref="pageMain" v-loading="state.loading">
<div class="page-main" ref="pageMain" v-loading="state.loading">
<el-card shadow="hover">
<el-table :data="state.tableData" border style="width: 100%" :height="state.tableHeight"
<el-table :data="state.tableData" border style="width: 100%;" :height="state.tableHeight"
ref="multipleTableRef">
<el-table-column v-for="column in state.columns" :key="column.prop" :label="column.label" :prop="column.prop" :width="column.width" show-overflow-tooltip align="center">
<template #default="scope">
<el-link type="danger" v-if="checkUrl(scope.row[column.prop])" :href="scope.row[column.prop]" target ="_blank">点击查看</el-link>
<span v-else>{{scope.row[column.prop]}}</span>
<el-table-column :cell-style="{ 'white-space': 'normal' }" v-for="column in state.columns" :key="column.prop" :label="column.label" :prop="column.prop" :width="column.width" show-overflow-tooltip align="center">
<template #default="scope"><span v-html="formatOutputCustom(scope.row[column.prop])"></span>
<!-- <span style="color:#409EFF" v-if="column.label =='用户名称'">{{scope.row[column.prop]}}</span>
<span style="color:#909399" v-else-if="column.label =='领取状态' && scope.row[column.prop] ==1">已领取</span>
<span style="color:#E6A23C" v-else-if="column.label =='完成状态' && scope.row[column.prop] ==0">未完成</span>
......@@ -54,7 +52,7 @@
apiData: {
id:'',
page: 1,
limit: 13,
limit: 10,
},
total: 0,
tableData:[],
......@@ -81,15 +79,15 @@
// 表格列名称
state.columns = [
{ label:'序号', prop: 'index',width:'80px'},
// { label:'ID', prop: 'id'},
{ label:'用户名称', prop: 'userInfo.name',width:120},
{ label:'ID', prop: 'id'},
{ label:'领取用户', prop: 'userInfo.name',width:120},
{ label:'任务名称', prop: 'task_info.name',width:180},
{ label:'子任务名称', prop: 'norm_info.name',width:180},
{ label:'指标名称', prop: 'norm_list_info.name',width:280},
{ label:'难度等级', prop: 'norm_info.level',width:180},
{ label:'参考信源', prop: 'norm_info.refer',width:180},
{ label:'单价', prop: 'norm_info.price',width:180},
{ label:'参考指南', prop: 'norm_info.guide',width:180},
{ label:'指标名称', prop: 'norm_list_info.name',width:280},
{ label:'上传文件', prop: 'fileListPdf',width:280},
];
titleColumn.forEach(function(item, index, arr) {
......@@ -101,6 +99,7 @@
receivesList.forEach(function(item, index, arr) {
let list = {
'index': index+1,
'id': item.id,
'userInfo.name': item.userInfo.name,
'task_info.name': item.task_info.name,
'norm_info.name': addItem.name,
......@@ -172,13 +171,52 @@
};
//校验链接
const checkUrl = (vlaue) =>{
if (/^https?:\/\//.test(vlaue)) {
return true;
} else {
return false;
}
if (/^https?:\/\//.test(vlaue)) {
return true;
} else {
return false;
}
}
/**
* 自定义内容格式化输出
* @param {*} vlaue
*/
const formatOutputCustom = (value) =>{
if(value&&typeof value =="string"){
let arr = value.split(',');
let txt = '';
arr.map((item, index) => {
let str = checkUrl(item);
if(str){
if(index==0){
txt+= "<a style='color:#409EFF;' href='"+item+"' target ='_blank'>"+item+"</a>";
}else{
txt+= "<br><br><a style='color:#409EFF;' href='"+item+"' target ='_blank'>"+item+"</a>";
}
}else{
txt+= item;
}
})
return txt;
}else{
return value;
}
}
// /**
// * 检查数据类型并且将多个逗号分隔成数组
// * @param {*} value
// */
// const inspectionType = (value) =>{
// if(typeof value =="string"){
// let arr = value.split(',');
// return arr;
// }else{
// return [value];
// }
// }
// 暴露变量
defineExpose({
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment