2024-07-27 05:33:36 +00:00
|
|
|
<template>
|
|
|
|
<a-page-header style="padding: 10px; font-size: 20px" @back="handleBack">
|
|
|
|
<template #extra>
|
|
|
|
<a-button v-if="route.query.type !== 'SEARCH'" key="1" type="primary" @click="onSubmit">保存</a-button>
|
|
|
|
</template>
|
|
|
|
</a-page-header>
|
|
|
|
|
|
|
|
<a-card :bordered="false" title="公众号">
|
|
|
|
<DynamicForm
|
|
|
|
:allDisabled="route.query.type === 'SEARCH'"
|
|
|
|
:formItems="officialAccountFormItems"
|
|
|
|
:model="formData"
|
|
|
|
:rules="formRules"
|
|
|
|
ref="formRef1"
|
|
|
|
/>
|
|
|
|
</a-card>
|
|
|
|
|
|
|
|
<a-card :bordered="false" title="基本信息" class="mt-4">
|
|
|
|
<DynamicForm
|
|
|
|
:allDisabled="route.query.type === 'SEARCH'"
|
|
|
|
:formItems="basicInfoFormItems"
|
|
|
|
:model="formData"
|
|
|
|
:rules="formRules"
|
|
|
|
ref="formRef2"
|
|
|
|
/>
|
|
|
|
</a-card>
|
2024-07-31 09:33:54 +00:00
|
|
|
|
|
|
|
<a-card :bordered="false" title="操作信息" class="mt-4" v-if="route.query.type !== 'ADD'">
|
|
|
|
<OperationalInformation :detailData="detailData" :colSpan="12"></OperationalInformation>
|
|
|
|
</a-card>
|
2024-07-27 05:33:36 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup name="publicAccountDetail">
|
|
|
|
import { required } from '@/utils/formRules'
|
|
|
|
import officialAccountApi from '@/api/base/wx/officialAccountApi'
|
|
|
|
import useFormHandler from '@/hook/useFormHandler'
|
2024-07-31 09:33:54 +00:00
|
|
|
import { basicInfoFormItems, officialAccountFormItems } from '@/views/basicData/client/formItems'
|
2024-07-27 05:33:36 +00:00
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
const route = useRoute()
|
|
|
|
|
|
|
|
const formRules = {
|
|
|
|
name: [required('请输入名称')],
|
|
|
|
type: [required('请输入类型')],
|
|
|
|
appid: [required('请输入AppID')],
|
|
|
|
secret: [required('请输入AppSecret')]
|
|
|
|
}
|
|
|
|
|
|
|
|
const formRef1 = ref(null)
|
|
|
|
const formRef2 = ref(null)
|
2024-07-31 09:33:54 +00:00
|
|
|
let detailData = ref({})
|
2024-07-27 05:33:36 +00:00
|
|
|
|
2024-07-31 09:33:54 +00:00
|
|
|
const { formData, formRefs, onSubmit, handleBack, fetchData } = useFormHandler(
|
2024-07-27 05:33:36 +00:00
|
|
|
[...officialAccountFormItems, ...basicInfoFormItems],
|
|
|
|
{
|
|
|
|
submitForm: officialAccountApi.officialAccountSubmitForm,
|
|
|
|
getDetail: officialAccountApi.officialAccountDetail
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
formRefs.value = [formRef1.value, formRef2.value]
|
2024-07-31 09:33:54 +00:00
|
|
|
fetchData(route.query.type).then((res) => {
|
|
|
|
if (res) {
|
|
|
|
detailData.value = res
|
|
|
|
}
|
|
|
|
})
|
2024-07-27 05:33:36 +00:00
|
|
|
})
|
|
|
|
</script>
|