diff --git a/src/api/content/ad.ts b/src/api/content/ad.ts new file mode 100644 index 0000000..521470a --- /dev/null +++ b/src/api/content/ad.ts @@ -0,0 +1,60 @@ +import { http } from '@/utils/http/axios'; + +/** + * @description: 列表 + */ +export function getAdList(params?) { + return http.request({ + url: '/ad/page', + method: 'GET', + params, + }); +} +/** + * @description: 根据ID获取详情 + */ +export function getAdDetail(adId) { + return http.request({ + url: '/ad/detail/'+adId, + method: 'get', + }); +} +/** + * @description: 添加 + */ +export function adAdd(data:any) { + return http.request({ + url: '/ad/add', + method: 'POST', + data, + }); +} +/** + * @description: 更新 + */ +export function adUpdate(data:any) { + return http.request({ + url: '/ad/update', + method: 'PUT', + data + }); +} +/** + * @description: 删除 + */ +export function adDelete(adId) { + return http.request({ + url: '/ad/delete/'+adId, + method: 'DELETE', + }); +} +/** + * @description: 批量删除 + */ +export function adBatchDelete(data:any) { + return http.request({ + url: '/ad/batchDelete', + method: 'DELETE', + data + }); +} \ No newline at end of file diff --git a/src/api/content/adSort.ts b/src/api/content/adSort.ts new file mode 100644 index 0000000..d9fd507 --- /dev/null +++ b/src/api/content/adSort.ts @@ -0,0 +1,67 @@ +import { http } from '@/utils/http/axios'; + +/** + * @description: 列表 + */ +export function getAdSortList(params?) { + return http.request({ + url: '/ad/sort/page', + method: 'GET', + params, + }); +} +export function getAdSortAllList(params?) { + return http.request({ + url: '/ad/sort/list', + method: 'GET', + params, + }); +} +/** + * @description: 根据ID获取详情 + */ +export function getAdSortDetail(adSortId) { + return http.request({ + url: '/ad/sort/detail/'+adSortId, + method: 'get', + }); +} +/** + * @description: 添加 + */ +export function adSortAdd(data:any) { + return http.request({ + url: '/ad/sort/add', + method: 'POST', + data, + }); +} +/** + * @description: 更新 + */ +export function adSortUpdate(data:any) { + return http.request({ + url: '/ad/sort/update', + method: 'PUT', + data + }); +} +/** + * @description: 删除 + */ +export function adSortDelete(adSortId) { + return http.request({ + url: '/ad/sort/delete/'+adSortId, + method: 'DELETE', + }); +} +/** + * @description: 批量删除 + */ +export function adSortBatchDelete(data:any) { + return http.request({ + url: '/ad/sort/batchDelete', + method: 'DELETE', + data + }); +} \ No newline at end of file diff --git a/src/components/Upload/Image.vue b/src/components/Upload/Image.vue index 9d28a46..16f46ff 100644 --- a/src/components/Upload/Image.vue +++ b/src/components/Upload/Image.vue @@ -122,8 +122,6 @@ interface UploadEmits { (e: 'update:imageUrl', value: string): void, (e: 'changeFileName', value: string): void; } -const oImg=ref('') -const fileName=ref('') const emit = defineEmits(); const loading=ref(false) const progress=ref(0) diff --git a/src/layout/components/Header/index.vue b/src/layout/components/Header/index.vue index b0d6603..4465113 100644 --- a/src/layout/components/Header/index.vue +++ b/src/layout/components/Header/index.vue @@ -384,7 +384,7 @@ const avatarSelect = (command) => { switch (command) { case '1': - router.push({ name: 'Setting' }); + router.push({ path: '/setting/profile' }); break; case '2': doLogout(); diff --git a/src/views/content/adSort/columns.ts b/src/views/content/adSort/columns.ts new file mode 100644 index 0000000..fbccf8a --- /dev/null +++ b/src/views/content/adSort/columns.ts @@ -0,0 +1,49 @@ +import { h } from 'vue'; +import { ElTag } from 'element-plus'; + +export const columns = [ + { + type: 'selection', + }, + { + label: '广告位名称', + prop: 'name', + }, + { + label: '广告位编号', + prop: 'location', + }, + { + label: '广告位类型', + prop: 'type', + render(record) { + let typeText = '' + switch (record.row.type) { + case 1: + typeText='网站' + break; + case 2: + typeText='手机站' + break; + case 3: + typeText='移动端' + break; + default: + break; + } + return h('span', typeText || '-'); + }, + }, + { + label: '排序', + prop: 'sort', + }, + { + label: '创建人', + prop: 'createUser', + }, + { + label: '创建时间', + prop: 'createTime', + }, +]; diff --git a/src/views/content/adSort/edit.vue b/src/views/content/adSort/edit.vue new file mode 100644 index 0000000..c2a68e1 --- /dev/null +++ b/src/views/content/adSort/edit.vue @@ -0,0 +1,118 @@ + + diff --git a/src/views/content/adSort/index.vue b/src/views/content/adSort/index.vue new file mode 100644 index 0000000..538cb2a --- /dev/null +++ b/src/views/content/adSort/index.vue @@ -0,0 +1,158 @@ + + + + + diff --git a/src/views/content/adSort/querySchemas.ts b/src/views/content/adSort/querySchemas.ts new file mode 100644 index 0000000..2f0521a --- /dev/null +++ b/src/views/content/adSort/querySchemas.ts @@ -0,0 +1,33 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'name', + component: 'Input', + label: '名称', + componentProps: { + placeholder: '请输入广告位名称', + }, + }, + { + field: 'type', + component: 'Select', + label: '类型', + componentProps: { + placeholder: '请选择广告位类型', + options: [ + { + label: '网站', + value: '1', + }, + { + label: '手机站', + value: '2', + }, + { + label: '移动端', + value: '3', + } + ], + }, + }, +]; diff --git a/src/views/content/article/columns.ts b/src/views/content/article/columns.ts new file mode 100644 index 0000000..9eec078 --- /dev/null +++ b/src/views/content/article/columns.ts @@ -0,0 +1,42 @@ +import { h } from 'vue'; +import { ElTag } from 'element-plus'; + +export const columns = [ + { + type: 'selection', + }, + { + label: '文章标题', + prop: 'title', + render(record) { + return h('a', { + href: 'http://www.baidu.com', + target:"_blank" + },record.row.title); + }, + }, + { + label: '文章分类', + prop: 'categoryName', + }, + // { + // label: '文章链接', + // value:'articelLink', + // isSlot:true, + // }, + { + label: '文章状态', + prop: 'status', + render(record) { + return h('span', record.row.status === 1 ? '下架' : '正常') + }, + }, + { + label: '创建人', + prop: 'createUser', + }, + { + label: '创建时间', + prop: 'createTime', + }, +]; diff --git a/src/views/content/article/edit.vue b/src/views/content/article/edit.vue new file mode 100644 index 0000000..c428ea0 --- /dev/null +++ b/src/views/content/article/edit.vue @@ -0,0 +1,160 @@ + + + diff --git a/src/views/content/article/index.vue b/src/views/content/article/index.vue new file mode 100644 index 0000000..c8d684f --- /dev/null +++ b/src/views/content/article/index.vue @@ -0,0 +1,160 @@ + + + + + diff --git a/src/views/content/article/querySchemas.ts b/src/views/content/article/querySchemas.ts new file mode 100644 index 0000000..f62291e --- /dev/null +++ b/src/views/content/article/querySchemas.ts @@ -0,0 +1,29 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'title', + component: 'Input', + label: '文章标题', + componentProps: { + placeholder: '请输入文章标题', + }, + }, + { + field: 'status', + component: 'Select', + label: '文章状态', + componentProps: { + placeholder: '请选择文章状态', + options: [ + { + label: '下架', + value: '1', + }, + { + label: '正常', + value: '0', + } + ], + }, + }, +];