fix: source和entity integration添加查看功能
This commit is contained in:
@@ -128,6 +128,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
.tool-btn-view {
|
||||
i {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-customize {
|
||||
color: var(--el-color-primary);
|
||||
font-size: 12px;
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
:resizable="false"
|
||||
align="center"
|
||||
type="selection"
|
||||
:selectable="checkSelectable"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
:resizable="false"
|
||||
align="center"
|
||||
type="selection"
|
||||
:selectable="checkSelectable"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
||||
@@ -42,6 +42,7 @@ export default {
|
||||
delFlag: false,
|
||||
disableEdit: true, // 编辑按钮是否不可用,当选择多条记录的时候,编辑按钮不可用
|
||||
disableDelete: true,
|
||||
disableView: true,
|
||||
operationWidth: '165', // 操作列宽
|
||||
loading: true,
|
||||
isNoData: false
|
||||
@@ -91,12 +92,18 @@ export default {
|
||||
}
|
||||
})
|
||||
this.disableEdit = this.batchDeleteObjs.length !== 1
|
||||
this.disableView = this.batchDeleteObjs.length !== 1
|
||||
this.disableDelete = this.batchDeleteObjs.length < 1
|
||||
const obj = objs.find(d => d.usage > 0)
|
||||
if (obj) {
|
||||
this.disableDelete = true
|
||||
this.disableEdit = true
|
||||
}
|
||||
const obj1 = objs.find(d => d.isBuiltIn > 0)
|
||||
if (obj1) {
|
||||
this.disableDelete = true
|
||||
this.disableEdit = true
|
||||
}
|
||||
},
|
||||
getTableData (params, isAll, isClearType) {
|
||||
if (isAll) {
|
||||
|
||||
@@ -197,15 +197,17 @@ export function handleComponent (code) {
|
||||
case 'locationMap':
|
||||
case 'traceTracking':
|
||||
return () => import('@/views/location/Index')
|
||||
case 'source':
|
||||
case 'dataSource':
|
||||
return () => import('@/views/setting/sources/Sources')
|
||||
case 'createSource':
|
||||
case 'editSource':
|
||||
case 'createDataSource':
|
||||
case 'editDataSource':
|
||||
case 'viewDataSource':
|
||||
return () => import('@/views/setting/sources/SourcesForm')
|
||||
case 'entitySetting':
|
||||
case 'entityIntegration':
|
||||
return () => import('@/views/setting/entitySetting/EntitySetting')
|
||||
case 'createEntitySetting':
|
||||
case 'editEntitySetting':
|
||||
case 'createEntityIntegration':
|
||||
case 'editEntityIntegration':
|
||||
case 'viewEntityIntegration':
|
||||
return () => import('@/views/setting/entitySetting/EntitySettingForm')
|
||||
default:
|
||||
return null
|
||||
|
||||
@@ -22,6 +22,12 @@
|
||||
<i class="cn-icon-edit cn-icon"></i>
|
||||
<span>{{ $t('overall.edit') }}</span>
|
||||
</button>
|
||||
<button id="tag-view" class="business-button business-button--light tag__btn margin-r-10 tool-btn-view"
|
||||
:disabled="disableView"
|
||||
@click="viewEntity">
|
||||
<i class="cn-icon-preview cn-icon"></i>
|
||||
<span>{{ $t('overall.view') }}</span>
|
||||
</button>
|
||||
<button id="tag-delete" class="business-button business-button--light tag__btn margin-r-10"
|
||||
:disabled="disableDelete"
|
||||
@click="delBatch">
|
||||
@@ -117,7 +123,7 @@ export default {
|
||||
},
|
||||
add () {
|
||||
this.$router.push({
|
||||
path: '/setting/entitySetting/create',
|
||||
path: '/setting/entityIntegration/create',
|
||||
query: {
|
||||
t: +new Date()
|
||||
}
|
||||
@@ -216,10 +222,21 @@ export default {
|
||||
this.jumpToEditPage(this.batchDeleteObjs[0].id)
|
||||
}
|
||||
},
|
||||
viewEntity () {
|
||||
const pageNo = this.$router.currentRoute.value.query.pageNo
|
||||
this.$router.push({
|
||||
path: '/setting/entityIntegration/view',
|
||||
query: {
|
||||
t: +new Date(),
|
||||
pageNoForTable: pageNo || 1,
|
||||
id: this.batchDeleteObjs[0].id
|
||||
}
|
||||
})
|
||||
},
|
||||
jumpToEditPage (id) {
|
||||
const pageNo = this.$router.currentRoute.value.query.pageNo
|
||||
this.$router.push({
|
||||
path: '/setting/entitySetting/edit',
|
||||
path: '/setting/entityIntegration/edit',
|
||||
query: {
|
||||
t: +new Date(),
|
||||
pageNoForTable: pageNo || 1,
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
<div class="es-form">
|
||||
<loading :loading="myLoading"></loading>
|
||||
|
||||
<div class="es-form-header">
|
||||
<!-- {{ ruleId ? $t('detection.editEventPolicies') : $t('overall.entitySetting') }}-->
|
||||
{{ $t('overall.entitySetting') }}
|
||||
</div>
|
||||
<div class="es-form-header">{{ $t('overall.entitySetting') }}</div>
|
||||
|
||||
<div class="es-form-content">
|
||||
<!--第一步:General Settings-->
|
||||
@@ -202,7 +199,7 @@
|
||||
<button class="business-button business-button--light tag__btn" @click="cancel">
|
||||
<span>{{ $t('overall.cancel') }}</span>
|
||||
</button>
|
||||
<button style="position: relative;" class="business-button tag__btn" :disabled="editObj.isBuiltIn>0" @click="saveEntity">
|
||||
<button style="position: relative;" class="business-button tag__btn" :disabled="disabledSave" @click="saveEntity">
|
||||
<!-- <loading :loading="blockOperation.save"></loading>-->
|
||||
<span>{{ $t('overall.save') }}</span>
|
||||
</button>
|
||||
@@ -268,6 +265,11 @@ export default {
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
computed: {
|
||||
disabledSave () {
|
||||
return this.editObj.isBuiltIn > 0 || this.isView
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.initSourceData()
|
||||
if (this.ruleId) {
|
||||
@@ -275,7 +277,7 @@ export default {
|
||||
}
|
||||
},
|
||||
setup () {
|
||||
const { query } = useRoute()
|
||||
const { query, name } = useRoute()
|
||||
const ruleId = ref(query.id || '')
|
||||
const pageNoForTable = ref(query.pageNoForTable || 1)
|
||||
const myLoading = ref(!!ruleId.value)
|
||||
@@ -306,12 +308,14 @@ export default {
|
||||
enable: 1
|
||||
})
|
||||
|
||||
const isView = name === 'viewEntityIntegration'
|
||||
return {
|
||||
ruleId,
|
||||
myLoading,
|
||||
pageNoForTable,
|
||||
editObj,
|
||||
ruleObj
|
||||
ruleObj,
|
||||
isView
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -340,7 +344,7 @@ export default {
|
||||
console.error(e)
|
||||
this.$message.error(this.errorMsgHandler(e))
|
||||
this.$router.push({
|
||||
path: '/setting/entitySetting',
|
||||
path: '/setting/entityIntegration',
|
||||
query: {
|
||||
pageNo: this.pageNoForTable ? Number(this.pageNoForTable) : 1,
|
||||
t: +new Date()
|
||||
@@ -381,7 +385,7 @@ export default {
|
||||
console.error(e)
|
||||
this.$message.error(this.errorMsgHandler(e))
|
||||
this.$router.push({
|
||||
path: '/setting/entitySetting',
|
||||
path: '/setting/entityIntegration',
|
||||
query: {
|
||||
pageNo: this.pageNoForTable ? Number(this.pageNoForTable) : 1,
|
||||
t: +new Date()
|
||||
@@ -643,7 +647,7 @@ export default {
|
||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
||||
|
||||
this.$router.push({
|
||||
path: '/setting/entitySetting',
|
||||
path: '/setting/entityIntegration',
|
||||
query: {
|
||||
t: +new Date()
|
||||
}
|
||||
@@ -673,7 +677,7 @@ export default {
|
||||
queryInfo.name = this.settingObj.name
|
||||
}
|
||||
this.$router.push({
|
||||
path: '/setting/entitySetting',
|
||||
path: '/setting/entityIntegration',
|
||||
query: queryInfo
|
||||
})
|
||||
} else {
|
||||
@@ -706,7 +710,7 @@ export default {
|
||||
// } else {
|
||||
// }
|
||||
this.$router.push({
|
||||
path: '/setting/entitySetting',
|
||||
path: '/setting/entityIntegration',
|
||||
query: queryInfo
|
||||
})
|
||||
},
|
||||
@@ -721,7 +725,7 @@ export default {
|
||||
customClass: 'del-model'
|
||||
}).then(() => {
|
||||
this.$router.push({
|
||||
path: '/setting/entitySetting',
|
||||
path: '/setting/entityIntegration',
|
||||
query: queryInfo
|
||||
})
|
||||
}).catch(() => {
|
||||
|
||||
@@ -22,6 +22,12 @@
|
||||
<i class="cn-icon-edit cn-icon"></i>
|
||||
<span>{{ $t('overall.edit') }}</span>
|
||||
</button>
|
||||
<button id="tag-view" class="business-button business-button--light tag__btn margin-r-10 tool-btn-view"
|
||||
:disabled="disableView"
|
||||
@click="viewSource">
|
||||
<i class="cn-icon-preview cn-icon"></i>
|
||||
<span>{{ $t('overall.view') }}</span>
|
||||
</button>
|
||||
<button id="tag-delete" class="business-button business-button--light tag__btn margin-r-10"
|
||||
:disabled="disableDelete"
|
||||
@click="delBatch">
|
||||
@@ -223,6 +229,17 @@ export default {
|
||||
this.jumpToEditPage(this.batchDeleteObjs[0].id)
|
||||
}
|
||||
},
|
||||
viewSource () {
|
||||
const pageNo = this.$router.currentRoute.value.query.pageNo
|
||||
this.$router.push({
|
||||
path: '/setting/source/view',
|
||||
query: {
|
||||
t: +new Date(),
|
||||
pageNoForTable: pageNo || 1,
|
||||
id: this.batchDeleteObjs[0].id
|
||||
}
|
||||
})
|
||||
},
|
||||
jumpToEditPage (id) {
|
||||
const pageNo = this.$router.currentRoute.value.query.pageNo
|
||||
this.$router.push({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="sources-form">
|
||||
<loading :loading="myLoading"></loading>
|
||||
<div class="sources-form__header">{{ sourceObj.id ? $t('sources.editSource') : $t('sources.createSource') }}</div>
|
||||
<div class="sources-form__header">{{ pageHeaderName }}</div>
|
||||
<div class="sources-form__body">
|
||||
<el-form ref="baseForm" :model="sourceObj" label-position="top" style="width: 620px" :rules="rules">
|
||||
<el-form-item :label="$t('overall.name')" prop="name">
|
||||
@@ -154,7 +154,7 @@
|
||||
<span>{{ $t('overall.cancel') }}</span>
|
||||
</button>
|
||||
<button style="position: relative;" :class="{'disabled': blockOperation.save}"
|
||||
:disabled="sourceObj.usage>0 || sourceObj.isBuiltIn>0" class="business-button tag__btn" @click="saveSource">
|
||||
:disabled="disabledSave" class="business-button tag__btn" @click="saveSource">
|
||||
<loading :loading="blockOperation.save"></loading>
|
||||
<span>{{ $t('overall.save') }}</span>
|
||||
</button>
|
||||
@@ -293,6 +293,18 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
pageHeaderName () {
|
||||
let name = this.$t('sources.createSource')
|
||||
if (this.sourceObj.id) {
|
||||
name = this.isView ? this.$t('setting.viewSource') : this.$t('sources.editSource')
|
||||
}
|
||||
return name
|
||||
},
|
||||
disabledSave () {
|
||||
return this.sourceObj.usage > 0 || this.sourceObj.isBuiltIn > 0 || this.isView
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
if (this.sourceId) {
|
||||
this.initDetailInfo()
|
||||
@@ -495,7 +507,7 @@ export default {
|
||||
}
|
||||
},
|
||||
setup () {
|
||||
const { query } = useRoute()
|
||||
const { query, name } = useRoute()
|
||||
const sourceId = ref(query.id || '')
|
||||
const pageNoForTable = ref(query.pageNoForTable || 1)
|
||||
const myLoading = ref(!!sourceId.value)
|
||||
@@ -517,11 +529,13 @@ export default {
|
||||
// enable: 1
|
||||
}
|
||||
const sourceObj = ref(_.cloneDeep(blankObject))
|
||||
const isView = name === 'viewDataSource'
|
||||
return {
|
||||
sourceId,
|
||||
pageNoForTable,
|
||||
myLoading,
|
||||
sourceObj
|
||||
sourceObj,
|
||||
isView
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user