feat: 病例管理页面
parent
8c0663abf8
commit
27df2efab9
@ -0,0 +1,133 @@
|
||||
<script setup lang="ts">
|
||||
import { PaginationProps } from "@pureadmin/table";
|
||||
|
||||
import { reactive, ref } from "vue";
|
||||
import { queryPageList } from "@/api/generalRules";
|
||||
import { onMounted } from "vue";
|
||||
defineOptions({
|
||||
name: "ConsultationResults"
|
||||
});
|
||||
|
||||
const dataList = ref([{}]);
|
||||
const loading = ref(false);
|
||||
const AddEditRef = ref(null);
|
||||
const seachForm = reactive({
|
||||
description: ""
|
||||
});
|
||||
const pagination = reactive<PaginationProps>({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
const columns: TableColumnList = [
|
||||
{
|
||||
label: "问诊类目",
|
||||
prop: "nameZhPath",
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
label: "问题",
|
||||
prop: "description",
|
||||
minWidth: 240
|
||||
},
|
||||
{
|
||||
label: "回复",
|
||||
prop: "defaultAnswer"
|
||||
},
|
||||
{
|
||||
label: "操作",
|
||||
fixed: "right",
|
||||
slot: "operation"
|
||||
}
|
||||
];
|
||||
const getData = async () => {
|
||||
const params = {
|
||||
pageNum: pagination.currentPage,
|
||||
pageSize: pagination.pageSize,
|
||||
description: seachForm.description
|
||||
};
|
||||
const res: any = await queryPageList(params);
|
||||
dataList.value = res.data.records;
|
||||
pagination.total = res.data.total;
|
||||
};
|
||||
function handleSizeChange(val: number) {
|
||||
pagination.pageSize = val;
|
||||
getData();
|
||||
}
|
||||
|
||||
function handleCurrentChange(val: number) {
|
||||
pagination.currentPage = val;
|
||||
getData();
|
||||
}
|
||||
const search = () => {
|
||||
pagination.currentPage = 1;
|
||||
pagination.pageSize = 10;
|
||||
getData();
|
||||
};
|
||||
|
||||
const reset = () => {
|
||||
seachForm.description = "";
|
||||
search();
|
||||
};
|
||||
const add = () => {
|
||||
AddEditRef.value.open();
|
||||
};
|
||||
const edit = item => {
|
||||
AddEditRef.value.open(JSON.parse(JSON.stringify(item)));
|
||||
};
|
||||
onMounted(() => {
|
||||
getData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="app-main-content">
|
||||
<div class="seach">
|
||||
<el-form :model="seachForm">
|
||||
<el-row>
|
||||
<el-form-item label="问题:">
|
||||
<el-input size="large" v-model="seachForm.description" />
|
||||
</el-form-item>
|
||||
|
||||
<el-button class="ml-8" size="large" @click="search" type="primary"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button size="large" @click="reset">重置</el-button>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="main-table">
|
||||
<div class="main-table-title">
|
||||
<div class="title">
|
||||
<div class="line" />
|
||||
<span>问诊结果</span>
|
||||
</div>
|
||||
<el-row class="mb-6">
|
||||
<el-button size="large" @click="add" type="primary"
|
||||
>批量删除</el-button
|
||||
>
|
||||
</el-row>
|
||||
</div>
|
||||
<pure-table
|
||||
align-whole="center"
|
||||
showOverflowTooltip
|
||||
table-layout="auto"
|
||||
:loading="loading"
|
||||
adaptive
|
||||
:data="dataList"
|
||||
:columns="columns"
|
||||
:pagination="pagination"
|
||||
:header-cell-style="{
|
||||
background: 'var(--el-table-row-hover-bg-color)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}"
|
||||
@page-size-change="handleSizeChange"
|
||||
@page-current-change="handleCurrentChange"
|
||||
><template #operation="{ row }">
|
||||
<el-button link type="primary" @click="edit(row)">编辑</el-button>
|
||||
</template>
|
||||
</pure-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
Loading…
Reference in New Issue