师资报名查看

main
lijingyu007 5 months ago
parent 28e27e03a7
commit d44268b783
  1. 2
      .env.development
  2. 2
      package.json
  3. 78
      src/components/jsonTool/index.vue
  4. 5
      src/main.js
  5. 11
      src/views/trainService/signlist.vue
  6. 68
      src/views/trainService/signupStudent.vue

@ -5,7 +5,7 @@ ENV = 'development'
VUE_APP_BASE_API = '/prod-api'
# VUE_APP_BASE_TARGET = 'http://www.bjkeyware.com/test-api'
VUE_APP_BASE_TARGET = 'http://192.168.0.229:9999'
VUE_APP_BASE_TARGET = 'http://192.168.0.129:9999'
# VUE_APP_BASE_TARGET = 'http://192.168.0.129:9999'
# VUE_APP_BASE_TARGET = 'http://172.16.36.180:9999'

@ -39,6 +39,7 @@
"@riophae/vue-treeselect": "0.4.0",
"axios": "^0.21.1",
"babel-polyfill": "^6.26.0",
"bin-code-editor": "^0.9.0",
"caniuse-lite": "^1.0.30001281",
"clipboard": "2.0.6",
"compression-webpack-plugin": "^5.0.1",
@ -89,7 +90,6 @@
"sass-loader": "^10.0.0",
"script-ext-html-webpack-plugin": "2.1.5",
"svg-sprite-loader": "5.1.1",
"vue-template-compiler": "2.6.12"
},
"engines": {

@ -0,0 +1,78 @@
<template>
<div style="width: 100%; margin-top: 30px">
<b-code-editor
v-model="jsonData"
:auto-format="true"
:smart-indent="true"
theme="dracula"
:indent-unit="4"
:line-wrap="false"
ref="editor"
></b-code-editor>
<br />
<!-- <el-button type="primary" @click="onSubumit">提交</el-button> -->
</div>
</template>
<script>
export default {
props: {
jsonData: {
type: String,
default: `[
{
"name": "姓名",
"key": "name",
"type": "input",
"value": ""
},
{
"title": "在校职务",
"key": "title",
"type": "input",
"value": ""
},
{
"mobile": "手机号",
"key": "mobile",
"type": "input",
"value": ""
}
]`,
},
},
data() {
return {
}
},
methods: {
// json
isJSON(str) {
if (typeof str == 'string') {
try {
var obj = JSON.parse(str)
if (typeof obj == 'object' && obj) {
return true
} else {
return false
}
} catch (e) {
return false
}
} else if (typeof str == 'object' && str) {
return true
}
},
onSubumit() {
if (!this.isJSON(this.jsonData)) {
this.$message.error(`json格式错误`)
return false
}
this.$message.success('json格式正确')
},
},
}
</script>
<style>
</style>

@ -32,6 +32,11 @@ import Distpicker from 'v-distpicker'
Vue.component('v-distpicker', Distpicker)
// json
import CodeEditor from 'bin-code-editor';
Vue.use(CodeEditor);
// json
// 防xss攻击
import Xss from 'xss'
Vue.prototype.Xss = Xss

@ -34,6 +34,7 @@
<el-option label="校企合作班" :value="0"></el-option>
<el-option label="线下培训进阶班" :value="1"></el-option>
<el-option label="可靠性人才培训班" :value="2"></el-option>
<el-option label="师资培训班" :value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item>
@ -131,6 +132,7 @@
<el-option label="校企合作班" :value="0"></el-option>
<el-option label="线下培训进阶班" :value="1"></el-option>
<el-option label="可靠性人才培训班" :value="2"></el-option>
<el-option label="师资培训班" :value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="培训教师" prop="teacherName">
@ -233,6 +235,8 @@
imageType="zip|rar"
/>
</el-form-item>
<!-- 编辑json -->
<JsonTool ref="jsontool" v-if="form.classType == 3"/>
<el-form-item style="padding-left: 170px">
<el-button
@ -276,6 +280,7 @@
@pagination="getStudentList"
/>
</el-dialog>
</div>
</template>
<script>
@ -291,9 +296,10 @@ import {
import ImageUpload from '@/components/ImgUpload/index.vue'
import NonimageUpload from '@/views/components/NonimageUpload'
// 1 2 3 4 5 status
import JsonTool from '@/components/jsonTool'
export default {
name: 'peixunbaoming',
components: { ImageUpload, NonimageUpload },
components: { ImageUpload, NonimageUpload, JsonTool },
data() {
return {
teacherList: [],
@ -348,6 +354,9 @@ export default {
mounted() {},
methods: {
// json
// json
//
async getTeacherList() {
const res = await listTeacherAll()
this.teacherList = res

@ -1,11 +1,6 @@
<template>
<div class="container" style="padding: 30px">
<el-form
:model="queryParamss"
ref="queryForm"
inline
label-width="68px"
>
<el-form :model="queryParamss" ref="queryForm" inline label-width="68px">
<el-form-item label="姓名" prop="studentName">
<el-input v-model="queryParamss.studentName" placeholder="请输入姓名" clearable size="small" />
</el-form-item>
@ -28,8 +23,7 @@
</el-form>
<!-- 详细学生信息弹层 -->
<el-table :data="studentList" v-loading="loading">
<el-table v-if="$route.query.type != 3" :data="studentList" v-loading="loading">
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="学号" align="center" prop="studentCode" v-if="$route.query.type == 0" />
<el-table-column label="姓名" align="center" prop="studentName" />
@ -49,6 +43,18 @@
</template>
</el-table-column>
</el-table>
<el-table v-else :data="teacherList" v-loading="loading">
<el-table-column label="序号" align="center" type="index" />
<el-table-column v-for="it in headerList" :key="it" :label="headerData[it]" align="center" :prop="it" />
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" v-if="scope.row.remark" @click="editRemark(scope.row)"
>修改备注</el-button
>
<el-button size="mini" type="text" v-else @click="addRemark(scope.row)">添加备注</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="totals > 0"
:total="totals"
@ -95,7 +101,7 @@ export default {
mobile: null,
majorName: null,
counsellor: null,
counsellorTel: null
counsellorTel: null,
},
totals: 0,
@ -108,6 +114,10 @@ export default {
remark: [{ required: true, message: '请输入备注', trigger: 'blur' }],
},
rowId: null,
teacherList: [], //
//
headerList: [],
headerData: {},
}
},
@ -117,8 +127,46 @@ export default {
methods: {
async getStudentList() {
this.loading = true
const res = await searchNum({ trainClassId: this.$route.query.id, ...this.queryParamss })
const res = await searchNum({
classType: this.$route.query.type,
trainClassId: this.$route.query.id,
...this.queryParamss,
})
if (this.$route.query.type == 3 && res.total > 0) {
// json
if (res.rows[0].data) {
this.headerList = []
this.headerData ={}
//
const firstData = JSON.parse(res.rows[0].data)
firstData.forEach((it) => {
//
this.headerList.push(it.key)
//
this.headerData[it.key] = it[it.key]
})
//
this.headerList.push('remark')
this.headerData.remark = '备注'
//
const newData = []
// --json
res.rows.forEach((item) => {
if (item.data) {
const obj = {}
JSON.parse(item.data).forEach((ite) => {
obj[ite.key] = ite.value
obj.trainingStudentId = item.trainingStudentId
obj.remark = item.remark
})
newData.push(obj)
}
})
this.teacherList = newData
}
} else {
this.studentList = res.rows
}
this.totals = res.total
this.loading = false
},

Loading…
Cancel
Save