209 lines
6.0 KiB
Vue
209 lines
6.0 KiB
Vue
|
|
<script setup>
|
||
|
|
import {queryComDictListService} from "../../../api/liswork/dict/ComDict.js";
|
||
|
|
|
||
|
|
const { proxy } = getCurrentInstance();
|
||
|
|
|
||
|
|
const data = reactive({
|
||
|
|
form: {},
|
||
|
|
queryParams: {
|
||
|
|
pageNum: 1,
|
||
|
|
pageSize: 10,
|
||
|
|
zdmc: undefined,
|
||
|
|
zdlb: '00',
|
||
|
|
zddh: undefined,
|
||
|
|
yljg: '1'
|
||
|
|
},
|
||
|
|
rules: {
|
||
|
|
dictName: [{ required: true, message: "字典名称不能为空", trigger: "blur" }],
|
||
|
|
dictType: [{ required: true, message: "字典类型不能为空", trigger: "blur" }]
|
||
|
|
},
|
||
|
|
});
|
||
|
|
const { queryParams, form, rules } = toRefs(data);
|
||
|
|
const single = ref(true);
|
||
|
|
const multiple = ref(true);
|
||
|
|
const loading = ref(true);
|
||
|
|
const typeList = ref([])
|
||
|
|
const typeDetail = ref([])
|
||
|
|
const total = ref(0);
|
||
|
|
const zdlbmc = ref('');
|
||
|
|
const zdlbRef = ref('')
|
||
|
|
|
||
|
|
|
||
|
|
function resetData(zdlb){
|
||
|
|
queryParams.value = {
|
||
|
|
pageNum: 1,
|
||
|
|
pageSize: 10,
|
||
|
|
zdmc: undefined,
|
||
|
|
zdlb: zdlb,
|
||
|
|
zddh: undefined,
|
||
|
|
yljg: '1'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function getTypeList(){
|
||
|
|
loading.value = true;
|
||
|
|
queryParams.value.pageSize = 1000;
|
||
|
|
queryParams.value.zdlb = '00'
|
||
|
|
queryComDictListService(queryParams.value).then(response => {
|
||
|
|
typeList.value = response.rows;
|
||
|
|
total.value = response.total;
|
||
|
|
loading.value = false;
|
||
|
|
resetData()
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
function refreshDetail(zdlb){
|
||
|
|
queryParams.value.zdlb = zdlb;
|
||
|
|
getList()
|
||
|
|
resetData(zdlb)
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/** 查询字典明细列表 */
|
||
|
|
function getList() {
|
||
|
|
loading.value = true;
|
||
|
|
queryComDictListService(queryParams.value).then(response => {
|
||
|
|
typeDetail.value = response.rows;
|
||
|
|
total.value = response.total;
|
||
|
|
loading.value = false;
|
||
|
|
});
|
||
|
|
//resetData()
|
||
|
|
}
|
||
|
|
|
||
|
|
//查询
|
||
|
|
function handleQuery(){
|
||
|
|
queryParams.value.pageNum = 1;
|
||
|
|
getList();
|
||
|
|
}
|
||
|
|
|
||
|
|
//重置
|
||
|
|
function resetQuery(){
|
||
|
|
queryParams.value = {
|
||
|
|
zdmc: '',
|
||
|
|
zddh: ''
|
||
|
|
}
|
||
|
|
proxy.resetForm("queryRef");
|
||
|
|
handleQuery();
|
||
|
|
}
|
||
|
|
|
||
|
|
//新增
|
||
|
|
function handleAdd(){
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
//修改
|
||
|
|
function handleUpdate(){
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
//删除
|
||
|
|
function handleDelete(){
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
//导出
|
||
|
|
function handleExport(){
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
//多选框选中数据
|
||
|
|
function handleSelectionChange(){
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
//查询字典大类
|
||
|
|
function handleQueryDetail(){
|
||
|
|
queryParams.value.zdmc = zdlbmc.value
|
||
|
|
getTypeList()
|
||
|
|
resetData()
|
||
|
|
}
|
||
|
|
|
||
|
|
getTypeList()
|
||
|
|
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<template>
|
||
|
|
<div class="app-container">
|
||
|
|
<el-row :gutter="20">
|
||
|
|
<el-col :span="4" :xs="24">
|
||
|
|
<div class="head-container">
|
||
|
|
<el-input v-model="zdlbmc" clearable placeholder="请输入字典名称" prefix-icon="Search" style="margin-bottom: 20px" @keyup.enter="handleQueryDetail" @clear="handleQueryDetail" />
|
||
|
|
</div>
|
||
|
|
<div class="head-container">
|
||
|
|
<el-card class="scrollable-card">
|
||
|
|
<div class="card-content">
|
||
|
|
<p class="clickable" v-for="item in typeList" :key="item.zdlb" @click="refreshDetail(item.zddh)">{{ item.zdmc }}</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</el-card>
|
||
|
|
</div>
|
||
|
|
</el-col>
|
||
|
|
<!-- 字典明细-->
|
||
|
|
<el-col :span="20" :xs="24">
|
||
|
|
<!-- 表单区域-->
|
||
|
|
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
|
||
|
|
<el-form-item class="cus-el-form-item" label="名称" prop="dictName">
|
||
|
|
<el-input v-model="queryParams.zdmc" placeholder="请输入名称" clearable style="width: 240px" @keyup.enter="handleQuery"/>
|
||
|
|
</el-form-item>
|
||
|
|
<el-form-item class="cus-el-form-item" label="明细代号" prop="status">
|
||
|
|
<el-input v-model="queryParams.zddh" placeholder="请输入明细代号" clearable style="width: 240px" @keyup.enter="handleQuery"/>
|
||
|
|
</el-form-item>
|
||
|
|
<el-form-item>
|
||
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||
|
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||
|
|
</el-form-item>
|
||
|
|
</el-form>
|
||
|
|
|
||
|
|
<el-row :gutter="10" class="mb8">
|
||
|
|
<el-col :span="1.5">
|
||
|
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:dict:add']">新增</el-button>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="1.5">
|
||
|
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['system:dict:edit']">修改</el-button>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="1.5">
|
||
|
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:dict:remove']">删除</el-button>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="1.5">
|
||
|
|
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:dict:export']">导出</el-button>
|
||
|
|
</el-col>
|
||
|
|
</el-row>
|
||
|
|
<!-- 表格区域-->
|
||
|
|
<el-table v-loading="loading" :data="typeDetail" @selection-change="handleSelectionChange">
|
||
|
|
<el-table-column type="selection" width="55" align="center" />
|
||
|
|
<el-table-column label='字典类型' align="center" prop="zdlb" :show-overflow-tooltip="true"/>
|
||
|
|
<el-table-column label="明细代号" align="center" prop="zddh" />
|
||
|
|
<el-table-column label="名称" align="center" prop="zdmc" :show-overflow-tooltip="true"/>
|
||
|
|
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||
|
|
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
||
|
|
<template #default="{row}">
|
||
|
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(row)" v-hasPermi="['system:dict:edit']">修改</el-button>
|
||
|
|
<el-button link type="primary" icon="Delete" @click="handleDelete(row)" v-hasPermi="['system:dict:remove']">删除</el-button>
|
||
|
|
</template>
|
||
|
|
</el-table-column>
|
||
|
|
</el-table>
|
||
|
|
|
||
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList"/>
|
||
|
|
|
||
|
|
</el-col>
|
||
|
|
</el-row>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<style scoped lang="scss">
|
||
|
|
|
||
|
|
.scrollable-card .card-content {
|
||
|
|
max-height: 450px; /* 设置最大高度 */
|
||
|
|
overflow-y: auto; /* 超出高度时显示垂直滚动条 */
|
||
|
|
padding: 16px; /* 保持与卡片默认一致的内边距 */
|
||
|
|
}
|
||
|
|
.clickable:hover {
|
||
|
|
cursor: pointer; /* 鼠标悬停时显示手型 */
|
||
|
|
transition: all 0.3s; /* 平滑过渡效果 */
|
||
|
|
color: blue;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
</style>
|