Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/smartBuilding
| | |
| | | |
| | | // 资产项目规则 |
| | | assetRules: { |
| | | a: [[{ 0: undefined, 1: undefined }]], |
| | | b: [[{ 0: undefined, 1: undefined }]], |
| | | c: [[{ 0: undefined, 1: undefined }]], |
| | | a: [[{}]], |
| | | b: [[{}]], |
| | | c: [[{}]], |
| | | }, |
| | | |
| | | // 权限表头开关 |
| | |
| | | |
| | | // 解析 assetProject |
| | | let assetRules = { |
| | | a: [[{ 0: undefined, 1: undefined }]], |
| | | b: [[{ 0: undefined, 1: undefined }]], |
| | | c: [[{ 0: undefined, 1: undefined }]], |
| | | a: [[{}]], |
| | | b: [[{}]], |
| | | c: [[{}]], |
| | | }; |
| | | if (data.assetProject) { |
| | | try { |
| | |
| | | ...prev.assetRules, |
| | | [type]: [ |
| | | ...prev.assetRules[type], |
| | | [{ 0: undefined, 1: undefined }], |
| | | [{}], |
| | | ], |
| | | }, |
| | | })); |
| | |
| | | ...prev.assetRules, |
| | | [type]: rules.length |
| | | ? rules |
| | | : [[{ 0: undefined, 1: undefined }]], // 至少保留一组 |
| | | : [[{}]], // 至少保留一组 |
| | | }, |
| | | }; |
| | | }); |
| | |
| | | |
| | | // 如果该类下没有任何规则了,保留一个空的 |
| | | if (rules.length === 0) { |
| | | rules.push([{ 0: undefined, 1: undefined }]); |
| | | rules.push([{}]); |
| | | } |
| | | |
| | | return { |
| | |
| | | const rules = [...prev.assetRules[type]]; |
| | | rules[orIndex] = [ |
| | | ...rules[orIndex], |
| | | { 0: undefined, 1: undefined }, |
| | | {}, |
| | | ]; |
| | | return { assetRules: { ...prev.assetRules, [type]: rules } }; |
| | | }); |
| | |
| | | updateCondition = (type, orIndex, andIndex, key, value) => { |
| | | this.setState((prev) => { |
| | | const rules = [...prev.assetRules[type]]; |
| | | rules[orIndex][andIndex][key] = value; |
| | | const item = rules[orIndex][andIndex]; |
| | | const currentLevel = Object.keys(item)[0]; |
| | | const currentQuantity = item[currentLevel]; |
| | | |
| | | if (key === 'level') { |
| | | // 修改隐患等级 (key) |
| | | // 如果之前有数量,保留数量 |
| | | rules[orIndex][andIndex] = { [value]: currentQuantity }; |
| | | } else if (key === 'quantity') { |
| | | // 修改数量 (value) |
| | | if (currentLevel) { |
| | | rules[orIndex][andIndex] = { [currentLevel]: value }; |
| | | } |
| | | } |
| | | return { assetRules: { ...prev.assetRules, [type]: rules } }; |
| | | }); |
| | | }; |
| | |
| | | )} |
| | | |
| | | <div style={{ border: '1px dashed #ccc', padding: 5, borderRadius: 4, display: 'flex', flexWrap: 'wrap', alignItems: 'center' }}> |
| | | {orGroup.map((andItem, andIndex) => ( |
| | | {orGroup.map((andItem, andIndex) => { |
| | | const level = Object.keys(andItem)[0]; |
| | | const quantity = andItem[level]; |
| | | return ( |
| | | <div key={andIndex} style={{ display: "flex", alignItems: "center", margin: '2px 0' }}> |
| | | {andIndex > 0 && ( |
| | | <div style={{ display: 'flex', alignItems: 'center' }}> |
| | |
| | | <Select |
| | | style={{ width: 120 }} |
| | | placeholder="隐患级别" |
| | | value={andItem['0']} |
| | | onChange={(val) => this.updateCondition(type, orIndex, andIndex, "0", val)} |
| | | value={level ? Number(level) : undefined} |
| | | onChange={(val) => this.updateCondition(type, orIndex, andIndex, "level", val)} |
| | | > |
| | | <Option value={1}>一级隐患</Option> |
| | | <Option value={2}>二级隐患</Option> |
| | |
| | | style={{ width: 80, marginLeft: 8 }} |
| | | type="number" |
| | | placeholder="数量" |
| | | value={andItem['1']} |
| | | onChange={(e) => this.updateCondition(type, orIndex, andIndex, "1", e.target.value)} |
| | | value={quantity} |
| | | disabled={!level} |
| | | onChange={(e) => this.updateCondition(type, orIndex, andIndex, "quantity", e.target.value)} |
| | | /> |
| | | </div> |
| | | ))} |
| | | )})} |
| | | <Icon |
| | | type="plus-circle" |
| | | theme="filled" |
| | |
| | | // 定义全局变量 |
| | | |
| | | // export const BASE_URL = 'http://47.93.28.249:8181' |
| | | // export const BASE_URL = 'http://221.182.45.100:8180'; |
| | | export const BASE_URL = 'http://192.168.110.111:8080'; |
| | | export const BASE_URL = 'http://221.182.45.100:8002'; |
| | | // export const BASE_URL = 'http://192.168.110.111:8080'; |
| | | // export const SCREEN_URL = 'http://221.182.45.100:8087/#/ '; |
| | | export const SCREEN_URL = 'http://192.168.110.22:8087/#/ '; |
| | | |
| | |
| | | ></div> |
| | | <img |
| | | v-if="detailData.img" |
| | | style="width: 730px; height: 348px; object-fit: cover" |
| | | :src=" |
| | | VUE_APP_BASE_URL + '/project/download/' + |
| | | detailData.img |
| | |
| | | src="../../assets/img/home/Shape@2x (2).png" |
| | | class="shrink0 w--8 h--9" |
| | | /> |
| | | <div class="fs--12 lh--12 c-fff SHSN"> |
| | | <div class="fs--14 lh--14 c-fff SHSN"> |
| | | {{ item.province }}{{ item.city }}{{ item.area }} |
| | | </div> |
| | | </div> |
| | |
| | | {{ item.classifyName }} |
| | | </div> |
| | | </div> |
| | | <div class="mt--5 fs--14 lh--20 SHSR c-fff text-ellipsis-3"> |
| | | <div class="mt--5 fs--16 lh--20 SHSR c-fff text-ellipsis-3"> |
| | | {{ item.content }} |
| | | </div> |
| | | </div> |
| | |
| | | <div |
| | | v-if=" |
| | | (activeTab == 1 && permissionClient.includes('4')) || |
| | | (activeTab == 1 && permissionClient.includes('6')) |
| | | (activeTab == 2 && permissionClient.includes('6')) |
| | | " |
| | | class="flex a-center absolute left--14 bottom--14" |
| | | > |
| | |
| | | </div> |
| | | </div> |
| | | <div class="leftBox"> |
| | | <!-- 日期搜索 --> |
| | | <div |
| | | @click="handleClick" |
| | | class="flex a-center j-between w100 h--40 relative bgcolor1 picker" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 项目搜索 --> |
| | | <div |
| | | class="flex a-center j-between w100 pl--20 mt--13 h--40 relative bgcolor1 searchBox" |
| | | > |
| | |
| | | <div class="btn" @click="handleSearch">搜索</div> |
| | | </div> |
| | | </div> |
| | | <!-- 项目数据总览 --> |
| | | <div |
| | | v-if=" |
| | | (activeTab == 1 && permissionClient.includes('2')) || |
| | | (activeTab == 1 && permissionClient.includes('5')) |
| | | (activeTab == 2 && permissionClient.includes('5')) |
| | | " |
| | | class="mt--33 relative" |
| | | > |
| | |
| | | {{ screenData.projectTotal }} |
| | | </div> |
| | | </div> |
| | | <div class="ml--18" v-if="activeTab == 1"> |
| | | <!-- 在建工程tab --> |
| | | <div class="ml--18 flex1" v-if="activeTab == 1"> |
| | | <div |
| | | @click="toPorjectList" |
| | | class="flex a-center pl--11 pr--13 py--6 bgimg2 cursor-pointer thisBox relative" |
| | |
| | | </div> |
| | | <div class="ml--11 txt-center"> |
| | | <div class="c-fff fs--22 lh--22 SHSBold"> |
| | | {{ screenData.municipalInspectionCoverage }} |
| | | {{ screenData.municipalProjectCount }} |
| | | </div> |
| | | <div |
| | | v-if="!dateRange.length" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 固定资产tab --> |
| | | <div class="ml--18 flex1" v-else> |
| | | <div |
| | | class="mt--13 flex a-center j-between bgcolor2 pl--9 pb--5 pt--4 pr--10" |
| | | > |
| | | <div class="flex flex1 mt--7 shrink0"> |
| | | <img |
| | | src="../../assets/img/home/Shape@2x (5).png" |
| | | class="w--31 h--30 shrink0" |
| | | /> |
| | | <div class="ml--7 SHSR shrink0"> |
| | | <div class="color2 fs--14 lh--14">已检查</div> |
| | | </div> |
| | | </div> |
| | | <div class="c-fff fs--22 lh--22 SHSBold"> |
| | | {{ screenData.inspectedCount }} |
| | | </div> |
| | | </div> |
| | | <div |
| | | class="mt--10 flex a-center j-between bgcolor2 pl--9 pb--5 pt--4 pr--10" |
| | | > |
| | | <div class="flex flex1 mt--7 shrink0"> |
| | | <img |
| | | src="../../assets/img/home/Shape@2x (5).png" |
| | | class="w--30 h--30 shrink0" |
| | | /> |
| | | <div class="ml--7 SHSR shrink0"> |
| | | <div class="color2 fs--14 lh--14">未检查</div> |
| | | </div> |
| | | </div> |
| | | <div class="c-fff fs--22 lh--22 SHSBold"> |
| | | {{ screenData.uninspectedCount }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </TitleBox> |
| | | </div> |
| | | <!-- 设备数据总览 --> |
| | | <div |
| | | class="mt--25" |
| | | v-if="activeTab == 1 && permissionClient.includes('3')" |
| | |
| | | src="../../assets/img/home/Shape@2x (2).png" |
| | | class="w--8 h--10 shrink0 mr--7" |
| | | /> |
| | | <div class="SHSN fs--12 lh--12"> |
| | | <div class="SHSN fs--14 lh--14"> |
| | | {{ item.province + item.city + item.area }} |
| | | </div> |
| | | </div> |
| | |
| | | src="../../assets/img/home/Shape@2x (3).png" |
| | | class="w--10 h--9 shrink0 mr--7" |
| | | /> |
| | | <div class="SHSN fs--12 lh--12">{{ item.time }}</div> |
| | | <div class="SHSN fs--14 lh--14">{{ item.time }}</div> |
| | | </div> |
| | | <div class="flex a-center"> |
| | | <img |
| | | src="../../assets/img/home/Shape@2x (1).png" |
| | | class="w--9 h--10 shrink0 mr--7" |
| | | /> |
| | | <div class="SHSN fs--12 lh--12"> |
| | | <div class="SHSN fs--14 lh--14"> |
| | | 伤亡:造成 |
| | | <span class="SHSBold fs--12">{{ |
| | | <span class="SHSBold fs--14">{{ |
| | | item.casualties |
| | | }}</span> |
| | | </div> |
| | |
| | | > |
| | | <el-carousel-item v-for="item in workListData" :key="item.id"> |
| | | <div @click="toWorkDetail(item)" class="cursor-pointer"> |
| | | <img :src="item.img.split(',')[0]" class="w100 h--290" /> |
| | | <img :src="VUE_APP_IMAGE_BASE_URL + item.img.split(',')[0]" class="w100 h--290" /> |
| | | <div |
| | | class="fs--18 lh--24 SHSBold py--10 pl--20 pr--14 c-fff" |
| | | > |
| | |
| | | searchTabs: ["本周", "本月", "本季度", "本年"], |
| | | activeTabs: "本周", |
| | | workListData: [], |
| | | VUE_APP_IMAGE_BASE_URL: process.env.VUE_APP_IMAGE_BASE_URL, |
| | | VUE_APP_IMAGE_BASE_URL: process.env.VUE_APP_IMAGE_BASE_URL + "/project/download/", |
| | | projectList: [], |
| | | tooltipVisible: false, |
| | | tooltipPos: { left: 0, top: 0 }, |
| | |
| | | }, |
| | | }, |
| | | created() { |
| | | if (localStorage.getItem("activeTab")) { |
| | | this.activeTab = Number(localStorage.getItem("activeTab")); |
| | | } |
| | | this.mapPromise = AMapLoader.load({ |
| | | key: "232929db1cb31f26d42b3645a7456154", |
| | | version: "2.0", |
| | |
| | | }); |
| | | }, |
| | | beforeDestroy() { |
| | | localStorage.setItem("activeTab", this.activeTab); |
| | | this.stopAutoScroll(); |
| | | }, |
| | | methods: { |
| | |
| | | <img |
| | | v-for="(item, index) in detailData.img.split(',')" |
| | | :key="index" |
| | | style="width: 100%; height: 100%" |
| | | :src="item" |
| | | :src="VUE_APP_IMAGE_BASE_URL + item" |
| | | /> |
| | | </div> |
| | | </div> |
| | |
| | | data() { |
| | | return { |
| | | detailData: {}, |
| | | VUE_APP_IMAGE_BASE_URL: process.env.VUE_APP_IMAGE_BASE_URL + '/project/download/' |
| | | }; |
| | | }, |
| | | computed: {}, |
| | |
| | | <div class="SHSR fs--16 lh--16 mb--17 color1">工作图片:</div> |
| | | <div class=""> |
| | | <el-upload |
| | | :action="VUE_APP_BASE_URL + '/open/file/upload'" |
| | | :action="VUE_APP_BASE_URL + '/work-presentation/upload'" |
| | | :headers="uploadHeaders" |
| | | :before-upload="beforeUpload" |
| | | :limit="5" |
| | |
| | | ...this.formData, |
| | | clientId: localStorage.getItem("clientId"), |
| | | }; |
| | | obj.img = this.fileList.map((item) => item.url).join(","); |
| | | obj.img = this.fileList |
| | | .map((item) => item.url.substring(item.url.lastIndexOf("/") + 1)) |
| | | .join(","); |
| | | let api = obj.id ? updateWorkPresentation : addWorkPresentation; |
| | | api(obj).then((res) => { |
| | | this.closeForm(); |
| | |
| | | }, |
| | | |
| | | handleSuccess(response, file, fileList) { |
| | | this.fileList.push({ |
| | | url: process.env.VUE_APP_IMAGE_BASE_URL + response.data, |
| | | }); |
| | | this.$message.success("上传成功"); |
| | | if (response.code == 200) { |
| | | this.fileList.push({ |
| | | url: |
| | | process.env.VUE_APP_IMAGE_BASE_URL + |
| | | "/project/download/" + |
| | | response.data.split(".")[0], |
| | | }); |
| | | this.$message.success("上传成功"); |
| | | } else { |
| | | this.$message.error(response.msg); |
| | | } |
| | | }, |
| | | |
| | | beforeUpload(file) { |
| | |
| | | this.formData = { ...row }; |
| | | this.fileList = row.img.split(",").map((item) => { |
| | | return { |
| | | url: item, |
| | | url: process.env.VUE_APP_IMAGE_BASE_URL + "/project/download/" + item, |
| | | }; |
| | | }); |
| | | this.formVisible = true; |