提交 0fabce76 作者: guolinhua

暂时禁用代码效验

上级 1dbbad7a
# API 接口地址
VITE_GLOB_API_URL=http://111.22.182.169:49600
# VITE_GLOB_API_URL=http://111.22.182.169:49600
VITE_GLOB_API_URL=http://36.133.16.81:42111
# API 接口地址前缀
VITE_GLOB_API_URL_PREFIX=/jeecgboot
VITE_GLOB_API_URL_PREFIX=/jeecg-boot
......@@ -5,4 +5,4 @@
[ -n "$CI" ] && exit 0
# Format and submit code according to lintstagedrc.js configuration
npm run lint:lint-staged
# npm run lint:lint-staged
......@@ -81,6 +81,7 @@
"@dcloudio/uni-quickapp-webview": "3.0.0-4060620250520001",
"@dcloudio/uni-ui": "^1.5.7",
"@faker-js/faker": "^9.8.0",
"@vant/area-data": "^2.1.0",
"@vue/runtime-core": "3.4.21",
"@vueuse/core": "^12.3.0",
"@vueuse/shared": "^12.3.0",
......
......@@ -53,6 +53,9 @@ importers:
'@faker-js/faker':
specifier: ^9.8.0
version: 9.8.0
'@vant/area-data':
specifier: ^2.1.0
version: 2.1.0
'@vue/runtime-core':
specifier: 3.4.21
version: 3.4.21
......@@ -2420,6 +2423,9 @@ packages:
peerDependencies:
vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0
'@vant/area-data@2.1.0':
resolution: {integrity: sha512-wx9PrUX7wSUJiFcz8UrcvZfTjV6sTc+7SHcbjGQQzEcv5y+EwOo5uV4ZKdfrR5Hzcw4MA08LQdvXPSEb4nWbug==}
'@vitalets/google-translate-api@9.2.1':
resolution: {integrity: sha512-zlwQWSjXUZhbZQ6qwtIQ7GdYXFQmJ4wYqzcrYJUxtvzQQwUP+uKUb/SRJaBOQuBntjBjzcdcJoLFrpCKUbIkOg==}
engines: {node: '>=14'}
......@@ -10137,6 +10143,8 @@ snapshots:
transitivePeerDependencies:
- rollup
'@vant/area-data@2.1.0': {}
'@vitalets/google-translate-api@9.2.1':
dependencies:
'@types/http-errors': 1.8.2
......
......@@ -2,6 +2,12 @@
import { onExit } from '@dcloudio/uni-app'
import { isDevMode } from '@/utils/env'
import { usePermissions } from '@/hooks/app/usePermissions'
import * as UserInfoAPI from '@/api/model/userInfo'
import { useDictStore } from '@/store/modules/dict'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const dictStore = useDictStore()
// import * as Push from '@/utils/push'
......@@ -29,6 +35,13 @@
}
// #endif
})
function getDictList() {
if (!userStore.getToken) return
if (Object.keys(dictStore.getDictList).length !== 0) return
UserInfoAPI.dictList().then((res) => {
dictStore.setDictList(res)
})
}
onExit(() => {
// 停用监听权限
......@@ -37,6 +50,7 @@
onShow(() => {
console.log('App Show')
getDictList()
})
onHide(() => {
......
// 上传请求
import { otherHttp } from '/@/utils/http/axios'
enum Api {
purchaseList = '/purchaseSell/bizPurchase/list', // 采购需求列表
supplyList = '/purchaseSell/bizSupply/list', // 供应需求列表
purchaseSellDetails = '/purchaseSell/bizPurchase/queryByld', // 产销详情
purchaseSell = '/purchaseSell/bizPurchase/add', // 发布采购需求
supplyAdd = '/purchaseSell/bizSupply/add', // 发布供应需求
bizPurchaseSupplyRecord = '/purchaseSell/bizPurchaseSupplyRecord/add', // 报价
}
/**
* @param params 请求参数
* @description: 采购需求列表
*/
export function purchaseList(params = {}) {
return otherHttp.get({
url: Api.purchaseList,
params,
})
}
/**
* @param params 请求参数
* @description: 供应需求列表
*/
export function supplyList(params = {}) {
return otherHttp.get({
url: Api.supplyList,
params,
})
}
/**
* @param params 请求参数
* @description: 采购需求详情
*/
export function purchaseSellDetails(params = {}) {
return otherHttp.get({
url: Api.purchaseSellDetails,
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
}
/**
* @param params 请求参数
* @description: 发布采购需求
*/
export function purchaseSellAdd(params = {}) {
return otherHttp.post({
url: Api.purchaseSell,
params,
})
}
/**
* @param params 请求参数
* @description: 发布采购需求
*/
export function supplyAdd(params = {}) {
return otherHttp.post({
url: Api.supplyAdd,
params,
})
}
/**
* @param params 请求参数
* @description: 报价
*/
export function bizPurchaseSupplyRecord(params = {}) {
return otherHttp.post({
url: Api.bizPurchaseSupplyRecord,
params,
})
}
......@@ -2,6 +2,7 @@ import { otherHttp } from '/@/utils/http/axios'
enum Api {
zoneList = '/online/cgform/api/getData/01fd687ecb164aea914e92047e144d66', // 金刚区菜单数据
warningInfo = '/tianditu/warningInfo', // 金刚区菜单数据
productMarketList = '/online/cgform/api/getData/5b71e11020d44366b2d130e200c7a640', // 热门产地行情
serviceStatsList = '/online/cgform/api/getData/491863dde351404da63a1a6e8c699c4c', // 服务展示窗
agricultureClassList = '/online/cgform/api/getData/311c300e05694ba69a063d04c8572e9e', // 农技课堂
......@@ -20,6 +21,20 @@ export function zoneList(params = {}) {
/**
* @param params 请求参数
* @description: 天气通知数据
*/
export function warningInfo(params = {}) {
return otherHttp.post({
url: Api.warningInfo,
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
}
/**
* @param params 请求参数
* @description: 热门产地行情数据
*/
export function productMarketList(params = {}) {
......
// 灵活用工
import { otherHttp } from '/@/utils/http/axios'
enum Api {
employmentList = '/employment/app/list', // 用工列表
employmentAdd = '/employment/app/add', // 发布用工
employmentDetails = '/employment/queryById', // 查看用工详情
}
/**
* @param params 请求参数
* @description: 用工列表
*/
export function employmentList(params = {}) {
return otherHttp.get({
url: Api.employmentList,
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
}
/**
* @param params 请求参数
* @description: 发布用工
*/
export function employmentAdd(params = {}) {
return otherHttp.post({
url: Api.employmentAdd,
params,
})
}
/**
* @param params 请求参数
* @description: 发布用工
*/
export function employmentDetails(params = {}) {
return otherHttp.get({
url: Api.employmentDetails,
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
}
......@@ -4,6 +4,8 @@ enum Api {
getUserInfo = '/sys/user/login/setting/getUserData', // 查询登录用户信息
logout = '/sys/logout', // 登出
sysLogin = '/sys/mLogin', // 登陆
dictList = '/sys/dict/queryAllDictItems', // 获取字典数据
location = '/tianditu/geocode', // 根据经纬度获取地址
}
/**
* @param params 请求参数
......@@ -37,3 +39,28 @@ export function logout(params = {}) {
params,
})
}
/**
* @param params 请求参数
* @description: 获取字典数据
*/
export function dictList(params = {}) {
return otherHttp.get({
url: Api.dictList,
params,
})
}
/**
* @param params 请求参数
* @description: 发布需求
*/
export function location(params = {}) {
return otherHttp.post({
url: Api.location,
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
}
......@@ -16,7 +16,6 @@
</view>
</view>
</template>
<script>
// #ifdef APP-NVUE
const animation = uni.requireNativePlugin('animation');
......
......@@ -45,6 +45,7 @@
"backgroundColorTop": "#e6f5e8",
"backgroundColorBottom": "#e6f5e8",
"enablePullDownRefresh": true,
"onReachBottomDistance": 50,
"app-plus": {
"titleNView": false,
"bounce": false
......@@ -52,6 +53,32 @@
}
},
{
"path": "pages/chanxiao/purchaseXuQiu",
"style": {
"navigationBarTitleText": "发布采购需求",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#5DB66F",
"navigationBarTextStyle": "white",
"backgroundColorBottom": "#F2F2F2",
"app-plus": {
"titleNView": {}
}
}
},
{
"path": "pages/chanxiao/supplyXuQiu",
"style": {
"navigationBarTitleText": "发布供应需求",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#5DB66F",
"navigationBarTextStyle": "white",
"backgroundColorBottom": "#F2F2F2",
"app-plus": {
"titleNView": {}
}
}
},
{
"path": "pages/nongzhi/nongzhi",
"style": {
"navigationBarTitleText": "",
......@@ -147,6 +174,20 @@
"navigationBarBackgroundColor": "#5DB66F",
"navigationBarTextStyle": "white",
"backgroundColorBottom": "#F2F2F2",
"onReachBottomDistance": 50,
"app-plus": {
"titleNView": {}
}
}
},
{
"path": "pages/linghuoyonggong/form",
"style": {
"navigationBarTitleText": "发布用工",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#5DB66F",
"navigationBarTextStyle": "white",
"backgroundColorBottom": "#F2F2F2",
"app-plus": {
"titleNView": {}
}
......
<script setup lang="ts">
import { reactive } from 'vue'
import * as ChanxiaoAPI from '@/api/model/chanxiao'
const pageData = reactive({
show: false,
content: '',
form: {
purchaseId: '',
supplyName: null,
supplyPrice: null,
phone: null,
remark: null,
},
rules: [
{
name: 'supplyPrice',
rule: ['required'],
msg: ['请输入姓名'],
},
{
name: 'supplyPrice',
rule: ['required'],
msg: ['请输入报价'],
},
{
name: 'phone',
rule: ['required', 'isMobile'],
msg: ['请输入手机号', '请输入正确的手机号'],
},
],
})
function open(params) {
pageData.form.purchaseId = params.id
pageData.show = true
}
function close() {
pageData.show = false
}
function reset() {
pageData.form = {
purchaseId: '',
supplyName: null,
supplyPrice: null,
phone: null,
remark: null,
}
}
const formRef = ref()
function submit() {
formRef.value.validator(pageData.form, pageData.rules, true).then((res) => {
if (res.isPassed) {
ChanxiaoAPI.bizPurchaseSupplyRecord(pageData.form).then((res) => {
reset()
close()
uni.showToast({
title: '报价成功',
icon: 'success',
})
})
}
})
}
defineExpose({
open,
close,
})
</script>
<template>
<fui-dialog title="" :buttons="[]" :show="pageData.show" maskClosable>
<view class="title flex justify-center">
<view class="flex-1">立即报价</view>
<fui-icon class="close flex-basis" name="close" size="46" color="#999999" @click="close"></fui-icon>
</view>
<view class="text-left">
<fui-form ref="formRef">
<fui-input
marginTop="30"
size="28"
placeholder="请填写联系人姓名"
v-model="pageData.form.supplyName"
></fui-input>
<fui-input
marginTop="30"
size="28"
placeholder="请填写联系电话"
v-model="pageData.form.phone"
></fui-input>
<fui-input marginTop="30" size="28" placeholder="请填写价格" v-model="pageData.form.supplyPrice">
<view class="flex">
<view class="mr-3" style="color: #ccc">|</view>
<view></view>
</view>
</fui-input>
<fui-textarea
:marginTop="30"
size="28"
height="80rpx"
placeholder="请输入报价备注"
v-model="pageData.form.remark"
></fui-textarea>
<view style="margin-top: 30rpx">
<fui-button text="确定" bold radius="96rpx" @click="submit"></fui-button>
</view>
</fui-form>
</view>
</fui-dialog>
</template>
<style lang="scss" scoped>
:deep(.fui-dialog__body) {
background: linear-gradient(0deg, rgba(93, 182, 111, 0) 0%, rgba(93, 182, 111, 0.25) 100%);
margin: 0;
}
:deep(.fui-dialog__footer) {
display: none;
}
:deep(.fui-input) {
margin-top: 40rpx;
}
</style>
......@@ -262,7 +262,7 @@
status: 1,
}).then((res) => {
const { records } = res
pageData.agricultureClass.videoList = records
pageData.agricultureClass.videoList = records.reverse()
pageData.agricultureClass.title = records[0]?.title
})
}
......@@ -335,6 +335,16 @@
function handleMetadataLoaded(e: any) {
pageData.agricultureClass.time = e.target.duration
}
// 解决轮播视频切换时,上一个视频不停止播放的问题
const handleVideoPlay = (currentIndex) => {
pageData.agricultureClass.videoList.forEach((_, index) => {
if (index != currentIndex) {
const videoContext = uni.createVideoContext(`video${index}`)
videoContext.pause()
}
})
}
</script>
<template>
......@@ -656,11 +666,13 @@
>
<swiper-item v-for="(video, index) in pageData.agricultureClass.videoList" :key="index">
<video
:id="'video' + index"
:src="video.media_video"
:poster="video.cover_image"
:controls="false"
style="width: 654rpx; height: 358rpx"
@loadedmetadata="handleMetadataLoaded"
@play="handleVideoPlay(index)"
></video>
</swiper-item>
</swiper>
......
......@@ -11,7 +11,26 @@
location: '112.982931,28.116698',
})
onLoad(() => {})
onLoad(() => {
uni.getLocation({
type: 'wgs84',
success: function (res) {
pageData.weather.lon = res.longitude
pageData.weather.lat = res.latitude
uni.setStorageSync('location', {
// 缓存地址
lon: res.longitude,
lat: res.latitude,
})
},
fail: function (error) {
uni.showToast({
title: '获取地址失败,将导致部分功能不可用',
icon: 'none',
})
},
})
})
onShow(() => {
uni.getLocation({
......@@ -39,6 +58,8 @@
// 查询金刚区数据
getServiceItems()
getMenuItems()
// 查询天气信息
getWarningInfo()
// 查询热门产地行情
getProductMarketList()
// 服务展示窗
......@@ -113,7 +134,9 @@
{ day: '周三', temp: '25-29°', icon: '101' },
{ day: '周四', temp: '26-31°', icon: '102' },
],
warning: '台风"尤特"12号 预计今晚登陆',
warning: '',
lon: null,
lat: null,
},
// 功能菜单
......@@ -187,7 +210,7 @@
// 农技课堂
agricultureClass: {
title: '专家实录—鸡饲养技术',
title: '',
// expert: '张教授',
time: '',
videoList: [],
......@@ -219,6 +242,16 @@
pageData.menuItems = records
})
}
function getWarningInfo() {
if (!pageData.weather.lon || !pageData.weather.lat) return
HomeAPI.warningInfo({
lon: pageData.weather.lon,
lat: pageData.weather.lat,
}).then((res) => {
pageData.weather.warning = res[0].criteria
})
}
function getProductMarketList() {
HomeAPI.productMarketList({
status: 1,
......@@ -285,6 +318,15 @@
function handleMetadataLoaded(e: any) {
pageData.agricultureClass.time = e.target.duration
}
// 解决轮播视频切换时,上一个视频不停止播放的问题
const handleVideoPlay = (currentIndex) => {
pageData.agricultureClass.videoList.forEach((_, index) => {
if (index != currentIndex) {
const videoContext = uni.createVideoContext(`video${index}`)
videoContext.pause()
}
})
}
</script>
<template>
......@@ -498,7 +540,7 @@
text_26: !product.isUp,
}"
>
{{ `${product.percent}%` }}
{{ `${product.isUp ? '' : '-'}${product.percent}%` }}
</text>
</view>
<view
......@@ -562,11 +604,13 @@
>
<swiper-item v-for="(video, index) in pageData.agricultureClass.videoList" :key="index">
<video
:id="'video' + index"
:src="video.media_video"
:poster="video.cover_image"
:controls="false"
style="width: 654rpx; height: 358rpx"
@loadedmetadata="handleMetadataLoaded"
@play="handleVideoPlay(index)"
></video>
</swiper-item>
</swiper>
......@@ -814,15 +858,19 @@
}
.text-wrapper_5 {
margin-right: 180rpx;
overflow: hidden;
width: 366rpx;
width: 90%;
height: 40rpx;
.text_12 {
margin-left: 2.3rpx;
margin-right: 13.7rpx;
color: #ff612c;
font-size: 28rpx;
line-height: 40rpx;
overflow: hidden;
text-overflow: ellipsis; /* 超出以 ...显示 */
display: -webkit-box;
-webkit-line-clamp: 1; /* // 显示1行 */
-webkit-box-orient: vertical;
color: #ff612c;
}
}
}
......
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="17" height="17.9998779296875" viewBox="0 0 17 17.9998779296875" fill="none"><path d="M4.76541 11.3167C4.44845 11.3167 4.19031 11.0729 4.19031 10.7736C4.19031 10.4739 4.44847 10.2296 4.76541 10.2296L11.8048 10.2296C12.1222 10.2296 12.3804 10.4739 12.3804 10.7736C12.3804 11.0729 12.1222 11.3167 11.8048 11.3167L4.76541 11.3167ZM4.6797 14.2541C4.36225 14.2541 4.10409 14.0103 4.10409 13.7106C4.10409 13.4113 4.36223 13.167 4.6797 13.167L11.7186 13.167C12.036 13.167 12.2942 13.4113 12.2942 13.7106C12.2942 14.0103 12.036 14.2541 11.7186 14.2541L4.6797 14.2541ZM1.55436 17.9999C0.56037 17.9999 0 17.4073 0 16.5137L0 1.9853C0 1.12685 0.464781 0.382572 1.5926 0.382572L11.5026 0.382572C11.7451 0.382572 11.9547 0.504928 12.0634 0.709841C12.1717 0.915007 12.1502 1.14701 12.0042 1.33016C11.8866 1.47867 11.699 1.56747 11.5026 1.56747L3.23704 1.56747C2.8706 1.56747 2.5796 1.56747 2.34253 1.56747L1.87079 1.56747C1.72238 1.56747 1.60334 1.56747 1.49752 1.56747L1.25404 1.56677L1.25404 16.8149L15.661 16.8149L15.6606 16.5855C15.6591 16.2427 15.6596 15.9873 15.6601 15.664L15.6601 15.6501C15.6601 15.454 15.6606 15.2301 15.6606 14.9428L15.6606 6.31558C15.6606 6.1308 15.7536 5.9541 15.9094 5.84284C16.0221 5.76327 16.1514 5.72161 16.2842 5.72161C16.5874 5.72161 16.9151 5.94851 16.9151 6.31537L16.9151 16.5859C16.9151 17.0323 16.8123 17.3737 16.6099 17.5998C16.3733 17.8648 15.9721 17.9999 15.4176 17.9999L1.55436 17.9999ZM14.261 0.889305L14.408 0.718613C14.53 0.576386 14.6966 0.381851 14.7989 0.275702C14.9728 0.0955167 15.2119 0 15.4901 0C15.6645 0 15.8139 0.0367844 15.9089 0.067793C16.2254 0.170457 16.6432 0.515576 16.8411 0.837034C17.0547 1.18468 17.0528 1.54202 16.8362 1.81772C16.6609 2.04252 16.5223 2.2095 16.4703 2.27058L16.3375 2.42855L14.261 0.889305ZM10.3391 8.26603C10.2225 8.26603 10.128 8.23158 10.0575 8.16355C9.96832 8.0773 9.92863 7.94685 9.93302 7.75348C9.94086 7.42343 10.129 6.38449 10.2005 6.1643C10.2544 5.99869 10.32 5.84905 10.465 5.65824C10.6742 5.38391 13.2685 2.13755 13.7863 1.48948L13.9186 1.32438L15.9922 2.86268L15.8663 3.02158C15.1334 3.94347 12.7336 6.96387 12.5984 7.12715C12.4793 7.27104 12.3196 7.4128 12.1717 7.50624C11.8626 7.70215 10.8706 8.1573 10.5439 8.23779C10.467 8.25678 10.3999 8.26603 10.3391 8.26603Z" fill="#FFFFFF" ></path></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M6 12C2.68889 12 0 9.31111 0 6C0 2.68889 2.68889 0 6 0C9.31111 0 12 2.68889 12 6C12 9.31111 9.31111 12 6 12ZM6 0.888889C3.17778 0.888889 0.888889 3.17778 0.888889 6C0.888889 8.82222 3.17778 11.1111 6 11.1111C8.82222 11.1111 11.1111 8.82222 11.1111 6C11.1111 3.17778 8.82222 0.888889 6 0.888889Z" fill="#999999" ></path><path d="M8.22226 6.53333L6.44449 6.53333L6.44449 5.64444L8.22226 5.64444C8.46671 5.64444 8.66671 5.44444 8.66671 5.19999C8.66671 4.95555 8.46671 4.75555 8.22226 4.75555L6.97782 4.75555L8.20004 3.53333C8.37782 3.35555 8.37782 3.08888 8.20004 2.9111C8.02226 2.73333 7.7556 2.73333 7.57782 2.9111L6.00004 4.48888L4.42226 2.9111C4.24449 2.73333 3.97782 2.73333 3.80004 2.9111C3.62226 3.08888 3.62226 3.35555 3.80004 3.53333L5.02226 4.75555L3.77782 4.75555C3.53337 4.75555 3.33337 4.95555 3.33337 5.19999C3.33337 5.44444 3.53337 5.64444 3.77782 5.64444L5.5556 5.64444L5.5556 6.53333L3.77782 6.53333C3.53337 6.53333 3.33337 6.73333 3.33337 6.97777C3.33337 7.22222 3.53337 7.42222 3.77782 7.42222L5.5556 7.42222L5.5556 9.19999C5.5556 9.44444 5.7556 9.64444 6.00004 9.64444C6.24449 9.64444 6.44449 9.44444 6.44449 9.19999L6.44449 7.42222L8.22226 7.42222C8.46671 7.42222 8.66671 7.22222 8.66671 6.97777C8.66671 6.73333 8.46671 6.53333 8.22226 6.53333Z" fill="#999999" ></path></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M7.88571 6.3C8.82857 5.7 9.42857 4.62857 9.42857 3.42857C9.42857 1.54286 7.88571 0 6 0C4.11429 0 2.57143 1.54286 2.57143 3.42857C2.57143 4.62857 3.17143 5.7 4.11429 6.3C1.71429 7.07143 0 9.34286 0 12L0.857143 12C0.857143 9.17143 3.17143 6.85714 6 6.85714C8.82857 6.85714 11.1429 9.17143 11.1429 12L12 12C12 9.34286 10.2857 7.07143 7.88571 6.3ZM6 6C4.58571 6 3.42857 4.84286 3.42857 3.42857C3.42857 2.01429 4.58571 0.857143 6 0.857143C7.41429 0.857143 8.57143 2.01429 8.57143 3.42857C8.57143 4.84286 7.41429 6 6 6Z" fill="#999999" ></path></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M6 11.0769C8.80384 11.0769 11.0769 8.80384 11.0769 6C11.0769 3.19615 8.80384 0.923077 6 0.923077C3.19615 0.923077 0.923076 3.19615 0.923076 6C0.923076 8.80384 3.19615 11.0769 6 11.0769ZM6 12C2.68615 12 0 9.31384 0 6C0 2.68615 2.68615 0 6 0C9.31384 0 12 2.68615 12 6C12 9.31384 9.31384 12 6 12Z" fill="#999999" ></path><path d="M6.00071 6.46146L8.76994 6.46146C8.7775 6.46146 8.78505 6.46165 8.79259 6.46203C8.80013 6.46239 8.80768 6.46295 8.81519 6.46369C8.8227 6.46442 8.83019 6.46534 8.83766 6.46645C8.84513 6.46756 8.85257 6.46886 8.85999 6.47033C8.86739 6.47181 8.87476 6.47346 8.88208 6.4753C8.88941 6.47713 8.89669 6.47915 8.90392 6.48134C8.91115 6.48353 8.91831 6.4859 8.92543 6.48845C8.93254 6.49099 8.93959 6.4937 8.94657 6.4966C8.95355 6.49948 8.96046 6.50254 8.96728 6.50577C8.9741 6.509 8.98085 6.51241 8.98752 6.51597C8.99417 6.51953 9.00074 6.52325 9.00722 6.52713C9.01369 6.53101 9.02008 6.53505 9.02636 6.53925C9.03263 6.54344 9.03881 6.54779 9.04488 6.55229C9.05095 6.55679 9.05691 6.56143 9.06275 6.56623C9.06859 6.57102 9.0743 6.57595 9.0799 6.58103C9.08549 6.58609 9.09096 6.5913 9.0963 6.59665C9.10165 6.60199 9.10685 6.60745 9.11192 6.61305C9.11699 6.61865 9.12193 6.62436 9.12671 6.6302C9.13152 6.63604 9.13616 6.642 9.14066 6.64807C9.14516 6.65413 9.1495 6.6603 9.1537 6.66659C9.1579 6.67286 9.16193 6.67925 9.16582 6.68573C9.16969 6.6922 9.17342 6.69877 9.17698 6.70543C9.18054 6.71209 9.18394 6.71884 9.18718 6.72567C9.19039 6.73249 9.19345 6.7394 9.19635 6.74638C9.19925 6.75336 9.20196 6.7604 9.2045 6.76751C9.20705 6.77462 9.20942 6.7818 9.21161 6.78903C9.2138 6.79625 9.21582 6.80354 9.21765 6.81086C9.21948 6.81819 9.22114 6.82556 9.22261 6.83296C9.22408 6.84037 9.22538 6.84781 9.22649 6.85529C9.2276 6.86276 9.22853 6.87024 9.22926 6.87776C9.23 6.88527 9.23056 6.89282 9.23092 6.90036C9.2313 6.9079 9.23148 6.91544 9.23148 6.923C9.23148 6.93056 9.2313 6.9381 9.23092 6.94565C9.23056 6.95319 9.23 6.96073 9.22926 6.96825C9.22853 6.97576 9.2276 6.98325 9.22649 6.99072C9.22538 6.99819 9.22408 7.00563 9.22261 7.01305C9.22114 7.02044 9.21948 7.02781 9.21765 7.03514C9.21582 7.04247 9.2138 7.04975 9.21161 7.05698C9.20942 7.0642 9.20705 7.07137 9.2045 7.07848C9.20196 7.08559 9.19925 7.09265 9.19635 7.09963C9.19345 7.10661 9.19039 7.11352 9.18718 7.12034C9.18394 7.12716 9.18054 7.13391 9.17698 7.14057C9.17342 7.14722 9.16969 7.1538 9.16582 7.16028C9.16193 7.16675 9.1579 7.17314 9.1537 7.17942C9.1495 7.18569 9.14515 7.19186 9.14066 7.19794C9.13616 7.20401 9.13152 7.20996 9.12671 7.21581C9.12193 7.22165 9.11699 7.22736 9.11192 7.23295C9.10685 7.23855 9.10165 7.24402 9.0963 7.24935C9.09096 7.2547 9.08549 7.25991 9.0799 7.26497C9.0743 7.27005 9.06857 7.27498 9.06273 7.27977C9.05689 7.28457 9.05095 7.28922 9.04488 7.29372C9.03881 7.29822 9.03263 7.30256 9.02636 7.30676C9.02008 7.31095 9.01369 7.31499 9.00722 7.31887C9.00074 7.32275 8.99417 7.32647 8.98752 7.33004C8.98085 7.3336 8.9741 7.337 8.96728 7.34023C8.96044 7.34345 8.95354 7.34651 8.94657 7.34941C8.93959 7.3523 8.93254 7.35502 8.92543 7.35755C8.91831 7.36011 8.91115 7.36247 8.90392 7.36467C8.89669 7.36686 8.88941 7.36888 8.88208 7.37071C8.87476 7.37254 8.86739 7.3742 8.85999 7.37567C8.85257 7.37714 8.84513 7.37844 8.83766 7.37955C8.83019 7.38066 8.8227 7.38158 8.81519 7.38232C8.80768 7.38306 8.80013 7.38362 8.79259 7.38398C8.78505 7.38435 8.7775 7.38454 8.76994 7.38454L5.53918 7.38454C5.53162 7.38454 5.52407 7.38435 5.51653 7.38398C5.50898 7.38362 5.50145 7.38306 5.49393 7.38232C5.48642 7.38158 5.47893 7.38066 5.47146 7.37955C5.46399 7.37844 5.45655 7.37714 5.44913 7.37567C5.44173 7.3742 5.43436 7.37254 5.42704 7.37071C5.41971 7.36888 5.41243 7.36686 5.4052 7.36467C5.39797 7.36247 5.39079 7.36011 5.38368 7.35755C5.37657 7.35502 5.36953 7.3523 5.36255 7.34941C5.35557 7.34651 5.34867 7.34345 5.34184 7.34023C5.33501 7.337 5.32827 7.3336 5.3216 7.33004C5.31494 7.32647 5.30837 7.32275 5.3019 7.31887C5.29542 7.31499 5.28904 7.31095 5.28276 7.30676C5.27648 7.30256 5.27031 7.29822 5.26424 7.29372C5.25817 7.28922 5.25222 7.28457 5.24637 7.27977C5.24054 7.27498 5.23482 7.27005 5.22922 7.26497C5.22363 7.25991 5.21816 7.2547 5.21282 7.24935C5.20748 7.24402 5.20227 7.23855 5.1972 7.23295C5.19213 7.22736 5.18719 7.22165 5.18241 7.21581C5.17761 7.20996 5.17296 7.20401 5.16846 7.19794C5.16396 7.19186 5.15961 7.18569 5.15542 7.17942C5.15122 7.17314 5.14718 7.16675 5.14331 7.16028C5.13942 7.1538 5.1357 7.14722 5.13214 7.14057C5.12857 7.13391 5.12517 7.12716 5.12194 7.12034C5.11871 7.11352 5.11566 7.10661 5.11277 7.09963C5.10988 7.09265 5.10716 7.08559 5.10462 7.07848C5.10207 7.07137 5.0997 7.0642 5.09751 7.05698C5.09532 7.04975 5.09331 7.04247 5.09147 7.03514C5.08963 7.02781 5.08798 7.02044 5.08651 7.01305C5.08504 7.00563 5.08374 6.99819 5.08263 6.99072C5.08152 6.98325 5.0806 6.97576 5.07986 6.96825C5.07912 6.96073 5.07856 6.95319 5.0782 6.94565C5.07782 6.9381 5.07764 6.93056 5.07764 6.923L5.07764 2.76916C5.07764 2.7616 5.07782 2.75405 5.0782 2.74651C5.07856 2.73896 5.07912 2.73143 5.07986 2.72391C5.0806 2.7164 5.08152 2.70891 5.08263 2.70144C5.08374 2.69397 5.08504 2.68653 5.08651 2.67911C5.08798 2.67171 5.08963 2.66434 5.09147 2.65702C5.09331 2.64969 5.09532 2.64241 5.09751 2.63518C5.0997 2.62795 5.10207 2.62078 5.10462 2.61366C5.10716 2.60655 5.10988 2.59951 5.11277 2.59253C5.11566 2.58555 5.11871 2.57865 5.12194 2.57182C5.12517 2.56499 5.12857 2.55825 5.13213 2.55158C5.13569 2.54492 5.13942 2.53835 5.14331 2.53188C5.14718 2.5254 5.15122 2.51902 5.15542 2.51274C5.15961 2.50646 5.16396 2.50029 5.16846 2.49422C5.17296 2.48816 5.17761 2.4822 5.18241 2.47635C5.18719 2.47052 5.19213 2.4648 5.1972 2.4592C5.20227 2.45361 5.20748 2.44814 5.21282 2.4428C5.21816 2.43746 5.22363 2.43225 5.22922 2.42718C5.23482 2.42211 5.24054 2.41718 5.24637 2.41239C5.25222 2.40759 5.25817 2.40294 5.26424 2.39844C5.27031 2.39394 5.27648 2.38959 5.28276 2.3854C5.28904 2.38121 5.29542 2.37717 5.3019 2.37329C5.30837 2.3694 5.31494 2.36568 5.3216 2.36212C5.32827 2.35855 5.33501 2.35516 5.34184 2.35192C5.34867 2.34869 5.35557 2.34564 5.36255 2.34275C5.36953 2.33986 5.37657 2.33714 5.38368 2.3346C5.39079 2.33205 5.39797 2.32968 5.4052 2.32749C5.41243 2.3253 5.41971 2.32329 5.42704 2.32145C5.43436 2.31961 5.44173 2.31796 5.44913 2.31649C5.45655 2.31502 5.46399 2.31372 5.47146 2.31261C5.47893 2.3115 5.48642 2.31058 5.49393 2.30984C5.50145 2.3091 5.50898 2.30855 5.51653 2.30818C5.52407 2.3078 5.53162 2.30762 5.53918 2.30762C5.54673 2.30762 5.55428 2.3078 5.56182 2.30818C5.56937 2.30855 5.5769 2.3091 5.58442 2.30984C5.59193 2.31058 5.59942 2.3115 5.60689 2.31261C5.61436 2.31372 5.62181 2.31502 5.62922 2.31649C5.63662 2.31796 5.64399 2.31961 5.65131 2.32145C5.65864 2.32329 5.66592 2.3253 5.67315 2.32749C5.68038 2.32968 5.68755 2.33205 5.69466 2.3346C5.70177 2.33714 5.70882 2.33986 5.7158 2.34275C5.72278 2.34564 5.72969 2.34869 5.73651 2.35192C5.74334 2.35516 5.75008 2.35855 5.75675 2.36212C5.7634 2.36568 5.76997 2.3694 5.77645 2.37329C5.78293 2.37717 5.78931 2.38121 5.79559 2.3854C5.80187 2.38959 5.80804 2.39394 5.81411 2.39844C5.82018 2.40294 5.82613 2.40759 5.83198 2.41239C5.83782 2.41718 5.84353 2.42211 5.84913 2.42718C5.85472 2.43225 5.86019 2.43746 5.86553 2.4428C5.87087 2.44814 5.87608 2.45361 5.88115 2.4592C5.88622 2.4648 5.89116 2.47052 5.89594 2.47635C5.90074 2.4822 5.90539 2.48816 5.90989 2.49422C5.91439 2.50029 5.91874 2.50646 5.92293 2.51274C5.92712 2.51902 5.93116 2.5254 5.93505 2.53188C5.93893 2.53835 5.94265 2.54492 5.94621 2.55158C5.94978 2.55825 5.95318 2.56499 5.95641 2.57182C5.95963 2.57865 5.96268 2.58555 5.96558 2.59253C5.96847 2.59951 5.97119 2.60655 5.97373 2.61366C5.97628 2.62078 5.97865 2.62795 5.98084 2.63518C5.98303 2.64241 5.98505 2.64969 5.98688 2.65702C5.98872 2.66434 5.99037 2.67171 5.99184 2.67911C5.99331 2.68653 5.99461 2.69397 5.99572 2.70144C5.99683 2.70891 5.99775 2.7164 5.99849 2.72391C5.99923 2.73143 5.99979 2.73896 6.00015 2.74651C6.00053 2.75405 6.00071 2.7616 6.00071 2.76916L6.00071 6.46146Z" fill="#999999" ></path></svg>
\ No newline at end of file
import { defineStore } from 'pinia'
import { store } from '/@/store'
interface dictItem {
color: string
jsonObject?: string
label: string
text: string
title: string
value: string | number
}
// 定义字典列表的类型
export interface DictListVO {
[key: string]: dictItem[]
}
export const useDictStore = defineStore({
id: 'dict',
state: () => ({
dictList: {} as DictListVO,
}),
getters: {
getDictList(): DictListVO {
return this.dictList
},
},
actions: {
setDictList(dictList: DictListVO): void {
this.dictList = dictList
},
/**
* 清空字典数据
*/
clearDict(): void {
this.dictList = {}
},
},
})
// Need to be used outside the setup
export function useAppStoreWithOut() {
return useDictStore(store)
}
......@@ -4,6 +4,7 @@ import { Storage } from '@/utils/storage'
import { TOKEN_KEY, USER_INFO_KEY } from '@/enums/cacheEnum'
import Navigate from '@/utils/page/navigate'
import * as API from '/@/api/model/userInfo'
import { useDictStore } from './dict'
export interface UserInfo {
id: string
......@@ -78,6 +79,11 @@ export const useUserStore = defineStore({
} finally {
this.setToken(null)
this.setUserInfo(null)
// 清空字典数据
const dictStore = useDictStore(store)
dictStore.clearDict()
await Navigate.to('/pages/login/login')
this.loading = false
}
......
import { areaList } from '@vant/area-data'
// 定义树形结构的类型
interface AreaNode {
text: string
value: string
children?: AreaNode[]
}
/**
* 将areaList转换为树形结构(省市县三级联动)
* @returns 树形结构的地区数据
*/
export const convertToTree = (): AreaNode[] => {
const { province_list, city_list, county_list } = areaList
const tree: AreaNode[] = []
// 遍历所有省份
Object.entries(province_list).forEach(([provinceCode, provinceName]) => {
const provinceNode: AreaNode = {
text: provinceName,
value: provinceCode,
children: [],
}
// 查找该省份下的所有城市
Object.entries(city_list).forEach(([cityCode, cityName]) => {
// 城市代码的前两位与省份代码的前两位相同表示属于该省份
if (cityCode.substring(0, 2) === provinceCode.substring(0, 2)) {
const cityNode: AreaNode = {
text: cityName,
value: cityCode,
children: [],
}
// 查找该城市下的所有区县
Object.entries(county_list).forEach(([countyCode, countyName]) => {
// 区县代码的前四位与城市代码的前四位相同表示属于该城市
if (countyCode.substring(0, 4) === cityCode.substring(0, 4)) {
cityNode.children!.push({
text: countyName,
value: countyCode,
})
}
})
provinceNode.children!.push(cityNode)
}
})
tree.push(provinceNode)
})
return tree
}
// 导出树形结构数据
export const areaTree = convertToTree()
/**
* 根据地区代码获取完整的地区名称(如:广东省广州市天河区)
* @param code 地区代码
* @returns 完整的地区名称
*/
export const getFullAreaName = (code: string): string => {
const { province_list, city_list, county_list } = areaList
let name = ''
if (county_list[code]) {
// 如果是区县代码,获取完整的省市县名称
const cityCode = code.substring(0, 4) + '00'
const provinceCode = code.substring(0, 2) + '0000'
name = `${province_list[provinceCode]}${city_list[cityCode]}${county_list[code]}`
} else if (city_list[code]) {
// 如果是城市代码,获取完整的省市名称
const provinceCode = code.substring(0, 2) + '0000'
name = `${province_list[provinceCode]}${city_list[code]}`
} else if (province_list[code]) {
// 如果是省份代码,直接返回省份名称
name = province_list[code]
}
return name
}
// 根据编号获取文本
export function getTextByCode(code) {
// 遍历省份
for (const provinceCode in areaList.province_list) {
if (provinceCode === code) {
return areaList.province_list[provinceCode]
}
// 遍历城市
for (const cityCode in areaList.city_list) {
if (cityCode === code) {
return areaList.city_list[cityCode]
}
// 遍历区县
for (const countyCode in areaList.county_list) {
if (countyCode === code) {
return areaList.county_list[countyCode]
}
}
}
}
return null
}
// 根据文本获取编号
export function getCodeByText(text) {
// 遍历省份
for (const provinceCode in areaList.province_list) {
if (areaList.province_list[provinceCode] === text) {
return provinceCode
}
}
// 遍历城市
for (const cityCode in areaList.city_list) {
if (areaList.city_list[cityCode] === text) {
return cityCode
}
}
// 遍历区县
for (const countyCode in areaList.county_list) {
if (areaList.county_list[countyCode] === text) {
return countyCode
}
}
return null
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论