|
|
@ -1,10 +1,13 @@ |
|
|
|
<script setup name="DictForm"> |
|
|
|
<script setup name="DictForm"> |
|
|
|
import { onMounted, h, watch, reactive } from 'vue'; |
|
|
|
import { onMounted, h, watch, reactive, ref } from 'vue'; |
|
|
|
import { useBaseDataStore } from '@/stores/baseData.js'; |
|
|
|
import { useBaseDataStore } from '@/stores/baseData.js'; |
|
|
|
import { ReloadOutlined, SettingOutlined } from '@ant-design/icons-vue'; |
|
|
|
import { ReloadOutlined, SettingOutlined } from '@ant-design/icons-vue'; |
|
|
|
const baseDataStore = useBaseDataStore(); |
|
|
|
const baseDataStore = useBaseDataStore(); |
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
|
const props = defineProps({ |
|
|
|
|
|
|
|
status: { |
|
|
|
|
|
|
|
type: Boolean, |
|
|
|
|
|
|
|
}, |
|
|
|
form: { |
|
|
|
form: { |
|
|
|
type: Object, |
|
|
|
type: Object, |
|
|
|
default: () => ({ |
|
|
|
default: () => ({ |
|
|
@ -46,6 +49,9 @@ const props = defineProps({ |
|
|
|
const form = reactive({ |
|
|
|
const form = reactive({ |
|
|
|
...props.form, |
|
|
|
...props.form, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
// ! ref |
|
|
|
|
|
|
|
const bodyRef = ref(null); |
|
|
|
|
|
|
|
const offsetBottom = ref(null); |
|
|
|
// ! pid |
|
|
|
// ! pid |
|
|
|
watch(form, (newVal, oldVal) => { |
|
|
|
watch(form, (newVal, oldVal) => { |
|
|
|
if (form.pid != '') { |
|
|
|
if (form.pid != '') { |
|
|
@ -58,6 +64,8 @@ watch(form, (newVal, oldVal) => { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
onMounted(() => { |
|
|
|
onMounted(() => { |
|
|
|
|
|
|
|
window.pino.info('DictForm Mounted'); |
|
|
|
|
|
|
|
offsetBottom.value = 0; |
|
|
|
// ! 检测获取字典列表 |
|
|
|
// ! 检测获取字典列表 |
|
|
|
if (baseDataStore.state.dictList?.length == 0) { |
|
|
|
if (baseDataStore.state.dictList?.length == 0) { |
|
|
|
baseDataStore.getDictList(); |
|
|
|
baseDataStore.getDictList(); |
|
|
@ -66,10 +74,15 @@ onMounted(() => { |
|
|
|
if (baseDataStore.state.serviceList?.length == 0) { |
|
|
|
if (baseDataStore.state.serviceList?.length == 0) { |
|
|
|
baseDataStore.getServiceList(); |
|
|
|
baseDataStore.getServiceList(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log(props); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
function change(affixed) { |
|
|
|
|
|
|
|
console.log(affixed); |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
|
|
|
|
<div ref="bodyRef" v-if="props.status"> |
|
|
|
<AForm :model="form" name="DictForm" :label-col="{ span: 8 }" layout="vertical"> |
|
|
|
<AForm :model="form" name="DictForm" :label-col="{ span: 8 }" layout="vertical"> |
|
|
|
<AFormItem label="上级字典" name="pid"> |
|
|
|
<AFormItem label="上级字典" name="pid"> |
|
|
|
<AFlex gap="small"> |
|
|
|
<AFlex gap="small"> |
|
|
@ -117,6 +130,10 @@ onMounted(() => { |
|
|
|
</AInputNumber> |
|
|
|
</AInputNumber> |
|
|
|
</AFormItem> |
|
|
|
</AFormItem> |
|
|
|
</AForm> |
|
|
|
</AForm> |
|
|
|
|
|
|
|
<AAffix :target="() => bodyRef" :offset-bottom="0"> |
|
|
|
|
|
|
|
<AckCreateAntdButton @click="props.handleAck" /> |
|
|
|
|
|
|
|
</AAffix> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<style scoped></style> |
|
|
|
<style scoped></style> |
|
|
|