REVIEW 公众号选择的下拉框

This commit is contained in:
YunaiV 2023-04-11 23:28:59 +08:00
parent 129766fca4
commit fd447dc7a3
11 changed files with 18 additions and 16 deletions

View File

@ -19,7 +19,7 @@ VITE_API_URL=/admin-api
VITE_BASE_PATH=/ VITE_BASE_PATH=/
# 项目本地运行端口号, 与.vscode/launch.json配合 # 项目本地运行端口号, 与.vscode/launch.json配合
VITE_PORT=5173 VITE_PORT=80
# 是否删除debugger # 是否删除debugger
VITE_DROP_DEBUGGER=false VITE_DROP_DEBUGGER=false

2
.vscode/launch.json vendored
View File

@ -8,7 +8,7 @@
"type": "msedge", "type": "msedge",
"request": "launch", "request": "launch",
"name": "Launch Edge against localhost", "name": "Launch Edge against localhost",
"url": "http://localhost:5173", "url": "http://localhost",
"webRoot": "${workspaceFolder}/src", "webRoot": "${workspaceFolder}/src",
"sourceMaps": true "sourceMaps": true
} }

View File

@ -3,7 +3,8 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<ContentWrap> <ContentWrap>
<WxAccountSelect @change="(accountId) => accountChanged(accountId)" /> <!-- TODO @芋艿调整成 el-form WxAccountSelect -->
<WxAccountSelect @change="accountChanged" />
</ContentWrap> </ContentWrap>
<!-- tab 切换 --> <!-- tab 切换 -->

View File

@ -19,13 +19,12 @@ const emit = defineEmits<{
(e: 'change', id: number | undefined): void (e: 'change', id: number | undefined): void
}>() }>()
onMounted(async () => { onMounted(() => {
handleQuery() handleQuery()
}) })
const handleQuery = async () => { const handleQuery = async () => {
const data = await MpAccountApi.getSimpleAccountList() accountList.value = await MpAccountApi.getSimpleAccountList()
accountList.value = data
// //
if (accountList.value.length > 0) { if (accountList.value.length > 0) {
accountId.value = accountList.value[0].id accountId.value = accountList.value[0].id

View File

@ -1,6 +1,7 @@
<template> <template>
<el-form class="-mb-15px" ref="queryFormRef" :inline="true" label-width="68px"> <el-form class="-mb-15px" ref="queryFormRef" :inline="true" label-width="68px">
<el-form-item label="公众号" prop="accountId"> <el-form-item label="公众号" prop="accountId">
<!-- TODO 芋艿需要将 el-form el-select 解耦 -->
<el-select <el-select
v-model="accountId" v-model="accountId"
placeholder="请选择公众号" placeholder="请选择公众号"
@ -24,13 +25,12 @@ const queryFormRef = ref()
const emit = defineEmits(['change']) const emit = defineEmits(['change'])
onMounted(async () => { onMounted(() => {
handleQuery() handleQuery()
}) })
const handleQuery = async () => { const handleQuery = async () => {
const data = await MpAccountApi.getSimpleAccountList() accountList.value = await MpAccountApi.getSimpleAccountList()
accountList.value = data
// //
if (accountList.value.length > 0) { if (accountList.value.length > 0) {
accountId.value = accountList.value[0].id accountId.value = accountList.value[0].id

View File

@ -3,7 +3,8 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<ContentWrap> <ContentWrap>
<WxAccountSelect @change="(accountId) => accountChanged(accountId)"> <!-- TODO @芋艿调整成 el-form WxAccountSelect -->
<WxAccountSelect @change="accountChanged">
<template #actions> <template #actions>
<el-button type="primary" plain @click="handleAdd" v-hasPermi="['mp:draft:create']"> <el-button type="primary" plain @click="handleAdd" v-hasPermi="['mp:draft:create']">
<Icon icon="ep:plus" />新增 <Icon icon="ep:plus" />新增

View File

@ -3,6 +3,7 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<ContentWrap> <ContentWrap>
<!-- TODO @芋艿调整成 el-form WxAccountSelect -->
<WxAccountSelect @change="(accountId) => accountChanged(accountId)" /> <WxAccountSelect @change="(accountId) => accountChanged(accountId)" />
</ContentWrap> </ContentWrap>

View File

@ -4,10 +4,7 @@
<ContentWrap> <ContentWrap>
<el-form class="-mb-15px" :inline="true" label-width="68px"> <el-form class="-mb-15px" :inline="true" label-width="68px">
<el-form-item label="公众号" prop="accountId"> <el-form-item label="公众号" prop="accountId">
<WxMpSelect @change="(accountId) => accountChange(accountId)" /> <WxMpSelect @change="accountChange" />
</el-form-item>
<el-form-item>
<slot name="actions"></slot>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>

View File

@ -2,7 +2,8 @@
<doc-alert title="公众号菜单" url="https://doc.iocoder.cn/mp/menu/" /> <doc-alert title="公众号菜单" url="https://doc.iocoder.cn/mp/menu/" />
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<ContentWrap> <ContentWrap>
<WxAccountSelect @change="(accountId) => accountChanged(accountId)" /> <!-- TODO @芋艿调整成 el-form WxAccountSelect -->
<WxAccountSelect @change="accountChanged" />
</ContentWrap> </ContentWrap>
<!-- 列表 --> <!-- 列表 -->

View File

@ -3,7 +3,8 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<ContentWrap> <ContentWrap>
<WxAccountSelect @change="(accountId) => accountChanged(accountId)"> <!-- TODO @芋艿调整成 el-form WxAccountSelect -->
<WxAccountSelect @change="accountChanged">
<template #actions> <template #actions>
<el-button type="primary" plain @click="openForm('create')" v-hasPermi="['mp:tag:create']"> <el-button type="primary" plain @click="openForm('create')" v-hasPermi="['mp:tag:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增 <Icon icon="ep:plus" class="mr-5px" /> 新增

View File

@ -3,6 +3,7 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<ContentWrap> <ContentWrap>
<!-- TODO @芋艿调整成 el-form WxAccountSelect -->
<WxAccountSelect @change="(accountId) => accountChanged(accountId)"> <WxAccountSelect @change="(accountId) => accountChanged(accountId)">
<template #actions> <template #actions>
<el-button type="success" plain @click="handleSync" v-hasPermi="['mp:user:sync']"> <el-button type="success" plain @click="handleSync" v-hasPermi="['mp:user:sync']">