地坪项目
This commit is contained in:
parent
d01a56caec
commit
6e46c063b9
|
@ -3,6 +3,6 @@ ENV = 'development'
|
|||
|
||||
# base api
|
||||
#VUE_APP_BASE_API = 'http://localhost:8000'
|
||||
VUE_APP_BASE_API = 'https://qw.ctc-zc.com/api'
|
||||
VUE_APP_BASE_API = 'https://dppz.ctc.ac.cn/api'
|
||||
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
|
|
@ -3,4 +3,4 @@ ENV = 'production'
|
|||
|
||||
# base api
|
||||
# VUE_APP_BASE_API = '/prod-api'
|
||||
VUE_APP_BASE_API = 'https://qw.ctc-zc.com/api'
|
||||
VUE_APP_BASE_API = 'https://dppz.ctc.ac.cn/api'
|
||||
|
|
|
@ -4,7 +4,7 @@ export function getArticleList(query) {
|
|||
return request({
|
||||
url: '/cms/article/',
|
||||
method: 'get',
|
||||
params:query
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function createArticle(data) {
|
||||
|
@ -24,19 +24,19 @@ export function updateArticle(id, data) {
|
|||
export function deleteArticle(id) {
|
||||
return request({
|
||||
url: `/cms/article/${id}/`,
|
||||
method: 'delete',
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
export function getArticle(id) {
|
||||
return request({
|
||||
url: `/cms/article/${id}/`,
|
||||
method: 'get',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export function topArticle(id) {
|
||||
return request({
|
||||
url: `/cms/article/${id}/top/`,
|
||||
method: 'put',
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ export function getMaterialList(query) {
|
|||
return request({
|
||||
url: '/cms/material/',
|
||||
method: 'get',
|
||||
params:query
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function createMaterial(data) {
|
||||
|
@ -72,7 +72,7 @@ export function getSourceList(query) {
|
|||
return request({
|
||||
url: '/cms/source/',
|
||||
method: 'get',
|
||||
params:query
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function createSource(data) {
|
||||
|
@ -100,7 +100,7 @@ export function getThresholdList(query) {
|
|||
return request({
|
||||
url: '/cms/threshold/',
|
||||
method: 'get',
|
||||
params:query
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function createThreshold(data) {
|
||||
|
@ -123,3 +123,60 @@ export function deleteThreshold(id) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
// 地坪项目优培企业
|
||||
export function getCompanyList(query) {
|
||||
return request({
|
||||
url: '/cms/company/',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function createCompany(data) {
|
||||
return request({
|
||||
url: '/cms/company/',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function updateCompany(id, data) {
|
||||
return request({
|
||||
url: `/cms/company/${id}/`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function deleteCompany(id) {
|
||||
return request({
|
||||
url: `/cms/company/${id}/`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function getChildcompanyList(query) {
|
||||
return request({
|
||||
url: '/cms/childcomany/',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function createChildcomany(data) {
|
||||
return request({
|
||||
url: '/cms/childcomany/',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function updateChildcomany(id, data) {
|
||||
return request({
|
||||
url: `/cms/childcomany/${id}/`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function deleteChildcomany(id) {
|
||||
return request({
|
||||
url: `/cms/childcomany/${id}/`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ export const constantRoutes = [
|
|||
* asyncRoutes
|
||||
* the routes that need to be dynamically loaded based on user perms
|
||||
*/
|
||||
// eslint-disable-next-line no-sparse-arrays
|
||||
export const asyncRoutes = [
|
||||
{
|
||||
path: '/',
|
||||
|
@ -57,7 +58,7 @@ export const asyncRoutes = [
|
|||
path: 'dashboard',
|
||||
name: 'Dashboard',
|
||||
component: () => import('@/views/dashboard/index'),
|
||||
meta: { title: '首页', icon: 'dashboard', perms:['admin'] }
|
||||
meta: { title: '首页', icon: 'dashboard', perms: ['admin'] }
|
||||
}]
|
||||
},
|
||||
{
|
||||
|
@ -83,18 +84,37 @@ export const asyncRoutes = [
|
|||
path: 'news/create',
|
||||
name: 'NewsCreate',
|
||||
component: () => import('@/views/news/newscreate.vue'),
|
||||
meta: { title: '新建文章', noCache: true, icon: '', perms: ['news_create']},
|
||||
meta: { title: '新建文章', noCache: true, icon: '', perms: ['news_create'] },
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'news/update',
|
||||
name: 'NewsUpdate',
|
||||
component: () => import('@/views/news/newsupdate.vue'),
|
||||
meta: { title: '编辑文章', noCache: true, icon: '', perms: ['news_update']},
|
||||
meta: { title: '编辑文章', noCache: true, icon: '', perms: ['news_update'] },
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
// youpei 是只针对地坪项目新建的菜单
|
||||
{
|
||||
path: '/youpei',
|
||||
component: Layout,
|
||||
redirect: '/youpei/index',
|
||||
name: 'Youpei',
|
||||
meta: { title: '优培企业', icon: 'documentation', perms: ['youpei_view'] },
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
name: 'youpeiList',
|
||||
component: () => import('@/views/youpei/index.vue'),
|
||||
meta: { title: '优培企业', icon: 'documentation', perms: ['youpei_view'] }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
path: '/vod',
|
||||
component: Layout,
|
||||
|
@ -155,7 +175,7 @@ export const asyncRoutes = [
|
|||
component: Layout,
|
||||
redirect: '/Qmanage/question',
|
||||
name: 'Qmanage',
|
||||
meta: { title: '题库管理', icon: 'table'},
|
||||
meta: { title: '题库管理', icon: 'table' },
|
||||
children: [
|
||||
{
|
||||
path: 'subject',
|
||||
|
@ -179,14 +199,14 @@ export const asyncRoutes = [
|
|||
path: 'question/create',
|
||||
name: 'CreateQuestion',
|
||||
component: () => import('@/views/question/questioncreate.vue'),
|
||||
meta: { title: '新建题目', noCache: true, icon: '', perms: ['question_create']},
|
||||
meta: { title: '新建题目', noCache: true, icon: '', perms: ['question_create'] },
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'question/update',
|
||||
name: 'UpdateQuestion',
|
||||
component: () => import('@/views/question/questionupdate.vue'),
|
||||
meta: { title: '编辑题目', noCache: true, icon: '', perms: ['question_update']},
|
||||
meta: { title: '编辑题目', noCache: true, icon: '', perms: ['question_update'] },
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
|
@ -196,19 +216,19 @@ export const asyncRoutes = [
|
|||
component: Layout,
|
||||
redirect: '/sjmanage/workscope',
|
||||
name: 'Sjmanage',
|
||||
meta: { title: '出卷管理', icon: 'component', perms: []},
|
||||
meta: { title: '出卷管理', icon: 'component', perms: [] },
|
||||
children: [
|
||||
{
|
||||
path: 'testrule',
|
||||
name: 'TestRule',
|
||||
component: () => import('@/views/examtest/rule.vue'),
|
||||
meta: { title: '试卷结构', icon: '', perms: ['testrule_manage'] },
|
||||
meta: { title: '试卷结构', icon: '', perms: ['testrule_manage'] }
|
||||
},
|
||||
{
|
||||
path: 'workscope',
|
||||
name: 'workscope',
|
||||
component: () => import('@/views/examtest/workscope.vue'),
|
||||
meta: { title: '工作类别', icon: '', perms: ['workscope_manage'] },
|
||||
meta: { title: '工作类别', icon: '', perms: ['workscope_manage'] }
|
||||
},
|
||||
{
|
||||
path: 'testpaper',
|
||||
|
@ -220,42 +240,42 @@ export const asyncRoutes = [
|
|||
path: 'testrule/create',
|
||||
name: 'CreateRule',
|
||||
component: () => import('@/views/examtest/rulecreate.vue'),
|
||||
meta: { title: '新建试卷结构', noCache: true, icon: '', perms: ['testrule_add']},
|
||||
meta: { title: '新建试卷结构', noCache: true, icon: '', perms: ['testrule_add'] },
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'testrule/update',
|
||||
name: 'UpdateRule',
|
||||
component: () => import('@/views/examtest/ruleupdate.vue'),
|
||||
meta: { title: '编辑试卷结构', noCache: true, icon: '', perms: ['testrule_update']},
|
||||
meta: { title: '编辑试卷结构', noCache: true, icon: '', perms: ['testrule_update'] },
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'workscope/create',
|
||||
name: 'CreateWorkscope',
|
||||
component: () => import('@/views/examtest/workscopecreate.vue'),
|
||||
meta: { title: '新建工作类别', noCache: true, icon: '', perms: ['workscope_add']},
|
||||
meta: { title: '新建工作类别', noCache: true, icon: '', perms: ['workscope_add'] },
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'workscope/update',
|
||||
name: 'UpdateWorkscope',
|
||||
component: () => import('@/views/examtest/workscopeupdate.vue'),
|
||||
meta: { title: '编辑工作类别', noCache: true, icon: '', perms: ['workscope_update']},
|
||||
meta: { title: '编辑工作类别', noCache: true, icon: '', perms: ['workscope_update'] },
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'paper/create',
|
||||
name: 'CreatePaper',
|
||||
component: () => import('@/views/examtest/papercreate.vue'),
|
||||
meta: { title: '新建押题试卷', noCache: true, icon: '', perms: ['paper_add']},
|
||||
meta: { title: '新建押题试卷', noCache: true, icon: '', perms: ['paper_add'] },
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'paper/update',
|
||||
name: 'UpdatePaper',
|
||||
component: () => import('@/views/examtest/paperupdate.vue'),
|
||||
meta: { title: '编辑押题试卷', noCache: true, icon: '', perms: ['paper_update']},
|
||||
meta: { title: '编辑押题试卷', noCache: true, icon: '', perms: ['paper_update'] },
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
|
@ -265,19 +285,19 @@ export const asyncRoutes = [
|
|||
component: Layout,
|
||||
redirect: '/exammanage/index',
|
||||
name: 'Exammanage',
|
||||
meta: { title: '考证管理', icon: 'component'},
|
||||
meta: { title: '考证管理', icon: 'component' },
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
name: 'exam',
|
||||
component: () => import('@/views/exam/index.vue'),
|
||||
meta: { title: '正式考试', perms: ['exam_view'] }
|
||||
meta: { title: '正式考试', perms: ['exam_view'] }
|
||||
},
|
||||
{
|
||||
path: 'issue',
|
||||
name: 'issue',
|
||||
component: () => import('@/views/exam/issue.vue'),
|
||||
meta: { title: '出证记录', perms: ['certificate_view'] }
|
||||
meta: { title: '出证记录', perms: ['certificate_view'] }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -286,13 +306,13 @@ export const asyncRoutes = [
|
|||
component: Layout,
|
||||
redirect: '/threshold/source',
|
||||
name: 'Threshold',
|
||||
meta: { title: '阈值库', icon: 'component'},
|
||||
meta: { title: '阈值库', icon: 'component', perms: ['threshold_view']},
|
||||
children: [
|
||||
{
|
||||
path: 'source',
|
||||
name: 'source',
|
||||
component: () => import('@/views/threshold/source.vue'),
|
||||
meta: { title: '阈值库', perms: ['threshold_view'] }
|
||||
meta: { title: '阈值库', perms: ['threshold_view'] }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -301,7 +321,7 @@ export const asyncRoutes = [
|
|||
component: Layout,
|
||||
redirect: '/analyse/examtest',
|
||||
name: 'Analyse',
|
||||
meta: { title: '统计分析', icon: 'chart', perms: ['examtest_view']},
|
||||
meta: { title: '统计分析', icon: 'chart', perms: ['examtest_view'] },
|
||||
children: [
|
||||
{
|
||||
path: 'examtest',
|
||||
|
@ -344,7 +364,7 @@ export const asyncRoutes = [
|
|||
component: Layout,
|
||||
redirect: '/system/admin',
|
||||
name: 'System',
|
||||
meta: { title: '系统管理', icon: 'tree', perms:[] },
|
||||
meta: { title: '系统管理', icon: 'tree', perms: [] },
|
||||
children: [
|
||||
{
|
||||
path: 'banner',
|
||||
|
@ -369,7 +389,7 @@ export const asyncRoutes = [
|
|||
name: 'Msg',
|
||||
component: () => import('@/views/system/msg'),
|
||||
meta: { title: '短信发送', icon: '', perms: ['msg_view'] }
|
||||
},
|
||||
}
|
||||
// {
|
||||
// path: 'user/password',
|
||||
// name: 'ChangePassword',
|
||||
|
@ -385,15 +405,15 @@ export const asyncRoutes = [
|
|||
redirect: '/changepassword',
|
||||
name: 'ChangePW',
|
||||
meta: { title: '修改密码', icon: 'tree' },
|
||||
hidden:true,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'ChangePassword',
|
||||
component: () => import('@/views/system/changepassword'),
|
||||
meta: { title: '修改密码', noCache: true, icon: ''},
|
||||
meta: { title: '修改密码', noCache: true, icon: '' },
|
||||
hidden: true
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
// 404 page must be placed at the end !!!
|
||||
|
|
|
@ -302,11 +302,11 @@ this.$confirm("确认删除该考试记录吗?将丢失数据!", "警告", {
|
|||
}else{
|
||||
this.listQuery.ordering = '-' + val.prop
|
||||
}
|
||||
|
||||
|
||||
this.getList()
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -38,12 +38,18 @@
|
|||
<el-table-column label="姓名">
|
||||
<template slot-scope="scope">{{ scope.row.consumer_name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="性别">
|
||||
<template slot-scope="scope">{{ scope.row.gender }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="身份证号">
|
||||
<template slot-scope="scope">{{ scope.row.ID_number }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作类别">
|
||||
<template slot-scope="scope">{{ scope.row.workscope_name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="职业等级">
|
||||
<template slot-scope="scope">{{ scope.row.opllevel }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位">
|
||||
<template slot-scope="scope">{{ scope.row.company_name }}</template>
|
||||
</el-table-column>
|
||||
|
@ -118,6 +124,9 @@
|
|||
<el-form-item label="姓名" prop="consumer_name">
|
||||
<el-input v-model="candidate.consumer_name" placeholder="姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-input v-model="candidate.gender" placeholder="性别" />
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证号" prop="ID_number">
|
||||
<el-input v-model="candidate.ID_number" placeholder="身份证号" />
|
||||
</el-form-item>
|
||||
|
@ -127,12 +136,11 @@
|
|||
placeholder="工作类别"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单位" prop="company_name">
|
||||
<el-input v-model="candidate.company_name" placeholder="单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门" prop="deptname">
|
||||
<el-input v-model="candidate.deptname" placeholder="部门" />
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发证日期" prop="issue_date">
|
||||
|
@ -167,23 +175,18 @@
|
|||
value-format="yyyy-MM-dd"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="照片" prop="photo">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
:action="upUrl"
|
||||
accept="image/jpeg, image/gif, image/png, image/bmp"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:headers="upHeaders"
|
||||
>
|
||||
<img
|
||||
v-if="candidate.photo"
|
||||
:src="candidate.photo"
|
||||
class="avatar"
|
||||
>
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon" />
|
||||
</el-upload>
|
||||
<el-form-item label="职业等级" prop="opllevel">
|
||||
<el-select v-model="candidate.opllevel" placeholder="职业等级" style="width:80%">
|
||||
<el-option
|
||||
v-for="item in typeOption"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="部门" prop="deptname">
|
||||
<el-input v-model="candidate.deptname" placeholder="部门" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -202,10 +205,10 @@
|
|||
width="1000px"
|
||||
title="证书查看"
|
||||
>
|
||||
<el-card shadow="never" style="width:100%;height:100%;background-color: black;">
|
||||
<el-image :src="src" style="width:531px;height:809;margin:10px 230px" />
|
||||
<el-card shadow="never" style="width:100%;height:100%;background-color: black;">
|
||||
<el-image :src="src" style="width:531px;height:809;margin:10px 230px" />
|
||||
|
||||
</el-card>
|
||||
</el-card>
|
||||
|
||||
<div style="text-align: right">
|
||||
<el-button type="danger" @click="dialogVisibleissue = false">取消</el-button>
|
||||
|
@ -276,7 +279,15 @@ export default {
|
|||
candidate: { photo: '' },
|
||||
candidateRule: {
|
||||
number: [{ required: true, message: '请输入编号', trigger: 'blur' }]
|
||||
}
|
||||
},
|
||||
typeOption:[
|
||||
{ name: '初级工', value: '初级工' },
|
||||
{ name: '中级工', value: '中级工'},
|
||||
{ name: '高级工', value: '高级工' },
|
||||
{ name: '技师', value: '技师'},
|
||||
{ name: '高级技师', value: '高级技师' }
|
||||
],
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
|
@ -322,19 +333,16 @@ export default {
|
|||
},
|
||||
// 气味分析证书展示
|
||||
handleDialogissue(scope) {
|
||||
if(scope.row.photo==null)
|
||||
{
|
||||
this.$message({
|
||||
if (scope.row.photo == null) {
|
||||
this.$message({
|
||||
message: '请先点击编辑上传证书人员照片!',
|
||||
type: 'warning'
|
||||
});
|
||||
})
|
||||
} else {
|
||||
this.dialogVisibleissue = true
|
||||
this.src = 'https://qw.ctc-zc.com' + scope.row.path
|
||||
this.name = scope.row.workscope_name
|
||||
}
|
||||
else{
|
||||
this.dialogVisibleissue = true
|
||||
this.src = 'https://qw.ctc-zc.com' + scope.row.path
|
||||
this.name = scope.row.workscope_name
|
||||
}
|
||||
|
||||
},
|
||||
handleAdd() {
|
||||
this.dialogVisible = true
|
||||
|
@ -375,11 +383,11 @@ export default {
|
|||
},
|
||||
// 下载证书
|
||||
downCandidate() {
|
||||
var a = document.createElement('a');
|
||||
a.href = this.src ;
|
||||
a.download = this.src ;
|
||||
a.target="_blank"
|
||||
a.click()
|
||||
var a = document.createElement('a')
|
||||
a.href = this.src
|
||||
a.download = this.src
|
||||
a.target = '_blank'
|
||||
a.click()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -199,4 +199,4 @@ export default {
|
|||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<!-- <img class="logo" src="../../assets/logo.png" /> -->
|
||||
</div>
|
||||
<div class="title-container">
|
||||
<h3 class="title">中科辐射小程序后台管理</h3>
|
||||
<h3 class="title">小程序后台管理</h3>
|
||||
</div>
|
||||
<el-form-item prop="username">
|
||||
<span class="svg-container">
|
||||
|
|
|
@ -1,125 +1,126 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<el-input
|
||||
v-model="listQuery.search"
|
||||
placeholder="名称/描述"
|
||||
style="width: 300px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="handleFilter"
|
||||
/>
|
||||
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">搜索</el-button>
|
||||
<el-button
|
||||
class="filter-item"
|
||||
style="margin-left: 10px;"
|
||||
type="primary"
|
||||
icon="el-icon-refresh-left"
|
||||
@click="resetFilter"
|
||||
>刷新重置</el-button>
|
||||
</div>
|
||||
<div style="margin-top:6px">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleCreate('文档')">文档</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleCreate('视频')">视频</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="materialList.results"
|
||||
style="width: 100%;margin-top:10px;"
|
||||
border
|
||||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
max-height="600"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="名称">
|
||||
<template slot-scope="scope">
|
||||
<el-link
|
||||
type="primary"
|
||||
:href="scope.row.path"
|
||||
target="_blank"
|
||||
v-if="scope.row.path"
|
||||
>{{ scope.row.name }}</el-link>
|
||||
<span v-else>{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="资源类型">
|
||||
<template slot-scope="scope">{{ scope.row.type }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上传时间">
|
||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分类" prop="cate"></el-table-column>
|
||||
<el-table-column align="header-center" label="排序码">
|
||||
<template slot-scope="scope">{{ scope.row.sort }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="header-center" label="下载量/播放量">
|
||||
<template slot-scope="scope">{{ scope.row.down_count }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-edit"
|
||||
:disabled="!checkPermission(['material_update'])"
|
||||
@click="handleUpdate(scope)"
|
||||
/>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
icon="el-icon-delete"
|
||||
:disabled="!checkPermission(['material_delete'])"
|
||||
@click="handleDelete(scope)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="materialList.count>0"
|
||||
:total="materialList.count"
|
||||
:page.sync="listQuery.page"
|
||||
:limit.sync="listQuery.limit"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisible"
|
||||
:title="dialogType==='update'?'编辑':'新增'"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form
|
||||
ref="Form"
|
||||
:model="material"
|
||||
label-width="80px"
|
||||
label-position="right"
|
||||
:rules="rule1"
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div style="margin-top: 10px;">
|
||||
<el-input
|
||||
v-model="listQuery.search"
|
||||
placeholder="名称/描述"
|
||||
style="width: 300px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="handleFilter"
|
||||
/>
|
||||
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">搜索</el-button>
|
||||
<el-button
|
||||
class="filter-item"
|
||||
style="margin-left: 10px;"
|
||||
type="primary"
|
||||
icon="el-icon-refresh-left"
|
||||
@click="resetFilter"
|
||||
>刷新重置</el-button>
|
||||
</div>
|
||||
<div style="margin-top:10px">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleCreate('文档')">文档</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleCreate('视频')">视频</el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="materialList.results"
|
||||
style="width: 100%;margin-top:30px;"
|
||||
border
|
||||
max-height="600"
|
||||
>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="material.name" placeholder="名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="material.description" placeholder="描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分类" prop="cate">
|
||||
<el-select
|
||||
v-model="material.cate"
|
||||
placeholder="所属分类"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in cateData"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="名称">
|
||||
<template slot-scope="scope">
|
||||
<el-link
|
||||
v-if="scope.row.path"
|
||||
type="primary"
|
||||
:href="scope.row.path"
|
||||
target="_blank"
|
||||
>{{ scope.row.name }}</el-link>
|
||||
<span v-else>{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="资源类型">
|
||||
<template slot-scope="scope">{{ scope.row.type }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上传时间">
|
||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分类" prop="cate" />
|
||||
<el-table-column align="header-center" label="排序码">
|
||||
<template slot-scope="scope">{{ scope.row.sort }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="header-center" label="下载量/播放量">
|
||||
<template slot-scope="scope">{{ scope.row.down_count }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-edit"
|
||||
:disabled="!checkPermission(['material_update'])"
|
||||
@click="handleUpdate(scope)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="description">
|
||||
<el-input-number v-model="material.sort" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="封面" prop="poster" v-if="material.type=='视频'">
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
icon="el-icon-delete"
|
||||
:disabled="!checkPermission(['material_delete'])"
|
||||
@click="handleDelete(scope)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="materialList.count>0"
|
||||
:total="materialList.count"
|
||||
:page.sync="listQuery.page"
|
||||
:limit.sync="listQuery.limit"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-main>
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisible"
|
||||
:title="dialogType==='update'?'编辑':'新增'"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form
|
||||
ref="Form"
|
||||
:model="material"
|
||||
label-width="80px"
|
||||
label-position="right"
|
||||
:rules="rule1"
|
||||
>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="material.name" placeholder="名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="material.description" placeholder="描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分类" prop="cate">
|
||||
<el-select
|
||||
v-model="material.cate"
|
||||
placeholder="所属分类"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in cateData"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="description">
|
||||
<el-input-number v-model="material.sort" :min="1" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="封面" prop="poster" v-if="material.type=='视频'">
|
||||
<el-upload
|
||||
accept=".png, .jpeg, .jpg"
|
||||
:before-upload="beforeUploadP"
|
||||
|
@ -133,20 +134,20 @@
|
|||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="material.type=='文档'?'文件':'视频'" prop="path" v-if="dialogVisible">
|
||||
<el-upload
|
||||
v-if="material.type=='文档'"
|
||||
:on-preview="handlePreview"
|
||||
:on-success="handleSuccess"
|
||||
:action="upUrl"
|
||||
:headers="upHeaders"
|
||||
:limit="1"
|
||||
:file-list="fileList"
|
||||
accept=".pdf, .doc, .docx"
|
||||
>
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
<!-- <el-upload
|
||||
<el-form-item v-if="dialogVisible" :label="material.type=='文档'?'文件':'视频'" prop="path">
|
||||
<el-upload
|
||||
v-if="material.type=='文档'"
|
||||
:on-preview="handlePreview"
|
||||
:on-success="handleSuccess"
|
||||
:action="upUrl"
|
||||
:headers="upHeaders"
|
||||
:limit="1"
|
||||
:file-list="fileList"
|
||||
accept=".pdf, .doc, .docx"
|
||||
>
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
<!-- <el-upload
|
||||
v-else
|
||||
class="avatar-uploader"
|
||||
:action="upUrl"
|
||||
|
@ -174,17 +175,18 @@
|
|||
></el-progress>
|
||||
</el-upload>
|
||||
<div >请保证视频格式正确,且不超过100M</div> -->
|
||||
<el-input v-else v-model="material.path" placeholder="腾讯视频地址" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-input v-else v-model="material.path" placeholder="腾讯视频地址" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div style="text-align:right;">
|
||||
<el-button type="danger" @click="dialogVisible=false">取消</el-button>
|
||||
<el-button type="primary" @click="confirm('Form')">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<div style="text-align:right;">
|
||||
<el-button type="danger" @click="dialogVisible=false">取消</el-button>
|
||||
<el-button type="primary" @click="confirm('Form')">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
|
@ -215,20 +217,20 @@ import {
|
|||
getMaterialList,
|
||||
createMaterial,
|
||||
updateMaterial,
|
||||
deleteMaterial,
|
||||
} from "@/api/cms";
|
||||
import { upUrl, upHeaders } from "@/api/file";
|
||||
import Pagination from "@/components/Pagination";
|
||||
import checkPermission from "@/utils/permission";
|
||||
deleteMaterial
|
||||
} from '@/api/cms'
|
||||
import { upUrl, upHeaders } from '@/api/file'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import checkPermission from '@/utils/permission'
|
||||
const defaultmaterial = {
|
||||
id: null,
|
||||
name: null,
|
||||
description: null,
|
||||
path: null,
|
||||
poster: null,
|
||||
type: "文档",
|
||||
cate:null,
|
||||
};
|
||||
type: '文档',
|
||||
cate: null
|
||||
}
|
||||
export default {
|
||||
components: { Pagination },
|
||||
data() {
|
||||
|
@ -240,143 +242,143 @@ export default {
|
|||
listLoading: true,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
limit: 20
|
||||
},
|
||||
cateData:['标准文件','文献','指南'],
|
||||
cateData: ['标准文件', '文献', '指南'],
|
||||
dialogVisible: false,
|
||||
dialogType: "create",
|
||||
dialogType: 'create',
|
||||
rule1: {
|
||||
name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
|
||||
path: [{ required: true, message: "请上传文件", trigger: "blur" }],
|
||||
cate: [{ required: true, message: "请选择文件分类", trigger: "blur" }],
|
||||
name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
|
||||
path: [{ required: true, message: '请上传文件', trigger: 'blur' }],
|
||||
cate: [{ required: true, message: '请选择文件分类', trigger: 'blur' }]
|
||||
},
|
||||
fileList: [],
|
||||
videoFlag:false,
|
||||
upVideoPercent:0
|
||||
};
|
||||
videoFlag: false,
|
||||
upVideoPercent: 0
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
this.listLoading = true
|
||||
getMaterialList(this.listQuery).then((response) => {
|
||||
if (response.data) {
|
||||
this.materialList = response.data;
|
||||
this.materialList = response.data
|
||||
}
|
||||
this.listLoading = false;
|
||||
});
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
resetFilter() {
|
||||
this.listQuery = {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
};
|
||||
this.getList();
|
||||
limit: 20
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
handleFilter() {
|
||||
this.listQuery.page = 1;
|
||||
this.getList();
|
||||
this.listQuery.page = 1
|
||||
this.getList()
|
||||
},
|
||||
handleDelete(scope) {
|
||||
deleteMaterial(scope.row.id).then((res) => {
|
||||
this.getList();
|
||||
});
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
handleCreate(val) {
|
||||
this.material = Object.assign({}, defaultmaterial);
|
||||
this.material.type = val;
|
||||
this.fileList = [];
|
||||
this.dialogType = "create";
|
||||
this.dialogVisible = true;
|
||||
this.material = Object.assign({}, defaultmaterial)
|
||||
this.material.type = val
|
||||
this.fileList = []
|
||||
this.dialogType = 'create'
|
||||
this.dialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs["Form"].clearValidate();
|
||||
});
|
||||
this.$refs['Form'].clearValidate()
|
||||
})
|
||||
},
|
||||
handleUpdate(scope) {
|
||||
this.material = Object.assign({}, scope.row); // copy obj
|
||||
this.material = Object.assign({}, scope.row) // copy obj
|
||||
if (this.material.path) {
|
||||
this.fileList = [
|
||||
{
|
||||
name:
|
||||
this.material.name +
|
||||
"." +
|
||||
this.material.path.split(".")[
|
||||
this.material.path.split(".").length - 1
|
||||
'.' +
|
||||
this.material.path.split('.')[
|
||||
this.material.path.split('.').length - 1
|
||||
],
|
||||
url: this.material.path,
|
||||
},
|
||||
];
|
||||
url: this.material.path
|
||||
}
|
||||
]
|
||||
}
|
||||
this.dialogType = "update";
|
||||
this.dialogVisible = true;
|
||||
this.dialogType = 'update'
|
||||
this.dialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs["Form"].clearValidate();
|
||||
});
|
||||
this.$refs['Form'].clearValidate()
|
||||
})
|
||||
},
|
||||
handlePreview(file) {
|
||||
if ("url" in file) {
|
||||
window.open(file.url);
|
||||
if ('url' in file) {
|
||||
window.open(file.url)
|
||||
} else {
|
||||
window.open(file.response.data.path);
|
||||
window.open(file.response.data.path)
|
||||
}
|
||||
},
|
||||
beforeUploadP(file) {
|
||||
const isLt1M = file.size / 1024 / 1024 < 1;
|
||||
const isLt1M = file.size / 1024 / 1024 < 1
|
||||
if (!isLt1M) {
|
||||
this.$message.error("上传封面大小不能超过 1MB!");
|
||||
this.$message.error('上传封面大小不能超过 1MB!')
|
||||
}
|
||||
return isLt1M;
|
||||
return isLt1M
|
||||
},
|
||||
beforeUploadV(file) {
|
||||
const isLt1M = file.size / 1024 / 1024 < 100;
|
||||
const isLt1M = file.size / 1024 / 1024 < 100
|
||||
if (!isLt1M) {
|
||||
this.$message.error("上传视频大小不能超过 100MB!");
|
||||
this.$message.error('上传视频大小不能超过 100MB!')
|
||||
}
|
||||
return isLt1M;
|
||||
return isLt1M
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
this.material.path = response.data.path;
|
||||
this.material.path = response.data.path
|
||||
},
|
||||
handleSuccessV(response, file, fileList) {
|
||||
this.videoFlag = false
|
||||
this.material.path = response.data.path;
|
||||
this.material.path = response.data.path
|
||||
},
|
||||
handleSuccessP(response, file, fileList) {
|
||||
this.material.poster = response.data.path;
|
||||
this.material.poster = response.data.path
|
||||
},
|
||||
upVideoProgess(event, file, fileList){
|
||||
this.videoFlag = true;
|
||||
this.upVideoPercent = file.percentage.toFixed(0);
|
||||
upVideoProgess(event, file, fileList) {
|
||||
this.videoFlag = true
|
||||
this.upVideoPercent = file.percentage.toFixed(0)
|
||||
},
|
||||
async confirm(form) {
|
||||
this.$refs[form].validate((valid) => {
|
||||
if (valid) {
|
||||
const isEdit = this.dialogType === "update";
|
||||
const isEdit = this.dialogType === 'update'
|
||||
if (isEdit) {
|
||||
updateMaterial(this.material.id, this.material).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.getList()
|
||||
this.dialogVisible = false
|
||||
this.$message.success('成功')
|
||||
}
|
||||
});
|
||||
})
|
||||
} else {
|
||||
createMaterial(this.material)
|
||||
.then((res) => {
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.getList()
|
||||
this.dialogVisible = false
|
||||
this.$message.success('成功')
|
||||
})
|
||||
.catch((error) => {});
|
||||
.catch((error) => {})
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
<el-table-column align="left" label="标题">
|
||||
<template slot-scope="scope">{{ scope.row.title }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="文章类型">
|
||||
<template slot-scope="scope">{{ type_[scope.row.type] }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="来源">
|
||||
<template slot-scope="scope">{{ scope.row.ifrom }}</template>
|
||||
</el-table-column>
|
||||
|
@ -107,10 +110,13 @@ export default {
|
|||
components: { Pagination },
|
||||
data() {
|
||||
return {
|
||||
type_: {1:"技能大赛",2:"铺装工匠",3:"培训信息",4:"大赛信息"},
|
||||
|
||||
listQuery: Object.assign({}, listQuery),
|
||||
tableData: {
|
||||
count:0,
|
||||
results:[],
|
||||
|
||||
},
|
||||
listLoading: true,
|
||||
};
|
||||
|
|
|
@ -1,66 +1,83 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<el-form
|
||||
:model="Form"
|
||||
:rules="rules"
|
||||
ref="Form"
|
||||
label-width="100px"
|
||||
status-icon
|
||||
>
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="Form.title" style="width: 80%"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源" prop="ifrom">
|
||||
<el-input v-model="Form.ifrom" style="width: 80%"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="外部链接" prop="elink" >
|
||||
<el-input v-model="Form.elink" style="width: 80%"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="内容" prop="content" v-show="is_show">
|
||||
<tinymce v-model="Form.content" :height="400" width="80%"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm('Form')" :loading="submitLoding">立即创建</el-button>
|
||||
<el-button type="warning" @click="goBack()">返回</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-form
|
||||
ref="Form"
|
||||
:model="Form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
status-icon
|
||||
>
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="Form.title" style="width: 80%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文章类型">
|
||||
<el-select v-model="Form.type" placeholder="文章类型" style="width:80%">
|
||||
<el-option
|
||||
v-for="item in typeOption"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源" prop="ifrom">
|
||||
<el-input v-model="Form.ifrom" style="width: 80%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="外部链接" prop="elink">
|
||||
<el-input v-model="Form.elink" style="width: 80%" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-show="is_show" label="内容" prop="content">
|
||||
<tinymce v-model="Form.content" :height="400" width="80%" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" :loading="submitLoding" @click="submitForm('Form')">立即创建</el-button>
|
||||
<el-button type="warning" @click="goBack()">返回</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Tinymce from '@/components/Tinymce'
|
||||
import {createArticle} from "@/api/cms";
|
||||
import { createArticle } from '@/api/cms'
|
||||
|
||||
export default {
|
||||
name: 'TinymceDemo',
|
||||
components: { Tinymce },
|
||||
data() {
|
||||
return {
|
||||
Form:{
|
||||
title:'',
|
||||
ifrom:'',
|
||||
elink:'',
|
||||
content:''
|
||||
typeOption: [
|
||||
{ name: '技能大赛', value: 1 },
|
||||
{ name: '铺装工匠', value: 2 },
|
||||
{ name: '培训信息', value: 3 },
|
||||
{ name: '大赛信息', value: 4 }
|
||||
],
|
||||
Form: {
|
||||
title: '',
|
||||
ifrom: '',
|
||||
elink: '',
|
||||
content: ''
|
||||
},
|
||||
submitLoding: false,
|
||||
rules: {
|
||||
title: [
|
||||
{ required: true, message: "请输入", trigger: "blur" }
|
||||
{ required: true, message: '请输入', trigger: 'blur' }
|
||||
],
|
||||
ifrom: [
|
||||
{ required: true, message: "请输入", trigger: "blur" }
|
||||
],
|
||||
{ required: true, message: '请输入', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
is_show: true
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'Form.elink':'showEditor'
|
||||
watch: {
|
||||
'Form.elink': 'showEditor'
|
||||
},
|
||||
methods:{
|
||||
methods: {
|
||||
goBack() {
|
||||
this.$router.go(-1)
|
||||
},
|
||||
|
@ -68,28 +85,26 @@ export default {
|
|||
this.$refs[formName].validate(valid => {
|
||||
if (valid) {
|
||||
// this.submitLoding = true
|
||||
createArticle(this.Form).then(response => {
|
||||
this.submitLoding = false
|
||||
if(response.code >= 200){
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "新建成功!"
|
||||
});
|
||||
this.goBack()
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
createArticle(this.Form).then(response => {
|
||||
this.submitLoding = false
|
||||
if (response.code >= 200) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '新建成功!'
|
||||
})
|
||||
this.goBack()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
showEditor(){
|
||||
if(this.Form.elink){
|
||||
showEditor() {
|
||||
if (this.Form.elink) {
|
||||
this.Form.content = ''
|
||||
this.is_show = false
|
||||
}else{
|
||||
} else {
|
||||
this.is_show = true
|
||||
}
|
||||
}
|
||||
|
@ -97,5 +112,3 @@ export default {
|
|||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -11,6 +11,16 @@
|
|||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="Form.title" style="width: 80%"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文章类型">
|
||||
<el-select v-model="Form.type" placeholder="文章类型" style="width:80%">
|
||||
<el-option
|
||||
v-for="item in typeOption"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源" prop="ifrom">
|
||||
<el-input v-model="Form.ifrom" style="width: 80%"></el-input>
|
||||
</el-form-item>
|
||||
|
@ -25,7 +35,7 @@
|
|||
<el-button type="warning" @click="goBack()">返回</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -45,6 +55,12 @@ export default {
|
|||
elink:'',
|
||||
content:''
|
||||
},
|
||||
typeOption: [
|
||||
{ name: '技能大赛', value: 1 },
|
||||
{ name: '铺装工匠', value: 2 },
|
||||
{ name: '培训信息', value: 3 },
|
||||
{ name: '大赛信息', value: 4 }
|
||||
],
|
||||
submitLoding: false,
|
||||
rules: {
|
||||
title: [
|
||||
|
@ -81,8 +97,8 @@ export default {
|
|||
});
|
||||
this.goBack()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div style="margin-top:10px" >
|
||||
地坪技能大赛详细信心
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
|
@ -0,0 +1,339 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-card style=" height:750px">
|
||||
<div style="margin-top:10px">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="tableData.results"
|
||||
style="width: 100%;margin-top:10px;"
|
||||
border
|
||||
stripe
|
||||
fit
|
||||
highlight-current-row
|
||||
max-height="600"
|
||||
@row-click="sourceRowClick"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column align="left" width="230" label="企业名称">
|
||||
<template slot-scope="scope">{{ scope.row.company_name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="教育工匠总积分">
|
||||
<template slot-scope="scope">{{ scope.row.edu_points }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="协办大赛总积分">
|
||||
<template slot-scope="scope">{{ scope.row.co_sponsor_points }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="企业总积分">
|
||||
<template slot-scope="scope">{{ scope.row.edu_points+scope.row.co_sponsor_points }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-edit"
|
||||
:disabled="!checkPermission(['article_update'])"
|
||||
@click="handleEdit(scope)"
|
||||
/>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
icon="el-icon-delete"
|
||||
:disabled="!checkPermission(['article_delete'])"
|
||||
@click="handleDelete(scope)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog :visible.sync="dialogVisible" :title="dialogType==='edit'?'编辑信息':'新增信息'">
|
||||
<el-form
|
||||
ref="commonForm"
|
||||
:model="companydata"
|
||||
label-width="120px"
|
||||
label-position="right"
|
||||
:rules="rule1"
|
||||
>
|
||||
<el-form-item label="企业名称" prop="company_name">
|
||||
<el-input v-model="companydata.company_name " placeholder="企业名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="教育工匠总积分" prop="edu_points">
|
||||
<el-input-number v-model="companydata.edu_points " />
|
||||
</el-form-item>
|
||||
<el-form-item label="协办大赛总积分" prop="co_sponsor_points">
|
||||
<el-input-number v-model="companydata.co_sponsor_points " />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="text-align:right;">
|
||||
<el-button type="danger" @click="dialogVisible=false">取消</el-button>
|
||||
<el-button type="primary" @click="confirmcompany('commonForm')">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<pagination
|
||||
v-show="tableData.count>0"
|
||||
:total="tableData.count"
|
||||
:page.sync="listQuery.page"
|
||||
:limit.sync="listQuery.limit"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-card style="height:750px">
|
||||
<div style="margin-top:10px">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd2">新增</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="tableData2.results"
|
||||
style="width: 100%;margin-top:10px;"
|
||||
border
|
||||
stripe
|
||||
fit
|
||||
highlight-current-row
|
||||
max-height="600"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column align="left" label="企业名称">
|
||||
<template slot-scope="scope">{{ scope.row.parent_company_name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="教育工匠积分">
|
||||
<template slot-scope="scope">{{ scope.row.child_edu_points }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="协办大赛积分">
|
||||
<template slot-scope="scope">{{ scope.row.child_co_sponsor_points }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="创建时间">
|
||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
icon="el-icon-delete"
|
||||
:disabled="!checkPermission(['article_delete'])"
|
||||
@click="handleDelete(scope)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog :visible.sync="dialogVisible2" :title="dialogType2==='edit'?'编辑信息':'新增信息'">
|
||||
<el-form
|
||||
ref="commonForm2"
|
||||
:model="childCompy"
|
||||
label-width="120px"
|
||||
label-position="right"
|
||||
:rules="rule1"
|
||||
>
|
||||
<el-form-item label="企业名称" prop="child_edu_points">
|
||||
<el-select
|
||||
v-model="childCompy.parent_company "
|
||||
placeholder="请选择企业名称"
|
||||
style="width:400px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in companyOption"
|
||||
:key="item.id"
|
||||
:label="item.company_name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="教育工匠积分" prop="child_edu_points">
|
||||
<el-input v-model.number="childCompy.child_edu_points" placeholder="教育工匠积分" />
|
||||
</el-form-item>
|
||||
<el-form-item label="协办大赛积分" prop="child_co_sponsor_points">
|
||||
<el-input v-model.number="childCompy.child_co_sponsor_points" placeholder="协办大赛积分" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="text-align:right;">
|
||||
<el-button type="danger" @click="dialogVisible2=false">取消</el-button>
|
||||
<el-button type="primary" @click="confirmchild('commonForm2')">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<pagination
|
||||
v-show="tableData2.count>0"
|
||||
:total="tableData2.count"
|
||||
:page.sync="listQuery2.page"
|
||||
:limit.sync="listQuery2.limit"
|
||||
@pagination="getList2"
|
||||
/>
|
||||
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCompanyList, createCompany, deleteCompany, updateCompany, getChildcompanyList, createChildcomany, deleteChildcomany, updateChildcomany } from '@/api/cms'
|
||||
import checkPermission from '@/utils/permission'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import { genTree, deepClone } from '@/utils'
|
||||
|
||||
const listQuery = {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
search: ''
|
||||
}
|
||||
const listQuery2 = {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
search: ''
|
||||
}
|
||||
export default {
|
||||
components: { Pagination },
|
||||
data() {
|
||||
return {
|
||||
listQuery: Object.assign({}, listQuery),
|
||||
listQuery2: Object.assign({}, listQuery2),
|
||||
tableData: [],
|
||||
tableData2: [],
|
||||
listLoading: true,
|
||||
dialogVisible: false,
|
||||
dialogType: 'new',
|
||||
dialogType2: 'new',
|
||||
dialogVisible2: false,
|
||||
childCompy: {},
|
||||
companydata: {},
|
||||
companyOption: []
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getList2()
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
getCompanyList(this.listQuery).then((response) => {
|
||||
this.tableData = response.data
|
||||
this.companyOption = genTree(response.data.results)
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
getList2() {
|
||||
this.listLoading = true
|
||||
getChildcompanyList(this.listQuery2).then((response) => {
|
||||
this.tableData2 = response.data
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
handleAdd() {
|
||||
this.companydata = {}
|
||||
this.dialogType = 'new'
|
||||
this.dialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['commonForm'].clearValidate()
|
||||
})
|
||||
},
|
||||
handleAdd2() {
|
||||
this.childCompy = {}
|
||||
this.dialogType2 = 'new'
|
||||
this.dialogVisible2 = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['commonForm2'].clearValidate()
|
||||
})
|
||||
},
|
||||
handleEdit(scope) {
|
||||
this.companydata = Object.assign({}, scope.row) // copy obj
|
||||
this.dialogType = 'edit'
|
||||
this.dialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['commonForm'].clearValidate()
|
||||
})
|
||||
},
|
||||
handleDelete(scope) {
|
||||
this.$confirm('确认删数据吗?将丢失数据!', '警告', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'error'
|
||||
})
|
||||
.then(async() => {
|
||||
await deleteCompany(scope.row.id)
|
||||
this.getList()
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '成功删除!'
|
||||
})
|
||||
})
|
||||
// eslint-disable-next-line handle-callback-err
|
||||
.catch(err => {
|
||||
// console.error(err);
|
||||
})
|
||||
},
|
||||
// 行单击事件
|
||||
sourceRowClick(row) {
|
||||
this.listQuery2.parent_company = row.id
|
||||
this.compayNameC = row.company_name
|
||||
this.getList2()
|
||||
},
|
||||
handleTop(scope) {
|
||||
|
||||
},
|
||||
//企业创建
|
||||
async confirmcompany(form) {
|
||||
this.$refs[form].validate(valid => {
|
||||
if (valid) {
|
||||
const isEdit = this.dialogType === 'edit'
|
||||
if (isEdit) {
|
||||
updateChildcomany(this.companydata.id, this.companydata).then(() => {
|
||||
this.getList()
|
||||
this.dialogVisible = false
|
||||
this.$message.success('成功')
|
||||
})
|
||||
} else {
|
||||
createCompany(this.companydata).then(res => {
|
||||
// this.exam = res.data
|
||||
// this.tableData.unshift(this.exam)
|
||||
this.getList()
|
||||
this.dialogVisible = false
|
||||
this.$message.success('成功')
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
//积分创建
|
||||
async confirmchild(form) {
|
||||
this.$refs[form].validate(valid => {
|
||||
if (valid) {
|
||||
const isEdit = this.dialogType2 === 'edit'
|
||||
if (isEdit) {
|
||||
updateCompany(this.childCompy.id, this.childCompy).then(() => {
|
||||
this.getList2()
|
||||
this.getList()
|
||||
this.dialogVisible2 = false
|
||||
this.$message.success('成功')
|
||||
})
|
||||
} else {
|
||||
createChildcomany(this.childCompy).then(res => {
|
||||
// this.exam = res.data
|
||||
// this.tableData.unshift(this.exam)
|
||||
this.getList2()
|
||||
this.getList()
|
||||
this.dialogVisible2 = false
|
||||
this.$message.success('成功')
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue