悬浮栏联调

master
yujialong 6 months ago
parent 0a7e561fea
commit 29df2858c8
  1. 6
      package-lock.json
  2. 1
      package.json
  3. 165
      src/api/index.js
  4. 138
      src/layouts/header/index.vue
  5. 249
      src/layouts/navbar/index.vue
  6. 242
      src/pages/article/list/index.vue
  7. 393
      src/pages/column/add/index.vue
  8. 74
      src/pages/column/page/devHistory.vue
  9. 963
      src/pages/column/page/iasf.vue
  10. 576
      src/pages/floatingFrame/index.vue
  11. 1420
      src/pages/user/list/index.vue
  12. 103
      src/setting.js

6
package-lock.json generated

@ -9613,9 +9613,9 @@
} }
}, },
"lodash": { "lodash": {
"version": "4.17.15", "version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
}, },
"lodash._basecopy": { "lodash._basecopy": {
"version": "3.0.1", "version": "3.0.1",

@ -16,6 +16,7 @@
"element-ui": "^2.13.0", "element-ui": "^2.13.0",
"image-conversion": "^2.1.1", "image-conversion": "^2.1.1",
"js-cookie": "^2.2.1", "js-cookie": "^2.2.1",
"lodash": "^4.17.21",
"mavon-editor": "^2.6.17", "mavon-editor": "^2.6.17",
"postcss-px2rem": "^0.3.0", "postcss-px2rem": "^0.3.0",
"px2rem-loader": "^0.1.9", "px2rem-loader": "^0.1.9",

@ -2,85 +2,90 @@ import Setting from '@/setting'
const host = Setting.apiBaseURL const host = Setting.apiBaseURL
export default { export default {
logins: `iasf/sys/user/login`, logins: `/iasf/sys/user/login`,
verification: `${host}iasf/sys/getVerify`, verification: `${host}/iasf/sys/getVerify`,
upload: `${host}iasf/sysFiles/upload`, upload: `${host}/iasf/sysFiles/upload`,
listByPage: `iasf/sysFiles/listByPage`, listByPage: `/iasf/sysFiles/listByPage`,
delFile: `iasf/sysFiles/delete`, delFile: `/iasf/sysFiles/delete`,
updateFile: `iasf/sysFiles/update`, updateFile: `/iasf/sysFiles/update`,
dept: `iasf/sys/dept`, dept: `/iasf/sys/dept`,
deptTree: `iasf/sys/dept/tree`, deptTree: `/iasf/sys/dept/tree`,
depts: `iasf/sys/dept/tree`, depts: `/iasf/sys/dept/tree`,
users: `iasf/sys/users`, users: `/iasf/sys/users`,
user: `iasf/sys/user`, user: `/iasf/sys/user`,
sendPhoneOrEmailCode: `iasf/sys/sendPhoneOrEmailCode`, sendPhoneOrEmailCode: `/iasf/sys/sendPhoneOrEmailCode`,
updatePhoneOrEmail: `iasf/sys/updatePhoneOrEmail`, updatePhoneOrEmail: `/iasf/sys/updatePhoneOrEmail`,
updateUserAvatars: `${host}iasf/sys/updateUserAvatars`, updateUserAvatars: `${host}/iasf/sys/updateUserAvatars`,
staffTemplate: `http://139.159.254.212/用户导入模板.xlsx`, staffTemplate: `http://139.159.254.212/用户导入模板.xlsx`,
checkJobNumber: `iasf/sys/checkJobNumber`, checkJobNumber: `/iasf/sys/checkJobNumber`,
checkUsername: `iasf/sys/checkUsername`, checkUsername: `/iasf/sys/checkUsername`,
resetPwd: `iasf/sys/resetPwd`, resetPwd: `/iasf/sys/resetPwd`,
pwd: `iasf/sys/user/pwd`, pwd: `/iasf/sys/user/pwd`,
exportFailure: `${host}iasf/sys/exportFailure`, exportFailure: `${host}/iasf/sys/exportFailure`,
importStaff: `${host}iasf/sys/importStaff`, importStaff: `${host}/iasf/sys/importStaff`,
roles: `iasf/sys/roles`, roles: `/iasf/sys/roles`,
role: `iasf/sys/role`, role: `/iasf/sys/role`,
deleteRole: `iasf/sys/role/deleted`, deleteRole: `/iasf/sys/role/deleted`,
perTree: `iasf/sys/permission/tree/all`, perTree: `/iasf/sys/permission/tree/all`,
groupAdd: `iasf/sys/userGroup/add`, groupAdd: `/iasf/sys/userGroup/add`,
groupDel: `iasf/sys/userGroup/delete`, groupDel: `/iasf/sys/userGroup/delete`,
groupList: `iasf/sys/userGroup/list`, groupList: `/iasf/sys/userGroup/list`,
groupUpdate: `iasf/sys/userGroup/update`, groupUpdate: `/iasf/sys/userGroup/update`,
site: `iasf/sys/site/list`, site: `/iasf/sys/site/list`,
updateSite: `iasf/sys/site/update`, updateSite: `/iasf/sys/site/update`,
delSite: `iasf/sys/site/delete`, delSite: `/iasf/sys/site/delete`,
listWithTree: `iasf/sysColumn/listWithTree`, listWithTree: `/iasf/sysColumn/listWithTree`,
saveColumn: `iasf/sysColumn/save`, saveColumn: `/iasf/sysColumn/save`,
updateColumn: `iasf/sysColumn/update`, updateColumn: `/iasf/sysColumn/update`,
findColumn: `iasf/sysColumn/findById`, findColumn: `/iasf/sysColumn/findById`,
deleteColumn: `iasf/sysColumn/batchDeletion`, deleteColumn: `/iasf/sysColumn/batchDeletion`,
sameLevelJudgment: `iasf/sysColumn/sameLevelJudgment`, sameLevelJudgment: `/iasf/sysColumn/sameLevelJudgment`,
sortByColumn: `iasf/sysColumn/sortByColumn`, sortByColumn: `/iasf/sysColumn/sortByColumn`,
checkIfTheTitleIsRepeat: `iasf/sysContent/checkIfTheTitleIsRepeat`, checkIfTheTitleIsRepeat: `/iasf/sysContent/checkIfTheTitleIsRepeat`,
deleteArticle: `iasf/sysContent/batchDeletion`, deleteArticle: `/iasf/sysContent/batchDeletion`,
findArticle: `iasf/sysContent/findById`, findArticle: `/iasf/sysContent/findById`,
queryArticle: `iasf/sysContent/pagingQuery`, queryArticle: `/iasf/sysContent/pagingQuery`,
articleEnableOrDisable: `iasf/sysContent/articleEnableOrDisable`, articleEnableOrDisable: `/iasf/sysContent/articleEnableOrDisable`,
saveArticle: `iasf/sysContent/save`, saveArticle: `/iasf/sysContent/save`,
updateArticle: `iasf/sysContent/update`, updateArticle: `/iasf/sysContent/update`,
modifiedSort: `iasf/sysContent/modifiedSort`, modifiedSort: `/iasf/sysContent/modifiedSort`,
longPageColumnList: `iasf/pageManagement/longPageColumnList`, longPageColumnList: `/iasf/pageManagement/longPageColumnList`,
searchAllBySite: `iasf/sysNavigationStyle/searchAllBySite`, searchAllBySite: `/iasf/sysNavigationStyle/searchAllBySite`,
updateStyle: `iasf/sysNavigationStyle/update`, updateStyle: `/iasf/sysNavigationStyle/update`,
saveStyle: `iasf/sysNavigationStyle/save`, saveStyle: `/iasf/sysNavigationStyle/save`,
findPage: `iasf/sysColumnLongPage/getLongPageInformation`, findPage: `/iasf/sysColumnLongPage/getLongPageInformation`,
getRedisPage: `iasf/sysColumnLongPage/getRedisCache`, getRedisPage: `/iasf/sysColumnLongPage/getRedisCache`,
savePage: `iasf/sysColumnLongPage/save`, savePage: `/iasf/sysColumnLongPage/save`,
saveRedisPage: `iasf/sysColumnLongPage/saveTheCache`, saveRedisPage: `/iasf/sysColumnLongPage/saveTheCache`,
updatePage: `iasf/sysColumnLongPage/update`, updatePage: `/iasf/sysColumnLongPage/update`,
listOfColumnTemplates: `iasf/template/listOfColumnTemplates`, listOfColumnTemplates: `/iasf/template/listOfColumnTemplates`,
theTemplateIdGetsTheStyle: `iasf/template/theTemplateIdGetsTheStyle`, theTemplateIdGetsTheStyle: `/iasf/template/theTemplateIdGetsTheStyle`,
queryClassif: `iasf/content/classification/allTheQuery`, queryClassif: `/iasf/content/classification/allTheQuery`,
delClassif: `iasf/content/classification/delete`, delClassif: `/iasf/content/classification/delete`,
checkClassif: `iasf/content/classification/checkForHeavy`, checkClassif: `/iasf/content/classification/checkForHeavy`,
saveClassif: `iasf/content/classification/save`, saveClassif: `/iasf/content/classification/save`,
updateClassif: `iasf/content/classification/update`, updateClassif: `/iasf/content/classification/update`,
checkLabel: `iasf/content/label/checkForHeavy`, checkLabel: `/iasf/content/label/checkForHeavy`,
delLabel: `iasf/content/label/delete`, delLabel: `/iasf/content/label/delete`,
checkLabel: `iasf/content/label/checkForHeavy`, checkLabel: `/iasf/content/label/checkForHeavy`,
queryLabel: `iasf/content/label/queryAllArticleSubjectTags`, queryLabel: `/iasf/content/label/queryAllArticleSubjectTags`,
saveLabel: `iasf/content/label/save`, saveLabel: `/iasf/content/label/save`,
updateLabel: `iasf/content/label/update`, updateLabel: `/iasf/content/label/update`,
delContentFile: `iasf/content/file/delete`, delContentFile: `/iasf/content/file/delete`,
saveContentFile: `iasf/content/file/save`, saveContentFile: `/iasf/content/file/save`,
theAttachmentUnderTheQueryColumn: `iasf/content/file/theAttachmentUnderTheQueryColumn`, theAttachmentUnderTheQueryColumn: `/iasf/content/file/theAttachmentUnderTheQueryColumn`,
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`, articleTopOperation: `/iasf/sysContent/articleTopOperation`,
deleteUselessData: `iasf/sysColumn/deleteUselessData`, deleteUselessData: `/iasf/sysColumn/deleteUselessData`,
addSeo: `iasf/seo/add`, addSeo: `/iasf/seo/add`,
delSeo: `iasf/seo/delete`, delSeo: `/iasf/seo/delete`,
seoList: `iasf/seo/list`, seoList: `/iasf/seo/list`,
updateSeo: `iasf/seo/update`, updateSeo: `/iasf/seo/update`,
batchDeletionFloating: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/batchDeletion`,
findFloating: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/findById`,
listFloating: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/floatingBarList`,
saveFloating: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/saveOrUpdate`,
enableOrDisableScheme: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/enableOrDisableScheme`,
} }

@ -2,36 +2,28 @@
<div class="header"> <div class="header">
<div class="group"> <div class="group">
<img src="@/assets/images/group.png"> <img src="@/assets/images/group.png">
<breadcrumb v-if="crumbRefresh" <breadcrumb v-if="crumbRefresh" ref="breadcrumb" :data="crumbs"></breadcrumb>
ref="breadcrumb"
:data="crumbs"></breadcrumb>
</div> </div>
<div class="user-tool"> <div class="user-tool">
<template v-if="inContent"> <template v-if="inContent">
<div class="site cp" <div class="site cp" @click="toIndex">
@click="toIndex">
<img src="@/assets/images/index.png"> <img src="@/assets/images/index.png">
当前站点首页 当前站点首页
</div> </div>
<el-dropdown class="site-switch cp" <el-dropdown class="site-switch cp" @command="siteCommand">
@command="siteCommand">
<span class="el-dropdown-link"> <span class="el-dropdown-link">
切换站点<i class="el-icon-caret-bottom el-icon--right"></i> 切换站点<i class="el-icon-caret-bottom el-icon--right"></i>
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="(site, i) in sites" <el-dropdown-item v-for="(site, i) in sites" :key="i" :command="site">{{ site.siteName }}</el-dropdown-item>
:key="i"
:command="site">{{ site.siteName }}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </template>
<!-- <img class="cp" src="@/assets/images/notice.png"> --> <!-- <img class="cp" src="@/assets/images/notice.png"> -->
<el-dropdown class="user-wrap" <el-dropdown class="user-wrap" @command="userCommand">
@command="userCommand">
<div class="user"> <div class="user">
<el-avatar :size="36" <el-avatar :size="36" :src="avatar"></el-avatar>
:src="avatar"></el-avatar> <span class="username">{{ userName }}</span>
<span class="username">{{userName}}</span>
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="person">个人资料</el-dropdown-item> <el-dropdown-item command="person">个人资料</el-dropdown-item>
@ -52,7 +44,7 @@ export default {
sites: [], sites: [],
crumbRefresh: true, crumbRefresh: true,
inContent: false, // inContent: false, //
sitePath: ['/page', '/column', '/article'] sitePath: ['/page', '/column', '/article', '/seo', '/floatingFrame']
}; };
}, },
components: { components: {
@ -127,63 +119,75 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.header { .header {
position: relative; position: relative;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center;
height: 64px;
padding: 0 25px;
color: #333;
background-color: #fff;
box-shadow: 0px 1px 4px 0px rgba(0, 21, 41, 0.12);
.group {
display: inline-flex;
align-items: center; align-items: center;
height: 64px;
padding: 0 25px; span {
color: #333; margin-left: 13px;
background-color: #fff; font-size: 14px;
box-shadow: 0px 1px 4px 0px rgba(0, 21, 41, 0.12); color: #333;
.group {
display: inline-flex;
align-items: center;
span {
margin-left: 13px;
font-size: 14px;
color: #333;
}
}
.cp {
cursor: pointer;
}
.user-tool {
display: flex;
align-items: center;
} }
.site, }
.user-wrap {
display: inline-flex; .cp {
align-items: center; cursor: pointer;
}
.user-tool {
display: flex;
align-items: center;
}
.site,
.user-wrap {
display: inline-flex;
align-items: center;
}
.site {
img {
margin-right: 4px;
} }
.site { }
img {
margin-right: 4px; .site-switch {
} margin: 0 60px 0 54px;
color: #333;
i {
color: #000;
} }
.site-switch { }
margin: 0 60px 0 54px;
.user-wrap {
margin-left: 26px;
.user {
display: inline-flex;
align-items: center;
cursor: pointer;
.username {
margin-left: 8px;
color: #333; color: #333;
i { font-size: 14px;
color: #000; }
}
} }
.user-wrap {
margin-left: 26px; /deep/.el-avatar>img {
.user { width: 100%;
display: inline-flex;
align-items: center;
cursor: pointer;
.username {
margin-left: 8px;
color: #333;
font-size: 14px;
}
}
/deep/.el-avatar > img {
width: 100%;
}
} }
}
} }
</style> </style>

@ -1,115 +1,73 @@
<template> <template>
<div> <div>
<div v-show="!collapse" <div v-show="!collapse" class="flex-1">
class="flex-1">
<div class="logo"> <div class="logo">
<img width="30" <img width="30" src="@/assets/images/logo.png" alt="">
src="@/assets/images/logo.png"
alt="">
<span>网站管理后台</span> <span>网站管理后台</span>
</div> </div>
<el-menu :default-active="active" <el-menu :default-active="active" :default-openeds="['user']" background-color="#001529" text-color="#fff"
:default-openeds="['user']" active-text-color="#fff" :collapse="collapse" :collapse-transition="false" @select="menuSelect">
background-color="#001529"
text-color="#fff"
active-text-color="#fff"
:collapse="collapse"
:collapse-transition="false"
@select="menuSelect">
<template v-for="item in menus"> <template v-for="item in menus">
<template v-if="item.subs"> <template v-if="item.subs">
<el-submenu :index="item.index" <el-submenu :index="item.index" :key="item.index">
:key="item.index">
<template slot="title"> <template slot="title">
<img class="icon" <img class="icon" :src="require('@/assets/images/' + item.icon + '.png')" alt="">
:src="require('@/assets/images/' + item.icon + '.png')"
alt="">
<span slot="title">{{ item.title }}</span> <span slot="title">{{ item.title }}</span>
</template> </template>
<template v-for="subItem in item.subs"> <template v-for="subItem in item.subs">
<el-submenu v-if="subItem.subs" <el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index">
:index="subItem.index"
:key="subItem.index">
<template slot="title">{{ subItem.title }}</template> <template slot="title">{{ subItem.title }}</template>
<el-menu-item v-for="(threeItem,i) in subItem.subs" <el-menu-item v-for="(threeItem, i) in subItem.subs" :key="i" :index="threeItem.index">{{
:key="i" threeItem.title
:index="threeItem.index">{{ threeItem.title }}</el-menu-item> }}</el-menu-item>
</el-submenu> </el-submenu>
<el-menu-item v-else <el-menu-item v-else :index="subItem.index" :key="subItem.index">{{ subItem.title }}</el-menu-item>
:index="subItem.index"
:key="subItem.index">{{ subItem.title }}</el-menu-item>
</template> </template>
</el-submenu> </el-submenu>
</template> </template>
<template v-else> <template v-else>
<el-menu-item :index="item.index" <el-menu-item :index="item.index" :key="item.index">
:key="item.index"> <img class="icon" :src="require('@/assets/images/' + item.icon + '.png')" alt="">
<img class="icon"
:src="require('@/assets/images/' + item.icon + '.png')"
alt="">
<span slot="title">{{ item.title }}</span> <span slot="title">{{ item.title }}</span>
</el-menu-item> </el-menu-item>
</template> </template>
</template> </template>
</el-menu> </el-menu>
</div> </div>
<div v-show="collapse" <div v-show="collapse" class="light">
class="light">
<div class="col-wrap"> <div class="col-wrap">
<img class="logo-icon" <img class="logo-icon" src="@/assets/images/logo.png" alt="">
src="@/assets/images/logo.png"
alt="">
<ul class="col-nav"> <ul class="col-nav">
<li v-for="(item, i) in colNav" <li v-for="(item, i) in colNav" :key="i" @click="menuSelect(item.index)">
:key="i" <img width="16" :src="require('@/assets/images/' + item.icon + '.png')" alt="">
@click="menuSelect(item.index)">
<img width="16"
:src="require('@/assets/images/' + item.icon + '.png')"
alt="">
</li> </li>
</ul> </ul>
</div> </div>
<div class="col-menu"> <div class="col-menu">
<div class="name">{{ site.siteName }}</div> <div class="name">{{ site.siteName }}</div>
<el-menu v-if="colRefresh" <el-menu v-if="colRefresh" :default-active="siteActive" background-color="#fff" text-color="#333"
:default-active="siteActive" active-text-color="#fff" :collapse-transition="false" router>
background-color="#fff"
text-color="#333"
active-text-color="#fff"
:collapse-transition="false"
router>
<template v-for="item in sites"> <template v-for="item in sites">
<template v-if="item.subs"> <template v-if="item.subs">
<el-submenu :index="item.index" <el-submenu :index="item.index" :key="item.index">
:key="item.index">
<template slot="title"> <template slot="title">
<img width="14" <img width="14" class="icon" :src="require('@/assets/images/' + item.icon + '.png')" alt="">
class="icon"
:src="require('@/assets/images/' + item.icon + '.png')"
alt="">
<span slot="title">{{ item.title }}</span> <span slot="title">{{ item.title }}</span>
</template> </template>
<template v-for="subItem in item.subs"> <template v-for="subItem in item.subs">
<el-submenu v-if="subItem.subs" <el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index">
:index="subItem.index"
:key="subItem.index">
<template slot="title">{{ subItem.title }}</template> <template slot="title">{{ subItem.title }}</template>
<el-menu-item v-for="(threeItem,i) in subItem.subs" <el-menu-item v-for="(threeItem, i) in subItem.subs" :key="i" :index="threeItem.index">{{
:key="i" threeItem.title
:index="threeItem.index">{{ threeItem.title }}</el-menu-item> }}</el-menu-item>
</el-submenu> </el-submenu>
<el-menu-item v-else <el-menu-item v-else :index="subItem.index" :key="subItem.index">{{ subItem.title }}</el-menu-item>
:index="subItem.index"
:key="subItem.index">{{ subItem.title }}</el-menu-item>
</template> </template>
</el-submenu> </el-submenu>
</template> </template>
<template v-else> <template v-else>
<el-menu-item :index="item.index" <el-menu-item :index="item.index" :key="item.index">
:key="item.index"> <img class="icon" :src="require('@/assets/images/' + item.icon + '.png')" alt="">
<img class="icon"
:src="require('@/assets/images/' + item.icon + '.png')"
alt="">
<span slot="title">{{ item.title }}</span> <span slot="title">{{ item.title }}</span>
</el-menu-item> </el-menu-item>
</template> </template>
@ -278,82 +236,99 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.nav { .nav {
height: 100%;
background-color: #001529;
box-shadow: 2px 0px 6px 0px rgba(92, 111, 130, 0.35);
overflow: auto;
.logo {
display: flex;
align-items: center;
padding-left: 28px;
margin: 15px 0 26px;
font-size: 16px;
color: #fff;
img {
margin-right: 8px;
}
}
/deep/.el-menu {
border-right: 0 !important;
.icon {
margin: 0 11px 0 5px;
}
.el-menu-item {
&.is-active {
background-color: #2962ff !important;
}
}
.el-menu .el-menu-item {
padding-left: 50px !important;
}
}
.light {
display: flex;
height: 100%; height: 100%;
background-color: #001529; background-color: #fff;
box-shadow: 2px 0px 6px 0px rgba(92, 111, 130, 0.35); overflow: hidden;
overflow: auto;
.logo { .col-wrap {
display: flex; width: 64px;
align-items: center; background-color: #001529;
padding-left: 28px;
margin: 15px 0 26px;
font-size: 16px;
color: #fff;
img {
margin-right: 8px;
}
} }
/deep/.el-menu {
border-right: 0 !important; .logo-icon {
.icon { width: 41px;
margin: 0 11px 0 5px; margin: 16px 0 30px 7px;
}
.el-menu-item {
&.is-active {
background-color: #2962ff !important;
}
}
.el-menu .el-menu-item {
padding-left: 50px !important;
}
} }
.light {
display: flex; .col-nav {
height: 100%; text-align: center;
background-color: #fff;
overflow: hidden; li {
.col-wrap { padding: 25px 0;
width: 64px; cursor: pointer;
background-color: #001529; }
} }
.logo-icon {
width: 41px; .name {
margin: 16px 0 30px 7px; margin: 17px 0 27px 15px;
} font-size: 15px;
.col-nav { font-weight: 600;
text-align: center; text-align: center;
li { color: #333;
padding: 25px 0; line-height: 32px;
cursor: pointer; }
}
} .col-menu {
.name { width: 192px;
margin: 17px 0 27px 15px;
font-size: 15px;
font-weight: 600;
text-align: center;
color: #333;
line-height: 32px;
}
.col-menu {
width: 192px;
}
/deep/.el-submenu__title {
padding-left: 14px !important;
}
.icon {
margin-left: 0;
}
} }
/deep/.el-submenu__title {
padding-left: 14px !important;
}
.icon {
margin-left: 0;
}
}
} }
.sidebar::-webkit-scrollbar { .sidebar::-webkit-scrollbar {
width: 0; width: 0;
} }
.sidebar-el-menu:not(.el-menu--collapse) { .sidebar-el-menu:not(.el-menu--collapse) {
width: 100%; width: 100%;
} }
.sidebar > ul {
height: 100%; .sidebar>ul {
height: 100%;
} }
</style> </style>

@ -3,189 +3,100 @@
<div style="width: 218px;border-right: 1px solid #EBEDF0"> <div style="width: 218px;border-right: 1px solid #EBEDF0">
<p class="page-name mb">全部栏目</p> <p class="page-name mb">全部栏目</p>
<div style="height: calc(100% - 50px);overflow: auto"> <div style="height: calc(100% - 50px);overflow: auto">
<el-tree ref="column" <el-tree ref="column" :data="columns" highlight-current :expand-on-click-node="false" default-expand-all
:data="columns" :props="defaultProps" node-key="id" @node-click="initData">
highlight-current <span class="custom-tree-node" slot-scope="{ node, data }">
:expand-on-click-node="false" <span class="org-name" :title="node.label">{{ node.label }}</span>
default-expand-all
:props="defaultProps"
node-key="id"
@node-click="initData">
<span class="custom-tree-node"
slot-scope="{ node, data }">
<span class="org-name"
:title="node.label">{{ node.label }}</span>
</span> </span>
</el-tree> </el-tree>
</div> </div>
</div> </div>
<div class="p-l-20" <div class="p-l-20" style="width: calc(100% - 219px);">
style="width: calc(100% - 219px);">
<div class="tool"> <div class="tool">
<div class="search-wrap"> <div class="search-wrap">
<el-select v-model="field" <el-select v-model="field" @change="initData">
@change="initData"> <el-option v-for="(item, i) in keywords" :key="i" :label="item.name" :value="item.id">
<el-option v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
<el-input class="keyword" <el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name"
:placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input>
v-model.trim="keyword"
clearable></el-input>
</div> </div>
<div class="actions"> <div class="actions">
<el-dropdown class="setting" <el-dropdown class="setting" trigger="click" :hide-on-click="false">
trigger="click" <img class="icon" src="@/assets/images/setting.png" alt="">
:hide-on-click="false">
<img class="icon"
src="@/assets/images/setting.png"
alt="">
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item> <el-dropdown-item>
<el-button @click="resetColumns" <el-button @click="resetColumns" type="text">列重置</el-button>
type="text">列重置</el-button>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item v-for="(column, i) in settings" <el-dropdown-item v-for="(column, i) in settings" :key="i" :divided="i === 0">
:key="i"
:divided="i === 0">
<el-checkbox v-model="column.show">{{ column.name }}</el-checkbox> <el-checkbox v-model="column.show">{{ column.name }}</el-checkbox>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:新增'" <el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:新增'" type="primary" @click="add">新增</el-button>
type="primary" <el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:删除'" @click="batchDel">删除</el-button>
@click="add">新增</el-button>
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:删除'"
@click="batchDel">删除</el-button>
</div> </div>
</div> </div>
<el-table :data="list" <el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange"
class="table" row-key="id" @sort-change="sortChange">
ref="table" <el-table-column v-if="settings[0].show" type="selection" width="55" align="center"
header-align="center" :reserve-selection="true"></el-table-column>
@selection-change="handleSelectionChange" <el-table-column type="index" width="60" label="序号" align="center">
row-key="id"
@sort-change="sortChange">
<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">
<template scope="scope"> <template scope="scope">
<span>{{(page - 1) * pageSize + scope.$index + 1}}</span> <span>{{ (page - 1) * pageSize + scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="settings[1].show" <el-table-column v-if="settings[1].show" show-overflow-tooltip prop="title" label="标题" align="center"
show-overflow-tooltip min-width="150"></el-table-column>
prop="title" <el-table-column v-if="settings[2].show" prop="columnName" label="栏目" align="center"
label="标题" min-width="120"></el-table-column>
align="center" <el-table-column v-if="settings[3].show" prop="classificationName" label="所属分类" align="center"
min-width="150"></el-table-column> min-width="120"></el-table-column>
<el-table-column v-if="settings[2].show" <el-table-column v-if="settings[4].show" prop="typeId" label="栏目类型" align="center" min-width="100">
prop="columnName"
label="栏目"
align="center"
min-width="120"></el-table-column>
<el-table-column v-if="settings[3].show"
prop="classificationName"
label="所属分类"
align="center"
min-width="120"></el-table-column>
<el-table-column v-if="settings[4].show"
prop="typeId"
label="栏目类型"
align="center"
min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ types.find(e => e.id === scope.row.typeId).name }} {{ types.find(e => e.id === scope.row.typeId).name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="settings[5].show" <el-table-column v-if="settings[5].show" prop="founderName" label="录入人" align="center"
prop="founderName" min-width="80"></el-table-column>
label="录入人" <el-table-column v-if="settings[6].show" prop="editorName" label="修改人" align="center"
align="center" min-width="80"></el-table-column>
min-width="80"></el-table-column> <el-table-column v-if="settings[7].show" prop="updateTime" label="修改日期" align="center" min-width="150"
<el-table-column v-if="settings[6].show" sortable="custom"></el-table-column>
prop="editorName" <el-table-column v-if="settings[8].show" prop="releaseTime" label="发布日期" align="center" min-width="100"
label="修改人" sortable="custom"></el-table-column>
align="center" <el-table-column v-if="settings[9].show" prop="totalBrowsing" label="总浏览" align="center"
min-width="80"></el-table-column> min-width="70"></el-table-column>
<el-table-column v-if="settings[7].show" <el-table-column v-if="settings[10].show" prop="workNumber" label="状态" align="center" min-width="80">
prop="updateTime"
label="修改日期"
align="center"
min-width="150"
sortable="custom"></el-table-column>
<el-table-column v-if="settings[8].show"
prop="releaseTime"
label="发布日期"
align="center"
min-width="100"
sortable="custom"></el-table-column>
<el-table-column v-if="settings[9].show"
prop="totalBrowsing"
label="总浏览"
align="center"
min-width="70"></el-table-column>
<el-table-column v-if="settings[10].show"
prop="workNumber"
label="状态"
align="center"
min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }} {{ scope.row.isRelease ? '已发布' : '草稿' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-auth="'/site/list:' + siteName + ':内容管理:文章管理:置顶'" <el-table-column v-auth="'/site/list:' + siteName + ':内容管理:文章管理:置顶'" prop="sequence" label="置顶" align="center"
prop="sequence" min-width="80" sortable="custom">
label="置顶"
align="center"
min-width="80"
sortable="custom">
<template slot-scope="scope"> <template slot-scope="scope">
<i v-if="scope.row.isRelease" <i v-if="scope.row.isRelease" :class="['squ-icon', scope.row.isTop ? 'el-icon-check' : 'el-icon-close']"
:class="['squ-icon', scope.row.isTop ? 'el-icon-check' : 'el-icon-close']" @click="sticky(scope.row)"></i>
@click="sticky(scope.row)"></i>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="settings[11].show" <el-table-column v-if="settings[11].show" label="操作" align="center" width="190">
label="操作"
align="center"
width="190">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:预览'" <el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:预览'" type="text"
type="text" @click="preview(scope.row)">预览</el-button>
@click="preview(scope.row)">预览</el-button> <el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:编辑'" type="text"
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:编辑'" @click="edit(scope.row)">编辑</el-button>
type="text" <el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:删除'" type="text"
@click="edit(scope.row)">编辑</el-button> @click="handleDelete(scope.row)">删除</el-button>
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:删除'" <el-switch v-if="scope.row.isRelease" v-auth="'/site/list:' + siteName + ':内容管理:文章管理:禁用'" class="m-l-10"
type="text" v-model="scope.row.isDisable" :active-value="0" :inactive-value="1"
@click="handleDelete(scope.row)">删除</el-button> @change="switchOff($event, scope.row, scope.$index)">
<el-switch v-if="scope.row.isRelease"
v-auth="'/site/list:' + siteName + ':内容管理:文章管理:禁用'"
class="m-l-10"
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background <el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next"
@current-change="currentChange" :total="total"></el-pagination>
:current-page="page"
layout="total, prev, pager, next"
:total="total"></el-pagination>
</div> </div>
</div> </div>
</div> </div>
@ -492,30 +403,35 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.custom-tree-node { .custom-tree-node {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
} }
.name { .name {
display: inline-block; display: inline-block;
max-width: 160px; max-width: 160px;
margin-right: 20px; margin-right: 20px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.squ-icon { .squ-icon {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
cursor: pointer; cursor: pointer;
color: #f70000; color: #f70000;
&.el-icon-check {
color: #05991e; &.el-icon-check {
} color: #05991e;
}
} }
/deep/.squ-input { /deep/.squ-input {
width: auto; width: auto;
.el-input__inner {
width: 60px; .el-input__inner {
padding: 0 10px; width: 60px;
} padding: 0 10px;
}
} }
</style> </style>

@ -1,135 +1,81 @@
<template> <template>
<div class="page" <div class="page" v-show="loaded">
v-show="loaded">
<p class="page-name mb">栏目</p> <p class="page-name mb">栏目</p>
<el-form :model="form" <el-form :model="form" :rules="rules" class="input-form model" label-width="120px">
:rules="rules"
class="input-form model"
label-width="120px">
<div class="item-line"> <div class="item-line">
<el-form-item prop="columnName" <el-form-item prop="columnName" label="栏目名称">
label="栏目名称"> <el-input placeholder="请输入栏目名称" v-model="form.columnName" clearable maxlength="40"
<el-input placeholder="请输入栏目名称" @input="nameChange"></el-input>
v-model="form.columnName"
clearable
maxlength="40"
@input="nameChange"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="fatherId" <el-form-item prop="fatherId" label="设置上级">
label="设置上级"> <el-cascader ref="fatherId" v-model="form.fatherId" :options="columns" :props="columnProps" clearable
<el-cascader ref="fatherId" @change="fatherIdChange"></el-cascader>
v-model="form.fatherId"
:options="columns"
:props="columnProps"
clearable
@change="fatherIdChange"></el-cascader>
</el-form-item> </el-form-item>
</div> </div>
<div class="item-line"> <div class="item-line">
<el-form-item prop="typeId" <el-form-item prop="typeId" label="栏目类型">
label="栏目类型"> <el-select v-model="form.typeId" @change="typeChange">
<el-select v-model="form.typeId" <el-option v-for="item in types" :key="item.id" :label="item.name" :value="item.id">
@change="typeChange">
<el-option v-for="item in types"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="pageSize" <el-form-item prop="pageSize" label="分页条数">
label="分页条数"> <el-input-number v-model="form.pageSize" :min="0" class="auto"></el-input-number>
<el-input-number v-model="form.pageSize"
:min="0"
class="auto"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item prop="menuVisible" <el-form-item prop="menuVisible" label="导航菜单可见">
label="导航菜单可见"> <el-switch v-model="form.menuVisible" :active-value="0" :inactive-value="1">
<el-switch v-model="form.menuVisible"
:active-value="0"
:inactive-value="1">
</el-switch> </el-switch>
</el-form-item> </el-form-item>
</div> </div>
<div class="line"></div> <div class="line"></div>
<template v-if="form.typeId === 1 || form.typeId === 4"> <template v-if="form.typeId === 1 || form.typeId === 4">
<el-form-item prop="columnBanner" <el-form-item prop="columnBanner" label="栏目Banner">
label="栏目Banner"> <el-upload class="avatar-uploader avatar-uploader-lg" accept=".jpg,.png,.jpeg,.gif" :on-change="changeFile"
<el-upload class="avatar-uploader avatar-uploader-lg" :show-file-list="false" :action="this.api.upload" :auto-upload="false">
accept=".jpg,.png,.jpeg,.gif" <img v-if="form.columnBanner" :src="form.columnBanner" class="avatar-lg">
:on-change="changeFile" <div class="uploader-default" v-else>
:show-file-list="false" <img class="plus" src="@/assets/images/plus.png" alt="">
:action="this.api.upload"
:auto-upload="false">
<img v-if="form.columnBanner"
:src="form.columnBanner"
class="avatar-lg">
<div class="uploader-default"
v-else>
<img class="plus"
src="@/assets/images/plus.png"
alt="">
<p>点击上传</p> <p>点击上传</p>
</div> </div>
<div slot="tip" <div slot="tip" class="el-upload__tip">
class="el-upload__tip">
<p>请上传1920x500PX5M以内的jpgbmppng格式</p> <p>请上传1920x500PX5M以内的jpgbmppng格式</p>
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item prop="subtitle" <el-form-item prop="subtitle" label="栏目副标题">
label="栏目副标题"> <el-input type="textarea" placeholder="请输入栏目副标题" v-model="form.subtitle"></el-input>
<el-input type="textarea"
placeholder="请输入栏目副标题"
v-model="form.subtitle"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="templateId" <el-form-item prop="templateId" label="栏目模板">
label="栏目模板"> <el-select v-model="form.templateId" @change="getStyle">
<el-select v-model="form.templateId" <el-option v-for="item in templates" :key="item.id" :label="item.templateType" :value="item.id">
@change="getStyle">
<el-option v-for="item in templates"
:key="item.id"
:label="item.templateType"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="listStyleId" <el-form-item prop="listStyleId" label="列表样式">
label="列表样式">
<ul class="styles"> <ul class="styles">
<li v-for="(item, i) in listStyle" <li v-for="(item, i) in listStyle" :key="i" @click="form.listStyleId = item.id">
:key="i"
@click="form.listStyleId = item.id">
<div class="review"> <div class="review">
<img style="width: 90px;max-height: 110px;" <img style="width: 90px;max-height: 110px;" :src="require('@/assets/images/style/' + item.id + '.png')"
:src="require('@/assets/images/style/' + item.id + '.png')" alt="">
alt="">
</div> </div>
<el-radio v-model="form.listStyleId" <el-radio v-model="form.listStyleId" :label="item.id">{{ item.style }}</el-radio>
:label="item.id">{{ item.style }}</el-radio>
</li> </li>
</ul> </ul>
</el-form-item> </el-form-item>
<el-form-item prop="detailStyleId" <el-form-item prop="detailStyleId" label="详情样式">
label="详情样式">
<ul class="styles"> <ul class="styles">
<li v-for="(item, i) in detailStyleId" <li v-for="(item, i) in detailStyleId" :key="i" @click="form.detailStyleId = item.id">
:key="i"
@click="form.detailStyleId = item.id">
<div class="review"> <div class="review">
<img :style="{width: item.id == 24 ? '50px' : '90px', 'max-height': '110px'}" <img :style="{ width: item.id == 24 ? '50px' : '90px', 'max-height': '110px' }"
:src="require('@/assets/images/style/' + item.id + '.png')" :src="require('@/assets/images/style/' + item.id + '.png')" alt="">
alt="">
</div> </div>
<el-radio v-model="form.detailStyleId" <el-radio v-model="form.detailStyleId" :label="item.id">{{ item.style }}</el-radio>
:label="item.id">{{ item.style }}</el-radio>
</li> </li>
</ul> </ul>
</el-form-item> </el-form-item>
</template> </template>
<template v-if="form.typeId === 2"> <template v-if="form.typeId === 2">
<el-form-item prop="connectionType" <el-form-item prop="connectionType" label="连接类型">
label="连接类型">
<el-radio-group v-model="form.connectionType"> <el-radio-group v-model="form.connectionType">
<el-radio :label="1">站内链接</el-radio> <el-radio :label="1">站内链接</el-radio>
<el-radio :label="2">站外链接</el-radio> <el-radio :label="2">站外链接</el-radio>
@ -138,89 +84,56 @@
</el-form-item> </el-form-item>
<template v-if="form.connectionType === 1"> <template v-if="form.connectionType === 1">
<el-form-item label="站内链接"> <el-form-item label="站内链接">
<el-cascader v-model="links" <el-cascader v-model="links" :options="columns" :props="columnProps" clearable
:options="columns" @change="getArticle"></el-cascader>
:props="columnProps"
clearable
@change="getArticle"></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="文章"> <el-form-item label="文章">
<el-select v-model="article" <el-select v-model="article" clearable>
clearable> <el-option v-for="item in articles" :key="item.id" :label="item.title" :value="item.id">
<el-option v-for="item in articles"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</template> </template>
<el-form-item v-show="form.connectionType === 2" <el-form-item v-show="form.connectionType === 2" prop="linkAddress" label="站外链接">
prop="linkAddress" <el-input placeholder="请输入站外链接" v-model.trim="form.linkAddress" clearable></el-input>
label="站外链接">
<el-input placeholder="请输入站外链接"
v-model.trim="form.linkAddress"
clearable></el-input>
</el-form-item> </el-form-item>
<template v-if="form.connectionType === 3"> <template v-if="form.connectionType === 3">
<el-form-item prop="siteSelection" <el-form-item prop="siteSelection" label="站点选择">
label="站点选择"> <el-select v-model="form.siteSelection" @change="getOtherColumn">
<el-select v-model="form.siteSelection" <el-option v-for="item in sites" :key="item.id" :label="item.siteName" :value="item.id">
@change="getOtherColumn">
<el-option v-for="item in sites"
:key="item.id"
:label="item.siteName"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="栏目"> <el-form-item label="栏目">
<el-cascader v-model="otherLink" <el-cascader v-model="otherLink" :options="otherColumns" :props="columnProps" clearable
:options="otherColumns" @change="getArticle"></el-cascader>
:props="columnProps"
clearable
@change="getArticle"></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="文章"> <el-form-item label="文章">
<el-select v-model="otherArticle" <el-select v-model="otherArticle" clearable>
clearable> <el-option v-for="item in otherArticles" :key="item.id" :label="item.title" :value="item.id">
<el-option v-for="item in otherArticles"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</template> </template>
<el-form-item prop="isOpen" <el-form-item prop="isOpen" label="新窗口打开">
label="新窗口打开"> <el-switch v-model="form.isOpen" :active-value="1" :inactive-value="0">
<el-switch v-model="form.isOpen"
:active-value="1"
:inactive-value="0">
</el-switch> </el-switch>
</el-form-item> </el-form-item>
</template> </template>
<template v-if="form.typeId === 3"> <template v-if="form.typeId === 3">
<el-form-item prop="templateId" <el-form-item prop="templateId" label="栏目模板">
label="栏目模板">
<el-select v-model="form.templateId"> <el-select v-model="form.templateId">
<el-option label="长页模板" <el-option label="长页模板" :value="9">
:value="9">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="listStyleId" <el-form-item prop="listStyleId" label="列表样式">
label="列表样式">
<ul class="styles"> <ul class="styles">
<li v-for="(item, i) in pageStyle" <li v-for="(item, i) in pageStyle" :key="i" @click="form.listStyleId = item.id">
:key="i"
@click="form.listStyleId = item.id">
<div class="review"> <div class="review">
<img :src="require('@/assets/images/page/' + item.pic + '.png')" <img :src="require('@/assets/images/page/' + item.pic + '.png')" alt="">
alt="">
</div> </div>
<el-radio v-model="form.listStyleId" <el-radio v-model="form.listStyleId" :label="item.id">{{ item.style }}</el-radio>
:label="item.id">{{ item.style }}</el-radio>
</li> </li>
</ul> </ul>
</el-form-item> </el-form-item>
@ -234,21 +147,12 @@
</el-form-item> --> </el-form-item> -->
</el-form> </el-form>
<div class="btns"> <div class="btns">
<el-button type="primary" <el-button type="primary" @click="submit(0)">确定</el-button>
@click="submit(0)">确定</el-button>
<el-button @click="$router.push('/column')">取消</el-button> <el-button @click="$router.push('/column')">取消</el-button>
</div> </div>
<!-- 剪裁组件弹窗 --> <!-- 剪裁组件弹窗 -->
<el-dialog title="图片裁剪" <el-dialog title="图片裁剪" append-to-body :visible.sync="cropperModel" width="1100px" :close-on-click-modal="false">
append-to-body <Cropper ref="cropper" :img-file.sync="file" :is-upload="isUpload" :fixed="true" @upload="customUpload" />
:visible.sync="cropperModel"
width="1100px"
:close-on-click-modal="false">
<Cropper ref="cropper"
:img-file.sync="file"
:is-upload="isUpload"
:fixed="true"
@upload="customUpload" />
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -768,97 +672,114 @@ export default {
$upload-width: 220px; $upload-width: 220px;
$upload-height: 102px; $upload-height: 102px;
$upload-lg-height: 102px; $upload-lg-height: 102px;
/deep/ .avatar-uploader { /deep/ .avatar-uploader {
.el-upload { .el-upload {
position: relative; position: relative;
width: $upload-width; width: $upload-width;
height: $upload-height; height: $upload-height;
border: 1px solid #dcdee0; border: 1px solid #dcdee0;
border-radius: 2px; border-radius: 2px;
cursor: pointer; cursor: pointer;
overflow: hidden; overflow: hidden;
.uploader-default {
display: flex;
height: $upload-height;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
background: #fafafa;
p {
margin-top: 10px;
font-size: 14px;
color: #333;
line-height: 20px;
}
}
}
&.avatar-uploader-lg {
.el-upload {
width: 100%;
max-width: 820px;
height: $upload-lg-height;
.uploader-default { .uploader-default {
height: $upload-lg-height; display: flex;
} height: $upload-height;
} flex-direction: column;
} justify-content: center;
.avatar { align-items: center;
display: block; text-align: center;
width: $upload-width; background: #fafafa;
height: $upload-height;
p {
margin-top: 10px;
font-size: 14px;
color: #333;
line-height: 20px;
}
} }
.avatar-lg { }
display: block;
width: 100%; &.avatar-uploader-lg {
.el-upload {
width: 100%;
max-width: 820px;
height: $upload-lg-height;
.uploader-default {
height: $upload-lg-height; height: $upload-lg-height;
}
} }
.el-upload__tip { }
margin-top: 0;
p { .avatar {
font-size: 12px; display: block;
color: #333; width: $upload-width;
} height: $upload-height;
}
.avatar-lg {
display: block;
width: 100%;
height: $upload-lg-height;
}
.el-upload__tip {
margin-top: 0;
p {
font-size: 12px;
color: #333;
} }
}
} }
.style-wrap { .style-wrap {
display: flex; display: flex;
margin-top: 10px; margin-top: 10px;
.label {
margin-right: 30px; .label {
} margin-right: 30px;
}
} }
.styles { .styles {
display: inline-flex; display: inline-flex;
flex-wrap: wrap; flex-wrap: wrap;
li {
width: 170px; li {
margin-right: 20px; width: 170px;
text-align: center; margin-right: 20px;
cursor: pointer; text-align: center;
&:hover .review { cursor: pointer;
border-color: #2962ff;
} &:hover .review {
} border-color: #2962ff;
.review {
display: flex;
justify-content: center;
align-items: center;
width: 170px;
height: 112px;
margin-bottom: 10px;
border: 1px solid #dcdee0;
border-radius: 2px;
img {
width: 50px;
}
} }
.el-radio { }
white-space: normal;
.review {
display: flex;
justify-content: center;
align-items: center;
width: 170px;
height: 112px;
margin-bottom: 10px;
border: 1px solid #dcdee0;
border-radius: 2px;
img {
width: 50px;
} }
}
.el-radio {
white-space: normal;
}
} }
/deep/.input-form .auto .el-input { /deep/.input-form .auto .el-input {
width: 119px; width: 119px;
} }
</style> </style>

@ -3,11 +3,9 @@
<div class="actions"> <div class="actions">
<p class="page-name">页面设置/关于IASF-发展历程</p> <p class="page-name">页面设置/关于IASF-发展历程</p>
<div> <div>
<el-button type="primary" <el-button type="primary" @click="preview">预览</el-button>
@click="preview">预览</el-button>
<el-button @click="save(0)">保存为草稿</el-button> <el-button @click="save(0)">保存为草稿</el-button>
<el-button type="primary" <el-button type="primary" @click="save(1)">发布</el-button>
@click="save(1)">发布</el-button>
<el-button @click="back">放弃编辑</el-button> <el-button @click="back">放弃编辑</el-button>
</div> </div>
</div> </div>
@ -15,15 +13,12 @@
<div class="modules"> <div class="modules">
<div class="relative"> <div class="relative">
<div class="single-banner"> <div class="single-banner">
<img class="banner-img" <img class="banner-img" :src="modules[0].form.pic" alt="" />
:src="modules[0].form.pic"
alt="" />
<div class="texts"> <div class="texts">
<h6 class="banner-title">{{ modules[0].form.title }}</h6> <h6 class="banner-title">{{ modules[0].form.title }}</h6>
</div> </div>
</div> </div>
<div class="cover" <div class="cover" @click="toSet(0)">点击更换banner与链接</div>
@click="toSet(0)">点击更换banner与链接</div>
</div> </div>
<div class="block history"> <div class="block history">
@ -31,29 +26,21 @@
<div class="c-wrap"> <div class="c-wrap">
<h6 v-html="modules[1].form.title"></h6> <h6 v-html="modules[1].form.title"></h6>
<p class="en">{{ modules[1].form.subTitle }}</p> <p class="en">{{ modules[1].form.subTitle }}</p>
<div class="text" <div class="text" v-html="modules[1].form.des"></div>
v-html="modules[1].form.des"></div> <div class="cover" @click="toSet(1)">点击更换标题小标题与概述</div>
<div class="cover"
@click="toSet(1)">点击更换标题小标题与概述</div>
</div> </div>
<div class="c-wrap"> <div class="c-wrap">
<h6 style="font-size: 1.6rem">{{ modules[2].form.title }}</h6> <h6 style="font-size: 1.6rem">{{ modules[2].form.title }}</h6>
<p class="en" <p class="en" style="margin-top: -15px;font-size: 1.6rem">{{ modules[2].form.subTitle }}</p>
style="margin-top: -15px;font-size: 1.6rem">{{ modules[2].form.subTitle }}</p> <div class="text" v-html="modules[2].form.des"></div>
<div class="text" <div class="cover" @click="toSet(2)">点击更换标题小标题与概述</div>
v-html="modules[2].form.des"></div>
<div class="cover"
@click="toSet(2)">点击更换标题小标题与概述</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<Module ref="module" <Module ref="module" :data.sync="curData" :visible.sync="diaVisible" @moduleSubmit="moduleSubmit" />
:data.sync="curData"
:visible.sync="diaVisible"
@moduleSubmit="moduleSubmit" />
</div> </div>
</template> </template>
@ -94,25 +81,28 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../../styles/page/page.scss'; @import '../../../styles/page/page.scss';
.history { .history {
h6 { h6 {
position: relative; position: relative;
font-size: 2.4rem; font-size: 2.4rem;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
} }
.en {
margin-top: -25px; .en {
font-size: 2.4rem; margin-top: -25px;
font-family: PingFangSC-Light, PingFang SC; font-size: 2.4rem;
font-weight: 300; font-family: PingFangSC-Light, PingFang SC;
color: #e3e3e3; font-weight: 300;
} color: #e3e3e3;
.text { }
max-width: 1200px;
margin: 30px 0; .text {
overflow: auto; max-width: 1200px;
} margin: 30px 0;
overflow: auto;
}
} }
</style> </style>

File diff suppressed because it is too large Load Diff

@ -2,204 +2,132 @@
<div class="page"> <div class="page">
<div class="tool"> <div class="tool">
<div class="search-wrap"> <div class="search-wrap">
<el-input placeholder="请输入悬浮栏名称" <el-input placeholder="请输入悬浮栏名称" v-model.trim="keyword" clearable></el-input>
v-model.trim="keyword"
clearable></el-input>
</div> </div>
<div class="actions"> <div class="actions">
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:新增'" <el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:新增'" type="primary" @click="add">新增</el-button>
type="primary" <el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" @click="batchDel">删除</el-button>
@click="add">新增</el-button>
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'"
@click="batchDel">删除</el-button>
</div> </div>
</div> </div>
<el-table v-loading="listLoading" <el-table v-loading="listLoading" ref="table" :data="list" default-expand-all class="table" header-align="center"
ref="table" @selection-change="handleSelectionChange" row-key="id">
:data="list" <el-table-column type="selection" width="50" align="center" :reserve-selection="true"></el-table-column>
default-expand-all <el-table-column prop="schemeName" show-overflow-tooltip label="悬浮栏名称" min-width="140"></el-table-column>
class="table" <el-table-column prop="scopeOfApplication" label="应用范围" min-width="100"></el-table-column>
header-align="center" <el-table-column prop="numberOfContentModules" label="内容模块" min-width="100"></el-table-column>
@selection-change="handleSelectionChange" <el-table-column prop="createTime" label="创建时间" min-width="100"></el-table-column>
row-key="id"> <el-table-column prop="updateTime" label="最近编辑" min-width="100"></el-table-column>
<el-table-column type="selection" <el-table-column prop="editorSName" label="编辑人" min-width="100"></el-table-column>
width="50" <el-table-column label="状态" min-width="100">
align="center" <template slot-scope="scope">{{ scope.row.isDisable ? '禁用' : '启用' }}</template>
:reserve-selection="true"></el-table-column> </el-table-column>
<el-table-column prop="columnName" <el-table-column label="操作" width="180">
show-overflow-tooltip
label="悬浮栏名称"
min-width="140"></el-table-column>
<el-table-column prop="typeId"
label="应用范围"
min-width="100"></el-table-column>
<el-table-column prop="typeId"
label="内容模块"
min-width="100"></el-table-column>
<el-table-column prop="typeId"
label="创建时间"
min-width="100"></el-table-column>
<el-table-column prop="typeId"
label="最近编辑"
min-width="100"></el-table-column>
<el-table-column prop="typeId"
label="编辑人"
min-width="100"></el-table-column>
<el-table-column label="操作"
width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:编辑'" <el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:编辑'" type="text"
type="text" @click="edit(scope.row)">编辑</el-button>
@click="edit(scope.row, 'edit')">编辑</el-button> <el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" type="text"
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" @click="del(scope.row)">删除</el-button>
type="text" <el-switch class="m-l-10" v-model="scope.row.isDisable" :active-value="0" :inactive-value="1"
@click="del(scope.row)">删除</el-button> @change="switchOff($event, scope.row, scope.$index)">
<el-switch class="m-l-10"
v-model="scope.row.menuVisible"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page"
layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
<el-dialog title="模块管理" <el-dialog title="模块管理" :visible.sync="moduleVisible" width="1000px" :close-on-click-modal="false">
:visible.sync="moduleVisible" <el-form ref="form" :model="form" :rules="rules" label-suffix="">
width="1000px" <div class="flex">
:close-on-click-modal="false"> <el-form-item prop="schemeName" label="悬浮栏目名称" label-width="130px">
<el-input style="width: 200px" placeholder="请输入悬浮栏目名称" v-model="form.schemeName" clearable
<el-form ref="form" maxlength="10"></el-input>
:model="moduleForm" </el-form-item>
:rules="moduleRules"> <!-- <el-form-item prop="style" label="悬浮栏样式" label-width="110px">
<el-form-item prop="columnName" <el-select v-model="form.floatingBarStyle" clearable>
label="悬浮栏目名称" <el-option v-for="item in styles" :key="item.id" :label="item.name" :value="item.id">
label-width="110px"> </el-option>
<el-input style="width: 200px" </el-select>
placeholder="请输入栏目名称" </el-form-item> -->
v-model="moduleForm.columnName" </div>
clearable <el-table class="module-table" :data="form.floatingColumnSchemeModules" header-align="center" row-key="id">
maxlength="10"></el-input> <el-table-column prop="pictureAddress" label="图片" min-width="140">
</el-form-item> <template slot-scope="scope">
<el-table class="module-table" <img class="pic" :src="scope.row.pictureAddress" alt="">
:data="modules" </template>
header-align="center" </el-table-column>
row-key="id"> <el-table-column prop="schemeTitle" label="标题" min-width="240"></el-table-column>
<el-table-column prop="columnName" <el-table-column prop="schemeContentJson" label="内容" min-width="240">
label="图片" <template slot-scope="scope">
min-width="140"></el-table-column> <div v-html="scope.row.schemeContentJson"></div>
<el-table-column prop="columnName" </template>
label="标题" </el-table-column>
min-width="140"></el-table-column> <el-table-column label="操作" :width="110" align="center">
<el-table-column prop="columnName"
label="内容"
min-width="140"></el-table-column>
<el-table-column label="操作"
:width="150"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex a-center"> <div class="flex a-center">
<el-switch v-model="scope.row.isEnable" <el-switch v-model="scope.row.isDisable" :active-value="0" :inactive-value="1">
:active-value="1"
:inactive-value="0">
</el-switch> </el-switch>
<i class="el-icon-edit-outline del" <i class="el-icon-edit-outline del" @click="editRow(scope.row, scope.$index)"></i>
@click="editRow(scope.row, scope.$index)"></i> <i class="el-icon-delete del" @click="delRow(scope.$index)"></i>
<i class="el-icon-delete del"
@click="delRow(scope.$index)"></i>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="plus"> <div class="plus m-b-30">
<i class="el-icon-circle-plus-outline" <i class="el-icon-circle-plus-outline" @click="addRow"></i>
@click="addRow"></i>
</div> </div>
<el-form-item label="应用范围"> <el-form-item label="应用范围">
<el-select v-model="moduleForm.range" <div class="flex">
clearable> <el-radio-group class="m-t-10" v-model="range">
<el-option v-for="item in ranges" <el-radio :label="0">网站全局</el-radio>
:key="item.id" <el-radio :label="1">选择栏目</el-radio>
:label="item.title" </el-radio-group>
:value="item.id">
</el-option> <el-cascader v-if="range" class="m-l-30" v-model="selectColumn" :options="columns" :props="columnProps"
</el-select> clearable></el-cascader>
</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer">
<el-button @click="moduleVisible = false">取消</el-button> <el-button @click="moduleVisible = false">取消</el-button>
<el-button type="primary" <el-button type="primary" @click="moduleSubmit">确定</el-button>
@click="moduleSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="新增内容"
:visible.sync="contentVisible" <el-dialog title="新增内容" :visible.sync="contentVisible" width="900px" :close-on-click-modal="false">
width="700px" <el-form ref="contentForm" :model="curRow" :rules="contentRules" label-width="100px" label-suffix="">
:close-on-click-modal="false"> <el-form-item prop="pictureAddress" label="图片">
<el-form ref="form" <el-upload class="avatar-uploader" accept=".jpg,.png,.jpeg,.gif" :on-change="file => changeFile(file)"
:model="contentForm" :show-file-list="false" :action="this.api.upload" :auto-upload="false">
:rules="contentRules"> <img v-if="curRow.pictureAddress" :src="curRow.pictureAddress" class="avatar">
<el-form-item prop="titleImg" <div class="uploader-default" v-else>
label="图片"> <img class="plus" src="@/assets/images/plus.png" alt="">
<el-upload class="avatar-uploader"
accept=".jpg,.png,.jpeg,.gif"
:on-change="file => changeFile(file, 0)"
:show-file-list="false"
:action="this.api.upload"
:auto-upload="false">
<img v-if="contentForm.titleImg"
:src="contentForm.titleImg"
class="avatar">
<div class="uploader-default"
v-else>
<img class="plus"
src="@/assets/images/plus.png"
alt="">
<p>点击上传</p> <p>点击上传</p>
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item prop="columnName" <el-form-item prop="schemeTitle" label="标题">
label="标题"> <el-input style="width: 200px" placeholder="请输入标题" v-model="curRow.schemeTitle" clearable
<el-input style="width: 200px" maxlength="20"></el-input>
placeholder="请输入栏目名称"
v-model="contentForm.columnName"
clearable
maxlength="20"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="columnName" <el-form-item prop="schemeContentJson" label="内容设置">
label="内容设置"> <Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="curRow.schemeContentJson"
<el-radio-group v-model="contentForm.connectionType"> :init="editorConfig" />
<el-radio :label="1">富文本</el-radio>
<el-radio :label="2">链接</el-radio>
</el-radio-group>
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda'
v-model="contentForm.connectionType"
:init="editorConfig" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer">
<el-button @click="contentVisible = false">取消</el-button> <el-button @click="contentVisible = false">取消</el-button>
<el-button type="primary" <el-button type="primary" @click="contentSubmit">确定</el-button>
@click="contentSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 剪裁组件弹窗 --> <!-- 剪裁组件弹窗 -->
<el-dialog title="图片裁剪" <el-dialog title="图片裁剪" append-to-body :visible.sync="cropperModel" width="1100px" :close-on-click-modal="false">
append-to-body <Cropper ref="cropper" :img-file.sync="file" :is-upload="isUpload" :fixed="true" :fixedNumber.sync="fixedNumber"
:visible.sync="cropperModel" @upload="customUpload" />
width="1100px"
:close-on-click-modal="false">
<Cropper ref="cropper"
:img-file.sync="file"
:is-upload="isUpload"
:fixed="true"
:fixedNumber.sync="fixedNumber"
@upload="customUpload" />
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -208,47 +136,67 @@
import Setting from '@/setting' import Setting from '@/setting'
import Util from '@/libs/util' import Util from '@/libs/util'
import Axios from 'axios' import Axios from 'axios'
import Cropper from '@/components/img-upload/Cropper'
import Editor from '@tinymce/tinymce-vue' import Editor from '@tinymce/tinymce-vue'
import editorConfig from '@/components/editor' import editorConfig from '@/components/editor'
import _ from 'lodash'
export default { export default {
data () { data () {
return { return {
editorConfig, editorConfig,
siteId: this.$store.state.content.site.id, siteId: this.$store.state.content.site.id,
siteName: this.$store.state.content.site.siteName, siteName: this.$store.state.content.site.siteName,
templates: [],
listStyle: [],
pageStyle: [],
detailStyle: [],
keyword: '', keyword: '',
searchTimer: null, searchTimer: null,
list: [], list: [],
page: 1,
pageSize: 10,
total: 0,
multipleSelection: [], multipleSelection: [],
listLoading: false, listLoading: false,
styleVisible: false, range: 0,
ranges: [], selectColumn: [],
moduleForm: { columns: [],
id: '', columnProps: {
columnName: '', multiple: true,
navigationStyle: 1, value: 'id',
styleTemplate: 1, label: 'columnName'
siteId: this.$store.state.content.site.id
}, },
moduleRules: { originForm: {},
columnName: [ form: {
editorId: this.$store.state.user.userId,
schemeName: '',
floatingBarStyle: '1',
siteId: this.$store.state.content.site.id,
floatingColumnSchemeModules: [],
floatingColumnSchemeScopeOfApplications: [],
},
originModules: {
pictureAddress: '',
schemeContentJson: '',
schemeTitle: '',
isDisable: 0,
},
rules: {
schemeName: [
{ required: true, message: '请输入悬浮栏目名称', trigger: 'blur' } { required: true, message: '请输入悬浮栏目名称', trigger: 'blur' }
], ],
}, },
moduleVisible: false, moduleVisible: false,
modules: [{}], modules: [],
curRow: {}, curRow: {},
curModule: 0, curModule: 0,
contentVisible: false, contentVisible: false,
contentForm: {},
contentRules: { contentRules: {
columnName: [ pictureAddress: [
{ required: true, message: '请输入悬浮栏目名称', trigger: 'blur' } { required: true, message: '请上传图片', trigger: 'change' }
],
schemeTitle: [
{ required: true, message: '请输入标题', trigger: 'blur' }
],
schemeContentJson: [
{ required: true, message: '请输入内容', trigger: 'blur' }
], ],
}, },
@ -259,7 +207,8 @@ export default {
}; };
}, },
components: { components: {
Editor Editor,
Cropper,
}, },
watch: { watch: {
keyword: function (val) { keyword: function (val) {
@ -282,18 +231,20 @@ export default {
name: '悬浮栏设置' name: '悬浮栏设置'
} }
]) ])
this.originForm = _.cloneDeep(this.form)
this.getData() this.getData()
this.getColumn()
}, },
methods: { methods: {
getData () { getData () {
this.$post(this.api.listWithTree, { this.$post(this.api.listFloating, {
siteId: this.siteId, siteId: this.siteId,
columnName: this.keyword, search: this.keyword,
templateId: '', pageNum: this.page,
typeId: '', pageSize: this.pageSize,
isSort: 1
}).then(({ data }) => { }).then(({ data }) => {
this.list = data this.list = data.records
this.total = +data.total
this.listLoading = false this.listLoading = false
}).catch(err => { }).catch(err => {
this.listLoading = false this.listLoading = false
@ -305,16 +256,32 @@ export default {
this.page = 1 this.page = 1
this.getData() this.getData()
}, },
//
async getColumn () {
const { data } = await this.$post(this.api.listWithTree, {
siteId: this.siteId,
columnName: '',
templateId: '',
typeId: '',
isSort: 1
})
this.columns = data
},
add () { add () {
this.range = 0
this.selectColumn = []
this.form = _.cloneDeep(this.originForm)
this.moduleVisible = true this.moduleVisible = true
}, },
// //
addRow () { addRow () {
// this.data.list.push(JSON.parse(JSON.stringify(this.data.historyForm))) this.curRow = _.cloneDeep(this.originModules)
this.curModule = -1
this.contentVisible = true
}, },
// //
editRow (row, i = 0) { editRow (row, i = 0) {
this.curRow = JSON.parse(JSON.stringify(row)) this.curRow = _.cloneDeep(row)
this.curModule = i this.curModule = i
this.contentVisible = true this.contentVisible = true
}, },
@ -323,19 +290,84 @@ export default {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
// list.splice(i, 1) this.form.floatingColumnSchemeModules.splice(i, 1)
}).catch(() => { }) }).catch(() => { })
}, },
edit (row, type) { async edit (row) {
this.$router.push(`add?id=${row.id}&level=${row.level + 1}&type=${type}`) this.moduleVisible = true
const { data } = await this.$post(`${this.api.findFloating}?id=${row.floatingBarSchemeId}`)
const range = data.floatingColumnSchemeScopeOfApplications
// applicationScopeId0
this.range = row.isGlobal ? 0 : 1
if (!row.isGlobal) {
const column = []
//
range.map(e => {
column.push(e.applicationScopeId.split(',').map(n => +n))
})
this.selectColumn = column
console.log("🚀 ~ edit ~ this.selectColumn:", this.selectColumn)
}
this.form = data
}, },
// //
moduleSubmit () { moduleSubmit () {
this.$refs.form.validate(async (valid) => {
if (valid) {
if (this.submiting) return false
const form = JSON.parse(JSON.stringify(this.form))
if (!form.floatingColumnSchemeModules.length) return Util.warningMsg('请添加内容模块')
const column = this.selectColumn
if (this.range && !column.length) return Util.warningMsg('请选择栏目')
this.submiting = true
if (this.range) {
const scope = []
// debugger
column.map(e => {
scope.push({
applicationScopeId: typeof e === 'number' ? e : e.join(',')
})
})
form.floatingColumnSchemeScopeOfApplications = scope
} else {
form.floatingColumnSchemeScopeOfApplications = [{
applicationScopeId: 0
}]
}
if (!form.floatingBarSchemeId) form.founderId = form.editorId
// debugger
try {
await this.$post(this.api.saveFloating, form)
Util.successMsg('新增成功!')
this.moduleVisible = false
this.getData()
setTimeout(() => {
this.submiting = false
}, 2000)
} catch (e) {
this.submiting = false
}
}
})
}, },
// //
contentSubmit () { contentSubmit () {
this.$refs.contentForm.validate(async (valid) => {
if (valid) {
this.contentVisible = false
const row = this.curRow
if (this.curModule === -1) {
this.form.floatingColumnSchemeModules.push(_.cloneDeep(row))
} else {
const list = this.form.floatingColumnSchemeModules[this.curModule]
for (const i in row) {
this.$set(list, i, row[i])
}
}
}
})
}, },
// //
customUpload (data) { customUpload (data) {
@ -362,14 +394,14 @@ export default {
}, 1000); }, 1000);
return false return false
} }
this.$set(this.curForm, 'pic', data.url) this.$set(this.curRow, 'pictureAddress', data.url)
}).catch(res => { }) }).catch(res => { })
this.$refs.cropper.isDisabled = false this.$refs.cropper.isDisabled = false
this.isUpload = false this.isUpload = false
this.cropperModel = false this.cropperModel = false
}, },
// //
changeFile (file, form) { changeFile (file) {
const { size, name } = file const { size, name } = file
const ext = name.substring(name.lastIndexOf('.') + 1) const ext = name.substring(name.lastIndexOf('.') + 1)
if (!Util.isImg(ext)) { if (!Util.isImg(ext)) {
@ -381,7 +413,6 @@ export default {
return false return false
} }
this.file = file this.file = file
this.curForm = form
this.cropperModel = true this.cropperModel = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.cropper.updateImg({ this.$refs.cropper.updateImg({
@ -392,38 +423,37 @@ export default {
}, },
del (row) { del (row) {
this.$confirm("删除栏目将会同时把栏目下的文章一并删除,是否确认删除栏目?", "提示", { this.$confirm('确定要删除吗?', "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.$post(`${this.api.deleteColumn}?ids=${row.id}`).then(res => { this.$post(`${this.api.batchDeletionFloating}?id=${row.floatingBarSchemeId}`).then(res => {
util.successMsg("删除成功") Util.successMsg("删除成功")
this.getData() this.getData()
}).catch(res => { }) }).catch(res => { })
}).catch(() => { }) }).catch(() => { })
}, },
// //
switchOff (val, row) { async switchOff (val, row) {
this.$post(this.api.updateColumn, row).then(res => { }).catch((res) => { }) await this.$post(`${this.api.enableOrDisableScheme}?id=${row.floatingBarSchemeId}&isDisable=${row.isDisable}`)
}, },
// //
batchDel () { batchDel () {
const list = this.multipleSelection const list = this.multipleSelection
if (list.length) { if (list.length) {
this.$confirm('删除栏目将会同时把栏目下的文章一并删除,是否确认删除栏目?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
const data = [] const ids = list.map(e => {
list.map(e => { return 'id=' + e.floatingBarSchemeId
data.push('ids=' + e.id)
}) })
this.$post(`${this.api.deleteColumn}?${data.join('&')}`).then(res => { this.$post(`${this.api.batchDeletionFloating}?${ids.join('&')}`).then(res => {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
util.successMsg("删除成功") Util.successMsg("删除成功")
this.getData() this.getData()
}).catch(res => { }) }).catch(res => { })
}).catch(() => { }) }).catch(() => { })
} else { } else {
util.errorMsg('请先选择数据 !') Util.errorMsg('请先选择数据 !')
} }
}, },
handleSelectionChange (val) { handleSelectionChange (val) {
@ -440,80 +470,88 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.plus { .plus {
margin-top: 10px; margin-top: 10px;
font-size: 20px; font-size: 20px;
text-align: center; text-align: center;
color: $main-color; color: $main-color;
cursor: pointer; cursor: pointer;
} }
.del { .del {
margin-left: 5px; margin-left: 8px;
font-size: 18px; font-size: 18px;
color: #333; color: #333;
cursor: pointer; cursor: pointer;
} }
$upload-width: 220px; $upload-width: 220px;
$upload-height: 102px; $upload-height: 102px;
$upload-lg-height: 102px; $upload-lg-height: 102px;
/deep/ .avatar-uploader { /deep/ .avatar-uploader {
.el-upload { .el-upload {
position: relative; position: relative;
width: $upload-width; width: $upload-width;
height: $upload-height; height: $upload-height;
border: 1px solid #dcdee0; border: 1px solid #dcdee0;
border-radius: 2px; border-radius: 2px;
cursor: pointer; cursor: pointer;
overflow: hidden; overflow: hidden;
.uploader-default {
display: flex;
height: $upload-height;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
background: #fafafa;
p {
margin-top: 10px;
font-size: 14px;
color: #333;
line-height: 20px;
}
}
}
&.avatar-uploader-lg {
.el-upload {
width: 100%;
max-width: 820px;
height: $upload-lg-height;
.uploader-default { .uploader-default {
height: $upload-lg-height; display: flex;
} height: $upload-height;
} flex-direction: column;
} justify-content: center;
.avatar { align-items: center;
display: block; text-align: center;
width: $upload-width; background: #fafafa;
height: $upload-height;
p {
margin-top: 10px;
font-size: 14px;
color: #333;
line-height: 20px;
}
} }
.avatar-lg { }
display: block;
width: 100%; &.avatar-uploader-lg {
.el-upload {
width: 100%;
max-width: 820px;
height: $upload-lg-height;
.uploader-default {
height: $upload-lg-height; height: $upload-lg-height;
}
} }
.el-upload__tip { }
margin-top: 0;
p { .avatar {
font-size: 12px; display: block;
color: #333; width: $upload-width;
} height: $upload-height;
}
.avatar-lg {
display: block;
width: 100%;
height: $upload-lg-height;
}
.el-upload__tip {
margin-top: 0;
p {
font-size: 12px;
color: #333;
} }
}
} }
.style-wrap {
display: flex; .pic {
margin-top: 10px; max-width: 100px;
.label { margin: 10px 0;
margin-right: 30px;
}
} }
</style> </style>

File diff suppressed because it is too large Load Diff

@ -1,63 +1,62 @@
/** /**
* 业务配置 * 业务配置
* */ * */
const url = location.host;
const isDev = process.env.NODE_ENV === 'development' // 开发环境 const isDev = process.env.NODE_ENV === 'development' // 开发环境
let host = `${location.origin}/` let host = location.origin
if (isDev) { if (isDev) {
host = 'https://huorantech.com/' host = 'https://huorantech.com'
// host = 'http://139.159.254.212/' host = 'http://192.168.31.217:10000'
} }
const Setting = { const Setting = {
/** /**
* 基础配置 * 基础配置
* */ * */
titleSuffix: '职站商城后台', // 网页标题的后缀 titleSuffix: '职站商城后台', // 网页标题的后缀
routerMode: "hash", // 路由模式,可选值为 history 或 hash routerMode: "hash", // 路由模式,可选值为 history 或 hash
showProgressBar: true, // 页面切换时,是否显示模拟的进度条 showProgressBar: true, // 页面切换时,是否显示模拟的进度条
apiBaseURL: host, // 接口请求地址 apiBaseURL: host, // 接口请求地址
autoLogoutTime: 1000 * 60 * 60 * 3, // 长时间未操作,自动退出登录时间 autoLogoutTime: 1000 * 60 * 60 * 3, // 长时间未操作,自动退出登录时间
modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒 modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒
errorModalType: "Message", // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice errorModalType: "Message", // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice
tokenExpires: 1296000000, // token在localStorage的时间(毫秒) tokenExpires: 1296000000, // token在localStorage的时间(毫秒)
isDev, isDev,
/** /**
* 路由白名单 * 路由白名单
* */ * */
whiteList: ['/login', '/redirect'], whiteList: ['/login', '/redirect'],
/** /**
* localStorage里保存的token的key * localStorage里保存的token的key
*/ */
tokenKey: "huoran_server_token", tokenKey: "huoran_server_token",
/** /**
* localStorage里保存的vuex的key * localStorage里保存的vuex的key
*/ */
storeKey: "huoran_server_store", storeKey: "huoran_server_store",
/** /**
* 默认密码 * 默认密码
*/ */
initialPassword: "111aaa", initialPassword: "111aaa",
/** /**
* 多语言配置 * 多语言配置
* */ * */
i18n: { i18n: {
// 默认语言 // 默认语言
default: "zh", default: "zh",
// 是否根据用户电脑配置自动设置语言(仅第一次有效) // 是否根据用户电脑配置自动设置语言(仅第一次有效)
auto: false auto: false
}, },
/** /**
* 布局配置 * 布局配置
* */ * */
layout: {}, layout: {},
/** /**
* 功能配置 * 功能配置
* */ * */
// 相同路由,不同参数间进行切换,是否强力更新 // 相同路由,不同参数间进行切换,是否强力更新
sameRouteForceUpdate: false, sameRouteForceUpdate: false,
// 是否使用动态路由(即角色权限,开启了的话就会取后端返回的权限树来显示头部导肮和页面按钮) // 是否使用动态路由(即角色权限,开启了的话就会取后端返回的权限树来显示头部导肮和页面按钮)
dynamicRoute: false dynamicRoute: false
}; };
export default Setting; export default Setting;

Loading…
Cancel
Save