Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mp-enterprise-people-recruitment-h5
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭佳妮(贵阳日报)
mp-enterprise-people-recruitment-h5
Commits
56dc57e2
Commit
56dc57e2
authored
Nov 05, 2024
by
李明环(东信)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
职位地理位置选择
parent
d69b2e18
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
12 deletions
+40
-12
common.js
src/api/common.js
+2
-0
step3.vue
src/pages/recommend/releasePostion/step3.vue
+36
-10
request.js
src/utils/request.js
+2
-2
No files found.
src/api/common.js
View file @
56dc57e2
...
...
@@ -5,6 +5,8 @@ export const getUploadToken = params => instance.post("/common/file/getUploadTok
export
const
getDictDataApi
=
params
=>
instance
.
post
(
"/common/dict/getDictData"
,
params
);
// 获取省市区树状数据
export
const
getTreeListApi
=
params
=>
instance
.
postForm
(
"/dict/dictProvinceCityDistrict/getTreeList"
,
params
);
// 懒加载省市区(province,city,district,street)
export
const
getAreaListApi
=
({
type
,
code
})
=>
instance
.
post
(
`dict/area/list/
${
type
}
/
${
code
}
`
);
// 获取岗位列表
export
const
dictJobTypeApi
=
params
=>
instance
.
post
(
"/dict/dictJobType/getTree"
,
params
);
// 获取岗位列表类型(1职位,2政策,3动态)
...
...
src/pages/recommend/releasePostion/step3.vue
View file @
56dc57e2
...
...
@@ -12,15 +12,16 @@
<wd-col-picker
v-model=
"cityValue"
:columns=
"cityOpstion"
style=
"width: 100%
;
"
style=
"width: 100%"
value-key=
"code"
label-key=
"name"
:column-change=
"columnChangeCity"
@
confirm=
"handleConfirmCity"
use-default-slot
>
<p
:class=
"
{ placeholder: !cityText }" class="text-single" style="width: 100%;">
{{
cityText
||
"请选择公司所在地"
}}
</p>
<p
:class=
"
{ placeholder: !cityText }" class="text-single" style="width: 100%">
{{
cityText
||
"请选择公司所在地"
}}
</p>
</wd-col-picker>
<view
class=
"arrow"
></view>
</view>
...
...
@@ -42,37 +43,62 @@
<
script
setup
>
import
{
ref
}
from
"vue"
;
import
AddressSelect
from
"@/components/form/address-select.vue"
;
import
{
getTreeListApi
}
from
"@/api/common"
;
import
{
getTreeListApi
,
getAreaListApi
}
from
"@/api/common"
;
import
{
useReleasePostionStore
}
from
"./store"
;
import
town
from
"@/assets/town.json"
;
/* tab */
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"
];
/* 获取省市区 */
const
cityOpstion
=
ref
([]);
const
cityValue
=
ref
([]);
const
cityText
=
ref
(
""
);
let
citySelectedItems
=
[];
getTreeListApi
({
provinceName
:
"贵州省"
}).
then
(
res
=>
{
getAreaListApi
({
type
:
"city"
,
code
:
"5201"
}).
then
(
res
=>
{
cityOpstion
.
value
.
push
(
res
.
data
);
});
const
columnChangeCity
=
({
selectedItem
,
resolve
,
index
,
finish
})
=>
{
console
.
log
(
selectedItem
.
code
);
console
.
log
(
index
);
const
type
=
keys
[
index
];
if
(
type
)
{
getAreaListApi
({
type
,
code
:
selectedItem
.
code
}).
then
(
res
=>
{
resolve
(
res
.
data
);
});
}
else
{
finish
();
}
};
/* getTreeListApi({ provinceName: "贵州省" }).then(res => {
cityOpstion.value.push(res.data[0].children);
});
const columnChangeCity = ({ selectedItem, resolve, finish }) => {
console.log(selectedItem);
if (selectedItem.children) {
console
.
log
(
selectedItem
.
children
);
resolve(selectedItem.children);
} else {
// 选择街道
// 加载街道
if (!town[selectedItem.code]) {
console.log("code:", selectedItem.code, "名字:", selectedItem.name);
}
if (selectedItem.children === null && town[selectedItem.code]) {
if (!town[selectedItem.code]) {
console.log("code:", selectedItem.code, "名字:", selectedItem.name);
}
resolve(town[selectedItem.code].map((v, i) => ({ ...v, code: i })));
} else {
finish();
}
}
};
};
*/
const
handleConfirmCity
=
({
selectedItems
})
=>
{
cityText
.
value
=
selectedItems
.
map
(
v
=>
v
.
name
||
""
).
join
(
"-"
);
citySelectedItems
=
selectedItems
;
...
...
src/utils/request.js
View file @
56dc57e2
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment