This commit is contained in:
wangzenghua 2025-04-02 10:13:20 +01:00
parent edf016b1c7
commit b204de0dc7

View File

@ -34,20 +34,18 @@
</div>
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue';
import { useRouter } from 'vue-router';
import { ref, reactive } from 'vue';
import { useApp } from '@/hooks';
import { useUserStore } from '@/store/modules/user';
import { CRUD_OPTIONS } from '@/config';
import { isEmpty, setDicData, debounce } from '@/utils';
import { CommonDicData } from '@/apis';
// import { CommonDicData } from '@/apis';
import { getLandsList } from '@/apis/land';
import { GetEntityList, AddEntity, UpdateEntity, DeleteEntity, UpdateStatus } from '@/apis/plantingAndBreeding/base';
const { VITE_APP_BASE_API } = import.meta.env;
const app = useApp();
const UserStore = useUserStore();
const router = useRouter();
const crudRef = ref(null);
const state = reactive({
loading: false,
@ -147,8 +145,9 @@ const state = reactive({
disabled: true,
labelTip: '请先选择地块!',
formatter: (row) => {
const item = state.unitList.find((v) => v.dictValue == row.unit);
return row.area + (!isEmpty(item) ? item.dictLabel : '平方米');
// const item = state.unitList.find((v) => v.dictValue == row.unit);
// return row.area + (!isEmpty(item) ? item.dictLabel : '');
return row.area + (!isEmpty(row.unit) ? row.unit : '平方米');
},
},
{
@ -243,18 +242,18 @@ const state = reactive({
});
//
const getUnit = async () => {
CommonDicData('sys_unit_type')
.then((res) => {
console.log(250, res);
if (res.code === 200) {
state.unitList = res.data;
}
})
.catch((err) => {
app.$message.error(err.msg);
});
};
// const getUnit = async () => {
// CommonDicData('sys_unit_type')
// .then((res) => {
// console.log(250, res);
// if (res.code === 200) {
// state.unitList = res.data;
// }
// })
// .catch((err) => {
// app.$message.error(err.msg);
// });
// };
const loadData = async () => {
state.loading = true;
@ -281,9 +280,9 @@ const loadData = async () => {
loadData();
onMounted(() => {
getUnit();
});
// onMounted(() => {
// getUnit();
// });
//
const currentChange = (current) => {