fix: eslint
parent
0f9ab388c3
commit
9ac774cd0a
|
@ -40,7 +40,6 @@ async function handleStart() {
|
|||
const canStart = await beforeStartFunc()
|
||||
if (canStart)
|
||||
start()
|
||||
|
||||
}
|
||||
finally {
|
||||
loading.value = false
|
||||
|
|
|
@ -27,8 +27,7 @@ export default {
|
|||
fApi:{},
|
||||
formData:{},
|
||||
formConfig: `
|
||||
/* eslint-disable */
|
||||
let codeVueLast = `
|
||||
const codeVueLast = `
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -38,36 +37,37 @@ let codeVueLast = `
|
|||
}
|
||||
}
|
||||
}
|
||||
<\/script>`;
|
||||
<\/script>`
|
||||
//
|
||||
const state = reactive({
|
||||
open: false,
|
||||
jsonData: {} as IFormConfig,
|
||||
});
|
||||
})
|
||||
|
||||
const showModal = (formConfig: IFormConfig) => {
|
||||
formConfig.schemas && formatRules(formConfig.schemas);
|
||||
state.open = true;
|
||||
state.jsonData = formConfig;
|
||||
};
|
||||
function showModal(formConfig: IFormConfig) {
|
||||
formConfig.schemas && formatRules(formConfig.schemas)
|
||||
state.open = true
|
||||
state.jsonData = formConfig
|
||||
}
|
||||
|
||||
const editorVueJson = computed(() => {
|
||||
return codeVueFront + JSON.stringify(removeAttrs(state.jsonData), null, '\t') + codeVueLast;
|
||||
});
|
||||
return codeVueFront + JSON.stringify(removeAttrs(state.jsonData), null, '\t') + codeVueLast
|
||||
})
|
||||
|
||||
defineExpose({ showModal })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Modal
|
||||
title="代码"
|
||||
:footer="null"
|
||||
:open="state.open"
|
||||
@cancel="state.open = false"
|
||||
wrapClassName="v-code-modal"
|
||||
wrap-class-name="v-code-modal"
|
||||
style="top: 20px"
|
||||
width="850px"
|
||||
:destroyOnClose="true"
|
||||
:destroy-on-close="true"
|
||||
@cancel="state.open = false"
|
||||
>
|
||||
<PreviewCode :editorJson="editorVueJson" fileFormat="vue" />
|
||||
<PreviewCode :editor-json="editorVueJson" file-format="vue" />
|
||||
</Modal>
|
||||
</template>
|
||||
|
|
|
@ -28,8 +28,7 @@ function handleSelectItem() {
|
|||
|
||||
<template>
|
||||
<div
|
||||
class="drag-move-box"
|
||||
:class="{ active: schema.key === formConfig.currentItem?.key }"
|
||||
class="drag-move-box" :class="{ active: schema.key === formConfig.currentItem?.key }"
|
||||
@click.stop="handleSelectItem"
|
||||
>
|
||||
<div class="form-item-box">
|
||||
|
|
|
@ -43,4 +43,3 @@ function handleChange(e) {
|
|||
<Select v-bind="getBindValue" class="max-w-32 w-30" :disabled="disabled" :options="options" @change="handleChange" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -72,7 +72,6 @@ const getIsFixed = computed(() => {
|
|||
return isFixed
|
||||
})
|
||||
|
||||
|
||||
const getDomStyle = computed((): CSSProperties => {
|
||||
const fixedWidth = unref(getIsFixed) ? unref(getRealWidth) : 0
|
||||
const width = `${unref(getMixSideWidth) + fixedWidth}px`
|
||||
|
|
|
@ -94,6 +94,7 @@ export function openWindow(url: string, opt?: { target?: TargetContext | string;
|
|||
export function getDynamicProps<T extends Record<string, unknown>, U>(props: T): Partial<U> {
|
||||
const ret: Recordable = {}
|
||||
|
||||
// eslint-disable-next-line array-callback-return
|
||||
Object.keys(props).map((key) => {
|
||||
ret[key] = unref((props as Recordable)[key])
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue