|
@ -4,45 +4,32 @@ |
|
|
<el-row> |
|
|
<el-row> |
|
|
<el-col :span="4"> |
|
|
<el-col :span="4"> |
|
|
<el-form-item label="参数名称" prop="paramClassName" label-width="auto"> |
|
|
<el-form-item label="参数名称" prop="paramClassName" label-width="auto"> |
|
|
<el-input |
|
|
<el-input v-model="queryParams.paramClassName" placeholder="请输入参数名称" clearable @keyup.enter="handleQuery" /> |
|
|
v-model="queryParams.paramClassName" |
|
|
|
|
|
placeholder="请输入参数名称" |
|
|
|
|
|
clearable |
|
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="4"> |
|
|
<el-col :span="4"> |
|
|
<el-form-item label="参数编码" prop="paramClassCode" label-width="auto"> |
|
|
<el-form-item label="参数编码" prop="paramClassCode" label-width="auto"> |
|
|
<el-input |
|
|
<el-input v-model="queryParams.paramClassCode" placeholder="请输入参数编码" clearable @keyup.enter="handleQuery" /> |
|
|
v-model="queryParams.paramClassCode" |
|
|
|
|
|
placeholder="请输入参数编码" |
|
|
|
|
|
clearable |
|
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="4"> |
|
|
<el-col :span="4"> |
|
|
<el-form-item label="类别" prop="classType" label-width="auto"> |
|
|
<el-form-item label="类别" prop="classType" label-width="auto"> |
|
|
<el-select v-model="queryParams.classType" placeholder="请选择类别" clearable> |
|
|
<el-select v-model="queryParams.classType" placeholder="请选择类别" clearable> |
|
|
<el-option |
|
|
<el-option v-for="dict in dc_class_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|
|
v-for="dict in dc_class_type" |
|
|
|
|
|
:key="dict.value" |
|
|
|
|
|
:label="dict.label" |
|
|
|
|
|
:value="dict.value" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="4"> |
|
|
<el-col :span="4"> |
|
|
<el-form-item label="单位" prop="paramUnit" label-width="auto"> |
|
|
<el-form-item label="单位" prop="paramUnit" label-width="auto"> |
|
|
<el-select v-model="queryParams.paramUnit" placeholder="请选择单位" clearable> |
|
|
<el-select v-model="queryParams.paramUnit" placeholder="请选择单位" clearable> |
|
|
<el-option |
|
|
<el-option v-for="dict in dc_param_uint_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|
|
v-for="dict in dc_param_uint_type" |
|
|
</el-select> |
|
|
:key="dict.value" |
|
|
</el-form-item> |
|
|
:label="dict.label" |
|
|
</el-col> |
|
|
:value="dict.value" |
|
|
<el-col :span="4"> |
|
|
/> |
|
|
<el-form-item label="数据类型" prop="paramType"> |
|
|
|
|
|
<el-select v-model="queryParams.paramType" placeholder="请选择数据类型" clearable> |
|
|
|
|
|
<el-option v-for="dict in dc_param_value_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
@ -57,80 +44,62 @@ |
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8"> |
|
|
<el-row :gutter="10" class="mb8"> |
|
|
<el-col :span="1.5"> |
|
|
<el-col :span="1.5"> |
|
|
<el-button |
|
|
<el-button type="success" icon="Plus" @click="handleAdd">新增</el-button> |
|
|
type="success" |
|
|
|
|
|
icon="Plus" |
|
|
|
|
|
@click="handleAdd" |
|
|
|
|
|
>新增</el-button> |
|
|
|
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="1.5"> |
|
|
<el-col :span="1.5"> |
|
|
<el-button |
|
|
<el-button type="success" icon="Delete" @click="handleDelete">删除</el-button> |
|
|
type="success" |
|
|
|
|
|
icon="Delete" |
|
|
|
|
|
@click="handleDelete" |
|
|
|
|
|
>删除</el-button> |
|
|
|
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="1.5"> |
|
|
<el-col :span="1.5"> |
|
|
<el-button |
|
|
<el-button type="warning" icon="Download" @click="handleExport">导出</el-button> |
|
|
type="warning" |
|
|
|
|
|
icon="Download" |
|
|
|
|
|
@click="handleExport" |
|
|
|
|
|
>导出</el-button> |
|
|
|
|
|
</el-col> |
|
|
</el-col> |
|
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
|
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
|
|
</el-row> |
|
|
</el-row> |
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="paramclassList" @selection-change="handleSelectionChange" :max-height="tableHeight" :border="true" :column-width-draggable="true"> |
|
|
<el-table v-loading="loading" :data="paramclassList" @selection-change="handleSelectionChange" |
|
|
<el-table-column type="selection" width="55" align="center" fixed="left"/> |
|
|
:max-height="tableHeight" :border="true" :column-width-draggable="true"> |
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" fixed="left" /> |
|
|
<el-table-column label="参数名称" align="center" prop="paramClassName" /> |
|
|
<el-table-column label="参数名称" align="center" prop="paramClassName" /> |
|
|
<el-table-column label="参数编码" align="center" prop="paramClassCode" /> |
|
|
<el-table-column label="参数编码" align="center" prop="paramClassCode" /> |
|
|
|
|
|
<el-table-column label="数据类型" align="center" prop="paramType"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<dict-tag :options="dc_param_value_type" :value="scope.row.paramType" /> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
<el-table-column label="类别" align="center" prop="classType"> |
|
|
<el-table-column label="类别" align="center" prop="classType"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<dict-tag :options="dc_class_type" :value="scope.row.classType"/> |
|
|
<dict-tag :options="dc_class_type" :value="scope.row.classType" /> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="单位" align="center" prop="paramUnit"> |
|
|
<el-table-column label="单位" align="center" prop="paramUnit"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<dict-tag :options="dc_param_uint_type" :value="scope.row.paramUnit"/> |
|
|
<dict-tag :options="dc_param_uint_type" :value="scope.row.paramUnit" /> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="备注" align="center" prop="note" /> |
|
|
<el-table-column label="备注" align="center" prop="note" /> |
|
|
<!-- <el-table-column label="主键" align="center" prop="id" /> --> |
|
|
<!-- <el-table-column label="主键" align="center" prop="id" /> --> |
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" :width="200" :fixed="fixedColumns?'right':false"> |
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" :width="200" |
|
|
|
|
|
:fixed="fixedColumns ? 'right' : false"> |
|
|
<template #header> |
|
|
<template #header> |
|
|
<div class="fixed-column-header" style="text-align: center;display: block;" @dblclick="toggleFixedColumns"> |
|
|
<div class="fixed-column-header" style="text-align: center;display: block;" @dblclick="toggleFixedColumns"> |
|
|
<span style="text-align: center;display: block;">操作<img style="width:10px;margin-left:5px" v-show="fixedColumns" :src="lock" alt="Image"/></span> |
|
|
<span style="text-align: center;display: block;">操作<img style="width:10px;margin-left:5px" |
|
|
|
|
|
v-show="fixedColumns" :src="lock" alt="Image" /></span> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<el-button |
|
|
<el-button type="text" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button> |
|
|
type="text" |
|
|
<el-button type="text" icon="Delete" @click="handleDelete(scope.row)">删除</el-button> |
|
|
icon="Edit" |
|
|
|
|
|
@click="handleUpdate(scope.row)" |
|
|
|
|
|
>修改</el-button> |
|
|
|
|
|
<el-button |
|
|
|
|
|
type="text" |
|
|
|
|
|
icon="Delete" |
|
|
|
|
|
@click="handleDelete(scope.row)" |
|
|
|
|
|
>删除</el-button> |
|
|
|
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
|
|
|
|
|
|
<pagination |
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" |
|
|
v-show="total>0" |
|
|
@pagination="getList" class="paddingBothLeftRight" /> |
|
|
:total="total" |
|
|
|
|
|
v-model:page="queryParams.pageNum" |
|
|
|
|
|
v-model:limit="queryParams.pageSize" |
|
|
|
|
|
@pagination="getList" |
|
|
|
|
|
class="paddingBothLeftRight" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改参数模型信息对话框 --> |
|
|
<!-- 添加或修改参数模型信息对话框 --> |
|
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body draggable> |
|
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body draggable> |
|
|
<el-form ref="paramclassRef" :model="form" :rules="rules" label-width="80px"> |
|
|
<el-form ref="paramclassRef" :model="form" :rules="rules" label-width="80px"> |
|
|
|
|
|
|
|
|
<el-row> |
|
|
<el-row> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="参数名称" prop="paramClassName"> |
|
|
<el-form-item label="参数名称" prop="paramClassName"> |
|
|
<el-input v-model="form.paramClassName" placeholder="请输入参数名称" /> |
|
|
<el-input v-model="form.paramClassName" placeholder="请输入参数名称" /> |
|
@ -141,25 +110,28 @@ |
|
|
<el-input v-model="form.paramClassCode" placeholder="请输入参数编码" /> |
|
|
<el-input v-model="form.paramClassCode" placeholder="请输入参数编码" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label="数据类型" prop="paramType"> |
|
|
|
|
|
<el-select v-model="form.paramType" placeholder="请选择数据类型"> |
|
|
|
|
|
<el-option v-for="dict in dc_param_value_type" :key="dict.value" :label="dict.label" |
|
|
|
|
|
:value="dict.value"> |
|
|
|
|
|
</el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="类别" prop="classType"> |
|
|
<el-form-item label="类别" prop="classType"> |
|
|
<el-select v-model="form.classType" placeholder="请选择类别"> |
|
|
<el-select v-model="form.classType" placeholder="请选择类别"> |
|
|
<el-option |
|
|
<el-option v-for="dict in dc_class_type" :key="dict.value" :label="dict.label" |
|
|
v-for="dict in dc_class_type" |
|
|
:value="dict.value"></el-option> |
|
|
:key="dict.value" |
|
|
|
|
|
:label="dict.label" |
|
|
|
|
|
:value="dict.value" ></el-option> |
|
|
|
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="单位" prop="paramUnit"> |
|
|
<el-form-item label="单位" prop="paramUnit"> |
|
|
<el-select v-model="form.paramUnit" placeholder="请选择单位"> |
|
|
<el-select v-model="form.paramUnit" placeholder="请选择单位"> |
|
|
<el-option |
|
|
<el-option v-for="dict in dc_param_uint_type" :key="dict.value" :label="dict.label" |
|
|
v-for="dict in dc_param_uint_type" |
|
|
:value="dict.value"></el-option> |
|
|
:key="dict.value" |
|
|
|
|
|
:label="dict.label" |
|
|
|
|
|
:value="dict.value" ></el-option> |
|
|
|
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
@ -180,15 +152,14 @@ |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<style lang="scss" > |
|
|
<style lang="scss" > @import "@/assets/styles/self-defined.scss"; |
|
|
@import "@/assets/styles/self-defined.scss"; |
|
|
|
|
|
</style> |
|
|
</style> |
|
|
<script setup name="Paramclass"> |
|
|
<script setup name="Paramclass"> |
|
|
import { listParamclass, getParamclass, delParamclass, addParamclass, updateParamclass,listParamclassForRepetition } from "@/api/model/paramclass"; |
|
|
import { listParamclass, getParamclass, delParamclass, addParamclass, updateParamclass, listParamclassForRepetition } from "@/api/model/paramclass"; |
|
|
import lock from "@/assets/icons/svg/lock.svg"; |
|
|
import lock from "@/assets/icons/svg/lock.svg"; |
|
|
import { ElMessageBox } from 'element-plus'; |
|
|
import { ElMessageBox } from 'element-plus'; |
|
|
const { proxy } = getCurrentInstance(); |
|
|
const { proxy } = getCurrentInstance(); |
|
|
const { dc_class_type, dc_param_uint_type } = proxy.useDict('dc_class_type', 'dc_param_uint_type'); |
|
|
const { dc_class_type, dc_param_uint_type, dc_param_value_type } = proxy.useDict('dc_class_type', 'dc_param_uint_type', 'dc_param_value_type'); |
|
|
const paramclassList = ref([]); |
|
|
const paramclassList = ref([]); |
|
|
const open = ref(false); |
|
|
const open = ref(false); |
|
|
const loading = ref(true); |
|
|
const loading = ref(true); |
|
@ -227,7 +198,7 @@ const data = reactive({ |
|
|
{ required: true, message: "参数类型不能为空", trigger: "blur" } |
|
|
{ required: true, message: "参数类型不能为空", trigger: "blur" } |
|
|
], |
|
|
], |
|
|
paramUnit: [ |
|
|
paramUnit: [ |
|
|
{ required: true, message: "单位不能为空", trigger: "blur" } |
|
|
{ required: false, message: "单位不能为空", trigger: "blur" } |
|
|
], |
|
|
], |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
@ -304,13 +275,13 @@ function handleAdd() { |
|
|
function handleUpdate(row) { |
|
|
function handleUpdate(row) { |
|
|
reset(); |
|
|
reset(); |
|
|
const _id = row.id || ids.value; |
|
|
const _id = row.id || ids.value; |
|
|
if(_id.length === 0){ |
|
|
if (_id.length === 0) { |
|
|
ElMessageBox.alert('请选择需要修改的记录', '提示', { |
|
|
ElMessageBox.alert('请选择需要修改的记录', '提示', { |
|
|
confirmButtonText: '确定', |
|
|
confirmButtonText: '确定', |
|
|
center: true, |
|
|
center: true, |
|
|
}) |
|
|
}) |
|
|
return; |
|
|
return; |
|
|
}else if(_id.length > 1){ |
|
|
} else if (_id.length > 1) { |
|
|
ElMessageBox.alert('只能选择一条记录进行修改', '提示', { |
|
|
ElMessageBox.alert('只能选择一条记录进行修改', '提示', { |
|
|
confirmButtonText: '确定', |
|
|
confirmButtonText: '确定', |
|
|
center: true, |
|
|
center: true, |
|
@ -328,7 +299,7 @@ function handleUpdate(row) { |
|
|
function submitForm() { |
|
|
function submitForm() { |
|
|
proxy.$refs["paramclassRef"].validate(valid => { |
|
|
proxy.$refs["paramclassRef"].validate(valid => { |
|
|
if (valid) { |
|
|
if (valid) { |
|
|
const param = {"paramClassCode":form.value.paramClassCode}; |
|
|
const param = { "paramClassCode": form.value.paramClassCode }; |
|
|
if (form.value.id != null) { |
|
|
if (form.value.id != null) { |
|
|
listParamclassForRepetition(param).then(response => { |
|
|
listParamclassForRepetition(param).then(response => { |
|
|
const result = response.data; |
|
|
const result = response.data; |
|
@ -338,7 +309,7 @@ function submitForm() { |
|
|
confirmButtonText: '确定', |
|
|
confirmButtonText: '确定', |
|
|
center: true, |
|
|
center: true, |
|
|
}) |
|
|
}) |
|
|
}else{ |
|
|
} else { |
|
|
updateParamclass(form.value).then(response => { |
|
|
updateParamclass(form.value).then(response => { |
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
open.value = false; |
|
|
open.value = false; |
|
@ -355,7 +326,7 @@ function submitForm() { |
|
|
confirmButtonText: '确定', |
|
|
confirmButtonText: '确定', |
|
|
center: true, |
|
|
center: true, |
|
|
}) |
|
|
}) |
|
|
}else{ |
|
|
} else { |
|
|
addParamclass(form.value).then(response => { |
|
|
addParamclass(form.value).then(response => { |
|
|
proxy.$modal.msgSuccess("新增成功"); |
|
|
proxy.$modal.msgSuccess("新增成功"); |
|
|
open.value = false; |
|
|
open.value = false; |
|
@ -371,7 +342,7 @@ function submitForm() { |
|
|
/** 删除按钮操作 */ |
|
|
/** 删除按钮操作 */ |
|
|
function handleDelete(row) { |
|
|
function handleDelete(row) { |
|
|
const _ids = row.id || ids.value; |
|
|
const _ids = row.id || ids.value; |
|
|
if(_ids.length == 0){ |
|
|
if (_ids.length == 0) { |
|
|
ElMessageBox.alert('请先选择要删除的项', '提示', { |
|
|
ElMessageBox.alert('请先选择要删除的项', '提示', { |
|
|
confirmButtonText: '确定', |
|
|
confirmButtonText: '确定', |
|
|
center: true, |
|
|
center: true, |
|
@ -379,12 +350,12 @@ function handleDelete(row) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
const _names = row.paramClassName || names.value; |
|
|
const _names = row.paramClassName || names.value; |
|
|
proxy.$modal.confirm('是否确认删除参数模型名称为"' + _names + '"的数据项?').then(function() { |
|
|
proxy.$modal.confirm('是否确认删除参数模型名称为"' + _names + '"的数据项?').then(function () { |
|
|
return delParamclass(_ids); |
|
|
return delParamclass(_ids); |
|
|
}).then(() => { |
|
|
}).then(() => { |
|
|
getList(); |
|
|
getList(); |
|
|
proxy.$modal.msgSuccess("删除成功"); |
|
|
proxy.$modal.msgSuccess("删除成功"); |
|
|
}).catch(() => {}); |
|
|
}).catch(() => { }); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
/** 导出按钮操作 */ |
|
@ -400,7 +371,7 @@ function toggleFixedColumns() { |
|
|
fixedColumns.value = !fixedColumns.value; |
|
|
fixedColumns.value = !fixedColumns.value; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
onMounted(()=>{ |
|
|
onMounted(() => { |
|
|
calculateTableHeight(); |
|
|
calculateTableHeight(); |
|
|
window.addEventListener('resize', calculateTableHeight); |
|
|
window.addEventListener('resize', calculateTableHeight); |
|
|
window.onresize = () => { |
|
|
window.onresize = () => { |
|
@ -414,14 +385,14 @@ onUnmounted(() => { |
|
|
window.removeEventListener('resize', calculateTableHeight); |
|
|
window.removeEventListener('resize', calculateTableHeight); |
|
|
}); |
|
|
}); |
|
|
watch( |
|
|
watch( |
|
|
[collapseVisible,showSearch], |
|
|
[collapseVisible, showSearch], |
|
|
() => { |
|
|
() => { |
|
|
calculateTableHeight(); |
|
|
calculateTableHeight(); |
|
|
} |
|
|
} |
|
|
); |
|
|
); |
|
|
const calculateTableHeight = () => { |
|
|
const calculateTableHeight = () => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
const heightForm = proxy.$refs.queryRef?.$el.clientHeight||0; |
|
|
const heightForm = proxy.$refs.queryRef?.$el.clientHeight || 0; |
|
|
const windowHeight = window.innerHeight; |
|
|
const windowHeight = window.innerHeight; |
|
|
const paginationHeight = 60; |
|
|
const paginationHeight = 60; |
|
|
const tableHeaderHeight = 40; |
|
|
const tableHeaderHeight = 40; |
|
|