feat: 修改类型
This commit is contained in:
parent
d654e0a0e4
commit
7ec3797737
@ -44,7 +44,7 @@ const submitForm = () => {
|
||||
formRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
if (props.isNew) {
|
||||
const res = await addIndicator({ name: props.metric.name, parentId: 0, level: 1 })
|
||||
const res = await addIndicator({ name: props.metric.name, parentId: 0, level: 1, type: 0 })
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('指标添加成功')
|
||||
emit('refresh')
|
||||
|
||||
@ -132,7 +132,8 @@ const handleSave = (row) => {
|
||||
compareNum2: row.compareNum2,
|
||||
score: row.score,
|
||||
remark: row.remark,
|
||||
parentId: props.indicatorId
|
||||
parentId: props.indicatorId,
|
||||
type: 0
|
||||
}).then(res => {
|
||||
if (res.code === 200) {
|
||||
ElMessage.success("保存成功");
|
||||
|
||||
@ -50,14 +50,6 @@ import { ElMessage } from 'element-plus'
|
||||
const activeIndicatorId = ref(null);
|
||||
|
||||
const listData = ref([])
|
||||
/**
|
||||
*
|
||||
{ id: 1, title: '无噪声唤醒', weight: 30 },
|
||||
{ id: 2, title: '有噪声唤醒', weight: 40 },
|
||||
{ id: 3, title: '免唤醒', weight: 50 },
|
||||
{ id: 4, title: '误唤醒', weight: 30 }
|
||||
|
||||
*/
|
||||
|
||||
const metric = ref({
|
||||
name: '',
|
||||
@ -98,7 +90,13 @@ const submitMetricForm = () => {
|
||||
if (formRef.value) {
|
||||
formRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
const res = await addIndicator({ name: metric.value.name, parentId: activeIndicatorId.value, level: 2, weight: metric.value.weight });
|
||||
const res = await addIndicator({
|
||||
name: metric.value.name,
|
||||
parentId: activeIndicatorId.value,
|
||||
level: 2,
|
||||
weight: metric.value.weight,
|
||||
type: 0
|
||||
});
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('指标添加成功')
|
||||
resetForm()
|
||||
|
||||
@ -139,7 +139,13 @@ const submitMetricForm = () => {
|
||||
ElMessage.error(res.message || '指标修改失败')
|
||||
}
|
||||
} else {
|
||||
addIndicator({ name: metric.value.name, parentId: props.indicatorId, level: level.value, weight: metric.value.weight }).then(res => {
|
||||
addIndicator({
|
||||
name: metric.value.name,
|
||||
parentId: props.indicatorId,
|
||||
level: level.value,
|
||||
weight: metric.value.weight,
|
||||
type: 0
|
||||
}).then(res => {
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('指标添加成功')
|
||||
getIndicatorByParentIdData(props.indicatorId);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user