补充缺失文件
This commit is contained in:
@@ -1,2 +1,2 @@
|
|||||||
VITE_APP_NAME=后台管理(开发环境)
|
VITE_APP_NAME=后台管理(开发环境)
|
||||||
VITE_API_URL=http://127.0.0.1:9200/api
|
#VITE_API_URL=http://127.0.0.1:9200/api
|
||||||
|
|||||||
@@ -71,7 +71,8 @@
|
|||||||
style="margin-left: 10px; width: 137px"
|
style="margin-left: 10px; width: 137px"
|
||||||
@click="openMapPicker"
|
@click="openMapPicker"
|
||||||
>
|
>
|
||||||
<AimOutlined />选取
|
<AimOutlined/>
|
||||||
|
选取
|
||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -124,62 +125,62 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, watch } from 'vue';
|
import {ref, reactive, watch} from 'vue';
|
||||||
import { Form, message } from 'ant-design-vue';
|
import {Form, message} from 'ant-design-vue';
|
||||||
import { assignObject, uuid } from 'ele-admin-pro';
|
import {assignObject, uuid} from 'ele-admin-pro';
|
||||||
import { addHjmCar, updateHjmCar } from '@/api/hjm/hjmCar';
|
import {addHjmCar, updateHjmCar} from '@/api/hjm/hjmCar';
|
||||||
import { HjmCar } from '@/api/hjm/hjmCar/model';
|
import {HjmCar} from '@/api/hjm/hjmCar/model';
|
||||||
import { useThemeStore } from '@/store/modules/theme';
|
import {useThemeStore} from '@/store/modules/theme';
|
||||||
import { storeToRefs } from 'pinia';
|
import {storeToRefs} from 'pinia';
|
||||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
import {ItemType} from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
import { FormInstance } from 'ant-design-vue/es/form';
|
import {FormInstance} from 'ant-design-vue/es/form';
|
||||||
import { FileRecord } from '@/api/system/file/model';
|
import {FileRecord} from '@/api/system/file/model';
|
||||||
import { AimOutlined } from '@ant-design/icons-vue';
|
import {AimOutlined} from '@ant-design/icons-vue';
|
||||||
import { CenterPoint } from 'ele-admin-pro/es/ele-map-picker/types';
|
import {CenterPoint} from 'ele-admin-pro/es/ele-map-picker/types';
|
||||||
import OrgSelect from '@/views/system/user/components/org-select.vue';
|
import OrgSelect from '@/views/system/user/components/org-select.vue';
|
||||||
import { Organization } from '@/api/system/organization/model';
|
import {Organization} from '@/api/system/organization/model';
|
||||||
import { User } from '@/api/system/user/model';
|
import {User} from '@/api/system/user/model';
|
||||||
import { pageUsers } from '@/api/system/user';
|
import {pageUsers} from '@/api/system/user';
|
||||||
import { listOrganizations } from '@/api/system/organization';
|
import {listOrganizations} from '@/api/system/organization';
|
||||||
import { toTreeData } from 'ele-admin-pro/es';
|
import {toTreeData} from 'ele-admin-pro/es';
|
||||||
import { DictData } from '@/api/system/dict-data/model';
|
import {DictData} from '@/api/system/dict-data/model';
|
||||||
import { HjmFence } from '@/api/hjm/hjmFence/model';
|
import {HjmFence} from '@/api/hjm/hjmFence/model';
|
||||||
|
|
||||||
// 是否是修改
|
// 是否是修改
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
const useForm = Form.useForm;
|
const useForm = Form.useForm;
|
||||||
// 是否开启响应式布局
|
// 是否开启响应式布局
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
const { styleResponsive } = storeToRefs(themeStore);
|
const {styleResponsive} = storeToRefs(themeStore);
|
||||||
const { darkMode } = storeToRefs(themeStore);
|
const {darkMode} = storeToRefs(themeStore);
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
// 弹窗是否打开
|
// 弹窗是否打开
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
// 修改回显的数据
|
// 修改回显的数据
|
||||||
data?: HjmCar | null;
|
data?: HjmCar | null;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'done'): void;
|
(e: 'done'): void;
|
||||||
(e: 'update:visible', visible: boolean): void;
|
(e: 'update:visible', visible: boolean): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
// 提交状态
|
// 提交状态
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
// 是否显示最大化切换按钮
|
// 是否显示最大化切换按钮
|
||||||
const maxable = ref(true);
|
const maxable = ref(true);
|
||||||
// 表格选中数据
|
// 表格选中数据
|
||||||
const formRef = ref<FormInstance | null>(null);
|
const formRef = ref<FormInstance | null>(null);
|
||||||
const images = ref<ItemType[]>([]);
|
const images = ref<ItemType[]>([]);
|
||||||
// 是否显示地图选择弹窗
|
// 是否显示地图选择弹窗
|
||||||
const showMap = ref(false);
|
const showMap = ref(false);
|
||||||
const users = ref<User[]>([]);
|
const users = ref<User[]>([]);
|
||||||
const organizationId = ref<number>();
|
const organizationId = ref<number>();
|
||||||
const organizations = ref<Organization[]>([]);
|
const organizations = ref<Organization[]>([]);
|
||||||
|
|
||||||
// 用户信息
|
// 用户信息
|
||||||
const form = reactive<HjmCar>({
|
const form = reactive<HjmCar>({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
image: undefined,
|
image: undefined,
|
||||||
@@ -210,15 +211,15 @@
|
|||||||
tenantId: undefined,
|
tenantId: undefined,
|
||||||
createTime: undefined,
|
createTime: undefined,
|
||||||
sortNumber: 100
|
sortNumber: 100
|
||||||
});
|
});
|
||||||
|
|
||||||
/* 更新visible */
|
/* 更新visible */
|
||||||
const updateVisible = (value: boolean) => {
|
const updateVisible = (value: boolean) => {
|
||||||
emit('update:visible', value);
|
emit('update:visible', value);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 表单验证规则
|
// 表单验证规则
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
organizationId: [
|
organizationId: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@@ -267,24 +268,24 @@
|
|||||||
// trigger: 'blur'
|
// trigger: 'blur'
|
||||||
// }
|
// }
|
||||||
// ]
|
// ]
|
||||||
});
|
});
|
||||||
|
|
||||||
const chooseInsuranceStatus = (item: DictData) => {
|
const chooseInsuranceStatus = (item: DictData) => {
|
||||||
form.insuranceStatus = item.dictDataCode;
|
form.insuranceStatus = item.dictDataCode;
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateFence = (item: HjmFence) => {
|
const updateFence = (item: HjmFence) => {
|
||||||
form.fenceName = item.name;
|
form.fenceName = item.name;
|
||||||
form.fenceId = item.id;
|
form.fenceId = item.id;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 打开位置选择 */
|
/* 打开位置选择 */
|
||||||
const openMapPicker = () => {
|
const openMapPicker = () => {
|
||||||
showMap.value = true;
|
showMap.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 地图选择后回调 */
|
/* 地图选择后回调 */
|
||||||
const onDone = (location: CenterPoint) => {
|
const onDone = (location: CenterPoint) => {
|
||||||
if (location) {
|
if (location) {
|
||||||
console.log(location);
|
console.log(location);
|
||||||
form.location = `${location.lat},${location.lng}`;
|
form.location = `${location.lat},${location.lng}`;
|
||||||
@@ -294,9 +295,9 @@
|
|||||||
form.district = `${location.city?.district}`;
|
form.district = `${location.city?.district}`;
|
||||||
}
|
}
|
||||||
showMap.value = false;
|
showMap.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const onOrganization = (index: number) => {
|
const onOrganization = (index: number) => {
|
||||||
form.driver = undefined;
|
form.driver = undefined;
|
||||||
users.value = [];
|
users.value = [];
|
||||||
organizations.value?.map((item) => {
|
organizations.value?.map((item) => {
|
||||||
@@ -320,10 +321,10 @@
|
|||||||
form.kuaidi = item.organizationName;
|
form.kuaidi = item.organizationName;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const getUsers = () => {
|
const getUsers = () => {
|
||||||
pageUsers({ organizationId: organizationId.value }).then((res) => {
|
pageUsers({organizationId: organizationId.value}).then((res) => {
|
||||||
users.value =
|
users.value =
|
||||||
res?.list.map((d) => {
|
res?.list.map((d) => {
|
||||||
d.label = d.realName || d.nickname;
|
d.label = d.realName || d.nickname;
|
||||||
@@ -331,27 +332,31 @@
|
|||||||
return d;
|
return d;
|
||||||
}) || [];
|
}) || [];
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const chooseImage = (data: FileRecord) => {
|
const chooseImage = (data: FileRecord) => {
|
||||||
images.value.push({
|
images.value.push({
|
||||||
uid: data.id,
|
uid: data.id,
|
||||||
url: data.path,
|
url: data.path,
|
||||||
status: 'done'
|
status: 'done'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const onDeleteItem = (index: number) => {
|
const onDeleteItem = (index: number) => {
|
||||||
images.value.splice(index, 1);
|
images.value.splice(index, 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { resetFields } = useForm(form, rules);
|
const {resetFields} = useForm(form, rules);
|
||||||
|
|
||||||
/* 保存编辑 */
|
/* 保存编辑 */
|
||||||
const save = () => {
|
const save = () => {
|
||||||
if (!formRef.value) {
|
if (!formRef.value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (form.code == '' || !form.code) {
|
||||||
|
message.error('所属站点下的节点不能为空!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
formRef.value
|
formRef.value
|
||||||
.validate()
|
.validate()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -373,10 +378,11 @@
|
|||||||
message.error(e.message);
|
message.error(e.message);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {
|
||||||
};
|
});
|
||||||
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.visible,
|
() => props.visible,
|
||||||
(visible) => {
|
(visible) => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
@@ -424,6 +430,6 @@
|
|||||||
resetFields();
|
resetFields();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{immediate: true}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user