2019-11-29 15:00:26 +08:00
|
|
|
|
<template>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
<div class="asset">
|
|
|
|
|
|
<div class="content-left">
|
|
|
|
|
|
<div class="sidebar-title">Asset</div>
|
|
|
|
|
|
<div class="sidebar-info">
|
|
|
|
|
|
<!--<div class="sidebar-info-header">ALL</div>-->
|
2020-01-08 09:16:34 +08:00
|
|
|
|
<el-checkbox-group v-model="checkList" size="small" @change="getSingleAsset()">
|
2020-01-02 18:13:01 +08:00
|
|
|
|
<el-checkbox class="sidebar-info-item" :class="{'sidebar-info-item-active': checkList.indexOf(item.id) != -1}"
|
|
|
|
|
|
v-for="(item,key) in checkListData" :key="key" :label=item.id>
|
2020-01-07 17:54:45 +08:00
|
|
|
|
<span>{{item.name}}</span>
|
|
|
|
|
|
<idc-config-box :post-idc="addIdcData" placement="left" @after="getIDCOptionData" :button-class="'checkbox-edit'">
|
|
|
|
|
|
<template v-slot:optionZone>
|
|
|
|
|
|
<i class="el-icon-edit-outline" @click="getSingleIDCData(item.id,'edit')"></i>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</idc-config-box>
|
|
|
|
|
|
<!--<el-popover
|
2020-01-02 18:13:01 +08:00
|
|
|
|
placement="left"
|
|
|
|
|
|
v-model="item[item.id]"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="pop-window-assetType-content">
|
|
|
|
|
|
<div class="right-box-top-btns">
|
|
|
|
|
|
<div class="right-box-top-btn right-box-top-btn-full"
|
|
|
|
|
|
@click="item[item.id] = false">
|
|
|
|
|
|
<div class="right-box-btn-icon">
|
|
|
|
|
|
<i class="el-icon-close"></i>
|
2019-12-06 15:53:50 +08:00
|
|
|
|
</div>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
<span>{{$t('overall.esc')}}</span>
|
|
|
|
|
|
</div>
|
2019-12-06 15:53:50 +08:00
|
|
|
|
</div>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
<div class="pop-window">
|
|
|
|
|
|
<span style="display: block;padding-bottom: 20px">标题</span>
|
|
|
|
|
|
<div style="padding-top: 10px;padding-left: 20px">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label style="font-size: 12px">DN name</label>
|
|
|
|
|
|
<input class='sidebar-pop-input' v-model="addIdcData.popName"/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="padding-top: 40px">
|
|
|
|
|
|
<label style="font-size: 12px">Loaction</label>
|
|
|
|
|
|
<input class='sidebar-pop-input' v-model="addIdcData.location"/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="padding-top: 40px">
|
|
|
|
|
|
<label style="font-size: 12px;padding-right: 20px">负责人</label>
|
|
|
|
|
|
<select class='sidebar-pop-input-select'
|
|
|
|
|
|
style="margin-left:-40px "
|
|
|
|
|
|
v-model="addIdcData.principal"
|
|
|
|
|
|
clearable>
|
|
|
|
|
|
<option
|
|
|
|
|
|
v-for="item in idcUserData"
|
|
|
|
|
|
:key="item.key"
|
|
|
|
|
|
:label="item.username"
|
|
|
|
|
|
:value="item.userId"
|
|
|
|
|
|
>
|
|
|
|
|
|
</option>
|
|
|
|
|
|
</select>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="padding-top: 40px">
|
|
|
|
|
|
<label style="font-size: 12px">Tel</label>
|
|
|
|
|
|
<input class='sidebar-pop-input' v-model="addIdcData.tel"/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="right-box-bottom-btns">
|
|
|
|
|
|
<div class="right-box-bottom-btn right-box-bottom-btn-cancel"
|
|
|
|
|
|
@click.stop="item[item.id]= false">
|
|
|
|
|
|
{{$t('overall.cancel')}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="right-box-bottom-btn right-box-bottom-btn-50"
|
|
|
|
|
|
@click="editData('idc',item)">
|
|
|
|
|
|
{{$t('overall.save')}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span class="checkbox-edit" slot="reference"
|
|
|
|
|
|
@click.prevent="getSingleIDCData(item.id,'edit')"><i
|
|
|
|
|
|
class="el-icon-edit-outline"></i></span>
|
2020-01-07 17:54:45 +08:00
|
|
|
|
</el-popover>-->
|
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">
|
|
|
|
|
|
<button @click.stop="tagShow('showAdd')" class="nz-btn nz-btn-size-normal nz-btn-style-normal float-right">
|
|
|
|
|
|
<span class="top-tool-btn-txt">{{$t('overall.add')}}</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<div class="top-tool-search float-right"><search-input :searchMsg="searchMsg" @search="search"></search-input></div>
|
|
|
|
|
|
</div>
|
2020-01-03 18:10:26 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
<el-table
|
|
|
|
|
|
height="calc(100% - 65px)"
|
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
|
:data="tableData"
|
|
|
|
|
|
border
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
v-for="(item, index) in tableTitle"
|
|
|
|
|
|
v-if="item.show"
|
|
|
|
|
|
min-width="110"
|
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"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{item}}
|
|
|
|
|
|
<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>
|
|
|
|
|
|
<div v-if="item.prop=='资产类型'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{scope.row.model.type.value}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='SN'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{scope.row.sn}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<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-02 18:13:01 +08:00
|
|
|
|
<div v-if="item.prop=='资产状态'">
|
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-01-02 18:13:01 +08:00
|
|
|
|
<div v-if="item.prop=='Module'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<div class="tab-input-square">{{scope.row.moduleNum}}</div>
|
2019-12-04 13:45:37 +08:00
|
|
|
|
</div>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
<div v-if="item.prop=='Alert'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<div class="tab-input-square">{{scope.row.alertNum}}</div>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='数据中心'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{scope.row.idc.name}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='机柜'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{returnData(scope.row.cabinet)}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='型号'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{scope.row.model.name}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='厂商'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{scope.row.model.vendor.value}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='购买日期'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{scope.row.purchaseDate}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='责任人'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{getPrincipalName(scope.row.idc.principal)}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='责任人电话'">
|
2020-01-03 18:10:26 +08:00
|
|
|
|
<span>{{scope.row.idc.tel}}</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
2020-01-06 20:57:49 +08:00
|
|
|
|
<div v-if="item.prop == 'option'" class="content-right-options">
|
|
|
|
|
|
<span @click.stop="deleteData('asset',scope.row.id)" class="content-right-option"><i
|
|
|
|
|
|
class="el-icon-delete"></i>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span @click.stop="tagShow('showView',scope.row.id)" class="content-right-option"><i
|
|
|
|
|
|
class="el-icon-view"></i>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span @click.stop="tagShow('showEdit',scope.row.id)" class="content-right-option"><i
|
|
|
|
|
|
class="el-icon-edit-outline"></i>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span @click="ssss(scope.row.id ,scope.row.host)" class="content-right-option"><i
|
|
|
|
|
|
class="el-icon-monitor"></i>
|
|
|
|
|
|
</span>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</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
|
|
|
|
|
|
|
|
|
|
<asset-add-unit :add-unit-show='addUnitShow' @refreshData="flushData"
|
|
|
|
|
|
@sendStateData="tabControl"></asset-add-unit>
|
|
|
|
|
|
<asset-edit-unit :edit-unit-show='editUnitShow' @refreshData="flushData" @sendStateData="tabControl"
|
|
|
|
|
|
ref="assetEditUnit"></asset-edit-unit>
|
2020-01-02 18:13:01 +08:00
|
|
|
|
</div>
|
2019-11-29 15:00:26 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
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
|
|
|
|
|
|
}],
|
|
|
|
|
|
},
|
|
|
|
|
|
searchLabel: {}, //搜索参数
|
2020-01-02 18:13:01 +08:00
|
|
|
|
checkList: [],
|
|
|
|
|
|
tableTitle: [
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t("asset.tableTitle.id"),
|
|
|
|
|
|
prop: 'ID',
|
2020-01-08 09:16:34 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
width: 60
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.assetType"),
|
|
|
|
|
|
prop: '资产类型',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.device"),
|
|
|
|
|
|
prop: 'SN',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.host"),
|
|
|
|
|
|
prop: 'HOST',
|
|
|
|
|
|
show: true,
|
2020-01-06 20:57:49 +08:00
|
|
|
|
width: 130
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.assetState"),
|
|
|
|
|
|
prop: '资产状态',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.module"),
|
|
|
|
|
|
prop: 'Module',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.alert"),
|
|
|
|
|
|
prop: 'Alert',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.dataCenter"),
|
|
|
|
|
|
prop: '数据中心',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.cabinet"),
|
|
|
|
|
|
prop: '机柜',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.model"),
|
|
|
|
|
|
prop: '型号',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.manufacturer"),
|
|
|
|
|
|
prop: '厂商',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.procurementDate"),
|
|
|
|
|
|
prop: '购买日期',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.principal"),
|
|
|
|
|
|
prop: '责任人',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.principalTel"),
|
|
|
|
|
|
prop: '责任人电话',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t('config.account.option'),
|
|
|
|
|
|
prop: 'option',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}],
|
|
|
|
|
|
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',
|
|
|
|
|
|
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: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
idcUserData: '',
|
|
|
|
|
|
modelCount: '',
|
|
|
|
|
|
isResourceShow: 0,
|
|
|
|
|
|
unitDisable: '',
|
|
|
|
|
|
modelClickData: '',
|
|
|
|
|
|
obj: null,
|
|
|
|
|
|
addUnitShow: false,
|
|
|
|
|
|
editUnitShow: false,
|
|
|
|
|
|
flag: false
|
|
|
|
|
|
}
|
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) {
|
|
|
|
|
|
if (this.checkList.indexOf(newVal.selectedData) >= 0) {
|
|
|
|
|
|
this.checkList.splice(this.checkList.indexOf(newVal.selectedData), 1);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.checkList.push(newVal.selectedData);
|
|
|
|
|
|
}
|
|
|
|
|
|
this.getSingleAsset();
|
|
|
|
|
|
this.getAssetData();
|
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
|
|
|
|
},
|
2019-12-18 16:55:49 +08:00
|
|
|
|
},
|
2020-01-02 18:13:01 +08:00
|
|
|
|
created() {
|
|
|
|
|
|
this.checkList.push(this.$store.state.assetData.selectedData)
|
2020-01-08 09:16:34 +08:00
|
|
|
|
this.getSingleAsset()
|
2019-12-26 17:28:04 +08:00
|
|
|
|
|
2019-12-18 16:55:49 +08:00
|
|
|
|
},
|
2020-01-02 18:13:01 +08:00
|
|
|
|
methods: {
|
|
|
|
|
|
ssss(id, sn) {
|
|
|
|
|
|
let routeData = this.$router.resolve({
|
|
|
|
|
|
name: "terminal",
|
|
|
|
|
|
query: {
|
|
|
|
|
|
id: id,
|
|
|
|
|
|
host: sn
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
window.open(routeData.href);
|
|
|
|
|
|
},
|
|
|
|
|
|
getAssetData(data) {
|
2020-01-08 09:16:34 +08:00
|
|
|
|
this.searchLabel = Object.assign(this.pageObj, this.searchLabel);
|
|
|
|
|
|
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
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
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
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
tagShow(data, id, type) {
|
|
|
|
|
|
if (data === 'showAdd') {
|
|
|
|
|
|
this.addUnitShow = true
|
|
|
|
|
|
}
|
|
|
|
|
|
if (data === 'showEdit') {
|
|
|
|
|
|
this.editUnitShow = true
|
|
|
|
|
|
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-02 18:13:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
,
|
2020-01-08 09:16:34 +08:00
|
|
|
|
getSingleAsset() {
|
|
|
|
|
|
if (this.checkList.length > 0 ) {
|
|
|
|
|
|
if (this.checkList[0] === '') {
|
|
|
|
|
|
this.checkList.splice(0, 1);
|
|
|
|
|
|
this.getSingleAsset();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.pageObj.idcIds = this.checkList.join(',');
|
|
|
|
|
|
}
|
|
|
|
|
|
this.getAssetData();
|
2019-12-09 18:51:56 +08:00
|
|
|
|
}
|
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 !== '--') {
|
|
|
|
|
|
return data.name;
|
|
|
|
|
|
} else if (data === '--') {
|
|
|
|
|
|
return '-';
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return "-";
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
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-08 09:16:34 +08:00
|
|
|
|
search(searchObj) {
|
|
|
|
|
|
this.searchLabel = {};
|
|
|
|
|
|
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-01-02 18:13:01 +08:00
|
|
|
|
mounted() {
|
|
|
|
|
|
this.getUserData();
|
2019-12-23 10:16:36 +08:00
|
|
|
|
this.getAssetData();
|
|
|
|
|
|
this.getIDCOptionData();
|
2020-01-02 18:13:01 +08:00
|
|
|
|
window.onresize = () => {
|
|
|
|
|
|
this.tableHeight = document.documentElement.clientHeight - 200;
|
|
|
|
|
|
}
|
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
|
|
|
|
|
2019-11-29 15:00:26 +08:00
|
|
|
|
<style scoped>
|
2020-01-03 18:10:26 +08:00
|
|
|
|
.asset {
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
}
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.sidebar-pop-input {
|
2019-12-23 10:16:36 +08:00
|
|
|
|
position: absolute;
|
|
|
|
|
|
right: 50px;
|
|
|
|
|
|
width: 200px;
|
|
|
|
|
|
height: 26px;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
border: 1px solid #DCDFE6;
|
|
|
|
|
|
color: #606266;
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
padding: 0px 15px;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-23 10:16:36 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.sidebar-pop-input-select {
|
2019-12-23 10:16:36 +08:00
|
|
|
|
position: absolute;
|
|
|
|
|
|
right: 83px;
|
|
|
|
|
|
width: 200px;
|
|
|
|
|
|
height: 26px;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
border: 1px solid #DCDFE6;
|
|
|
|
|
|
color: #606266;
|
|
|
|
|
|
display: inline-block;
|
2019-12-26 17:28:04 +08:00
|
|
|
|
padding: 0 15px;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-06 15:53:50 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.tab-input-square {
|
2019-12-09 18:51:56 +08:00
|
|
|
|
border: 1px solid #aaaaaa;
|
2019-12-04 13:45:37 +08:00
|
|
|
|
height: 25px;
|
2019-12-12 17:07:33 +08:00
|
|
|
|
width: 65px;
|
2019-12-09 18:51:56 +08:00
|
|
|
|
border-radius: 3px;
|
2019-12-04 13:45:37 +08:00
|
|
|
|
text-align: center;
|
2019-12-09 18:51:56 +08:00
|
|
|
|
line-height: 23px;
|
|
|
|
|
|
color: #aaaaaa;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-06 16:43:04 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.account-list-option {
|
2019-12-10 17:10:32 +08:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
margin-right: 6px;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-10 17:10:32 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.right-box-top-btns {
|
2019-12-09 18:51:56 +08:00
|
|
|
|
text-align: center;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-09 18:51:56 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.right-box-top-btn {
|
2019-12-09 18:51:56 +08:00
|
|
|
|
border-radius: 0 0 9px 9px;
|
|
|
|
|
|
float: right;
|
|
|
|
|
|
color: #656565;
|
|
|
|
|
|
height: 30px;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
padding: 3px 8px 1px 8px;
|
|
|
|
|
|
border: 1px solid #aaaaaa;
|
|
|
|
|
|
border-top: none;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
margin-left: 20px;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-09 18:51:56 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.right-box-top-btn-full {
|
2019-12-09 18:51:56 +08:00
|
|
|
|
background-color: #656565;
|
|
|
|
|
|
border: 1px solid #656565;
|
|
|
|
|
|
border-top: none;
|
|
|
|
|
|
color: white;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-09 18:51:56 +08:00
|
|
|
|
|
|
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.pop-window {
|
2019-12-12 17:07:33 +08:00
|
|
|
|
height: 370px;
|
2019-12-09 18:51:56 +08:00
|
|
|
|
width: 400px;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-10 17:10:32 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.pop-window-assetType-content {
|
2019-12-10 17:10:32 +08:00
|
|
|
|
padding: 1px 15px 15px 20px;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-09 18:51:56 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.rm-c-list span:hover {
|
2019-12-10 17:10:32 +08:00
|
|
|
|
background-color: #888;
|
|
|
|
|
|
color: #fff;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-09 18:51:56 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.right-box-bottom-btn {
|
2019-12-10 17:10:32 +08:00
|
|
|
|
display: inline-block;
|
|
|
|
|
|
background-color: #656565;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
line-height: 35px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
text-align: center;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-10 17:10:32 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.right-box-bottom-btns {
|
2019-12-10 17:10:32 +08:00
|
|
|
|
position: absolute;
|
|
|
|
|
|
bottom: 0px;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
text-align: center;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-10 17:10:32 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.right-box-bottom-btn-cancel {
|
2019-12-10 17:10:32 +08:00
|
|
|
|
background-color: #DADADA;
|
|
|
|
|
|
color: #656565;
|
|
|
|
|
|
width: 50%;
|
|
|
|
|
|
border-bottom-left-radius: 8px;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-10 17:10:32 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.right-box-bottom-btn-50 {
|
2019-12-10 17:10:32 +08:00
|
|
|
|
width: 50%;
|
|
|
|
|
|
float: right;
|
|
|
|
|
|
border-bottom-right-radius: 8px;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-12 17:07:33 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.activeColor {
|
2019-12-12 17:07:33 +08:00
|
|
|
|
background-color: #409EFF;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-12 17:07:33 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
@keyframes slide-in-from-right {
|
2019-12-09 18:51:56 +08:00
|
|
|
|
from {
|
2020-01-02 18:13:01 +08:00
|
|
|
|
right: -800px
|
2019-12-09 18:51:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
to {
|
2020-01-02 18:13:01 +08:00
|
|
|
|
right: 0
|
2019-12-09 18:51:56 +08:00
|
|
|
|
}
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-09 18:51:56 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
@keyframes slide-out-to-right {
|
2019-12-09 18:51:56 +08:00
|
|
|
|
from {
|
2020-01-02 18:13:01 +08:00
|
|
|
|
right: 0
|
2019-12-09 18:51:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
to {
|
2020-01-02 18:13:01 +08:00
|
|
|
|
right: -800px
|
2019-12-09 18:51:56 +08:00
|
|
|
|
}
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-09 18:51:56 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.right-box-enter-active {
|
2019-12-06 16:43:04 +08:00
|
|
|
|
animation: slide-in-from-right 0.4s;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
2019-12-09 18:51:56 +08:00
|
|
|
|
|
2020-01-02 18:13:01 +08:00
|
|
|
|
.right-box-leave-active {
|
2019-12-06 16:43:04 +08:00
|
|
|
|
animation: slide-out-to-right 0.4s;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|
|
|
|
|
|
<style>
|
|
|
|
|
|
.asset .content-left .el-checkbox__input.is-focus .el-checkbox__inner,
|
|
|
|
|
|
.asset .content-left .el-checkbox__input .el-checkbox__inner:hover,
|
|
|
|
|
|
.asset .content-left .el-checkbox__input.is-checked .el-checkbox__inner,
|
|
|
|
|
|
.asset .content-left .el-checkbox__input.is-indeterminate .el-checkbox__inner {
|
|
|
|
|
|
border-color: #e07700;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.asset .content-left .el-checkbox__input.is-checked + .el-checkbox__label {
|
|
|
|
|
|
color: #444;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.asset .content-left .el-checkbox__input.is-checked .el-checkbox__inner, .asset .content-left .el-checkbox__input.is-indeterminate .el-checkbox__inner {
|
|
|
|
|
|
background-color: #e07700;
|
|
|
|
|
|
}
|
2020-01-07 17:54:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.checkbox-edit {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
right: 10px;
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
}
|
2019-12-23 10:16:36 +08:00
|
|
|
|
</style>
|