Commit 712154e1 authored by liangjingpeng's avatar liangjingpeng

腳本開發-sql审核

parent 90a798e4
......@@ -18,7 +18,7 @@
>
<template #ruleContentSlot>
<div class="editor">
<CodeEditor v-model:value="sql" />
<CodeEditor v-model:value="info.sql" />
</div>
</template>
......@@ -40,7 +40,7 @@
</template>
<script lang="ts" setup>
import {ref, } from 'vue';
import {computed, onMounted, ref,} from 'vue';
import {PageWrapper} from "@/components/Page";
import {tableList} from "@/views/scriptDevelopment/sqlAudit/mock";
import {personSchema} from "@/views/scriptDevelopment/sqlAudit/mainBody.data";
......@@ -48,22 +48,45 @@ import {BasicForm, useForm} from "@/components/Form";
import CodeEditor from "@/components/CodeEditor/src/CodeEditor.vue";
import {Alert} from "ant-design-vue";
const sql = ref(tableList[0].sql);
const pros = defineProps({
deptId: {
type: Number,
default: 0,
}
})
// 初始化 info 为一个响应式对象
const info = ref({...tableList[0]});
const info = computed(() => {
const list = tableList;
const index = list.findIndex((item) => {
return item.selectedDeptId === pros.deptId; // 添加 return 关键字
});
console.log('list', list);
console.log('index', index);
console.log('deptId', pros.deptId);
if (index !== -1) {
return list[index];
}
return {};
});
console.log("info数据:",info);
function palyStart() {
setFieldsValue(info.value);
}
onMounted(() => {
console.log('tableList', tableList)
palyStart();
});
const [registerGuideModeForm] = useForm({
const [registerGuideModeForm, {setFieldsValue}] = useForm({
labelWidth: 100,
schemas: personSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment