|
|
|
@ -15,7 +15,7 @@
|
|
|
|
|
* limitations under the License. |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
import { defineComponent, onMounted, ref, toRefs } from 'vue' |
|
|
|
|
import {defineComponent, onMounted, ref, toRefs, watch} from 'vue' |
|
|
|
|
import { |
|
|
|
|
NButton, |
|
|
|
|
NInput, |
|
|
|
@ -40,10 +40,12 @@ const AlarmInstanceManage = defineComponent({
|
|
|
|
|
const { t } = useI18n() |
|
|
|
|
const showDetailModal = ref(false) |
|
|
|
|
const currentRecord = ref() |
|
|
|
|
|
|
|
|
|
const columns = ref() |
|
|
|
|
const { IS_ADMIN } = useUserInfo() |
|
|
|
|
const { data, changePage, changePageSize, deleteRecord, updateList } = |
|
|
|
|
useTable() |
|
|
|
|
|
|
|
|
|
const { columnsRef } = useColumns( |
|
|
|
|
const { getColumns } = useColumns( |
|
|
|
|
(record: IRecord, type: 'edit' | 'delete') => { |
|
|
|
|
if (type === 'edit') { |
|
|
|
|
showDetailModal.value = true |
|
|
|
@ -54,9 +56,6 @@ const AlarmInstanceManage = defineComponent({
|
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
const { data, changePage, changePageSize, deleteRecord, updateList } = |
|
|
|
|
useTable() |
|
|
|
|
|
|
|
|
|
const onCreate = () => { |
|
|
|
|
currentRecord.value = null |
|
|
|
|
showDetailModal.value = true |
|
|
|
@ -69,6 +68,11 @@ const AlarmInstanceManage = defineComponent({
|
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
changePage(1) |
|
|
|
|
columns.value = getColumns() |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
watch(useI18n().locale, () => { |
|
|
|
|
columns.value = getColumns() |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
@ -76,7 +80,7 @@ const AlarmInstanceManage = defineComponent({
|
|
|
|
|
IS_ADMIN, |
|
|
|
|
showDetailModal, |
|
|
|
|
currentRecord: currentRecord, |
|
|
|
|
columnsRef, |
|
|
|
|
columns, |
|
|
|
|
...toRefs(data), |
|
|
|
|
changePage, |
|
|
|
|
changePageSize, |
|
|
|
@ -91,7 +95,7 @@ const AlarmInstanceManage = defineComponent({
|
|
|
|
|
IS_ADMIN, |
|
|
|
|
currentRecord, |
|
|
|
|
showDetailModal, |
|
|
|
|
columnsRef, |
|
|
|
|
columns, |
|
|
|
|
list, |
|
|
|
|
page, |
|
|
|
|
pageSize, |
|
|
|
@ -141,7 +145,7 @@ const AlarmInstanceManage = defineComponent({
|
|
|
|
|
</Card> |
|
|
|
|
<Card title='' class={styles['mt-8']}> |
|
|
|
|
<NDataTable |
|
|
|
|
columns={columnsRef} |
|
|
|
|
columns={columns} |
|
|
|
|
data={list} |
|
|
|
|
loading={loading} |
|
|
|
|
striped |
|
|
|
|