费率等联调

dev_202303
yujialong 2 years ago
parent 63849c7c7f
commit d4366a467a
  1. 12
      src/assets/css/main.css
  2. 2
      src/setting.js
  3. 9
      src/utils/api.js
  4. 46
      src/views/join/index.vue
  5. 10
      src/views/parner/index.vue
  6. 524
      src/views/parner/rate.vue
  7. 194
      src/views/parner/staff.vue
  8. 26
      src/views/parnerOperation/learnMg.vue
  9. 91
      src/views/parnerOperation/mobileRole.vue
  10. 149
      src/views/parnerOperation/pcRole.vue
  11. 466
      src/views/parnerOperation/schemeSet.vue
  12. 40
      src/views/parnerOperation/staff.vue

@ -478,4 +478,16 @@ li {
.mce-content-body:not([dir=rtl]) blockquote { .mce-content-body:not([dir=rtl]) blockquote {
border-left: 0; border-left: 0;
background-color: #ccc; background-color: #ccc;
}
.search-wrap {
display: flex;
}
.search-wrap .el-select {
width: 140px;
}
.search-wrap .keyword .el-input__inner {
border-left: 0;
}
.search-wrap .el-input__inner {
border-radius: 0;
} }

@ -12,7 +12,7 @@ if (isDev) {
host = 'http://121.37.12.51/' host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/' // host = 'https://huorantech.cn/'
host = 'http://192.168.31.151:9000/'// 榕 host = 'http://192.168.31.151:9000/'// 榕
host = 'http://192.168.31.116:9000/'// 赓 // host = 'http://192.168.31.116:9000/'// 赓
} else if (isPro) { } else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/' jumpPath = 'https://www.huorantech.cn/judgmentPoint/'
} }

@ -99,6 +99,9 @@ export default {
updateModelClass: `nakadai/nakadai/model/reference/updateModelClass`, updateModelClass: `nakadai/nakadai/model/reference/updateModelClass`,
checkIsShowBySystemId: `nakadai/nakadai/model/reference/checkIsShowBySystemId`, checkIsShowBySystemId: `nakadai/nakadai/model/reference/checkIsShowBySystemId`,
modifyIsShowState: `nakadai/nakadai/model/reference/modifyIsShowState`, modifyIsShowState: `nakadai/nakadai/model/reference/modifyIsShowState`,
editProvinceCity: `nakadai/nakadai/partner-team/editProvinceCity`,
editPartnerTeamRates: `nakadai/nakadai/partner-team/editPartnerTeamRates`,
teamPartnerList: `nakadai/nakadai/partnerAccount/teamPartnerList`,
delModelInfoBySystemId: `nakadai/nakadai/model/reference/demo/delModelInfoBySystemId`, delModelInfoBySystemId: `nakadai/nakadai/model/reference/demo/delModelInfoBySystemId`,
deleteReferenceDemo: `nakadai/nakadai/model/reference/demo/deleteReferenceDemo`, deleteReferenceDemo: `nakadai/nakadai/model/reference/demo/deleteReferenceDemo`,
@ -420,4 +423,10 @@ export default {
saveParnerFile: `nakadai/nakadai/partner/article/file/save`, saveParnerFile: `nakadai/nakadai/partner/article/file/save`,
theAttachmentUnderTheQueryColumn: `nakadai/nakadai/partner/article/file/theAttachmentUnderTheQueryColumn`, theAttachmentUnderTheQueryColumn: `nakadai/nakadai/partner/article/file/theAttachmentUnderTheQueryColumn`,
updateParnerFile: `nakadai/nakadai/partner/article/file/update`, updateParnerFile: `nakadai/nakadai/partner/article/file/update`,
batchDeletionScheme: `nakadai/nakadai/partner/schemeManagement/batchDeletion`,
enableOrDisableScheme: `nakadai/nakadai/partner/schemeManagement/enableOrDisable`,
findByIdScheme: `nakadai/nakadai/partner/schemeManagement/findById`,
saveScheme: `nakadai/nakadai/partner/schemeManagement/save`,
schemeList: `nakadai/nakadai/partner/schemeManagement/schemeList`,
updateScheme: `nakadai/nakadai/partner/schemeManagement/update`,
}; };

@ -11,15 +11,22 @@
</div> </div>
<div class="inner"> <div class="inner">
<el-form class="form" ref="form" :model="form" :rules="rules"> <el-form class="form" ref="form" :model="form" :rules="rules">
<el-form-item prop="provinceId">
<el-select style="width: 100%" v-model="form.provinceId" placeholder="请选择省份" @change="getCity">
<el-option v-for="(item,index) in provinces" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="cityId">
<el-select style="width: 100%" v-model="form.cityId" placeholder="请选择城市" :disabled="form.provinceId ? false : true">
<el-option v-for="(item,index) in cities" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="phone"> <el-form-item prop="phone">
<el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11" @change="phoneChange"></el-input> <el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11" @change="phoneChange"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="userName"> <el-form-item prop="userName">
<el-input v-model.trim="form.userName" placeholder="请输入姓名" :disabled="repeat"></el-input> <el-input v-model.trim="form.userName" placeholder="请输入姓名" :disabled="repeat"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="account">
<el-input v-model.trim="form.account" placeholder="请设置你的账号" :disabled="repeat"></el-input>
</el-form-item>
<el-form-item prop="code"> <el-form-item prop="code">
<div class="ver-code"> <div class="ver-code">
<el-input v-model="form.code" placeholder="请输入验证码" maxlength="6"></el-input> <el-input v-model="form.code" placeholder="请输入验证码" maxlength="6"></el-input>
@ -39,6 +46,8 @@ import Setting from "@/setting"
export default { export default {
data() { data() {
return { return {
provinces: [],
cities: [],
isMobile: util.isMobile(), isMobile: util.isMobile(),
userName: this.$route.query.userName, userName: this.$route.query.userName,
teamName: this.$route.query.teamName, teamName: this.$route.query.teamName,
@ -47,14 +56,18 @@ export default {
id: this.$route.query.accountId, id: this.$route.query.accountId,
partnerClassificationId: this.$route.query.id, partnerClassificationId: this.$route.query.id,
isTeam: this.$route.query.isTeam, // (0)pc(1) isTeam: this.$route.query.isTeam, // (0)pc(1)
account: '',
phone: '', phone: '',
code: '', code: '',
userName: '' userName: '',
provinceId: +this.$route.query.provinceId || '',
cityId: +this.$route.query.cityId || ''
}, },
rules: { rules: {
account: [ provinceId: [
{ required: true, message: '请输入账号', trigger: 'blur' } { required: true, message: '请选择省份', trigger: "change" }
],
cityId: [
{ required: true, message: '请选择城市', trigger: "change" }
], ],
userName: [ userName: [
{ required: true, message: '请输入用户名', trigger: "blur" } { required: true, message: '请输入用户名', trigger: "blur" }
@ -75,9 +88,25 @@ export default {
}; };
}, },
mounted() { mounted() {
this.getProvince()
this.form.cityId && this.getCity()
}, },
methods: { methods: {
//
getProvince(){
this.$get(this.api.queryProvince).then(res => {
this.provinces = res.list
}).catch(res => {})
},
//
getCity(val){
this.$get(this.api.queryCity,{
provinceId: val
}).then(res => {
this.cities = res.list
if (val) this.form.cityId = ''
}).catch(res => {})
},
// //
verifyPhone(phone) { verifyPhone(phone) {
if (!phone) { if (!phone) {
@ -146,7 +175,6 @@ export default {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
if (this.submiting) return false if (this.submiting) return false
if (this.accountReapeat) return util.warningMsg("该账号已存在")
if (this.phoneRepeat) return util.warningMsg("该手机号已存在") if (this.phoneRepeat) return util.warningMsg("该手机号已存在")
if (this.emailRepeat) return util.warningMsg("该邮箱已存在") if (this.emailRepeat) return util.warningMsg("该邮箱已存在")
const { form } = this const { form } = this

@ -7,6 +7,7 @@
<staff v-if="active == 'staff'"></staff> <staff v-if="active == 'staff'"></staff>
<pc-role v-if="active == 'pcRole'"></pc-role> <pc-role v-if="active == 'pcRole'"></pc-role>
<mobile-role v-if="active == 'mobileRole'"></mobile-role> <mobile-role v-if="active == 'mobileRole'"></mobile-role>
<rate v-if="active == 'rate'"></rate>
</div> </div>
</template> </template>
@ -15,6 +16,7 @@ import Setting from "@/setting";
import staff from "./staff"; import staff from "./staff";
import pcRole from "./pcRole"; import pcRole from "./pcRole";
import mobileRole from "./mobileRole"; import mobileRole from "./mobileRole";
import rate from "./rate";
export default { export default {
data() { data() {
return { return {
@ -22,14 +24,16 @@ export default {
tabs: { tabs: {
staff: "账号管理", staff: "账号管理",
pcRole: "pc角色权限", pcRole: "pc角色权限",
mobileRole: "小程序角色权限" mobileRole: "小程序角色权限",
rate: "费率管理",
} }
}; };
}, },
components: { components: {
staff, staff,
pcRole, pcRole,
mobileRole mobileRole,
rate
}, },
created() { created() {
Setting.dynamicRoute && this.initTabs(); Setting.dynamicRoute && this.initTabs();
@ -50,10 +54,12 @@ export default {
const tab1 = btns.includes('/parner:账号管理') const tab1 = btns.includes('/parner:账号管理')
const tab2 = btns.includes('/parner:pc角色权限') const tab2 = btns.includes('/parner:pc角色权限')
const tab3 = btns.includes('/parner:小程序角色权限') const tab3 = btns.includes('/parner:小程序角色权限')
const tab4 = btns.includes('/parner:费率管理')
tab1 || delete this.tabs.staff tab1 || delete this.tabs.staff
tab2 || delete this.tabs.pcRole tab2 || delete this.tabs.pcRole
tab3 || delete this.tabs.mobileRole tab3 || delete this.tabs.mobileRole
tab4 || delete this.tabs.rate
const type = this.$route.query.type const type = this.$route.query.type
const keys = Object.keys(this.tabs) const keys = Object.keys(this.tabs)
this.active = keys.includes(type) ? type : keys[0] this.active = keys.includes(type) ? type : keys[0]

@ -0,0 +1,524 @@
<template>
<div class="wrap">
<!-- 左边的组织 -->
<div class="side">
<div>
<div class="flex-between">
<h6 class="p-title" style="margin-bottom: 0">城市合伙人区域管理</h6>
<el-button type="text" @click="addOrg" v-auth="'/parner:账号管理:添加分类'">添加分类</el-button>
</div>
<div style="height: 504px; max-height: 504px; overflow: auto">
<el-tree
:data="orgList"
default-expand-all
ref="orgTree"
node-key="id"
highlight-current
:expand-on-click-node="false"
@node-click="handleNodeClick"
:props="{children: 'children', label: 'partnerClassificationName', isLeaf: 'leaf'}"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span class="org-name">{{ node.label }}</span>
<span>
<!-- isTeam 0: 分类1: 团队 -->
<el-button
v-auth="'/parner:账号管理:添加分类'"
v-if="!data.isTeam"
type="text"
icon="el-icon-circle-plus-outline"
@click="() => addOrg(node, data)">
</el-button>
<el-button
v-auth="'/parner:账号管理:编辑分类'"
type="text"
icon="el-icon-edit-outline"
@click="() => editOrg(node, data)">
</el-button>
<el-button
v-auth="'/parner:账号管理:删除分类'"
type="text"
icon="el-icon-delete"
@click="() => delOrg(node, data)">
</el-button>
</span>
</span>
</el-tree>
</div>
</div>
<el-dialog
:title="typeForm.id ? '编辑' : '新增' + '分类'"
:visible.sync="orgVisible"
:close-on-click-modal="false"
width="50%"
@close="closeType"
>
<el-form v-if="orgVisible" ref="typeForm" :model="typeForm" :rules="orgRules" label-width="100px">
<el-form-item label="分类名称" prop="partnerClassificationName">
<el-input v-model.trim="typeForm.partnerClassificationName" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="上级部门">
<span v-if="typeForm.parentName">{{ typeForm.parentName }}</span>
<el-cascader
v-else
:options="orgListDia"
v-model="cascaderValue"
:props="cascaderProps"
clearable
style="width: 100%"
>
</el-cascader>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="closeOrg"> </el-button>
<el-button type="primary" @click="orgSubmit"> </el-button>
</span>
</el-dialog>
</div>
<!-- 右边的员工 -->
<div class="right">
<!-- <h6 class="p-title">筛选</h6>
<div class="tool">
<ul class="filter">
<li>
<el-input style="width: 250px;" placeholder="请输入员工姓名/手机号" prefix-icon="el-icon-search" v-model="keyWord" clearable></el-input>
</li>
</ul>
</div> -->
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="teamName" label="团队名称" align="center" min-width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="userName" label="团队负责人" align="center" min-width="100"></el-table-column>
<el-table-column prop="phone" label="手机号" align="center" min-width="120"></el-table-column>
<el-table-column prop="account" label="账号" align="center" min-width="100"></el-table-column>
<el-table-column prop="invitationAccount" label="邀请人" align="center" min-width="120"></el-table-column>
<el-table-column prop="phone" label="团队年费" align="center" min-width="120">
<template slot-scope="scope">
固定年费{{ scope.row.annualTeamFee}}w
<el-button type="primary" size="mini" @click="editAnnualTeamFee(scope.row)">修改</el-button>
</template>
</el-table-column>
<el-table-column prop="phone" label="市场服务年费" align="center" min-width="120">
<template slot-scope="scope">
项目抽成{{ scope.row.annualMarketingFee}}%
<el-button type="primary" size="mini" @click="editAnnualMarketingFee(scope.row)">修改</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
<el-dialog title="请设置费率" :visible.sync="annualTeamFeeVisible" width="300px" class="dialog" :close-on-click-modal="false">
<el-form ref="form" label-width="75px" style='margin-right: 0;'>
<el-form-item label="固定年费">
<el-input style="width: 150px;" type="number" v-model.trim="annualTeamFee" placeholder="请输入数字"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="annualTeamFeeVisible = false">取消</el-button>
<el-button type="primary" @click="submitAnnualTeamFee">确定</el-button>
</span>
</el-dialog>
<el-dialog title="请设置费率" :visible.sync="annualMarketingFeeVisible" width="300px" class="dialog" :close-on-click-modal="false">
<el-form ref="form" label-width="75px" style='margin-right: 0;'>
<el-form-item label="固定年费">
<el-input style="width: 150px;" type="number" v-model.trim="annualMarketingFee" placeholder="请输入数字"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="annualMarketingFeeVisible = false">取消</el-button>
<el-button type="primary" @click="submitAnnualMarketingFee">确定</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
import util from "@/libs/util";
import Setting from "@/setting";
import OrgTree from "@/components/org-tree/src/tree";
import clipboard from '@/libs/clipboard'
import axios from 'axios'
export default {
components: { OrgTree },
data() {
return {
accountId: this.$store.state.accountId,
userName: this.$store.state.userName,
type: 1,
orgList: [],
orgListDia: [],
orgVisible: false, //
typeForm: {
id: '',
partnerClassificationName: ''
},
cascaderValue: [], //
cascaderProps: {
checkStrictly: true,
label: "partnerClassificationName",
value: "id"
},
treeVisible: true,
treeNode: {},
treeResolve: [],
isDetail: false,
keyWord: '',
listData: [],
page: 1,
pageSize: 10,
total: 0,
multipleSelection: [],
orgRules: {
partnerClassificationName: [
{ required: true, message: "请输入部门名称", trigger: "blur" }
]
},
parnerVisible: false,
casProps: {
multiple: true,
checkStrictly: true,
label: 'partnerClassificationName',
value: 'id',
isLeaf: 'leaf'
},
link: '',
qrcode: '',
expireTime: '',
curTeamId: '',
submiting: false, //
setKey: '',
transferVisible: false,
chooseVisible: false,
members: [],
choosePartnerId: '',
curRow: '',
annualTeamFeeVisible: false,
annualTeamFee: '',
annualMarketingFeeVisible: false,
annualMarketingFee: '',
};
},
watch: {
keyWord: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(this.initData, 500);
}
},
mounted() {
this.getOrg()
},
methods: {
//
async getOrg() {
const res = await this.$post(this.api.listParner)
const list = res.treeList
// children
const handleLeaf = (list, ids) => {
list.map(e => {
e.ids = ids ? [...ids, e.id] : [e.id]
if (e.children.length) {
if (e.isTeam) {
delete e.children
} else {
handleLeaf(e.children, e.ids)
}
} else {
delete e.children
}
})
}
handleLeaf(list)
this.orgList = list
//
this.setKey && this.$nextTick(() => {
this.$refs.orgTree.setCurrentKey(this.setKey)
})
this.getList()
},
//
typeChange() {
this.$refs.orgTree.setCurrentKey(null)
this.curTeamId = ''
this.initData()
},
//
addOrg(node, data) {
const list = JSON.parse(JSON.stringify(this.orgList))
this.handleOrg(list)
this.orgListDia = list
this.typeForm = {
id: '',
parentId: data ? data.id : 1,
level: data ? data.level + 1 : 1,
parentName: data ? data.partnerClassificationName : '',
partnerClassificationName: ''
}
this.cascaderValue = []
this.orgVisible = true
},
//
editOrg(node, data) {
const list = JSON.parse(JSON.stringify(this.orgList))
this.handleOrg(list)
this.orgListDia = list
this.typeForm = {
id: data.id,
partnerClassificationName: data.partnerClassificationName,
isTeam: data.isTeam
}
this.orgVisible = true
const { ids } = data
ids.splice(ids.length - 1, 1)
this.cascaderValue = ids
},
//
closeType() {
this.typeForm = {
id: '',
partnerClassificationName: ''
}
},
//
handleOrg(list) {
for (const i in list) {
const e = list[i]
//
if (e.isTeam) {
e.disabled = true
} else {
this.handleOrg(e.children)
}
}
},
//
delOrg(node, data) {
this.$confirm(data.isTeam ? '确定删除该城市合伙人?删除后,该团队同步解散,且不可恢复!' : '确定要删除吗?', "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteParner}?id=${data.id}`).then(res => {
util.successMsg("删除成功")
this.getOrg()
}).catch(res => {})
}).catch(() => {})
},
// /
orgSubmit() {
this.$refs.typeForm.validate((valid) => {
if (valid) {
const form = this.typeForm
const cas = this.cascaderValue
const len = cas.length
if (cas && len) {
this.typeForm.parentId = cas[len - 1]
this.typeForm.level = len + 1
}
if (!form.id) {
//
this.$post(this.api.saveParner, form).then(res => {
util.successMsg("新增成功!")
this.closeOrg()
}).catch(err => {})
} else {
//
this.$post(this.api.updateParner, form).then(res => {
util.successMsg("编辑成功!")
this.setKey = form.id
this.closeOrg()
}).catch(err => {})
}
}
});
},
// id
getTeamId(list) {
for (const i in list) {
const e = list[i]
if (e.isTeam && !this.curTeamId) {
this.curTeamId = e.id
break
} else {
this.getTeamId(e.children)
}
}
},
//
handleNodeClick(data) {
this.type = ''
this.curTeamId = ''
if (data.isTeam) {
this.curTeamId = data.id
} else {
// this.getTeamId(data.children)
}
if (!this.curTeamId) this.curTeamId = data.id
this.initData()
this.$refs.table.clearSelection()
},
//
closeOrg() {
this.orgVisible = false
this.cascaderValue = []
this.getOrg()
},
//
getAll() {
this.curTeamId = ''
this.getList()
},
//
getList() {
this.$post(this.api.teamPartnerList, {
type: this.type || 1,
partnerClassificationId: this.curTeamId,
keyWord: this.keyWord,
pageNum: this.page,
pageSize: this.pageSize
}).then(({ pageList }) => {
pageList.records.forEach((e, i) => {
e.id = i
})
this.listData = pageList.records
console.log("🚀 ~ file: staff.vue:479 ~ getList ~ this.listData:", this.listData)
this.total = pageList.total
}).catch(err => {})
},
//
currentChange(val) {
this.page = val
this.getList()
},
handleSelectionChange(val) { //
this.multipleSelection = val
},
initData() {
this.$refs.table.clearSelection()
this.page = 1
this.getList()
},
//
editAnnualTeamFee(row) {
this.curRow = row
this.annualTeamFee = row.annualTeamFee
this.annualTeamFeeVisible = true
},
//
submitAnnualTeamFee() {
this.$post(this.api.editPartnerTeamRates, {
annualTeamFee: this.annualTeamFee,
partnerId: this.curRow.partnerId,
teamId: this.curRow.teamId,
}).then(res => {
this.annualTeamFeeVisible = false
util.successMsg('修改成功')
this.getList()
}).catch(res => {})
},
//
editAnnualMarketingFee(row) {
this.curRow = row
this.annualMarketingFee = row.annualMarketingFee
this.annualMarketingFeeVisible = true
},
//
submitAnnualMarketingFee() {
this.$post(this.api.editPartnerTeamRates, {
annualMarketingFee: this.annualMarketingFee,
partnerId: this.curRow.partnerId,
teamId: this.curRow.teamId,
}).then(res => {
this.annualMarketingFeeVisible = false
util.successMsg('修改成功')
this.getList()
}).catch(res => {})
},
}
};
</script>
<style lang="scss" scoped>
.m-b-20 {
margin-bottom: 20px;
}
.org-name {
margin-right: 20px;
}
.w-100 {
width: 100%;
}
.wrap {
display: flex;
padding: 0 24px;
.side {
width: 300px;
padding: 24px 10px 24px 0;
margin-right: 24px;
border-right: 1px solid rgba(0, 0, 0, 0.06);
}
.right {
width: calc(100% - 324px);
padding: 24px 0;
}
}
.add-dia {
.tips {
font-size: 12px;
color: #f00;
}
.title {
margin: 10px 0;
font-size: 14px;
em {
font-style: normal;
}
}
.des {
font-size: 13px;
color: #7a7a7a;
}
.link-wrap {
display: flex;
align-items: center;
margin: 10px 0 20px;
}
.link {
padding: 10px;
margin-right: 15px;
background-color: #e7f5ff;
border-radius: 4px;
}
}
/deep/.choose-dia {
.member-list {
li {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.info {
display: inline-flex;
align-items: center;
}
img {
width: 40px;
height: 40px;
}
.name {
margin-left: 10px;
}
.el-radio__label {
display: none;
}
}
}
</style>

@ -104,16 +104,28 @@
</div> </div>
</div> </div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="accountId"> <el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="userName" label="姓名" align="center" min-width="100"></el-table-column> <el-table-column prop="userName" label="团队负责人" align="center" min-width="100"></el-table-column>
<el-table-column prop="account" label="账号" align="center" min-width="100"></el-table-column> <el-table-column prop="account" label="账号" align="center" min-width="100"></el-table-column>
<el-table-column prop="phone" label="手机号" align="center" width="120"></el-table-column> <el-table-column prop="phone" label="手机号" align="center" min-width="120"></el-table-column>
<el-table-column prop="partnerClassificationName" label="团队名称" align="center" min-width="200" show-overflow-tooltip></el-table-column> <el-table-column prop="invitationAccount" label="邀请人" align="center" min-width="120"></el-table-column>
<el-table-column v-if="!type" prop="roleName" label="授权角色" align="center" min-width="200" show-overflow-tooltip></el-table-column> <el-table-column prop="partnerClassificationName" label="团队名称" align="center" min-width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="provinceName" label="省份" align="center" min-width="80"></el-table-column>
<el-table-column prop="cityName" label="城市" align="center" min-width="80"></el-table-column>
<el-table-column v-if="!type" prop="roleName" label="授权角色" align="center" min-width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="phone" label="费率" align="center" min-width="120">
<template slot-scope="scope">
团队年费{{ scope.row.annualTeamFee}},
市场服务年费{{ scope.row.annualMarketingFee}}
</template>
</el-table-column>
<el-table-column prop="loginNumber" label="登录次数" align="center" width="120"></el-table-column>
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center" width="120"></el-table-column>
<el-table-column label="操作" align="center" width="300"> <el-table-column label="操作" align="center" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="!type" type="text" v-auth="'/parner:账号管理:重置密码'" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" v-auth="'/parner:账号管理:重置密码'" @click="resetPassword(scope.row)">重置密码</el-button> <el-button type="text" v-auth="'/parner:账号管理:重置密码'" @click="resetPassword(scope.row)">重置密码</el-button>
<el-button v-if="type" type="text" v-auth="'/parner:账号管理:删除合伙人'" @click="del(scope.row)">删除</el-button> <el-button v-if="type" type="text" v-auth="'/parner:账号管理:删除合伙人'" @click="del(scope.row)">删除</el-button>
<el-button v-else-if="scope.row.isTeam == 1" type="text" v-auth="'/parner:账号管理:转让超管'" @click="transfer(scope.row)">转让超管</el-button> <el-button v-else-if="scope.row.isTeam == 1" type="text" v-auth="'/parner:账号管理:转让超管'" @click="transfer(scope.row)">转让超管</el-button>
@ -160,6 +172,40 @@
<el-button size="small" type="primary" @click="chooseSubmit"> </el-button> <el-button size="small" type="primary" @click="chooseSubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="编辑合伙人'" :visible.sync="editVisible" width="400px" class="dialog" :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="60px" style='margin-right: 0;'>
<el-form-item prop="userName" label="姓名">
<el-input v-model.trim="form.userName" placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item prop="roleList" label="角色">
<el-select class="w-100" v-model="form.roleList" multiple>
<template v-for="item in roleList">
<!-- 不显示超管 -->
<el-option
:key="item.id"
:label="item.roleName"
:value="item.id">
</el-option>
</template>
</el-select>
</el-form-item>
<el-form-item prop="provinceId" label="省份">
<el-select style="width: 100%" v-model="form.provinceId" placeholder="请选择省份" @change="getCity">
<el-option v-for="(item,index) in provinces" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="cityId" label="城市">
<el-select style="width: 100%" v-model="form.cityId" placeholder="请选择城市" :disabled="form.provinceId ? false : true">
<el-option v-for="(item,index) in cities" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="editVisible = false">取消</el-button>
<el-button type="primary" @click="submitEdit">确定</el-button>
</span>
</el-dialog>
</div> </div>
</div> </div>
</template> </template>
@ -173,45 +219,6 @@ import axios from 'axios'
export default { export default {
components: { OrgTree }, components: { OrgTree },
data() { data() {
const accountPass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入账号'))
} else {
const pattern = /^[A-Za-z0-9]*$/
if(pattern.test(value)){
this.accountChange()
callback()
}else{
callback(new Error('请输入正确账号格式'))
}
}
}
const phonePass = (rule, value, callback) => {
if (value) {
const pattern = /^1[3456789]\d{9}$/
if(pattern.test(value)){
// this.phoneChange()
callback()
}else{
callback(new Error('请输入正确手机号格式'))
}
} else {
callback()
}
}
const emailPass = (rule, value, callback) => {
if (value) {
const pattern = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/
if(pattern.test(value)){
// this.emailChange()
callback()
}else{
callback(new Error('请输入正确邮箱格式'))
}
} else {
callback()
}
}
return { return {
accountId: this.$store.state.accountId, accountId: this.$store.state.accountId,
userName: this.$store.state.userName, userName: this.$store.state.userName,
@ -236,28 +243,23 @@ export default {
keyWord: '', keyWord: '',
form: { form: {
userName: '', userName: '',
phone: '', provinceId: '',
email: '', cityId: '',
account: '' roleList: []
},
orgRules: {
partnerClassificationName: [
{ required: true, message: "请输入部门名称", trigger: "blur" }
]
}, },
rules: { rules: {
account: [
{ required: true,validator: accountPass, trigger: 'blur' }
],
userName: [ userName: [
{ required: true, message: "请输入姓名", trigger: "blur" } { required: true, message: "请输入姓名", trigger: "blur" }
], ],
phone: [ provinceId: [
{ validator: phonePass, trigger: 'blur' } { required: true, message: '请选择省份', trigger: "change" }
],
cityId: [
{ required: true, message: '请选择城市', trigger: "change" }
],
roleList: [
{ required: true, message: '请选择角色', trigger: "change" }
], ],
email: [
{ validator: emailPass, trigger: 'blur' }
]
}, },
listData: [], listData: [],
page: 1, page: 1,
@ -265,6 +267,11 @@ export default {
total: 0, total: 0,
multipleSelection: [], multipleSelection: [],
orgRules: {
partnerClassificationName: [
{ required: true, message: "请输入部门名称", trigger: "blur" }
]
},
parnerVisible: false, parnerVisible: false,
casProps: { casProps: {
multiple: true, multiple: true,
@ -283,7 +290,10 @@ export default {
chooseVisible: false, chooseVisible: false,
members: [], members: [],
choosePartnerId: '', choosePartnerId: '',
curRow: '' curRow: '',
provinces: [],
cities: [],
editVisible: false
}; };
}, },
watch: { watch: {
@ -294,6 +304,8 @@ export default {
}, },
mounted() { mounted() {
this.getOrg() this.getOrg()
this.getProvince()
this.getRole()
}, },
methods: { methods: {
// //
@ -462,7 +474,12 @@ export default {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize pageSize: this.pageSize
}).then(({ pageList }) => { }).then(({ pageList }) => {
pageList.records.forEach((e, i) => {
e.id = i
})
this.listData = pageList.records this.listData = pageList.records
console.log("🚀 ~ file: staff.vue:479 ~ getList ~ this.listData:", this.listData)
this.total = pageList.total this.total = pageList.total
}).catch(err => {}) }).catch(err => {})
}, },
@ -479,6 +496,21 @@ export default {
this.page = 1 this.page = 1
this.getList() this.getList()
}, },
//
getProvince(){
this.$get(this.api.queryProvince).then(res => {
this.provinces = res.list
}).catch(res => {})
},
//
getCity(val){
this.$get(this.api.queryCity,{
provinceId: this.form.provinceId
}).then(res => {
this.cities = res.list
if (val) this.form.cityId = ''
}).catch(res => {})
},
// //
del(row) { del(row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
@ -509,6 +541,44 @@ export default {
this.curRow = row this.curRow = row
this.transferVisible = true this.transferVisible = true
}, },
getRole() {
// platformId 4setting.jsport: pc01
this.$get(`${this.api.roleList}?page=1&size=10000&platformId=4&port=1&name=`).then(res => {
this.roleList = res.rolePage.records;
}).catch(res => {});
},
//
edit(row) {
if (!row.provinceId) row.provinceId = ''
if (!row.cityId) row.cityId = ''
row.roleList = row.roleId.split(',').map(e => +e)
this.editVisible = true
this.form = JSON.parse(JSON.stringify(row))
row.cityId && this.getCity()
},
//
submitEdit() {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
this.submiting = true
const form = JSON.parse(JSON.stringify(this.form))
form.classificationId = form.partnerClassificationId
this.$post(this.api.editProvinceCity, form).then(res => {
this.getList()
util.successMsg("编辑成功!")
this.editVisible = false
setTimeout(() => {
this.submiting = false
}, 2000)
}).catch(res => {
setTimeout(() => {
this.submiting = false
}, 2000)
})
}
})
},
// //
resetPassword(row) { resetPassword(row) {
const newPwd = Setting.initialPassword const newPwd = Setting.initialPassword
@ -609,7 +679,7 @@ export default {
border-right: 1px solid rgba(0, 0, 0, 0.06); border-right: 1px solid rgba(0, 0, 0, 0.06);
} }
.right { .right {
flex: 1; width: calc(100% - 324px);
padding: 24px 0; padding: 24px 0;
} }
} }

@ -226,25 +226,11 @@ import Axios from 'axios'
export default { export default {
data() { data() {
return { return {
typeId: +this.$route.query.type,
headers: { headers: {
token: sessionStorage.getItem('token') token: sessionStorage.getItem('token')
}, },
nameRepeat: false, nameRepeat: false,
sites: [],
detailStyle: [],
columns: [],
articles: [],
otherArticles: [],
columnProps: {
checkStrictly: true,
value: 'id',
label: 'columnName'
},
links: [],
article: '',
otherColumns: [],
otherLink: [],
otherArticle: '',
form: { form: {
id: this.$route.query.id || '', id: this.$route.query.id || '',
author: '', author: '',
@ -260,7 +246,7 @@ export default {
summary : '', summary : '',
title: '', title: '',
fileList: [], fileList: [],
typeId: 1 typeId: +this.$route.query.type
}, },
rules: { rules: {
title: [ title: [
@ -344,7 +330,7 @@ export default {
}, },
// //
getClassification() { getClassification() {
this.$post(`${this.api.queryClassificationByType}?typeId=1`).then(({ data }) => { this.$post(`${this.api.queryClassificationByType}?typeId=${this.typeId}`).then(({ data }) => {
this.classifications = data this.classifications = data
}).catch(err => {}) }).catch(err => {})
}, },
@ -382,10 +368,10 @@ export default {
// //
submitClass(row, showMsg = 1) { submitClass(row, showMsg = 1) {
if (!row.classificationName) return Util.errorMsg('请输入分类名称') if (!row.classificationName) return Util.errorMsg('请输入分类名称')
this.$post(`${this.api.checkForHeavyParnerClass}?classificationName=${row.classificationName}&typeId=1&classificationId=${row.id}`).then(res => { this.$post(`${this.api.checkForHeavyParnerClass}?classificationName=${row.classificationName}&typeId=${this.typeId}&classificationId=${row.id}`).then(res => {
this.$post(this.api[row.id ? 'updateParnerClass' : 'saveParnerClass'], { this.$post(this.api[row.id ? 'updateParnerClass' : 'saveParnerClass'], {
classificationName: row.classificationName, classificationName: row.classificationName,
typeId: 1, // (1.2.) typeId: this.typeId, // (1.2.)
id: row.id, id: row.id,
}).then(res => { }).then(res => {
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功') showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功')
@ -489,7 +475,7 @@ export default {
const { title, id } = this.form const { title, id } = this.form
if(title && title !== this.originalName){ if(title && title !== this.originalName){
this.$post(this.api.checkIfTheTitleIsRepeat, { this.$post(this.api.checkIfTheTitleIsRepeat, {
typeId: 1, typeId: this.typeId,
title, title,
id: id || '' id: id || ''
}).then(res => { }).then(res => {

@ -2,7 +2,15 @@
<div class="page"> <div class="page">
<div class="tool"> <div class="tool">
<div class="search-wrap"> <div class="search-wrap">
<el-input class="keyword" placeholder="请输入标题" v-model.trim="keyword" clearable></el-input> <el-select v-model="field" @change="initData">
<el-option
v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input>
</div> </div>
<div class="actions"> <div class="actions">
<el-button v-auth="'/site/list:内容管理:文章管理:删除'" @click="batchDel">批量删除</el-button> <el-button v-auth="'/site/list:内容管理:文章管理:删除'" @click="batchDel">批量删除</el-button>
@ -17,8 +25,8 @@
<el-table-column prop="founderName" label="录入人" align="center" min-width="80"></el-table-column> <el-table-column prop="founderName" label="录入人" align="center" min-width="80"></el-table-column>
<el-table-column prop="editorName" label="修改人" align="center" min-width="80"></el-table-column> <el-table-column prop="editorName" label="修改人" align="center" min-width="80"></el-table-column>
<el-table-column prop="updateTime" label="修改日期" align="center" min-width="150"></el-table-column> <el-table-column prop="updateTime" label="修改日期" align="center" min-width="150"></el-table-column>
<el-table-column prop="releaseTime" label="发布日期" align="center" min-width="100"></el-table-column> <el-table-column prop="createTime" label="发布日期" align="center" min-width="100"></el-table-column>
<el-table-column prop="totalBrowsing" label="已学习人数" align="center" min-width="70"></el-table-column> <el-table-column prop="learnerNumber" label="已学习人数" align="center" min-width="70"></el-table-column>
<el-table-column prop="workNumber" label="状态" align="center" min-width="80"> <el-table-column prop="workNumber" label="状态" align="center" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }} {{ scope.row.isRelease ? '已发布' : '草稿' }}
@ -51,6 +59,21 @@ import { mapMutations } from 'vuex'
export default { export default {
data() { data() {
return { return {
field: 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: '', keyword: '',
list: [], list: [],
page: 1, page: 1,
@ -58,7 +81,8 @@ export default {
total: 0, total: 0,
modifiedTimeSort: '', modifiedTimeSort: '',
publicationTimeSort: '', publicationTimeSort: '',
ordinalSort: 0, classificationNameSort: '',
editTimeSort: '',
multipleSelection: [], multipleSelection: [],
}; };
}, },
@ -71,7 +95,7 @@ export default {
} }
}, },
mounted() { mounted() {
// this.getData() this.getData()
}, },
methods: { methods: {
// //
@ -80,15 +104,15 @@ export default {
const data = { const data = {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
ordinalSort: this.ordinalSort, querySource: 3, //(3. 4.)
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
releaseDateSort: this.releaseDateSort,
title: this.field === 'title' ? keyword : '', title: this.field === 'title' ? keyword : '',
founder: this.field === 'founder' ? keyword : '', founderName: this.field === 'founder' ? keyword : '',
column: this.field === 'column' ? keyword : '', editorName: this.field === 'editor' ? keyword : ''
editor: this.field === 'editor' ? keyword : ''
} }
if (this.modifiedTimeSort !== '') data.modifiedTimeSort = this.modifiedTimeSort this.$post(this.api.schemeList, data).then(({ data }) => {
if (this.publicationTimeSort !== '') data.publicationTimeSort = this.publicationTimeSort
this.$post(this.api.queryArticle, data).then(({ data }) => {
this.list = data.records this.list = data.records
this.total = +data.total this.total = +data.total
}).catch(err => {}) }).catch(err => {})
@ -116,7 +140,7 @@ export default {
list.map(e => { list.map(e => {
data.push('ids=' + e.id) data.push('ids=' + e.id)
}) })
this.$post(`${this.api.deleteArticle}?${data.join('&')}`).then(res => { this.$post(`${this.api.batchDeletionScheme}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
util.successMsg("删除成功") util.successMsg("删除成功")
this.getData() this.getData()
@ -131,7 +155,7 @@ export default {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$post(`${this.api.deleteArticle}?ids=${row.id}`).then(res => { this.$post(`${this.api.batchDeletionScheme}?ids=${row.id}`).then(res => {
util.successMsg('删除成功') util.successMsg('删除成功')
this.getData() this.getData()
}).catch(res => {}) }).catch(res => {})
@ -139,7 +163,7 @@ export default {
}, },
// //
switchOff(val, row) { switchOff(val, row) {
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {}) this.$post(`${this.api.enableOrDisableScheme}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {})
}, },
// //
add() { add() {
@ -149,39 +173,50 @@ export default {
sortChange(column) { sortChange(column) {
const { order } = column const { order } = column
// 1 // 1
// 0 1 if (column.prop === 'classificationName') {
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'updateTime') { if (column.prop === 'updateTime') {
this.modifiedTimeSort = order ? order === 'ascending' ? 1 : 0 : '' this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) { if (order) {
this.publicationTimeSort = '' this.classificationNameSort = ''
this.ordinalSort = '' this.releaseDateSort = ''
this.sequenceSort = ''
} }
} }
if (column.prop === 'releaseTime') { if (column.prop === 'releaseTime') {
this.publicationTimeSort = order ? order === 'ascending' ? 1 : 0 : '' this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) { if (order) {
this.modifiedTimeSort = '' this.editTimeSort = ''
this.ordinalSort = '' this.classificationNameSort = ''
this.sequenceSort = ''
} }
} }
// 0 1
if (column.prop === 'sequence') { if (column.prop === 'sequence') {
this.ordinalSort = order ? order === 'ascending' ? 0 : 1 : '' this.sequenceSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) { if (order) {
this.publicationTimeSort = '' this.editTimeSort = ''
this.modifiedTimeSort = '' this.releaseDateSort = ''
this.classificationNameSort = ''
} }
} }
this.getData() this.getData()
}, },
// //
edit(row) { edit(row) {
this.$router.push(`add?id=${row.id}&columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`) this.$router.push(`/schemeSet?id=${row.id}`)
}, },
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
</style> </style>

@ -2,7 +2,15 @@
<div class="page"> <div class="page">
<div class="tool"> <div class="tool">
<div class="search-wrap"> <div class="search-wrap">
<el-input class="keyword" placeholder="请输入标题" v-model.trim="keyword" clearable></el-input> <el-select v-model="field" @change="initData">
<el-option
v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input>
</div> </div>
<div class="actions"> <div class="actions">
<el-button v-auth="'/site/list:内容管理:文章管理:删除'" @click="batchDel">批量删除</el-button> <el-button v-auth="'/site/list:内容管理:文章管理:删除'" @click="batchDel">批量删除</el-button>
@ -13,12 +21,24 @@
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column> <el-table-column show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column>
<el-table-column prop="sequence" label="文章排序" align="center" min-width="110" sortable="custom">
<template slot-scope="scope">
<el-input
v-if="scope.row.editing"
class="squ-input"
v-model="scope.row.sequence"
></el-input>
<span v-else>{{ scope.row.sequence }}</span>
<i v-if="scope.row.editing" class="el-icon-check squ-icon" @click="submitSequence(scope.row)"></i>
<i v-else class="el-icon-edit squ-icon" @click="editSequence(scope.row)"></i>
</template>
</el-table-column>
<el-table-column prop="classificationName" label="所属分类" align="center" min-width="120" sortable="custom"></el-table-column> <el-table-column prop="classificationName" label="所属分类" align="center" min-width="120" sortable="custom"></el-table-column>
<el-table-column prop="founderName" label="录入人" align="center" min-width="80"></el-table-column> <el-table-column prop="founderName" label="录入人" align="center" min-width="80"></el-table-column>
<el-table-column prop="editorName" label="修改人" align="center" min-width="80"></el-table-column> <el-table-column prop="editorName" label="修改人" align="center" min-width="80"></el-table-column>
<el-table-column prop="updateTime" label="修改日期" align="center" min-width="150"></el-table-column> <el-table-column prop="updateTime" label="修改日期" align="center" min-width="150" sortable="custom"></el-table-column>
<el-table-column prop="releaseTime" label="发布日期" align="center" min-width="100"></el-table-column> <el-table-column prop="releaseTime" label="发布日期" align="center" min-width="100" sortable="custom"></el-table-column>
<el-table-column prop="totalBrowsing" label="总浏览" align="center" min-width="70"></el-table-column> <el-table-column prop="learnerNumber" label="总浏览" align="center" min-width="70"></el-table-column>
<el-table-column prop="workNumber" label="状态" align="center" min-width="80"> <el-table-column prop="workNumber" label="状态" align="center" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }} {{ scope.row.isRelease ? '已发布' : '草稿' }}
@ -26,6 +46,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="170"> <el-table-column label="操作" align="center" width="170">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="sticky(scope.row)">置顶</el-button>
<el-button v-auth="'/site/list:内容管理:文章管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button> <el-button v-auth="'/site/list:内容管理:文章管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/site/list:内容管理:文章管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button v-auth="'/site/list:内容管理:文章管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-switch <el-switch
@ -51,14 +72,30 @@ import { mapMutations } from 'vuex'
export default { export default {
data() { data() {
return { return {
field: 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: '', keyword: '',
list: [], list: [],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
modifiedTimeSort: '', sequenceSort: '',
publicationTimeSort: '', classificationNameSort: '',
ordinalSort: 0, releaseDateSort: '',
editTimeSort: 'desc',
multipleSelection: [], multipleSelection: [],
}; };
}, },
@ -71,24 +108,28 @@ export default {
} }
}, },
mounted() { mounted() {
// this.getData() this.getData()
}, },
methods: { methods: {
// //
getData() { getData() {
const { keyword } = this const { keyword } = this
const data = { this.$post(this.api.partnerOperatingList, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
ordinalSort: this.ordinalSort, querySource: 3, //(3. 4.)
sequenceSort: this.sequenceSort,
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
releaseDateSort: this.releaseDateSort,
typeId: 2, // (1.2.)
title: this.field === 'title' ? keyword : '', title: this.field === 'title' ? keyword : '',
founder: this.field === 'founder' ? keyword : '', founderName: this.field === 'founder' ? keyword : '',
column: this.field === 'column' ? keyword : '', editorName: this.field === 'editor' ? keyword : ''
editor: this.field === 'editor' ? keyword : '' }).then(({ data }) => {
} data.records.forEach(e => {
if (this.modifiedTimeSort !== '') data.modifiedTimeSort = this.modifiedTimeSort e.editing = false
if (this.publicationTimeSort !== '') data.publicationTimeSort = this.publicationTimeSort })
this.$post(this.api.queryArticle, data).then(({ data }) => {
this.list = data.records this.list = data.records
this.total = +data.total this.total = +data.total
}).catch(err => {}) }).catch(err => {})
@ -116,7 +157,7 @@ export default {
list.map(e => { list.map(e => {
data.push('ids=' + e.id) data.push('ids=' + e.id)
}) })
this.$post(`${this.api.deleteArticle}?${data.join('&')}`).then(res => { this.$post(`${this.api.batchDeletionParnerArticle}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
util.successMsg("删除成功") util.successMsg("删除成功")
this.getData() this.getData()
@ -131,7 +172,7 @@ export default {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$post(`${this.api.deleteArticle}?ids=${row.id}`).then(res => { this.$post(`${this.api.batchDeletionParnerArticle}?ids=${row.id}`).then(res => {
util.successMsg('删除成功') util.successMsg('删除成功')
this.getData() this.getData()
}).catch(res => {}) }).catch(res => {})
@ -143,45 +184,87 @@ export default {
}, },
// //
add() { add() {
this.$router.push(`/learnMg`) this.$router.push(`/learnMg?type=2`)
}, },
// //
sortChange(column) { sortChange(column) {
const { order } = column const { order } = column
// 1 // 1
// 0 1 if (column.prop === 'classificationName') {
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'updateTime') { if (column.prop === 'updateTime') {
this.modifiedTimeSort = order ? order === 'ascending' ? 1 : 0 : '' this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) { if (order) {
this.publicationTimeSort = '' this.classificationNameSort = ''
this.ordinalSort = '' this.releaseDateSort = ''
this.sequenceSort = ''
} }
} }
if (column.prop === 'releaseTime') { if (column.prop === 'releaseTime') {
this.publicationTimeSort = order ? order === 'ascending' ? 1 : 0 : '' this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) { if (order) {
this.modifiedTimeSort = '' this.editTimeSort = ''
this.ordinalSort = '' this.classificationNameSort = ''
this.sequenceSort = ''
} }
} }
// 0 1
if (column.prop === 'sequence') { if (column.prop === 'sequence') {
this.ordinalSort = order ? order === 'ascending' ? 0 : 1 : '' this.sequenceSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) { if (order) {
this.publicationTimeSort = '' this.editTimeSort = ''
this.modifiedTimeSort = '' this.releaseDateSort = ''
this.classificationNameSort = ''
} }
} }
this.getData() this.getData()
}, },
//
submitSequence(row) {
if (!row.sequence) return Util.errorMsg('请输入排序')
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${row.sequence}`).then(res => {
this.initData()
}).catch(res => {})
},
//
editSequence(row) {
this.list.forEach(e => {
e.editing = false
})
row.editing = true
},
//
sticky(row) {
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=1`).then(res => {
this.initData()
}).catch(res => {})
},
// //
edit(row) { edit(row) {
this.$router.push(`add?id=${row.id}&columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`) this.$router.push(`/learnMg?id=${row.id}&type=2`)
}, },
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
.squ-icon {
margin-left: 5px;
cursor: pointer;
}
/deep/.squ-input {
width: auto;
.el-input__inner {
width: 60px;
padding: 0 10px;
}
}
</style> </style>

@ -3,16 +3,16 @@
<p class="page-name mb">方案设置</p> <p class="page-name mb">方案设置</p>
<el-form :model="form" :rules="rules" class="input-form model" label-width="140px"> <el-form :model="form" :rules="rules" class="input-form model" label-width="140px">
<div class="item-line"> <div class="item-line">
<el-form-item prop="source" label="标题"> <el-form-item prop="title" label="标题">
<el-input <el-input
placeholder="请输入标题" placeholder="请输入标题"
v-model.trim="form.source" v-model.trim="form.title"
clearable clearable
maxlength="30" maxlength="30"
class="inline-input" class="inline-input"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="author" label="所属分类"> <el-form-item prop="classificationId" label="所属分类">
<el-select style="width: 234px;" v-model="form.classificationId"> <el-select style="width: 234px;" v-model="form.classificationId">
<template v-for="item in classifications"> <template v-for="item in classifications">
<el-option <el-option
@ -26,31 +26,30 @@
<el-button class="set-btn" type="primary" @click="setClass">设置</el-button> <el-button class="set-btn" type="primary" @click="setClass">设置</el-button>
</el-form-item> </el-form-item>
</div> </div>
<el-form-item prop="summary" label="适用专业"> <el-form-item prop="applicableMajor" label="适用专业">
<el-input <el-input
style="width: 940px" style="width: 940px"
type="textarea" type="textarea"
v-model.trim="form.summary" v-model.trim="form.applicableMajor"
:rows="3" :rows="3"
clearable clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="summary" label="产品"> <el-form-item prop="product" label="产品">
<el-input <el-input
style="width: 940px" style="width: 940px"
type="textarea" type="textarea"
v-model.trim="form.summary" v-model.trim="form.product"
:rows="3" :rows="3"
clearable clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="file" label="文件上传"> <el-form-item prop="schemeFile" label="方案文件">
<el-upload <el-upload
:before-upload="fileBeforeUpload" :before-upload="fileBeforeUpload"
:on-remove="handleRemove"
:on-success="uploadSuccessFile" :on-success="uploadSuccessFile"
:action="this.api.fileupload" :action="this.api.fileUploadNakadai"
:file-list="form.fileList" :file-list="fileList"
:headers="headers" :headers="headers"
> >
<el-button>上传</el-button> <el-button>上传</el-button>
@ -62,16 +61,6 @@
<el-button @click="submit(0)">保存草稿</el-button> <el-button @click="submit(0)">保存草稿</el-button>
<el-button @click="back">取消</el-button> <el-button @click="back">取消</el-button>
</div> </div>
<!-- 剪裁组件弹窗 -->
<el-dialog title="图片裁剪" append-to-body :visible.sync="cropperModel" 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 title="所属分类设置" :visible.sync="classVisible" width="500px" :close-on-click-modal="false" class="manage-dia" :before-close="closeClass"> <el-dialog title="所属分类设置" :visible.sync="classVisible" width="500px" :close-on-click-modal="false" class="manage-dia" :before-close="closeClass">
<div class="plus"> <div class="plus">
@ -104,44 +93,11 @@
<el-button @click="closeClass">返回</el-button> <el-button @click="closeClass">返回</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="主题标签设置" :visible.sync="labelVisible" width="500px" :close-on-click-modal="false" class="manage-dia" :before-close="closeLabel">
<div class="plus">
<i class="el-icon-circle-plus-outline" @click="addLabel"></i>
</div>
<el-table :data="labels" ref="table" header-align="center" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="labelName" label="主题名称" align="center" min-width="130">
<template slot-scope="scope">
<el-input
v-if="scope.row.edit"
placeholder="请输入主题名称"
v-model="scope.row.labelName"
clearable
maxlength="30"
></el-input>
<span v-else>{{ scope.row.labelName }}</span>
</template>
</el-table-column>
<el-table-column prop="updateTime1" label="是否引用" align="center" min-width="60"></el-table-column>
<el-table-column label="操作" align="center" min-width="60">
<template slot-scope="scope">
<i v-if="scope.row.edit" class="el-icon-check edit" @click="submitLabel(scope.row)"></i>
<i v-else class="el-icon-edit edit" @click="editLabel(scope.row)"></i>
<i class="el-icon-delete del" @click="delLabel(scope.row, scope.$index)"></i>
</template>
</el-table-column>
</el-table>
<span slot="footer">
<el-button @click="closeLabel">返回</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import Setting from '@/setting' import Setting from '@/setting'
import Util from '@/libs/util' import Util from '@/libs/util'
import { mapState } from 'vuex'
import Editor from '@tinymce/tinymce-vue' import Editor from '@tinymce/tinymce-vue'
import editorConfig from './editor' import editorConfig from './editor'
import Cropper from '@/components/img-upload/Cropper' import Cropper from '@/components/img-upload/Cropper'
@ -153,98 +109,32 @@ export default {
token: sessionStorage.getItem('token') token: sessionStorage.getItem('token')
}, },
nameRepeat: false, nameRepeat: false,
sites: [],
detailStyle: [],
columns: [],
articles: [],
otherArticles: [],
columnProps: {
checkStrictly: true,
value: 'id',
label: 'columnName'
},
links: [],
article: '',
otherColumns: [],
otherLink: [],
otherArticle: '',
form: { form: {
id: this.$route.query.id || '', id: this.$route.query.id || '',
templateStatus: 0, applicableMajor: '',
articleTemplate: '',
doi: '',
quote: '',
articleKeyWord: '',
publicationTypeId: '',
publicationYear: '',
periodicalName: '',
reel: '',
documentNumber: '',
activityEndTime: '',
activityStartTime: '',
time: '',
lectureSeries: '',
onlineLocation: '',
offlineLocation: '',
keynoteSpeaker: '',
eventProfile: '',
author: '',
edit: '',
audit: '',
bannerImg: '',
lableId: [],
classificationId: '', classificationId: '',
columnId: +this.$route.query.columnId, product: '',
file: '', schemeFile: '',
isRelease: 0,
mainBody: '',
releaseTime: new Date(),
source: '',
summary : '',
title: '', title: '',
titleImg: '',
connectionType : 1,
linkAddress: '',
siteSelection: '',
fileList: [],
isOpen: 1
}, },
fileList: [],
rules: { rules: {
title: [ title: [
{ required: true, message: '请输入标题', trigger: 'blur' } { required: true, message: '请输入标题', trigger: 'blur' }
], ],
columnId: [
{ required: true, message: '请选择所属栏目', trigger: 'change' }
],
time: [
{ required: true, message: '请选择起始时间', trigger: 'change' }
],
classificationId: [ classificationId: [
{ required: false, message: '请选择所属分类', trigger: 'change' } { required: true, message: '请选择所属分类', trigger: 'change' }
],
keynoteSpeaker: [
{ required: true, message: '请输入主讲人', trigger: 'blur' }
],
eventProfile: [
{ required: true, message: '请输入活动简介', trigger: 'blur' }
], ],
releaseTime: [ applicableMajor: [
{ required: true, message: '请选择发布日期', trigger: 'change' } { required: true, message: '请输入适用专业', trigger: 'blur' }
], ],
publicationYear: [ product: [
{ required: true, message: '请选择出版年份', trigger: 'change' } { required: true, message: '请输入产品', trigger: 'blur' }
], ],
titleImg: [ schemeFile: [
{ required: true, message: '请上传封面图', trigger: 'change' } { required: true, message: '请选择方案文件', trigger: 'change' }
],
mainBody: [
{ required: true, message: '请输入正文', trigger: 'blur' }
],
connectionType: [
{ required: true, message: '请选择连接类型', trigger: 'blur' }
], ],
}, },
columnInfo: {},
editorConfig, editorConfig,
submiting: false, // submiting: false, //
pass: false, pass: false,
@ -254,7 +144,6 @@ export default {
isUpload: false, isUpload: false,
fixedNumber: [1.76, 1], fixedNumber: [1.76, 1],
file: {}, // file: {}, //
isBanner: 0,
classifications: [], classifications: [],
classVisible: false, classVisible: false,
labels: [], labels: [],
@ -262,7 +151,7 @@ export default {
}; };
}, },
components: { components: {
// Editor, Editor,
Cropper Cropper
}, },
watch: { watch: {
@ -296,24 +185,21 @@ export default {
} }
}, },
mounted() { mounted() {
this.getClassification()
this.getArticle() this.getArticle()
this.getLabel()
}, },
methods: { methods: {
// //
getArticle() { getArticle() {
this.$post(this.api.queryArticle, { const { id } = this.form
pageNum: 1, id && this.$post(`${this.api.findByIdScheme}?id=${id}`).then(({ data }) => {
pageSize: 1000, if (data.schemeFile) this.fileList = [{name: data.schemeFile, url: data.schemeFile}]
title: '', this.form = data
isDisable: 0
}).then(({ data }) => {
this[inner ? 'articles' : 'otherArticles'] = data.records.filter(e => e.isRelease) //
}).catch(err => {}) }).catch(err => {})
}, },
// //
getClassification() { getClassification() {
this.$post(`${this.api.queryClassif}?siteId=${this.site.id}&templateId=${this.columnInfo.templateId}`).then(({ data }) => { this.$post(`${this.api.queryClassificationByType}?typeId=3`).then(({ data }) => {
this.classifications = data this.classifications = data
}).catch(err => {}) }).catch(err => {})
}, },
@ -339,7 +225,7 @@ export default {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$post(`${this.api.delClassif}?id=${row.id}`).then(res => { this.$post(`${this.api.batchDeletionParnerClass}?ids=${row.id}`).then(res => {
Util.successMsg('删除成功') Util.successMsg('删除成功')
this.getClassification() this.getClassification()
}).catch(res => {}) }).catch(res => {})
@ -351,14 +237,11 @@ export default {
// //
submitClass(row, showMsg = 1) { submitClass(row, showMsg = 1) {
if (!row.classificationName) return Util.errorMsg('请输入分类名称') if (!row.classificationName) return Util.errorMsg('请输入分类名称')
this.$post(`${this.api.checkClassif}?classificationName=${row.classificationName}&siteId=${this.site.id}&classificationId=${row.id}`).then(res => { this.$post(`${this.api.checkForHeavyParnerClass}?classificationName=${row.classificationName}&typeId=1&classificationId=${row.id}`).then(res => {
this.$post(this.api[row.id ? 'updateClassif' : 'saveClassif'], { this.$post(this.api[row.id ? 'updateParnerClass' : 'saveParnerClass'], {
classificationName: row.classificationName, classificationName: row.classificationName,
templateId: this.columnInfo.templateId, typeId: 3, // (1.2.)
id: row.id, id: row.id,
siteId: this.site.id,
editorId: this.userId,
founderId: this.userId
}).then(res => { }).then(res => {
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功') showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功')
this.getClassification() this.getClassification()
@ -384,224 +267,13 @@ export default {
} }
}, },
//
getLabel() {
this.$post(`${this.api.queryLabel}?siteId=${this.site.id}`).then(({ data }) => {
this.labels = data
}).catch(err => {})
},
//
setLabel() {
this.labelVisible = true
},
//
addLabel() {
this.labels.push({
edit: true,
id: '',
labelName: ''
})
},
//
editLabel(row) {
this.$set(row, 'edit', 1)
},
//
delLabel(row, i) {
if (row.id) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.delLabel}?id=${row.id}`).then(res => {
Util.successMsg('删除成功')
this.getLabel()
}).catch(res => {})
}).catch(() => {})
} else {
this.labels.splice(i, 1)
}
},
//
submitLabel(row, showMsg = 1) {
if (!row.labelName) return Util.errorMsg('请输入主题名称')
this.$post(`${this.api.checkLabel}?labelName=${row.labelName}&siteId=${this.site.id}&labelId=${row.id}`).then(res => {
this.$post(this.api[row.id ? 'updateLabel' : 'saveLabel'], {
labelName: row.labelName,
id: row.id,
siteId: this.site.id,
editorId: this.userId,
founderId: this.userId
}).then(res => {
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功')
this.getLabel()
}).catch(res => {})
}).catch(res => {})
},
//
closeLabel() {
const list = this.labels
if (list.find(e => e.edit && e.labelName)) {
this.$confirm('所填写内容暂未保存,是否保存?', '提示', {
type: 'warning'
}).then(() => {
list.map(e => {
e.edit && e.labelName && this.submitLabel(e, 0)
})
this.labelVisible = false
}).catch(() => {
this.labelVisible = false
})
} else {
this.labelVisible = false
}
},
//
nameChange(){
const { title, level, id } = this.form
if(title && title !== this.originalName){
this.$post(this.api.checkIfTheTitleIsRepeat, {
siteId: this.site.id,
title,
id: id || ''
}).then(res => {
this.nameRepeat = false
}).catch(res => {
this.nameRepeat = true
})
}else{
this.nameRepeat = false
}
},
//
customUpload(data) {
const formData = new FormData()
formData.append('file', data, this.file.name)
this.imgUpload(formData)
},
//
compress(img) {
const canvas = document.createElement('canvas')
const ctx = canvas.getContext('2d')
// let initSize = img.src.length;
const width = img.width
const height = img.height
canvas.width = width
canvas.height = height
//
ctx.fillStyle = '#fff'
ctx.fillRect(0, 0, canvas.width, canvas.height)
ctx.drawImage(img, 0, 0, width, height)
//
const ndata = canvas.toDataURL('image/jpeg', 0.8)
return ndata
},
// base64bolb
dataURItoBlob(base64Data) {
let byteString
if (base64Data.split(',')[0].indexOf('base64') >= 0) {
byteString = atob(base64Data.split(',')[1])
} else {
byteString = unescape(base64Data.split(',')[1])
}
const mimeString = base64Data
.split(',')[0]
.split(':')[1]
.split(';')[0]
const ia = new Uint8Array(byteString.length)
for (let i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i)
}
return new Blob([ia], {
type: mimeString
})
},
//
imgUpload(formData) {
this.isUpload = true
Axios({
method: 'post',
url: this.api.upload,
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
token: Util.local.get(Setting.tokenKey)
},
}).then(({ data }) => {
let url = this.form[this.isBanner ? 'bannerImg' : 'titleImg']
url && this.$del(this.api.delFile, [url.split('/').pop()]).then(res => {}).catch(e => {}) //
this.form[this.isBanner ? 'bannerImg' : 'titleImg'] = data.url
}).catch(res => {})
this.$refs.cropper.isDisabled = false
this.isUpload = false
this.cropperModel = false
},
//
changeFile(file, isBanner) {
this.fixedNumber = isBanner ? [1, 0.26] : [1.76, 1]
this.isBanner = isBanner
const { size, name } = file
const ext = name.substring(name.lastIndexOf('.') + 1)
if (!Util.isImg(ext)) {
this.$message.error('请上传图片!')
return false
}
// if (size / 1024 / 1024 > 5) {
// this.$message.error('5M')
// return false
// }
this.file = file
this.cropperModel = true
this.$nextTick(() => {
this.$refs.cropper.updateImg({
url: window.URL.createObjectURL(file.raw),
size: file.size
})
})
},
//
handleRemove(e, fileList) {
e.id ? this.$post(`${this.api.delContentFile}?id=${e.id}`).then(res => {
this.form.fileList = fileList
}).catch(res => {}) : (this.form.fileList = fileList)
},
// banner
uploadSuccessBanner(res) {
let url = this.form.bannerImg
url && this.$del(this.api.delFile, [url.split('/').pop()]).then(res => {}).catch(e => {})
this.form.bannerImg = res.url
},
// //
fileBeforeUpload(file) { fileBeforeUpload(file) {
this.uploading++ this.uploading++
}, },
// //
uploadSuccessFile(res) { uploadSuccessFile(res) {
this.uploading-- this.form.schemeFile = res.filesResult.fileUrl
this.form.id ?
this.$post(this.api.saveContentFile, {
contentId: this.form.id,
editorId: this.userId,
founderId: this.userId,
id: '',
fileName: res.original,
filePath: res.url
}).then(({ data }) => {
this.form.fileList.push({
name: res.original,
url: res.url,
id: data
})
}).catch(res => {}) :
this.form.fileList.push({
name: res.original,
url: res.url
})
},
//
preview() {
window.open((Setting.isDev ? `http://${location.hostname}:8095` : this.$store.state.content.site.domainName) + `#/article?articleId=${this.form.id}&siteId=${this.form.siteId}&id=${this.form.columnId}`)
}, },
// //
back() { back() {
@ -637,78 +309,26 @@ export default {
const form = JSON.parse(JSON.stringify(this.form)) const form = JSON.parse(JSON.stringify(this.form))
if (!form.title) return Util.errorMsg('请填写标题') if (!form.title) return Util.errorMsg('请填写标题')
if (this.nameRepeat) return Util.errorMsg('该标题已重复!') if (this.nameRepeat) return Util.errorMsg('该标题已重复!')
if (typeof form.fatherId === 'object') form.fatherId = form.fatherId[form.fatherId.length - 1]
const tId = form.articleTemplate
// //
if (isRelease) { if (isRelease) {
if (tId !== 25) { // if (!form.releaseTime) return Util.errorMsg('')
if (!form.releaseTime) return Util.errorMsg('请选择发布日期') // if (!form.bannerImg ) return Util.errorMsg('')
} // if (!form.mainBody) return Util.errorMsg('')
if (tId === 22 || tId === 23 || tId === 24) {
if (!form.titleImg ) return Util.errorMsg('请上传封面')
}
if (tId === 25) {
if ((!form.time || !form.time.length) && isRelease) return Util.errorMsg('请选择起止时间')
form.activityStartTime = form.time[0]
form.activityEndTime = form.time[1]
}
if (tId === 24 && form.connectionType !== 2) {
if (form.connectionType === 1) {
if (!this.links.length) return Util.errorMsg('请选择站内链接')
}
if (!this.otherLink.length && form.connectionType === 3) {
if (!this.otherLink.length) return Util.errorMsg('请选择栏目')
}
}
if ((tId === 22 || tId === 23 || tId === 25) && !form.mainBody) return Util.errorMsg('请输入正文')
} }
if (this.uploading) return Util.errorMsg('文件正在上传,请上传完成后再发布') // if (this.uploading) return Util.errorMsg('')
if (form.connectionType === 1) {
form.linkAddress = this.links.join()
if (this.article) form.linkAddress += '-' + this.article
} else if (form.connectionType === 3) {
form.linkAddress = this.otherLink.join()
if (this.otherArticle) form.linkAddress += '-' + this.otherArticle
}
const { columnId, bannerImg, fileList, titleImg } = form
const fileId = []
if (typeof columnId === 'object') form.columnId = columnId[columnId.length - 1] // id
// idurlid
if (bannerImg) fileId.push(bannerImg.substr(bannerImg.lastIndexOf('/') + 1))
if (titleImg) fileId.push(titleImg.substr(titleImg.lastIndexOf('/') + 1))
fileList && fileList.map(e => {
fileId.push(e[e.url ? 'url' : 'filePath'].substr(e[e.url ? 'url' : 'filePath'].lastIndexOf('/') + 1))
})
form.lableId = form.lableId.join(',')
form.releaseTime = Util.formatDate('yyyy-MM-dd', new Date(form.releaseTime)) //
form.isRelease = isRelease form.isRelease = isRelease
this.submiting = true this.submiting = true
if (form.id) { if (form.id) {
delete form.children delete form.children
form.editorId = +this.$store.state.user.userId this.$post(this.api.updateScheme, form).then(res => {
this.$post(this.api.updateArticle, form).then(res => {
this.updateFile(fileId, form, form.id)
Util.successMsg('修改成功') Util.successMsg('修改成功')
next ? next() : this.$router.push(`list?columnId=` + form.columnId) next ? next() : this.$router.back()
}).catch(err => { }).catch(err => {
this.submiting = false this.submiting = false
}) })
} else { } else {
this.$post(this.api.saveArticle, form).then(({ data }) => { this.$post(this.api.saveScheme, form).then(({ data }) => {
this.updateFile(fileId, form, data)
//
form.fileList.map(e => {
this.$post(this.api.saveContentFile, {
contentId: data,
editorId: this.userId,
founderId: this.userId,
id: '',
fileName: e.name,
filePath: e.url
}).then(res => {}).catch(err => {})
})
Util.successMsg('创建成功') Util.successMsg('创建成功')
next ? next() : this.$router.back() next ? next() : this.$router.back()
}).catch(err => { }).catch(err => {
@ -826,7 +446,7 @@ $upload-lg-height: 102px;
.plus { .plus {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 18px; font-size: 18px;
color: #2962FF; color: #9278FF;
text-align: right; text-align: right;
cursor: pointer; cursor: pointer;
} }
@ -844,7 +464,7 @@ $upload-lg-height: 102px;
} }
.input-form { .input-form {
&.model { &.model {
height: calc(100vh - 200px); height: calc(100vh - 250px);
padding-right: 20px; padding-right: 20px;
overflow: auto; overflow: auto;
.el-form-item__label { .el-form-item__label {

@ -2,7 +2,15 @@
<div class="page"> <div class="page">
<div class="tool"> <div class="tool">
<div class="search-wrap"> <div class="search-wrap">
<el-input class="keyword" placeholder="请输入标题" v-model.trim="keyword" clearable></el-input> <el-select v-model="field" @change="initData">
<el-option
v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input>
</div> </div>
<div class="actions"> <div class="actions">
<el-button v-auth="'/site/list:内容管理:文章管理:删除'" @click="batchDel">批量删除</el-button> <el-button v-auth="'/site/list:内容管理:文章管理:删除'" @click="batchDel">批量删除</el-button>
@ -60,19 +68,32 @@
<script> <script>
import Setting from '@/setting' import Setting from '@/setting'
import util from '@/libs/util' import util from '@/libs/util'
import { mapMutations } from 'vuex'
export default { export default {
data() { data() {
return { return {
field: 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: '', keyword: '',
list: [], list: [],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
sequenceSort: '', sequenceSort: '',
modifiedTimeSort: '',
publicationTimeSort: '',
classificationNameSort: '', classificationNameSort: '',
releaseDateSort: '',
editTimeSort: 'desc', editTimeSort: 'desc',
multipleSelection: [], multipleSelection: [],
}; };
@ -91,6 +112,7 @@ export default {
methods: { methods: {
// //
getData() { getData() {
const { keyword } = this
this.$post(this.api.partnerOperatingList, { this.$post(this.api.partnerOperatingList, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
@ -99,8 +121,10 @@ export default {
classificationNameSort: this.classificationNameSort, classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort, editTimeSort: this.editTimeSort,
releaseDateSort: this.releaseDateSort, releaseDateSort: this.releaseDateSort,
title: this.keyword, typeId: 1, // (1.2.)
typeId: 1 // (1.2.) title: this.field === 'title' ? keyword : '',
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}).then(({ data }) => { }).then(({ data }) => {
data.records.forEach(e => { data.records.forEach(e => {
e.editing = false e.editing = false
@ -159,7 +183,7 @@ export default {
}, },
// //
add() { add() {
this.$router.push(`/learnMg`) this.$router.push(`/learnMg?type=1`)
}, },
// //
sortChange(column) { sortChange(column) {
@ -221,7 +245,7 @@ export default {
}, },
// //
edit(row) { edit(row) {
this.$router.push(`/learnMg?id=${row.id}`) this.$router.push(`/learnMg?id=${row.id}&type=1`)
}, },
} }
}; };

Loading…
Cancel
Save