|
|
@@ -21,13 +21,23 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { IColumn } from '@/components/common/types/tableCommon'
|
|
|
import { getMsgList } from './api/alarm.api'
|
|
|
+import { listDept} from '@/api/system/dept'
|
|
|
|
|
|
import YtCrud from '@/components/common/yt-crud.vue'
|
|
|
|
|
|
-const column: IColumn[] = [{
|
|
|
+interface DeptOptionsType {
|
|
|
+ id: number | string
|
|
|
+ deptName: string
|
|
|
+ children: DeptOptionsType[]
|
|
|
+}
|
|
|
+
|
|
|
+const deptOptions = ref<DeptOptionsType[]>([])
|
|
|
+
|
|
|
+const column= ref<IColumn[]>([{
|
|
|
label: '名称',
|
|
|
key: 'name',
|
|
|
search: true,
|
|
|
+ tableWidth: 260,
|
|
|
rules: [{ required: true, message: '告警名称不能为空' }],
|
|
|
}, {
|
|
|
label: '告警等级',
|
|
|
@@ -54,7 +64,21 @@ const column: IColumn[] = [{
|
|
|
value: 5,
|
|
|
}],
|
|
|
}
|
|
|
-}, {
|
|
|
+},
|
|
|
+ {
|
|
|
+ label: '所属部门',
|
|
|
+ key: 'createDept',
|
|
|
+ search: true,
|
|
|
+ type: 'select',
|
|
|
+ hide: true,
|
|
|
+ formHide: true,
|
|
|
+ componentProps: {
|
|
|
+ labelAlias: 'deptName',
|
|
|
+ valueAlias: 'id',
|
|
|
+ options: [],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
label: '是否已读',
|
|
|
key: 'read',
|
|
|
tableWidth: 120,
|
|
|
@@ -68,12 +92,11 @@ const column: IColumn[] = [{
|
|
|
}, {
|
|
|
label: '告警内容',
|
|
|
key: 'details',
|
|
|
- tableWidth: 360,
|
|
|
componentProps: {
|
|
|
type: 'textarea',
|
|
|
rows: 4,
|
|
|
}
|
|
|
-}]
|
|
|
+}])
|
|
|
|
|
|
|
|
|
const data = ref([])
|
|
|
@@ -98,4 +121,16 @@ const getData = () => {
|
|
|
state.loading = false
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+const getDept = () => {
|
|
|
+ listDept().then((res) => {
|
|
|
+ deptOptions.value = res.data || []
|
|
|
+ column.value.forEach(item => {
|
|
|
+ if (item.key === 'createDept') {
|
|
|
+ item.componentProps.options = deptOptions.value
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+getDept()
|
|
|
</script>
|