Merge branch 'dev-3.10' of git.mesalab.cn:nezha/nezha-fronted into dev-3.10
This commit is contained in:
@@ -30,3 +30,19 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.licenseStatus{
|
||||
padding: 20px 15px;
|
||||
background: $--background-color-empty;
|
||||
border-radius: 3px;
|
||||
transform: translate(0,20px);
|
||||
.licenseStatus-title{
|
||||
color: $--color-text-regular;
|
||||
}
|
||||
.licenseStatus-date{
|
||||
color: $--color-text-primary;
|
||||
i{
|
||||
color: $--color-primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,6 +73,9 @@ export default {
|
||||
if (typeof (itemValue) === 'string') {
|
||||
itemValue = Number(itemValue)
|
||||
}
|
||||
// if (typeof (itemValue) !== 'undefined' && isNaN(itemValue)) {
|
||||
// itemValue = null
|
||||
// }
|
||||
if (itemValue === null && nullValueMode !== 'null') {
|
||||
if (nullValueMode === 'zero') {
|
||||
itemValue = 0
|
||||
@@ -341,7 +344,10 @@ export default {
|
||||
paramsDot = 6
|
||||
}
|
||||
const val = typeof (item.value[1]) == 'undefined' ? 0 : formatScientificNotation(item.value[1], paramsDot)
|
||||
const showVal = typeof (item.value[1]) == 'undefined' ? '' : chartDataFormat.getUnit(unit).compute(val, null, -1, decimals)
|
||||
let showVal = typeof (item.value[1]) == 'undefined' ? '' : chartDataFormat.getUnit(unit).compute(val, null, -1, decimals)
|
||||
if ((item.value[1] + '') === 'NaN') {
|
||||
showVal = 'NaN'
|
||||
}
|
||||
sum += isNaN(self.numberWithEConvent(val)) ? 0 : parseFloat(self.numberWithEConvent(val))
|
||||
let previousDom = ''
|
||||
if (previousItem) {
|
||||
|
||||
@@ -12,6 +12,9 @@ function stack (data, omit) {
|
||||
if (typeof (v) === 'undefined') {
|
||||
return accum[i]
|
||||
}
|
||||
if (isNaN(v)) {
|
||||
return accum[i]
|
||||
}
|
||||
return (accum[i] += +v)
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -83,11 +83,11 @@
|
||||
<!-- notebook Tab -->
|
||||
<notebook-tab @getTableData="getTableData" v-if="from === fromRoute.notebook && targetTab === 'notebookTab'" :from="from" :obj="obj" :tabs="tabs.notebook" @changeTab="changeTab" :targetTab.sync="targetTab"></notebook-tab>
|
||||
<!--softwareAsset列表的tab-->
|
||||
<endpointTabNew v-if="from === fromRoute.softwareAsset && targetTab === 'endpoint'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="softwareAssetTbas" :targetTab="targetTab" @changeTab="changeTab"></endpointTabNew>
|
||||
<licenseManagementTab v-if="from === fromRoute.softwareAsset && targetTab === 'licenseManagement'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="softwareAssetTbas" :targetTab="targetTab" @changeTab="changeTab"></licenseManagementTab>
|
||||
<!-- <endpointTabNew v-if="from === fromRoute.softwareAsset && targetTab === 'endpoint'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="softwareAssetTbas" :targetTab="targetTab" @changeTab="changeTab"></endpointTabNew> -->
|
||||
<!-- <licenseManagementTab v-if="from === fromRoute.softwareAsset && targetTab === 'licenseManagement'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="softwareAssetTbas" :targetTab="targetTab" @changeTab="changeTab"></licenseManagementTab> -->
|
||||
|
||||
<!--softwareType 下滑-->
|
||||
<softwareAsset v-if="(from === fromRoute.softwareType) && targetTab === 'softwareAsset'" :tabs="tabs.softwareType" ref="assetTab" :from="from" :obj="obj" @changeTab="changeTab" @exit="closeSubList" :targetTab.sync="targetTab"></softwareAsset>
|
||||
<softwareAssetTab v-if="(from === fromRoute.softwareType) && targetTab === 'softwareAsset'" :tabs="tabs.softwareType" ref="assetTab" :from="from" :obj="obj" @changeTab="changeTab" @exit="closeSubList" :targetTab.sync="targetTab"></softwareAssetTab>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -126,7 +126,7 @@ import discoveryTab from '@/components/common/bottomBox/tabs/discoveryTab'
|
||||
import IpDetails from '@/components/common/bottomBox/tabs/IpDetails'
|
||||
import recordRuleEvalLog from '@/components/common/bottomBox/tabs/recordRuleEvalLog'
|
||||
import notebookTab from '@/components/common/bottomBox/tabs/notebookTab'
|
||||
import softwareAsset from '@/components/common/bottomBox/tabs/softwareAsset'
|
||||
import softwareAssetTab from '@/components/common/bottomBox/tabs/softwareAssetTab'
|
||||
import licenseManagementTab from '@/components/common/bottomBox/tabs/licenseManagementTab'
|
||||
|
||||
export default {
|
||||
@@ -163,7 +163,7 @@ export default {
|
||||
vsysBottomTab,
|
||||
rolesTab,
|
||||
notebookTab,
|
||||
softwareAsset,
|
||||
softwareAssetTab,
|
||||
licenseManagementTab
|
||||
},
|
||||
props: {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<nz-bottom-data-list
|
||||
:showTitle='showTitle'
|
||||
:obj='obj'
|
||||
@@ -22,7 +23,7 @@
|
||||
:loading="tools.loading"
|
||||
:api="url"
|
||||
:custom-table-title="tools.customTableTitle"
|
||||
:height="mainTableHeight"
|
||||
:height="subTableHeight"
|
||||
:table-data="tableData"
|
||||
@del="del"
|
||||
@edit="edit"
|
||||
@@ -36,22 +37,26 @@
|
||||
<Pagination ref="Pagination" :pageObj="pageObj" :tableId="tableId" @pageNo='pageNo' @pageSize='pageSize'></Pagination>
|
||||
</template>
|
||||
</nz-bottom-data-list>
|
||||
<transition name="right-box">
|
||||
<softwareAssetBox v-if="rightBox.show" :obj="object" @close="closeRightBox"></softwareAssetBox>
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dataListMixin from '@/components/common/mixin/dataList'
|
||||
import subDataListMixin from '@/components/common/mixin/subDataList'
|
||||
import nzBottomDataList from '@/components/common/bottomBox/nzBottomDataList'
|
||||
import { fromRoute } from '@/components/common/js/constants'
|
||||
import detailViewRightMixin from '@/components/common/mixin/detailViewRightMixin'
|
||||
import softwareAssetTable from '@/components/common/table/settings/softwareAssetTable'
|
||||
|
||||
import softwareAssetBox from '@/components/common/rightBox/software/softwareAssetBox'
|
||||
export default {
|
||||
name: 'softwareAssetTab',
|
||||
mixins: [dataListMixin, subDataListMixin, detailViewRightMixin],
|
||||
components: {
|
||||
nzBottomDataList,
|
||||
softwareAssetTable
|
||||
softwareAssetTable,
|
||||
softwareAssetBox
|
||||
},
|
||||
computed: {
|
||||
externalTerminal () {
|
||||
@@ -89,14 +94,6 @@ export default {
|
||||
},
|
||||
objectSilence: {},
|
||||
silenceBoxShow: false,
|
||||
searchLabel: { dcIds: this.obj.id },
|
||||
brandData: [],
|
||||
modelData: [],
|
||||
stateData: [],
|
||||
typeData: [],
|
||||
dcData: [],
|
||||
snmpCredentialData: [],
|
||||
fieldGroupData: [],
|
||||
needAlertDaysData: true,
|
||||
trendKey: 'assetId',
|
||||
fromBottom: true
|
||||
@@ -163,20 +160,11 @@ export default {
|
||||
this.tableData = response.data.list
|
||||
const globalSearchId = this.$store.getters.getGlobalSearchId
|
||||
let detailViewRightObj = ''
|
||||
if (this.tableId === 'notebookTable' && this.detailType === 'view') { // 防止详情视图编辑后切换到别的数据
|
||||
const obj = this.tableData.find(item => item.id === this.detailViewRightObj.id)
|
||||
if (obj) {
|
||||
detailViewRightObj = obj
|
||||
} else {
|
||||
detailViewRightObj = this.tableData[0]
|
||||
}
|
||||
} else {
|
||||
if (globalSearchId) {
|
||||
detailViewRightObj = this.tableData.find(item => item.id === globalSearchId)
|
||||
} else {
|
||||
detailViewRightObj = this.tableData[0]
|
||||
}
|
||||
}
|
||||
this.detailViewRightObj = this.$lodash.cloneDeep(detailViewRightObj)
|
||||
this.pageObj.total = response.data.total
|
||||
this.pageObj.pages = response.data.pages
|
||||
@@ -193,7 +181,7 @@ export default {
|
||||
this.$message.error(response.error || response.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
obj: {
|
||||
@@ -834,10 +834,10 @@ export default {
|
||||
},
|
||||
jsonKey: 'val'
|
||||
},
|
||||
dc: {
|
||||
dcIds: {
|
||||
target: this.searchLabel,
|
||||
isSearchInput: true,
|
||||
propertyName: 'dc',
|
||||
propertyName: 'dcIds',
|
||||
type: 'number',
|
||||
defaultJson: {
|
||||
name: 'Date center',
|
||||
@@ -1137,10 +1137,10 @@ export default {
|
||||
},
|
||||
jsonKey: 'val'
|
||||
},
|
||||
dc: {
|
||||
dcIds: {
|
||||
target: this.searchLabel,
|
||||
isSearchInput: true,
|
||||
propertyName: 'dc',
|
||||
propertyName: 'dcIds',
|
||||
type: 'number',
|
||||
defaultJson: {
|
||||
name: 'Date center',
|
||||
|
||||
@@ -75,17 +75,14 @@ export default {
|
||||
break
|
||||
}
|
||||
case 'sync': {
|
||||
// this.$emit('copy', row)
|
||||
this.$emit('sync', row)
|
||||
break
|
||||
}
|
||||
case 'fastSilence': {
|
||||
// this.$emit('copy', row)
|
||||
this.$emit('addSilence', row, param)
|
||||
break
|
||||
}
|
||||
case 'topology': {
|
||||
// this.$emit('copy', row)
|
||||
this.$emit('topology', row, param)
|
||||
break
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<el-input placeholder="" maxlength="64" show-word-limit v-model="editAssetMeta.name" size="small" id="editAssetMeta-box-input-name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label='$t("overall.key")' prop="metaKey">
|
||||
<el-input placeholder="" maxlength="128" show-word-limit v-model="editAssetMeta.metaKey" size="small" id="editAssetMeta-box-input-key"></el-input>
|
||||
<el-input :disabled="!!(editAssetMeta.id)" placeholder="" maxlength="128" show-word-limit v-model="editAssetMeta.metaKey" size="small" id="editAssetMeta-box-input-key"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label='$t("dashboard.dashboard.chartForm.group")' prop="groupId">
|
||||
<el-select v-model="editAssetMeta.groupId" size="small" class="right-box__select" :placeholder="$t('el.select.placeholder')" popper-class="right-box-select-top prevent-clickoutside" :popper-append-to-body="false">
|
||||
@@ -336,9 +336,7 @@ export default {
|
||||
t.disabled = false
|
||||
})
|
||||
} else if (value == 1) {
|
||||
if (this.editAssetMeta.type !== 'RADIO' &&
|
||||
this.editAssetMeta.type !== 'CHECKBOX' &&
|
||||
this.editAssetMeta.type !== 'SELECT') {
|
||||
if (this.editAssetMeta.type !== 'RADIO' && this.editAssetMeta.type !== 'CHECKBOX' && this.editAssetMeta.type !== 'SELECT') {
|
||||
flag = false
|
||||
this.editAssetMeta.type = 'RADIO'
|
||||
}
|
||||
|
||||
@@ -15,11 +15,12 @@
|
||||
</el-form-item>
|
||||
<!--type-->
|
||||
<el-form-item :label="$t('softwareType.text')" prop="typeId" class="select-warp">
|
||||
<!-- <el-input maxlength="128" show-word-limit v-model="editSoftwareAsset.type" size="small" type="text"></el-input>-->
|
||||
<!-- <el-input maxlength="128" show-word-limit v-model="editSoftwareAsset.type" size="small" type="text"></el-input> -->
|
||||
<el-select v-model="editSoftwareAsset.typeId" size="small" class="right-box__select" popper-class="right-box-select-top prevent-clickoutside" @change="renderParams">
|
||||
<el-option v-for="item in softwareTypeArr" :key="item.id" :value="item.id" :label="item.name"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- asset -->
|
||||
<el-form-item :label='$t("asset.asset")' label-width="125px" prop="assetId" v-if="!disabled">
|
||||
<v-selectpage
|
||||
:data="assetList"
|
||||
@@ -40,12 +41,6 @@
|
||||
:result-format="resultFormat"
|
||||
></v-selectpage>
|
||||
</el-form-item>
|
||||
<!--project-->
|
||||
<el-form-item :label='$t("project.project.projectName")' class="select-warp" prop="projectId">
|
||||
<el-select id="add-endpoint-project" v-model="editSoftwareAsset.projectId" class="right-box__select" clearable placeholder="" popper-class="right-box-select-top prevent-clickoutside" size="small" value-key="id">
|
||||
<el-option v-for="item in projectList" :id="'project-'+item.id" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!--remark-->
|
||||
<el-form-item :label="$t('overall.remark')" prop="remark">
|
||||
<el-input maxlength="256" show-word-limit v-model="editSoftwareAsset.remark" size="small" :rows="2" type="textarea"></el-input>
|
||||
@@ -57,7 +52,7 @@
|
||||
<!-- <el-form-item v-for="(value, key) in editSoftwareAsset.params" :label="key" :key="key">-->
|
||||
<!-- <el-input maxlength="128" show-word-limit v-model="editSoftwareAsset.params[key]" size="small" type="text" @input="$forceUpdate()"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item prop="paramObj">
|
||||
<el-form-item prop="paramObj" v-my-loading="loading">
|
||||
<div v-for="(label, i) in editSoftwareAsset.paramObj" :key="i" class="form__dotted-item form__dotted-item-required">
|
||||
<el-form-item :prop="'paramObj.' + i + '.value.0'" :rules="[ { required: JSON.parse(label.param).required === '1', message: $t('validate.required'), trigger: 'blur' }]">
|
||||
<template v-slot:label>
|
||||
@@ -160,7 +155,7 @@ import editRigthBox from '../../mixin/editRigthBox'
|
||||
import { sysObjectIdInput } from '@/components/common/js/validate'
|
||||
import iconList from '@/components/common/js/iconList'
|
||||
import { asset as assetConstants } from '@/components/common/js/constants'
|
||||
|
||||
import axios from 'axios'
|
||||
export default {
|
||||
name: 'softwareAssetBox',
|
||||
components: {
|
||||
@@ -190,7 +185,6 @@ export default {
|
||||
name: '',
|
||||
typeId: '',
|
||||
assetId: '',
|
||||
projectId: '',
|
||||
params: {},
|
||||
remark: ''
|
||||
},
|
||||
@@ -209,7 +203,6 @@ export default {
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
projectList: [],
|
||||
softwareTypeArr: [],
|
||||
assetList: [],
|
||||
columns: [
|
||||
@@ -254,7 +247,8 @@ export default {
|
||||
return row.dc ? row.dc.name : ''
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -264,23 +258,13 @@ export default {
|
||||
handler (n) {
|
||||
this.isEdit = true
|
||||
const editSoftwareAsset = JSON.parse(JSON.stringify(n))
|
||||
editSoftwareAsset.paramObj = []
|
||||
if (editSoftwareAsset.projectId === -1) {
|
||||
editSoftwareAsset.projectId = ''
|
||||
}
|
||||
editSoftwareAsset.assetId = ''
|
||||
// if (editSoftwareAsset.params) {
|
||||
// Object.keys(editSoftwareAsset.params).forEach(key => {
|
||||
// editSoftwareAsset.paramObj.push(editSoftwareAsset.params[key])
|
||||
// })
|
||||
// }
|
||||
this.editSoftwareAsset = editSoftwareAsset
|
||||
this.oldData = this.$lodash.cloneDeep(this.editSoftwareAsset)
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getProjectList()
|
||||
this.getAsset()
|
||||
this.getSoftwareTypeList()
|
||||
},
|
||||
@@ -316,15 +300,14 @@ export default {
|
||||
const params = {
|
||||
...this.editSoftwareAsset
|
||||
}
|
||||
params.params = {}
|
||||
params.paramObj.forEach(item => {
|
||||
if (item.type === 'CHECKBOX') {
|
||||
params.params[item.metaKey] = item.value
|
||||
} else if (item.type === 'DATETIME' && JSON.parse(item.param).interval) {
|
||||
params.params[item.metaKey] = item.value
|
||||
} else {
|
||||
params.params[item.metaKey] = item.value[0]
|
||||
params.params = {
|
||||
connectorAttributeKeys: []
|
||||
}
|
||||
params.paramObj.forEach(item => {
|
||||
params.params.connectorAttributeKeys.push({
|
||||
key: item.metaKey,
|
||||
value: item.value
|
||||
})
|
||||
})
|
||||
params.icon = this.imageUrl
|
||||
if (this.editSoftwareAsset.id) {
|
||||
@@ -354,14 +337,6 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
/* 获取project列表 */
|
||||
getProjectList () {
|
||||
this.$get('monitor/project', { pageSize: -1, pageNo: 1 }).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.projectList = response.data.list
|
||||
}
|
||||
})
|
||||
},
|
||||
/* 获取asset列表 */
|
||||
getAsset () {
|
||||
this.$get('asset/asset', { pageSize: -1 }).then(res => {
|
||||
@@ -387,21 +362,58 @@ export default {
|
||||
return assetData
|
||||
}
|
||||
},
|
||||
renderParams () {
|
||||
this.editSoftwareAsset.paramObj = []
|
||||
async renderParams () {
|
||||
// 获取当前type的attributes key
|
||||
this.loading = true
|
||||
const findItem = this.softwareTypeArr.find(item => item.id == this.editSoftwareAsset.typeId)
|
||||
if (findItem.params) {
|
||||
Object.keys(findItem.params).forEach(key => {
|
||||
if (findItem.params[key].type === 'CHECKBOX') {
|
||||
findItem.params[key].value = this.editSoftwareAsset.params[key] ? this.editSoftwareAsset.params[key] : findItem.params[key].value
|
||||
} else if (findItem.params[key].type === 'DATETIME' && JSON.parse(findItem.params[key].param).interval) {
|
||||
findItem.params[key].value = this.editSoftwareAsset.params[key] ? this.editSoftwareAsset.params[key] : findItem.params[key].value
|
||||
} else {
|
||||
findItem.params[key].value = this.editSoftwareAsset.params[key] ? [this.editSoftwareAsset.params[key]] : findItem.params[key].value
|
||||
}
|
||||
this.editSoftwareAsset.paramObj.push(findItem.params[key])
|
||||
const connectorAttributeKeys = this.$lodash.get(findItem, 'params.connectorAttributeKeys', [])
|
||||
const requests = connectorAttributeKeys.map(key => {
|
||||
return this.$get('asset/field/meta', { key: key })
|
||||
})
|
||||
const paramObj = []
|
||||
const res = await axios.all(requests)
|
||||
res.forEach(response => {
|
||||
const data = this.$lodash.get(response, 'data.list.0')
|
||||
if (data) {
|
||||
paramObj.push({ ...data, value: this.blankLabelValue(data), action: 0 })
|
||||
}
|
||||
})
|
||||
// 设置填写过的值
|
||||
const keyValue = this.$lodash.get(this.editSoftwareAsset, 'params.connectorAttributeKeys', [])
|
||||
paramObj.forEach(item => {
|
||||
const findValue = keyValue.find(subItem => subItem.key == item.metaKey)?.value
|
||||
findValue && (item.value = findValue)
|
||||
})
|
||||
this.$set(this.editSoftwareAsset, 'paramObj', paramObj)
|
||||
this.oldData = this.$lodash.cloneDeep(this.editSoftwareAsset)
|
||||
this.loading = false
|
||||
},
|
||||
blankLabelValue (label) {
|
||||
const defaultValue = JSON.parse(label.param).default || ''
|
||||
if (label.type.toUpperCase() === this.assetConstants.labelTypeData.CHECKBOX) {
|
||||
const arr = []
|
||||
if (label.param && JSON.parse(label.param).items) {
|
||||
JSON.parse(label.param).items.forEach(item => {
|
||||
if (item.check) {
|
||||
arr.push(item.name)
|
||||
}
|
||||
})
|
||||
}
|
||||
return arr
|
||||
} else if (label.type.toUpperCase() === this.assetConstants.labelTypeData.MULTITEXT || label.type.toUpperCase() === assetConstants.labelTypeData.TEXT || label.type.toUpperCase() === assetConstants.labelTypeData.TEXTAREA) {
|
||||
return [defaultValue]
|
||||
} else if (label.type.toUpperCase() === this.assetConstants.labelTypeData.RADIO || label.type.toUpperCase() === assetConstants.labelTypeData.SELECT) {
|
||||
const arr = ['']
|
||||
if (label.param && JSON.parse(label.param).items) {
|
||||
JSON.parse(label.param).items.forEach(item => {
|
||||
if (item.check) {
|
||||
arr[0] = item.name
|
||||
}
|
||||
})
|
||||
}
|
||||
return arr
|
||||
} else {
|
||||
return [defaultValue]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@
|
||||
<div class="form__sub-title" >
|
||||
<span>{{$t('softwareType.params')}}</span>
|
||||
</div>
|
||||
<el-form-item prop="paramObj">
|
||||
<!-- 此处属性只展示不可修改 -->
|
||||
<el-form-item prop="paramObj" v-my-loading="loading">
|
||||
<div v-for="(label, i) in editSoftwareType.paramObj" :key="i" class="form__dotted-item form__dotted-item-required">
|
||||
<el-form-item :prop="'paramObj.' + i + '.value.0'" :rules="[]">
|
||||
<template v-slot:label>
|
||||
@@ -56,56 +57,59 @@
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="label.action !== 1">
|
||||
<!-- TEXT -->
|
||||
<template v-if="label.type.toUpperCase() === assetConstants.labelTypeData.TEXT">
|
||||
<el-input v-model="label.value[0]" size="small"/>
|
||||
<el-input disabled v-model="label.value[0]" size="small"/>
|
||||
</template>
|
||||
<!-- PASSWORD -->
|
||||
<template v-else-if="label.type.toUpperCase() === assetConstants.labelTypeData.PASSWORD">
|
||||
<el-input v-model="label.value[0]" type="password" size="small"/>
|
||||
</template>
|
||||
<template v-else-if="label.type.toUpperCase() === assetConstants.labelTypeData.MULTITEXT">
|
||||
<div v-for="(value, i) in label.value" :key="i" class="label__multi-text">
|
||||
<el-input v-model="label.value[i]" size="small"/>
|
||||
<span @click="addMultiTextRow(label)" style="margin: 0 5px" :title="$t('tip.add')"><i class="nz-icon nz-icon-plus"></i></span>
|
||||
<span @click="removeMultiTextRow(label, i)" :title="$t('overall.delete')"><i class="nz-icon nz-icon-minus"></i></span>
|
||||
</div>
|
||||
<el-input disabled v-model="label.value[0]" type="password" size="small"/>
|
||||
</template>
|
||||
<!-- TEXTAREA -->
|
||||
<template v-else-if="label.type.toUpperCase() === assetConstants.labelTypeData.TEXTAREA">
|
||||
<el-input v-model="label.value[0]" :maxlength="4096" show-word-limit size="small" :rows="2" type="textarea"/>
|
||||
<el-input disabled v-model="label.value[0]" :maxlength="4096" show-word-limit size="small" :rows="2" type="textarea"/>
|
||||
</template>
|
||||
<!-- RADIO -->
|
||||
<template v-else-if="label.type.toUpperCase() === assetConstants.labelTypeData.RADIO">
|
||||
<el-radio-group v-model="label.value[0]">
|
||||
<el-radio-group disabled v-model="label.value[0]">
|
||||
<el-radio v-for="item in JSON.parse(label.param).items" :key="item.name" :label="item.name">{{item.name}}</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
<!-- CHECKBOX -->
|
||||
<template v-else-if="label.type.toUpperCase() === assetConstants.labelTypeData.CHECKBOX">
|
||||
<el-checkbox-group v-model="label.value">
|
||||
<el-checkbox-group disabled v-model="label.value">
|
||||
<el-checkbox v-for="item in JSON.parse(label.param).items" :key="item.name" :label="item.name" :value="item.name"></el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</template>
|
||||
<!-- SELECT -->
|
||||
<template v-else-if="label.type.toUpperCase() === assetConstants.labelTypeData.SELECT">
|
||||
<el-select v-model="label.value[0]" class="right-box__select" :placeholder="$t('el.select.placeholder')" popper-class="right-box-select-top prevent-clickoutside" size="small">
|
||||
<el-select disabled v-model="label.value[0]" class="right-box__select" :placeholder="$t('el.select.placeholder')" popper-class="right-box-select-top prevent-clickoutside" size="small">
|
||||
<el-option v-for="item in JSON.parse(label.param).items" :key="item.name" :label="item.name" :value="item.name"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<!-- INTEGER -->
|
||||
<template v-else-if="label.type.toUpperCase() === assetConstants.labelTypeData.INTEGER">
|
||||
<el-input v-model="label.value[0]" oninput="value=value.replace(/[^\d]/g,'')" size="small"></el-input>
|
||||
<el-input disabled v-model="label.value[0]" oninput="value=value.replace(/[^\d]/g,'')" size="small"></el-input>
|
||||
</template>
|
||||
<!-- DOUBLE -->
|
||||
<template v-else-if="label.type.toUpperCase() === assetConstants.labelTypeData.DOUBLE">
|
||||
<el-input-number v-model="label.value[0]" :controls="false" size="small" :precision="JSON.parse(label.param).decimals" style="width: 100%;text-align: left" :max="10000000000000000000" :min="-10000000000000000000"></el-input-number>
|
||||
<el-input-number disabled v-model="label.value[0]" :controls="false" size="small" :precision="JSON.parse(label.param).decimals" style="width: 100%;text-align: left" :max="10000000000000000000" :min="-10000000000000000000"></el-input-number>
|
||||
</template>
|
||||
<!-- DATETIME -->
|
||||
<template v-else-if="label.type.toUpperCase() === assetConstants.labelTypeData.DATETIME">
|
||||
<template v-if="JSON.parse(label.param).subType === assetConstants.labelSubTypeData.time">
|
||||
<div v-if="JSON.parse(label.param).interval" style="display: flex; justify-content: space-between">
|
||||
<el-time-select v-model="label.value[0]" size="small"></el-time-select>
|
||||
<el-time-select v-model="label.value[1]" size="small"></el-time-select>
|
||||
<el-time-select disabled v-model="label.value[0]" size="small"></el-time-select>
|
||||
<el-time-select disabled v-model="label.value[1]" size="small"></el-time-select>
|
||||
</div>
|
||||
<template v-else>
|
||||
<el-time-select v-model="label.value[0]" size="small" style="width: 100%"></el-time-select>
|
||||
<el-time-select disabled v-model="label.value[0]" size="small" style="width: 100%"></el-time-select>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="JSON.parse(label.param).interval">
|
||||
<my-date-picker
|
||||
disabled
|
||||
id="asset-box-input-purchase-date"
|
||||
v-model="label.value"
|
||||
:type="JSON.parse(label.param).subType === assetConstants.labelSubTypeData.date ? 'daterange' : 'datetimerange'"
|
||||
@@ -118,6 +122,7 @@
|
||||
</template>
|
||||
<template v-else>
|
||||
<my-date-picker
|
||||
disabled
|
||||
id="asset-box-input-parchase-date"
|
||||
v-model="label.value[0]"
|
||||
:type="JSON.parse(label.param).subType"
|
||||
@@ -130,8 +135,9 @@
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
<!-- EMAIL -->
|
||||
<template v-else-if="label.type.toUpperCase() === assetConstants.labelTypeData.EMAIL">
|
||||
<el-input v-model="label.value[0]" size="small"/>
|
||||
<el-input disabled v-model="label.value[0]" size="small"/>
|
||||
</template>
|
||||
</template>
|
||||
</el-form-item>
|
||||
@@ -171,7 +177,7 @@ import editRigthBox from '../../mixin/editRigthBox'
|
||||
import { sysObjectIdInput } from '@/components/common/js/validate'
|
||||
import iconList from '@/components/common/js/iconList'
|
||||
import { asset as assetConstants } from '@/components/common/js/constants'
|
||||
|
||||
import axios from 'axios'
|
||||
export default {
|
||||
name: 'softwareTypeBox',
|
||||
components: {
|
||||
@@ -252,7 +258,8 @@ export default {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -263,13 +270,8 @@ export default {
|
||||
this.isEdit = true
|
||||
const editSoftwareType = JSON.parse(JSON.stringify(n))
|
||||
this.imageUrl = editSoftwareType.icon
|
||||
editSoftwareType.paramObj = []
|
||||
if (editSoftwareType.params) {
|
||||
Object.keys(editSoftwareType.params).forEach(key => {
|
||||
editSoftwareType.paramObj.push(editSoftwareType.params[key])
|
||||
})
|
||||
}
|
||||
this.editSoftwareType = editSoftwareType
|
||||
this.renderParams()
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -279,6 +281,24 @@ export default {
|
||||
this.getFieldGroupData()
|
||||
},
|
||||
methods: {
|
||||
// 根据key 请求Asset attributes
|
||||
async renderParams () {
|
||||
this.loading = true
|
||||
const connectorAttributeKeys = this.$lodash.get(this.editSoftwareType, 'params.connectorAttributeKeys', [])
|
||||
const requests = connectorAttributeKeys.map(key => {
|
||||
return this.$get('asset/field/meta', { key: key })
|
||||
})
|
||||
const paramObj = []
|
||||
const res = await axios.all(requests)
|
||||
res.forEach(response => {
|
||||
const data = this.$lodash.get(response, 'data.list.0')
|
||||
if (data) {
|
||||
paramObj.push({ ...data, value: this.blankLabelValue(data), action: 0 })
|
||||
}
|
||||
})
|
||||
this.$set(this.editSoftwareType, 'paramObj', paramObj)
|
||||
this.loading = false
|
||||
},
|
||||
clickOutside () {
|
||||
this.esc(false)
|
||||
},
|
||||
@@ -313,9 +333,11 @@ export default {
|
||||
...this.editSoftwareType
|
||||
}
|
||||
params.icon = this.imageUrl
|
||||
params.params = {}
|
||||
params.params = {
|
||||
connectorAttributeKeys: []
|
||||
}
|
||||
params.paramObj.forEach(item => {
|
||||
params.params[item.metaKey] = item
|
||||
params.params.connectorAttributeKeys.push(item.metaKey)
|
||||
})
|
||||
if (this.editSoftwareType.id) {
|
||||
this.$put(this.url, params).then(res => {
|
||||
|
||||
@@ -989,6 +989,8 @@ export default {
|
||||
objectInfo.priority = val.valnum
|
||||
} else if (val.label === 'dashboardVarType') {
|
||||
objectInfo.varType = val.valnum
|
||||
} else if (val.label === 'licenseStatus') {
|
||||
objectInfo.licenseStatus = val.valnum
|
||||
} else if (typeof (val.valnum) === 'undefined' || val.valnum == '') {
|
||||
this.selectInfoList[val.label].forEach(item => {
|
||||
if (item.label === val.val) {
|
||||
@@ -1069,7 +1071,7 @@ export default {
|
||||
localStorage.setItem('nz-history-' + this.where, JSON.stringify(this.historyList))
|
||||
} else {
|
||||
this.historyList = JSON.parse(localStorage.getItem('nz-history-' + this.where))
|
||||
const findIndex = this.historyList.findIndex(item=> JSON.stringify(item) == JSON.stringify(this.select_list))
|
||||
const findIndex = this.historyList.findIndex(item => JSON.stringify(item) == JSON.stringify(this.select_list))
|
||||
if (findIndex !== -1) {
|
||||
this.historyList.splice(findIndex, 1)
|
||||
}
|
||||
|
||||
@@ -399,6 +399,15 @@ export default {
|
||||
value: 3,
|
||||
label: i18n.t('issue.low')
|
||||
}
|
||||
],
|
||||
licenseStatus: [
|
||||
{
|
||||
value: 1,
|
||||
label: i18n.t('licenseMange.licensed')
|
||||
}, {
|
||||
value: 0,
|
||||
label: i18n.t('licenseMange.notLicensed')
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
</div>
|
||||
<div v-else-if=" item.prop === 'type' ">
|
||||
<div v-if="scope.row[item.prop].toUpperCase() == 'TEXT'"><i class="nz-icon nz-icon-text"></i> {{typeData[0].name}}</div>
|
||||
<div v-else-if="scope.row[item.prop].toUpperCase() == 'MULTITEXT'"><i class="nz-icon nz-icon-multitext"></i> {{typeData[1].name}}</div>
|
||||
<!-- <div v-else-if="scope.row[item.prop].toUpperCase() == 'MULTITEXT'"><i class="nz-icon nz-icon-multitext"></i> {{typeData[1].name}}</div> -->
|
||||
<div v-else-if="scope.row[item.prop].toUpperCase() == 'TEXTAREA'"><i class="nz-icon nz-icon-textarea"></i> {{typeData[1].name}}</div>
|
||||
<div v-else-if="scope.row[item.prop].toUpperCase() == 'RADIO'"><i class="nz-icon nz-icon-radio"></i> {{typeData[2].name}}</div>
|
||||
<div v-else-if="scope.row[item.prop].toUpperCase() == 'CHECKBOX'"><i class="nz-icon nz-icon-checkbox"></i> {{typeData[3].name}}</div>
|
||||
@@ -245,7 +245,7 @@ export default {
|
||||
value: 'EMAIL',
|
||||
name: this.$t('config.assetLabel.email')
|
||||
}
|
||||
],
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -140,6 +140,48 @@
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'brand'">{{scope.row.brand ? scope.row.brand.name : '-'}}</template>
|
||||
<template v-else-if="item.prop === 'purchaseDate'">{{scope.row.purchaseDate ? scope.row.purchaseDate : '-'}}</template>
|
||||
<!-- license -->
|
||||
<template v-else-if="item.prop === 'license'">
|
||||
<el-popover
|
||||
placement="left-start"
|
||||
trigger="hover"
|
||||
:open-delay="300"
|
||||
popper-class="licenseStatus nz-tooltip-bac"
|
||||
:disabled="!(scope.row.license&&scope.row.license.status==1)"
|
||||
>
|
||||
<div>
|
||||
<!-- dateIssued -->
|
||||
<div class="licenseStatus-title" style="margin-bottom:5px;">{{$t('licenseMange.dateIssue')}}</div>
|
||||
<div class="licenseStatus-date">
|
||||
<i class="nz-icon nz-icon-date margin-r-5"/>
|
||||
<span>{{ scope.row.license&&scope.row.license.dateIssued ? momentTz(scope.row.license.dateIssued ) : '-'}}</span>
|
||||
</div>
|
||||
<!-- dateExpires -->
|
||||
<div class="licenseStatus-title" style="margin-top:10px;margin-bottom:5px;">{{$t('licenseMange.dateExpire')}}</div>
|
||||
<div class="licenseStatus-date">
|
||||
<i class="nz-icon nz-icon-date margin-r-5"/>
|
||||
<span v-if="scope.row.license && scope.row.license.dateExpires == -1">{{$t('license.permanent')}}</span>
|
||||
<span v-else>{{ scope.row.license && scope.row.license.dateExpires ? momentTz(scope.row.license.dateExpires ) : '-'}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- status -->
|
||||
<div slot="reference">
|
||||
<div v-if="scope.row.license && scope.row.license.status == 0">
|
||||
<i class="nz-icon nz-icon-stop" style="color:#bebebe;"></i>
|
||||
<span>{{$t('licenseMange.notLicensed')}}</span>
|
||||
</div>
|
||||
<div v-else-if="scope.row.license && scope.row.license.status == 1">
|
||||
<i class="nz-icon nz-icon-import-success1" style="color:#8dcb4b;"></i>
|
||||
<span>{{$t('licenseMange.licensed')}}</span>
|
||||
</div>
|
||||
<div v-else-if="scope.row.license && scope.row.license.status == 2">
|
||||
<i class="nz-icon nz-icon-stop" style="color:#ec7f66;"></i>
|
||||
<span>{{$t('overall.error')}}({{$t('config.terminallog.statusItem.unknownError')}})</span>
|
||||
</div>
|
||||
<div v-else>-</div>
|
||||
</div>
|
||||
</el-popover>
|
||||
</template>
|
||||
<span v-else-if="item.prop === 'id'" :id="'globalSearch' + scope.row.id">{{scope.row[item.prop]}}</span>
|
||||
<template v-else>
|
||||
<span v-if="scope.row.fields&&scope.row.fields.find(field => field.name === item.prop)">
|
||||
@@ -324,6 +366,11 @@ export default {
|
||||
prop: 'purchaseDate',
|
||||
show: false,
|
||||
minWidth: 120
|
||||
}, {
|
||||
label: this.$t('licenseMange.licenseStatus'),
|
||||
prop: 'license',
|
||||
minWidth: 200,
|
||||
show: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -43,6 +43,14 @@
|
||||
</template>
|
||||
</copy>
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'category'">
|
||||
<div>
|
||||
{{scope.row.type ? scope.row.type.category : '-'}}
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'type'">
|
||||
{{scope.row.type ? scope.row.type.name : '-'}}
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'asset'">
|
||||
<div>
|
||||
<div class="document-copy-block" v-if="scope.row.asset">
|
||||
@@ -59,27 +67,25 @@
|
||||
<span v-else>--</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'category'">
|
||||
<div>
|
||||
{{scope.row.type ? scope.row.type.category : '-'}}
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'project'">
|
||||
<div>
|
||||
<div class="document-copy-block" v-if="scope.row.project">
|
||||
<span class="document-copy-text"
|
||||
:title="scope.row[item.prop].name"
|
||||
@mouseenter="labelHover(scope.row, item.prop, true,true, $event)"
|
||||
@mouseleave="labelHover(scope.row, item.prop, false,true)">
|
||||
{{scope.row[item.prop].name}}
|
||||
<span v-else-if="item.prop === 'dateIssued' || item.prop === 'dateExpires'">
|
||||
<span v-if="scope.row[item.prop] == -1">{{$t('license.permanent')}}</span>
|
||||
<span v-else>{{ scope.row[item.prop] ? momentTz(scope.row[item.prop] ) : '-'}}</span>
|
||||
</span>
|
||||
<i v-if="scope.row[item.prop].name" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(scope.row[item.prop].name)" :title="$t('overall.copyText')"></i>
|
||||
<!-- status -->
|
||||
<template v-else-if="item.prop === 'status'">
|
||||
<div v-if="scope.row.status == 0">
|
||||
<i class="nz-icon nz-icon-stop" style="color:#bebebe;"></i>
|
||||
<span>{{$t('licenseMange.notLicensed')}}</span>
|
||||
</div>
|
||||
<span v-else>--</span>
|
||||
<div v-else-if="scope.row.status == 1">
|
||||
<i class="nz-icon nz-icon-import-success1" style="color:#8dcb4b;"></i>
|
||||
<span>{{$t('licenseMange.licensed')}}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'type'">
|
||||
{{scope.row.type ? scope.row.type.name : '-'}}
|
||||
<div v-else-if="scope.row.status == 2">
|
||||
<i class="nz-icon nz-icon-stop" style="color:#ec7f66;"></i>
|
||||
<span>{{$t('overall.error')}}({{$t('config.terminallog.statusItem.unknownError')}})</span>
|
||||
</div>
|
||||
<div v-else>-</div>
|
||||
</template>
|
||||
<span v-else-if="scope.row[item.prop]" :class="item.prop === 'remark'? 'el-table-remark':''">{{scope.row[item.prop]}}</span>
|
||||
<span v-else>-</span>
|
||||
@@ -91,16 +97,21 @@
|
||||
fixed="right">
|
||||
<div slot="header" class="table-operation-title">{{$t('overall.option')}}</div>
|
||||
<div slot-scope="scope" class="table-operation-items">
|
||||
<!-- <button class="table-operation-item" v-has="'softwareAsset_edit'" @click="$emit('edit', scope.row)" :title="$t('overall.edit')"><i class="nz-icon nz-icon-edit"></i></button> -->
|
||||
<button class="table-operation-item" @click="showBottomBox('endpoint', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button>
|
||||
<el-dropdown size="medium" v-has="['softwareAsset_delete','main_edit','softwareAsset_edit']" trigger="click" @command="tableOperation">
|
||||
<!-- <button class="table-operation-item" @click="showBottomBox('endpoint', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button> -->
|
||||
<button class="table-operation-item" v-has="'softwareAsset_edit'" @click="tableOperation(['edit', scope.row])" :title="$t('overall.edit')"><i class="nz-icon nz-icon-edit"></i></button>
|
||||
<el-dropdown size="medium" v-has="['softwareAsset_edit','softwareAsset_add','softwareAsset_delete']" trigger="click" @command="tableOperation">
|
||||
<div class="table-operation-item table-operation-item--more" :title="$t('overall.moreOperations')">
|
||||
<i class="nz-icon nz-icon-more3"></i>
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown" class="right-box-select-top right-public-box-dropdown-top">
|
||||
<el-dropdown-item v-has="'softwareAsset_edit'" :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
|
||||
<el-dropdown-item v-has="'softwareAsset_edit'" :command="['copy', scope.row]"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
|
||||
<el-dropdown-item v-has="'softwareAsset_delete'" :command="['delete-rel', scope.row, {forceDeleteShow:true, single:true,from:'model'}]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
||||
<el-dropdown-item v-has="'softwareAsset_add'" :command="['copy', scope.row]"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
|
||||
<el-dropdown-item v-has="'softwareAsset_delete'" :command="['delete-rel', scope.row, {forceDeleteShow:true, single:true,from:'softwareAsset'}]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
||||
<el-dropdown-item v-has="'softwareAsset_edit'" :command="['upload', scope.row]" @click.native="upload(scope.row)">
|
||||
<i class="nz-icon nz-icon-upload"></i><span class="operation-dropdown-text">{{$t('softwareAsset.upload')}}</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-has="'softwareAsset_edit'" :command="['download', scope.row]" @click.native="download(scope.row)">
|
||||
<i class="nz-icon nz-icon-download1"></i><span class="operation-dropdown-text">{{$t('softwareAsset.download')}}</span>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
@@ -121,6 +132,15 @@
|
||||
:that="alertLabelObj"
|
||||
:type="alertLabelType"
|
||||
></alertLabel>
|
||||
<el-upload
|
||||
action=""
|
||||
:auto-upload="false"
|
||||
accept=".v2c,.V2CP,.H2R,.R2H,.H2H,.ID "
|
||||
:on-change="uploadChange"
|
||||
style="display: none"
|
||||
ref="upload"
|
||||
>
|
||||
</el-upload>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -128,8 +148,9 @@
|
||||
import table from '@/components/common/mixin/table'
|
||||
import copy from '@/components/common/copy'
|
||||
import alertLabelMixin from '@/components/common/mixin/alertLabelMixin'
|
||||
import axios from 'axios'
|
||||
export default {
|
||||
name: 'softwareTypeTable',
|
||||
name: 'softwareTable',
|
||||
mixins: [table, alertLabelMixin],
|
||||
components: { copy },
|
||||
props: {
|
||||
@@ -143,13 +164,13 @@ export default {
|
||||
label: 'ID',
|
||||
prop: 'id',
|
||||
show: true,
|
||||
width: 120,
|
||||
width: 80,
|
||||
sortable: 'custom'
|
||||
}, {
|
||||
label: this.$t('overall.name'),
|
||||
prop: 'name',
|
||||
show: true,
|
||||
width: 350,
|
||||
width: 200,
|
||||
sortable: 'custom'
|
||||
}, {
|
||||
label: this.$t('softwareType.category'),
|
||||
@@ -157,62 +178,113 @@ export default {
|
||||
show: true,
|
||||
minWidth: 200,
|
||||
sortable: 'custom'
|
||||
},
|
||||
// {
|
||||
// label: this.$t('config.menus.icon'),
|
||||
// prop: 'icon',
|
||||
// show: true,
|
||||
// width: 120,
|
||||
// sortable: 'custom'
|
||||
// },
|
||||
{
|
||||
}, {
|
||||
label: this.$t('overall.type'),
|
||||
prop: 'type',
|
||||
minWidth: 200,
|
||||
show: true
|
||||
},
|
||||
{
|
||||
label: this.$t('project.project.projectName'),
|
||||
prop: 'project',
|
||||
minWidth: 200,
|
||||
show: true
|
||||
}, {
|
||||
label: this.$t('asset.asset'),
|
||||
prop: 'asset',
|
||||
minWidth: 200,
|
||||
show: true
|
||||
},
|
||||
|
||||
{
|
||||
}, {
|
||||
label: this.$t('licenseMange.dateIssue'),
|
||||
prop: 'dateIssued',
|
||||
minWidth: 200,
|
||||
show: true
|
||||
}, {
|
||||
label: this.$t('licenseMange.dateExpire'),
|
||||
prop: 'dateExpires',
|
||||
minWidth: 200,
|
||||
show: true
|
||||
}, {
|
||||
label: this.$t('licenseMange.licenseStatus'),
|
||||
prop: 'status',
|
||||
minWidth: 200,
|
||||
show: true
|
||||
}, {
|
||||
label: this.$t('licenseMange.concurrency'),
|
||||
prop: 'concurrency',
|
||||
minWidth: 150,
|
||||
show: true
|
||||
}, {
|
||||
label: this.$t('licenseMange.logins'),
|
||||
prop: 'logins',
|
||||
minWidth: 100,
|
||||
show: true
|
||||
}, {
|
||||
label: this.$t('overall.remark'),
|
||||
prop: 'remark',
|
||||
minWidth: 200,
|
||||
show: true
|
||||
}
|
||||
]
|
||||
],
|
||||
uploadId: undefined
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 上传V2C
|
||||
upload (row) {
|
||||
this.uploadId = row.id
|
||||
this.$refs.upload.$children[0].$refs.input.click()
|
||||
},
|
||||
async uploadChange (file) {
|
||||
const form = new FormData()
|
||||
form.append('file', file.raw)
|
||||
form.append('saId', this.uploadId)
|
||||
const res = await this.$post('/license/uploadV2C', form, { 'Content-Type': 'multipart/form-data' })
|
||||
if (res.code === 200) {
|
||||
this.$emit('reload')
|
||||
this.$message.success(this.$t('tip.uploadSuccess'))
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
},
|
||||
// 下载C2V
|
||||
download (row) {
|
||||
const params = {
|
||||
saId: row.id
|
||||
}
|
||||
axios.get('/license/downloadC2V', { responseType: 'blob', params: params }).then(res => {
|
||||
const filename = row.name + '.c2v'
|
||||
if (window.navigator.msSaveOrOpenBlob) {
|
||||
// 兼容ie11
|
||||
const blobObject = new Blob([res.data])
|
||||
window.navigator.msSaveOrOpenBlob(blobObject, filename)
|
||||
} else {
|
||||
const url = URL.createObjectURL(new Blob([res.data]))
|
||||
const a = document.createElement('a')
|
||||
document.body.appendChild(a) // 此处增加了将创建的添加到body当中
|
||||
a.href = url
|
||||
a.download = filename
|
||||
a.target = '_blank'
|
||||
a.click()
|
||||
a.remove() // 将a标签移除
|
||||
}
|
||||
}, error => {
|
||||
const $self = this
|
||||
const reader = new FileReader()
|
||||
reader.onload = function (event) {
|
||||
const responseText = reader.result
|
||||
const exception = JSON.parse(responseText)
|
||||
if (exception.message) {
|
||||
$self.$message.error(exception.message)
|
||||
} else if (exception.msg) {
|
||||
$self.$message.error(exception.msg)
|
||||
} else {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
reader.readAsText(error.response.data)
|
||||
})
|
||||
},
|
||||
copyValue (item) {
|
||||
const str = item
|
||||
// const domUrl = document.createElement('input')
|
||||
// domUrl.value = JSON.stringify(str)
|
||||
// domUrl.id = 'creatDom'
|
||||
// document.body.appendChild(domUrl)
|
||||
// domUrl.select() // 选择对象
|
||||
// document.execCommand('Copy') // 执行浏览器复制命令
|
||||
// const creatDom = document.getElementById('creatDom')
|
||||
// creatDom.parentNode.removeChild(creatDom)
|
||||
// this.$message.success(this.$t('overall.copySuccess'))
|
||||
this.$copyText(JSON.stringify(str)).then(() => {
|
||||
this.$message.success({ message: this.$t('overall.copySuccess') })
|
||||
})
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
computed: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -75,17 +75,15 @@
|
||||
fixed="right">
|
||||
<div slot="header" class="table-operation-title">{{$t('overall.option')}}</div>
|
||||
<div slot-scope="scope" class="table-operation-items">
|
||||
<!-- <button class="table-operation-item" v-has="'model_edit'" @click="$emit('edit', scope.row)" :title="$t('overall.edit')"><i class="nz-icon nz-icon-edit"></i></button> -->
|
||||
<button class="table-operation-item" @click="showBottomBox('softwareAsset', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button>
|
||||
<el-dropdown size="medium" v-has="['model_delete','main_edit','model_edit']" trigger="click" @command="tableOperation">
|
||||
<el-dropdown size="medium" v-has="['software_type_add','software_type_edit','software_type_delete']" trigger="click" @command="tableOperation">
|
||||
<div class="table-operation-item table-operation-item--more" :title="$t('overall.moreOperations')">
|
||||
<i class="nz-icon nz-icon-more3"></i>
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown" class="right-box-select-top right-public-box-dropdown-top">
|
||||
<el-dropdown-item v-has="'model_edit'" :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
|
||||
<el-dropdown-item v-has="'model_edit'" :command="['copy', scope.row]"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
|
||||
<el-dropdown-item v-has="'model_delete'" :command="['delete-rel', scope.row, {forceDeleteShow:true, single:true,from:'model'}]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
||||
<el-dropdown-item v-has="'main_edit'" :command="['sync', scope.row]"><i class="nz-icon nz-icon-sync"></i><span class="operation-dropdown-text">{{$t('overall.syncChart')}}</span></el-dropdown-item>
|
||||
<el-dropdown-item v-has="'software_type_add'" :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
|
||||
<el-dropdown-item v-has="'software_type_edit'" :command="['copy', scope.row]"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
|
||||
<el-dropdown-item v-has="'software_type_delete'" :command="['delete-rel', scope.row, {forceDeleteShow:true, single:true,from:'softwareType'}]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
@@ -336,6 +336,12 @@ export default {
|
||||
type: 'input',
|
||||
label: 'comment',
|
||||
disabled: false
|
||||
}, {
|
||||
name: this.$t('licenseMange.licenseStatus'),
|
||||
type: 'select',
|
||||
label: 'licenseStatus',
|
||||
readonly: true,
|
||||
disabled: false
|
||||
}]
|
||||
},
|
||||
|
||||
@@ -997,6 +1003,22 @@ export default {
|
||||
},
|
||||
jsonKey: 'val'
|
||||
},
|
||||
licenseStatus: {
|
||||
target: this.searchLabel,
|
||||
isSearchInput: true,
|
||||
propertyName: 'licenseStatus',
|
||||
type: 'string',
|
||||
defaultJson: {
|
||||
disabled: false,
|
||||
label: 'licenseStatus',
|
||||
name: 'licenseStatus',
|
||||
readonly: true,
|
||||
type: 'select',
|
||||
val: '',
|
||||
listStr: 'licenseStatus'
|
||||
},
|
||||
jsonKey: 'valnum'
|
||||
},
|
||||
dcIds: { target: this.searchCheckBox, propertyName: 'dcIds', type: 'string', target2: this.selectValue, type2: 'array' },
|
||||
typeIds: { target: this.searchCheckBox, propertyName: 'typeIds', type: 'string', target2: this.selectValue, type2: 'array' },
|
||||
ping: { target: this.searchCheckBox, propertyName: 'ping', type: 'string', target2: this.selectValue, type2: 'array' },
|
||||
|
||||
@@ -97,6 +97,7 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
url: '/asset/software',
|
||||
tableId: 'softwareAssetTable',
|
||||
blankObject: { // 空白对象
|
||||
id: '',
|
||||
name: '',
|
||||
@@ -106,7 +107,6 @@ export default {
|
||||
params: {},
|
||||
remark: ''
|
||||
},
|
||||
tableId: 'softwareAssetTable',
|
||||
searchMsg: { // 给搜索框子组件传递的信息
|
||||
searchLabelList: [{
|
||||
name: 'ID',
|
||||
@@ -123,7 +123,44 @@ export default {
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
||||
const searchKeys = {
|
||||
// key: path 键
|
||||
// value: vue set 参数
|
||||
pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' },
|
||||
pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' },
|
||||
orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
|
||||
ids: {
|
||||
target: this.searchLabel,
|
||||
isSearchInput: true,
|
||||
propertyName: 'ids',
|
||||
type: 'string',
|
||||
defaultJson: {
|
||||
disabled: false,
|
||||
id: 'ids',
|
||||
label: 'ids',
|
||||
name: 'ID',
|
||||
type: 'input',
|
||||
val: ''
|
||||
},
|
||||
jsonKey: 'val'
|
||||
},
|
||||
name: {
|
||||
target: this.searchLabel,
|
||||
isSearchInput: true,
|
||||
propertyName: 'name',
|
||||
type: 'string',
|
||||
defaultJson: {
|
||||
disabled: false,
|
||||
id: 'name',
|
||||
label: 'name',
|
||||
name: 'Name',
|
||||
type: 'input',
|
||||
val: ''
|
||||
},
|
||||
jsonKey: 'val'
|
||||
}
|
||||
}
|
||||
this.initQueryFromPath(searchKeys)
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user