文章置顶等

master
yujialong 2 years ago
parent b2dc8250e3
commit 9e75121a19
  1. 1
      src/api/index.js
  2. 2
      src/layouts/header/index.vue
  3. 30
      src/pages/article/list/index.vue
  4. 2
      src/pages/user/list/index.vue
  5. 40
      src/plugins/requests/index.js

@ -76,4 +76,5 @@ export default {
individualTemplateDetailsStyle: `iasf/template/individualTemplateDetailsStyle`, individualTemplateDetailsStyle: `iasf/template/individualTemplateDetailsStyle`,
longPageListStyle: `iasf/template/longPageListStyle`, longPageListStyle: `iasf/template/longPageListStyle`,
resort: `iasf/sysContent/sort`, resort: `iasf/sysContent/sort`,
articleTopOperation: `iasf/sysContent/articleTopOperation`,
} }

@ -98,7 +98,7 @@ export default {
// //
toIndex() { toIndex() {
const { site } = this.$store.state.content const { site } = this.$store.state.content
window.open((Setting.isDev ? `http://${location.hostname}:8095` : site.domainName) + `/#/column?siteId=${site.id}`) window.open((Setting.isDev ? `http://${location.hostname}:8095/` : site.domainName) + `#/column?siteId=${site.id}`)
}, },
// //
siteCommand(e) { siteCommand(e) {

@ -39,18 +39,6 @@
<el-table-column v-if="settings[0].show" type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column v-if="settings[0].show" type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column v-if="settings[1].show" show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column> <el-table-column v-if="settings[1].show" show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column>
<el-table-column prop="sequence" label="文章排序" align="center" min-width="110" sortable="custom">
<template slot-scope="scope">
<el-input
v-if="scope.row.editing"
class="squ-input"
v-model.number="scope.row.sequence"
></el-input>
<span v-else>{{ scope.row.sequence }}</span>
<i v-if="scope.row.editing" class="el-icon-check squ-icon" @click="submitSequence(scope.row)"></i>
<i v-auth="'/site/list:' + siteName + ':内容管理:文章管理:文章排序设置'" v-else class="el-icon-edit squ-icon" @click="editSequence(scope.row)"></i>
</template>
</el-table-column>
<el-table-column v-if="settings[2].show" prop="columnName" label="栏目" align="center" min-width="120"></el-table-column> <el-table-column v-if="settings[2].show" prop="columnName" label="栏目" align="center" min-width="120"></el-table-column>
<el-table-column prop="classificationName" label="所属分类" align="center" min-width="120"></el-table-column> <el-table-column prop="classificationName" label="所属分类" align="center" min-width="120"></el-table-column>
<el-table-column v-if="settings[3].show" prop="typeId" label="栏目类型" align="center" min-width="100"> <el-table-column v-if="settings[3].show" prop="typeId" label="栏目类型" align="center" min-width="100">
@ -68,13 +56,18 @@
{{ scope.row.isRelease ? '已发布' : '草稿' }} {{ scope.row.isRelease ? '已发布' : '草稿' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="settings[10].show" label="操作" align="center" width="210"> <el-table-column v-auth="'/site/list:' + siteName + ':内容管理:文章管理:置顶'" prop="sequence" label="置顶" align="center" min-width="80" sortable="custom">
<template slot-scope="scope">
<i v-if="scope.row.isRelease" :class="['squ-icon', scope.row.isTop ? 'el-icon-check' : 'el-icon-close']" @click="sticky(scope.row)"></i>
</template>
</el-table-column>
<el-table-column v-if="settings[10].show" label="操作" align="center" width="190">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:置顶'" type="text" @click="sticky(scope.row)">置顶</el-button>
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:预览'" type="text" @click="preview(scope.row)">预览</el-button> <el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:预览'" type="text" @click="preview(scope.row)">预览</el-button>
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button> <el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-switch <el-switch
v-if="scope.row.isRelease"
v-auth="'/site/list:' + siteName + ':内容管理:文章管理:禁用'" v-auth="'/site/list:' + siteName + ':内容管理:文章管理:禁用'"
class="m-l-10" class="m-l-10"
v-model="scope.row.isDisable" v-model="scope.row.isDisable"
@ -362,7 +355,7 @@ export default {
}, },
// //
sticky(row) { sticky(row) {
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=1`).then(res => { this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => {
this.initData() this.initData()
}).catch(res => {}) }).catch(res => {})
}, },
@ -391,8 +384,13 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.squ-icon { .squ-icon {
margin-left: 5px; font-size: 16px;
font-weight: 600;
cursor: pointer; cursor: pointer;
color: #f70000;
&.el-icon-check {
color: #05991e;
}
} }
/deep/.squ-input { /deep/.squ-input {
width: auto; width: auto;

@ -521,7 +521,7 @@ export default {
const len = cas.length const len = cas.length
if (cas && len) { if (cas && len) {
this.orgForm.pid = cas[len - 1] this.orgForm.pid = cas[len - 1]
} else { } else if (!form.pid) {
form.pid = 0 form.pid = 0
} }
if (!form.id) { if (!form.id) {

@ -47,28 +47,26 @@ service.interceptors.response.use(
// 服务器状态码不是200的情况 // 服务器状态码不是200的情况
error => { error => {
if (error.response.status) { if (error.response.status) {
switch (error.response.status) { const { msg, code } = error.response.data
case 500: switch (code) {
Util.errorMsg("网络错误"); // 401: 未登录
break;
// 401token过期
case 401: case 401:
Util.errorMsg(error.response.data.msg) Util.errorMsg("登录过期,请重新登录");
setTimeout(() => { setTimeout(() => {
store.dispatch('user/logout') store.dispatch('user/logout')
}, 1000) }, 1000);
break; break;
// 404请求不存在 // 403 token过期
case 404: case 403:
Util.errorMsg("网络请求不存在!"); Util.errorMsg("登录过期,请重新登录");
break; setTimeout(() => {
case 401001: store.dispatch('user/logout')
Util.errorMsg(error.response.data.msg); }, 1000);
break; break;
// 其他错误,直接抛出错误提示 // 其他错误,直接抛出错误提示
default: default:
Util.errorMsg(error.response.data.msg); Util.errorMsg(msg);
Promise.reject(res); Promise.reject(error.response.data);
} }
return Promise.reject(error.response); return Promise.reject(error.response);
} }

Loading…
Cancel
Save