From 7b9a4f5dc10f666c848d382f9756e01e3fb7923d Mon Sep 17 00:00:00 2001
From: Echo <1711788888@qq.com>
Date: Mon, 23 Jun 2025 17:05:42 +0800
Subject: [PATCH] =?UTF-8?q?:art:=20=20=E4=BC=98=E5=8C=96=E6=96=87=E7=AB=A0?=
=?UTF-8?q?=E5=92=8C=E5=88=86=E7=B1=BB=E6=A8=A1=E5=9D=97&=E6=96=B0?=
=?UTF-8?q?=E5=A2=9Ebanner?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/article/index.js | 14 ++
src/api/banner/index.js | 43 ++++
src/api/goods/index.js | 8 +
src/components/richtext/rich-edit.vue | 2 +-
src/components/userChoose/index.vue | 59 +++--
src/pathInfo.json | 5 +-
src/view/banner/index.vue | 265 ++++++++++++++++++++
src/view/category/category/category.vue | 54 +++-
src/view/category/category/categoryForm.vue | 4 +
src/view/goods/article/edit.vue | 11 +-
10 files changed, 420 insertions(+), 45 deletions(-)
create mode 100644 src/api/article/index.js
create mode 100644 src/api/banner/index.js
create mode 100644 src/view/banner/index.vue
diff --git a/src/api/article/index.js b/src/api/article/index.js
new file mode 100644
index 0000000..54f3bb0
--- /dev/null
+++ b/src/api/article/index.js
@@ -0,0 +1,14 @@
+import service from '@/utils/request'
+
+// @tag Order
+// @summary 获取订单列表
+// @param {object} params
+// @return {object} data
+// @router get /order/list
+export const list = (params) => {
+ return service({
+ url: '/article/list',
+ method: 'get',
+ params
+ })
+}
diff --git a/src/api/banner/index.js b/src/api/banner/index.js
new file mode 100644
index 0000000..1d008f3
--- /dev/null
+++ b/src/api/banner/index.js
@@ -0,0 +1,43 @@
+import service from '@/utils/request'
+
+
+export const list = (params) => {
+ return service({
+ url: '/banner/list',
+ method: 'get',
+ params
+ })
+}
+
+export const info = (params) => {
+ return service({
+ url: '/banner',
+ method: 'get',
+ params
+ })
+}
+
+
+export const creat = (data) => {
+ return service({
+ url: '/banner',
+ method: 'post',
+ data
+ })
+}
+
+export const deleteBanner = (data) => {
+ return service({
+ url: '/banner',
+ method: 'delete',
+ data
+ })
+}
+
+export const put = (data) => {
+ return service({
+ url: '/banner',
+ method: 'put',
+ data
+ })
+}
diff --git a/src/api/goods/index.js b/src/api/goods/index.js
index eec81e2..3291dba 100644
--- a/src/api/goods/index.js
+++ b/src/api/goods/index.js
@@ -40,3 +40,11 @@ export const detail = (id) => {
method: 'get',
})
}
+
+export const getTechers = (params) => {
+ return service({
+ url: '/app_user/teachers',
+ method: 'get',
+ params
+ })
+}
diff --git a/src/components/richtext/rich-edit.vue b/src/components/richtext/rich-edit.vue
index 030f35b..a2038c5 100644
--- a/src/components/richtext/rich-edit.vue
+++ b/src/components/richtext/rich-edit.vue
@@ -50,7 +50,7 @@
placeholder: '请输入内容...',
MENU_CONF: {}
}
- editorConfig.MENU_CONF['uploadImage'] = {
+ editorConfig.MENU_CONF['uploadImage','uploadVideo'] = {
fieldName: 'file',
server: basePath + '/fileUploadAndDownload/upload?noSave=1',
customInsert(res, insertFn) {
diff --git a/src/components/userChoose/index.vue b/src/components/userChoose/index.vue
index 9699ec7..274ffb7 100644
--- a/src/components/userChoose/index.vue
+++ b/src/components/userChoose/index.vue
@@ -49,8 +49,8 @@
>
-
-
+
+
{
tabList.value = res.data.list
total.value = res.data.total
@@ -171,44 +171,41 @@
// getStaffList()
// }
function nodeClick(e) {
- selectDept.value = e
+ if(!props.multiple) {
+ selectDept.value = e
+ }
}
function handleSelectionChange(selection) {
- console.log(selection)
- // 更新选中ID集合
- selection.forEach((row) => selectedIds.value.add(row.ID))
+ if (props.multiple) {
+ if (!depClick.value) {
+ // This is a user interaction on the current page.
+ const selectedOnPageIds = new Set(selection.map(row => row.ID));
- // 删除当前页取消选中的ID,前提是非点击部门或分页节点触发
- if (!depClick.value) {
- // 找出当前页需要删除的ID
- unChoosed.value = []
- if (selection.length > 0) {
- selection = selection.map((item) => item.ID)
- tabList.value.forEach((item) => {
- if (!selection.includes(item.ID)) {
- unChoosed.value.push(item.ID)
- }
- })
- } else {
- unChoosed.value = JSON.parse(JSON.stringify(tabList.value)).map((item) => item.ID)
+ // Iterate over all items on the current page to see what was selected or unselected.
+ tabList.value.forEach(rowOnPage => {
+ if (selectedOnPageIds.has(rowOnPage.ID)) {
+ selectedIds.value.add(rowOnPage.ID);
+ } else {
+ selectedIds.value.delete(rowOnPage.ID);
+ }
+ });
}
- selectedIds.value.forEach((id) => {
- if (unChoosed.value.includes(id)) {
- selectedIds.value.delete(id)
- }
- })
+ choosedTableRows.value = Array.from(selectedIds.value)
+ .map((id) => [...tabList.value, ...choosedTableRows.value].find((r) => r.ID === id))
+ .filter(Boolean)
}
- // 更新已选数据(使用过滤确保有效性)
- choosedTableRows.value = Array.from(selectedIds.value)
- .map((id) => [...tabList.value, ...choosedTableRows.value].find((r) => r.ID === id))
- .filter(Boolean)
}
// function filterNode(value, data) {
// if (!value) return true
// return data.label.includes(value)
// }
function requireDiolag() {
- emit('getRecipientInfo', props.multiple ? choosedTableRows.value : selectDept.value)
+ const dataToEmit = props.multiple ? choosedTableRows.value : selectDept.value;
+ if ((props.multiple && dataToEmit.length === 0) || (!props.multiple && !dataToEmit)) {
+ // Optional: show a message to the user
+ return;
+ }
+ emit('getRecipientInfo', dataToEmit)
dialoagVisible.value = false
}
defineExpose({
diff --git a/src/pathInfo.json b/src/pathInfo.json
index af81d89..79a7aea 100644
--- a/src/pathInfo.json
+++ b/src/pathInfo.json
@@ -1,5 +1,6 @@
{
"/src/view/about/index.vue": "About",
+ "/src/view/banner/index.vue": "Index",
"/src/view/bot/bot/bot.vue": "Bot",
"/src/view/bot/bot/botForm.vue": "BotForm",
"/src/view/category/category/category.vue": "Category",
@@ -86,5 +87,7 @@
"/src/plugin/customerservice/view/reply/index.vue": "ServiceIndex",
"/src/plugin/customerservice/view/script/index.vue": "ServiceIndex",
"/src/plugin/customerservice/view/service/index.vue": "ServiceIndex",
- "/src/plugin/email/view/index.vue": "Email"
+ "/src/plugin/email/view/index.vue": "Email",
+ "/src/plugin/picturelibrary/view/components/imageLibrary.vue": "ImageLibrary",
+ "/src/plugin/picturelibrary/view/index.vue": "PictureLibrary"
}
\ No newline at end of file
diff --git a/src/view/banner/index.vue b/src/view/banner/index.vue
new file mode 100644
index 0000000..aeaea57
--- /dev/null
+++ b/src/view/banner/index.vue
@@ -0,0 +1,265 @@
+
+
+
+
+ 新增Banner
+
+
+
+
+
+
+
+
+
+
+
+
+ handleStatusChange(row)"
+ />
+
+
+
+
+ {{ formatDate(row.CreatedAt) }}
+
+
+
+
+ 编辑
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 启用
+ 停用
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/view/category/category/category.vue b/src/view/category/category/category.vue
index 9209f81..c1fad86 100644
--- a/src/view/category/category/category.vue
+++ b/src/view/category/category/category.vue
@@ -1,4 +1,3 @@
-
@@ -16,7 +15,7 @@
—
-
+
@@ -34,7 +33,7 @@
新增
删除
-
+
-
+
{{ formatDate(scope.row.CreatedAt) }}
-
+
+
+
+
+ 无
+
+
-
+
{{ formatBoolean(scope.row.active) }}
+
+ {{ formatBoolean(scope.row.index) }}
+
- 查看
+
+ 查看
+
编辑
删除
@@ -92,12 +108,18 @@
+
+
+
+
+
+
@@ -109,12 +131,25 @@
{{ detailFrom.name }}
+
+
+ 无
+
{{ detailFrom.order }}
{{ detailFrom.active }}
+
+ {{ detailFrom.index }}
+
{{ detailFrom.parentId }}
@@ -139,6 +174,7 @@ import { getDictFunc, formatDate, formatBoolean, filterDict ,filterDataSource, r
import { ElMessage, ElMessageBox } from 'element-plus'
import { ref, reactive } from 'vue'
import { useAppStore } from "@/pinia"
+import selectImage from '@/components/selectImage/selectImage.vue'
@@ -160,6 +196,8 @@ const formData = ref({
order: 0,
active: false,
parentId: 0,
+ index: 0,
+ icon: ''
})
@@ -370,6 +408,8 @@ const closeDialog = () => {
order: 0,
active: false,
parentId: 0,
+ index: 0,
+ icon: ''
}
}
// 弹窗确定
diff --git a/src/view/category/category/categoryForm.vue b/src/view/category/category/categoryForm.vue
index 48a71ba..0c72d35 100644
--- a/src/view/category/category/categoryForm.vue
+++ b/src/view/category/category/categoryForm.vue
@@ -12,6 +12,9 @@
+
+
+
@@ -54,6 +57,7 @@ const formData = ref({
order: 0,
active: false,
parentId: 0,
+ index:0,
})
// 验证规则
const rule = reactive({
diff --git a/src/view/goods/article/edit.vue b/src/view/goods/article/edit.vue
index 9e59f42..5104609 100644
--- a/src/view/goods/article/edit.vue
+++ b/src/view/goods/article/edit.vue
@@ -28,8 +28,8 @@
-
- userDialogRef.open()" />
+
+ userDialogRef.open()" />
@@ -90,7 +90,7 @@
coverImg: [
{ required: true, message: '请上传封面', trigger: 'blur' }
],
- teacher: [
+ teacherId: [
{ required: true, message: '请选择讲师', trigger: 'blur' }
],
content: [
@@ -125,8 +125,9 @@
}
}
function getStaffInfo(data) {
- formData.value.teacherId = data.ID
- formData.value.teacher = data.nickName
+ console.log(formData)
+ formData.value.teacherId = data.id
+ formData.value.teacherName = data.nick_name
}
function submit(formRef) {
if(!formRef) return