2019-11-29 15:00:26 +08:00
|
|
|
|
<template>
|
2020-01-19 18:31:18 +08:00
|
|
|
|
<div class="asset" ref="asset">
|
2020-01-02 18:13:01 +08:00
|
|
|
|
<div class="content-left">
|
2020-02-21 17:14:46 +08:00
|
|
|
|
<div class="sidebar-title">{{$t('asset.asset')}}</div>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
<div class="sidebar-info">
|
|
|
|
|
|
<!--<div class="sidebar-info-header">ALL</div>-->
|
2020-01-15 22:21:19 +08:00
|
|
|
|
<el-checkbox :indeterminate="checkAllHandler" class="sidebar-info-item" v-model="checkAllFlag" @change="dcSelectAll" :true-label="1" :false-label="0">
|
2020-01-15 10:17:36 +08:00
|
|
|
|
<div class="sidebar-info-item-txt" style="font-weight: bold;">All</div>
|
2020-01-10 20:09:33 +08:00
|
|
|
|
</el-checkbox>
|
2020-01-15 22:21:19 +08:00
|
|
|
|
<el-checkbox-group v-model="checkList" size="small" @change="changeCheckBox">
|
|
|
|
|
|
<el-checkbox class="sidebar-info-item" :class="{'sidebar-info-item-active': indOf(checkList, item.id)}"
|
2020-01-02 18:13:01 +08:00
|
|
|
|
v-for="(item,key) in checkListData" :key="key" :label=item.id>
|
2020-01-17 16:06:35 +08:00
|
|
|
|
<div class="sidebar-info-item-txt">
|
2020-01-19 19:50:12 +08:00
|
|
|
|
<el-popover v-if="item.name.length > 16" trigger="hover" placement="top-start" :content="item.name" >
|
2020-01-17 16:06:35 +08:00
|
|
|
|
<span slot="reference">{{item.name}}</span>
|
|
|
|
|
|
</el-popover>
|
2020-01-19 19:34:38 +08:00
|
|
|
|
<span v-else>{{item.name}}</span>
|
2020-01-17 16:06:35 +08:00
|
|
|
|
</div>
|
2020-01-16 17:54:04 +08:00
|
|
|
|
|
2020-02-21 17:14:46 +08:00
|
|
|
|
<!-- <idc-config-box ref="idcConfigBox" :post-idc="item" placement="left" @after="getIDCOptionData" :button-class="'checkbox-edit'" :user-data="idcUserData">-->
|
|
|
|
|
|
<!-- <template v-slot:optionZone>-->
|
|
|
|
|
|
<!-- <span @click="closeAllPop">-->
|
|
|
|
|
|
<!-- <i class="nz-icon nz-icon-edit" @click="getSingleIDCData(item.id,'edit')"></i>-->
|
|
|
|
|
|
<!-- </span>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </idc-config-box>-->
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</el-checkbox>
|
|
|
|
|
|
</el-checkbox-group>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2020-01-03 18:10:26 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
<div class="content-right">
|
|
|
|
|
|
<div class="top-tools">
|
2020-02-03 21:30:07 +08:00
|
|
|
|
<div></div>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<button @click.stop="tagShow('showAdd')" class="nz-btn nz-btn-size-normal nz-btn-style-light float-right nz-btn-min-width-82" id="asset-add">
|
|
|
|
|
|
<span class="top-tool-btn-txt">
|
|
|
|
|
|
<i class="nz-icon-create-square nz-icon"></i>
|
|
|
|
|
|
{{$t('overall.add')}}</span>
|
|
|
|
|
|
<!-- ADD按钮 -->
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<div class="top-tool-search float-right"><search-input :searchMsg="searchMsg" @search="search"></search-input></div>
|
|
|
|
|
|
</div>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
2020-01-03 18:10:26 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
<el-table
|
2020-01-21 11:29:38 +08:00
|
|
|
|
class="nz-table"
|
2020-02-14 18:01:48 +08:00
|
|
|
|
height="calc(100% - 160px)"
|
2020-01-02 18:13:01 +08:00
|
|
|
|
style="width: 100%;"
|
|
|
|
|
|
:data="tableData"
|
|
|
|
|
|
border
|
2020-01-19 18:31:18 +08:00
|
|
|
|
tooltip-effect="light"
|
2020-01-02 18:13:01 +08:00
|
|
|
|
>
|
|
|
|
|
|
<el-table-column
|
2020-01-19 18:31:18 +08:00
|
|
|
|
:resizable="false"
|
2020-01-08 22:19:46 +08:00
|
|
|
|
v-for="(item, index) in tablelable"
|
2020-01-02 18:13:01 +08:00
|
|
|
|
v-if="item.show"
|
2020-01-06 20:57:49 +08:00
|
|
|
|
:width="item.width"
|
2020-01-02 18:13:01 +08:00
|
|
|
|
:key="`col_${index}`"
|
|
|
|
|
|
:label="item.label"
|
2020-02-17 18:41:38 +08:00
|
|
|
|
:fixed="item.fixed"
|
2020-01-19 18:31:18 +08:00
|
|
|
|
:show-overflow-tooltip="item.prop != 'Alert' || item.prop != 'Module'"
|
|
|
|
|
|
min-width="110px"
|
2020-02-11 12:58:40 +08:00
|
|
|
|
:class-name="item.prop == 'option' ? 'content-right-options' : ''"
|
2020-01-02 18:13:01 +08:00
|
|
|
|
>
|
|
|
|
|
|
<template slot-scope="scope" :column="item">
|
|
|
|
|
|
<div v-if="item.prop=='ID'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{scope.row.id}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
2020-01-16 15:48:49 +08:00
|
|
|
|
<div v-if="item.prop=='assetType'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{scope.row.model.type.value}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
2020-01-19 18:31:18 +08:00
|
|
|
|
<template v-if="item.prop=='SN'">{{scope.row.sn}}</template>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
<div v-if="item.prop=='HOST'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{scope.row.host}}</span>
|
2019-12-06 15:53:50 +08:00
|
|
|
|
</div>
|
2020-01-09 14:57:44 +08:00
|
|
|
|
<div v-if="item.prop=='state'">
|
2020-01-06 20:57:49 +08:00
|
|
|
|
<span>{{scope.row.state==1 ? $t('asset.createAssetTab.inStock') : $t('asset.createAssetTab.notInStock')}}</span>
|
2019-12-11 17:11:44 +08:00
|
|
|
|
</div>
|
2020-02-07 11:22:08 +08:00
|
|
|
|
<div v-if="item.prop == 'pingStatus'">
|
2020-02-06 17:44:07 +08:00
|
|
|
|
<el-popover
|
|
|
|
|
|
placement="right"
|
2020-02-11 19:55:20 +08:00
|
|
|
|
width="50"
|
2020-02-06 17:44:07 +08:00
|
|
|
|
trigger="hover"
|
2020-02-17 18:41:38 +08:00
|
|
|
|
:content="scope.row.pingRtt ? (scope.row.pingLastUpdate&&scope.row.pingLastUpdate!=''?(new Date(scope.row.pingLastUpdate).getHours()+':'+new Date(scope.row.pingLastUpdate).getMinutes()):'--')+'['+ scope.row.pingRtt+'ms'+']':(scope.row.pingLastUpdate&&scope.row.pingLastUpdate!=''?(new Date(scope.row.pingLastUpdate).getHours()+':'+new Date(scope.row.pingLastUpdate).getMinutes()):'--')+'[unreachable]'">
|
2020-02-07 11:22:08 +08:00
|
|
|
|
<div slot="reference" style="width: 20px">
|
|
|
|
|
|
<div :class="{'active-icon green':scope.row.pingState == 1,'active-icon red':scope.row.pingState == 0}"></div>
|
|
|
|
|
|
</div>
|
2020-02-06 17:44:07 +08:00
|
|
|
|
</el-popover>
|
|
|
|
|
|
</div>
|
2020-01-19 18:31:18 +08:00
|
|
|
|
<template v-if="item.prop=='Module'">
|
|
|
|
|
|
<template v-if="scope.row.moduleNum > 0" >
|
2020-01-16 11:33:30 +08:00
|
|
|
|
<module-list-pop :asset-id="scope.row.id + ''" @openModuleBox="openModuleBox" placement="left" :ref="'moduleListPop' + scope.row.id">
|
2020-01-10 20:09:33 +08:00
|
|
|
|
<template v-slot:optionZone>
|
2020-02-17 18:41:38 +08:00
|
|
|
|
<!-- <button class="nz-btn nz-btn-size-normal nz-btn-style-light nz-btn-min-width-75">{{scope.row.moduleNum}}</button>-->
|
|
|
|
|
|
<span class="clickable">{{scope.row.moduleNum}}</span>
|
2020-01-10 20:09:33 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</module-list-pop>
|
2020-01-19 18:31:18 +08:00
|
|
|
|
</template>
|
2020-02-17 18:41:38 +08:00
|
|
|
|
<!-- <button type="button" v-else class="nz-btn nz-btn-size-normal nz-btn-style-light nz-btn-min-width-75 nz-btn-disabled">{{scope.row.moduleNum}}</button>-->
|
|
|
|
|
|
<span v-else class="unclickable">{{scope.row.moduleNum}}</span>
|
2020-01-19 18:31:18 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<template v-if="item.prop=='Alert'">
|
2020-02-17 18:41:38 +08:00
|
|
|
|
<!-- <button type="button" v-if="scope.row.alertNum > 0" id="'asset-alerts-'+scope.row.id" @click="jumpToAlertMsg(scope.row.id)" class="nz-btn nz-btn-size-normal nz-btn-style-light nz-btn-min-width-75">{{scope.row.alertNum}}</button>-->
|
|
|
|
|
|
<!-- <button type="button" v-else class="nz-btn nz-btn-size-normal nz-btn-style-light nz-btn-min-width-75 nz-btn-disabled">{{scope.row.alertNum}}</button>-->
|
|
|
|
|
|
<span v-if="scope.row.alertNum > 0" id="'asset-alerts-'+scope.row.id" @click="jumpToAlertMsg(scope.row.id)" class="clickable">{{scope.row.alertNum}}</span>
|
|
|
|
|
|
<span v-else class="unclickable">{{scope.row.alertNum}}</span>
|
2020-01-19 18:31:18 +08:00
|
|
|
|
</template>
|
2020-01-09 14:57:44 +08:00
|
|
|
|
<div v-if="item.prop=='dataCenter'">
|
2020-02-21 17:14:46 +08:00
|
|
|
|
<!-- <idc-config-box :post-idc="JSON.parse(JSON.stringify(scope.row.idc))" ref="idcConfigBox" :is-edit="false" placement="left" @after="getAssetData(null, true)" :button-class="'checkbox-edit'" :user-data="idcUserData">-->
|
|
|
|
|
|
<!-- <template v-slot:optionZone>-->
|
|
|
|
|
|
<!--<!– <span class="link" @click="closeAllPop">{{scope.row.idc.name}}</span>–>-->
|
|
|
|
|
|
<!-- <span class="clickable" @click="closeAllPop">{{scope.row.idc.name}}</span>-->
|
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
<!-- </idc-config-box>-->
|
|
|
|
|
|
<span >{{scope.row.idc.name}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
2020-01-19 18:31:18 +08:00
|
|
|
|
<template v-if="item.prop=='cabinet'">
|
2020-02-21 17:14:46 +08:00
|
|
|
|
<!-- <cabinet-config-box v-if="scope.row.cabinet&&scope.row.cabinet!='--'" ref="cabinetConfigBox" placement="left" :is-edit="false" :post-cabinet="JSON.parse(JSON.stringify(scope.row.cabinet))" @after="getAssetData(null, true)" :post-idc-datas="IDCOptionData">-->
|
|
|
|
|
|
<!--<!– <span slot="optionZone" @click="closeAllPop" class="link">{{returnData(scope.row.cabinet)}}</span>–>-->
|
|
|
|
|
|
<!-- <span class="clickable" slot="optionZone" @click="closeAllPop" >{{returnData(scope.row.cabinet).name}}</span>-->
|
|
|
|
|
|
<!-- </cabinet-config-box>-->
|
|
|
|
|
|
<span v-if="scope.row.cabinet&&scope.row.cabinet!='--'">{{returnData(scope.row.cabinet).name}}</span>
|
|
|
|
|
|
<!-- <span v-else class="unclickable">{{returnData(scope.row.cabinet)}}</span>-->
|
|
|
|
|
|
<span v-else >{{returnData(scope.row.cabinet)}}</span>
|
2020-01-19 18:31:18 +08:00
|
|
|
|
</template>
|
2020-01-09 14:57:44 +08:00
|
|
|
|
<div v-if="item.prop=='model'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{scope.row.model.name}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
2020-01-09 14:57:44 +08:00
|
|
|
|
<div v-if="item.prop=='vendor'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{scope.row.model.vendor.value}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
2020-01-16 15:48:49 +08:00
|
|
|
|
<div v-if="item.prop=='purchaseDate'">
|
2020-02-17 18:41:38 +08:00
|
|
|
|
<span>{{returnData(scope.row.purchaseDate)}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
2020-01-09 14:57:44 +08:00
|
|
|
|
<div v-if="item.prop=='principal'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{getPrincipalName(scope.row.idc.principal)}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
2020-01-09 14:57:44 +08:00
|
|
|
|
<div v-if="item.prop=='tel'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{scope.row.idc.tel}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
2020-02-11 12:58:40 +08:00
|
|
|
|
<template v-if="item.prop == 'option'">
|
2020-02-17 18:41:38 +08:00
|
|
|
|
<span :title="$t('overall.view')" @click.stop="tagShow('showView',scope.row.id)" class="content-right-option" :id="'asset-detail-'+scope.row.id"><i
|
|
|
|
|
|
class="el-icon-view"></i>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
<span :title="$t('overall.edit')" @click.stop="tagShow('showEdit',scope.row.id)" class="content-right-option" :id="'asset-edit-'+scope.row.id"><i
|
|
|
|
|
|
class="nz-icon nz-icon-edit"></i>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
<span :title="$t('overall.delete')" @click.stop="deleteData('asset',scope.row.id)" class="content-right-option" :id="'asset-del-'+scope.row.id"><i
|
|
|
|
|
|
class="el-icon-delete"></i>
|
2020-01-16 18:11:15 +08:00
|
|
|
|
</span>
|
2020-02-17 18:41:38 +08:00
|
|
|
|
|
|
|
|
|
|
<span title="CLI" @click="ssss(scope.row.id ,scope.row.host)" class="content-right-option" :id="'asset-ssh-'+scope.row.id"><i
|
|
|
|
|
|
class="nz-icon nz-icon-cli"></i>
|
2020-01-06 20:57:49 +08:00
|
|
|
|
</span>
|
2020-02-11 12:58:40 +08:00
|
|
|
|
</template>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2020-02-18 11:05:57 +08:00
|
|
|
|
<el-table-column width="28" fixed="right">
|
|
|
|
|
|
<template slot="header" slot-scope="scope">
|
|
|
|
|
|
<span @click.stop="elementsetShow('shezhi',$event)" class="nz-table-gear">
|
|
|
|
|
|
<i class="nz-icon nz-icon-gear"></i>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</el-table>
|
|
|
|
|
|
<Pagination :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
|
2019-11-29 15:00:26 +08:00
|
|
|
|
</div>
|
2020-01-06 20:57:49 +08:00
|
|
|
|
|
2020-02-20 10:47:37 +08:00
|
|
|
|
<asset-add-unit :add-unit-show='addUnitShow' @refreshData="flushData" ref="assetAddUnit"
|
|
|
|
|
|
@sendStateData="tabControl"></asset-add-unit>
|
|
|
|
|
|
<asset-edit-unit :edit-unit-show='editUnitShow' @refreshData="flushData" @sendStateData="tabControl"
|
|
|
|
|
|
ref="assetEditUnit"></asset-edit-unit>
|
|
|
|
|
|
<!--<asset-box :edit-unit-show='editUnitShow' @refreshData="flushData" @sendStateData="tabControl"
|
|
|
|
|
|
ref="assetEditUnit"></asset-box>-->
|
2020-01-08 22:19:46 +08:00
|
|
|
|
<element-set
|
|
|
|
|
|
v-clickoutside="elementsetHide"
|
2020-01-16 15:48:49 +08:00
|
|
|
|
:drop-col="dropCol"
|
|
|
|
|
|
:table-title="tableTitle"
|
2020-01-08 22:19:46 +08:00
|
|
|
|
@tablelable="tablelabelEmit"
|
|
|
|
|
|
ref="elementset"
|
|
|
|
|
|
></element-set>
|
2020-01-09 19:30:43 +08:00
|
|
|
|
<module-box :module="module" @reload="getAssetData" ref="moduleBox"></module-box>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
2019-11-29 15:00:26 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2020-02-11 11:30:56 +08:00
|
|
|
|
import bus from "../../../libs/bus";
|
2020-01-02 18:13:01 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: "asset",
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2020-01-03 18:10:26 +08:00
|
|
|
|
searchMsg: { //给搜索框子组件传递的信息
|
|
|
|
|
|
zheze_none: true,
|
|
|
|
|
|
searchLabelList: [{
|
|
|
|
|
|
id: 1,
|
|
|
|
|
|
name: 'ID',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
label: 'id',
|
|
|
|
|
|
disabled: false
|
|
|
|
|
|
},{
|
|
|
|
|
|
id: 20,
|
|
|
|
|
|
name: 'SN',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
label: 'sn',
|
|
|
|
|
|
disabled: false
|
|
|
|
|
|
},{
|
|
|
|
|
|
id: 21,
|
|
|
|
|
|
name: 'Host',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
label: 'host',
|
|
|
|
|
|
disabled: false
|
2020-01-09 14:57:44 +08:00
|
|
|
|
},{
|
|
|
|
|
|
id: 22,
|
|
|
|
|
|
name: this.$t("asset.createAssetTab.state"),
|
|
|
|
|
|
type: 'select',
|
|
|
|
|
|
label: 'assetState',
|
|
|
|
|
|
disabled: false
|
2020-02-06 17:44:07 +08:00
|
|
|
|
},{
|
|
|
|
|
|
id: 22,
|
|
|
|
|
|
name: "pingStatus",
|
|
|
|
|
|
type: 'select',
|
|
|
|
|
|
label: 'pingStatus',
|
|
|
|
|
|
disabled: false
|
2020-01-03 18:10:26 +08:00
|
|
|
|
}],
|
|
|
|
|
|
},
|
|
|
|
|
|
searchLabel: {}, //搜索参数
|
2020-01-02 18:13:01 +08:00
|
|
|
|
checkList: [],
|
2020-01-08 22:19:46 +08:00
|
|
|
|
tablelable: [],
|
|
|
|
|
|
dropCol: [],
|
2020-01-02 18:13:01 +08:00
|
|
|
|
tableTitle: [
|
2020-02-17 18:41:38 +08:00
|
|
|
|
{
|
|
|
|
|
|
label: this.$t("asset.tableTitle.host"),
|
|
|
|
|
|
prop: 'HOST',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
width: 130,
|
|
|
|
|
|
fixed:'left'
|
|
|
|
|
|
},
|
2020-01-02 18:13:01 +08:00
|
|
|
|
{
|
|
|
|
|
|
label: this.$t("asset.tableTitle.id"),
|
|
|
|
|
|
prop: 'ID',
|
2020-01-08 09:16:34 +08:00
|
|
|
|
show: true,
|
2020-01-19 18:31:18 +08:00
|
|
|
|
width: 110
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.assetType"),
|
2020-01-16 15:48:49 +08:00
|
|
|
|
prop: 'assetType',
|
2020-01-02 18:13:01 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.device"),
|
|
|
|
|
|
prop: 'SN',
|
|
|
|
|
|
show: true,
|
2020-01-17 16:06:35 +08:00
|
|
|
|
width: 130
|
2020-02-17 18:41:38 +08:00
|
|
|
|
}, {
|
2020-01-02 18:13:01 +08:00
|
|
|
|
label: this.$t("asset.tableTitle.assetState"),
|
2020-01-09 14:57:44 +08:00
|
|
|
|
prop: 'state',
|
2020-01-02 18:13:01 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
2020-02-06 17:44:07 +08:00
|
|
|
|
label:this.$t('asset.tableTitle.assetPing'),
|
2020-02-07 11:22:08 +08:00
|
|
|
|
prop:'pingStatus',
|
2020-02-06 17:44:07 +08:00
|
|
|
|
show:true,
|
|
|
|
|
|
},{
|
2020-01-10 20:09:33 +08:00
|
|
|
|
label: this.$t("asset.tableTitle.modules"),
|
2020-01-02 18:13:01 +08:00
|
|
|
|
prop: 'Module',
|
|
|
|
|
|
show: true,
|
2020-01-19 18:31:18 +08:00
|
|
|
|
width: 105
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}, {
|
2020-01-09 14:57:44 +08:00
|
|
|
|
label: this.$t("asset.tableTitle.alerts"),
|
2020-01-02 18:13:01 +08:00
|
|
|
|
prop: 'Alert',
|
|
|
|
|
|
show: true,
|
2020-01-19 18:31:18 +08:00
|
|
|
|
width: 105
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.dataCenter"),
|
2020-01-09 14:57:44 +08:00
|
|
|
|
prop: 'dataCenter',
|
2020-01-02 18:13:01 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.cabinet"),
|
2020-01-09 14:57:44 +08:00
|
|
|
|
prop: 'cabinet',
|
2020-01-02 18:13:01 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.model"),
|
2020-01-09 14:57:44 +08:00
|
|
|
|
prop: 'model',
|
2020-01-02 18:13:01 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.manufacturer"),
|
2020-01-09 14:57:44 +08:00
|
|
|
|
prop: 'vendor',
|
2020-01-02 18:13:01 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.procurementDate"),
|
2020-01-16 15:48:49 +08:00
|
|
|
|
prop: 'purchaseDate',
|
2020-01-02 18:13:01 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.principal"),
|
2020-01-09 14:57:44 +08:00
|
|
|
|
prop: 'principal',
|
2020-01-02 18:13:01 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.principalTel"),
|
2020-01-09 14:57:44 +08:00
|
|
|
|
prop: 'tel',
|
2020-01-02 18:13:01 +08:00
|
|
|
|
show: true,
|
2020-01-10 20:09:33 +08:00
|
|
|
|
width: 115
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t('config.account.option'),
|
|
|
|
|
|
prop: 'option',
|
|
|
|
|
|
show: true,
|
2020-02-18 11:05:57 +08:00
|
|
|
|
width: 150,
|
2020-02-17 18:41:38 +08:00
|
|
|
|
fixed:'right'
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}],
|
|
|
|
|
|
tableData: [],
|
|
|
|
|
|
checkListData: [],
|
|
|
|
|
|
IDCData: '',
|
|
|
|
|
|
IDCOptionData: [],
|
|
|
|
|
|
cabinetData: '',
|
|
|
|
|
|
cabinetOptionData: [],
|
|
|
|
|
|
input: '',
|
|
|
|
|
|
pageObj: {
|
|
|
|
|
|
id: '',
|
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
|
pageSize: 20,
|
|
|
|
|
|
total: 0,
|
|
|
|
|
|
idcId: '',
|
|
|
|
|
|
idcIds: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
tableHeight: document.documentElement.clientHeight - 200,
|
|
|
|
|
|
tabShow: false,
|
|
|
|
|
|
tabView: true,
|
|
|
|
|
|
tagType: 'add',
|
2020-01-09 19:30:43 +08:00
|
|
|
|
module: {},
|
2020-01-02 18:13:01 +08:00
|
|
|
|
form: {
|
|
|
|
|
|
name: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
rightBox: { //弹出框相关
|
2019-12-12 17:07:33 +08:00
|
|
|
|
show: false,
|
2020-01-02 18:13:01 +08:00
|
|
|
|
isEdit: false, //false查看,true编辑
|
|
|
|
|
|
title: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
assetType: '',
|
|
|
|
|
|
idcSelectedData: {
|
|
|
|
|
|
id: '',
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
location: '',
|
|
|
|
|
|
principal: '',
|
|
|
|
|
|
tel: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
addIdcData: {
|
|
|
|
|
|
id: '',
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
popName: '',
|
|
|
|
|
|
location: '',
|
|
|
|
|
|
principal: '',
|
|
|
|
|
|
tel: ''
|
|
|
|
|
|
},
|
2020-02-06 12:35:29 +08:00
|
|
|
|
idcUserData: [],
|
2020-01-02 18:13:01 +08:00
|
|
|
|
modelCount: '',
|
|
|
|
|
|
isResourceShow: 0,
|
|
|
|
|
|
unitDisable: '',
|
|
|
|
|
|
modelClickData: '',
|
|
|
|
|
|
obj: null,
|
|
|
|
|
|
addUnitShow: false,
|
|
|
|
|
|
editUnitShow: false,
|
2020-01-13 21:42:14 +08:00
|
|
|
|
flag: false,
|
|
|
|
|
|
checkAllFlag: false,
|
2020-01-15 22:21:19 +08:00
|
|
|
|
checkAllHandler: false,
|
|
|
|
|
|
assetClick: false,
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-26 17:28:04 +08:00
|
|
|
|
},
|
2020-01-02 18:13:01 +08:00
|
|
|
|
computed: {
|
|
|
|
|
|
getData() {
|
|
|
|
|
|
return this.$store.state.assetData
|
2019-12-06 15:53:50 +08:00
|
|
|
|
},
|
2020-01-02 18:13:01 +08:00
|
|
|
|
getFlushData() {
|
|
|
|
|
|
return this.$store.state.flushDataSign
|
|
|
|
|
|
}
|
2019-12-06 15:53:50 +08:00
|
|
|
|
},
|
2020-01-02 18:13:01 +08:00
|
|
|
|
watch: {
|
|
|
|
|
|
getData: {
|
2020-01-08 09:16:34 +08:00
|
|
|
|
handler(newVal) {
|
2020-01-15 22:21:19 +08:00
|
|
|
|
if (newVal.type == 1) {
|
|
|
|
|
|
this.checkList = newVal.selectedData;
|
|
|
|
|
|
this.assetClick = false;
|
2020-01-08 09:16:34 +08:00
|
|
|
|
}
|
2020-01-02 18:13:01 +08:00
|
|
|
|
},
|
2020-01-15 22:21:19 +08:00
|
|
|
|
immediate: true,
|
2020-01-02 18:13:01 +08:00
|
|
|
|
deep: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
getFlushData: {
|
|
|
|
|
|
handler(newVal, oldVal) {
|
|
|
|
|
|
if (newVal === true) {
|
|
|
|
|
|
this.getIDCOptionData();
|
|
|
|
|
|
this.getAssetData()
|
|
|
|
|
|
}
|
2019-12-18 16:55:49 +08:00
|
|
|
|
}
|
2020-01-02 18:13:01 +08:00
|
|
|
|
},
|
2020-01-15 22:21:19 +08:00
|
|
|
|
checkList(n, o) {
|
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
|
if (n.length > 0 ) {
|
|
|
|
|
|
this.pageObj.idcIds = n.join(',');
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.pageObj.idcIds = '';
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.assetClick) {
|
|
|
|
|
|
this.$store.state.assetData = {selectedData: n, step: this.$store.state.assetData.step+1, type: 0};
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.getSingleAsset();
|
|
|
|
|
|
}
|
|
|
|
|
|
this.getAssetData();
|
|
|
|
|
|
}, 50);
|
2020-01-13 21:42:14 +08:00
|
|
|
|
}
|
2019-12-18 16:55:49 +08:00
|
|
|
|
},
|
2020-01-02 18:13:01 +08:00
|
|
|
|
methods: {
|
2020-01-13 21:42:14 +08:00
|
|
|
|
dcSelectAll(val) { //DC全选
|
2020-01-10 20:09:33 +08:00
|
|
|
|
if (this.checkListData.length > 0) {
|
2020-01-13 21:42:14 +08:00
|
|
|
|
this.checkList = [];
|
|
|
|
|
|
if (val) {
|
2020-01-10 20:09:33 +08:00
|
|
|
|
for (let i = 0; i < this.checkListData.length; i++) {
|
|
|
|
|
|
this.checkList.push(this.checkListData[i].id);
|
2020-01-15 09:51:52 +08:00
|
|
|
|
this.$store.commit('assetItemIdChange',this.checkListData[i].id)
|
2020-01-10 20:09:33 +08:00
|
|
|
|
}
|
2020-01-15 09:51:52 +08:00
|
|
|
|
this.$store.commit('assetAllIdChange',this.checkListData)
|
2020-01-10 20:09:33 +08:00
|
|
|
|
}
|
2020-01-13 21:42:14 +08:00
|
|
|
|
this.checkAllHandler = false;
|
2020-01-10 20:09:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2020-01-09 19:30:43 +08:00
|
|
|
|
openModuleBox(module) {
|
2020-01-19 18:31:18 +08:00
|
|
|
|
if (module.param) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
let tempObj = JSON.parse(module.param);
|
|
|
|
|
|
this.$set(module, 'paramObj', []);
|
|
|
|
|
|
for (let k in tempObj) {
|
|
|
|
|
|
module.paramObj.push({key: k, value: tempObj[k]});
|
|
|
|
|
|
}
|
|
|
|
|
|
} catch (err) {
|
|
|
|
|
|
console.info(module, err);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-01-09 19:30:43 +08:00
|
|
|
|
this.module = module;
|
2020-01-19 18:31:18 +08:00
|
|
|
|
console.info(this.module);
|
2020-01-09 19:30:43 +08:00
|
|
|
|
this.$refs.moduleBox.show(true);
|
|
|
|
|
|
},
|
|
|
|
|
|
getAssetModuleList(id) {
|
|
|
|
|
|
this.$refs['moduleListPop' + id][0].getModuleList();
|
|
|
|
|
|
},
|
2020-01-08 22:19:46 +08:00
|
|
|
|
elementsetShow(s, e) {
|
|
|
|
|
|
var eventfixed = {
|
|
|
|
|
|
shezhi: 0,
|
|
|
|
|
|
screen: 0
|
|
|
|
|
|
};
|
|
|
|
|
|
eventfixed[s] = 1;
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
this.$store.commit('setHeaderTable', this.tablelable);
|
|
|
|
|
|
this.$store.commit('setEventfixed', eventfixed);
|
|
|
|
|
|
const h = document.documentElement.clientHeight;
|
|
|
|
|
|
const w = document.documentElement.clientWidth;
|
|
|
|
|
|
const dw = this.$refs.elementset.$el.offsetWidth;
|
|
|
|
|
|
const dh = this.$refs.elementset.$el.offsetHeight;
|
|
|
|
|
|
let positionx =
|
2020-02-18 11:05:57 +08:00
|
|
|
|
e.clientX + dw <= w - 10 ? e.clientX + 14 : e.clientX + 14 - dw;
|
2020-01-08 22:19:46 +08:00
|
|
|
|
let positiony =
|
|
|
|
|
|
e.clientY + dh <= h - 10
|
2020-02-18 11:05:57 +08:00
|
|
|
|
? e.clientY + 20
|
|
|
|
|
|
: e.clientY + 20 - (e.clientY + dh - h);
|
2020-01-08 22:19:46 +08:00
|
|
|
|
this.$store.commit('setPosition', { positionx, positiony });
|
|
|
|
|
|
},
|
|
|
|
|
|
elementsetHide() {
|
|
|
|
|
|
//悬浮点击空白隐藏
|
|
|
|
|
|
this.$refs.elementset.elementsetHide();
|
|
|
|
|
|
},
|
|
|
|
|
|
tablelabelEmit(data) {
|
|
|
|
|
|
//获取子组件传过来的参数
|
|
|
|
|
|
this.$store.commit('setHeaderTable', data);
|
|
|
|
|
|
this.tablelable = data;
|
|
|
|
|
|
},
|
2020-01-02 18:13:01 +08:00
|
|
|
|
ssss(id, sn) {
|
|
|
|
|
|
let routeData = this.$router.resolve({
|
|
|
|
|
|
name: "terminal",
|
|
|
|
|
|
query: {
|
|
|
|
|
|
id: id,
|
|
|
|
|
|
host: sn
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
window.open(routeData.href);
|
|
|
|
|
|
},
|
2020-01-10 20:09:33 +08:00
|
|
|
|
jumpToAlertMsg(assetId) {
|
|
|
|
|
|
this.$store.commit('assetForAlertListChange', assetId);
|
2020-02-11 11:30:56 +08:00
|
|
|
|
bus.$emit("menu-change", 'alertList');
|
2020-01-10 20:09:33 +08:00
|
|
|
|
this.$router.push({
|
|
|
|
|
|
path: "/alertList",
|
|
|
|
|
|
query: {
|
|
|
|
|
|
t: +new Date()
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2020-01-09 14:57:44 +08:00
|
|
|
|
getAssetData(data, flushRightBoxDc) {
|
|
|
|
|
|
this.searchLabel = Object.assign(this.searchLabel, this.pageObj);
|
2020-01-08 09:16:34 +08:00
|
|
|
|
this.$get('asset', this.searchLabel).then(response => {
|
2020-01-02 18:13:01 +08:00
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.tableData = response.data.list;
|
|
|
|
|
|
this.pageObj.total = response.data.total
|
|
|
|
|
|
}
|
2020-01-09 14:57:44 +08:00
|
|
|
|
});
|
|
|
|
|
|
if (flushRightBoxDc) {
|
|
|
|
|
|
this.$refs.assetAddUnit.getIDCOptionData();
|
|
|
|
|
|
this.$refs.assetEditUnit.getIDCOptionData();
|
|
|
|
|
|
}
|
2020-01-02 18:13:01 +08:00
|
|
|
|
},
|
|
|
|
|
|
getIDCOptionData() {
|
|
|
|
|
|
this.$get('idc').then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.checkListData = this.IDCOptionData = response.data.list;
|
|
|
|
|
|
this.markOptionData(this.IDCOptionData)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
getUserData() {
|
|
|
|
|
|
this.$get('sys/user/list').then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.idcUserData = response.data.list
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
editData(data, item) {
|
|
|
|
|
|
if (data === 'idc') {
|
|
|
|
|
|
item.name = this.addIdcData.popName
|
2019-12-23 10:16:36 +08:00
|
|
|
|
}
|
2020-01-02 18:13:01 +08:00
|
|
|
|
this.$put(data, item).then(res => {
|
2019-12-12 17:07:33 +08:00
|
|
|
|
if (res.code === 200) {
|
2020-01-08 09:16:34 +08:00
|
|
|
|
this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")});
|
2020-01-02 18:13:01 +08:00
|
|
|
|
this.getAssetData();
|
|
|
|
|
|
} else {
|
2020-01-08 09:16:34 +08:00
|
|
|
|
this.$message.error(res.msg);
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
addNewData(type) {
|
|
|
|
|
|
if (type === 'IDC') {
|
|
|
|
|
|
this.$post('idc', this.addIdcData).then(res => {
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
const h = this.$createElement;
|
2020-01-08 09:16:34 +08:00
|
|
|
|
this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")});
|
2020-01-02 18:13:01 +08:00
|
|
|
|
this.getIDCOptionData()
|
|
|
|
|
|
this.getAssetData()
|
|
|
|
|
|
} else {
|
2020-01-08 09:16:34 +08:00
|
|
|
|
this.$message.error(res.msg);
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
deleteData(data, item) {
|
2020-01-08 09:16:34 +08:00
|
|
|
|
this.$confirm(this.$t("tip.assetConfirmDelete"), {
|
|
|
|
|
|
confirmButtonText: this.$t("tip.yes"),
|
|
|
|
|
|
cancelButtonText: this.$t("tip.no"),
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
}).then(() => {
|
|
|
|
|
|
this.$delete(data + "?ids=" + item).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")});
|
|
|
|
|
|
this.getAssetData();
|
|
|
|
|
|
this.getIDCOptionData();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(response.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
});
|
2020-01-02 18:13:01 +08:00
|
|
|
|
},
|
|
|
|
|
|
markOptionData(data) {
|
|
|
|
|
|
data.forEach(item => {
|
|
|
|
|
|
this.$set(item, 'isEdit', false);
|
|
|
|
|
|
this.$set(item, 'oldName', item.value);
|
|
|
|
|
|
this.$set(item, item.name, false)
|
|
|
|
|
|
this.$set(item, item.id, false)
|
|
|
|
|
|
this.$set(item, item.id + item.name, false)
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
editOptionData(item) {
|
|
|
|
|
|
if (!item.isEdit) {
|
|
|
|
|
|
item.isEdit = true;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if (item.name !== item.oldName) {
|
|
|
|
|
|
item.isEdit = false;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
item.isEdit = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
delOptionData(data) {
|
|
|
|
|
|
},
|
|
|
|
|
|
tabControl(data) {
|
|
|
|
|
|
if (data === 'close') {
|
|
|
|
|
|
this.addUnitShow = false
|
|
|
|
|
|
this.editUnitShow = false
|
|
|
|
|
|
this.$refs['assetEditUnit'].tabView = false
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2020-01-15 22:21:19 +08:00
|
|
|
|
indOf(a, b) {
|
|
|
|
|
|
let c = [];
|
|
|
|
|
|
for (let i = 0; i < a.length; i++) {
|
|
|
|
|
|
c.push(a[i]);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (c.indexOf(b) > -1) {
|
|
|
|
|
|
return true;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2020-01-02 18:13:01 +08:00
|
|
|
|
tagShow(data, id, type) {
|
|
|
|
|
|
if (data === 'showAdd') {
|
2020-02-20 10:47:37 +08:00
|
|
|
|
this.addUnitShow = true;
|
|
|
|
|
|
/*this.editUnitShow = true;
|
|
|
|
|
|
this.$refs['assetEditUnit'].getAssetData('');*/
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (data === 'showEdit') {
|
2020-02-19 16:33:01 +08:00
|
|
|
|
this.editUnitShow = true;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
this.$refs['assetEditUnit'].getAssetData(id)
|
|
|
|
|
|
}
|
|
|
|
|
|
if (data === 'showView') {
|
|
|
|
|
|
this.editUnitShow = true
|
|
|
|
|
|
this.$refs['assetEditUnit'].getAssetData(id)
|
|
|
|
|
|
this.$refs['assetEditUnit'].tabView = true
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
editing() {
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
getSingleIDCData(data, item) {
|
|
|
|
|
|
if (item !== 'edit') {
|
|
|
|
|
|
this.idcSelectedData = '';
|
|
|
|
|
|
this.IDCOptionData.forEach(item => {
|
|
|
|
|
|
if (item.id === data) {
|
|
|
|
|
|
this.idcSelectedData = item
|
|
|
|
|
|
}
|
2019-12-13 16:43:24 +08:00
|
|
|
|
});
|
2020-01-07 17:54:45 +08:00
|
|
|
|
return
|
2019-12-18 16:55:49 +08:00
|
|
|
|
} else {
|
2020-01-02 18:13:01 +08:00
|
|
|
|
this.IDCOptionData.forEach(item => {
|
|
|
|
|
|
if (item.id === data) {
|
2020-01-07 17:54:45 +08:00
|
|
|
|
this.addIdcData.id = item.id;
|
|
|
|
|
|
this.addIdcData.name = item.name;
|
|
|
|
|
|
this.addIdcData.popName = item.name;
|
|
|
|
|
|
this.addIdcData.location = item.location;
|
|
|
|
|
|
this.addIdcData.principal = item.principal;
|
|
|
|
|
|
this.addIdcData.tel = item.tel;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-18 16:55:49 +08:00
|
|
|
|
});
|
2019-12-13 16:43:24 +08:00
|
|
|
|
}
|
2020-01-15 22:21:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
changeCheckBox() {
|
|
|
|
|
|
this.assetClick = true;
|
|
|
|
|
|
this.getSingleAsset();
|
|
|
|
|
|
},
|
2020-01-08 09:16:34 +08:00
|
|
|
|
getSingleAsset() {
|
2020-01-13 21:42:14 +08:00
|
|
|
|
let checkedCount = this.checkList.length;
|
2020-01-15 22:21:19 +08:00
|
|
|
|
let allCount = this.checkListData.length;
|
|
|
|
|
|
this.checkAllFlag = ((checkedCount == allCount) && allCount > 0);
|
|
|
|
|
|
this.checkAllHandler = checkedCount > 0 && checkedCount < allCount;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
},
|
|
|
|
|
|
pageNo(val) {
|
|
|
|
|
|
this.pageObj.pageNo = val;
|
|
|
|
|
|
this.getAssetData()
|
2019-12-09 18:51:56 +08:00
|
|
|
|
}
|
2020-01-02 18:13:01 +08:00
|
|
|
|
,
|
|
|
|
|
|
pageSize(val) {
|
|
|
|
|
|
this.pageObj.pageSize = val;
|
|
|
|
|
|
this.getAssetData()
|
|
|
|
|
|
},
|
|
|
|
|
|
getPrincipalName(data) {
|
|
|
|
|
|
for (let item in this.idcUserData) {
|
|
|
|
|
|
if (this.idcUserData[item].userId === data) {
|
|
|
|
|
|
return this.idcUserData[item].username
|
2019-12-23 10:16:36 +08:00
|
|
|
|
}
|
2019-12-18 16:55:49 +08:00
|
|
|
|
}
|
2020-01-02 18:13:01 +08:00
|
|
|
|
},
|
|
|
|
|
|
returnData(data) {
|
|
|
|
|
|
if (data && data !== '--') {
|
2020-02-17 18:41:38 +08:00
|
|
|
|
return data;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
} else if (data === '--') {
|
2020-02-17 18:41:38 +08:00
|
|
|
|
return '--';
|
2020-01-02 18:13:01 +08:00
|
|
|
|
} else {
|
2020-02-17 18:41:38 +08:00
|
|
|
|
return "--";
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
flushData() {
|
2020-01-08 09:16:34 +08:00
|
|
|
|
this.getSingleAsset();
|
2020-01-02 18:13:01 +08:00
|
|
|
|
this.getAssetData();
|
|
|
|
|
|
this.getIDCOptionData();
|
|
|
|
|
|
},
|
2020-01-10 18:16:25 +08:00
|
|
|
|
closeAllPop:function(){
|
|
|
|
|
|
this.$refs.idcConfigBox.forEach((item)=>{
|
|
|
|
|
|
item.show(false)
|
|
|
|
|
|
})
|
|
|
|
|
|
this.$refs.cabinetConfigBox.forEach((item)=>{
|
|
|
|
|
|
item.show(false)
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2020-01-08 09:16:34 +08:00
|
|
|
|
search(searchObj) {
|
|
|
|
|
|
this.searchLabel = {};
|
2020-01-09 14:57:44 +08:00
|
|
|
|
this.pageObj.pageNo = 1;
|
2020-01-08 09:16:34 +08:00
|
|
|
|
for (let item in searchObj) {
|
|
|
|
|
|
if (searchObj[item]) {
|
|
|
|
|
|
this.$set(this.searchLabel, item, searchObj[item]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.getAssetData();
|
2020-01-03 18:10:26 +08:00
|
|
|
|
}
|
2019-12-23 10:16:36 +08:00
|
|
|
|
},
|
2020-02-06 17:44:07 +08:00
|
|
|
|
created() {
|
|
|
|
|
|
this.getUserData();
|
|
|
|
|
|
this.getIDCOptionData();
|
|
|
|
|
|
},
|
2020-01-02 18:13:01 +08:00
|
|
|
|
mounted() {
|
2020-01-15 22:21:19 +08:00
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
|
if (this.$store.state.assetData.selectedData.length > 0) {
|
|
|
|
|
|
this.checkList = [];
|
|
|
|
|
|
this.checkList = this.$store.state.assetData.selectedData;
|
|
|
|
|
|
}
|
|
|
|
|
|
}, 50);
|
2020-01-16 15:48:49 +08:00
|
|
|
|
let localStorageTitle=localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path);
|
|
|
|
|
|
this.tablelable = localStorageTitle ? JSON.parse(localStorageTitle) : this.tableTitle;
|
|
|
|
|
|
this.dropCol = localStorageTitle ? JSON.parse(localStorageTitle) : this.tableTitle;
|
2019-12-27 17:08:39 +08:00
|
|
|
|
}
|
2019-12-04 13:45:37 +08:00
|
|
|
|
}
|
2019-11-29 15:00:26 +08:00
|
|
|
|
</script>
|
2019-12-04 13:45:37 +08:00
|
|
|
|
|
2020-01-13 21:42:14 +08:00
|
|
|
|
<style scoped lang="scss">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
.asset {
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
}
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.tab-input-square {
|
2020-01-10 20:09:33 +08:00
|
|
|
|
border: 1px solid #606266;
|
2020-01-09 19:30:43 +08:00
|
|
|
|
height: 22px;
|
|
|
|
|
|
width: 50px;
|
2019-12-09 18:51:56 +08:00
|
|
|
|
border-radius: 3px;
|
2019-12-04 13:45:37 +08:00
|
|
|
|
text-align: center;
|
2020-01-09 19:30:43 +08:00
|
|
|
|
line-height: 20px;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2020-01-10 20:09:33 +08:00
|
|
|
|
.tab-input-square-high {
|
|
|
|
|
|
border: 1px solid #1166bb;
|
|
|
|
|
|
}
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</style>
|
2020-01-13 21:42:14 +08:00
|
|
|
|
<style lang="scss">
|
2020-02-06 18:55:59 +08:00
|
|
|
|
|
2019-12-23 10:16:36 +08:00
|
|
|
|
</style>
|