master
yujialong 2 years ago
parent bc6f953a59
commit 49e09732fc
  1. 36
      src/api/index.js
  2. 2
      src/components/img-upload/Cropper.vue
  3. 10
      src/pages/account/login/index.vue
  4. 6
      src/pages/annex/list/index.vue
  5. 24
      src/pages/article/add/index.vue
  6. 1
      src/pages/article/list/index.vue
  7. 117
      src/pages/column/add/index.vue
  8. 42
      src/pages/column/list/index.vue
  9. 12
      src/pages/setting/list/index.vue
  10. 41
      src/pages/setting/list/info.vue
  11. 7
      src/pages/user/list/index.vue
  12. 2
      src/setting.js
  13. 3
      src/styles/common.scss

@ -1,6 +1,6 @@
import Setting from '@/setting'
const host = Setting.apiBaseURL
const host1 = 'http://192.168.31.151:10000/'
const host1 = 'http://192.168.31.136:10000/'
export default {
logins: `iasf/sys/user/login`,
@ -13,6 +13,9 @@ export default {
depts: `iasf/sys/dept/tree`,
users: `iasf/sys/users`,
user: `iasf/sys/user`,
sendPhoneOrEmailCode: `iasf/sys/sendPhoneOrEmailCode`,
updatePhoneOrEmail: `iasf/sys/updatePhoneOrEmail`,
updateUserAvatars: `${host}iasf/sys/updateUserAvatars`,
staffTemplate: `http://192.168.31.136/用户导入模板.xlsx`,
checkJobNumber: `iasf/sys/checkJobNumber`,
checkUsername: `iasf/sys/checkUsername`,
@ -28,18 +31,21 @@ export default {
groupUpdate: `iasf/sys/userGroup/update`,
site: `iasf/sys/site/list`,
updateSite: `iasf/sys/site/update`,
listWithTree: `${host1}iasf/sysColumn/listWithTree`,
saveColumn: `${host1}iasf/sysColumn/save`,
updateColumn: `${host1}iasf/sysColumn/update`,
findColumn: `${host1}iasf/sysColumn/findById`,
deleteColumn: `${host1}iasf/sysColumn/delete`,
sameLevelJudgment: `${host1}iasf/sysColumn/sameLevelJudgment`,
sortByColumn: `${host1}iasf/sysColumn/sortByColumn`,
checkIfTheTitleIsRepeat: `${host1}iasf/sysContent/checkIfTheTitleIsRepeat`,
deleteArticle: `${host1}iasf/sysContent/delete`,
findArticle: `${host1}iasf/sysContent/findById`,
queryArticle: `${host1}iasf/sysContent/pagingQuery`,
saveArticle: `${host1}iasf/sysContent/save`,
updateArticle: `${host1}iasf/sysContent/update`,
longPageColumnList: `${host1}iasf/pageManagement/longPageColumnList`,
listWithTree: `iasf/sysColumn/listWithTree`,
saveColumn: `iasf/sysColumn/save`,
updateColumn: `iasf/sysColumn/update`,
findColumn: `iasf/sysColumn/findById`,
deleteColumn: `iasf/sysColumn/delete`,
sameLevelJudgment: `iasf/sysColumn/sameLevelJudgment`,
sortByColumn: `iasf/sysColumn/sortByColumn`,
checkIfTheTitleIsRepeat: `iasf/sysContent/checkIfTheTitleIsRepeat`,
deleteArticle: `iasf/sysContent/delete`,
findArticle: `iasf/sysContent/findById`,
queryArticle: `iasf/sysContent/pagingQuery`,
saveArticle: `iasf/sysContent/save`,
updateArticle: `iasf/sysContent/update`,
longPageColumnList: `iasf/pageManagement/longPageColumnList`,
searchAllBySite: `iasf/sysNavigationStyle/searchAllBySite`,
updateStyle: `iasf/sysNavigationStyle/update`,
saveStyle: `iasf/sysNavigationStyle/save`,
}

@ -84,7 +84,7 @@ export default {
img: '', // ()
size: 0.8, // (:1)
full: true, // true (:false)
outputType: 'jpeg', // (:jpg)
outputType: 'jpg', // (:jpg)
canMove: true, // (:true)
original: false, // (:false)
canMoveBox: true, // (:true)

@ -68,21 +68,17 @@ export default {
...mapMutations('user', [
'setUserId', 'setUserName'
]),
getVerImg() { //
//
getVerImg() {
this.loginForm.random = Math.floor(Math.random() * 999999999);
this.verificationIMG = this.api.verification + "?random=" + `${this.loginForm.random}`;
},
handleClick(tab, event) { //
this.loginForm.username = "";
this.$refs.loginForm.clearValidate();
this.loginRules.username[0].message = tab.index === "1" ? "请输入账号" : "请输入手机号/邮箱";
},
submit() {
this.$post(this.api.logins, this.loginForm).then(({ data }) => {
util.local.set(Setting.tokenKey, data.accessToken, Setting.tokenExpires)
addRoutes(data.permissionList[0].children)
util.successMsg('登录成功')
this.setUserId(data.id)
this.setUserId(data.id || 1)
this.setUserName(data.username)
this.$router.push('/site')
}).catch(res => {

@ -58,7 +58,11 @@
</el-table-column>
<el-table-column prop="createDate" label="上传时间" min-width="150"></el-table-column>
<el-table-column prop="uploader" label="上传人" min-width="100"></el-table-column>
<el-table-column prop="quote" label="文章名称" min-width="180"></el-table-column>
<el-table-column prop="quote" label="文章名称" min-width="180">
<template slot-scope="scope">
{{ scope.row.quote || '--' }}
</template>
</el-table-column>
<el-table-column prop="deleted" label="是否使用" min-width="100">
<template slot-scope="scope">
{{ scope.row.quote ? '是' : '否' }}

@ -112,20 +112,22 @@
<img slot="reference" class="info" src="@/assets/img/ques.png" alt="">
</el-popover>
<el-switch
v-model="form.useArticleTemplate"
v-model="form.templateStatus"
:active-value="1"
:inactive-value="0">
</el-switch>
<ul v-if="form.useArticleTemplate" class="styles">
<li v-for="(item, i) in detailStyle" :key="i" @click="form.articleTemplate = item.id">
<ul v-if="form.templateStatus" class="styles">
<template v-for="(item, i) in detailStyle">
<li v-if="item.id !== column.detailStyle" :key="i" @click="form.articleTemplate = item.id">
<div class="review">
<img :src="require('@/assets/img/article' + item.id + '.png')" alt="">
</div>
<el-radio v-model="form.articleTemplate" :label="item.id">{{ item.name }}</el-radio>
</li>
</template>
</ul>
</el-form-item>
<template v-if="form.articleTemplate === 1 || form.articleTemplate === 2">
<template v-if="!form.templateStatus || (form.templateStatus && form.articleTemplate === 2)">
<el-form-item prop="mainBody" label="正文">
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="form.mainBody" :init="editorConfig" />
</el-form-item>
@ -202,7 +204,7 @@
<el-button type="primary" @click="submit(1)">发布</el-button>
<el-button @click="preview">预览</el-button>
<el-button @click="submit(0)">保存草稿</el-button>
<el-button @click="$router.back()">取消</el-button>
<el-button @click="$router.push('/article')">取消</el-button>
</div>
</div>
</template>
@ -216,7 +218,6 @@ export default {
data() {
return {
site: this.$store.state.content.site,
headers: {},
nameRepeat: false,
types: ColumnConst.types,
templates: ColumnConst.templates,
@ -234,8 +235,8 @@ export default {
id: this.$route.query.id || '',
founderId: this.$store.state.user.userId,
editorId: this.$store.state.user.userId,
useArticleTemplate: 0,
articleTemplate: this.$route.query.columnId ? this.$store.state.content.column.detailStyle : '',
templateStatus: 0,
articleTemplate: '',
author: '',
bannerImg: '',
columnId: +this.$route.query.columnId,
@ -277,6 +278,9 @@ export default {
computed: {
...mapState('user', [
'userName'
]),
...mapState('content', [
'column'
])
},
components: {
@ -296,7 +300,6 @@ export default {
if (this.submiting) {
next()
} else {
const { id } = this.form
const { updateTime } = this
//
if (updateTime > 2) {
@ -340,6 +343,7 @@ export default {
columnName: '',
templateId: '',
typeId : '',
isSort: 0
}).then(({ data }) => {
this.columns = data
let { columnId } = this.$route.query
@ -459,7 +463,7 @@ export default {
if (!links.length && form.connectionType === 3 && isRelease) return util.errorMsg('请选择栏目')
form.linkAddress = links.join()
}
if (form.articleTemplate !== 3 && !form.mainBody && isRelease) return util.errorMsg('请输入正文')
if (((form.templateStatus && form.articleTemplate === 2) || !form.templateStatus) && !form.mainBody && isRelease) return util.errorMsg('请输入正文')
const { columnId } = form
if (typeof columnId === 'object') form.columnId = columnId[columnId.length - 1]
form.isRelease = isRelease

@ -193,6 +193,7 @@ export default {
columnName: '',
templateId: '',
typeId : '',
isSort: 0
}).then(({ data }) => {
this.columns = data
this.$nextTick(() => {

@ -1,5 +1,5 @@
<template>
<div class="page">
<div class="page" v-show="loaded">
<p class="page-name mb">栏目</p>
<el-form :model="form" :rules="rules" class="input-form model" label-width="120px">
<div class="item-line">
@ -70,6 +70,14 @@
</div>
</el-upload>
</el-form-item>
<el-form-item prop="subtitle" label="栏目副标题">
<el-input
type="textarea"
placeholder="请输入栏目副标题"
v-model.trim="form.subtitle"
@change="nameChange"
></el-input>
</el-form-item>
<el-form-item prop="templateId" label="栏目模板">
<el-select v-model="form.templateId">
<el-option
@ -218,18 +226,29 @@
</el-form>
<div class="btns">
<el-button type="primary" @click="submit(0)">确定</el-button>
<el-button @click="$router.back()">取消</el-button>
<el-button @click="$router.push('/column')">取消</el-button>
</div>
<!-- 剪裁组件弹窗 -->
<el-dialog append-to-body :visible.sync="cropperModel" width="1100px">
<Cropper
ref="vueCropper"
:is-upload="isUpload"
:img-file="file"
:fixed="true"
@upload="customUpload" />
</el-dialog>
</div>
</template>
<script>
import util from "@/libs/util";
import ColumnConst from '@/const/column'
import { mapState } from 'vuex'
import ImgUpload from '@/components/img-upload'
import Cropper from '@/components/img-upload/Cropper'
import Axios from 'axios'
export default {
data() {
return {
loaded: false,
site: this.$store.state.content.site,
isEdit: this.$route.query.type === 'edit',
nameRepeat: false,
@ -261,6 +280,7 @@ export default {
pageSize: 10,
menuVisible: 0,
columnBanner: '',
subtitle: '',
templateId: 1,
listStyleId: 1,
detailStyle: 1,
@ -296,11 +316,14 @@ export default {
],
},
submiting: false, //
updateTime: 0
updateTime: 0,
cropperModel: false,
isUpload: false,
file: {}, //
};
},
components: {
ImgUpload
Cropper
},
computed: {
...mapState('user', [
@ -356,7 +379,6 @@ export default {
next()
}
}
console.log("🚀 ~ file: index.vue ~ line 336 ~ beforeRouteLeave ~ to", to, this.updateTime)
},
methods: {
//
@ -366,11 +388,24 @@ export default {
columnName: '',
templateId: '',
typeId : '',
isSort: 0
}).then(({ data }) => {
this.columns = data
this.isEdit && this.getData()
if (this.isEdit) {
this.getData()
this.handleId(data)
} else {
this.loaded = true
}
}).catch(err => {})
},
// disabled
handleId(list) {
list.forEach(e => {
if (this.isEdit && e.id == this.form.id) e.disabled = true
e.children.length ? this.handleId(e.children) : delete e.children
})
},
//
getArticle() {
// /
@ -390,14 +425,14 @@ export default {
this.$post(`${this.api.findColumn}?id=${this.form.id}`).then(({ data }) => {
this.form = data
if (data.typeId === 2) {
let link = data.linkAddress
if (link) {
link = link.split(',').map(e => +e)
const article = +link.splice(link.length - 1, 1) // ididlinkAddressid
if (data.linkAddress) {
const columnArticle = data.linkAddress.split('-')
const column = columnArticle[0].split(',').map(e => +e)
const article = columnArticle[1] || '' // ididlinkAddressid
//
this.$post(this.api.queryArticle, {
siteId: this.site.id,
columnIds: [link[link.length - 1]], // ididid
columnIds: [column[column.length - 1]], // ididid
pageNum: 1,
pageSize: 1000,
title: ''
@ -405,16 +440,22 @@ export default {
this.articles = res.data.records
// /
if (data.connectionType === 1) {
this.links = link
this.links = column
this.form.linkAddress = ''
this.article = article
if (article) this.article = +article
} else if (data.connectionType === 3) {
this.otherLink = link
this.otherLink = column
this.form.linkAddress = ''
this.otherArticle = article
if (article) this.otherArticle = +article
}
this.$nextTick(() => {
this.updateTime = 1
})
this.loaded = true
}).catch(err => {})
}
} else {
this.loaded = true
}
}).catch(err => {})
},
@ -446,6 +487,42 @@ export default {
this.nameRepeat = false
}
},
customUpload(data) {
// upload
// console.log(data);
// let _data = this.compress(img);
const blob = this.dataURItoBlob(data)
const formData = new FormData()
formData.append('file', blob, this.file.name) //
this.imgUpload(formData)
},
imgUpload(formData) {
this.isUpload = true
Axios({
method: 'post',
url: this.api.upload,
data: formData,
headers: {
'Content-Type': 'multipart/form-data'
},
}).then(({ data }) => {
}).catch(res => {})
// this.$api[this.uploadMethodName]({
// data: formData,
// showLoading: false
// }).then(res => {
// //
// console.log(this.uploadList)
// this.uploadList = this.isSingle ? res : this.uploadList.concat(res)
// this.uploadList.forEach(item => {
// item.name = item.fileId
// item.url = `/common-service/file/downloadFileFromOSS?key=${item.fileId}`
// })
// }).catch(() => {})
this.isUpload = false
this.cropperModel = false
},
//
beforeUpload(file) {
const { size, name } = file
@ -490,13 +567,13 @@ export default {
const { links, article, otherLink, otherArticle } = this
if (form.connectionType === 1) {
if (!links.length) return util.errorMsg('请选择站内链接')
if (!article) return util.errorMsg('请选择文章')
form.linkAddress = links.join() + ',' + article
form.linkAddress = links.join()
if (article) form.linkAddress += '-' + article
}
if (form.connectionType === 3) {
if (!otherLink.length) return util.errorMsg('请选择栏目')
if (!otherArticle) return util.errorMsg('请选择文章')
form.linkAddress = otherLink.join() + ',' + otherArticle
form.linkAddress = otherLink.join()
if (otherArticle) form.linkAddress += '-' + otherArticle
}
}
this.submiting = true

@ -98,7 +98,7 @@
<el-dialog title="导航样式设置" :visible.sync="styleVisible" width="850px" :close-on-click-modal="false">
<el-form class="input-form" label-width="100px">
<el-form-item label="导航样式">
<el-select v-model="form.typeId">
<el-select v-model="form.navigationStyle">
<el-option
v-for="item in styleTypes"
:key="item.id"
@ -113,13 +113,13 @@
<div class="review">
<img src="@/assets/img/style1.png" alt="">
</div>
<el-radio v-model="form.listStyleId" :label="1">竖行导航</el-radio>
<el-radio v-model="form.styleTemplate" :label="1">竖行导航</el-radio>
</li>
<li>
<div class="review">
<img src="@/assets/img/style2.png" alt="">
</div>
<el-radio v-model="form.listStyleId" :label="2">横向导航</el-radio>
<el-radio v-model="form.styleTemplate" :label="2">横向导航</el-radio>
</li>
</ul>
</el-form-item>
@ -138,6 +138,7 @@ import util from "@/libs/util";
export default {
data() {
return {
siteId: this.$store.state.content.site.id,
siteName: this.$store.state.content.site.siteName,
types: ColumnConst.types,
templates: ColumnConst.templates,
@ -156,7 +157,10 @@ export default {
}
],
form: {
typeId: 1
id: '',
navigationStyle: 1,
styleTemplate: 1,
siteId: this.$store.state.content.site.id
},
originSettings: [],
settings: [
@ -225,10 +229,11 @@ export default {
methods: {
getData() {
this.$post(this.api.listWithTree, {
siteId: this.$store.state.content.site.id,
siteId: this.siteId,
columnName: this.keyword,
templateId: '',
typeId : '',
isSort: 0
}).then(({ data }) => {
this.list = data
this.listLoading = false
@ -303,7 +308,15 @@ export default {
},
//
sort() {
this.sortColumns = JSON.parse(JSON.stringify(this.list))
this.$post(this.api.listWithTree, {
siteId: this.siteId,
columnName: '',
templateId: '',
typeId : '',
isSort: 1
}).then(({ data }) => {
this.sortColumns = data
}).catch(err => {})
this.sortVisible = true
},
//
@ -336,10 +349,25 @@ export default {
//
styleSet() {
this.styleVisible = true
this.$post(`${this.api.searchAllBySite}?siteId=${this.siteId}`).then(({ data }) => {
// id
if (data.length) {
this.form = data[0]
} else {
this.$post(this.api.saveStyle, this.form).then(res => {
this.$post(`${this.api.searchAllBySite}?siteId=${this.siteId}`).then(({ data }) => {
this.form = data[0]
}).catch(res => {})
}).catch(res => {})
}
}).catch(res => {})
},
//
styleSubmit() {
this.$post(this.api.updateStyle, this.form).then(res => {
util.successMsg('修改成功')
this.styleVisible = false
}).catch(res => {})
}
}
};

@ -4,7 +4,7 @@
<div class="inner">
<div class="text-center">
<img :src="avatar" class="avatar" />
<el-upload :headers="{token}" :action="this.api.uploadUserAvatars" name="file" :limit="10" :show-file-list="false" :on-success="changeAvatar">
<el-upload :action="this.api.updateUserAvatars" name="file" :data="{ userId }" :limit="10" :show-file-list="false" :on-success="changeAvatar">
<el-button type="text" size="small">点击更换头像</el-button>
</el-upload>
</div>
@ -22,13 +22,12 @@
<script>
import Setting from '@/setting'
import { mapState,mapActions } from 'vuex'
import { mapState,mapActions, mapMutations } from 'vuex'
import info from './info'
import util from '@/libs/util'
export default {
data() {
return {
token: util.local.get(Setting.tokenKey),
typeList: [
{
index: '1',
@ -42,18 +41,19 @@ export default {
components: { info },
computed: {
...mapState('user', [
'avatar'
'avatar', 'userId'
]),
},
mounted() {
},
methods: {
...mapActions('user', [
...mapMutations('user', [
'setAvatar'
]),
changeAvatar(res) {
this.setAvatar(res.message)
console.log("🚀 ~ file: index.vue ~ line 55 ~ changeAvatar ~ res", res)
this.setAvatar(res.data)
},
updateStatus(status){
this.edited = status

@ -23,12 +23,12 @@
<label>工号</label>
<el-input size="small" v-model="form.jobNumber" clearable></el-input>
</li>
<li>
<!-- <li>
<label>邮箱</label>
<el-input class="m-r-10" size="small" v-model="form.email" disabled></el-input>
<el-button v-if="form.email" type="text" size="small" @click="bindEmail">更换</el-button>
<el-button v-else type="text" size="small" @click="bindEmail">添加</el-button>
</li>
</li> -->
<li>
<label>手机号</label>
<el-input class="m-r-10" type="text" size="small" v-model="form.phone" disabled></el-input>
@ -38,7 +38,7 @@
<li>
<label>密码</label>
<el-input class="m-r-10" size="small" value="******" disabled></el-input>
<el-button type="text" size="small" @click="bindPassword">更换</el-button>
<!-- <el-button type="text" size="small" @click="bindPassword">更换</el-button> -->
</li>
</ul>
</div>
@ -263,7 +263,7 @@ export default {
if (this.passwordForm.password === this.passwordForm.newPassword) return util.warningMsg("原密码跟新密码不能一致")
let data = this.passwordForm
data.userid = this.userId
this.$post(this.api.examinePassword, data).then(res => {
this.$put(this.api.examinePassword, data).then(res => {
util.successMsg("更换成功")
this.passwordVisible = false
}).catch(err => {})
@ -324,40 +324,35 @@ export default {
}
},
sendEmailCode() {
if (!this.email) return util.warningMsg("请输入邮箱");
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)) return util.warningMsg("请输入正确的邮箱");
let data = {
userId: this.userId,
if (!this.email) return util.warningMsg("请输入邮箱")
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)) return util.warningMsg("请输入正确的邮箱")
this.$post(this.api.sendPhoneOrEmailCode, {
email: this.email,
types: 1
};
this.$post(this.api.sendPhoneOrEmailCode, data).then(res => {
}).then(res => {
if (res.message.opener) {
this.emailCountdown();
this.emailOpener = res.message.opener;
} else {
util.errorMsg(res.message);
}
}).catch(res => {
});
}).catch(res => {})
},
emailSubmit() {
if (!this.email) return util.warningMsg("请输入邮箱");
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)) return util.warningMsg("请输入正确的邮箱");
if (!this.emailCode) return util.warningMsg("请输入验证码");
let data = {
if (!this.email) return util.warningMsg("请输入邮箱")
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)) return util.warningMsg("请输入正确的邮箱")
if (!this.emailCode) return util.warningMsg("请输入验证码")
this.$put(this.api.bindPhoneOrEmail, {
userId: this.userId,
email: this.email,
types: 1,
code: this.emailCode,
opener: this.emailOpener
};
this.$put(this.api.bindPhoneOrEmail, data).then(res => {
util.successMsg("绑定成功");
this.form.email = this.email;
this.emailVisible = false;
}).catch(res => {
});
}).then(res => {
util.successMsg("绑定成功")
this.form.email = this.email
this.emailVisible = false
}).catch(res => {})
},
closePhone() {
if (!this.emailDisabled) {

@ -154,9 +154,9 @@
<el-form-item prop="phone" label="手机号">
<el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11"></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱">
<!-- <el-form-item prop="email" label="邮箱">
<el-input v-model.trim="form.email" placeholder="请输入邮箱"></el-input>
</el-form-item>
</el-form-item> -->
<el-form-item prop="groupId" label="用户组">
<el-select v-model="form.groupId" style="width: 100%">
<template v-for="item in userGroups">
@ -209,7 +209,6 @@
<script>
import util from '@/libs/util'
import Setting from '@/setting'
import { mapState } from 'vuex'
export default {
data() {
const accountPass = (rule, value, callback) => {
@ -622,7 +621,7 @@ export default {
if (ids.length) {
let has = false //
for (const i in ids) {
if (list.find(n => n.id === ids[i])) {
if (list.find(n => n.id == ids[i])) {
has = true
break
}

@ -7,7 +7,7 @@ const isPro = url.includes("occupationlab.com"); //是否生产
let host = `${location.origin}:10000/`
if (isDev) {
host = 'http://192.168.31.136:10000/' // 测试服
host = 'http://192.168.31.151:10000/' // 榕
// host = 'http://192.168.31.151:10000/' // 榕
// host = 'http://192.168.31.137:10000/' // 赓
}

@ -134,6 +134,9 @@
.el-input, .el-select {
width: 300px;
}
.el-textarea {
width: 550px;
}
.auto, .auto .el-input {
width: auto;
}

Loading…
Cancel
Save