diff --git a/src/api/cms/article/model/index.ts b/src/api/cms/article/model/index.ts index e76d990..055907f 100644 --- a/src/api/cms/article/model/index.ts +++ b/src/api/cms/article/model/index.ts @@ -65,6 +65,8 @@ export interface ArticleParam extends PageParam { title?: string; articleId?: number; categoryId?: number; + model?: string; + modelName?: string; navigationId?: number; status?: number; sortNumber?: string; diff --git a/src/api/cms/design/model/index.ts b/src/api/cms/design/model/index.ts index 44e20a3..e8e6cdc 100644 --- a/src/api/cms/design/model/index.ts +++ b/src/api/cms/design/model/index.ts @@ -20,7 +20,7 @@ export interface Design { // 高 height?: string; // 页面样式 - styles?: string; + style?: string; // 附件 images?: string; // 用户ID diff --git a/src/api/cms/navigation/model/index.ts b/src/api/cms/navigation/model/index.ts index 2c4e552..8d379c7 100644 --- a/src/api/cms/navigation/model/index.ts +++ b/src/api/cms/navigation/model/index.ts @@ -11,6 +11,7 @@ export interface Navigation { path?: string; icon?: string; component?: string; + componentPath?: string; model?: string; modelName?: string; type?: number; @@ -40,6 +41,7 @@ export interface Navigation { isMpWeixin?: boolean; label?: string; value?: number; + style?: string; } /** diff --git a/src/api/cms/website/field/model/index.ts b/src/api/cms/website/field/model/index.ts index cf32e49..5928894 100644 --- a/src/api/cms/website/field/model/index.ts +++ b/src/api/cms/website/field/model/index.ts @@ -16,6 +16,7 @@ export interface WebsiteField { sortNumber?: any; createTime?: string; deleted?: number; + style?: string; } // 约定的网站参数名称 diff --git a/src/api/cms/website/model/index.ts b/src/api/cms/website/model/index.ts index 1826153..785f28a 100644 --- a/src/api/cms/website/model/index.ts +++ b/src/api/cms/website/model/index.ts @@ -49,6 +49,7 @@ export interface Website { links?: Link[]; // 配置信息 config?: any; + style?: string; } /** diff --git a/src/api/system/dict-data/model/index.ts b/src/api/system/dict-data/model/index.ts index d4d40a8..6383ed3 100644 --- a/src/api/system/dict-data/model/index.ts +++ b/src/api/system/dict-data/model/index.ts @@ -14,6 +14,10 @@ export interface DictData { dictDataCode?: string; // 字典数据名称 dictDataName?: string; + // 预设字段(路由地址) + path?: string; + // 预设字段(组件路径) + component?: string; // 字典标识 dictCode?: string; // 排序号 diff --git a/src/api/system/dictionary-data/model/index.ts b/src/api/system/dictionary-data/model/index.ts index e1301bd..734485a 100644 --- a/src/api/system/dictionary-data/model/index.ts +++ b/src/api/system/dictionary-data/model/index.ts @@ -12,8 +12,12 @@ export interface DictionaryData { dictDataCode?: string; // 字典数据名称 dictDataName?: string; + // 预设字段(路由地址) + path?: string; + // 组件路径 + component?: string; // 排序号 - sortNumber?: string; + sortNumber?: number; // 备注 comments?: string; // 创建时间 diff --git a/src/api/system/domain/index.ts b/src/api/system/domain/index.ts new file mode 100644 index 0000000..de4a858 --- /dev/null +++ b/src/api/system/domain/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { Domain, DomainParam } from './model'; +import { SERVER_API_URL } from '@/config/setting'; + +/** + * 分页查询授权域名 + */ +export async function pageDomain(params: DomainParam) { + const res = await request.get>>( + SERVER_API_URL + '/system/domain/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询授权域名列表 + */ +export async function listDomain(params?: DomainParam) { + const res = await request.get>( + SERVER_API_URL + '/system/domain', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加授权域名 + */ +export async function addDomain(data: Domain) { + const res = await request.post>( + SERVER_API_URL + '/system/domain', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改授权域名 + */ +export async function updateDomain(data: Domain) { + const res = await request.put>( + SERVER_API_URL + '/system/domain', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除授权域名 + */ +export async function removeDomain(id?: number) { + const res = await request.delete>( + SERVER_API_URL + '/system/domain/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除授权域名 + */ +export async function removeBatchDomain(data: (number | undefined)[]) { + const res = await request.delete>( + SERVER_API_URL + '/system/domain/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询授权域名 + */ +export async function getDomain(id: number) { + const res = await request.get>( + SERVER_API_URL + '/system/domain/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/system/domain/model/index.ts b/src/api/system/domain/model/index.ts new file mode 100644 index 0000000..89a73e4 --- /dev/null +++ b/src/api/system/domain/model/index.ts @@ -0,0 +1,38 @@ +import type { PageParam } from '@/api'; + +/** + * 授权域名 + */ +export interface Domain { + // ID + id?: number; + // 域名 + domain?: string; + // 主机记录 + hostName?: string; + // 记录值 + hostValue?: string; + // 状态 + status?: number; + // 排序号 + sortNumber?: number; + // 用户ID + userId?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; + // 修改时间 + updateTime?: string; + comments?: string; +} + +/** + * 授权域名搜索条件 + */ +export interface DomainParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/api/system/website/field/index.ts b/src/api/system/website/field/index.ts index db973f2..477bd09 100644 --- a/src/api/system/website/field/index.ts +++ b/src/api/system/website/field/index.ts @@ -134,7 +134,7 @@ export async function checkExistence( */ export async function configWebsiteField(params?: WebsiteFieldParam) { const res = await request.get>( - 'https://modules.gxwebsoft.com/api/system/website-field/config', + MODULES_API_URL + '/cms/website-field/config', { params } diff --git a/src/components/ChooseDictionary/index.vue b/src/components/ChooseDictionary/index.vue index 9e17f7c..65b24dc 100644 --- a/src/components/ChooseDictionary/index.vue +++ b/src/components/ChooseDictionary/index.vue @@ -62,7 +62,8 @@ data.value = list.map((d) => { return { label: d.dictDataName, - value: d.dictDataCode + value: d.dictDataCode, + component: d.component }; }); }); diff --git a/src/components/SelectWebsiteField/components/select-data.vue b/src/components/SelectWebsiteField/components/select-data.vue index 9435e1f..6567db1 100644 --- a/src/components/SelectWebsiteField/components/select-data.vue +++ b/src/components/SelectWebsiteField/components/select-data.vue @@ -154,11 +154,6 @@ /* 自定义行属性 */ const customRow = (record: Company) => { return { - // 行点击事件 - // onClick: () => { - // updateVisible(false); - // emit('done', record); - // }, // 行双击事件 onDblclick: () => { updateVisible(false); diff --git a/src/utils/common.ts b/src/utils/common.ts index 13d9097..46348b5 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -80,21 +80,21 @@ export function openSpmUrl(path: string, d?: any, id = 0): void { const timestamp = ref(Date.now() / 1000); token.value = `&token=${uuid()}`; - // TODO 含http直接跳转 - if (path.slice(0, 4) == 'http') { - window.open(`${path}`); - return; - } - // TODO 不传data - if (!d) { - window.open(`${domain}${path}`); - return; - } + // if (!d) { + // window.open(`${domain}${path}`); + // return; + // } // TODO 封装租户ID和店铺ID spm.value = `?spm=c.${uid}.${tid}.${pid}.${cid}.${id}.${timestamp.value}`; + // TODO 含http直接跳转 + if (path.slice(0, 4) == 'http') { + window.open(`${path}${spm.value}`); + return; + } + // 跳转页面 url.value = `${domain}${path}${spm.value}${token.value}`; window.open(url.value); diff --git a/src/views/cms/article/components/search.vue b/src/views/cms/article/components/search.vue index bd90924..3cdeee0 100644 --- a/src/views/cms/article/components/search.vue +++ b/src/views/cms/article/components/search.vue @@ -22,17 +22,26 @@ allow-clear :tree-data="navigationList" tree-default-expand-all - style="width: 230px" + style="width: 280px" placeholder="请选择栏目" :value="where.categoryId || undefined" :dropdown-style="{ maxHeight: '360px', overflow: 'auto' }" @update:value="(value?: number) => (where.categoryId = value)" @change="onCategoryId" /> + @@ -62,15 +71,18 @@ const type = ref(); // 统计数据 const articleCount = ref(); + const showChooseDict = ref(false); // 表单数据 const { where, resetFields } = useSearch({ articleId: undefined, + model: undefined, navigationId: undefined, categoryId: undefined, merchantId: undefined, status: undefined, - keywords: '' + keywords: '', + userId: undefined }); const emit = defineEmits<{ @@ -107,6 +119,13 @@ emit('search', where); }; + // 按模型查找 + const chooseModel = (item: Navigation) => { + where.model = `${item.value}`; + where.modelName = `${item.label}`; + emit('search', where); + }; + // 按分类查询 const onCategoryId = (id: number) => { where.categoryId = id; diff --git a/src/views/cms/article/index.vue b/src/views/cms/article/index.vue index e8536ea..1e1e8eb 100644 --- a/src/views/cms/article/index.vue +++ b/src/views/cms/article/index.vue @@ -317,7 +317,7 @@ data: res?.map((d) => { d.value = d.navigationId; d.label = d.title; - if (d.type != 2) { + if (d.model == 'links' || d.model == 'product' || d.path == '/') { d.disabled = true; } return d; diff --git a/src/views/cms/design/components/search.vue b/src/views/cms/design/components/search.vue index 82fea9d..634bb84 100644 --- a/src/views/cms/design/components/search.vue +++ b/src/views/cms/design/components/search.vue @@ -7,6 +7,18 @@ 添加 + + 重置 @@ -14,11 +26,14 @@ import { PlusOutlined } from '@ant-design/icons-vue'; import type { GradeParam } from '@/api/user/grade/model'; import { watch } from 'vue'; + import useSearch from "@/utils/use-search"; + import type { ArticleParam } from "@/api/cms/article/model"; const props = withDefaults( defineProps<{ // 选中的角色 selection?: []; + navigationList?: Navigator[]; }>(), {} ); @@ -35,6 +50,29 @@ emit('add'); }; + // 表单数据 + const { where, resetFields } = useSearch({ + articleId: undefined, + navigationId: undefined, + categoryId: undefined, + merchantId: undefined, + status: undefined, + keywords: '' + }); + + // 按分类查询 + const onCategoryId = (id: number) => { + where.categoryId = id; + emit('search', where); + }; + + /* 重置 */ + const reset = () => { + resetFields(); + type.value = ''; + reload(); + }; + watch( () => props.selection, () => {} diff --git a/src/views/cms/design/index.vue b/src/views/cms/design/index.vue index a135135..ba6678b 100644 --- a/src/views/cms/design/index.vue +++ b/src/views/cms/design/index.vue @@ -15,6 +15,7 @@ diff --git a/src/views/oa/domain/components/search.vue b/src/views/oa/domain/components/search.vue new file mode 100644 index 0000000..180b9c1 --- /dev/null +++ b/src/views/oa/domain/components/search.vue @@ -0,0 +1,53 @@ + + + + diff --git a/src/views/oa/domain/index.vue b/src/views/oa/domain/index.vue new file mode 100644 index 0000000..fb9c63a --- /dev/null +++ b/src/views/oa/domain/index.vue @@ -0,0 +1,246 @@ + + + + + + + diff --git a/src/views/system/dict/components/dict-data-edit.vue b/src/views/system/dict/components/dict-data-edit.vue index 3dece81..6dcb527 100644 --- a/src/views/system/dict/components/dict-data-edit.vue +++ b/src/views/system/dict/components/dict-data-edit.vue @@ -46,6 +46,15 @@ v-model:value="form.comments" /> + + + + @@ -84,6 +93,8 @@ dictDataId: undefined, dictDataName: '', dictDataCode: '', + path: '', + component: '', sortNumber: 100, comments: '' }); diff --git a/src/views/system/dictionary/components/dict-data-edit.vue b/src/views/system/dictionary/components/dict-data-edit.vue index 560b43e..eda1e4b 100644 --- a/src/views/system/dictionary/components/dict-data-edit.vue +++ b/src/views/system/dictionary/components/dict-data-edit.vue @@ -46,6 +46,15 @@ v-model:value="form.comments" /> + + + + @@ -87,6 +96,8 @@ dictDataId: undefined, dictDataName: '', dictDataCode: '', + path: '', + component: '', sortNumber: 100, comments: '' }); diff --git a/src/views/system/domain/components/domainEdit.vue b/src/views/system/domain/components/domainEdit.vue new file mode 100644 index 0000000..059f378 --- /dev/null +++ b/src/views/system/domain/components/domainEdit.vue @@ -0,0 +1,193 @@ + + + + diff --git a/src/views/system/domain/components/search.vue b/src/views/system/domain/components/search.vue new file mode 100644 index 0000000..180b9c1 --- /dev/null +++ b/src/views/system/domain/components/search.vue @@ -0,0 +1,53 @@ + + + + diff --git a/src/views/system/domain/index.vue b/src/views/system/domain/index.vue new file mode 100644 index 0000000..fb9c63a --- /dev/null +++ b/src/views/system/domain/index.vue @@ -0,0 +1,246 @@ + + + + + + + diff --git a/src/views/system/field/components/website-field-edit.vue b/src/views/system/field/components/website-field-edit.vue index f43dd57..282bb18 100644 --- a/src/views/system/field/components/website-field-edit.vue +++ b/src/views/system/field/components/website-field-edit.vue @@ -17,20 +17,14 @@ :wrapper-col="{ md: { span: 21 }, sm: { span: 22 }, xs: { span: 24 } }" > - - - - - - + - + 折叠全部 - - - + + 一键克隆 +