培训文件显示创建时间,不展示更新时间
continuous-integration/drone/push Build is passing Details

uat_us
wangxiaoshuang 2024-12-20 11:03:46 +08:00
parent c24c98b334
commit 2c0c2e8111
3 changed files with 114 additions and 56 deletions

View File

@ -104,8 +104,8 @@
</template>
</el-table-column>
<el-table-column
prop="UpdateTime"
label="上传时间"
prop="CreateTime"
label="创建时间"
show-overflow-tooltip
sortable="custom"
/>

View File

@ -456,7 +456,6 @@ export default {
},
//
setPassword(val) {
console.log(val)
if (this.isShowPassword) {
this.loginForm.password = val
} else {

View File

@ -1,5 +1,5 @@
<template>
<box-content style="height: 100%;background: #fff;">
<box-content style="height: 100%; background: #fff">
<!-- 搜索框 -->
<div class="search">
<el-form :inline="true" class="base-search-form">
@ -8,7 +8,7 @@
<el-select
v-model="searchData.FileTypeId"
clearable
style="width:150px;"
style="width: 150px"
>
<el-option
v-for="item of $d.Trial_Document"
@ -20,14 +20,14 @@
</el-form-item>
<!-- 文件名称 -->
<el-form-item :label="$t('trials:attachment:table:fileName')">
<el-input v-model="searchData.Name" style="width:100px;" />
<el-input v-model="searchData.Name" style="width: 100px" />
</el-form-item>
<!-- 培训状态 -->
<el-form-item :label="$t('trials:attachment:table:isDeleted')">
<el-select
clearable
v-model="searchData.IsDeleted"
style="width:150px;"
style="width: 150px"
>
<el-option
v-for="item of $d.TrainingStatus"
@ -42,11 +42,18 @@
<el-select
v-model="searchData.UserTypeId"
clearable
style="width:100%;"
style="width: 100%"
>
<el-option
v-for="item of userTypeOptions"
v-show="item.UserTypeEnum !== 1 && item.UserTypeEnum !== 8 && item.UserTypeEnum !== 20 && item.UserTypeEnum !== 26 && item.UserTypeEnum !== 27 && item.UserTypeEnum !== 31"
v-show="
item.UserTypeEnum !== 1 &&
item.UserTypeEnum !== 8 &&
item.UserTypeEnum !== 20 &&
item.UserTypeEnum !== 26 &&
item.UserTypeEnum !== 27 &&
item.UserTypeEnum !== 31
"
:key="item.Id"
:label="item.UserTypeShortName"
:value="item.Id"
@ -56,19 +63,22 @@
</el-select>
</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">
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t('common:button:reset') }}
</el-button>
</el-form-item>
</el-form>
<span style="margin-left:auto;">
<span style="margin-left: auto">
<!-- 新增 -->
<el-button
v-hasPermi="['trials:trials-panel:setting:attachment:add']"
@ -85,7 +95,7 @@
<el-table
ref="attachmentList"
v-loading="loading"
v-adaptive="{bottomOffset:60}"
v-adaptive="{ bottomOffset: 60 }"
:data="list"
stripe
height="100"
@ -125,8 +135,12 @@
min-width="100"
>
<template slot-scope="scope">
<el-tag v-if="scope.row.IsDeleted" type="danger">{{ $fd('TrainingStatus', !scope.row.IsDeleted) }}</el-tag>
<el-tag v-else type="primary">{{ $fd('TrainingStatus', !scope.row.IsDeleted) }}</el-tag>
<el-tag v-if="scope.row.IsDeleted" type="danger">{{
$fd('TrainingStatus', !scope.row.IsDeleted)
}}</el-tag>
<el-tag v-else type="primary">{{
$fd('TrainingStatus', !scope.row.IsDeleted)
}}</el-tag>
</template>
</el-table-column>
<!-- 需要签署的用户类型 -->
@ -137,7 +151,11 @@
min-width="100"
>
<template slot-scope="scope">
{{ scope.row.NeedConfirmedUserTypes?scope.row.NeedConfirmedUserTypes.join(', '):'' }}
{{
scope.row.NeedConfirmedUserTypes
? scope.row.NeedConfirmedUserTypes.join(', ')
: ''
}}
</template>
</el-table-column>
<!-- 描述 -->
@ -148,14 +166,21 @@
min-width="300"
/> -->
<!-- 更新时间 -->
<el-table-column
<!-- <el-table-column
prop="UpdateTime"
:label="$t('trials:attachment:table:updateTime')"
show-overflow-tooltip
sortable="custom"
min-width="160"
/> -->
<!--创建时间-->
<el-table-column
prop="CreateTime"
:label="$t('trials:attachment:table:CreateTime')"
show-overflow-tooltip
sortable="custom"
min-width="160"
/>
<el-table-column
:label="$t('common:action:action')"
min-width="140"
@ -192,7 +217,13 @@
</el-table>
<!-- 分页组件 -->
<pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize" @pagination="getList" />
<pagination
class="page"
:total="total"
:page.sync="searchData.PageIndex"
:limit.sync="searchData.PageSize"
@pagination="getList"
/>
<!-- 新增/编辑 -->
<el-dialog
@ -203,7 +234,11 @@
width="800px"
custom-class="base-dialog-wrapper"
>
<AttachmentForm :data="currentRow" @closeDialog="closeDialog" @getList="getList" />
<AttachmentForm
:data="currentRow"
@closeDialog="closeDialog"
@getList="getList"
/>
</el-dialog>
<!-- 预览文件 -->
@ -215,16 +250,25 @@
append-to-body
custom-class="base-dialog-wrapper"
>
<div class="base-modal-body" style="border:2px solid #ccc;padding: 10px">
<PreviewFile v-if="previewVisible" :file-path="currentPath" :file-type="currentType" />
<div
class="base-modal-body"
style="border: 2px solid #ccc; padding: 10px"
>
<PreviewFile
v-if="previewVisible"
:file-path="currentPath"
:file-type="currentType"
/>
</div>
</el-dialog>
</box-content>
</template>
<script>
import { getTrialDocumentList, userAbandonDoc, getTrialUserTypeList } from '@/api/trials'
import {
getTrialDocumentList,
userAbandonDoc,
getTrialUserTypeList,
} from '@/api/trials'
import BoxContent from '@/components/BoxContent'
import Pagination from '@/components/Pagination'
import AttachmentForm from './components/attachmentForm'
@ -238,7 +282,7 @@ const searchDataDefault = () => {
SortField: '',
Asc: false,
IsDeleted: null,
UserTypeId: null
UserTypeId: null,
}
}
export default {
@ -258,7 +302,7 @@ export default {
currentPath: '',
currentType: '',
trialId: '',
userTypeOptions: []
userTypeOptions: [],
}
},
mounted() {
@ -271,10 +315,11 @@ export default {
getList() {
this.loading = true
this.searchData.TrialId = this.trialId
getTrialDocumentList(this.searchData).then(res => {
getTrialDocumentList(this.searchData)
.then((res) => {
this.loading = false
const { CurrentPageData, TotalCount } = res.Result
CurrentPageData.forEach(item => {
CurrentPageData.forEach((item) => {
item.NeedConfirmedUserTypes = []
item.NeedConfirmedUserTypeeIds = []
item.NeedConfirmedUserTypeList.forEach((i) => {
@ -284,18 +329,24 @@ export default {
})
this.list = CurrentPageData
this.total = TotalCount
}).catch(() => {
})
.catch(() => {
this.loading = false
})
},
//
getUserType() {
getTrialUserTypeList().then(res => {
getTrialUserTypeList()
.then((res) => {
this.userTypeOptions = res.Result
if (this.form.Id) {
this.form.NeedConfirmedUserTypeIdList = this.data.NeedConfirmedUserTypeeIds
this.form.NeedConfirmedUserTypeIdList =
this.data.NeedConfirmedUserTypeeIds
}
}).catch(() => { this.loading = false })
})
.catch(() => {
this.loading = false
})
},
//
handleAdd() {
@ -307,7 +358,9 @@ export default {
handlePreview(row) {
const { Name, FullFilePath } = row
this.currentPath = FullFilePath
this.currentType = row.Name ? Name.substring(Name.lastIndexOf('.') + 1).toLocaleLowerCase() : ''
this.currentType = row.Name
? Name.substring(Name.lastIndexOf('.') + 1).toLocaleLowerCase()
: ''
this.previewVisible = true
},
//
@ -320,19 +373,25 @@ export default {
handleRepeal(row) {
this.$confirm(this.$t('trials:attachment:message:abolish'), {
type: 'warning',
distinguishCancelAndClose: true
distinguishCancelAndClose: true,
})
.then(() => {
this.loading = true
userAbandonDoc(row.Id, false)
.then(res => {
.then((res) => {
this.loading = false
if (res.IsSuccess) {
this.getList()
this.$message.success(this.$t('trials:trials-list:message:abolitionSuccessfully'))
this.$message.success(
this.$t('trials:trials-list:message:abolitionSuccessfully')
)
}
}).catch(() => { this.loading = false })
}).catch(() => {})
})
.catch(() => {
this.loading = false
})
})
.catch(() => {})
},
//
closeDialog() {
@ -361,7 +420,7 @@ export default {
this.searchData.SortField = column.prop
this.searchData.PageIndex = 1
this.getList()
}
}
},
},
}
</script>