项目总览新增下载记录列表
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2024-05-28 11:15:52 +08:00
parent fd46407dfa
commit 5bb0479f45
1 changed files with 251 additions and 0 deletions

View File

@ -0,0 +1,251 @@
<template>
<BaseContainer>
<template slot="search-container">
<el-form :inline="true">
<el-form-item
:label="$t('trials:downloadRecord:table:SubjectCode')"
prop="SubjectCode"
>
<el-input
v-model="searchData.SubjectCode"
size="small"
clearable
style="width: 120px"
/>
</el-form-item>
<el-form-item :label="$t('trials:downloadRecord:table:IP')" prop="IP">
<el-input
v-model="searchData.IP"
size="small"
clearable
style="width: 120px"
/>
</el-form-item>
<el-form-item
:label="$t('trials:downloadRecord:table:VisitName')"
prop="VisitName"
>
<el-input
v-model="searchData.VisitName"
size="small"
clearable
style="width: 120px"
/>
</el-form-item>
<el-form-item
:label="$t('trials:downloadRecord:table:Name')"
prop="LoginUserName"
>
<el-input
v-model="searchData.Name"
size="small"
clearable
style="width: 120px"
/>
</el-form-item>
<!-- 下载日期 -->
<el-form-item :label="$t('trials:downloadRecord:table:DownloadTime')">
<el-date-picker
v-model="dateValue"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">
{{ $t("common:button:search") }}
</el-button>
<!-- 重置 -->
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t("common:button:reset") }}
</el-button>
</el-form-item>
</el-form>
</template>
<template slot="main-container">
<el-table
v-loading="loading"
v-adaptive="{ bottomOffset: 60 }"
height="100"
:data="list"
class="table"
@sort-change="handleSortByColumn"
:default-sort="{ prop: 'DownloadTime', order: 'descending' }"
>
<el-table-column type="index" width="50" />
<!--受试者-->
<el-table-column
:label="$t('trials:downloadRecord:table:SubjectCode')"
prop="SubjectCode"
min-width="90"
show-overflow-tooltip
sortable="custom"
>
</el-table-column>
<!--ip-->
<el-table-column
:label="$t('trials:downloadRecord:table:IP')"
prop="IP"
min-width="90"
show-overflow-tooltip
sortable="custom"
/>
<!--访视名-->
<el-table-column
:label="$t('trials:downloadRecord:table:VisitName')"
prop="VisitName"
min-width="90"
show-overflow-tooltip
sortable="custom"
/>
<!--下载用户名称-->
<el-table-column
:label="$t('trials:downloadRecord:table:DownloadUserName')"
prop="DownloadUserName"
min-width="90"
show-overflow-tooltip
sortable="custom"
>
</el-table-column>
<!--下载用户别名--->
<el-table-column
:label="$t('trials:downloadRecord:table:DownLoadUserFullName')"
prop="DownLoadUserFullName"
min-width="90"
show-overflow-tooltip
sortable="custom"
/>
<!--下载图像数量--->
<el-table-column
:label="$t('trials:downloadRecord:table:VisitImageFileCount')"
prop="VisitImageFileCount"
min-width="90"
show-overflow-tooltip
sortable="custom"
/>
<!--下载图像大小--->
<el-table-column
:label="$t('trials:downloadRecord:table:VisitImageFileSize')"
prop="VisitImageZipSize"
min-width="90"
show-overflow-tooltip
sortable="custom"
>
<template slot-scope="scope">
<span>{{
scope.row.VisitImageZipSize && scope.row.VisitImageZipSize > 0
? `${Math.ceil(scope.row.VisitImageZipSize / 1024 / 1024)}MB`
: 0
}}</span>
</template>
</el-table-column>
<!--下载时间--->
<el-table-column
:label="$t('trials:downloadRecord:table:DownloadTime')"
prop="DownloadTime"
min-width="90"
show-overflow-tooltip
sortable="custom"
/>
</el-table>
<!-- 分页组件 -->
<pagination
class="page"
:total="total"
:page.sync="searchData.PageIndex"
:limit.sync="searchData.PageSize"
@pagination="getList"
/>
</template>
</BaseContainer>
</template>
<script>
import { getTrialSubjectVisitDownloadList } from "@/api/inspection";
import BaseContainer from "@/components/BaseContainer";
import Pagination from "@/components/Pagination";
const searchDataDefault = () => {
return {
TrialId: "",
SubjectCode: null,
IP: "",
VisitName: "",
Name: "",
BeginDownloadTime: null,
EndDownloadTime: null,
Asc: false,
SortField: "DownloadTime",
PageIndex: 1,
PageSize: 20,
};
};
export default {
components: { BaseContainer, Pagination },
data() {
return {
searchData: searchDataDefault(),
list: [],
total: 0,
loading: false,
dateValue: [],
};
},
mounted() {
this.getList();
},
methods: {
getList() {
this.loading = true;
this.searchData.TrialId = this.$route.query.trialId;
if (this.dateValue && this.dateValue[0] && this.dateValue[1]) {
this.searchData.BeginDownloadTime = this.$moment(
this.dateValue[0]
).format("YYYY-MM-DD HH:mm:ss");
this.searchData.EndDownloadTime = this.$moment(
this.dateValue[1]
).format("YYYY-MM-DD HH:mm:ss");
} else {
this.searchData.BeginDownloadTime = null;
this.searchData.EndDownloadTime = null;
}
getTrialSubjectVisitDownloadList(this.searchData)
.then((res) => {
this.loading = false;
this.list = res.Result.CurrentPageData;
this.total = res.Result.TotalCount;
})
.catch(() => {
this.loading = false;
});
},
handleSearch() {
this.searchData.PageIndex = 1;
this.getList();
},
//
handleReset() {
this.searchData = searchDataDefault();
this.dateValue = [];
this.getList();
},
//
handleSortByColumn(column) {
if (column.order === "ascending") {
this.searchData.Asc = true;
} else {
this.searchData.Asc = false;
}
this.searchData.SortField = column.prop;
this.searchData.PageIndex = 1;
this.getList();
},
},
};
</script>