修改地址组件

parent 6dda009e
......@@ -50,9 +50,6 @@ import town from "@/assets/town.json";
const pinias = useReleasePostionStore();
const showTab = ref(true);
import { validateForm } from "@/utils/utils";
getAreaListApi({ type: "street", code: "520112" }).then(res => {
console.log(res);
});
// 地区接口地址
const keys = ["district", "street"];
/* 获取省市区 */
......@@ -62,7 +59,7 @@ const cityValue = ref([]);
const cityText = ref("");
let citySelectedItems = [];
getAreaListApi({ type: "city", code: "5201" }).then(res => {
getAreaListApi({ type: "city", code: "52" }).then(res => {
cityOpstion.value.push(res.data);
});
const columnChangeCity = ({ selectedItem, resolve, index, finish }) => {
......
......@@ -288,7 +288,7 @@ import { positionList, positionAddList, positionuUdateList, jobFair, jobFairRegi
import Selectbox from "@/components/form/selectbox.vue";
import FormItem from "@/components/form/form-item.vue";
import FormRow from "@/components/form/form-row.vue";
import { dictJobTypeApi, getTreeListApi } from "@/api/common";
import { dictJobTypeApi, getAreaListApi } from "@/api/common";
import { validateForm } from "@/utils/utils";
import town from "@/assets/town.json";
......@@ -443,9 +443,11 @@ initageColumns();
const getEnumWorkMode = async () => {
EnumWorkMode.value = await getEumData("EnumWorkMode");
};
getTreeListApi({ provinceName: "贵州省" }).then(res => {
cityOpstion.value.push(res.data[0].children);
getAreaListApi({ type: "city", code: "52" }).then(res => {
cityOpstion.value.push(res.data);
});
const keys = ["district", "street"];
getEnumWorkMode();
positionList({ status: 3 }).then(res => {
res.data = res.data.map(item => {
......@@ -486,16 +488,14 @@ const handleConfirm = (params, item) => {
// 职业类型
// 地址
const columnChangeCity = ({ selectedItem, resolve, finish }) => {
if (selectedItem.children) {
resolve(selectedItem.children);
const columnChangeCity = ({ selectedItem, resolve, index, finish }) => {
const type = keys[index];
if (type) {
getAreaListApi({ type, code: selectedItem.code }).then(res => {
resolve(res.data);
});
} else {
// 选择街道
if (selectedItem.children === null && town[selectedItem.code]) {
resolve(town[selectedItem.code].map((v, i) => ({ ...v, code: i })));
} else {
finish();
}
finish();
}
};
const handleConfirmCity = (params, item) => {
......@@ -509,7 +509,6 @@ const handleConfirmCity = (params, item) => {
item.cityCode = city.code;
item.districtCode = district.code;
item.street = street ? street.name : "";
console.log("item.cityName", item.cityName);
};
// 地址
......
import axios from "axios";
import { getToken, removeToken } from "@/utils/token";
// const baseURL = "https://lygsh-api.wjzpgz.com/";
const baseURL = "http://192.168.11.48:8080/";
const baseURL = "https://lygsh-api.wjzpgz.com/";
// const baseURL = "http://192.168.11.48:8080/";
// 创建一个 axios 实例
const instance = axios.create({
baseURL, // 设置基础 URL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment