微调
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
<template>
|
||||
<el-dialog :title="dialogTitle" :model-value="visible" @close="handleCancel" v-bind="dialogSmall">
|
||||
<el-form :model="formData" :rules="rules">
|
||||
<el-form-item label="菜单名称" prop="name">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="formData.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单路径" prop="path">
|
||||
<el-form-item label="路径" prop="path">
|
||||
<el-input v-model="formData.path" />
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单排序" prop="sort">
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number v-model="formData.sort" />
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单类型" prop="type">
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select v-model="formData.type" placeholder="请选择资源类型">
|
||||
<el-option label="菜单" value="菜单" />
|
||||
<el-option label="按钮" value="按钮" />
|
||||
<el-option label="公共资源" value="公共资源" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单描述" prop="remark">
|
||||
<el-form-item label="描述" prop="remark">
|
||||
<el-input v-model="formData.remark" :rows="2" type="textarea"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="路由名称" prop="route_Name">
|
||||
<el-form-item label="路由" prop="route_Name">
|
||||
<el-input v-model="formData.route_Name" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
>
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader>
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openAddDialog">新增菜单</el-button>
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openAddDialog">新增</el-button>
|
||||
<el-button type='danger' :icon='Delete' plain :disabled='!multipleSelection.length' @click="handleDelList"
|
||||
>
|
||||
批量删除菜单
|
||||
批量删除
|
||||
</el-button>
|
||||
</template>
|
||||
<template>
|
||||
@@ -97,7 +97,7 @@
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
label: '资源类型',
|
||||
label: '类型',
|
||||
width: 150,
|
||||
// 字典数据(本地数据)
|
||||
//enum: dictStore.getDictData('type'),
|
||||
@@ -108,11 +108,10 @@
|
||||
render: ({ searchParam }) => {
|
||||
return (
|
||||
<div class='flx-center'>
|
||||
<el-select >
|
||||
<el-option ></el-option>
|
||||
<el-option label="未检测"></el-option>
|
||||
<el-option label="检测中"></el-option>
|
||||
<el-option label="检测完成"></el-option>
|
||||
<el-select placeholder="请选择">
|
||||
<el-option label="菜单"></el-option>
|
||||
<el-option label="按钮"></el-option>
|
||||
<el-option label="公共资源"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
@@ -123,7 +122,7 @@
|
||||
{
|
||||
prop: 'route_Name',
|
||||
width: 200,
|
||||
label: '路由名称',
|
||||
label: '路由',
|
||||
search: { el: 'input' },
|
||||
},
|
||||
{
|
||||
@@ -142,7 +141,7 @@
|
||||
width: 180,
|
||||
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', width: 200 },
|
||||
{ prop: 'operation', label: '操作', fixed: 'right' },
|
||||
])
|
||||
// 打开 drawer(新增、查看、编辑)
|
||||
// 打开新增对话框
|
||||
|
||||
@@ -36,35 +36,20 @@ const proTable = ref<ProTableInstance>()
|
||||
const columns = reactive<ColumnProps<Log.LogList>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 50 },
|
||||
{
|
||||
prop: 'content',
|
||||
label: '内容',
|
||||
width: 600,
|
||||
},
|
||||
{
|
||||
prop: 'record_Time',
|
||||
label: '记录时间',
|
||||
width: 180,
|
||||
prop: 'id',
|
||||
label: '序号',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
prop: 'user',
|
||||
label: '操作用户',
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
},
|
||||
|
||||
{
|
||||
prop: 'type',
|
||||
label: '日志类型',
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
},
|
||||
{
|
||||
prop: 'level',
|
||||
label: '日志等级',
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
prop: 'record_Time',
|
||||
label: '记录时间',
|
||||
isShow: false,
|
||||
width: 200,
|
||||
search: {
|
||||
span: 2,
|
||||
render: ({ searchParam }) => {
|
||||
@@ -76,6 +61,24 @@ const columns = reactive<ColumnProps<Log.LogList>[]>([
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'content',
|
||||
label: '内容',
|
||||
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
label: '日志类型',
|
||||
width: 200,
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
},
|
||||
{
|
||||
prop: 'level',
|
||||
label: '日志等级',
|
||||
width: 200,
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
},
|
||||
|
||||
])
|
||||
|
||||
//选中
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<el-tab-pane label="基础信息">
|
||||
<div class="form-grid">
|
||||
<el-form :model="formData" >
|
||||
<el-row :gutter="20" >
|
||||
<el-col :span="10">
|
||||
<el-row :gutter="160" >
|
||||
<el-col :span="9">
|
||||
<el-form-item label="误差体系名称" prop="name">
|
||||
<el-input v-model='formData.name' placeholder="标准号+年份+设备等级"/>
|
||||
</el-form-item>
|
||||
@@ -15,14 +15,14 @@
|
||||
<el-input v-model="formData.publishTime" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="7">
|
||||
<el-form-item label="上传误差体系截图" prop="screenshot">
|
||||
<el-button :icon="FolderOpened" type="primary"></el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" >
|
||||
<el-col :span="10">
|
||||
<el-row :gutter="160" >
|
||||
<el-col :span="9">
|
||||
<el-form-item label="适用设备等级" prop="level">
|
||||
<el-select v-model='formData.level' placeholder="请选择设备等级">
|
||||
<el-option label="A级" value="A级" />
|
||||
@@ -35,7 +35,7 @@
|
||||
<el-input v-model='formData.year'/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="7">
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-select v-model='formData.state' placeholder="请选择状态">
|
||||
<el-option label="启用" value="启用" />
|
||||
@@ -50,17 +50,17 @@
|
||||
</el-tabs>
|
||||
<div class="dialog-footer">
|
||||
<el-button :icon='CirclePlus' type="primary" @click="openAddDialog">新增</el-button>
|
||||
<el-button :icon='Delete' type="danger" >批量删除</el-button>
|
||||
<el-button :icon='Delete' type="danger" plain :disabled='!multipleSelection.length'>批量删除</el-button>
|
||||
</div>
|
||||
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<div class="table-container">
|
||||
<el-table :data="tableData" style="width: 100%" @selection-change="handleSelectionChange" >
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="id" label="序号" width="60" />
|
||||
<el-table-column prop="type" label="电能质量检测指标类型" width="200"/>
|
||||
<el-table-column label="起止范围" style="text-align: center;">
|
||||
<el-table-column label="起始" style="text-align: center;">
|
||||
<el-table-column label="起止范围" >
|
||||
<el-table-column label="起始">
|
||||
<template #default="{ row }">
|
||||
<el-row type="flex" align="middle">
|
||||
<el-row type="flex">
|
||||
<el-col :span="16">
|
||||
<el-select v-model="row.startSelect" placeholder="选择起始值" style="width: 70px;">
|
||||
<el-option
|
||||
@@ -79,7 +79,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="结束">
|
||||
<template #default="{ row }">
|
||||
<el-row type="flex" align="middle">
|
||||
<el-row type="flex" >
|
||||
<el-col :span="16">
|
||||
<el-select v-model="row.endSelect" placeholder="选择结束值" style="width: 70px;">
|
||||
<el-option
|
||||
@@ -131,8 +131,10 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<div >
|
||||
<el-button @click="handleCancel">取 消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">保存</el-button>
|
||||
</div>
|
||||
@@ -170,7 +172,7 @@
|
||||
const dialogForm =ref({
|
||||
type : '',
|
||||
})
|
||||
|
||||
let multipleSelection = ref<string[]>([])
|
||||
const errorTypeOptions = [
|
||||
{ label: '绝对值-标称值', value: 'type1' },
|
||||
{ label: '相对值-I类', value: 'type2' },
|
||||
@@ -196,6 +198,12 @@ const errorEndOptions = [
|
||||
{ label: '无', value: 'type3' },
|
||||
];
|
||||
|
||||
//选中
|
||||
// 处理选择变化
|
||||
const handleSelectionChange = (selection: any[]) => {
|
||||
multipleSelection.value = selection.map((row: { id: any; }) => row.id); // 更新选中的行
|
||||
|
||||
};
|
||||
|
||||
const tableData = [
|
||||
{
|
||||
@@ -232,7 +240,6 @@ const errorEndOptions = [
|
||||
errorType:'type4'
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -278,7 +285,7 @@ const errorEndOptions = [
|
||||
}
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
justify-content: flex-start;
|
||||
margin-bottom: 10px; /* 调整这里的值以增加或减少间距 */
|
||||
}
|
||||
.el-tabs {
|
||||
@@ -288,4 +295,10 @@ const errorEndOptions = [
|
||||
.el-table th, .el-table td {
|
||||
text-align: center; /* 所有单元格文字居中 */
|
||||
}
|
||||
|
||||
.table-container {
|
||||
max-height: 400px; /* 根据需要调整高度 */
|
||||
overflow-y: auto; /* 允许垂直滚动 */
|
||||
overflow-x: hidden; /* 隐藏水平滚动条 */
|
||||
}
|
||||
</style>
|
||||
@@ -5,13 +5,14 @@
|
||||
:columns='columns'
|
||||
:data='errorData'
|
||||
type='selection'
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader>
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openAddDialog">新增误差体系</el-button>
|
||||
<el-button type='danger' :icon='Delete' plain
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openAddDialog">新增</el-button>
|
||||
<el-button type='danger' :icon='Delete' plain :disabled='!multipleSelection.length'
|
||||
>
|
||||
批量删除误差体系
|
||||
批量删除
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
@@ -84,20 +85,22 @@ const columns = reactive<ColumnProps<ErrorSystem.ErrorSystemList>[]>([
|
||||
{
|
||||
prop: 'name',
|
||||
label: '误差体系名称',
|
||||
width: 300,
|
||||
|
||||
},
|
||||
{
|
||||
prop: 'year',
|
||||
label: '标准实施年份',
|
||||
width: 200,
|
||||
search: { el: 'input' },
|
||||
},
|
||||
|
||||
{
|
||||
prop: 'level',
|
||||
label: '适用设备等级',
|
||||
width: 200,
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right' },
|
||||
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 400, },
|
||||
])
|
||||
|
||||
// 打开编辑对话框
|
||||
@@ -122,6 +125,14 @@ const openAddDialog = () => {
|
||||
dialogFormVisible.value = true; // 打开对话框
|
||||
};
|
||||
|
||||
//选中
|
||||
// 处理选择变化
|
||||
const handleSelectionChange = (selection:ErrorSystem.ErrorSystemList[]) => {
|
||||
multipleSelection.value = selection.map(row => row.id); // 更新选中的行
|
||||
|
||||
};
|
||||
|
||||
|
||||
const handleRowClick = (errorSystem: ErrorSystem.ErrorSystemList) =>{
|
||||
detail_dialogTitle.value = errorSystem.name;
|
||||
detail_dialogFormVisible.value = true; // 显示对话框
|
||||
|
||||
Reference in New Issue
Block a user