浏览代码

reactor:地州市配置调整;

zhangchong 9 月之前
父节点
当前提交
43d9d1a45f

+ 1 - 7
.env.development

@@ -30,13 +30,7 @@ VITE_RECORD_DOWNLOAD_PREFIX=http://222.213.23.229:10085
 VITE_JTHS_API_URL=http://118.121.58.161:19021
 # 捷通华声AppKey
 VITE_JTHS_APPKEY=MTAwMDAx
-# 登录背景图
-VITE_LOGIN_BG=yibin/login_bg.png
-# 是否开启logo
-VITE_IS_SHOW_LOGO=true
-# 底部显示文字
-VITE_FOOTER_TEXT=蜀ICP备19035032号-36
 # 当前地州市
-VITE_CURRENT_CITY=yibin
+VITE_CURRENT_CITY=zigong
 # 兴唐呼叫中心ws地址
 VITE_XINGTANG_SOCKET_URL=ws://123.56.10.71:7681

+ 0 - 6
.env.production

@@ -30,12 +30,6 @@ VITE_RECORD_DOWNLOAD_PREFIX=http://222.213.23.229:10085
 VITE_JTHS_API_URL=http://118.121.58.161:19021
 # 捷通华声AppKey
 VITE_JTHS_APPKEY=MTAwMDAx
-# 登录背景图
-VITE_LOGIN_BG=yibin/login_bg.png
-# 是否开启logo
-VITE_IS_SHOW_LOGO=true
-# 底部显示文字
-VITE_FOOTER_TEXT=蜀ICP备19035032号-36
 # 当前地州市
 VITE_CURRENT_CITY=yibin
 # 兴唐呼叫中心ws地址

+ 1 - 7
.env.st

@@ -30,13 +30,7 @@ VITE_RECORD_DOWNLOAD_PREFIX=http://222.213.23.229:10085
 VITE_JTHS_API_URL=http://118.121.58.161:19021
 # 捷通华声AppKey
 VITE_JTHS_APPKEY=MTAwMDAx
-# 登录背景图
-VITE_LOGIN_BG=yibin/login_bg.png
-# 是否开启logo
-VITE_IS_SHOW_LOGO=true
-# 底部显示文字
-VITE_FOOTER_TEXT=蜀ICP备19035032号-36
 # 当前地州市
-VITE_CURRENT_CITY=yibin
+VITE_CURRENT_CITY=zigong
 # 兴唐呼叫中心ws地址
 VITE_XINGTANG_SOCKET_URL=ws://123.56.10.71:7681

+ 0 - 6
.env.yibin

@@ -30,12 +30,6 @@ VITE_RECORD_DOWNLOAD_PREFIX=http://192.168.2.212:29003
 VITE_JTHS_API_URL=http://218.6.151.146:50110
 # 捷通华声AppKey
 VITE_JTHS_APPKEY=MTAwMDAx
-# 登录背景图
-VITE_LOGIN_BG=yibin/login_bg.png
-# 是否开启logo
-VITE_IS_SHOW_LOGO=true
-# 底部显示文字
-VITE_FOOTER_TEXT=蜀ICP备19035032号-36
 # 当前地州市
 VITE_CURRENT_CITY=yibin
 # 兴唐呼叫中心ws地址

+ 7 - 8
src/App.vue

@@ -1,9 +1,9 @@
 <template>
 	<el-config-provider :size="getGlobalComponentSize" :locale="zhCn" :message="messageConfig" :button="buttonConfig">
-			<router-view v-show="setLockScreen" />
-			<LockScreen v-if="themeConfig.isLockScreen" />
-			<SetTings ref="setTingsRef" v-show="setLockScreen" />
-			<CloseFull v-if="!themeConfig.isLockScreen" />
+		<router-view v-show="setLockScreen" />
+		<LockScreen v-if="themeConfig.isLockScreen" />
+		<SetTings ref="setTingsRef" v-show="setLockScreen" />
+		<CloseFull v-if="!themeConfig.isLockScreen" />
 	</el-config-provider>
 </template>
 
@@ -23,6 +23,7 @@ import { loginPageInfo } from '@/api/login';
 import { getImageUrl } from '@/utils/tools';
 import { useKeepALiveNames } from '@/stores/keepAliveNames';
 import { useFavicon } from '@vueuse/core';
+import { getCurrentCityConfig } from '@/utils/appConfig';
 // 引入组件
 const LockScreen = defineAsyncComponent(() => import('@/layout/lockScreen/index.vue'));
 const SetTings = defineAsyncComponent(() => import('@/layout/navBars/breadcrumb/setings.vue'));
@@ -37,10 +38,8 @@ const storesTagsViewRoutes = useTagsViewRoutes();
 const { tagsViewRoutes } = storeToRefs(storesTagsViewRoutes);
 // 动态修改icon
 const icon = useFavicon();
-const currentCity = computed(() => {
-	return import.meta.env.VITE_CURRENT_CITY;
-});
-icon.value = getImageUrl(`${currentCity.value}/favicon.ico`); // 更改当前左上角角标
+const { favicon } = getCurrentCityConfig();
+icon.value = getImageUrl(favicon); // 更改当前左上角角标
 
 // 设置锁屏时组件显示隐藏
 const setLockScreen = computed(() => {

+ 7 - 8
src/layout/component/aside.vue

@@ -1,28 +1,30 @@
 <template>
 	<div class="h100" v-show="!isTagsViewCurrenFull">
 		<el-aside class="layout-aside" :class="setCollapseStyle">
-			<Logo v-if="setShowLogo" />
-			<el-scrollbar class="flex-auto" ref="layoutAsideScrollbarRef" @mouseenter="onAsideEnterLeave(true)"
-				@mouseleave="onAsideEnterLeave(false)">
+			<Logo v-if="isShowLogo" />
+			<el-scrollbar class="flex-auto" ref="layoutAsideScrollbarRef" @mouseenter="onAsideEnterLeave(true)" @mouseleave="onAsideEnterLeave(false)">
 				<Vertical :menuList="state.menuList" />
 			</el-scrollbar>
-<!--      <LayoutFooter />-->
+			<!--      <LayoutFooter />-->
 		</el-aside>
 	</div>
 </template>
 
 <script lang="ts" name="layoutAside" setup>
-import {  reactive, computed, watch, onBeforeMount, ref, defineAsyncComponent } from 'vue';
+import { reactive, computed, watch, onBeforeMount, ref, defineAsyncComponent } from 'vue';
 import { storeToRefs } from 'pinia';
 import pinia from '@/stores/index';
 import { useRoutesList } from '@/stores/routesList';
 import { useThemeConfig } from '@/stores/themeConfig';
 import { useTagsViewRoutes } from '@/stores/tagsViewRoutes';
 import mittBus from '@/utils/mitt';
+import { getCurrentCityConfig } from '@/utils/appConfig';
 // 引入组件
 const Logo = defineAsyncComponent(() => import('@/layout/logo/index.vue'));
 const Vertical = defineAsyncComponent(() => import('@/layout/navMenu/vertical.vue'));
 const LayoutFooter = defineAsyncComponent(() => import('@/layout/footer/footer.vue'));
+// const { isShowLogo } = getCurrentCityConfig();
+const isShowLogo = ref(false);
 // 定义变量内容
 const stores = useRoutesList();
 const storesThemeConfig = useThemeConfig();
@@ -82,9 +84,6 @@ const closeLayoutAsideMobileMode = () => {
 	let { layout, isShowLogo } = themeConfig.value;
 	return (isShowLogo && layout === 'defaults') || (isShowLogo && layout === 'columns');
 });*/
-const setShowLogo = computed(() => {
-  return import.meta.env.VITE_IS_SHOW_LOGO === 'true'
-});
 // 设置/过滤路由(非静态路由/是否显示在菜单中)
 const setFilterRoutes = () => {
 	if (themeConfig.value.layout === 'columns') return false;

+ 17 - 20
src/layout/footer/index.vue

@@ -1,31 +1,28 @@
 <template>
-  <div class="layout-footer">
-    <div class="layout-footer-warp">
-      <el-link href="https://beian.miit.gov.cn/" target="_blank">备案号:{{footerText}}</el-link>
-    </div>
-  </div>
+	<div class="layout-footer">
+		<div class="layout-footer-warp">
+			<el-link href="https://beian.miit.gov.cn/" target="_blank">备案号:{{ recordNumber }}</el-link>
+		</div>
+	</div>
 </template>
 
 <script setup lang="ts" name="layoutFooter">
 // 此处需有内容(注释也得),否则缓存将失败
-import {computed} from "vue";
-
-const footerText = computed(() => {
-  return import.meta.env.VITE_FOOTER_TEXT;
-})
+import { getCurrentCityConfig } from '@/utils/appConfig';
+const { recordNumber } = getCurrentCityConfig();
 </script>
 
 <style scoped lang="scss">
 .layout-footer {
-  width: 100%;
-  display: flex;
-  &-warp {
-    margin: auto;
-    text-align: center;
-    animation: error-num 0.3s ease;
-    :deep(.el-link) {
-      //color: var(--el-text-color-secondary);
-    }
-  }
+	width: 100%;
+	display: flex;
+	&-warp {
+		margin: auto;
+		text-align: center;
+		animation: error-num 0.3s ease;
+		:deep(.el-link) {
+			//color: var(--el-text-color-secondary);
+		}
+	}
 }
 </style>

+ 3 - 3
src/stores/themeConfig.ts

@@ -7,8 +7,8 @@
  * 1、需要每次都清理 `window.localStorage` 浏览器永久缓存
  * 2、或者点击布局配置最底部 `一键恢复默认` 按钮即可看到效果
  */
-import {defineStore} from 'pinia';
-import {getImageUrl} from '@/utils/tools';
+import { defineStore } from 'pinia';
+import { getImageUrl } from '@/utils/tools';
 
 export const useThemeConfig = defineStore('themeConfig', {
 	state: (): ThemeConfigStates => ({
@@ -97,7 +97,7 @@ export const useThemeConfig = defineStore('themeConfig', {
 			// 是否开启水印
 			isWatermark: false,
 			// 水印文案
-			watermarkText:[],
+			watermarkText: [],
 
 			/**
 			 * 其它设置

+ 49 - 0
src/utils/appConfig.ts

@@ -0,0 +1,49 @@
+/**
+ * @description 获取当前市州配置
+ * @return
+ *     cityName: 'name', // 中文名称
+ *     cityCode: 'code', // 6位区号
+ *     cityAbbr: 'abbr', // 简写
+ *     recordNumber: 'recordNumber', // 备案号
+ *     locationCenter: [lat,lng], // 地图中心点
+ *     loginBg: 'loginBg', // 登录背景
+ *     isShowLogo: true, // 是否显示左上角logo
+ */
+export const getCurrentCityConfig = () => {
+    switch (import.meta.env.VITE_CURRENT_CITY) {
+        case 'yibin':
+            return {
+                cityName: '宜宾市', // 中文名称
+                cityCode: '511500', // 6位区号
+                cityAbbr: '宜宾', // 简写
+                recordNumber: '蜀ICP备19035032号-36', // 备案号
+                locationCenter: [104.643, 28.751694], // 地图中心点
+                loginBg: 'yibin/login_bg.png', // 登录背景
+                isShowLogo: true, // 是否显示左上角logo
+                favicon: 'yibin/favicon.ico',
+            };
+        case 'zigong':
+            return {
+                cityName: '自贡市',
+                cityCode: '510300',
+                cityAbbr: 'zg',
+                recordNumber: '蜀ICP备2024053169号-1',
+                locationCenter: [104.778001, 29.339399],
+                // loginBg: 'zigong/login_bg.png',
+                loginBg: 'login/login_bg.png',
+                isShowLogo: false,
+                favicon: 'zigong/favicon.ico',
+            };
+        default:
+            return {
+                cityName: '宜宾市', // 中文名称
+                cityCode: '511500', // 6位区号
+                cityAbbr: '宜宾', // 简写
+                recordNumber: '蜀ICP备19035032号-36', // 备案号
+                locationCenter: [104.643, 28.751694], // 地图中心点
+                loginBg: 'yibin/login_bg.png', // 登录背景
+                isShowLogo: true, // 是否显示左上角logo
+                favicon: 'yibin/favicon.ico',
+            };
+    }
+};

+ 0 - 44
src/utils/constants.ts

@@ -198,47 +198,3 @@ export const defaultDateOne = [
 // 默认的起始与结束时刻 (Start date time 00:00:00, end date time 23:59:59)
 // @ts-ignore
 export const defaultTimeStartEnd: [Date, Date] = [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]; // '00:00:00', '23:59:59'
-// 获取当前市州中文
-export const getCurrentCityName = () => {
-	switch (import.meta.env.VITE_CURRENT_CITY) {
-		case 'yibin':
-			return '宜宾市';
-		case 'zigong':
-			return '自贡市';
-		default:
-			return '宜宾市';
-	}
-}
-// 获取当前市州地区编码
-export const getCurrentCityCode = () => {
-	switch (import.meta.env.VITE_CURRENT_CITY) {
-		case 'yibin':
-			return '511500';
-		case 'zigong':
-			return '510300';
-		default:
-			return '511500';
-	}
-}
-// 获取当前市州地区缩写
-export const getCurrentCityAbbr = () => {
-	switch (import.meta.env.VITE_CURRENT_CITY) {
-		case 'yibin':
-			return '宜宾';
-		case 'zigong':
-			return '自贡';
-		default:
-			return '宜宾';
-	}
-}
-// 获取当前市州地区中心经纬度
-export const getCurrentCityCenter = () => {
-	switch (import.meta.env.VITE_CURRENT_CITY) {
-		case 'yibin':
-			return [104.643000,28.751694];
-		case 'zigong':
-			return [104.778001,29.339399];
-		default:
-			return [104.643000,28.751694];
-	}
-}

+ 3 - 6
src/views/login/component/footer.vue

@@ -1,18 +1,15 @@
 <template>
 	<div class="layout-footer">
 		<div class="layout-footer-warp">
-			<el-link href="https://beian.miit.gov.cn/" target="_blank" style="color: #333" :underline="false">备案号:{{ footerText }}</el-link>
+			<el-link href="https://beian.miit.gov.cn/" target="_blank" style="color: #333" :underline="false">备案号:{{ recordNumber }}</el-link>
 		</div>
 	</div>
 </template>
 
 <script setup lang="ts" name="layoutFooter">
 // 此处需有内容(注释也得),否则缓存将失败
-import { computed } from 'vue';
-
-const footerText = computed(() => {
-	return import.meta.env.VITE_FOOTER_TEXT;
-});
+import { getCurrentCityConfig } from '@/utils/appConfig';
+const { recordNumber } = getCurrentCityConfig();
 </script>
 
 <style scoped lang="scss">

+ 5 - 4
src/views/login/index.vue

@@ -24,7 +24,7 @@
 				</div>-->
 			</div>
 		</div>
-    <LayoutFooter v-if="isFooter" />
+		<LayoutFooter v-if="isFooter" />
 	</div>
 </template>
 
@@ -35,6 +35,7 @@ import { useThemeConfig } from '@/stores/themeConfig';
 import { NextLoading } from '@/utils/loading';
 import { getImageUrl } from '@/utils/tools';
 import Motion from '@/utils/motion';
+import { getCurrentCityConfig } from '@/utils/appConfig';
 // 定义接口来定义对象的类型
 interface LoginState {
 	tabsActiveName: string;
@@ -53,14 +54,14 @@ const state = reactive<LoginState>({
 	tabsActiveName: 'account', // 默认显示账号密码登录
 	isScan: false, // 是否显示扫码登录
 });
-
+const { loginBg } = getCurrentCityConfig();
 // 设置 footer 显示/隐藏
 const isFooter = computed(() => {
-  return themeConfig.value.isFooter;
+	return themeConfig.value.isFooter;
 });
 
 // let bgImg = themeConfig.value.loginImage ?? `url(${getImageUrl('login/login_bg.png')})`;
-const bgImg = `url(${getImageUrl(import.meta.env.VITE_LOGIN_BG)}`
+const bgImg = `url(${getImageUrl(loginBg)}`;
 // 获取布局配置信息
 const getThemeConfig = computed(() => {
 	return themeConfig.value;

+ 4 - 3
src/views/todo/seats/accept/Map-select.vue

@@ -22,7 +22,7 @@ import AMapLoader from '@amap/amap-jsapi-loader';
 import { computed, onMounted, ref, shallowRef, watch } from 'vue';
 import { storeToRefs } from 'pinia';
 import { useThemeConfig } from '@/stores/themeConfig';
-import { getCurrentCityAbbr, getCurrentCityCenter } from '@/utils/constants';
+import { getCurrentCityConfig } from '@/utils/appConfig';
 
 const storesThemeConfig = useThemeConfig();
 const { themeConfig } = storeToRefs(storesThemeConfig);
@@ -61,6 +61,7 @@ watch(location, (val) => {
 });
 const keyword = ref('');
 let placeSearch, AMapObj, marker, geocoder;
+const { cityAbbr, locationCenter } = getCurrentCityConfig();
 const initMap = () => {
 	AMapLoader.load({
 		key: import.meta.env.VITE_AMAP_KEY, // 申请好的Web端Key,首次调用 load 时必填
@@ -68,7 +69,7 @@ const initMap = () => {
 	}).then((AMap) => {
 		AMapObj = AMap;
 		map.value = new AMap.Map('map-container', {
-			center: getCurrentCityCenter(),
+			center: locationCenter,
 		});
 		// 添加点击事件
 		map.value.on('click', onMapClick);
@@ -90,7 +91,7 @@ const initMap = () => {
 				zoomToAccuracy: true, //定位成功后是否自动调整地图视野到定位点
 			});
 			geocoder = new AMap.Geocoder({
-				city: getCurrentCityAbbr(),
+				city: cityAbbr,
 			});
 			map.value.addControl(geolocation);
 			map.value.addControl(toolbar);

+ 5 - 3
src/views/todo/seats/accept/index.vue

@@ -576,7 +576,8 @@ import { useRoute, useRouter } from 'vue-router';
 import { useTelStatus } from '@/stores/telStatus';
 import { useAppConfig } from '@/stores/appConfig';
 import { throttle, transformFile } from '@/utils/tools';
-import {commonEnum, getCityCode, getCityName, getCurrentCityCode, getCurrentCityName} from '@/utils/constants';
+import { commonEnum } from '@/utils/constants';
+import { getCurrentCityConfig } from '@/utils/appConfig';
 import { orderAdd, orderBaseDataAdd, orderBaseExt, orderDetail, orderEdit } from '@/api/business/order';
 import { useUserInfo } from '@/stores/userInfo';
 import { treeArea } from '@/api/auxiliary/area';
@@ -603,6 +604,7 @@ const RealTimeQuality = defineAsyncComponent(() => import('@/views/todo/seats/ac
 const ScriptNavigation = defineAsyncComponent(() => import('@/views/todo/seats/accept/Script-navigation.vue')); // 话术导航
 const CallSummary = defineAsyncComponent(() => import('@/views/todo/seats/accept/Call-summary.vue')); // 呼叫小结
 // 定义变量内容
+const { cityName, cityCode } = getCurrentCityConfig();
 const state = reactive<any>({
 	createBy: 'manual', // 工单创建方式 默认手动创建  tel:来电弹单  letter:互联网来信 默认表示手动创建
 	ruleForm: {
@@ -634,8 +636,8 @@ const state = reactive<any>({
 		eventCategoryId: '', // 事件分类
 		incidentTime: null, // 事发时间
 		incidentPurpose: null, // 事件目的
-		areaCode: getCurrentCityCode(), // 区域编码
-		city: getCurrentCityName(), // 市
+		areaCode: cityCode, // 区域编码
+		city: cityName, // 市
 		street: null, // 街道
 		isRepeat: 'false', // 是否重复工单 默认否
 		pushType: null, // 推送类型