|
|
@@ -39,6 +39,19 @@
|
|
|
maxlength="50"
|
|
|
show-word-limit
|
|
|
/>
|
|
|
+ <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>
|
|
|
</wrapper>
|
|
|
@@ -59,6 +72,7 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
isAdd: false,
|
|
|
+ isTenant: false,
|
|
|
dialogTitle: '',
|
|
|
schema: {
|
|
|
condition: { name: '' },
|
|
|
@@ -72,6 +86,14 @@ 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: 180, render: [
|
|
|
{ label: '编辑', on: this.onEdit },
|
|
|
{ label: '新增下级', render ({ parentGroup }) { return !parentGroup }, on: this.onAddSub },
|
|
|
@@ -88,20 +110,27 @@ export default {
|
|
|
},
|
|
|
onAdd () {
|
|
|
this.isAdd = true
|
|
|
+ this.isTenant = true
|
|
|
this.dialogTitle = '新增租户'
|
|
|
- this.group = { name: '', remark: '' }
|
|
|
+ this.group = {
|
|
|
+ name: '',
|
|
|
+ remark: '',
|
|
|
+ aiAudit: '1'
|
|
|
+ }
|
|
|
this.$refs.editDialog.show()
|
|
|
},
|
|
|
onEdit (group) {
|
|
|
this.isAdd = false
|
|
|
+ this.isTenant = !group.parentGroup
|
|
|
this.dialogTitle = group.parentGroup ? '编辑部门' : '编辑租户'
|
|
|
- const { id, name, remark } = group
|
|
|
+ const { id, name, remark, aiAudit } = group
|
|
|
this.$group = group
|
|
|
- this.group = { id, name, remark }
|
|
|
+ this.group = { id, name, remark, aiAudit: this.isTenant ? aiAudit : void 0 }
|
|
|
this.$refs.editDialog.show()
|
|
|
},
|
|
|
onAddSub (group) {
|
|
|
this.isAdd = true
|
|
|
+ this.isTenant = false
|
|
|
this.dialogTitle = '新增下级部门'
|
|
|
this.group = { name: '', remark: '', parentGroup: group }
|
|
|
this.$refs.editDialog.show()
|
|
|
@@ -136,10 +165,13 @@ export default {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if (this.$group.remark !== this.group.remark) {
|
|
|
+ if (this.$group.remark !== this.group.remark
|
|
|
+ || this.isTenant && this.$group.aiAudit !== this.group.aiAudit
|
|
|
+ ) {
|
|
|
updateGroup(this.group).then(() => {
|
|
|
done()
|
|
|
this.$group.remark = this.group.remark
|
|
|
+ this.$group.aiAudit = this.group.aiAudit
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
@@ -156,7 +188,7 @@ export default {
|
|
|
{ type: 'warning' }
|
|
|
).then(() => {
|
|
|
const loading = this.$showLoading()
|
|
|
- unbindDevices(group.path)
|
|
|
+ unbindDevices({ org: group.path })
|
|
|
.then(() => deleteGroup(group))
|
|
|
.then(() => {
|
|
|
this.$message({
|