|
|
@@ -39,49 +39,6 @@
|
|
|
maxlength="50"
|
|
|
clearable
|
|
|
/>
|
|
|
- <template v-if="isTenant">
|
|
|
- <span class="c-grid-form__label">媒资AI机审:</span>
|
|
|
- <div class="l-flex--row c-grid-form__option">
|
|
|
- <el-switch
|
|
|
- v-model="group.aiAudit"
|
|
|
- class="c-sibling-item"
|
|
|
- active-value="1"
|
|
|
- inactive-value="0"
|
|
|
- active-color="#13ce66"
|
|
|
- inactive-color="#ff4949"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- </confirm-dialog>
|
|
|
- <confirm-dialog
|
|
|
- ref="strategyDialog"
|
|
|
- title="告警设置"
|
|
|
- @confirm="onSaveStrategy"
|
|
|
- >
|
|
|
- <div class="u-align-self--center">
|
|
|
- <div
|
|
|
- v-for="strategy in strategies"
|
|
|
- :key="strategy.level"
|
|
|
- class="c-sibling-item--v far"
|
|
|
- >
|
|
|
- <div class="c-sibling-item--v u-bold">{{ strategy.name }}</div>
|
|
|
- <div class="l-flex--row c-sibling-item--v">
|
|
|
- <div
|
|
|
- v-for="option in strategy.options"
|
|
|
- :key="option.key"
|
|
|
- class="c-sibling-item far"
|
|
|
- >
|
|
|
- <span class="c-sibling-item">{{ option.label }}</span>
|
|
|
- <el-switch
|
|
|
- v-model="option.value"
|
|
|
- class="c-sibling-item"
|
|
|
- active-color="#13ce66"
|
|
|
- inactive-color="#ff4949"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
</div>
|
|
|
</confirm-dialog>
|
|
|
</wrapper>
|
|
|
@@ -95,10 +52,6 @@ import {
|
|
|
updateGroup,
|
|
|
deleteGroup
|
|
|
} from '@/api/user'
|
|
|
-import {
|
|
|
- getInformStrategy,
|
|
|
- updateInformStrategy
|
|
|
-} from './api'
|
|
|
import { unbindDevices } from '@/api/device'
|
|
|
|
|
|
export default {
|
|
|
@@ -120,17 +73,8 @@ export default {
|
|
|
cols: [
|
|
|
{ prop: 'name', label: '标识' },
|
|
|
{ prop: 'remark', label: '名称' },
|
|
|
- { label: '媒资AI机审', type: 'tag', render ({ parentGroup, aiAudit }) {
|
|
|
- return parentGroup
|
|
|
- ? null
|
|
|
- : {
|
|
|
- type: aiAudit === '1' ? 'success' : 'danger',
|
|
|
- label: aiAudit === '1' ? '开启' : '关闭'
|
|
|
- }
|
|
|
- } },
|
|
|
{ type: 'invoke', width: 240, render: [
|
|
|
{ label: '编辑', on: this.onEdit },
|
|
|
- { label: '告警设置', render ({ parentGroup }) { return !parentGroup }, on: this.onStrategy },
|
|
|
{ label: '新增下级', render ({ parentGroup }) { return !parentGroup }, on: this.onAddSub },
|
|
|
{ label: '删除', on: this.onDel }
|
|
|
] }
|
|
|
@@ -150,8 +94,7 @@ export default {
|
|
|
this.dialogTitle = '新增租户'
|
|
|
this.group = {
|
|
|
name: '',
|
|
|
- remark: '',
|
|
|
- aiAudit: '1'
|
|
|
+ remark: ''
|
|
|
}
|
|
|
this.$refs.editDialog.show()
|
|
|
},
|
|
|
@@ -159,9 +102,9 @@ export default {
|
|
|
this.isAdd = false
|
|
|
this.isTenant = !group.parentGroup
|
|
|
this.dialogTitle = group.parentGroup ? '编辑部门' : '编辑租户'
|
|
|
- const { id, name, remark, aiAudit } = group
|
|
|
+ const { id, name, remark } = group
|
|
|
this.$group = group
|
|
|
- this.group = { id, name, remark, aiAudit: this.isTenant ? aiAudit : void 0 }
|
|
|
+ this.group = { id, name, remark }
|
|
|
this.$refs.editDialog.show()
|
|
|
},
|
|
|
onAddSub (group) {
|
|
|
@@ -201,13 +144,10 @@ export default {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if (this.$group.remark !== this.group.remark
|
|
|
- || this.isTenant && this.$group.aiAudit !== this.group.aiAudit
|
|
|
- ) {
|
|
|
+ if (this.$group.remark !== this.group.remark) {
|
|
|
updateGroup(this.group).then(() => {
|
|
|
done()
|
|
|
this.$group.remark = this.group.remark
|
|
|
- this.$group.aiAudit = this.group.aiAudit
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
@@ -242,32 +182,7 @@ export default {
|
|
|
this.$closeLoading(loading)
|
|
|
})
|
|
|
})
|
|
|
- },
|
|
|
- onStrategy ({ path }) {
|
|
|
- this.$tenant = path
|
|
|
- getInformStrategy(path).then(data => {
|
|
|
- console.log(data)
|
|
|
- this.strategies = data
|
|
|
- this.$refs.strategyDialog.show()
|
|
|
- })
|
|
|
- },
|
|
|
- onSaveStrategy (done) {
|
|
|
- const strategies = {}
|
|
|
- this.strategies.forEach(({ level, options }) => {
|
|
|
- const strategy = {}
|
|
|
- options.forEach(({ key, value }) => {
|
|
|
- strategy[key] = value
|
|
|
- })
|
|
|
- strategies[level] = strategy
|
|
|
- })
|
|
|
- updateInformStrategy(this.$tenant, strategies).then(done)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
-.o-strategy-name {
|
|
|
- width: 60px;
|
|
|
-}
|
|
|
-</style>
|