优化打印
This commit is contained in:
parent
4be4bf155f
commit
2ccf8d4aa0
@ -179,3 +179,35 @@ export function getmonthst(data?: Object) {
|
||||
params: data
|
||||
})
|
||||
}
|
||||
//查询月室内质控小结
|
||||
export function getmonthpj(data?: Object) {
|
||||
return request({
|
||||
url: '/qcstat/getmonthpj',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
//保存月室内质控小结
|
||||
export function savemonthpj(data?: Object) {
|
||||
return request({
|
||||
url: '/qcstat/savemonthpj',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
//查询月失控情况总结
|
||||
export function getmonthskzj(data?: Object) {
|
||||
return request({
|
||||
url: '/qcstat/getmonthskzj',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
//保存月失控情况总结
|
||||
export function savemonthskzj(data?: Object) {
|
||||
return request({
|
||||
url: '/qcstat/savemonthskzj',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@ -125,6 +125,7 @@ aside {
|
||||
.app-container {
|
||||
padding: 10px 10px 0 10px;
|
||||
height: calc(100vh - 5.25rem);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.components-container {
|
||||
|
||||
@ -47,7 +47,8 @@ const getYqConfig = () => {
|
||||
if (res.code == 0) {
|
||||
instrOptions.value = res.data.map((item: any) => ({
|
||||
yq: item.yq.trim(),
|
||||
yqmc: item.yqmc
|
||||
yqmc: item.yqmc,
|
||||
lisgroupid: item.lisgroup
|
||||
}))
|
||||
}
|
||||
})
|
||||
|
||||
@ -71,9 +71,10 @@
|
||||
<el-button type="warning" :size="aotuSize" plain @click="sendSampleHandle">清单打印</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-select v-model="printName" placeholder="打印机设置" @visible-change="visibleChange" @change="changePrinter">
|
||||
<el-button type="warning" :size="aotuSize" plain @click="changePrinter">打印机设置</el-button>
|
||||
<!-- <el-select v-model="printName" placeholder="打印机设置" @visible-change="visibleChange" @change="changePrinter">
|
||||
<el-option v-for="item in printerList" :key="item.name" :label="item.name" :value="item.name" />
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@ -609,7 +610,20 @@ const visibleChange = (visible: boolean) => {
|
||||
};
|
||||
|
||||
const changePrinter = (value: string) => {
|
||||
printStore.setDefaultPrinter(value);
|
||||
// printStore.setDefaultPrinter(value);
|
||||
|
||||
const link = document.createElement('a');
|
||||
link.href = 'lisbarprint://setup';
|
||||
link.style.display = 'none';
|
||||
document.body.appendChild(link);
|
||||
|
||||
// 模拟点击
|
||||
link.click();
|
||||
|
||||
// 移除创建的标签(清理DOM)
|
||||
document.body.removeChild(link);
|
||||
|
||||
|
||||
};
|
||||
|
||||
const timeDate = () => {
|
||||
@ -752,7 +766,7 @@ const selectStatusRows = () => {
|
||||
|
||||
// 打印pdf
|
||||
const printPdf = () => {
|
||||
if (!printName.value) return ElMessage.warning("未设置打印机,请先设置打印机!");
|
||||
// if (!printName.value) return ElMessage.warning("未设置打印机,请先设置打印机!");
|
||||
const selections = tableRef.value.allSelection()
|
||||
if (selections.length <= 0) return ElMessage.warning('请选择数据!')
|
||||
ElMessageBox.confirm(`确定打印选中的数据吗?`, "提示", {
|
||||
@ -769,8 +783,18 @@ const printPdf = () => {
|
||||
}).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
done();
|
||||
// HiprintPrinter.silentPrint(res.data, printName.value);
|
||||
const link = document.createElement('a');
|
||||
link.href = `lisbarprint://${res.data}`;
|
||||
link.style.display = 'none';
|
||||
document.body.appendChild(link);
|
||||
|
||||
// 模拟点击
|
||||
link.click();
|
||||
|
||||
// 移除创建的标签(清理DOM)
|
||||
document.body.removeChild(link);
|
||||
getList()
|
||||
HiprintPrinter.silentPrint(res.data, printName.value);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
@ -8,7 +8,8 @@
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" inline class="demo-form-inline">
|
||||
<el-form-item label="仪器:">
|
||||
<YQSelectTable v-model:data="queryParams.yq" style="width: 150px;" />
|
||||
<SelectTable v-model:data="queryParams.yq" :tableData="instrOptions" style="width:200px"
|
||||
@get-data-value="getDataValue" />
|
||||
</el-form-item>
|
||||
<el-form-item label="质控月份:">
|
||||
<el-date-picker v-model="queryParams.zkrq" type="month" placeholder="请选择检查时间" value-format="YYYY-MM" />
|
||||
@ -32,14 +33,14 @@
|
||||
<div class="title">{{ formatDict(userStore.sysLoginParam.loginYLJG, 'HOS') }}</div>
|
||||
<div class="content">室内质控数据统计表</div>
|
||||
<div class="info">
|
||||
<div> 专业组:<span></span></div>
|
||||
<div> 仪器:<span>{{ queryParams.yq }}</span> </div>
|
||||
<div> 浓度: <span></span></div>
|
||||
<div> 专业组:<span>{{ lisgroup }}</span></div>
|
||||
<div> 仪器:<span>{{ yqmc }}</span> </div>
|
||||
<div> 浓度: <span>{{ ld }}</span></div>
|
||||
<div> 质控品号:<span>{{ queryParams.zkph }}</span> </div>
|
||||
<div> 质控月份:<span>{{ queryParams.zkrq }}</span> </div>
|
||||
</div>
|
||||
<div class="table-container">
|
||||
<el-table :data="tableData" height="100%" border highlightCurrentRow>
|
||||
<el-table :data="tableData" height="100%" border highlight-current-row v-loading="loading">
|
||||
<el-table-column label="质控项目" prop="xmdh" align="center" />
|
||||
<el-table-column label="测定数" prop="cnt" align="center" />
|
||||
<el-table-column label="失控数" prop="badcnt" align="center" />
|
||||
@ -71,7 +72,7 @@
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<el-dialog v-model="dialogVisible" :title="title" width="30%">
|
||||
<el-dialog v-model="dialogVisible" :title="title" width="30%" :close-on-click-modal="false" :draggable="true">
|
||||
<el-input v-model="inputValue" type="textarea" :rows="10" placeholder="请输入内容" />
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
@ -87,8 +88,9 @@
|
||||
import { getDictData, formatDict } from '@/hooks'
|
||||
import { useCommonStore } from '@/store/modules/commonStore';
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue'
|
||||
import { getmonthst } from '@/api/liswork/qualityControl/index'
|
||||
import { getmonthst, getmonthpj, savemonthpj, getmonthskzj, savemonthskzj } from '@/api/liswork/qualityControl/index'
|
||||
import { getComDicts } from "@/api/liswork/dict/ComDict";
|
||||
import { getGroupInstrdList } from "@/api/liswork/work/LisWork";
|
||||
import dayjs from 'dayjs';
|
||||
const userStore = useUserStore()
|
||||
const mbStore = useCommonStore();
|
||||
@ -100,7 +102,10 @@ const queryParams = reactive({
|
||||
zkph: '1',
|
||||
zkpph: ''
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
const lisgroup = ref('')
|
||||
const yqmc = ref('')
|
||||
const ld = ref('')
|
||||
const inputValue = ref('')
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('')
|
||||
@ -112,30 +117,91 @@ const viewHandle = () => {
|
||||
|
||||
}
|
||||
const skHandle = () => {
|
||||
getmonthskzj(queryParams).then((res) => {
|
||||
|
||||
});
|
||||
|
||||
title.value = '失控总结'
|
||||
dialogVisible.value = true
|
||||
}
|
||||
const byHandle = () => {
|
||||
getmonthpj(queryParams).then((res) => {
|
||||
|
||||
});
|
||||
title.value = '本月总结'
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
const subHandle = () => {
|
||||
if (title.value == '失控总结') {
|
||||
savemonthskzj({
|
||||
...queryParams,
|
||||
skzj: inputValue.value
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
});
|
||||
} else if (title.value == '本月总结') {
|
||||
savemonthpj({
|
||||
...queryParams,
|
||||
monthpj: inputValue.value
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
});
|
||||
}
|
||||
inputValue.value = ''
|
||||
dialogVisible.value = false
|
||||
|
||||
}
|
||||
|
||||
const getList = () => {
|
||||
getmonthst(queryParams).then((res) => {
|
||||
tableData.value = res.data || []
|
||||
const getDataValue = (val) => {
|
||||
yqmc.value = val.label
|
||||
lisgroup.value = instrGroupOptions.value.find(item => item.zddh == val.lisgroupid)?.zdmc || val.lisgroupid
|
||||
}
|
||||
|
||||
const instrGroupOptions = ref([])
|
||||
// 部门
|
||||
const getInstrGroupOptions = () => {
|
||||
getComDicts({ zdlb: 'GROUP' }).then((res) => {
|
||||
instrGroupOptions.value = res.data
|
||||
lisgroup.value = res.data.find(item => item.zddh == mbStore.defaultConfig.lisgroupid)?.zdmc || mbStore.defaultConfig.lisgroupid
|
||||
getYqConfig()
|
||||
});
|
||||
}
|
||||
const instrOptions = ref([])
|
||||
// 仪器
|
||||
const getYqConfig = () => {
|
||||
getGroupInstrdList().then((res) => {
|
||||
if (res.code == 0) {
|
||||
instrOptions.value = res.data.map((item) => ({
|
||||
value: item.yq.trim(),
|
||||
label: item.yqmc,
|
||||
lisgroupid: item.lisgroup
|
||||
}))
|
||||
yqmc.value = instrOptions.value.find(item => item.value == queryParams.yq)?.label || queryParams.yq
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
getList()
|
||||
const getList = () => {
|
||||
loading.value = true
|
||||
getmonthst(queryParams).then((res) => {
|
||||
loading.value = false
|
||||
tableData.value = res.data || []
|
||||
ld.value = res.data[0]?.ld || ''
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
getDictData('HOS')
|
||||
getInstrGroupOptions()
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -160,10 +226,13 @@ onMounted(() => {
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
padding: 5px 10px;
|
||||
padding: 0 10px;
|
||||
border-bottom: 1px solid #000;
|
||||
min-width: 100px;
|
||||
text-align: center;
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -207,6 +207,30 @@ const getEcharts = () => {
|
||||
itemStyle: { shadowColor: color[index], shadowBlur: index === 0 ? 10 : 0 },
|
||||
}],
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter: function (params) {
|
||||
// params:当前鼠标指向的数据点信息
|
||||
const [dataItem] = params;
|
||||
const levelName = dataItem.seriesName; // 水平1/水平2...
|
||||
const targetValue = '23'; // 靶值
|
||||
|
||||
return `
|
||||
<div style="padding: 8px; border: 1px solid #ccc; border-radius: 4px; min-width: 200px;">
|
||||
<div style="margin-bottom: 4px;"><strong>日期区间:</strong>${queryParams.st}</div>
|
||||
<div style="margin-bottom: 4px;"><strong>仪器:</strong>${yqmc.value || '未选择'}</div>
|
||||
<div style="margin-bottom: 4px;"><strong>${levelName} 靶值:</strong>${targetValue}</div>
|
||||
<div><strong>点位:</strong>${dataItem.name} <strong>SD值:</strong>${dataItem.value}</div>
|
||||
</div>
|
||||
`;
|
||||
},
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
boundaryGap: true,
|
||||
data: xAxisData,
|
||||
@ -281,6 +305,38 @@ const getEcharts = () => {
|
||||
textStyle: { color: '#000', fontSize: 12 },
|
||||
data: legendData,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter: function (params) {
|
||||
// 单图模式下params是所有水平的同点位数据
|
||||
let tooltipHtml = `
|
||||
<div style="padding: 8px; border: 1px solid #ccc; border-radius: 4px; min-width: 200px;">
|
||||
<div style="margin-bottom: 6px;"><strong>日期区间:</strong>${queryParams.st} </div>
|
||||
<div style="margin-bottom: 6px;"><strong>仪器:</strong>${yqmc.value || '未选择'}</div>
|
||||
<div style="font-weight: bold; margin-bottom: 4px;">点位 ${params[0].name} 数据:</div>
|
||||
`;
|
||||
|
||||
// 遍历每个水平的点位数据,展示靶值和SD值
|
||||
params.forEach(item => {
|
||||
const targetValue = '23'
|
||||
tooltipHtml += `
|
||||
<div style="margin-bottom: 2px;">
|
||||
<strong>${item.seriesName}:</strong>
|
||||
靶值 ${targetValue} SD值 ${item.value}
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
|
||||
tooltipHtml += `</div>`;
|
||||
return tooltipHtml;
|
||||
},
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
boundaryGap: true,
|
||||
data: xAxisData,
|
||||
|
||||
@ -67,11 +67,11 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" :size="aotuSize" plain>清单打印</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<!-- <el-col :span="4">
|
||||
<el-select v-model="printName" placeholder="打印机设置" @visible-change="visibleChange" @change="changePrinter">
|
||||
<el-option v-for="item in printerList" :key="item.name" :label="item.name" :value="item.name" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
|
||||
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig" :loading="loading"
|
||||
@ -670,7 +670,7 @@ const selectStatusRows = () => {
|
||||
|
||||
// 打印pdf
|
||||
const printPdf = () => {
|
||||
if (!printName.value) return ElMessage.warning("未设置打印机,请先设置打印机!");
|
||||
// if (!printName.value) return ElMessage.warning("未设置打印机,请先设置打印机!");
|
||||
if (sqhs.value.length <= 0) return ElMessage.warning('请选择数据!')
|
||||
ElMessageBox.confirm(`确定打印选中的数据吗?`, "提示", {
|
||||
confirmButtonText: "确认",
|
||||
|
||||
@ -1,178 +1,128 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="字典名称" prop="dictType">
|
||||
<el-select v-model="queryParams.dictType" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.dictId"
|
||||
:label="item.dictName"
|
||||
:value="item.dictType"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="字典标签" prop="dictLabel">
|
||||
<el-input
|
||||
v-model="queryParams.dictLabel"
|
||||
placeholder="请输入字典标签"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="数据状态" clearable style="width: 200px">
|
||||
<el-option
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</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>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="字典名称" prop="dictType">
|
||||
<el-select v-model="queryParams.dictType" style="width: 200px">
|
||||
<el-option v-for="item in typeOptions" :key="item.dictId" :label="item.dictName" :value="item.dictType" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="字典标签" prop="dictLabel">
|
||||
<el-input v-model="queryParams.dictLabel" placeholder="请输入字典标签" clearable style="width: 200px"
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="数据状态" clearable style="width: 200px">
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</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-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Close" @click="handleClose">关闭</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="字典编码" align="center" prop="dictCode" />
|
||||
<el-table-column label="字典标签" align="center" prop="dictLabel">
|
||||
<template #default="scope">
|
||||
<span
|
||||
v-if="(scope.row.listClass == '' || scope.row.listClass == 'default') && (scope.row.cssClass == '' || scope.row.cssClass == null)">{{
|
||||
scope.row.dictLabel }}</span>
|
||||
<el-tag v-else :type="scope.row.listClass == 'primary' ? '' : scope.row.listClass"
|
||||
:class="scope.row.cssClass">{{ scope.row.dictLabel }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="字典键值" align="center" prop="dictValue" />
|
||||
<el-table-column label="字典排序" align="center" prop="dictSort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:dict:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.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-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="dataRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="字典类型">
|
||||
<el-input v-model="form.dictType" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据标签" prop="dictLabel">
|
||||
<el-input v-model="form.dictLabel" placeholder="请输入数据标签" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据键值" prop="dictValue">
|
||||
<el-input v-model="form.dictValue" placeholder="请输入数据键值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="样式属性" prop="cssClass">
|
||||
<el-input v-model="form.cssClass" placeholder="请输入样式属性" />
|
||||
</el-form-item>
|
||||
<el-form-item label="显示排序" prop="dictSort">
|
||||
<el-input-number v-model="form.dictSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="回显样式" prop="listClass">
|
||||
<el-select v-model="form.listClass">
|
||||
<el-option v-for="item in listClassOptions" :key="item.value" :label="item.label + '(' + item.value + ')'"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
</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-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Close"
|
||||
@click="handleClose"
|
||||
>关闭</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="字典编码" align="center" prop="dictCode" />
|
||||
<el-table-column label="字典标签" align="center" prop="dictLabel">
|
||||
<template #default="scope">
|
||||
<span v-if="(scope.row.listClass == '' || scope.row.listClass == 'default') && (scope.row.cssClass == '' || scope.row.cssClass == null)">{{ scope.row.dictLabel }}</span>
|
||||
<el-tag v-else :type="scope.row.listClass == 'primary' ? '' : scope.row.listClass" :class="scope.row.cssClass">{{ scope.row.dictLabel }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="字典键值" align="center" prop="dictValue" />
|
||||
<el-table-column label="字典排序" align="center" prop="dictSort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.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-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="dataRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="字典类型">
|
||||
<el-input v-model="form.dictType" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据标签" prop="dictLabel">
|
||||
<el-input v-model="form.dictLabel" placeholder="请输入数据标签" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据键值" prop="dictValue">
|
||||
<el-input v-model="form.dictValue" placeholder="请输入数据键值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="样式属性" prop="cssClass">
|
||||
<el-input v-model="form.cssClass" placeholder="请输入样式属性" />
|
||||
</el-form-item>
|
||||
<el-form-item label="显示排序" prop="dictSort">
|
||||
<el-input-number v-model="form.dictSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="回显样式" prop="listClass">
|
||||
<el-select v-model="form.listClass">
|
||||
<el-option
|
||||
v-for="item in listClassOptions"
|
||||
:key="item.value"
|
||||
:label="item.label + '(' + item.value + ')'"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Data">
|
||||
@ -197,8 +147,8 @@ const typeOptions = ref([]);
|
||||
const route = useRoute();
|
||||
// 数据标签回显样式
|
||||
const listClassOptions = ref([
|
||||
{ value: "default", label: "默认" },
|
||||
{ value: "primary", label: "主要" },
|
||||
{ value: "default", label: "默认" },
|
||||
{ value: "primary", label: "主要" },
|
||||
{ value: "success", label: "成功" },
|
||||
{ value: "info", label: "信息" },
|
||||
{ value: "warning", label: "警告" },
|
||||
@ -273,7 +223,7 @@ function handleQuery() {
|
||||
}
|
||||
/** 返回按钮操作 */
|
||||
function handleClose() {
|
||||
const obj = { path: "/system/dict" };
|
||||
const obj = { path: "/systeminfo/dict" };
|
||||
proxy.$tab.closeOpenPage(obj);
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
@ -330,13 +280,13 @@ function submitForm() {
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const dictCodes = row.dictCode || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() {
|
||||
proxy.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function () {
|
||||
return delData(dictCodes);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
useDictStore().removeDict(queryParams.value.dictType);
|
||||
}).catch(() => {});
|
||||
}).catch(() => { });
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user