Merge remote-tracking branch 'origin/feature/v1.3_营销资产中台' into feature/v1.3_营销资产中台

This commit is contained in:
林志军
2025-07-10 14:24:11 +08:00
35 changed files with 525 additions and 252 deletions

View File

@ -225,7 +225,6 @@ const clearError = (field: string) => {
const handleOk = async () => {
visible.value = false;
await enterpriseStore.updateEnterpriseInfo();
handleUserLogin();
};
@ -269,11 +268,9 @@ const getProfileInfo = async () => {
mobileNumber.value = data['mobile'];
accounts.value = enterprises;
enterpriseStore.setEnterpriseInfo(data);
userStore.setUserInfo(data);
if (enterprises.length > 0) {
if (enterprises.length === 1) {
await enterpriseStore.updateEnterpriseInfo();
handleUserLogin();
} else {
// 多个企业时候需要弹窗让用户选择企业

View File

@ -99,7 +99,7 @@ const addAccountVisible = ref(false);
const deleteVisible = ref(false);
const deleteTitle = ref('');
const enterpriseInfo = store.getEnterpriseInfo();
const enterpriseInfo = store.enterpriseInfo;
const okText = computed(() => {
if (!canAddAccount.value) {

View File

@ -48,7 +48,7 @@ const form = reactive({
name: '',
});
const enterpriseInfo = store.getEnterpriseInfo();
const enterpriseInfo = store.enterpriseInfo;
const columns = [
{

View File

@ -26,7 +26,7 @@
v-if="props.product.status === Status.Enable || props.product.status === Status.ON_TRIAL"
class="primary-button"
type="primary"
@click="gotoModule(props.product.menu_id)"
@click="gotoModule(props.product.id)"
>
进入模块
</a-button>
@ -70,13 +70,16 @@ import { trialProduct } from '@/api/all';
import { useRouter } from 'vue-router';
import CustomerServiceModal from '@/components/customer-service-modal.vue';
import { appRoutes } from '@/router/routes';
import { useSidebarStore } from '@/stores/modules/side-bar';
import { useEnterpriseStore } from '@/stores/modules/enterprise';
import { useUserStore } from '@/stores';
import { getUserEnterpriseInfo } from '@/utils/user';
const props = defineProps<{
product: Product;
}>();
const emit = defineEmits(['refresh']);
const sidebarStore = useSidebarStore();
enum Status {
Disable = 0, // 禁用
@ -87,30 +90,37 @@ enum Status {
}
interface Product {
id: number;
status: Status;
name: string;
image: string;
desc: string;
menu_id: number;
id: number;
expired_at?: number;
}
const visible = ref(false);
const router = useRouter();
const enterpriseStore = useEnterpriseStore();
const userStore = useUserStore();
const sidebarStore = useSidebarStore();
const handleTrial = async (id: any) => {
await trialProduct(id);
AMessage.success('试用成功!');
emit('refresh');
const { code } = await trialProduct(id);
if (code === 200) {
getUserEnterpriseInfo();
AMessage.success('试用成功!');
emit('refresh');
}
};
const gotoModule = (menuId: number) => {
const _target = appRoutes.find((v) => v.meta.id === menuId);
if (_target) {
console.log({ _target });
router.push({ name: _target.name });
}
const routeMap: Record<number, string> = {
'1': 'DataEngineHotTranslation',
'2': 'RepositoryBrandMaterials',
};
console.log(routeMap[menuId]);
router.push({ name: routeMap[menuId] });
};
</script>
<style scoped lang="less">