点击选择账号

This commit is contained in:
lq
2025-09-19 18:36:20 +08:00
parent 77cd789d4a
commit c70b44022b
2 changed files with 39 additions and 2 deletions

View File

@ -149,7 +149,7 @@
</template>
<script lang="ts" setup>
import { ref, reactive, onMounted, watch } from 'vue';
import { ref, reactive, onMounted, nextTick } from 'vue';
import aiIcon from '@/assets/img/media-account/icon-AI.png';
import { Checkbox, Button, Space, Pagination, notification, DatePicker, TimePicker } from 'ant-design-vue';
import { TABS_LIST, ORIGIN_LIST, RawMaterialType } from '@/views/material-center/components/raw-material/constants';
@ -263,8 +263,15 @@ const handleAddMaterial = () => {
};
const handleDateChange = (date) => {};
// 暴露方法给父组件
const showDrawer = () => {
const showDrawer = (accountInfo = null) => {
showDriwer.value = true;
// 如果传入了账号信息,则设置为默认选中
if (accountInfo && accountInfo.id) {
// 使用 nextTick 确保在 DOM 更新后设置默认值
nextTick(() => {
localQuery.value.accounts = [accountInfo.name];
});
}
};
const showDriwerChange = (visible: boolean) => {