2020-02-21 17:57:19 +08:00
|
|
|
|
<template>
|
2023-08-30 17:30:36 +08:00
|
|
|
|
<div v-my-loading="preferenceLoading">
|
2021-10-21 10:04:01 +08:00
|
|
|
|
<nzDetailView
|
2022-03-25 15:40:05 +08:00
|
|
|
|
v-my-loading="detailViewLoading || tools.loading"
|
2024-01-22 11:15:58 +08:00
|
|
|
|
v-if="detailType !== 'list' "
|
2021-10-21 10:04:01 +08:00
|
|
|
|
:api="url"
|
|
|
|
|
|
ref="detailList"
|
|
|
|
|
|
:layout="['searchInput', 'elementSet', 'pagination','detailViewSet']"
|
|
|
|
|
|
:from="fromRoute.dc"
|
|
|
|
|
|
:search-msg="searchMsg"
|
|
|
|
|
|
:detailType="detailType"
|
|
|
|
|
|
:detailViewRightObj="detailViewRightObj"
|
|
|
|
|
|
:dataLength="tableData.length"
|
|
|
|
|
|
@search="search"
|
|
|
|
|
|
@changeDetailType="changeDetailType"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template v-slot:top-tool-left>
|
|
|
|
|
|
<!-- <detailViewTopSearch :selectValue.sync="selectValue" :detailSearchList="detailSearchList" @reload="reloadTable" />-->
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:top-tool-right>
|
2022-06-16 15:58:17 +08:00
|
|
|
|
<button id="asset-create-asset" v-has="'asset_add'" :title="$t('asset.createAsset')" class="top-tool-btn" @click.stop="add">
|
2021-10-21 10:04:01 +08:00
|
|
|
|
<i class="nz-icon nz-icon-create-square"></i>
|
|
|
|
|
|
</button>
|
2021-11-02 15:47:17 +08:00
|
|
|
|
<top-tool-more-options
|
|
|
|
|
|
:delete-objs="batchDeleteObjs"
|
2021-10-21 10:04:01 +08:00
|
|
|
|
ref="export"
|
|
|
|
|
|
id="model"
|
|
|
|
|
|
:params="searchLabel"
|
|
|
|
|
|
:params2="searchCheckBox"
|
|
|
|
|
|
:permissions="{
|
2022-09-16 09:50:02 +08:00
|
|
|
|
import: 'dc_add',
|
|
|
|
|
|
export: 'dc_edit'
|
|
|
|
|
|
}"
|
2022-09-09 14:47:56 +08:00
|
|
|
|
class="top-tool-export margin-r-10 margin-l-10"
|
2021-11-05 17:18:53 +08:00
|
|
|
|
export-file-name="datacenter"
|
|
|
|
|
|
export-url="/dc/export"
|
|
|
|
|
|
import-url="/dc/import"
|
2021-10-21 10:04:01 +08:00
|
|
|
|
@afterImport="getTableData"
|
2022-12-27 16:17:50 +08:00
|
|
|
|
v-has="['dc_add','dc_edit']"
|
2021-10-21 10:04:01 +08:00
|
|
|
|
>
|
|
|
|
|
|
</top-tool-more-options>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:nz-detail-view-list>
|
|
|
|
|
|
<dc-detail
|
|
|
|
|
|
class="data-detail"
|
|
|
|
|
|
ref="dataDetail"
|
|
|
|
|
|
:orderByFa="orderBy"
|
2022-03-25 15:40:05 +08:00
|
|
|
|
v-my-loading="tools.loading"
|
2021-10-21 10:04:01 +08:00
|
|
|
|
:detailViewRightObj="detailViewRightObj"
|
|
|
|
|
|
:api="url"
|
|
|
|
|
|
:table-data="tableData"
|
|
|
|
|
|
@detailViewRightShow = 'detailViewRightShow'
|
|
|
|
|
|
@orderDetail="orderDetail"
|
|
|
|
|
|
>
|
|
|
|
|
|
</dc-detail>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<!-- 分页组件 -->
|
|
|
|
|
|
<template v-slot:pagination>
|
|
|
|
|
|
<el-pagination
|
|
|
|
|
|
@current-change="pageNo"
|
|
|
|
|
|
:current-page.sync="pageObj.pageNo"
|
|
|
|
|
|
:page-size="20"
|
|
|
|
|
|
:total="pageObj.total"
|
|
|
|
|
|
layout="prev, slot, next"
|
|
|
|
|
|
small
|
|
|
|
|
|
>
|
|
|
|
|
|
<template>
|
2022-10-11 16:11:56 +08:00
|
|
|
|
<el-input-number v-if="showInput" ref="jumpInput" v-model="pageObj.pageNo" :controls="false" :min="1" :max="pageObj.pages" class="jump-input" @change="getTableData" @keyup.enter.native="getTableData" size="mini"/>
|
2022-09-16 09:50:02 +08:00
|
|
|
|
<span class="jump-pages">/ {{pageObj.pages}}</span>
|
2021-10-21 10:04:01 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-pagination>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</nzDetailView>
|
2021-04-08 20:28:54 +08:00
|
|
|
|
<nz-data-list
|
|
|
|
|
|
ref="dataList"
|
2021-04-13 20:33:12 +08:00
|
|
|
|
:api="url"
|
2024-01-22 11:15:58 +08:00
|
|
|
|
v-if="detailType === 'list' "
|
2021-10-21 10:04:01 +08:00
|
|
|
|
:layout="['searchInput', 'elementSet', 'pagination','detailViewSet']"
|
2021-04-08 20:28:54 +08:00
|
|
|
|
:custom-table-title.sync="tools.customTableTitle"
|
|
|
|
|
|
:from="fromRoute.dc"
|
2021-04-29 22:24:38 +08:00
|
|
|
|
:search-msg="searchMsg"
|
|
|
|
|
|
@search="search"
|
2021-10-21 10:04:01 +08:00
|
|
|
|
:detailType="detailType"
|
|
|
|
|
|
@changeDetailType="changeDetailType"
|
|
|
|
|
|
@getTableData="getTableData"
|
2021-04-29 22:24:38 +08:00
|
|
|
|
>
|
2021-04-08 20:28:54 +08:00
|
|
|
|
<template v-slot:top-tool-right>
|
2022-09-16 09:50:02 +08:00
|
|
|
|
<button id="dc-add" v-has="'dc_add'" :title="$t('overall.createDatacenter')" class="top-tool-btn margin-r-10" type="button" @click="add">
|
2021-04-08 20:28:54 +08:00
|
|
|
|
<i class="nz-icon-create-square nz-icon"></i>
|
|
|
|
|
|
</button>
|
2021-11-02 15:47:17 +08:00
|
|
|
|
<top-tool-more-options
|
|
|
|
|
|
:delete-objs="batchDeleteObjs"
|
2021-07-20 10:55:27 +08:00
|
|
|
|
ref="export"
|
|
|
|
|
|
id="model"
|
|
|
|
|
|
:params="searchLabel"
|
|
|
|
|
|
:permissions="{
|
2022-09-16 09:50:02 +08:00
|
|
|
|
import: 'dc_add',
|
|
|
|
|
|
export: 'dc_edit'
|
|
|
|
|
|
}"
|
2021-07-20 10:55:27 +08:00
|
|
|
|
class="top-tool-export margin-r-10"
|
2021-07-20 14:31:54 +08:00
|
|
|
|
export-file-name="datacenter"
|
2021-07-20 10:55:27 +08:00
|
|
|
|
export-url="/dc/export"
|
|
|
|
|
|
import-url="/dc/import"
|
|
|
|
|
|
@afterImport="getTableData"
|
2022-12-27 16:17:50 +08:00
|
|
|
|
v-has="['dc_add','dc_edit','dc_delete']"
|
2021-07-20 10:55:27 +08:00
|
|
|
|
>
|
|
|
|
|
|
<template v-slot:before>
|
|
|
|
|
|
<div>
|
2022-12-27 15:43:38 +08:00
|
|
|
|
<el-dropdown-item :disabled="batchDeleteObjs.length==0" :class="'nz-el-dropdown-menu-item'">
|
2022-08-26 15:56:19 +08:00
|
|
|
|
<delete-button
|
|
|
|
|
|
ref="deleteButton"
|
2022-10-14 15:43:11 +08:00
|
|
|
|
:single="false"
|
2022-08-26 15:56:19 +08:00
|
|
|
|
:from="'datacenter'"
|
|
|
|
|
|
:forceDeleteShow="true"
|
2022-08-30 09:33:30 +08:00
|
|
|
|
:deleteTitle="'overall.dc'"
|
2022-08-26 15:56:19 +08:00
|
|
|
|
:type="'link'"
|
|
|
|
|
|
:title="$t('overall.batchDel')"
|
|
|
|
|
|
id="account-list-batch-delete"
|
|
|
|
|
|
v-has="'dc_delete'"
|
|
|
|
|
|
:delete-objs="batchDeleteObjs"
|
|
|
|
|
|
api="dc"
|
|
|
|
|
|
@after="getTableData"
|
|
|
|
|
|
@before="delFlag=true"
|
|
|
|
|
|
></delete-button>
|
2021-07-20 10:55:27 +08:00
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</top-tool-more-options>
|
2021-04-08 20:28:54 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:default="slotProps">
|
2021-04-13 20:33:12 +08:00
|
|
|
|
<dc-table
|
2021-04-08 20:28:54 +08:00
|
|
|
|
ref="dataTable"
|
2022-03-04 13:59:25 +08:00
|
|
|
|
:orderByFa="orderBy"
|
2022-03-25 15:40:05 +08:00
|
|
|
|
v-my-loading="tools.loading"
|
2021-10-22 17:47:42 +08:00
|
|
|
|
:loading="tools.loading"
|
2021-04-13 20:33:12 +08:00
|
|
|
|
:api="url"
|
|
|
|
|
|
:custom-table-title="tools.customTableTitle"
|
2021-04-07 09:58:34 +08:00
|
|
|
|
:height="mainTableHeight"
|
2021-04-13 20:33:12 +08:00
|
|
|
|
:table-data="tableData"
|
|
|
|
|
|
@del="del"
|
|
|
|
|
|
@edit="edit"
|
2021-08-26 18:05:40 +08:00
|
|
|
|
@copy="copy"
|
2021-04-13 20:33:12 +08:00
|
|
|
|
@orderBy="tableDataSort"
|
|
|
|
|
|
@reload="getTableData"
|
2022-03-18 18:21:43 +08:00
|
|
|
|
@topology="topology"
|
2021-04-13 20:33:12 +08:00
|
|
|
|
@selectionChange="selectionChange"
|
|
|
|
|
|
@showBottomBox="(targetTab, object) => { $refs.dataList.showBottomBox(targetTab, object) }"></dc-table>
|
2021-04-08 20:28:54 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<!-- 分页组件 -->
|
|
|
|
|
|
<template v-slot:pagination>
|
|
|
|
|
|
<Pagination ref="Pagination" :pageObj="pageObj" :tableId="tableId" @pageNo='pageNo' @pageSize='pageSize'></Pagination>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</nz-data-list>
|
2020-07-16 17:33:20 +08:00
|
|
|
|
<transition name="right-box">
|
2022-06-14 16:12:27 +08:00
|
|
|
|
<dc-box v-if="rightBox.show" :obj="object" :user-data="userData" @close="closeRightBox" @reload="getTableData" @addcabinet="addCabinet"></dc-box>
|
2020-07-16 17:33:20 +08:00
|
|
|
|
</transition>
|
2021-05-12 16:19:43 +08:00
|
|
|
|
<transition name="right-box">
|
|
|
|
|
|
<cabinetBox v-if="cabinetBoxShow" :obj="cabinet" :current-dc="{}" @close="closeRightBox" :dcDisabled="false" @reload="getTableData"></cabinetBox>
|
|
|
|
|
|
</transition>
|
2020-07-16 17:33:20 +08:00
|
|
|
|
</div>
|
2020-02-21 17:57:19 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
2021-04-08 20:28:54 +08:00
|
|
|
|
import dcBox from '@/components/common/rightBox/dcBox' // dc弹框
|
2021-05-12 16:19:43 +08:00
|
|
|
|
import cabinetBox from '@/components/common/rightBox/cabinetBox' // dc弹框
|
2022-09-16 09:50:02 +08:00
|
|
|
|
// import trafficSettingBox from '@/components/common/rightBox/trafficSetting/trafficSettingBox'
|
2021-04-08 20:28:54 +08:00
|
|
|
|
import deleteButton from '@/components/common/deleteButton'
|
|
|
|
|
|
import nzDataList from '@/components/common/table/nzDataList'
|
2021-04-13 20:33:12 +08:00
|
|
|
|
import dataListMixin from '@/components/common/mixin/dataList'
|
|
|
|
|
|
import dcTable from '@/components/common/table/settings/dcTable'
|
2021-07-20 10:55:27 +08:00
|
|
|
|
import topToolMoreOptions from '@/components/common/popBox/topToolMoreOptions'
|
2021-10-21 10:04:01 +08:00
|
|
|
|
import nzDetailView from '@/components/common/detailView/nzDetailView'
|
|
|
|
|
|
import detailViewMixin from '@/components/common/mixin/detailViewMixin'
|
|
|
|
|
|
import dcDetail from '@/components/common/detailView/list/dc/dcDetail'
|
2022-09-16 09:50:02 +08:00
|
|
|
|
// import detailViewTopSearch from '@/components/common/detailView/detailViewTopSearch'
|
2021-11-05 12:48:19 +08:00
|
|
|
|
import bus from '@/libs/bus'
|
2021-10-21 10:04:01 +08:00
|
|
|
|
|
2021-03-19 18:52:19 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: 'dc',
|
|
|
|
|
|
components: {
|
2021-04-08 20:28:54 +08:00
|
|
|
|
dcBox,
|
|
|
|
|
|
deleteButton,
|
2021-04-13 20:33:12 +08:00
|
|
|
|
nzDataList,
|
2021-05-12 16:19:43 +08:00
|
|
|
|
dcTable,
|
2021-07-20 10:55:27 +08:00
|
|
|
|
cabinetBox,
|
2021-10-21 10:04:01 +08:00
|
|
|
|
topToolMoreOptions,
|
|
|
|
|
|
nzDetailView,
|
2021-11-05 20:19:26 +08:00
|
|
|
|
dcDetail
|
2021-03-19 18:52:19 +08:00
|
|
|
|
},
|
2021-11-05 20:19:26 +08:00
|
|
|
|
mixins: [dataListMixin, detailViewMixin],
|
2021-03-19 18:52:19 +08:00
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
2021-04-13 20:33:12 +08:00
|
|
|
|
url: 'dc',
|
2021-03-19 18:52:19 +08:00
|
|
|
|
tableId: 'dcTable', // 需要分页的table的id,用于记录每页数量
|
2021-04-08 20:28:54 +08:00
|
|
|
|
blankObject: {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
id: '',
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
location: '',
|
|
|
|
|
|
tel: '',
|
|
|
|
|
|
principal: '',
|
|
|
|
|
|
state: 'ON',
|
2021-11-05 20:19:26 +08:00
|
|
|
|
longitude: '',
|
|
|
|
|
|
latitude: '',
|
|
|
|
|
|
lnglat: ''
|
2020-02-21 17:57:19 +08:00
|
|
|
|
},
|
2021-05-12 16:19:43 +08:00
|
|
|
|
cabinet: {
|
|
|
|
|
|
id: '',
|
|
|
|
|
|
idcId: '',
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
remark: '',
|
|
|
|
|
|
seq: '',
|
|
|
|
|
|
uSize: 1
|
|
|
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
|
searchMsg: { // 给搜索框子组件传递的信息
|
|
|
|
|
|
zheze_none: true,
|
2021-05-10 15:59:39 +08:00
|
|
|
|
searchLabelList: [
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'ID',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
label: 'ids',
|
|
|
|
|
|
disabled: false
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: this.$t('overall.name'),
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
label: 'name',
|
|
|
|
|
|
disabled: false
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: this.$t('asset.location'),
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
label: 'location',
|
|
|
|
|
|
disabled: false
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
2022-06-16 15:58:17 +08:00
|
|
|
|
name: this.$t('overall.state'),
|
2021-05-10 15:59:39 +08:00
|
|
|
|
type: 'selectString',
|
|
|
|
|
|
label: 'dcState',
|
2021-09-27 18:06:41 +08:00
|
|
|
|
readonly: true,
|
2021-05-10 15:59:39 +08:00
|
|
|
|
disabled: false
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2020-03-30 14:14:09 +08:00
|
|
|
|
},
|
2021-04-13 20:33:12 +08:00
|
|
|
|
regNum: /^[0-9]+.?[0-9]*/,
|
2021-05-12 16:19:43 +08:00
|
|
|
|
userData: [],
|
2022-02-25 14:07:17 +08:00
|
|
|
|
cabinetBoxShow: false,
|
|
|
|
|
|
needAlertDaysData: true,
|
|
|
|
|
|
trendKey: 'dcId'
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-06-14 16:12:27 +08:00
|
|
|
|
computed: {
|
|
|
|
|
|
addCabinetBoxShow () {
|
|
|
|
|
|
return this.$store.getters.getAddCabinetBoxParams
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
|
methods: {
|
|
|
|
|
|
getUserData () {
|
|
|
|
|
|
return new Promise(resolve => {
|
2021-04-08 19:36:14 +08:00
|
|
|
|
this.$get('sys/user', { pageSize: -1, pageNo: 1 }).then(response => {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.userData = response.data.list
|
2020-12-31 17:41:40 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
resolve()
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
regNumTest (val) { // 校验是否是数字
|
2021-04-13 20:33:12 +08:00
|
|
|
|
return this.regNum.test(val)
|
2021-05-12 16:19:43 +08:00
|
|
|
|
},
|
2022-06-14 16:12:27 +08:00
|
|
|
|
addCabinet (params) {
|
|
|
|
|
|
if (params) {
|
|
|
|
|
|
this.cabinet.idcId = params.dcid
|
|
|
|
|
|
}
|
2021-05-12 16:19:43 +08:00
|
|
|
|
this.cabinetBoxShow = true
|
|
|
|
|
|
},
|
2021-12-21 18:28:54 +08:00
|
|
|
|
add () {
|
2023-11-21 15:57:37 +08:00
|
|
|
|
this.$get('/sys/config/key/map_center_config').then(response => {
|
2021-12-21 18:28:54 +08:00
|
|
|
|
if (response.code === 200) {
|
2023-11-21 15:57:37 +08:00
|
|
|
|
const mapParam = JSON.parse(response.data.paramValue)
|
2021-12-21 18:28:54 +08:00
|
|
|
|
this.object = this.newObject()
|
|
|
|
|
|
this.object.longitude = mapParam.longitude
|
|
|
|
|
|
this.object.latitude = mapParam.latitude
|
|
|
|
|
|
this.rightBox.show = true
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2021-05-12 16:19:43 +08:00
|
|
|
|
closeRightBox (refresh) {
|
|
|
|
|
|
this.rightBox.show = false
|
|
|
|
|
|
this.cabinetBoxShow = false
|
2022-06-14 16:12:27 +08:00
|
|
|
|
this.$store.dispatch('addCabinet', { dcid: '', cabinetBoxShow: false })
|
2021-05-12 16:19:43 +08:00
|
|
|
|
if (refresh) {
|
|
|
|
|
|
this.delFlag = true
|
|
|
|
|
|
this.getTableData()
|
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
mounted () {
|
2021-11-05 12:48:19 +08:00
|
|
|
|
bus.$on('cabinet-tab', () => {
|
|
|
|
|
|
this.getTableData()
|
|
|
|
|
|
})
|
2021-03-19 18:52:19 +08:00
|
|
|
|
this.getUserData()
|
2021-05-12 16:19:43 +08:00
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
$route: {
|
|
|
|
|
|
immediate: true,
|
|
|
|
|
|
handler () {
|
|
|
|
|
|
// 是否弹出侧滑
|
|
|
|
|
|
const add = this.$route.query.add
|
|
|
|
|
|
if (add) {
|
|
|
|
|
|
if (add === 'dc') {
|
|
|
|
|
|
this.add()
|
|
|
|
|
|
}
|
|
|
|
|
|
if (add === 'cabinet') {
|
|
|
|
|
|
this.addCabinet()
|
|
|
|
|
|
}
|
2023-03-02 11:34:42 +08:00
|
|
|
|
const newQuery = JSON.parse(JSON.stringify(this.$route.query)) // 深拷贝
|
|
|
|
|
|
delete newQuery.add
|
|
|
|
|
|
this.$router.replace({ query: newQuery })
|
2021-05-12 16:19:43 +08:00
|
|
|
|
}
|
2021-05-11 22:29:14 +08:00
|
|
|
|
}
|
2022-06-14 16:12:27 +08:00
|
|
|
|
},
|
|
|
|
|
|
addCabinetBoxShow: {
|
|
|
|
|
|
handler (n) {
|
|
|
|
|
|
this.cabinetBoxShow = n.cabinetBoxShow
|
|
|
|
|
|
this.cabinet.idcId = n.dcId
|
|
|
|
|
|
}
|
2021-05-11 22:29:14 +08:00
|
|
|
|
}
|
2020-02-21 17:57:19 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
2020-02-21 17:57:19 +08:00
|
|
|
|
</script>
|