Merge remote-tracking branch 'remotes/origin/feature/tek-system-ui' into skill
This commit is contained in:
commit
5b54371cfc
@ -8,7 +8,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title>学之思管理系统</title>
|
||||
<title>TEKSystem管理系统</title>
|
||||
<style>
|
||||
html {
|
||||
height: 100%;
|
||||
|
9
source/vue/xzs-admin/src/api/industry.js
Normal file
9
source/vue/xzs-admin/src/api/industry.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { post } from '@/utils/request'
|
||||
|
||||
export default {
|
||||
list: query => post('/api/admin/industry/list'),
|
||||
pageList: query => post('/api/admin/industry/page', query),
|
||||
edit: query => post('/api/admin/industry/edit', query),
|
||||
select: id => post('/api/admin/industry/select/' + id),
|
||||
deleteSubject: id => post('/api/admin/industry/delete/' + id)
|
||||
}
|
@ -24,7 +24,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title: '学之思管理系统'
|
||||
title: 'TEKSystem管理系统'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -184,6 +184,19 @@ const constantRoutes = [
|
||||
name: 'EducationSubjectEditPage',
|
||||
meta: { title: 'skill编辑', noCache: true, activeMenu: '/education/subject/list' },
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'industry/list',
|
||||
component: () => import('@/views/education/industry/list'),
|
||||
name: 'EducationIndustryPage',
|
||||
meta: { title: 'industry列表', noCache: true }
|
||||
},
|
||||
{
|
||||
path: 'industry/edit',
|
||||
component: () => import('@/views/education/industry/edit'),
|
||||
name: 'EducationIndustryEditPage',
|
||||
meta: { title: 'industry编辑', noCache: true, activeMenu: '/education/industry/list' },
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
88
source/vue/xzs-admin/src/views/education/industry/edit.vue
Normal file
88
source/vue/xzs-admin/src/views/education/industry/edit.vue
Normal file
@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-form :model="form" ref="form" label-width="100px" v-loading="formLoading">
|
||||
<el-form-item label="industry:" required>
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="年级:" required>
|
||||
<el-select v-model="form.level" placeholder="年级">
|
||||
<el-option v-for="item in levelEnum" :key="item.key" :value="item.key" :label="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
<el-button @click="resetForm">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters, mapState, mapActions } from 'vuex'
|
||||
import subjectApi from '@/api/subject'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
form: {
|
||||
id: null,
|
||||
name: '',
|
||||
level: 1,
|
||||
levelName: ''
|
||||
},
|
||||
formLoading: false
|
||||
}
|
||||
},
|
||||
created () {
|
||||
let id = this.$route.query.id
|
||||
let _this = this
|
||||
if (id && parseInt(id) !== 0) {
|
||||
_this.formLoading = true
|
||||
subjectApi.select(id).then(re => {
|
||||
_this.form = re.response
|
||||
_this.formLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitForm () {
|
||||
let _this = this
|
||||
this.formLoading = true
|
||||
this.form.levelName = this.enumFormat(this.levelEnum, this.form.level)
|
||||
subjectApi.edit(this.form).then(data => {
|
||||
if (data.code === 1) {
|
||||
_this.$message.success(data.message)
|
||||
_this.delCurrentView(_this).then(() => {
|
||||
_this.$router.push('/education/industry/list')
|
||||
})
|
||||
} else {
|
||||
_this.$message.error(data.message)
|
||||
_this.formLoading = false
|
||||
}
|
||||
}).catch(e => {
|
||||
_this.formLoading = false
|
||||
})
|
||||
},
|
||||
resetForm () {
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = {
|
||||
id: null,
|
||||
name: '',
|
||||
level: 1,
|
||||
levelName: ''
|
||||
}
|
||||
},
|
||||
...mapActions('tagsView', { delCurrentView: 'delCurrentView' })
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('enumItem', [
|
||||
'enumFormat'
|
||||
]),
|
||||
...mapState('enumItem', {
|
||||
levelEnum: state => state.user.levelEnum
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
93
source/vue/xzs-admin/src/views/education/industry/list.vue
Normal file
93
source/vue/xzs-admin/src/views/education/industry/list.vue
Normal file
@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParam" ref="queryForm" :inline="true">
|
||||
<el-form-item label="年级:">
|
||||
<el-select v-model="queryParam.level" placeholder="年级" clearable="">
|
||||
<el-option v-for="item in levelEnum" :key="item.key" :value="item.key" :label="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm">查询</el-button>
|
||||
<router-link :to="{path:'/education/industry/edit'}" class="link-left">
|
||||
<el-button type="primary">添加</el-button>
|
||||
</router-link>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%">
|
||||
<el-table-column prop="id" label="Id" />
|
||||
<el-table-column prop="name" label="industry"/>
|
||||
<el-table-column width="220px" label="操作" align="center">
|
||||
<template slot-scope="{row}">
|
||||
<router-link :to="{path:'/education/subject/edit', query:{id:row.id}}" class="link-left">
|
||||
<el-button size="mini">编辑</el-button>
|
||||
</router-link>
|
||||
<el-button size="mini" type="danger" @click="delSubject(row)" class="link-left">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParam.pageIndex" :limit.sync="queryParam.pageSize"
|
||||
@pagination="search"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters, mapState } from 'vuex'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import subjectApi from '@/api/subject'
|
||||
|
||||
export default {
|
||||
components: { Pagination },
|
||||
data () {
|
||||
return {
|
||||
queryParam: {
|
||||
level: null,
|
||||
pageIndex: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
listLoading: true,
|
||||
tableData: [],
|
||||
total: 0
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search () {
|
||||
this.listLoading = true
|
||||
subjectApi.pageList(this.queryParam).then(data => {
|
||||
const re = data.response
|
||||
this.tableData = re.list
|
||||
this.total = re.total
|
||||
this.queryParam.pageIndex = re.pageNum
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
submitForm () {
|
||||
this.queryParam.pageIndex = 1
|
||||
this.search()
|
||||
},
|
||||
delSubject (row) {
|
||||
let _this = this
|
||||
subjectApi.deleteSubject(row.id).then(re => {
|
||||
if (re.code === 1) {
|
||||
_this.search()
|
||||
_this.$message.success(re.message)
|
||||
} else {
|
||||
_this.$message.error(re.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('enumItem', [
|
||||
'enumFormat'
|
||||
]),
|
||||
...mapState('enumItem', {
|
||||
levelEnum: state => state.user.levelEnum
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -5,11 +5,11 @@
|
||||
<el-form-item label="skill:" required>
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="年级:" required>
|
||||
<!-- <el-form-item label="年级:" required>
|
||||
<el-select v-model="form.level" placeholder="年级">
|
||||
<el-option v-for="item in levelEnum" :key="item.key" :value="item.key" :label="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
<el-button @click="resetForm">重置</el-button>
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
<el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%">
|
||||
<el-table-column prop="id" label="Id" />
|
||||
<el-table-column prop="skill" label="skill"/>
|
||||
<el-table-column prop="industry" label="industry"/>
|
||||
<el-table-column prop="name" label="skill"/>
|
||||
<!-- <el-table-column prop="industry" label="industry"/> -->
|
||||
<!-- <el-table-column prop="levelName" label="年级" /> -->
|
||||
<el-table-column width="220px" label="操作" align="center">
|
||||
<template slot-scope="{row}">
|
||||
|
@ -3,7 +3,7 @@
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left">
|
||||
|
||||
<div class="title-container">
|
||||
<h3 class="title">学之思管理系统</h3>
|
||||
<h3 class="title">TekSystem管理系统</h3>
|
||||
</div>
|
||||
|
||||
<el-form-item prop="userName">
|
||||
|
Loading…
Reference in New Issue
Block a user