main
expressgy 3 months ago
parent fcdf22d13e
commit ca2bce89fe
  1. 9
      pnpm-lock.yaml
  2. 31
      src/assets/custom.css
  3. 20
      src/components/AntDesignVue/CustomAntDesignVue/Button/AckCreateAntdButton.vue
  4. 2
      src/components/AntDesignVue/CustomAntDesignVue/index.js
  5. 8
      src/components/AntDesignVue/index.js
  6. 19
      src/views/Auth/Dict/DictForm.vue
  7. 13
      src/views/Auth/Dict/index.vue

@ -529,55 +529,46 @@ packages:
resolution: {integrity: sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==} resolution: {integrity: sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==}
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm-musleabihf@4.18.0': '@rollup/rollup-linux-arm-musleabihf@4.18.0':
resolution: {integrity: sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==} resolution: {integrity: sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==}
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
libc: [musl]
'@rollup/rollup-linux-arm64-gnu@4.18.0': '@rollup/rollup-linux-arm64-gnu@4.18.0':
resolution: {integrity: sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==} resolution: {integrity: sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm64-musl@4.18.0': '@rollup/rollup-linux-arm64-musl@4.18.0':
resolution: {integrity: sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==} resolution: {integrity: sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
libc: [musl]
'@rollup/rollup-linux-powerpc64le-gnu@4.18.0': '@rollup/rollup-linux-powerpc64le-gnu@4.18.0':
resolution: {integrity: sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==} resolution: {integrity: sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==}
cpu: [ppc64] cpu: [ppc64]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-riscv64-gnu@4.18.0': '@rollup/rollup-linux-riscv64-gnu@4.18.0':
resolution: {integrity: sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==} resolution: {integrity: sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==}
cpu: [riscv64] cpu: [riscv64]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-s390x-gnu@4.18.0': '@rollup/rollup-linux-s390x-gnu@4.18.0':
resolution: {integrity: sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==} resolution: {integrity: sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==}
cpu: [s390x] cpu: [s390x]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-gnu@4.18.0': '@rollup/rollup-linux-x64-gnu@4.18.0':
resolution: {integrity: sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==} resolution: {integrity: sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-musl@4.18.0': '@rollup/rollup-linux-x64-musl@4.18.0':
resolution: {integrity: sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==} resolution: {integrity: sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
libc: [musl]
'@rollup/rollup-win32-arm64-msvc@4.18.0': '@rollup/rollup-win32-arm64-msvc@4.18.0':
resolution: {integrity: sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==} resolution: {integrity: sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==}

@ -6,3 +6,34 @@
text-align: center; text-align: center;
} }
} }
/* Antd Custom */
/* 模态框 */
.ant-modal{
position: relative;
max-height: 75vh;
height: 900px;
overflow: hidden;
.ant-modal-content{
position: relative;
box-sizing: border-box;
max-height: 100%;
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
.ant-modal-body{
height: 100%;
overflow: hidden;
& > *{
position: relative;
height: 100%;
overflow: auto;
padding: 0 5px ;
}
}
}
}

@ -0,0 +1,20 @@
<script setup name="AckCreateAntdButton">
import { h, ref } from 'vue';
import { PlusOutlined } from '@ant-design/icons-vue';
const canClick = ref(true);
const handleClick = () => {
if (canClick.value) {
canClick.value = false;
setTimeout(() => {
canClick.value = true;
}, 750);
}
};
</script>
<template>
<AButton type="primary" :disabled="!canClick" @click="handleClick" :icon="h(PlusOutlined)">确认创建</AButton>
</template>
<style scoped></style>

@ -12,11 +12,13 @@
// | ------------------------------------------------------------ // | ------------------------------------------------------------
import CreateAntdButton from './Button/CreateAntdButton.vue'; import CreateAntdButton from './Button/CreateAntdButton.vue';
import AckCreateAntdButton from './Button/AckCreateAntdButton.vue';
// ! 全局导出自定义的Antd组件 // ! 全局导出自定义的Antd组件
export default function setupCustomAntdComponents(app) { export default function setupCustomAntdComponents(app) {
const customComponentList = [ const customComponentList = [
CreateAntdButton, // ! 主要添加按钮 CreateAntdButton, // ! 主要添加按钮
AckCreateAntdButton
]; ];
for (let component of customComponentList) { for (let component of customComponentList) {
app.component(component.__name, component); app.component(component.__name, component);

@ -24,7 +24,12 @@ import {
Space, Space,
Flex, Flex,
Select, Select,
SelectOption, Textarea, Input, Radio, RadioGroup, InputNumber, SelectOption,
Textarea,
Input,
Radio,
RadioGroup,
InputNumber, Affix,
} from 'ant-design-vue'; } from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css'; import 'ant-design-vue/dist/reset.css';
@ -56,6 +61,7 @@ export function setupCustomAntDesignVueComponents(app) {
RadioGroup, // ! 单选组 RadioGroup, // ! 单选组
Radio, // ! 单选 Radio, // ! 单选
InputNumber, // ! 数字输入框 InputNumber, // ! 数字输入框
Affix, // ! 固钉
]; ];
for (let component of componentList) { for (let component of componentList) {
app.component(component.name, component); app.component(component.name, component);

@ -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>

@ -5,7 +5,7 @@ import DictForm from './DictForm.vue';
// ! // !
const form = reactive({ const form = reactive({
// //
status: true, status: false,
// //
formData: { formData: {
pid: 0, pid: 0,
@ -14,7 +14,7 @@ const form = reactive({
// //
dictDesc: '', dictDesc: '',
// //
dictName: '', dictName: 'AAAAAAA',
// //
dictIcon: '', dictIcon: '',
// //
@ -27,7 +27,9 @@ const form = reactive({
orderNum: 0, orderNum: 0,
}, },
// //
handleAck: () => {}, handleAck: () => {
console.log('确认');
},
// //
handleCancel: () => {}, handleCancel: () => {},
}); });
@ -40,8 +42,9 @@ const form = reactive({
<CreateAntdButton name="字典" @click="form.status = true"/> <CreateAntdButton name="字典" @click="form.status = true"/>
</template> </template>
<template #modal> <template #modal>
<AModal v-model:open="form.status" title="添加字典" :centered="true"> <AModal v-model:open="form.status" title="添加字典" :centered="true" :maskClosable="false">
<DictForm :form="form.formData" :handleAck="form.handleAck" :handleCancel="form.handleCancel"></DictForm> <DictForm v-if="form.status" :form="form.formData" :handleAck="form.handleAck" :handleCancel="form.handleCancel" :status:="form.status"></DictForm>
<template #footer></template>
</AModal> </AModal>
</template> </template>
</WorkContainer> </WorkContainer>

Loading…
Cancel
Save