修改地址组件

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