优化前端页面 (#1439)
* fix: 点击重置按钮时表格未刷新; 修复点击重置按钮时,筛选项被清空,但是下方表格未刷新的问题; * fix: 未限制输入范围导致的报错; 后端使用了int类型,未限制输入会导致输入过大的数字时报错; * fix: 未限制输入类型; 使用文本框会导致输入内容的类型未被限制,后端使用了int类型,输入非数字字符时会导致json绑定错误; * feat: 添加创建时间验证规则; 后端仅在开始时间和结束时间同时有值时才进行搜索,所以前端会出现只选择一项内容时,搜索结果不符合预期的问题。添加验证规则使搜索结果符合预期。 * feat: 优化创建时间搜索项; 选择开始时间后,自动禁用结束时间中早于开始时间的选项;选择结束时间后,自动禁用开始时间中晚于结束时间的选项;增加校验规则,校验开始时间是否早于结束时间;点击搜索按钮时如果未通过校验则不进行搜索; * fix: 角色id输入非数字字符时点击提交按钮后变为NaN; * fix: 角色ID输入超大数字时报错; 后端使用int,输入的数字溢出会导致报错,所以限制输入长度; * feat: 时间类型的选项增加验证规则; 选择开始时间后,自动禁用结束时间中早于开始时间的选项;选择结束时间后,自动禁用开始时间中晚于结束时间的选项;增加校验规则,校验开始时间是否早于结束时间;点击搜索按钮时如果未通过校验则不进行搜索; * fix: 补全搜索form的ref引用; * feat: 添加时间类型的搜索范围提示; 时间类型的搜索范围是开始时间(包含)至结束时间(不包含),为避免歧义,增加相关提示; * feat: 将"时间"修改为"日期"确保字段名称一致性; * feat: 将列名称从"按钮组"修改为更友好的"操作"; * feat: 将dialog标题修改为更友好的内容; * fix: 使用了计算值的属性没有进行绑定; * fix: 必填字段可以只填写空格; --------- Co-authored-by: 奇淼(piexlmax <303176530@qq.com>
This commit is contained in:
committed by
GitHub
co-authored by
奇淼(piexlmax
parent
4b6adb3919
commit
40e3555d13
@@ -21,7 +21,7 @@
|
||||
<el-table-column align="left" label="姓名" prop="customerName" width="120" />
|
||||
<el-table-column align="left" label="电话" prop="customerPhoneData" width="120" />
|
||||
<el-table-column align="left" label="接入人ID" prop="sysUserId" width="120" />
|
||||
<el-table-column align="left" label="按钮组" min-width="160">
|
||||
<el-table-column align="left" label="操作" min-width="160">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link icon="edit" @click="updateCustomer(scope.row)">变更</el-button>
|
||||
<el-popover v-model="scope.row.visible" placement="top" width="160">
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色ID" prop="authorityId">
|
||||
<el-input v-model="form.authorityId" :disabled="dialogType==='edit'" autocomplete="off" />
|
||||
<el-input v-model="form.authorityId" :disabled="dialogType==='edit'" autocomplete="off" maxlength="15" />
|
||||
</el-form-item>
|
||||
<el-form-item label="角色姓名" prop="authorityName">
|
||||
<el-input v-model="form.authorityName" autocomplete="off" />
|
||||
@@ -253,16 +253,9 @@ const closeDialog = () => {
|
||||
// 确定弹窗
|
||||
|
||||
const enterDialog = () => {
|
||||
form.value.authorityId = Number(form.value.authorityId)
|
||||
if (form.value.authorityId === 0) {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '角色id不能为0'
|
||||
})
|
||||
return false
|
||||
}
|
||||
authorityForm.value.validate(async valid => {
|
||||
if (valid) {
|
||||
form.value.authorityId = Number(form.value.authorityId)
|
||||
switch (dialogType.value) {
|
||||
case 'add':
|
||||
{
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
<el-table-column align="left" label="描述" prop="desc" width="280" />
|
||||
|
||||
<el-table-column align="left" label="按钮组">
|
||||
<el-table-column align="left" label="操作">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
<el-dialog
|
||||
v-model="dialogFormVisible"
|
||||
:before-close="closeDialog"
|
||||
title="弹窗操作"
|
||||
:title="type==='create'?'添加字典':'修改字典'"
|
||||
>
|
||||
<el-form
|
||||
ref="dialogForm"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<el-input v-model="searchInfo.label" placeholder="搜索条件" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字典值">
|
||||
<el-input v-model="searchInfo.value" placeholder="搜索条件" />
|
||||
<el-input-number v-model="searchInfo.value" placeholder="搜索条件" min="-2147483648" max="2147483647"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态" prop="status">
|
||||
<el-select v-model="searchInfo.status" placeholder="请选择">
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
<el-table-column align="left" label="排序标记" prop="sort" width="120" />
|
||||
|
||||
<el-table-column align="left" label="按钮组">
|
||||
<el-table-column align="left" label="操作">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link icon="edit" @click="updateSysDictionaryDetailFunc(scope.row)">变更</el-button>
|
||||
<el-popover v-model="scope.row.visible" placement="top" width="160">
|
||||
@@ -76,7 +76,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="弹窗操作">
|
||||
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="type==='create'?'添加字典项':'修改字典项'">
|
||||
<el-form ref="dialogForm" :model="formData" :rules="rules" label-width="110px">
|
||||
<el-form-item label="展示值" prop="label">
|
||||
<el-input
|
||||
@@ -94,6 +94,8 @@
|
||||
placeholder="请输入字典值"
|
||||
clearable
|
||||
:style="{width: '100%'}"
|
||||
min="-2147483648"
|
||||
max="2147483647"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态" prop="status" required>
|
||||
@@ -177,6 +179,7 @@ const tableData = ref([])
|
||||
const searchInfo = ref({ sysDictionaryID: Number(route.params.id) })
|
||||
const onReset = () => {
|
||||
searchInfo.value = { sysDictionaryID: Number(route.params.id) }
|
||||
getTableData()
|
||||
}
|
||||
|
||||
// 条件搜索前端看此方法
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="按钮组">
|
||||
<el-table-column align="left" label="操作">
|
||||
<template #default="scope">
|
||||
<el-popover v-model="scope.row.visible" placement="top" width="160">
|
||||
<p>确定要删除吗?</p>
|
||||
|
||||
Reference in New Issue
Block a user