123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504 |
- <template>
- <div class="box">
- <div class="condition">
- <div class="header">
- <el-button style="float:left;" size="small" type="default" icon="el-icon-back" @click="goBack"></el-button>
- <span>{{params.Name}}</span>
- </div>
- <el-row class="spaceTypes">
- <div class="types">
- <el-tabs v-model="activeTab" type='card'>
- <template v-for="(item,index) in tabsList">
- <el-tab-pane :name="item.Code" :key="index" :label="item.Name"></el-tab-pane>
- </template>
- </el-tabs>
- </div>
- <div class="deleBtn">
- <el-button size="small" @click="deleteSystem">删除系统</el-button>
- </div>
- </el-row>
- <div v-if="activeTab=='detail'" class="content">
- <div class="content-left">
- <div class="content-showType">
- <selectRadio
- :selectRadio="selectRadio"
- @changeRadio="changeRadio"
- />
- </div>
- <div class="content-point">
- <div class="content-point-left">
- <el-scrollbar style="height:100%;">
- <div>
- <exhibitionBaseInformation :exhibitionBaseInformation="exhibitionBaseInformation"/>
- </div>
- </el-scrollbar>
- </div>
- </div>
- </div>
- <div class="content-right">
- <div class="content-repair">
- <exhibitionMaintain :exhibitionMaintain="exhibitionMaintain"/>
- </div>
- <div class="content-media">
- <el-scrollbar style="height:100%;">
- <div>
- <exhibitionImage :exhibitionImage="exhibitionImage"/>
- <exhibitionVideo :exhibitionVideo="exhibitionVideo"/>
- <exhibitionFile :exhibitionFile="exhibitionFile"/>
- </div>
- </el-scrollbar>
- </div>
- </div>
- </div>
- <!-- 系统内设备 -->
- <deviceTable v-if="activeTab=='Equipment'" :params="params" :type="activeTab"></deviceTable>
- <!-- 系统所在竖井 -->
- <cenoteTable v-else-if="activeTab=='cenote'" :params="params" :type="activeTab"></cenoteTable>
- <!-- 系统所在业务空间 -->
- <spaceTable v-else-if="activeTab=='space'" :params="params" :type="activeTab" :spaceType="spaceType" :floorType="floorType"></spaceTable>
- </div>
- </div>
- </template>
- <script>
- import {mapGetters} from "vuex";
- import {
- buildingQuery,
- deleteGeneralSys,
- getDataDictionary,
- queryDictionaryHead,
- queryLinkSys
- } from '@/api/scan/request';
- import cenoteTable from '@/components/ledger/system/table/cenoteTable';
- import deviceTable from '@/components/ledger/system/table/deviceTable';
- import spaceTable from '@/components/ledger/system/table/spaceTable';
- import exhibitionBaseInformation from "@/components/ledger/details/detail/exhibitionBaseInformation";
- import exhibitionFile from "@/components/ledger/details/detail/exhibitionFile";
- import exhibitionImage from "@/components/ledger/details/detail/exhibitionImage";
- import selectRadio from "@/components/ledger/details/detail/selectRadio";
- import exhibitionMaintain from "@/components/ledger/details/detail/exhibitionMaintain";
- import exhibitionVideo from "@/components/ledger/details/detail/exhibitionVideo";
- import tools from "@/utils/scan/tools"
- export default {
- data() {
- return {
- params: {}, //参数-包含系统id 分区类型
- tabsList: [
- {Code: 'detail', Name: '系统详情'},
- {Code: 'Equipment', Name: '系统内设备'},
- {Code: 'cenote', Name: '系统所在竖井'},
- {Code: 'space', Name: '系统所在业务空间'},
- ], //tab页
- activeTab: 'detail', //当前选中的tab
- pointData: [], //信息点数据
- exampleData: {}, //实例数据
- spaceType: {},//空间种类
- floorType: {},
- currentRadio: '',//当前选中的select
- selectRadio: {
- information: '设备信息点',
- initRadio: '1',
- radioList: [
- {
- value: '显示需采集信息点',
- label: '1'
- },
- {
- value: '显示有值信息点',
- label: '2'
- },
- {
- value: '显示全部信息点',
- label: '3'
- }
- ]
- },
- exhibitionBaseInformation: {
- information: {},
- style: 3
- },
- exhibitionEnergy: {
- title: '能耗信息',
- dynamic: [],
- },
- exhibitionMaintain: {
- title: '维修/维保记录'
- },
- exhibitionFile: {
- title: '文件',
- list: {}
- },
- exhibitionCrux: {
- title: '关键信息点:',
- cruxArray: [],
- allMessage: [],//全部信息点
- },
- exhibitionImage: {
- title: '图片',
- list: {}
- },
- exhibitionVideo: {
- title: '视频',
- list: {}
- },
- instance: {},//实例信息处理
- }
- },
- computed: {
- ...mapGetters("layout", ["projectId", "userId", "secret"])
- },
- components: {
- cenoteTable,
- deviceTable,
- spaceTable,
- exhibitionBaseInformation,
- exhibitionFile,
- exhibitionImage,
- selectRadio,
- exhibitionMaintain,
- exhibitionVideo
- },
- created() {
- this.params = this.$route.query;
- this.getData();
- let pa = {
- Filters: `parentId='Space'`
- }
- queryDictionaryHead(pa, res => {
- res.Content.map(t => {
- if (t.Name != "元空间") {
- this.spaceType[t.Code] = t.Name;
- }
- })
- });
- let param = {
- Cascade: [
- { Name: "floor" }
- ]
- };
- buildingQuery(param, res => {
- res.Content.map(item => {
- if (item.BuildID && item.BuildLocalName) {
- this.floorType[item.BuildID] = item.BuildLocalName;
- if (item.Floor instanceof Array) {
- item.Floor.map(f => {
- if (f.FloorID && f.FloorLocalName) {
- this.floorType[f.FloorID] = f.FloorLocalName;
- }
- })
- }
- }
- });
- });
- },
- mounted() { },
- watch: {
- projectId() { }
- },
- methods: {
- // 返回
- goBack() {
- this.$router.push({
- name: "systemlist",
- params: this.params
- })
- },
- // 获取表头和实例数据
- getData () {
- let params1 = {
- data: {
- Orders: "sort asc",
- PageNumber: 1,
- PageSize: 1000
- },
- type: this.params.SysType
- }, params2 = {
- Filters: `SysID='${this.params.SysID}'`,
- };
- let promise1 = new Promise((resolve, reject) => {
- getDataDictionary(params1, res => {
- resolve(res)
- })
- })
- let promise2 = new Promise((resolve, reject) => {
- queryLinkSys(params2, res => {
- resolve(res)
- })
- })
- Promise.all([promise1, promise2]).then(values => {
- this.pointData = values[0].Content;
- this.exampleData = values[1].Content[0];
- let obj = this.deepCopy(values[1].Content[0]);
- obj = tools.flattenKeys(obj);
- this.instance = obj;
- this.handleRadios(1)
- })
- },
- deepCopy(obj) {
- return JSON.parse(JSON.stringify(obj))
- },
- handleRadios(val) { //判断radio的值显示关键信息,基本信息,图片,文件
- let arr = []
- if (val == 1) { //需采集信息
- arr = this.pointData.filter(i => i.Visible)
- // 图片和的处理
- this.handlePicList(arr)
- // 文件处理
- this.handleFileList(arr)
- } else if (val == 2) { //有值信息点
- let list = this.pointData
- list.map(j => {
- if (this.exampleData.hasOwnProperty(j.Path)) {
- return {
- ...j,
- value: this.exampleData[j.Path]
- }
- }
- arr = list.filter(k => k.value)
- this.handlePicList(arr)
- this.handleFileList(arr)
- })
- } else { //全部信息点
- arr = this.pointData
- this.handlePicList(arr)
- this.handleFileList(arr)
- }
- this.displayData(arr)
- },
- handlePicList(arr) {
- let picObject = {}
- //处理数据格式
- arr.map(i => {
- if(i.InputMode == 'F2') {
- switch (i.Path) {
- case 'LedgerParam.PhotoDoc.Drawing':
- case 'LedgerParam.Siteinstall.InstallPic':
- case 'LedgerParam.Siteinstall.InstallDrawing':
- case 'LedgerParam.PhotoDoc.Nameplate':
- if (this.instance.hasOwnProperty(i.Path)) {
- i.PicList = this.instance[i.Path]
- }
- if (picObject[i.InfoPointName]) {
- } else {
- picObject[i.InfoPointName] = []
- }
- picObject[i.InfoPointName].push({
- ...i,
- })
- break;
- }
- }
- })
- //展示图片
- this.exhibitionImage.list = picObject
- },
- handleFileList(arr) {
- let picObject = {}
- //处理数据格式
- arr.map(i => {
- if (i.InputMode == 'F2') {
- switch (i.Path) {
- case 'LedgerParam.InsuranceDoc.InsuranceFile':
- case 'LedgerParam.PhotoDoc.Archive':
- case 'LedgerParam.Siteinstall.CheckReport':
- if (this.instance.hasOwnProperty(i.Path)) {
- i.fileList = this.instance[i.Path]
- }
- if (picObject[i.InfoPointName]) {
- } else {
- picObject[i.InfoPointName] = []
- }
- picObject[i.InfoPointName].push({
- ...i,
- })
- break
- }
- }
- })
- //展示文件
- this.exhibitionFile.list = picObject
- },
- changeRadio(val) { //1,需采集,2,有值,3,全部
- this.handleRadios(val)
- this.currentRadio = val
- },
- displayData(arr) {//对数据进行处理传给组件展示
- const result = {}
- arr.forEach(i => {
- if (this.exampleData.hasOwnProperty(i.Path) && this.currentRadio != 2) {
- i.value = this.exampleData[i.Path]
- }
- switch (i.InputMode) {
- case "L":
- case "L1":
- case "L2":
- case "M":
- break;
- default:
- if (result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`]) {
- result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`].paths.push({
- Path: i.Path,
- InfoPointName: i.InfoPointName,
- InfoPointCode: i.InfoPointCode,
- Value: i.value,
- Visible: i.Visible,
- KeyWord: i.KeyWord
- })
- } else {
- result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`] = {
- paths: [{
- Path: i.Path,
- InfoPointName: i.InfoPointName,
- InfoPointCode: i.InfoPointCode,
- Value: i.value,
- Visible: i.Visible,
- KeyWord: i.KeyWord
- }]
- }
- }
- }
- })
- this.exhibitionBaseInformation.information = result
- this.exhibitionCrux.allMessage = result
- },
- // 删除系统
- deleteSystem() {
- this.$confirm("此操作将删除系统,是否继续?", "提示", {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let pa = [{
- SysID: this.exampleData.SysID
- }]
- this.removeSys(pa)
- }).catch(() => {
- this.$message("取消删除")
- })
- },
- async removeSys(param) {
- await deleteGeneralSys(param, res => {
- this.$message.success("删除成功")
- this.goBack()
- })
- },
- }
- };
- </script>
- <style scoped lang='less'>
- .box {
- .condition {
- padding: 10px;
- display: flex;
- height: 100%;
- flex-direction: column;
- border: 1px solid #dfe6ec;
- background: #fff;
- box-sizing: border-box;
- .header {
- padding-bottom: 10px;
- span {
- line-height: 33px;
- margin-left: 15px;
- }
- }
- .spaceTypes {
- .types {
- float: left;
- width: calc(100% - 200px);
- /deep/ .el-tabs__item.is-top {
- border-top: 2px solid transparent;
- &.is-active {
- border-top: 2px solid #409eff;
- }
- }
- }
- .deleBtn {
- float: left;
- width: 200px;
- text-align: right;
- height: 40px;
- border-bottom: 1px solid #e4e7ed;
- }
- }
- .content {
- display: flex;
- flex-direction: row;
- box-sizing: border-box;
- height: calc(100% - 99px);
- .content-left {
- display: flex;
- flex-direction: column;
- flex: 1;
- .content-showType {
- height: 50px;
- border: 1px solid #ccc;
- border-bottom: none;
- box-sizing: border-box;
- }
- .content-point {
- display: flex;
- flex-direction: row;
- height: calc(100% - 50px);
- border: 1px solid #ccc;
- box-sizing: border-box;
- .content-point-left {
- flex: 1;
- }
- }
- }
- .content-right {
- width: 400px;
- margin-left: 10px;
- .content-repair {
- height: 50px;
- line-height: 50px;
- margin-bottom: 10px;
- border: 1px solid #ccc;
- box-sizing: border-box;
- }
- .content-media {
- height: calc(100% - 60px);
- border: 1px solid #ccc;
- box-sizing: border-box;
- }
- }
- }
- .main {
- margin-top: 10px;
- height: calc(100% - 96px);
- }
- .footer {
- margin-bottom: 10px;
- }
- /deep/ .el-scrollbar__wrap {
- overflow-x: hidden;
- }
- }
- }
- </style>
- <style lang="less">
- .el-table th {
- background-color: #d9d9d9;
- color: #000;
- }
- </style>
|