diff --git a/.env b/.env index 6862a98..ca3c81c 100644 --- a/.env +++ b/.env @@ -1,7 +1,3 @@ -VITE_BASE_URL=http://192.168.0.49:8093/ -VITE_PROXY=/api/ +VITE_PROXY=/api VITE_FILE_URL=https://file.zcloudchina.com/YTHFile VITE_TEMPLATE_URL=https://qaaq.qhdsafety.com/file/ -VITE_ON_LINE_WEB_SOCKET_URL=wss://qaaq.qhdsafety.com/zxwebsocket/ -VITE_LEARNING_WEB_SOCKET_URL=wss://qaaq.qhdsafety.com/websocket/ - diff --git a/.env.development b/.env.development index e69de29..045cc8b 100644 --- a/.env.development +++ b/.env.development @@ -0,0 +1,3 @@ +VITE_BASE_URL=http://192.168.0.69:7082/ +VITE_ON_LINE_WEB_SOCKET_URL=ws://192.168.0.31:8869 +VITE_LEARNING_WEB_SOCKET_URL=ws://192.168.0.31:8899 diff --git a/.env.production b/.env.production index fdbe314..07df8ad 100644 --- a/.env.production +++ b/.env.production @@ -1,7 +1,10 @@ -VITE_BASE_URL=http://192.168.0.31:7082/integrated_traffic/ -VITE_PROXY=/api/ -VITE_FILE_URL=https://file.zcloudchina.com/YTHFile -VITE_TEMPLATE_URL=https://qaaq.qhdsafety.com/file/ -VITE_ON_LINE_WEB_SOCKET_URL=wss://qaaq.qhdsafety.com/zxwebsocket/ -VITE_LEARNING_WEB_SOCKET_URL=wss://qaaq.qhdsafety.com/websocket/ +VITE_BASE_URL=http://39.101.166.211:8073/integrated_traffic/ + +#websocket t掉线 +VITE_ON_LINE_WEB_SOCKET_URL=ws://39.101.166.211:8869 +# VITE_ON_LINE_WEB_SOCKET_URL=wss://qaaqjt.qhdsafety.com/disconnected/ + +#websocket 在线学习 +VITE_LEARNING_WEB_SOCKET_URL=ws://39.101.166.211:8899 +# VITE_LEARNING_WEB_SOCKET_URL=wss://qaaqjt.qhdsafety.com/onlinelearning/ diff --git a/.eslintignore b/.eslintignore index 32b17dc..7385d52 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,4 +2,4 @@ public dist package.json !.prettierrc.cjs -src/vite-env.d.ts +env.d.ts diff --git a/env.d.ts b/env.d.ts new file mode 100644 index 0000000..433693a --- /dev/null +++ b/env.d.ts @@ -0,0 +1,27 @@ +interface ImportMetaEnv { + // Auto generate by env-parse + /** + * undefined + */ + readonly VITE_PROXY: string + /** + * undefined + */ + readonly VITE_FILE_URL: string + /** + * undefined + */ + readonly VITE_TEMPLATE_URL: string + /** + * undefined + */ + readonly VITE_BASE_URL: string + /** + * undefined + */ + readonly VITE_ON_LINE_WEB_SOCKET_URL: string + /** + * undefined + */ + readonly VITE_LEARNING_WEB_SOCKET_URL: string +} \ No newline at end of file diff --git a/index.html b/index.html index 98432fa..8f0f120 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + 交通运输安全生产综合管理系统 diff --git a/package-lock.json b/package-lock.json index 7cc317a..ee2614a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,6 +68,7 @@ "unplugin-vue-components": "^0.22.12", "vite": "^4.5.1", "vite-plugin-enhance-log": "^0.5.2", + "vite-plugin-env-parse": "^1.0.10", "vite-plugin-eslint": "^1.8.1", "vite-plugin-remove-console": "^2.2.0", "vue-eslint-parser": "^9.3.2" @@ -5966,6 +5967,15 @@ "vite": "^2.9.0 || ^3.0.0 || ^4.0.0" } }, + "node_modules/vite-plugin-env-parse": { + "version": "1.0.10", + "resolved": "https://registry.npmmirror.com/vite-plugin-env-parse/-/vite-plugin-env-parse-1.0.10.tgz", + "integrity": "sha512-7C3ixNz02ExrYCZRkAhXRWXqWktR/YO/SkrCdOUFR3GCXALUGt4xNhTTVZonKH8SpA4xe1wp2mS606MKZdvOpw==", + "dev": true, + "peerDependencies": { + "vite": "*" + } + }, "node_modules/vite-plugin-eslint": { "version": "1.8.1", "resolved": "https://registry.npmmirror.com/vite-plugin-eslint/-/vite-plugin-eslint-1.8.1.tgz", diff --git a/package.json b/package.json index 8bb9dbf..249ca3d 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "unplugin-vue-components": "^0.22.12", "vite": "^4.5.1", "vite-plugin-enhance-log": "^0.5.2", + "vite-plugin-env-parse": "^1.0.10", "vite-plugin-eslint": "^1.8.1", "vite-plugin-remove-console": "^2.2.0", "vue-eslint-parser": "^9.3.2" diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..ae2e4d4 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/vite.svg b/public/vite.svg deleted file mode 100644 index e7b8dfb..0000000 --- a/public/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/css/common.scss b/src/assets/css/common.scss index 423d0d6..f1d1f48 100644 --- a/src/assets/css/common.scss +++ b/src/assets/css/common.scss @@ -127,10 +127,9 @@ h1, h2, h3, h4, h5, h6 { } .layout-container { - background-color: #030f2f; + background-color: #051a55; min-height: 100vh; - background-image: url("/src/assets/images/public/bg.jpg"); - background-repeat: no-repeat; + } a { diff --git a/src/assets/css/element.scss b/src/assets/css/element.scss index a53ad65..0b32bbf 100644 --- a/src/assets/css/element.scss +++ b/src/assets/css/element.scss @@ -6,7 +6,7 @@ --el-text-color-regular: #fff !important; --el-fill-color-light: #0e1d44 !important; //hover背景色 --el-color-check: #14affe !important; //hover、选中 文字颜色 - --el-aside-bg-color: #081e42 !important; + --el-aside-bg-color: #08277e !important; --el-input-bg-color: #081435 !important; --el-fill-color-blank: #081435 !important; // 背景色 --el-border-color-lighter: var(--el-border-color) !important; @@ -91,7 +91,7 @@ .el-menu-item { &:hover, &.is-active { //background: #1d3f77; - background-image: linear-gradient(to right, #1e499a, rgba(0, 0, 0, 0)); + background-image: linear-gradient(to right, #2c6ee9, rgba(0, 0, 0, 0)); } } diff --git a/src/assets/images/login/loginbg.png b/src/assets/images/login/loginbg.png new file mode 100644 index 0000000..82e7187 Binary files /dev/null and b/src/assets/images/login/loginbg.png differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..56ba09a Binary files /dev/null and b/src/assets/images/login/logo.png differ diff --git a/src/assets/images/login/midbg.png b/src/assets/images/login/midbg.png new file mode 100644 index 0000000..8bf005f Binary files /dev/null and b/src/assets/images/login/midbg.png differ diff --git a/src/assets/images/public/loginbg.jpg b/src/assets/images/public/loginbg.jpg deleted file mode 100644 index 10605f4..0000000 Binary files a/src/assets/images/public/loginbg.jpg and /dev/null differ diff --git a/src/assets/js/constant.js b/src/assets/js/constant.js index 29ac496..effd3a3 100644 --- a/src/assets/js/constant.js +++ b/src/assets/js/constant.js @@ -16,7 +16,7 @@ export const MENU = [ { title: "双重预防", model: MODEL["3"] }, { title: "教育培训", model: MODEL["4"] }, { title: "综合管理", model: MODEL["5"] }, - { title: "定位管理", model: MODEL["6"] }, + // { title: "定位管理", model: MODEL["6"] }, ]; // 安全生成及电子运单管理 export const PRACTITIONERMENU = [ @@ -29,13 +29,6 @@ export const TRUCKMENU = [ { id: "货B73752", name: "2" }, { id: "货C87376", name: "3" }, ]; -export const PERSONTYPEMENU = [ - { id: "其他", name: "1" }, - { id: "驾驶员", name: "2" }, - { id: "监控员", name: "3" }, - { id: "押运员", name: "4" }, - { id: "安全负责人", name: "5" }, -]; export const CUSTOMERTYPEMENU = [ { id: "委托方", name: "1" }, { id: "确认方", name: "2" }, @@ -92,8 +85,8 @@ export const INSURANCEMENU = [ export const DUE_STATUS_LIST = [ // 到期状态 - { ID: "1", NAME: "未到期" }, { ID: "0", NAME: "已到期" }, + { ID: "1", NAME: "未到期" }, { ID: "2", NAME: "即将到期" }, ]; @@ -139,11 +132,18 @@ export const REMINDER_STATUS = [ { ID: "1", NAME: "关闭" }, ]; -export const REMIND_DAYS = [ +export const REMIND_DAYS = [ // 提醒天数 { ID: "0", NAME: "30天", NUM: "30" }, { ID: "1", NAME: "45天", NUM: "45" }, - { ID: "2", NAME: "90天", NUM: "90" } + { ID: "2", NAME: "90天", NUM: "90" }, +]; + +export const INSURANCE_TYPE = [ + // 提醒天数 + { ID: "0", NAME: "承运人责任险" }, + { ID: "1", NAME: "强制险" }, + { ID: "2", NAME: "商业险" }, ]; // export const MAINTENANCE_LEVEL_LIST = [ diff --git a/src/assets/js/data_dictionary.js b/src/assets/js/data_dictionary.js index edc738a..ff686ba 100644 --- a/src/assets/js/data_dictionary.js +++ b/src/assets/js/data_dictionary.js @@ -188,6 +188,20 @@ export const layoutFnGetRiskClassification = async () => { }); return ref(resData.list); }; +// 风险等级 +export const layoutFnGetRiskLevel = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "a178357ce6ce4d6a9ac95def6aca3a14", + }); + return ref(resData.list); +}; +// 风险成因 +export const layoutFnGetRiskCauses = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "1bacbc4c1f6544718519c0d470dfeb62", + }); + return ref(resData.list); +}; // 排查项类型 export const layoutFnGetDrivingType = async () => { const resData = await getLevels({ @@ -195,6 +209,97 @@ export const layoutFnGetDrivingType = async () => { }); return ref(resData.list); }; +// 适用领域 +export const layoutFnGetApplicableFields = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "ab52643da4714042be2ebfb880097330", + }); + return ref(resData.list); +}; +// 预案类别 +export const layoutFnGetPlanCategory = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "b2759070db524cc4ae2d60ee4b263dc3", + }); + return ref(resData.list); +}; +// 预案备案状态 +export const layoutFnGetPlanFilingStatus = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "8d07af03be10473ca17e1516a8e860d2", + }); + return ref(resData.list); +}; +// 预案级别 +export const layoutFnGetPlanLevel = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "ab54d50f12ef4f578bc29c3b980b83e5", + }); + return ref(resData.list); +}; +// 装备类别 +export const layoutFnGetEquipmentCategory = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "716f792cfc354fcf81bf3c0e904fb4f8", + }); + return ref(resData.list); +}; +// 救援专业 +export const layoutFnGetRescueSpecialty = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "6a724d36c3ad416fad22049d932c329e", + }); + return ref(resData.list); +}; +// 队伍属性 +export const layoutFnGetTeamAttribute = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "afde28dd39c841d984fb331116781ff3", + }); + return ref(resData.list); +}; +// 队伍类别 +export const layoutFnGetTeamCategory = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "ef2f9a53723b4531968279fe4816be3d", + }); + return ref(resData.list); +}; +// 队伍等级 +export const layoutFnGetTeamGrade = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "4dca6d39490d4845ba7b02df2ab68aa4", + }); + return ref(resData.list); +}; +// 队伍级别 +export const layoutFnGetTeamLevel = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "bfd057e59c124b42ac93e13c6a30b85e", + }); + return ref(resData.list); +}; +// 特种设备类型 +export const layoutFnGetSpecialEquipmentType = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "cffb3d28d48548328ddd78976610b05d", + }); + return ref(resData.list); +}; +// 特种设备状态 +export const layoutFnGetSpecialEquipmentState = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "0feb448f975e422fafbf5db20c0b85c9", + }); + return ref(resData.list); +}; +// 巡检周期 +export const layoutFnGetInspectionCycle = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "3017f7f6f6794f23bf15d026a1e55426", + }); + return ref(resData.list); +}; // 部门树 export const layoutFnGetDepartmentTree = async (params) => { const resData = await getDepartmentTree(params); diff --git a/src/assets/js/useListData.js b/src/assets/js/useListData.js index 27d21c9..12d83fd 100644 --- a/src/assets/js/useListData.js +++ b/src/assets/js/useListData.js @@ -40,17 +40,13 @@ export default function useListData(api, options = {}) { getDataType(options.clearSelection) !== "Boolean" ) throw new Error("options.clearSelection必须是一个布尔值"); + if (options.otherParams && getDataType(options.otherParams) !== "Object") + throw new Error("options.otherParams必须是一个对象"); const immediate = options.immediate ?? true; const usePagination = options.usePagination ?? true; const key = options.key ?? "varList"; const defaultSearchForm = options.defaultSearchForm ?? {}; const clearSelection = options.clearSelection ?? true; - if ( - immediate && - options.otherParams && - getDataType(options.otherParams) !== "Object" - ) - throw new Error("options.otherParams必须是一个对象"); const list = ref([]); const pagination = ref({ currentPage: 1, diff --git a/src/assets/js/utils.js b/src/assets/js/utils.js index 5b6acdb..a601c10 100644 --- a/src/assets/js/utils.js +++ b/src/assets/js/utils.js @@ -414,8 +414,6 @@ export function subtractDaysFromDate(date, daysToSubtract, type = false) { } else if (Object.prototype.toString.call(date) === "[object Date]") { // 直接传入了 Date 对象 newDate = date; - } else { - console.log("无效的输入参数"); } if (type) { newDate.setDate(newDate.getDate() + daysToSubtract); diff --git a/src/components/learning_train_type/index.vue b/src/components/learning_train_type/index.vue index 57eace5..282c35b 100644 --- a/src/components/learning_train_type/index.vue +++ b/src/components/learning_train_type/index.vue @@ -93,16 +93,16 @@ const getCurrentNode = () => { if (props.type !== "industryType") { if (data.value.length === 0) return {}; for (let i = 0; i < data.value.length; i++) { - if (data.value[i][keys[props.type]] === props.modelValue) { + if (data.value[i][keys[props.type]] === modelValue.value) { return data.value[i]; } } } return treeSelectRef.value.getCurrentNode(); }; -const getNode = (value = getCurrentNode()) => { +const getNode = () => { if (props.type !== "industryType") return ""; - return treeSelectRef.value.getNode(getCurrentNode(value)); + return treeSelectRef.value.getNode(getCurrentNode() || modelValue.value); }; const getIndustryTypeCurrentCheckAll = () => { const name = []; diff --git a/src/components/qr_code/index.vue b/src/components/qr_code/index.vue index 23a77f1..af59a10 100644 --- a/src/components/qr_code/index.vue +++ b/src/components/qr_code/index.vue @@ -1,6 +1,6 @@ @@ -16,10 +16,22 @@ const props = defineProps({ required: true, default: "", }, + width: { + type: Number, + default: 200, + }, + height: { + type: Number, + default: 200, + }, + margin: { + type: Boolean, + default: true, + }, }); const src = useQRCode(() => props.src, { - width: 200, - height: 200, + width: props.width, + height: props.height, margin: 1, correctLevel: "H", }); diff --git a/src/layout/header/index.vue b/src/layout/header/index.vue index d376b91..ba7d5c5 100644 --- a/src/layout/header/index.vue +++ b/src/layout/header/index.vue @@ -4,9 +4,9 @@