diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a752d --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +**/*.log + +tests/**/coverage/ +tests/e2e/reports +selenium-debug.log + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.local + +package-lock.json +yarn.lock diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..e955840 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,5 @@ +module.exports = { + presets: [ + '@vue/cli-plugin-babel/preset' + ] +} diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..4aafc5f --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "esnext", + "baseUrl": "./", + "moduleResolution": "node", + "paths": { + "@/*": [ + "src/*" + ] + }, + "lib": [ + "esnext", + "dom", + "dom.iterable", + "scripthost" + ] + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..936a154 --- /dev/null +++ b/package.json @@ -0,0 +1,35 @@ +{ + "name": "inspection-website", + "version": "0.1.0", + "private": true, + "scripts": { + "serve": "vue-cli-service serve", + "build": "vue-cli-service build" + }, + "dependencies": { + "axios": "^1.6.8", + "core-js": "^3.8.3", + "element-plus": "^2.7.2", + "lib-flexible": "^0.3.2", + "vue": "^3.2.13", + "vue_pageination": "^1.1.2", + "vue-quill-editor": "^3.0.6", + "vue-router": "^4.0.3", + "vuex": "^4.0.0" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "~5.0.0", + "@vue/cli-plugin-router": "~5.0.0", + "@vue/cli-plugin-vuex": "~5.0.0", + "@vue/cli-service": "~5.0.0", + "sass": "^1.32.7", + "sass-loader": "^12.0.0", + "swiper": "^3.4.2" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not dead", + "not ie 11" + ] +} diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..660c423 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..c35c98e --- /dev/null +++ b/public/index.html @@ -0,0 +1,17 @@ + + + + + + + + 中业消防 + + + +
+ + + diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..bbc26b9 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,29 @@ + + + diff --git a/src/assets/css/common.css b/src/assets/css/common.css new file mode 100644 index 0000000..05daef6 --- /dev/null +++ b/src/assets/css/common.css @@ -0,0 +1,19 @@ +.videoPlayer{ + position: absolute; + top: 0; + width: 100%; + height: 100%; + object-fit: fill; + z-index: -999; +} +.haixing{ + position: absolute; + width: 8.225rem; + height: 5.825rem; + bottom:0; + right:0; + z-index: -998; +} +.style-en{ + letter-spacing: .0063rem; +} \ No newline at end of file diff --git a/src/assets/css/reset.css b/src/assets/css/reset.css new file mode 100644 index 0000000..273548f --- /dev/null +++ b/src/assets/css/reset.css @@ -0,0 +1,175 @@ +html, +body { + height: 100%; + /* 文字风格 Sans-serif 各笔画粗细相同,Serif 笔画粗细不同,monospace 等宽体,cursive草书,fantasy梦幻 */ + font-family: 'Microsoft YaHei', sans-serif, 'Helvetica Neue', Helvetica, Arial, + '黑体', '宋体', Arial; + -webkit-tap-highlight-color: transparent; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +body { + +} +/* 重置各标签的默认样式 */ +a, +body, +center, +cite, +code, +dd, +del, +div, +dl, +dt, +em, +fieldset, +figcaption, +figure, +footer, +form, +h1, +h2, +h3, +h4, +h5, +h6, +header, +hr, +html, +img, +input, +label, +legend, +li, +mark, +ol, +p, +section, +span, +textarea, +time, +td, +th, +ul { + margin: 0; + border: 0; + padding: 0; + font-style: normal; + box-sizing: border-box; + /* 自动换行 */ + word-wrap: break-word; + /* 强制英文单词断行 */ + word-break: break-all; +} + +/* 设置标签为块级分类 */ +article, +aside, +details, +fieldset, +figcaption, +figure, +footer, +header, +main, +nav, +section { + display: block; +} + +/* 去除input标签的默认样式 */ +button, +input, +textarea { + -webkit-appearance: none; + font-family: 'Microsoft YaHei', sans-serif, 'Helvetica Neue', Helvetica, Arial, + '黑体', '宋体', Arial; + border: 0; + margin: 0; + padding: 0; + font-size: 1em; + line-height: 1em; + outline: none; + background-color: transparent; +} + +/* 禁止多文本框手动拖动大小 */ +textarea { + resize: none; + -webkit-appearance: none; +} + +/* 去掉按下的阴影盒子 */ +input, +textarea, +a { + -webkit-tap-highlight-color: transparent; +} + +/* 清除a标签下划线 */ +a, +a:visited { + text-decoration: none; +} +a:focus, +a:active, +a:hover { + outline: none; +} + +/* 清除列表前面的点 */ +ol, +li, +ul { + list-style: none; +} + +/* 清除IE下图片的边框 */ +img { + border-style: none; + font-size: 0; +} + +/* 解决chrome浏览器默认黄色背景问题 */ +input:-webkit-autofill, +textarea:-webkit-autofill, +select:-webkit-autofill { + -webkit-box-shadow: 0 0 0 1000px #fff inset; +} + +/* 设置默认滚动条样式 */ +::-webkit-input-placeholder { + color: #afbdcc; +} +:-moz-placeholder { + color: #afbdcc; +} +::-moz-placeholder { + color: #afbdcc; +} +:-ms-input-placeholder { + color: #afbdcc; +} +::-webkit-scrollbar { + width: 6px; + height: 6px; +} +::-webkit-scrollbar-track { + background-color: #f5f5f5; +} +::-webkit-scrollbar-track-piece { + background-color: #f5f5f5; + border-radius: 6px; +} +::-webkit-scrollbar-thumb { + background-color: #cccccc; + border-radius: 6px; +} +::-webkit-scrollbar-corner { + background-color: #f5f5f5; +} +::-webkit-resizer { + background-repeat: no-repeat; + background-position: bottom right; +} \ No newline at end of file diff --git a/src/assets/images/1.png b/src/assets/images/1.png new file mode 100644 index 0000000..49c39ff Binary files /dev/null and b/src/assets/images/1.png differ diff --git a/src/assets/images/11后红崖.jpg b/src/assets/images/11后红崖.jpg new file mode 100644 index 0000000..4df0ee8 Binary files /dev/null and b/src/assets/images/11后红崖.jpg differ diff --git a/src/assets/images/15探海神龟.jpg b/src/assets/images/15探海神龟.jpg new file mode 100644 index 0000000..9f47111 Binary files /dev/null and b/src/assets/images/15探海神龟.jpg differ diff --git a/src/assets/images/33@2x.png b/src/assets/images/33@2x.png new file mode 100644 index 0000000..5fe821d Binary files /dev/null and b/src/assets/images/33@2x.png differ diff --git a/src/assets/images/_M2A3823.png b/src/assets/images/_M2A3823.png new file mode 100644 index 0000000..1af4249 Binary files /dev/null and b/src/assets/images/_M2A3823.png differ diff --git a/src/assets/images/企业介绍(1).png b/src/assets/images/企业介绍(1).png new file mode 100644 index 0000000..23a2e07 Binary files /dev/null and b/src/assets/images/企业介绍(1).png differ diff --git a/src/assets/images/水上摩托.jpg b/src/assets/images/水上摩托.jpg new file mode 100644 index 0000000..c322133 Binary files /dev/null and b/src/assets/images/水上摩托.jpg differ diff --git a/src/assets/images/组 10.png b/src/assets/images/组 10.png new file mode 100644 index 0000000..001b655 Binary files /dev/null and b/src/assets/images/组 10.png differ diff --git a/src/assets/images/组 11 (1).png b/src/assets/images/组 11 (1).png new file mode 100644 index 0000000..40c2d6d Binary files /dev/null and b/src/assets/images/组 11 (1).png differ diff --git a/src/assets/images/组 11.png b/src/assets/images/组 11.png new file mode 100644 index 0000000..cd326b9 Binary files /dev/null and b/src/assets/images/组 11.png differ diff --git a/src/assets/images/组 12.png b/src/assets/images/组 12.png new file mode 100644 index 0000000..f7ec50b Binary files /dev/null and b/src/assets/images/组 12.png differ diff --git a/src/assets/images/组 21 拷贝.png b/src/assets/images/组 21 拷贝.png new file mode 100644 index 0000000..56f9a73 Binary files /dev/null and b/src/assets/images/组 21 拷贝.png differ diff --git a/src/assets/images/组织架构管理.png b/src/assets/images/组织架构管理.png new file mode 100644 index 0000000..4641ed0 Binary files /dev/null and b/src/assets/images/组织架构管理.png differ diff --git a/src/assets/images/资质.png b/src/assets/images/资质.png new file mode 100644 index 0000000..0f419c0 Binary files /dev/null and b/src/assets/images/资质.png differ diff --git a/src/components/bottom.vue b/src/components/bottom.vue new file mode 100644 index 0000000..f09a760 --- /dev/null +++ b/src/components/bottom.vue @@ -0,0 +1,50 @@ + + + + + \ No newline at end of file diff --git a/src/lib/lib-flexible/flexible.js b/src/lib/lib-flexible/flexible.js new file mode 100644 index 0000000..832560f --- /dev/null +++ b/src/lib/lib-flexible/flexible.js @@ -0,0 +1,119 @@ + +;(function(win, lib) { + var doc = win.document; + var docEl = doc.documentElement; + var metaEl = doc.querySelector('meta[name="viewport"]'); + var flexibleEl = doc.querySelector('meta[name="flexible"]'); + var dpr = 0; + var scale = 0; + var tid; + var flexible = lib.flexible || (lib.flexible = {}); + if (metaEl) { + console.warn('将根据已有的meta标签来设置缩放比例'); + var match = metaEl.getAttribute('content').match(/initial\-scale=([\d\.]+)/); + if (match) { + scale = parseFloat(match[1]); + dpr = parseInt(1 / scale); + } + } else if (flexibleEl) { + var content = flexibleEl.getAttribute('content'); + if (content) { + var initialDpr = content.match(/initial\-dpr=([\d\.]+)/); + var maximumDpr = content.match(/maximum\-dpr=([\d\.]+)/); + if (initialDpr) { + dpr = parseFloat(initialDpr[1]); + scale = parseFloat((1 / dpr).toFixed(2)); + } + if (maximumDpr) { + dpr = parseFloat(maximumDpr[1]); + scale = parseFloat((1 / dpr).toFixed(2)); + } + } + } + + if (!dpr && !scale) { + // var isAndroid = win.navigator.appVersion.match(/android/gi);yy + var isIPhone = win.navigator.appVersion.match(/iphone/gi); + var devicePixelRatio = win.devicePixelRatio; + if (isIPhone) { + // iOS下,对于2和3的屏,用2倍的方案,其余的用1倍方案 + if (devicePixelRatio >= 3 && (!dpr || dpr >= 3)) { + dpr = 3; + } else if (devicePixelRatio >= 2 && (!dpr || dpr >= 2)){ + dpr = 2; + } else { + dpr = 1; + } + } else { + // 其他设备下,仍旧使用1倍的方案 + dpr = 1; + } + scale = 1 / dpr; + } + + docEl.setAttribute('data-dpr', dpr); + if (!metaEl) { + metaEl = doc.createElement('meta'); + metaEl.setAttribute('name', 'viewport'); + metaEl.setAttribute('content', 'initial-scale=' + scale + ', maximum-scale=' + scale + ', minimum-scale=' + scale + ', user-scalable=no'); + if (docEl.firstElementChild) { + docEl.firstElementChild.appendChild(metaEl); + } else { + var wrap = doc.createElement('div'); + wrap.appendChild(metaEl); + doc.write(wrap.innerHTML); + } + } + + function refreshRem(){ + var width = docEl.getBoundingClientRect().width; + if (width / dpr > 540) { + width = width * dpr; + + } + var rem = width / 24; + + docEl.style.fontSize = rem + 'px'; + flexible.rem = win.rem = rem; + } + + win.addEventListener('resize', function() { + clearTimeout(tid); + tid = setTimeout(refreshRem, 300); + }, false); + win.addEventListener('pageshow', function(e) { + if (e.persisted) { + clearTimeout(tid); + tid = setTimeout(refreshRem, 300); + } + }, false); + + if (doc.readyState === 'complete') { + doc.body.style.fontSize = 12 * dpr + 'px'; + } else { + doc.addEventListener('DOMContentLoaded', function(e) { + doc.body.style.fontSize = 12 * dpr + 'px'; + }, false); + } + + + refreshRem(); + + flexible.dpr = win.dpr = dpr; + flexible.refreshRem = refreshRem; + flexible.rem2px = function(d) { + var val = parseFloat(d) * this.rem; + if (typeof d === 'string' && d.match(/rem$/)) { + val += 'px'; + } + return val; + } + flexible.px2rem = function(d) { + var val = parseFloat(d) / this.rem; + if (typeof d === 'string' && d.match(/px$/)) { + val += 'rem'; + } + return val; + } + +})(window, window['lib'] || (window['lib'] = {})); diff --git a/src/lib/lib-flexible/package.json b/src/lib/lib-flexible/package.json new file mode 100644 index 0000000..662d589 --- /dev/null +++ b/src/lib/lib-flexible/package.json @@ -0,0 +1,14 @@ +{ + "name": "lib-flexible", + "version": "0.3.2", + "description": "移动端适配解决方案", + "main": "flexible.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [ + "适配" + ], + "author": "", + "license": "ISC" +} diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..357a0cb --- /dev/null +++ b/src/main.js @@ -0,0 +1,28 @@ +import {createApp} from 'vue' +import App from './App.vue' +import router from './router' +import './assets/css/reset.css' +import './assets/css/common.css' +import 'quill/dist/quill.core.css' +import 'quill/dist/quill.snow.css' +import 'quill/dist/quill.bubble.css' +import './lib/lib-flexible' + +import axios from 'axios' + +import ElementPlus from 'element-plus' +import 'element-plus/dist/index.css' + + + + +const app = createApp(App) +const baseUrl = 'https://admin.liandaojq.com/prod-api' +axios.defaults.baseURL = baseUrl + +app.config.globalProperties.$http=axios +app.config.globalProperties.$baseUrl = baseUrl +app.use(router).use(ElementPlus).mount('#app') + + + diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 0000000..2fb1a7d --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,78 @@ +import { createRouter, createWebHistory } from 'vue-router' + +const routes = [ + { + path: '/', + name: 'index', + component: () => import( '@/views/index.vue'), + children:[ + // 首页 + { + path: 'home', + name: 'Home', + component: () => import( '@/views/pages/home.vue'), + meta: { + title: '首页', + keepAlive: true + } + }, + // 走进中业 + { + path: 'introduce', + name: 'Introduce', + component: () => import( '@/views/pages/introduce.vue'), + meta: { + title: '走进中业', + keepAlive: true + } + }, + // 走进中业 + { + path: 'information', + name: 'Information', + component: () => import( '@/views/pages/information.vue'), + meta: { + title: '资讯中心', + keepAlive: true + } + }, + // 资质证书 + { + path: 'honor', + name: 'honor', + component: () => import( '@/views/pages/honor.vue'), + meta: { + title: '资讯中心', + keepAlive: true + } + }, + // 资质证书 + { + path: 'cases', + name: 'cases', + component: () => import( '@/views/pages/cases.vue'), + meta: { + title: '资讯中心', + keepAlive: true + } + }, + // 资质证书 + { + path: 'recruit', + name: 'recruit', + component: () => import( '@/views/pages/recruit.vue'), + meta: { + title: '人才招聘', + keepAlive: true + } + } + ] + }, +] + +const router = createRouter({ + history: createWebHistory(process.env.BASE_URL), + routes +}) + +export default router diff --git a/src/utils/request.js b/src/utils/request.js new file mode 100644 index 0000000..27539d4 --- /dev/null +++ b/src/utils/request.js @@ -0,0 +1,136 @@ +import axios from 'axios' +// import { Notification, MessageBox, Message, Loading } from 'element-ui' +// import store from '@/store' +// import { getToken } from '@/utils/auth' +// import errorCode from '@/utils/errorCode' +// import { tansParams, blobValidate } from "@/utils/ruoyi"; +// import cache from '@/plugins/cache' +// import { saveAs } from 'file-saver' + + +axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' +// 创建axios实例 +const service = axios.create({ + // axios中请求配置有baseURL选项,表示请求URL公共部分 + baseURL: process.env.VUE_APP_BASE_API, + // 超时 + timeout: 30000 +}) + +// request拦截器 +service.interceptors.request.use(config => { + // 是否需要设置 token + if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { + const requestObj = { + url: config.url, + data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data, + time: new Date().getTime() + } + const requestSize = Object.keys(JSON.stringify(requestObj)).length; // 请求数据大小 + const limitSize = 5 * 1024 * 1024; // 限制存放数据5M + if (requestSize >= limitSize) { + console.warn(`[${config.url}]: ` + '请求数据大小超出允许的5M限制,无法进行防重复提交验证。') + return config; + } + const sessionObj = cache.session.getJSON('sessionObj') + if (sessionObj === undefined || sessionObj === null || sessionObj === '') { + cache.session.setJSON('sessionObj', requestObj) + } else { + const s_url = sessionObj.url; // 请求地址 + const s_data = sessionObj.data; // 请求数据 + const s_time = sessionObj.time; // 请求时间 + const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交 + if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { + const message = '数据正在处理,请勿重复提交'; + console.warn(`[${s_url}]: ` + message) + return Promise.reject(new Error(message)) + } else { + cache.session.setJSON('sessionObj', requestObj) + } + } + } + return config +}, error => { + console.log(error) + Promise.reject(error) +}) + +// 响应拦截器 +service.interceptors.response.use(res => { + // 未设置状态码则默认成功状态 + const code = res.data.code || 200; + // 获取错误信息 + const msg = errorCode[code] || res.data.msg || errorCode['default'] + // 二进制数据则直接返回 + if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { + return res.data + } + if (code === 401) { + if (!isRelogin.show) { + isRelogin.show = true; + MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { + isRelogin.show = false; + store.dispatch('LogOut').then(() => { + location.href = '/index'; + }) + }).catch(() => { + isRelogin.show = false; + }); + } + return Promise.reject('无效的会话,或者会话已过期,请重新登录。') + } else if (code === 500) { + Message({ message: msg, type: 'error' }) + return Promise.reject(new Error(msg)) + } else if (code === 601) { + Message({ message: msg, type: 'warning' }) + return Promise.reject('error') + } else if (code !== 200) { + Notification.error({ title: msg }) + return Promise.reject('error') + } else { + return res.data + } + }, + error => { + console.log('err' + error) + let { message } = error; + if (message == "Network Error") { + message = "后端接口连接异常"; + } else if (message.includes("timeout")) { + message = "当前网络不稳定,请稍后再试"; + } else if (message.includes("Request failed with status code")) { + message = "系统接口" + message.substr(message.length - 3) + "异常"; + } + Message({ message: message, type: 'error', duration: 5 * 1000 }) + return Promise.reject(error) + } +) + +// 通用下载方法 +export function download(url, params, filename, config) { + downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }) + return service.post(url, params, { + transformRequest: [(params) => { return tansParams(params) }], + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + responseType: 'blob', + ...config + }).then(async (data) => { + const isBlob = blobValidate(data); + if (isBlob) { + const blob = new Blob([data]) + saveAs(blob, filename) + } else { + const resText = await data.text(); + const rspObj = JSON.parse(resText); + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'] + Message.error(errMsg); + } + downloadLoadingInstance.close(); + }).catch((r) => { + console.error(r) + Message.error('下载文件出现错误,请联系管理员!') + downloadLoadingInstance.close(); + }) +} + +export default service diff --git a/src/views/index.vue b/src/views/index.vue new file mode 100644 index 0000000..30b56dc --- /dev/null +++ b/src/views/index.vue @@ -0,0 +1,159 @@ + + + + diff --git a/src/views/pages/cases.vue b/src/views/pages/cases.vue new file mode 100644 index 0000000..ce0b8c6 --- /dev/null +++ b/src/views/pages/cases.vue @@ -0,0 +1,69 @@ + + + + + \ No newline at end of file diff --git a/src/views/pages/home.vue b/src/views/pages/home.vue new file mode 100644 index 0000000..bbd2e6c --- /dev/null +++ b/src/views/pages/home.vue @@ -0,0 +1,310 @@ + + + + + \ No newline at end of file diff --git a/src/views/pages/honor.vue b/src/views/pages/honor.vue new file mode 100644 index 0000000..af4402f --- /dev/null +++ b/src/views/pages/honor.vue @@ -0,0 +1,61 @@ + + + + + \ No newline at end of file diff --git a/src/views/pages/information.vue b/src/views/pages/information.vue new file mode 100644 index 0000000..31831d4 --- /dev/null +++ b/src/views/pages/information.vue @@ -0,0 +1,149 @@ + + + + + \ No newline at end of file diff --git a/src/views/pages/introduce.vue b/src/views/pages/introduce.vue new file mode 100644 index 0000000..d90faa9 --- /dev/null +++ b/src/views/pages/introduce.vue @@ -0,0 +1,124 @@ + + + + + \ No newline at end of file diff --git a/src/views/pages/recruit.vue b/src/views/pages/recruit.vue new file mode 100644 index 0000000..5296781 --- /dev/null +++ b/src/views/pages/recruit.vue @@ -0,0 +1,132 @@ + + + + + \ No newline at end of file diff --git a/vue.config.js b/vue.config.js new file mode 100644 index 0000000..910e297 --- /dev/null +++ b/vue.config.js @@ -0,0 +1,4 @@ +const { defineConfig } = require('@vue/cli-service') +module.exports = defineConfig({ + transpileDependencies: true +})