From e53651d05fa26aa2ab09de25612ddbb8a1435da1 Mon Sep 17 00:00:00 2001
From: song
Date: Thu, 24 Feb 2022 16:42:48 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/contentIntro.js | 81 ++++
src/components/Banner/addOrEdit.vue | 2 +-
src/components/Banner/index.vue | 2 +-
src/components/Detail/addOrEdit.vue | 4 +-
src/components/Detail/index.vue | 16 +-
src/components/News/addOrEdit.vue | 2 +-
src/components/News/detailContent.vue | 30 ++
src/components/News/index.vue | 96 +++--
src/main.js | 1 +
src/styles/flex.scss | 514 ++++++++++++++++++++++++++
10 files changed, 695 insertions(+), 53 deletions(-)
create mode 100644 src/api/contentIntro.js
create mode 100644 src/components/News/detailContent.vue
create mode 100644 src/styles/flex.scss
diff --git a/src/api/contentIntro.js b/src/api/contentIntro.js
new file mode 100644
index 0000000..0ebe5b0
--- /dev/null
+++ b/src/api/contentIntro.js
@@ -0,0 +1,81 @@
+import request from '@/utils/request'
+const contentIntro = '/back/contentIntro'
+const content = '/content'
+
+/**
+ * 查询列表详情列表
+ * @param params
+ * @returns {Promise}
+ * @constructor
+ */
+export function POST_QUERY_DETAIL(params) {
+ return request({
+ url: `${contentIntro}/list`,
+ method: 'post',
+ data:params
+ }).then(res => {
+ return res.data
+ })
+}
+
+/**
+ * 单个列表详情
+ * @param params
+ * @returns {Promise}
+ * @constructor
+ */
+export function QUERY_DETAIL(params) {
+ return request({
+ url: `${content}/detail`,
+ method: 'get',
+ params
+ }).then(res => res.data)
+}
+
+/**
+ * 删除列表详情
+ * @param params
+ * @returns {Promise}
+ * @constructor
+ */
+export function DELETE_DETAIL(params) {
+ return request({
+ url: `${contentIntro}/delete`,
+ method: 'post',
+ data:params
+ }).then(res => {
+ return res.data
+ })
+}
+
+/**
+ * 添加列表详情
+ * @param params
+ * @returns {Promise}
+ * @constructor
+ */
+export function ADD_DETAIL(params) {
+ return request({
+ url: `${contentIntro}/add`,
+ method: 'post',
+ data:params
+ }).then(res => {
+ return res.data
+ })
+}
+
+/**
+ * 修改列表详情
+ * @param params
+ * @returns {Promise}
+ * @constructor
+ */
+export function UPDATE_DETAIL(params) {
+ return request({
+ url: `${contentIntro}/update`,
+ method: 'post',
+ data:params
+ }).then(res => {
+ return res.data
+ })
+}
diff --git a/src/components/Banner/addOrEdit.vue b/src/components/Banner/addOrEdit.vue
index 2738090..9616ce5 100644
--- a/src/components/Banner/addOrEdit.vue
+++ b/src/components/Banner/addOrEdit.vue
@@ -14,7 +14,7 @@
-
+
diff --git a/src/components/Detail/addOrEdit.vue b/src/components/Detail/addOrEdit.vue
index 08634e2..ff2bad2 100644
--- a/src/components/Detail/addOrEdit.vue
+++ b/src/components/Detail/addOrEdit.vue
@@ -2,7 +2,7 @@
{{ showAdd ? '添加' : '修改' }}详情
-
+
@@ -109,7 +109,7 @@
width="600px"
:show-close="false"
:visible.sync="showModal">
-
+
@@ -204,13 +204,11 @@
await QUERY_DETAIL(params).then(res => {
if(res.code === 200){
this.content = res.data.content
- this.keys.forEach((key,index) =>{
- if(key === row.detailId){
- this.keys.splice(index, 1)
- }else{
- this.keys.push(row.detailId)
- }
- })
+ if(this.keys.length){
+ this.keys.splice(0, 1, row.detailId)
+ }else{
+ this.keys.push(row.detailId)
+ }
}else{
Alert.fail(res.msg || '详情获取失败');
}
diff --git a/src/components/News/addOrEdit.vue b/src/components/News/addOrEdit.vue
index 08634e2..d11c874 100644
--- a/src/components/News/addOrEdit.vue
+++ b/src/components/News/addOrEdit.vue
@@ -43,7 +43,7 @@
components: {
// Editor,
},
- props: ['currList', 'showAdd', 'content'],
+ props: ['currList', 'showAdd'],
data() {
return {
labelPosition: 'right',
diff --git a/src/components/News/detailContent.vue b/src/components/News/detailContent.vue
new file mode 100644
index 0000000..b375f30
--- /dev/null
+++ b/src/components/News/detailContent.vue
@@ -0,0 +1,30 @@
+
+
+ {{ $moment(list.publishTime).format('YYYY-MM-DD HH:mm') }}
+ {{ $moment(list.createdAt).format('YYYY-MM-DD HH:mm') }}
+ {{ $moment(list.updatedAt).format('YYYY-MM-DD HH:mm') }}
+
+ {{ list.showType == 0 ? '文本' : list.showType == 1 ? '图片' : list.showType == 2 ? '视频' : '' }}
+
+ {{ list.jumpUrl }}
+
+
+ 暂无
+
+
+
+
+
diff --git a/src/components/News/index.vue b/src/components/News/index.vue
index 833693c..1416a57 100644
--- a/src/components/News/index.vue
+++ b/src/components/News/index.vue
@@ -18,17 +18,31 @@
>
-
-
-
- 暂无
-
-
+
+
+
+
+
+
+
@@ -36,31 +50,34 @@
-
- {{ $moment(lists.row.createdAt).format('YYYY-MM-DD HH:mm') }}
-
- {{ $moment(lists.row.updatedAt).format('YYYY-MM-DD HH:mm') }}
+
+
+
-
- {{ lists.row.modifyName }}
-
+
+
+ {{ setCode(lists.row.submitStatus) }}
确定删除吗?
取消
- 确定
+ 确定
删除
@@ -109,18 +126,19 @@
width="600px"
:show-close="false"
:visible.sync="showModal">
-
+