yujialong 10 months ago
parent 57f0f4ce83
commit 8ee53be060
  1. 2
      public/index.html
  2. 2
      src/pages/achievement/info/course.vue
  3. 6
      src/pages/achievement/info/project.vue
  4. 5
      src/pages/achievement/list/course.vue
  5. 3
      src/pages/achievement/list/project.vue
  6. 2
      src/pages/activity/details/index.vue
  7. 1
      src/pages/assessment/list/index.vue
  8. 483
      src/pages/course/list/courseManagement/index.vue
  9. 2
      src/pages/match/add/step1.vue
  10. 11
      src/pages/match/add/step2.vue
  11. 1
      src/pages/match/manage/matchInfo.vue
  12. 1
      src/pages/product/show/index.vue
  13. 5
      src/pages/screen/index.vue
  14. 92
      src/pages/system/list/index.vue
  15. 1152
      src/pages/system/list/staff.vue
  16. 559
      src/pages/system/list/staffSide.vue

@ -10,7 +10,7 @@
var _hmt = _hmt || []; var _hmt = _hmt || [];
(function() { (function() {
var hm = document.createElement('script'); var hm = document.createElement('script');
hm.src = 'https://hm.baidu.com/hm.js?72fbad6ebf1d6c705117fe8fe0686a0e'; hm.src = 'https://hm.baidu.com/hm.js?e4d7deeca2d6ea71d2bd5fa2365bc654';
var s = document.getElementsByTagName('script')[0]; var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(hm, s); s.parentNode.insertBefore(hm, s);
})(); })();

@ -3,7 +3,7 @@
<el-card shadow="hover" <el-card shadow="hover"
class="m-b-20 head-card"> class="m-b-20 head-card">
<div class="flex-between m-b-20"> <div class="flex-between m-b-20">
<el-page-header @back="$router.push('list?tab=tab1')" <el-page-header @back="$router.back()"
:content="goodsName"></el-page-header> :content="goodsName"></el-page-header>
</div> </div>
</el-card> </el-card>

@ -320,7 +320,8 @@ export default {
pageActivation: 1, pageActivation: 1,
pageSizeActivation: 10, pageSizeActivation: 10,
totalActivation: 0, totalActivation: 0,
loadIns: null loadIns: null,
scores: {}
}; };
}, },
components: { components: {
@ -378,6 +379,7 @@ export default {
this.errorAnalysis = res.errorAnalysis || {} this.errorAnalysis = res.errorAnalysis || {}
this.max = res.highestErrorRate || {} this.max = res.highestErrorRate || {}
this.min = res.minimumErrorRate || {} this.min = res.minimumErrorRate || {}
this.scores = res.getFractionalSegmentNum
this.getChart() this.getChart()
this.errorChart() this.errorChart()
} catch (e) { } catch (e) {
@ -531,7 +533,7 @@ export default {
getChart () { // 线 getChart () { // 线
const xData = Array.from({ length: 101 }, (v, k) => k) const xData = Array.from({ length: 101 }, (v, k) => k)
const yData = Array.from({ length: 101 }, (v, k) => 0) const yData = Array.from({ length: 101 }, (v, k) => 0)
const list = this.listDataAll const list = this.listData
list.map(n => { list.map(n => {
yData[n.score]++ yData[n.score]++
}) })

@ -166,7 +166,8 @@ export default {
path: 'list', path: 'list',
query: { query: {
...this.$route.query, ...this.$route.query,
keyword: val keyword: val,
page: 1
} }
}) })
this.initData(); this.initData();
@ -182,7 +183,7 @@ export default {
async getCourse () { async getCourse () {
const { data } = await this.$get(this.api.getSchoolEffectiveCourse) const { data } = await this.$get(this.api.getSchoolEffectiveCourse)
this.curs = data this.curs = data
this.initData(); this.getData();
}, },
// //
curChange (id) { curChange (id) {

@ -232,7 +232,8 @@ export default {
path: 'list', path: 'list',
query: { query: {
...this.$route.query, ...this.$route.query,
keyword: val keyword: val,
page: 1
} }
}) })
this.initData(); this.initData();

@ -447,7 +447,7 @@ export default {
.tool { .tool {
z-index: 100; z-index: 100;
position: sticky; position: sticky;
top: 64px; top: 0;
margin-bottom: 20px; margin-bottom: 20px;
background-color: #fff; background-color: #fff;
} }

@ -291,6 +291,7 @@ export default {
month: "", month: "",
}, },
mallId: '',
pageNum: +this.$route.query.page || 1, // pageNum: +this.$route.query.page || 1, //
pageSize: 10, // 10 pageSize: 10, // 10
total: 0, // total: 0, //

@ -1,233 +1,290 @@
<template> <template>
<!-- 课程管理 --> <!-- 课程管理 -->
<div style="padding-top: 24px"> <div style="padding-top: 24px">
<div class="tool"> <div class="tool">
<ul class="filter" style="align-items: flex-start"> <ul class="filter"
<li> style="align-items: flex-start">
<label>课程分类</label> <li>
<el-select v-model="categoryId" clearable placeholder="请选择课程分类" @change="initData"> <label>课程分类</label>
<el-option label="不限" value=""></el-option> <el-select v-model="categoryId"
<el-option v-for="(item,index) in classificationList" :key="index" :label="item.classificationName" :value="item.id"></el-option> clearable
</el-select> placeholder="请选择课程分类"
</li> @change="initData">
<li> <el-option label="不限"
<label>搜索</label> value=""></el-option>
<el-input placeholder="请输入课程名称/创建人" suffix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input> <el-option v-for="(item,index) in classificationList"
</li> :key="index"
</ul> :label="item.classificationName"
<div> :value="item.id"></el-option>
<el-button v-auth="'课程管理:新增'" type="info" round @click="addCourse">新增</el-button> </el-select>
<el-button v-auth="'课程管理:批量删除'" type="primary" round @click="delAllData">批量删除</el-button> </li>
</div> <li>
</div> <label>搜索</label>
<el-input placeholder="请输入课程名称/创建人"
suffix-icon="el-icon-search"
v-model="keyword"
clearable
size="small"></el-input>
</li>
</ul>
<div>
<el-button v-auth="'课程管理:新增'"
type="info"
round
@click="addCourse">新增</el-button>
<el-button v-auth="'课程管理:批量删除'"
type="primary"
round
@click="delAllData">批量删除</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table :data="list"
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column> class="table"
<el-table-column type="index" width="100" label="序号" align="center"> ref="table"
<template slot-scope="scope"> stripe
{{ scope.$index + (page - 1) * pageSize + 1 }} header-align="center"
</template> @selection-change="handleSelectionChange"
</el-table-column> row-key="id">
<el-table-column prop="courseName" label="课程名称" align="center"> <el-table-column type="selection"
</el-table-column> width="80"
<el-table-column prop="courseClassification" label="课程分类" align="center" show-overflow-tooltip> align="center"
</el-table-column> :reserve-selection="true"></el-table-column>
<el-table-column label="可见范围" align="center"> <el-table-column type="index"
<template slot-scope="scope"> width="100"
{{ regionName[scope.row.visibleRange] }} label="序号"
</template> align="center">
</el-table-column> <template slot-scope="scope">
<el-table-column prop="createTime" label="创建时间" align="center"> {{ scope.$index + (page - 1) * pageSize + 1 }}
</el-table-column> </template>
<el-table-column prop="founder" label="创建人" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="courseName"
<el-table-column label="操作" align="center" width="250"> label="课程名称"
<template slot-scope="scope"> align="center">
<el-button v-auth="'课程管理:编辑信息'" type="text" @click="editCourse(scope.row)">编辑信息</el-button> </el-table-column>
<el-divider v-auth="'课程管理:编辑信息'" direction="vertical"></el-divider> <el-table-column prop="courseClassification"
<el-button v-auth="'课程管理:内容设置'" type="text" @click="config(scope.row)">内容设置</el-button> label="课程分类"
<el-divider v-auth="'课程管理:内容设置'" direction="vertical"></el-divider> align="center"
<el-button v-auth="'课程管理:预览'" type="text" @click="preview(scope.row)">预览</el-button> show-overflow-tooltip>
<el-divider v-auth="'课程管理:预览'" direction="vertical"></el-divider> </el-table-column>
<el-button v-auth="'课程管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> <el-table-column label="可见范围"
</template> align="center">
</el-table-column> <template slot-scope="scope">
<el-table-column label="可授权状态" align="center" width="120"> {{ regionName[scope.row.visibleRange] }}
<template slot-scope="scope"> </template>
<!-- 列表展示中台的禁启用依据zt_open展示职站的禁启用依据is_open展示 --> </el-table-column>
<!-- 中台禁用了这个学校发布的学校这边还能看到但是学校这边不能启用 --> <el-table-column prop="createTime"
<el-switch label="创建时间"
v-auth="'课程管理:禁用'" align="center">
v-model="scope.row.isOpen" </el-table-column>
:active-value="0" <el-table-column prop="founder"
:inactive-value="1" label="创建人"
style="margin: 0 10px 0 5px" align="center">
:active-text="scope.row.isOpen ? '关' : '开'" </el-table-column>
@change="switchOff($event,scope.row,scope.$index)" <el-table-column label="操作"
></el-switch> align="center"
</template> width="250">
</el-table-column> <template slot-scope="scope">
</el-table> <el-button v-auth="'课程管理:编辑信息'"
<div class="pagination"> type="text"
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"> @click="editCourse(scope.row)">编辑信息</el-button>
</el-pagination> <el-divider v-auth="'课程管理:编辑信息'"
</div> direction="vertical"></el-divider>
<el-button v-auth="'课程管理:内容设置'"
type="text"
@click="config(scope.row)">内容设置</el-button>
<el-divider v-auth="'课程管理:内容设置'"
direction="vertical"></el-divider>
<el-button v-auth="'课程管理:预览'"
type="text"
@click="preview(scope.row)">预览</el-button>
<el-divider v-auth="'课程管理:预览'"
direction="vertical"></el-divider>
<el-button v-auth="'课程管理:删除'"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="可授权状态"
align="center"
width="120">
<template slot-scope="scope">
<!-- 列表展示中台的禁启用依据zt_open展示职站的禁启用依据is_open展示 -->
<!-- 中台禁用了这个学校发布的学校这边还能看到但是学校这边不能启用 -->
<el-switch v-auth="'课程管理:禁用'"
v-model="scope.row.isOpen"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
:active-text="scope.row.isOpen ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
</div> </div>
</div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import Setting from '@/setting' import Setting from '@/setting'
export default { export default {
name: "courseManagement", name: "courseManagement",
data() { data () {
return { return {
regionName: ['本校内', '全平台可见', '指定院校区域'], regionName: ['本校内', '全平台可见', '指定院校区域'],
timer: null, timer: null,
keyword: "", keyword: "",
categoryId: '', categoryId: '',
list: [], list: [],
multipleSelection: [], multipleSelection: [],
classificationList: [], classificationList: [],
page: +this.$route.query.page || 1, // page: +this.$route.query.page || 1, //
pageSize: 10, pageSize: 10,
total: 0 total: 0
}; };
}, },
watch: { watch: {
keyword: function(val) { keyword: function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData(); this.initData();
}, 500); }, 500);
}
},
mounted () {
this.getClassification();
this.getData();
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
})
},
methods: {
getList () {
this.$post(this.api.listTheoreticalCourse, {
pageNum: this.page,
pageSize: this.pageSize,
keyWord: this.keyword,
createPlatform: 1,
platformSource: Setting.platformSource,
categoryId: this.categoryId
}).then(({ page }) => {
this.list = page.records;
//:
//
// 使
//1.
page.records.map(e => {
if (e.ztOpen) e.isOpen = 1
})
this.total = page.total;
if (!this.list.length && this.total) {
this.page--;
this.getData();
} }
}).catch(res => {
});
},
// redis
getRedis () {
this.$post(this.api.getRedisCache).then(({ data }) => {
data && this.getList()
}).catch(res => { })
},
getData () {
this.getList()
// if (!Setting.isDev) {
// clearInterval(this.timer)
// this.timer = setInterval(this.getRedis, 1000)
// }
}, },
mounted() { initData () {
this.getClassification(); this.page = 1;
this.getData(); this.getData();
this.$once('hook:beforeDestroy', function() { },
clearInterval(this.timer) getClassification () {
this.$post(this.api.listClassification, {
pageNum: 1,
pageSize: 1000,
platformSource: Setting.platformSource
}).then(({ page }) => {
this.classificationList = page.records
}).catch(res => { })
},
preview (row) {
this.$router.push(`/course/preview?id=${row.id}`);
},
config (row) {
this.$router.push(`/course/contentSettings?id=${row.id}`);
},
addCourse () {
this.$router.push("/course/add");
},
editCourse (row) {
this.$router.push(`/course/add?id=${row.id}`);
},
handleDelete (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
}) })
.then(() => {
this.$post(`${this.api.delTheoreticalCourse}?ids=${row.id}`).then(res => {
util.successMsg("删除成功");
this.initData();
}).catch(res => {
});
})
.catch(() => {
});
},
handleSelectionChange (val) {
this.multipleSelection = val;
}, },
methods: { delAllData () {
getList() { const list = this.multipleSelection
this.$post(this.api.listTheoreticalCourse, { if (list.length != "") {
pageNum: this.page, this.$confirm(`确定要删除吗?`, "提示", {
pageSize: this.pageSize, type: "warning"
keyWord: this.keyword, })
createPlatform: 1, .then(() => {
platformSource: Setting.platformSource, const data = []
categoryId: this.categoryId list.map(e => {
}).then(({ page }) => { data.push('ids=' + e.id)
this.list = page.records; })
//: this.$post(`${this.api.delTheoreticalCourse}?${data.join('&')}`).then(res => {
// this.$refs.table.clearSelection();
// 使 util.successMsg("删除成功");
//1. this.initData();
page.records.map(e => {
if (e.ztOpen) e.isOpen = 1
})
this.total = page.total;
if (!this.list.length && this.total) {
this.page--;
this.getData();
}
}).catch(res => { }).catch(res => {
}); });
}, }).catch(() => {
// redis });
getRedis() { } else {
this.$post(this.api.getRedisCache).then(({ data }) => { util.errorMsg("请先选择数据 !");
data && this.getList() }
}).catch(res => {}) },
}, handleCurrentChange (val) {
getData() { this.page = val;
this.getList() this.$router.push(`list?page=${val}`)
if (!Setting.isDev) { this.getData();
clearInterval(this.timer) },
this.timer = setInterval(this.getRedis, 1000) switchOff (val, row) {
} this.$post(this.api.disabledTheoreticalCourse, {
}, courseId: row.id,
initData() { isOpen: val,
this.page = 1; type: 1 // (01)
this.getData(); }).then(res => {
}, val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功')
getClassification() { }).catch(err => { })
this.$post(this.api.listClassification, {
pageNum: 1,
pageSize: 1000,
platformSource: Setting.platformSource
}).then(({ page }) => {
this.classificationList = page.records
}).catch(res => {})
},
preview(row) {
this.$router.push(`/course/preview?id=${row.id}`);
},
config(row) {
this.$router.push(`/course/contentSettings?id=${row.id}`);
},
addCourse() {
this.$router.push("/course/add");
},
editCourse(row) {
this.$router.push(`/course/add?id=${row.id}`);
},
handleDelete(row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$post(`${this.api.delTheoreticalCourse}?ids=${row.id}`).then(res => {
util.successMsg("删除成功");
this.initData();
}).catch(res => {
});
})
.catch(() => {
});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delAllData() {
const list = this.multipleSelection
if (list.length != "") {
this.$confirm(`确定要删除吗?`, "提示", {
type: "warning"
})
.then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.delTheoreticalCourse}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.initData();
}).catch(res => {
});
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
handleCurrentChange(val) {
this.page = val;
this.$router.push(`list?page=${val}`)
this.getData();
},
switchOff(val, row) {
this.$post(this.api.disabledTheoreticalCourse, {
courseId: row.id,
isOpen: val,
type: 1 // (01)
}).then(res => {
val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功')
}).catch(err => {})
}
} }
}
}; };
</script> </script>

@ -696,7 +696,7 @@ export default {
this.$parent.showLoad() this.$parent.showLoad()
delete form.publishStatus delete form.publishStatus
if (status === 1) form.publishStatus = 1 if (status === 1) form.publishStatus = 1
form.isOpen = status ? 0 : 1 // form.ztOpen = status ? 0 : 1 //
form.releaseType = releaseType form.releaseType = releaseType
form.id = this.$route.query.id form.id = this.$route.query.id

@ -80,8 +80,7 @@
<span class="req">*</span> <span class="req">*</span>
团队参赛人数限制 团队参赛人数限制
<el-radio v-model="item.teamNumLimitOpt" <el-radio v-model="item.teamNumLimitOpt"
:label="0" :label="0">不限制</el-radio>
@change="item.teamNumLimit = 0">不限制</el-radio>
<el-radio v-model="item.teamNumLimitOpt" <el-radio v-model="item.teamNumLimitOpt"
:label="1">自定义</el-radio> :label="1">自定义</el-radio>
<el-input v-model.number="item.teamNumLimit" <el-input v-model.number="item.teamNumLimit"
@ -449,7 +448,7 @@ export default {
} }
e.resultAnnouncementTime = +e.resultAnnouncementTime e.resultAnnouncementTime = +e.resultAnnouncementTime
} }
if (e.teamNumLimit) teamNumLimit += e.teamNumLimit // if (e.teamNumLimitOpt && e.teamNumLimit) teamNumLimit += e.teamNumLimit //
} }
if (invalid) return if (invalid) return
if (form.teamLimit && competitionType) { if (form.teamLimit && competitionType) {
@ -461,9 +460,9 @@ export default {
} else { // 稿 } else { // 稿
form.competitionStageList = form.competitionStageList.filter(e => e.stageName) form.competitionStageList = form.competitionStageList.filter(e => e.stageName)
} }
for (const e of form.competitionStageList) { // for (const e of form.competitionStageList) {
if (!e.teamNumLimitOpt) e.teamNumLimit = 0 // if (!e.teamNumLimitOpt) e.teamNumLimit = 0
} // }
this.$parent.showLoad() this.$parent.showLoad()
this.pass = 1 this.pass = 1
if (form.ruleId) { if (form.ruleId) {

@ -435,7 +435,6 @@ export default {
status = 5; status = 5;
} }
this.status = status this.status = status
console.log("🚀 ~ file: matchInfo.vue:350 ~ handleStatus ~ status", status)
}, },
// //
edit (showMsg) { edit (showMsg) {

@ -533,6 +533,7 @@ export default {
margin-bottom: 15px; margin-bottom: 15px;
color: #333; color: #333;
font-size: 14px; font-size: 14px;
font-weight: 600;
} }
.sectionName { .sectionName {
position: relative; position: relative;

@ -772,7 +772,7 @@ export default {
sort: 0, sort: 0,
isShelves: 0, isShelves: 0,
hotTag: 1, hotTag: 1,
purchaseStatus: 1 purchaseStatus: this.token ? 1 : ''
}) })
if (cousrseRes) { if (cousrseRes) {
const courseList = cousrseRes.page.records const courseList = cousrseRes.page.records
@ -1063,6 +1063,8 @@ export default {
}], }],
yAxis: [{ yAxis: [{
type: 'value', type: 'value',
minInterval: 1,
min: 0,
axisTick: { axisTick: {
show: false show: false
}, },
@ -1072,6 +1074,7 @@ export default {
} }
}, },
axisLabel: { axisLabel: {
// interval: 5,
margin: 10, margin: 10,
textStyle: { textStyle: {
fontSize: 12, fontSize: 12,

@ -1,13 +1,18 @@
<template> <template>
<div class="page" style="padding: 0"> <div class="page"
<div class="tabs"> style="padding: 0">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a> <div class="tabs">
</div> <a class="item"
v-for="(item,index) in tabs"
<staff v-if="active == 'staff'"></staff> :key="index"
<role v-if="active == 'role'"></role> :class="{active: index == active}"
<logo v-if="active == 'logo'"></logo> @click="tabChange(index)">{{ item }}</a>
</div> </div>
<staff v-if="active == 'staff'"></staff>
<role v-if="active == 'role'"></role>
<logo v-if="active == 'logo'"></logo>
</div>
</template> </template>
<script> <script>
@ -17,46 +22,45 @@ import staff from "./staff";
import role from "./role"; import role from "./role";
import logo from "./logo"; import logo from "./logo";
export default { export default {
data() { data () {
return { return {
active: "staff", active: "staff",
tabs: { tabs: {
staff: "员工管理", staff: "教师管理",
role: "角色权限", role: "角色权限",
logo: "系统logo设置", logo: "系统logo设置",
}
};
},
computed: {
...mapState('auth', [
'btns'
])
},
components: {
staff,
role,
logo
},
created() {
Setting.dynamicRoute && this.initTabs()
},
methods: {
tabChange(index) {
this.active = index
},
initTabs() {
const { btns } = this
const tab1 = btns.includes('/system/list:员工管理')
const tab2 = btns.includes('/system/list:角色权限')
const tab3 = btns.includes('/system/list:系统logo设置')
tab1 || delete this.tabs.staff
tab2 || delete this.tabs.role
tab3 || delete this.tabs.logo
} }
};
},
computed: {
...mapState('auth', [
'btns'
])
},
components: {
staff,
role,
logo
},
created () {
Setting.dynamicRoute && this.initTabs()
},
methods: {
tabChange (index) {
this.active = index
},
initTabs () {
const { btns } = this
const tab1 = btns.includes('/system/list:员工管理')
const tab2 = btns.includes('/system/list:角色权限')
const tab3 = btns.includes('/system/list:系统logo设置')
tab1 || delete this.tabs.staff
tab2 || delete this.tabs.role
tab3 || delete this.tabs.logo
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>

File diff suppressed because it is too large Load Diff

@ -1,12 +1,14 @@
<template> <template>
<div>
<div> <div>
<div> <div class="flex-between m-b-20">
<div class="flex-between m-b-20"> <h6 class="p-title"
<h6 class="p-title" style="margin-bottom: 0">员工组织架构</h6> style="margin-bottom: 0">教师组织架构</h6>
<el-button type="text" @click="addMajor" v-auth="'员工管理:新增专业'">添加</el-button> <el-button type="text"
</div> @click="addMajor"
<org-tree v-auth="'员工管理:新增专业'">添加</el-button>
:data="orgList" </div>
<org-tree :data="orgList"
show-checkbox show-checkbox
default-expand-all default-expand-all
ref="orgTree" ref="orgTree"
@ -15,277 +17,294 @@
:expand-on-click-node="false" :expand-on-click-node="false"
@node-click="getSingle" @node-click="getSingle"
@check="getCheck" @check="getCheck"
:props="{children: 'children', label: 'label', isLeaf: 'leaf'}" :props="{children: 'children', label: 'label', isLeaf: 'leaf'}">
> <span class="custom-tree-node"
<span class="custom-tree-node" slot-scope="{ node, data }"> slot-scope="{ node, data }">
<span style="display: inline-block; margin-right: 20px">{{ node.label }}</span> <span style="display: inline-block; margin-right: 20px">{{ node.label }}</span>
<span> <span>
<el-button <el-button v-auth="'员工管理:新增专业'"
v-auth="'员工管理:新增专业'" type="text"
type="text" icon="el-icon-edit-outline"
icon="el-icon-edit-outline" @click="() => handleEdit(node, data)">
@click="() => handleEdit(node, data)"> </el-button>
</el-button> <el-button v-auth="'员工管理:编辑专业'"
<el-button v-if="node.level === 1"
v-auth="'员工管理:编辑专业'" type="text"
v-if="node.level === 1" icon="el-icon-circle-plus-outline"
type="text" @click="() => handleAdd(node, data)">
icon="el-icon-circle-plus-outline" </el-button>
@click="() => handleAdd(node, data)"> <el-button v-auth="'员工管理:删除专业'"
</el-button> type="text"
<el-button icon="el-icon-delete"
v-auth="'员工管理:删除专业'" @click="() => handleDel(node, data)">
type="text" </el-button>
icon="el-icon-delete" </span>
@click="() => handleDel(node, data)"> </span>
</el-button> </org-tree>
</span> </div>
</span>
</org-tree>
</div>
<el-dialog :title="Form.staffArchitectureId ? '编辑部门' : '新增部门'" :visible.sync="majorVisible" width="24%" center @close="closeAdd" :close-on-click-modal="false"> <el-dialog :title="Form.staffArchitectureId ? '编辑部门' : '新增部门'"
<el-form ref="Form" :model="Form" :rules="rules"> :visible.sync="majorVisible"
<el-form-item prop="staffArchitectureName"> width="24%"
<el-input placeholder="请输入部门名称" v-model="Form.staffArchitectureName"></el-input> center
</el-form-item> @close="closeAdd"
</el-form> :close-on-click-modal="false">
<span slot="footer" class="dialog-footer"> <el-form ref="Form"
<el-button @click="majorVisible = false"> </el-button> :model="Form"
<el-button type="primary" @click="sure('Form')"> </el-button> :rules="rules">
</span> <el-form-item prop="staffArchitectureName">
</el-dialog> <el-input placeholder="请输入部门名称"
v-model="Form.staffArchitectureName"></el-input>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer">
<el-button @click="majorVisible = false"> </el-button>
<el-button type="primary"
@click="sure('Form')"> </el-button>
</span>
</el-dialog>
<el-dialog :title="Form.gradeId ? '编辑部门' : '新增部门'" :visible.sync="depVisible" width="24%" center @close="closeAdd" :close-on-click-modal="false"> <el-dialog :title="Form.gradeId ? '编辑部门' : '新增部门'"
<el-form ref="Form1" :model="Form" :rules="rules"> :visible.sync="depVisible"
<el-form-item prop="gradeName"> width="24%"
<el-input placeholder="请输入部门名称" v-model="Form.gradeName"></el-input> center
</el-form-item> @close="closeAdd"
</el-form> :close-on-click-modal="false">
<span slot="footer" class="dialog-footer"> <el-form ref="Form1"
<el-button @click="depVisible = false"> </el-button> :model="Form"
<el-button type="primary" @click="sureDepartment('Form1')"> </el-button> :rules="rules">
</span> <el-form-item prop="gradeName">
</el-dialog> <el-input placeholder="请输入部门名称"
</div> v-model="Form.gradeName"></el-input>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer">
<el-button @click="depVisible = false"> </el-button>
<el-button type="primary"
@click="sureDepartment('Form1')"> </el-button>
</span>
</el-dialog>
</div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import OrgTree from "@/components/org-tree/src/tree"; import OrgTree from "@/components/org-tree/src/tree";
export default { export default {
props: ["Data"], props: ["Data"],
data() { data () {
return { return {
orgList: [], orgList: [],
firactive: 0, firactive: 0,
twoactive: 0, twoactive: 0,
majorVisible: false, majorVisible: false,
depVisible: false, depVisible: false,
Form: { Form: {
staffArchitectureId: "", // ID staffArchitectureId: "", // ID
staffArchitectureName: "", // // staffArchitectureName: "", // //
gradeId: "", gradeId: "",
gradeName: "" gradeName: ""
}, },
rules: { rules: {
staffArchitectureName: [ staffArchitectureName: [
{ required: true, message: "请输入部门名称", trigger: "blur" } { required: true, message: "请输入部门名称", trigger: "blur" }
], ],
gradeName: [ gradeName: [
{ required: true, message: "请输入部门名称", trigger: "blur" } { required: true, message: "请输入部门名称", trigger: "blur" }
] ]
}, },
staffstateProfessId: "", staffstateProfessId: "",
staffstateId: "", staffstateId: "",
}; };
},
components: {
OrgTree
},
mounted () {
this.getStaff()
},
methods: {
getStaff () {
this.$get(this.api.professionalList).then(res => {
if (res.data && res.data.length) {
res.data.map(e => {
(e.ifVisible = false), (e.ischeck = false), (e.label = e.staffArchitectureName), (e.id = e.staffArchitectureId);
let data = {
staffArchitectureId: e.staffArchitectureId
}
this.$get(this.api.staffGradeList, data).then(res => {
res.data.map(e => {
(e.ischeck = false), (e.label = e.gradeName), (e.id = e.gradeId)
})
e.children = res.data
}).catch(res => { })
});
}
setTimeout(() => {
this.orgList = res.data;
}, 500)
}).catch(res => { })
}, },
components: { closeAdd () {
OrgTree this.$refs.Form.resetFields()
}, },
mounted() { getSingle (data) {
this.getStaff() this.$emit('getSingle', data)
}, },
methods: { getCheck (data, checked) {
getStaff() { this.$emit('getCheck', checked.checkedNodes)
this.$get(this.api.professionalList).then(res => { },
if (res.data && res.data.length) { //
res.data.map(e => { addMajor () {
(e.ifVisible = false), (e.ischeck = false), (e.label = e.staffArchitectureName), (e.id = e.staffArchitectureId); this.Form.staffArchitectureId = ''
let data = { this.Form.staffArchitectureName = ''
staffArchitectureId: e.staffArchitectureId this.majorVisible = true
} },
this.$get(this.api.staffGradeList, data).then(res => { sure (Form) { // /
res.data.map(e => { this.$refs[Form].validate((valid) => {
(e.ischeck = false), (e.label = e.gradeName), (e.id = e.gradeId) if (valid) {
}) let data = {
e.children = res.data staffArchitectureName: this.Form.staffArchitectureName,
}).catch(res => {}) staffArchitectureId: this.Form.staffArchitectureId,
}); isDel: 0 // (0 1)
} };
setTimeout(() => { if (this.Form.staffArchitectureId) {
this.orgList = res.data; this.$post(this.api.updateProfessional, data).then(res => {
}, 500) util.successMsg("编辑成功");
}).catch(res => {}) this.majorVisible = false;
}, this.orgList.map(e => {
closeAdd() { if (e.staffArchitectureId == this.Form.staffArchitectureId) {
this.$refs.Form.resetFields() e.staffArchitectureName = this.Form.staffArchitectureName;
}, e.label = this.Form.staffArchitectureName;
getSingle(data) {
this.$emit('getSingle', data)
},
getCheck(data, checked) {
this.$emit('getCheck', checked.checkedNodes)
},
//
addMajor() {
this.Form.staffArchitectureId = ''
this.Form.staffArchitectureName = ''
this.majorVisible = true
},
sure(Form) { // /
this.$refs[Form].validate((valid) => {
if (valid) {
let data = {
staffArchitectureName: this.Form.staffArchitectureName,
staffArchitectureId: this.Form.staffArchitectureId,
isDel: 0 // (0 1)
};
if (this.Form.staffArchitectureId) {
this.$post(this.api.updateProfessional, data).then(res => {
util.successMsg("编辑成功");
this.majorVisible = false;
this.orgList.map(e => {
if (e.staffArchitectureId == this.Form.staffArchitectureId) {
e.staffArchitectureName = this.Form.staffArchitectureName;
e.label = this.Form.staffArchitectureName;
}
});
this.$emit("getData");
}).catch(res => {
});
} else {
this.$post(this.api.saveProfessional, data).then(res => {
util.successMsg("添加成功");
this.majorVisible = false;
this.getStaff()
// let newData = {
// staffArchitectureId: res.staffArchitectureId,
// staffArchitectureName: this.Form.staffArchitectureName,
// label: this.Form.staffArchitectureName,
// value: res.staffArchitectureId,
// ifVisible: false,
// ischeck: false,
// children: []
// };
// this.orgList.push(newData);
}).catch(res => {
});
}
} else {
return false;
} }
});
this.$emit("getData");
}).catch(res => {
}); });
}, } else {
handleAdd(node, data) { // this.$post(this.api.saveProfessional, data).then(res => {
this.Form.gradeId = '' util.successMsg("添加成功");
this.Form.gradeName = '' this.majorVisible = false;
this.depVisible = true this.getStaff()
this.Form.staffArchitectureId = data.staffArchitectureId // let newData = {
}, // staffArchitectureId: res.staffArchitectureId,
handleEdit(node, data) { // // staffArchitectureName: this.Form.staffArchitectureName,
if (node.level === 1) { // label: this.Form.staffArchitectureName,
this.Form.staffArchitectureId = data.staffArchitectureId // value: res.staffArchitectureId,
this.Form.staffArchitectureName = data.staffArchitectureName // ifVisible: false,
this.majorVisible = true // ischeck: false,
} else { // children: []
this.Form.gradeId = data.gradeId // };
this.Form.gradeName = data.gradeName // this.orgList.push(newData);
this.depVisible = true }).catch(res => {
}
for (let j = 0; j < this.orgList.length; j++) {
for (let k = 0; k < this.orgList[j].children.length; k++) {
if (this.orgList[j].children[k].gradeName == data.gradeName) {
this.Form.staffArchitectureId = this.orgList[j].staffArchitectureId;
}
}
}
},
sureDepartment(Form) { //
this.$refs[Form].validate((valid) => {
if (valid) {
let data = {
gradeId: this.Form.gradeId,
gradeName: this.Form.gradeName,
staffArchitectureId: this.Form.staffArchitectureId
};
if (this.Form.gradeId) {
this.$post(this.api.updateGrade, data).then(res => {
util.successMsg("编辑成功");
this.depVisible = false;
this.orgList.map(e => {
e.children.map(r => {
if (r.gradeId == this.Form.gradeId) {
r.gradeName = this.Form.gradeName;
r.label = this.Form.gradeName;
}
});
});
}).catch(res => {
});
} else {
this.$post(this.api.saveGrade, data).then(res => {
util.successMsg("添加成功");
this.depVisible = false;
this.getStaff()
// let newData = {
// gradeId: res.gradeId,
// gradeName: this.Form.gradeName,
// label: this.Form.gradeName,
// value: res.gradeId,
// ifVisible: false,
// ischeck: false
// };
// this.orgList.map(e => {
// if (e.staffArchitectureId == this.Form.staffArchitectureId) {
// e.ifVisible = true;
// e.children.push(newData);
// }
// });
}).catch(res => {
});
}
} else {
return false;
}
}); });
}, }
handleDel(node, data) { } else {
node.level === 1 ? this.delMajor(data) : this.delDepartment(data) return false;
},
delMajor(item) {
this.$confirm("确定要删除该专业吗?该操作将会删除该组织下的用户账号。", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteProfessional}?staffArchitectureId=${item.staffArchitectureId}`).then(res => {
util.successMsg("删除成功")
this.$emit("getData")
this.getStaff()
}).catch(res => {})
}).catch(() => {})
},
delDepartment(item) {
this.$confirm("确定要删除该部门吗?该操作将会删除该组织下的用户账号。", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteGrade}?gradeId=${item.gradeId}`).then(res => {
util.successMsg("删除成功")
this.getStaff()
this.$emit("delDep", item, this.orgList)
this.$emit("getData")
}).catch(res => {})
}).catch(() => {})
} }
});
},
handleAdd (node, data) { //
this.Form.gradeId = ''
this.Form.gradeName = ''
this.depVisible = true
this.Form.staffArchitectureId = data.staffArchitectureId
},
handleEdit (node, data) { //
if (node.level === 1) {
this.Form.staffArchitectureId = data.staffArchitectureId
this.Form.staffArchitectureName = data.staffArchitectureName
this.majorVisible = true
} else {
this.Form.gradeId = data.gradeId
this.Form.gradeName = data.gradeName
this.depVisible = true
}
for (let j = 0; j < this.orgList.length; j++) {
for (let k = 0; k < this.orgList[j].children.length; k++) {
if (this.orgList[j].children[k].gradeName == data.gradeName) {
this.Form.staffArchitectureId = this.orgList[j].staffArchitectureId;
}
}
}
},
sureDepartment (Form) { //
this.$refs[Form].validate((valid) => {
if (valid) {
let data = {
gradeId: this.Form.gradeId,
gradeName: this.Form.gradeName,
staffArchitectureId: this.Form.staffArchitectureId
};
if (this.Form.gradeId) {
this.$post(this.api.updateGrade, data).then(res => {
util.successMsg("编辑成功");
this.depVisible = false;
this.orgList.map(e => {
e.children.map(r => {
if (r.gradeId == this.Form.gradeId) {
r.gradeName = this.Form.gradeName;
r.label = this.Form.gradeName;
}
});
});
}).catch(res => {
});
} else {
this.$post(this.api.saveGrade, data).then(res => {
util.successMsg("添加成功");
this.depVisible = false;
this.getStaff()
// let newData = {
// gradeId: res.gradeId,
// gradeName: this.Form.gradeName,
// label: this.Form.gradeName,
// value: res.gradeId,
// ifVisible: false,
// ischeck: false
// };
// this.orgList.map(e => {
// if (e.staffArchitectureId == this.Form.staffArchitectureId) {
// e.ifVisible = true;
// e.children.push(newData);
// }
// });
}).catch(res => {
});
}
} else {
return false;
}
});
},
handleDel (node, data) {
node.level === 1 ? this.delMajor(data) : this.delDepartment(data)
},
delMajor (item) {
this.$confirm("确定要删除该专业吗?该操作将会删除该组织下的用户账号。", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteProfessional}?staffArchitectureId=${item.staffArchitectureId}`).then(res => {
util.successMsg("删除成功")
this.$emit("getData")
this.getStaff()
}).catch(res => { })
}).catch(() => { })
},
delDepartment (item) {
this.$confirm("确定要删除该部门吗?该操作将会删除该组织下的用户账号。", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteGrade}?gradeId=${item.gradeId}`).then(res => {
util.successMsg("删除成功")
this.getStaff()
this.$emit("delDep", item, this.orgList)
this.$emit("getData")
}).catch(res => { })
}).catch(() => { })
} }
}
}; };
</script> </script>
<style scoped> <style scoped>
@ -302,7 +321,7 @@ export default {
.side_icon i { .side_icon i {
cursor: pointer; cursor: pointer;
font-size: 20px; font-size: 20px;
color: #9278FF; color: #9278ff;
} }
.side_tree { .side_tree {
@ -312,7 +331,7 @@ export default {
} }
.side_tree i { .side_tree i {
color: #9278FF; color: #9278ff;
margin-left: 10px; margin-left: 10px;
} }
@ -339,7 +358,7 @@ export default {
} }
.two_active { .two_active {
color: #9278FF; color: #9278ff;
} }
/* .two_active:hover{ /* .two_active:hover{
@ -348,7 +367,7 @@ export default {
} */ } */
.two_back:hover { .two_back:hover {
cursor: pointer; cursor: pointer;
color: #9278FF; color: #9278ff;
} }
.mar_top { .mar_top {
@ -382,11 +401,13 @@ export default {
transform: rotate(180deg); transform: rotate(180deg);
} }
.list-enter-active, .list-leave-active { .list-enter-active,
.list-leave-active {
transition: all 1s; transition: all 1s;
} }
.list-enter, .list-leave-to { .list-enter,
.list-leave-to {
opacity: 0; opacity: 0;
transform: translateY(-30px); transform: translateY(-30px);
} }

Loading…
Cancel
Save