This commit is contained in:
沈鸿 2025-06-13 10:00:09 +08:00
parent 2a7d36761d
commit a65ce4b6a8
6 changed files with 41 additions and 10 deletions

View File

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

View File

@ -13,5 +13,5 @@ VITE_APP_UPLOAD_API = '/uploadApis'
# VITE_APP_UPLOAD_URL = 'http://47.109.205.240:9300'
# 内网接口地址
VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
VITE_APP_UPLOAD_URL = 'http://192.168.18.99:8080'
VITE_APP_BASE_URL = 'http://192.168.18.74:8080'
VITE_APP_UPLOAD_URL = 'http://192.168.18.74:8080'

View File

@ -15,7 +15,7 @@ export function deleteGrid(id) {
}
// 修改PUT
export function updateGrid(data = {}) {
return request('//land-resource/gridManage/edit', {
return request('/land-resource/gridManage/edit', {
method: 'PUT',
data,
});

View File

@ -130,6 +130,7 @@ const containerStyle = computed(() => ({
display: flex;
gap: 0;
align-items: center;
background-color: antiquewhite;
}
.area-cascader-separator {
align-self: center;

View File

@ -191,9 +191,15 @@ const handleSubmit = async () => {
if (dialogTitle.value === '新增网格') {
await createGrid(formData.value);
ElMessage.success('新增成功');
resetForm();
visible.value = false;
getData();
} else {
await updateGrid(formData.value);
ElMessage.success('更新成功');
resetForm();
visible.value = false;
getData();
}
} catch (error) {
ElMessage.error(error.message || '新增失败,请重试');

View File

@ -48,20 +48,21 @@
</template>
</avue-crud>
<el-dialog v-model="addDialogVisible" :title="isEdit ? '编辑网格员' : '新增网格员'" width="600px">
<el-form ref="addFormRef" :model="addForm" :rules="addFormRules" label-width="120px">
<el-dialog :key="dialogTitle" v-model="addDialogVisible" :title="isEdit ? '编辑网格员' : '新增网格员'" width="60%" align-center :draggable="true">
<el-form ref="addFormRef" :model="addForm" :rules="addFormRules" label-width="120px" class="form-item">
<p class="form-title">填写网格员信息</p>
<el-form-item label="网格员姓名" prop="memberName">
<el-input v-model="addForm.memberName" style="width: 380px" />
<el-input v-model="addForm.memberName" />
</el-form-item>
<el-form-item label="" prop="gridId" label-width="0px">
<!-- 假设 AreaCascader 是行政区域-网格的级联选择组件 -->
<AreaCascader v-model:region-code="addForm.gridAreaCode" v-model:grid-id="addForm.gridId" split-rows label="" />
</el-form-item>
<el-form-item label="电话号码" prop="phone">
<el-input v-model="addForm.phone" style="width: 380px" />
<el-input v-model="addForm.phone" />
</el-form-item>
<el-form-item label="备注" prop="note">
<el-input v-model="addForm.note" type="textarea" style="width: 380px" />
<el-input v-model="addForm.note" type="textarea" />
</el-form-item>
</el-form>
<template #footer>
@ -351,6 +352,11 @@ const onExport = () => {
</script>
<style scoped lang="scss">
:deep(.el-dialog__body) {
padding: 20px;
height: calc(100vh - 300px);
overflow-y: auto;
}
.custom-page {
padding: 20px;
.custom-search {
@ -394,4 +400,22 @@ const onExport = () => {
}
}
}
.form-title {
font-size: 16px;
font-weight: 500;
margin: 30px 0;
color: #333333;
}
.form-item {
width: 500px;
margin: 0 auto;
}
.dialog-footer {
text-align: center;
}
:deep(.area-cascader-label) {
padding: 0 12px 0 0;
margin: 0;
width: 120px;
}
</style>