问题增加sort
This commit is contained in:
parent
e64bd73bba
commit
42eec6046c
|
@ -80,6 +80,7 @@ export interface ScaleAnswer {
|
||||||
answerOption: string;
|
answerOption: string;
|
||||||
score: number;
|
score: number;
|
||||||
type: number;
|
type: number;
|
||||||
|
sort: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SysScaleQuestionQuery extends PageQuery {
|
export interface SysScaleQuestionQuery extends PageQuery {
|
||||||
|
|
|
@ -181,7 +181,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="SysScaleFactor" lang="ts">
|
<script setup name="SysScaleFactor" lang="ts">
|
||||||
import {computed} from 'vue'
|
import { computed } from 'vue'
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { nanoid } from 'nanoid'
|
import { nanoid } from 'nanoid'
|
||||||
import { listSysScaleFactor, getSysScaleFactor, delSysScaleFactor, addSysScaleFactor, updateSysScaleFactor } from '@/api/scale/SysScaleFactor';
|
import { listSysScaleFactor, getSysScaleFactor, delSysScaleFactor, addSysScaleFactor, updateSysScaleFactor } from '@/api/scale/SysScaleFactor';
|
||||||
|
@ -273,7 +273,7 @@ const getList = async () => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRuleType(row:any) {
|
function getRuleType(row: any) {
|
||||||
if (row.ruleType === 0) {
|
if (row.ruleType === 0) {
|
||||||
return '求和型';
|
return '求和型';
|
||||||
} else if (row.ruleType === 1) {
|
} else if (row.ruleType === 1) {
|
||||||
|
|
|
@ -306,10 +306,11 @@ const submitForm = () => {
|
||||||
SysScaleQuestionFormRef.value?.validate(async (valid: boolean) => {
|
SysScaleQuestionFormRef.value?.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
buttonLoading.value = true;
|
buttonLoading.value = true;
|
||||||
form.value.scaleAnswerList.forEach(item => {
|
form.value.scaleAnswerList.forEach((item, index) => {
|
||||||
if (item.answerId.length == 21) {
|
if (item.answerId.length == 21) {
|
||||||
item.answerId = '';
|
item.answerId = '';
|
||||||
}
|
}
|
||||||
|
item.sort = index + 1
|
||||||
})
|
})
|
||||||
|
|
||||||
if (form.value.questionId) {
|
if (form.value.questionId) {
|
||||||
|
|
Loading…
Reference in New Issue