irc_web/.svn/pristine/ee/eea81a0b6a3eebe23ff7d02b24f...

230 lines
6.5 KiB
Plaintext

<template>
<box-content>
<!-- 搜索框 -->
<div class="search">
<el-form :inline="true" size="mini" class="base-search-form">
<el-form-item label="临床数据名称">
<el-input v-model="searchData.ClinicalDataSetName" />
</el-form-item>
<el-form-item label="数据级别">
<el-select v-model="searchData.ClinicalDataLevel" clearable style="width:120px;">
<el-option
v-for="(item,index) of $d.ClinicalLevel"
:key="index"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="传输方式">
<el-select v-model="searchData.ClinicalUploadType" clearable style="width:120px;">
<el-option
v-for="(item,index) of $d.ClinicalUploadType"
:key="index"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleReset">重置</el-button>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<span style="margin-left:auto">
<el-button type="primary" size="mini" @click="handleAdd">新增</el-button>
</span>
</div>
<el-table
v-loading="loading"
v-adaptive="{bottomOffset:45}"
:data="list"
stripe
size="small"
height="100"
>
<el-table-column type="index" width="60" />
<el-table-column
prop="ClinicalDataSetName"
label="临床数据名称"
show-overflow-tooltip
/>
<el-table-column
prop="ClinicalDataLevel"
label="数据级别"
show-overflow-tooltip
>
<template slot-scope="scope">
{{ $fd('ClinicalLevel',scope.row.ClinicalDataLevel) }}
</template>
</el-table-column>
<el-table-column
prop="ClinicalUploadType"
label="传输方式"
show-overflow-tooltip
>
<template slot-scope="scope">
{{ $fd('ClinicalUploadType',scope.row.ClinicalUploadType) }}
</template>
</el-table-column>
<el-table-column
prop="FileName"
label="模板名称"
show-overflow-tooltip
>
<template slot-scope="scope">
<a :href="scope.row.Path" target="_blank" style="color:#00D1B2">{{ scope.row.FileName }}</a>
</template>
</el-table-column>
<el-table-column
prop="UploadRole"
label="上传人"
show-overflow-tooltip
>
<template slot-scope="scope">
{{ $fd('ClinicalDataUploadRole',scope.row.UploadRole) }}
</template>
</el-table-column>
<el-table-column
prop="IsEnable"
label="状态"
show-overflow-tooltip
>
<template slot-scope="scope">
<el-tag v-if="scope.row.IsEnable">启用</el-tag>
<el-tag v-else type="danger">禁用</el-tag>
</template>
</el-table-column>
<el-table-column
prop="CreateTime"
label="创建时间"
show-overflow-tooltip
/>
<el-table-column label="操作" width="200" fixed="right">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="handleEdit(scope.row)"
>
编辑
</el-button>
<el-button
type="danger"
size="mini"
@click="handleDelete(scope.row)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog
v-if="addOrEditCD.visible"
:visible.sync="addOrEditCD.visible"
:close-on-click-modal="false"
:title="addOrEditCD.title"
width="500px"
append-to-body
custom-class="base-dialog-wrapper"
>
<ClinicalDataForm ref="addOrEditCD" :data="currentRow" @close="addOrEditCD.visible = false" @getList="getList" />
</el-dialog>
</box-content>
</template>
<script>
import { getClinicalDataSetList, deleteClinicalSetData } from '@/api/dictionary'
import BoxContent from '@/components/BoxContent'
import ClinicalDataForm from './ClinicalDataForm'
const searchDataDefault = () => {
return {
ClinicalDataSetName: '',
ClinicalDataLevel: null,
ClinicalUploadType: null
}
}
export default {
name: 'ClinicalDataTemplate',
components: { BoxContent, ClinicalDataForm },
data() {
return {
searchData: searchDataDefault(),
list: [],
total: 0,
loading: false,
currentRow: {},
addOrEditCD: { visible: false, title: '' }
}
},
mounted() {
this.getList()
},
methods: {
// 获取列表信息
getList() {
this.loading = true
getClinicalDataSetList(this.searchData).then(res => {
this.loading = false
this.list = res.Result
}).catch(() => { this.loading = false })
},
// 新增
handleAdd() {
this.currentRow = {}
this.addOrEditCD.title = '新增'
this.addOrEditCD.visible = true
},
// 编辑
handleEdit(row) {
this.currentRow = { ...row }
this.addOrEditCD.title = '编辑'
this.addOrEditCD.visible = true
},
// 删除
handleDelete(row) {
this.$confirm('是否确认删除?', {
type: 'warning',
distinguishCancelAndClose: true
})
.then(() => {
this.loading = true
deleteClinicalSetData(row.Id)
.then(res => {
this.loading = false
if (res.IsSuccess) {
this.getList()
this.$message.success('删除成功!')
}
}).catch(() => { this.loading = false })
})
},
// 排序
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()
},
// 查询
handleSearch() {
this.getList()
},
// 重置
handleReset() {
this.searchData = searchDataDefault()
this.getList()
}
}
}
</script>