fix: 修复代码调试 调试状态错误
This commit is contained in:
parent
b4875fd496
commit
2c3fecf1cc
@ -21,7 +21,8 @@ defineOptions({ name: 'CodemirrorEditor' })
|
|||||||
|
|
||||||
function getRangeFromLineAndColumn(state: any, line: number, column: number, end_column?: number) {
|
function getRangeFromLineAndColumn(state: any, line: number, column: number, end_column?: number) {
|
||||||
const l = state.doc.line(line)
|
const l = state.doc.line(line)
|
||||||
return { form: l.from + column, to: end_column ? l.from + end_column : l.to }
|
const form = l.from + column
|
||||||
|
return { form: form > l.to ? l.to : form, to: end_column ? l.from + end_column : l.to }
|
||||||
}
|
}
|
||||||
|
|
||||||
const regexpLinter = linter(async (view) => {
|
const regexpLinter = linter(async (view) => {
|
||||||
|
|||||||
@ -102,22 +102,9 @@ watch(debugVisible, (bool) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const submit = async (formEl: FormInstance | undefined) => {
|
const submit = async (formEl: FormInstance | undefined) => {
|
||||||
if (!formEl) {
|
console.log(formEl)
|
||||||
functionLibApi
|
const validate = formEl ? formEl.validate() : Promise.resolve()
|
||||||
.postFunctionLibDebug(form.value, loading)
|
validate.then(() => {
|
||||||
.then((res) => {
|
|
||||||
showResult.value = true
|
|
||||||
isSuccess.value = true
|
|
||||||
result.value = res.data
|
|
||||||
})
|
|
||||||
.catch((res) => {
|
|
||||||
showResult.value = true
|
|
||||||
isSuccess.value = false
|
|
||||||
result.value = res.data
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
await formEl.validate((valid: any) => {
|
|
||||||
if (valid) {
|
|
||||||
functionLibApi.postFunctionLibDebug(form.value, loading).then((res) => {
|
functionLibApi.postFunctionLibDebug(form.value, loading).then((res) => {
|
||||||
if (res.code === 500) {
|
if (res.code === 500) {
|
||||||
showResult.value = true
|
showResult.value = true
|
||||||
@ -129,10 +116,8 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||||||
result.value = res.data
|
result.value = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const open = (data: any) => {
|
const open = (data: any) => {
|
||||||
if (data.input_field_list.length > 0) {
|
if (data.input_field_list.length > 0) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user