cmc-web/webs/sms-web/src/views/configs/setting/interface/index.vue

58 lines
1.5 KiB
Vue
Raw Normal View History

2024-08-20 12:11:31 +00:00
<template>
<div class="wrapper" v-loading="loading">
<el-row :gutter="15" v-if="!loading">
<el-col :span="12">
<CardItem :configs="item" v-for="item in leftConfigs" :key="item.name" :show-test="showTest(item.name)"></CardItem>
</el-col>
<el-col :span="12">
<CardItem :configs="item" v-for="item in rightConfigs" :key="item.name" :show-test="showTest(item.name)"></CardItem>
</el-col>
</el-row>
</div>
</template>
<script>
import { ref } from 'vue'
import CardItem from './CardItem.vue'
import { getSystemTreeConfigs } from 'services/system'
export default {
components: {
CardItem
},
setup() {
const leftConfigs = ref([])
const rightConfigs = ref([])
const loading = ref(true)
const leftKeys = ['企业微信配置', '钉钉配置', 'LDAP配置']
async function getConfigs() {
loading.value = true
const res = await getSystemTreeConfigs({ category: '系统对接' })
loading.value = false
if (res.success) {
res.data.forEach(item => {
if (leftKeys.includes(item.name)) {
leftConfigs.value.push(item)
} else {
rightConfigs.value.push(item)
}
2024-08-21 01:17:14 +00:00
})
2024-08-20 12:11:31 +00:00
}
}
2024-08-21 01:17:14 +00:00
getConfigs()
2024-08-20 12:11:31 +00:00
const showTest = name => {
2024-08-28 02:40:51 +00:00
return !['短信配置', '阵地信息'].includes(name)
2024-08-20 12:11:31 +00:00
}
return {
leftConfigs,
rightConfigs,
loading,
showTest
}
}
}
</script>
<style lang="scss" scoped>
.wrapper {
padding: 0 8px;
}
</style>