nursing_unit_vue/src/views/services/directivePackage/DirectivePackageList.vue

221 lines
6.4 KiB
Vue
Raw Normal View History

2025-03-24 14:59:31 +08:00
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" :model="searchForm" :label-col="labelCol" :wrapper-col="wrapperCol">
2025-03-24 14:59:31 +08:00
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="packageName">
<template #label><span title="服务指令包名称">服务指令包</span></template>
<a-input v-model:value="searchForm.packageName" allow-clear />
2025-03-24 14:59:31 +08:00
</a-form-item>
</a-col>
2025-05-13 15:34:20 +08:00
<a-col :lg="6" :sm="24">
2025-03-24 14:59:31 +08:00
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd"
style="margin-left: 8px">新增</a-button>
2025-03-24 14:59:31 +08:00
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<a-row>
2025-05-14 10:41:21 +08:00
<a-col :span="6" v-for="directive of tableData.records" :key="directive.id" style="padding: 5px 10px 0 0;height: 220px;">
<a-row style="padding: 5px;background-color: white;border-radius: 8px;height: 200px;">
2025-05-07 14:04:02 +08:00
<a-col :span="4">
<div class="bjclass">
<img src="/src/assets/images/logo.png" style="width: 40px;height:40px;margin-top: 10px;" />
</div>
</a-col>
2025-05-14 10:41:21 +08:00
<a-col :span="20" style="padding: 15px;">
2025-05-07 14:04:02 +08:00
<div>
<span class="titleOne">{{ directive.packageName }}</span>
</div>
2025-05-14 10:41:21 +08:00
<div style="height: 100px">
2025-05-07 14:04:02 +08:00
<span class="ellipsis-two-lines" :title="directive.description">{{ directive.description }}</span>
</div>
<div style="color: #857f7f;">
<span style="float:left;"><Icon icon="ant-design:user-add-outlined" :size="18" /><span style="margin-left:5px;">{{ directive.createBy_dictText }}</span></span>
<span style="margin-left: 15px;float:left;"><Icon icon="ant-design:field-time-outlined" :size="20" /><span style="margin-left:5px;font-size:16px;">{{ directive.createTime.substring(0,10) }}</span></span>
2025-05-14 10:41:21 +08:00
<span style="float:right;">
2025-05-07 14:04:02 +08:00
<a-dropdown :trigger="['hover']" placement="topRight">
<a-button type="link"><Icon icon="ant-design:more-outlined" :size="20" /></a-button>
<template #overlay>
<a-menu>
<a-menu-item @click="packageEdit(directive)">
<template #icon></template>
编辑
</a-menu-item>
<a-menu-item>
<a-popconfirm title="是否确认删除?" ok-text="确认" cancel-text="取消" @confirm="remove(directive)">
删除
</a-popconfirm>
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</span>
</div>
</a-col>
</a-row>
</a-col>
</a-row>
<div
2025-05-14 10:41:21 +08:00
style="float:right;bottom: 20px;z-index: 999;padding: 8px 16px;border-radius: 4px;display: flex;align-items: center;">
<span style="margin-right: 10px;"> {{ tableData.total }} 条数据</span>
<Pagination showLessItems v-model:current="pageParams.pageNo" :pageSize="pageParams.pageSize" size="small"
show-quick-jumper :total="tableData.total" @change="queryList" />
</div>
2025-03-24 14:59:31 +08:00
</div>
<!-- 表单区域 -->
<DirectivePackageModal ref="registerModal" @success="handleSuccess"></DirectivePackageModal>
2025-03-24 14:59:31 +08:00
</template>
<script lang="ts" name="directivePackage-directivePackage" setup>
import { ref, reactive, onMounted } from 'vue';
2025-03-24 14:59:31 +08:00
import DirectivePackageModal from './components/DirectivePackageModal.vue'
2025-03-28 16:44:40 +08:00
import { list, queryById, deleteOne } from './DirectivePackage.api'
import { Pagination } from 'ant-design-vue';
2025-03-24 14:59:31 +08:00
const registerModal = ref();
const searchForm = ref({})
const tableData = ref({})
2025-03-24 14:59:31 +08:00
const labelCol = reactive({
2025-05-13 15:34:20 +08:00
xs:24,
sm:6,
xl:6,
xxl:6
});
const wrapperCol = reactive({
xs: 24,
sm: 24,
});
2025-05-07 14:04:02 +08:00
const pageParams = ref({ pageNo: 1, pageSize: 12 })
2025-05-14 10:41:21 +08:00
// function onShowSizeChange (current, pageSize) {
// pageParams.value.pageSize = pageSize
// console.log(current, pageSize);
// };
2025-03-24 14:59:31 +08:00
/**
* 搜索
2025-03-24 14:59:31 +08:00
*/
function searchQuery() {
2025-05-14 10:41:21 +08:00
pageParams.value.pageNo = 1
queryList()
2025-03-24 14:59:31 +08:00
}
/**
* 重置
2025-03-24 14:59:31 +08:00
*/
function searchReset() {
searchForm.value = {}
2025-05-14 10:41:21 +08:00
pageParams.value.pageNo = 1
queryList()
2025-03-24 14:59:31 +08:00
}
/**
* 新增
2025-03-24 14:59:31 +08:00
*/
function handleAdd() {
2025-03-24 14:59:31 +08:00
registerModal.value.disableSubmit = false;
registerModal.value.add();
2025-03-24 14:59:31 +08:00
}
/**
* 成功回调
*/
function handleSuccess() {
2025-05-14 10:41:21 +08:00
queryList()
2025-03-24 14:59:31 +08:00
}
/**
* 数据查询
2025-03-24 14:59:31 +08:00
*/
function queryList() {
list({ pageNo: pageParams.value.pageNo, pageSize: pageParams.value.pageSize, packageName: searchForm.value.packageName }).then(res => {
tableData.value = res
})
2025-03-24 14:59:31 +08:00
}
/**
* 编辑
* @param data
2025-03-24 14:59:31 +08:00
*/
function packageEdit(data) {
queryById({ id: data.id }).then(item => {
registerModal.value.edit(item);
})
2025-03-24 14:59:31 +08:00
}
/**
* 移除
* @param data
2025-03-24 14:59:31 +08:00
*/
function remove(data) {
2025-03-28 16:44:40 +08:00
deleteOne({ id: data.id }, handleSuccess())
}
2025-03-24 14:59:31 +08:00
onMounted(() => {
2025-05-14 10:41:21 +08:00
queryList()
})
2025-03-24 14:59:31 +08:00
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
2025-05-07 14:04:02 +08:00
.bjclass{
text-align: center;
2025-05-14 10:41:21 +08:00
margin-top: 24px;
2025-05-07 14:04:02 +08:00
border-radius: 50%;
width: 60px;
height: 60px;
background: linear-gradient(to bottom, #fff, #efe9e9);
2025-05-14 10:41:21 +08:00
margin-left: 9px;
2025-05-07 14:04:02 +08:00
}
.titleOne {
font-size: 16px;
font-weight: 600;
height: 40px;
line-height: 40px;
margin-bottom: 10px;
}
.ellipsis-two-lines {
display: -webkit-box;
-webkit-box-orient: vertical;
2025-05-14 10:41:21 +08:00
-webkit-line-clamp: 3; /* 限制文本为2行 */
2025-05-07 14:04:02 +08:00
overflow: hidden;
text-overflow: ellipsis;
line-height:24px;color: #5a5a5a;
}
2025-03-24 14:59:31 +08:00
</style>