diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/src/assets/images/login-image/smallBg.png b/src/assets/images/login-image/smallBg.png new file mode 100644 index 0000000..cfc2658 --- /dev/null +++ b/src/assets/images/login-image/smallBg.png Binary files differ diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/src/assets/images/login-image/smallBg.png b/src/assets/images/login-image/smallBg.png new file mode 100644 index 0000000..cfc2658 --- /dev/null +++ b/src/assets/images/login-image/smallBg.png Binary files differ diff --git a/src/assets/images/login-image/whiteBg.png b/src/assets/images/login-image/whiteBg.png new file mode 100644 index 0000000..0c244b8 --- /dev/null +++ b/src/assets/images/login-image/whiteBg.png Binary files differ diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/src/assets/images/login-image/smallBg.png b/src/assets/images/login-image/smallBg.png new file mode 100644 index 0000000..cfc2658 --- /dev/null +++ b/src/assets/images/login-image/smallBg.png Binary files differ diff --git a/src/assets/images/login-image/whiteBg.png b/src/assets/images/login-image/whiteBg.png new file mode 100644 index 0000000..0c244b8 --- /dev/null +++ b/src/assets/images/login-image/whiteBg.png Binary files differ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index a7824b6..c8923ec 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -6,7 +6,6 @@ import { getDeptTreeList } from '@/api/system/dept' import { judgeTree, toTreeList } from '@/utils/structure' import indexDB from '@/utils/indexDB' -import { indexDBHandler } from '@/utils/sessionData' const props = defineProps({ // 数据绑定 modelValue: { @@ -71,7 +70,6 @@ const fetch = () => { getDeptTreeList().then((res) => { const list = res.data.filter((item: any) => item.id !== '0') - indexDBHandler('all-dept-list', JSON.stringify(res.data)) dictStore.setAllDeptList(list) refreshList(list) console.log(list, 'list') @@ -80,17 +78,7 @@ // 如果未指定需要展示的部门类型,获取全部部门 if (!props.deptType) { // if (dictStore.allDeptList.length === 0) { // 如果store中未存储,从服务器上获取 - indexDB.getAll().then(allData => { - if (allData.filter((item: any) => item.name === 'all-dept-list').length) { - const list = JSON.parse(allData.filter((item: any) => item.name === 'all-dept-list')[0].data).filter((item: any) => item.id !== '0') - refreshList(list) - } - else { - fetch() - } - }).catch(() => { - fetch() - }) + fetch() // } // else { // refreshList(dictStore.allDeptList) diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/src/assets/images/login-image/smallBg.png b/src/assets/images/login-image/smallBg.png new file mode 100644 index 0000000..cfc2658 --- /dev/null +++ b/src/assets/images/login-image/smallBg.png Binary files differ diff --git a/src/assets/images/login-image/whiteBg.png b/src/assets/images/login-image/whiteBg.png new file mode 100644 index 0000000..0c244b8 --- /dev/null +++ b/src/assets/images/login-image/whiteBg.png Binary files differ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index a7824b6..c8923ec 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -6,7 +6,6 @@ import { getDeptTreeList } from '@/api/system/dept' import { judgeTree, toTreeList } from '@/utils/structure' import indexDB from '@/utils/indexDB' -import { indexDBHandler } from '@/utils/sessionData' const props = defineProps({ // 数据绑定 modelValue: { @@ -71,7 +70,6 @@ const fetch = () => { getDeptTreeList().then((res) => { const list = res.data.filter((item: any) => item.id !== '0') - indexDBHandler('all-dept-list', JSON.stringify(res.data)) dictStore.setAllDeptList(list) refreshList(list) console.log(list, 'list') @@ -80,17 +78,7 @@ // 如果未指定需要展示的部门类型,获取全部部门 if (!props.deptType) { // if (dictStore.allDeptList.length === 0) { // 如果store中未存储,从服务器上获取 - indexDB.getAll().then(allData => { - if (allData.filter((item: any) => item.name === 'all-dept-list').length) { - const list = JSON.parse(allData.filter((item: any) => item.name === 'all-dept-list')[0].data).filter((item: any) => item.id !== '0') - refreshList(list) - } - else { - fetch() - } - }).catch(() => { - fetch() - }) + fetch() // } // else { // refreshList(dictStore.allDeptList) diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index ab01ebc..e378ecf 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -37,7 +37,7 @@ // 关闭声音 const { proxy } = getCurrentInstance() as any const closeSound = () => { - proxy.pauseAudio() + // proxy.pauseAudio() localStorage.setItem('eventAudio', 'pause') } // 查看 diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/src/assets/images/login-image/smallBg.png b/src/assets/images/login-image/smallBg.png new file mode 100644 index 0000000..cfc2658 --- /dev/null +++ b/src/assets/images/login-image/smallBg.png Binary files differ diff --git a/src/assets/images/login-image/whiteBg.png b/src/assets/images/login-image/whiteBg.png new file mode 100644 index 0000000..0c244b8 --- /dev/null +++ b/src/assets/images/login-image/whiteBg.png Binary files differ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index a7824b6..c8923ec 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -6,7 +6,6 @@ import { getDeptTreeList } from '@/api/system/dept' import { judgeTree, toTreeList } from '@/utils/structure' import indexDB from '@/utils/indexDB' -import { indexDBHandler } from '@/utils/sessionData' const props = defineProps({ // 数据绑定 modelValue: { @@ -71,7 +70,6 @@ const fetch = () => { getDeptTreeList().then((res) => { const list = res.data.filter((item: any) => item.id !== '0') - indexDBHandler('all-dept-list', JSON.stringify(res.data)) dictStore.setAllDeptList(list) refreshList(list) console.log(list, 'list') @@ -80,17 +78,7 @@ // 如果未指定需要展示的部门类型,获取全部部门 if (!props.deptType) { // if (dictStore.allDeptList.length === 0) { // 如果store中未存储,从服务器上获取 - indexDB.getAll().then(allData => { - if (allData.filter((item: any) => item.name === 'all-dept-list').length) { - const list = JSON.parse(allData.filter((item: any) => item.name === 'all-dept-list')[0].data).filter((item: any) => item.id !== '0') - refreshList(list) - } - else { - fetch() - } - }).catch(() => { - fetch() - }) + fetch() // } // else { // refreshList(dictStore.allDeptList) diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index ab01ebc..e378ecf 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -37,7 +37,7 @@ // 关闭声音 const { proxy } = getCurrentInstance() as any const closeSound = () => { - proxy.pauseAudio() + // proxy.pauseAudio() localStorage.setItem('eventAudio', 'pause') } // 查看 diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 2c073d1..4888bc9 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -1,8 +1,6 @@ - - - { }"> - - - - - {{ info?.alarmType }} - - - × - - - - - 报警时间: - - - {{ info?.alarmTime }} - - - - - 报警原因: - - - {{ info?.alarmContent }} - - - - - 位置: - - - - {{ info?.address }} - - - - - 详细地址: - - - {{ info?.position }} - - - - - 管理单位: - - - {{ info?.deptName }} - - - - - 产权单位: - - - {{ info?.propertyOwner }} - - - - - 管理方式: - - - {{ info?.manageType }} - - - - - - - - diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/src/assets/images/login-image/smallBg.png b/src/assets/images/login-image/smallBg.png new file mode 100644 index 0000000..cfc2658 --- /dev/null +++ b/src/assets/images/login-image/smallBg.png Binary files differ diff --git a/src/assets/images/login-image/whiteBg.png b/src/assets/images/login-image/whiteBg.png new file mode 100644 index 0000000..0c244b8 --- /dev/null +++ b/src/assets/images/login-image/whiteBg.png Binary files differ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index a7824b6..c8923ec 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -6,7 +6,6 @@ import { getDeptTreeList } from '@/api/system/dept' import { judgeTree, toTreeList } from '@/utils/structure' import indexDB from '@/utils/indexDB' -import { indexDBHandler } from '@/utils/sessionData' const props = defineProps({ // 数据绑定 modelValue: { @@ -71,7 +70,6 @@ const fetch = () => { getDeptTreeList().then((res) => { const list = res.data.filter((item: any) => item.id !== '0') - indexDBHandler('all-dept-list', JSON.stringify(res.data)) dictStore.setAllDeptList(list) refreshList(list) console.log(list, 'list') @@ -80,17 +78,7 @@ // 如果未指定需要展示的部门类型,获取全部部门 if (!props.deptType) { // if (dictStore.allDeptList.length === 0) { // 如果store中未存储,从服务器上获取 - indexDB.getAll().then(allData => { - if (allData.filter((item: any) => item.name === 'all-dept-list').length) { - const list = JSON.parse(allData.filter((item: any) => item.name === 'all-dept-list')[0].data).filter((item: any) => item.id !== '0') - refreshList(list) - } - else { - fetch() - } - }).catch(() => { - fetch() - }) + fetch() // } // else { // refreshList(dictStore.allDeptList) diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index ab01ebc..e378ecf 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -37,7 +37,7 @@ // 关闭声音 const { proxy } = getCurrentInstance() as any const closeSound = () => { - proxy.pauseAudio() + // proxy.pauseAudio() localStorage.setItem('eventAudio', 'pause') } // 查看 diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 2c073d1..4888bc9 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -1,8 +1,6 @@ - - - { }"> - - - - - {{ info?.alarmType }} - - - × - - - - - 报警时间: - - - {{ info?.alarmTime }} - - - - - 报警原因: - - - {{ info?.alarmContent }} - - - - - 位置: - - - - {{ info?.address }} - - - - - 详细地址: - - - {{ info?.position }} - - - - - 管理单位: - - - {{ info?.deptName }} - - - - - 产权单位: - - - {{ info?.propertyOwner }} - - - - - 管理方式: - - - {{ info?.manageType }} - - - - - - - - diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue deleted file mode 100644 index beea45e..0000000 --- a/src/views/home/dashboard/components/controlMap.vue +++ /dev/null @@ -1,3095 +0,0 @@ - - - - - - - - - - 智控区 - - - 行政区 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - - - - {{ item.name }} - - - - - - - - - {{ item.name }} - - - - - - -::v-deep(.el-loading-mask) { - background-color: rgba($color: #0b0b0f, $alpha: 95%); -} - -.show-count { - position: absolute; - z-index: 9; - left: 400px; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - // right: 400px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.legend { - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - position: absolute; - z-index: 1; - bottom: 10px; - // left: 400px; - left: 21%; - padding: 10px; - // border-radius: 3px; - border: 1px solid #249eff; - color: #fff; - - .legend-item { - margin: 10px 0; - // font-weight: 700; - display: flex; - align-items: center; - - .img { - width: 20px; - height: 20px; - } - - &:hover { - cursor: pointer; - } - } -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // left: 400px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // right: 400px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 20px; - width: 20px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/src/assets/images/login-image/smallBg.png b/src/assets/images/login-image/smallBg.png new file mode 100644 index 0000000..cfc2658 --- /dev/null +++ b/src/assets/images/login-image/smallBg.png Binary files differ diff --git a/src/assets/images/login-image/whiteBg.png b/src/assets/images/login-image/whiteBg.png new file mode 100644 index 0000000..0c244b8 --- /dev/null +++ b/src/assets/images/login-image/whiteBg.png Binary files differ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index a7824b6..c8923ec 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -6,7 +6,6 @@ import { getDeptTreeList } from '@/api/system/dept' import { judgeTree, toTreeList } from '@/utils/structure' import indexDB from '@/utils/indexDB' -import { indexDBHandler } from '@/utils/sessionData' const props = defineProps({ // 数据绑定 modelValue: { @@ -71,7 +70,6 @@ const fetch = () => { getDeptTreeList().then((res) => { const list = res.data.filter((item: any) => item.id !== '0') - indexDBHandler('all-dept-list', JSON.stringify(res.data)) dictStore.setAllDeptList(list) refreshList(list) console.log(list, 'list') @@ -80,17 +78,7 @@ // 如果未指定需要展示的部门类型,获取全部部门 if (!props.deptType) { // if (dictStore.allDeptList.length === 0) { // 如果store中未存储,从服务器上获取 - indexDB.getAll().then(allData => { - if (allData.filter((item: any) => item.name === 'all-dept-list').length) { - const list = JSON.parse(allData.filter((item: any) => item.name === 'all-dept-list')[0].data).filter((item: any) => item.id !== '0') - refreshList(list) - } - else { - fetch() - } - }).catch(() => { - fetch() - }) + fetch() // } // else { // refreshList(dictStore.allDeptList) diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index ab01ebc..e378ecf 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -37,7 +37,7 @@ // 关闭声音 const { proxy } = getCurrentInstance() as any const closeSound = () => { - proxy.pauseAudio() + // proxy.pauseAudio() localStorage.setItem('eventAudio', 'pause') } // 查看 diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 2c073d1..4888bc9 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -1,8 +1,6 @@ - - - { }"> - - - - - {{ info?.alarmType }} - - - × - - - - - 报警时间: - - - {{ info?.alarmTime }} - - - - - 报警原因: - - - {{ info?.alarmContent }} - - - - - 位置: - - - - {{ info?.address }} - - - - - 详细地址: - - - {{ info?.position }} - - - - - 管理单位: - - - {{ info?.deptName }} - - - - - 产权单位: - - - {{ info?.propertyOwner }} - - - - - 管理方式: - - - {{ info?.manageType }} - - - - - - - - diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue deleted file mode 100644 index beea45e..0000000 --- a/src/views/home/dashboard/components/controlMap.vue +++ /dev/null @@ -1,3095 +0,0 @@ - - - - - - - - - - 智控区 - - - 行政区 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - - - - {{ item.name }} - - - - - - - - - {{ item.name }} - - - - - - -::v-deep(.el-loading-mask) { - background-color: rgba($color: #0b0b0f, $alpha: 95%); -} - -.show-count { - position: absolute; - z-index: 9; - left: 400px; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - // right: 400px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.legend { - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - position: absolute; - z-index: 1; - bottom: 10px; - // left: 400px; - left: 21%; - padding: 10px; - // border-radius: 3px; - border: 1px solid #249eff; - color: #fff; - - .legend-item { - margin: 10px 0; - // font-weight: 700; - display: flex; - align-items: center; - - .img { - width: 20px; - height: 20px; - } - - &:hover { - cursor: pointer; - } - } -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // left: 400px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // right: 400px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 20px; - width: 20px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/src/views/home/dashboard/components/demonstration.vue b/src/views/home/dashboard/components/demonstration.vue deleted file mode 100644 index f9c4f14..0000000 --- a/src/views/home/dashboard/components/demonstration.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - {{ $props.data.name }} - - - - 设备类型: - - - {{ $props.data.type }} - - - - - 设备编号: - - - {{ }} - - - - - 厂商: - - - 北京无线电计量测试研究所 - - - - - 负责人: - - - {{ }} - - - - - 联系方式: - - - - - - 管理单位: - - - 第一分公司 - - - - - 详细位置: - - - - - - - - - - - diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/src/assets/images/login-image/smallBg.png b/src/assets/images/login-image/smallBg.png new file mode 100644 index 0000000..cfc2658 --- /dev/null +++ b/src/assets/images/login-image/smallBg.png Binary files differ diff --git a/src/assets/images/login-image/whiteBg.png b/src/assets/images/login-image/whiteBg.png new file mode 100644 index 0000000..0c244b8 --- /dev/null +++ b/src/assets/images/login-image/whiteBg.png Binary files differ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index a7824b6..c8923ec 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -6,7 +6,6 @@ import { getDeptTreeList } from '@/api/system/dept' import { judgeTree, toTreeList } from '@/utils/structure' import indexDB from '@/utils/indexDB' -import { indexDBHandler } from '@/utils/sessionData' const props = defineProps({ // 数据绑定 modelValue: { @@ -71,7 +70,6 @@ const fetch = () => { getDeptTreeList().then((res) => { const list = res.data.filter((item: any) => item.id !== '0') - indexDBHandler('all-dept-list', JSON.stringify(res.data)) dictStore.setAllDeptList(list) refreshList(list) console.log(list, 'list') @@ -80,17 +78,7 @@ // 如果未指定需要展示的部门类型,获取全部部门 if (!props.deptType) { // if (dictStore.allDeptList.length === 0) { // 如果store中未存储,从服务器上获取 - indexDB.getAll().then(allData => { - if (allData.filter((item: any) => item.name === 'all-dept-list').length) { - const list = JSON.parse(allData.filter((item: any) => item.name === 'all-dept-list')[0].data).filter((item: any) => item.id !== '0') - refreshList(list) - } - else { - fetch() - } - }).catch(() => { - fetch() - }) + fetch() // } // else { // refreshList(dictStore.allDeptList) diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index ab01ebc..e378ecf 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -37,7 +37,7 @@ // 关闭声音 const { proxy } = getCurrentInstance() as any const closeSound = () => { - proxy.pauseAudio() + // proxy.pauseAudio() localStorage.setItem('eventAudio', 'pause') } // 查看 diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 2c073d1..4888bc9 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -1,8 +1,6 @@ - - - { }"> - - - - - {{ info?.alarmType }} - - - × - - - - - 报警时间: - - - {{ info?.alarmTime }} - - - - - 报警原因: - - - {{ info?.alarmContent }} - - - - - 位置: - - - - {{ info?.address }} - - - - - 详细地址: - - - {{ info?.position }} - - - - - 管理单位: - - - {{ info?.deptName }} - - - - - 产权单位: - - - {{ info?.propertyOwner }} - - - - - 管理方式: - - - {{ info?.manageType }} - - - - - - - - diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue deleted file mode 100644 index beea45e..0000000 --- a/src/views/home/dashboard/components/controlMap.vue +++ /dev/null @@ -1,3095 +0,0 @@ - - - - - - - - - - 智控区 - - - 行政区 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - - - - {{ item.name }} - - - - - - - - - {{ item.name }} - - - - - - -::v-deep(.el-loading-mask) { - background-color: rgba($color: #0b0b0f, $alpha: 95%); -} - -.show-count { - position: absolute; - z-index: 9; - left: 400px; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - // right: 400px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.legend { - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - position: absolute; - z-index: 1; - bottom: 10px; - // left: 400px; - left: 21%; - padding: 10px; - // border-radius: 3px; - border: 1px solid #249eff; - color: #fff; - - .legend-item { - margin: 10px 0; - // font-weight: 700; - display: flex; - align-items: center; - - .img { - width: 20px; - height: 20px; - } - - &:hover { - cursor: pointer; - } - } -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // left: 400px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // right: 400px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 20px; - width: 20px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/src/views/home/dashboard/components/demonstration.vue b/src/views/home/dashboard/components/demonstration.vue deleted file mode 100644 index f9c4f14..0000000 --- a/src/views/home/dashboard/components/demonstration.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - {{ $props.data.name }} - - - - 设备类型: - - - {{ $props.data.type }} - - - - - 设备编号: - - - {{ }} - - - - - 厂商: - - - 北京无线电计量测试研究所 - - - - - 负责人: - - - {{ }} - - - - - 联系方式: - - - - - - 管理单位: - - - 第一分公司 - - - - - 详细位置: - - - - - - - - - - - diff --git a/src/views/home/dashboard/components/detailInfoDialog.vue b/src/views/home/dashboard/components/detailInfoDialog.vue deleted file mode 100644 index c8eff74..0000000 --- a/src/views/home/dashboard/components/detailInfoDialog.vue +++ /dev/null @@ -1,137 +0,0 @@ - - - - - { }"> - - × - - - - - - - - - - diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/src/assets/images/login-image/smallBg.png b/src/assets/images/login-image/smallBg.png new file mode 100644 index 0000000..cfc2658 --- /dev/null +++ b/src/assets/images/login-image/smallBg.png Binary files differ diff --git a/src/assets/images/login-image/whiteBg.png b/src/assets/images/login-image/whiteBg.png new file mode 100644 index 0000000..0c244b8 --- /dev/null +++ b/src/assets/images/login-image/whiteBg.png Binary files differ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index a7824b6..c8923ec 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -6,7 +6,6 @@ import { getDeptTreeList } from '@/api/system/dept' import { judgeTree, toTreeList } from '@/utils/structure' import indexDB from '@/utils/indexDB' -import { indexDBHandler } from '@/utils/sessionData' const props = defineProps({ // 数据绑定 modelValue: { @@ -71,7 +70,6 @@ const fetch = () => { getDeptTreeList().then((res) => { const list = res.data.filter((item: any) => item.id !== '0') - indexDBHandler('all-dept-list', JSON.stringify(res.data)) dictStore.setAllDeptList(list) refreshList(list) console.log(list, 'list') @@ -80,17 +78,7 @@ // 如果未指定需要展示的部门类型,获取全部部门 if (!props.deptType) { // if (dictStore.allDeptList.length === 0) { // 如果store中未存储,从服务器上获取 - indexDB.getAll().then(allData => { - if (allData.filter((item: any) => item.name === 'all-dept-list').length) { - const list = JSON.parse(allData.filter((item: any) => item.name === 'all-dept-list')[0].data).filter((item: any) => item.id !== '0') - refreshList(list) - } - else { - fetch() - } - }).catch(() => { - fetch() - }) + fetch() // } // else { // refreshList(dictStore.allDeptList) diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index ab01ebc..e378ecf 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -37,7 +37,7 @@ // 关闭声音 const { proxy } = getCurrentInstance() as any const closeSound = () => { - proxy.pauseAudio() + // proxy.pauseAudio() localStorage.setItem('eventAudio', 'pause') } // 查看 diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 2c073d1..4888bc9 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -1,8 +1,6 @@ - - - { }"> - - - - - {{ info?.alarmType }} - - - × - - - - - 报警时间: - - - {{ info?.alarmTime }} - - - - - 报警原因: - - - {{ info?.alarmContent }} - - - - - 位置: - - - - {{ info?.address }} - - - - - 详细地址: - - - {{ info?.position }} - - - - - 管理单位: - - - {{ info?.deptName }} - - - - - 产权单位: - - - {{ info?.propertyOwner }} - - - - - 管理方式: - - - {{ info?.manageType }} - - - - - - - - diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue deleted file mode 100644 index beea45e..0000000 --- a/src/views/home/dashboard/components/controlMap.vue +++ /dev/null @@ -1,3095 +0,0 @@ - - - - - - - - - - 智控区 - - - 行政区 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - - - - {{ item.name }} - - - - - - - - - {{ item.name }} - - - - - - -::v-deep(.el-loading-mask) { - background-color: rgba($color: #0b0b0f, $alpha: 95%); -} - -.show-count { - position: absolute; - z-index: 9; - left: 400px; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - // right: 400px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.legend { - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - position: absolute; - z-index: 1; - bottom: 10px; - // left: 400px; - left: 21%; - padding: 10px; - // border-radius: 3px; - border: 1px solid #249eff; - color: #fff; - - .legend-item { - margin: 10px 0; - // font-weight: 700; - display: flex; - align-items: center; - - .img { - width: 20px; - height: 20px; - } - - &:hover { - cursor: pointer; - } - } -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // left: 400px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // right: 400px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 20px; - width: 20px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/src/views/home/dashboard/components/demonstration.vue b/src/views/home/dashboard/components/demonstration.vue deleted file mode 100644 index f9c4f14..0000000 --- a/src/views/home/dashboard/components/demonstration.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - {{ $props.data.name }} - - - - 设备类型: - - - {{ $props.data.type }} - - - - - 设备编号: - - - {{ }} - - - - - 厂商: - - - 北京无线电计量测试研究所 - - - - - 负责人: - - - {{ }} - - - - - 联系方式: - - - - - - 管理单位: - - - 第一分公司 - - - - - 详细位置: - - - - - - - - - - - diff --git a/src/views/home/dashboard/components/detailInfoDialog.vue b/src/views/home/dashboard/components/detailInfoDialog.vue deleted file mode 100644 index c8eff74..0000000 --- a/src/views/home/dashboard/components/detailInfoDialog.vue +++ /dev/null @@ -1,137 +0,0 @@ - - - - - { }"> - - × - - - - - - - - - - diff --git a/src/views/home/dashboard/components/eventMap.vue b/src/views/home/dashboard/components/eventMap.vue deleted file mode 100644 index 7c6f5af..0000000 --- a/src/views/home/dashboard/components/eventMap.vue +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - -.show-count { - position: absolute; - z-index: 9; - left: 21%; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 2px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 2px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - // .icon { - // height: 20px; - // width: 20px; - // border-radius: 50%; - // opacity: 0.8; - // } - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/src/assets/images/login-image/smallBg.png b/src/assets/images/login-image/smallBg.png new file mode 100644 index 0000000..cfc2658 --- /dev/null +++ b/src/assets/images/login-image/smallBg.png Binary files differ diff --git a/src/assets/images/login-image/whiteBg.png b/src/assets/images/login-image/whiteBg.png new file mode 100644 index 0000000..0c244b8 --- /dev/null +++ b/src/assets/images/login-image/whiteBg.png Binary files differ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index a7824b6..c8923ec 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -6,7 +6,6 @@ import { getDeptTreeList } from '@/api/system/dept' import { judgeTree, toTreeList } from '@/utils/structure' import indexDB from '@/utils/indexDB' -import { indexDBHandler } from '@/utils/sessionData' const props = defineProps({ // 数据绑定 modelValue: { @@ -71,7 +70,6 @@ const fetch = () => { getDeptTreeList().then((res) => { const list = res.data.filter((item: any) => item.id !== '0') - indexDBHandler('all-dept-list', JSON.stringify(res.data)) dictStore.setAllDeptList(list) refreshList(list) console.log(list, 'list') @@ -80,17 +78,7 @@ // 如果未指定需要展示的部门类型,获取全部部门 if (!props.deptType) { // if (dictStore.allDeptList.length === 0) { // 如果store中未存储,从服务器上获取 - indexDB.getAll().then(allData => { - if (allData.filter((item: any) => item.name === 'all-dept-list').length) { - const list = JSON.parse(allData.filter((item: any) => item.name === 'all-dept-list')[0].data).filter((item: any) => item.id !== '0') - refreshList(list) - } - else { - fetch() - } - }).catch(() => { - fetch() - }) + fetch() // } // else { // refreshList(dictStore.allDeptList) diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index ab01ebc..e378ecf 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -37,7 +37,7 @@ // 关闭声音 const { proxy } = getCurrentInstance() as any const closeSound = () => { - proxy.pauseAudio() + // proxy.pauseAudio() localStorage.setItem('eventAudio', 'pause') } // 查看 diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 2c073d1..4888bc9 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -1,8 +1,6 @@ - - - { }"> - - - - - {{ info?.alarmType }} - - - × - - - - - 报警时间: - - - {{ info?.alarmTime }} - - - - - 报警原因: - - - {{ info?.alarmContent }} - - - - - 位置: - - - - {{ info?.address }} - - - - - 详细地址: - - - {{ info?.position }} - - - - - 管理单位: - - - {{ info?.deptName }} - - - - - 产权单位: - - - {{ info?.propertyOwner }} - - - - - 管理方式: - - - {{ info?.manageType }} - - - - - - - - diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue deleted file mode 100644 index beea45e..0000000 --- a/src/views/home/dashboard/components/controlMap.vue +++ /dev/null @@ -1,3095 +0,0 @@ - - - - - - - - - - 智控区 - - - 行政区 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - - - - {{ item.name }} - - - - - - - - - {{ item.name }} - - - - - - -::v-deep(.el-loading-mask) { - background-color: rgba($color: #0b0b0f, $alpha: 95%); -} - -.show-count { - position: absolute; - z-index: 9; - left: 400px; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - // right: 400px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.legend { - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - position: absolute; - z-index: 1; - bottom: 10px; - // left: 400px; - left: 21%; - padding: 10px; - // border-radius: 3px; - border: 1px solid #249eff; - color: #fff; - - .legend-item { - margin: 10px 0; - // font-weight: 700; - display: flex; - align-items: center; - - .img { - width: 20px; - height: 20px; - } - - &:hover { - cursor: pointer; - } - } -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // left: 400px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // right: 400px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 20px; - width: 20px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/src/views/home/dashboard/components/demonstration.vue b/src/views/home/dashboard/components/demonstration.vue deleted file mode 100644 index f9c4f14..0000000 --- a/src/views/home/dashboard/components/demonstration.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - {{ $props.data.name }} - - - - 设备类型: - - - {{ $props.data.type }} - - - - - 设备编号: - - - {{ }} - - - - - 厂商: - - - 北京无线电计量测试研究所 - - - - - 负责人: - - - {{ }} - - - - - 联系方式: - - - - - - 管理单位: - - - 第一分公司 - - - - - 详细位置: - - - - - - - - - - - diff --git a/src/views/home/dashboard/components/detailInfoDialog.vue b/src/views/home/dashboard/components/detailInfoDialog.vue deleted file mode 100644 index c8eff74..0000000 --- a/src/views/home/dashboard/components/detailInfoDialog.vue +++ /dev/null @@ -1,137 +0,0 @@ - - - - - { }"> - - × - - - - - - - - - - diff --git a/src/views/home/dashboard/components/eventMap.vue b/src/views/home/dashboard/components/eventMap.vue deleted file mode 100644 index 7c6f5af..0000000 --- a/src/views/home/dashboard/components/eventMap.vue +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - -.show-count { - position: absolute; - z-index: 9; - left: 21%; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 2px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 2px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - // .icon { - // height: 20px; - // width: 20px; - // border-radius: 50%; - // opacity: 0.8; - // } - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/src/views/home/dashboard/components/fullScreen-bak.vue b/src/views/home/dashboard/components/fullScreen-bak.vue deleted file mode 100644 index ffb82cc..0000000 --- a/src/views/home/dashboard/components/fullScreen-bak.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/src/assets/images/login-image/smallBg.png b/src/assets/images/login-image/smallBg.png new file mode 100644 index 0000000..cfc2658 --- /dev/null +++ b/src/assets/images/login-image/smallBg.png Binary files differ diff --git a/src/assets/images/login-image/whiteBg.png b/src/assets/images/login-image/whiteBg.png new file mode 100644 index 0000000..0c244b8 --- /dev/null +++ b/src/assets/images/login-image/whiteBg.png Binary files differ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index a7824b6..c8923ec 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -6,7 +6,6 @@ import { getDeptTreeList } from '@/api/system/dept' import { judgeTree, toTreeList } from '@/utils/structure' import indexDB from '@/utils/indexDB' -import { indexDBHandler } from '@/utils/sessionData' const props = defineProps({ // 数据绑定 modelValue: { @@ -71,7 +70,6 @@ const fetch = () => { getDeptTreeList().then((res) => { const list = res.data.filter((item: any) => item.id !== '0') - indexDBHandler('all-dept-list', JSON.stringify(res.data)) dictStore.setAllDeptList(list) refreshList(list) console.log(list, 'list') @@ -80,17 +78,7 @@ // 如果未指定需要展示的部门类型,获取全部部门 if (!props.deptType) { // if (dictStore.allDeptList.length === 0) { // 如果store中未存储,从服务器上获取 - indexDB.getAll().then(allData => { - if (allData.filter((item: any) => item.name === 'all-dept-list').length) { - const list = JSON.parse(allData.filter((item: any) => item.name === 'all-dept-list')[0].data).filter((item: any) => item.id !== '0') - refreshList(list) - } - else { - fetch() - } - }).catch(() => { - fetch() - }) + fetch() // } // else { // refreshList(dictStore.allDeptList) diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index ab01ebc..e378ecf 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -37,7 +37,7 @@ // 关闭声音 const { proxy } = getCurrentInstance() as any const closeSound = () => { - proxy.pauseAudio() + // proxy.pauseAudio() localStorage.setItem('eventAudio', 'pause') } // 查看 diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 2c073d1..4888bc9 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -1,8 +1,6 @@ - - - { }"> - - - - - {{ info?.alarmType }} - - - × - - - - - 报警时间: - - - {{ info?.alarmTime }} - - - - - 报警原因: - - - {{ info?.alarmContent }} - - - - - 位置: - - - - {{ info?.address }} - - - - - 详细地址: - - - {{ info?.position }} - - - - - 管理单位: - - - {{ info?.deptName }} - - - - - 产权单位: - - - {{ info?.propertyOwner }} - - - - - 管理方式: - - - {{ info?.manageType }} - - - - - - - - diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue deleted file mode 100644 index beea45e..0000000 --- a/src/views/home/dashboard/components/controlMap.vue +++ /dev/null @@ -1,3095 +0,0 @@ - - - - - - - - - - 智控区 - - - 行政区 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - - - - {{ item.name }} - - - - - - - - - {{ item.name }} - - - - - - -::v-deep(.el-loading-mask) { - background-color: rgba($color: #0b0b0f, $alpha: 95%); -} - -.show-count { - position: absolute; - z-index: 9; - left: 400px; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - // right: 400px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.legend { - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - position: absolute; - z-index: 1; - bottom: 10px; - // left: 400px; - left: 21%; - padding: 10px; - // border-radius: 3px; - border: 1px solid #249eff; - color: #fff; - - .legend-item { - margin: 10px 0; - // font-weight: 700; - display: flex; - align-items: center; - - .img { - width: 20px; - height: 20px; - } - - &:hover { - cursor: pointer; - } - } -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // left: 400px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // right: 400px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 20px; - width: 20px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/src/views/home/dashboard/components/demonstration.vue b/src/views/home/dashboard/components/demonstration.vue deleted file mode 100644 index f9c4f14..0000000 --- a/src/views/home/dashboard/components/demonstration.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - {{ $props.data.name }} - - - - 设备类型: - - - {{ $props.data.type }} - - - - - 设备编号: - - - {{ }} - - - - - 厂商: - - - 北京无线电计量测试研究所 - - - - - 负责人: - - - {{ }} - - - - - 联系方式: - - - - - - 管理单位: - - - 第一分公司 - - - - - 详细位置: - - - - - - - - - - - diff --git a/src/views/home/dashboard/components/detailInfoDialog.vue b/src/views/home/dashboard/components/detailInfoDialog.vue deleted file mode 100644 index c8eff74..0000000 --- a/src/views/home/dashboard/components/detailInfoDialog.vue +++ /dev/null @@ -1,137 +0,0 @@ - - - - - { }"> - - × - - - - - - - - - - diff --git a/src/views/home/dashboard/components/eventMap.vue b/src/views/home/dashboard/components/eventMap.vue deleted file mode 100644 index 7c6f5af..0000000 --- a/src/views/home/dashboard/components/eventMap.vue +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - -.show-count { - position: absolute; - z-index: 9; - left: 21%; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 2px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 2px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - // .icon { - // height: 20px; - // width: 20px; - // border-radius: 50%; - // opacity: 0.8; - // } - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/src/views/home/dashboard/components/fullScreen-bak.vue b/src/views/home/dashboard/components/fullScreen-bak.vue deleted file mode 100644 index ffb82cc..0000000 --- a/src/views/home/dashboard/components/fullScreen-bak.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - diff --git a/src/views/home/dashboard/components/imgData.ts b/src/views/home/dashboard/components/imgData.ts deleted file mode 100644 index ee2cf8a..0000000 --- a/src/views/home/dashboard/components/imgData.ts +++ /dev/null @@ -1,25 +0,0 @@ -export const img = { - bjtj: new URL('@/assets/images/dashboard/bjtj.png', import.meta.url), - czjc: new URL('@/assets/images/dashboard/czjc.png', import.meta.url), - dqbj: new URL('@/assets/images/dashboard/dqbj.png', import.meta.url), - guanxian: new URL('@/assets/images/dashboard/guanxian.png', import.meta.url), - gxjc: new URL('@/assets/images/dashboard/gxjc.png', import.meta.url), - lixian: new URL('@/assets/images/dashboard/lixian.png', import.meta.url), - ssgl: new URL('@/assets/images/dashboard/ssgl.png', import.meta.url), - - tiaoya: new URL('@/assets/images/dashboard/tiaoya.png', import.meta.url), - tingyong: new URL('@/assets/images/dashboard/tingyong.png', import.meta.url), - well: new URL('@/assets/images/dashboard/well.png', import.meta.url), - zaixian: new URL('@/assets/images/dashboard/zaixian.png', import.meta.url), - zjjc: new URL('@/assets/images/dashboard/zjjc.png', import.meta.url), - - fm: new URL('@/assets/images/dashboard/fm.png', import.meta.url), - tyz: new URL('@/assets/images/dashboard/tyz.png', import.meta.url), - tyx: new URL('@/assets/images/dashboard/tyx.png', import.meta.url), - zy: new URL('@/assets/images/dashboard/zy.png', import.meta.url), - dy: new URL('@/assets/images/dashboard/dy.png', import.meta.url), - shaobing: new URL('@/assets/images/dashboard/shaobing.png', import.meta.url), - yuntai: new URL('@/assets/images/dashboard/yuntai.png', import.meta.url), - ranqi: new URL('@/assets/images/dashboard/ranqi.png', import.meta.url), - alarm: new URL('@/assets/images/spread.gif', import.meta.url), -} diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/src/assets/images/login-image/smallBg.png b/src/assets/images/login-image/smallBg.png new file mode 100644 index 0000000..cfc2658 --- /dev/null +++ b/src/assets/images/login-image/smallBg.png Binary files differ diff --git a/src/assets/images/login-image/whiteBg.png b/src/assets/images/login-image/whiteBg.png new file mode 100644 index 0000000..0c244b8 --- /dev/null +++ b/src/assets/images/login-image/whiteBg.png Binary files differ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index a7824b6..c8923ec 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -6,7 +6,6 @@ import { getDeptTreeList } from '@/api/system/dept' import { judgeTree, toTreeList } from '@/utils/structure' import indexDB from '@/utils/indexDB' -import { indexDBHandler } from '@/utils/sessionData' const props = defineProps({ // 数据绑定 modelValue: { @@ -71,7 +70,6 @@ const fetch = () => { getDeptTreeList().then((res) => { const list = res.data.filter((item: any) => item.id !== '0') - indexDBHandler('all-dept-list', JSON.stringify(res.data)) dictStore.setAllDeptList(list) refreshList(list) console.log(list, 'list') @@ -80,17 +78,7 @@ // 如果未指定需要展示的部门类型,获取全部部门 if (!props.deptType) { // if (dictStore.allDeptList.length === 0) { // 如果store中未存储,从服务器上获取 - indexDB.getAll().then(allData => { - if (allData.filter((item: any) => item.name === 'all-dept-list').length) { - const list = JSON.parse(allData.filter((item: any) => item.name === 'all-dept-list')[0].data).filter((item: any) => item.id !== '0') - refreshList(list) - } - else { - fetch() - } - }).catch(() => { - fetch() - }) + fetch() // } // else { // refreshList(dictStore.allDeptList) diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index ab01ebc..e378ecf 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -37,7 +37,7 @@ // 关闭声音 const { proxy } = getCurrentInstance() as any const closeSound = () => { - proxy.pauseAudio() + // proxy.pauseAudio() localStorage.setItem('eventAudio', 'pause') } // 查看 diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 2c073d1..4888bc9 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -1,8 +1,6 @@ - - - { }"> - - - - - {{ info?.alarmType }} - - - × - - - - - 报警时间: - - - {{ info?.alarmTime }} - - - - - 报警原因: - - - {{ info?.alarmContent }} - - - - - 位置: - - - - {{ info?.address }} - - - - - 详细地址: - - - {{ info?.position }} - - - - - 管理单位: - - - {{ info?.deptName }} - - - - - 产权单位: - - - {{ info?.propertyOwner }} - - - - - 管理方式: - - - {{ info?.manageType }} - - - - - - - - diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue deleted file mode 100644 index beea45e..0000000 --- a/src/views/home/dashboard/components/controlMap.vue +++ /dev/null @@ -1,3095 +0,0 @@ - - - - - - - - - - 智控区 - - - 行政区 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - - - - {{ item.name }} - - - - - - - - - {{ item.name }} - - - - - - -::v-deep(.el-loading-mask) { - background-color: rgba($color: #0b0b0f, $alpha: 95%); -} - -.show-count { - position: absolute; - z-index: 9; - left: 400px; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - // right: 400px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.legend { - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - position: absolute; - z-index: 1; - bottom: 10px; - // left: 400px; - left: 21%; - padding: 10px; - // border-radius: 3px; - border: 1px solid #249eff; - color: #fff; - - .legend-item { - margin: 10px 0; - // font-weight: 700; - display: flex; - align-items: center; - - .img { - width: 20px; - height: 20px; - } - - &:hover { - cursor: pointer; - } - } -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // left: 400px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // right: 400px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 20px; - width: 20px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/src/views/home/dashboard/components/demonstration.vue b/src/views/home/dashboard/components/demonstration.vue deleted file mode 100644 index f9c4f14..0000000 --- a/src/views/home/dashboard/components/demonstration.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - {{ $props.data.name }} - - - - 设备类型: - - - {{ $props.data.type }} - - - - - 设备编号: - - - {{ }} - - - - - 厂商: - - - 北京无线电计量测试研究所 - - - - - 负责人: - - - {{ }} - - - - - 联系方式: - - - - - - 管理单位: - - - 第一分公司 - - - - - 详细位置: - - - - - - - - - - - diff --git a/src/views/home/dashboard/components/detailInfoDialog.vue b/src/views/home/dashboard/components/detailInfoDialog.vue deleted file mode 100644 index c8eff74..0000000 --- a/src/views/home/dashboard/components/detailInfoDialog.vue +++ /dev/null @@ -1,137 +0,0 @@ - - - - - { }"> - - × - - - - - - - - - - diff --git a/src/views/home/dashboard/components/eventMap.vue b/src/views/home/dashboard/components/eventMap.vue deleted file mode 100644 index 7c6f5af..0000000 --- a/src/views/home/dashboard/components/eventMap.vue +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - -.show-count { - position: absolute; - z-index: 9; - left: 21%; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 2px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 2px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - // .icon { - // height: 20px; - // width: 20px; - // border-radius: 50%; - // opacity: 0.8; - // } - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/src/views/home/dashboard/components/fullScreen-bak.vue b/src/views/home/dashboard/components/fullScreen-bak.vue deleted file mode 100644 index ffb82cc..0000000 --- a/src/views/home/dashboard/components/fullScreen-bak.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - diff --git a/src/views/home/dashboard/components/imgData.ts b/src/views/home/dashboard/components/imgData.ts deleted file mode 100644 index ee2cf8a..0000000 --- a/src/views/home/dashboard/components/imgData.ts +++ /dev/null @@ -1,25 +0,0 @@ -export const img = { - bjtj: new URL('@/assets/images/dashboard/bjtj.png', import.meta.url), - czjc: new URL('@/assets/images/dashboard/czjc.png', import.meta.url), - dqbj: new URL('@/assets/images/dashboard/dqbj.png', import.meta.url), - guanxian: new URL('@/assets/images/dashboard/guanxian.png', import.meta.url), - gxjc: new URL('@/assets/images/dashboard/gxjc.png', import.meta.url), - lixian: new URL('@/assets/images/dashboard/lixian.png', import.meta.url), - ssgl: new URL('@/assets/images/dashboard/ssgl.png', import.meta.url), - - tiaoya: new URL('@/assets/images/dashboard/tiaoya.png', import.meta.url), - tingyong: new URL('@/assets/images/dashboard/tingyong.png', import.meta.url), - well: new URL('@/assets/images/dashboard/well.png', import.meta.url), - zaixian: new URL('@/assets/images/dashboard/zaixian.png', import.meta.url), - zjjc: new URL('@/assets/images/dashboard/zjjc.png', import.meta.url), - - fm: new URL('@/assets/images/dashboard/fm.png', import.meta.url), - tyz: new URL('@/assets/images/dashboard/tyz.png', import.meta.url), - tyx: new URL('@/assets/images/dashboard/tyx.png', import.meta.url), - zy: new URL('@/assets/images/dashboard/zy.png', import.meta.url), - dy: new URL('@/assets/images/dashboard/dy.png', import.meta.url), - shaobing: new URL('@/assets/images/dashboard/shaobing.png', import.meta.url), - yuntai: new URL('@/assets/images/dashboard/yuntai.png', import.meta.url), - ranqi: new URL('@/assets/images/dashboard/ranqi.png', import.meta.url), - alarm: new URL('@/assets/images/spread.gif', import.meta.url), -} diff --git a/src/views/home/dashboard/components/mapData.ts b/src/views/home/dashboard/components/mapData.ts deleted file mode 100644 index ab7e0c3..0000000 --- a/src/views/home/dashboard/components/mapData.ts +++ /dev/null @@ -1,230 +0,0 @@ -// 北京各个区坐标数据 // 取数据地址https://datav.aliyun.com/portal/school/atlas/area_selector#&lat=30.332329214580188&lng=106.72278672066881&zoom=3.5 -import yanqing from '@/assets/map/yanqing.json' -import huairou from '@/assets/map/huairou.json' -import miyun from '@/assets/map/miyun.json' -import pinggu from '@/assets/map/pinggu.json' -import shunyi from '@/assets/map/shunyi.json' -import changping from '@/assets/map/changping.json' -import mentougou from '@/assets/map/mentougou.json' -import shijingshan from '@/assets/map/shijingshan.json' -import haidian from '@/assets/map/haidian.json' -import chaoyang from '@/assets/map/chaoyang.json' -import tongzhou from '@/assets/map/tongzhou.json' -import dongcheng from '@/assets/map/dongcheng.json' -import xicheng from '@/assets/map/xicheng.json' -import fengtai from '@/assets/map/fengtai.json' -import fangshan from '@/assets/map/fangshan.json' -import daxing from '@/assets/map/daxing.json' -import demonstration from '@/assets/map/95.json' -const yanqingData = yanqing.features[0].geometry.coordinates -const huairouData = huairou.features[0].geometry.coordinates -const miyunData = miyun.features[0].geometry.coordinates -const pingguData = pinggu.features[0].geometry.coordinates -const shunyiData = shunyi.features[0].geometry.coordinates -const changpingData = changping.features[0].geometry.coordinates -const mentougouData = mentougou.features[0].geometry.coordinates -const shijingshanData = shijingshan.features[0].geometry.coordinates -const haidianData = haidian.features[0].geometry.coordinates -const chaoyangData = chaoyang.features[0].geometry.coordinates -const tongzhouData = tongzhou.features[0].geometry.coordinates -const dongchengData = dongcheng.features[0].geometry.coordinates -const xichengData = xicheng.features[0].geometry.coordinates -const fengtaiData = fengtai.features[0].geometry.coordinates -const fangshanData = fangshan.features[0].geometry.coordinates -const daxingData = daxing.features[0].geometry.coordinates -export const demonstrationData = demonstration.features[0].geometry.coordinates - -export const mapData = [ - { - name: '延庆区', - data: yanqingData, - center: [116.161222, 40.548786], - deptName: '第一分公司', - area: '1993.75', - long: '12.3', - tyz: '22', - tyx: '25', - well: '87', - rate: '80', - }, - { - name: '怀柔区', - data: huairouData, - center: [116.617155, 40.750918], - deptName: '第五分公司', - area: '2122.8', - long: '32.1', - tyz: '32', - tyx: '32', - well: '89', - rate: '60', - }, - { - name: '密云区', - data: miyunData, - center: [116.952238, 40.53835], - deptName: '第五分公司', - area: '2229.45', - long: '27', - tyz: '30', - tyx: '38', - well: '55', - rate: '67', - }, - { - name: '平谷区', - data: pingguData, - center: [117.139005, 40.222423], - deptName: '第四分公司', - area: '948.24', - long: '56', - tyz: '66', - tyx: '56', - well: '102', - rate: '77', - }, - { - name: '顺义区', - data: shunyiData, - center: [116.702299, 40.163678], - deptName: '第三分公司', - area: '1021', - long: '54', - tyz: '44', - tyx: '44', - well: '122', - rate: '75', - }, - { - name: '昌平区', - data: changpingData, - center: [116.23, 40.22], - deptName: '第三分公司', - area: '1343.5', - long: '69', - tyz: '33', - tyx: '45', - well: '112', - rate: '79', - }, - { - name: '门头沟区', - data: mentougouData, - center: [115.768461, 40.013437], - deptName: '第四分公司', - area: '1447.85', - long: '34', - tyz: '12', - tyx: '12', - well: '41', - rate: '56', - }, - { - name: '石景山区', - data: shijingshanData, - center: [116.16933, 39.941635], - deptName: '第三分公司', - area: '85.74', - long: '22', - tyz: '19', - tyx: '18', - well: '141', - rate: '85', - }, - { - name: '海淀区', - data: haidianData, - center: [116.213366, 40.040809], - deptName: '第三分公司', - area: '430.77', - long: '122', - tyz: '88', - tyx: '90', - well: '231', - rate: '87', - }, - { - name: '朝阳区', - data: chaoyangData, - center: [116.481049, 39.978515], - deptName: '第二分公司', - area: '470.8', - long: '162', - tyz: '100', - tyx: '100', - well: '220', - rate: '89', - }, - { - name: '通州区', - data: tongzhouData, - center: [116.692824, 39.810692], - deptName: '第二分公司', - area: '1193.95', - long: '122', - tyz: '140', - tyx: '140', - well: '200', - rate: '76', - }, - { - name: '东城区', - data: dongchengData, - center: [116.358728, 39.914069], - deptName: '第一分公司', - area: '41.84', - long: '66', - tyz: '230', - tyx: '230', - well: '200', - rate: '98', - }, - { - name: '西城区', - data: xichengData, - center: [116.401798, 39.894739], - deptName: '第一分公司', - area: '50.7', - long: '320', - tyz: '300', - tyx: '290', - well: '400', - rate: '97', - }, - { - name: '丰台区', - data: fengtaiData, - center: [116.179934, 39.846876], - deptName: '第四分公司', - area: '306', - long: '230', - tyz: '111', - tyx: '180', - well: '301', - rate: '66', - }, - { - name: '房山区', - data: fangshanData, - center: [115.757474, 39.738367], - deptName: '第五分公司', - area: '2019', - long: '220', - tyz: '140', - tyx: '146', - well: '209', - rate: '73', - }, - { - name: '大兴区', - data: daxingData, - center: [116.345243, 39.668634], - deptName: '第四分公司', - area: '1036.33', - long: '290', - tyz: '430', - tyx: '340', - well: '279', - rate: '78', - }, -] diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/src/assets/images/login-image/smallBg.png b/src/assets/images/login-image/smallBg.png new file mode 100644 index 0000000..cfc2658 --- /dev/null +++ b/src/assets/images/login-image/smallBg.png Binary files differ diff --git a/src/assets/images/login-image/whiteBg.png b/src/assets/images/login-image/whiteBg.png new file mode 100644 index 0000000..0c244b8 --- /dev/null +++ b/src/assets/images/login-image/whiteBg.png Binary files differ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index a7824b6..c8923ec 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -6,7 +6,6 @@ import { getDeptTreeList } from '@/api/system/dept' import { judgeTree, toTreeList } from '@/utils/structure' import indexDB from '@/utils/indexDB' -import { indexDBHandler } from '@/utils/sessionData' const props = defineProps({ // 数据绑定 modelValue: { @@ -71,7 +70,6 @@ const fetch = () => { getDeptTreeList().then((res) => { const list = res.data.filter((item: any) => item.id !== '0') - indexDBHandler('all-dept-list', JSON.stringify(res.data)) dictStore.setAllDeptList(list) refreshList(list) console.log(list, 'list') @@ -80,17 +78,7 @@ // 如果未指定需要展示的部门类型,获取全部部门 if (!props.deptType) { // if (dictStore.allDeptList.length === 0) { // 如果store中未存储,从服务器上获取 - indexDB.getAll().then(allData => { - if (allData.filter((item: any) => item.name === 'all-dept-list').length) { - const list = JSON.parse(allData.filter((item: any) => item.name === 'all-dept-list')[0].data).filter((item: any) => item.id !== '0') - refreshList(list) - } - else { - fetch() - } - }).catch(() => { - fetch() - }) + fetch() // } // else { // refreshList(dictStore.allDeptList) diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index ab01ebc..e378ecf 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -37,7 +37,7 @@ // 关闭声音 const { proxy } = getCurrentInstance() as any const closeSound = () => { - proxy.pauseAudio() + // proxy.pauseAudio() localStorage.setItem('eventAudio', 'pause') } // 查看 diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 2c073d1..4888bc9 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -1,8 +1,6 @@ - - - { }"> - - - - - {{ info?.alarmType }} - - - × - - - - - 报警时间: - - - {{ info?.alarmTime }} - - - - - 报警原因: - - - {{ info?.alarmContent }} - - - - - 位置: - - - - {{ info?.address }} - - - - - 详细地址: - - - {{ info?.position }} - - - - - 管理单位: - - - {{ info?.deptName }} - - - - - 产权单位: - - - {{ info?.propertyOwner }} - - - - - 管理方式: - - - {{ info?.manageType }} - - - - - - - - diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue deleted file mode 100644 index beea45e..0000000 --- a/src/views/home/dashboard/components/controlMap.vue +++ /dev/null @@ -1,3095 +0,0 @@ - - - - - - - - - - 智控区 - - - 行政区 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - - - - {{ item.name }} - - - - - - - - - {{ item.name }} - - - - - - -::v-deep(.el-loading-mask) { - background-color: rgba($color: #0b0b0f, $alpha: 95%); -} - -.show-count { - position: absolute; - z-index: 9; - left: 400px; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - // right: 400px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.legend { - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - position: absolute; - z-index: 1; - bottom: 10px; - // left: 400px; - left: 21%; - padding: 10px; - // border-radius: 3px; - border: 1px solid #249eff; - color: #fff; - - .legend-item { - margin: 10px 0; - // font-weight: 700; - display: flex; - align-items: center; - - .img { - width: 20px; - height: 20px; - } - - &:hover { - cursor: pointer; - } - } -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // left: 400px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // right: 400px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 20px; - width: 20px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/src/views/home/dashboard/components/demonstration.vue b/src/views/home/dashboard/components/demonstration.vue deleted file mode 100644 index f9c4f14..0000000 --- a/src/views/home/dashboard/components/demonstration.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - {{ $props.data.name }} - - - - 设备类型: - - - {{ $props.data.type }} - - - - - 设备编号: - - - {{ }} - - - - - 厂商: - - - 北京无线电计量测试研究所 - - - - - 负责人: - - - {{ }} - - - - - 联系方式: - - - - - - 管理单位: - - - 第一分公司 - - - - - 详细位置: - - - - - - - - - - - diff --git a/src/views/home/dashboard/components/detailInfoDialog.vue b/src/views/home/dashboard/components/detailInfoDialog.vue deleted file mode 100644 index c8eff74..0000000 --- a/src/views/home/dashboard/components/detailInfoDialog.vue +++ /dev/null @@ -1,137 +0,0 @@ - - - - - { }"> - - × - - - - - - - - - - diff --git a/src/views/home/dashboard/components/eventMap.vue b/src/views/home/dashboard/components/eventMap.vue deleted file mode 100644 index 7c6f5af..0000000 --- a/src/views/home/dashboard/components/eventMap.vue +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - -.show-count { - position: absolute; - z-index: 9; - left: 21%; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 2px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 2px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - // .icon { - // height: 20px; - // width: 20px; - // border-radius: 50%; - // opacity: 0.8; - // } - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/src/views/home/dashboard/components/fullScreen-bak.vue b/src/views/home/dashboard/components/fullScreen-bak.vue deleted file mode 100644 index ffb82cc..0000000 --- a/src/views/home/dashboard/components/fullScreen-bak.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - diff --git a/src/views/home/dashboard/components/imgData.ts b/src/views/home/dashboard/components/imgData.ts deleted file mode 100644 index ee2cf8a..0000000 --- a/src/views/home/dashboard/components/imgData.ts +++ /dev/null @@ -1,25 +0,0 @@ -export const img = { - bjtj: new URL('@/assets/images/dashboard/bjtj.png', import.meta.url), - czjc: new URL('@/assets/images/dashboard/czjc.png', import.meta.url), - dqbj: new URL('@/assets/images/dashboard/dqbj.png', import.meta.url), - guanxian: new URL('@/assets/images/dashboard/guanxian.png', import.meta.url), - gxjc: new URL('@/assets/images/dashboard/gxjc.png', import.meta.url), - lixian: new URL('@/assets/images/dashboard/lixian.png', import.meta.url), - ssgl: new URL('@/assets/images/dashboard/ssgl.png', import.meta.url), - - tiaoya: new URL('@/assets/images/dashboard/tiaoya.png', import.meta.url), - tingyong: new URL('@/assets/images/dashboard/tingyong.png', import.meta.url), - well: new URL('@/assets/images/dashboard/well.png', import.meta.url), - zaixian: new URL('@/assets/images/dashboard/zaixian.png', import.meta.url), - zjjc: new URL('@/assets/images/dashboard/zjjc.png', import.meta.url), - - fm: new URL('@/assets/images/dashboard/fm.png', import.meta.url), - tyz: new URL('@/assets/images/dashboard/tyz.png', import.meta.url), - tyx: new URL('@/assets/images/dashboard/tyx.png', import.meta.url), - zy: new URL('@/assets/images/dashboard/zy.png', import.meta.url), - dy: new URL('@/assets/images/dashboard/dy.png', import.meta.url), - shaobing: new URL('@/assets/images/dashboard/shaobing.png', import.meta.url), - yuntai: new URL('@/assets/images/dashboard/yuntai.png', import.meta.url), - ranqi: new URL('@/assets/images/dashboard/ranqi.png', import.meta.url), - alarm: new URL('@/assets/images/spread.gif', import.meta.url), -} diff --git a/src/views/home/dashboard/components/mapData.ts b/src/views/home/dashboard/components/mapData.ts deleted file mode 100644 index ab7e0c3..0000000 --- a/src/views/home/dashboard/components/mapData.ts +++ /dev/null @@ -1,230 +0,0 @@ -// 北京各个区坐标数据 // 取数据地址https://datav.aliyun.com/portal/school/atlas/area_selector#&lat=30.332329214580188&lng=106.72278672066881&zoom=3.5 -import yanqing from '@/assets/map/yanqing.json' -import huairou from '@/assets/map/huairou.json' -import miyun from '@/assets/map/miyun.json' -import pinggu from '@/assets/map/pinggu.json' -import shunyi from '@/assets/map/shunyi.json' -import changping from '@/assets/map/changping.json' -import mentougou from '@/assets/map/mentougou.json' -import shijingshan from '@/assets/map/shijingshan.json' -import haidian from '@/assets/map/haidian.json' -import chaoyang from '@/assets/map/chaoyang.json' -import tongzhou from '@/assets/map/tongzhou.json' -import dongcheng from '@/assets/map/dongcheng.json' -import xicheng from '@/assets/map/xicheng.json' -import fengtai from '@/assets/map/fengtai.json' -import fangshan from '@/assets/map/fangshan.json' -import daxing from '@/assets/map/daxing.json' -import demonstration from '@/assets/map/95.json' -const yanqingData = yanqing.features[0].geometry.coordinates -const huairouData = huairou.features[0].geometry.coordinates -const miyunData = miyun.features[0].geometry.coordinates -const pingguData = pinggu.features[0].geometry.coordinates -const shunyiData = shunyi.features[0].geometry.coordinates -const changpingData = changping.features[0].geometry.coordinates -const mentougouData = mentougou.features[0].geometry.coordinates -const shijingshanData = shijingshan.features[0].geometry.coordinates -const haidianData = haidian.features[0].geometry.coordinates -const chaoyangData = chaoyang.features[0].geometry.coordinates -const tongzhouData = tongzhou.features[0].geometry.coordinates -const dongchengData = dongcheng.features[0].geometry.coordinates -const xichengData = xicheng.features[0].geometry.coordinates -const fengtaiData = fengtai.features[0].geometry.coordinates -const fangshanData = fangshan.features[0].geometry.coordinates -const daxingData = daxing.features[0].geometry.coordinates -export const demonstrationData = demonstration.features[0].geometry.coordinates - -export const mapData = [ - { - name: '延庆区', - data: yanqingData, - center: [116.161222, 40.548786], - deptName: '第一分公司', - area: '1993.75', - long: '12.3', - tyz: '22', - tyx: '25', - well: '87', - rate: '80', - }, - { - name: '怀柔区', - data: huairouData, - center: [116.617155, 40.750918], - deptName: '第五分公司', - area: '2122.8', - long: '32.1', - tyz: '32', - tyx: '32', - well: '89', - rate: '60', - }, - { - name: '密云区', - data: miyunData, - center: [116.952238, 40.53835], - deptName: '第五分公司', - area: '2229.45', - long: '27', - tyz: '30', - tyx: '38', - well: '55', - rate: '67', - }, - { - name: '平谷区', - data: pingguData, - center: [117.139005, 40.222423], - deptName: '第四分公司', - area: '948.24', - long: '56', - tyz: '66', - tyx: '56', - well: '102', - rate: '77', - }, - { - name: '顺义区', - data: shunyiData, - center: [116.702299, 40.163678], - deptName: '第三分公司', - area: '1021', - long: '54', - tyz: '44', - tyx: '44', - well: '122', - rate: '75', - }, - { - name: '昌平区', - data: changpingData, - center: [116.23, 40.22], - deptName: '第三分公司', - area: '1343.5', - long: '69', - tyz: '33', - tyx: '45', - well: '112', - rate: '79', - }, - { - name: '门头沟区', - data: mentougouData, - center: [115.768461, 40.013437], - deptName: '第四分公司', - area: '1447.85', - long: '34', - tyz: '12', - tyx: '12', - well: '41', - rate: '56', - }, - { - name: '石景山区', - data: shijingshanData, - center: [116.16933, 39.941635], - deptName: '第三分公司', - area: '85.74', - long: '22', - tyz: '19', - tyx: '18', - well: '141', - rate: '85', - }, - { - name: '海淀区', - data: haidianData, - center: [116.213366, 40.040809], - deptName: '第三分公司', - area: '430.77', - long: '122', - tyz: '88', - tyx: '90', - well: '231', - rate: '87', - }, - { - name: '朝阳区', - data: chaoyangData, - center: [116.481049, 39.978515], - deptName: '第二分公司', - area: '470.8', - long: '162', - tyz: '100', - tyx: '100', - well: '220', - rate: '89', - }, - { - name: '通州区', - data: tongzhouData, - center: [116.692824, 39.810692], - deptName: '第二分公司', - area: '1193.95', - long: '122', - tyz: '140', - tyx: '140', - well: '200', - rate: '76', - }, - { - name: '东城区', - data: dongchengData, - center: [116.358728, 39.914069], - deptName: '第一分公司', - area: '41.84', - long: '66', - tyz: '230', - tyx: '230', - well: '200', - rate: '98', - }, - { - name: '西城区', - data: xichengData, - center: [116.401798, 39.894739], - deptName: '第一分公司', - area: '50.7', - long: '320', - tyz: '300', - tyx: '290', - well: '400', - rate: '97', - }, - { - name: '丰台区', - data: fengtaiData, - center: [116.179934, 39.846876], - deptName: '第四分公司', - area: '306', - long: '230', - tyz: '111', - tyx: '180', - well: '301', - rate: '66', - }, - { - name: '房山区', - data: fangshanData, - center: [115.757474, 39.738367], - deptName: '第五分公司', - area: '2019', - long: '220', - tyz: '140', - tyx: '146', - well: '209', - rate: '73', - }, - { - name: '大兴区', - data: daxingData, - center: [116.345243, 39.668634], - deptName: '第四分公司', - area: '1036.33', - long: '290', - tyz: '430', - tyx: '340', - well: '279', - rate: '78', - }, -] diff --git a/src/views/home/dashboard/components/noticeDialog.vue b/src/views/home/dashboard/components/noticeDialog.vue deleted file mode 100644 index f27bb53..0000000 --- a/src/views/home/dashboard/components/noticeDialog.vue +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - 查看 - - - - - - - - - - - - diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/src/assets/images/login-image/smallBg.png b/src/assets/images/login-image/smallBg.png new file mode 100644 index 0000000..cfc2658 --- /dev/null +++ b/src/assets/images/login-image/smallBg.png Binary files differ diff --git a/src/assets/images/login-image/whiteBg.png b/src/assets/images/login-image/whiteBg.png new file mode 100644 index 0000000..0c244b8 --- /dev/null +++ b/src/assets/images/login-image/whiteBg.png Binary files differ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index a7824b6..c8923ec 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -6,7 +6,6 @@ import { getDeptTreeList } from '@/api/system/dept' import { judgeTree, toTreeList } from '@/utils/structure' import indexDB from '@/utils/indexDB' -import { indexDBHandler } from '@/utils/sessionData' const props = defineProps({ // 数据绑定 modelValue: { @@ -71,7 +70,6 @@ const fetch = () => { getDeptTreeList().then((res) => { const list = res.data.filter((item: any) => item.id !== '0') - indexDBHandler('all-dept-list', JSON.stringify(res.data)) dictStore.setAllDeptList(list) refreshList(list) console.log(list, 'list') @@ -80,17 +78,7 @@ // 如果未指定需要展示的部门类型,获取全部部门 if (!props.deptType) { // if (dictStore.allDeptList.length === 0) { // 如果store中未存储,从服务器上获取 - indexDB.getAll().then(allData => { - if (allData.filter((item: any) => item.name === 'all-dept-list').length) { - const list = JSON.parse(allData.filter((item: any) => item.name === 'all-dept-list')[0].data).filter((item: any) => item.id !== '0') - refreshList(list) - } - else { - fetch() - } - }).catch(() => { - fetch() - }) + fetch() // } // else { // refreshList(dictStore.allDeptList) diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index ab01ebc..e378ecf 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -37,7 +37,7 @@ // 关闭声音 const { proxy } = getCurrentInstance() as any const closeSound = () => { - proxy.pauseAudio() + // proxy.pauseAudio() localStorage.setItem('eventAudio', 'pause') } // 查看 diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 2c073d1..4888bc9 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -1,8 +1,6 @@ - - - { }"> - - - - - {{ info?.alarmType }} - - - × - - - - - 报警时间: - - - {{ info?.alarmTime }} - - - - - 报警原因: - - - {{ info?.alarmContent }} - - - - - 位置: - - - - {{ info?.address }} - - - - - 详细地址: - - - {{ info?.position }} - - - - - 管理单位: - - - {{ info?.deptName }} - - - - - 产权单位: - - - {{ info?.propertyOwner }} - - - - - 管理方式: - - - {{ info?.manageType }} - - - - - - - - diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue deleted file mode 100644 index beea45e..0000000 --- a/src/views/home/dashboard/components/controlMap.vue +++ /dev/null @@ -1,3095 +0,0 @@ - - - - - - - - - - 智控区 - - - 行政区 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - - - - {{ item.name }} - - - - - - - - - {{ item.name }} - - - - - - -::v-deep(.el-loading-mask) { - background-color: rgba($color: #0b0b0f, $alpha: 95%); -} - -.show-count { - position: absolute; - z-index: 9; - left: 400px; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - // right: 400px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.legend { - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - position: absolute; - z-index: 1; - bottom: 10px; - // left: 400px; - left: 21%; - padding: 10px; - // border-radius: 3px; - border: 1px solid #249eff; - color: #fff; - - .legend-item { - margin: 10px 0; - // font-weight: 700; - display: flex; - align-items: center; - - .img { - width: 20px; - height: 20px; - } - - &:hover { - cursor: pointer; - } - } -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // left: 400px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // right: 400px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 20px; - width: 20px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/src/views/home/dashboard/components/demonstration.vue b/src/views/home/dashboard/components/demonstration.vue deleted file mode 100644 index f9c4f14..0000000 --- a/src/views/home/dashboard/components/demonstration.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - {{ $props.data.name }} - - - - 设备类型: - - - {{ $props.data.type }} - - - - - 设备编号: - - - {{ }} - - - - - 厂商: - - - 北京无线电计量测试研究所 - - - - - 负责人: - - - {{ }} - - - - - 联系方式: - - - - - - 管理单位: - - - 第一分公司 - - - - - 详细位置: - - - - - - - - - - - diff --git a/src/views/home/dashboard/components/detailInfoDialog.vue b/src/views/home/dashboard/components/detailInfoDialog.vue deleted file mode 100644 index c8eff74..0000000 --- a/src/views/home/dashboard/components/detailInfoDialog.vue +++ /dev/null @@ -1,137 +0,0 @@ - - - - - { }"> - - × - - - - - - - - - - diff --git a/src/views/home/dashboard/components/eventMap.vue b/src/views/home/dashboard/components/eventMap.vue deleted file mode 100644 index 7c6f5af..0000000 --- a/src/views/home/dashboard/components/eventMap.vue +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - -.show-count { - position: absolute; - z-index: 9; - left: 21%; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 2px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 2px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - // .icon { - // height: 20px; - // width: 20px; - // border-radius: 50%; - // opacity: 0.8; - // } - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/src/views/home/dashboard/components/fullScreen-bak.vue b/src/views/home/dashboard/components/fullScreen-bak.vue deleted file mode 100644 index ffb82cc..0000000 --- a/src/views/home/dashboard/components/fullScreen-bak.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - diff --git a/src/views/home/dashboard/components/imgData.ts b/src/views/home/dashboard/components/imgData.ts deleted file mode 100644 index ee2cf8a..0000000 --- a/src/views/home/dashboard/components/imgData.ts +++ /dev/null @@ -1,25 +0,0 @@ -export const img = { - bjtj: new URL('@/assets/images/dashboard/bjtj.png', import.meta.url), - czjc: new URL('@/assets/images/dashboard/czjc.png', import.meta.url), - dqbj: new URL('@/assets/images/dashboard/dqbj.png', import.meta.url), - guanxian: new URL('@/assets/images/dashboard/guanxian.png', import.meta.url), - gxjc: new URL('@/assets/images/dashboard/gxjc.png', import.meta.url), - lixian: new URL('@/assets/images/dashboard/lixian.png', import.meta.url), - ssgl: new URL('@/assets/images/dashboard/ssgl.png', import.meta.url), - - tiaoya: new URL('@/assets/images/dashboard/tiaoya.png', import.meta.url), - tingyong: new URL('@/assets/images/dashboard/tingyong.png', import.meta.url), - well: new URL('@/assets/images/dashboard/well.png', import.meta.url), - zaixian: new URL('@/assets/images/dashboard/zaixian.png', import.meta.url), - zjjc: new URL('@/assets/images/dashboard/zjjc.png', import.meta.url), - - fm: new URL('@/assets/images/dashboard/fm.png', import.meta.url), - tyz: new URL('@/assets/images/dashboard/tyz.png', import.meta.url), - tyx: new URL('@/assets/images/dashboard/tyx.png', import.meta.url), - zy: new URL('@/assets/images/dashboard/zy.png', import.meta.url), - dy: new URL('@/assets/images/dashboard/dy.png', import.meta.url), - shaobing: new URL('@/assets/images/dashboard/shaobing.png', import.meta.url), - yuntai: new URL('@/assets/images/dashboard/yuntai.png', import.meta.url), - ranqi: new URL('@/assets/images/dashboard/ranqi.png', import.meta.url), - alarm: new URL('@/assets/images/spread.gif', import.meta.url), -} diff --git a/src/views/home/dashboard/components/mapData.ts b/src/views/home/dashboard/components/mapData.ts deleted file mode 100644 index ab7e0c3..0000000 --- a/src/views/home/dashboard/components/mapData.ts +++ /dev/null @@ -1,230 +0,0 @@ -// 北京各个区坐标数据 // 取数据地址https://datav.aliyun.com/portal/school/atlas/area_selector#&lat=30.332329214580188&lng=106.72278672066881&zoom=3.5 -import yanqing from '@/assets/map/yanqing.json' -import huairou from '@/assets/map/huairou.json' -import miyun from '@/assets/map/miyun.json' -import pinggu from '@/assets/map/pinggu.json' -import shunyi from '@/assets/map/shunyi.json' -import changping from '@/assets/map/changping.json' -import mentougou from '@/assets/map/mentougou.json' -import shijingshan from '@/assets/map/shijingshan.json' -import haidian from '@/assets/map/haidian.json' -import chaoyang from '@/assets/map/chaoyang.json' -import tongzhou from '@/assets/map/tongzhou.json' -import dongcheng from '@/assets/map/dongcheng.json' -import xicheng from '@/assets/map/xicheng.json' -import fengtai from '@/assets/map/fengtai.json' -import fangshan from '@/assets/map/fangshan.json' -import daxing from '@/assets/map/daxing.json' -import demonstration from '@/assets/map/95.json' -const yanqingData = yanqing.features[0].geometry.coordinates -const huairouData = huairou.features[0].geometry.coordinates -const miyunData = miyun.features[0].geometry.coordinates -const pingguData = pinggu.features[0].geometry.coordinates -const shunyiData = shunyi.features[0].geometry.coordinates -const changpingData = changping.features[0].geometry.coordinates -const mentougouData = mentougou.features[0].geometry.coordinates -const shijingshanData = shijingshan.features[0].geometry.coordinates -const haidianData = haidian.features[0].geometry.coordinates -const chaoyangData = chaoyang.features[0].geometry.coordinates -const tongzhouData = tongzhou.features[0].geometry.coordinates -const dongchengData = dongcheng.features[0].geometry.coordinates -const xichengData = xicheng.features[0].geometry.coordinates -const fengtaiData = fengtai.features[0].geometry.coordinates -const fangshanData = fangshan.features[0].geometry.coordinates -const daxingData = daxing.features[0].geometry.coordinates -export const demonstrationData = demonstration.features[0].geometry.coordinates - -export const mapData = [ - { - name: '延庆区', - data: yanqingData, - center: [116.161222, 40.548786], - deptName: '第一分公司', - area: '1993.75', - long: '12.3', - tyz: '22', - tyx: '25', - well: '87', - rate: '80', - }, - { - name: '怀柔区', - data: huairouData, - center: [116.617155, 40.750918], - deptName: '第五分公司', - area: '2122.8', - long: '32.1', - tyz: '32', - tyx: '32', - well: '89', - rate: '60', - }, - { - name: '密云区', - data: miyunData, - center: [116.952238, 40.53835], - deptName: '第五分公司', - area: '2229.45', - long: '27', - tyz: '30', - tyx: '38', - well: '55', - rate: '67', - }, - { - name: '平谷区', - data: pingguData, - center: [117.139005, 40.222423], - deptName: '第四分公司', - area: '948.24', - long: '56', - tyz: '66', - tyx: '56', - well: '102', - rate: '77', - }, - { - name: '顺义区', - data: shunyiData, - center: [116.702299, 40.163678], - deptName: '第三分公司', - area: '1021', - long: '54', - tyz: '44', - tyx: '44', - well: '122', - rate: '75', - }, - { - name: '昌平区', - data: changpingData, - center: [116.23, 40.22], - deptName: '第三分公司', - area: '1343.5', - long: '69', - tyz: '33', - tyx: '45', - well: '112', - rate: '79', - }, - { - name: '门头沟区', - data: mentougouData, - center: [115.768461, 40.013437], - deptName: '第四分公司', - area: '1447.85', - long: '34', - tyz: '12', - tyx: '12', - well: '41', - rate: '56', - }, - { - name: '石景山区', - data: shijingshanData, - center: [116.16933, 39.941635], - deptName: '第三分公司', - area: '85.74', - long: '22', - tyz: '19', - tyx: '18', - well: '141', - rate: '85', - }, - { - name: '海淀区', - data: haidianData, - center: [116.213366, 40.040809], - deptName: '第三分公司', - area: '430.77', - long: '122', - tyz: '88', - tyx: '90', - well: '231', - rate: '87', - }, - { - name: '朝阳区', - data: chaoyangData, - center: [116.481049, 39.978515], - deptName: '第二分公司', - area: '470.8', - long: '162', - tyz: '100', - tyx: '100', - well: '220', - rate: '89', - }, - { - name: '通州区', - data: tongzhouData, - center: [116.692824, 39.810692], - deptName: '第二分公司', - area: '1193.95', - long: '122', - tyz: '140', - tyx: '140', - well: '200', - rate: '76', - }, - { - name: '东城区', - data: dongchengData, - center: [116.358728, 39.914069], - deptName: '第一分公司', - area: '41.84', - long: '66', - tyz: '230', - tyx: '230', - well: '200', - rate: '98', - }, - { - name: '西城区', - data: xichengData, - center: [116.401798, 39.894739], - deptName: '第一分公司', - area: '50.7', - long: '320', - tyz: '300', - tyx: '290', - well: '400', - rate: '97', - }, - { - name: '丰台区', - data: fengtaiData, - center: [116.179934, 39.846876], - deptName: '第四分公司', - area: '306', - long: '230', - tyz: '111', - tyx: '180', - well: '301', - rate: '66', - }, - { - name: '房山区', - data: fangshanData, - center: [115.757474, 39.738367], - deptName: '第五分公司', - area: '2019', - long: '220', - tyz: '140', - tyx: '146', - well: '209', - rate: '73', - }, - { - name: '大兴区', - data: daxingData, - center: [116.345243, 39.668634], - deptName: '第四分公司', - area: '1036.33', - long: '290', - tyz: '430', - tyx: '340', - well: '279', - rate: '78', - }, -] diff --git a/src/views/home/dashboard/components/noticeDialog.vue b/src/views/home/dashboard/components/noticeDialog.vue deleted file mode 100644 index f27bb53..0000000 --- a/src/views/home/dashboard/components/noticeDialog.vue +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - 查看 - - - - - - - - - - - - diff --git a/src/views/home/dashboard/components/showCard.vue b/src/views/home/dashboard/components/showCard.vue deleted file mode 100644 index 9f61fba..0000000 --- a/src/views/home/dashboard/components/showCard.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - {{ title }} - >>更多 - - - - - - - - - - diff --git a/public/config/config.json b/public/config/config.json index 310124c..0c02bb3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title":"燃气物联感知平台", - "baseUrl": "http://111.198.10.15:11643", + "baseUrl": "http://111.198.10.15:11645", "securityJsCode": "56bf9671d4b3517d294caec4751889a1", "JsKey": "40849e82b4e33f5255b17372520c954d", "xuntengMap": "http://111.198.10.15:11643/getMap?mapPath=http://172.17.206.70:20198/_allLayer/tile", diff --git a/src/api/index.ts b/src/api/index.ts index 2501205..6ef01b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ enum responseCode { success = 200, // 成功 noPermission = 401, // 未授权 - error = 500, // 服务器异常 + error = 500 // 服务器异常 } // 以下地址发生错误直接跳转至登录页 const toLoginPath = ['/sys/user/permission', '/sys/user/info'] @@ -18,56 +18,56 @@ router.push({ path: '/login', query: { - redirect: router.currentRoute.value.path !== '/login' ? router.currentRoute.value.fullPath : undefined, - }, + redirect: + router.currentRoute.value.path !== '/login' + ? router.currentRoute.value.fullPath + : undefined + } }) } const request = axios.create({ - baseURL: window.localStorage.getItem('url-bj-well') as string, + baseURL: window.localStorage.getItem('BaseUrl') as string, // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60 * 3, - responseType: 'json', + responseType: 'json' }) -request.interceptors.request.use( - (request) => { - const userStore = useUserStore() - /** - * 全局拦截请求发送前提交的参数 - * 以下代码为示例,在请求头里带上 token 信息 - */ - if (userStore.isLogin && request.headers) { - request.headers.token = userStore.token - } - // 是否将 POST 请求参数进行字符串化处理 - if (request.method === 'post') { - // request.data = qs.stringify(request.data, { - // arrayFormat: 'brackets', - // }) - } - return request - }, -) +request.interceptors.request.use(request => { + const userStore = useUserStore() + /** + * 全局拦截请求发送前提交的参数 + * 以下代码为示例,在请求头里带上 token 信息 + */ + if (userStore.isLogin && request.headers) { + request.headers.token = userStore.token + } + // 是否将 POST 请求参数进行字符串化处理 + if (request.method === 'post') { + // request.data = qs.stringify(request.data, { + // arrayFormat: 'brackets', + // }) + } + return request +}) request.interceptors.response.use( - (response) => { + response => { /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 如果是文件直接返回整个response对象 */ if (response.data instanceof Blob) { return Promise.resolve(response) - } - else if (response.data.code !== responseCode.success) { - if (response.data.code === responseCode.noPermission) { // token失效状态跳转到登录页 + } else if (response.data.code !== responseCode.success) { + if (response.data.code === responseCode.noPermission) { + // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { ElMessage.error(response.data.message || '发生错误') } useUserStore().toLogout() - } - else { + } else { // 这里做错误提 ElMessage.error(`${response.data.message}` || '发生错误') const loadingInstance = ElLoading.service({}) @@ -78,12 +78,12 @@ } return Promise.reject(response.data) - } - else { // 成功 + } else { + // 成功 return Promise.resolve(response.data) } }, - (error) => { + error => { // 处理文件下载的错误提示 if (error.response && error.response.data instanceof Blob) { error.response.data.text().then((res: any) => { @@ -97,40 +97,37 @@ // } // ElMessage.error(errMsg) // } - } - else if (error.response && error.response.data) { + } else if (error.response && error.response.data) { // 如果是发生错误必须回到登录页的api - const needLogin = toLoginPath.findIndex(path => error.request.responseURL.includes(path)) + const needLogin = toLoginPath.findIndex(path => + error.request.responseURL.includes(path) + ) if (needLogin > -1) { toLogin() - } - else { + } else { const message: string = error.response.data.message ElMessage({ message, - type: 'error', + type: 'error' }) } - } - else if (error.message) { + } else if (error.message) { let message = error.message if (message === 'Network Error') { message = '后端网络故障' - } - else if (message.includes('timeout')) { + } else if (message.includes('timeout')) { message = '接口请求超时' - } - else if (message.includes('Request failed with status code')) { + } else if (message.includes('Request failed with status code')) { message = `接口${message.substr(message.length - 3)}异常` } ElMessage({ message, - type: 'error', + type: 'error' }) } return Promise.reject(error) - }, + } ) export default request diff --git a/src/assets/images/login-bg.png b/src/assets/images/login-bg.png deleted file mode 100644 index 67c02c9..0000000 --- a/src/assets/images/login-bg.png +++ /dev/null Binary files differ diff --git a/src/assets/images/login-image/login-bg.png b/src/assets/images/login-image/login-bg.png new file mode 100644 index 0000000..67c02c9 --- /dev/null +++ b/src/assets/images/login-image/login-bg.png Binary files differ diff --git a/src/assets/images/login-image/logo.png b/src/assets/images/login-image/logo.png new file mode 100644 index 0000000..f3db083 --- /dev/null +++ b/src/assets/images/login-image/logo.png Binary files differ diff --git a/src/assets/images/login-image/smallBg.png b/src/assets/images/login-image/smallBg.png new file mode 100644 index 0000000..cfc2658 --- /dev/null +++ b/src/assets/images/login-image/smallBg.png Binary files differ diff --git a/src/assets/images/login-image/whiteBg.png b/src/assets/images/login-image/whiteBg.png new file mode 100644 index 0000000..0c244b8 --- /dev/null +++ b/src/assets/images/login-image/whiteBg.png Binary files differ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index a7824b6..c8923ec 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -6,7 +6,6 @@ import { getDeptTreeList } from '@/api/system/dept' import { judgeTree, toTreeList } from '@/utils/structure' import indexDB from '@/utils/indexDB' -import { indexDBHandler } from '@/utils/sessionData' const props = defineProps({ // 数据绑定 modelValue: { @@ -71,7 +70,6 @@ const fetch = () => { getDeptTreeList().then((res) => { const list = res.data.filter((item: any) => item.id !== '0') - indexDBHandler('all-dept-list', JSON.stringify(res.data)) dictStore.setAllDeptList(list) refreshList(list) console.log(list, 'list') @@ -80,17 +78,7 @@ // 如果未指定需要展示的部门类型,获取全部部门 if (!props.deptType) { // if (dictStore.allDeptList.length === 0) { // 如果store中未存储,从服务器上获取 - indexDB.getAll().then(allData => { - if (allData.filter((item: any) => item.name === 'all-dept-list').length) { - const list = JSON.parse(allData.filter((item: any) => item.name === 'all-dept-list')[0].data).filter((item: any) => item.id !== '0') - refreshList(list) - } - else { - fetch() - } - }).catch(() => { - fetch() - }) + fetch() // } // else { // refreshList(dictStore.allDeptList) diff --git a/src/layouts/components/Tools/alarmDialog.vue b/src/layouts/components/Tools/alarmDialog.vue index ab01ebc..e378ecf 100644 --- a/src/layouts/components/Tools/alarmDialog.vue +++ b/src/layouts/components/Tools/alarmDialog.vue @@ -37,7 +37,7 @@ // 关闭声音 const { proxy } = getCurrentInstance() as any const closeSound = () => { - proxy.pauseAudio() + // proxy.pauseAudio() localStorage.setItem('eventAudio', 'pause') } // 查看 diff --git a/src/layouts/components/Tools/alarmList.vue b/src/layouts/components/Tools/alarmList.vue index 2c073d1..4888bc9 100644 --- a/src/layouts/components/Tools/alarmList.vue +++ b/src/layouts/components/Tools/alarmList.vue @@ -1,8 +1,6 @@ - - - { }"> - - - - - {{ info?.alarmType }} - - - × - - - - - 报警时间: - - - {{ info?.alarmTime }} - - - - - 报警原因: - - - {{ info?.alarmContent }} - - - - - 位置: - - - - {{ info?.address }} - - - - - 详细地址: - - - {{ info?.position }} - - - - - 管理单位: - - - {{ info?.deptName }} - - - - - 产权单位: - - - {{ info?.propertyOwner }} - - - - - 管理方式: - - - {{ info?.manageType }} - - - - - - - - diff --git a/src/views/home/dashboard/components/controlMap.vue b/src/views/home/dashboard/components/controlMap.vue deleted file mode 100644 index beea45e..0000000 --- a/src/views/home/dashboard/components/controlMap.vue +++ /dev/null @@ -1,3095 +0,0 @@ - - - - - - - - - - 智控区 - - - 行政区 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - - - - {{ item.name }} - - - - - - - - - {{ item.name }} - - - - - - -::v-deep(.el-loading-mask) { - background-color: rgba($color: #0b0b0f, $alpha: 95%); -} - -.show-count { - position: absolute; - z-index: 9; - left: 400px; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - // right: 400px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.legend { - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - position: absolute; - z-index: 1; - bottom: 10px; - // left: 400px; - left: 21%; - padding: 10px; - // border-radius: 3px; - border: 1px solid #249eff; - color: #fff; - - .legend-item { - margin: 10px 0; - // font-weight: 700; - display: flex; - align-items: center; - - .img { - width: 20px; - height: 20px; - } - - &:hover { - cursor: pointer; - } - } -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // left: 400px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - // right: 400px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 1px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 20px; - width: 20px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/src/views/home/dashboard/components/demonstration.vue b/src/views/home/dashboard/components/demonstration.vue deleted file mode 100644 index f9c4f14..0000000 --- a/src/views/home/dashboard/components/demonstration.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - {{ $props.data.name }} - - - - 设备类型: - - - {{ $props.data.type }} - - - - - 设备编号: - - - {{ }} - - - - - 厂商: - - - 北京无线电计量测试研究所 - - - - - 负责人: - - - {{ }} - - - - - 联系方式: - - - - - - 管理单位: - - - 第一分公司 - - - - - 详细位置: - - - - - - - - - - - diff --git a/src/views/home/dashboard/components/detailInfoDialog.vue b/src/views/home/dashboard/components/detailInfoDialog.vue deleted file mode 100644 index c8eff74..0000000 --- a/src/views/home/dashboard/components/detailInfoDialog.vue +++ /dev/null @@ -1,137 +0,0 @@ - - - - - { }"> - - × - - - - - - - - - - diff --git a/src/views/home/dashboard/components/eventMap.vue b/src/views/home/dashboard/components/eventMap.vue deleted file mode 100644 index 7c6f5af..0000000 --- a/src/views/home/dashboard/components/eventMap.vue +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - -.show-count { - position: absolute; - z-index: 9; - left: 21%; - top: 100px; - width: 240px; -} - -.show-change { - position: absolute; - top: 100px; - right: 21%; - z-index: 9; - // background-color: #ddd; - - .change { - padding: 10px 20px; - text-align: center; - background: url("@/assets/fullscren/data-bg.png") no-repeat center center / cover; - border: 1px solid #249eff; - color: #fff; - - &:hover { - cursor: pointer; - } - } -} - -.left-container { - position: absolute; - z-index: 9; - top: 100px; - left: 15px; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.right-container { - position: absolute; - z-index: 9; - top: 100px; - right: 15px; - // background-color: #0b0b0f; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); -} - -.amap-legend1 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - left: 21%; - /* background: rgb(68 66 66 / 80%); */ - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - border: 2px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 16px; - line-height: 16px; - - &:hover { - cursor: pointer; - } - } - } -} - -.amap-legend2 { - /* background: url("@/assets/images/dashboard/legend.png") no-repeat center center / cover; */ - position: absolute; - z-index: 9; - bottom: 10px; - right: 21%; - background-color: rgba($color: #0B0B0F, $alpha: 0.8); - - border: 2px solid #249eff; - color: #fff; - padding: 10px; - - .legend-item { - display: flex; - margin: 5px; - flex-wrap: wrap; - color: #a7ceec; - - // .icon { - // height: 20px; - // width: 20px; - // border-radius: 50%; - // opacity: 0.8; - // } - img { - height: 16px; - width: 16px; - } - - .value { - margin-left: 5px; - height: 20px; - line-height: 20px; - - &:hover { - cursor: pointer; - } - } - } -} - - - diff --git a/src/views/home/dashboard/components/fullScreen-bak.vue b/src/views/home/dashboard/components/fullScreen-bak.vue deleted file mode 100644 index ffb82cc..0000000 --- a/src/views/home/dashboard/components/fullScreen-bak.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - diff --git a/src/views/home/dashboard/components/imgData.ts b/src/views/home/dashboard/components/imgData.ts deleted file mode 100644 index ee2cf8a..0000000 --- a/src/views/home/dashboard/components/imgData.ts +++ /dev/null @@ -1,25 +0,0 @@ -export const img = { - bjtj: new URL('@/assets/images/dashboard/bjtj.png', import.meta.url), - czjc: new URL('@/assets/images/dashboard/czjc.png', import.meta.url), - dqbj: new URL('@/assets/images/dashboard/dqbj.png', import.meta.url), - guanxian: new URL('@/assets/images/dashboard/guanxian.png', import.meta.url), - gxjc: new URL('@/assets/images/dashboard/gxjc.png', import.meta.url), - lixian: new URL('@/assets/images/dashboard/lixian.png', import.meta.url), - ssgl: new URL('@/assets/images/dashboard/ssgl.png', import.meta.url), - - tiaoya: new URL('@/assets/images/dashboard/tiaoya.png', import.meta.url), - tingyong: new URL('@/assets/images/dashboard/tingyong.png', import.meta.url), - well: new URL('@/assets/images/dashboard/well.png', import.meta.url), - zaixian: new URL('@/assets/images/dashboard/zaixian.png', import.meta.url), - zjjc: new URL('@/assets/images/dashboard/zjjc.png', import.meta.url), - - fm: new URL('@/assets/images/dashboard/fm.png', import.meta.url), - tyz: new URL('@/assets/images/dashboard/tyz.png', import.meta.url), - tyx: new URL('@/assets/images/dashboard/tyx.png', import.meta.url), - zy: new URL('@/assets/images/dashboard/zy.png', import.meta.url), - dy: new URL('@/assets/images/dashboard/dy.png', import.meta.url), - shaobing: new URL('@/assets/images/dashboard/shaobing.png', import.meta.url), - yuntai: new URL('@/assets/images/dashboard/yuntai.png', import.meta.url), - ranqi: new URL('@/assets/images/dashboard/ranqi.png', import.meta.url), - alarm: new URL('@/assets/images/spread.gif', import.meta.url), -} diff --git a/src/views/home/dashboard/components/mapData.ts b/src/views/home/dashboard/components/mapData.ts deleted file mode 100644 index ab7e0c3..0000000 --- a/src/views/home/dashboard/components/mapData.ts +++ /dev/null @@ -1,230 +0,0 @@ -// 北京各个区坐标数据 // 取数据地址https://datav.aliyun.com/portal/school/atlas/area_selector#&lat=30.332329214580188&lng=106.72278672066881&zoom=3.5 -import yanqing from '@/assets/map/yanqing.json' -import huairou from '@/assets/map/huairou.json' -import miyun from '@/assets/map/miyun.json' -import pinggu from '@/assets/map/pinggu.json' -import shunyi from '@/assets/map/shunyi.json' -import changping from '@/assets/map/changping.json' -import mentougou from '@/assets/map/mentougou.json' -import shijingshan from '@/assets/map/shijingshan.json' -import haidian from '@/assets/map/haidian.json' -import chaoyang from '@/assets/map/chaoyang.json' -import tongzhou from '@/assets/map/tongzhou.json' -import dongcheng from '@/assets/map/dongcheng.json' -import xicheng from '@/assets/map/xicheng.json' -import fengtai from '@/assets/map/fengtai.json' -import fangshan from '@/assets/map/fangshan.json' -import daxing from '@/assets/map/daxing.json' -import demonstration from '@/assets/map/95.json' -const yanqingData = yanqing.features[0].geometry.coordinates -const huairouData = huairou.features[0].geometry.coordinates -const miyunData = miyun.features[0].geometry.coordinates -const pingguData = pinggu.features[0].geometry.coordinates -const shunyiData = shunyi.features[0].geometry.coordinates -const changpingData = changping.features[0].geometry.coordinates -const mentougouData = mentougou.features[0].geometry.coordinates -const shijingshanData = shijingshan.features[0].geometry.coordinates -const haidianData = haidian.features[0].geometry.coordinates -const chaoyangData = chaoyang.features[0].geometry.coordinates -const tongzhouData = tongzhou.features[0].geometry.coordinates -const dongchengData = dongcheng.features[0].geometry.coordinates -const xichengData = xicheng.features[0].geometry.coordinates -const fengtaiData = fengtai.features[0].geometry.coordinates -const fangshanData = fangshan.features[0].geometry.coordinates -const daxingData = daxing.features[0].geometry.coordinates -export const demonstrationData = demonstration.features[0].geometry.coordinates - -export const mapData = [ - { - name: '延庆区', - data: yanqingData, - center: [116.161222, 40.548786], - deptName: '第一分公司', - area: '1993.75', - long: '12.3', - tyz: '22', - tyx: '25', - well: '87', - rate: '80', - }, - { - name: '怀柔区', - data: huairouData, - center: [116.617155, 40.750918], - deptName: '第五分公司', - area: '2122.8', - long: '32.1', - tyz: '32', - tyx: '32', - well: '89', - rate: '60', - }, - { - name: '密云区', - data: miyunData, - center: [116.952238, 40.53835], - deptName: '第五分公司', - area: '2229.45', - long: '27', - tyz: '30', - tyx: '38', - well: '55', - rate: '67', - }, - { - name: '平谷区', - data: pingguData, - center: [117.139005, 40.222423], - deptName: '第四分公司', - area: '948.24', - long: '56', - tyz: '66', - tyx: '56', - well: '102', - rate: '77', - }, - { - name: '顺义区', - data: shunyiData, - center: [116.702299, 40.163678], - deptName: '第三分公司', - area: '1021', - long: '54', - tyz: '44', - tyx: '44', - well: '122', - rate: '75', - }, - { - name: '昌平区', - data: changpingData, - center: [116.23, 40.22], - deptName: '第三分公司', - area: '1343.5', - long: '69', - tyz: '33', - tyx: '45', - well: '112', - rate: '79', - }, - { - name: '门头沟区', - data: mentougouData, - center: [115.768461, 40.013437], - deptName: '第四分公司', - area: '1447.85', - long: '34', - tyz: '12', - tyx: '12', - well: '41', - rate: '56', - }, - { - name: '石景山区', - data: shijingshanData, - center: [116.16933, 39.941635], - deptName: '第三分公司', - area: '85.74', - long: '22', - tyz: '19', - tyx: '18', - well: '141', - rate: '85', - }, - { - name: '海淀区', - data: haidianData, - center: [116.213366, 40.040809], - deptName: '第三分公司', - area: '430.77', - long: '122', - tyz: '88', - tyx: '90', - well: '231', - rate: '87', - }, - { - name: '朝阳区', - data: chaoyangData, - center: [116.481049, 39.978515], - deptName: '第二分公司', - area: '470.8', - long: '162', - tyz: '100', - tyx: '100', - well: '220', - rate: '89', - }, - { - name: '通州区', - data: tongzhouData, - center: [116.692824, 39.810692], - deptName: '第二分公司', - area: '1193.95', - long: '122', - tyz: '140', - tyx: '140', - well: '200', - rate: '76', - }, - { - name: '东城区', - data: dongchengData, - center: [116.358728, 39.914069], - deptName: '第一分公司', - area: '41.84', - long: '66', - tyz: '230', - tyx: '230', - well: '200', - rate: '98', - }, - { - name: '西城区', - data: xichengData, - center: [116.401798, 39.894739], - deptName: '第一分公司', - area: '50.7', - long: '320', - tyz: '300', - tyx: '290', - well: '400', - rate: '97', - }, - { - name: '丰台区', - data: fengtaiData, - center: [116.179934, 39.846876], - deptName: '第四分公司', - area: '306', - long: '230', - tyz: '111', - tyx: '180', - well: '301', - rate: '66', - }, - { - name: '房山区', - data: fangshanData, - center: [115.757474, 39.738367], - deptName: '第五分公司', - area: '2019', - long: '220', - tyz: '140', - tyx: '146', - well: '209', - rate: '73', - }, - { - name: '大兴区', - data: daxingData, - center: [116.345243, 39.668634], - deptName: '第四分公司', - area: '1036.33', - long: '290', - tyz: '430', - tyx: '340', - well: '279', - rate: '78', - }, -] diff --git a/src/views/home/dashboard/components/noticeDialog.vue b/src/views/home/dashboard/components/noticeDialog.vue deleted file mode 100644 index f27bb53..0000000 --- a/src/views/home/dashboard/components/noticeDialog.vue +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - 查看 - - - - - - - - - - - - diff --git a/src/views/home/dashboard/components/showCard.vue b/src/views/home/dashboard/components/showCard.vue deleted file mode 100644 index 9f61fba..0000000 --- a/src/views/home/dashboard/components/showCard.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - {{ title }} - >>更多 - - - - - - - - - - diff --git a/src/views/login.vue b/src/views/login.vue index 724b5d3..5c360a3 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -194,7 +194,7 @@ }) onMounted(() => { // 暂停播放报警声音 - proxy.pauseAudio() + // proxy.pauseAudio() localStorage.setItem('eventAudio', 'pause') // 清空面包屑 menuStore.resetBreadcrumb() @@ -203,118 +203,73 @@ - + - - - - 用户登录 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 记住我 - - - - 登录 - - - 演示账号一键登录 - - admin + + + 欢迎访问机器狗巡检平台 + + + + + + + 登录 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 记住我 + + + + 登录 - - test - - - + +