13 changed files with 128 additions and 638 deletions
@ -1,2 +1,2 @@ |
|||||
VITE_APP_NAME=webSoft |
|
||||
|
VITE_APP_NAME=WSADMIN |
||||
VITE_API_URL=/api |
VITE_API_URL=/api |
||||
|
@ -1,4 +1 @@ |
|||||
VITE_APP_NAME=后台管理系统 |
|
||||
VITE_SOCKET_URL=wss://server.websoft.top |
|
||||
VITE_SERVER_URL=https://server.websoft.top/api |
|
||||
VITE_API_URL=https://cms.websoft.top/api |
VITE_API_URL=https://cms.websoft.top/api |
||||
|
@ -1,142 +0,0 @@ |
|||||
import request from '@/utils/request'; |
|
||||
import type {ApiResult, PageResult} from '@/api'; |
|
||||
import type { |
|
||||
CmsWebsiteField, |
|
||||
CmsWebsiteFieldParam |
|
||||
} from '@/api/cms/cmsWebsiteField/model'; |
|
||||
import {COMMON_API_URL, SERVER_API_URL} from '@/config/setting'; |
|
||||
|
|
||||
/** |
|
||||
* 分页查询项目参数 |
|
||||
*/ |
|
||||
export async function pageWebsiteField(params: CmsWebsiteFieldParam) { |
|
||||
const res = await request.get<ApiResult<PageResult<CmsWebsiteField>>>( |
|
||||
COMMON_API_URL + '/system/website-field/page', |
|
||||
{ |
|
||||
params |
|
||||
} |
|
||||
); |
|
||||
if (res.data.code === 0) { |
|
||||
return res.data.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 查询项目参数列表 |
|
||||
*/ |
|
||||
export async function listWebsiteField(params?: CmsWebsiteFieldParam) { |
|
||||
const res = await request.get<ApiResult<CmsWebsiteField[]>>( |
|
||||
SERVER_API_URL + '/system/website-field', |
|
||||
{ |
|
||||
params |
|
||||
} |
|
||||
); |
|
||||
if (res.data.code === 0 && res.data.data) { |
|
||||
return res.data.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 根据id查询项目参数 |
|
||||
*/ |
|
||||
export async function getWebsiteField(id: number) { |
|
||||
const res = await request.get<ApiResult<CmsWebsiteField>>( |
|
||||
SERVER_API_URL + '/system/website-field/' + id |
|
||||
); |
|
||||
if (res.data.code === 0 && res.data.data) { |
|
||||
return res.data.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 添加项目参数 |
|
||||
*/ |
|
||||
export async function addWebsiteField(data: CmsWebsiteField) { |
|
||||
const res = await request.post<ApiResult<unknown>>( |
|
||||
SERVER_API_URL + '/system/website-field', |
|
||||
data |
|
||||
); |
|
||||
if (res.data.code === 0) { |
|
||||
return res.data.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 修改项目参数 |
|
||||
*/ |
|
||||
export async function updateWebsiteField(data: CmsWebsiteField) { |
|
||||
const res = await request.put<ApiResult<unknown>>( |
|
||||
SERVER_API_URL + '/system/website-field', |
|
||||
data |
|
||||
); |
|
||||
if (res.data.code === 0) { |
|
||||
return res.data.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 删除项目参数 |
|
||||
*/ |
|
||||
export async function removeWebsiteField(id?: number) { |
|
||||
const res = await request.delete<ApiResult<unknown>>( |
|
||||
SERVER_API_URL + '/system/website-field/' + id |
|
||||
); |
|
||||
if (res.data.code === 0) { |
|
||||
return res.data.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 批量删除项目参数 |
|
||||
*/ |
|
||||
export async function removeBatchWebsiteField(data: (number | undefined)[]) { |
|
||||
const res = await request.delete<ApiResult<unknown>>( |
|
||||
SERVER_API_URL + '/system/website-field/batch', |
|
||||
{ |
|
||||
data |
|
||||
} |
|
||||
); |
|
||||
if (res.data.code === 0) { |
|
||||
return res.data.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 检查IP是否存在 |
|
||||
*/ |
|
||||
export async function checkExistence( |
|
||||
field: string, |
|
||||
value: string, |
|
||||
id?: number |
|
||||
) { |
|
||||
const res = await request.get<ApiResult<unknown>>( |
|
||||
SERVER_API_URL + '/system/website-field/existence', |
|
||||
{ |
|
||||
params: {field, value, id} |
|
||||
} |
|
||||
); |
|
||||
if (res.data.code === 0) { |
|
||||
return res.data.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 恢复项目参数 |
|
||||
*/ |
|
||||
export async function undeleteWebsiteField(id?: number) { |
|
||||
const res = await request.delete<ApiResult<unknown>>( |
|
||||
SERVER_API_URL + '/system/website-field/undelete/' + id |
|
||||
); |
|
||||
if (res.data.code === 0) { |
|
||||
return res.data.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
@ -1,65 +0,0 @@ |
|||||
import type { PageParam } from '@/api'; |
|
||||
|
|
||||
/** |
|
||||
* 网站参数 |
|
||||
*/ |
|
||||
export interface WebsiteField { |
|
||||
id?: number; |
|
||||
name?: string; |
|
||||
value?: string; |
|
||||
comments?: string; |
|
||||
userId?: number; |
|
||||
template?: string; |
|
||||
defaultValue?: string; |
|
||||
modifyRange?: string; |
|
||||
type?: number; |
|
||||
status?: any; |
|
||||
sortNumber?: any; |
|
||||
createTime?: string; |
|
||||
deleted?: number; |
|
||||
style?: string; |
|
||||
} |
|
||||
|
|
||||
// 约定的网站参数名称
|
|
||||
export interface WebsiteParam { |
|
||||
// 网站名称
|
|
||||
site_logo?: string; |
|
||||
// 登录页面标题
|
|
||||
login_name?: string; |
|
||||
// 登录页面的背景图片
|
|
||||
login_bg_img?: string; |
|
||||
} |
|
||||
|
|
||||
// 约定的小程序参数名称
|
|
||||
export interface MpWeixinParam { |
|
||||
// 小程序LOGO
|
|
||||
site_logo?: string; |
|
||||
// 我的页面顶部背景图片
|
|
||||
mp_user_top?: string; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 网站参数搜索条件 |
|
||||
*/ |
|
||||
export interface WebsiteFieldParam extends PageParam { |
|
||||
id?: number; |
|
||||
userId?: number; |
|
||||
name?: string; |
|
||||
websiteId?: number; |
|
||||
} |
|
||||
|
|
||||
export interface Config { |
|
||||
siteName?: string; |
|
||||
siteLogo?: string; |
|
||||
domain?: string; |
|
||||
icpNo?: string; |
|
||||
copyright?: string; |
|
||||
loginBgImg?: string; |
|
||||
address?: string; |
|
||||
tel?: string; |
|
||||
kefu2?: string; |
|
||||
kefu1?: string; |
|
||||
email?: string; |
|
||||
loginTitle?: string; |
|
||||
sysLogo?: string; |
|
||||
} |
|
@ -1,169 +0,0 @@ |
|||||
import request from '@/utils/request'; |
|
||||
import type { ApiResult, PageResult } from '@/api'; |
|
||||
import type { Website, WebsiteParam } from './model'; |
|
||||
import { MODULES_API_URL } from '@/config/setting'; |
|
||||
|
|
||||
/** |
|
||||
* 获取网站信息 |
|
||||
*/ |
|
||||
export async function getSiteInfo() { |
|
||||
const res = await request.get<ApiResult<Website>>( |
|
||||
MODULES_API_URL + '/cms/website/getSiteInfo' |
|
||||
); |
|
||||
if (res.data.code === 0 && res.data.data) { |
|
||||
return res.data.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 清除缓存 |
|
||||
*/ |
|
||||
export async function removeSiteInfoCache(key?: string) { |
|
||||
const res = await request.delete<ApiResult<unknown>>( |
|
||||
MODULES_API_URL + '/cms/website/clearSiteInfo/' + key |
|
||||
); |
|
||||
if (res.data.code === 0) { |
|
||||
return res.data.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 分页查询网站 |
|
||||
*/ |
|
||||
export async function pageWebsite(params: WebsiteParam) { |
|
||||
const res = await request.get<ApiResult<PageResult<Website>>>( |
|
||||
MODULES_API_URL + '/cms/website/page', |
|
||||
{ |
|
||||
params |
|
||||
} |
|
||||
); |
|
||||
if (res.data.code === 0) { |
|
||||
return res.data.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 查询网站列表 |
|
||||
*/ |
|
||||
export async function listWebsite(params?: WebsiteParam) { |
|
||||
const res = await request.get<ApiResult<Website[]>>( |
|
||||
MODULES_API_URL + '/cms/website', |
|
||||
{ |
|
||||
params |
|
||||
} |
|
||||
); |
|
||||
if (res.data.code === 0 && res.data.data) { |
|
||||
return res.data.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 添加网站 |
|
||||
*/ |
|
||||
export async function addWebsite(data: Website) { |
|
||||
const res = await request.post<ApiResult<unknown>>( |
|
||||
MODULES_API_URL + '/cms/website', |
|
||||
data |
|
||||
); |
|
||||
if (res.data.code === 0) { |
|
||||
return res.data.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 修改网站 |
|
||||
*/ |
|
||||
export async function updateWebsite(data: Website) { |
|
||||
const res = await request.put<ApiResult<unknown>>( |
|
||||
MODULES_API_URL + '/cms/website', |
|
||||
data |
|
||||
); |
|
||||
if (res.data.code === 0) { |
|
||||
return res.data.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 删除网站 |
|
||||
*/ |
|
||||
export async function removeWebsite(id?: number) { |
|
||||
const res = await request.delete<ApiResult<unknown>>( |
|
||||
MODULES_API_URL + '/cms/website/' + id |
|
||||
); |
|
||||
if (res.data.code === 0) { |
|
||||
return res.data.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 批量删除网站 |
|
||||
*/ |
|
||||
export async function removeBatchWebsite(data: (number | undefined)[]) { |
|
||||
const res = await request.delete<ApiResult<unknown>>( |
|
||||
MODULES_API_URL + '/cms/website/batch', |
|
||||
{ |
|
||||
data |
|
||||
} |
|
||||
); |
|
||||
if (res.data.code === 0) { |
|
||||
return res.data.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 修改用户状态 |
|
||||
*/ |
|
||||
export async function updateWebsiteStatus(websiteId?: number, status?: number) { |
|
||||
const res = await request.put<ApiResult<unknown>>( |
|
||||
MODULES_API_URL + '/cms/website/status', |
|
||||
{ |
|
||||
websiteId, |
|
||||
status |
|
||||
} |
|
||||
); |
|
||||
if (res.data.code === 0) { |
|
||||
return res.data.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 根据id查询网站 |
|
||||
*/ |
|
||||
export async function getWebsite(id: number) { |
|
||||
const res = await request.get<ApiResult<Website>>( |
|
||||
MODULES_API_URL + '/cms/website/' + id |
|
||||
); |
|
||||
if (res.data.code === 0 && res.data.data) { |
|
||||
return res.data.data; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 检查IP是否存在 |
|
||||
*/ |
|
||||
export async function checkExistence( |
|
||||
field: string, |
|
||||
value: string, |
|
||||
id?: number |
|
||||
) { |
|
||||
const res = await request.get<ApiResult<unknown>>( |
|
||||
MODULES_API_URL + '/cms/website/existence', |
|
||||
{ |
|
||||
params: { field, value, id } |
|
||||
} |
|
||||
); |
|
||||
if (res.data.code === 0) { |
|
||||
return res.data.message; |
|
||||
} |
|
||||
return Promise.reject(new Error(res.data.message)); |
|
||||
} |
|
@ -1,63 +0,0 @@ |
|||||
import { WebsiteField } from '@/api/cms/website/field/model'; |
|
||||
import { Navigation } from '@/api/cms/navigation/model'; |
|
||||
import { Link } from '@/api/cms/link/model'; |
|
||||
import { ArrangeCategory } from '@/api/cms/category/model'; |
|
||||
import { PageParam } from '@/api'; |
|
||||
|
|
||||
/** |
|
||||
* 菜单 |
|
||||
*/ |
|
||||
export interface Website { |
|
||||
websiteId?: number; |
|
||||
websiteName?: string; |
|
||||
websiteCode?: string; |
|
||||
websiteIcon?: string; |
|
||||
websiteLogo?: string; |
|
||||
websiteDarkLogo?: string; |
|
||||
keywords?: string; |
|
||||
address?: string; |
|
||||
phone?: string; |
|
||||
email?: string; |
|
||||
version?: number; |
|
||||
websiteType?: string; |
|
||||
expirationTime?: string; |
|
||||
templateId?: string; |
|
||||
industryParent?: string; |
|
||||
industryChild?: string; |
|
||||
companyId?: number; |
|
||||
prefix?: string; |
|
||||
domain?: string; |
|
||||
adminUrl?: string; |
|
||||
icpNo?: string; |
|
||||
policeNo?: string; |
|
||||
comments?: string; |
|
||||
statusText?: string; |
|
||||
sortNumber?: number; |
|
||||
createTime?: string; |
|
||||
disabled?: boolean; |
|
||||
country?: string; |
|
||||
province?: string; |
|
||||
city?: string; |
|
||||
region?: string; |
|
||||
appId?: number; |
|
||||
fields?: WebsiteField[]; |
|
||||
status?: number; |
|
||||
tenantId?: number; |
|
||||
tenantName?: string; |
|
||||
navigations?: Navigation[]; |
|
||||
categoryList?: ArrangeCategory[]; |
|
||||
links?: Link[]; |
|
||||
// 配置信息
|
|
||||
config?: any; |
|
||||
style?: string; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 菜单搜索参数 |
|
||||
*/ |
|
||||
export interface WebsiteParam extends PageParam { |
|
||||
title?: string; |
|
||||
path?: string; |
|
||||
authority?: string; |
|
||||
parentId?: number; |
|
||||
} |
|
@ -1,72 +0,0 @@ |
|||||
<!-- 公共参数数据源 --> |
|
||||
<template> |
|
||||
<a-select |
|
||||
:allow-clear="allowClear" |
|
||||
show-search |
|
||||
optionFilterProp="label" |
|
||||
:options="data" |
|
||||
:value="value" |
|
||||
class="w-full" |
|
||||
:placeholder="placeholder" |
|
||||
@update:value="updateValue" |
|
||||
@change="change" |
|
||||
@blur="onBlur" |
|
||||
/> |
|
||||
</template> |
|
||||
|
|
||||
<script lang="ts" setup> |
|
||||
import { ref } from 'vue'; |
|
||||
import { listWebsiteField } from '@/api/system/website/field'; |
|
||||
import { CmsWebsiteField } from '@/api/cms/cmsWebsiteField/model'; |
|
||||
|
|
||||
const emit = defineEmits<{ |
|
||||
(e: 'update:value', value: string): void; |
|
||||
(e: 'index', index: number): void; |
|
||||
(e: 'blur'): void; |
|
||||
(e: 'done', item: CmsWebsiteField): void; |
|
||||
}>(); |
|
||||
|
|
||||
const props = withDefaults( |
|
||||
defineProps<{ |
|
||||
value?: string; |
|
||||
placeholder?: string; |
|
||||
allowClear?: boolean; |
|
||||
width?: number; |
|
||||
index?: number; |
|
||||
}>(), |
|
||||
{ |
|
||||
placeholder: '请选择' |
|
||||
} |
|
||||
); |
|
||||
|
|
||||
const data = ref<CmsWebsiteField[]>(); |
|
||||
|
|
||||
/* 更新选中数据 */ |
|
||||
const updateValue = (value: string) => { |
|
||||
emit('update:value', value); |
|
||||
emit('index', Number(props.index)); |
|
||||
}; |
|
||||
|
|
||||
/* 失去焦点 */ |
|
||||
const onBlur = () => { |
|
||||
emit('blur'); |
|
||||
}; |
|
||||
|
|
||||
const change = (e, item) => { |
|
||||
emit('done', item); |
|
||||
}; |
|
||||
|
|
||||
const reload = () => { |
|
||||
data.value = []; |
|
||||
listWebsiteField({}).then((list) => { |
|
||||
data.value = list.map((d) => { |
|
||||
return { |
|
||||
label: d.name, |
|
||||
value: d.value |
|
||||
}; |
|
||||
}); |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
reload(); |
|
||||
</script> |
|
Loading…
Reference in new issue