隐患详情重新设计,检查计划重新设计成做题排查式
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":3,"file":"assets.js","sources":["static/home_icon/jianbianbeijing.png","static/yujin/yujin_sousuo.png","static/yujin/yujin_tongji.png","static/my/edit.png","static/my/Notification.png","static/my/Account.png","static/my/Customer service.png","static/my/Phone.png","static/index/index_bg.png","static/index/phone.png","static/index/lock.png","static/index/蒙版组 260.png"],"sourcesContent":["export default \"__VITE_ASSET__ea9fb36d__\"","export default \"__VITE_ASSET__8fe3bf4d__\"","export default \"__VITE_ASSET__d9a3c09a__\"","export default \"__VITE_ASSET__e5df6314__\"","export default \"__VITE_ASSET__553a3ebb__\"","export default \"__VITE_ASSET__ebdbece8__\"","export default \"__VITE_ASSET__2a9450b4__\"","export default \"__VITE_ASSET__57c23edd__\"","export default \"__VITE_ASSET__f48d129d__\"","export default \"__VITE_ASSET__6b0aa87a__\"","export default \"__VITE_ASSET__e0160358__\"","export default \"__VITE_ASSET__d3a3f4fb__\""],"names":[],"mappings":";AAAA,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,aAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;;;;;;;;;;;;;"}
|
||||
{"version":3,"file":"assets.js","sources":["static/home_icon/jianbianbeijing.png","static/yinhuan_detail/status.png","static/yinhuan_detail/date.png","static/yujin/yujin_sousuo.png","static/yujin/yujin_tongji.png","static/my/edit.png","static/my/Notification.png","static/my/Account.png","static/my/Customer service.png","static/my/Phone.png","static/index/index_bg.png","static/index/phone.png","static/index/lock.png","static/index/蒙版组 260.png"],"sourcesContent":["export default \"__VITE_ASSET__ea9fb36d__\"","export default \"__VITE_ASSET__8ebecbdc__\"","export default \"__VITE_ASSET__4ec3ff67__\"","export default \"__VITE_ASSET__8fe3bf4d__\"","export default \"__VITE_ASSET__d9a3c09a__\"","export default \"__VITE_ASSET__e5df6314__\"","export default \"__VITE_ASSET__553a3ebb__\"","export default \"__VITE_ASSET__ebdbece8__\"","export default \"__VITE_ASSET__2a9450b4__\"","export default \"__VITE_ASSET__57c23edd__\"","export default \"__VITE_ASSET__f48d129d__\"","export default \"__VITE_ASSET__6b0aa87a__\"","export default \"__VITE_ASSET__e0160358__\"","export default \"__VITE_ASSET__d3a3f4fb__\""],"names":[],"mappings":";AAAA,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,aAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;;;;;;;;;;;;;;;"}
|
||||
File diff suppressed because one or more lines are too long
1
unpackage/dist/dev/.sourcemap/mp-weixin/components/hazard/HazardFormPopup.js.map
vendored
Normal file
1
unpackage/dist/dev/.sourcemap/mp-weixin/components/hazard/HazardFormPopup.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
unpackage/dist/dev/.sourcemap/mp-weixin/components/hazard/hazardForm.js.map
vendored
Normal file
1
unpackage/dist/dev/.sourcemap/mp-weixin/components/hazard/hazardForm.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"hazardForm.js","sources":["components/hazard/hazardForm.js"],"sourcesContent":["import { buildAttachmentItem } from '@/utils/upload.js';\r\n\r\nexport const LEVEL_OPTIONS = [\r\n\t{ id: 2, title: '一般隐患' },\r\n\t{ id: 3, title: '重大隐患' }\r\n];\r\n\r\nexport const SOURCE_OPTIONS = [\r\n\t{ id: 1, title: '部门检查' },\r\n\t{ id: 2, title: '督导检查' },\r\n\t{ id: 3, title: '企业自查' },\r\n\t{ id: 4, title: '行业互查' }\r\n];\r\n\r\nexport const AI_LEVEL_MAP = {\r\n\t轻微: 0,\r\n\t轻微隐患: 0,\r\n\t一般: 0,\r\n\t一般隐患: 0,\r\n\t重大: 1,\r\n\t重大隐患: 1\r\n};\r\n\r\nexport function createEmptyHazardPayload() {\r\n\treturn {\r\n\t\tformData: {\r\n\t\t\ttitle: '',\r\n\t\t\tlevel: 0,\r\n\t\t\tsource: 0,\r\n\t\t\tdescription: '',\r\n\t\t\ttagIndex: 0,\r\n\t\t\ttagId: null,\r\n\t\t\tregulationId: null,\r\n\t\t\tregulationName: ''\r\n\t\t},\r\n\t\taddress: '',\r\n\t\tlng: 0,\r\n\t\tlat: 0,\r\n\t\tareaId: '',\r\n\t\tareaName: '',\r\n\t\tfileList: []\r\n\t};\r\n}\r\n\r\nexport function buildHiddenDangerParams(payload, extra = {}) {\r\n\tconst { formData, address, lng, lat, areaId, fileList } = payload;\r\n\tconst selectedTag = payload.tagOptions?.[formData.tagIndex];\r\n\tconst tagId = formData.tagId ?? (selectedTag ? selectedTag.id : null);\r\n\r\n\treturn {\r\n\t\ttitle: formData.title,\r\n\t\tlevel: LEVEL_OPTIONS[formData.level]?.id || 2,\r\n\t\tlng: lng || 0,\r\n\t\tlat: lat || 0,\r\n\t\taddress: address || '',\r\n\t\tareaId: areaId || null,\r\n\t\tdescription: formData.description || '',\r\n\t\tsource: SOURCE_OPTIONS[formData.source]?.title || '',\r\n\t\ttagId,\r\n\t\tattachments: (fileList || [])\r\n\t\t\t.filter((f) => f.status === 'success')\r\n\t\t\t.map((file) => buildAttachmentItem(file)),\r\n\t\tregulationId: formData.regulationId || null,\r\n\t\t...extra\r\n\t};\r\n}\r\n\r\nexport function hasValidHazardPayload(payload) {\r\n\tif (!payload) return false;\r\n\tconst { formData, fileList } = payload;\r\n\treturn !!(formData?.title && fileList?.length > 0);\r\n}\r\n"],"names":["buildAttachmentItem"],"mappings":";;AAEY,MAAC,gBAAgB;AAAA,EAC5B,EAAE,IAAI,GAAG,OAAO,OAAQ;AAAA,EACxB,EAAE,IAAI,GAAG,OAAO,OAAQ;AACzB;AAEY,MAAC,iBAAiB;AAAA,EAC7B,EAAE,IAAI,GAAG,OAAO,OAAQ;AAAA,EACxB,EAAE,IAAI,GAAG,OAAO,OAAQ;AAAA,EACxB,EAAE,IAAI,GAAG,OAAO,OAAQ;AAAA,EACxB,EAAE,IAAI,GAAG,OAAO,OAAQ;AACzB;AAEY,MAAC,eAAe;AAAA,EAC3B,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AACP;AAEO,SAAS,2BAA2B;AAC1C,SAAO;AAAA,IACN,UAAU;AAAA,MACT,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,UAAU;AAAA,MACV,OAAO;AAAA,MACP,cAAc;AAAA,MACd,gBAAgB;AAAA,IAChB;AAAA,IACD,SAAS;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,UAAU,CAAE;AAAA,EACd;AACA;AAEO,SAAS,wBAAwB,SAAS,QAAQ,IAAI;;AAC5D,QAAM,EAAE,UAAU,SAAS,KAAK,KAAK,QAAQ,SAAU,IAAG;AAC1D,QAAM,eAAc,aAAQ,eAAR,mBAAqB,SAAS;AAClD,QAAM,QAAQ,SAAS,UAAU,cAAc,YAAY,KAAK;AAEhE,SAAO;AAAA,IACN,OAAO,SAAS;AAAA,IAChB,SAAO,mBAAc,SAAS,KAAK,MAA5B,mBAA+B,OAAM;AAAA,IAC5C,KAAK,OAAO;AAAA,IACZ,KAAK,OAAO;AAAA,IACZ,SAAS,WAAW;AAAA,IACpB,QAAQ,UAAU;AAAA,IAClB,aAAa,SAAS,eAAe;AAAA,IACrC,UAAQ,oBAAe,SAAS,MAAM,MAA9B,mBAAiC,UAAS;AAAA,IAClD;AAAA,IACA,cAAc,YAAY,CAAE,GAC1B,OAAO,CAAC,MAAM,EAAE,WAAW,SAAS,EACpC,IAAI,CAAC,SAASA,aAAmB,oBAAC,IAAI,CAAC;AAAA,IACzC,cAAc,SAAS,gBAAgB;AAAA,IACvC,GAAG;AAAA,EACL;AACA;AAEO,SAAS,sBAAsB,SAAS;AAC9C,MAAI,CAAC;AAAS,WAAO;AACrB,QAAM,EAAE,UAAU,SAAU,IAAG;AAC/B,SAAO,CAAC,GAAE,qCAAU,WAAS,qCAAU,UAAS;AACjD;;;;;;;"}
|
||||
1
unpackage/dist/dev/.sourcemap/mp-weixin/components/hazard/index.js.map
vendored
Normal file
1
unpackage/dist/dev/.sourcemap/mp-weixin/components/hazard/index.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
||||
1
unpackage/dist/dev/.sourcemap/mp-weixin/components/hazardDetail/HazardDetailPanel.js.map
vendored
Normal file
1
unpackage/dist/dev/.sourcemap/mp-weixin/components/hazardDetail/HazardDetailPanel.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
unpackage/dist/dev/.sourcemap/mp-weixin/components/hazardDetail/HazardDetailPanelV2.js.map
vendored
Normal file
1
unpackage/dist/dev/.sourcemap/mp-weixin/components/hazardDetail/HazardDetailPanelV2.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
unpackage/dist/dev/.sourcemap/mp-weixin/components/hazardDetail/hazardDetail.js.map
vendored
Normal file
1
unpackage/dist/dev/.sourcemap/mp-weixin/components/hazardDetail/hazardDetail.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
unpackage/dist/dev/.sourcemap/mp-weixin/components/hazardDetail/useHazardDetailScroll.js.map
vendored
Normal file
1
unpackage/dist/dev/.sourcemap/mp-weixin/components/hazardDetail/useHazardDetailScroll.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/Inspectionresult/detail.js.map
vendored
Normal file
1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/Inspectionresult/detail.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/Inspectionresult/list.js.map
vendored
Normal file
1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/Inspectionresult/list.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/hiddendanger/detail2.js.map
vendored
Normal file
1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/hiddendanger/detail2.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"props.js","sources":["uni_modules/uview-plus/components/u-checkbox-group/props.js"],"sourcesContent":["import { defineMixin } from '../../libs/vue'\r\nimport defProps from '../../libs/config/props.js'\r\n\r\nexport const props = defineMixin({\r\n props: {\r\n // 标识符\r\n name: {\r\n type: String,\r\n default: () => defProps.checkboxGroup.name\r\n },\r\n\t\t// #ifdef VUE3\r\n\t\t// 绑定的值\r\n\t\tmodelValue: {\r\n\t\t type: Array,\r\n\t\t default: () => defProps.checkboxGroup.value\r\n\t\t},\r\n\t\t// #endif\r\n\t\t// #ifdef VUE2\r\n\t\t// 绑定的值\r\n\t\tvalue: {\r\n\t\t type: Array,\r\n\t\t default: () => defProps.checkboxGroup.value\r\n\t\t},\r\n\t\t// #endif\r\n // 形状,circle-圆形,square-方形\r\n shape: {\r\n type: String,\r\n default: () => defProps.checkboxGroup.shape\r\n },\r\n // 是否禁用全部checkbox\r\n disabled: {\r\n type: Boolean,\r\n default: () => defProps.checkboxGroup.disabled\r\n },\r\n\r\n // 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值\r\n activeColor: {\r\n type: String,\r\n default: () => defProps.checkboxGroup.activeColor\r\n },\r\n // 未选中的颜色\r\n inactiveColor: {\r\n type: String,\r\n default: () => defProps.checkboxGroup.inactiveColor\r\n },\r\n\r\n // 整个组件的尺寸,默认px\r\n size: {\r\n type: [String, Number],\r\n default: () => defProps.checkboxGroup.size\r\n },\r\n // 布局方式,row-横向,column-纵向\r\n placement: {\r\n type: String,\r\n default: () => defProps.checkboxGroup.placement\r\n },\r\n // label的字体大小,px单位\r\n labelSize: {\r\n type: [String, Number],\r\n default: () => defProps.checkboxGroup.labelSize\r\n },\r\n // label的字体颜色\r\n labelColor: {\r\n type: [String],\r\n default: () => defProps.checkboxGroup.labelColor\r\n },\r\n // 是否禁止点击文本操作\r\n labelDisabled: {\r\n type: Boolean,\r\n default: () => defProps.checkboxGroup.labelDisabled\r\n },\r\n // 图标颜色\r\n iconColor: {\r\n type: String,\r\n default: () => defProps.checkboxGroup.iconColor\r\n },\r\n // 图标的大小,单位px\r\n iconSize: {\r\n type: [String, Number],\r\n default: () => defProps.checkboxGroup.iconSize\r\n },\r\n // 勾选图标的对齐方式,left-左边,right-右边\r\n iconPlacement: {\r\n type: String,\r\n default: () => defProps.checkboxGroup.iconPlacement\r\n },\r\n // 竖向配列时,是否显示下划线\r\n borderBottom: {\r\n type: Boolean,\r\n default: () => defProps.checkboxGroup.borderBottom\r\n }\r\n }\r\n})\r\n"],"names":["defineMixin","defProps"],"mappings":";;;AAGY,MAAC,QAAQA,+BAAAA,YAAY;AAAA,EAC7B,OAAO;AAAA;AAAA,IAEH,MAAM;AAAA,MACF,MAAM;AAAA,MACN,SAAS,MAAMC,8CAAS,cAAc;AAAA,IACzC;AAAA;AAAA,IAGP,YAAY;AAAA,MACR,MAAM;AAAA,MACN,SAAS,MAAMA,8CAAS,cAAc;AAAA,IACzC;AAAA;AAAA,IAUK,OAAO;AAAA,MACH,MAAM;AAAA,MACN,SAAS,MAAMA,8CAAS,cAAc;AAAA,IACzC;AAAA;AAAA,IAED,UAAU;AAAA,MACN,MAAM;AAAA,MACN,SAAS,MAAMA,8CAAS,cAAc;AAAA,IACzC;AAAA;AAAA,IAGD,aAAa;AAAA,MACT,MAAM;AAAA,MACN,SAAS,MAAMA,8CAAS,cAAc;AAAA,IACzC;AAAA;AAAA,IAED,eAAe;AAAA,MACX,MAAM;AAAA,MACN,SAAS,MAAMA,8CAAS,cAAc;AAAA,IACzC;AAAA;AAAA,IAGD,MAAM;AAAA,MACF,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS,MAAMA,8CAAS,cAAc;AAAA,IACzC;AAAA;AAAA,IAED,WAAW;AAAA,MACP,MAAM;AAAA,MACN,SAAS,MAAMA,8CAAS,cAAc;AAAA,IACzC;AAAA;AAAA,IAED,WAAW;AAAA,MACP,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS,MAAMA,8CAAS,cAAc;AAAA,IACzC;AAAA;AAAA,IAED,YAAY;AAAA,MACR,MAAM,CAAC,MAAM;AAAA,MACb,SAAS,MAAMA,8CAAS,cAAc;AAAA,IACzC;AAAA;AAAA,IAED,eAAe;AAAA,MACX,MAAM;AAAA,MACN,SAAS,MAAMA,8CAAS,cAAc;AAAA,IACzC;AAAA;AAAA,IAED,WAAW;AAAA,MACP,MAAM;AAAA,MACN,SAAS,MAAMA,8CAAS,cAAc;AAAA,IACzC;AAAA;AAAA,IAED,UAAU;AAAA,MACN,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS,MAAMA,8CAAS,cAAc;AAAA,IACzC;AAAA;AAAA,IAED,eAAe;AAAA,MACX,MAAM;AAAA,MACN,SAAS,MAAMA,8CAAS,cAAc;AAAA,IACzC;AAAA;AAAA,IAED,cAAc;AAAA,MACV,MAAM;AAAA,MACN,SAAS,MAAMA,8CAAS,cAAc;AAAA,IACzC;AAAA,EACJ;AACL,CAAC;;"}
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"u-choose.js","sources":["uni_modules/uview-plus/components/u-choose/u-choose.vue","F:/software/HBuilderX/HBuilderX/plugins/uniapp-cli-vite/uniComponent:/RTovaGV4aWV5dW4vVGhyZWVDaGVja3NPbmVFeHBvc3VyZV9wbGF0Zm9ybS8xMi4wN2Nob25ncWl4aW5kZS_kuInmn6XkuIDmm53lhYnlsI_nqIvluo8vdGhyZWVvbmVjaGVja1_lsI_nqIvluo8vdW5pX21vZHVsZXMvdXZpZXctcGx1cy9jb21wb25lbnRzL3UtY2hvb3NlL3UtY2hvb3NlLnZ1ZQ"],"sourcesContent":["<style scoped lang=\"scss\">\r\n\t.up-choose {\r\n\t\t::v-deep .up-tag {\r\n\t\t font-weight: 600;\r\n\t\t}\r\n\t\t&:last-child {\r\n\t\t\tmargin-right: 0;\r\n\t\t}\r\n\t}\r\n\t\r\n\t.up-choose-wrap {\r\n\t\tflex-wrap: wrap;\r\n\t}\r\n\t\r\n\t.up-choose-nowrap {\r\n\t\tflex-wrap: nowrap;\r\n\t\twhite-space: nowrap;\r\n\t}\r\n</style>\r\n\r\n<template>\r\n\t<scroll-view \r\n\t\t:scroll-x=\"wrap === false\" \r\n\t\t:class=\"['up-choose', wrap ? 'up-choose-wrap' : 'up-choose-nowrap']\">\r\n <template :key=\"item.id\" v-for=\"(item,index) in options\">\r\n <view :style=\"{width: itemWidth, display: 'inline-block'}\">\r\n <slot :item=\"item\" :index=\"index\">\r\n <up-tag :type=\"index == currentIndex ? 'primary' : 'info'\"\r\n size=\"large\" :plain=\"index == currentIndex ? false : true\"\r\n :class=\"currentIndex === index ? 'active': ''\" :height=\"itemHeight\"\r\n :style=\"{width: itemWidth, padding: itemPadding}\"\r\n @click=\"change(index)\">\r\n {{item[labelName]}}\r\n </up-tag>\r\n </slot>\r\n </view>\r\n </template>\r\n\t</scroll-view>\r\n</template>\r\n\r\n<script>\r\n\texport default {\r\n\t name: 'up-choose',\r\n\t props: {\r\n\t\t\toptions:{\r\n\t\t\t\ttype: Array,\r\n\t\t\t\tdefault: ()=>{\r\n\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tmodelValue: {\r\n\t\t\t\ttype: [Number,String,Array],\r\n\t\t\t\tdefault: false\r\n\t\t\t},\r\n\t\t\ttype: {\r\n\t\t\t type: [String],\r\n\t\t\t default: 'radio'\r\n\t\t\t},\r\n\t\t\titemWidth: {\r\n\t\t\t type: [String],\r\n\t\t\t default: 'auto'\r\n\t\t\t},\r\n\t\t\titemHeight: {\r\n\t\t\t type: [String],\r\n\t\t\t default: '50px'\r\n\t\t\t},\r\n itemPadding: {\r\n type: [String],\r\n\t\t\t default: '8px'\r\n },\r\n\t\t\tlabelName: {\r\n\t\t\t type: String,\r\n\t\t\t default: 'title'\r\n\t\t\t},\r\n\t\t\tvalueName: {\r\n\t\t\t type: String,\r\n\t\t\t default: 'value'\r\n\t\t\t},\r\n\t\t\tcustomClick: {\r\n\t\t\t type: Boolean,\r\n\t\t\t default: false\r\n\t\t\t},\r\n\t\t\t// 是否换行\r\n\t\t\twrap: {\r\n\t\t\t\ttype: Boolean,\r\n\t\t\t\tdefault: true\r\n\t\t\t}\r\n\t },\r\n\t data() {\r\n\t return {\r\n\t\t\t\tcurrentIndex: ''\r\n\t }\r\n\t },\r\n\t created: function () {\r\n\t\t\tthis.currentIndex = this.modelValue;\r\n\t },\r\n emits: ['update:modelValue', 'custom-click'],\r\n\t methods: {\r\n\t change(index){\r\n\t\t\t\tif (this.customClick) {\r\n\t\t\t\t\tthis.$emit('custom-click', index);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.currentIndex = index;\r\n\t\t\t\t\tthis.$emit('update:modelValue', index);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t }\r\n\t}\r\n</script>","import Component from 'E:/hexieyun/ThreeChecksOneExposure_platform/12.07chongqixinde/三查一曝光小程序/threeonecheck_小程序/uni_modules/uview-plus/components/u-choose/u-choose.vue'\nwx.createComponent(Component)"],"names":[],"mappings":";;AAyCC,MAAK,YAAU;AAAA,EACX,MAAM;AAAA,EACN,OAAO;AAAA,IACT,SAAQ;AAAA,MACP,MAAM;AAAA,MACN,SAAS,MAAI;AACZ,eAAO;MACR;AAAA,IACA;AAAA,IACD,YAAY;AAAA,MACX,MAAM,CAAC,QAAO,QAAO,KAAK;AAAA,MAC1B,SAAS;AAAA,IACT;AAAA,IACD,MAAM;AAAA,MACF,MAAM,CAAC,MAAM;AAAA,MACb,SAAS;AAAA,IACZ;AAAA,IACD,WAAW;AAAA,MACP,MAAM,CAAC,MAAM;AAAA,MACb,SAAS;AAAA,IACZ;AAAA,IACD,YAAY;AAAA,MACR,MAAM,CAAC,MAAM;AAAA,MACb,SAAS;AAAA,IACZ;AAAA,IACQ,aAAa;AAAA,MACT,MAAM,CAAC,MAAM;AAAA,MACtB,SAAS;AAAA,IACH;AAAA,IACV,WAAW;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,IACZ;AAAA,IACD,WAAW;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,IACZ;AAAA,IACD,aAAa;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,IACZ;AAAA;AAAA,IAED,MAAM;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,EACG;AAAA,EACD,OAAO;AACH,WAAO;AAAA,MACZ,cAAc;AAAA,IACT;AAAA,EACH;AAAA,EACD,SAAS,WAAY;AACvB,SAAK,eAAe,KAAK;AAAA,EACtB;AAAA,EACE,OAAO,CAAC,qBAAqB,cAAc;AAAA,EAC9C,SAAS;AAAA,IACL,OAAO,OAAM;AAClB,UAAI,KAAK,aAAa;AACrB,aAAK,MAAM,gBAAgB,KAAK;AAAA,aAC1B;AACN,aAAK,eAAe;AACpB,aAAK,MAAM,qBAAqB,KAAK;AAAA,MACtC;AAAA,IACD;AAAA,EACE;AACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1GD,GAAG,gBAAgB,SAAS;"}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
unpackage/dist/dev/.sourcemap/mp-weixin/utils/draftCache.js.map
vendored
Normal file
1
unpackage/dist/dev/.sourcemap/mp-weixin/utils/draftCache.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"draftCache.js","sources":["utils/draftCache.js"],"sourcesContent":["/** 草稿 Storage 命名空间(统一 key 前缀) */\nexport const DRAFT_NS = {\n\tASSIGN: 'draft_assign',\n\tACCEPT: 'draft_accept',\n\tRECTIFY: 'draft_rectify',\n\tINSPECTION_RESULT: 'draft_inspection_result',\n\tINSPECTION_SHEET: 'draft_inspection_sheet'\n};\n\n/**\n * 构建草稿 Storage key(与迁移前页面逻辑一致,保留空片段)\n * 例:draft_rectify_100_ 、draft_accept_\n * @param {string} namespace 命名空间,如 DRAFT_NS.ASSIGN\n * @param {...string|number} parts 业务 id 片段\n */\nexport function buildDraftKey(namespace, ...parts) {\n\treturn [namespace, ...parts.map((p) => String(p ?? ''))].join('_');\n}\n\n/** 迁移期 compact key(曾错误地 filter 掉空片段) */\nexport function buildDraftKeyCompact(namespace, ...parts) {\n\treturn [namespace, ...parts.map((p) => String(p ?? '')).filter(Boolean)].join('_');\n}\n\n/**\n * 读取草稿,支持回退到其它 key(迁移兼容)\n * @param {string} primaryKey\n * @param {string[]} [fallbackKeys]\n */\nexport function loadDraftWithFallback(primaryKey, fallbackKeys = []) {\n\tconst primary = loadDraft(primaryKey);\n\tif (primary) {\n\t\treturn { data: primary, key: primaryKey, fromFallback: false };\n\t}\n\n\tfor (const fallbackKey of fallbackKeys) {\n\t\tif (!fallbackKey || fallbackKey === primaryKey) continue;\n\t\tconst fallback = loadDraft(fallbackKey);\n\t\tif (fallback) {\n\t\t\treturn { data: fallback, key: primaryKey, fromFallback: true, fallbackKey };\n\t\t}\n\t}\n\n\treturn { data: null, key: primaryKey, fromFallback: false };\n}\n\n/**\n * 读取草稿\n * @param {string} key\n * @returns {Object|null}\n */\nexport function loadDraft(key) {\n\tif (!key) return null;\n\n\tconst raw = uni.getStorageSync(key);\n\tif (!raw) return null;\n\n\ttry {\n\t\treturn typeof raw === 'string' ? JSON.parse(raw) : raw;\n\t} catch (error) {\n\t\tconsole.error('[draftCache] 解析草稿失败:', key, error);\n\t\treturn null;\n\t}\n}\n\n/**\n * 写入草稿\n * @param {string} key\n * @param {Object} data\n */\nexport function saveDraftToStorage(key, data) {\n\tif (!key) return;\n\n\tuni.setStorageSync(\n\t\tkey,\n\t\tJSON.stringify({\n\t\t\t...data,\n\t\t\tupdatedAt: Date.now()\n\t\t})\n\t);\n}\n\n/**\n * 删除草稿\n * @param {string} key\n */\nexport function removeDraft(key) {\n\tif (!key) return;\n\tuni.removeStorageSync(key);\n}\n\n/** 默认:payload 中任一字段有值即视为有内容(忽略 updatedAt) */\nexport function defaultHasContent(payload) {\n\tif (!payload || typeof payload !== 'object') return false;\n\n\treturn Object.entries(payload).some(([key, value]) => {\n\t\tif (key === 'updatedAt') return false;\n\t\tif (Array.isArray(value)) return value.length > 0;\n\t\tif (value && typeof value === 'object') return Object.keys(value).length > 0;\n\t\treturn value !== '' && value != null;\n\t});\n}\n"],"names":["uni"],"mappings":";;AACY,MAAC,WAAW;AAAA,EACvB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,kBAAkB;AACnB;AAQO,SAAS,cAAc,cAAc,OAAO;AAClD,SAAO,CAAC,WAAW,GAAG,MAAM,IAAI,CAAC,MAAM,OAAO,KAAK,EAAE,CAAC,CAAC,EAAE,KAAK,GAAG;AAClE;AAGO,SAAS,qBAAqB,cAAc,OAAO;AACzD,SAAO,CAAC,WAAW,GAAG,MAAM,IAAI,CAAC,MAAM,OAAO,KAAK,EAAE,CAAC,EAAE,OAAO,OAAO,CAAC,EAAE,KAAK,GAAG;AAClF;AAOO,SAAS,sBAAsB,YAAY,eAAe,IAAI;AACpE,QAAM,UAAU,UAAU,UAAU;AACpC,MAAI,SAAS;AACZ,WAAO,EAAE,MAAM,SAAS,KAAK,YAAY,cAAc;EACvD;AAED,aAAW,eAAe,cAAc;AACvC,QAAI,CAAC,eAAe,gBAAgB;AAAY;AAChD,UAAM,WAAW,UAAU,WAAW;AACtC,QAAI,UAAU;AACb,aAAO,EAAE,MAAM,UAAU,KAAK,YAAY,cAAc,MAAM;IAC9D;AAAA,EACD;AAED,SAAO,EAAE,MAAM,MAAM,KAAK,YAAY,cAAc;AACrD;AAOO,SAAS,UAAU,KAAK;AAC9B,MAAI,CAAC;AAAK,WAAO;AAEjB,QAAM,MAAMA,cAAAA,MAAI,eAAe,GAAG;AAClC,MAAI,CAAC;AAAK,WAAO;AAEjB,MAAI;AACH,WAAO,OAAO,QAAQ,WAAW,KAAK,MAAM,GAAG,IAAI;AAAA,EACnD,SAAQ,OAAO;AACfA,kBAAc,MAAA,MAAA,SAAA,6BAAA,wBAAwB,KAAK,KAAK;AAChD,WAAO;AAAA,EACP;AACF;AAOO,SAAS,mBAAmB,KAAK,MAAM;AAC7C,MAAI,CAAC;AAAK;AAEVA,gBAAAA,MAAI;AAAA,IACH;AAAA,IACA,KAAK,UAAU;AAAA,MACd,GAAG;AAAA,MACH,WAAW,KAAK,IAAK;AAAA,IACxB,CAAG;AAAA,EACH;AACA;AAMO,SAAS,YAAY,KAAK;AAChC,MAAI,CAAC;AAAK;AACVA,sBAAI,kBAAkB,GAAG;AAC1B;AAGO,SAAS,kBAAkB,SAAS;AAC1C,MAAI,CAAC,WAAW,OAAO,YAAY;AAAU,WAAO;AAEpD,SAAO,OAAO,QAAQ,OAAO,EAAE,KAAK,CAAC,CAAC,KAAK,KAAK,MAAM;AACrD,QAAI,QAAQ;AAAa,aAAO;AAChC,QAAI,MAAM,QAAQ,KAAK;AAAG,aAAO,MAAM,SAAS;AAChD,QAAI,SAAS,OAAO,UAAU;AAAU,aAAO,OAAO,KAAK,KAAK,EAAE,SAAS;AAC3E,WAAO,UAAU,MAAM,SAAS;AAAA,EAClC,CAAE;AACF;;;;;;;;"}
|
||||
1
unpackage/dist/dev/.sourcemap/mp-weixin/utils/useDraftCache.js.map
vendored
Normal file
1
unpackage/dist/dev/.sourcemap/mp-weixin/utils/useDraftCache.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
3
unpackage/dist/dev/mp-weixin/app.js
vendored
3
unpackage/dist/dev/mp-weixin/app.js
vendored
@@ -7,6 +7,8 @@ if (!Math) {
|
||||
"./pages/map/map.js";
|
||||
"./pages/plandetail/plandetail.js";
|
||||
"./pages/Inspectionresult/Inspectionresult.js";
|
||||
"./pages/Inspectionresult/list.js";
|
||||
"./pages/Inspectionresult/detail.js";
|
||||
"./pages/membermanagemen/membermanagemen.js";
|
||||
"./pages/corporateInformation/corporateInformation.js";
|
||||
"./pages/editcompanInformation/editcompanInformation.js";
|
||||
@@ -17,6 +19,7 @@ if (!Math) {
|
||||
"./pages/Idphotomanagement/Idphotomanagement.js";
|
||||
"./pages/hiddendanger/Inspection.js";
|
||||
"./pages/hiddendanger/view.js";
|
||||
"./pages/hiddendanger/detail2.js";
|
||||
"./pages/hiddendanger/rectification.js";
|
||||
"./pages/hiddendanger/acceptance.js";
|
||||
"./pages/hiddendanger/assignment.js";
|
||||
|
||||
3
unpackage/dist/dev/mp-weixin/app.json
vendored
3
unpackage/dist/dev/mp-weixin/app.json
vendored
@@ -4,6 +4,8 @@
|
||||
"pages/map/map",
|
||||
"pages/plandetail/plandetail",
|
||||
"pages/Inspectionresult/Inspectionresult",
|
||||
"pages/Inspectionresult/list",
|
||||
"pages/Inspectionresult/detail",
|
||||
"pages/membermanagemen/membermanagemen",
|
||||
"pages/corporateInformation/corporateInformation",
|
||||
"pages/editcompanInformation/editcompanInformation",
|
||||
@@ -14,6 +16,7 @@
|
||||
"pages/Idphotomanagement/Idphotomanagement",
|
||||
"pages/hiddendanger/Inspection",
|
||||
"pages/hiddendanger/view",
|
||||
"pages/hiddendanger/detail2",
|
||||
"pages/hiddendanger/rectification",
|
||||
"pages/hiddendanger/acceptance",
|
||||
"pages/hiddendanger/assignment",
|
||||
|
||||
28
unpackage/dist/dev/mp-weixin/common/assets.js
vendored
28
unpackage/dist/dev/mp-weixin/common/assets.js
vendored
@@ -1,5 +1,7 @@
|
||||
"use strict";
|
||||
const _imports_0$6 = "/static/home_icon/jianbianbeijing.png";
|
||||
const _imports_0$7 = "/static/home_icon/jianbianbeijing.png";
|
||||
const _imports_0$6 = "/static/yinhuan_detail/status.png";
|
||||
const _imports_1$4 = "/static/yinhuan_detail/date.png";
|
||||
const _imports_0$5 = "/static/yujin/yujin_sousuo.png";
|
||||
const _imports_1$3 = "/static/yujin/yujin_tongji.png";
|
||||
const _imports_0$4 = "/static/my/edit.png";
|
||||
@@ -11,16 +13,18 @@ const _imports_0$2 = "/static/index/index_bg.png";
|
||||
const _imports_0$1 = "/static/index/phone.png";
|
||||
const _imports_1 = "/static/index/lock.png";
|
||||
const _imports_0 = "/static/index/蒙版组 260.png";
|
||||
exports._imports_0 = _imports_0$6;
|
||||
exports._imports_0$1 = _imports_0$5;
|
||||
exports._imports_0$2 = _imports_0$4;
|
||||
exports._imports_0$3 = _imports_0$3;
|
||||
exports._imports_0$4 = _imports_0$2;
|
||||
exports._imports_0$5 = _imports_0$1;
|
||||
exports._imports_0$6 = _imports_0;
|
||||
exports._imports_1 = _imports_1$3;
|
||||
exports._imports_1$1 = _imports_1$2;
|
||||
exports._imports_1$2 = _imports_1$1;
|
||||
exports._imports_1$3 = _imports_1;
|
||||
exports._imports_0 = _imports_0$7;
|
||||
exports._imports_0$1 = _imports_0$6;
|
||||
exports._imports_0$2 = _imports_0$5;
|
||||
exports._imports_0$3 = _imports_0$4;
|
||||
exports._imports_0$4 = _imports_0$3;
|
||||
exports._imports_0$5 = _imports_0$2;
|
||||
exports._imports_0$6 = _imports_0$1;
|
||||
exports._imports_0$7 = _imports_0;
|
||||
exports._imports_1 = _imports_1$4;
|
||||
exports._imports_1$1 = _imports_1$3;
|
||||
exports._imports_1$2 = _imports_1$2;
|
||||
exports._imports_1$3 = _imports_1$1;
|
||||
exports._imports_1$4 = _imports_1;
|
||||
exports._imports_2 = _imports_2;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/assets.js.map
|
||||
|
||||
59
unpackage/dist/dev/mp-weixin/common/vendor.js
vendored
59
unpackage/dist/dev/mp-weixin/common/vendor.js
vendored
@@ -784,6 +784,10 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
||||
}
|
||||
resetScheduling();
|
||||
}
|
||||
function getDepFromReactive(object, key) {
|
||||
var _a;
|
||||
return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
|
||||
}
|
||||
const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
|
||||
const builtInSymbols = new Set(
|
||||
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
|
||||
@@ -1501,6 +1505,38 @@ const shallowUnwrapHandlers = {
|
||||
function proxyRefs(objectWithRefs) {
|
||||
return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
|
||||
}
|
||||
function toRefs(object) {
|
||||
if (!isProxy(object)) {
|
||||
warn$2(`toRefs() expects a reactive object but received a plain one.`);
|
||||
}
|
||||
const ret = isArray$1(object) ? new Array(object.length) : {};
|
||||
for (const key in object) {
|
||||
ret[key] = propertyToRef(object, key);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
class ObjectRefImpl {
|
||||
constructor(_object, _key, _defaultValue) {
|
||||
this._object = _object;
|
||||
this._key = _key;
|
||||
this._defaultValue = _defaultValue;
|
||||
this.__v_isRef = true;
|
||||
}
|
||||
get value() {
|
||||
const val = this._object[this._key];
|
||||
return val === void 0 ? this._defaultValue : val;
|
||||
}
|
||||
set value(newVal) {
|
||||
this._object[this._key] = newVal;
|
||||
}
|
||||
get dep() {
|
||||
return getDepFromReactive(toRaw(this._object), this._key);
|
||||
}
|
||||
}
|
||||
function propertyToRef(source, key, defaultValue) {
|
||||
const val = source[key];
|
||||
return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
|
||||
}
|
||||
const stack = [];
|
||||
function pushWarningContext(vnode) {
|
||||
stack.push(vnode);
|
||||
@@ -7103,9 +7139,9 @@ function isConsoleWritable() {
|
||||
return isWritable;
|
||||
}
|
||||
function initRuntimeSocketService() {
|
||||
const hosts = "192.168.1.144,127.0.0.1,172.17.192.1";
|
||||
const hosts = "192.168.1.144,127.0.0.1,172.22.80.1";
|
||||
const port = "8090";
|
||||
const id = "mp-weixin_Capuq2";
|
||||
const id = "mp-weixin_VsFItf";
|
||||
const lazy = typeof swan !== "undefined";
|
||||
let restoreError = lazy ? () => {
|
||||
} : initOnError();
|
||||
@@ -8059,11 +8095,26 @@ const onShow = /* @__PURE__ */ createLifeCycleHook(
|
||||
1 | 2
|
||||
/* HookFlags.PAGE */
|
||||
);
|
||||
const onHide = /* @__PURE__ */ createLifeCycleHook(
|
||||
ON_HIDE,
|
||||
1 | 2
|
||||
/* HookFlags.PAGE */
|
||||
);
|
||||
const onLoad = /* @__PURE__ */ createLifeCycleHook(
|
||||
ON_LOAD,
|
||||
2
|
||||
/* HookFlags.PAGE */
|
||||
);
|
||||
const onReady = /* @__PURE__ */ createLifeCycleHook(
|
||||
ON_READY,
|
||||
2
|
||||
/* HookFlags.PAGE */
|
||||
);
|
||||
const onBackPress = /* @__PURE__ */ createLifeCycleHook(
|
||||
ON_BACK_PRESS,
|
||||
2
|
||||
/* HookFlags.PAGE */
|
||||
);
|
||||
const onReachBottom = /* @__PURE__ */ createLifeCycleHook(
|
||||
ON_REACH_BOTTOM,
|
||||
2
|
||||
@@ -8756,10 +8807,13 @@ exports.n = n;
|
||||
exports.nextTick$1 = nextTick$1;
|
||||
exports.o = o;
|
||||
exports.objToStyle = objToStyle;
|
||||
exports.onBackPress = onBackPress;
|
||||
exports.onBeforeMount = onBeforeMount;
|
||||
exports.onHide = onHide;
|
||||
exports.onLoad = onLoad;
|
||||
exports.onMounted = onMounted;
|
||||
exports.onReachBottom = onReachBottom;
|
||||
exports.onReady = onReady;
|
||||
exports.onShow = onShow;
|
||||
exports.onUnmounted = onUnmounted;
|
||||
exports.p = p;
|
||||
@@ -8771,6 +8825,7 @@ exports.s = s;
|
||||
exports.signatureProps = signatureProps;
|
||||
exports.sr = sr;
|
||||
exports.t = t;
|
||||
exports.toRefs = toRefs;
|
||||
exports.unref = unref;
|
||||
exports.useTranslate = useTranslate;
|
||||
exports.uuid = uuid;
|
||||
|
||||
657
unpackage/dist/dev/mp-weixin/components/hazard/HazardFormPopup.js
vendored
Normal file
657
unpackage/dist/dev/mp-weixin/components/hazard/HazardFormPopup.js
vendored
Normal file
@@ -0,0 +1,657 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_three_one_api_area = require("../../request/three_one_api/area.js");
|
||||
const utils_upload = require("../../utils/upload.js");
|
||||
const components_hazard_hazardForm = require("./hazardForm.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
(_easycom_up_upload2 + _easycom_up_input2 + _easycom_up_textarea2 + _easycom_u_popup2)();
|
||||
}
|
||||
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_upload + _easycom_up_input + _easycom_up_textarea + _easycom_u_popup)();
|
||||
}
|
||||
const LOCATION_PICKER_DRAFT_KEY = "hazard_form_location_picker_draft";
|
||||
const _sfc_main = {
|
||||
__name: "HazardFormPopup",
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: "填写隐患信息"
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: "collect"
|
||||
},
|
||||
modelValue: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
extraParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
showDraftBanner: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bodyHeight: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
canvasId: {
|
||||
type: String,
|
||||
default: "hazardFormWatermarkCanvas"
|
||||
}
|
||||
},
|
||||
emits: ["update:show", "update:modelValue", "success", "confirm", "clear-draft"],
|
||||
setup(__props, { expose: __expose, emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const popupVisible = common_vendor.computed({
|
||||
get: () => props.show,
|
||||
set: (value) => emit("update:show", value)
|
||||
});
|
||||
const isApiSuccess = (res) => Number(res == null ? void 0 : res.code) === 0 || Number(res == null ? void 0 : res.code) === 200;
|
||||
const bodyStyle = common_vendor.computed(() => props.bodyHeight ? { height: props.bodyHeight } : {});
|
||||
const canvasWidth = common_vendor.ref(300);
|
||||
const canvasHeight = common_vendor.ref(300);
|
||||
const submitting = common_vendor.ref(false);
|
||||
const aiAnalyzing = common_vendor.ref(false);
|
||||
const syncingFromParent = common_vendor.ref(false);
|
||||
const formData = common_vendor.reactive({
|
||||
title: "",
|
||||
level: 0,
|
||||
source: 0,
|
||||
description: "",
|
||||
tagIndex: 0,
|
||||
tagId: null,
|
||||
regulationId: null,
|
||||
regulationName: ""
|
||||
});
|
||||
const address = common_vendor.ref("");
|
||||
const lng = common_vendor.ref(0);
|
||||
const lat = common_vendor.ref(0);
|
||||
const areaId = common_vendor.ref("");
|
||||
const areaName = common_vendor.ref("");
|
||||
const fileList = common_vendor.ref([]);
|
||||
const tagOptions = common_vendor.ref([]);
|
||||
const showLawPopup = common_vendor.ref(false);
|
||||
const lawKeyword = common_vendor.ref("");
|
||||
const selectedLawId = common_vendor.ref(null);
|
||||
const selectedLawName = common_vendor.ref("");
|
||||
const lawList = common_vendor.ref([]);
|
||||
const lawLoading = common_vendor.ref(false);
|
||||
const lawPageNum = common_vendor.ref(1);
|
||||
const lawPageSize = common_vendor.ref(10);
|
||||
const hasMoreLaw = common_vendor.ref(true);
|
||||
const showAreaPicker = common_vendor.ref(false);
|
||||
const areaList = common_vendor.ref([]);
|
||||
const tempAreaId = common_vendor.ref("");
|
||||
const choosingLocation = common_vendor.ref(false);
|
||||
const suppressModelEmit = common_vendor.ref(false);
|
||||
const uploadInstance = common_vendor.getCurrentInstance();
|
||||
const { afterRead, deletePic } = utils_upload.createUploadListHandlers(fileList, {
|
||||
watermark: {
|
||||
canvasId: props.canvasId,
|
||||
canvasWidthRef: canvasWidth,
|
||||
canvasHeightRef: canvasHeight,
|
||||
instance: uploadInstance
|
||||
}
|
||||
});
|
||||
function getPayload() {
|
||||
syncTagIdFromIndex();
|
||||
return {
|
||||
formData: {
|
||||
title: formData.title,
|
||||
level: formData.level,
|
||||
source: formData.source,
|
||||
description: formData.description,
|
||||
tagIndex: formData.tagIndex,
|
||||
tagId: formData.tagId,
|
||||
regulationId: formData.regulationId,
|
||||
regulationName: formData.regulationName
|
||||
},
|
||||
address: address.value,
|
||||
lng: lng.value,
|
||||
lat: lat.value,
|
||||
areaId: areaId.value,
|
||||
areaName: areaName.value,
|
||||
fileList: fileList.value,
|
||||
tagOptions: tagOptions.value
|
||||
};
|
||||
}
|
||||
function applyPayload(payload) {
|
||||
if (!payload)
|
||||
return;
|
||||
syncingFromParent.value = true;
|
||||
const data = payload.formData || {};
|
||||
formData.title = data.title || "";
|
||||
formData.level = data.level ?? 0;
|
||||
formData.source = data.source ?? 0;
|
||||
formData.description = data.description || "";
|
||||
formData.tagIndex = data.tagIndex ?? 0;
|
||||
formData.tagId = data.tagId ?? null;
|
||||
formData.regulationId = data.regulationId ?? null;
|
||||
formData.regulationName = data.regulationName || "";
|
||||
address.value = payload.address || "";
|
||||
lng.value = payload.lng || 0;
|
||||
lat.value = payload.lat || 0;
|
||||
areaId.value = payload.areaId || "";
|
||||
areaName.value = payload.areaName || "";
|
||||
fileList.value = payload.fileList ? [...payload.fileList] : [];
|
||||
selectedLawId.value = data.regulationId ?? null;
|
||||
selectedLawName.value = data.regulationName || "";
|
||||
syncingFromParent.value = false;
|
||||
}
|
||||
function hasPayloadContent(payload) {
|
||||
if (!payload)
|
||||
return false;
|
||||
const data = payload.formData || {};
|
||||
const files = payload.fileList || [];
|
||||
return !!(data.title || data.description || data.regulationName || payload.address || files.length > 0);
|
||||
}
|
||||
function getLocationPickerDraftKey() {
|
||||
var _a;
|
||||
return ((_a = props.extraParams) == null ? void 0 : _a.locationDraftKey) || LOCATION_PICKER_DRAFT_KEY;
|
||||
}
|
||||
function saveLocationPickerDraft() {
|
||||
const snapshot = getPayload();
|
||||
try {
|
||||
common_vendor.index.setStorageSync(getLocationPickerDraftKey(), snapshot);
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at components/hazard/HazardFormPopup.vue:400", "保存选点草稿失败:", error);
|
||||
}
|
||||
return snapshot;
|
||||
}
|
||||
function loadLocationPickerDraft() {
|
||||
try {
|
||||
const draft = common_vendor.index.getStorageSync(getLocationPickerDraftKey());
|
||||
return draft && typeof draft === "object" ? draft : null;
|
||||
} catch (error) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
function clearLocationPickerDraft() {
|
||||
try {
|
||||
common_vendor.index.removeStorageSync(getLocationPickerDraftKey());
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at components/hazard/HazardFormPopup.vue:418", "清除选点草稿失败:", error);
|
||||
}
|
||||
}
|
||||
function restoreAfterLocationPicker(patch = {}) {
|
||||
const draft = loadLocationPickerDraft();
|
||||
if (!draft)
|
||||
return false;
|
||||
applyPayload({
|
||||
...draft,
|
||||
...patch,
|
||||
formData: {
|
||||
...draft.formData || {},
|
||||
...patch.formData || {}
|
||||
},
|
||||
fileList: patch.fileList ?? draft.fileList ?? []
|
||||
});
|
||||
clearLocationPickerDraft();
|
||||
return true;
|
||||
}
|
||||
function reopenPopupAfterLocation() {
|
||||
common_vendor.nextTick$1(() => {
|
||||
choosingLocation.value = false;
|
||||
popupVisible.value = true;
|
||||
emitModelValue();
|
||||
});
|
||||
}
|
||||
function resetForm() {
|
||||
applyPayload(components_hazard_hazardForm.createEmptyHazardPayload());
|
||||
selectedLawId.value = null;
|
||||
selectedLawName.value = "";
|
||||
tempAreaId.value = "";
|
||||
clearLocationPickerDraft();
|
||||
}
|
||||
function syncTagIdFromIndex() {
|
||||
const selectedTag = tagOptions.value[formData.tagIndex];
|
||||
formData.tagId = (selectedTag == null ? void 0 : selectedTag.id) ?? formData.tagId ?? null;
|
||||
}
|
||||
function onChooseSelect(field, index) {
|
||||
formData[field] = Number(index);
|
||||
if (field === "tagIndex") {
|
||||
syncTagIdFromIndex();
|
||||
}
|
||||
emitModelValue();
|
||||
}
|
||||
function emitModelValue() {
|
||||
if (suppressModelEmit.value || syncingFromParent.value || props.modelValue === null)
|
||||
return;
|
||||
if (props.mode === "collect" || props.mode === "direct")
|
||||
return;
|
||||
emit("update:modelValue", getPayload());
|
||||
}
|
||||
function closePopup() {
|
||||
popupVisible.value = false;
|
||||
}
|
||||
function handleClose() {
|
||||
closePopup();
|
||||
}
|
||||
function validateForm() {
|
||||
if (fileList.value.length === 0) {
|
||||
common_vendor.index.showToast({ title: "请上传隐患图片", icon: "none" });
|
||||
return false;
|
||||
}
|
||||
if (!formData.title) {
|
||||
common_vendor.index.showToast({ title: "请输入隐患标题", icon: "none" });
|
||||
return false;
|
||||
}
|
||||
if (!address.value) {
|
||||
common_vendor.index.showToast({ title: "请输入隐患位置", icon: "none" });
|
||||
return false;
|
||||
}
|
||||
if (!formData.description) {
|
||||
common_vendor.index.showToast({ title: "请输入隐患描述", icon: "none" });
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
async function handleConfirm() {
|
||||
if (!validateForm())
|
||||
return;
|
||||
const payload = getPayload();
|
||||
if (props.mode === "collect") {
|
||||
if (props.modelValue !== null) {
|
||||
emit("update:modelValue", payload);
|
||||
}
|
||||
emit("confirm", payload);
|
||||
closePopup();
|
||||
common_vendor.index.showToast({ title: "隐患信息已暂存", icon: "success" });
|
||||
return;
|
||||
}
|
||||
submitting.value = true;
|
||||
try {
|
||||
const params = components_hazard_hazardForm.buildHiddenDangerParams(payload, props.extraParams);
|
||||
const res = await request_api.addHiddenDanger(params);
|
||||
if (isApiSuccess(res)) {
|
||||
suppressModelEmit.value = true;
|
||||
closePopup();
|
||||
emit("success", { ...payload, hazardId: res.data });
|
||||
await common_vendor.nextTick$1();
|
||||
resetForm();
|
||||
common_vendor.index.showToast({ title: res.msg || "新增成功", icon: "success" });
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "新增失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at components/hazard/HazardFormPopup.vue:534", error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
} finally {
|
||||
suppressModelEmit.value = false;
|
||||
submitting.value = false;
|
||||
}
|
||||
}
|
||||
function openLawPopup() {
|
||||
showLawPopup.value = true;
|
||||
if (lawList.value.length === 0) {
|
||||
fetchRegulationList();
|
||||
}
|
||||
}
|
||||
async function fetchRegulationList(isLoadMore = false) {
|
||||
var _a;
|
||||
if (lawLoading.value)
|
||||
return;
|
||||
lawLoading.value = true;
|
||||
try {
|
||||
const params = {
|
||||
pageNum: lawPageNum.value,
|
||||
pageSize: lawPageSize.value,
|
||||
status: 1
|
||||
};
|
||||
if ((_a = lawKeyword.value) == null ? void 0 : _a.trim()) {
|
||||
params.keyword = lawKeyword.value.trim();
|
||||
}
|
||||
const res = await request_api.getRegulationList(params);
|
||||
if (res.code === 0) {
|
||||
const records = res.data.records || res.data || [];
|
||||
lawList.value = isLoadMore ? [...lawList.value, ...records] : records;
|
||||
const total = res.data.total || 0;
|
||||
hasMoreLaw.value = lawList.value.length < total;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at components/hazard/HazardFormPopup.vue:569", "获取法规列表失败:", error);
|
||||
} finally {
|
||||
lawLoading.value = false;
|
||||
}
|
||||
}
|
||||
function searchRegulation() {
|
||||
lawPageNum.value = 1;
|
||||
lawList.value = [];
|
||||
hasMoreLaw.value = true;
|
||||
fetchRegulationList();
|
||||
}
|
||||
function loadMoreLaw() {
|
||||
if (!hasMoreLaw.value || lawLoading.value)
|
||||
return;
|
||||
lawPageNum.value++;
|
||||
fetchRegulationList(true);
|
||||
}
|
||||
function selectLaw(item) {
|
||||
selectedLawId.value = item.id;
|
||||
selectedLawName.value = item.depict || item.keyword || "";
|
||||
}
|
||||
function confirmLaw() {
|
||||
if (selectedLawId.value) {
|
||||
formData.regulationId = selectedLawId.value;
|
||||
formData.regulationName = selectedLawName.value;
|
||||
}
|
||||
showLawPopup.value = false;
|
||||
emitModelValue();
|
||||
}
|
||||
function openAreaPicker() {
|
||||
tempAreaId.value = areaId.value;
|
||||
showAreaPicker.value = true;
|
||||
}
|
||||
async function fetchAreaList() {
|
||||
var _a;
|
||||
try {
|
||||
const res = await request_three_one_api_area.getAreaList();
|
||||
if (res.code === 0 && ((_a = res.data) == null ? void 0 : _a.records)) {
|
||||
areaList.value = res.data.records;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at components/hazard/HazardFormPopup.vue:614", "获取区域列表失败:", error);
|
||||
}
|
||||
}
|
||||
function confirmAreaSelect() {
|
||||
if (tempAreaId.value) {
|
||||
areaId.value = tempAreaId.value;
|
||||
const selected = areaList.value.find((item) => item.id === tempAreaId.value);
|
||||
areaName.value = selected ? selected.name : "";
|
||||
}
|
||||
showAreaPicker.value = false;
|
||||
emitModelValue();
|
||||
}
|
||||
function chooseLocation() {
|
||||
choosingLocation.value = true;
|
||||
saveLocationPickerDraft();
|
||||
closePopup();
|
||||
setTimeout(() => {
|
||||
common_vendor.index.getLocation({
|
||||
type: "gcj02",
|
||||
success: (locationRes) => {
|
||||
openChooseLocation(locationRes.latitude, locationRes.longitude);
|
||||
},
|
||||
fail: () => {
|
||||
openChooseLocation();
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
}
|
||||
function openChooseLocation(latitude, longitude) {
|
||||
const options = {};
|
||||
if (latitude != null && longitude != null) {
|
||||
options.latitude = latitude;
|
||||
options.longitude = longitude;
|
||||
}
|
||||
common_vendor.index.chooseLocation({
|
||||
...options,
|
||||
success: (res) => {
|
||||
restoreAfterLocationPicker({
|
||||
address: res.address + (res.name ? `(${res.name})` : ""),
|
||||
lng: res.longitude,
|
||||
lat: res.latitude
|
||||
});
|
||||
reopenPopupAfterLocation();
|
||||
},
|
||||
fail: (err) => {
|
||||
restoreAfterLocationPicker();
|
||||
reopenPopupAfterLocation();
|
||||
if (err.errMsg && err.errMsg.indexOf("cancel") === -1) {
|
||||
common_vendor.index.showToast({ title: "选择位置失败", icon: "none" });
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
async function handleAiAnalyze() {
|
||||
const imageFiles = fileList.value.filter((f) => {
|
||||
return f.status === "success" && f.url.toLowerCase().match(/\.(jpg|jpeg|png|gif|bmp|webp)$/);
|
||||
});
|
||||
if (imageFiles.length === 0) {
|
||||
common_vendor.index.showToast({ title: "请先上传隐患图片", icon: "none" });
|
||||
return;
|
||||
}
|
||||
aiAnalyzing.value = true;
|
||||
try {
|
||||
const analyzeRes = await request_api.analyzeHazardImage({ imageUrl: imageFiles[0].url });
|
||||
if (analyzeRes.code === 0 && analyzeRes.data) {
|
||||
const aiData = analyzeRes.data;
|
||||
if (aiData.title)
|
||||
formData.title = aiData.title;
|
||||
if (aiData.description)
|
||||
formData.description = aiData.description;
|
||||
if (aiData.level) {
|
||||
const levelIndex = components_hazard_hazardForm.AI_LEVEL_MAP[aiData.level];
|
||||
if (levelIndex !== void 0) {
|
||||
formData.level = levelIndex;
|
||||
}
|
||||
}
|
||||
emitModelValue();
|
||||
common_vendor.index.showToast({ title: "AI分析完成,已自动填充", icon: "success", duration: 2e3 });
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: analyzeRes.msg || "AI分析失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at components/hazard/HazardFormPopup.vue:699", "AI分析接口调用失败:", error);
|
||||
common_vendor.index.showToast({ title: "AI分析失败,请重试", icon: "none" });
|
||||
} finally {
|
||||
aiAnalyzing.value = false;
|
||||
}
|
||||
}
|
||||
async function fetchTagOptions() {
|
||||
try {
|
||||
const res = await request_api.getHiddenDangerLabelList();
|
||||
if (res.code === 0) {
|
||||
tagOptions.value = res.data.map((item) => ({
|
||||
id: item.id,
|
||||
title: item.name
|
||||
}));
|
||||
syncTagIdFromIndex();
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at components/hazard/HazardFormPopup.vue:717", "获取标签列表失败:", error);
|
||||
}
|
||||
}
|
||||
common_vendor.watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
if (props.mode === "direct")
|
||||
return;
|
||||
if (hasPayloadContent(val)) {
|
||||
applyPayload(val);
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => props.show,
|
||||
(val) => {
|
||||
if (val && areaList.value.length === 0) {
|
||||
fetchAreaList();
|
||||
}
|
||||
if (!val)
|
||||
return;
|
||||
if (choosingLocation.value) {
|
||||
return;
|
||||
}
|
||||
const locationDraft = loadLocationPickerDraft();
|
||||
if (locationDraft) {
|
||||
applyPayload(locationDraft);
|
||||
clearLocationPickerDraft();
|
||||
return;
|
||||
}
|
||||
if (hasPayloadContent(props.modelValue)) {
|
||||
applyPayload(props.modelValue);
|
||||
}
|
||||
}
|
||||
);
|
||||
fetchTagOptions();
|
||||
fetchAreaList();
|
||||
__expose({
|
||||
getPayload,
|
||||
applyPayload,
|
||||
resetForm,
|
||||
validateForm
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(__props.title),
|
||||
b: common_vendor.o(handleClose),
|
||||
c: __props.showDraftBanner
|
||||
}, __props.showDraftBanner ? {
|
||||
d: common_vendor.o(($event) => emit("clear-draft"))
|
||||
} : {}, {
|
||||
e: common_vendor.f(common_vendor.unref(components_hazard_hazardForm.SOURCE_OPTIONS), (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.title),
|
||||
b: item.id,
|
||||
c: formData.source === index ? 1 : "",
|
||||
d: common_vendor.o(($event) => onChooseSelect("source", index), item.id)
|
||||
};
|
||||
}),
|
||||
f: common_vendor.o(common_vendor.unref(afterRead)),
|
||||
g: common_vendor.o(common_vendor.unref(deletePic)),
|
||||
h: common_vendor.p({
|
||||
fileList: fileList.value,
|
||||
name: "1",
|
||||
multiple: true,
|
||||
imageMode: "aspectFill",
|
||||
maxCount: 10
|
||||
}),
|
||||
i: __props.canvasId,
|
||||
j: canvasWidth.value,
|
||||
k: canvasHeight.value,
|
||||
l: canvasWidth.value + "px",
|
||||
m: canvasHeight.value + "px",
|
||||
n: !aiAnalyzing.value
|
||||
}, !aiAnalyzing.value ? {} : {}, {
|
||||
o: common_vendor.t(aiAnalyzing.value ? "AI识别中..." : "AI 识别隐患"),
|
||||
p: aiAnalyzing.value,
|
||||
q: aiAnalyzing.value,
|
||||
r: common_vendor.o(handleAiAnalyze),
|
||||
s: common_vendor.o(($event) => formData.title = $event),
|
||||
t: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: formData.title
|
||||
}),
|
||||
v: common_vendor.f(common_vendor.unref(components_hazard_hazardForm.LEVEL_OPTIONS), (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.title),
|
||||
b: item.id,
|
||||
c: formData.level === index ? 1 : "",
|
||||
d: common_vendor.o(($event) => onChooseSelect("level", index), item.id)
|
||||
};
|
||||
}),
|
||||
w: common_vendor.o(($event) => address.value = $event),
|
||||
x: common_vendor.p({
|
||||
placeholder: "请输入地址",
|
||||
border: "surround",
|
||||
modelValue: address.value
|
||||
}),
|
||||
y: common_vendor.o(chooseLocation),
|
||||
z: common_vendor.t(formData.regulationName || "请选择法律依据"),
|
||||
A: !formData.regulationName ? 1 : "",
|
||||
B: common_vendor.o(openLawPopup),
|
||||
C: common_vendor.t(areaName.value || "请选择隐患区域"),
|
||||
D: !areaName.value ? 1 : "",
|
||||
E: common_vendor.o(openAreaPicker),
|
||||
F: common_vendor.o(($event) => formData.description = $event),
|
||||
G: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: formData.description
|
||||
}),
|
||||
H: common_vendor.f(tagOptions.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.title),
|
||||
b: item.id,
|
||||
c: formData.tagIndex === index ? 1 : "",
|
||||
d: common_vendor.o(($event) => onChooseSelect("tagIndex", index), item.id)
|
||||
};
|
||||
}),
|
||||
I: common_vendor.s(bodyStyle.value),
|
||||
J: common_vendor.o(handleClose),
|
||||
K: submitting.value,
|
||||
L: common_vendor.o(handleConfirm),
|
||||
M: common_vendor.o(handleClose),
|
||||
N: common_vendor.o(($event) => popupVisible.value = $event),
|
||||
O: common_vendor.p({
|
||||
mode: "center",
|
||||
round: "20",
|
||||
["safe-area-inset-bottom"]: false,
|
||||
show: popupVisible.value
|
||||
}),
|
||||
P: common_vendor.o(($event) => showLawPopup.value = false),
|
||||
Q: common_vendor.o(searchRegulation),
|
||||
R: lawKeyword.value,
|
||||
S: common_vendor.o(($event) => lawKeyword.value = $event.detail.value),
|
||||
T: common_vendor.o(searchRegulation),
|
||||
U: lawLoading.value && lawList.value.length === 0
|
||||
}, lawLoading.value && lawList.value.length === 0 ? {} : !lawLoading.value && lawList.value.length === 0 ? {} : common_vendor.e({
|
||||
W: common_vendor.f(lawList.value, (item, k0, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.depict),
|
||||
b: common_vendor.t(item.legalBasis),
|
||||
c: selectedLawId.value === item.id ? 1 : "",
|
||||
d: item.id,
|
||||
e: common_vendor.o(($event) => selectLaw(item), item.id)
|
||||
};
|
||||
}),
|
||||
X: lawLoading.value
|
||||
}, lawLoading.value ? {} : {}), {
|
||||
V: !lawLoading.value && lawList.value.length === 0,
|
||||
Y: common_vendor.o(loadMoreLaw),
|
||||
Z: common_vendor.o(($event) => showLawPopup.value = false),
|
||||
aa: common_vendor.o(confirmLaw),
|
||||
ab: common_vendor.o(($event) => showLawPopup.value = false),
|
||||
ac: common_vendor.p({
|
||||
show: showLawPopup.value,
|
||||
mode: "center",
|
||||
round: "20",
|
||||
["safe-area-inset-bottom"]: false
|
||||
}),
|
||||
ad: common_vendor.o(($event) => showAreaPicker.value = false),
|
||||
ae: common_vendor.o(confirmAreaSelect),
|
||||
af: common_vendor.f(areaList.value, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.color,
|
||||
b: common_vendor.t(item.name),
|
||||
c: tempAreaId.value === item.id
|
||||
}, tempAreaId.value === item.id ? {} : {}, {
|
||||
d: item.id,
|
||||
e: tempAreaId.value === item.id ? 1 : "",
|
||||
f: common_vendor.o(($event) => tempAreaId.value = item.id, item.id)
|
||||
});
|
||||
}),
|
||||
ag: areaList.value.length === 0
|
||||
}, areaList.value.length === 0 ? {} : {}, {
|
||||
ah: common_vendor.o(($event) => showAreaPicker.value = false),
|
||||
ai: common_vendor.p({
|
||||
show: showAreaPicker.value,
|
||||
mode: "bottom",
|
||||
round: "20"
|
||||
})
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-fd540320"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazard/HazardFormPopup.js.map
|
||||
9
unpackage/dist/dev/mp-weixin/components/hazard/HazardFormPopup.json
vendored
Normal file
9
unpackage/dist/dev/mp-weixin/components/hazard/HazardFormPopup.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload",
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/components/hazard/HazardFormPopup.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/components/hazard/HazardFormPopup.wxml
vendored
Normal file
File diff suppressed because one or more lines are too long
373
unpackage/dist/dev/mp-weixin/components/hazard/HazardFormPopup.wxss
vendored
Normal file
373
unpackage/dist/dev/mp-weixin/components/hazard/HazardFormPopup.wxss
vendored
Normal file
@@ -0,0 +1,373 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.popup-content.data-v-fd540320 {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-header.data-v-fd540320 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.popup-header .popup-title.data-v-fd540320 {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
.popup-header .popup-close.data-v-fd540320 {
|
||||
font-size: 40rpx;
|
||||
color: #999;
|
||||
line-height: 1;
|
||||
}
|
||||
.popup-body.data-v-fd540320 {
|
||||
padding: 30rpx;
|
||||
max-height: 900rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.draft-banner.data-v-fd540320 {
|
||||
font-size: 24rpx;
|
||||
background-color: #fff7eb;
|
||||
border: 1rpx solid #ffe4cc;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 16rpx 20rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #fa8c16;
|
||||
}
|
||||
.draft-banner-left.data-v-fd540320 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.draft-banner-icon.data-v-fd540320 {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.draft-banner-action.data-v-fd540320 {
|
||||
cursor: pointer;
|
||||
padding: 0 10rpx;
|
||||
color: #2667e9;
|
||||
font-weight: bold;
|
||||
}
|
||||
.hazard-choose-scroll.data-v-fd540320 {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.hazard-choose-row.data-v-fd540320 {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
.hazard-choose-wrap.data-v-fd540320 {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.hazard-choose-tag.data-v-fd540320 {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
background: #fff;
|
||||
flex-shrink: 0;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.hazard-choose-tag--source.data-v-fd540320 {
|
||||
width: 152rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
.hazard-choose-tag--level.data-v-fd540320 {
|
||||
width: 183rpx;
|
||||
height: 72rpx;
|
||||
}
|
||||
.hazard-choose-tag--tag.data-v-fd540320 {
|
||||
min-width: 120rpx;
|
||||
height: 64rpx;
|
||||
padding: 0 24rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.hazard-choose-tag--active.data-v-fd540320 {
|
||||
background: #2667e9;
|
||||
border-color: #2667e9;
|
||||
}
|
||||
.hazard-choose-tag--active .hazard-choose-tag__text.data-v-fd540320 {
|
||||
color: #fff;
|
||||
}
|
||||
.hazard-choose-tag__text.data-v-fd540320 {
|
||||
font-size: 24rpx;
|
||||
line-height: 1.2;
|
||||
color: #606266;
|
||||
text-align: center;
|
||||
}
|
||||
.ai-btn-wrapper.data-v-fd540320 {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.ai-analyze-btn.data-v-fd540320 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 72rpx;
|
||||
padding: 0 32rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #4facfe 0%, #2668ea 100%);
|
||||
border-radius: 36rpx;
|
||||
border: none;
|
||||
}
|
||||
.ai-analyze-btn.data-v-fd540320::after {
|
||||
border: none;
|
||||
}
|
||||
.ai-analyze-btn .ai-btn-icon.data-v-fd540320 {
|
||||
margin-right: 8rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.ai-analyze-btn[disabled].data-v-fd540320 {
|
||||
opacity: 0.7;
|
||||
}
|
||||
.popup-footer.data-v-fd540320 {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
.popup-footer button.data-v-fd540320 {
|
||||
flex: 1;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 0;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.popup-footer button.data-v-fd540320::after {
|
||||
border: none;
|
||||
}
|
||||
.popup-footer .btn-cancel.data-v-fd540320 {
|
||||
background: #fff;
|
||||
color: #666;
|
||||
}
|
||||
.popup-footer .btn-confirm.data-v-fd540320 {
|
||||
color: #fff;
|
||||
}
|
||||
.address-box.data-v-fd540320 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.address-box .address-input-wrapper.data-v-fd540320 {
|
||||
flex: 1;
|
||||
}
|
||||
.address-box .btn-address.data-v-fd540320 {
|
||||
flex-shrink: 0;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
padding: 0 30rpx;
|
||||
font-size: 26rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #fff;
|
||||
}
|
||||
.address-box .btn-address.data-v-fd540320::after {
|
||||
border: none;
|
||||
}
|
||||
.select-trigger.data-v-fd540320 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #fff;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
}
|
||||
.select-trigger .select-value.data-v-fd540320 {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.select-trigger .select-value.placeholder.data-v-fd540320 {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
.picker-popup.data-v-fd540320 {
|
||||
background: #fff;
|
||||
}
|
||||
.picker-popup .picker-header.data-v-fd540320 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.picker-popup .picker-header .picker-cancel.data-v-fd540320 {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
.picker-popup .picker-header .picker-title.data-v-fd540320 {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.picker-popup .picker-header .picker-confirm.data-v-fd540320 {
|
||||
font-size: 28rpx;
|
||||
color: #2667e9;
|
||||
}
|
||||
.picker-popup .picker-body.data-v-fd540320 {
|
||||
max-height: 600rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.picker-popup .picker-item.data-v-fd540320 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
.picker-popup .picker-item.data-v-fd540320:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.picker-popup .picker-item.picker-item-active.data-v-fd540320 {
|
||||
color: #2667e9;
|
||||
}
|
||||
.area-color-dot.data-v-fd540320 {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
.law-popup.data-v-fd540320 {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
max-height: 80vh;
|
||||
}
|
||||
.law-popup .popup-header.data-v-fd540320 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.law-popup .popup-header .popup-title.data-v-fd540320 {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.law-popup .popup-header .popup-close.data-v-fd540320 {
|
||||
font-size: 40rpx;
|
||||
color: #999;
|
||||
}
|
||||
.search-box.data-v-fd540320 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #f5f5f5;
|
||||
border-radius: 40rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
margin: 20rpx 30rpx;
|
||||
}
|
||||
.search-box .search-icon.data-v-fd540320 {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.search-box .search-input.data-v-fd540320 {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
.search-box .search-btn.data-v-fd540320 {
|
||||
color: #2667e9;
|
||||
font-size: 26rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
.loading-tip.data-v-fd540320,
|
||||
.empty-tip.data-v-fd540320 {
|
||||
text-align: center;
|
||||
padding: 40rpx;
|
||||
color: #999;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.law-list.data-v-fd540320 {
|
||||
max-height: 400rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.law-item.data-v-fd540320 {
|
||||
padding: 24rpx;
|
||||
border: 2rpx solid #e5e5e5;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 16rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.law-item .law-title.data-v-fd540320 {
|
||||
line-height: 1.5;
|
||||
margin-bottom: 8rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.law-item .law-basis.data-v-fd540320 {
|
||||
font-size: 24rpx;
|
||||
line-height: 1.4;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
.law-item-active.data-v-fd540320 {
|
||||
border-color: #2667e9;
|
||||
background: #f0f6ff;
|
||||
}
|
||||
.law-popup-footer.data-v-fd540320 {
|
||||
display: flex;
|
||||
padding: 30rpx;
|
||||
border-top: 1rpx solid #eee;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.law-popup-footer button.data-v-fd540320 {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
.law-popup-footer button.data-v-fd540320::after {
|
||||
border: none;
|
||||
}
|
||||
.law-popup-footer .btn-cancel.data-v-fd540320 {
|
||||
background: #f5f5f5;
|
||||
color: #666;
|
||||
}
|
||||
.law-popup-footer .btn-confirm.data-v-fd540320 {
|
||||
background: #2667e9;
|
||||
color: #fff;
|
||||
}
|
||||
73
unpackage/dist/dev/mp-weixin/components/hazard/hazardForm.js
vendored
Normal file
73
unpackage/dist/dev/mp-weixin/components/hazard/hazardForm.js
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
"use strict";
|
||||
const utils_upload = require("../../utils/upload.js");
|
||||
const LEVEL_OPTIONS = [
|
||||
{ id: 2, title: "一般隐患" },
|
||||
{ id: 3, title: "重大隐患" }
|
||||
];
|
||||
const SOURCE_OPTIONS = [
|
||||
{ id: 1, title: "部门检查" },
|
||||
{ id: 2, title: "督导检查" },
|
||||
{ id: 3, title: "企业自查" },
|
||||
{ id: 4, title: "行业互查" }
|
||||
];
|
||||
const AI_LEVEL_MAP = {
|
||||
轻微: 0,
|
||||
轻微隐患: 0,
|
||||
一般: 0,
|
||||
一般隐患: 0,
|
||||
重大: 1,
|
||||
重大隐患: 1
|
||||
};
|
||||
function createEmptyHazardPayload() {
|
||||
return {
|
||||
formData: {
|
||||
title: "",
|
||||
level: 0,
|
||||
source: 0,
|
||||
description: "",
|
||||
tagIndex: 0,
|
||||
tagId: null,
|
||||
regulationId: null,
|
||||
regulationName: ""
|
||||
},
|
||||
address: "",
|
||||
lng: 0,
|
||||
lat: 0,
|
||||
areaId: "",
|
||||
areaName: "",
|
||||
fileList: []
|
||||
};
|
||||
}
|
||||
function buildHiddenDangerParams(payload, extra = {}) {
|
||||
var _a, _b, _c;
|
||||
const { formData, address, lng, lat, areaId, fileList } = payload;
|
||||
const selectedTag = (_a = payload.tagOptions) == null ? void 0 : _a[formData.tagIndex];
|
||||
const tagId = formData.tagId ?? (selectedTag ? selectedTag.id : null);
|
||||
return {
|
||||
title: formData.title,
|
||||
level: ((_b = LEVEL_OPTIONS[formData.level]) == null ? void 0 : _b.id) || 2,
|
||||
lng: lng || 0,
|
||||
lat: lat || 0,
|
||||
address: address || "",
|
||||
areaId: areaId || null,
|
||||
description: formData.description || "",
|
||||
source: ((_c = SOURCE_OPTIONS[formData.source]) == null ? void 0 : _c.title) || "",
|
||||
tagId,
|
||||
attachments: (fileList || []).filter((f) => f.status === "success").map((file) => utils_upload.buildAttachmentItem(file)),
|
||||
regulationId: formData.regulationId || null,
|
||||
...extra
|
||||
};
|
||||
}
|
||||
function hasValidHazardPayload(payload) {
|
||||
if (!payload)
|
||||
return false;
|
||||
const { formData, fileList } = payload;
|
||||
return !!((formData == null ? void 0 : formData.title) && (fileList == null ? void 0 : fileList.length) > 0);
|
||||
}
|
||||
exports.AI_LEVEL_MAP = AI_LEVEL_MAP;
|
||||
exports.LEVEL_OPTIONS = LEVEL_OPTIONS;
|
||||
exports.SOURCE_OPTIONS = SOURCE_OPTIONS;
|
||||
exports.buildHiddenDangerParams = buildHiddenDangerParams;
|
||||
exports.createEmptyHazardPayload = createEmptyHazardPayload;
|
||||
exports.hasValidHazardPayload = hasValidHazardPayload;
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazard/hazardForm.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/components/hazard/index.js
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/components/hazard/index.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
require("../../common/vendor.js");
|
||||
require("../../request/request.js");
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazard/index.js.map
|
||||
242
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanel.js
vendored
Normal file
242
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanel.js
vendored
Normal file
@@ -0,0 +1,242 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
const components_hazardDetail_hazardDetail = require("./hazardDetail.js");
|
||||
const components_hazardDetail_useHazardDetailScroll = require("./useHazardDetailScroll.js");
|
||||
const _sfc_main = {
|
||||
__name: "HazardDetailPanel",
|
||||
props: {
|
||||
detail: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const { detail, loading } = common_vendor.toRefs(props);
|
||||
const {
|
||||
historyList,
|
||||
activeIndex,
|
||||
contentScrollIntoView,
|
||||
stepScrollIntoView,
|
||||
scrollWithAnimation,
|
||||
onContentScroll,
|
||||
onScrollToLower,
|
||||
scrollToNode,
|
||||
scheduleMeasureLayout
|
||||
} = components_hazardDetail_useHazardDetailScroll.useHazardDetailScroll(detail, loading);
|
||||
const statusClass = common_vendor.computed(() => {
|
||||
var _a, _b;
|
||||
return components_hazardDetail_hazardDetail.getStatusClass((_a = props.detail) == null ? void 0 : _a.status, (_b = props.detail) == null ? void 0 : _b.statusName);
|
||||
});
|
||||
const LEVEL_CLASS_MAP = {
|
||||
2: "level-normal",
|
||||
3: "level-major"
|
||||
};
|
||||
const LEVEL_NAME_CLASS_MAP = {
|
||||
一般: "level-normal",
|
||||
一般隐患: "level-normal",
|
||||
重大: "level-major",
|
||||
重大隐患: "level-major"
|
||||
};
|
||||
const getLevelTagClass = (content) => {
|
||||
const level = content == null ? void 0 : content.level;
|
||||
const levelName = content == null ? void 0 : content.levelName;
|
||||
if (level != null && LEVEL_CLASS_MAP[level]) {
|
||||
return LEVEL_CLASS_MAP[level];
|
||||
}
|
||||
if (levelName && LEVEL_NAME_CLASS_MAP[levelName]) {
|
||||
return LEVEL_NAME_CLASS_MAP[levelName];
|
||||
}
|
||||
return "";
|
||||
};
|
||||
const resolveFileUrl = (path) => request_request.toImageUrl(path);
|
||||
const formatCost = (cost) => {
|
||||
if (cost == null || cost === "")
|
||||
return "-";
|
||||
const num = Number(cost);
|
||||
return Number.isNaN(num) ? "-" : `${num} 元`;
|
||||
};
|
||||
const previewSingle = (path) => {
|
||||
const url = resolveFileUrl(path);
|
||||
if (!url)
|
||||
return;
|
||||
common_vendor.index.previewImage({ current: url, urls: [url] });
|
||||
};
|
||||
const previewImages = (attachments, index) => {
|
||||
const urls = (attachments || []).filter((f) => f.fileType === "image" || !f.fileType).map((f) => resolveFileUrl(f.filePath)).filter(Boolean);
|
||||
if (!urls.length)
|
||||
return;
|
||||
common_vendor.index.previewImage({ current: urls[index] || urls[0], urls });
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(common_vendor.unref(detail).title || "-"),
|
||||
b: common_vendor.t(common_vendor.unref(detail).statusName || "-"),
|
||||
c: common_vendor.n(statusClass.value),
|
||||
d: common_vendor.t(common_vendor.unref(detail).createdAt || "-"),
|
||||
e: common_vendor.unref(loading)
|
||||
}, common_vendor.unref(loading) ? {} : common_vendor.unref(historyList).length === 0 ? {} : {
|
||||
g: common_vendor.f(common_vendor.unref(historyList), (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.nodeName),
|
||||
b: common_vendor.unref(activeIndex) === index ? 1 : "",
|
||||
c: index < common_vendor.unref(historyList).length - 1
|
||||
}, index < common_vendor.unref(historyList).length - 1 ? {} : {}, {
|
||||
d: "step-" + index,
|
||||
e: "hazard-step-" + index,
|
||||
f: common_vendor.unref(activeIndex) === index ? 1 : "",
|
||||
g: common_vendor.o(($event) => common_vendor.unref(scrollToNode)(index), "step-" + index)
|
||||
});
|
||||
}),
|
||||
h: common_vendor.unref(stepScrollIntoView),
|
||||
i: common_vendor.f(common_vendor.unref(historyList), (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.titlePrefix),
|
||||
b: common_vendor.t(item.operator),
|
||||
c: common_vendor.t(item.time),
|
||||
d: item.type === "submit"
|
||||
}, item.type === "submit" ? common_vendor.e({
|
||||
e: common_vendor.t(item.content.title),
|
||||
f: common_vendor.t(item.content.source),
|
||||
g: item.content.areaColor
|
||||
}, item.content.areaColor ? {
|
||||
h: item.content.areaColor
|
||||
} : {}, {
|
||||
i: common_vendor.t(item.content.areaName),
|
||||
j: common_vendor.t(item.content.address),
|
||||
k: common_vendor.t(item.content.levelName || "-"),
|
||||
l: common_vendor.n(getLevelTagClass(item.content)),
|
||||
m: common_vendor.t(item.content.tagName),
|
||||
n: common_vendor.t(item.content.description),
|
||||
o: item.content.attachments && item.content.attachments.length
|
||||
}, item.content.attachments && item.content.attachments.length ? {
|
||||
p: common_vendor.f(item.content.attachments, (file, idx, i1) => {
|
||||
return {
|
||||
a: idx,
|
||||
b: resolveFileUrl(file.filePath),
|
||||
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
|
||||
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
q: common_vendor.t(item.content.legalBasis)
|
||||
}) : item.type === "assign" ? {
|
||||
s: common_vendor.t(item.content.assigneeName),
|
||||
t: common_vendor.t(item.content.deadline)
|
||||
} : item.type === "rectify" ? common_vendor.e({
|
||||
w: common_vendor.t(item.content.rectifyStatusName),
|
||||
x: common_vendor.t(item.content.rectifyPlan),
|
||||
y: common_vendor.t(item.content.rectifyResult),
|
||||
z: common_vendor.t(item.content.rectificationMeasures),
|
||||
A: common_vendor.t(item.content.controlMeasures),
|
||||
B: common_vendor.t(item.content.deadline),
|
||||
C: common_vendor.t(item.content.rectifierNames),
|
||||
D: common_vendor.t(item.content.managerNames),
|
||||
E: common_vendor.t(formatCost(item.content.planCost)),
|
||||
F: common_vendor.t(formatCost(item.content.actualCost)),
|
||||
G: item.content.attachments && item.content.attachments.length
|
||||
}, item.content.attachments && item.content.attachments.length ? {
|
||||
H: common_vendor.f(item.content.attachments, (file, idx, i1) => {
|
||||
return common_vendor.e({
|
||||
a: file.fileType === "image"
|
||||
}, file.fileType === "image" ? {
|
||||
b: resolveFileUrl(file.filePath),
|
||||
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
|
||||
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
|
||||
} : {
|
||||
e: common_vendor.t(file.fileName || "附件")
|
||||
}, {
|
||||
f: idx
|
||||
});
|
||||
})
|
||||
} : {}, {
|
||||
I: item.content.signPath
|
||||
}, item.content.signPath ? {
|
||||
J: resolveFileUrl(item.content.signPath),
|
||||
K: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
|
||||
L: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
|
||||
} : {}) : item.type === "verify" ? common_vendor.e({
|
||||
N: common_vendor.t(item.content.resultName),
|
||||
O: common_vendor.n(item.content.resultName === "通过" ? "result-tag--pass" : "result-tag--fail"),
|
||||
P: item.content.remark
|
||||
}, item.content.remark ? {
|
||||
Q: common_vendor.t(item.content.remark)
|
||||
} : {}, {
|
||||
R: item.content.attachments && item.content.attachments.length
|
||||
}, item.content.attachments && item.content.attachments.length ? {
|
||||
S: common_vendor.f(item.content.attachments, (file, idx, i1) => {
|
||||
return common_vendor.e({
|
||||
a: file.fileType === "image"
|
||||
}, file.fileType === "image" ? {
|
||||
b: resolveFileUrl(file.filePath),
|
||||
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
|
||||
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
|
||||
} : {
|
||||
e: common_vendor.t(file.fileName || "附件")
|
||||
}, {
|
||||
f: idx
|
||||
});
|
||||
})
|
||||
} : {}, {
|
||||
T: item.content.signPath
|
||||
}, item.content.signPath ? {
|
||||
U: resolveFileUrl(item.content.signPath),
|
||||
V: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
|
||||
W: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
|
||||
} : {}) : item.type === "writeoff" ? common_vendor.e({
|
||||
Y: common_vendor.t(item.content.resultName),
|
||||
Z: common_vendor.n(item.content.resultName === "通过" ? "result-tag--pass" : "result-tag--fail"),
|
||||
aa: item.content.remark
|
||||
}, item.content.remark ? {
|
||||
ab: common_vendor.t(item.content.remark)
|
||||
} : {}, {
|
||||
ac: item.content.attachments && item.content.attachments.length
|
||||
}, item.content.attachments && item.content.attachments.length ? {
|
||||
ad: common_vendor.f(item.content.attachments, (file, idx, i1) => {
|
||||
return common_vendor.e({
|
||||
a: file.fileType === "image"
|
||||
}, file.fileType === "image" ? {
|
||||
b: resolveFileUrl(file.filePath),
|
||||
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
|
||||
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
|
||||
} : {
|
||||
e: common_vendor.t(file.fileName || "附件")
|
||||
}, {
|
||||
f: idx
|
||||
});
|
||||
})
|
||||
} : {}, {
|
||||
ae: item.content.signPath
|
||||
}, item.content.signPath ? {
|
||||
af: resolveFileUrl(item.content.signPath),
|
||||
ag: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
|
||||
ah: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
|
||||
} : {}) : {}, {
|
||||
r: item.type === "assign",
|
||||
v: item.type === "rectify",
|
||||
M: item.type === "verify",
|
||||
X: item.type === "writeoff",
|
||||
ai: "node-" + index,
|
||||
aj: "hazard-node-" + index,
|
||||
ak: index === common_vendor.unref(historyList).length - 1 ? 1 : ""
|
||||
});
|
||||
}),
|
||||
j: common_vendor.unref(contentScrollIntoView),
|
||||
k: common_vendor.unref(scrollWithAnimation),
|
||||
l: common_vendor.o((...args) => common_vendor.unref(onContentScroll) && common_vendor.unref(onContentScroll)(...args)),
|
||||
m: common_vendor.o((...args) => common_vendor.unref(onScrollToLower) && common_vendor.unref(onScrollToLower)(...args))
|
||||
}, {
|
||||
f: common_vendor.unref(historyList).length === 0,
|
||||
n: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f38c3cb4"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazardDetail/HazardDetailPanel.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanel.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanel.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanel.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanel.wxml
vendored
Normal file
File diff suppressed because one or more lines are too long
331
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanel.wxss
vendored
Normal file
331
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanel.wxss
vendored
Normal file
@@ -0,0 +1,331 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.hazard-detail-panel.data-v-f38c3cb4 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
background: #ebf2fc;
|
||||
overflow: hidden;
|
||||
}
|
||||
.status-bar.data-v-f38c3cb4 {
|
||||
flex-shrink: 0;
|
||||
background: #f5f7fa;
|
||||
border-bottom: 1rpx solid #e4e7ed;
|
||||
padding: 20rpx 24rpx;
|
||||
}
|
||||
.hazard-title.data-v-f38c3cb4 {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
line-height: 1.4;
|
||||
margin-bottom: 16rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
.status-row.data-v-f38c3cb4 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 24rpx;
|
||||
font-size: 24rpx;
|
||||
color: #909399;
|
||||
}
|
||||
.info-item.data-v-f38c3cb4 {
|
||||
line-height: 1.5;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.info-item--right.data-v-f38c3cb4 {
|
||||
text-align: right;
|
||||
}
|
||||
.status-meta.data-v-f38c3cb4 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.info-label.data-v-f38c3cb4 {
|
||||
line-height: 1.5;
|
||||
}
|
||||
.status-tag.data-v-f38c3cb4 {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.status-blue.data-v-f38c3cb4 {
|
||||
background: #ecf5ff;
|
||||
border: 2rpx solid #b3d8ff;
|
||||
color: #409eff;
|
||||
}
|
||||
.status-green.data-v-f38c3cb4 {
|
||||
background: #f0f9eb;
|
||||
border: 2rpx solid #c2e7b0;
|
||||
color: #67c23a;
|
||||
}
|
||||
.status-orange.data-v-f38c3cb4 {
|
||||
background: #fff7e6;
|
||||
border: 2rpx solid #ffd591;
|
||||
color: #fa8c16;
|
||||
}
|
||||
.status-red.data-v-f38c3cb4 {
|
||||
background: #fef0f0;
|
||||
border: 2rpx solid #fbc4c4;
|
||||
color: #f56c6c;
|
||||
}
|
||||
.status-yellow.data-v-f38c3cb4 {
|
||||
background: #fdf6ec;
|
||||
border: 2rpx solid #f5dab1;
|
||||
color: #e6a23c;
|
||||
}
|
||||
.status-gray.data-v-f38c3cb4 {
|
||||
background: #f4f4f5;
|
||||
border: 2rpx solid #d3d4d6;
|
||||
color: #909399;
|
||||
}
|
||||
.level-tag.data-v-f38c3cb4 {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.level-normal.data-v-f38c3cb4 {
|
||||
background: #fffbe6;
|
||||
border: 2rpx solid #ffe58f;
|
||||
color: #faad14;
|
||||
}
|
||||
.level-major.data-v-f38c3cb4 {
|
||||
background: #fff1f0;
|
||||
border: 2rpx solid #ffa39e;
|
||||
color: #f5222d;
|
||||
}
|
||||
.loading-wrap.data-v-f38c3cb4,
|
||||
.empty-wrap.data-v-f38c3cb4 {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.loading-text.data-v-f38c3cb4,
|
||||
.empty-text.data-v-f38c3cb4 {
|
||||
font-size: 28rpx;
|
||||
color: #909399;
|
||||
}
|
||||
.detail-body.data-v-f38c3cb4 {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.steps-column.data-v-f38c3cb4 {
|
||||
width: 168rpx;
|
||||
flex-shrink: 0;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
border-right: 1rpx solid #ebeef5;
|
||||
}
|
||||
.step-item.data-v-f38c3cb4 {
|
||||
padding: 0 16rpx;
|
||||
}
|
||||
.step-track.data-v-f38c3cb4 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 24rpx 0 0;
|
||||
}
|
||||
.step-dot.data-v-f38c3cb4 {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 50%;
|
||||
background: #dcdfe6;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
|
||||
transition: background 0.2s;
|
||||
}
|
||||
.step-dot--active.data-v-f38c3cb4 {
|
||||
background: #409eff;
|
||||
}
|
||||
.step-dot-text.data-v-f38c3cb4 {
|
||||
font-size: 22rpx;
|
||||
font-weight: 600;
|
||||
color: #606266;
|
||||
text-align: center;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.step-item--active .step-dot-text.data-v-f38c3cb4 {
|
||||
color: #fff;
|
||||
}
|
||||
.step-line.data-v-f38c3cb4 {
|
||||
width: 4rpx;
|
||||
height: 48rpx;
|
||||
background: #e4e7ed;
|
||||
margin: 8rpx 0;
|
||||
}
|
||||
.content-column.data-v-f38c3cb4 {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.node-section.data-v-f38c3cb4 {
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx 20rpx 0;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.node-section--last.data-v-f38c3cb4 {
|
||||
padding-bottom: 40rpx;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.detail-card.data-v-f38c3cb4 {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
border: 1rpx solid #ebeef5;
|
||||
overflow: hidden;
|
||||
}
|
||||
.card-header.data-v-f38c3cb4 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
padding: 20rpx;
|
||||
background: linear-gradient(135deg, #4facfe 0%, #2668ea 100%);
|
||||
}
|
||||
.card-node-name.data-v-f38c3cb4 {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.operator.data-v-f38c3cb4 {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
line-height: 1.5;
|
||||
word-break: break-all;
|
||||
}
|
||||
.time.data-v-f38c3cb4 {
|
||||
font-size: 24rpx;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
}
|
||||
.card-body.data-v-f38c3cb4 {
|
||||
padding: 24rpx;
|
||||
}
|
||||
.detail-row.data-v-f38c3cb4 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.detail-row.data-v-f38c3cb4:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.detail-row--block.data-v-f38c3cb4 {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.label.data-v-f38c3cb4 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #909399;
|
||||
font-weight: 500;
|
||||
}
|
||||
.label.data-v-f38c3cb4::before {
|
||||
content: "";
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
border-radius: 50%;
|
||||
background: #909399;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.value.data-v-f38c3cb4 {
|
||||
font-size: 28rpx;
|
||||
color: #303133;
|
||||
line-height: 1.6;
|
||||
word-break: break-all;
|
||||
}
|
||||
.value--inline.data-v-f38c3cb4 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.area-dot.data-v-f38c3cb4 {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 12rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.attachment-list.data-v-f38c3cb4 {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16rpx;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
.attachment-img.data-v-f38c3cb4 {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #f5f7fa;
|
||||
}
|
||||
.sign-img.data-v-f38c3cb4 {
|
||||
width: 300rpx;
|
||||
height: 160rpx;
|
||||
margin-top: 8rpx;
|
||||
border: 1rpx solid #e4e7ed;
|
||||
border-radius: 8rpx;
|
||||
background: #fafafa;
|
||||
}
|
||||
.file-link.data-v-f38c3cb4 {
|
||||
display: inline-block;
|
||||
padding: 12rpx 20rpx;
|
||||
background: #f5f7fa;
|
||||
border: 1rpx solid #e4e7ed;
|
||||
border-radius: 8rpx;
|
||||
color: #409eff;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.result-tag.data-v-f38c3cb4 {
|
||||
align-self: flex-start;
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 6rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.result-tag--pass.data-v-f38c3cb4 {
|
||||
background: #f0f9eb;
|
||||
color: #67c23a;
|
||||
}
|
||||
.result-tag--fail.data-v-f38c3cb4 {
|
||||
background: #fef0f0;
|
||||
color: #f56c6c;
|
||||
}
|
||||
265
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanelV2.js
vendored
Normal file
265
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanelV2.js
vendored
Normal file
@@ -0,0 +1,265 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
const components_hazardDetail_hazardDetail = require("./hazardDetail.js");
|
||||
const components_hazardDetail_useHazardDetailScroll = require("./useHazardDetailScroll.js");
|
||||
const _sfc_main = {
|
||||
__name: "HazardDetailPanelV2",
|
||||
props: {
|
||||
detail: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bodyHeight: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const { detail, loading } = common_vendor.toRefs(props);
|
||||
const {
|
||||
historyList,
|
||||
activeIndex,
|
||||
contentScrollIntoView,
|
||||
stepScrollIntoView,
|
||||
scrollWithAnimation,
|
||||
onContentScroll,
|
||||
onScrollToLower,
|
||||
scrollToNode,
|
||||
scheduleMeasureLayout
|
||||
} = components_hazardDetail_useHazardDetailScroll.useHazardDetailScroll(detail, loading);
|
||||
const scrollAreaStyle = common_vendor.computed(() => {
|
||||
const height = props.bodyHeight > 0 ? props.bodyHeight : 400;
|
||||
return { height: `${height}px` };
|
||||
});
|
||||
const detailBodyStyle = common_vendor.computed(() => {
|
||||
const height = props.bodyHeight > 0 ? props.bodyHeight : 400;
|
||||
return { height: `${height}px` };
|
||||
});
|
||||
common_vendor.watch(
|
||||
() => props.bodyHeight,
|
||||
(height) => {
|
||||
if (height > 0) {
|
||||
scheduleMeasureLayout();
|
||||
setTimeout(scheduleMeasureLayout, 100);
|
||||
}
|
||||
}
|
||||
);
|
||||
const LEVEL_CLASS_MAP = {
|
||||
2: "level-normal",
|
||||
3: "level-major"
|
||||
};
|
||||
const LEVEL_NAME_CLASS_MAP = {
|
||||
一般: "level-normal",
|
||||
一般隐患: "level-normal",
|
||||
重大: "level-major",
|
||||
重大隐患: "level-major"
|
||||
};
|
||||
const getLevelTagClass = (content) => {
|
||||
const level = content == null ? void 0 : content.level;
|
||||
const levelName = content == null ? void 0 : content.levelName;
|
||||
if (level != null && LEVEL_CLASS_MAP[level]) {
|
||||
return LEVEL_CLASS_MAP[level];
|
||||
}
|
||||
if (levelName && LEVEL_NAME_CLASS_MAP[levelName]) {
|
||||
return LEVEL_NAME_CLASS_MAP[levelName];
|
||||
}
|
||||
return "";
|
||||
};
|
||||
const resolveFileUrl = (path) => request_request.toImageUrl(path);
|
||||
const formatCost = (cost) => {
|
||||
if (cost == null || cost === "")
|
||||
return "-";
|
||||
const num = Number(cost);
|
||||
return Number.isNaN(num) ? "-" : `${num} 元`;
|
||||
};
|
||||
const previewSingle = (path) => {
|
||||
const url = resolveFileUrl(path);
|
||||
if (!url)
|
||||
return;
|
||||
common_vendor.index.previewImage({ current: url, urls: [url] });
|
||||
};
|
||||
const previewImages = (attachments, index) => {
|
||||
const urls = (attachments || []).filter((f) => f.fileType === "image" || !f.fileType).map((f) => resolveFileUrl(f.filePath)).filter(Boolean);
|
||||
if (!urls.length)
|
||||
return;
|
||||
common_vendor.index.previewImage({ current: urls[index] || urls[0], urls });
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.unref(loading)
|
||||
}, common_vendor.unref(loading) ? {} : common_vendor.unref(historyList).length === 0 ? {} : {
|
||||
c: common_vendor.f(common_vendor.unref(historyList), (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.unref(components_hazardDetail_hazardDetail.getStepIconPath)(item.type, common_vendor.unref(activeIndex) === index),
|
||||
b: common_vendor.unref(activeIndex) === index ? 1 : "",
|
||||
c: common_vendor.t(item.nodeName),
|
||||
d: common_vendor.unref(activeIndex) === index ? 1 : "",
|
||||
e: index < common_vendor.unref(historyList).length - 1
|
||||
}, index < common_vendor.unref(historyList).length - 1 ? {} : {}, {
|
||||
f: "step-" + index,
|
||||
g: "hazard-step-" + index,
|
||||
h: common_vendor.unref(activeIndex) === index ? 1 : "",
|
||||
i: common_vendor.o(($event) => common_vendor.unref(scrollToNode)(index), "step-" + index)
|
||||
});
|
||||
}),
|
||||
d: common_vendor.s(scrollAreaStyle.value),
|
||||
e: common_vendor.unref(stepScrollIntoView),
|
||||
f: common_vendor.f(common_vendor.unref(historyList), (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.titlePrefix),
|
||||
b: common_vendor.t(item.operator),
|
||||
c: common_vendor.t(item.time),
|
||||
d: item.type === "submit" && item.content.levelName
|
||||
}, item.type === "submit" && item.content.levelName ? {
|
||||
e: common_vendor.t(item.content.levelName),
|
||||
f: common_vendor.n(getLevelTagClass(item.content))
|
||||
} : {}, {
|
||||
g: item.type === "submit"
|
||||
}, item.type === "submit" ? common_vendor.e({
|
||||
h: common_vendor.t(item.content.title),
|
||||
i: common_vendor.t(item.content.source),
|
||||
j: item.content.areaColor
|
||||
}, item.content.areaColor ? {
|
||||
k: item.content.areaColor
|
||||
} : {}, {
|
||||
l: common_vendor.t(item.content.areaName),
|
||||
m: common_vendor.t(item.content.address),
|
||||
n: common_vendor.t(item.content.levelName || "-"),
|
||||
o: common_vendor.n(getLevelTagClass(item.content)),
|
||||
p: common_vendor.t(item.content.tagName),
|
||||
q: common_vendor.t(item.content.description),
|
||||
r: item.content.attachments && item.content.attachments.length
|
||||
}, item.content.attachments && item.content.attachments.length ? {
|
||||
s: common_vendor.f(item.content.attachments, (file, idx, i1) => {
|
||||
return {
|
||||
a: idx,
|
||||
b: resolveFileUrl(file.filePath),
|
||||
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
|
||||
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
t: common_vendor.t(item.content.legalBasis)
|
||||
}) : item.type === "assign" ? {
|
||||
w: common_vendor.t(item.content.assigneeName),
|
||||
x: common_vendor.t(item.content.deadline)
|
||||
} : item.type === "rectify" ? common_vendor.e({
|
||||
z: common_vendor.t(item.content.rectifyStatusName),
|
||||
A: common_vendor.t(item.content.rectifyPlan),
|
||||
B: common_vendor.t(item.content.rectifyResult),
|
||||
C: common_vendor.t(item.content.rectificationMeasures),
|
||||
D: common_vendor.t(item.content.controlMeasures),
|
||||
E: common_vendor.t(item.content.deadline),
|
||||
F: common_vendor.t(item.content.rectifierNames),
|
||||
G: common_vendor.t(item.content.managerNames),
|
||||
H: common_vendor.t(formatCost(item.content.planCost)),
|
||||
I: common_vendor.t(formatCost(item.content.actualCost)),
|
||||
J: item.content.attachments && item.content.attachments.length
|
||||
}, item.content.attachments && item.content.attachments.length ? {
|
||||
K: common_vendor.f(item.content.attachments, (file, idx, i1) => {
|
||||
return common_vendor.e({
|
||||
a: file.fileType === "image"
|
||||
}, file.fileType === "image" ? {
|
||||
b: resolveFileUrl(file.filePath),
|
||||
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
|
||||
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
|
||||
} : {
|
||||
e: common_vendor.t(file.fileName || "附件")
|
||||
}, {
|
||||
f: idx
|
||||
});
|
||||
})
|
||||
} : {}, {
|
||||
L: item.content.signPath
|
||||
}, item.content.signPath ? {
|
||||
M: resolveFileUrl(item.content.signPath),
|
||||
N: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
|
||||
O: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
|
||||
} : {}) : item.type === "verify" ? common_vendor.e({
|
||||
Q: common_vendor.t(item.content.resultName),
|
||||
R: common_vendor.n(item.content.resultName === "通过" ? "result-tag--pass" : "result-tag--fail"),
|
||||
S: item.content.remark
|
||||
}, item.content.remark ? {
|
||||
T: common_vendor.t(item.content.remark)
|
||||
} : {}, {
|
||||
U: item.content.attachments && item.content.attachments.length
|
||||
}, item.content.attachments && item.content.attachments.length ? {
|
||||
V: common_vendor.f(item.content.attachments, (file, idx, i1) => {
|
||||
return common_vendor.e({
|
||||
a: file.fileType === "image"
|
||||
}, file.fileType === "image" ? {
|
||||
b: resolveFileUrl(file.filePath),
|
||||
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
|
||||
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
|
||||
} : {
|
||||
e: common_vendor.t(file.fileName || "附件")
|
||||
}, {
|
||||
f: idx
|
||||
});
|
||||
})
|
||||
} : {}, {
|
||||
W: item.content.signPath
|
||||
}, item.content.signPath ? {
|
||||
X: resolveFileUrl(item.content.signPath),
|
||||
Y: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
|
||||
Z: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
|
||||
} : {}) : item.type === "writeoff" ? common_vendor.e({
|
||||
ab: common_vendor.t(item.content.resultName),
|
||||
ac: common_vendor.n(item.content.resultName === "通过" ? "result-tag--pass" : "result-tag--fail"),
|
||||
ad: item.content.remark
|
||||
}, item.content.remark ? {
|
||||
ae: common_vendor.t(item.content.remark)
|
||||
} : {}, {
|
||||
af: item.content.attachments && item.content.attachments.length
|
||||
}, item.content.attachments && item.content.attachments.length ? {
|
||||
ag: common_vendor.f(item.content.attachments, (file, idx, i1) => {
|
||||
return common_vendor.e({
|
||||
a: file.fileType === "image"
|
||||
}, file.fileType === "image" ? {
|
||||
b: resolveFileUrl(file.filePath),
|
||||
c: common_vendor.o(($event) => previewImages(item.content.attachments, idx), idx),
|
||||
d: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), idx)
|
||||
} : {
|
||||
e: common_vendor.t(file.fileName || "附件")
|
||||
}, {
|
||||
f: idx
|
||||
});
|
||||
})
|
||||
} : {}, {
|
||||
ah: item.content.signPath
|
||||
}, item.content.signPath ? {
|
||||
ai: resolveFileUrl(item.content.signPath),
|
||||
aj: common_vendor.o(($event) => previewSingle(item.content.signPath), "node-" + index),
|
||||
ak: common_vendor.o((...args) => common_vendor.unref(scheduleMeasureLayout) && common_vendor.unref(scheduleMeasureLayout)(...args), "node-" + index)
|
||||
} : {}) : {}, {
|
||||
v: item.type === "assign",
|
||||
y: item.type === "rectify",
|
||||
P: item.type === "verify",
|
||||
aa: item.type === "writeoff",
|
||||
al: "node-" + index,
|
||||
am: "hazard-node-" + index,
|
||||
an: index === common_vendor.unref(historyList).length - 1 ? 1 : ""
|
||||
});
|
||||
}),
|
||||
g: common_vendor.s(scrollAreaStyle.value),
|
||||
h: common_vendor.unref(contentScrollIntoView),
|
||||
i: common_vendor.unref(scrollWithAnimation),
|
||||
j: common_vendor.o((...args) => common_vendor.unref(onContentScroll) && common_vendor.unref(onContentScroll)(...args)),
|
||||
k: common_vendor.o((...args) => common_vendor.unref(onScrollToLower) && common_vendor.unref(onScrollToLower)(...args)),
|
||||
l: common_vendor.s(detailBodyStyle.value)
|
||||
}, {
|
||||
b: common_vendor.unref(historyList).length === 0,
|
||||
m: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-361ef447"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazardDetail/HazardDetailPanelV2.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanelV2.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanelV2.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanelV2.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanelV2.wxml
vendored
Normal file
File diff suppressed because one or more lines are too long
292
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanelV2.wxss
vendored
Normal file
292
unpackage/dist/dev/mp-weixin/components/hazardDetail/HazardDetailPanelV2.wxss
vendored
Normal file
@@ -0,0 +1,292 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.hazard-detail-panel-v2.data-v-361ef447 {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
.loading-wrap.data-v-361ef447,
|
||||
.empty-wrap.data-v-361ef447 {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 0;
|
||||
}
|
||||
.loading-text.data-v-361ef447,
|
||||
.empty-text.data-v-361ef447 {
|
||||
font-size: 28rpx;
|
||||
color: #909399;
|
||||
}
|
||||
.detail-body.data-v-361ef447 {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
align-items: stretch;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.steps-card.data-v-361ef447 {
|
||||
width: 140rpx;
|
||||
flex-shrink: 0;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.step-item.data-v-361ef447 {
|
||||
padding: 0 12rpx;
|
||||
}
|
||||
.step-track.data-v-361ef447 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 28rpx 0 0;
|
||||
}
|
||||
.step-dot.data-v-361ef447 {
|
||||
width: 66rpx;
|
||||
height: 66rpx;
|
||||
border-radius: 50%;
|
||||
background: #f3f3f3;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
.step-dot--active.data-v-361ef447 {
|
||||
background: #2667e9;
|
||||
}
|
||||
.step-icon.data-v-361ef447 {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
.step-label.data-v-361ef447 {
|
||||
margin-top: 12rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.step-label--active.data-v-361ef447 {
|
||||
color: #2667e9;
|
||||
font-weight: 600;
|
||||
}
|
||||
.step-line.data-v-361ef447 {
|
||||
width: 0;
|
||||
height: 40rpx;
|
||||
margin: 10rpx 0;
|
||||
border-left: 2rpx dashed #dcdfe6;
|
||||
}
|
||||
.content-column.data-v-361ef447 {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
min-height: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.content-scroll.data-v-361ef447 {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.node-section.data-v-361ef447 {
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.node-section--last.data-v-361ef447 {
|
||||
padding-bottom: 40rpx;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.detail-card.data-v-361ef447 {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
padding: 28rpx 38rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.card-header-v2.data-v-361ef447 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 16rpx;
|
||||
padding: 0;
|
||||
}
|
||||
.card-header-main.data-v-361ef447 {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.operator.data-v-361ef447 {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
line-height: 1.5;
|
||||
word-break: break-all;
|
||||
}
|
||||
.time.data-v-361ef447 {
|
||||
display: block;
|
||||
margin-top: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.level-badge.data-v-361ef447 {
|
||||
flex-shrink: 0;
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.level-badge.level-normal.data-v-361ef447 {
|
||||
background: #fff7e6;
|
||||
border: 2rpx solid #ffd591;
|
||||
color: #fa8c16;
|
||||
}
|
||||
.level-badge.level-major.data-v-361ef447 {
|
||||
background: #fff1f0;
|
||||
border: 2rpx solid #ffa39e;
|
||||
color: #f5222d;
|
||||
}
|
||||
.card-divider.data-v-361ef447 {
|
||||
height: 0;
|
||||
margin: 20rpx 0;
|
||||
border-top: 2rpx dashed #eee;
|
||||
}
|
||||
.card-body.data-v-361ef447 {
|
||||
padding: 0;
|
||||
}
|
||||
.detail-row-v2.data-v-361ef447 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
gap: 24rpx;
|
||||
padding: 18rpx 0;
|
||||
}
|
||||
.detail-row-v2--block.data-v-361ef447 {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.label.data-v-361ef447 {
|
||||
flex-shrink: 0;
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.value.data-v-361ef447 {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
line-height: 1.6;
|
||||
text-align: left;
|
||||
word-break: break-all;
|
||||
}
|
||||
.value--inline.data-v-361ef447 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.area-dot.data-v-361ef447 {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 12rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.level-tag.data-v-361ef447 {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.level-normal.data-v-361ef447 {
|
||||
background: #fff7e6;
|
||||
border: 2rpx solid #ffd591;
|
||||
color: #fa8c16;
|
||||
}
|
||||
.level-major.data-v-361ef447 {
|
||||
background: #fff1f0;
|
||||
border: 2rpx solid #ffa39e;
|
||||
color: #f5222d;
|
||||
}
|
||||
.tag-badge.data-v-361ef447 {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
background: #eef3ff;
|
||||
border: 2rpx solid #aac5fc;
|
||||
color: #2667e9;
|
||||
}
|
||||
.attachment-list.data-v-361ef447 {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16rpx;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.attachment-img.data-v-361ef447 {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #f5f7fa;
|
||||
}
|
||||
.sign-img.data-v-361ef447 {
|
||||
width: 300rpx;
|
||||
height: 160rpx;
|
||||
border: 1rpx solid #e4e7ed;
|
||||
border-radius: 8rpx;
|
||||
background: #fafafa;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
.file-link.data-v-361ef447 {
|
||||
display: inline-block;
|
||||
padding: 12rpx 20rpx;
|
||||
background: #f5f7fa;
|
||||
border: 1rpx solid #e4e7ed;
|
||||
border-radius: 8rpx;
|
||||
color: #2667e9;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.result-tag.data-v-361ef447 {
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 6rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.result-tag--pass.data-v-361ef447 {
|
||||
background: #f0f9eb;
|
||||
color: #67c23a;
|
||||
}
|
||||
.result-tag--fail.data-v-361ef447 {
|
||||
background: #fef0f0;
|
||||
color: #f56c6c;
|
||||
}
|
||||
203
unpackage/dist/dev/mp-weixin/components/hazardDetail/hazardDetail.js
vendored
Normal file
203
unpackage/dist/dev/mp-weixin/components/hazardDetail/hazardDetail.js
vendored
Normal file
@@ -0,0 +1,203 @@
|
||||
"use strict";
|
||||
const HAZARD_NODE_TYPES = {
|
||||
SUBMIT: "submit",
|
||||
ASSIGN: "assign",
|
||||
RECTIFY: "rectify",
|
||||
VERIFY: "verify",
|
||||
WRITEOFF: "writeoff"
|
||||
};
|
||||
const HAZARD_STATUS_CLASS_MAP = {
|
||||
1: "status-blue",
|
||||
2: "status-orange",
|
||||
3: "status-red",
|
||||
4: "status-yellow",
|
||||
5: "status-green"
|
||||
};
|
||||
const STATUS_NAME_CLASS_MAP = {
|
||||
待交办: "status-blue",
|
||||
待整改: "status-orange",
|
||||
整改中: "status-orange",
|
||||
待验收: "status-red",
|
||||
待销号: "status-yellow",
|
||||
已完成: "status-green",
|
||||
已销号: "status-green"
|
||||
};
|
||||
const LEVEL_NAME_MAP = {
|
||||
2: "一般隐患",
|
||||
3: "重大隐患"
|
||||
};
|
||||
function getLevelName(level) {
|
||||
return LEVEL_NAME_MAP[level] || "未知";
|
||||
}
|
||||
function getStatusClass(status, statusName) {
|
||||
if (statusName && STATUS_NAME_CLASS_MAP[statusName]) {
|
||||
return STATUS_NAME_CLASS_MAP[statusName];
|
||||
}
|
||||
return HAZARD_STATUS_CLASS_MAP[status] || "";
|
||||
}
|
||||
function getStepIconPath(type, active = false) {
|
||||
const baseMap = {
|
||||
submit: "tijiao",
|
||||
assign: "jiaoban",
|
||||
rectify: "zhenggai",
|
||||
verify: "yanshou",
|
||||
writeoff: "xiaohao"
|
||||
};
|
||||
const base = baseMap[type] || "tijiao";
|
||||
if (base === "zhenggai") {
|
||||
return active ? "/static/yinhuan_detail/zhenggai_selected.png" : "/static/yinhuan_detail/zhenggai__unselected.png";
|
||||
}
|
||||
return `/static/yinhuan_detail/${base}__${active ? "selected" : "unselected"}.png`;
|
||||
}
|
||||
function formatNameList(names, fallback = "-") {
|
||||
if (Array.isArray(names) && names.length) {
|
||||
return names.join("、");
|
||||
}
|
||||
if (typeof names === "string" && names.trim()) {
|
||||
const parts = names.split(/[,,、]/).map((s) => s.trim()).filter(Boolean);
|
||||
return parts.length ? parts.join("、") : names;
|
||||
}
|
||||
return fallback;
|
||||
}
|
||||
function isWriteoffRecord(record) {
|
||||
if (!record)
|
||||
return false;
|
||||
return record.type === 2 || record.typeName === "销号";
|
||||
}
|
||||
function buildVerifyNode(record) {
|
||||
return {
|
||||
type: HAZARD_NODE_TYPES.VERIFY,
|
||||
nodeName: "验收",
|
||||
titlePrefix: "验收",
|
||||
operator: record.verifierName || "-",
|
||||
time: record.verifyTime || "-",
|
||||
content: {
|
||||
resultName: record.resultName || "-",
|
||||
remark: record.remark || "",
|
||||
attachments: record.attachments || [],
|
||||
signPath: record.signPath || "",
|
||||
verifyDeptName: record.verifyDeptName || "-"
|
||||
}
|
||||
};
|
||||
}
|
||||
function buildWriteoffNode(record) {
|
||||
return {
|
||||
type: HAZARD_NODE_TYPES.WRITEOFF,
|
||||
nodeName: "销号",
|
||||
titlePrefix: "销号",
|
||||
operator: record.verifierName || "-",
|
||||
time: record.verifyTime || "-",
|
||||
content: {
|
||||
resultName: record.resultName || "-",
|
||||
remark: record.remark || "",
|
||||
attachments: record.attachments || [],
|
||||
signPath: record.signPath || "",
|
||||
writeoffDeptName: record.writeoffDeptName || "-"
|
||||
}
|
||||
};
|
||||
}
|
||||
function appendAuditNodes(list, records, seenIds) {
|
||||
(records || []).forEach((record) => {
|
||||
if (!record)
|
||||
return;
|
||||
const key = record.verifyId ?? record.id;
|
||||
if (key != null) {
|
||||
if (seenIds.has(key))
|
||||
return;
|
||||
seenIds.add(key);
|
||||
}
|
||||
list.push(isWriteoffRecord(record) ? buildWriteoffNode(record) : buildVerifyNode(record));
|
||||
});
|
||||
}
|
||||
function resolveWriteoffRecords(flow) {
|
||||
return flow.writeOffs || flow.writeoffs || [];
|
||||
}
|
||||
function resolveRectifierNames(rectify) {
|
||||
if (!rectify)
|
||||
return "-";
|
||||
if (Array.isArray(rectify.rectifierNames) && rectify.rectifierNames.length) {
|
||||
return rectify.rectifierNames.join("、");
|
||||
}
|
||||
if (Array.isArray(rectify.memberNames) && rectify.memberNames.length) {
|
||||
return rectify.memberNames.join("、");
|
||||
}
|
||||
return formatNameList(rectify.rectifierName, "-");
|
||||
}
|
||||
function generateHazardHistory(data) {
|
||||
if (!data)
|
||||
return [];
|
||||
const list = [];
|
||||
list.push({
|
||||
type: HAZARD_NODE_TYPES.SUBMIT,
|
||||
nodeName: "提交",
|
||||
titlePrefix: "提交",
|
||||
operator: data.reporterName || "-",
|
||||
time: data.createdAt || "-",
|
||||
content: {
|
||||
title: data.title || "-",
|
||||
source: data.source || "-",
|
||||
areaName: data.areaName || "-",
|
||||
areaColor: data.areaColor || "",
|
||||
address: data.address || "-",
|
||||
level: data.level,
|
||||
levelName: data.levelName || getLevelName(data.level),
|
||||
tagName: data.tagName || "-",
|
||||
description: data.description || "-",
|
||||
attachments: data.attachments || [],
|
||||
legalBasis: data.legalBasis || data.regulationName || "-",
|
||||
reporterPhone: data.reporterPhone || "-",
|
||||
reportDeptName: data.reportDeptName || "-"
|
||||
}
|
||||
});
|
||||
if (data.assignFlows && data.assignFlows.length > 0) {
|
||||
data.assignFlows.forEach((flow) => {
|
||||
if (flow.assignId) {
|
||||
list.push({
|
||||
type: HAZARD_NODE_TYPES.ASSIGN,
|
||||
nodeName: "交办",
|
||||
titlePrefix: "交办",
|
||||
operator: flow.assignerName || "-",
|
||||
time: flow.assignTime || "-",
|
||||
content: {
|
||||
assigneeName: flow.assigneeName || "-",
|
||||
deadline: flow.deadline || "-",
|
||||
assignDeptName: flow.assignDeptName || "-",
|
||||
assignRemark: flow.assignRemark || "-",
|
||||
priorityName: flow.priorityName || "-"
|
||||
}
|
||||
});
|
||||
}
|
||||
if (flow.rectify) {
|
||||
list.push({
|
||||
type: HAZARD_NODE_TYPES.RECTIFY,
|
||||
nodeName: "整改",
|
||||
titlePrefix: "整改",
|
||||
operator: flow.rectify.rectifierName || "-",
|
||||
time: flow.rectify.rectifyTime || "-",
|
||||
content: {
|
||||
rectifyPlan: flow.rectify.rectifyPlan || "-",
|
||||
rectifyResult: flow.rectify.rectifyResult || "-",
|
||||
rectificationMeasures: flow.rectify.rectificationMeasures || "-",
|
||||
controlMeasures: flow.rectify.controlMeasures || "-",
|
||||
deadline: flow.deadline || "-",
|
||||
rectifierNames: resolveRectifierNames(flow.rectify),
|
||||
managerNames: formatNameList(flow.rectify.managerNames, "-"),
|
||||
planCost: flow.rectify.planCost,
|
||||
actualCost: flow.rectify.actualCost,
|
||||
attachments: flow.rectify.attachments || [],
|
||||
signPath: flow.rectify.signPath || "",
|
||||
rectifyStatusName: flow.rectify.rectifyStatusName || "-"
|
||||
}
|
||||
});
|
||||
}
|
||||
const seenAuditIds = /* @__PURE__ */ new Set();
|
||||
appendAuditNodes(list, flow.verifies || [], seenAuditIds);
|
||||
appendAuditNodes(list, resolveWriteoffRecords(flow), seenAuditIds);
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
exports.generateHazardHistory = generateHazardHistory;
|
||||
exports.getStatusClass = getStatusClass;
|
||||
exports.getStepIconPath = getStepIconPath;
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazardDetail/hazardDetail.js.map
|
||||
144
unpackage/dist/dev/mp-weixin/components/hazardDetail/useHazardDetailScroll.js
vendored
Normal file
144
unpackage/dist/dev/mp-weixin/components/hazardDetail/useHazardDetailScroll.js
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const components_hazardDetail_hazardDetail = require("./hazardDetail.js");
|
||||
function useHazardDetailScroll(detailSource, loadingSource) {
|
||||
const instance = common_vendor.getCurrentInstance();
|
||||
const queryScope = (instance == null ? void 0 : instance.proxy) || instance;
|
||||
const historyList = common_vendor.ref([]);
|
||||
const activeIndex = common_vendor.ref(0);
|
||||
const sectionOffsets = common_vendor.ref([0]);
|
||||
const contentViewHeight = common_vendor.ref(0);
|
||||
const contentScrollIntoView = common_vendor.ref("");
|
||||
const stepScrollIntoView = common_vendor.ref("");
|
||||
const scrollWithAnimation = common_vendor.ref(true);
|
||||
const isProgrammaticScroll = common_vendor.ref(false);
|
||||
let measureLayoutTimer = null;
|
||||
const measureLayout = () => {
|
||||
if (!historyList.value.length)
|
||||
return;
|
||||
common_vendor.nextTick$1(() => {
|
||||
const query = common_vendor.index.createSelectorQuery().in(queryScope);
|
||||
query.select(".content-scroll").boundingClientRect();
|
||||
query.select(".content-scroll").scrollOffset();
|
||||
query.selectAll(".node-section").boundingClientRect();
|
||||
query.exec((res) => {
|
||||
const containerRect = res == null ? void 0 : res[0];
|
||||
const scrollOffset = res == null ? void 0 : res[1];
|
||||
const sections = (res == null ? void 0 : res[2]) || [];
|
||||
if (!containerRect || !sections.length)
|
||||
return;
|
||||
contentViewHeight.value = containerRect.height || 0;
|
||||
const baseScrollTop = (scrollOffset == null ? void 0 : scrollOffset.scrollTop) || 0;
|
||||
sectionOffsets.value = sections.map(
|
||||
(section) => section.top - containerRect.top + baseScrollTop
|
||||
);
|
||||
});
|
||||
});
|
||||
};
|
||||
const scheduleMeasureLayout = () => {
|
||||
clearTimeout(measureLayoutTimer);
|
||||
measureLayoutTimer = setTimeout(() => {
|
||||
measureLayout();
|
||||
}, 80);
|
||||
};
|
||||
const rebuildHistory = (data) => {
|
||||
historyList.value = components_hazardDetail_hazardDetail.generateHazardHistory(data);
|
||||
activeIndex.value = 0;
|
||||
contentScrollIntoView.value = "";
|
||||
scheduleMeasureLayout();
|
||||
setTimeout(scheduleMeasureLayout, 300);
|
||||
};
|
||||
const syncActiveIndex = (scrollTop, scrollHeight = 0) => {
|
||||
const count = historyList.value.length;
|
||||
if (!count)
|
||||
return;
|
||||
if (scrollHeight > 0 && contentViewHeight.value > 0) {
|
||||
if (scrollTop + contentViewHeight.value >= scrollHeight - 60) {
|
||||
if (activeIndex.value !== count - 1) {
|
||||
activeIndex.value = count - 1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
const offsets = sectionOffsets.value;
|
||||
if (!offsets.length)
|
||||
return;
|
||||
let idx = 0;
|
||||
for (let i = offsets.length - 1; i >= 0; i--) {
|
||||
if (scrollTop >= offsets[i] - 80) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (idx !== activeIndex.value) {
|
||||
activeIndex.value = idx;
|
||||
}
|
||||
};
|
||||
const onContentScroll = (e) => {
|
||||
if (isProgrammaticScroll.value)
|
||||
return;
|
||||
const { scrollTop = 0, scrollHeight = 0 } = e.detail || {};
|
||||
syncActiveIndex(scrollTop, scrollHeight);
|
||||
scheduleMeasureLayout();
|
||||
};
|
||||
const onScrollToLower = () => {
|
||||
const count = historyList.value.length;
|
||||
if (count > 0 && activeIndex.value !== count - 1) {
|
||||
activeIndex.value = count - 1;
|
||||
}
|
||||
};
|
||||
const scrollToNode = (index) => {
|
||||
if (index < 0 || index >= historyList.value.length)
|
||||
return;
|
||||
isProgrammaticScroll.value = true;
|
||||
scrollWithAnimation.value = true;
|
||||
activeIndex.value = index;
|
||||
contentScrollIntoView.value = "hazard-node-" + index;
|
||||
setTimeout(() => {
|
||||
contentScrollIntoView.value = "";
|
||||
isProgrammaticScroll.value = false;
|
||||
scheduleMeasureLayout();
|
||||
}, 350);
|
||||
};
|
||||
common_vendor.watch(
|
||||
() => typeof loadingSource === "function" ? loadingSource() : loadingSource == null ? void 0 : loadingSource.value,
|
||||
(loading) => {
|
||||
if (!loading) {
|
||||
scheduleMeasureLayout();
|
||||
setTimeout(scheduleMeasureLayout, 300);
|
||||
}
|
||||
}
|
||||
);
|
||||
common_vendor.watch(
|
||||
() => typeof detailSource === "function" ? detailSource() : detailSource == null ? void 0 : detailSource.value,
|
||||
(val) => rebuildHistory(val),
|
||||
{ immediate: true, deep: true }
|
||||
);
|
||||
common_vendor.watch(activeIndex, (index) => {
|
||||
stepScrollIntoView.value = "hazard-step-" + index;
|
||||
setTimeout(() => {
|
||||
stepScrollIntoView.value = "";
|
||||
}, 300);
|
||||
});
|
||||
common_vendor.watch(
|
||||
() => historyList.value.length,
|
||||
() => scheduleMeasureLayout()
|
||||
);
|
||||
common_vendor.onReady(() => {
|
||||
scheduleMeasureLayout();
|
||||
setTimeout(scheduleMeasureLayout, 300);
|
||||
});
|
||||
return {
|
||||
historyList,
|
||||
activeIndex,
|
||||
contentScrollIntoView,
|
||||
stepScrollIntoView,
|
||||
scrollWithAnimation,
|
||||
onContentScroll,
|
||||
onScrollToLower,
|
||||
scrollToNode,
|
||||
scheduleMeasureLayout
|
||||
};
|
||||
}
|
||||
exports.useHazardDetailScroll = useHazardDetailScroll;
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/hazardDetail/useHazardDetailScroll.js.map
|
||||
@@ -1,177 +1,111 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
require("../../request/request.js");
|
||||
const utils_upload = require("../../utils/upload.js");
|
||||
const request_three_one_api_area = require("../../request/three_one_api/area.js");
|
||||
const utils_draftCache = require("../../utils/draftCache.js");
|
||||
const utils_useDraftCache = require("../../utils/useDraftCache.js");
|
||||
const components_hazard_hazardForm = require("../../components/hazard/hazardForm.js");
|
||||
if (!Array) {
|
||||
const _easycom_u_radio2 = common_vendor.resolveComponent("u-radio");
|
||||
const _easycom_u_radio_group2 = common_vendor.resolveComponent("u-radio-group");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
const _easycom_up_choose2 = common_vendor.resolveComponent("up-choose");
|
||||
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
(_easycom_u_radio2 + _easycom_u_radio_group2 + _easycom_up_textarea2 + _easycom_up_choose2 + _easycom_up_upload2 + _easycom_up_input2 + _easycom_u_popup2)();
|
||||
(_easycom_u_radio2 + _easycom_u_radio_group2 + _easycom_up_textarea2)();
|
||||
}
|
||||
const _easycom_u_radio = () => "../../uni_modules/uview-plus/components/u-radio/u-radio.js";
|
||||
const _easycom_u_radio_group = () => "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
|
||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
||||
const _easycom_up_choose = () => "../../uni_modules/uview-plus/components/u-choose/u-choose.js";
|
||||
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_u_radio + _easycom_u_radio_group + _easycom_up_textarea + _easycom_up_choose + _easycom_up_upload + _easycom_up_input + _easycom_u_popup)();
|
||||
(_easycom_u_radio + _easycom_u_radio_group + _easycom_up_textarea + HazardFormPopup)();
|
||||
}
|
||||
const HazardFormPopup = () => "../../components/hazard/HazardFormPopup.js";
|
||||
const _sfc_main = {
|
||||
__name: "Inspectionresult",
|
||||
setup(__props) {
|
||||
const oneTableId = common_vendor.ref("");
|
||||
const canvasWidth = common_vendor.ref(300);
|
||||
const canvasHeight = common_vendor.ref(300);
|
||||
const checkData = common_vendor.ref(null);
|
||||
const hazardFormRef = common_vendor.ref(null);
|
||||
const showHazardPopup = common_vendor.ref(false);
|
||||
const hazardPayload = common_vendor.ref(components_hazard_hazardForm.createEmptyHazardPayload());
|
||||
const radiolist1 = common_vendor.reactive([
|
||||
{
|
||||
name: "正常",
|
||||
value: 1,
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: "异常",
|
||||
value: 2,
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: "不涉及",
|
||||
value: 3,
|
||||
disabled: false
|
||||
}
|
||||
{ name: "正常", value: 1, disabled: false },
|
||||
{ name: "异常", value: 2, disabled: false },
|
||||
{ name: "不涉及", value: 3, disabled: false }
|
||||
]);
|
||||
const radiovalue1 = common_vendor.ref("");
|
||||
const value1 = common_vendor.ref("");
|
||||
const normalizeInspectionDraft = (data) => {
|
||||
if (!data)
|
||||
return { radiovalue1: "", value1: "", hazardPayload: components_hazard_hazardForm.createEmptyHazardPayload() };
|
||||
if (!data.hazardPayload && data.hazardFormData) {
|
||||
data.hazardPayload = {
|
||||
formData: data.hazardFormData,
|
||||
address: data.hazardAddress || "",
|
||||
lng: data.hazardLng || 0,
|
||||
lat: data.hazardLat || 0,
|
||||
areaId: "",
|
||||
areaName: "",
|
||||
fileList: data.hazardFileList || []
|
||||
};
|
||||
}
|
||||
return {
|
||||
radiovalue1: data.radiovalue1 || "",
|
||||
value1: data.value1 || "",
|
||||
hazardPayload: data.hazardPayload || components_hazard_hazardForm.createEmptyHazardPayload()
|
||||
};
|
||||
};
|
||||
const inspectionDraftHasContent = (data) => {
|
||||
var _a, _b;
|
||||
const normalized = normalizeInspectionDraft(data);
|
||||
const payload = normalized.hazardPayload;
|
||||
return !!(normalized.radiovalue1 || normalized.value1 || ((_a = payload.formData) == null ? void 0 : _a.title) || ((_b = payload.formData) == null ? void 0 : _b.description) || payload.fileList && payload.fileList.length > 0);
|
||||
};
|
||||
const {
|
||||
showRestoreBanner,
|
||||
clear: clearDraft,
|
||||
restore: restoreDraft,
|
||||
bindAutoSave
|
||||
} = utils_useDraftCache.useDraftCache({
|
||||
getKey: () => {
|
||||
var _a;
|
||||
return utils_draftCache.buildDraftKey(
|
||||
utils_draftCache.DRAFT_NS.INSPECTION_RESULT,
|
||||
oneTableId.value,
|
||||
(_a = checkData.value) == null ? void 0 : _a.currentIndex
|
||||
);
|
||||
},
|
||||
getPayload: () => ({
|
||||
radiovalue1: radiovalue1.value,
|
||||
value1: value1.value,
|
||||
hazardPayload: JSON.parse(JSON.stringify(hazardPayload.value))
|
||||
}),
|
||||
hasContent: inspectionDraftHasContent,
|
||||
applyPayload: (data) => {
|
||||
const normalized = normalizeInspectionDraft(data);
|
||||
radiovalue1.value = normalized.radiovalue1;
|
||||
value1.value = normalized.value1;
|
||||
hazardPayload.value = normalized.hazardPayload;
|
||||
common_vendor.nextTick$1(() => {
|
||||
var _a;
|
||||
(_a = hazardFormRef.value) == null ? void 0 : _a.applyPayload(normalized.hazardPayload);
|
||||
});
|
||||
},
|
||||
clearForm: () => {
|
||||
radiovalue1.value = "";
|
||||
value1.value = "";
|
||||
clearHazard();
|
||||
},
|
||||
canSave: () => !!oneTableId.value,
|
||||
requireInitialized: true
|
||||
});
|
||||
bindAutoSave(() => [radiovalue1.value, value1.value, hazardPayload.value]);
|
||||
const groupChange = (n) => {
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:312", "groupChange", n);
|
||||
if (n !== "异常") {
|
||||
clearHazard();
|
||||
}
|
||||
};
|
||||
const radioChange = (n) => {
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:320", "radioChange", n);
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:207", "radioChange", n);
|
||||
};
|
||||
const value1 = common_vendor.ref("");
|
||||
const showHazardPopup = common_vendor.ref(false);
|
||||
const hazardFormData = common_vendor.reactive({
|
||||
title: "",
|
||||
level: 0,
|
||||
source: 0,
|
||||
description: "",
|
||||
tagIndex: 0,
|
||||
regulationId: null,
|
||||
// 法律依据ID
|
||||
regulationName: ""
|
||||
// 法律依据名称(显示用)
|
||||
});
|
||||
const hazardAddress = common_vendor.ref("");
|
||||
const hazardLng = common_vendor.ref(0);
|
||||
const hazardLat = common_vendor.ref(0);
|
||||
const showAreaPicker = common_vendor.ref(false);
|
||||
const areaList = common_vendor.ref([]);
|
||||
const selectedAreaId = common_vendor.ref("");
|
||||
const selectedAreaName = common_vendor.ref("");
|
||||
const tempAreaId = common_vendor.ref("");
|
||||
const showLawPopup = common_vendor.ref(false);
|
||||
const lawKeyword = common_vendor.ref("");
|
||||
const selectedLawId = common_vendor.ref(null);
|
||||
const selectedLawName = common_vendor.ref("");
|
||||
const lawList = common_vendor.ref([]);
|
||||
const lawLoading = common_vendor.ref(false);
|
||||
const lawPageNum = common_vendor.ref(1);
|
||||
const lawPageSize = common_vendor.ref(10);
|
||||
const hasMoreLaw = common_vendor.ref(true);
|
||||
const openLawPopup = () => {
|
||||
showLawPopup.value = true;
|
||||
if (lawList.value.length === 0) {
|
||||
fetchRegulationList();
|
||||
}
|
||||
};
|
||||
const fetchRegulationList = async (isLoadMore = false) => {
|
||||
if (lawLoading.value)
|
||||
return;
|
||||
lawLoading.value = true;
|
||||
try {
|
||||
const params = {
|
||||
pageNum: lawPageNum.value,
|
||||
pageSize: lawPageSize.value,
|
||||
status: 1
|
||||
// 启用状态
|
||||
};
|
||||
if (lawKeyword.value && lawKeyword.value.trim()) {
|
||||
params.keyword = lawKeyword.value.trim();
|
||||
}
|
||||
const res = await request_api.getRegulationList(params);
|
||||
if (res.code === 0) {
|
||||
const records = res.data.records || res.data || [];
|
||||
if (isLoadMore) {
|
||||
lawList.value = [...lawList.value, ...records];
|
||||
} else {
|
||||
lawList.value = records;
|
||||
}
|
||||
const total = res.data.total || 0;
|
||||
hasMoreLaw.value = lawList.value.length < total;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:399", "获取法规列表失败:", error);
|
||||
} finally {
|
||||
lawLoading.value = false;
|
||||
}
|
||||
};
|
||||
const searchRegulation = () => {
|
||||
lawPageNum.value = 1;
|
||||
lawList.value = [];
|
||||
hasMoreLaw.value = true;
|
||||
fetchRegulationList();
|
||||
};
|
||||
const loadMoreLaw = () => {
|
||||
if (!hasMoreLaw.value || lawLoading.value)
|
||||
return;
|
||||
lawPageNum.value++;
|
||||
fetchRegulationList(true);
|
||||
};
|
||||
const selectLaw = (item) => {
|
||||
selectedLawId.value = item.id;
|
||||
selectedLawName.value = item.depict || item.keyword || "";
|
||||
};
|
||||
const confirmLaw = () => {
|
||||
if (selectedLawId.value) {
|
||||
hazardFormData.regulationId = selectedLawId.value;
|
||||
hazardFormData.regulationName = selectedLawName.value;
|
||||
}
|
||||
showLawPopup.value = false;
|
||||
};
|
||||
const fetchAreaList = async () => {
|
||||
try {
|
||||
const res = await request_three_one_api_area.getAreaList();
|
||||
if (res.code === 0 && res.data && res.data.records) {
|
||||
areaList.value = res.data.records;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:443", "获取区域列表失败:", error);
|
||||
}
|
||||
};
|
||||
const confirmAreaSelect = () => {
|
||||
if (tempAreaId.value) {
|
||||
selectedAreaId.value = tempAreaId.value;
|
||||
const selected = areaList.value.find((item) => item.id === tempAreaId.value);
|
||||
selectedAreaName.value = selected ? selected.name : "";
|
||||
}
|
||||
showAreaPicker.value = false;
|
||||
};
|
||||
const hazardFileList = common_vendor.ref([]);
|
||||
const levelChooseRef = common_vendor.ref(null);
|
||||
const aiAnalyzing = common_vendor.ref(false);
|
||||
const hasHazardData = common_vendor.computed(() => {
|
||||
return hazardFormData.title && hazardFileList.value.length > 0;
|
||||
});
|
||||
const hasHazardData = common_vendor.computed(() => components_hazard_hazardForm.hasValidHazardPayload(hazardPayload.value));
|
||||
const progressPercent = common_vendor.computed(() => {
|
||||
if (!checkData.value)
|
||||
return 0;
|
||||
@@ -179,149 +113,24 @@ const _sfc_main = {
|
||||
const total = checkData.value.totalCount || 1;
|
||||
return Math.round(current / total * 100);
|
||||
});
|
||||
const levelOptions = common_vendor.ref([
|
||||
// { id: 1, title: '轻微隐患' },
|
||||
{ id: 2, title: "一般隐患" },
|
||||
{ id: 3, title: "重大隐患" }
|
||||
]);
|
||||
const sourceOptions = common_vendor.ref([
|
||||
{ id: 1, title: "部门检查" },
|
||||
{ id: 2, title: "都导检查" },
|
||||
{ id: 3, title: "企业自查" },
|
||||
{ id: 4, title: "行业互查" }
|
||||
]);
|
||||
const tagOptions = common_vendor.ref([]);
|
||||
const fetchTagOptions = async () => {
|
||||
try {
|
||||
const res = await request_api.getHiddenDangerLabelList();
|
||||
if (res.code === 0) {
|
||||
tagOptions.value = res.data.map((item) => ({
|
||||
id: item.id,
|
||||
title: item.name
|
||||
}));
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:508", "获取标签列表失败:", error);
|
||||
}
|
||||
};
|
||||
const openHazardPopup = () => {
|
||||
showHazardPopup.value = true;
|
||||
};
|
||||
const editHazard = () => {
|
||||
showHazardPopup.value = true;
|
||||
};
|
||||
const onHazardConfirm = (payload) => {
|
||||
if (payload) {
|
||||
hazardPayload.value = JSON.parse(JSON.stringify(payload));
|
||||
}
|
||||
};
|
||||
const clearHazard = () => {
|
||||
hazardFormData.regulationId = null;
|
||||
hazardFormData.regulationName = "";
|
||||
selectedLawId.value = null;
|
||||
selectedLawName.value = "";
|
||||
hazardFormData.title = "";
|
||||
hazardFormData.level = 0;
|
||||
hazardFormData.source = 0;
|
||||
hazardFormData.description = "";
|
||||
hazardFormData.tagIndex = 0;
|
||||
hazardAddress.value = "";
|
||||
hazardLng.value = 0;
|
||||
hazardLat.value = 0;
|
||||
hazardFileList.value = [];
|
||||
selectedAreaId.value = "";
|
||||
selectedAreaName.value = "";
|
||||
};
|
||||
const confirmHazard = () => {
|
||||
if (hazardFileList.value.length === 0) {
|
||||
common_vendor.index.showToast({ title: "请上传隐患图片", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!hazardFormData.title) {
|
||||
common_vendor.index.showToast({ title: "请输入隐患标题", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!hazardAddress.value) {
|
||||
common_vendor.index.showToast({ title: "请输入隐患位置", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (!hazardFormData.description) {
|
||||
common_vendor.index.showToast({ title: "请输入隐患描述", icon: "none" });
|
||||
return;
|
||||
}
|
||||
showHazardPopup.value = false;
|
||||
common_vendor.index.showToast({ title: "隐患信息已暂存", icon: "success" });
|
||||
};
|
||||
const chooseLocation = () => {
|
||||
showHazardPopup.value = false;
|
||||
setTimeout(() => {
|
||||
common_vendor.index.chooseLocation({
|
||||
success: (res) => {
|
||||
hazardAddress.value = res.address + (res.name ? `(${res.name})` : "");
|
||||
hazardLng.value = res.longitude;
|
||||
hazardLat.value = res.latitude;
|
||||
showHazardPopup.value = true;
|
||||
},
|
||||
fail: (err) => {
|
||||
showHazardPopup.value = true;
|
||||
if (err.errMsg && err.errMsg.indexOf("cancel") === -1) {
|
||||
common_vendor.index.showToast({ title: "选择位置失败", icon: "none" });
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
};
|
||||
const inspectionUploadInstance = common_vendor.getCurrentInstance();
|
||||
const { afterRead, deletePic } = utils_upload.createUploadListHandlers(hazardFileList, {
|
||||
watermark: {
|
||||
canvasId: "watermarkCanvas",
|
||||
canvasWidthRef: canvasWidth,
|
||||
canvasHeightRef: canvasHeight,
|
||||
instance: inspectionUploadInstance
|
||||
}
|
||||
});
|
||||
const handleAiAnalyze = async () => {
|
||||
const imageFiles = hazardFileList.value.filter((f) => {
|
||||
return f.status === "success" && f.url.toLowerCase().match(/\.(jpg|jpeg|png|gif|bmp|webp)$/);
|
||||
});
|
||||
if (imageFiles.length === 0) {
|
||||
common_vendor.index.showToast({ title: "请先上传隐患图片", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const fullImageUrl = imageFiles[0].url;
|
||||
aiAnalyzing.value = true;
|
||||
try {
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:612", "开始调用AI分析接口,图片地址:", fullImageUrl);
|
||||
const analyzeRes = await request_api.analyzeHazardImage({
|
||||
imageUrl: fullImageUrl
|
||||
});
|
||||
if (analyzeRes.code === 0 && analyzeRes.data) {
|
||||
const aiData = analyzeRes.data;
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:619", "AI分析结果:", aiData);
|
||||
if (aiData.title)
|
||||
hazardFormData.title = aiData.title;
|
||||
if (aiData.description)
|
||||
hazardFormData.description = aiData.description;
|
||||
if (aiData.level) {
|
||||
const levelMap = { "轻微": 0, "轻微隐患": 0, "一般": 1, "一般隐患": 1, "重大": 2, "重大隐患": 2 };
|
||||
const levelIndex = levelMap[aiData.level];
|
||||
if (levelIndex !== void 0) {
|
||||
hazardFormData.level = levelIndex;
|
||||
common_vendor.nextTick$1(() => {
|
||||
if (levelChooseRef.value && levelChooseRef.value.$data) {
|
||||
levelChooseRef.value.$data.currentIndex = levelIndex;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
common_vendor.index.showToast({ title: "AI分析完成,已自动填充", icon: "success", duration: 2e3 });
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: analyzeRes.msg || "AI分析失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:642", "AI分析接口调用失败:", error);
|
||||
common_vendor.index.showToast({ title: "AI分析失败,请重试", icon: "none" });
|
||||
} finally {
|
||||
aiAnalyzing.value = false;
|
||||
}
|
||||
var _a;
|
||||
hazardPayload.value = components_hazard_hazardForm.createEmptyHazardPayload();
|
||||
(_a = hazardFormRef.value) == null ? void 0 : _a.resetForm();
|
||||
};
|
||||
const handleSubmit = async () => {
|
||||
var _a, _b, _c, _d, _e;
|
||||
var _a, _b, _c, _d;
|
||||
if (!radiovalue1.value) {
|
||||
common_vendor.index.showToast({ title: "请选择检查结果", icon: "none" });
|
||||
return;
|
||||
@@ -339,40 +148,23 @@ const _sfc_main = {
|
||||
try {
|
||||
common_vendor.index.showLoading({ title: "提交中..." });
|
||||
if (radiovalue1.value === "异常" && hasHazardData.value) {
|
||||
const attachments = hazardFileList.value.filter((f) => f.status === "success").map((file) => utils_upload.buildAttachmentItem(file));
|
||||
const selectedTag = tagOptions.value[hazardFormData.tagIndex];
|
||||
const tagId = selectedTag ? selectedTag.id : null;
|
||||
const hazardParams = {
|
||||
taskId: (_a = checkData.value) == null ? void 0 : _a.taskId,
|
||||
checkPointId: (_b = checkData.value) == null ? void 0 : _b.checkPointId,
|
||||
title: hazardFormData.title,
|
||||
level: ((_c = levelOptions.value[hazardFormData.level]) == null ? void 0 : _c.id) || 2,
|
||||
lng: hazardLng.value || 0,
|
||||
lat: hazardLat.value || 0,
|
||||
address: hazardAddress.value || "",
|
||||
areaId: selectedAreaId.value || null,
|
||||
// 隐患区域ID
|
||||
description: hazardFormData.description || "",
|
||||
source: ((_d = sourceOptions.value[hazardFormData.source]) == null ? void 0 : _d.title) || "",
|
||||
tagId,
|
||||
attachments,
|
||||
regulationId: hazardFormData.regulationId || null
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:705", "隐患参数:", hazardParams);
|
||||
const payload = ((_a = hazardFormRef.value) == null ? void 0 : _a.getPayload()) || hazardPayload.value;
|
||||
const hazardParams = components_hazard_hazardForm.buildHiddenDangerParams(payload, {
|
||||
taskId: (_b = checkData.value) == null ? void 0 : _b.taskId,
|
||||
checkPointId: (_c = checkData.value) == null ? void 0 : _c.checkPointId
|
||||
});
|
||||
const hazardRes = await request_api.addHiddenDanger(hazardParams);
|
||||
if (hazardRes.code !== 0) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({ title: hazardRes.msg || "新增隐患失败", icon: "none" });
|
||||
return;
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:714", "新增隐患成功");
|
||||
}
|
||||
const submitParams = {
|
||||
taskId: (_e = checkData.value) == null ? void 0 : _e.taskId,
|
||||
taskId: (_d = checkData.value) == null ? void 0 : _d.taskId,
|
||||
result: resultValue,
|
||||
remark: value1.value
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:723", "提交参数:", submitParams);
|
||||
const res = await request_api.submitCheckResult(submitParams);
|
||||
common_vendor.index.hideLoading();
|
||||
if (res.code === 0) {
|
||||
@@ -397,7 +189,7 @@ const _sfc_main = {
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:758", "提交失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:306", "提交失败:", error);
|
||||
common_vendor.index.showToast({ title: "提交失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -409,164 +201,19 @@ const _sfc_main = {
|
||||
const getCheckData = async () => {
|
||||
try {
|
||||
const res = await request_api.enterCheckPlan(oneTableId.value);
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:777", "检查项数据:", res);
|
||||
if (res.code === 0) {
|
||||
checkData.value = res.data;
|
||||
restoreDraft();
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:784", error);
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:325", error);
|
||||
}
|
||||
};
|
||||
const hasDraft = common_vendor.ref(false);
|
||||
const showRestoreBanner = common_vendor.ref(false);
|
||||
const isRestoring = common_vendor.ref(false);
|
||||
const isInitialized = common_vendor.ref(false);
|
||||
const getDraftKey = () => {
|
||||
var _a;
|
||||
return `draft_inspection_result_${oneTableId.value || ""}_${((_a = checkData.value) == null ? void 0 : _a.currentIndex) || ""}`;
|
||||
};
|
||||
const saveDraft = () => {
|
||||
if (isRestoring.value || !isInitialized.value) {
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:799", "【草稿Debug - 巡检】saveDraft 被跳过:", { isRestoring: isRestoring.value, isInitialized: isInitialized.value });
|
||||
return;
|
||||
}
|
||||
const key = getDraftKey();
|
||||
const hasContent = radiovalue1.value || value1.value || hazardFormData.title || hazardFormData.description || hazardFileList.value.length > 0;
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:809", "【草稿Debug - 巡检】尝试自动保存草稿. Key:", key, "是否有实质内容:", !!hasContent, "当前数据:", {
|
||||
radiovalue1: radiovalue1.value,
|
||||
value1: value1.value,
|
||||
title: hazardFormData.title,
|
||||
description: hazardFormData.description,
|
||||
fileCount: hazardFileList.value.length
|
||||
});
|
||||
if (!hasContent) {
|
||||
common_vendor.index.removeStorageSync(key);
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:819", "【草稿Debug - 巡检】当前表单为空,自动删除本地缓存 Key:", key);
|
||||
hasDraft.value = false;
|
||||
return;
|
||||
}
|
||||
const data = {
|
||||
radiovalue1: radiovalue1.value,
|
||||
value1: value1.value,
|
||||
hazardFormData: {
|
||||
title: hazardFormData.title,
|
||||
level: hazardFormData.level,
|
||||
source: hazardFormData.source,
|
||||
description: hazardFormData.description,
|
||||
tagIndex: hazardFormData.tagIndex
|
||||
},
|
||||
hazardFileList: hazardFileList.value,
|
||||
hazardAddress: hazardAddress.value,
|
||||
hazardLng: hazardLng.value,
|
||||
hazardLat: hazardLat.value
|
||||
};
|
||||
common_vendor.index.setStorageSync(key, JSON.stringify(data));
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:840", "【草稿Debug - 巡检】成功保存草稿到 LocalStorage, Key:", key);
|
||||
hasDraft.value = true;
|
||||
};
|
||||
const clearDraft = (showToast = true) => {
|
||||
const key = getDraftKey();
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:847", "【草稿Debug - 巡检】手动清空草稿, Key:", key);
|
||||
common_vendor.index.removeStorageSync(key);
|
||||
hasDraft.value = false;
|
||||
showRestoreBanner.value = false;
|
||||
isRestoring.value = true;
|
||||
radiovalue1.value = "";
|
||||
value1.value = "";
|
||||
hazardFormData.title = "";
|
||||
hazardFormData.level = 0;
|
||||
hazardFormData.source = 0;
|
||||
hazardFormData.description = "";
|
||||
hazardFormData.tagIndex = 0;
|
||||
hazardFileList.value = [];
|
||||
hazardAddress.value = "";
|
||||
hazardLng.value = 0;
|
||||
hazardLat.value = 0;
|
||||
common_vendor.nextTick$1(() => {
|
||||
isRestoring.value = false;
|
||||
});
|
||||
if (showToast) {
|
||||
common_vendor.index.showToast({ title: "草稿已清空", icon: "none" });
|
||||
}
|
||||
};
|
||||
const restoreDraft = () => {
|
||||
const key = getDraftKey();
|
||||
const cached = common_vendor.index.getStorageSync(key);
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:877", "【草稿Debug - 巡检】尝试恢复草稿, Key:", key, "获取本地缓存结果:", !!cached);
|
||||
if (cached) {
|
||||
try {
|
||||
const data = JSON.parse(cached);
|
||||
const hasContent = data.radiovalue1 || data.value1 || data.hazardFormData.title || data.hazardFormData.description || data.hazardFileList && data.hazardFileList.length > 0;
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:887", "【草稿Debug - 巡检】解析本地缓存成功, 是否有实质内容:", !!hasContent, "缓存数据:", data);
|
||||
if (!hasContent) {
|
||||
isInitialized.value = true;
|
||||
return;
|
||||
}
|
||||
isRestoring.value = true;
|
||||
radiovalue1.value = data.radiovalue1 || "";
|
||||
value1.value = data.value1 || "";
|
||||
hazardFormData.title = data.hazardFormData.title || "";
|
||||
hazardFormData.level = data.hazardFormData.level || 0;
|
||||
hazardFormData.source = data.hazardFormData.source || 0;
|
||||
hazardFormData.description = data.hazardFormData.description || "";
|
||||
hazardFormData.tagIndex = data.hazardFormData.tagIndex || 0;
|
||||
hazardFileList.value = data.hazardFileList || [];
|
||||
hazardAddress.value = data.hazardAddress || "";
|
||||
hazardLng.value = data.hazardLng || 0;
|
||||
hazardLat.value = data.hazardLat || 0;
|
||||
hasDraft.value = true;
|
||||
showRestoreBanner.value = true;
|
||||
common_vendor.nextTick$1(() => {
|
||||
isRestoring.value = false;
|
||||
isInitialized.value = true;
|
||||
if (levelChooseRef.value && levelChooseRef.value.$data) {
|
||||
levelChooseRef.value.$data.currentIndex = hazardFormData.level;
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:914", "【草稿Debug - 巡检】UI与多选组件状态同步重绘完毕!");
|
||||
});
|
||||
common_vendor.index.showToast({
|
||||
title: "已自动恢复您上次未提交的内容",
|
||||
icon: "none",
|
||||
duration: 2500
|
||||
});
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/Inspectionresult.vue:923", "【草稿Debug - 巡检】解析草稿异常:", e);
|
||||
isRestoring.value = false;
|
||||
isInitialized.value = true;
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:928", "【草稿Debug - 巡检】本地无任何缓存, 页面已安全标记为 initialized");
|
||||
isInitialized.value = true;
|
||||
}
|
||||
};
|
||||
common_vendor.watch(
|
||||
() => [
|
||||
radiovalue1.value,
|
||||
value1.value,
|
||||
hazardFormData.title,
|
||||
hazardFormData.level,
|
||||
hazardFormData.source,
|
||||
hazardFormData.description,
|
||||
hazardFormData.tagIndex,
|
||||
hazardAddress.value,
|
||||
hazardFileList.value
|
||||
],
|
||||
() => {
|
||||
if (oneTableId.value) {
|
||||
saveDraft();
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
common_vendor.onLoad((options) => {
|
||||
common_vendor.index.__f__("log", "at pages/Inspectionresult/Inspectionresult.vue:955", "接收到的参数:", options);
|
||||
if (options.id) {
|
||||
oneTableId.value = options.id;
|
||||
getCheckData();
|
||||
}
|
||||
fetchTagOptions();
|
||||
fetchAreaList();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
var _a, _b, _c, _d;
|
||||
@@ -605,17 +252,17 @@ const _sfc_main = {
|
||||
}, !hasHazardData.value ? {
|
||||
m: common_vendor.o(openHazardPopup)
|
||||
} : common_vendor.e({
|
||||
n: common_vendor.t(hazardFormData.title),
|
||||
o: common_vendor.t((_c = levelOptions.value[hazardFormData.level]) == null ? void 0 : _c.title),
|
||||
p: hazardFormData.level === 0 ? 1 : "",
|
||||
q: hazardFormData.level === 1 ? 1 : "",
|
||||
r: hazardFormData.level === 2 ? 1 : "",
|
||||
s: common_vendor.t(((_d = sourceOptions.value[hazardFormData.source]) == null ? void 0 : _d.title) || "-"),
|
||||
t: common_vendor.t(hazardAddress.value || "-"),
|
||||
v: common_vendor.t(hazardFormData.description || "-"),
|
||||
w: hazardFileList.value.length > 0
|
||||
}, hazardFileList.value.length > 0 ? {
|
||||
x: common_vendor.t(hazardFileList.value.length)
|
||||
n: common_vendor.t(hazardPayload.value.formData.title),
|
||||
o: common_vendor.t((_c = common_vendor.unref(components_hazard_hazardForm.LEVEL_OPTIONS)[hazardPayload.value.formData.level]) == null ? void 0 : _c.title),
|
||||
p: hazardPayload.value.formData.level === 0 ? 1 : "",
|
||||
q: hazardPayload.value.formData.level === 1 ? 1 : "",
|
||||
r: hazardPayload.value.formData.level === 2 ? 1 : "",
|
||||
s: common_vendor.t(((_d = common_vendor.unref(components_hazard_hazardForm.SOURCE_OPTIONS)[hazardPayload.value.formData.source]) == null ? void 0 : _d.title) || "-"),
|
||||
t: common_vendor.t(hazardPayload.value.address || "-"),
|
||||
v: common_vendor.t(hazardPayload.value.formData.description || "-"),
|
||||
w: hazardPayload.value.fileList.length > 0
|
||||
}, hazardPayload.value.fileList.length > 0 ? {
|
||||
x: common_vendor.t(hazardPayload.value.fileList.length)
|
||||
} : {}, {
|
||||
y: common_vendor.o(editHazard),
|
||||
z: common_vendor.o(clearHazard)
|
||||
@@ -626,138 +273,22 @@ const _sfc_main = {
|
||||
modelValue: value1.value
|
||||
}),
|
||||
C: common_vendor.o(handleSubmit),
|
||||
D: common_vendor.o(($event) => showHazardPopup.value = false),
|
||||
E: showRestoreBanner.value
|
||||
}, showRestoreBanner.value ? {
|
||||
F: common_vendor.o(($event) => clearDraft(true))
|
||||
} : {}, {
|
||||
G: common_vendor.o(($event) => hazardFormData.source = $event),
|
||||
H: common_vendor.p({
|
||||
options: sourceOptions.value,
|
||||
wrap: false,
|
||||
["item-width"]: "152rpx",
|
||||
["item-height"]: "64rpx",
|
||||
modelValue: hazardFormData.source
|
||||
D: common_vendor.sr(hazardFormRef, "643afff0-3", {
|
||||
"k": "hazardFormRef"
|
||||
}),
|
||||
I: common_vendor.o(common_vendor.unref(afterRead)),
|
||||
J: common_vendor.o(common_vendor.unref(deletePic)),
|
||||
K: common_vendor.p({
|
||||
fileList: hazardFileList.value,
|
||||
name: "1",
|
||||
multiple: true,
|
||||
imageMode: "aspectFill",
|
||||
maxCount: 10
|
||||
}),
|
||||
L: canvasWidth.value,
|
||||
M: canvasHeight.value,
|
||||
N: canvasWidth.value + "px",
|
||||
O: canvasHeight.value + "px",
|
||||
P: !aiAnalyzing.value
|
||||
}, !aiAnalyzing.value ? {} : {}, {
|
||||
Q: common_vendor.t(aiAnalyzing.value ? "AI识别中..." : "AI 识别隐患"),
|
||||
R: aiAnalyzing.value,
|
||||
S: aiAnalyzing.value,
|
||||
T: common_vendor.o(handleAiAnalyze),
|
||||
U: common_vendor.o(($event) => hazardFormData.title = $event),
|
||||
V: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: hazardFormData.title
|
||||
}),
|
||||
W: common_vendor.sr(levelChooseRef, "643afff0-7,643afff0-3", {
|
||||
"k": "levelChooseRef"
|
||||
}),
|
||||
X: common_vendor.o(($event) => hazardFormData.level = $event),
|
||||
Y: common_vendor.p({
|
||||
options: levelOptions.value,
|
||||
wrap: false,
|
||||
["item-width"]: "183rpx",
|
||||
["item-height"]: "72rpx",
|
||||
modelValue: hazardFormData.level
|
||||
}),
|
||||
Z: common_vendor.o(($event) => hazardAddress.value = $event),
|
||||
aa: common_vendor.p({
|
||||
placeholder: "请输入地址",
|
||||
border: "surround",
|
||||
modelValue: hazardAddress.value
|
||||
}),
|
||||
ab: common_vendor.o(chooseLocation),
|
||||
ac: common_vendor.t(hazardFormData.regulationName || "请选择法律依据"),
|
||||
ad: !hazardFormData.regulationName ? 1 : "",
|
||||
ae: common_vendor.o(openLawPopup),
|
||||
af: common_vendor.t(selectedAreaName.value || "请选择隐患区域"),
|
||||
ag: !selectedAreaName.value ? 1 : "",
|
||||
ah: common_vendor.o(($event) => showAreaPicker.value = true),
|
||||
ai: common_vendor.o(($event) => hazardFormData.description = $event),
|
||||
aj: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: hazardFormData.description
|
||||
}),
|
||||
ak: common_vendor.o(($event) => hazardFormData.tagIndex = $event),
|
||||
al: common_vendor.p({
|
||||
options: tagOptions.value,
|
||||
modelValue: hazardFormData.tagIndex
|
||||
}),
|
||||
am: common_vendor.o(($event) => showHazardPopup.value = false),
|
||||
an: common_vendor.o(confirmHazard),
|
||||
ao: common_vendor.o(($event) => showHazardPopup.value = false),
|
||||
ap: common_vendor.p({
|
||||
E: common_vendor.o(onHazardConfirm),
|
||||
F: common_vendor.o(($event) => common_vendor.unref(clearDraft)(true)),
|
||||
G: common_vendor.o(($event) => showHazardPopup.value = $event),
|
||||
H: common_vendor.o(($event) => hazardPayload.value = $event),
|
||||
I: common_vendor.p({
|
||||
title: "填写隐患信息",
|
||||
mode: "collect",
|
||||
["body-height"]: "60vh",
|
||||
["show-draft-banner"]: common_vendor.unref(showRestoreBanner),
|
||||
show: showHazardPopup.value,
|
||||
mode: "center",
|
||||
round: "20",
|
||||
safeAreaInsetBottom: false
|
||||
modelValue: hazardPayload.value
|
||||
}),
|
||||
aq: common_vendor.o(($event) => showLawPopup.value = false),
|
||||
ar: common_vendor.o(searchRegulation),
|
||||
as: lawKeyword.value,
|
||||
at: common_vendor.o(($event) => lawKeyword.value = $event.detail.value),
|
||||
av: common_vendor.o(searchRegulation),
|
||||
aw: lawLoading.value && lawList.value.length === 0
|
||||
}, lawLoading.value && lawList.value.length === 0 ? {} : !lawLoading.value && lawList.value.length === 0 ? {} : common_vendor.e({
|
||||
ay: common_vendor.f(lawList.value, (item, k0, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.depict),
|
||||
b: common_vendor.t(item.legalBasis),
|
||||
c: selectedLawId.value === item.id ? 1 : "",
|
||||
d: item.id,
|
||||
e: common_vendor.o(($event) => selectLaw(item), item.id)
|
||||
};
|
||||
}),
|
||||
az: lawLoading.value
|
||||
}, lawLoading.value ? {} : {}), {
|
||||
ax: !lawLoading.value && lawList.value.length === 0,
|
||||
aA: common_vendor.o(loadMoreLaw),
|
||||
aB: common_vendor.o(($event) => showLawPopup.value = false),
|
||||
aC: common_vendor.o(confirmLaw),
|
||||
aD: common_vendor.o(($event) => showLawPopup.value = false),
|
||||
aE: common_vendor.p({
|
||||
show: showLawPopup.value,
|
||||
mode: "center",
|
||||
round: "20",
|
||||
safeAreaInsetBottom: false
|
||||
}),
|
||||
aF: common_vendor.o(($event) => showAreaPicker.value = false),
|
||||
aG: common_vendor.o(confirmAreaSelect),
|
||||
aH: common_vendor.f(areaList.value, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.color,
|
||||
b: common_vendor.t(item.name),
|
||||
c: tempAreaId.value === item.id
|
||||
}, tempAreaId.value === item.id ? {} : {}, {
|
||||
d: item.id,
|
||||
e: tempAreaId.value === item.id ? 1 : "",
|
||||
f: common_vendor.o(($event) => tempAreaId.value = item.id, item.id)
|
||||
});
|
||||
}),
|
||||
aI: areaList.value.length === 0
|
||||
}, areaList.value.length === 0 ? {} : {}, {
|
||||
aJ: common_vendor.o(($event) => showAreaPicker.value = false),
|
||||
aK: common_vendor.p({
|
||||
show: showAreaPicker.value,
|
||||
mode: "bottom",
|
||||
round: "20"
|
||||
}),
|
||||
aL: common_vendor.gei(_ctx, "")
|
||||
J: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
"u-radio": "../../uni_modules/uview-plus/components/u-radio/u-radio",
|
||||
"u-radio-group": "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group",
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
||||
"up-choose": "../../uni_modules/uview-plus/components/u-choose/u-choose",
|
||||
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload",
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
||||
"hazard-form-popup": "../../components/hazard/HazardFormPopup"
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -170,278 +170,4 @@
|
||||
background: #FFF1F0;
|
||||
border: 2rpx solid #FFA39E;
|
||||
color: #F5222D;
|
||||
}
|
||||
.popup-content.data-v-643afff0 {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-header.data-v-643afff0 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.popup-header .popup-title.data-v-643afff0 {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
.popup-header .popup-close.data-v-643afff0 {
|
||||
font-size: 40rpx;
|
||||
color: #999;
|
||||
line-height: 1;
|
||||
}
|
||||
.popup-body.data-v-643afff0 {
|
||||
padding: 30rpx;
|
||||
}
|
||||
.source-choose-scroll.data-v-643afff0 {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.source-choose-scroll.data-v-643afff0 .up-choose {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.source-choose-scroll.data-v-643afff0 .u-tag-wrapper {
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.source-choose-scroll.data-v-643afff0 .u-tag {
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
box-sizing: border-box;
|
||||
padding: 0 8rpx !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
.source-choose-scroll.data-v-643afff0 .u-tag__content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
}
|
||||
.source-choose-scroll.data-v-643afff0 .u-tag__text {
|
||||
font-size: 24rpx !important;
|
||||
line-height: 1.3 !important;
|
||||
text-align: center;
|
||||
}
|
||||
.ai-btn-wrapper.data-v-643afff0 {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.ai-analyze-btn.data-v-643afff0 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 72rpx;
|
||||
padding: 0 32rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #4facfe 0%, #2668EA 100%);
|
||||
border-radius: 36rpx;
|
||||
border: none;
|
||||
}
|
||||
.ai-analyze-btn.data-v-643afff0::after {
|
||||
border: none;
|
||||
}
|
||||
.ai-analyze-btn .ai-btn-icon.data-v-643afff0 {
|
||||
margin-right: 8rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.ai-analyze-btn[disabled].data-v-643afff0 {
|
||||
opacity: 0.7;
|
||||
}
|
||||
.popup-footer.data-v-643afff0 {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
.popup-footer button.data-v-643afff0 {
|
||||
flex: 1;
|
||||
height: 90rpx;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
line-height: 90rpx;
|
||||
border-radius: 0;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.popup-footer button.data-v-643afff0::after {
|
||||
border: none;
|
||||
}
|
||||
.popup-footer .btn-cancel.data-v-643afff0 {
|
||||
background: #fff;
|
||||
color: #666;
|
||||
}
|
||||
.popup-footer .btn-confirm.data-v-643afff0 {
|
||||
color: #fff;
|
||||
}
|
||||
.address-box.data-v-643afff0 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.address-box .address-input-wrapper.data-v-643afff0 {
|
||||
flex: 1;
|
||||
}
|
||||
.address-box .btn-address.data-v-643afff0 {
|
||||
flex-shrink: 0;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
padding: 0 30rpx;
|
||||
font-size: 26rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #fff;
|
||||
}
|
||||
.address-box .btn-address.data-v-643afff0::after {
|
||||
border: none;
|
||||
}
|
||||
.select-trigger.data-v-643afff0 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #fff;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
}
|
||||
.select-trigger .select-value.data-v-643afff0 {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.select-trigger .select-value.placeholder.data-v-643afff0 {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
.picker-popup.data-v-643afff0 {
|
||||
background: #fff;
|
||||
}
|
||||
.picker-popup .picker-header.data-v-643afff0 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.picker-popup .picker-header .picker-cancel.data-v-643afff0 {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
.picker-popup .picker-header .picker-title.data-v-643afff0 {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.picker-popup .picker-header .picker-confirm.data-v-643afff0 {
|
||||
font-size: 28rpx;
|
||||
color: #2667E9;
|
||||
}
|
||||
.picker-popup .picker-body.data-v-643afff0 {
|
||||
max-height: 600rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.picker-popup .picker-item.data-v-643afff0 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
.picker-popup .picker-item.data-v-643afff0:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.picker-popup .picker-item.picker-item-active.data-v-643afff0 {
|
||||
color: #2667E9;
|
||||
}
|
||||
.law-popup.data-v-643afff0 {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
max-height: 80vh;
|
||||
}
|
||||
.law-popup .popup-header.data-v-643afff0 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.law-popup .popup-header .popup-title.data-v-643afff0 {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.law-popup .popup-header .popup-close.data-v-643afff0 {
|
||||
font-size: 40rpx;
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
}
|
||||
.search-box.data-v-643afff0 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #F5F5F5;
|
||||
border-radius: 40rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
margin: 20rpx 30rpx;
|
||||
}
|
||||
.search-box .search-icon.data-v-643afff0 {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.search-box .search-input.data-v-643afff0 {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
.search-box .search-btn.data-v-643afff0 {
|
||||
color: #2667E9;
|
||||
font-size: 26rpx;
|
||||
margin-left: 16rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
.loading-tip.data-v-643afff0, .empty-tip.data-v-643afff0 {
|
||||
text-align: center;
|
||||
padding: 40rpx;
|
||||
color: #999;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.law-list.data-v-643afff0 {
|
||||
max-height: 500rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.law-item.data-v-643afff0 {
|
||||
padding: 24rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 16rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
text-align: left;
|
||||
}
|
||||
.law-item .law-title.data-v-643afff0 {
|
||||
line-height: 1.5;
|
||||
margin-bottom: 8rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.law-item .law-basis.data-v-643afff0 {
|
||||
font-size: 24rpx;
|
||||
line-height: 1.4;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
.law-item-active.data-v-643afff0 {
|
||||
border-color: #2667E9;
|
||||
background: #F0F6FF;
|
||||
}
|
||||
.area-color-dot.data-v-643afff0 {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
645
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/detail.js
vendored
Normal file
645
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/detail.js
vendored
Normal file
@@ -0,0 +1,645 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const utils_draftCache = require("../../utils/draftCache.js");
|
||||
const utils_useDraftCache = require("../../utils/useDraftCache.js");
|
||||
const components_hazard_hazardForm = require("../../components/hazard/hazardForm.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
|
||||
const _easycom_u_radio2 = common_vendor.resolveComponent("u-radio");
|
||||
const _easycom_u_radio_group2 = common_vendor.resolveComponent("u-radio-group");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
(_easycom_up_icon2 + _easycom_u_radio2 + _easycom_u_radio_group2 + _easycom_up_textarea2 + _easycom_u_popup2)();
|
||||
}
|
||||
const _easycom_up_icon = () => "../../uni_modules/uview-plus/components/u-icon/u-icon.js";
|
||||
const _easycom_u_radio = () => "../../uni_modules/uview-plus/components/u-radio/u-radio.js";
|
||||
const _easycom_u_radio_group = () => "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
|
||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_icon + _easycom_u_radio + _easycom_u_radio_group + _easycom_up_textarea + HazardFormPopup + _easycom_u_popup)();
|
||||
}
|
||||
const HazardFormPopup = () => "../../components/hazard/HazardFormPopup.js";
|
||||
const TASK_STATUS_SUBMITTED = 2;
|
||||
const _sfc_main = {
|
||||
__name: "detail",
|
||||
setup(__props) {
|
||||
const oneTableId = common_vendor.ref("");
|
||||
const tableId = common_vendor.ref("");
|
||||
const taskDate = common_vendor.ref("");
|
||||
const planName = common_vendor.ref("");
|
||||
const loading = common_vendor.ref(true);
|
||||
const checkItemList = common_vendor.ref([]);
|
||||
const answerList = common_vendor.ref([]);
|
||||
const sessionSubmittedTaskIds = common_vendor.ref(/* @__PURE__ */ new Set());
|
||||
const showHazardPopup = common_vendor.ref(false);
|
||||
const showCheckSheet = common_vendor.ref(false);
|
||||
const activeHazardIndex = common_vendor.ref(-1);
|
||||
const hazardFormRef = common_vendor.ref(null);
|
||||
const editingHazardPayload = common_vendor.ref(components_hazard_hazardForm.createEmptyHazardPayload());
|
||||
const resultOptions = [
|
||||
{ name: "正常", value: 1 },
|
||||
{ name: "异常", value: 2 },
|
||||
{ name: "不涉及", value: 3 }
|
||||
];
|
||||
const syncSubmittedTaskIds = (list) => {
|
||||
const next = new Set(sessionSubmittedTaskIds.value);
|
||||
(list || []).forEach((item) => {
|
||||
if ((item == null ? void 0 : item.status) === TASK_STATUS_SUBMITTED && item.taskId != null) {
|
||||
next.add(item.taskId);
|
||||
}
|
||||
});
|
||||
sessionSubmittedTaskIds.value = next;
|
||||
};
|
||||
const isItemSubmitted = (item) => {
|
||||
if (!item)
|
||||
return false;
|
||||
if (item.status === TASK_STATUS_SUBMITTED)
|
||||
return true;
|
||||
if (item.taskId != null && sessionSubmittedTaskIds.value.has(item.taskId))
|
||||
return true;
|
||||
return false;
|
||||
};
|
||||
const getResultLabel = (result) => {
|
||||
const opt = resultOptions.find((o) => o.value === result);
|
||||
return (opt == null ? void 0 : opt.name) || "-";
|
||||
};
|
||||
const getResultTagClass = (result) => {
|
||||
if (result === 1)
|
||||
return "result-tag--normal";
|
||||
if (result === 2)
|
||||
return "result-tag--abnormal";
|
||||
if (result === 3)
|
||||
return "result-tag--na";
|
||||
return "";
|
||||
};
|
||||
const viewHazardDetail = (item) => {
|
||||
if (!(item == null ? void 0 : item.hazardId)) {
|
||||
common_vendor.index.showToast({ title: "暂无隐患信息", icon: "none" });
|
||||
return;
|
||||
}
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/hiddendanger/view?hazardId=${item.hazardId}`
|
||||
});
|
||||
};
|
||||
common_vendor.computed(() => {
|
||||
var _a;
|
||||
return planName.value || ((_a = checkItemList.value[0]) == null ? void 0 : _a.itemName) || "检查表";
|
||||
});
|
||||
common_vendor.computed(() => {
|
||||
var _a;
|
||||
return ((_a = checkItemList.value[0]) == null ? void 0 : _a.industryName) || "";
|
||||
});
|
||||
const createEmptyAnswer = () => ({
|
||||
resultLabel: "",
|
||||
result: null,
|
||||
remark: "",
|
||||
hazardPayload: components_hazard_hazardForm.createEmptyHazardPayload()
|
||||
});
|
||||
const normalizeSheetAnswer = (answer) => {
|
||||
if (!answer)
|
||||
return createEmptyAnswer();
|
||||
const hazardPayload = answer.hazardPayload || components_hazard_hazardForm.createEmptyHazardPayload();
|
||||
const empty = components_hazard_hazardForm.createEmptyHazardPayload();
|
||||
return {
|
||||
resultLabel: answer.resultLabel || "",
|
||||
result: answer.result ?? null,
|
||||
remark: answer.remark || "",
|
||||
hazardPayload: {
|
||||
formData: {
|
||||
...empty.formData,
|
||||
...hazardPayload.formData || {}
|
||||
},
|
||||
address: hazardPayload.address || "",
|
||||
lng: hazardPayload.lng || 0,
|
||||
lat: hazardPayload.lat || 0,
|
||||
areaId: hazardPayload.areaId || "",
|
||||
areaName: hazardPayload.areaName || "",
|
||||
fileList: Array.isArray(hazardPayload.fileList) ? [...hazardPayload.fileList] : [],
|
||||
tagOptions: Array.isArray(hazardPayload.tagOptions) ? [...hazardPayload.tagOptions] : []
|
||||
}
|
||||
};
|
||||
};
|
||||
const syncAnswerFields = (answer) => {
|
||||
const normalized = normalizeSheetAnswer(answer);
|
||||
if (!normalized.resultLabel && normalized.result != null) {
|
||||
const opt = resultOptions.find((o) => o.value === normalized.result);
|
||||
if (opt)
|
||||
normalized.resultLabel = opt.name;
|
||||
} else if (normalized.resultLabel && normalized.result == null) {
|
||||
const opt = resultOptions.find((o) => o.name === normalized.resultLabel);
|
||||
if (opt)
|
||||
normalized.result = opt.value;
|
||||
}
|
||||
return normalized;
|
||||
};
|
||||
const buildAnswerFromTask = (item) => {
|
||||
const answer = createEmptyAnswer();
|
||||
if (!isItemSubmitted(item)) {
|
||||
return answer;
|
||||
}
|
||||
answer.result = item.result;
|
||||
answer.remark = item.remark || "";
|
||||
const opt = resultOptions.find((o) => o.value === item.result);
|
||||
if (opt) {
|
||||
answer.resultLabel = opt.name;
|
||||
}
|
||||
if (item.result === 2 && item.hazardName) {
|
||||
const sourceIndex = components_hazard_hazardForm.SOURCE_OPTIONS.findIndex((o) => o.title === item.source);
|
||||
answer.hazardPayload = {
|
||||
...components_hazard_hazardForm.createEmptyHazardPayload(),
|
||||
formData: {
|
||||
...components_hazard_hazardForm.createEmptyHazardPayload().formData,
|
||||
title: item.hazardName || "",
|
||||
description: item.hazardDesc || "",
|
||||
source: sourceIndex >= 0 ? sourceIndex : 0
|
||||
},
|
||||
address: item.hazardAddress || ""
|
||||
};
|
||||
}
|
||||
return syncAnswerFields(answer);
|
||||
};
|
||||
const isAnswerFilled = (answer) => {
|
||||
if (!answer)
|
||||
return false;
|
||||
return !!(answer.resultLabel || answer.result != null);
|
||||
};
|
||||
const hasAnswerDraftContent = (answer) => {
|
||||
var _a, _b;
|
||||
if (!answer)
|
||||
return false;
|
||||
const normalized = normalizeSheetAnswer(answer);
|
||||
const hazard = normalized.hazardPayload;
|
||||
return !!(normalized.resultLabel || normalized.result != null || normalized.remark || ((_a = hazard.formData) == null ? void 0 : _a.title) || ((_b = hazard.formData) == null ? void 0 : _b.description) || hazard.fileList && hazard.fileList.length > 0);
|
||||
};
|
||||
const buildDraftAnswers = () => {
|
||||
return checkItemList.value.map((item, index) => {
|
||||
if (isItemSubmitted(item))
|
||||
return null;
|
||||
const answer = answerList.value[index] || createEmptyAnswer();
|
||||
if (!hasAnswerDraftContent(answer))
|
||||
return null;
|
||||
return {
|
||||
taskId: item.taskId,
|
||||
...JSON.parse(JSON.stringify(answer))
|
||||
};
|
||||
}).filter(Boolean);
|
||||
};
|
||||
const pruneDraftSubmitted = (taskIds = []) => {
|
||||
var _a;
|
||||
const key = utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.INSPECTION_SHEET, oneTableId.value, taskDate.value);
|
||||
const { data } = utils_draftCache.loadDraftWithFallback(key);
|
||||
if (!((_a = data == null ? void 0 : data.answers) == null ? void 0 : _a.length))
|
||||
return;
|
||||
const submittedSet = new Set(taskIds);
|
||||
const remainingAnswers = data.answers.filter(
|
||||
(answer) => (answer == null ? void 0 : answer.taskId) == null || !submittedSet.has(answer.taskId)
|
||||
);
|
||||
if (!remainingAnswers.length) {
|
||||
utils_draftCache.removeDraft(key);
|
||||
return;
|
||||
}
|
||||
utils_draftCache.saveDraftToStorage(key, {
|
||||
...data,
|
||||
answers: remainingAnswers
|
||||
});
|
||||
};
|
||||
const isItemPendingSubmit = (index) => {
|
||||
const item = checkItemList.value[index];
|
||||
return !isItemSubmitted(item) && isAnswerFilled(answerList.value[index]);
|
||||
};
|
||||
const submittedCount = common_vendor.computed(() => {
|
||||
return checkItemList.value.filter(isItemSubmitted).length;
|
||||
});
|
||||
const pendingSubmitCount = common_vendor.computed(() => {
|
||||
return checkItemList.value.filter((item, index) => isItemPendingSubmit(index)).length;
|
||||
});
|
||||
const uncheckedCount = common_vendor.computed(() => {
|
||||
return Math.max(checkItemList.value.length - submittedCount.value - pendingSubmitCount.value, 0);
|
||||
});
|
||||
const getSheetCellClass = (index) => {
|
||||
const item = checkItemList.value[index];
|
||||
if (isItemSubmitted(item))
|
||||
return "check-sheet-cell--submitted";
|
||||
if (isItemPendingSubmit(index))
|
||||
return "check-sheet-cell--pending";
|
||||
return "";
|
||||
};
|
||||
const progressPercent = common_vendor.computed(() => {
|
||||
if (!checkItemList.value.length)
|
||||
return 0;
|
||||
return Math.round(submittedCount.value / checkItemList.value.length * 100);
|
||||
});
|
||||
const sheetDraftHasContent = (data) => {
|
||||
var _a;
|
||||
if (!((_a = data == null ? void 0 : data.answers) == null ? void 0 : _a.length))
|
||||
return false;
|
||||
return data.answers.some((answer) => hasAnswerDraftContent(answer));
|
||||
};
|
||||
const {
|
||||
showRestoreBanner,
|
||||
clear: clearDraft,
|
||||
restore: restoreDraft,
|
||||
bindAutoSave
|
||||
} = utils_useDraftCache.useDraftCache({
|
||||
getKey: () => utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.INSPECTION_SHEET, oneTableId.value, taskDate.value),
|
||||
getPayload: () => ({
|
||||
oneTableId: oneTableId.value,
|
||||
taskDate: taskDate.value,
|
||||
planName: planName.value,
|
||||
answers: buildDraftAnswers()
|
||||
}),
|
||||
hasContent: sheetDraftHasContent,
|
||||
applyPayload: (data) => {
|
||||
var _a;
|
||||
if (!((_a = data == null ? void 0 : data.answers) == null ? void 0 : _a.length) || !checkItemList.value.length)
|
||||
return;
|
||||
answerList.value = checkItemList.value.map((item, index) => {
|
||||
if (isItemSubmitted(item)) {
|
||||
return buildAnswerFromTask(item);
|
||||
}
|
||||
const savedByIndex = data.answers[index];
|
||||
if (savedByIndex && sheetDraftHasContent({ answers: [savedByIndex] })) {
|
||||
return syncAnswerFields(savedByIndex);
|
||||
}
|
||||
if (item.taskId != null && item.taskId !== "") {
|
||||
const savedByTaskId = data.answers.find((a) => a.taskId === item.taskId);
|
||||
if (savedByTaskId) {
|
||||
return syncAnswerFields(savedByTaskId);
|
||||
}
|
||||
}
|
||||
return createEmptyAnswer();
|
||||
});
|
||||
if (data.planName && !planName.value) {
|
||||
planName.value = data.planName;
|
||||
}
|
||||
},
|
||||
clearForm: () => {
|
||||
answerList.value = checkItemList.value.map((item) => isItemSubmitted(item) ? buildAnswerFromTask(item) : createEmptyAnswer());
|
||||
},
|
||||
canSave: () => !!oneTableId.value && !!taskDate.value && checkItemList.value.length > 0,
|
||||
requireInitialized: true
|
||||
});
|
||||
bindAutoSave(() => answerList.value);
|
||||
const onResultChange = (index, label) => {
|
||||
const answer = answerList.value[index];
|
||||
if (!answer)
|
||||
return;
|
||||
answer.resultLabel = label;
|
||||
const selected = resultOptions.find((opt) => opt.name === label);
|
||||
answer.result = selected ? selected.value : null;
|
||||
if (label !== "异常") {
|
||||
answer.hazardPayload = components_hazard_hazardForm.createEmptyHazardPayload();
|
||||
}
|
||||
};
|
||||
const hazardFormExtraParams = common_vendor.computed(() => {
|
||||
var _a;
|
||||
const index = activeHazardIndex.value;
|
||||
const taskId = index >= 0 ? (_a = checkItemList.value[index]) == null ? void 0 : _a.taskId : "";
|
||||
return {
|
||||
locationDraftKey: `hazard_location_${oneTableId.value}_${taskDate.value}_${taskId || index}`
|
||||
};
|
||||
});
|
||||
const hasHazardData = (index) => {
|
||||
var _a;
|
||||
return components_hazard_hazardForm.hasValidHazardPayload((_a = answerList.value[index]) == null ? void 0 : _a.hazardPayload);
|
||||
};
|
||||
const openHazardPopup = (index) => {
|
||||
var _a;
|
||||
activeHazardIndex.value = index;
|
||||
editingHazardPayload.value = JSON.parse(JSON.stringify(
|
||||
((_a = answerList.value[index]) == null ? void 0 : _a.hazardPayload) ?? components_hazard_hazardForm.createEmptyHazardPayload()
|
||||
));
|
||||
showHazardPopup.value = true;
|
||||
};
|
||||
const closeHazardPopup = () => {
|
||||
showHazardPopup.value = false;
|
||||
activeHazardIndex.value = -1;
|
||||
editingHazardPayload.value = components_hazard_hazardForm.createEmptyHazardPayload();
|
||||
};
|
||||
const onHazardConfirm = (payload) => {
|
||||
const index = activeHazardIndex.value;
|
||||
const data = payload || editingHazardPayload.value;
|
||||
if (index >= 0 && data && answerList.value[index]) {
|
||||
answerList.value[index].hazardPayload = JSON.parse(JSON.stringify(data));
|
||||
}
|
||||
closeHazardPopup();
|
||||
};
|
||||
const clearHazard = (index) => {
|
||||
if (answerList.value[index]) {
|
||||
answerList.value[index].hazardPayload = components_hazard_hazardForm.createEmptyHazardPayload();
|
||||
}
|
||||
};
|
||||
const openCheckSheet = () => {
|
||||
showCheckSheet.value = true;
|
||||
};
|
||||
const closeCheckSheet = () => {
|
||||
showCheckSheet.value = false;
|
||||
};
|
||||
const handleSheetSubmit = () => {
|
||||
closeCheckSheet();
|
||||
handleSubmitAll();
|
||||
};
|
||||
const scrollToItem = (index) => {
|
||||
closeCheckSheet();
|
||||
common_vendor.nextTick$1(() => {
|
||||
common_vendor.index.pageScrollTo({
|
||||
selector: `#check-item-${index}`,
|
||||
duration: 300,
|
||||
offsetTop: -80
|
||||
});
|
||||
});
|
||||
};
|
||||
const getFilledAnswerIndices = () => {
|
||||
const indices = [];
|
||||
for (let i = 0; i < checkItemList.value.length; i++) {
|
||||
if (!isItemSubmitted(checkItemList.value[i]) && isAnswerFilled(answerList.value[i])) {
|
||||
indices.push(i);
|
||||
}
|
||||
}
|
||||
return indices;
|
||||
};
|
||||
const validateFilledAnswers = () => {
|
||||
const indices = getFilledAnswerIndices();
|
||||
if (!indices.length) {
|
||||
common_vendor.index.showToast({ title: "请先填写待提交的检查项", icon: "none" });
|
||||
return null;
|
||||
}
|
||||
for (const index of indices) {
|
||||
const answer = answerList.value[index];
|
||||
if (answer.resultLabel === "异常" && !components_hazard_hazardForm.hasValidHazardPayload(answer.hazardPayload)) {
|
||||
common_vendor.index.showToast({ title: `第 ${index + 1} 项为异常,请填写隐患信息`, icon: "none" });
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return indices;
|
||||
};
|
||||
const buildSubmitPayload = (filledIndices) => {
|
||||
return filledIndices.filter((index) => !isItemSubmitted(checkItemList.value[index])).map((index) => {
|
||||
const item = checkItemList.value[index];
|
||||
const answer = syncAnswerFields(answerList.value[index]);
|
||||
const payload = {
|
||||
taskId: item.taskId,
|
||||
result: answer.result,
|
||||
remark: answer.remark || ""
|
||||
};
|
||||
if (answer.resultLabel === "异常" && components_hazard_hazardForm.hasValidHazardPayload(answer.hazardPayload)) {
|
||||
payload.hazard = components_hazard_hazardForm.buildHiddenDangerParams(answer.hazardPayload, {
|
||||
taskId: item.taskId,
|
||||
checkPointId: item.checkPointId
|
||||
});
|
||||
}
|
||||
return payload;
|
||||
});
|
||||
};
|
||||
const goToListPage = () => {
|
||||
common_vendor.index.navigateBack();
|
||||
};
|
||||
const handleSubmitAll = async () => {
|
||||
const filledIndices = validateFilledAnswers();
|
||||
if (!filledIndices)
|
||||
return;
|
||||
const submitList = buildSubmitPayload(filledIndices);
|
||||
if (!submitList.length) {
|
||||
common_vendor.index.showToast({ title: "没有可提交的新检查项", icon: "none" });
|
||||
return;
|
||||
}
|
||||
try {
|
||||
common_vendor.index.showLoading({ title: "提交中..." });
|
||||
const res = await request_api.submitAllTask(submitList);
|
||||
common_vendor.index.hideLoading();
|
||||
if (res.code === 0) {
|
||||
const nextSubmitted = new Set(sessionSubmittedTaskIds.value);
|
||||
submitList.forEach((item) => {
|
||||
if (item.taskId != null) {
|
||||
nextSubmitted.add(item.taskId);
|
||||
}
|
||||
});
|
||||
sessionSubmittedTaskIds.value = nextSubmitted;
|
||||
pruneDraftSubmitted(submitList.map((item) => item.taskId));
|
||||
common_vendor.index.showToast({
|
||||
title: `已成功提交 ${submitList.length} 项`,
|
||||
icon: "success"
|
||||
});
|
||||
setTimeout(() => {
|
||||
goToListPage();
|
||||
}, 1500);
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "提交失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/detail.vue:730", "提交失败:", error);
|
||||
common_vendor.index.showToast({ title: "提交失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
const fetchDetail = async () => {
|
||||
var _a;
|
||||
if (!oneTableId.value || !taskDate.value) {
|
||||
loading.value = false;
|
||||
common_vendor.index.showToast({ title: "缺少任务参数", icon: "none" });
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await request_api.getAllTask(oneTableId.value, taskDate.value);
|
||||
if (res.code === 0) {
|
||||
const list = Array.isArray(res.data) ? res.data : ((_a = res.data) == null ? void 0 : _a.records) || [];
|
||||
syncSubmittedTaskIds(list);
|
||||
checkItemList.value = list;
|
||||
answerList.value = list.map((item) => buildAnswerFromTask(item));
|
||||
restoreDraft();
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取检查项失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/detail.vue:754", "获取检查项失败:", error);
|
||||
common_vendor.index.showToast({ title: "获取检查项失败", icon: "none" });
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.oneTableId) {
|
||||
oneTableId.value = options.oneTableId;
|
||||
} else if (options.id) {
|
||||
oneTableId.value = options.id;
|
||||
}
|
||||
if (options.taskDate) {
|
||||
taskDate.value = decodeURIComponent(options.taskDate).split(" ")[0];
|
||||
}
|
||||
if (options.name) {
|
||||
planName.value = decodeURIComponent(options.name);
|
||||
}
|
||||
if (options.tableId) {
|
||||
tableId.value = options.tableId;
|
||||
}
|
||||
fetchDetail();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: loading.value
|
||||
}, loading.value ? {} : !checkItemList.value.length ? {} : common_vendor.e({
|
||||
c: common_vendor.t(checkItemList.value.length),
|
||||
d: common_vendor.t(submittedCount.value),
|
||||
e: common_vendor.t(pendingSubmitCount.value),
|
||||
f: common_vendor.t(uncheckedCount.value),
|
||||
g: progressPercent.value + "%",
|
||||
h: common_vendor.p({
|
||||
name: "grid",
|
||||
size: "22",
|
||||
color: "#2667E9"
|
||||
}),
|
||||
i: common_vendor.o(openCheckSheet),
|
||||
j: common_vendor.unref(showRestoreBanner)
|
||||
}, common_vendor.unref(showRestoreBanner) ? {
|
||||
k: common_vendor.o(($event) => common_vendor.unref(clearDraft)(true))
|
||||
} : {}, {
|
||||
l: common_vendor.f(checkItemList.value, (item, index, i0) => {
|
||||
var _a, _b;
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(index + 1),
|
||||
b: isItemSubmitted(item)
|
||||
}, isItemSubmitted(item) ? {} : isItemPendingSubmit(index) ? {} : {}, {
|
||||
c: isItemPendingSubmit(index),
|
||||
d: common_vendor.t(item.name),
|
||||
e: item.point || "",
|
||||
f: isItemSubmitted(item)
|
||||
}, isItemSubmitted(item) ? common_vendor.e({
|
||||
g: common_vendor.t(getResultLabel(item.result)),
|
||||
h: common_vendor.n(getResultTagClass(item.result)),
|
||||
i: item.remark
|
||||
}, item.remark ? {
|
||||
j: common_vendor.t(item.remark)
|
||||
} : {}, {
|
||||
k: item.result === 2
|
||||
}, item.result === 2 ? common_vendor.e({
|
||||
l: item.hazardName
|
||||
}, item.hazardName ? {
|
||||
m: common_vendor.t(item.hazardName)
|
||||
} : {}, {
|
||||
n: item.source
|
||||
}, item.source ? {
|
||||
o: common_vendor.t(item.source)
|
||||
} : {}, {
|
||||
p: item.hazardAddress
|
||||
}, item.hazardAddress ? {
|
||||
q: common_vendor.t(item.hazardAddress)
|
||||
} : {}, {
|
||||
r: item.hazardDesc
|
||||
}, item.hazardDesc ? {
|
||||
s: common_vendor.t(item.hazardDesc)
|
||||
} : {}) : {}, {
|
||||
t: item.result === 2 && item.hazardId
|
||||
}, item.result === 2 && item.hazardId ? {
|
||||
v: common_vendor.o(($event) => viewHazardDetail(item), "check-item-" + index)
|
||||
} : {}) : common_vendor.e({
|
||||
w: common_vendor.f(resultOptions, (opt, optIndex, i1) => {
|
||||
return {
|
||||
a: optIndex,
|
||||
b: "1b3bf21b-2-" + i0 + "-" + i1 + "," + ("1b3bf21b-1-" + i0),
|
||||
c: common_vendor.p({
|
||||
customStyle: {
|
||||
marginBottom: "8px",
|
||||
marginRight: "24rpx"
|
||||
},
|
||||
label: opt.name,
|
||||
name: opt.name
|
||||
})
|
||||
};
|
||||
}),
|
||||
x: common_vendor.o((label) => onResultChange(index, label), "check-item-" + index),
|
||||
y: "1b3bf21b-1-" + i0,
|
||||
z: common_vendor.o(($event) => answerList.value[index].resultLabel = $event, "check-item-" + index),
|
||||
A: common_vendor.p({
|
||||
placement: "row",
|
||||
modelValue: answerList.value[index].resultLabel
|
||||
}),
|
||||
B: answerList.value[index].resultLabel === "异常"
|
||||
}, answerList.value[index].resultLabel === "异常" ? common_vendor.e({
|
||||
C: !hasHazardData(index)
|
||||
}, !hasHazardData(index) ? {
|
||||
D: common_vendor.o(($event) => openHazardPopup(index), "check-item-" + index)
|
||||
} : common_vendor.e({
|
||||
E: common_vendor.t(answerList.value[index].hazardPayload.formData.title),
|
||||
F: common_vendor.t((_a = common_vendor.unref(components_hazard_hazardForm.LEVEL_OPTIONS)[answerList.value[index].hazardPayload.formData.level]) == null ? void 0 : _a.title),
|
||||
G: answerList.value[index].hazardPayload.formData.level === 0 ? 1 : "",
|
||||
H: answerList.value[index].hazardPayload.formData.level === 1 ? 1 : "",
|
||||
I: answerList.value[index].hazardPayload.formData.level === 2 ? 1 : "",
|
||||
J: common_vendor.t(((_b = common_vendor.unref(components_hazard_hazardForm.SOURCE_OPTIONS)[answerList.value[index].hazardPayload.formData.source]) == null ? void 0 : _b.title) || "-"),
|
||||
K: common_vendor.t(answerList.value[index].hazardPayload.address || "-"),
|
||||
L: common_vendor.t(answerList.value[index].hazardPayload.formData.description || "-"),
|
||||
M: answerList.value[index].hazardPayload.fileList.length > 0
|
||||
}, answerList.value[index].hazardPayload.fileList.length > 0 ? {
|
||||
N: common_vendor.t(answerList.value[index].hazardPayload.fileList.length)
|
||||
} : {}, {
|
||||
O: common_vendor.o(($event) => openHazardPopup(index), "check-item-" + index),
|
||||
P: common_vendor.o(($event) => clearHazard(index), "check-item-" + index)
|
||||
})) : {}, {
|
||||
Q: "1b3bf21b-3-" + i0,
|
||||
R: common_vendor.o(($event) => answerList.value[index].remark = $event, "check-item-" + index),
|
||||
S: common_vendor.p({
|
||||
placeholder: "请输入备注信息",
|
||||
modelValue: answerList.value[index].remark
|
||||
})
|
||||
}), {
|
||||
T: "check-item-" + index,
|
||||
U: "check-item-" + index,
|
||||
V: isItemSubmitted(item) ? 1 : ""
|
||||
});
|
||||
}),
|
||||
m: pendingSubmitCount.value > 0
|
||||
}, pendingSubmitCount.value > 0 ? {
|
||||
n: common_vendor.t(pendingSubmitCount.value),
|
||||
o: common_vendor.o(handleSubmitAll)
|
||||
} : {}), {
|
||||
b: !checkItemList.value.length,
|
||||
p: activeHazardIndex.value >= 0
|
||||
}, activeHazardIndex.value >= 0 ? {
|
||||
q: common_vendor.sr(hazardFormRef, "1b3bf21b-4", {
|
||||
"k": "hazardFormRef"
|
||||
}),
|
||||
r: common_vendor.o(onHazardConfirm),
|
||||
s: common_vendor.o(($event) => showHazardPopup.value = $event),
|
||||
t: common_vendor.o(($event) => editingHazardPayload.value = $event),
|
||||
v: common_vendor.p({
|
||||
title: "填写隐患信息",
|
||||
mode: "collect",
|
||||
["body-height"]: "60vh",
|
||||
["extra-params"]: hazardFormExtraParams.value,
|
||||
show: showHazardPopup.value,
|
||||
modelValue: editingHazardPayload.value
|
||||
})
|
||||
} : {}, {
|
||||
w: common_vendor.t(checkItemList.value.length),
|
||||
x: common_vendor.f(checkItemList.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(index + 1),
|
||||
b: "sheet-nav-" + index,
|
||||
c: common_vendor.n(getSheetCellClass(index)),
|
||||
d: common_vendor.o(($event) => scrollToItem(index), "sheet-nav-" + index)
|
||||
};
|
||||
}),
|
||||
y: common_vendor.t(submittedCount.value),
|
||||
z: common_vendor.t(pendingSubmitCount.value),
|
||||
A: common_vendor.t(uncheckedCount.value),
|
||||
B: pendingSubmitCount.value > 0
|
||||
}, pendingSubmitCount.value > 0 ? {
|
||||
C: common_vendor.o(handleSheetSubmit)
|
||||
} : {}, {
|
||||
D: common_vendor.o(closeCheckSheet),
|
||||
E: common_vendor.p({
|
||||
show: showCheckSheet.value,
|
||||
mode: "bottom",
|
||||
round: "20",
|
||||
["safe-area-inset-bottom"]: true
|
||||
}),
|
||||
F: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1b3bf21b"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Inspectionresult/detail.js.map
|
||||
11
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/detail.json
vendored
Normal file
11
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/detail.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"navigationBarTitleText": "排查详情",
|
||||
"usingComponents": {
|
||||
"up-icon": "../../uni_modules/uview-plus/components/u-icon/u-icon",
|
||||
"u-radio": "../../uni_modules/uview-plus/components/u-radio/u-radio",
|
||||
"u-radio-group": "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group",
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup",
|
||||
"hazard-form-popup": "../../components/hazard/HazardFormPopup"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/detail.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/detail.wxml
vendored
Normal file
File diff suppressed because one or more lines are too long
455
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/detail.wxss
vendored
Normal file
455
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/detail.wxss
vendored
Normal file
@@ -0,0 +1,455 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-1b3bf21b {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
.page-content.data-v-1b3bf21b {
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
.empty-tip.data-v-1b3bf21b {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.sheet-header.data-v-1b3bf21b {
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.float-nav.data-v-1b3bf21b {
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 100;
|
||||
background: #fff;
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
|
||||
padding: 20rpx 24rpx;
|
||||
}
|
||||
.float-nav-body.data-v-1b3bf21b {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.float-nav-main.data-v-1b3bf21b {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.sheet-nav-btn.data-v-1b3bf21b {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
background: #eef3ff;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.question-card.data-v-1b3bf21b {
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.question-card--submitted.data-v-1b3bf21b {
|
||||
background: #f8faf8;
|
||||
border: 1rpx solid #e8f5e9;
|
||||
}
|
||||
.question-header-row.data-v-1b3bf21b {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16rpx;
|
||||
}
|
||||
.question-index.data-v-1b3bf21b {
|
||||
display: inline-block;
|
||||
padding: 4rpx 16rpx;
|
||||
font-size: 24rpx;
|
||||
color: #2667E9;
|
||||
background: #EEF3FF;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
.submitted-tag.data-v-1b3bf21b {
|
||||
padding: 4rpx 16rpx;
|
||||
font-size: 22rpx;
|
||||
color: #52c41a;
|
||||
background: #f6ffed;
|
||||
border: 1rpx solid #b7eb8f;
|
||||
border-radius: 8rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.pending-tag.data-v-1b3bf21b {
|
||||
padding: 4rpx 16rpx;
|
||||
font-size: 22rpx;
|
||||
color: #2667e9;
|
||||
background: #eef3ff;
|
||||
border: 1rpx solid #adc6ff;
|
||||
border-radius: 8rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.readonly-block.data-v-1b3bf21b,
|
||||
.answer-panel.data-v-1b3bf21b {
|
||||
padding: 20rpx;
|
||||
background: #f7f8fa;
|
||||
border: 1rpx solid #e8e8e8;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
.readonly-row.data-v-1b3bf21b {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
margin-bottom: 12rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.readonly-row.data-v-1b3bf21b:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.readonly-row--stack.data-v-1b3bf21b {
|
||||
align-items: flex-start;
|
||||
}
|
||||
.hazard-summary.data-v-1b3bf21b {
|
||||
margin-top: 16rpx;
|
||||
padding-top: 16rpx;
|
||||
border-top: 1rpx dashed #e0e0e0;
|
||||
}
|
||||
.readonly-label.data-v-1b3bf21b {
|
||||
flex-shrink: 0;
|
||||
color: #999;
|
||||
min-width: 120rpx;
|
||||
}
|
||||
.readonly-value.data-v-1b3bf21b {
|
||||
flex: 1;
|
||||
color: #333;
|
||||
word-break: break-all;
|
||||
}
|
||||
.result-tag.data-v-1b3bf21b {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.result-tag--normal.data-v-1b3bf21b {
|
||||
background: #f6ffed;
|
||||
border: 1rpx solid #b7eb8f;
|
||||
color: #52c41a;
|
||||
}
|
||||
.result-tag--abnormal.data-v-1b3bf21b {
|
||||
background: #fff1f0;
|
||||
border: 1rpx solid #ffa39e;
|
||||
color: #f5222d;
|
||||
}
|
||||
.result-tag--na.data-v-1b3bf21b {
|
||||
background: #f5f5f5;
|
||||
border: 1rpx solid #d9d9d9;
|
||||
color: #8c8c8c;
|
||||
}
|
||||
.view-hazard-btn.data-v-1b3bf21b {
|
||||
margin-top: 20rpx;
|
||||
width: 100%;
|
||||
height: 72rpx;
|
||||
line-height: 72rpx;
|
||||
font-size: 28rpx;
|
||||
color: #2667e9;
|
||||
background: #fff;
|
||||
border: 1rpx solid #adc6ff;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
.view-hazard-btn.data-v-1b3bf21b::after {
|
||||
border: none;
|
||||
}
|
||||
.progress-text.data-v-1b3bf21b {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.progress-text .current-index.data-v-1b3bf21b {
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #2667E9;
|
||||
}
|
||||
.progress-text .total-count.data-v-1b3bf21b {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
.progress-line.data-v-1b3bf21b {
|
||||
height: 12rpx;
|
||||
background: #E5E5E5;
|
||||
border-radius: 6rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.progress-inner.data-v-1b3bf21b {
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, #2667E9, #5B9BFF);
|
||||
border-radius: 6rpx;
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
.hazard-section.data-v-1b3bf21b {
|
||||
border-top: 1rpx solid #eee;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
.hazard-tip.data-v-1b3bf21b {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16rpx 20rpx;
|
||||
background: #FFF7E6;
|
||||
border: 1rpx solid #FFE7BA;
|
||||
border-radius: 8rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.hazard-tip .text-orange.data-v-1b3bf21b {
|
||||
color: #FA8C16;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.hazard-btn.data-v-1b3bf21b {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 88rpx;
|
||||
border: 2rpx dashed #2667E9;
|
||||
border-radius: 12rpx;
|
||||
background: #F5F9FF;
|
||||
}
|
||||
.hazard-btn .text-blue.data-v-1b3bf21b {
|
||||
color: #2667E9;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.hazard-card.data-v-1b3bf21b {
|
||||
background: #F5F9FF;
|
||||
border: 1rpx solid #D6E4FF;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.hazard-card .card-header.data-v-1b3bf21b {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx solid #E8E8E8;
|
||||
background: #fff;
|
||||
}
|
||||
.hazard-card .card-body.data-v-1b3bf21b {
|
||||
padding: 20rpx;
|
||||
}
|
||||
.hazard-card .card-body .info-row.data-v-1b3bf21b {
|
||||
display: flex;
|
||||
margin-bottom: 12rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.hazard-card .card-body .info-row.data-v-1b3bf21b:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.hazard-card .card-body .info-row .text-gray.data-v-1b3bf21b {
|
||||
flex-shrink: 0;
|
||||
color: #999;
|
||||
}
|
||||
.hazard-card .card-body .info-row .description-text.data-v-1b3bf21b {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.hazard-card .card-footer.data-v-1b3bf21b {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #E8E8E8;
|
||||
background: #fff;
|
||||
}
|
||||
.hazard-card .card-footer button.data-v-1b3bf21b {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 0;
|
||||
}
|
||||
.hazard-card .card-footer button.data-v-1b3bf21b::after {
|
||||
border: none;
|
||||
}
|
||||
.hazard-card .card-footer .btn-edit.data-v-1b3bf21b {
|
||||
background: #fff;
|
||||
color: #2667E9;
|
||||
border-right: 1rpx solid #E8E8E8;
|
||||
}
|
||||
.hazard-card .card-footer .btn-clear.data-v-1b3bf21b {
|
||||
background: #fff;
|
||||
color: #F56C6C;
|
||||
}
|
||||
.level-tag.data-v-1b3bf21b {
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.level-minor.data-v-1b3bf21b {
|
||||
background: #F6FFED;
|
||||
border: 2rpx solid #B7EB8F;
|
||||
color: #52C41A;
|
||||
}
|
||||
.level-normal.data-v-1b3bf21b {
|
||||
background: #FFF7E6;
|
||||
border: 2rpx solid #FFD591;
|
||||
color: #FA8C16;
|
||||
}
|
||||
.level-major.data-v-1b3bf21b {
|
||||
background: #FFF1F0;
|
||||
border: 2rpx solid #FFA39E;
|
||||
color: #F5222D;
|
||||
}
|
||||
.submit-btn.data-v-1b3bf21b {
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
.draft-banner.data-v-1b3bf21b {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 24rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fa8c16;
|
||||
background: #fff7eb;
|
||||
border: 1rpx solid #ffe4cc;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
.draft-banner-left.data-v-1b3bf21b {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.draft-banner-icon.data-v-1b3bf21b {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.draft-banner-action.data-v-1b3bf21b {
|
||||
flex-shrink: 0;
|
||||
margin-left: 16rpx;
|
||||
color: #2667e9;
|
||||
font-weight: bold;
|
||||
}
|
||||
.check-sheet-popup.data-v-1b3bf21b {
|
||||
padding: 32rpx 32rpx calc(24rpx + env(safe-area-inset-bottom));
|
||||
background: #fff;
|
||||
}
|
||||
.check-sheet-header.data-v-1b3bf21b {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.check-sheet-title.data-v-1b3bf21b {
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.check-sheet-subtitle.data-v-1b3bf21b {
|
||||
margin-top: 8rpx;
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
.check-sheet-grid-wrap.data-v-1b3bf21b {
|
||||
max-height: 52vh;
|
||||
}
|
||||
.check-sheet-grid.data-v-1b3bf21b {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 20rpx;
|
||||
padding-bottom: 8rpx;
|
||||
}
|
||||
.check-sheet-cell.data-v-1b3bf21b {
|
||||
width: calc((100% - 80rpx) / 5);
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
background: #fff;
|
||||
border: 2rpx solid #e5e5e5;
|
||||
border-radius: 12rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.check-sheet-cell--pending.data-v-1b3bf21b {
|
||||
color: #fff;
|
||||
background: #2667e9;
|
||||
border-color: #2667e9;
|
||||
}
|
||||
.check-sheet-cell--submitted.data-v-1b3bf21b {
|
||||
color: #52c41a;
|
||||
background: #f6ffed;
|
||||
border-color: #b7eb8f;
|
||||
}
|
||||
.check-sheet-footer.data-v-1b3bf21b {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 24rpx;
|
||||
margin-top: 28rpx;
|
||||
padding-top: 24rpx;
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
}
|
||||
.check-sheet-legend.data-v-1b3bf21b {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 32rpx;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
}
|
||||
.check-sheet-submit-btn.data-v-1b3bf21b {
|
||||
flex-shrink: 0;
|
||||
height: 72rpx;
|
||||
line-height: 72rpx;
|
||||
padding: 0 36rpx;
|
||||
margin: 0;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #4facfe 0%, #2668ea 100%);
|
||||
border-radius: 36rpx;
|
||||
border: none;
|
||||
box-shadow: 0 4rpx 16rpx rgba(38, 104, 234, 0.3);
|
||||
}
|
||||
.check-sheet-submit-btn.data-v-1b3bf21b::after {
|
||||
border: none;
|
||||
}
|
||||
.legend-item.data-v-1b3bf21b {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
}
|
||||
.legend-dot.data-v-1b3bf21b {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
border-radius: 8rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.legend-dot--submitted.data-v-1b3bf21b {
|
||||
background: #f6ffed;
|
||||
border: 2rpx solid #b7eb8f;
|
||||
}
|
||||
.legend-dot--pending.data-v-1b3bf21b {
|
||||
background: #2667e9;
|
||||
border: 2rpx solid #2667e9;
|
||||
}
|
||||
.legend-dot--todo.data-v-1b3bf21b {
|
||||
background: #fff;
|
||||
border: 2rpx solid #e5e5e5;
|
||||
}
|
||||
138
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/list.js
vendored
Normal file
138
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/list.js
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_u_navbar2 = common_vendor.resolveComponent("u-navbar");
|
||||
_easycom_u_navbar2();
|
||||
}
|
||||
const _easycom_u_navbar = () => "../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
|
||||
if (!Math) {
|
||||
_easycom_u_navbar();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "list",
|
||||
setup(__props) {
|
||||
const loading = common_vendor.ref(true);
|
||||
const checkPlanData = common_vendor.ref([]);
|
||||
const tableId = common_vendor.ref("");
|
||||
const planName = common_vendor.ref("");
|
||||
const listParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
name: ""
|
||||
};
|
||||
const formatDate = (dateStr) => {
|
||||
if (!dateStr)
|
||||
return "";
|
||||
return String(dateStr).split(" ")[0];
|
||||
};
|
||||
const formatProgress = (progress) => {
|
||||
const num = Number(progress);
|
||||
if (Number.isNaN(num))
|
||||
return 0;
|
||||
return Math.min(100, Math.max(0, num));
|
||||
};
|
||||
const fetchList = async () => {
|
||||
var _a;
|
||||
if (!tableId.value) {
|
||||
loading.value = false;
|
||||
checkPlanData.value = [];
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await request_api.getPlanTableDetail({
|
||||
...listParams,
|
||||
tableId: tableId.value
|
||||
});
|
||||
if (res.code === 0) {
|
||||
checkPlanData.value = ((_a = res.data) == null ? void 0 : _a.records) || [];
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取检查清单失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/Inspectionresult/list.vue:138", "获取检查清单失败:", error);
|
||||
common_vendor.index.showToast({ title: "获取检查清单失败", icon: "none" });
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
const startCheck = (item) => {
|
||||
const oneTableId = item.id;
|
||||
const taskDate = formatDate(item.taskDate);
|
||||
if (!oneTableId || !taskDate) {
|
||||
common_vendor.index.showToast({ title: "缺少任务参数", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const name = item.name || planName.value || "";
|
||||
const tableIdQuery = tableId.value ? `&tableId=${tableId.value}` : "";
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/Inspectionresult/detail?oneTableId=${oneTableId}&taskDate=${encodeURIComponent(taskDate)}&name=${encodeURIComponent(name)}${tableIdQuery}`
|
||||
});
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.tableId) {
|
||||
tableId.value = options.tableId;
|
||||
}
|
||||
if (options.name) {
|
||||
planName.value = decodeURIComponent(options.name);
|
||||
}
|
||||
});
|
||||
common_vendor.onShow(() => {
|
||||
fetchList();
|
||||
});
|
||||
const goHome = () => {
|
||||
common_vendor.index.switchTab({
|
||||
url: "/pages/index/index"
|
||||
});
|
||||
};
|
||||
common_vendor.onBackPress(() => {
|
||||
goHome();
|
||||
return true;
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.o(goHome),
|
||||
b: common_vendor.p({
|
||||
title: "检查列表",
|
||||
placeholder: true,
|
||||
safeAreaInsetTop: true,
|
||||
bgColor: "#3375e6",
|
||||
titleColor: "#ffffff",
|
||||
leftIconColor: "#ffffff",
|
||||
autoBack: false
|
||||
}),
|
||||
c: loading.value
|
||||
}, loading.value ? {} : !tableId.value ? {} : checkPlanData.value.length === 0 ? {} : {
|
||||
f: common_vendor.f(checkPlanData.value, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.name || planName.value || "检查任务"),
|
||||
b: common_vendor.t(item.runModeName),
|
||||
c: common_vendor.t(item.cycle),
|
||||
d: item.taskDate
|
||||
}, item.taskDate ? {
|
||||
e: common_vendor.t(formatDate(item.taskDate))
|
||||
} : {}, {
|
||||
f: common_vendor.t(formatDate(item.planStartTime)),
|
||||
g: common_vendor.t(formatDate(item.planEndTime)),
|
||||
h: formatProgress(item.progress) + "%",
|
||||
i: common_vendor.t(formatProgress(item.progress)),
|
||||
j: common_vendor.t(item.totalCount ?? 0),
|
||||
k: common_vendor.t(item.pendingCount ?? 0),
|
||||
l: common_vendor.t(item.unusualNum ?? 0),
|
||||
m: common_vendor.t(item.finishedCount ?? 0),
|
||||
n: common_vendor.o(($event) => startCheck(item), item.id || item.taskDate),
|
||||
o: item.id || item.taskDate
|
||||
});
|
||||
})
|
||||
}, {
|
||||
d: !tableId.value,
|
||||
e: checkPlanData.value.length === 0,
|
||||
g: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-52eec896"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Inspectionresult/list.js.map
|
||||
7
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/list.json
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/list.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "检查列表",
|
||||
"usingComponents": {
|
||||
"u-navbar": "../../uni_modules/uview-plus/components/u-navbar/u-navbar"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/list.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/list.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['page', 'data-v-52eec896', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{g}}"><u-navbar wx:if="{{b}}" class="data-v-52eec896" virtualHostClass="data-v-52eec896" bindleftClick="{{a}}" u-i="52eec896-0" bind:__l="__l" u-p="{{b}}"/><view class="page-content padding data-v-52eec896"><view wx:if="{{c}}" class="empty-tip text-gray text-center padding data-v-52eec896">加载中...</view><view wx:elif="{{d}}" class="empty-tip text-gray text-center padding data-v-52eec896"> 请从首页检查计划进入 </view><view wx:elif="{{e}}" class="empty-tip text-gray text-center padding data-v-52eec896"> 暂无检查任务 </view><block wx:else><view wx:for="{{f}}" wx:for-item="item" wx:key="o" class="plan-card margin-bottom data-v-52eec896"><view class="plan-header data-v-52eec896"><text class="plan-header-title data-v-52eec896">{{item.a}}</text></view><view class="plan-body data-v-52eec896"><view class="flex data-v-52eec896"><view class="border-border margin-right-xs data-v-52eec896">{{item.b}}完成</view><view class="border-border data-v-52eec896">{{item.c}}</view></view><view wx:if="{{item.d}}" class="flex text-gray margin-top data-v-52eec896"><view class="data-v-52eec896">任务日期:</view><view class="data-v-52eec896" style="color:#333333">{{item.e}}</view></view><view class="flex text-gray margin-top data-v-52eec896"><view class="data-v-52eec896">计划时间:</view><view class="data-v-52eec896" style="color:#333333">{{item.f}}至{{item.g}}</view></view><view class="flex margin-top align-center data-v-52eec896"><view class="data-v-52eec896" style="color:#B5B5B5">完成进度:</view><view class="flex align-center margin-left-sm data-v-52eec896"><view class="cu-progress round data-v-52eec896"><view class="bg-green data-v-52eec896" style="{{'width:' + item.h}}"></view></view><text class="margin-left-sm data-v-52eec896">{{item.i}}%</text></view></view><view class="plan-stats margin-top data-v-52eec896"><view class="plan-stat-item data-v-52eec896"><view class="plan-stat-num text-orange data-v-52eec896">{{item.j}}</view><view class="plan-stat-label data-v-52eec896">总检项</view></view><view class="plan-stat-item data-v-52eec896"><view class="plan-stat-num text-yellow data-v-52eec896">{{item.k}}</view><view class="plan-stat-label data-v-52eec896">待排查</view></view><view class="plan-stat-item data-v-52eec896"><view class="plan-stat-num text-red data-v-52eec896">{{item.l}}</view><view class="plan-stat-label data-v-52eec896">异常数</view></view><view class="plan-stat-item data-v-52eec896"><view class="plan-stat-num text-blue data-v-52eec896">{{item.m}}</view><view class="plan-stat-label data-v-52eec896">已完成</view></view></view><view class="margin-top margin-bottom flex justify-end data-v-52eec896"><button class="cu-btn round lg bg-blue data-v-52eec896" catchtap="{{item.n}}"> 检查处置 </button></view></view></view></block></view></view>
|
||||
105
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/list.wxss
vendored
Normal file
105
unpackage/dist/dev/mp-weixin/pages/Inspectionresult/list.wxss
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-52eec896 {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
.empty-tip.data-v-52eec896 {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.plan-card.data-v-52eec896 {
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0rpx 2rpx 6rpx 2rpx rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
.plan-header.data-v-52eec896 {
|
||||
background: linear-gradient(135deg, #4A90E2 0%, #2667E9 100%);
|
||||
padding: 24rpx 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.plan-header .plan-header-title.data-v-52eec896 {
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.plan-body.data-v-52eec896 {
|
||||
padding: 24rpx 30rpx 10rpx 30rpx;
|
||||
background: #fff;
|
||||
}
|
||||
.plan-stats.data-v-52eec896 {
|
||||
display: flex;
|
||||
background: #F5F7FA;
|
||||
border-radius: 12rpx;
|
||||
border: 1rpx solid #E8ECF0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.plan-stats .plan-stat-item.data-v-52eec896 {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 20rpx 0;
|
||||
border-right: 1rpx solid #E8ECF0;
|
||||
}
|
||||
.plan-stats .plan-stat-item.data-v-52eec896:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
.plan-stats .plan-stat-num.data-v-52eec896 {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.plan-stats .plan-stat-label.data-v-52eec896 {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
.cu-progress.data-v-52eec896 {
|
||||
width: 300rpx;
|
||||
height: 20rpx;
|
||||
background: #ebeef5;
|
||||
border-radius: 100rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cu-progress view.data-v-52eec896 {
|
||||
height: 100%;
|
||||
border-radius: 100rpx;
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
.bg-green.data-v-52eec896 {
|
||||
background: #2667E9;
|
||||
}
|
||||
.border-border.data-v-52eec896 {
|
||||
padding: 10rpx;
|
||||
background: #EEF3FF;
|
||||
border-radius: 4rpx;
|
||||
border: 2rpx solid #AAC5FC;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 28rpx;
|
||||
color: #2667E9;
|
||||
}
|
||||
@@ -158,7 +158,7 @@ const _sfc_main = {
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_assets._imports_0$1,
|
||||
a: common_assets._imports_0$2,
|
||||
b: common_vendor.t(searchForm.startDate || "请选择"),
|
||||
c: common_vendor.n(searchForm.startDate ? "date-value" : "date-placeholder"),
|
||||
d: common_vendor.o(($event) => showStartDatePicker.value = true),
|
||||
@@ -190,7 +190,7 @@ const _sfc_main = {
|
||||
modelValue: searchForm.deptName
|
||||
}),
|
||||
t: common_vendor.o(handleSearch),
|
||||
v: common_assets._imports_1,
|
||||
v: common_assets._imports_1$1,
|
||||
w: common_vendor.t(statistics.total),
|
||||
x: common_vendor.t(statistics.overdue),
|
||||
y: common_vendor.t(statistics.onTimeCompleted),
|
||||
|
||||
@@ -45,8 +45,20 @@ const _sfc_main = {
|
||||
const onSwitchChange = (e) => {
|
||||
workdaySwitch.value = e.detail.value;
|
||||
};
|
||||
const startDateValue = common_vendor.ref(Number(/* @__PURE__ */ new Date()));
|
||||
const endDateValue = common_vendor.ref(Number(/* @__PURE__ */ new Date()));
|
||||
const getTodayTimestamp = () => {
|
||||
const now = /* @__PURE__ */ new Date();
|
||||
return new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime();
|
||||
};
|
||||
const todayMinDate = common_vendor.computed(() => getTodayTimestamp());
|
||||
const endDateMinDate = common_vendor.computed(() => {
|
||||
if (formData.startDate) {
|
||||
const [year, month, day] = formData.startDate.split("-").map(Number);
|
||||
return new Date(year, month - 1, day).getTime();
|
||||
}
|
||||
return getTodayTimestamp();
|
||||
});
|
||||
const startDateValue = common_vendor.ref(getTodayTimestamp());
|
||||
const endDateValue = common_vendor.ref(getTodayTimestamp());
|
||||
const showDeptPicker = common_vendor.ref(false);
|
||||
const showTypePicker = common_vendor.ref(false);
|
||||
const showModePicker = common_vendor.ref(false);
|
||||
@@ -103,7 +115,7 @@ const _sfc_main = {
|
||||
executorList.value = res.data || [];
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:505", "获取部门用户失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:522", "获取部门用户失败:", error);
|
||||
}
|
||||
};
|
||||
const toggleExecutorSelect = (item) => {
|
||||
@@ -132,7 +144,7 @@ const _sfc_main = {
|
||||
initDeptCascader(res.data);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:543", "获取部门树失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:560", "获取部门树失败:", error);
|
||||
}
|
||||
};
|
||||
const initDeptCascader = (data) => {
|
||||
@@ -184,19 +196,42 @@ const _sfc_main = {
|
||||
}
|
||||
showCyclePicker.value = false;
|
||||
};
|
||||
const formatDateTime = (timestamp) => {
|
||||
const formatDate = (timestamp) => {
|
||||
const date = new Date(timestamp);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
||||
const day = String(date.getDate()).padStart(2, "0");
|
||||
const hours = String(date.getHours()).padStart(2, "0");
|
||||
const minutes = String(date.getMinutes()).padStart(2, "0");
|
||||
const seconds = String(date.getSeconds()).padStart(2, "0");
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
return `${year}-${month}-${day}`;
|
||||
};
|
||||
const parseDateValue = (dateStr) => {
|
||||
if (!dateStr)
|
||||
return 0;
|
||||
const [datePart] = dateStr.split(" ");
|
||||
const [year, month, day] = datePart.split("-").map(Number);
|
||||
return new Date(year, month - 1, day).getTime();
|
||||
};
|
||||
const openStartDatePicker = () => {
|
||||
const today = getTodayTimestamp();
|
||||
if (startDateValue.value < today) {
|
||||
startDateValue.value = today;
|
||||
}
|
||||
showStartDatePicker.value = true;
|
||||
};
|
||||
const openEndDatePicker = () => {
|
||||
const minDate = endDateMinDate.value;
|
||||
if (endDateValue.value < minDate) {
|
||||
endDateValue.value = minDate;
|
||||
}
|
||||
showEndDatePicker.value = true;
|
||||
};
|
||||
const onStartDateConfirm = (e) => {
|
||||
const selectedDate = formatDateTime(e.value);
|
||||
if (formData.endDate && new Date(selectedDate) > new Date(formData.endDate)) {
|
||||
const selectedDate = formatDate(e.value);
|
||||
const todayStr = formatDate(getTodayTimestamp());
|
||||
if (selectedDate < todayStr) {
|
||||
common_vendor.index.showToast({ title: "开始时间不能早于今天", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (formData.endDate && parseDateValue(selectedDate) > parseDateValue(formData.endDate)) {
|
||||
common_vendor.index.showToast({ title: "开始时间不能晚于结束时间", icon: "none" });
|
||||
return;
|
||||
}
|
||||
@@ -204,8 +239,8 @@ const _sfc_main = {
|
||||
showStartDatePicker.value = false;
|
||||
};
|
||||
const onEndDateConfirm = (e) => {
|
||||
const selectedDate = formatDateTime(e.value);
|
||||
if (formData.startDate && new Date(selectedDate) < new Date(formData.startDate)) {
|
||||
const selectedDate = formatDate(e.value);
|
||||
if (formData.startDate && parseDateValue(selectedDate) < parseDateValue(formData.startDate)) {
|
||||
common_vendor.index.showToast({ title: "结束时间不能早于开始时间", icon: "none" });
|
||||
return;
|
||||
}
|
||||
@@ -249,7 +284,7 @@ const _sfc_main = {
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:700", "删除检查项失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:740", "删除检查项失败:", error);
|
||||
common_vendor.index.showToast({ title: "删除失败", icon: "none" });
|
||||
}
|
||||
} else {
|
||||
@@ -325,7 +360,7 @@ const _sfc_main = {
|
||||
hasMoreLaw.value = lawList.value.length < total;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:787", "获取法规列表失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:827", "获取法规列表失败:", error);
|
||||
} finally {
|
||||
lawLoading.value = false;
|
||||
}
|
||||
@@ -405,7 +440,7 @@ const _sfc_main = {
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:887", "添加检查项失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:927", "添加检查项失败:", error);
|
||||
common_vendor.index.showToast({ title: "添加失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -454,7 +489,7 @@ const _sfc_main = {
|
||||
hasMoreLibrary.value = libraryList.value.length < total;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:947", "获取检查库列表失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:987", "获取检查库列表失败:", error);
|
||||
} finally {
|
||||
libraryLoading.value = false;
|
||||
}
|
||||
@@ -557,7 +592,7 @@ const _sfc_main = {
|
||||
selectedLibraries.value = [];
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1067", "获取检查库详情失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1107", "获取检查库详情失败:", error);
|
||||
common_vendor.index.showToast({ title: "添加失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -590,7 +625,7 @@ const _sfc_main = {
|
||||
common_vendor.index.showToast({ title: "请选择计划时间", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (new Date(formData.endDate) < new Date(formData.startDate)) {
|
||||
if (parseDateValue(formData.endDate) < parseDateValue(formData.startDate)) {
|
||||
common_vendor.index.showToast({ title: "结束时间不能早于开始时间", icon: "none" });
|
||||
return;
|
||||
}
|
||||
@@ -634,8 +669,8 @@ const _sfc_main = {
|
||||
// 从检查库选择的库id数组
|
||||
cycle: cycleMap[formData.cycleName] || 1,
|
||||
isWeekend: workdaySwitch.value ? 1 : 2,
|
||||
planStartTime: formData.startDate,
|
||||
planEndTime: formData.endDate
|
||||
planStartTime: `${formData.startDate} 00:00:00`,
|
||||
planEndTime: `${formData.endDate} 23:59:59`
|
||||
};
|
||||
if (formData.modeName === "指定人员" && formData.executorIds.length > 0) {
|
||||
params.executorId = formData.executorIds[0];
|
||||
@@ -654,7 +689,7 @@ const _sfc_main = {
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1185", "保存失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1225", "保存失败:", error);
|
||||
common_vendor.index.showToast({ title: "保存失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -727,26 +762,28 @@ const _sfc_main = {
|
||||
N: common_vendor.o(onSwitchChange),
|
||||
O: common_vendor.t(formData.startDate || "请选择开始时间"),
|
||||
P: common_vendor.n(formData.startDate ? "picker-value" : "picker-placeholder"),
|
||||
Q: common_vendor.o(($event) => showStartDatePicker.value = true),
|
||||
Q: common_vendor.o(openStartDatePicker),
|
||||
R: common_vendor.o(onStartDateConfirm),
|
||||
S: common_vendor.o(($event) => showStartDatePicker.value = false),
|
||||
T: common_vendor.o(($event) => showStartDatePicker.value = false),
|
||||
U: common_vendor.o(($event) => startDateValue.value = $event),
|
||||
V: common_vendor.p({
|
||||
show: showStartDatePicker.value,
|
||||
mode: "datetime",
|
||||
mode: "date",
|
||||
minDate: todayMinDate.value,
|
||||
modelValue: startDateValue.value
|
||||
}),
|
||||
W: common_vendor.t(formData.endDate || "请选择结束时间"),
|
||||
X: common_vendor.n(formData.endDate ? "picker-value" : "picker-placeholder"),
|
||||
Y: common_vendor.o(($event) => showEndDatePicker.value = true),
|
||||
Y: common_vendor.o(openEndDatePicker),
|
||||
Z: common_vendor.o(onEndDateConfirm),
|
||||
aa: common_vendor.o(($event) => showEndDatePicker.value = false),
|
||||
ab: common_vendor.o(($event) => showEndDatePicker.value = false),
|
||||
ac: common_vendor.o(($event) => endDateValue.value = $event),
|
||||
ad: common_vendor.p({
|
||||
show: showEndDatePicker.value,
|
||||
mode: "datetime",
|
||||
mode: "date",
|
||||
minDate: endDateMinDate.value,
|
||||
modelValue: endDateValue.value
|
||||
}),
|
||||
ae: common_vendor.t(checkItemCount.value),
|
||||
|
||||
@@ -1,32 +1,20 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_three_one_api_area = require("../../request/three_one_api/area.js");
|
||||
require("../../request/request.js");
|
||||
const utils_upload = require("../../utils/upload.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_choose2 = common_vendor.resolveComponent("up-choose");
|
||||
const _easycom_up_upload2 = common_vendor.resolveComponent("up-upload");
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
(_easycom_up_choose2 + _easycom_up_upload2 + _easycom_up_input2 + _easycom_up_textarea2 + _easycom_u_popup2)();
|
||||
}
|
||||
const _easycom_up_choose = () => "../../uni_modules/uview-plus/components/u-choose/u-choose.js";
|
||||
const _easycom_up_upload = () => "../../uni_modules/uview-plus/components/u-upload/u-upload.js";
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_choose + _easycom_up_upload + _easycom_up_input + _easycom_up_textarea + _easycom_u_popup)();
|
||||
HazardFormPopup();
|
||||
}
|
||||
const HazardFormPopup = () => "../../components/hazard/HazardFormPopup.js";
|
||||
const _sfc_main = {
|
||||
__name: "Inspection",
|
||||
setup(__props) {
|
||||
const showAddPopup = common_vendor.ref(false);
|
||||
const canvasWidth = common_vendor.ref(300);
|
||||
const canvasHeight = common_vendor.ref(300);
|
||||
const levelChooseRef = common_vendor.ref(null);
|
||||
const taskId = common_vendor.ref("");
|
||||
const checkPointId = common_vendor.ref("");
|
||||
const hazardExtraParams = common_vendor.computed(() => ({
|
||||
taskId: taskId.value,
|
||||
checkPointId: checkPointId.value
|
||||
}));
|
||||
const userRole = common_vendor.ref("");
|
||||
const canAcceptance = common_vendor.computed(() => {
|
||||
return userRole.value === "admin" || userRole.value === "manage";
|
||||
@@ -37,15 +25,12 @@ const _sfc_main = {
|
||||
if (userInfoStr) {
|
||||
const userInfo = JSON.parse(userInfoStr);
|
||||
userRole.value = userInfo.role || "";
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:286", "当前用户角色:", userRole.value);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:289", "获取用户信息失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:100", "获取用户信息失败:", error);
|
||||
}
|
||||
};
|
||||
getUserRole();
|
||||
const taskId = common_vendor.ref("");
|
||||
const checkPointId = common_vendor.ref("");
|
||||
const fetchTaskInfo = async (oneTableId) => {
|
||||
try {
|
||||
const startRes = await request_api.enterCheckPlan(oneTableId);
|
||||
@@ -58,7 +43,7 @@ const _sfc_main = {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:314", "获取任务信息失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:117", "获取任务信息失败:", error);
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
@@ -66,259 +51,6 @@ const _sfc_main = {
|
||||
fetchTaskInfo(options.id);
|
||||
}
|
||||
});
|
||||
const formData = common_vendor.reactive({
|
||||
title: "",
|
||||
// 隐患标题
|
||||
level: 0,
|
||||
// 隐患等级索引
|
||||
description: "",
|
||||
// 隐患描述
|
||||
tagIndex: 0,
|
||||
// 隐患标签索引
|
||||
source: 0,
|
||||
// 隐患来源
|
||||
regulationId: null,
|
||||
// 法律依据ID
|
||||
regulationName: ""
|
||||
// 法律依据名称(显示用)
|
||||
});
|
||||
common_vendor.ref(0);
|
||||
const lng = common_vendor.ref(0);
|
||||
const lat = common_vendor.ref(0);
|
||||
const selectedAddress = common_vendor.ref("");
|
||||
const showAreaPicker = common_vendor.ref(false);
|
||||
const areaList = common_vendor.ref([]);
|
||||
const selectedAreaId = common_vendor.ref("");
|
||||
const selectedAreaName = common_vendor.ref("");
|
||||
const tempAreaId = common_vendor.ref("");
|
||||
const showLawPopup = common_vendor.ref(false);
|
||||
const lawKeyword = common_vendor.ref("");
|
||||
const selectedLawId = common_vendor.ref(null);
|
||||
const selectedLawName = common_vendor.ref("");
|
||||
const lawList = common_vendor.ref([]);
|
||||
const lawLoading = common_vendor.ref(false);
|
||||
const lawPageNum = common_vendor.ref(1);
|
||||
const lawPageSize = common_vendor.ref(10);
|
||||
const hasMoreLaw = common_vendor.ref(true);
|
||||
const openLawPopup = () => {
|
||||
showLawPopup.value = true;
|
||||
if (lawList.value.length === 0) {
|
||||
fetchRegulationList();
|
||||
}
|
||||
};
|
||||
const fetchRegulationList = async (isLoadMore = false) => {
|
||||
if (lawLoading.value)
|
||||
return;
|
||||
lawLoading.value = true;
|
||||
try {
|
||||
const params = {
|
||||
pageNum: lawPageNum.value,
|
||||
pageSize: lawPageSize.value,
|
||||
status: 1
|
||||
// 启用状态
|
||||
};
|
||||
if (lawKeyword.value && lawKeyword.value.trim()) {
|
||||
params.keyword = lawKeyword.value.trim();
|
||||
}
|
||||
const res = await request_api.getRegulationList(params);
|
||||
if (res.code === 0) {
|
||||
const records = res.data.records || res.data || [];
|
||||
if (isLoadMore) {
|
||||
lawList.value = [...lawList.value, ...records];
|
||||
} else {
|
||||
lawList.value = records;
|
||||
}
|
||||
const total = res.data.total || 0;
|
||||
hasMoreLaw.value = lawList.value.length < total;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:397", "获取法规列表失败:", error);
|
||||
} finally {
|
||||
lawLoading.value = false;
|
||||
}
|
||||
};
|
||||
const searchRegulation = () => {
|
||||
lawPageNum.value = 1;
|
||||
lawList.value = [];
|
||||
hasMoreLaw.value = true;
|
||||
fetchRegulationList();
|
||||
};
|
||||
const loadMoreLaw = () => {
|
||||
if (!hasMoreLaw.value || lawLoading.value)
|
||||
return;
|
||||
lawPageNum.value++;
|
||||
fetchRegulationList(true);
|
||||
};
|
||||
const selectLaw = (item) => {
|
||||
selectedLawId.value = item.id;
|
||||
selectedLawName.value = item.depict || item.keyword || "";
|
||||
};
|
||||
const confirmLaw = () => {
|
||||
if (selectedLawId.value) {
|
||||
formData.regulationId = selectedLawId.value;
|
||||
formData.regulationName = selectedLawName.value;
|
||||
}
|
||||
showLawPopup.value = false;
|
||||
};
|
||||
const fetchAreaList = async () => {
|
||||
try {
|
||||
const res = await request_three_one_api_area.getAreaList();
|
||||
if (res.code === 0 && res.data && res.data.records) {
|
||||
areaList.value = res.data.records;
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:441", "获取区域列表失败:", error);
|
||||
}
|
||||
};
|
||||
fetchAreaList();
|
||||
const confirmAreaSelect = () => {
|
||||
if (tempAreaId.value) {
|
||||
selectedAreaId.value = tempAreaId.value;
|
||||
const selected = areaList.value.find((item) => item.id === tempAreaId.value);
|
||||
selectedAreaName.value = selected ? selected.name : "";
|
||||
}
|
||||
showAreaPicker.value = false;
|
||||
};
|
||||
const chooseLocation = () => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:457", "chooseLocation called");
|
||||
showAddPopup.value = false;
|
||||
setTimeout(() => {
|
||||
common_vendor.index.getLocation({
|
||||
type: "gcj02",
|
||||
// 使用国测局坐标系(腾讯地图使用)
|
||||
success: (locationRes) => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:466", "获取当前位置成功:", locationRes);
|
||||
common_vendor.index.chooseLocation({
|
||||
latitude: locationRes.latitude,
|
||||
longitude: locationRes.longitude,
|
||||
success: (res) => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:472", "选择位置成功:", res);
|
||||
selectedAddress.value = res.address + (res.name ? `(${res.name})` : "");
|
||||
lng.value = res.longitude;
|
||||
lat.value = res.latitude;
|
||||
showAddPopup.value = true;
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:481", "选择位置失败:", err);
|
||||
showAddPopup.value = true;
|
||||
if (err.errMsg && err.errMsg.indexOf("cancel") === -1) {
|
||||
common_vendor.index.showToast({
|
||||
title: "选择位置失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:495", "获取当前位置失败:", err);
|
||||
common_vendor.index.chooseLocation({
|
||||
success: (res) => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:499", "选择位置成功:", res);
|
||||
selectedAddress.value = res.address + (res.name ? `(${res.name})` : "");
|
||||
lng.value = res.longitude;
|
||||
lat.value = res.latitude;
|
||||
showAddPopup.value = true;
|
||||
},
|
||||
fail: (chooseErr) => {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:506", "选择位置失败:", chooseErr);
|
||||
showAddPopup.value = true;
|
||||
if (chooseErr.errMsg && chooseErr.errMsg.indexOf("cancel") === -1) {
|
||||
common_vendor.index.showToast({
|
||||
title: "选择位置失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
};
|
||||
const handleAdd = async () => {
|
||||
var _a, _b;
|
||||
if (!formData.title) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请输入隐患标题",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (fileList1.value.length === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请上传隐患图片/视频",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
const attachments = fileList1.value.filter((f) => f.status === "success").map((file) => utils_upload.buildAttachmentItem(file));
|
||||
const selectedTag = tagOptions.value[formData.tagIndex];
|
||||
const tagId = selectedTag ? selectedTag.id : null;
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:546", "innnn", sourceOptions);
|
||||
const params = {
|
||||
title: formData.title,
|
||||
//标题
|
||||
level: ((_a = levelOptions.value[formData.level]) == null ? void 0 : _a.id) || 2,
|
||||
// 2.一般隐患 3.重大隐患
|
||||
lng: lng.value || 0,
|
||||
//经度
|
||||
lat: lat.value || 0,
|
||||
//纬度
|
||||
address: selectedAddress.value || "",
|
||||
//详细地址
|
||||
areaId: selectedAreaId.value || null,
|
||||
//隐患区域ID
|
||||
description: formData.description || "",
|
||||
//隐患描述
|
||||
tagId,
|
||||
//隐患标签ID
|
||||
taskId: taskId.value,
|
||||
//关联任务ID
|
||||
checkPointId: checkPointId.value,
|
||||
//关联检查点ID
|
||||
source: ((_b = sourceOptions.value[formData.source]) == null ? void 0 : _b.title) || "",
|
||||
//隐患来源(随手拍、企业自查、行业互查、专家诊查)
|
||||
attachments,
|
||||
//附件列表(图片/视频)
|
||||
regulationId: formData.regulationId || null
|
||||
// 法律依据ID
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:565", "提交的参数:", params);
|
||||
try {
|
||||
const res = await request_api.addHiddenDanger(params);
|
||||
if (res.code === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: "新增成功",
|
||||
icon: "success"
|
||||
});
|
||||
showAddPopup.value = false;
|
||||
formData.title = "";
|
||||
formData.level = 0;
|
||||
formData.description = "";
|
||||
formData.tagIndex = 0;
|
||||
selectedAddress.value = "";
|
||||
selectedAreaId.value = "";
|
||||
selectedAreaName.value = "";
|
||||
fileList1.value = [];
|
||||
formData.regulationId = null;
|
||||
formData.regulationName = "";
|
||||
selectedLawId.value = null;
|
||||
selectedLawName.value = "";
|
||||
fetchHiddenDangerList();
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || "新增失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:598", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
const hiddenDangerList = common_vendor.ref([]);
|
||||
const fetchHiddenDangerList = async () => {
|
||||
try {
|
||||
@@ -332,7 +64,7 @@ const _sfc_main = {
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:619", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:140", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
@@ -342,6 +74,13 @@ const _sfc_main = {
|
||||
common_vendor.onShow(() => {
|
||||
fetchHiddenDangerList();
|
||||
});
|
||||
const openAddPopup = () => {
|
||||
showAddPopup.value = true;
|
||||
};
|
||||
const onHazardAddSuccess = () => {
|
||||
showAddPopup.value = false;
|
||||
fetchHiddenDangerList();
|
||||
};
|
||||
const details = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/hiddendanger/view?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||
@@ -369,128 +108,6 @@ const _sfc_main = {
|
||||
url: `/pages/hiddendanger/assignment?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||
});
|
||||
};
|
||||
const fileList1 = common_vendor.ref([]);
|
||||
const uploadInstance = common_vendor.getCurrentInstance();
|
||||
const { afterRead, deletePic } = utils_upload.createUploadListHandlers(fileList1, {
|
||||
watermark: {
|
||||
canvasId: "watermarkCanvas",
|
||||
canvasWidthRef: canvasWidth,
|
||||
canvasHeightRef: canvasHeight,
|
||||
instance: uploadInstance
|
||||
}
|
||||
});
|
||||
const aiAnalyzing = common_vendor.ref(false);
|
||||
const handleAiAnalyze = async () => {
|
||||
const imageFiles = fileList1.value.filter((f) => {
|
||||
return f.status === "success" && f.url.toLowerCase().match(/\.(jpg|jpeg|png|gif|bmp|webp)$/);
|
||||
});
|
||||
if (imageFiles.length === 0) {
|
||||
common_vendor.index.showToast({ title: "请先上传隐患图片", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const fullImageUrl = imageFiles[0].url;
|
||||
aiAnalyzing.value = true;
|
||||
try {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:690", "开始调用AI分析接口,图片地址:", fullImageUrl);
|
||||
const analyzeRes = await request_api.analyzeHazardImage({
|
||||
// imageUrl: 'https://yx.zhihuixiangxi.com:58880/1.png' ,
|
||||
imageUrl: fullImageUrl
|
||||
});
|
||||
if (analyzeRes.code === 0 && analyzeRes.data) {
|
||||
const aiData = analyzeRes.data;
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:698", "AI分析结果:", aiData);
|
||||
if (aiData.title)
|
||||
formData.title = aiData.title;
|
||||
if (aiData.description)
|
||||
formData.description = aiData.description;
|
||||
if (aiData.level) {
|
||||
const levelMap = { "轻微": 0, "轻微隐患": 0, "一般": 0, "一般隐患": 0, "重大": 1, "重大隐患": 1 };
|
||||
const levelIndex = levelMap[aiData.level];
|
||||
if (levelIndex !== void 0) {
|
||||
formData.level = levelIndex;
|
||||
common_vendor.nextTick$1(() => {
|
||||
if (levelChooseRef.value && levelChooseRef.value.$data) {
|
||||
levelChooseRef.value.$data.currentIndex = levelIndex;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
common_vendor.index.showToast({ title: "AI分析完成,已自动填充", icon: "success", duration: 2e3 });
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: analyzeRes.msg || "AI分析失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:721", "AI分析接口调用失败:", error);
|
||||
common_vendor.index.showToast({ title: "AI分析失败,请重试", icon: "none" });
|
||||
} finally {
|
||||
aiAnalyzing.value = false;
|
||||
}
|
||||
};
|
||||
const tagOptions = common_vendor.ref([]);
|
||||
const fetchTagOptions = async () => {
|
||||
try {
|
||||
const res = await request_api.getHiddenDangerLabelList();
|
||||
if (res.code === 0) {
|
||||
tagOptions.value = res.data.map((item) => ({
|
||||
id: item.id,
|
||||
title: item.name
|
||||
}));
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: res.msg || "获取标签列表失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:744", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
fetchTagOptions();
|
||||
const levelOptions = common_vendor.ref([
|
||||
// {
|
||||
// id: 1,
|
||||
// title: '轻微隐患'
|
||||
// },
|
||||
{
|
||||
id: 2,
|
||||
title: "一般隐患"
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "重大隐患"
|
||||
}
|
||||
]);
|
||||
const sourceOptions = common_vendor.ref([
|
||||
{
|
||||
id: 1,
|
||||
title: "部门检查"
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "都导检查"
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "企业自查"
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: "行业互查"
|
||||
}
|
||||
]);
|
||||
common_vendor.watch(() => formData.source, (newVal) => {
|
||||
const selected = sourceOptions.value[newVal];
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/Inspection.vue:791", "隐患来源选择结果:", {
|
||||
索引: newVal,
|
||||
选中项: selected,
|
||||
id: selected == null ? void 0 : selected.id,
|
||||
title: selected == null ? void 0 : selected.title
|
||||
});
|
||||
});
|
||||
const statusTabs = common_vendor.ref([
|
||||
{ label: "全部", value: null },
|
||||
{ label: "待交办", value: 1 },
|
||||
@@ -555,135 +172,16 @@ const _sfc_main = {
|
||||
t: item.hazardId
|
||||
});
|
||||
}),
|
||||
d: common_vendor.o(($event) => showAddPopup.value = true),
|
||||
e: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
f: common_vendor.o(($event) => formData.source = $event),
|
||||
d: common_vendor.o(openAddPopup),
|
||||
e: common_vendor.o(onHazardAddSuccess),
|
||||
f: common_vendor.o(($event) => showAddPopup.value = $event),
|
||||
g: common_vendor.p({
|
||||
options: sourceOptions.value,
|
||||
wrap: false,
|
||||
["item-width"]: "152rpx",
|
||||
["item-height"]: "64rpx",
|
||||
modelValue: formData.source
|
||||
title: "新增隐患排查",
|
||||
mode: "direct",
|
||||
["extra-params"]: hazardExtraParams.value,
|
||||
show: showAddPopup.value
|
||||
}),
|
||||
h: common_vendor.o(common_vendor.unref(afterRead)),
|
||||
i: common_vendor.o(common_vendor.unref(deletePic)),
|
||||
j: common_vendor.p({
|
||||
fileList: fileList1.value,
|
||||
name: "1",
|
||||
multiple: true,
|
||||
imageMode: "aspectFill",
|
||||
maxCount: 10
|
||||
}),
|
||||
k: canvasWidth.value,
|
||||
l: canvasHeight.value,
|
||||
m: canvasWidth.value + "px",
|
||||
n: canvasHeight.value + "px",
|
||||
o: !aiAnalyzing.value
|
||||
}, !aiAnalyzing.value ? {} : {}, {
|
||||
p: common_vendor.t(aiAnalyzing.value ? "AI识别中..." : "AI 识别隐患"),
|
||||
q: aiAnalyzing.value,
|
||||
r: aiAnalyzing.value,
|
||||
s: common_vendor.o(handleAiAnalyze),
|
||||
t: common_vendor.o(($event) => formData.title = $event),
|
||||
v: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
border: "surround",
|
||||
modelValue: formData.title
|
||||
}),
|
||||
w: common_vendor.sr(levelChooseRef, "b44c631d-4,b44c631d-0", {
|
||||
"k": "levelChooseRef"
|
||||
}),
|
||||
x: common_vendor.o(($event) => formData.level = $event),
|
||||
y: common_vendor.p({
|
||||
options: levelOptions.value,
|
||||
wrap: false,
|
||||
["item-width"]: "183rpx",
|
||||
["item-height"]: "72rpx",
|
||||
modelValue: formData.level
|
||||
}),
|
||||
z: common_vendor.o(($event) => selectedAddress.value = $event),
|
||||
A: common_vendor.p({
|
||||
placeholder: "请输入地址",
|
||||
border: "surround",
|
||||
modelValue: selectedAddress.value
|
||||
}),
|
||||
B: common_vendor.o(chooseLocation),
|
||||
C: common_vendor.t(formData.regulationName || "请选择法律依据"),
|
||||
D: !formData.regulationName ? 1 : "",
|
||||
E: common_vendor.o(openLawPopup),
|
||||
F: common_vendor.t(selectedAreaName.value || "请选择隐患区域"),
|
||||
G: !selectedAreaName.value ? 1 : "",
|
||||
H: common_vendor.o(($event) => showAreaPicker.value = true),
|
||||
I: common_vendor.o(($event) => formData.description = $event),
|
||||
J: common_vendor.p({
|
||||
placeholder: "请输入内容",
|
||||
modelValue: formData.description
|
||||
}),
|
||||
K: common_vendor.o(($event) => formData.tagIndex = $event),
|
||||
L: common_vendor.p({
|
||||
options: tagOptions.value,
|
||||
modelValue: formData.tagIndex
|
||||
}),
|
||||
M: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
N: common_vendor.o(handleAdd),
|
||||
O: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
P: common_vendor.p({
|
||||
show: showAddPopup.value,
|
||||
mode: "center",
|
||||
round: "20",
|
||||
["safe-area-inset-bottom"]: false
|
||||
}),
|
||||
Q: common_vendor.o(($event) => showLawPopup.value = false),
|
||||
R: common_vendor.o(searchRegulation),
|
||||
S: lawKeyword.value,
|
||||
T: common_vendor.o(($event) => lawKeyword.value = $event.detail.value),
|
||||
U: common_vendor.o(searchRegulation),
|
||||
V: lawLoading.value && lawList.value.length === 0
|
||||
}, lawLoading.value && lawList.value.length === 0 ? {} : !lawLoading.value && lawList.value.length === 0 ? {} : common_vendor.e({
|
||||
X: common_vendor.f(lawList.value, (item, k0, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.depict),
|
||||
b: common_vendor.t(item.legalBasis),
|
||||
c: selectedLawId.value === item.id ? 1 : "",
|
||||
d: item.id,
|
||||
e: common_vendor.o(($event) => selectLaw(item), item.id)
|
||||
};
|
||||
}),
|
||||
Y: lawLoading.value
|
||||
}, lawLoading.value ? {} : {}), {
|
||||
W: !lawLoading.value && lawList.value.length === 0,
|
||||
Z: common_vendor.o(loadMoreLaw),
|
||||
aa: common_vendor.o(($event) => showLawPopup.value = false),
|
||||
ab: common_vendor.o(confirmLaw),
|
||||
ac: common_vendor.o(($event) => showLawPopup.value = false),
|
||||
ad: common_vendor.p({
|
||||
show: showLawPopup.value,
|
||||
mode: "center",
|
||||
round: "20",
|
||||
["safe-area-inset-bottom"]: false
|
||||
}),
|
||||
ae: common_vendor.o(($event) => showAreaPicker.value = false),
|
||||
af: common_vendor.o(confirmAreaSelect),
|
||||
ag: common_vendor.f(areaList.value, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.color,
|
||||
b: common_vendor.t(item.name),
|
||||
c: tempAreaId.value === item.id
|
||||
}, tempAreaId.value === item.id ? {} : {}, {
|
||||
d: item.id,
|
||||
e: tempAreaId.value === item.id ? 1 : "",
|
||||
f: common_vendor.o(($event) => tempAreaId.value = item.id, item.id)
|
||||
});
|
||||
}),
|
||||
ah: areaList.value.length === 0
|
||||
}, areaList.value.length === 0 ? {} : {}, {
|
||||
ai: common_vendor.o(($event) => showAreaPicker.value = false),
|
||||
aj: common_vendor.p({
|
||||
show: showAreaPicker.value,
|
||||
mode: "bottom",
|
||||
round: "20"
|
||||
}),
|
||||
ak: common_vendor.gei(_ctx, "")
|
||||
h: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "隐患排查",
|
||||
"usingComponents": {
|
||||
"up-choose": "../../uni_modules/uview-plus/components/u-choose/u-choose",
|
||||
"up-upload": "../../uni_modules/uview-plus/components/u-upload/u-upload",
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
||||
"hazard-form-popup": "../../components/hazard/HazardFormPopup"
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -79,232 +79,6 @@
|
||||
border: 2rpx solid #FFA39E;
|
||||
color: #F5222D;
|
||||
}
|
||||
.ai-btn-wrapper.data-v-b44c631d {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.ai-analyze-btn.data-v-b44c631d {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 72rpx;
|
||||
padding: 0 32rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #4facfe 0%, #2668EA 100%);
|
||||
border-radius: 36rpx;
|
||||
border: none;
|
||||
}
|
||||
.ai-analyze-btn.data-v-b44c631d::after {
|
||||
border: none;
|
||||
}
|
||||
.ai-analyze-btn .ai-btn-icon.data-v-b44c631d {
|
||||
margin-right: 8rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.ai-analyze-btn[disabled].data-v-b44c631d {
|
||||
opacity: 0.7;
|
||||
}
|
||||
.popup-content.data-v-b44c631d {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-header.data-v-b44c631d {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.popup-header .popup-title.data-v-b44c631d {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
.popup-header .popup-close.data-v-b44c631d {
|
||||
font-size: 40rpx;
|
||||
color: #999;
|
||||
line-height: 1;
|
||||
}
|
||||
.popup-body.data-v-b44c631d {
|
||||
padding: 30rpx;
|
||||
max-height: 900rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.source-choose-scroll.data-v-b44c631d {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.source-choose-scroll.data-v-b44c631d .up-choose {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.source-choose-scroll.data-v-b44c631d .u-tag-wrapper {
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.source-choose-scroll.data-v-b44c631d .u-tag {
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
box-sizing: border-box;
|
||||
padding: 0 8rpx !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
.source-choose-scroll.data-v-b44c631d .u-tag__content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
}
|
||||
.source-choose-scroll.data-v-b44c631d .u-tag__text {
|
||||
font-size: 24rpx !important;
|
||||
line-height: 1.3 !important;
|
||||
text-align: center;
|
||||
}
|
||||
.popup-footer.data-v-b44c631d {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
.popup-footer button.data-v-b44c631d {
|
||||
flex: 1;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 0;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.popup-footer button.data-v-b44c631d::after {
|
||||
border: none;
|
||||
}
|
||||
.popup-footer .btn-cancel.data-v-b44c631d {
|
||||
background: #fff;
|
||||
color: #666;
|
||||
}
|
||||
.popup-footer .btn-confirm.data-v-b44c631d {
|
||||
color: #fff;
|
||||
}
|
||||
.address-box.data-v-b44c631d {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.address-box .address-input-wrapper.data-v-b44c631d {
|
||||
flex: 1;
|
||||
}
|
||||
.address-box .btn-address.data-v-b44c631d {
|
||||
flex-shrink: 0;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
padding: 0 30rpx;
|
||||
font-size: 26rpx;
|
||||
border-radius: 8rpx;
|
||||
color: #fff;
|
||||
}
|
||||
.address-box .btn-address.data-v-b44c631d::after {
|
||||
border: none;
|
||||
}
|
||||
.select-trigger.data-v-b44c631d {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #fff;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
}
|
||||
.select-trigger .select-value.data-v-b44c631d {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.select-trigger .select-value.placeholder.data-v-b44c631d {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
.picker-popup.data-v-b44c631d {
|
||||
background: #fff;
|
||||
}
|
||||
.picker-popup .picker-header.data-v-b44c631d {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.picker-popup .picker-header .picker-cancel.data-v-b44c631d {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
.picker-popup .picker-header .picker-title.data-v-b44c631d {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.picker-popup .picker-header .picker-confirm.data-v-b44c631d {
|
||||
font-size: 28rpx;
|
||||
color: #2667E9;
|
||||
}
|
||||
.picker-popup .picker-body.data-v-b44c631d {
|
||||
max-height: 600rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.picker-popup .picker-item.data-v-b44c631d {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
.picker-popup .picker-item.data-v-b44c631d:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.picker-popup .picker-item.picker-item-active.data-v-b44c631d {
|
||||
color: #2667E9;
|
||||
}
|
||||
.area-color-dot.data-v-b44c631d {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
.address-popup.data-v-b44c631d {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.address-popup-body.data-v-b44c631d {
|
||||
padding: 30rpx;
|
||||
max-height: 500rpx;
|
||||
}
|
||||
.address-popup-body .search-box.data-v-b44c631d {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.address-popup-body .search-box .search-input.data-v-b44c631d {
|
||||
width: 100%;
|
||||
background: #f5f5f5;
|
||||
border-radius: 8rpx;
|
||||
padding: 16rpx 20rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.address-popup-body .address-list.data-v-b44c631d {
|
||||
max-height: 350rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.address-popup-body .address-item.data-v-b44c631d {
|
||||
padding: 24rpx 20rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
.address-popup-body .address-item.data-v-b44c631d:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.address-popup-body .address-item.address-item-active.data-v-b44c631d {
|
||||
background: #EBF2FC;
|
||||
color: #2667E9;
|
||||
}
|
||||
.status-tabs.data-v-b44c631d {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
@@ -346,114 +120,6 @@
|
||||
background: #2667E9;
|
||||
border-radius: 3rpx;
|
||||
}
|
||||
.law-popup.data-v-b44c631d {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
max-height: 80vh;
|
||||
}
|
||||
.law-popup .popup-header.data-v-b44c631d {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.law-popup .popup-header .popup-title.data-v-b44c631d {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.law-popup .popup-header .popup-close.data-v-b44c631d {
|
||||
font-size: 40rpx;
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
}
|
||||
.search-box.data-v-b44c631d {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #F5F5F5;
|
||||
border-radius: 40rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
margin: 20rpx 30rpx;
|
||||
}
|
||||
.search-box .search-icon.data-v-b44c631d {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.search-box .search-input.data-v-b44c631d {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
.search-box .search-btn.data-v-b44c631d {
|
||||
color: #2667E9;
|
||||
font-size: 26rpx;
|
||||
margin-left: 16rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
.loading-tip.data-v-b44c631d, .empty-tip.data-v-b44c631d {
|
||||
text-align: center;
|
||||
padding: 40rpx;
|
||||
color: #999;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.law-list.data-v-b44c631d {
|
||||
max-height: 400rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.law-item.data-v-b44c631d {
|
||||
padding: 24rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 16rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.law-item .law-title.data-v-b44c631d {
|
||||
line-height: 1.5;
|
||||
margin-bottom: 8rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.law-item .law-basis.data-v-b44c631d {
|
||||
font-size: 24rpx;
|
||||
line-height: 1.4;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
.law-item-active.data-v-b44c631d {
|
||||
border-color: #2667E9;
|
||||
background: #F0F6FF;
|
||||
}
|
||||
.popup-footer.data-v-b44c631d {
|
||||
display: flex;
|
||||
padding: 30rpx;
|
||||
border-top: 1rpx solid #eee;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.popup-footer button.data-v-b44c631d {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
.popup-footer button.data-v-b44c631d::after {
|
||||
border: none;
|
||||
}
|
||||
.popup-footer .btn-cancel.data-v-b44c631d {
|
||||
background: #f5f5f5;
|
||||
color: #666;
|
||||
}
|
||||
.popup-footer .btn-confirm.data-v-b44c631d {
|
||||
background: #2667E9;
|
||||
color: #fff;
|
||||
}
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
@@ -480,7 +146,6 @@
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/* 全局样式覆盖 up-tag 文字居中 */
|
||||
.card-actions {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
@@ -492,7 +157,4 @@
|
||||
white-space: nowrap !important;
|
||||
flex-shrink: 0 !important;
|
||||
width: auto !important;
|
||||
}
|
||||
.u-tag {
|
||||
justify-content: center !important;
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
const utils_draftCache = require("../../utils/draftCache.js");
|
||||
const utils_useDraftCache = require("../../utils/useDraftCache.js");
|
||||
const utils_upload = require("../../utils/upload.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
@@ -58,12 +60,122 @@ const _sfc_main = {
|
||||
const signatureRef = common_vendor.ref(null);
|
||||
const isSignatureEmpty = common_vendor.ref(true);
|
||||
const isSubmitting = common_vendor.ref(false);
|
||||
const hasDraft = common_vendor.ref(false);
|
||||
const showRestoreBanner = common_vendor.ref(false);
|
||||
const isRestoring = common_vendor.ref(false);
|
||||
const isInitialized = common_vendor.ref(false);
|
||||
const signaturePaths = common_vendor.ref([]);
|
||||
const getDraftKey = () => `draft_accept_${rectifyId.value || ""}`;
|
||||
const signatureLocalPath = common_vendor.ref("");
|
||||
const isDraftExporting = common_vendor.ref(false);
|
||||
let signatureExportTimer = null;
|
||||
const applySignatureFromServer = (signPath) => {
|
||||
const url = signPath ? utils_upload.toSubmitFileUrl(signPath) : "";
|
||||
if (!url) {
|
||||
showCanvas.value = true;
|
||||
signatureServerPath.value = "";
|
||||
signatureUrl.value = "";
|
||||
signatureLocalPath.value = "";
|
||||
isSignatureEmpty.value = true;
|
||||
return;
|
||||
}
|
||||
signatureServerPath.value = url;
|
||||
signatureUrl.value = url;
|
||||
signatureLocalPath.value = "";
|
||||
showCanvas.value = false;
|
||||
isSignatureEmpty.value = false;
|
||||
};
|
||||
const applySignatureFromLocal = (localPath) => {
|
||||
if (!localPath)
|
||||
return;
|
||||
signatureLocalPath.value = localPath;
|
||||
signatureUrl.value = localPath;
|
||||
signatureServerPath.value = "";
|
||||
showCanvas.value = false;
|
||||
isSignatureEmpty.value = false;
|
||||
};
|
||||
const acceptDraftHasContent = (data) => {
|
||||
const form = data.formData || {};
|
||||
return !!(form.verifyRemark || data.fileList1 && data.fileList1.length > 0 || data.signatureServerPath || data.signatureLocalPath || data.signaturePaths && data.signaturePaths.length > 0);
|
||||
};
|
||||
const {
|
||||
showRestoreBanner,
|
||||
clear: clearDraft,
|
||||
restore: restoreDraft,
|
||||
save: saveDraft,
|
||||
bindAutoSave
|
||||
} = utils_useDraftCache.useDraftCache({
|
||||
getKey: () => utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.ACCEPT, rectifyId.value),
|
||||
getFallbackKeys: () => {
|
||||
const primary = utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.ACCEPT, rectifyId.value);
|
||||
const compact = utils_draftCache.buildDraftKeyCompact(utils_draftCache.DRAFT_NS.ACCEPT, rectifyId.value);
|
||||
return compact !== primary ? [compact] : [];
|
||||
},
|
||||
getPayload: () => ({
|
||||
formData: {
|
||||
result: formData.result,
|
||||
verifyRemark: formData.verifyRemark
|
||||
},
|
||||
fileList1: fileList1.value,
|
||||
signatureServerPath: signatureServerPath.value,
|
||||
signatureUrl: signatureUrl.value,
|
||||
signatureLocalPath: signatureLocalPath.value,
|
||||
showCanvas: showCanvas.value,
|
||||
signaturePaths: signaturePaths.value
|
||||
}),
|
||||
hasContent: acceptDraftHasContent,
|
||||
applyPayload: (data) => {
|
||||
const form = data.formData || {};
|
||||
formData.result = form.result !== void 0 ? form.result : 1;
|
||||
formData.verifyRemark = form.verifyRemark || "";
|
||||
fileList1.value = data.fileList1 || [];
|
||||
signaturePaths.value = data.signaturePaths || [];
|
||||
if (data.signatureServerPath || data.signatureUrl) {
|
||||
applySignatureFromServer(data.signatureServerPath || data.signatureUrl);
|
||||
} else if (data.signatureLocalPath) {
|
||||
applySignatureFromLocal(data.signatureLocalPath);
|
||||
} else {
|
||||
showCanvas.value = data.showCanvas !== void 0 ? data.showCanvas : true;
|
||||
signatureServerPath.value = "";
|
||||
signatureUrl.value = "";
|
||||
signatureLocalPath.value = "";
|
||||
isSignatureEmpty.value = true;
|
||||
}
|
||||
},
|
||||
clearForm: () => {
|
||||
formData.result = 1;
|
||||
formData.verifyRemark = "";
|
||||
fileList1.value = [];
|
||||
signatureServerPath.value = "";
|
||||
signatureUrl.value = "";
|
||||
signatureLocalPath.value = "";
|
||||
showCanvas.value = true;
|
||||
signaturePaths.value = [];
|
||||
if (signatureRef.value) {
|
||||
signatureRef.value.clear();
|
||||
}
|
||||
},
|
||||
canSave: () => !!rectifyId.value,
|
||||
requireInitialized: true,
|
||||
onAfterRestore: (data) => {
|
||||
var _a;
|
||||
if (data.signatureServerPath || data.signatureUrl || data.signatureLocalPath) {
|
||||
return;
|
||||
}
|
||||
if (((_a = data.signaturePaths) == null ? void 0 : _a.length) > 0) {
|
||||
setTimeout(() => {
|
||||
if (signatureRef.value) {
|
||||
isSignatureEmpty.value = false;
|
||||
}
|
||||
}, 450);
|
||||
}
|
||||
}
|
||||
});
|
||||
bindAutoSave(() => [
|
||||
formData.result,
|
||||
formData.verifyRemark,
|
||||
fileList1.value,
|
||||
signatureServerPath.value,
|
||||
signatureUrl.value,
|
||||
signatureLocalPath.value,
|
||||
showCanvas.value,
|
||||
signaturePaths.value
|
||||
]);
|
||||
const getFullPath = (filePath) => {
|
||||
if (!filePath)
|
||||
return "";
|
||||
@@ -123,14 +235,14 @@ const _sfc_main = {
|
||||
const assign = resolveAssignWithRectify(res.data.assigns);
|
||||
if (assign == null ? void 0 : assign.rectify) {
|
||||
applyRectifyData(assign.rectify);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:240", "整改记录:", rectifyData);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:241", "整改附件:", rectifyAttachments.value);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:370", "整改记录:", rectifyData);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:371", "整改附件:", rectifyAttachments.value);
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:247", "获取隐患详情失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:377", "获取隐患详情失败:", error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -157,7 +269,7 @@ const _sfc_main = {
|
||||
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
|
||||
signatureRef.value.confirm();
|
||||
} else {
|
||||
if (!signatureServerPath.value) {
|
||||
if (!signatureServerPath.value && !signatureLocalPath.value) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请进行电子签名",
|
||||
icon: "none"
|
||||
@@ -166,7 +278,18 @@ const _sfc_main = {
|
||||
}
|
||||
isSubmitting.value = true;
|
||||
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
|
||||
await executeSubmit();
|
||||
try {
|
||||
if (!signatureServerPath.value && signatureLocalPath.value) {
|
||||
const { url } = await utils_upload.uploadToCloud(signatureLocalPath.value);
|
||||
applySignatureFromServer(url);
|
||||
}
|
||||
await executeSubmit();
|
||||
} catch (err) {
|
||||
isSubmitting.value = false;
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:431", "签名上传失败:", err);
|
||||
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
|
||||
}
|
||||
}
|
||||
};
|
||||
const executeSubmit = async () => {
|
||||
@@ -179,7 +302,7 @@ const _sfc_main = {
|
||||
signPath: signatureServerPath.value || ""
|
||||
// 电子签名路径
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:311", "提交验收参数:", params);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:452", "提交验收参数:", params);
|
||||
try {
|
||||
const res = await request_api.acceptanceRectification(params);
|
||||
common_vendor.index.hideLoading();
|
||||
@@ -200,7 +323,7 @@ const _sfc_main = {
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:333", "验收失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:474", "验收失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "请求失败",
|
||||
icon: "none"
|
||||
@@ -218,125 +341,45 @@ const _sfc_main = {
|
||||
instance: acceptUploadInstance
|
||||
}
|
||||
});
|
||||
const saveDraft = () => {
|
||||
if (isRestoring.value || !isInitialized.value)
|
||||
return;
|
||||
const key = getDraftKey();
|
||||
const hasContent = formData.verifyRemark || fileList1.value.length > 0 || signatureServerPath.value || signaturePaths.value.length > 0;
|
||||
if (!hasContent) {
|
||||
common_vendor.index.removeStorageSync(key);
|
||||
hasDraft.value = false;
|
||||
return;
|
||||
}
|
||||
const data = {
|
||||
formData: {
|
||||
result: formData.result,
|
||||
verifyRemark: formData.verifyRemark
|
||||
},
|
||||
fileList1: fileList1.value,
|
||||
signatureServerPath: signatureServerPath.value,
|
||||
signatureUrl: signatureUrl.value,
|
||||
showCanvas: showCanvas.value,
|
||||
signaturePaths: signaturePaths.value
|
||||
};
|
||||
common_vendor.index.setStorageSync(key, JSON.stringify(data));
|
||||
hasDraft.value = true;
|
||||
const onSignatureStart = () => {
|
||||
isSignatureEmpty.value = false;
|
||||
};
|
||||
const clearDraft = (showToast = true) => {
|
||||
const key = getDraftKey();
|
||||
common_vendor.index.removeStorageSync(key);
|
||||
hasDraft.value = false;
|
||||
showRestoreBanner.value = false;
|
||||
isRestoring.value = true;
|
||||
formData.result = 1;
|
||||
formData.verifyRemark = "";
|
||||
fileList1.value = [];
|
||||
signatureServerPath.value = "";
|
||||
signatureUrl.value = "";
|
||||
showCanvas.value = true;
|
||||
signaturePaths.value = [];
|
||||
if (signatureRef.value) {
|
||||
signatureRef.value.clear();
|
||||
}
|
||||
common_vendor.nextTick$1(() => {
|
||||
isRestoring.value = false;
|
||||
});
|
||||
if (showToast) {
|
||||
common_vendor.index.showToast({ title: "草稿已清空", icon: "none" });
|
||||
}
|
||||
const onSignatureSigning = () => {
|
||||
isSignatureEmpty.value = false;
|
||||
};
|
||||
const restoreDraft = () => {
|
||||
const key = getDraftKey();
|
||||
const cached = common_vendor.index.getStorageSync(key);
|
||||
if (cached) {
|
||||
try {
|
||||
const data = JSON.parse(cached);
|
||||
const hasContent = data.formData.verifyRemark || data.fileList1 && data.fileList1.length > 0 || data.signatureServerPath || data.signaturePaths && data.signaturePaths.length > 0;
|
||||
if (!hasContent) {
|
||||
isInitialized.value = true;
|
||||
return;
|
||||
}
|
||||
isRestoring.value = true;
|
||||
formData.result = data.formData.result !== void 0 ? data.formData.result : 1;
|
||||
formData.verifyRemark = data.formData.verifyRemark || "";
|
||||
fileList1.value = data.fileList1 || [];
|
||||
signatureServerPath.value = data.signatureServerPath || "";
|
||||
signatureUrl.value = data.signatureUrl || "";
|
||||
showCanvas.value = data.showCanvas !== void 0 ? data.showCanvas : true;
|
||||
signaturePaths.value = data.signaturePaths || [];
|
||||
hasDraft.value = true;
|
||||
showRestoreBanner.value = true;
|
||||
if (signaturePaths.value.length > 0) {
|
||||
setTimeout(() => {
|
||||
if (signatureRef.value) {
|
||||
isSignatureEmpty.value = false;
|
||||
}
|
||||
}, 450);
|
||||
}
|
||||
common_vendor.nextTick$1(() => {
|
||||
isRestoring.value = false;
|
||||
isInitialized.value = true;
|
||||
});
|
||||
common_vendor.index.showToast({
|
||||
title: "已自动恢复您上次未提交的内容",
|
||||
icon: "none",
|
||||
duration: 2500
|
||||
});
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:466", "解析草稿失败:", e);
|
||||
isRestoring.value = false;
|
||||
isInitialized.value = true;
|
||||
}
|
||||
} else {
|
||||
isInitialized.value = true;
|
||||
}
|
||||
};
|
||||
common_vendor.watch(
|
||||
() => [
|
||||
formData.result,
|
||||
formData.verifyRemark,
|
||||
fileList1.value,
|
||||
signatureServerPath.value,
|
||||
signaturePaths.value
|
||||
],
|
||||
() => {
|
||||
if (rectifyId.value) {
|
||||
saveDraft();
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
const clearSignature = () => {
|
||||
const onSignatureClear = () => {
|
||||
isSignatureEmpty.value = true;
|
||||
signatureLocalPath.value = "";
|
||||
};
|
||||
const scheduleSignatureDraftExport = () => {
|
||||
clearTimeout(signatureExportTimer);
|
||||
signatureExportTimer = setTimeout(() => {
|
||||
if (!showCanvas.value || isSignatureEmpty.value || !signatureRef.value || isSubmitting.value || isDraftExporting.value) {
|
||||
return;
|
||||
}
|
||||
isDraftExporting.value = true;
|
||||
signatureRef.value.confirm();
|
||||
}, 600);
|
||||
};
|
||||
const onSignatureEnd = () => {
|
||||
isSignatureEmpty.value = false;
|
||||
scheduleSignatureDraftExport();
|
||||
};
|
||||
const clearSignature = () => {
|
||||
clearTimeout(signatureExportTimer);
|
||||
isSignatureEmpty.value = true;
|
||||
signatureLocalPath.value = "";
|
||||
if (signatureRef.value) {
|
||||
signatureRef.value.clear();
|
||||
}
|
||||
};
|
||||
const reSign = () => {
|
||||
clearTimeout(signatureExportTimer);
|
||||
isSignatureEmpty.value = true;
|
||||
showCanvas.value = true;
|
||||
signatureUrl.value = "";
|
||||
signatureServerPath.value = "";
|
||||
signatureLocalPath.value = "";
|
||||
common_vendor.nextTick$1(() => {
|
||||
if (signatureRef.value) {
|
||||
signatureRef.value.clear();
|
||||
@@ -344,28 +387,39 @@ const _sfc_main = {
|
||||
});
|
||||
};
|
||||
const onSignatureConfirm = async (tempFilePath) => {
|
||||
if (isDraftExporting.value) {
|
||||
isDraftExporting.value = false;
|
||||
applySignatureFromLocal(tempFilePath);
|
||||
saveDraft();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const { url } = await utils_upload.uploadToCloud(tempFilePath);
|
||||
signatureServerPath.value = url;
|
||||
signatureUrl.value = url;
|
||||
showCanvas.value = false;
|
||||
isSignatureEmpty.value = false;
|
||||
applySignatureFromServer(url);
|
||||
saveDraft();
|
||||
if (isSubmitting.value) {
|
||||
await executeSubmit();
|
||||
}
|
||||
} catch (err) {
|
||||
isSubmitting.value = false;
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:536", "签名上传失败:", err);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:583", "签名上传失败:", err);
|
||||
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
|
||||
}
|
||||
};
|
||||
common_vendor.onHide(() => {
|
||||
if (showCanvas.value && !isSignatureEmpty.value && signatureRef.value && !isDraftExporting.value) {
|
||||
isDraftExporting.value = true;
|
||||
signatureRef.value.confirm();
|
||||
}
|
||||
saveDraft();
|
||||
});
|
||||
common_vendor.onLoad((options) => {
|
||||
try {
|
||||
const sysInfo = common_vendor.index.getSystemInfoSync();
|
||||
signatureWidth.value = sysInfo.windowWidth - 40;
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:547", "获取系统信息失败:", e);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/acceptance.vue:602", "获取系统信息失败:", e);
|
||||
}
|
||||
if (options.rectifyId) {
|
||||
rectifyId.value = options.rectifyId;
|
||||
@@ -376,7 +430,7 @@ const _sfc_main = {
|
||||
if (options.assignId) {
|
||||
assignId.value = options.assignId;
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:558", "验收页面参数:", { rectifyId: rectifyId.value, hazardId: hazardId.value, assignId: assignId.value });
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/acceptance.vue:613", "验收页面参数:", { rectifyId: rectifyId.value, hazardId: hazardId.value, assignId: assignId.value });
|
||||
fetchDetail();
|
||||
restoreDraft();
|
||||
});
|
||||
@@ -429,19 +483,22 @@ const _sfc_main = {
|
||||
A: common_vendor.o(reSign)
|
||||
}, {
|
||||
B: !showCanvas.value
|
||||
}, !showCanvas.value ? {
|
||||
}, !showCanvas.value ? common_vendor.e({
|
||||
C: signatureUrl.value
|
||||
} : {}, {
|
||||
D: showCanvas.value
|
||||
}, signatureUrl.value ? {
|
||||
D: signatureUrl.value
|
||||
} : {}) : {}, {
|
||||
E: showCanvas.value
|
||||
}, showCanvas.value ? {
|
||||
E: common_vendor.sr(signatureRef, "39f9b795-2", {
|
||||
F: common_vendor.sr(signatureRef, "39f9b795-2", {
|
||||
"k": "signatureRef"
|
||||
}),
|
||||
F: common_vendor.o((res) => onSignatureConfirm(res.tempFilePath)),
|
||||
G: common_vendor.o(($event) => isSignatureEmpty.value = false),
|
||||
H: common_vendor.o(($event) => isSignatureEmpty.value = false),
|
||||
I: common_vendor.o(($event) => isSignatureEmpty.value = true),
|
||||
J: common_vendor.p({
|
||||
G: common_vendor.o((res) => onSignatureConfirm(res.tempFilePath)),
|
||||
H: common_vendor.o(onSignatureStart),
|
||||
I: common_vendor.o(onSignatureSigning),
|
||||
J: common_vendor.o(onSignatureEnd),
|
||||
K: common_vendor.o(onSignatureClear),
|
||||
L: common_vendor.p({
|
||||
width: signatureWidth.value,
|
||||
height: 160,
|
||||
backgroundColor: "#f8f8f8",
|
||||
@@ -450,9 +507,9 @@ const _sfc_main = {
|
||||
enableHistory: false
|
||||
})
|
||||
} : {}, {
|
||||
K: common_vendor.o(handleCancel),
|
||||
L: common_vendor.o(handleSubmit),
|
||||
M: common_vendor.gei(_ctx, "")
|
||||
M: common_vendor.o(handleCancel),
|
||||
N: common_vendor.o(handleSubmit),
|
||||
O: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,8 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const utils_draftCache = require("../../utils/draftCache.js");
|
||||
const utils_useDraftCache = require("../../utils/useDraftCache.js");
|
||||
if (!Array) {
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
|
||||
@@ -75,19 +77,42 @@ const _sfc_main = {
|
||||
const showDatePicker = common_vendor.ref(false);
|
||||
const dateValue = common_vendor.ref(Date.now());
|
||||
const selectedDate = common_vendor.ref("");
|
||||
const {
|
||||
showRestoreBanner,
|
||||
clear: clearDraft,
|
||||
restore: restoreDraft,
|
||||
bindAutoSave
|
||||
} = utils_useDraftCache.useDraftCache({
|
||||
getKey: () => utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.ASSIGN, hazardId.value),
|
||||
getPayload: () => ({
|
||||
selectedDate: selectedDate.value,
|
||||
dateValue: dateValue.value
|
||||
}),
|
||||
hasContent: (payload) => !!payload.selectedDate,
|
||||
applyPayload: (payload) => {
|
||||
selectedDate.value = payload.selectedDate || "";
|
||||
dateValue.value = payload.dateValue || Date.now();
|
||||
},
|
||||
clearForm: () => {
|
||||
selectedDate.value = "";
|
||||
dateValue.value = Date.now();
|
||||
},
|
||||
canSave: () => !!hazardId.value
|
||||
});
|
||||
bindAutoSave(() => [selectedDate.value]);
|
||||
const fetchDeptUsers = async () => {
|
||||
try {
|
||||
const res = await request_api.getDepartmentPersonUsers();
|
||||
if (res.code === 0 && res.data) {
|
||||
deptList.value = res.data;
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:172", "部门人员树:", deptList.value);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:200", "部门人员树:", deptList.value);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:175", "获取部门人员失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:203", "获取部门人员失败:", error);
|
||||
}
|
||||
};
|
||||
const onDateConfirm = (e) => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:181", "选择的日期时间:", e);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:209", "选择的日期时间:", e);
|
||||
const date = new Date(e.value);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
||||
@@ -120,7 +145,7 @@ const _sfc_main = {
|
||||
assignRemark: ""
|
||||
// 交办备注(可选)
|
||||
};
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:217", "提交数据:", params);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/assignment.vue:245", "提交数据:", params);
|
||||
try {
|
||||
const res = await request_api.assignHiddenDanger(params);
|
||||
if (res.code === 0) {
|
||||
@@ -133,82 +158,10 @@ const _sfc_main = {
|
||||
common_vendor.index.showToast({ title: res.msg || "交办失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:231", "交办失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:259", "交办失败:", error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
const hasDraft = common_vendor.ref(false);
|
||||
const showRestoreBanner = common_vendor.ref(false);
|
||||
const isRestoring = common_vendor.ref(false);
|
||||
const getDraftKey = () => `draft_assign_${hazardId.value || ""}`;
|
||||
const saveDraft = () => {
|
||||
if (isRestoring.value)
|
||||
return;
|
||||
const key = getDraftKey();
|
||||
const hasContent = selectedDate.value;
|
||||
if (!hasContent) {
|
||||
common_vendor.index.removeStorageSync(key);
|
||||
hasDraft.value = false;
|
||||
return;
|
||||
}
|
||||
const data = {
|
||||
selectedDate: selectedDate.value,
|
||||
dateValue: dateValue.value
|
||||
};
|
||||
common_vendor.index.setStorageSync(key, JSON.stringify(data));
|
||||
hasDraft.value = true;
|
||||
};
|
||||
const clearDraft = (showToast = true) => {
|
||||
const key = getDraftKey();
|
||||
common_vendor.index.removeStorageSync(key);
|
||||
hasDraft.value = false;
|
||||
showRestoreBanner.value = false;
|
||||
isRestoring.value = true;
|
||||
selectedDate.value = "";
|
||||
dateValue.value = Date.now();
|
||||
common_vendor.nextTick$1(() => {
|
||||
isRestoring.value = false;
|
||||
});
|
||||
if (showToast) {
|
||||
common_vendor.index.showToast({ title: "草稿已清空", icon: "none" });
|
||||
}
|
||||
};
|
||||
const restoreDraft = () => {
|
||||
const key = getDraftKey();
|
||||
const cached = common_vendor.index.getStorageSync(key);
|
||||
if (cached) {
|
||||
try {
|
||||
const data = JSON.parse(cached);
|
||||
const hasContent = data.selectedDate;
|
||||
if (!hasContent)
|
||||
return;
|
||||
isRestoring.value = true;
|
||||
selectedDate.value = data.selectedDate || "";
|
||||
dateValue.value = data.dateValue || Date.now();
|
||||
hasDraft.value = true;
|
||||
showRestoreBanner.value = true;
|
||||
common_vendor.nextTick$1(() => {
|
||||
isRestoring.value = false;
|
||||
});
|
||||
common_vendor.index.showToast({
|
||||
title: "已自动恢复您上次未提交的内容",
|
||||
icon: "none",
|
||||
duration: 2500
|
||||
});
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/assignment.vue:306", "解析草稿失败:", e);
|
||||
isRestoring.value = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
common_vendor.watch(
|
||||
() => [selectedDate.value],
|
||||
() => {
|
||||
if (hazardId.value) {
|
||||
saveDraft();
|
||||
}
|
||||
}
|
||||
);
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.hazardId)
|
||||
hazardId.value = options.hazardId;
|
||||
@@ -219,9 +172,9 @@ const _sfc_main = {
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: showRestoreBanner.value
|
||||
}, showRestoreBanner.value ? {
|
||||
b: common_vendor.o(($event) => clearDraft(true))
|
||||
a: common_vendor.unref(showRestoreBanner)
|
||||
}, common_vendor.unref(showRestoreBanner) ? {
|
||||
b: common_vendor.o(($event) => common_vendor.unref(clearDraft)(true))
|
||||
} : {}, {
|
||||
c: common_vendor.t(selectedUser.value || "请选择整改责任人"),
|
||||
d: !selectedUser.value ? 1 : "",
|
||||
|
||||
106
unpackage/dist/dev/mp-weixin/pages/hiddendanger/detail2.js
vendored
Normal file
106
unpackage/dist/dev/mp-weixin/pages/hiddendanger/detail2.js
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_u_navbar2 = common_vendor.resolveComponent("u-navbar");
|
||||
_easycom_u_navbar2();
|
||||
}
|
||||
const _easycom_u_navbar = () => "../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
|
||||
if (!Math) {
|
||||
(_easycom_u_navbar + HazardDetailPanelV2)();
|
||||
}
|
||||
const HazardDetailPanelV2 = () => "../../components/hazardDetail/HazardDetailPanelV2.js";
|
||||
const _sfc_main = {
|
||||
__name: "detail2",
|
||||
setup(__props) {
|
||||
const instance = common_vendor.getCurrentInstance();
|
||||
const queryScope = (instance == null ? void 0 : instance.proxy) || instance;
|
||||
const detailData = common_vendor.ref({});
|
||||
const loading = common_vendor.ref(false);
|
||||
const panelBodyHeight = common_vendor.ref(0);
|
||||
const calcPanelBodyHeight = () => {
|
||||
common_vendor.nextTick$1(() => {
|
||||
const query = common_vendor.index.createSelectorQuery().in(queryScope);
|
||||
query.select(".panel-wrap").boundingClientRect();
|
||||
query.exec((res) => {
|
||||
const rect = res == null ? void 0 : res[0];
|
||||
if ((rect == null ? void 0 : rect.height) > 0) {
|
||||
panelBodyHeight.value = Math.floor(rect.height);
|
||||
return;
|
||||
}
|
||||
const sys = common_vendor.index.getSystemInfoSync();
|
||||
panelBodyHeight.value = Math.floor(sys.windowHeight * 0.55);
|
||||
});
|
||||
});
|
||||
};
|
||||
const loadDetail = async (hazardId) => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await request_api.getHazardDetail(hazardId);
|
||||
if (res.code === 0 && res.data) {
|
||||
detailData.value = res.data;
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/detail2.vue:85", "获取隐患详情失败:", error);
|
||||
common_vendor.index.showToast({ title: "获取详情失败", icon: "none" });
|
||||
} finally {
|
||||
loading.value = false;
|
||||
calcPanelBodyHeight();
|
||||
setTimeout(calcPanelBodyHeight, 100);
|
||||
setTimeout(calcPanelBodyHeight, 400);
|
||||
}
|
||||
};
|
||||
common_vendor.onReady(() => {
|
||||
calcPanelBodyHeight();
|
||||
setTimeout(calcPanelBodyHeight, 100);
|
||||
setTimeout(calcPanelBodyHeight, 400);
|
||||
});
|
||||
common_vendor.watch(loading, (isLoading) => {
|
||||
if (!isLoading) {
|
||||
calcPanelBodyHeight();
|
||||
setTimeout(calcPanelBodyHeight, 100);
|
||||
setTimeout(calcPanelBodyHeight, 400);
|
||||
}
|
||||
});
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.hazardId) {
|
||||
loadDetail(options.hazardId);
|
||||
return;
|
||||
}
|
||||
common_vendor.index.showToast({ title: "缺少隐患ID", icon: "none" });
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
title: "查看隐患",
|
||||
placeholder: true,
|
||||
safeAreaInsetTop: true,
|
||||
bgColor: "transparent",
|
||||
titleColor: "#ffffff",
|
||||
leftIconColor: "#ffffff",
|
||||
autoBack: true,
|
||||
border: false
|
||||
}),
|
||||
b: common_assets._imports_0$1,
|
||||
c: common_vendor.t(detailData.value.statusName || "-"),
|
||||
d: common_assets._imports_1,
|
||||
e: common_vendor.t(detailData.value.createdAt || "-"),
|
||||
f: common_vendor.p({
|
||||
detail: detailData.value,
|
||||
loading: loading.value,
|
||||
["body-height"]: panelBodyHeight.value
|
||||
}),
|
||||
g: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-364026f2"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/hiddendanger/detail2.js.map
|
||||
10
unpackage/dist/dev/mp-weixin/pages/hiddendanger/detail2.json
vendored
Normal file
10
unpackage/dist/dev/mp-weixin/pages/hiddendanger/detail2.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"navigationBarTitleText": "隐患详情",
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "white",
|
||||
"disableScroll": true,
|
||||
"usingComponents": {
|
||||
"u-navbar": "../../uni_modules/uview-plus/components/u-navbar/u-navbar",
|
||||
"hazard-detail-panel-v2": "../../components/hazardDetail/HazardDetailPanelV2"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/hiddendanger/detail2.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/hiddendanger/detail2.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['page', 'data-v-364026f2', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{g}}"><view class="top-gradient-wrap data-v-364026f2"><u-navbar wx:if="{{a}}" class="data-v-364026f2" virtualHostClass="data-v-364026f2" u-i="364026f2-0" bind:__l="__l" u-p="{{a}}"/><view class="summary-card data-v-364026f2"><view class="summary-side summary-side--left data-v-364026f2"><image class="summary-icon data-v-364026f2" src="{{b}}" mode="aspectFit"/><view class="summary-icon-gap data-v-364026f2"><view class="summary-text data-v-364026f2"><view class="summary-label data-v-364026f2">隐患状态</view><view class="summary-status data-v-364026f2">{{c}}</view></view></view></view><view class="summary-divider data-v-364026f2"></view><view class="summary-side summary-side--right data-v-364026f2"><image class="summary-icon data-v-364026f2" src="{{d}}" mode="aspectFit"/><view class="summary-text data-v-364026f2"><view class="summary-label data-v-364026f2">提交日期</view><view class="summary-date data-v-364026f2">{{e}}</view></view></view></view></view><view class="panel-wrap data-v-364026f2"><hazard-detail-panel-v2 wx:if="{{f}}" class="data-v-364026f2" virtualHostClass="data-v-364026f2" u-i="364026f2-1" bind:__l="__l" u-p="{{f}}"/></view></view>
|
||||
132
unpackage/dist/dev/mp-weixin/pages/hiddendanger/detail2.wxss
vendored
Normal file
132
unpackage/dist/dev/mp-weixin/pages/hiddendanger/detail2.wxss
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-364026f2 {
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
background: #f5f7fa;
|
||||
}
|
||||
|
||||
/* 渐变只覆盖导航栏 + 顶部卡片区域,在卡片下沿开始淡出 */
|
||||
.top-gradient-wrap.data-v-364026f2 {
|
||||
flex-shrink: 0;
|
||||
background: linear-gradient(180deg, #046CEA 0%, #2158C8 28.44%, rgba(4, 107, 234, 0) 100%);
|
||||
}
|
||||
.summary-card.data-v-364026f2 {
|
||||
margin: 32rpx 30rpx 0;
|
||||
padding: 28rpx 30rpx 32rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.summary-side.data-v-364026f2 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.summary-side--left.data-v-364026f2 {
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
}
|
||||
.summary-side--left .summary-text.data-v-364026f2 {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.summary-side--right.data-v-364026f2 {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
align-items: center;
|
||||
}
|
||||
.summary-side--right .summary-icon.data-v-364026f2 {
|
||||
margin-right: 22rpx;
|
||||
}
|
||||
.summary-side--right .summary-text.data-v-364026f2 {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
/* 图标右边缘到竖线 = 169rpx,文字靠左,右侧留白 */
|
||||
.summary-icon-gap.data-v-364026f2 {
|
||||
width: 149rpx;
|
||||
flex-shrink: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.summary-icon.data-v-364026f2 {
|
||||
width: 55rpx;
|
||||
height: 65rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.summary-side--left .summary-icon.data-v-364026f2 {
|
||||
margin-right: 22rpx;
|
||||
}
|
||||
.summary-text.data-v-364026f2 {
|
||||
flex-shrink: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.summary-label.data-v-364026f2 {
|
||||
font-size: 24rpx;
|
||||
color: #8f9ca2;
|
||||
line-height: 34rpx;
|
||||
}
|
||||
.summary-status.data-v-364026f2 {
|
||||
margin-top: 8rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.summary-date.data-v-364026f2 {
|
||||
margin-top: 8rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
line-height: 40rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.summary-divider.data-v-364026f2 {
|
||||
width: 2rpx;
|
||||
height: 72rpx;
|
||||
flex-shrink: 0;
|
||||
background: #eee;
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
.panel-wrap.data-v-364026f2 {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
height: 0;
|
||||
margin-top: 12rpx;
|
||||
padding: 0 30rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const utils_draftCache = require("../../utils/draftCache.js");
|
||||
const utils_useDraftCache = require("../../utils/useDraftCache.js");
|
||||
const utils_upload = require("../../utils/upload.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
@@ -38,8 +40,13 @@ const _sfc_main = {
|
||||
const signatureRef = common_vendor.ref(null);
|
||||
const isSignatureEmpty = common_vendor.ref(true);
|
||||
const isSubmitting = common_vendor.ref(false);
|
||||
const signatureLocalPath = common_vendor.ref("");
|
||||
const isDraftExporting = common_vendor.ref(false);
|
||||
let signatureExportTimer = null;
|
||||
const clearSignature = () => {
|
||||
clearTimeout(signatureExportTimer);
|
||||
isSignatureEmpty.value = true;
|
||||
signatureLocalPath.value = "";
|
||||
if (signatureRef.value) {
|
||||
signatureRef.value.clear();
|
||||
}
|
||||
@@ -55,23 +62,60 @@ const _sfc_main = {
|
||||
showCanvas.value = true;
|
||||
signatureServerPath.value = "";
|
||||
signatureUrl.value = "";
|
||||
signatureLocalPath.value = "";
|
||||
isSignatureEmpty.value = true;
|
||||
return;
|
||||
}
|
||||
signatureServerPath.value = url;
|
||||
signatureUrl.value = url;
|
||||
signatureLocalPath.value = "";
|
||||
showCanvas.value = false;
|
||||
isSignatureEmpty.value = false;
|
||||
};
|
||||
const applySignatureFromLocal = (localPath) => {
|
||||
if (!localPath)
|
||||
return;
|
||||
signatureLocalPath.value = localPath;
|
||||
signatureUrl.value = localPath;
|
||||
signatureServerPath.value = "";
|
||||
showCanvas.value = false;
|
||||
isSignatureEmpty.value = false;
|
||||
};
|
||||
const onSignatureStart = () => {
|
||||
isSignatureEmpty.value = false;
|
||||
};
|
||||
const onSignatureSigning = () => {
|
||||
isSignatureEmpty.value = false;
|
||||
};
|
||||
const onSignatureClear = () => {
|
||||
isSignatureEmpty.value = true;
|
||||
signatureLocalPath.value = "";
|
||||
};
|
||||
const scheduleSignatureDraftExport = () => {
|
||||
clearTimeout(signatureExportTimer);
|
||||
signatureExportTimer = setTimeout(() => {
|
||||
if (!showCanvas.value || isSignatureEmpty.value || !signatureRef.value || isSubmitting.value || isDraftExporting.value) {
|
||||
return;
|
||||
}
|
||||
isDraftExporting.value = true;
|
||||
signatureRef.value.confirm();
|
||||
}, 600);
|
||||
};
|
||||
const onSignatureEnd = () => {
|
||||
isSignatureEmpty.value = false;
|
||||
scheduleSignatureDraftExport();
|
||||
};
|
||||
const onSignatureImageError = () => {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:321", "签名图片加载失败:", signatureUrl.value);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:376", "签名图片加载失败:", signatureUrl.value);
|
||||
common_vendor.index.showToast({ title: "签名图片加载失败", icon: "none" });
|
||||
};
|
||||
const reSign = () => {
|
||||
clearTimeout(signatureExportTimer);
|
||||
isSignatureEmpty.value = true;
|
||||
showCanvas.value = true;
|
||||
signatureUrl.value = "";
|
||||
signatureServerPath.value = "";
|
||||
signatureLocalPath.value = "";
|
||||
common_vendor.nextTick$1(() => {
|
||||
if (signatureRef.value) {
|
||||
signatureRef.value.clear();
|
||||
@@ -345,11 +389,11 @@ const _sfc_main = {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:633", "获取安全管理人员列表失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:690", "获取安全管理人员列表失败:", error);
|
||||
}
|
||||
};
|
||||
const fetchRectifyDeptUsers = async () => {
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:639", "当前hazardId:", hazardId.value);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:696", "当前hazardId:", hazardId.value);
|
||||
try {
|
||||
const res = await request_api.getDeptUsersWithSubordinates({ hazardId: hazardId.value });
|
||||
if (res.code === 0 && res.data) {
|
||||
@@ -357,10 +401,10 @@ const _sfc_main = {
|
||||
if (selectedUserIds.value.length > 0) {
|
||||
syncSelectedUsersFromIds(selectedUserIds.value);
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:647", "整改责任人部门树:", deptList.value);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:704", "整改责任人部门树:", deptList.value);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:650", "获取整改责任人列表失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:707", "获取整改责任人列表失败:", error);
|
||||
}
|
||||
};
|
||||
const fetchPersonnelLists = async () => {
|
||||
@@ -419,7 +463,7 @@ const _sfc_main = {
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:721", "提交整改失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:778", "提交整改失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "操作失败",
|
||||
icon: "none"
|
||||
@@ -429,16 +473,23 @@ const _sfc_main = {
|
||||
}
|
||||
};
|
||||
const onSignatureConfirm = async (tempFilePath) => {
|
||||
if (isDraftExporting.value) {
|
||||
isDraftExporting.value = false;
|
||||
applySignatureFromLocal(tempFilePath);
|
||||
saveDraft();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const { url } = await utils_upload.uploadToCloud(tempFilePath);
|
||||
applySignatureFromServer(url);
|
||||
saveDraft();
|
||||
if (isSubmitting.value) {
|
||||
await executeSubmit();
|
||||
}
|
||||
} catch (err) {
|
||||
isSubmitting.value = false;
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:743", "签名上传失败:", err);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:808", "签名上传失败:", err);
|
||||
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -504,7 +555,7 @@ const _sfc_main = {
|
||||
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
|
||||
signatureRef.value.confirm();
|
||||
} else {
|
||||
if (!signatureServerPath.value) {
|
||||
if (!signatureServerPath.value && !signatureLocalPath.value) {
|
||||
common_vendor.index.showToast({
|
||||
title: "请进行电子签名",
|
||||
icon: "none"
|
||||
@@ -513,7 +564,18 @@ const _sfc_main = {
|
||||
}
|
||||
isSubmitting.value = true;
|
||||
common_vendor.index.showLoading({ title: "正在提交...", mask: true });
|
||||
await executeSubmit();
|
||||
try {
|
||||
if (!signatureServerPath.value && signatureLocalPath.value) {
|
||||
const { url } = await utils_upload.uploadToCloud(signatureLocalPath.value);
|
||||
applySignatureFromServer(url);
|
||||
}
|
||||
await executeSubmit();
|
||||
} catch (err) {
|
||||
isSubmitting.value = false;
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:899", "签名上传失败:", err);
|
||||
common_vendor.index.showToast({ title: "签名上传失败,请重试", icon: "none" });
|
||||
}
|
||||
}
|
||||
};
|
||||
const fetchRectifyDetail = async () => {
|
||||
@@ -536,7 +598,7 @@ const _sfc_main = {
|
||||
applyRectifyTimeValue(data.rectifyTime);
|
||||
}
|
||||
const signPath = resolveSignPathFromData(data);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:926", "整改详情签名路径:", signPath);
|
||||
common_vendor.index.__f__("log", "at pages/hiddendanger/rectification.vue:1002", "整改详情签名路径:", signPath);
|
||||
applySignatureFromServer(signPath);
|
||||
hazardId.value = data.hazardId || "";
|
||||
assignId.value = data.assignId || "";
|
||||
@@ -562,7 +624,7 @@ const _sfc_main = {
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:960", "获取整改详情失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:1036", "获取整改详情失败:", error);
|
||||
common_vendor.index.showToast({ title: "获取详情失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -593,28 +655,31 @@ const _sfc_main = {
|
||||
common_vendor.index.showToast({ title: aiRes.msg || "AI生成失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:997", "AI生成整改方案失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:1073", "AI生成整改方案失败:", error);
|
||||
common_vendor.index.showToast({ title: "AI生成失败,请重试", icon: "none" });
|
||||
} finally {
|
||||
aiGenerating.value = false;
|
||||
}
|
||||
};
|
||||
const hasDraft = common_vendor.ref(false);
|
||||
const showRestoreBanner = common_vendor.ref(false);
|
||||
const isRestoring = common_vendor.ref(false);
|
||||
const signaturePaths = common_vendor.ref([]);
|
||||
const getDraftKey = () => `draft_rectify_${hazardId.value || ""}_${rectifyId.value || ""}`;
|
||||
const saveDraft = () => {
|
||||
if (isRestoring.value)
|
||||
return;
|
||||
const key = getDraftKey();
|
||||
const hasContent = formData.rectifyPlan || formData.rectificationMeasures || formData.controlMeasures || formData.rectifyResult || formData.planCost || formData.actualCost || fileList1.value.length > 0 || signatureServerPath.value || signaturePaths.value.length > 0;
|
||||
if (!hasContent) {
|
||||
common_vendor.index.removeStorageSync(key);
|
||||
hasDraft.value = false;
|
||||
return;
|
||||
}
|
||||
const data = {
|
||||
const rectifyDraftHasContent = (data) => {
|
||||
const form = data.formData || {};
|
||||
return !!(form.rectifyPlan || form.rectificationMeasures || form.controlMeasures || form.rectifyResult || form.planCost || form.actualCost || data.fileList1 && data.fileList1.length > 0 || data.signatureServerPath || data.signatureLocalPath || data.signaturePaths && data.signaturePaths.length > 0);
|
||||
};
|
||||
const {
|
||||
showRestoreBanner,
|
||||
clear: clearDraft,
|
||||
restore: restoreDraft,
|
||||
save: saveDraft,
|
||||
bindAutoSave
|
||||
} = utils_useDraftCache.useDraftCache({
|
||||
getKey: () => utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.RECTIFY, hazardId.value, rectifyId.value),
|
||||
getFallbackKeys: () => {
|
||||
const primary = utils_draftCache.buildDraftKey(utils_draftCache.DRAFT_NS.RECTIFY, hazardId.value, rectifyId.value);
|
||||
const compact = utils_draftCache.buildDraftKeyCompact(utils_draftCache.DRAFT_NS.RECTIFY, hazardId.value, rectifyId.value);
|
||||
return compact !== primary ? [compact] : [];
|
||||
},
|
||||
getPayload: () => ({
|
||||
formData: {
|
||||
rectifyPlan: formData.rectifyPlan,
|
||||
rectificationMeasures: formData.rectificationMeasures,
|
||||
@@ -626,110 +691,88 @@ const _sfc_main = {
|
||||
fileList1: fileList1.value,
|
||||
signatureServerPath: signatureServerPath.value,
|
||||
signatureUrl: signatureUrl.value,
|
||||
signatureLocalPath: signatureLocalPath.value,
|
||||
showCanvas: showCanvas.value,
|
||||
signaturePaths: signaturePaths.value
|
||||
};
|
||||
common_vendor.index.setStorageSync(key, JSON.stringify(data));
|
||||
hasDraft.value = true;
|
||||
};
|
||||
const clearDraft = (showToast = true) => {
|
||||
const key = getDraftKey();
|
||||
common_vendor.index.removeStorageSync(key);
|
||||
hasDraft.value = false;
|
||||
showRestoreBanner.value = false;
|
||||
isRestoring.value = true;
|
||||
formData.rectifyPlan = "";
|
||||
formData.rectificationMeasures = "";
|
||||
formData.controlMeasures = "";
|
||||
formData.rectifyResult = "";
|
||||
formData.planCost = "";
|
||||
formData.actualCost = "";
|
||||
fileList1.value = [];
|
||||
signatureServerPath.value = "";
|
||||
signatureUrl.value = "";
|
||||
showCanvas.value = true;
|
||||
signaturePaths.value = [];
|
||||
if (signatureRef.value) {
|
||||
signatureRef.value.clear();
|
||||
}
|
||||
common_vendor.nextTick$1(() => {
|
||||
isRestoring.value = false;
|
||||
});
|
||||
if (showToast) {
|
||||
common_vendor.index.showToast({ title: "草稿已清空", icon: "none" });
|
||||
}
|
||||
};
|
||||
const restoreDraft = () => {
|
||||
const key = getDraftKey();
|
||||
const cached = common_vendor.index.getStorageSync(key);
|
||||
if (cached) {
|
||||
try {
|
||||
const data = JSON.parse(cached);
|
||||
const hasContent = data.formData.rectifyPlan || data.formData.rectificationMeasures || data.formData.controlMeasures || data.formData.rectifyResult || data.formData.planCost || data.formData.actualCost || data.fileList1 && data.fileList1.length > 0 || data.signatureServerPath || data.signaturePaths && data.signaturePaths.length > 0;
|
||||
if (!hasContent)
|
||||
return;
|
||||
isRestoring.value = true;
|
||||
formData.rectifyPlan = data.formData.rectifyPlan || "";
|
||||
formData.rectificationMeasures = data.formData.rectificationMeasures || "";
|
||||
formData.controlMeasures = data.formData.controlMeasures || "";
|
||||
formData.rectifyResult = data.formData.rectifyResult || "";
|
||||
formData.planCost = data.formData.planCost || "";
|
||||
formData.actualCost = data.formData.actualCost || "";
|
||||
fileList1.value = data.fileList1 || [];
|
||||
signaturePaths.value = data.signaturePaths || [];
|
||||
if (data.signatureServerPath || data.signatureUrl) {
|
||||
applySignatureFromServer(data.signatureServerPath || data.signatureUrl);
|
||||
} else if (data.showCanvas === false) {
|
||||
showCanvas.value = false;
|
||||
}
|
||||
hasDraft.value = true;
|
||||
showRestoreBanner.value = true;
|
||||
if (signaturePaths.value.length > 0) {
|
||||
setTimeout(() => {
|
||||
if (signatureRef.value) {
|
||||
isSignatureEmpty.value = false;
|
||||
}
|
||||
}, 450);
|
||||
}
|
||||
common_vendor.nextTick$1(() => {
|
||||
isRestoring.value = false;
|
||||
});
|
||||
common_vendor.index.showToast({
|
||||
title: "已自动恢复您上次未提交的内容",
|
||||
icon: "none",
|
||||
duration: 2500
|
||||
});
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:1145", "解析草稿失败:", e);
|
||||
isRestoring.value = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
common_vendor.watch(
|
||||
() => [
|
||||
formData.rectifyPlan,
|
||||
formData.rectificationMeasures,
|
||||
formData.controlMeasures,
|
||||
formData.rectifyResult,
|
||||
formData.planCost,
|
||||
formData.actualCost,
|
||||
fileList1.value,
|
||||
signatureServerPath.value,
|
||||
signaturePaths.value
|
||||
],
|
||||
() => {
|
||||
if (hazardId.value || rectifyId.value) {
|
||||
saveDraft();
|
||||
}),
|
||||
hasContent: rectifyDraftHasContent,
|
||||
applyPayload: (data) => {
|
||||
const form = data.formData || {};
|
||||
formData.rectifyPlan = form.rectifyPlan || "";
|
||||
formData.rectificationMeasures = form.rectificationMeasures || "";
|
||||
formData.controlMeasures = form.controlMeasures || "";
|
||||
formData.rectifyResult = form.rectifyResult || "";
|
||||
formData.planCost = form.planCost || "";
|
||||
formData.actualCost = form.actualCost || "";
|
||||
fileList1.value = data.fileList1 || [];
|
||||
signaturePaths.value = data.signaturePaths || [];
|
||||
if (data.signatureServerPath || data.signatureUrl) {
|
||||
applySignatureFromServer(data.signatureServerPath || data.signatureUrl);
|
||||
} else if (data.signatureLocalPath) {
|
||||
applySignatureFromLocal(data.signatureLocalPath);
|
||||
} else if (data.showCanvas === false) {
|
||||
showCanvas.value = false;
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
clearForm: () => {
|
||||
formData.rectifyPlan = "";
|
||||
formData.rectificationMeasures = "";
|
||||
formData.controlMeasures = "";
|
||||
formData.rectifyResult = "";
|
||||
formData.planCost = "";
|
||||
formData.actualCost = "";
|
||||
fileList1.value = [];
|
||||
signatureServerPath.value = "";
|
||||
signatureUrl.value = "";
|
||||
signatureLocalPath.value = "";
|
||||
showCanvas.value = true;
|
||||
signaturePaths.value = [];
|
||||
if (signatureRef.value) {
|
||||
signatureRef.value.clear();
|
||||
}
|
||||
},
|
||||
canSave: () => !!(hazardId.value || rectifyId.value),
|
||||
onAfterRestore: (data) => {
|
||||
var _a;
|
||||
if (data.signatureServerPath || data.signatureUrl || data.signatureLocalPath) {
|
||||
return;
|
||||
}
|
||||
if (((_a = data.signaturePaths) == null ? void 0 : _a.length) > 0) {
|
||||
setTimeout(() => {
|
||||
if (signatureRef.value) {
|
||||
isSignatureEmpty.value = false;
|
||||
}
|
||||
}, 450);
|
||||
}
|
||||
}
|
||||
});
|
||||
bindAutoSave(() => [
|
||||
formData.rectifyPlan,
|
||||
formData.rectificationMeasures,
|
||||
formData.controlMeasures,
|
||||
formData.rectifyResult,
|
||||
formData.planCost,
|
||||
formData.actualCost,
|
||||
fileList1.value,
|
||||
signatureServerPath.value,
|
||||
signatureUrl.value,
|
||||
signatureLocalPath.value,
|
||||
showCanvas.value,
|
||||
signaturePaths.value
|
||||
]);
|
||||
common_vendor.onHide(() => {
|
||||
if (showCanvas.value && !isSignatureEmpty.value && signatureRef.value && !isDraftExporting.value) {
|
||||
isDraftExporting.value = true;
|
||||
signatureRef.value.confirm();
|
||||
}
|
||||
saveDraft();
|
||||
});
|
||||
common_vendor.onLoad((options) => {
|
||||
try {
|
||||
const sysInfo = common_vendor.index.getSystemInfoSync();
|
||||
signatureWidth.value = sysInfo.windowWidth - 40;
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:1178", "获取系统信息失败:", e);
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/rectification.vue:1207", "获取系统信息失败:", e);
|
||||
}
|
||||
if (options.hazardId) {
|
||||
hazardId.value = options.hazardId;
|
||||
@@ -753,9 +796,9 @@ const _sfc_main = {
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: showRestoreBanner.value
|
||||
}, showRestoreBanner.value ? {
|
||||
b: common_vendor.o(($event) => clearDraft(true))
|
||||
a: common_vendor.unref(showRestoreBanner)
|
||||
}, common_vendor.unref(showRestoreBanner) ? {
|
||||
b: common_vendor.o(($event) => common_vendor.unref(clearDraft)(true))
|
||||
} : {}, {
|
||||
c: !aiGenerating.value
|
||||
}, !aiGenerating.value ? {} : {}, {
|
||||
@@ -944,10 +987,11 @@ const _sfc_main = {
|
||||
"k": "signatureRef"
|
||||
}),
|
||||
aA: common_vendor.o((res) => onSignatureConfirm(res.tempFilePath)),
|
||||
aB: common_vendor.o(($event) => isSignatureEmpty.value = false),
|
||||
aC: common_vendor.o(($event) => isSignatureEmpty.value = false),
|
||||
aD: common_vendor.o(($event) => isSignatureEmpty.value = true),
|
||||
aE: common_vendor.p({
|
||||
aB: common_vendor.o(onSignatureStart),
|
||||
aC: common_vendor.o(onSignatureSigning),
|
||||
aD: common_vendor.o(onSignatureEnd),
|
||||
aE: common_vendor.o(onSignatureClear),
|
||||
aF: common_vendor.p({
|
||||
width: signatureWidth.value,
|
||||
height: 160,
|
||||
backgroundColor: "#f8f8f8",
|
||||
@@ -956,9 +1000,9 @@ const _sfc_main = {
|
||||
enableHistory: false
|
||||
})
|
||||
} : {}, {
|
||||
aF: common_vendor.t(isEdit.value ? "保存修改" : "提交整改"),
|
||||
aG: common_vendor.o(handleSubmit),
|
||||
aH: common_vendor.gei(_ctx, "")
|
||||
aG: common_vendor.t(isEdit.value ? "保存修改" : "提交整改"),
|
||||
aH: common_vendor.o(handleSubmit),
|
||||
aI: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,116 +1,48 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const request_request = require("../../request/request.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
(_easycom_up_input2 + _easycom_up_textarea2)();
|
||||
}
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_input + _easycom_up_textarea)();
|
||||
HazardDetailPanel();
|
||||
}
|
||||
const HazardDetailPanel = () => "../../components/hazardDetail/HazardDetailPanel.js";
|
||||
const _sfc_main = {
|
||||
__name: "view",
|
||||
setup(__props) {
|
||||
const detailData = common_vendor.reactive({
|
||||
hazardId: "",
|
||||
assignId: "",
|
||||
title: "",
|
||||
level: 0,
|
||||
levelName: "",
|
||||
source: "",
|
||||
description: "",
|
||||
address: "",
|
||||
areaName: "",
|
||||
areaColor: "",
|
||||
tagName: "",
|
||||
legalBasis: "",
|
||||
regulationName: "",
|
||||
attachments: []
|
||||
});
|
||||
const legalBasisText = common_vendor.computed(() => detailData.legalBasis || detailData.regulationName || "");
|
||||
const getFullPath = (filePath) => request_request.toImageUrl(filePath);
|
||||
const previewHazardImage = (index) => {
|
||||
if (!detailData.attachments || detailData.attachments.length === 0)
|
||||
return;
|
||||
common_vendor.index.previewImage({
|
||||
current: index,
|
||||
urls: detailData.attachments.map((item) => getFullPath(item.filePath))
|
||||
});
|
||||
};
|
||||
const fetchDetail = async (hazardId, assignId) => {
|
||||
const detailData = common_vendor.ref({});
|
||||
const loading = common_vendor.ref(false);
|
||||
const loadDetail = async (hazardId) => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const params = { hazardId };
|
||||
if (assignId)
|
||||
params.assignId = assignId;
|
||||
const res = await request_api.getHiddenDangerDetail(params);
|
||||
const res = await request_api.getHazardDetail(hazardId);
|
||||
if (res.code === 0 && res.data) {
|
||||
Object.assign(detailData, res.data);
|
||||
detailData.value = res.data;
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/view.vue:138", "获取隐患详情失败:", error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
common_vendor.index.__f__("error", "at pages/hiddendanger/view.vue:26", "获取隐患详情失败:", error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.hazardId) {
|
||||
fetchDetail(options.hazardId, options.assignId);
|
||||
loadDetail(options.hazardId);
|
||||
return;
|
||||
}
|
||||
common_vendor.index.showToast({ title: "缺少隐患ID", icon: "none" });
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(detailData.source || "暂无"),
|
||||
b: detailData.attachments && detailData.attachments.length > 0
|
||||
}, detailData.attachments && detailData.attachments.length > 0 ? {
|
||||
c: common_vendor.f(detailData.attachments, (img, idx, i0) => {
|
||||
return {
|
||||
a: idx,
|
||||
b: getFullPath(img.filePath),
|
||||
c: common_vendor.o(($event) => previewHazardImage(idx), idx)
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
d: common_vendor.o(($event) => detailData.title = $event),
|
||||
e: common_vendor.p({
|
||||
disabled: true,
|
||||
disabledColor: "#F6F6F6",
|
||||
border: "surround",
|
||||
placeholder: "暂无",
|
||||
modelValue: detailData.title
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
detail: detailData.value,
|
||||
loading: loading.value
|
||||
}),
|
||||
f: common_vendor.n(detailData.level === 2 ? "bg-blue light" : "bg-gray"),
|
||||
g: common_vendor.n(detailData.level === 3 ? "bg-blue light" : "bg-gray"),
|
||||
h: common_vendor.o(($event) => detailData.address = $event),
|
||||
i: common_vendor.p({
|
||||
disabled: true,
|
||||
disabledColor: "#F6F6F6",
|
||||
border: "surround",
|
||||
placeholder: "暂无地址",
|
||||
modelValue: detailData.address
|
||||
}),
|
||||
j: common_vendor.t(legalBasisText.value || "暂无"),
|
||||
k: !legalBasisText.value ? 1 : "",
|
||||
l: detailData.areaColor
|
||||
}, detailData.areaColor ? {
|
||||
m: detailData.areaColor
|
||||
} : {}, {
|
||||
n: common_vendor.t(detailData.areaName || "暂无"),
|
||||
o: !detailData.areaName ? 1 : "",
|
||||
p: common_vendor.o(($event) => detailData.description = $event),
|
||||
q: common_vendor.p({
|
||||
placeholder: "暂无描述",
|
||||
disabled: true,
|
||||
autoHeight: true,
|
||||
modelValue: detailData.description
|
||||
}),
|
||||
r: common_vendor.t(detailData.tagName || "暂无"),
|
||||
s: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
b: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "查看隐患",
|
||||
"usingComponents": {
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea"
|
||||
"hazard-detail-panel": "../../components/hazardDetail/HazardDetailPanel"
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
<view class="{{['padding', 'page', 'data-v-4d631e68', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{s}}"><view class="padding bg-white radius data-v-4d631e68"><view class="flex margin-bottom data-v-4d631e68"><view class="text-gray data-v-4d631e68">检查形式</view><view class="text-red data-v-4d631e68">*</view></view><view class="read-only-box data-v-4d631e68">{{a}}</view><view class="flex margin-bottom margin-top data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患图片</view><view class="text-red data-v-4d631e68">*</view></view><view class="margin-bottom data-v-4d631e68"><view wx:if="{{b}}" class="margin-top-xs data-v-4d631e68"><view class="flex data-v-4d631e68" style="flex-wrap:wrap;gap:10rpx"><image wx:for="{{c}}" wx:for-item="img" wx:key="a" class="data-v-4d631e68" src="{{img.b}}" style="width:136rpx;height:136rpx;border-radius:16rpx" mode="aspectFill" bindtap="{{img.c}}"></image></view></view><view wx:else class="text-gray text-sm data-v-4d631e68">暂无图片</view><view class="text-gray text-sm margin-top-xs data-v-4d631e68">必填:请上传现场照片作为隐患证据</view></view><view class="flex margin-bottom margin-top data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患标题</view><view class="text-red data-v-4d631e68">*</view></view><up-input wx:if="{{e}}" class="data-v-4d631e68" virtualHostClass="data-v-4d631e68" u-i="4d631e68-0" bind:__l="__l" bindupdateModelValue="{{d}}" u-p="{{e}}"/><view class="text-sm text-gray margin-top-xs data-v-4d631e68">请用简洁的语言概括隐患要点</view><view class="flex margin-bottom margin-top data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患等级</view><view class="text-red data-v-4d631e68">*</view></view><view class="flex col-2 data-v-4d631e68" style="gap:10rpx"><view class="{{[f, 'level-item', 'data-v-4d631e68']}}">一般隐患</view><view class="{{[g, 'level-item', 'data-v-4d631e68']}}">重大隐患</view></view><view class="flex margin-bottom margin-top data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患位置</view><view class="text-red data-v-4d631e68">*</view></view><up-input wx:if="{{i}}" class="data-v-4d631e68" virtualHostClass="data-v-4d631e68" u-i="4d631e68-1" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"/><view class="text-gray text-sm margin-top-xs data-v-4d631e68">如:办公楼3层东侧消防通道、生产车间A区设备旁等,或点击"选择地址"按钮在地图上选择</view><view class="flex margin-bottom margin-top data-v-4d631e68"><view class="text-gray data-v-4d631e68">法律依据</view></view><view class="read-only-select data-v-4d631e68"><view class="{{['select-value', 'data-v-4d631e68', k && 'placeholder']}}">{{j}}</view></view><view class="flex margin-bottom margin-top data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患区域</view></view><view class="read-only-select data-v-4d631e68"><view class="flex align-center data-v-4d631e68"><view wx:if="{{l}}" class="area-color-dot data-v-4d631e68" style="{{'background-color:' + m}}"></view><view class="{{['select-value', 'data-v-4d631e68', o && 'placeholder']}}">{{n}}</view></view></view><view class="flex margin-bottom margin-top data-v-4d631e68"><view class="text-gray data-v-4d631e68">隐患描述</view><view class="text-red data-v-4d631e68">*</view></view><up-textarea wx:if="{{q}}" class="data-v-4d631e68" virtualHostClass="data-v-4d631e68" u-i="4d631e68-2" bind:__l="__l" bindupdateModelValue="{{p}}" u-p="{{q}}"></up-textarea><view class="text-gray text-sm margin-top-xs data-v-4d631e68">请详细说明隐患现状、潜在风险及影响范围</view><view class="text-gray margin-bottom margin-top data-v-4d631e68">隐患标签</view><view class="read-only-box data-v-4d631e68">{{r}}</view></view></view>
|
||||
<view class="{{['page', 'data-v-4d631e68', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{b}}"><hazard-detail-panel wx:if="{{a}}" class="data-v-4d631e68" virtualHostClass="data-v-4d631e68" u-i="4d631e68-0" bind:__l="__l" u-p="{{a}}"/></view>
|
||||
@@ -26,40 +26,5 @@
|
||||
/* 文章场景相关 */
|
||||
.page.data-v-4d631e68 {
|
||||
min-height: 100vh;
|
||||
background: #EBF2FC;
|
||||
}
|
||||
.read-only-box.data-v-4d631e68 {
|
||||
background: #f5f5f5;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.read-only-select.data-v-4d631e68 {
|
||||
background: #f5f5f5;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
}
|
||||
.read-only-select .select-value.data-v-4d631e68 {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
line-height: 1.5;
|
||||
word-break: break-all;
|
||||
}
|
||||
.read-only-select .select-value.placeholder.data-v-4d631e68 {
|
||||
color: #999;
|
||||
}
|
||||
.level-item.data-v-4d631e68 {
|
||||
padding: 16rpx 40rpx;
|
||||
border-radius: 8rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.area-color-dot.data-v-4d631e68 {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 16rpx;
|
||||
flex-shrink: 0;
|
||||
background: #ebf2fc;
|
||||
}
|
||||
177
unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
177
unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
@@ -6,13 +6,16 @@ const request_three_one_api_info = require("../../request/three_one_api/info.js"
|
||||
const request_request = require("../../request/request.js");
|
||||
if (!Array) {
|
||||
const _easycom_u_navbar2 = common_vendor.resolveComponent("u-navbar");
|
||||
_easycom_u_navbar2();
|
||||
const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
|
||||
(_easycom_u_navbar2 + _easycom_u_icon2)();
|
||||
}
|
||||
const _easycom_u_navbar = () => "../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
|
||||
const _easycom_u_icon = () => "../../uni_modules/uview-plus/components/u-icon/u-icon.js";
|
||||
if (!Math) {
|
||||
_easycom_u_navbar();
|
||||
(_easycom_u_navbar + _easycom_u_icon)();
|
||||
}
|
||||
const defaultAvatar = "https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg";
|
||||
const PLAN_INITIAL_SIZE = 4;
|
||||
const _sfc_main = {
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
@@ -51,7 +54,7 @@ const _sfc_main = {
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:229", "获取用户信息失败:", e);
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:245", "获取用户信息失败:", e);
|
||||
try {
|
||||
const storedUserInfo = common_vendor.index.getStorageSync("userInfo");
|
||||
if (storedUserInfo) {
|
||||
@@ -66,7 +69,7 @@ const _sfc_main = {
|
||||
userInfo.phone = info.phone || "";
|
||||
}
|
||||
} catch (storageError) {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:245", "从本地存储获取用户信息失败:", storageError);
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:261", "从本地存储获取用户信息失败:", storageError);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -111,14 +114,41 @@ const _sfc_main = {
|
||||
}
|
||||
return allMenuList;
|
||||
});
|
||||
const ViewDetails = (item) => {
|
||||
const formatProgress = (progress) => {
|
||||
const num = Number(progress);
|
||||
if (Number.isNaN(num))
|
||||
return 0;
|
||||
return Math.min(100, Math.max(0, num));
|
||||
};
|
||||
const getTodayDateStr = () => {
|
||||
const date = /* @__PURE__ */ new Date();
|
||||
const y = date.getFullYear();
|
||||
const m = String(date.getMonth() + 1).padStart(2, "0");
|
||||
const d = String(date.getDate()).padStart(2, "0");
|
||||
return `${y}-${m}-${d}`;
|
||||
};
|
||||
const goTodayInspect = (item) => {
|
||||
const oneTableId = item.id;
|
||||
const taskDate = getTodayDateStr();
|
||||
const tableId = item.tableId ?? item.id;
|
||||
if (!oneTableId || !taskDate) {
|
||||
common_vendor.index.showToast({ title: "缺少任务参数", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const name = item.name || "";
|
||||
const tableIdQuery = tableId ? `&tableId=${tableId}` : "";
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/plandetail/plandetail?id=${item.id}`
|
||||
url: `/pages/Inspectionresult/detail?oneTableId=${oneTableId}&taskDate=${encodeURIComponent(taskDate)}&name=${encodeURIComponent(name)}${tableIdQuery}`
|
||||
});
|
||||
};
|
||||
const goDetails = (item) => {
|
||||
const goPlanCheckList = (item) => {
|
||||
const tableId = item.tableId ?? item.id;
|
||||
if (!tableId) {
|
||||
common_vendor.index.showToast({ title: "缺少检查表ID", icon: "none" });
|
||||
return;
|
||||
}
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/Inspectionresult/Inspectionresult?id=${item.id}`
|
||||
url: `/pages/Inspectionresult/list?tableId=${tableId}&name=${encodeURIComponent(item.name || "")}`
|
||||
});
|
||||
};
|
||||
const handleMenuClick = (item) => {
|
||||
@@ -142,23 +172,78 @@ const _sfc_main = {
|
||||
};
|
||||
const checkPlanParams = common_vendor.ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: PLAN_INITIAL_SIZE,
|
||||
name: ""
|
||||
});
|
||||
const checkPlanData = common_vendor.ref([]);
|
||||
const checkPlanTotal = common_vendor.ref(0);
|
||||
const planShowAll = common_vendor.ref(false);
|
||||
const expandedPlanMap = common_vendor.ref({});
|
||||
const hasMoreCheckPlans = common_vendor.computed(() => {
|
||||
return !planShowAll.value && checkPlanTotal.value > PLAN_INITIAL_SIZE;
|
||||
});
|
||||
const initPlanExpandedState = (records = [], { reset = false, expandFirst = false } = {}) => {
|
||||
const map = reset ? {} : { ...expandedPlanMap.value };
|
||||
records.forEach((item, index) => {
|
||||
if (reset) {
|
||||
map[item.id] = expandFirst && index === 0;
|
||||
} else if (!(item.id in map)) {
|
||||
map[item.id] = false;
|
||||
}
|
||||
});
|
||||
expandedPlanMap.value = map;
|
||||
};
|
||||
const isPlanExpanded = (id) => !!expandedPlanMap.value[id];
|
||||
const togglePlanExpand = (id) => {
|
||||
expandedPlanMap.value = {
|
||||
...expandedPlanMap.value,
|
||||
[id]: !expandedPlanMap.value[id]
|
||||
};
|
||||
};
|
||||
const getCheckPlanLists = async () => {
|
||||
var _a, _b;
|
||||
planShowAll.value = false;
|
||||
try {
|
||||
const res = await request_api.getCheckPlanList(checkPlanParams.value);
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:339", res);
|
||||
const res = await request_api.getCheckPlanList({
|
||||
pageNum: 1,
|
||||
pageSize: PLAN_INITIAL_SIZE,
|
||||
name: checkPlanParams.value.name
|
||||
});
|
||||
if (res.code === 0) {
|
||||
checkPlanData.value = res.data.records;
|
||||
const records = ((_a = res.data) == null ? void 0 : _a.records) || [];
|
||||
checkPlanTotal.value = Number(((_b = res.data) == null ? void 0 : _b.total) ?? records.length);
|
||||
checkPlanData.value = records;
|
||||
initPlanExpandedState(records, { reset: true, expandFirst: true });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:344", error);
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:431", error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
const loadMoreCheckPlans = async () => {
|
||||
var _a;
|
||||
if (!hasMoreCheckPlans.value)
|
||||
return;
|
||||
try {
|
||||
const res = await request_api.getCheckPlanList({
|
||||
pageNum: 1,
|
||||
pageSize: checkPlanTotal.value,
|
||||
name: checkPlanParams.value.name
|
||||
});
|
||||
if (res.code === 0) {
|
||||
const records = ((_a = res.data) == null ? void 0 : _a.records) || [];
|
||||
initPlanExpandedState(records);
|
||||
checkPlanData.value = records;
|
||||
planShowAll.value = true;
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "加载失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:454", error);
|
||||
common_vendor.index.showToast({ title: "加载失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
const formatDate = (dateStr) => {
|
||||
if (!dateStr)
|
||||
return "";
|
||||
@@ -197,13 +282,13 @@ const _sfc_main = {
|
||||
const getHiddenDangerLists = async () => {
|
||||
try {
|
||||
const res = await request_api.getHiddenDangerList(hiddenDangerParams.value);
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:403", res);
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:512", res);
|
||||
if (res.code === 0) {
|
||||
hiddenDangerData.value = res.data.records;
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:406", hiddenDangerData.value, 1111);
|
||||
common_vendor.index.__f__("log", "at pages/index/index.vue:515", hiddenDangerData.value, 1111);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:409", error);
|
||||
common_vendor.index.__f__("error", "at pages/index/index.vue:518", error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
@@ -213,7 +298,7 @@ const _sfc_main = {
|
||||
});
|
||||
const viewHazardDetail = (item) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/hiddendanger/view?hazardId=${item.hazardId}&assignId=${item.assignId}`
|
||||
url: `/pages/hiddendanger/detail2?hazardId=${item.hazardId}&assignId=${item.assignId || ""}`
|
||||
});
|
||||
};
|
||||
const goRectification = (item) => {
|
||||
@@ -237,7 +322,7 @@ const _sfc_main = {
|
||||
return common_vendor.e({
|
||||
a: common_assets._imports_0,
|
||||
b: common_vendor.p({
|
||||
title: "三查一曝光",
|
||||
title: "湘西州“三个一”安全管理平台",
|
||||
placeholder: false,
|
||||
fixed: false,
|
||||
safeAreaInsetTop: true,
|
||||
@@ -259,27 +344,39 @@ const _sfc_main = {
|
||||
}),
|
||||
g: checkPlanData.value.length === 0
|
||||
}, checkPlanData.value.length === 0 ? {} : {}, {
|
||||
h: common_vendor.f(checkPlanData.value, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
h: common_vendor.f(checkPlanData.value, (item, k0, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.name),
|
||||
b: common_vendor.t(item.runModeName),
|
||||
c: common_vendor.t(item.cycle),
|
||||
d: common_vendor.t(formatDate(item.planStartTime)),
|
||||
e: common_vendor.t(formatDate(item.planEndTime)),
|
||||
f: item.progress + "%",
|
||||
g: common_vendor.t(item.progress),
|
||||
h: common_vendor.t(item.totalCount),
|
||||
i: common_vendor.t(item.totalCount - item.finishedCount),
|
||||
j: common_vendor.t(item.finishedCount),
|
||||
k: common_vendor.o(($event) => ViewDetails(item), item.id),
|
||||
l: item.finishedCount < item.totalCount
|
||||
}, item.finishedCount < item.totalCount ? {
|
||||
m: common_vendor.o(($event) => goDetails(item), item.id)
|
||||
} : {}, {
|
||||
n: item.id
|
||||
});
|
||||
b: "1cf27b2a-1-" + i0,
|
||||
c: common_vendor.p({
|
||||
name: isPlanExpanded(item.id) ? "arrow-down" : "arrow-up",
|
||||
color: "#ffffff",
|
||||
size: "18"
|
||||
}),
|
||||
d: common_vendor.o(($event) => togglePlanExpand(item.id), item.id),
|
||||
e: common_vendor.o(($event) => togglePlanExpand(item.id), item.id),
|
||||
f: common_vendor.t(item.runModeName),
|
||||
g: common_vendor.t(item.cycle),
|
||||
h: common_vendor.t(formatDate(item.planStartTime)),
|
||||
i: common_vendor.t(formatDate(item.planEndTime)),
|
||||
j: formatProgress(item.progress) + "%",
|
||||
k: common_vendor.t(formatProgress(item.progress)),
|
||||
l: common_vendor.t(item.pendingCount ?? 0),
|
||||
m: common_vendor.t(item.waitCheckNum ?? 0),
|
||||
n: common_vendor.t(item.unusualNum ?? 0),
|
||||
o: common_vendor.t(item.finishedCount ?? 0),
|
||||
p: common_vendor.o(($event) => goTodayInspect(item), item.id),
|
||||
q: common_vendor.o(($event) => goPlanCheckList(item), item.id),
|
||||
r: isPlanExpanded(item.id),
|
||||
s: !isPlanExpanded(item.id) ? 1 : "",
|
||||
t: item.id
|
||||
};
|
||||
}),
|
||||
i: common_vendor.f(dangerTabs.value, (tab, index, i0) => {
|
||||
i: hasMoreCheckPlans.value
|
||||
}, hasMoreCheckPlans.value ? {
|
||||
j: common_vendor.o(loadMoreCheckPlans)
|
||||
} : {}, {
|
||||
k: common_vendor.f(dangerTabs.value, (tab, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(tab.label),
|
||||
b: activeDangerTab.value === index ? 1 : "",
|
||||
@@ -287,9 +384,9 @@ const _sfc_main = {
|
||||
d: common_vendor.o(($event) => switchDangerTab(index), index)
|
||||
};
|
||||
}),
|
||||
j: filteredDangerData.value.length === 0
|
||||
l: filteredDangerData.value.length === 0
|
||||
}, filteredDangerData.value.length === 0 ? {} : {}, {
|
||||
k: common_vendor.f(filteredDangerData.value, (item, index, i0) => {
|
||||
m: common_vendor.f(filteredDangerData.value, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.title),
|
||||
b: common_vendor.t(item.levelName),
|
||||
@@ -316,7 +413,7 @@ const _sfc_main = {
|
||||
q: item.hazardId
|
||||
});
|
||||
}),
|
||||
l: common_vendor.gei(_ctx, "")
|
||||
n: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"navigationBarTitleText": "三查一曝光",
|
||||
"navigationBarTitleText": "湘西州“三个一”安全管理平台",
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "white",
|
||||
"usingComponents": {
|
||||
"u-navbar": "../../uni_modules/uview-plus/components/u-navbar/u-navbar"
|
||||
"u-navbar": "../../uni_modules/uview-plus/components/u-navbar/u-navbar",
|
||||
"u-icon": "../../uni_modules/uview-plus/components/u-icon/u-icon"
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -139,6 +139,14 @@
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
.inspect-list-btn.data-v-1cf27b2a {
|
||||
margin: 0;
|
||||
padding: 0 24rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
font-size: 24rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.plan-card.data-v-1cf27b2a {
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
@@ -149,6 +157,7 @@
|
||||
padding: 24rpx 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.plan-header .plan-header-icon.data-v-1cf27b2a {
|
||||
width: 36rpx;
|
||||
@@ -156,14 +165,34 @@
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.plan-header .plan-header-title.data-v-1cf27b2a {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding-right: 16rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.plan-toggle-btn.data-v-1cf27b2a {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
.plan-body.data-v-1cf27b2a {
|
||||
padding: 24rpx 30rpx 10rpx 30rpx;
|
||||
background: #fff;
|
||||
}
|
||||
.plan-body--collapsed.data-v-1cf27b2a {
|
||||
padding-bottom: 24rpx;
|
||||
}
|
||||
.plan-load-more.data-v-1cf27b2a {
|
||||
text-align: center;
|
||||
padding: 24rpx 0 8rpx;
|
||||
font-size: 28rpx;
|
||||
color: #2667E9;
|
||||
}
|
||||
.plan-stats.data-v-1cf27b2a {
|
||||
display: flex;
|
||||
background: #F5F7FA;
|
||||
|
||||
@@ -147,10 +147,10 @@ const _sfc_main = {
|
||||
a: common_vendor.p({
|
||||
isBack: true
|
||||
}),
|
||||
b: common_assets._imports_0$5,
|
||||
b: common_assets._imports_0$6,
|
||||
c: phone.value,
|
||||
d: common_vendor.o(($event) => phone.value = $event.detail.value),
|
||||
e: common_assets._imports_1$3,
|
||||
e: common_assets._imports_1$4,
|
||||
f: !showPassword.value,
|
||||
g: password.value,
|
||||
h: common_vendor.o(($event) => password.value = $event.detail.value),
|
||||
|
||||
@@ -75,11 +75,11 @@ const _sfc_main = {
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_assets._imports_0$4,
|
||||
b: common_assets._imports_0$5,
|
||||
a: common_assets._imports_0$5,
|
||||
b: common_assets._imports_0$6,
|
||||
c: username.value,
|
||||
d: common_vendor.o(($event) => username.value = $event.detail.value),
|
||||
e: common_assets._imports_1$3,
|
||||
e: common_assets._imports_1$4,
|
||||
f: showPassword.value,
|
||||
g: password.value,
|
||||
h: common_vendor.o(($event) => password.value = $event.detail.value),
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="{{['content', 'data-v-e4e4508d', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{l}}"><view class="header data-v-e4e4508d"><image src="{{a}}" class="bg-image data-v-e4e4508d"></image><view class="padding login data-v-e4e4508d"><view class="text-xl text-black text-bold data-v-e4e4508d">账号登录</view><view class="padding-top data-v-e4e4508d">欢迎登录三查一曝光平台</view></view></view><view class="list data-v-e4e4508d"><view class="list-call data-v-e4e4508d"><image class="img data-v-e4e4508d" src="{{b}}"></image><input class="sl-input data-v-e4e4508d" type="text" placeholder="请输入用户名" value="{{c}}" bindinput="{{d}}"/></view><view class="list-call data-v-e4e4508d"><image class="img data-v-e4e4508d" src="{{e}}"></image><input class="sl-input data-v-e4e4508d" type="text" maxlength="32" placeholder="请输入密码" password="{{f}}" value="{{g}}" bindinput="{{h}}"/><image class="eye-img data-v-e4e4508d" src="{{i}}" bindtap="{{j}}"></image></view></view><view class="padding-lr data-v-e4e4508d"><button class="button-login data-v-e4e4508d" hover-class="button-hover" bindtap="{{k}}"> 登录 </button></view></view>
|
||||
<view class="{{['content', 'data-v-e4e4508d', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{l}}"><view class="header data-v-e4e4508d"><image src="{{a}}" class="bg-image data-v-e4e4508d"></image><view class="padding login data-v-e4e4508d"><view class="text-xl text-black text-bold data-v-e4e4508d">账号登录</view><view class="padding-top data-v-e4e4508d">欢迎登录湘西州“三个一”安全管理平台</view></view></view><view class="list data-v-e4e4508d"><view class="list-call data-v-e4e4508d"><image class="img data-v-e4e4508d" src="{{b}}"></image><input class="sl-input data-v-e4e4508d" type="text" placeholder="请输入用户名" value="{{c}}" bindinput="{{d}}"/></view><view class="list-call data-v-e4e4508d"><image class="img data-v-e4e4508d" src="{{e}}"></image><input class="sl-input data-v-e4e4508d" type="text" maxlength="32" placeholder="请输入密码" password="{{f}}" value="{{g}}" bindinput="{{h}}"/><image class="eye-img data-v-e4e4508d" src="{{i}}" bindtap="{{j}}"></image></view></view><view class="padding-lr data-v-e4e4508d"><button class="button-login data-v-e4e4508d" hover-class="button-hover" bindtap="{{k}}"> 登录 </button></view></view>
|
||||
@@ -9,7 +9,7 @@ const _sfc_main = {
|
||||
return common_vendor.e({
|
||||
a: success
|
||||
}, {
|
||||
b: common_assets._imports_0$6
|
||||
b: common_assets._imports_0$7
|
||||
}, {
|
||||
d: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
|
||||
@@ -39,10 +39,10 @@ const _sfc_main = {
|
||||
const userInfoStr = common_vendor.index.getStorageSync("userInfo");
|
||||
if (userInfoStr) {
|
||||
userInfo.value = JSON.parse(userInfoStr);
|
||||
common_vendor.index.__f__("log", "at pages/membermanagemen/membermanagemen.vue:147", "用户信息:", userInfo.value);
|
||||
common_vendor.index.__f__("log", "at pages/membermanagemen/membermanagemen.vue:166", "用户信息:", userInfo.value);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:150", "获取用户信息失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:169", "获取用户信息失败:", error);
|
||||
}
|
||||
};
|
||||
const list = common_vendor.ref([]);
|
||||
@@ -51,43 +51,103 @@ const _sfc_main = {
|
||||
const res = await request_api.getMemberList();
|
||||
if (res.code === 0 && res.data) {
|
||||
list.value = res.data;
|
||||
common_vendor.index.__f__("log", "at pages/membermanagemen/membermanagemen.vue:163", "成员列表:", res.data);
|
||||
common_vendor.index.__f__("log", "at pages/membermanagemen/membermanagemen.vue:182", "成员列表:", res.data);
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:166", "获取成员列表失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:185", "获取成员列表失败:", error);
|
||||
}
|
||||
};
|
||||
const showPopup = common_vendor.ref(false);
|
||||
const showRolePicker = common_vendor.ref(false);
|
||||
const showPostPicker = common_vendor.ref(false);
|
||||
const selectedRoleName = common_vendor.ref("");
|
||||
const selectedPostName = common_vendor.ref("");
|
||||
const formData = common_vendor.reactive({
|
||||
username: "",
|
||||
nickname: "",
|
||||
phone: "",
|
||||
password: "",
|
||||
roleType: ""
|
||||
roleType: "",
|
||||
postId: ""
|
||||
});
|
||||
const roleColumns = common_vendor.reactive([
|
||||
["管理员", "普通成员"]
|
||||
]);
|
||||
const roleMap = {
|
||||
"管理员": "manage",
|
||||
"普通成员": "common"
|
||||
const roleOptions = common_vendor.ref([]);
|
||||
const roleColumns = common_vendor.ref([[]]);
|
||||
const postOptions = common_vendor.ref([]);
|
||||
const postColumns = common_vendor.ref([[]]);
|
||||
const postPlaceholder = common_vendor.computed(() => {
|
||||
if (!userInfo.value.deptId)
|
||||
return "请先登录并确认部门信息";
|
||||
return postOptions.value.length ? "请选择岗位" : "暂无可用岗位";
|
||||
});
|
||||
const openAddMemberPopup = async () => {
|
||||
getUserInfo();
|
||||
const deptId = userInfo.value.deptId;
|
||||
if (!deptId) {
|
||||
common_vendor.index.showToast({ title: "缺少部门信息,无法添加成员", icon: "none" });
|
||||
return;
|
||||
}
|
||||
try {
|
||||
common_vendor.index.showLoading({ title: "加载中..." });
|
||||
const [optionsRes, postRes] = await Promise.all([
|
||||
request_api.getSystemUserFormOptions(),
|
||||
request_api.listPostByDeptId(deptId)
|
||||
]);
|
||||
common_vendor.index.hideLoading();
|
||||
if (optionsRes.code !== 0 || !Array.isArray(optionsRes.roles) || !optionsRes.roles.length) {
|
||||
common_vendor.index.showToast({ title: optionsRes.msg || "获取角色列表失败", icon: "none" });
|
||||
return;
|
||||
}
|
||||
roleOptions.value = optionsRes.roles.filter((item) => item.status === "0");
|
||||
roleColumns.value = [roleOptions.value.map((item) => item.roleName)];
|
||||
const posts = postRes.data || postRes.rows || [];
|
||||
postOptions.value = posts.filter((item) => item.status === "0");
|
||||
postColumns.value = [postOptions.value.map((item) => item.postName)];
|
||||
showPopup.value = true;
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:251", "获取表单选项失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: (error == null ? void 0 : error.msg) || "获取表单选项失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
};
|
||||
const openPostPicker = () => {
|
||||
if (!postOptions.value.length) {
|
||||
common_vendor.index.showToast({ title: "当前部门暂无可用岗位", icon: "none" });
|
||||
return;
|
||||
}
|
||||
showPostPicker.value = true;
|
||||
};
|
||||
const onRoleConfirm = (e) => {
|
||||
if (e.value && e.value.length > 0) {
|
||||
selectedRoleName.value = e.value[0];
|
||||
formData.roleType = roleMap[e.value[0]];
|
||||
const roleName = e.value[0];
|
||||
const role = roleOptions.value.find((item) => item.roleName === roleName);
|
||||
selectedRoleName.value = roleName;
|
||||
formData.roleType = (role == null ? void 0 : role.roleKey) || "";
|
||||
}
|
||||
showRolePicker.value = false;
|
||||
};
|
||||
const onPostConfirm = (e) => {
|
||||
if (e.value && e.value.length > 0) {
|
||||
const postName = e.value[0];
|
||||
const post = postOptions.value.find((item) => item.postName === postName);
|
||||
selectedPostName.value = postName;
|
||||
formData.postId = (post == null ? void 0 : post.postId) ?? "";
|
||||
}
|
||||
showPostPicker.value = false;
|
||||
};
|
||||
const resetForm = () => {
|
||||
formData.username = "";
|
||||
formData.nickname = "";
|
||||
formData.phone = "";
|
||||
formData.password = "";
|
||||
formData.roleType = "";
|
||||
formData.postId = "";
|
||||
selectedRoleName.value = "";
|
||||
selectedPostName.value = "";
|
||||
postOptions.value = [];
|
||||
postColumns.value = [[]];
|
||||
};
|
||||
const handleSubmit = async () => {
|
||||
if (!formData.username) {
|
||||
@@ -102,13 +162,23 @@ const _sfc_main = {
|
||||
common_vendor.index.showToast({ title: "请选择角色类型", icon: "none" });
|
||||
return;
|
||||
}
|
||||
getUserInfo();
|
||||
const deptId = userInfo.value.deptId;
|
||||
if (!deptId) {
|
||||
common_vendor.index.showToast({ title: "缺少部门信息,无法添加成员", icon: "none" });
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
userName: formData.username,
|
||||
nickName: formData.nickname || "",
|
||||
phonenumber: formData.phone || "",
|
||||
password: formData.password,
|
||||
roleType: formData.roleType
|
||||
roleType: formData.roleType,
|
||||
deptId
|
||||
};
|
||||
if (formData.postId) {
|
||||
params.postId = formData.postId;
|
||||
}
|
||||
try {
|
||||
const res = await request_api.addMember(params);
|
||||
if (res.code === 0) {
|
||||
@@ -120,7 +190,7 @@ const _sfc_main = {
|
||||
common_vendor.index.showToast({ title: res.msg || "添加失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:249", "添加成员失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:349", "添加成员失败:", error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
@@ -147,7 +217,7 @@ const _sfc_main = {
|
||||
common_vendor.index.showToast({ title: result.msg || `${actionText}失败`, icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:280", `${actionText}成员失败:`, error);
|
||||
common_vendor.index.__f__("error", "at pages/membermanagemen/membermanagemen.vue:380", `${actionText}成员失败:`, error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
}
|
||||
@@ -174,7 +244,7 @@ const _sfc_main = {
|
||||
h: index < list.value.length - 1 ? 1 : ""
|
||||
};
|
||||
}),
|
||||
d: common_vendor.o(($event) => showPopup.value = true),
|
||||
d: common_vendor.o(openAddMemberPopup),
|
||||
e: common_vendor.o(($event) => showPopup.value = false),
|
||||
f: common_vendor.o(($event) => formData.username = $event),
|
||||
g: common_vendor.p({
|
||||
@@ -205,23 +275,33 @@ const _sfc_main = {
|
||||
n: common_vendor.t(selectedRoleName.value || "请选择角色类型"),
|
||||
o: common_vendor.n(selectedRoleName.value ? "" : "text-gray"),
|
||||
p: common_vendor.o(($event) => showRolePicker.value = true),
|
||||
q: common_vendor.o(($event) => showPopup.value = false),
|
||||
r: common_vendor.o(handleSubmit),
|
||||
s: common_vendor.o(($event) => showPopup.value = false),
|
||||
t: common_vendor.p({
|
||||
q: common_vendor.t(selectedPostName.value || postPlaceholder.value),
|
||||
r: common_vendor.n(selectedPostName.value ? "" : "text-gray"),
|
||||
s: common_vendor.o(openPostPicker),
|
||||
t: common_vendor.o(($event) => showPopup.value = false),
|
||||
v: common_vendor.o(handleSubmit),
|
||||
w: common_vendor.o(($event) => showPopup.value = false),
|
||||
x: common_vendor.p({
|
||||
show: showPopup.value,
|
||||
mode: "center",
|
||||
round: "20",
|
||||
safeAreaInsetBottom: false
|
||||
}),
|
||||
v: common_vendor.o(onRoleConfirm),
|
||||
w: common_vendor.o(($event) => showRolePicker.value = false),
|
||||
x: common_vendor.o(($event) => showRolePicker.value = false),
|
||||
y: common_vendor.p({
|
||||
show: showRolePicker.value,
|
||||
columns: roleColumns
|
||||
y: common_vendor.o(onPostConfirm),
|
||||
z: common_vendor.o(($event) => showPostPicker.value = false),
|
||||
A: common_vendor.o(($event) => showPostPicker.value = false),
|
||||
B: common_vendor.p({
|
||||
show: showPostPicker.value,
|
||||
columns: postColumns.value
|
||||
}),
|
||||
z: common_vendor.gei(_ctx, "")
|
||||
C: common_vendor.o(onRoleConfirm),
|
||||
D: common_vendor.o(($event) => showRolePicker.value = false),
|
||||
E: common_vendor.o(($event) => showRolePicker.value = false),
|
||||
F: common_vendor.p({
|
||||
show: showRolePicker.value,
|
||||
columns: roleColumns.value
|
||||
}),
|
||||
G: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="{{['page', 'padding', 'data-v-06d9f81b', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{z}}"><view class="member-card bg-white radius data-v-06d9f81b"><view class="card-header data-v-06d9f81b"><view class="flex align-center data-v-06d9f81b"><view class="border-line data-v-06d9f81b"></view><view class="text-bold margin-left-sm data-v-06d9f81b">{{a}}</view></view><view class="role-tag data-v-06d9f81b">{{b}}</view></view><view class="member-list data-v-06d9f81b"><view wx:for="{{c}}" wx:for-item="item" wx:key="g" class="{{['member-item', 'data-v-06d9f81b', item.h && 'border-bottom']}}"><view class="cu-avatar radius lg bg-gray data-v-06d9f81b" style="background-image:url(https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png)"></view><view class="member-info data-v-06d9f81b"><view class="flex align-center data-v-06d9f81b"><text class="member-name data-v-06d9f81b">{{item.a}}</text><view class="{{['status-tag', 'data-v-06d9f81b', item.c]}}">{{item.b}}</view></view><view class="member-phone text-gray data-v-06d9f81b"><text class="data-v-06d9f81b">手机:{{item.d}}</text></view></view><button class="btn-lock bg-blue data-v-06d9f81b" bindtap="{{item.f}}">{{item.e}}</button></view></view><view class="add-btn-wrapper data-v-06d9f81b"><button class="add-btn data-v-06d9f81b" bindtap="{{d}}"><text class="cuIcon-add data-v-06d9f81b"></text><text class="data-v-06d9f81b">添加成员</text></button></view></view><u-popup wx:if="{{t}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-s="{{['d']}}" bindclose="{{s}}" u-i="06d9f81b-0" bind:__l="__l" u-p="{{t}}"><view class="popup-content data-v-06d9f81b"><view class="popup-header data-v-06d9f81b"><view class="popup-title text-bold data-v-06d9f81b">添加成员</view><view class="popup-close data-v-06d9f81b" bindtap="{{e}}">×</view></view><scroll-view class="popup-body data-v-06d9f81b" scroll-y><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">用户名<text class="text-red data-v-06d9f81b">*</text></view><up-input wx:if="{{g}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-1,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{f}}" u-p="{{g}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">昵称</view><up-input wx:if="{{i}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-2,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">手机号</view><up-input wx:if="{{k}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-3,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{j}}" u-p="{{k}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">密码<text class="text-red data-v-06d9f81b">*</text></view><up-input wx:if="{{m}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-4,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{l}}" u-p="{{m}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">角色类型<text class="text-red data-v-06d9f81b">*</text></view><view class="form-select data-v-06d9f81b" bindtap="{{p}}"><text class="{{['data-v-06d9f81b', o]}}">{{n}}</text><text class="cuIcon-unfold data-v-06d9f81b"></text></view></view><view class="data-v-06d9f81b" style="height:40rpx"></view></scroll-view><view class="popup-footer data-v-06d9f81b"><button class="btn-cancel data-v-06d9f81b" bindtap="{{q}}">取消</button><button class="btn-confirm bg-blue data-v-06d9f81b" bindtap="{{r}}">确定</button></view></view></u-popup><up-picker wx:if="{{y}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" bindconfirm="{{v}}" bindcancel="{{w}}" bindclose="{{x}}" u-i="06d9f81b-5" bind:__l="__l" u-p="{{y}}"></up-picker><tab-bar class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-6" bind:__l="__l"/></view>
|
||||
<view class="{{['page', 'padding', 'data-v-06d9f81b', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{G}}"><view class="member-card bg-white radius data-v-06d9f81b"><view class="card-header data-v-06d9f81b"><view class="flex align-center data-v-06d9f81b"><view class="border-line data-v-06d9f81b"></view><view class="text-bold margin-left-sm data-v-06d9f81b">{{a}}</view></view><view class="role-tag data-v-06d9f81b">{{b}}</view></view><view class="member-list data-v-06d9f81b"><view wx:for="{{c}}" wx:for-item="item" wx:key="g" class="{{['member-item', 'data-v-06d9f81b', item.h && 'border-bottom']}}"><view class="cu-avatar radius lg bg-gray data-v-06d9f81b" style="background-image:url(https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png)"></view><view class="member-info data-v-06d9f81b"><view class="flex align-center data-v-06d9f81b"><text class="member-name data-v-06d9f81b">{{item.a}}</text><view class="{{['status-tag', 'data-v-06d9f81b', item.c]}}">{{item.b}}</view></view><view class="member-phone text-gray data-v-06d9f81b"><text class="data-v-06d9f81b">手机:{{item.d}}</text></view></view><button class="btn-lock bg-blue data-v-06d9f81b" bindtap="{{item.f}}">{{item.e}}</button></view></view><view class="add-btn-wrapper data-v-06d9f81b"><button class="add-btn data-v-06d9f81b" bindtap="{{d}}"><text class="cuIcon-add data-v-06d9f81b"></text><text class="data-v-06d9f81b">添加成员</text></button></view></view><u-popup wx:if="{{x}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-s="{{['d']}}" bindclose="{{w}}" u-i="06d9f81b-0" bind:__l="__l" u-p="{{x}}"><view class="popup-content data-v-06d9f81b"><view class="popup-header data-v-06d9f81b"><view class="popup-title text-bold data-v-06d9f81b">添加成员</view><view class="popup-close data-v-06d9f81b" bindtap="{{e}}">×</view></view><scroll-view class="popup-body data-v-06d9f81b" scroll-y><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">用户名<text class="text-red data-v-06d9f81b">*</text></view><up-input wx:if="{{g}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-1,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{f}}" u-p="{{g}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">昵称</view><up-input wx:if="{{i}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-2,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">手机号</view><up-input wx:if="{{k}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-3,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{j}}" u-p="{{k}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">密码<text class="text-red data-v-06d9f81b">*</text></view><up-input wx:if="{{m}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-4,06d9f81b-0" bind:__l="__l" bindupdateModelValue="{{l}}" u-p="{{m}}"></up-input></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">角色类型<text class="text-red data-v-06d9f81b">*</text></view><view class="form-select data-v-06d9f81b" bindtap="{{p}}"><text class="{{['data-v-06d9f81b', o]}}">{{n}}</text><text class="cuIcon-unfold data-v-06d9f81b"></text></view></view><view class="form-item data-v-06d9f81b"><view class="form-label data-v-06d9f81b">岗位</view><view class="form-select data-v-06d9f81b" bindtap="{{s}}"><text class="{{['data-v-06d9f81b', r]}}">{{q}}</text><text class="cuIcon-unfold data-v-06d9f81b"></text></view></view><view class="data-v-06d9f81b" style="height:40rpx"></view></scroll-view><view class="popup-footer data-v-06d9f81b"><button class="btn-cancel data-v-06d9f81b" bindtap="{{t}}">取消</button><button class="btn-confirm bg-blue data-v-06d9f81b" bindtap="{{v}}">确定</button></view></view></u-popup><up-picker wx:if="{{B}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" bindconfirm="{{y}}" bindcancel="{{z}}" bindclose="{{A}}" u-i="06d9f81b-5" bind:__l="__l" u-p="{{B}}"></up-picker><up-picker wx:if="{{F}}" class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" bindconfirm="{{C}}" bindcancel="{{D}}" bindclose="{{E}}" u-i="06d9f81b-6" bind:__l="__l" u-p="{{F}}"></up-picker><tab-bar class="data-v-06d9f81b" virtualHostClass="data-v-06d9f81b" u-i="06d9f81b-7" bind:__l="__l"/></view>
|
||||
@@ -4,8 +4,8 @@ const common_assets = require("../../common/assets.js");
|
||||
const _sfc_main = {};
|
||||
function _sfc_render(_ctx, _cache) {
|
||||
return {
|
||||
a: common_assets._imports_0$3,
|
||||
b: common_assets._imports_1$2,
|
||||
a: common_assets._imports_0$4,
|
||||
b: common_assets._imports_1$3,
|
||||
c: common_vendor.gei(_ctx, "")
|
||||
};
|
||||
}
|
||||
|
||||
@@ -82,9 +82,9 @@ const _sfc_main = {
|
||||
b: getImageUrl(userInfo.avatar) || defaultAvatar,
|
||||
c: common_vendor.t(userInfo.nickName || "未设置昵称"),
|
||||
d: common_vendor.t(userInfo.phonenumber || "未绑定手机"),
|
||||
e: common_assets._imports_0$2,
|
||||
e: common_assets._imports_0$3,
|
||||
f: common_vendor.o(($event) => editinfo()),
|
||||
g: common_assets._imports_1$1,
|
||||
g: common_assets._imports_1$2,
|
||||
h: common_vendor.o(($event) => editinfo()),
|
||||
i: common_assets._imports_2,
|
||||
j: common_vendor.o(($event) => Account()),
|
||||
|
||||
47
unpackage/dist/dev/mp-weixin/request/api.js
vendored
47
unpackage/dist/dev/mp-weixin/request/api.js
vendored
@@ -7,12 +7,26 @@ function getCheckPlanList(params) {
|
||||
data: params
|
||||
});
|
||||
}
|
||||
function getPlanTableDetail(params) {
|
||||
return request_request.requestAPI({
|
||||
url: "/frontend/plan/tableDetail",
|
||||
method: "GET",
|
||||
data: params
|
||||
});
|
||||
}
|
||||
function enterCheckPlan(oneTableId) {
|
||||
return request_request.requestAPI({
|
||||
url: `/frontend/task/start/${oneTableId}`,
|
||||
method: "GET"
|
||||
});
|
||||
}
|
||||
function getAllTask(oneTableId, taskDate) {
|
||||
const date = String(taskDate || "").split(" ")[0];
|
||||
return request_request.requestAPI({
|
||||
url: `/frontend/task/getAllTask/${oneTableId}/${date}`,
|
||||
method: "GET"
|
||||
});
|
||||
}
|
||||
function getCheckTaskDetail(taskId) {
|
||||
return request_request.requestAPI({
|
||||
url: `/frontend/task/detail/${taskId}`,
|
||||
@@ -26,6 +40,13 @@ function submitCheckResult(params) {
|
||||
data: params
|
||||
});
|
||||
}
|
||||
function submitAllTask(data) {
|
||||
return request_request.requestAPI({
|
||||
url: "/frontend/task/submitAll",
|
||||
method: "POST",
|
||||
data
|
||||
});
|
||||
}
|
||||
function addHiddenDanger(params) {
|
||||
return request_request.requestAPI({
|
||||
url: "/frontend/hazard/add",
|
||||
@@ -66,6 +87,12 @@ function getHiddenDangerDetail(params) {
|
||||
data: filteredParams
|
||||
});
|
||||
}
|
||||
function getHazardDetail(hazardId) {
|
||||
return request_request.requestAPI({
|
||||
url: `/admin/hazard/detail/${hazardId}`,
|
||||
method: "GET"
|
||||
});
|
||||
}
|
||||
function getHiddenDangerList(params) {
|
||||
return request_request.requestAPI({
|
||||
url: "/frontend/hazard/my/list",
|
||||
@@ -128,6 +155,20 @@ function lockOrUnlockMember(params) {
|
||||
data: params
|
||||
});
|
||||
}
|
||||
function getSystemUserFormOptions() {
|
||||
return request_request.requestAPI({
|
||||
url: "/system/user/",
|
||||
method: "GET",
|
||||
loadingText: false
|
||||
});
|
||||
}
|
||||
function listPostByDeptId(deptId) {
|
||||
return request_request.requestAPI({
|
||||
url: `/system/post/listByDeptId/${deptId}`,
|
||||
method: "GET",
|
||||
loadingText: false
|
||||
});
|
||||
}
|
||||
function applyDelete(params) {
|
||||
return request_request.requestAPI({
|
||||
url: "/frontend/hazard/writeoff/apply",
|
||||
@@ -317,6 +358,7 @@ exports.enterCheckPlan = enterCheckPlan;
|
||||
exports.generateRectifyPlan = generateRectifyPlan;
|
||||
exports.generateWriteoffContent = generateWriteoffContent;
|
||||
exports.getAcceptanceList = getAcceptanceList;
|
||||
exports.getAllTask = getAllTask;
|
||||
exports.getCheckItemList = getCheckItemList;
|
||||
exports.getCheckItemListDetail = getCheckItemListDetail;
|
||||
exports.getCheckPlanList = getCheckPlanList;
|
||||
@@ -327,6 +369,7 @@ exports.getDeptUsers = getDeptUsers;
|
||||
exports.getDeptUsersWithSubordinates = getDeptUsersWithSubordinates;
|
||||
exports.getEnterpriseinfo = getEnterpriseinfo;
|
||||
exports.getEnterprisetype = getEnterprisetype;
|
||||
exports.getHazardDetail = getHazardDetail;
|
||||
exports.getHiddenDangerDetail = getHiddenDangerDetail;
|
||||
exports.getHiddenDangerLabelList = getHiddenDangerLabelList;
|
||||
exports.getHiddenDangerList = getHiddenDangerList;
|
||||
@@ -335,13 +378,17 @@ exports.getMemberList = getMemberList;
|
||||
exports.getMyHiddenDangerList = getMyHiddenDangerList;
|
||||
exports.getMyWriteOffList = getMyWriteOffList;
|
||||
exports.getParentDepts = getParentDepts;
|
||||
exports.getPlanTableDetail = getPlanTableDetail;
|
||||
exports.getQiniuUploadToken = getQiniuUploadToken;
|
||||
exports.getRectifyDetail = getRectifyDetail;
|
||||
exports.getRegulationList = getRegulationList;
|
||||
exports.getSystemUserFormOptions = getSystemUserFormOptions;
|
||||
exports.getWriteOffApplyDetail = getWriteOffApplyDetail;
|
||||
exports.getindustry = getindustry;
|
||||
exports.listPostByDeptId = listPostByDeptId;
|
||||
exports.lockOrUnlockMember = lockOrUnlockMember;
|
||||
exports.login = login;
|
||||
exports.submitAllTask = submitAllTask;
|
||||
exports.submitCheckResult = submitCheckResult;
|
||||
exports.submitRectification = submitRectification;
|
||||
exports.updateEnterprise = updateEnterprise;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../common/vendor.js");
|
||||
const request_luchRequest_core_Request = require("./luch-request/core/Request.js");
|
||||
const baseUrl = "http://192.168.1.168:5004";
|
||||
const baseUrl = "https://yingji.hexieapi.com/prod-api";
|
||||
const imageBaseUrl = baseUrl.replace(/\/prod-api\/?$/, "");
|
||||
new request_luchRequest_core_Request.Request({
|
||||
baseURL: baseUrl,
|
||||
@@ -60,7 +60,7 @@ const requestAPI = (config) => {
|
||||
success: (res) => {
|
||||
common_vendor.index.hideLoading();
|
||||
if (res.statusCode !== 200) {
|
||||
common_vendor.index.__f__("error", "at request/request.js:86", "HTTP错误:", res.statusCode);
|
||||
common_vendor.index.__f__("error", "at request/request.js:88", "HTTP错误:", res.statusCode);
|
||||
reject(`HTTP_${res.statusCode}`);
|
||||
return;
|
||||
}
|
||||
@@ -79,7 +79,7 @@ const requestAPI = (config) => {
|
||||
reject({ code: 401, msg: "登录已过期" });
|
||||
} else {
|
||||
const errorMsg = res.data.msg || res.data.message || res.data.error || res.msg || "请求失败";
|
||||
common_vendor.index.__f__("error", "at request/request.js:111", "接口错误:", res.data);
|
||||
common_vendor.index.__f__("error", "at request/request.js:113", "接口错误:", res.data);
|
||||
showToast(errorMsg);
|
||||
reject({ code: res.data.code, msg: errorMsg, data: res.data });
|
||||
}
|
||||
@@ -88,7 +88,7 @@ const requestAPI = (config) => {
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at request/request.js:122", "网络请求失败:", err);
|
||||
common_vendor.index.__f__("error", "at request/request.js:124", "网络请求失败:", err);
|
||||
common_vendor.index.hideLoading();
|
||||
if (err.errMsg && err.errMsg.includes("request:fail")) {
|
||||
showToast("网络连接失败,请检查网络设置");
|
||||
|
||||
BIN
unpackage/dist/dev/mp-weixin/static/yinhuan_detail/date.png
vendored
Normal file
BIN
unpackage/dist/dev/mp-weixin/static/yinhuan_detail/date.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/yinhuan_detail/jiaoban__selected.png
vendored
Normal file
BIN
unpackage/dist/dev/mp-weixin/static/yinhuan_detail/jiaoban__selected.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user