From f7e2effec658dbeb8abb9f336704c064036aed39 Mon Sep 17 00:00:00 2001
From: clay <20932067@zju.edu.cn>
Date: Sun, 25 Sep 2022 16:48:26 +0800
Subject: [PATCH] =?UTF-8?q?clay=20commit=20:=20=E7=AC=AC=E4=B8=80=E9=98=B6?=
=?UTF-8?q?=E6=AE=B5=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ebts-ui/.env.staging | 1 -
ebts-ui/src/api/sist/article.js | 11 +
.../views/sist/article/components/article.vue | 28 +-
ebts-ui/src/views/sist/article/index.vue | 331 ++++++++++++------
ebts-ui/src/views/sist/navigation/index.vue | 42 ++-
ebts-ui/src/views/system/user/index.vue | 49 ++-
6 files changed, 320 insertions(+), 142 deletions(-)
diff --git a/ebts-ui/.env.staging b/ebts-ui/.env.staging
index e9f4593..c97e6f1 100644
--- a/ebts-ui/.env.staging
+++ b/ebts-ui/.env.staging
@@ -5,5 +5,4 @@ ENV = 'staging'
# EBTS/测试环境
#VUE_APP_BASE_API = '/dev-api'
-#VUE_APP_BASE_API = 'http://sistapi.hchyun.cn/dev-api'
VUE_APP_BASE_API = 'http://192.168.190.67/dev-api'
diff --git a/ebts-ui/src/api/sist/article.js b/ebts-ui/src/api/sist/article.js
index 2b001d4..0b4b0b0 100644
--- a/ebts-ui/src/api/sist/article.js
+++ b/ebts-ui/src/api/sist/article.js
@@ -1,4 +1,5 @@
import request from '@/utils/request'
+import da from 'element-ui/src/locale/lang/da'
// 查询系统文章列表
@@ -105,6 +106,16 @@ export function updateArticle(data) {
})
}
+// 修改系统文章
+export function putIndex(data) {
+ console.log(data,"data")
+ return request({
+ url: '/sist/article/index',
+ method: 'put',
+ data: data
+ })
+}
+
// 删除系统文章
export function delArticle(id) {
return request({
diff --git a/ebts-ui/src/views/sist/article/components/article.vue b/ebts-ui/src/views/sist/article/components/article.vue
index aa17a0c..d2307bb 100644
--- a/ebts-ui/src/views/sist/article/components/article.vue
+++ b/ebts-ui/src/views/sist/article/components/article.vue
@@ -231,9 +231,9 @@ export default {
this.getDicts("article_site_type").then(response => {
this.sitetypeOptions = response.data;
});
- this.getDicts("article_type").then(response => {
- this.articleTypeOptions = response.data;
- });
+ // this.getDicts("article_type").then(response => {
+ // this.articleTypeOptions = response.data;
+ // });
this.getDicts("is_top").then(response => {
this.isTopOptions = response.data;
});
@@ -246,9 +246,9 @@ export default {
this.getDicts("article_status").then(response => {
this.statusOptions = response.data;
});
-
getArticleNav().then(res=>{
let data = res.data
+ this.articleTypeOptions = data
for (let item of data) {
if (item.sitetype == 1){
this.sistArticleTypeOption.push(item)
@@ -256,11 +256,8 @@ export default {
this.labArticleTypeOption.push(item)
}
}
-
-
console.log(res)
})
-
// getArticleType().then(res => {
// let dictCodes = res.data
// let articleList = this.articleTypeOptions
@@ -281,22 +278,23 @@ export default {
mounted() {
},
methods: {
- getSistApprove(dictCode) {
- this.judgeThumbnail(dictCode)
- getArticleApprove(dictCode).then(res => {
+ getSistApprove(navId) {
+ this.judgeThumbnail(navId)
+ getArticleApprove(navId).then(res => {
this.sistApproveOption = res.data
})
},
- getLabApprove(dictCode) {
- this.judgeThumbnail(dictCode)
- getArticleApprove(dictCode).then(res => {
+ getLabApprove(navId) {
+ this.judgeThumbnail(navId)
+ getArticleApprove(navId).then(res => {
this.labApproveOption = res.data
})
},
- judgeThumbnail(dictCode){
+ judgeThumbnail(navId){
let articleList = this.articleTypeOptions
for (let article of articleList) {
- if (dictCode === article.dictCode && article.attribute1 == 1){
+ console.log(article.title)
+ if (navId === article.id && article.isThumbnail == 1){
this.imgurlShow = true
return
}
diff --git a/ebts-ui/src/views/sist/article/index.vue b/ebts-ui/src/views/sist/article/index.vue
index d2a5a7c..adfd282 100644
--- a/ebts-ui/src/views/sist/article/index.vue
+++ b/ebts-ui/src/views/sist/article/index.vue
@@ -12,16 +12,16 @@
-
+
-
+
-
-
+
+
@@ -118,14 +118,15 @@
-
-
+
+
+
@@ -145,11 +146,11 @@
-
-
- {{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{m}:{s}') }}
-
-
+
+
+
+
+
{{ parseTime(scope.row.publishTime, '{y}-{m}-{d} {h}:{m}:{s}') }}
@@ -182,13 +183,22 @@
@click="handleApprova(scope.row)"
>审批
-
+ 推首页
+
+ 下线
+
@@ -200,18 +210,48 @@
:limit.sync="queryParams.pageInfo.pageSize"
@pagination="getList"
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ebts-ui/src/views/sist/navigation/index.vue b/ebts-ui/src/views/sist/navigation/index.vue
index b7113de..b675cca 100644
--- a/ebts-ui/src/views/sist/navigation/index.vue
+++ b/ebts-ui/src/views/sist/navigation/index.vue
@@ -129,16 +129,25 @@
-
-
-
-
+
+
+ {{dict.label}}
+
+
+
+
+
+
+
+
+
+
+
{
this.form = response.data;
+ console.log(this.form,"this.form")
+ if (this.form.isThumbnail == null){
+ this.form.isThumbnail = 0
+ }
console.log(response.data,"data")
if (this.form.pid == 0) {
this.form.ptitle = "顶级节点"
diff --git a/ebts-ui/src/views/system/user/index.vue b/ebts-ui/src/views/system/user/index.vue
index 3577f84..5588cf5 100644
--- a/ebts-ui/src/views/system/user/index.vue
+++ b/ebts-ui/src/views/system/user/index.vue
@@ -365,6 +365,7 @@ import { getToken } from "@/utils/auth";
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import { getArticleNav } from '../../../api/sist/article'
export default {
name: "User",
@@ -540,7 +541,31 @@ export default {
},
getSiteTypeTree() {
- this.getDicts('article_type').then(res => {
+ // this.getDicts('article_type').then(res => {
+ // let sist = {
+ // attribute2: 1,
+ // dictCode: 0,
+ // dictLabel: "信息网站",
+ // children: [],
+ // }
+ // let lab = {
+ // attribute2: 2,
+ // dictCode: 1,
+ // dictLabel: "lab实验室",
+ // children: [],
+ // }
+ // let data = res.data
+ // for (let i = 0; i < data.length; i++) {
+ // if (data[i].attribute2 === 1) {
+ // sist.children.push(data[i])
+ // } else {
+ // lab.children.push(data[i])
+ // }
+ // }
+ // this.siteTypeOptions.push(sist)
+ // this.siteTypeOptions.push(lab)
+ // })
+ getArticleNav().then(res=>{
let sist = {
attribute2: 1,
dictCode: 0,
@@ -554,16 +579,28 @@ export default {
children: [],
}
let data = res.data
- for (let i = 0; i < data.length; i++) {
- if (data[i].attribute2 === 1) {
- sist.children.push(data[i])
- } else {
- lab.children.push(data[i])
+ for (let item of data) {
+ if (item.sitetype === "1"){
+ let node = {
+ attribute2: 1,
+ dictCode: item.id,
+ dictLabel: item.title,
+ }
+ sist.children.push(node)
+ }else {
+ let node = {
+ attribute2: 2,
+ dictCode: item.id,
+ dictLabel: item.title,
+ }
+ lab.children.push(node)
}
}
+ console.log(res)
this.siteTypeOptions.push(sist)
this.siteTypeOptions.push(lab)
})
+
},
// 树权限(展开/折叠)