mirror of
https://gitee.com/log4j/pig-ui.git
synced 2025-01-03 23:42:23 +08:00
✨ Introducing new features. 优化微信公众号
This commit is contained in:
parent
7a928715d4
commit
8d55645309
4486
package-lock.json
generated
4486
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -92,7 +92,6 @@ export function useTable(options?: BasicTableProps) {
|
|||||||
descs: state.descs,
|
descs: state.descs,
|
||||||
ascs: state.ascs
|
ascs: state.ascs
|
||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
console.log(res,'resss')
|
|
||||||
state.dataList = state.isPage ? res.data[state.props.item] : res.data
|
state.dataList = state.isPage ? res.data[state.props.item] : res.data
|
||||||
state.pagination!.total = state.isPage ? res.data[state.props.totalCount] : 0
|
state.pagination!.total = state.isPage ? res.data[state.props.totalCount] : 0
|
||||||
}).catch((err: any) => {
|
}).catch((err: any) => {
|
||||||
|
150
src/views/mp/wx-account-fans/form.vue
Normal file
150
src/views/mp/wx-account-fans/form.vue
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-model="visible" :close-on-click-modal="false"
|
||||||
|
:title="form.id ? $t('common.editBtn') : $t('common.addBtn')" draggable>
|
||||||
|
<el-form ref="dataFormRef" v-loading="loading" :model="form" :rules="dataRules" label-width="90px">
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<el-col :span="24" class="mb20">
|
||||||
|
<el-form-item :label="t('fans.wxAccountName')" prop="wxAccountName">
|
||||||
|
<el-input v-model="form.wxAccountName" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" class="mb20">
|
||||||
|
<el-form-item :label="t('fans.wxAccountAppid')" prop="wxAccountAppid">
|
||||||
|
<el-input v-model="form.wxAccountAppid" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" class="mb20">
|
||||||
|
<el-form-item :label="t('fans.openid')" prop="openid">
|
||||||
|
<el-input v-model="form.openid" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" class="mb20">
|
||||||
|
<el-form-item :label="t('fans.nickname')" prop="nickname">
|
||||||
|
<el-input v-model="form.nickname" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" class="mb20">
|
||||||
|
<el-form-item :label="t('fans.remark')" prop="remark">
|
||||||
|
<el-input v-model="form.remark" :placeholder="t('fans.inputremarkTip')"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" class="mb20">
|
||||||
|
<el-form-item :label="t('fans.tagIds')" prop="tagIds">
|
||||||
|
<el-select v-model="form.tagIds" :placeholder="t('fans.inputTagTip')" class="w100" clearable multiple>
|
||||||
|
<el-option v-for="item in tagOption" :key="item.tagId" :label="item.tag" :value="item.tagId"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="visible = false">{{ $t('common.cancelButtonText') }}</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmit">{{ $t('common.confirmButtonText') }}</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="wx-fans" setup>
|
||||||
|
|
||||||
|
import {addObj, getObj, putObj} from "/@/api/mp/wx-account-fans";
|
||||||
|
import {list} from '/@/api/mp/wx-account-tag'
|
||||||
|
import {useMessage} from "/@/hooks/message";
|
||||||
|
import {useI18n} from "vue-i18n"
|
||||||
|
|
||||||
|
const {t} = useI18n();
|
||||||
|
const emit = defineEmits(['refresh']);
|
||||||
|
|
||||||
|
// 定义变量内容
|
||||||
|
const dataFormRef = ref();
|
||||||
|
const visible = ref(false)
|
||||||
|
const loading = ref(false)
|
||||||
|
|
||||||
|
const wxAccountAppid = ref()
|
||||||
|
|
||||||
|
|
||||||
|
// 提交表单数据
|
||||||
|
const form = reactive({
|
||||||
|
id: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const dataRules = ref([])
|
||||||
|
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (row: any, accountId: string) => {
|
||||||
|
visible.value = true
|
||||||
|
form.id = row.id
|
||||||
|
wxAccountAppid.value = accountId
|
||||||
|
|
||||||
|
// 重置表单数据
|
||||||
|
if (dataFormRef.value) {
|
||||||
|
dataFormRef.value.resetFields()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (form.id) {
|
||||||
|
getFansData()
|
||||||
|
}
|
||||||
|
getTagList()
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const getFansData = () => {
|
||||||
|
loading.value = true
|
||||||
|
getObj(form.id).then(res => {
|
||||||
|
Object.assign(form, res.data)
|
||||||
|
}).finally(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
const onSubmit = () => {
|
||||||
|
dataFormRef.value.validate((valid: boolean) => {
|
||||||
|
if (!valid) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
loading.value = true
|
||||||
|
if (form.id) {
|
||||||
|
putObj(form).then(() => {
|
||||||
|
useMessage().success(t('common.editSuccessText'))
|
||||||
|
visible.value = false // 关闭弹窗
|
||||||
|
emit('refresh')
|
||||||
|
}).catch((err: any) => {
|
||||||
|
useMessage().error(err.msg)
|
||||||
|
}).finally(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
addObj(form).then(() => {
|
||||||
|
useMessage().success(t('common.addSuccessText'))
|
||||||
|
visible.value = false // 关闭弹窗
|
||||||
|
emit('refresh')
|
||||||
|
}).catch((err: any) => {
|
||||||
|
useMessage().error(err.msg)
|
||||||
|
}).finally(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const tagOption = ref([])
|
||||||
|
const getTagList = () => {
|
||||||
|
list(wxAccountAppid.value).then(res => {
|
||||||
|
tagOption.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 暴露变量
|
||||||
|
defineExpose({
|
||||||
|
openDialog
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
@ -12,11 +12,13 @@ export default {
|
|||||||
country: '国家',
|
country: '国家',
|
||||||
province: '省份',
|
province: '省份',
|
||||||
city: '城市',
|
city: '城市',
|
||||||
tagIds: '分组ID',
|
tagIds: '分组',
|
||||||
headimgUrl: ' headimgUrl',
|
headimgUrl: ' headimgUrl',
|
||||||
remark: '备注',
|
remark: '备注',
|
||||||
wxAccountId: '微信公众号ID',
|
wxAccountId: '微信公众号ID',
|
||||||
wxAccountName: '微信公众号',
|
wxAccountName: '微信公众号',
|
||||||
wxAccountAppid: '公众号appid'
|
wxAccountAppid: '公众号appid',
|
||||||
|
inputremarkTip: '请输入备注',
|
||||||
|
inputTagTip: '请选择分组'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,10 +27,6 @@
|
|||||||
@click="exportExcel">
|
@click="exportExcel">
|
||||||
{{ $t('common.exportBtn') }}
|
{{ $t('common.exportBtn') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-auth="'mp_fans_del'" :disabled="multiple" class="ml10" formDialogRef icon="Delete"
|
|
||||||
type="primary" @click="handleDelete(selectObjs)">
|
|
||||||
{{ $t('common.delBtn') }}
|
|
||||||
</el-button>
|
|
||||||
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
|
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
|
||||||
@queryTable="getDataList"></right-toolbar>
|
@queryTable="getDataList"></right-toolbar>
|
||||||
</div>
|
</div>
|
||||||
@ -41,20 +37,29 @@
|
|||||||
<el-table-column :label="t('fans.index')" type="index" width="80"/>
|
<el-table-column :label="t('fans.index')" type="index" width="80"/>
|
||||||
<el-table-column :label="t('fans.id')" prop="id" show-overflow-tooltip/>
|
<el-table-column :label="t('fans.id')" prop="id" show-overflow-tooltip/>
|
||||||
<el-table-column :label="t('fans.openid')" prop="openid" show-overflow-tooltip/>
|
<el-table-column :label="t('fans.openid')" prop="openid" show-overflow-tooltip/>
|
||||||
<el-table-column :label="t('fans.subscribeStatus')" prop="subscribeStatus" show-overflow-tooltip/>
|
<el-table-column :label="t('fans.subscribeStatus')" prop="subscribeStatus" show-overflow-tooltip>
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="subscribe" :value="scope.row.subscribeStatus"></dict-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column :label="t('fans.subscribeTime')" prop="subscribeTime" show-overflow-tooltip/>
|
<el-table-column :label="t('fans.subscribeTime')" prop="subscribeTime" show-overflow-tooltip/>
|
||||||
<el-table-column :label="t('fans.nickname')" prop="nickname" show-overflow-tooltip/>
|
<el-table-column :label="t('fans.nickname')" prop="nickname" show-overflow-tooltip/>
|
||||||
<el-table-column :label="t('fans.gender')" prop="gender" show-overflow-tooltip/>
|
|
||||||
<el-table-column :label="t('fans.language')" prop="language" show-overflow-tooltip/>
|
<el-table-column :label="t('fans.language')" prop="language" show-overflow-tooltip/>
|
||||||
<el-table-column :label="t('fans.tagIds')" prop="tagIds" show-overflow-tooltip/>
|
<el-table-column :label="t('fans.tagIds')" prop="tagIds" show-overflow-tooltip width="200">
|
||||||
|
<template #default="scope">
|
||||||
|
<span v-for="(tag, index) in scope.row.tagList" :key="index">
|
||||||
|
<el-tag>{{ tag.tag }} </el-tag>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column :label="t('fans.remark')" prop="remark" show-overflow-tooltip/>
|
<el-table-column :label="t('fans.remark')" prop="remark" show-overflow-tooltip/>
|
||||||
<el-table-column :label="t('fans.wxAccountName')" prop="wxAccountName" show-overflow-tooltip/>
|
<el-table-column :label="t('fans.wxAccountName')" prop="wxAccountName" show-overflow-tooltip/>
|
||||||
<el-table-column :label="$t('common.action')" width="150">
|
<el-table-column :label="$t('common.action')" width="150">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button v-auth="'mp_fans_edit'" text type="primary"
|
<el-button text type="primary"
|
||||||
@click="formDialogRef.openDialog(scope.row.id)">{{ $t('common.editBtn') }}
|
@click="formDialogRef.openDialog(scope.row,state.queryForm.wxAccountAppid)">{{ $t('common.editBtn') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-auth="'sys_fans_del'" text type="primary" @click="handleDelete([scope.row.id])">{{
|
<el-button text type="primary" @click="handleDelete([scope.row.id])">{{
|
||||||
$t('common.delBtn')
|
$t('common.delBtn')
|
||||||
}}
|
}}
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -62,6 +67,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"/>
|
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"/>
|
||||||
|
<form-dialog ref="formDialogRef" @refresh="getDataList"></form-dialog>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -72,6 +78,11 @@ import {delObjs, fetchList, sync} from "/@/api/mp/wx-account-fans";
|
|||||||
import { fetchAccountList } from '/@/api/mp/wx-account'
|
import { fetchAccountList } from '/@/api/mp/wx-account'
|
||||||
import {useMessage, useMessageBox} from "/@/hooks/message";
|
import {useMessage, useMessageBox} from "/@/hooks/message";
|
||||||
import {useI18n} from "vue-i18n";
|
import {useI18n} from "vue-i18n";
|
||||||
|
import {useDict} from "/@/hooks/dict";
|
||||||
|
|
||||||
|
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||||
|
|
||||||
|
const { subscribe } = useDict('subscribe')
|
||||||
|
|
||||||
// 引入组件
|
// 引入组件
|
||||||
const {t} = useI18n()
|
const {t} = useI18n()
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
// 定义子组件向父组件传值/事件
|
// 定义子组件向父组件传值/事件
|
||||||
const emit = defineEmits(['refresh']);
|
const emit = defineEmits(['refresh']);
|
||||||
import {useMessage} from "/@/hooks/message";
|
import {useMessage} from "/@/hooks/message";
|
||||||
import {addObj, putObj} from '/@/api/mp/wx-account-tag'
|
import {addObj} from '/@/api/mp/wx-account-tag'
|
||||||
import {useI18n} from "vue-i18n"
|
import {useI18n} from "vue-i18n"
|
||||||
|
|
||||||
const {t} = useI18n();
|
const {t} = useI18n();
|
||||||
|
@ -308,7 +308,7 @@ const handleEdit = (row: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleDel = (row) => {
|
const handleDel = (row) => {
|
||||||
useMessageBox().confirm("").then(() => {
|
useMessageBox().confirm("是否确认删除此数据?").then(() => {
|
||||||
delObj(row.id).then(() =>{
|
delObj(row.id).then(() =>{
|
||||||
useMessage().success("删除成功")
|
useMessage().success("删除成功")
|
||||||
getDataList()
|
getDataList()
|
||||||
|
Loading…
Reference in New Issue
Block a user