From a3ed8d0a731eabba9d4abe08c359935193659a98 Mon Sep 17 00:00:00 2001
From: lwh <2679599887@qq.com>
Date: Thu, 29 Jun 2023 10:33:00 +0800
Subject: [PATCH] =?UTF-8?q?fixed=20=E4=BF=AE=E6=94=B9=E4=BA=A7=E5=93=81?=
=?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=92=8C=E6=96=B0=E9=97=BB=E5=AF=BC=E5=85=A5?=
=?UTF-8?q?=E5=AF=BC=E5=87=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../news/components/AddNewsDialog.vue | 37 +++-
.../news/components/DetailNewsDialog.vue | 167 ++++++++-------
.../news/components/EditNewsDialog.vue | 199 ++++++++++--------
src/pages/index/business/news/index.vue | 27 ++-
.../business/products/product_type/index.vue | 20 +-
src/service/news.js | 77 +++----
6 files changed, 295 insertions(+), 232 deletions(-)
diff --git a/src/pages/index/business/news/components/AddNewsDialog.vue b/src/pages/index/business/news/components/AddNewsDialog.vue
index 9ebe47d..f0c6b36 100644
--- a/src/pages/index/business/news/components/AddNewsDialog.vue
+++ b/src/pages/index/business/news/components/AddNewsDialog.vue
@@ -12,11 +12,17 @@
-
+
+
+
+
+
+
@@ -34,13 +40,12 @@
-
+
-
+
@@ -50,6 +55,9 @@
+
+ 获取富文本内容
+
@@ -70,6 +78,7 @@
import { reactive, ref, watch } from "vue";
import { addNews, getDictionary } from "~/service/news";
import { useLoginStore } from "~/store";
+import { ElMessage } from "element-plus";
// --业务参数
@@ -85,6 +94,11 @@ async function get_news_type() {
})
}
+// 复制富文本内容
+async function handleCopyRichText() {
+ let text = await navigator.clipboard.writeText(formData.news_content);
+ ElMessage.success("富文本内容复制成功")
+}
@@ -127,6 +141,12 @@ const rules = reactive({
message: '新闻标题不能为空'
}
],
+ news_cover: [
+ {
+ required: true,
+ message: '新闻封面不能为空'
+ }
+ ],
news_sort: [
{
required: true,
@@ -175,4 +195,11 @@ const handleResetClick = async (formEl) => {
};
-
+
diff --git a/src/pages/index/business/news/components/DetailNewsDialog.vue b/src/pages/index/business/news/components/DetailNewsDialog.vue
index e95e62a..269db82 100644
--- a/src/pages/index/business/news/components/DetailNewsDialog.vue
+++ b/src/pages/index/business/news/components/DetailNewsDialog.vue
@@ -1,68 +1,65 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -71,24 +68,34 @@
diff --git a/src/pages/index/business/news/components/EditNewsDialog.vue b/src/pages/index/business/news/components/EditNewsDialog.vue
index 876949c..3920ec6 100644
--- a/src/pages/index/business/news/components/EditNewsDialog.vue
+++ b/src/pages/index/business/news/components/EditNewsDialog.vue
@@ -2,67 +2,65 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 获取富文本内容
+
+
+
+
@@ -77,7 +75,7 @@
diff --git a/src/pages/index/business/news/index.vue b/src/pages/index/business/news/index.vue
index 04d44fd..8673c4f 100644
--- a/src/pages/index/business/news/index.vue
+++ b/src/pages/index/business/news/index.vue
@@ -65,6 +65,12 @@
+
+
+ 暂无图片
+
@@ -146,16 +152,23 @@ const column = [
prop: "news_type",
label: '新闻类型',
},
+ {
+ prop: "news_cover",
+ label: '新闻封面',
+ width: "200",
+ },
{
prop: "news_title",
label: '新闻标题',
showOverflowTooltip: true,
+ width: "500",
},
- {
- prop: "news_intro",
- label: '新闻简介',
- showOverflowTooltip: true,
- },
+ // {
+ // prop: "news_intro",
+ // label: '新闻简介',
+ // showOverflowTooltip: true,
+ // width: "400",
+ // },
{
prop: "news_issue_date",
label: '发布日期',
@@ -164,11 +177,13 @@ const column = [
{
prop: "news_views_num",
label: '浏览次数',
- sortable: true
+ sortable: true,
+ width: "150",
},
{
prop: "news_sort",
label: '新闻排序',
+ width: "180",
sortable: true
},
{
diff --git a/src/pages/index/business/products/product_type/index.vue b/src/pages/index/business/products/product_type/index.vue
index a6d75e1..0d0262b 100644
--- a/src/pages/index/business/products/product_type/index.vue
+++ b/src/pages/index/business/products/product_type/index.vue
@@ -23,18 +23,17 @@
添加
-
-
-
-
-
+
+
+
+ 导出
-
+ 下载导入模板
@@ -57,7 +56,8 @@
:tree-props="{ children: 'children' }">
-
+
+
-
+
+
@@ -125,7 +126,6 @@ const headers = {
// 查询参数
const params = reactive({
product_type_name: "",
-
});
const handleCommand = ({ type, row }) => {
diff --git a/src/service/news.js b/src/service/news.js
index 190518f..327c0a4 100644
--- a/src/service/news.js
+++ b/src/service/news.js
@@ -1,47 +1,50 @@
-import { api, downloadFile, createApiUrl} from '~/utils/axios';
+import {
+ api,
+ downloadFile,
+ createApiUrl
+} from '~/utils/axios';
- /**
- * 导出新闻
- * @param {Object} data
- * @return {Promise} api
- */
- export function exportExcel(data) {
- downloadFile(createApiUrl('News.News/exportExcel'), data);
- }
-
- /**
- * 下载新闻模板
- * @param {Object} data
- * @return {Promise} api
- */
- export function downloadTemplate(data) {
- downloadFile(createApiUrl('News.News/downloadTemplate'), data);
- }
-
- /**
- * 导入新闻
- * @param {Object} data
- * @return {Promise} api
- */
- export const importExcel = createApiUrl('News.News/importExcel');
-
+/**
+ * 导出新闻
+ * @param {Object} data
+ * @return {Promise} api
+ */
+export function exportExcel(data) {
+ downloadFile(createApiUrl('News.News/exportExcel'), data);
+}
+
+/**
+ * 下载新闻模板
+ * @param {Object} data
+ * @return {Promise} api
+ */
+export function downloadTemplate(data) {
+ downloadFile(createApiUrl('News.News/downloadTemplate'), data);
+}
+
+/**
+ * 导入新闻
+ * @param {Object} data
+ * @return {Promise} api
+ */
+export const importExcel = createApiUrl('News.News/importExcel');
- /**
- * 获取字典值
- * @param {Object} data
- * @return {Promise} api
- */
- export function getDictionary(data) {
- return api.post('Dictionary.Dictionary/getDictionary', data, {
- });
- }
-
+
+/**
+ * 获取字典值
+ * @param {Object} data
+ * @return {Promise} api
+ */
+export function getDictionary(data) {
+ return api.post('Dictionary.Dictionary/getDictionary', data, {});
+}
+
/**
* 获取新闻列表
@@ -88,4 +91,4 @@ export function editNews(data) {
isShowSuccessMessage: true,
errorMessageText: '编辑失败'
});
-}
+}
\ No newline at end of file