Compare commits

..

No commits in common. "d7fbd3d720421018c9e4e5600d54123d6316c518" and "5e76a17a25e9469cda4b290468c98140e359c33f" have entirely different histories.

5 changed files with 272 additions and 514 deletions

View File

@ -16,6 +16,6 @@ VITE_APP_UPLOAD_API = '/uploadApis'
# VITE_APP_BASE_URL = 'http://47.109.205.240:8080' # VITE_APP_BASE_URL = 'http://47.109.205.240:8080'
# VITE_APP_UPLOAD_URL = 'http://47.109.205.240:9300' # VITE_APP_UPLOAD_URL = 'http://47.109.205.240:9300'
# 内网接口地址 # 内网接口地址
VITE_APP_BASE_URL = 'http://192.168.18.88:8080' VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
VITE_APP_UPLOAD_URL = 'http://192.168.18.88:8080' VITE_APP_UPLOAD_URL = 'http://192.168.18.99:8080'
VITE_APP_VIST_URL = 'http://192.168.18.99' VITE_APP_VIST_URL = 'http://192.168.18.99'

View File

@ -13,8 +13,8 @@ VITE_APP_UPLOAD_API = '/uploadApis'
# VITE_APP_UPLOAD_URL = 'http://47.109.205.240:9204' # VITE_APP_UPLOAD_URL = 'http://47.109.205.240:9204'
# 内网测试库接口地址 # 内网测试库接口地址
VITE_APP_BASE_URL = 'http://192.168.18.88:8080' VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
VITE_APP_UPLOAD_URL = 'http://192.168.18.88:8080' VITE_APP_UPLOAD_URL = 'http://192.168.18.99:8080'
# 本地开发接口地址 # 本地开发接口地址
# VITE_APP_BASE_URL = 'http://192.168.18.99:8080' # VITE_APP_BASE_URL = 'http://192.168.18.99:8080'

View File

@ -1,38 +0,0 @@
import request from '@/utils/axios';
/**
* @Title: 列表
*/
export function GetOutputList(params = {}) {
return request('/inputGoods/outPut/page', {
method: 'GET',
params,
});
}
/**
* @Title: 新增
*/
export function AddOutput(data = {}) {
return request('/inputGoods/outPut/save', {
method: 'POST',
data,
});
}
/**
* @Title: 编辑
*/
export function UpdateOutput(data = {}) {
return request('/inputGoods/outPut/uploadReport', {
method: 'PUT',
data,
});
}
/**
* @Title: 删除
*/
export function DeleteOutput(ids) {
return request(`/inputGoods/outPut/delete/${ids}`);
}

View File

@ -256,7 +256,7 @@
// color: #fff; // color: #fff;
} }
.table-cell-img-box { .table-cell-img-box {
width: 100%; width: 60px;
height: 60px; height: 60px;
text-align: center; text-align: center;
overflow: hidden; /* 隐藏超出部分 */ overflow: hidden; /* 隐藏超出部分 */

View File

@ -1,112 +1,84 @@
<template> <template>
<div class="app-container"> <div class="custom-page">
<div class="container-custom"> <div class="custom-search">
<h2 class="custom-h2">产出品信息</h2> <AreaCascader v-model:region-code="searchForm.regionCode" v-model:grid-id="searchForm.id" :width="600" />
<div ref="searchBarRef" class="search-box"> <el-button type="primary" @click="handleSearch"> 搜索 </el-button>
<div class="search-bar"> <el-button @click="resetSearch"> 重置 </el-button>
<div class="search-bar-left">
<el-form ref="searchForm" :inline="true" :model="formInline" class="demo-form-inline" :label-width="'auto'">
<el-form-item label="关键词" prop="name">
<el-input v-model="formInline.name" placeholder="请输入关键词" clearable />
</el-form-item>
<!-- <el-form-item label="分类" prop="seedTypeId">
<el-select v-model="formInline.seedTypeId" placeholder="请选择" clearable @change="seedTypeChange">
<el-option v-for="item in seedTypeList" :key="item.id" :value="item.id" :label="item.dataName" />
</el-select>
</el-form-item> -->
<el-form-item label="">
<el-button type="primary" icon="Search" @click="onSubmit">查询</el-button>
<el-button icon="Refresh" @click="resetForm">重置</el-button>
</el-form-item>
</el-form>
</div> </div>
</div> <avue-crud
</div> ref="crudRef"
<div class="table-toolbar"> v-model:page="pageData"
<el-button type="primary" icon="plus" @click="addItem()">新增</el-button> :data="crudData"
</div> :option="crudOptions"
<div class="table-statistics flex-left-center"> :table-loading="loading"
<el-icon class="mr-20" color="#409eff" size="16"><InfoFilled /></el-icon> @refresh-change="handleRefresh"
<div class="mr-20"> @current-change="handleCurrentChange"
已选择 <span class="color-blue">{{ landNums }}</span> 个地块 @size-change="handleSizeChange"
</div>
<div class="mr-20">
面积总计<span class="color-blue">{{ totalArea }}</span>
</div>
<div class="mr-20">
产量总计公斤<span class="color-blue">{{ yieldSeed }}</span>
</div>
</div>
<div class="table-cont">
<tableComponent
:table-data="tableData"
:columns="columns"
:show-selection="true"
:loading="tableLoading"
:total="tableTotal"
:current-page="formInline.current"
:page-size="formInline.size"
:show-sort="false"
@page-change="handlePaginationChange"
@selection-change="handleSelectionChange"
> >
<!-- 自定义-操作 --> <template #menu="scope">
<template #action="slotProps"> <custom-table-operate :actions="crudOptions.actions" :data="scope" />
<!-- <el-button type="primary" @click="seeDetails(slotProps.row)">查看</el-button> -->
<!-- <el-button type="primary" @click="handleEdit(slotProps.row)">编辑</el-button> -->
<el-button @click="handleDelete(slotProps.row)">删除</el-button>
</template> </template>
</tableComponent> </avue-crud>
</div> <el-dialog :key="dialogTitle" v-model="visible" :title="dialogTitle" width="60%" align-center :draggable="true">
</div> <el-form ref="form" :model="formData" :rules="rules" :disabled="isReadonly" label-width="120px" class="form-item">
<el-dialog v-model="dialogFormVisible" :title="dialogTitle" width="800" :close-on-click-modal="false" align-center> <el-row :gutter="20">
<el-form :inline="true" :label-width="'auto'"> <el-col :span="24"><p class="form-title">基础信息</p></el-col>
<LandSelect ref="landSelectRef" v-model="dialogForm.landId" :options="landSelectList" :disabled="formDisabled" @change="handleLandChange" /> <el-col :span="12">
</el-form> <el-form-item label="农产品名称" prop="productName">
<el-descriptions title="地块信息" border class="mb-20 custom-descriptions" :column="2"> <el-input v-model="formData.productName" placeholder="请输入网格名称" />
<el-descriptions-item label="农产品名称">{{ dialogForm.cropName }}</el-descriptions-item>
<el-descriptions-item label="面积(亩)">{{ dialogForm.area }}</el-descriptions-item>
<el-descriptions-item label="行政区域编码">{{ dialogForm.regionCode }}</el-descriptions-item>
<el-descriptions-item label="行政区域名称">{{ dialogForm.regionName }}</el-descriptions-item>
<el-descriptions-item label="网格编码">{{ dialogForm.gridId }}</el-descriptions-item>
<el-descriptions-item label="网格名称">{{ dialogForm.gridName }}</el-descriptions-item>
<el-descriptions-item label="地块编码">{{ dialogForm.landId }}</el-descriptions-item>
<el-descriptions-item label="地块名称">{{ dialogForm.landName }}</el-descriptions-item>
<el-descriptions-item label="姓名">{{ dialogForm.propertyName }}</el-descriptions-item>
<el-descriptions-item label="联系方式">{{ dialogForm.propertyPhone }}</el-descriptions-item>
</el-descriptions>
<el-form
ref="dialogRef"
:model="dialogForm"
:inline="true"
:label-width="'120'"
:rules="dialogFormRules"
:disabled="formDisabled"
class="dialog-form-container"
>
<div class="el-descriptions__title" style="margin-bottom: 16px">产量信息</div>
<el-form-item label="采收时间" prop="detectionTime" class="dialog-form-item">
<el-date-picker v-model="dialogForm.detectionTime" :clearable="false" type="date" value-format="YYYY-MM-DD" placeholder="请选择使用时间" />
</el-form-item> </el-form-item>
<el-form-item label="亩产量(公斤)" required prop="yield" class="dialog-form-item"> <el-form-item label="面积(亩)" prop="area">
<el-input-number v-model="dialogForm.yield" :min="1" controls-position="right" placeholder="请输入亩产量" style="width: 230px" /> <el-input v-model="formData.area" placeholder="请输入种植面积" />
</el-form-item> </el-form-item>
<el-form-item label="总产量(公斤)" prop="totalYield" class="dialog-form-item"> <el-form-item label="行政区划" prop="gridAreaCode">
<el-input-number <AreaSelect v-model="formData.gridAreaCode" :label="null" :emit-path="false" />
v-model="dialogForm.totalYield"
disabled
:min="0"
controls-position="right"
placeholder="请输入亩产量"
style="width: 230px"
/>
</el-form-item> </el-form-item>
<el-form-item label="联系方式" prop="contactInfo">
<el-input v-model="formData.contactInfo" placeholder="请输入联系方式" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="地块" prop="landName">
<el-input v-model="formData.landName" placeholder="请输入地块名称" />
</el-form-item>
<el-form-item label="网格" prop="gridName">
<el-input v-model="formData.gridName" placeholder="请输入网格名称" />
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input v-model="formData.name" placeholder="请输入姓名" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24"><p class="form-title">品质信息</p></el-col>
<el-col :span="12">
<el-form-item label="采收时间" prop="harvestTime">
<el-input v-model="formData.harvestTime" placeholder="请输入采收时间" />
</el-form-item>
<el-form-item label="地块总产(公斤)" prop="totalYield">
<el-input v-model="formData.totalYield" placeholder="请输入地块总产" />
</el-form-item>
<!-- <el-form-item label="价格(元/公斤)" prop="price">
<el-input v-model="formData.price" placeholder="请输入价格" />
</el-form-item> -->
</el-col>
<el-col :span="12">
<el-form-item label="亩产(公斤)" prop="yieldPerMu">
<el-input v-model="formData.yieldPerMu" placeholder="请输入亩产" />
</el-form-item>
<!-- <el-form-item label="品质" prop="quality">
<el-input v-model="formData.quality" placeholder="请输入品质" />
</el-form-item>
<el-form-item label="产值(元)" prop="outputValue">
<el-input v-model="formData.outputValue" placeholder="请输入产值" />
</el-form-item> -->
</el-col>
</el-row>
</el-form> </el-form>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button v-if="!formDisabled" type="primary" @click="onSaveCategory">保存</el-button> <el-button @click="handleCancel">取消</el-button>
<el-button v-if="!formDisabled" @click="cancelDialog">取消</el-button> <el-button v-if="!isReadonly" type="primary" @click="handleSubmit()"> 保存 </el-button>
<el-button v-else @click="cancelDialog">关闭</el-button>
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
@ -114,405 +86,229 @@
</template> </template>
<script setup> <script setup>
import { ref, reactive, computed, onMounted, onBeforeUnmount, nextTick, watch } from 'vue'; // ---------------------------------------------------------------------
import tableComponent from '@/components/tableComponent.vue'; // avue-crud
import LandSelect from '@/components/LandSelect.vue'; // ---------------------------------------------------------------------
import { ElMessage } from 'element-plus'; import { ref, reactive, watch, onMounted, computed, nextTick } from 'vue';
import inputSuppliesApi from '@/apis/inputSuppliesApi'; import { CRUD_OPTIONS } from '@/config';
const { getMaterailTypes } = inputSuppliesApi; import { ElMessage, ElMessageBox } from 'element-plus';
import { GetOutputList, AddOutput, UpdateOutput, DeleteOutput } from '@/apis/outputProducts'; import { useUserStore } from '@/store/modules/user';
import { getLandList } from '@/apis/inputSuppliesApi/supervisionOfInputs';
import request from '@/utils/axios';
import { GetDictTypeInfo } from '@/apis/system/dictType';
import { useApp } from '@/hooks';
const app = useApp();
// const UserStore = useUserStore();
const formInline = reactive({ const user = UserStore.getUserInfo();
name: '', console.log('admin 属性:', user.admin);
seedTypeId: '',
current: 1, const loading = ref(false);
size: 10,
const visible = ref(false);
const isReadonly = ref(false);
const dialogTitle = ref();
const formData = ref({
gridName: '',
gridAreaCode: '',
scope: '',
scopeImg: '',
note: '',
}); });
const searchForm = ref(null); const initialFormData = { ...formData.value };
const onSubmit = () => {
formInline.current = 1;
loadData();
};
const resetForm = () => { const resetForm = () => {
searchForm.value.resetFields(); formData.value = { ...initialFormData };
}; };
// const pageData = ref({
const tableData = ref([]); currentPage: 1,
const selectedIds = ref([]); pageSize: 10,
const selectedRows = ref([]); total: 0,
const tableLoading = ref(false); });
const tableTotal = ref(0); const searchForm = ref({
const columns = ref([ gridName: '',
{ label: '行政区划编码', prop: 'regionCode', width: 150 }, keyword: '',
{ label: '行政区划', prop: 'regionName', width: 150 }, regionCode: '',
{ label: '网格编码', prop: 'gridId', width: 150 }, id: '',
status: -1,
});
const initialSearchForm = { ...searchForm.value };
const resetSearch = () => {
searchForm.value = { ...initialSearchForm };
};
//
const filterObject = (obj) => {
const newObj = {};
Object.keys(obj).forEach((key) => {
const value = obj[key];
// null undefined
if (value !== '' && value !== null && value !== undefined) {
newObj[key] = value;
}
});
return newObj;
};
const crudData = ref([]);
const crudOptions = reactive({
...CRUD_OPTIONS,
// menu: false,
header: false,
height: 'calc(100vh - 340px)',
selection: true,
column: [
{ label: '行政区划编码', prop: 'AreaCode', width: 150 },
{ label: '行政区划', prop: 'gridAreaName', width: 150 },
{ label: '网格编码', prop: 'gridCode', width: 150 },
{ label: '网格名称', prop: 'gridName', width: 150 }, { label: '网格名称', prop: 'gridName', width: 150 },
{ label: '地块编码', prop: 'landId', width: 150 }, { label: '地块编码', prop: 'landCode', width: 150 },
{ label: '地块名称', prop: 'landName' }, { label: '地块', prop: 'landName' },
{ label: '农产品名称', prop: 'cropName', width: 150 }, { label: '农产品名称', prop: 'productName', width: 150 },
{ label: '面积(亩)', prop: 'area' }, { label: '面积(亩)', prop: 'area', formatter: (row, cloumn, cellValue) => `${Number(cellValue).toFixed(2)}` },
{ label: '亩产(公斤)', prop: 'yield', width: 80 }, { label: '亩产(公斤)', prop: 'yieldPerMu', width: 80 },
{ label: '地块总产(公斤)', prop: 'totalYield' }, { label: '地块总产(公斤)', prop: 'totalYield' },
{ label: '生产经营主体编码', prop: 'businessEntityCode', width: 150 }, { label: '生产经营主体编码', prop: 'enterCode', width: 150 },
{ label: '生产经营主体类型', prop: 'businessEntityType', width: 150 }, { label: '生产经营主体类型', prop: 'enterType', width: 150 },
{ label: '生产经营主体名称', prop: 'businessEntityName' }, { label: '生产经营主体名称', prop: 'enterName' },
{ label: '是否溯源', prop: 'isTrace' }, { label: '是否溯源', prop: 'isTrace' },
{ prop: 'action', label: '操作', slotName: 'action', width: 100, fixed: 'right' }, ],
]); actions: [
const handlePaginationChange = ({ page, pageSize }) => { {
formInline.current = page; name: '查看',
formInline.size = pageSize; icon: 'view',
loadData(); event: ({ row }) => handleView(row),
}; },
let landNums = ref(0); // {
let totalArea = computed(() => { // name: '',
const sum = selectedRows.value.reduce((sum, item) => { // icon: 'edit',
return sum + Math.round(item.area * 100); // event: ({ row }) => handleEdit(row),
}, 0); // },
const result = sum / 100; {
return parseFloat(result.toFixed(2)); type: 'danger',
name: '删除',
icon: 'delete',
event: ({ row }) => handleDelete(row),
},
],
}); });
let yieldSeed = computed(() => { const handleRefresh = async () => {
const sum = selectedRows.value.reduce((sum, item) => { searchForm.value = { ...initialSearchForm };
return sum + Math.round(item.totalYield * 100); getData();
}, 0);
const result = sum / 100;
return parseFloat(result.toFixed(2));
});
const handleSelectionChange = (selection, keys) => {
// console.log(selection, keys);
selectedRows.value = selection;
landNums.value = selection.length;
}; };
const loadData = async () => { const handleCurrentChange = (val) => {
tableLoading.value = true; pageData.value.currentPage = val;
try {
let response = await GetOutputList(formInline);
tableLoading.value = false;
if (response.code == 200) {
tableData.value = response.data.records;
tableTotal.value = response.data.total;
}
} catch (error) {
tableLoading.value = false;
console.error(error);
}
}; };
const handleSizeChange = (val) => {
const extractThirdLevelChildren = (dataArray) => { pageData.value.pageSize = val;
let result = [];
//
for (const level1 of dataArray) {
// children
if (level1.children && Array.isArray(level1.children)) {
//
for (const level2 of level1.children) {
// children
if (level2.children && Array.isArray(level2.children)) {
//
result.push(...level2.children);
}
}
}
}
return result;
}; };
const seedTypeChange = () => { const handleView = (row) => {
console.log(formInline.seedTypeId); isReadonly.value = true;
// formData.value = { ...row };
}; dialogTitle.value = '产出品信息';
visible.value = true;
const dialogFormVisible = ref(false);
const dialogRef = ref(null);
const dialogTitle = ref('新增');
const formDisabled = ref(false);
const landSelectRef = ref(null);
const nowSelectRow = ref({});
const dialogForm = reactive({
area: 0, //
regionCode: '', //
regionName: '', //
gridId: '', //
gridName: '', //
landId: '', //id
landName: '', //
name: '', //
phone: '', //
totalYield: 0, //
yield: 1, //
detectionTime: '', //使
businessEntityCode: '', //
businessEntityName: '', //
});
const dialogFormRules = ref({
yield: [{ required: true, message: '请输入亩产量', trigger: ['change', 'blur'] }],
detectionTime: [{ required: true, message: '请选择使用时间', trigger: 'blur' }],
});
watch(
() => dialogForm.yield,
(val) => {
console.log(val);
console.log(dialogForm.area);
console.log(val * dialogForm.area);
dialogForm.totalYield = val * dialogForm.area;
}
);
const addItem = async () => {
// ElMessage.success('!');
restDialogForm();
dialogTitle.value = '新增';
formDisabled.value = false;
dialogFormVisible.value = true;
};
const seeDetails = async (row) => {
// ElMessage.success('!');
dialogTitle.value = '详情';
console.log(row);
formDisabled.value = true;
dialogForm.landId = row.landId;
getDetails();
dialogForm.totalYield = row.totalYield ?? 0;
dialogForm.yield = row.yield;
dialogForm.useUnit = row.useUnit;
dialogForm.detectionTime = row.useTime;
dialogFormVisible.value = true;
}; };
const handleEdit = (row) => { const handleEdit = (row) => {
// ElMessage.success('!'); isReadonly.value = false;
nowSelectRow.value = row; formData.value = { ...row };
dialogTitle.value = '编辑'; dialogTitle.value = '编辑';
console.log(row); visible.value = true;
formDisabled.value = false;
dialogForm.landId = row.landId;
getDetails();
dialogForm.totalYield = row.totalYield ?? 0;
dialogForm.yield = row.yield;
dialogForm.useUnit = row.useUnit;
dialogForm.detectionTime = row.useTime;
dialogFormVisible.value = true;
}; };
// const handleDelete = async (row) => {
const getDetails = async () => { try {
let response = await request({ await ElMessageBox.confirm('确认删除该网格吗?', '提示', {
url: `/land-resource/landManage/getLandInfo?landId=${dialogForm.landId}`,
});
console.log(response);
if (response.code == 200) {
if (response.data) {
setDialogForm(response.data);
} else {
ElMessage.error('未查询到数据');
}
} else {
ElMessage.error(response.message);
}
};
const setDialogForm = (row) => {
dialogForm.area = row.area;
dialogForm.regionCode = row.gridAreaCode;
dialogForm.regionName = row.fullRegionName;
dialogForm.gridId = row.gridId;
dialogForm.gridName = row.gridName;
dialogForm.landId = row.id;
dialogForm.landName = row.landName;
dialogForm.name = row.propertyName;
dialogForm.phone = row.propertyPhone;
dialogForm.businessEntityCode = row.businessEntityCode ?? '';
dialogForm.businessEntityName = row.businessEntityName ?? '';
};
const handleDelete = (row) => {
console.log('删除操作: ', row);
app
.$confirm(`删除后信息将不可查看,确认要删除吗?`, '确定删除', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
})
.then(() => {
deleteGoods(row.id)
.then((res) => {
if (res.code === 200) {
onSubmit();
app.$message.success('删除成功!');
}
})
.catch((err) => {
app.$message.error(err.msg);
}); });
})
.catch(() => {}); const response = await deleteGrid(row.id);
};
const deleteGoods = async (ids) => { ElMessage.success('删除成功');
try { getData();
let res = await DeleteOutput(ids);
return res;
} catch (error) { } catch (error) {
return false; if (error === 'cancel') {
} ElMessage.info('已取消删除');
};
const onSaveCategory = () => {
console.log(dialogForm);
if (dialogForm.landId == '') {
landSelectRef.value.handleChange();
return;
}
dialogRef.value.validate(async (valid, fields) => {
if (valid) {
try {
let param = { ...dialogForm };
param.useTime = dialogForm.detectionTime;
console.log(param);
// valid.businessEntityCode = dialogForm.businessEntityCode; //
// valid.businessEntityName = dialogForm.businessEntityName; //
let response;
if (dialogTitle.value == '新增') {
response = await AddOutput(param);
} else { } else {
param.id = nowSelectRow.value.id; ElMessage.error('删除失败');
response = await UpdateOutput(param); console.error('删除异常:', error);
} }
if (response.code == 200) {
cancelDialog();
onSubmit();
if (dialogTitle.value == '新增') {
ElMessage.success('新增成功!');
} else {
ElMessage.success('编辑成功!');
}
} else {
ElMessage.error(response.msg);
}
} catch (error) {
console.error(error);
}
}
});
};
const cancelDialog = async () => {
restDialogForm();
dialogFormVisible.value = false;
};
const restDialogForm = () => {
Object.assign(dialogForm, {
area: 0, //
regionCode: '', //
regionName: '', //
gridId: '', //
gridName: '', //
landId: '', //id
landName: '', //
name: '', //
phone: '', //
totalYield: 0, //
yield: 1, //
useTime: '', //使
businessEntityCode: '', //
businessEntityName: '', //
});
nowSelectRow.value = ref({});
};
const seedTypeList = ref([]);
const seedTypeDialogList = ref([]);
const getSeedTypeList = async () => {
try {
let response = await getMaterailTypes({ moduleType: '4' });
console.log(response);
if (response.code == 200) {
if (response.data?.length > 0) {
seedTypeDialogList.value = response.data[0].children;
let result = extractThirdLevelChildren(response.data);
seedTypeList.value = result;
console.log(seedTypeDialogList.value);
}
}
} catch (error) {
console.error(error);
} }
}; };
const unitList = ref([ const handleSubmit = async () => {
{ dictCode: '52', dictValue: 'g' }, console.log('提交表单:', formData.value);
{ dictCode: '53', dictValue: 'kg' }, // try {
]); // if (dialogTitle.value === '') {
// await createGrid(formData.value);
const landSelectList = ref([]); // ElMessage.success('');
const getLandsList = async () => { // resetForm();
let res = await getLandList(); // visible.value = false;
if (res.code == 200) { // getData();
landSelectList.value = res.data; // } else {
} // await updateGrid(formData.value);
}; // ElMessage.success('');
const handleLandChange = (val) => { // resetForm();
console.log(val); // visible.value = false;
if (val) { // getData();
getDetails(); // }
} else { // } catch (error) {
restDialogForm(); // ElMessage.error(error.message || '');
} // }
};
const getEntityOptions = async () => {
let res = await GetDictTypeInfo('sys_use_supervise_number');
console.log(res);
if (res.code == 200) {
unitList.value = res.data;
} else {
unitList.value = [
{ dictCode: '52', dictValue: 'g' },
{ dictCode: '53', dictValue: 'kg' },
];
}
}; };
// ---------------------------------------------------------------------
//
// ---------------------------------------------------------------------
import { createGrid, updateGrid, deleteGrid, fetchGridList, getGridDetail, exportGrid } from '@/apis/landResourceManagement/gridManagement';
import { mockData } from './output';
onMounted(() => { onMounted(() => {
onSubmit(); getData();
getLandsList();
getEntityOptions();
// getSeedTypeList();
}); });
const getData = async () => {
// const filteredParams = filterObject(searchForm.value);
// const response = await fetchGridList(filteredParams);
// crudData.value = Array.isArray(response.data.records) ? response.data.records : [];
await new Promise((resolve) => setTimeout(resolve, 300));
crudData.value = mockData;
pageData.value.total = crudData.value.length;
};
const handleAdd = () => {
console.log('handleAdd');
resetForm();
isReadonly.value = false;
dialogTitle.value = '新增网格';
visible.value = true;
};
const handleSearch = () => {
getData();
};
const handleCancel = () => {
visible.value = false;
};
</script> </script>
<style lang="scss" scoped>
.dialog-form-item {
:deep(.el-upload--picture-card) {
width: 100px;
height: 100px;
}
:deep(.file-uploader__upload) { <style scoped lang="scss">
width: 100px; :deep(.el-dialog__body) {
height: 100px; padding: 20px;
} height: calc(100vh - 300px);
overflow-y: auto;
}
.form-title {
font-size: 16px;
font-weight: 500;
margin: 30px 0;
color: #333333;
}
.form-item {
margin: 0 auto;
}
.dialog-footer {
text-align: center;
}
.custom-search {
display: flex;
align-items: center;
margin-bottom: 16px;
:deep(.el-upload-list__item) { .el-button {
width: 100px; margin-left: 12px;
height: 100px;
} }
} }
/* 必须使用深度选择器 + 精确DOM层级 */
.custom-descriptions :deep(.el-descriptions__body) table.el-descriptions__table {
table-layout: fixed; /* 关键属性1强制等宽 */
width: 100%;
}
.custom-descriptions :deep(.el-descriptions__label) {
width: 130px !important; /* 关键属性2固定宽度 */
min-width: 130px !important;
max-width: 130px !important;
background: #f5f7fa;
font-weight: bold;
text-align: left;
padding-right: 20px;
}
.custom-descriptions :deep(.el-descriptions__content) {
width: calc(100% - 130px) !important; /* 自动填充剩余空间 */
word-break: break-word;
}
</style> </style>