feat: 优化大屏

This commit is contained in:
fyy
2025-08-05 17:07:10 +08:00
parent c847bd29e1
commit 2beb771185
24 changed files with 1671 additions and 1481 deletions

View File

@@ -7,7 +7,7 @@ import { carChargeAdd } from '#/api/property/carCharge';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { addModalSchema } from './data';
import { communityTree } from '#/api/property/community';
import { cloneDeep,handleNode,getPopupContainer } from '@vben/utils';
import { cloneDeep, handleNode, getPopupContainer } from '@vben/utils';
const emit = defineEmits<{ reload: [] }>();
@@ -41,11 +41,11 @@ const [BasicModal, modalApi] = useVbenModal({
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) return null;
setupCommunitySelect()
setupCommunitySelect();
modalApi.modalLoading(true);
await formApi.resetForm();
await markInitialized();
await formApi.setValues({costType:'2'});
await formApi.setValues({ costType: '2' });
modalApi.modalLoading(false);
},
});
@@ -72,12 +72,12 @@ async function handleClosed() {
resetInitialized();
}
async function setupCommunitySelect() {
const areaList = await communityTree(4);
const areaList = await communityTree(3);
// 选中后显示在输入框的值 即父节点 / 子节点
// addFullName(areaList, 'areaName', ' / ');
const splitStr = '/';
handleNode(areaList, 'label', splitStr, function (node: any) {
if (node.level != 4) {
if (node.level != 3) {
node.disabled = true;
}
});
@@ -112,7 +112,7 @@ async function setupCommunitySelect() {
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>
</template>
<style scoped>
/* 使用 :deep() 穿透 scoped 样式,影响子组件 */
@@ -126,4 +126,4 @@ async function setupCommunitySelect() {
/* 有些浏览器需要这个来覆盖默认颜色 */
-webkit-text-fill-color: rgb(0 0 0 / 65%) !important;
}
</style>
</style>

View File

@@ -111,7 +111,6 @@ const schema = [
itemId: '',
meterTypeId: '',
});
console.log(await formApi.getValues());
},
},
},
@@ -216,8 +215,6 @@ const [BasicModal, modalApi] = useVbenModal({
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await costMeterWaterInfo(id);
console.log(1, record);
const costItemsRes = await costItemSettingList({
pageSize: 1000000000,
pageNum: 1,
@@ -253,7 +250,6 @@ const [BasicModal, modalApi] = useVbenModal({
},
]);
await formApi.setValues(record);
console.log(2, await formApi.getValues());
}
await markInitialized();
@@ -270,8 +266,6 @@ async function handleConfirm() {
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
console.log(data);
await (isUpdate.value
? costMeterWaterUpdate(data)
: costMeterWaterAdd(data));