1
continuous-integration/drone/push Build is passing Details

uat_us
wangxiaoshuang 2024-10-25 15:26:21 +08:00
parent 4c8f2675ad
commit 7eff02eb9b
1 changed files with 99 additions and 71 deletions

View File

@ -2,27 +2,18 @@
<BaseContainer> <BaseContainer>
<template slot="search-container"> <template slot="search-container">
<el-form :inline="true" size="small"> <el-form :inline="true" size="small">
<el-form-item label="文件类型:"> <el-form-item label="文件类型:">
<el-select <el-select v-model="searchData.FileTypeId" style="width: 150px">
v-model="searchData.FileTypeId"
style="width:150px;"
>
<el-option <el-option
v-for="item of dict.type.Sys_Document" v-for="item of dict.type.Sys_Document"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="文件名称"> <el-form-item label="文件名称">
<el-input <el-input v-model="searchData.Name" style="width: 130px" clearable />
v-model="searchData.Name"
style="width:130px;"
clearable
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -31,7 +22,11 @@
{{ $t('common:button:search') }} {{ $t('common:button:search') }}
</el-button> </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') }} {{ $t('common:button:reset') }}
</el-button> </el-button>
</el-form-item> </el-form-item>
@ -39,7 +34,7 @@
<el-button <el-button
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
style="margin-left:auto;" style="margin-left: auto"
size="small" size="small"
@click="handleAdd" @click="handleAdd"
> >
@ -48,7 +43,7 @@
</template> </template>
<template slot="main-container"> <template slot="main-container">
<el-table <el-table
v-adaptive="{bottomOffset:60}" v-adaptive="{ bottomOffset: 60 }"
v-loading="loading" v-loading="loading"
:data="list" :data="list"
stripe stripe
@ -81,7 +76,11 @@
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.NeedConfirmedUserTypes?scope.row.NeedConfirmedUserTypes.join(', '):'' }} {{
scope.row.NeedConfirmedUserTypes
? scope.row.NeedConfirmedUserTypes.join(', ')
: ''
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -91,7 +90,17 @@
sortable="custom" sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.IsDeleted?'Yes':'No' }} {{ scope.row.IsDeleted ? 'Yes' : 'No' }}
</template>
</el-table-column>
<el-table-column
prop="DocUserSignType"
label="是否仅内部签署"
show-overflow-tooltip
sortable="custom"
>
<template slot-scope="scope">
{{ $fd('ReadingYesOrNo', Number(scope.row.DocUserSignType)) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -103,16 +112,10 @@
<el-table-column label="Action"> <el-table-column label="Action">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button type="text" @click="handlePreview(scope.row)">
type="text"
@click="handlePreview(scope.row)"
>
预览 预览
</el-button> </el-button>
<el-button <el-button type="text" @click="handleEdit(scope.row)">
type="text"
@click="handleEdit(scope.row)"
>
编辑 编辑
</el-button> </el-button>
<el-button <el-button
@ -122,17 +125,20 @@
> >
废除 废除
</el-button> </el-button>
<el-button <el-button type="text" @click="handleDelete(scope.row)">
type="text"
@click="handleDelete(scope.row)"
>
删除 删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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 <el-dialog
@ -143,7 +149,11 @@
width="600px" width="600px"
custom-class="base-dialog-wrapper" custom-class="base-dialog-wrapper"
> >
<TemplateForm :data="currentRow" @closeDialog="closeDialog" @getList="getList" /> <TemplateForm
:data="currentRow"
@closeDialog="closeDialog"
@getList="getList"
/>
</el-dialog> </el-dialog>
<!-- 预览文件 --> <!-- 预览文件 -->
@ -155,10 +165,16 @@
append-to-body append-to-body
custom-class="base-dialog-wrapper" custom-class="base-dialog-wrapper"
> >
<div class="base-modal-body" style="border:2px solid #ccc;padding: 10px"> <div
<PreviewFile v-if="previewVisible" :file-path="currentPath" :file-type="currentType" /> class="base-modal-body"
style="border: 2px solid #ccc; padding: 10px"
>
<PreviewFile
v-if="previewVisible"
:file-path="currentPath"
:file-type="currentType"
/>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
</BaseContainer> </BaseContainer>
@ -175,7 +191,7 @@ const searchDataDefault = () => {
FileTypeId: '', FileTypeId: '',
Name: '', Name: '',
PageIndex: 1, PageIndex: 1,
PageSize: 20 PageSize: 20,
} }
} }
export default { export default {
@ -193,7 +209,7 @@ export default {
editVisible: false, editVisible: false,
previewVisible: false, previewVisible: false,
title: '', title: '',
loading: false loading: false,
} }
}, },
mounted() { mounted() {
@ -203,10 +219,11 @@ export default {
// //
getList() { getList() {
this.loading = true this.loading = true
getSystemDocumentList(this.searchData).then(res => { getSystemDocumentList(this.searchData)
.then((res) => {
this.loading = false this.loading = false
const { CurrentPageData, TotalCount } = res.Result const { CurrentPageData, TotalCount } = res.Result
CurrentPageData.forEach(item => { CurrentPageData.forEach((item) => {
item.NeedConfirmedUserTypes = [] item.NeedConfirmedUserTypes = []
item.NeedConfirmedUserTypeIds = [] item.NeedConfirmedUserTypeIds = []
item.NeedConfirmedUserTypeList.forEach((i) => { item.NeedConfirmedUserTypeList.forEach((i) => {
@ -216,7 +233,8 @@ export default {
}) })
this.list = CurrentPageData this.list = CurrentPageData
this.total = TotalCount this.total = TotalCount
}).catch(() => { })
.catch(() => {
this.loading = false this.loading = false
}) })
}, },
@ -230,7 +248,9 @@ export default {
handlePreview(row) { handlePreview(row) {
const { Name, FullFilePath } = row const { Name, FullFilePath } = row
this.currentPath = FullFilePath 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 this.previewVisible = true
}, },
// //
@ -244,36 +264,44 @@ export default {
this.$confirm('是否确认废除此文件?', { this.$confirm('是否确认废除此文件?', {
type: 'warning', type: 'warning',
distinguishCancelAndClose: true, distinguishCancelAndClose: true,
}) })
.then(() => { .then(() => {
this.loading = true this.loading = true
userAbandonDoc(row.Id, true) userAbandonDoc(row.Id, true)
.then(res => { .then((res) => {
this.loading = false this.loading = false
if (res.IsSuccess) { if (res.IsSuccess) {
this.getList() this.getList()
this.$message.success(this.$t('common:message:savedSuccessfully')) this.$message.success(
this.$t('common:message:savedSuccessfully')
)
} }
}).catch(() => { this.loading = false }) })
}).catch(() => {}) .catch(() => {
this.loading = false
})
})
.catch(() => {})
}, },
// //
handleDelete(row) { handleDelete(row) {
this.$confirm(this.$t('trials:staffResearch:message:confirmDel'), { this.$confirm(this.$t('trials:staffResearch:message:confirmDel'), {
type: 'warning', type: 'warning',
distinguishCancelAndClose: true distinguishCancelAndClose: true,
}) }).then(() => {
.then(() => {
this.loading = true this.loading = true
deleteSystemDocument(row.Id) deleteSystemDocument(row.Id)
.then(res => { .then((res) => {
this.loading = false this.loading = false
if (res.IsSuccess) { if (res.IsSuccess) {
this.list.splice(this.list.findIndex(item => item.Id === row.Id), 1) this.list.splice(
this.list.findIndex((item) => item.Id === row.Id),
1
)
this.$message.success('删除成功!') this.$message.success('删除成功!')
} }
}).catch(() => { })
.catch(() => {
this.loading = false this.loading = false
}) })
}) })
@ -305,7 +333,7 @@ export default {
this.searchData.SortField = column.prop this.searchData.SortField = column.prop
this.searchData.PageIndex = 1 this.searchData.PageIndex = 1
this.getList() this.getList()
} },
} },
} }
</script> </script>