Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions saiadmin-artd/src/views/safeguard/dict/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
<SaButton v-permission="'core:dict:edit'" type="error" @click="deleteTypeDialog" />
</ElSpace>
<ArtTable
ref="typeTableRef"
rowKey="id"
:loading="loading"
:data="typeData"
:columns="typeColumns"
:pagination="typePagination"
highlight-current-row
@row-click="handleRowClick"
@pagination:size-change="handleSizeChange"
@pagination:current-change="handleCurrentChange"
>
Expand Down Expand Up @@ -209,6 +211,7 @@
name: '',
code: ''
})
const typeTableRef = ref()

/** 修改字典类型 */
const updateTypeDialog = () => {
Expand Down Expand Up @@ -243,12 +246,20 @@
getDictData()
}

/** 行点击切换 */
const handleRowClick = (row: any) => {
handleTypeChange(row.id, row)
}

/** 刷新数据 */
const refreshTypeData = () => {
selectedId.value = 0
selectedRow.value = {}
getTypeData()
getDictData()
nextTick(() => {
typeTableRef.value?.elTableRef?.setCurrentRow(null)
})
}

// 字典类型数据
Expand Down
12 changes: 12 additions & 0 deletions saiadmin-artd/src/views/system/config/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
<SaButton v-permission="'core:config:edit'" type="error" @click="deleteConfigData" />
</ElSpace>
<ArtTable
ref="groupTableRef"
rowKey="id"
:loading="loading"
:data="groupData"
:columns="groupColumns"
:pagination="groupPagination"
highlight-current-row
@row-click="handleRowClick"
@pagination:size-change="handleSizeChange"
@pagination:current-change="handleCurrentChange"
>
Expand Down Expand Up @@ -183,6 +185,7 @@
</template>

<script setup lang="ts">
import { ref, nextTick } from 'vue'
import { useTable } from '@/hooks/core/useTable'
import { useSaiAdmin } from '@/composables/useSaiAdmin'
import { Search } from '@element-plus/icons-vue'
Expand All @@ -199,6 +202,9 @@
selectedRow.value = {}
formArray.value = []
getGroupData()
nextTick(() => {
groupTableRef.value?.elTableRef?.setCurrentRow(null)
})
}

// 修改配置
Expand Down Expand Up @@ -233,6 +239,7 @@
name: '',
code: ''
})
const groupTableRef = ref()

// 配置搜索
const handleConfigSearch = () => {
Expand All @@ -257,6 +264,11 @@
getConfigData()
}

/** 行点击切换 */
const handleRowClick = (row: any) => {
handleGroupChange(row.id, row)
}

const getConfigData = () => {
api.configList({ group_id: selectedId.value, saiType: 'all' }).then((data) => {
formArray.value = data.map((item: any) => {
Expand Down