业务管理,系统管理
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" :title="title">
|
||||
<el-scrollbar>
|
||||
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
|
||||
<el-form-item label="名称:" class="top" prop="name">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
<el-form-item label="名称:" class="top" prop="name" >
|
||||
<el-input v-model="form.name" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="计算值:" class="top">
|
||||
<el-input v-model="form.value"></el-input>
|
||||
@@ -118,5 +118,6 @@ const submit = async () => {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<el-scrollbar>
|
||||
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
<el-input v-model="form.name" maxlength="32" show-word-limit @input="handleInput"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="编码" class="top" prop="code">
|
||||
<el-input v-model="form.code"></el-input>
|
||||
@@ -112,5 +112,9 @@ const submit = async () => {
|
||||
})
|
||||
}
|
||||
|
||||
const handleInput = (value: string) => {
|
||||
form.name = value.replace(/[^\d]/g, '')
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" :title="title">
|
||||
<el-scrollbar>
|
||||
<el-form :inline="false" :model="form" label-width="120px" :rules="rules">
|
||||
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
|
||||
<el-form-item label="字典名称:" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入字典名称"></el-input>
|
||||
<el-input v-model="form.name" placeholder="请输入字典名称" maxlength="32" show-word-limit @input="handleInput"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="序号:" prop="sort" class="top">
|
||||
<el-input v-model="form.sort" placeholder="请输入序号"></el-input>
|
||||
@@ -33,6 +33,7 @@ import { ElMessage } from 'element-plus'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { dicAdd, dicUpdate } from '@/api/system-boot/dic'
|
||||
|
||||
const formRef = ref()
|
||||
const adminInfo = useAdminInfo()
|
||||
const tableStore = inject('tableStore') as TableStore
|
||||
// do not use same name with ref
|
||||
@@ -69,14 +70,23 @@ const open = (text: string, data?: anyObj) => {
|
||||
}
|
||||
}
|
||||
const submit = async () => {
|
||||
if (form.id) {
|
||||
await dicUpdate(form)
|
||||
} else {
|
||||
await dicAdd(form)
|
||||
}
|
||||
ElMessage.success('保存成功')
|
||||
tableStore.index()
|
||||
dialogVisible.value = false
|
||||
formRef.value.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (form.id) {
|
||||
await dicUpdate(form)
|
||||
} else {
|
||||
await dicAdd(form)
|
||||
}
|
||||
ElMessage.success('保存成功')
|
||||
tableStore.index()
|
||||
dialogVisible.value = false
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
const handleInput = (val: string) => {
|
||||
form.name = val.replace(/\s+/g, '')
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
|
||||
Reference in New Issue
Block a user