自定义字段

dev
lion 1 year ago
parent 10e350b0ca
commit 46345fd214

@ -33,6 +33,7 @@
"view-design": "^4.7.0",
"vue": "2.6.10",
"vue-count-to": "^1.0.13",
"vue-print-nb-jeecg": "^1.0.12",
"vue-router": "3.0.6",
"vuedraggable": "^2.24.3",
"vuex": "3.1.0",

@ -0,0 +1,56 @@
import request from "@/utils/request";
function customParamsSerializer(params) {
let result = '';
for (let key in params) {
if (params.hasOwnProperty(key)) {
if (Array.isArray(params[key])) {
params[key].forEach((item,index) => {
if(item.key){
result += `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`;
}else{
result +=`${key}[${index}]=${item}&`
}
});
} else {
result += `${key}=${params[key]}&`;
}
}
}
return result.slice(0, -1);
}
export function index(params,isLoading = false) {
return request({
method: "get",
url: "/api/admin/course-keeps/index",
params,
paramsSerializer: customParamsSerializer,
isLoading
})
}
export function show(params, isLoading = true) {
return request({
method: "get",
url: "/api/admin/course-keeps/show",
params,
isLoading
})
}
export function save(data) {
return request({
method: "post",
url: "/api/admin/course-keeps/save",
data
})
}
export function destroy(params) {
return request({
method: "get",
url: "/api/admin/course-keeps/destroy",
params
})
}

@ -2,7 +2,7 @@
export const templatePropsMap = new Map([
["text", {
readonly: true,
clearable: true
clearable: true,
}],
["richtext",'my-tinymce'],
['select', {

@ -52,6 +52,9 @@ Vue.use(avue)
import AvueMap from 'avue-plugin-map'
Vue.use(AvueMap);
import Print from 'vue-print-nb-jeecg'
Vue.use(Print);
Vue.directive('loadMore', {
bind(el, binding) {
const selectWrap = el.querySelector('.el-scrollbar__wrap')

@ -7,32 +7,32 @@ export default {
}, {
id: 1,
value: '是'
}],
apply_status_list:[{
}],
apply_status_list: [{
id: 0,
value: '待审核',
type:''
value: '待审核',
type: ''
}, {
id: 1,
value: '通过',
type:'success'
value: '通过',
type: 'success'
}, {
id: 2,
value: '驳回',
type:'warning'
}],
fee_status_list:[{
id: 0,
value: '待缴费'
}, {
id: 3,
value: '待确认'
}, {
id: 1,
value: '缴费成功'
}, {
id: 2,
value: '缴费失败'
value: '驳回',
type: 'warning'
}],
fee_status_list: [{
id: 0,
value: '待缴费'
}, {
id: 3,
value: '待确认'
}, {
id: 1,
value: '缴费成功'
}, {
id: 2,
value: '缴费失败'
}],
// 课程
course_type: [{
@ -83,31 +83,80 @@ export default {
}, {
id: 7,
value: '博士'
}],
company_type_list:[{
}],
company_type_list: [{
id: 0,
value: '上市公司'
}, {
id: 1,
value: '上市公司子公司'
}],
// 预约审核
book_status: [{
id: 0,
value: '待审核',
type: ''
}, {
id: 1,
value: '通过',
type: 'success'
}, {
id: 2,
value: '驳回',
type: 'warning'
}, {
id: 3,
value: '取消',
type: 'info'
}],
// 预约审核
book_status:[{
id:0,
value:'待审核',
type:''
// 考勤
keep_options:[{
id:'',
value:'全部'
},{
id:1,
value:'通过',
type:'success'
value:'正常'
},{
id:2,
value:'驳回',
type:'warning'
},{
id:3,
value:'取消',
type:'info'
id:0,
value:'缺勤'
}],
// 自定义表单的 固定字段
defaultFormList: [{
name: '姓名',
field: 'name',
rule: 'required',
edit_input: "text",
help: '基础字段'
}, {
name: '性别',
field: 'sex',
rule: 'required',
edit_input: "text",
help: '基础字段'
}, {
name: '出生日期',
field: 'birth',
rule: 'required',
edit_input: "text",
help: '基础字段'
}, {
name: '联系方式',
field: 'mobile',
rule: 'required',
edit_input: "text",
help: '基础字段'
}, {
name: '邮箱',
field: 'email',
rule: '',
edit_input: "text",
help: '基础字段'
}, {
name: '公司名称',
field: 'company',
rule: 'required',
edit_input: "text",
help: '基础字段'
}],
}
},

@ -1,200 +1,227 @@
<template>
<div>
<el-dialog :visible.sync="dialogVisible" title="数据导入" width="740px">
<div class="title">模板下载</div>
<el-button
style="margin-top: 10px"
size="small"
type="primary"
@click="exportExcel(new Date().getTime().toString())"
>模板下载</el-button
>
<div style="color: red; margin-top: 10px">
导入的时候请勿修改模版的标题名称
</div>
<el-upload
style="margin-top: 10px"
drag
:action="action"
:data="{
table_name: tableName,
course_id:course_id?course_id:''
}"
:headers="{
Authorization: `Bearer ${getToken()}`,
}"
:on-success="uploadSuccess"
:on-error="uploadFail"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">只能上传xls/xlsx文件</div>
</el-upload>
<div class="title" style="margin-top: 10px;">数据预览</div>
<Table :height="350" :data="tableList" :columns="table" style="margin-top: 10px;"></Table>
<div style="font-size: 12px;zoom: 0.8;">总共数据{{ tableList.length }}</div>
<el-button type="primary" size="small" style="margin-top: 10px;" @click="imports"></el-button>
</el-dialog>
</div>
</template>
<script>
import * as XLSX from "xlsx";
import { saveAs } from "file-saver";
import { getToken } from "@/utils/auth";
import { imports } from "@/api/system/baseForm";
import { realTableShow } from "@/api/system/customForm";
import request from '@/utils/request'
export default {
props: {
formInfo: {
type: Array,
default: () => [],
},
tableName: String,
course_id: String
},
data() {
return {
action: `${process.env.VUE_APP_BASE_API}/api/admin/base-form/excel-show`,
import_action:'',
dialogVisible: false,
headers: [],
tableList: [],
table: [],
};
},
methods: {
getToken,
show() {
this.dialogVisible = true;
},
hidden() {
this.dialogVisible = false;
},
//
async getHeaders(){
const res = await realTableShow({
table_name:this.tableName
})
let b = [];
for (let key in res) {
if (!this.base.isNull(res[key])) {
b.push({ key: key, title: res[key] });
<template>
<div>
<el-dialog :visible.sync="dialogVisible" title="数据导入" width="740px">
<div class="title">模板下载</div>
<el-button style="margin-top: 10px" size="small" type="primary"
@click="exportExcel(new Date().getTime().toString())">模板下载</el-button>
<div style="color: red; margin-top: 10px">
导入的时候请勿修改模版的标题名称
</div>
<el-upload style="margin-top: 10px" drag :action="action" :data="{
table_name: tableName,
course_id: course_id ? course_id : '',
...tableData
}" :headers="{
Authorization: `Bearer ${getToken()}`,
}" :on-success="uploadSuccess" :on-error="uploadFail">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">只能上传xls/xlsx文件</div>
</el-upload>
<div class="title" style="margin-top: 10px;">数据预览</div>
<Table :height="350" :data="tableList" :columns="table" style="margin-top: 10px;"></Table>
<div style="font-size: 12px;zoom: 0.8;">总共数据{{ tableList.length }}</div>
<el-button type="primary" size="small" style="margin-top: 10px;" @click="imports"></el-button>
</el-dialog>
</div>
</template>
<script>
import * as XLSX from "xlsx";
import {
saveAs
} from "file-saver";
import {
getToken
} from "@/utils/auth";
import {
imports
} from "@/api/system/baseForm";
import {
realTableShow
} from "@/api/system/customForm";
import request from '@/utils/request'
export default {
props: {
formInfo: {
type: Array,
default: () => [],
},
tableName: String,
course_id: String,
},
data() {
return {
action: `${process.env.VUE_APP_BASE_API}/api/admin/base-form/excel-show`,
import_action: '',
dialogVisible: false,
// keep_status
tableData: {},
headers: [],
tableList: [],
table: [],
};
},
methods: {
getToken,
show() {
this.dialogVisible = true;
},
hidden() {
this.dialogVisible = false;
},
//
async getHeaders() {
const res = await realTableShow({
table_name: this.tableName
})
let b = [];
for (let key in res) {
if (!this.base.isNull(res[key])) {
b.push({
key: key,
title: res[key]
});
}
}
//
if (this.tableName === 'course_contents') {
b.push({
key: '',
title: '老师简介'
});
b.map(item => {
if (item.key === 'teacher_id') {
item.key = 'teacher_name'
}
})
}
}
//
if(this.tableName==='course_contents'){
b.push({ key: '', title: '老师简介' });
b.map(item=>{
if(item.key==='teacher_id'){
item.key = 'teacher_name'
}
})
}
this.table = this.headers = b
console.log("table",this.table)
},
//
uploadFail(err) {
console.log(err);
this.$message({
message: "上传失败",
type: "error",
});
},
uploadSuccess(response) {
this.tableList = response;
this.$message({
message: `上传成功`,
type: "success",
});
},
exportExcel(sheetName) {
const data = [this.headers.map((header) => header.title)];
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, sheetName);
const wbout = XLSX.write(wb, {
bookType: "xlsx",
bookSST: true,
type: "array",
});
saveAs(
new Blob([wbout], { type: "application/octet-stream" }),
`${sheetName}.xlsx`
);
},
imports() {
request({
method: "post",
url: this.import_action,
data:{
table_name: this.tableName,
course_id:this.course_id?this.course_id:'',
data: this.tableList
//
if (this.tableName === 'course_keeps') {
b.map(item => {
if (item.key === 'user_id') {
item.key = 'user_name'
}
if(item.key==='status'){
item.key = 'status_name'
}
})
}
this.table = this.headers = b
},
//
uploadFail(err) {
console.log(err);
this.$message({
message: "上传失败",
type: "error",
});
},
uploadSuccess(response) {
if(this.tableName==='course_keeps'){
response.map(item=>{
console.log("item",item)
item.status_name = item.status===1?'正常':'缺勤'
})
}
}).then(res => {
console.log(res)
this.$message({
type: 'success',
message: `成功导入${res.total}`
})
this.hidden();
this.$emit('refresh')
})
}
},
computed: {},
watch: {
formInfo(newVal) {
if (newVal && newVal instanceof Array) {
this.table = this.headers = newVal.map((i) => {
return {
key: i.field,
title: i.name,
};
});
}
},
dialogVisible(newval){
console.log("newval",newval,this.tableName)
if(newval){
let changeTableName = this.tableName.replace('_','-')
this.action = `${process.env.VUE_APP_BASE_API}/api/admin/${changeTableName}/excel-show`
this.import_action = `/api/admin/${changeTableName}/import`
this.getHeaders()
console.log("action",this.action,this.import_action)
}
}
},
};
</script>
<style scoped lang="scss">
.title {
font-size: 15px;
font-weight: 600;
padding: 8px 4px;
position: relative;
&::before {
content: '';
width: 4px;
background: $primaryColor;
position: absolute;
top: 8px;
bottom: 8px;
left: -8px;
}
}
this.tableList = response;
this.$message({
message: `上传成功`,
type: "success",
});
},
exportExcel(sheetName) {
const data = [this.headers.map((header) => header.title)];
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, sheetName);
const wbout = XLSX.write(wb, {
bookType: "xlsx",
bookSST: true,
type: "array",
});
saveAs(
new Blob([wbout], {
type: "application/octet-stream"
}),
`${sheetName}.xlsx`
);
},
imports() {
request({
method: "post",
url: this.import_action,
data: {
table_name: this.tableName,
course_id: this.course_id ? this.course_id : '',
data: this.tableList
}
}).then(res => {
console.log(res)
this.$message({
type: 'success',
message: `成功导入${res.total}`
})
this.hidden();
this.$emit('refresh')
})
}
},
computed: {},
watch: {
formInfo(newVal) {
if (newVal && newVal instanceof Array) {
this.table = this.headers = newVal.map((i) => {
return {
key: i.field,
title: i.name,
};
});
}
},
dialogVisible(newval) {
console.log("newval", newval, this.tableName)
if (newval) {
let changeTableName = this.tableName.replace('_', '-')
this.action = `${process.env.VUE_APP_BASE_API}/api/admin/${changeTableName}/excel-show`
this.import_action = `/api/admin/${changeTableName}/import`
this.getHeaders()
console.log("action", this.action, this.import_action)
} else {
this.tableList = []
this.table = []
this.headers = []
this.tableData = []
}
}
},
};
</script>
<style scoped lang="scss">
.title {
font-size: 15px;
font-weight: 600;
padding: 8px 4px;
position: relative;
&::before {
content: '';
width: 4px;
background: $primaryColor;
position: absolute;
top: 8px;
bottom: 8px;
left: -8px;
}
}
</style>

@ -119,11 +119,15 @@
},
async exportExcel() {
let sheetName = `教师${new Date().getTime().toString()}`
const res = await index(Object.assign(this.select, {
const res = await index({
filter: [{
key: 'name',
op: 'like',
value: this.select.name
}],
page: 1,
page_size: 9999,
// is_export:1
}))
page_size: 9999
})
if (res.data) {
let headers = this.table_item.map(i => {
return {

@ -7,16 +7,15 @@
<div slot="content">
<div class="searchwrap" style="display: flex;align-items: center;">
<div>
<el-input v-model="select.name" placeholder="请输入课时名称"></el-input>
<el-input v-model="select.theme" placeholder="请输入课程主题"></el-input>
</div>
<div>
<el-date-picker v-model="select.daterange" type="date" placeholder="考勤日期"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd">
<el-date-picker v-model="select.date" type="date" placeholder="考勤日期" value-format="yyyy-MM-dd"
format="yyyy-MM-dd">
</el-date-picker>
</div>
<div>
<el-button type="primary" size="small">查询</el-button>
<el-button type="primary" size="small" @click='getList'>查询</el-button>
<el-button type="primary" size="small">导出</el-button>
</div>
</div>
@ -27,175 +26,170 @@
</div>
<div>
<xy-table :list="list" :total="total" :table-item="table_item">
<xy-table :list="list" :total="total" :table-item="table_item">
<template v-slot:course_keeps_count>
<el-table-column align='center' label="应到人数" width="120" header-align="center">
<template slot-scope="scope">
<div @click="showAttendance(scope.row,'')" v-if="scope.row.course_keeps_count && scope.row.course_keeps_count>0" style="cursor: pointer;color:blue;text-decoration:underline">
{{scope.row.course_keeps_count}}
</div>
<div v-else>0</div>
</template>
</el-table-column>
</template>
<template v-slot:user_sign_total>
<el-table-column align='center' label="实到人数" width="120" header-align="center">
<template slot-scope="scope">
<div @click="showAttendance(scope.row,1)" v-if="scope.row.user_sign_total && scope.row.user_sign_total>0" style="cursor: pointer;color:blue;text-decoration:underline">
{{scope.row.user_sign_total}}
</div>
<div v-else>0</div>
</template>
</el-table-column>
</template>
<template v-slot:user_nosign_total>
<el-table-column align='center' label="缺勤人数" width="120" header-align="center">
<template slot-scope="scope">
<div @click="showAttendance(scope.row,0)" v-if="scope.row.user_nosign_total && scope.row.user_nosign_total>0" style="cursor: pointer;color:blue;text-decoration:underline">
{{scope.row.user_nosign_total}}
</div>
<div v-else>0</div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='center' label="操作" width="280" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small">导入</el-button>
<el-button type="primary" size="small" @click="showAttendance"></el-button>
<el-button type="primary" size="small" @click="importTable(scope.row)"></el-button>
<el-button type="primary" size="small" @click="showAttendance(scope.row,'')"></el-button>
</template>
</el-table-column>
</template>
</xy-table>
</div>
<showAttendance ref="showAttendance"></showAttendance>
<showAttendance ref="showAttendance"></showAttendance>
<imports ref="imports" :table-name="'course_keeps'"></imports>
</div>
</template>
<script>
<script>
import showAttendance from './components/showAttendance.vue'
import {
index
} from '@/api/course/courseContent.js'
import imports from "@/views/component/imports.vue"
export default {
components: {
showAttendance
showAttendance,
imports
},
data() {
return {
select: {
name: '',
daterange: '',
type: ''
},
list: [{
name: '第六期高级科创人才研修班',
daterange: '2024.3.1-2024.9.1',
type: '常规课程',
total: 60,
now_apply: 50,
success_apply: 20,
no_apply: 5,
by_apply: 25
}],
theme: '',
date: '',
page: 1,
page_size: 10
},
importData:[],
list: [],
total: 0,
table_item: [{
prop: 'daterange',
label: '考勤日期',
align: 'center',
width: 180,
},{
prop: 'name',
label: '课程名称',
align: 'left'
}, {
prop: 'type',
label: '授课教师',
align: 'center',
width: 160,
}, {
prop: 'total',
label: '教室',
align: 'center',
width: 180,
}, {
prop: 'now_apply',
label: '应到人数',
align: 'center',
width: 120,
customFn: (cell) => {
return ( <div style = {
{
cursor: 'pointer',
color: "blue",
textDecoration: "underline"
}
}
on = {
{
['click']: (e) => {
if (cell.now_apply < 1) {
return
}
this.showAttendance()
}
}
}>
{
cell.now_apply ? cell.now_apply : 0
} </div> )
}
},
{
prop: 'success_apply',
label: '实到人数',
align: 'center',
width: 120,
customFn: (cell) => {
return ( <div style = {
{
cursor: 'pointer',
color: "blue",
textDecoration: "underline"
}
}
on = {
{
['click']: (e) => {
if (cell.success_apply < 1) {
return
}
this.showAttendance()
}
}
}>
{
cell.success_apply ? cell.success_apply : 0
} </div> )
prop: 'date',
label: '考勤日期',
align: 'center',
width: 180,
}, {
prop:'period',
label: '考勤时间',
align: 'center',
width: 180,
},{
prop: 'theme',
label: '课程主题',
align: 'left'
}, {
prop: 'teacher.name',
label: '授课教师',
align: 'center',
width: 160,
}, {
prop: 'course_keeps_count',
label: '应到人数',
align: 'center',
width: 120,
},
{
prop: 'user_sign_total',
label: '实到人数',
align: 'center',
width: 120,
},
{
prop: 'user_nosign_total',
label: '缺勤人数',
align: 'center',
width: 120,
}
},
{
prop: 'no_apply',
label: '缺勤人数',
align: 'center',
width: 120,
customFn: (cell) => {
return ( <div style = {
{
cursor: 'pointer',
color: "blue",
textDecoration: "underline"
}
}
on = {
{
['click']: (e) => {
if (cell.no_apply < 1) {
return
}
this.showAttendance()
}
}
} >
{
cell.no_apply ? cell.no_apply : 0
} </div> )
}
}]
]
}
},
created() {
this.getList()
},
methods: {
showAttendance() {
showAttendance(row,state) {
this.$refs.showAttendance.setRow(row,)
this.$refs.showAttendance.isShow = true
}
},
//
importTable(row) {
this.$refs.imports.tableData = {
'data[course_id]':row.course_id,
'data[course_content_id]':row.id
}
this.$refs.imports.show()
// {"course_id":15,"course_content_id":188}
},
async getList() {
const res = await index({
page: this.select.page,
page_size: this.select.page_size,
show_relation: ['teacher'],
filter: [{
key: 'theme',
op: 'like',
value: this.select.theme
}, {
key: 'date',
op: 'eq',
value: this.select.date?this.select.date:''
}]
})
this.list = res.data
this.total = res.total
},
}
}
</script>
<style lang="scss" scoped>
.searchwrap {
display: flex;
align-items: center;
&>div {
.searchwrap {
display: flex;
align-items: center;
margin-right: 10px;
span {
min-width: 70px;
&>div {
display: flex;
align-items: center;
margin-right: 10px;
span {
min-width: 70px;
}
}
}
}
</style>

@ -78,7 +78,7 @@
</xy-table>
</div>
<add-class ref="addClass"></add-class>
<add-class ref="addClass" @refresh="getList"></add-class>
<set-main-teacher ref="setMainTeacher" @refresh="getList"></set-main-teacher>
</div>
</template>

@ -4,7 +4,11 @@
<div class="txl">
<div>课程名称{{subjectObj.name}}</div>
<div>开课日期{{subjectObj.start_date}}{{subjectObj.end_date}}</div>
<div>类别{{subjectObj.leibie}}</div>
<div>类别
<template v-for="item in course_type">
<span v-if="subjectObj.type===item.id">{{item.value}}</span>
</template>
</div>
</div>
<div class="txl">
<div>班主任{{subjectObj.teacher?subjectObj.teacher.name:''}}</div>
@ -18,37 +22,43 @@
<el-button type="primary" size="small" @click="changeContentStatus"></el-button>
</div>
<div>
<el-button type="primary" size="small">下载并打印课表</el-button>
<el-button type="primary" size="small" v-print="'#print'"></el-button>
</div>
</div>
<div class="schedule">
<xy-table :list="list" :isPage="false" :table-item="table_item">
<div class="schedule" id="print">
<!-- <xy-table :list="list" :isPage="false" :table-item="table_item" :height="'100%'">
<template v-slot:btns>
<div></div>
</template>
</xy-table>
</xy-table> -->
<el-table :data="list" border style="width: 100%">
<el-table-column v-for="item in table_item" :prop="item.prop" :label="item.label"
:width="item.width?item.width:''" :align="item.align">
</el-table-column>
</el-table>
</div>
<template v-slot:footer>
<!-- <el-button type="primary" style='margin-left:5px;margin-bottom:5px;' @click="submit"></el-button> -->
<el-button plain type="primary" plain style='margin-left:5px;margin-bottom:5px;'
@click="isShow=false">取消</el-button>
@click="closeClass">取消</el-button>
</template>
</Modal>
<imports ref="imports" :table-name="'course_contents'" :course_id="id+''" @refresh="getCousreContent"></imports>
<imports ref="imports" :table-name="'course_contents'" :course_id="id+''" @refresh="refreshData"></imports>
</div>
</template>
<script>
import myMixins from "@/mixin/selectMixin.js";
import {
index
} from '@/api/course/courseContent.js'
import {
show,
show,
save
} from "@/api/course/index.js"
import imports from "@/views/component/imports.vue"
export default {
mixins: [myMixins],
components: {
imports
},
@ -80,7 +90,7 @@
}, {
prop: 'address',
label: '上课地点',
align: 'center'
align: 'left'
}]
}
},
@ -100,33 +110,47 @@
}]
})
this.list = res.data
},
async getCourseDetail(){
const res = await show({id:this.id,show_relation:['teacher']})
this.subjectObj = this.base.requestToForm(res, this.subjectObj)
},
async getCourseDetail() {
const res = await show({
id: this.id,
show_relation: ['teacher']
})
this.subjectObj = {}
this.subjectObj = this.base.requestToForm(res, this.subjectObj)
console.log('this.subjectObj', this.subjectObj)
},
//
importTable() {
this.$refs.imports.show()
},
changeContentStatus(){
this.subjectObj.course_content_status = 1
save(this.subjectObj).then(res=>{
},
refreshData() {
this.$emit('refresh')
this.getCourseDetail()
this.getCousreContent()
},
//
changeContentStatus() {
this.subjectObj.course_content_status = 1
save(this.subjectObj).then(res => {
this.$Message.success("发布成功")
this.getCourseDetail()
})
},
//
submit() {}
this.$emit('refresh')
this.getCourseDetail()
})
},
closeClass() {
this.isShow = false
},
},
watch: {
isShow(newVal) {
if (newVal) {
if (newVal) {
this.getCourseDetail()
this.getCousreContent()
} else {
this.id = ''
this.subjectObj = {}
this.list = []
// this.$refs['dialog'].reset()
}
},
@ -135,6 +159,18 @@
</script>
<style lang="scss" scoped>
@media print {
@page {
size: auto;
}
body,
html,
div {
height: auto !important;
}
}
::v-deep .el-table__cell {
position: relative;
}

@ -155,10 +155,18 @@
<Button v-if="formList.length>0" ghost type="primary" @click="editForm('editor')"></Button>
<Button v-else ghost type="primary" @click="editForm('add')"></Button>
</template>
<el-form style="min-height: 300px;" label-width="80px" label-position="right" size="small">
<el-form-item :label="i.name || '字段名称'" :required="
<el-form style="min-height: 300px;display: flex;flex-wrap: wrap;" label-width="80px"
label-position="right" size="small">
<el-divider>基础字段</el-divider>
<el-form-item :label="i.name" :required="
i.rule ? !!i.rule.includes('required') : false
" v-for="(i, index) in defaultFormList">
<el-input placeholder="基础字段" :disabled="true"></el-input>
</el-form-item>
<el-divider>自定义字段</el-divider>
<el-form-item style="flex-basis: 100%;" :label="i.name || '字段名称'" :required="
i.rule ? !!i.rule.includes('required') : false
" v-for="(i, index) in formList" @click.native="selectPick(i, index)">
" v-for="(i, index) in formList">
<formSlotRender :config="i" :index="index"></formSlotRender>
</el-form-item>
</el-form>
@ -364,7 +372,7 @@
this.form.dateRange = [res.start_date, res.end_date]
this.showTinymce = true
})
},
},
//
next() {
if (this.id) {
@ -384,7 +392,7 @@
...this.selectForm
})
this.formList = res.data
},
},
//
editForm(type, id) {
this.$refs.applyForm.formList = deepCopy(this.formList)
@ -409,22 +417,22 @@
this.imgList = []
this.publicizeList = []
this.active = 0
this.formList = []
this.form = {
step: '', //
name: '',
type: '',
dateRange: '',
total: '',
status: '',
is_arrange: '',
is_fee: '',
image_id: '',
publicize_ids: [],
content: '',
applylabel: ''
},
this.$refs['dialog'].reset()
this.formList = []
this.form = {
step: '', //
name: '',
type: '',
dateRange: '',
total: '',
status: '',
is_arrange: '',
is_fee: '',
image_id: '',
publicize_ids: [],
content: '',
applylabel: ''
},
this.$refs['dialog'].reset()
}
},
}

@ -15,11 +15,21 @@
<template #left>
<div style="height: 100%">
<el-dialog id="template-dialog" :title="'模板表单'"
style="position: relative; inset: 0 0 0 0; height: 100%" width="600px" top="40px" :visible="true"
style="position: relative; inset: 0 0 0 0; height: 100%" width="80%" top="40px" :visible="true"
:modal="false" :append-to-body="false" :modal-append-to-body="false">
<el-form style="min-height: 200px;" label-width="80px" label-position="right" size="small">
<draggable :value="formList" group="items" @change="changeHandler">
<el-form-item :label="i.name || '字段名称'" :required="
<el-form style="min-height: 200px;display: flex;flex-wrap: wrap;" label-width="80px"
label-position="right" size="small">
<el-divider>基础字段</el-divider>
<el-form-item :label="i.name" :required="
i.rule ? !!i.rule.includes('required') : false
" v-for="(i, index) in defaultFormList">
<el-input placeholder="基础字段" :disabled="true"></el-input>
</el-form-item>
<el-divider>自定义字段</el-divider>
<draggable :value="formList" group="items" @change="changeHandler"
style="display: flex;flex-wrap: wrap;width:100%">
<el-form-item style="flex-basis: 100%;" :label="i.name || '字段名称'" :required="
i.rule ? !!i.rule.includes('required') : false
" v-for="(i, index) in formList" @click.native="selectPick(i, index)">
<formSlotRender :config="i" :index="index"></formSlotRender>
@ -50,6 +60,7 @@
</template>
<script>
import myMixins from "@/mixin/selectMixin.js";
import {
config
} from "@/api/system/customFormField";
@ -62,6 +73,7 @@
import editPane from "../components/editPane.vue";
import formSlotRender from "@/views/system/components/formSlotRender.vue";
export default {
mixins: [myMixins],
components: {
formSlotRender,
editPane
@ -97,8 +109,9 @@
validation_rules
} = await config(false);
this.rules = validation_rules;
this.types = edit_to_migration.filter(item => item.edit_input !== 'textarea' && item.edit_input !== "richtext"
&& item.edit_input !== "file" && item.edit_input !== "map");
this.types = edit_to_migration.filter(item => item.edit_input !== 'textarea' && item.edit_input !==
"richtext" &&
item.edit_input !== "file" && item.edit_input !== "map");
},
//
async getFormList() {
@ -169,7 +182,7 @@
if (newval) {
console.log("this.course_id", this.course_id)
} else {
this.course_id = ''
this.course_id = ''
this.$emit("refresh")
}
}
@ -196,7 +209,7 @@
position: relative;
transition: all 0.2s ease-out;
padding:10px;
padding: 10px;
margin: 6px;
&:hover {

@ -20,7 +20,7 @@
</div>
<div style="margin-right: 10px;">
<el-select v-model="select.type" placeholder="请选择状态" clearable>
<el-option v-for="item in type_options" :key="item.id" :label="item.value" :value="item.id">
<el-option v-for="item in keep_options" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
@ -50,8 +50,11 @@
</div>
</template>
<script>
export default {
<script>
import {index} from "@/api/course/courseKeeps.js"
import myMixins from "@/mixin/selectMixin.js";
export default {
mixins: [myMixins],
components: {
},
@ -61,34 +64,21 @@
type: 'add',
id: '',
select:{
name:'',
type:''
},
status:'',
page:1,
page_size:999
},
form: {
settings: '',
},
type_options:[{
id:0,
value:'正常'
},{
id:1,
value:'缺勤'
}],
list:[{
name:'王同学',
time:'9:10',
status:'正常'
},{
name:'李同学',
time:'',
status:'缺勤'
}],
list:[],
table_item:[{
prop: 'name',
label: '学员姓名',
align: 'center'
},{
prop: 'time',
prop: 'date',
label: '考勤时间',
align: 'center'
},{
@ -96,7 +86,7 @@
label: '状态',
align: 'center',
customFn: (cell) => {
return ( < div style = {{color: cell.status=='正常'?"blue":"red"}}
return ( <div style = {{color: cell.status=='1'?"blue":"red"}}
>
{
cell.status?cell.status:''
@ -107,12 +97,28 @@
},
created() {},
methods: {
getDetail() {
show({
id: this.id,
table_name: 'new_plans',
}).then(res => {
setRow(row,status){
this.keepsObj = row
this.select.status = status
this.getList()
},
async getList() {
const res = index({
page:this.select.page,
page_size:this.select.page_size,
filter:[{
key:'course_content_id',
op:'eq',
value:this.keepsObj.id
},{
key:'status',
op:'eq',
value:this.select.status
},{
key:'date',
op:'eq',
value:this.keepsObj.date
}],
})
}
@ -120,12 +126,9 @@
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
// this.getDetail()
}
} else {
this.id = ''
this.$refs['dialog'].reset()
this.keepsObj = {}
}
},
}

@ -2,7 +2,7 @@
<div>
<div class="statistics">
<panel-group :totaldata="list" />
<!-- <panel-group :totaldata="list" /> -->
</div>
@ -178,10 +178,10 @@
//this.init()
window.onresize = () => {
this.col.resize()
this.line.resize()
}
// window.onresize = () => {
// this.col.resize()
// this.line.resize()
// }
},
destroyed() {

@ -4,7 +4,7 @@ import { templatePropsMap } from "@/const/templateProps";
export default {
props: {
config: Object,
index: Number,
index: Number
},
data() {
return {

Loading…
Cancel
Save