2019-11-29 15:00:26 +08:00
|
|
|
|
<template>
|
2019-12-06 15:53:50 +08:00
|
|
|
|
<div class="asset">
|
|
|
|
|
|
<div class="content-left">
|
|
|
|
|
|
<div class="sidebar-title">
|
2019-12-13 16:43:24 +08:00
|
|
|
|
<div>Asset</div>
|
2019-12-06 15:53:50 +08:00
|
|
|
|
<div class="sidebar-info">
|
|
|
|
|
|
<div class="sidebar-info-header">ALL</div>
|
2019-12-06 16:43:04 +08:00
|
|
|
|
<div class="sidebar-info-footer">
|
2019-12-12 17:07:33 +08:00
|
|
|
|
<el-checkbox-group v-model="checkList" size="small" @change="getSingleAsset(checkList)">
|
2019-12-10 17:10:32 +08:00
|
|
|
|
<el-checkbox v-for="(item,key) in checkListData" :key="key" border :label=item.id>
|
|
|
|
|
|
{{item.name}}
|
2019-12-23 10:16:36 +08:00
|
|
|
|
<el-popover
|
|
|
|
|
|
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>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span>{{$t('overall.esc')}}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<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"
|
2019-12-26 17:28:04 +08:00
|
|
|
|
@click="editData('idc',item)">
|
2019-12-23 10:16:36 +08:00
|
|
|
|
{{$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>
|
|
|
|
|
|
</el-popover>
|
2019-12-06 15:53:50 +08:00
|
|
|
|
</el-checkbox>
|
|
|
|
|
|
</el-checkbox-group>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2019-12-04 13:45:37 +08:00
|
|
|
|
</div>
|
2019-12-06 15:53:50 +08:00
|
|
|
|
<div class="content-right">
|
2019-12-11 17:11:44 +08:00
|
|
|
|
<div>
|
|
|
|
|
|
<button style="float: right;margin-top: 10px;width: 100px;height: 32px;margin-left: 10px"
|
|
|
|
|
|
@click.stop="tagShow('showAdd')">+ADD
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
:placeholder="$t('overall.search')"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
style="width: 200px;float: right;padding-top: 10px"
|
|
|
|
|
|
>
|
|
|
|
|
|
</el-input>
|
|
|
|
|
|
</div>
|
2019-12-06 15:53:50 +08:00
|
|
|
|
<div>
|
|
|
|
|
|
<el-table
|
|
|
|
|
|
:height="tableHeight"
|
|
|
|
|
|
:data="this.tableData"
|
2019-12-04 13:45:37 +08:00
|
|
|
|
>
|
2019-12-06 15:53:50 +08:00
|
|
|
|
<el-table-column
|
|
|
|
|
|
v-for="(item, index) in tableTitle"
|
|
|
|
|
|
v-if="item.show"
|
2019-12-12 17:07:33 +08:00
|
|
|
|
min-width="110"
|
2019-12-06 15:53:50 +08:00
|
|
|
|
:key="`col_${index}`"
|
|
|
|
|
|
:label="item.label"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{item}}
|
|
|
|
|
|
<template slot-scope="scope" :column="item">
|
|
|
|
|
|
<div v-if="item.prop=='ID'">
|
|
|
|
|
|
<p>
|
2019-12-12 17:07:33 +08:00
|
|
|
|
<span>{{scope.row.id}}</span>
|
2019-12-06 15:53:50 +08:00
|
|
|
|
</p>
|
2019-12-04 13:45:37 +08:00
|
|
|
|
</div>
|
2019-12-12 17:07:33 +08:00
|
|
|
|
<div v-if="item.prop=='资产类型'">
|
2019-12-06 15:53:50 +08:00
|
|
|
|
<p>
|
2019-12-12 17:07:33 +08:00
|
|
|
|
<span>{{scope.row.model.type.value}}</span>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='SN'">
|
|
|
|
|
|
<p>
|
2019-12-13 16:43:24 +08:00
|
|
|
|
<span>{{scope.row.sn}}</span>
|
2019-12-12 17:07:33 +08:00
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='HOST'">
|
|
|
|
|
|
<p>
|
|
|
|
|
|
<span>{{scope.row.host}}</span>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='资产状态'">
|
|
|
|
|
|
<p>
|
|
|
|
|
|
<span>{{scope.row.state==1?'在库':'出库'}}</span>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='Module'">
|
|
|
|
|
|
<p>
|
2019-12-26 17:28:04 +08:00
|
|
|
|
<span>
|
|
|
|
|
|
<div class="tab-input-square">{{scope.row.moduleNum}}</div>
|
|
|
|
|
|
</span>
|
2019-12-12 17:07:33 +08:00
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='Alert'">
|
|
|
|
|
|
<p>
|
2019-12-26 17:28:04 +08:00
|
|
|
|
<span>
|
|
|
|
|
|
<div class="tab-input-square">{{scope.row.alertNum}}</div>
|
|
|
|
|
|
</span>
|
2019-12-12 17:07:33 +08:00
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='数据中心'">
|
|
|
|
|
|
<p>
|
|
|
|
|
|
<span>{{scope.row.idc.name}}</span>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='机柜'">
|
|
|
|
|
|
<p>
|
|
|
|
|
|
<span>{{returnData(scope.row.cabinet)}}</span>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='型号'">
|
|
|
|
|
|
<p>
|
|
|
|
|
|
<span>{{scope.row.model.name}}</span>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='厂商'">
|
|
|
|
|
|
<p>
|
|
|
|
|
|
<span>{{scope.row.model.vendor.value}}</span>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='购买日期'">
|
|
|
|
|
|
<p>
|
|
|
|
|
|
<span>{{scope.row.purchaseDate}}</span>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='责任人'">
|
|
|
|
|
|
<p>
|
2019-12-18 16:55:49 +08:00
|
|
|
|
<span>{{getPrincipalName(scope.row.idc.principal)}}</span>
|
2019-12-12 17:07:33 +08:00
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.prop=='责任人电话'">
|
|
|
|
|
|
<p>
|
|
|
|
|
|
<span>{{scope.row.idc.tel}}</span>
|
2019-12-06 15:53:50 +08:00
|
|
|
|
</p>
|
2019-12-04 13:45:37 +08:00
|
|
|
|
</div>
|
2019-12-10 17:10:32 +08:00
|
|
|
|
<div v-if="item.prop == 'option'">
|
2019-12-26 17:28:04 +08:00
|
|
|
|
<span @click="ssss(scope.row.id ,scope.row.host)" class="account-list-option"><i
|
|
|
|
|
|
class="el-icon-monitor"></i></span>
|
2019-12-18 16:55:49 +08:00
|
|
|
|
<span @click.stop="deleteData('asset',scope.row.id)" class="account-list-option"><i
|
2019-12-09 18:51:56 +08:00
|
|
|
|
class="el-icon-delete"></i></span>
|
2019-12-12 17:07:33 +08:00
|
|
|
|
<span @click.stop="tagShow('showEdit',scope.row.id)" class="account-list-option"><i
|
2019-12-09 18:51:56 +08:00
|
|
|
|
class="el-icon-edit-outline"></i></span>
|
2019-12-18 16:55:49 +08:00
|
|
|
|
<span @click.stop="tagShow('showView',scope.row.id)" class="account-list-option"><i
|
2019-12-12 17:07:33 +08:00
|
|
|
|
class="el-icon-view"></i></span>
|
2019-12-06 16:43:04 +08:00
|
|
|
|
</div>
|
2019-12-06 15:53:50 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
<Pagination :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
|
2019-12-26 17:28:04 +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>
|
2019-12-04 13:45:37 +08:00
|
|
|
|
</div>
|
2019-12-06 15:53:50 +08:00
|
|
|
|
</div>
|
2019-11-29 15:00:26 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
export default {
|
2019-12-04 13:45:37 +08:00
|
|
|
|
name: "asset",
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2019-12-06 16:43:04 +08:00
|
|
|
|
checkList: [],
|
2019-12-05 16:48:23 +08:00
|
|
|
|
tableTitle: [
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t("asset.tableTitle.id"),
|
|
|
|
|
|
prop: 'ID',
|
2019-12-12 17:07:33 +08:00
|
|
|
|
show: false,
|
2019-12-05 16:48:23 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.assetType"),
|
|
|
|
|
|
prop: '资产类型',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
2019-12-06 16:43:04 +08:00
|
|
|
|
label: this.$t("asset.tableTitle.device"),
|
2019-12-12 17:07:33 +08:00
|
|
|
|
prop: 'SN',
|
2019-12-05 16:48:23 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
2019-12-12 17:07:33 +08:00
|
|
|
|
label: this.$t("asset.tableTitle.host"),
|
|
|
|
|
|
prop: 'HOST',
|
2019-12-05 16:48:23 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t("asset.tableTitle.assetState"),
|
|
|
|
|
|
prop: '资产状态',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
2019-12-06 16:43:04 +08:00
|
|
|
|
label: this.$t("asset.tableTitle.module"),
|
2019-12-05 16:48:23 +08:00
|
|
|
|
prop: 'Module',
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
2019-12-10 17:10:32 +08:00
|
|
|
|
label: this.$t("asset.tableTitle.alert"),
|
2019-12-12 17:07:33 +08:00
|
|
|
|
prop: 'Alert',
|
2019-12-05 16:48:23 +08:00
|
|
|
|
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"),
|
2019-12-12 17:07:33 +08:00
|
|
|
|
prop: '购买日期',
|
2019-12-05 16:48:23 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
2019-12-12 17:07:33 +08:00
|
|
|
|
label: this.$t("asset.tableTitle.principal"),
|
|
|
|
|
|
prop: '责任人',
|
2019-12-05 16:48:23 +08:00
|
|
|
|
show: true,
|
|
|
|
|
|
}, {
|
2019-12-12 17:07:33 +08:00
|
|
|
|
label: this.$t("asset.tableTitle.principalTel"),
|
|
|
|
|
|
prop: '责任人电话',
|
2019-12-05 16:48:23 +08:00
|
|
|
|
show: true,
|
2019-12-06 16:43:04 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
label: this.$t('config.account.option'),
|
|
|
|
|
|
prop: 'option',
|
|
|
|
|
|
show: true,
|
2019-12-05 16:48:23 +08:00
|
|
|
|
}],
|
2019-12-04 13:45:37 +08:00
|
|
|
|
tableData: [],
|
2019-12-09 18:51:56 +08:00
|
|
|
|
checkListData: [],
|
2019-12-10 17:10:32 +08:00
|
|
|
|
IDCData: '',
|
|
|
|
|
|
IDCOptionData: [],
|
|
|
|
|
|
cabinetData: '',
|
|
|
|
|
|
cabinetOptionData: [],
|
2019-12-06 15:53:50 +08:00
|
|
|
|
input: '',
|
2019-12-04 13:45:37 +08:00
|
|
|
|
pageObj: {
|
2019-12-13 16:43:24 +08:00
|
|
|
|
id: '',
|
2019-12-04 13:45:37 +08:00
|
|
|
|
pageNo: 1,
|
|
|
|
|
|
pageSize: 20,
|
2019-12-06 15:53:50 +08:00
|
|
|
|
total: 0,
|
2019-12-12 17:07:33 +08:00
|
|
|
|
idcId: '',
|
2019-12-13 16:43:24 +08:00
|
|
|
|
idcIds: ''
|
2019-12-04 13:45:37 +08:00
|
|
|
|
},
|
2019-12-09 18:51:56 +08:00
|
|
|
|
tableHeight: document.documentElement.clientHeight - 200,
|
2019-12-04 13:45:37 +08:00
|
|
|
|
tabShow: false,
|
2019-12-13 16:43:24 +08:00
|
|
|
|
tabView: true,
|
2019-12-04 13:45:37 +08:00
|
|
|
|
tagType: 'add',
|
|
|
|
|
|
form: {
|
|
|
|
|
|
name: ''
|
|
|
|
|
|
},
|
2019-12-09 18:51:56 +08:00
|
|
|
|
rightBox: { //弹出框相关
|
|
|
|
|
|
show: false,
|
|
|
|
|
|
isEdit: false, //false查看,true编辑
|
|
|
|
|
|
title: ''
|
|
|
|
|
|
},
|
2019-12-11 17:11:44 +08:00
|
|
|
|
assetType: '',
|
2019-12-10 17:10:32 +08:00
|
|
|
|
idcSelectedData: {
|
|
|
|
|
|
id: '',
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
location: '',
|
|
|
|
|
|
principal: '',
|
|
|
|
|
|
tel: ''
|
|
|
|
|
|
},
|
2019-12-11 17:11:44 +08:00
|
|
|
|
addIdcData: {
|
|
|
|
|
|
id: '',
|
|
|
|
|
|
name: '',
|
2019-12-23 10:16:36 +08:00
|
|
|
|
popName: '',
|
2019-12-11 17:11:44 +08:00
|
|
|
|
location: '',
|
|
|
|
|
|
principal: '',
|
|
|
|
|
|
tel: ''
|
|
|
|
|
|
},
|
2019-12-18 16:55:49 +08:00
|
|
|
|
idcUserData: '',
|
2019-12-13 16:43:24 +08:00
|
|
|
|
modelCount: '',
|
2019-12-18 16:55:49 +08:00
|
|
|
|
isResourceShow: 0,
|
|
|
|
|
|
unitDisable: '',
|
|
|
|
|
|
modelClickData: '',
|
2019-12-23 10:16:36 +08:00
|
|
|
|
obj: null,
|
|
|
|
|
|
addUnitShow: false,
|
|
|
|
|
|
editUnitShow: false,
|
2019-12-26 17:28:04 +08:00
|
|
|
|
flag: false
|
2019-12-06 15:53:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2019-12-09 18:51:56 +08:00
|
|
|
|
computed: {
|
|
|
|
|
|
getData() {
|
2019-12-06 15:53:50 +08:00
|
|
|
|
return this.$store.state.assetData
|
2019-12-26 17:28:04 +08:00
|
|
|
|
},
|
|
|
|
|
|
getFlushData() {
|
|
|
|
|
|
return this.$store.state.flushDataSign
|
2019-12-04 13:45:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2019-12-09 18:51:56 +08:00
|
|
|
|
watch: {
|
|
|
|
|
|
getData: {
|
2019-12-26 17:28:04 +08:00
|
|
|
|
handler(oldVal, newVal) {
|
|
|
|
|
|
this.checkList.splice(0, 1, newVal.selectedData);
|
|
|
|
|
|
this.pageObj.idcIds = newVal.selectedData;
|
2019-12-23 10:16:36 +08:00
|
|
|
|
this.getAssetData()
|
2019-12-06 15:53:50 +08:00
|
|
|
|
},
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
},
|
2019-12-26 17:28:04 +08:00
|
|
|
|
getFlushData: {
|
|
|
|
|
|
handler(newVal, oldVal) {
|
|
|
|
|
|
if (newVal === true) {
|
|
|
|
|
|
this.getIDCOptionData();
|
|
|
|
|
|
this.getAssetData()
|
2019-12-18 16:55:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2019-12-26 17:28:04 +08:00
|
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
|
|
|
this.checkList.push(this.$store.state.assetData.selectedData)
|
|
|
|
|
|
this.getSingleAsset(this.checkList)
|
|
|
|
|
|
|
2019-12-06 15:53:50 +08:00
|
|
|
|
},
|
2019-12-04 13:45:37 +08:00
|
|
|
|
methods: {
|
2019-12-26 17:28:04 +08:00
|
|
|
|
ssss(id, sn) {
|
2019-12-18 16:55:49 +08:00
|
|
|
|
let routeData = this.$router.resolve({
|
|
|
|
|
|
name: "terminal",
|
2019-12-26 17:28:04 +08:00
|
|
|
|
query: {
|
|
|
|
|
|
id: id,
|
|
|
|
|
|
host: sn
|
|
|
|
|
|
}
|
2019-12-18 16:55:49 +08:00
|
|
|
|
});
|
|
|
|
|
|
window.open(routeData.href);
|
2019-12-13 16:43:24 +08:00
|
|
|
|
},
|
2019-12-12 17:07:33 +08:00
|
|
|
|
getAssetData(data) {
|
2019-12-26 17:28:04 +08:00
|
|
|
|
this.$get('asset', this.pageObj).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.tableData = response.data.list;
|
|
|
|
|
|
this.pageObj.total = response.data.total
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2019-12-10 17:10:32 +08:00
|
|
|
|
},
|
|
|
|
|
|
getIDCOptionData() {
|
2019-12-11 17:11:44 +08:00
|
|
|
|
this.$get('idc').then(response => {
|
2019-12-10 17:10:32 +08:00
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.checkListData = this.IDCOptionData = response.data.list;
|
2019-12-12 17:07:33 +08:00
|
|
|
|
this.markOptionData(this.IDCOptionData)
|
2019-12-06 16:43:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2019-12-18 16:55:49 +08:00
|
|
|
|
getUserData() {
|
|
|
|
|
|
this.$get('sys/user/list').then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.idcUserData = response.data.list
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
editData(data, item) {
|
2019-12-26 17:28:04 +08:00
|
|
|
|
if (data === 'idc') {
|
|
|
|
|
|
item.name = this.addIdcData.popName
|
2019-12-18 16:55:49 +08:00
|
|
|
|
}
|
2019-12-26 17:28:04 +08:00
|
|
|
|
this.$put(data, item).then(res => {
|
|
|
|
|
|
const h = this.$createElement;
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
this.$notify({
|
|
|
|
|
|
message: h('i', {style: 'color: teal'}, '修改成功'),
|
|
|
|
|
|
duration: 2000
|
|
|
|
|
|
});
|
|
|
|
|
|
this.getAssetData();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$notify({
|
|
|
|
|
|
message: h('i', {style: 'color: teal'}, res.msg),
|
|
|
|
|
|
duration: 2000
|
|
|
|
|
|
})
|
2019-12-23 10:16:36 +08:00
|
|
|
|
}
|
2019-12-26 17:28:04 +08:00
|
|
|
|
})
|
2019-12-18 16:55:49 +08:00
|
|
|
|
},
|
2019-12-11 17:11:44 +08:00
|
|
|
|
addNewData(type) {
|
|
|
|
|
|
if (type === 'IDC') {
|
|
|
|
|
|
this.$post('idc', this.addIdcData).then(res => {
|
2019-12-26 17:28:04 +08:00
|
|
|
|
const h = this.$createElement;
|
2019-12-12 17:07:33 +08:00
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
const h = this.$createElement;
|
|
|
|
|
|
this.$notify({
|
|
|
|
|
|
message: h('i', {style: 'color: teal'}, '添加成功'),
|
|
|
|
|
|
duration: 2000
|
|
|
|
|
|
});
|
2019-12-13 16:43:24 +08:00
|
|
|
|
this.getIDCOptionData()
|
|
|
|
|
|
this.getAssetData()
|
|
|
|
|
|
} else {
|
2019-12-12 17:07:33 +08:00
|
|
|
|
this.$notify({
|
|
|
|
|
|
message: h('i', {style: 'color: teal'}, '添加成功'),
|
|
|
|
|
|
duration: 2000
|
|
|
|
|
|
});
|
2019-12-13 16:43:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2019-12-18 16:55:49 +08:00
|
|
|
|
deleteData(data, item) {
|
|
|
|
|
|
this.$delete(data + "?ids=" + item).then(response => {
|
|
|
|
|
|
const h = this.$createElement;
|
2019-12-13 16:43:24 +08:00
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.$notify({
|
|
|
|
|
|
message: h('i', {style: 'color: teal'}, '删除成功'),
|
|
|
|
|
|
duration: 2000
|
|
|
|
|
|
});
|
|
|
|
|
|
this.getAssetData()
|
2019-12-18 16:55:49 +08:00
|
|
|
|
this.getIDCOptionData()
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$notify({
|
|
|
|
|
|
message: h('i', {style: 'color: teal'}, response.msg),
|
|
|
|
|
|
duration: 2000
|
|
|
|
|
|
});
|
2019-12-13 16:43:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2019-12-11 17:11:44 +08:00
|
|
|
|
markOptionData(data) {
|
|
|
|
|
|
data.forEach(item => {
|
2019-12-10 17:10:32 +08:00
|
|
|
|
this.$set(item, 'isEdit', false);
|
2019-12-11 17:11:44 +08:00
|
|
|
|
this.$set(item, 'oldName', item.value);
|
2019-12-23 10:16:36 +08:00
|
|
|
|
this.$set(item, item.name, false)
|
|
|
|
|
|
this.$set(item, item.id, false)
|
|
|
|
|
|
this.$set(item, item.id + item.name, false)
|
2019-12-10 17:10:32 +08:00
|
|
|
|
})
|
2019-12-09 18:51:56 +08:00
|
|
|
|
},
|
|
|
|
|
|
editOptionData(item) {
|
|
|
|
|
|
if (!item.isEdit) {
|
|
|
|
|
|
item.isEdit = true;
|
|
|
|
|
|
} else {
|
2019-12-10 17:10:32 +08:00
|
|
|
|
if (item.name !== item.oldName) {
|
2019-12-09 18:51:56 +08:00
|
|
|
|
item.isEdit = false;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
item.isEdit = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2019-12-12 17:07:33 +08:00
|
|
|
|
delOptionData(data) {
|
|
|
|
|
|
},
|
2019-12-23 10:16:36 +08:00
|
|
|
|
tabControl(data) {
|
|
|
|
|
|
if (data === 'close') {
|
|
|
|
|
|
this.addUnitShow = false
|
|
|
|
|
|
this.editUnitShow = false
|
2019-12-27 17:08:39 +08:00
|
|
|
|
this.$refs['assetEditUnit'].tabView = false
|
2019-12-04 13:45:37 +08:00
|
|
|
|
}
|
2019-12-23 10:16:36 +08:00
|
|
|
|
},
|
|
|
|
|
|
tagShow(data, id, type) {
|
2019-12-26 17:28:04 +08:00
|
|
|
|
if (data === 'showAdd') {
|
2019-12-23 10:16:36 +08:00
|
|
|
|
this.addUnitShow = true
|
|
|
|
|
|
}
|
2019-12-26 17:28:04 +08:00
|
|
|
|
if (data === 'showEdit') {
|
2019-12-23 10:16:36 +08:00
|
|
|
|
this.editUnitShow = true
|
|
|
|
|
|
this.$refs['assetEditUnit'].getAssetData(id)
|
2019-12-13 16:43:24 +08:00
|
|
|
|
}
|
2019-12-26 17:28:04 +08:00
|
|
|
|
if (data === 'showView') {
|
2019-12-23 10:16:36 +08:00
|
|
|
|
this.editUnitShow = true
|
2019-12-26 17:28:04 +08:00
|
|
|
|
this.$refs['assetEditUnit'].getAssetData(id)
|
|
|
|
|
|
this.$refs['assetEditUnit'].tabView = true
|
2019-12-04 13:45:37 +08:00
|
|
|
|
}
|
2019-12-09 18:51:56 +08:00
|
|
|
|
},
|
|
|
|
|
|
editing() {
|
|
|
|
|
|
|
2019-12-10 17:10:32 +08:00
|
|
|
|
},
|
2019-12-23 10:16:36 +08:00
|
|
|
|
getSingleIDCData(data, item) {
|
|
|
|
|
|
if (item !== 'edit') {
|
|
|
|
|
|
this.idcSelectedData = '';
|
|
|
|
|
|
this.IDCOptionData.forEach(item => {
|
|
|
|
|
|
if (item.id === data) {
|
|
|
|
|
|
this.idcSelectedData = item
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.IDCOptionData.forEach(item => {
|
|
|
|
|
|
if (item.id === data) {
|
|
|
|
|
|
this.addIdcData.popName = item.name
|
|
|
|
|
|
this.addIdcData.location = item.location
|
|
|
|
|
|
this.addIdcData.principal = item.principal
|
|
|
|
|
|
this.addIdcData.tel = item.tel
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2019-12-12 17:07:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
,
|
2019-12-13 16:43:24 +08:00
|
|
|
|
getSingleAsset(data) {
|
2019-12-26 17:28:04 +08:00
|
|
|
|
let result = []
|
|
|
|
|
|
if (data[0] === '') {
|
|
|
|
|
|
result = data.slice(1);
|
|
|
|
|
|
this.pageObj.idcIds = result.join(',')
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.pageObj.idcIds = data.join(',')
|
|
|
|
|
|
}
|
2019-12-12 17:07:33 +08:00
|
|
|
|
this.getAssetData()
|
2019-12-11 17:11:44 +08:00
|
|
|
|
},
|
2019-12-04 13:45:37 +08:00
|
|
|
|
pageNo(val) {
|
|
|
|
|
|
this.pageObj.pageNo = val;
|
2019-12-10 17:10:32 +08:00
|
|
|
|
this.getAssetData()
|
2019-12-12 17:07:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
,
|
2019-12-05 16:48:23 +08:00
|
|
|
|
pageSize(val) {
|
2019-12-04 13:45:37 +08:00
|
|
|
|
this.pageObj.pageSize = val;
|
2019-12-10 17:10:32 +08:00
|
|
|
|
this.getAssetData()
|
2019-12-13 16:43:24 +08:00
|
|
|
|
},
|
2019-12-23 10:16:36 +08:00
|
|
|
|
getPrincipalName(data) {
|
|
|
|
|
|
for (let item in this.idcUserData) {
|
|
|
|
|
|
if (this.idcUserData[item].userId === data) {
|
2019-12-18 16:55:49 +08:00
|
|
|
|
return this.idcUserData[item].username
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2019-12-13 16:43:24 +08:00
|
|
|
|
returnData(data) {
|
2019-12-12 17:07:33 +08:00
|
|
|
|
if (data && data !== '--') {
|
|
|
|
|
|
return data.name;
|
|
|
|
|
|
} else if (data === '--') {
|
|
|
|
|
|
return '-';
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return "-";
|
|
|
|
|
|
}
|
2019-12-23 10:16:36 +08:00
|
|
|
|
},
|
|
|
|
|
|
flushData() {
|
|
|
|
|
|
this.getAssetData();
|
|
|
|
|
|
this.getIDCOptionData();
|
|
|
|
|
|
},
|
2019-12-04 13:45:37 +08:00
|
|
|
|
},
|
|
|
|
|
|
mounted() {
|
2019-12-26 17:28:04 +08:00
|
|
|
|
this.getUserData();
|
2019-12-06 16:43:04 +08:00
|
|
|
|
this.getAssetData();
|
2019-12-10 17:10:32 +08:00
|
|
|
|
this.getIDCOptionData();
|
2019-12-27 17:08:39 +08:00
|
|
|
|
window.onresize = () => {
|
|
|
|
|
|
this.tableHeight = document.documentElement.clientHeight - 200;
|
|
|
|
|
|
}
|
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>
|
2019-12-23 10:16:36 +08:00
|
|
|
|
.sidebar-pop-input {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
right: 50px;
|
|
|
|
|
|
width: 200px;
|
|
|
|
|
|
height: 26px;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
border: 1px solid #DCDFE6;
|
|
|
|
|
|
color: #606266;
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
padding: 0px 15px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sidebar-pop-input-select {
|
|
|
|
|
|
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;
|
2019-12-23 10:16:36 +08:00
|
|
|
|
}
|
2019-12-09 18:51:56 +08:00
|
|
|
|
|
2019-12-06 15:53:50 +08:00
|
|
|
|
.content-left {
|
|
|
|
|
|
float: left;
|
|
|
|
|
|
width: 370px;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
}
|
2019-12-09 18:51:56 +08:00
|
|
|
|
|
2019-12-06 15:53:50 +08:00
|
|
|
|
.content-right {
|
2019-12-09 18:51:56 +08:00
|
|
|
|
margin-left: 370px;
|
2019-12-06 15:53:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sidebar-title {
|
|
|
|
|
|
padding-left: 30px;
|
|
|
|
|
|
padding-top: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sidebar-info {
|
2019-12-13 16:43:24 +08:00
|
|
|
|
|
2019-12-06 15:53:50 +08:00
|
|
|
|
margin-top: 20px;
|
|
|
|
|
|
border: 1px solid #acacac;
|
2019-12-04 13:45:37 +08:00
|
|
|
|
border-radius: 8px;
|
2019-12-06 15:53:50 +08:00
|
|
|
|
height: calc(90vh - 55px);
|
2019-12-13 16:43:24 +08:00
|
|
|
|
width: calc(100% - 8px);
|
2019-12-04 13:45:37 +08:00
|
|
|
|
}
|
2019-11-29 15:00:26 +08:00
|
|
|
|
|
2019-12-06 15:53:50 +08:00
|
|
|
|
.sidebar-info-header {
|
|
|
|
|
|
background: #acacac;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
line-height: 50px;
|
|
|
|
|
|
border-top-left-radius: 8px;
|
|
|
|
|
|
border-top-right-radius: 8px;
|
|
|
|
|
|
height: 60px;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sidebar-info-footer {
|
|
|
|
|
|
padding-top: 15px;
|
|
|
|
|
|
padding-left: 15px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.checkbox-edit {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
top: 8px;
|
|
|
|
|
|
left: 230px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-12-09 18:51:56 +08:00
|
|
|
|
.tab-input-square {
|
|
|
|
|
|
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
|
|
|
|
margin-top: 6px;
|
|
|
|
|
|
line-height: 23px;
|
|
|
|
|
|
color: #aaaaaa;
|
2019-12-04 13:45:37 +08:00
|
|
|
|
}
|
2019-12-06 16:43:04 +08:00
|
|
|
|
|
2019-12-10 17:10:32 +08:00
|
|
|
|
.account-list-option {
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
margin-right: 6px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-12-09 18:51:56 +08:00
|
|
|
|
.right-box-top-btns {
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.right-box-top-btn {
|
|
|
|
|
|
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;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.right-box-top-btn-full {
|
|
|
|
|
|
background-color: #656565;
|
|
|
|
|
|
border: 1px solid #656565;
|
|
|
|
|
|
border-top: none;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.pop-window {
|
2019-12-12 17:07:33 +08:00
|
|
|
|
height: 370px;
|
2019-12-09 18:51:56 +08:00
|
|
|
|
width: 400px;
|
|
|
|
|
|
}
|
2019-12-10 17:10:32 +08:00
|
|
|
|
|
|
|
|
|
|
.pop-window-assetType-content {
|
|
|
|
|
|
padding: 1px 15px 15px 20px;
|
2019-12-09 18:51:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-12-10 17:10:32 +08:00
|
|
|
|
.rm-c-list span:hover {
|
|
|
|
|
|
background-color: #888;
|
|
|
|
|
|
color: #fff;
|
2019-12-09 18:51:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-12-10 17:10:32 +08:00
|
|
|
|
.right-box-bottom-btn {
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
background-color: #656565;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
line-height: 35px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.right-box-bottom-btns {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
bottom: 0px;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.right-box-bottom-btn-cancel {
|
|
|
|
|
|
background-color: #DADADA;
|
|
|
|
|
|
color: #656565;
|
|
|
|
|
|
width: 50%;
|
|
|
|
|
|
border-bottom-left-radius: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.right-box-bottom-btn-50 {
|
|
|
|
|
|
width: 50%;
|
|
|
|
|
|
float: right;
|
|
|
|
|
|
border-bottom-right-radius: 8px;
|
|
|
|
|
|
}
|
2019-12-12 17:07:33 +08:00
|
|
|
|
|
|
|
|
|
|
.activeColor {
|
|
|
|
|
|
background-color: #409EFF;
|
2019-12-11 17:11:44 +08:00
|
|
|
|
}
|
2019-12-12 17:07:33 +08:00
|
|
|
|
|
2019-12-06 16:43:04 +08:00
|
|
|
|
@keyframes slide-in-from-right {
|
2019-12-09 18:51:56 +08:00
|
|
|
|
from {
|
|
|
|
|
|
right: -800px
|
|
|
|
|
|
}
|
|
|
|
|
|
to {
|
|
|
|
|
|
right: 0
|
|
|
|
|
|
}
|
2019-12-06 16:43:04 +08:00
|
|
|
|
}
|
2019-12-09 18:51:56 +08:00
|
|
|
|
|
2019-12-06 16:43:04 +08:00
|
|
|
|
@keyframes slide-out-to-right {
|
2019-12-09 18:51:56 +08:00
|
|
|
|
from {
|
|
|
|
|
|
right: 0
|
|
|
|
|
|
}
|
|
|
|
|
|
to {
|
|
|
|
|
|
right: -800px
|
|
|
|
|
|
}
|
2019-12-06 16:43:04 +08:00
|
|
|
|
}
|
2019-12-09 18:51:56 +08:00
|
|
|
|
|
2019-12-06 16:43:04 +08:00
|
|
|
|
.right-box-enter-active {
|
|
|
|
|
|
animation: slide-in-from-right 0.4s;
|
|
|
|
|
|
}
|
2019-12-09 18:51:56 +08:00
|
|
|
|
|
2019-12-06 16:43:04 +08:00
|
|
|
|
.right-box-leave-active {
|
|
|
|
|
|
animation: slide-out-to-right 0.4s;
|
|
|
|
|
|
}
|
2019-12-23 10:16:36 +08:00
|
|
|
|
</style>
|