老师 banner 导入导出 基础信息 通知公告

dev
lion 1 year ago
parent ffbe8b42cc
commit 8f2e872166

@ -0,0 +1,55 @@
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/banners/index",
params,
paramsSerializer: customParamsSerializer,
isLoading
})
}
export function show(params, isLoading = true) {
return request({
method: "get",
url: "/api/admin/banners/show",
params,
isLoading
})
}
export function save(data) {
return request({
method: "post",
url: "/api/admin/banners/save",
data
})
}
export function destroy(params) {
return request({
method: "get",
url: "/api/admin/banners/destroy",
params
})
}

@ -0,0 +1,55 @@
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/configs/index",
params,
paramsSerializer: customParamsSerializer,
isLoading
})
}
export function show(params, isLoading = true) {
return request({
method: "get",
url: "/api/admin/configs/show",
params,
isLoading
})
}
export function save(data) {
return request({
method: "post",
url: "/api/admin/configs/save",
data
})
}
export function destroy(params) {
return request({
method: "get",
url: "/api/admin/configs/destroy",
params
})
}

@ -0,0 +1,55 @@
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/teachers/index",
params,
paramsSerializer: customParamsSerializer,
isLoading
})
}
export function show(params, isLoading = true) {
return request({
method: "get",
url: "/api/admin/teachers/show",
params,
isLoading
})
}
export function save(data) {
return request({
method: "post",
url: "/api/admin/teachers/save",
data
})
}
export function destroy(params) {
return request({
method: "get",
url: "/api/admin/teachers/destroy",
params
})
}

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 4052909 */
src: url('iconfont.woff2?t=1683361610626') format('woff2'),
url('iconfont.woff?t=1683361610626') format('woff'),
url('iconfont.ttf?t=1683361610626') format('truetype');
font-family: "iconfont"; /* Project id 4625369 */
src: url('iconfont.woff2?t=1721285561761') format('woff2'),
url('iconfont.woff?t=1721285561761') format('woff'),
url('iconfont.ttf?t=1721285561761') format('truetype');
}
.iconfont {
@ -13,107 +13,79 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-jurassic_process-list:before {
content: "\e6c4";
.icon-xinxi:before {
content: "\e600";
}
.icon-biaodan:before {
content: "\e663";
.icon-xueyuan-xueyuansousuo:before {
content: "\e610";
}
.icon-biaozhunhuaguizeguanli:before {
content: "\e60a";
.icon-yuyuedingdan:before {
content: "\e8a2";
}
.icon-a-zhidu6:before {
content: "\eb07";
.icon-lishihangcheng:before {
content: "\e8d5";
}
.icon-dat:before {
content: "\e691";
.icon-fl-baobiao:before {
content: "\e636";
}
.icon-audio:before {
content: "\e692";
.icon-lunbotu:before {
content: "\e62b";
}
.icon-video:before {
content: "\e693";
.icon-kecheng:before {
content: "\e605";
}
.icon-zip:before {
content: "\e694";
.icon-kecheng1:before {
content: "\e66f";
}
.icon-image:before {
content: "\e695";
.icon-xiaoyuanxinwentongzhigonggao:before {
content: "\e653";
}
.icon-pdf:before {
content: "\e696";
.icon-ico_yuyueguanli_jiedaiyuyue:before {
content: "\e8ba";
}
.icon-ppt:before {
content: "\e697";
.icon-xianxiabaoming:before {
content: "\e61f";
}
.icon-21excel:before {
content: "\e698";
.icon-tongxunlu:before {
content: "\e670";
}
.icon-21word:before {
content: "\e699";
.icon-tongzhi:before {
content: "\e68f";
}
.icon-21move:before {
content: "\e69a";
.icon-jiekou:before {
content: "\e669";
}
.icon-21setting:before {
content: "\e69b";
.icon-xueyuanguanli:before {
content: "\e6ac";
}
.icon-21upload:before {
content: "\e69c";
.icon-paikeguanli:before {
content: "\e7b4";
}
.icon-21download:before {
content: "\e69d";
.icon-lunbotu1:before {
content: "\e6d1";
}
.icon-21cancel:before {
content: "\e69e";
.icon-xueyuanguanli1:before {
content: "\e61a";
}
.icon-21ok:before {
content: "\e69f";
}
.icon-21copy:before {
content: "\e6a0";
}
.icon-21delete:before {
content: "\e6a1";
}
.icon-21edit:before {
content: "\e6a2";
}
.icon-21new:before {
content: "\e6a3";
}
.icon-21folder:before {
content: "\e6a4";
}
.icon-21mutil:before {
content: "\e6a5";
}
.icon-21file:before {
content: "\e6a6";
.icon-tongzhigonggao:before {
content: "\e7ab";
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -251,6 +251,76 @@ let base = {
nodes.unshift(_node)
}
return nodes
},
isNull(p) {
return p == '' || p == undefined || p == null || p == 'undefined' || p == 'null';
},
deepCopy(data) {
//string,number,bool,null,undefined,symbol
//object,array,date
if (data && typeof data === "object") {
//针对函数的拷贝
if (typeof data === "function") {
let tempFunc = data.bind(null);
tempFunc.prototype = this.deepCopy(data.prototype);
return tempFunc;
}
switch (Object.prototype.toString.call(data)) {
case "[object String]":
return data.toString();
case "[object Number]":
return Number(data.toString());
case "[object Boolean]":
return Boolean(data.toString());
case "[object Date]":
return new Date(data.getTime());
case "[object Array]":
let arr = [];
for (let i = 0; i < data.length; i++) {
arr[i] = this.deepCopy(data[i]);
}
return arr;
//js自带对象或用户自定义类实例
case "[object Object]":
let obj = {};
for (let key in data) {
//会遍历原型链上的属性方法可以用hasOwnProperty来控制 obj.hasOwnProperty(prop)
obj[key] = this.deepCopy(data[key]);
}
return obj;
}
} else {
//string,number,bool,null,undefined,symbol
return data;
}
},
// 按顺序把接口返回值 赋给 form
requestToForm(requestObj,form){
// 获取a对象中属性的顺序和值
let aKeys = Object.keys(form);
let aValues = aKeys.map(key => form[key]);
// 遍历b对象将属性等于a中属性值的对象深拷贝给a中的相应属性
for (let i = 0; i < aKeys.length; i++) {
let key = aKeys[i];
let value = aValues[i];
if (requestObj[key] === value) {
// 深拷贝对象
Object.assign(form, { [key]: this.deepCopy(requestObj[key]) });
}
}
// 遍历b对象将b中独有的属性按照a的顺序插入到a中
for (let key in requestObj) {
if (!form[key]) {
// 深拷贝属性值
Object.assign(form, { [key]: this.deepCopy(requestObj[key]) });
}
}
return form
}
}

@ -1,173 +1,178 @@
/**
* Created by PanJiaChen on 16/11/18.
*/
/**
* Created by PanJiaChen on 16/11/18.
*/
/**
* Parse the time to string
* @param {(Object|string|number)} time
* @param {string} cFormat
* @returns {string | null}
*/
export function parseTime(time, cFormat) {
if (arguments.length === 0 || !time) {
return null
}
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string')) {
if ((/^[0-9]+$/.test(time))) {
// support "1548221490638"
time = parseInt(time)
} else {
// support safari
// https://stackoverflow.com/questions/4310953/invalid-date-in-safari
time = time.replace(new RegExp(/-/gm), '/')
}
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
const value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value]
}
return value.toString().padStart(2, '0')
})
return time_str
}
/**
* @param {number} time
* @param {string} option
* @returns {string}
*/
export function formatTime(time, option) {
if (('' + time).length === 10) {
time = parseInt(time) * 1000
} else {
time = +time
}
const d = new Date(time)
const now = Date.now()
const diff = (now - d) / 1000
if (diff < 30) {
return '刚刚'
} else if (diff < 3600) {
// less 1 hour
return Math.ceil(diff / 60) + '分钟前'
} else if (diff < 3600 * 24) {
return Math.ceil(diff / 3600) + '小时前'
} else if (diff < 3600 * 24 * 2) {
return '1天前'
}
if (option) {
return parseTime(time, option)
} else {
return (
d.getMonth() +
1 +
'月' +
d.getDate() +
'日' +
d.getHours() +
'时' +
d.getMinutes() +
'分'
)
}
}
/**
* @param {string} url
* @returns {Object}
*/
export function param2Obj(url) {
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
if (!search) {
return {}
}
const obj = {}
const searchArr = search.split('&')
searchArr.forEach(v => {
const index = v.indexOf('=')
if (index !== -1) {
const name = v.substring(0, index)
const val = v.substring(index + 1, v.length)
obj[name] = val
}
})
return obj
}
//深拷贝数据
export function deepCopy(data) {
//string,number,bool,null,undefined,symbol
//object,array,date
if (data && typeof data === "object") {
//针对函数的拷贝
if (typeof data === "function") {
let tempFunc = data.bind(null);
tempFunc.prototype = deepCopy(data.prototype);
return tempFunc;
}
switch (Object.prototype.toString.call(data)) {
case "[object String]":
return data.toString();
case "[object Number]":
return Number(data.toString());
case "[object Boolean]":
return Boolean(data.toString());
case "[object Date]":
return new Date(data.getTime());
case "[object Array]":
let arr = [];
for (let i = 0; i < data.length; i++) {
arr[i] = deepCopy(data[i]);
}
return arr;
//js自带对象或用户自定义类实例
case "[object Object]":
let obj = {};
for (let key in data) {
//会遍历原型链上的属性方法可以用hasOwnProperty来控制 obj.hasOwnProperty(prop)
obj[key] = deepCopy(data[key]);
}
return obj;
}
} else {
//string,number,bool,null,undefined,symbol
return data;
}
}
export function debounce(func, delay) {
let timer = null;
return function() {
const context = this;
const args = arguments;
clearTimeout(timer);
timer = setTimeout(function() {
func.apply(context, args);
}, delay);
}
}
/**
* Parse the time to string
* @param {(Object|string|number)} time
* @param {string} cFormat
* @returns {string | null}
*/
export function parseTime(time, cFormat) {
if (arguments.length === 0 || !time) {
return null
}
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string')) {
if ((/^[0-9]+$/.test(time))) {
// support "1548221490638"
time = parseInt(time)
} else {
// support safari
// https://stackoverflow.com/questions/4310953/invalid-date-in-safari
time = time.replace(new RegExp(/-/gm), '/')
}
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
const value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] }
return value.toString().padStart(2, '0')
})
return time_str
}
/**
* @param {number} time
* @param {string} option
* @returns {string}
*/
export function formatTime(time, option) {
if (('' + time).length === 10) {
time = parseInt(time) * 1000
} else {
time = +time
}
const d = new Date(time)
const now = Date.now()
const diff = (now - d) / 1000
if (diff < 30) {
return '刚刚'
} else if (diff < 3600) {
// less 1 hour
return Math.ceil(diff / 60) + '分钟前'
} else if (diff < 3600 * 24) {
return Math.ceil(diff / 3600) + '小时前'
} else if (diff < 3600 * 24 * 2) {
return '1天前'
}
if (option) {
return parseTime(time, option)
} else {
return (
d.getMonth() +
1 +
'月' +
d.getDate() +
'日' +
d.getHours() +
'时' +
d.getMinutes() +
'分'
)
}
}
/**
* @param {string} url
* @returns {Object}
*/
export function param2Obj(url) {
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
if (!search) {
return {}
}
const obj = {}
const searchArr = search.split('&')
searchArr.forEach(v => {
const index = v.indexOf('=')
if (index !== -1) {
const name = v.substring(0, index)
const val = v.substring(index + 1, v.length)
obj[name] = val
}
})
return obj
export function isNull(p) {
return p == '' || p == undefined || p == null || p == 'undefined' || p == 'null';
}
//深拷贝数据
export function deepCopy(data) {
//string,number,bool,null,undefined,symbol
//object,array,date
if (data && typeof data === "object") {
//针对函数的拷贝
if (typeof data === "function") {
let tempFunc = data.bind(null);
tempFunc.prototype = deepCopy(data.prototype);
return tempFunc;
}
switch (Object.prototype.toString.call(data)) {
case "[object String]":
return data.toString();
case "[object Number]":
return Number(data.toString());
case "[object Boolean]":
return Boolean(data.toString());
case "[object Date]":
return new Date(data.getTime());
case "[object Array]":
let arr = [];
for (let i = 0; i < data.length; i++) {
arr[i] = deepCopy(data[i]);
}
return arr;
//js自带对象或用户自定义类实例
case "[object Object]":
let obj = {};
for (let key in data) {
//会遍历原型链上的属性方法可以用hasOwnProperty来控制 obj.hasOwnProperty(prop)
obj[key] = deepCopy(data[key]);
}
return obj;
}
} else {
//string,number,bool,null,undefined,symbol
return data;
}
}
export function debounce(func, delay) {
let timer = null;
return function() {
const context = this;
const args = arguments;
clearTimeout(timer);
timer = setTimeout(function() {
func.apply(context, args);
}, delay);
}
}

@ -0,0 +1,143 @@
<template>
<div>
<xy-dialog ref="dialog" :width="40" :is-show.sync="isShow" :type="'form'" :title="type=='show'?'预约查看':'预约审核'"
:form="form">
<template v-slot:name>
<div class="xy-table-item" style="padding:0">
<div class="xy-table-item-label" style="font-weight: bold;width:0;padding:0;display:none">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>
</div>
<div class="xy-table-item-content" style="flex-grow:1;text-align:center">
<div class="bookInfo">
<div>
<span>预约日期</span>
<span>2024-6-3</span>
</div>
<div>
<span>时间段</span>
<span>14:00-15:00</span>
</div>
<div>
<span>预约事项</span>
<span>游泳练习</span>
</div>
<div>
<span>预约场地</span>
<span>游泳馆</span>
</div>
<div>
<span>车牌</span>
<span></span>
</div>
<div>
<span>同行人数</span>
<span>2</span>
</div>
<div>
<span>状态</span>
<span>待审核</span>
</div>
</div>
<div v-if="type=='check'">
<lx-header icon="" text="审核意见" style="margin-bottom: 10px; border: 0px;text-align: left;">
</lx-header>
<div>
<el-input type="textarea" row="3"></el-input>
</div>
<div style="margin-top:15px">
<el-button type="primary" style='margin:15px;' @click="isShow=false"></el-button>
<el-button type="primary" style='margin:15px;' @click="isShow=false"></el-button>
<el-button type="primary" plain style='margin:15px;' @click="isShow=false"></el-button>
</div>
</div>
</div>
</div>
</template>
<template v-slot:footerContent>
<el-button v-if="type=='show'" type="primary" plain @click="isShow=false"></el-button>
<div v-else></div>
</template>
</xy-dialog>
</div>
</template>
<script>
export default {
components: {
},
data() {
return {
isShow: false,
type: 'show',
id: '',
form: {
name: '',
},
}
},
created() {},
methods: {
submit() {
save({
table_name: 'new_plans',
...this.form
}).then(res => {
Message({
type: 'success',
message: '核对成功'
})
this.isShow = false
this.$emit('refresh')
})
},
getDetail() {
show({
id: this.id,
table_name: 'new_plans',
}).then(res => {
})
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
// this.getDetail()
}
} else {
this.id = ''
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .name {
flex-basis: 100%;
}
.bookInfo{
&>div{
span{
display: inline-block;
}
span:first-child{
width:20%;
text-align: right;
}
span:last-child{
width:80%;
text-align: left;
}
}
}
</style>

@ -0,0 +1,153 @@
<template>
<div>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content">
<div class="searchwrap" style="display: flex;align-items: center;">
<div>
<el-date-picker v-model="select.daterange" type="daterange" range-separator="" start-placeholder=""
end-placeholder="结束日期">
</el-date-picker>
</div>
<div>
<el-input v-model="select.name" placeholder="请输入预约人"></el-input>
</div>
<div>
<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>
</el-select>
</div>
<div>
<el-button type="primary" size="small">查询</el-button>
</div>
</div>
</div>
</lx-header>
</div>
</div>
<div>
<xy-table :list="list" :total="total" :table-item="table_item">
<template v-slot:btns>
<el-table-column align='center' label="操作" width="180" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="checkBook('check',scope.row.id)"></el-button>
<el-button type="primary" size="small" @click="checkBook('show',scope.row.id)"></el-button>
</template>
</el-table-column>
</template>
</xy-table>
</div>
<check-book ref="checkBook"></check-book>
</div>
</template>
<script>
import checkBook from './components/checkBook.vue';
export default {
components: {
checkBook
},
data() {
return {
select: {
name: '',
daterange: '',
type: ''
},
type_options: [{
id: 0,
value: '会议室1'
}, {
id: 1,
value: '会议室2'
}],
list: [{
name: '2024-07-18',
daterange: '08:00-09:00',
do: '研修班会议',
address: '会议室1',
no:'',
num:3,
user:'王同学',
status: '待审核'
}],
total: 0,
table_item: [{
prop: 'name',
label: '预约日期',
align: 'left',
width:120,
}, {
prop: 'daterange',
label: '预约时段',
align: 'center',
width: 120,
}, {
prop: 'do',
label: '预约事项',
align: 'center',
width: 120,
}, {
prop: 'address',
label: '预约场地',
align: 'center',
width: 120,
}, {
prop: 'no',
label: '车牌',
align: 'center',
// width: 180,
}, {
prop: 'num',
label: '同行人数',
align: 'center',
width: 120,
},{
prop: 'user',
label: '预约人',
align: 'center',
width: 120,
} ,{
prop: 'status',
label: '状态',
align: 'center',
width: 120,
},]
}
},
created() {
},
methods: {
checkBook(type, id) {
this.$refs.checkBook.type = type
this.$refs.checkBook.isShow = true
}
}
}
</script>
<style lang="scss" scoped>
.searchwrap {
display: flex;
align-items: center;
&>div {
display: flex;
align-items: center;
margin-right: 10px;
span {
min-width: 70px;
}
}
}
</style>

@ -44,6 +44,8 @@ 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: {
@ -55,6 +57,7 @@ export default {
data() {
return {
action: `${process.env.VUE_APP_BASE_API}/api/admin/base-form/excel-show`,
import_action:'',
dialogVisible: false,
headers: [],
@ -70,7 +73,19 @@ export default {
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] });
}
}
this.table = this.headers = b
},
//
uploadFail(err) {
console.log(err);
@ -104,9 +119,13 @@ export default {
},
imports() {
imports({
table_name: this.tableName,
data: this.tableList
request({
method: "post",
url: this.import_action,
data:{
table_name: this.tableName,
data: this.tableList
}
}).then(res => {
console.log(res)
this.$message({
@ -130,6 +149,15 @@ export default {
});
}
},
dialogVisible(newval){
console.log("newval",newval,this.tableName)
if(newval){
this.action = `${process.env.VUE_APP_BASE_API}/api/admin/${this.tableName}/excel-show`
this.import_action = `/api/admin/${this.tableName}/import`
this.getHeaders()
console.log("action",this.action,this.import_action)
}
}
},
};
</script>

@ -0,0 +1,209 @@
<template>
<div>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content">
<div class="searchwrap" style="display: flex;align-items: center;">
<div>
<el-input v-model="select.name" placeholder="请输入名称"></el-input>
</div>
<div>
<el-select v-model="select.position" placeholder="请选择显示位置" clearable>
<el-option v-for="item in position_options" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
<div>
<el-button type="primary" size="small" @click="getList"></el-button>
</div>
<div>
<el-button type="primary" size="small" @click="editBanner('add')"></el-button>
</div>
</div>
</div>
</lx-header>
</div>
</div>
<div>
<xy-table :list="list" :total="total" :table-item="table_item">
<template v-slot:image_id>
<el-table-column align='center' label="图片" width="80" header-align="center">
<template slot-scope="scope">
<el-image style="width: 60px; height: 60px" :src="scope.row.image.url" :preview-src-list="[scope.row.image.url]">
</el-image>
</template>
</el-table-column>
</template>
<template v-slot:jump_type>
<el-table-column align='center' label="跳转类型" width="120" header-align="center">
<template slot-scope="scope">
<div v-for="item in type_options">
<div v-if="scope.row.jump_type===item.id">{{item.value}}</div>
</div>
</template>
</el-table-column>
</template>
<template v-slot:position>
<el-table-column align='center' label="显示位置" width="120" header-align="center">
<template slot-scope="scope">
<div v-for="item in position_options">
<div v-if="scope.row.position===item.id">{{item.value}}</div>
</div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='center' label="操作" width="180" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="editBanner('editor',scope.row.id)"></el-button>
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
<el-button type="danger" size="small" slot="reference">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</template>
</xy-table>
</div>
<add-banner ref="addBanner" @refresh="getList"></add-banner>
</div>
</template>
<script>
import addBanner from './components/addBanner.vue';
import {
index,
destroy
} from "@/api/info/banners.js"
export default {
components: {
addBanner
},
data() {
return {
select: {
name: '',
page: 1,
page_size: 10,
position: ''
},
position_options: [{
id: 1,
value: '首页'
}, {
id: 2,
value: '课程'
}, {
id: 3,
value: '公告'
}],
type_options: [{
id: 1,
value: '小程序'
}, {
id: 2,
value: 'h5'
}],
list: [],
total: 0,
table_item: [{
prop: 'name',
label: '名称',
align: 'left'
}, {
prop: 'image_id',
label: '图片',
align: 'center',
width: 80,
slot: 'imageshow'
}, {
prop: 'position',
label: '显示位置',
align: 'center',
width: 120,
}, {
prop: 'jump_type',
label: '跳转类型',
align: 'center',
width: 120,
}, {
prop: 'jump_url',
label: '跳转链接',
align: 'left',
width: 180,
}, {
prop: 'sort',
label: '排序',
align: 'center',
width: 80,
}]
}
},
created() {
this.getList()
},
methods: {
async getList() {
const res = await index({
page: this.select.page,
page_size: this.select.page_size,
filter: [{
key: 'name',
op: 'like',
value: this.select.name
}, {
key: 'position',
op: 'eq',
value: this.select.position
}],
show_relation: ['image']
})
this.list = res.data
this.total = res.total
},
editBanner(type, id) {
if (id) {
this.$refs.addBanner.id = id
}
this.$refs.addBanner.setOptions(this.position_options, this.type_options)
this.$refs.addBanner.type = type
this.$refs.addBanner.isShow = true
},
deleteList(id) {
var that = this;
destroy({
id: id,
}).then(response => {
this.$Message.success('删除成功');
this.getList()
}).catch(error => {
console.log(error)
reject(error)
})
},
}
}
</script>
<style lang="scss" scoped>
.searchwrap {
display: flex;
align-items: center;
&>div {
display: flex;
align-items: center;
margin-right: 10px;
span {
min-width: 70px;
}
}
}
</style>

@ -0,0 +1,204 @@
<template>
<div>
<xy-dialog ref="dialog" :width="70" :is-show.sync="isShow" :type="'form'"
:title="type === 'add' ? '新增轮播图' : '编辑轮播图'" :form="form" :rules='rules' @submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>标题
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" placeholder="请输入标题" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:position>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>显示位置
</div>
<div class="xy-table-item-content">
<el-select v-model="form.position" placeholder="请选择显示位置" clearable style="width: 100%;">
<el-option v-for="item in position_options" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:jump_type>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>跳转类型
</div>
<div class="xy-table-item-content">
<el-select v-model="form.jump_type" placeholder="请选择跳转类型" clearable style="width: 100%;">
<el-option v-for="item in type_options" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:jump_url>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>跳转链接
</div>
<div class="xy-table-item-content">
<el-input v-model="form.jump_url" placeholder="请输入跳转链接" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:sort>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>排序
</div>
<div class="xy-table-item-content">
<el-input v-model="form.sort" placeholder="请输入排序" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:image_id>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold;">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>图片
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class='upload-demo' :limit="1" list-type="picture-card" :file-list="imgList"
ref="pictureUpload" :auto-upload="true" :on-success="uploadSuccess" :on-remove="uploadRemove">
<i class="el-icon-plus"></i>
</el-upload>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
show,
save
} from "@/api/info/banners.js"
export default {
components: {
},
data() {
return {
isShow: false,
type: 'add',
action: `${process.env.VUE_APP_UPLOAD_API}`,
id: '',
type_options:[],
position_options: [],
form: {
name: '',
position:'',
jump_type: '',
jump_url: '',
sort:0,
image_id: '',
},
imgList:[],
rules: {
name:[{
required:true,
message:'请输入标题'
}],
position:[{
required:true,
message:'请选择显示位置'
}],
image_id:[{
required:true,
message:'请上传图片'
}]
}
}
},
created() {},
methods: {
setOptions(position,type){
this.position_options = position?position:[]
this.type_options = type?type:[]
},
uploadFail(err) {
console.log(err)
},
uploadSuccess(response, file, fileList) {
console.log(response, file, fileList)
this.form.image_id = response.id
this.imgList = fileList
},
uploadRemove(file, fileList){
this.imgList = fileList
this.form.image_id = ''
},
submit() {
if (this.id) {
this.form.id = this.id
}
if (this.type == 'add') {
this.form.id = ''
}
// if(this.imgList && this.imgList.length>0){
// this.imgList.map(item=>{
// if(item.response){
// this.form.image_id = item.response.id
// }else{
// this.form.image_id = item.id
// }
// })
// }else{
// this.$message({
// type: 'warning',
// message: ''
// })
// }
save({
...this.form
}).then(res => {
this.$message({
type: 'success',
message: this.type === 'add' ? '新增轮播图成功' : '编辑轮播图成功'
})
this.isShow = false
this.$emit('refresh')
})
},
getDetail() {
show({
id: this.id,
show_relation: ['image']
}).then(res => {
this.form = this.base.requestToForm(res,this.form)
this.imgList.push(res.image)
})
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.imgList = []
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .image_id{
flex-basis: 100%;
}
</style>

@ -0,0 +1,121 @@
<template>
<div>
<xy-dialog ref="dialog" :width="40" :is-show.sync="isShow" :type="'form'"
:title="type === 'add' ? '新增基础信息' : '编辑基础信息'" :form="form" :rules='rules' @submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>配置名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" placeholder="请输入配置名称" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:key>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>英文标识
</div>
<div class="xy-table-item-content">
<el-input v-model="form.key" placeholder="请输入英文标识" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:value>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>配置值
</div>
<div class="xy-table-item-content">
<el-input v-model="form.value" placeholder="请输入配置值" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
show,
save
} from "@/api/info/configs.js"
export default {
components: {
},
data() {
return {
isShow: false,
type: 'add',
id: '',
form: {
name: '',
key: '',
value: ''
},
rules: {
name:[{
required:true,
message:'请输入配置名称'
}],
key:[{
required:true,
message:'请输入英文标识'
}]
}
}
},
created() {},
methods: {
submit() {
if (this.id) {
this.form.id = this.id
}
if (this.type == 'add') {
this.form.id = ''
}
save(this.form).then(res => {
this.$message({
type: 'success',
message: this.type === 'add' ? '新增成功' : '编辑成功'
})
this.isShow = false
this.$emit('refresh')
})
},
getDetail() {
show({
id: this.id
}).then(res => {
this.form = this.base.requestToForm(res,this.form)
})
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .name,
::v-deep .key,
::v-deep .value {
flex-basis: 100%;
}
</style>

@ -0,0 +1,134 @@
<template>
<div>
<xy-dialog ref="dialog" :width="40" :is-show.sync="isShow" :type="'form'"
:title="type === 'add' ? '新增教师信息' : '编辑教师信息'" :form="form" :rules='rules' @submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>姓名
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" placeholder="请输入姓名" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:sex>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>性别
</div>
<div class="xy-table-item-content">
<el-select v-model="form.sex" placeholder="请选择" clearable style="width: 100%;">
<el-option v-for="item in sex_options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:introduce>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>介绍
</div>
<div class="xy-table-item-content">
<el-input v-model="form.introduce" type="textarea" placeholder="请输入介绍" clearable
style="width: 100%;"></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
show,
save
} from "@/api/info/teachers.js"
export default {
components: {
},
data() {
return {
isShow: false,
type: 'add',
action: '',
id: '',
form: {
name: '',
sex: '',
introduce: ''
},
sex_options:[{
label:'男',
value:'男'
},{
label:'女',
value:'女'
}],
rules: {
name:[{
required:true,
message:'请输入姓名'
}],
sex:[{
required:true,
message:'请选择性别'
}]
}
}
},
created() {},
methods: {
submit() {
if (this.id) {
this.form.id = this.id
}
if (this.type == 'add') {
this.form.id = ''
}
save(this.form).then(res => {
this.$message({
type: 'success',
message: this.type === 'add' ? '新增教师成功' : '编辑教师成功'
})
this.isShow = false
this.$emit('refresh')
})
},
getDetail() {
show({
id: this.id
}).then(res => {
this.form = this.base.requestToForm(res,this.form)
})
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .name,
::v-deep .sex,
::v-deep .introduce {
flex-basis: 100%;
}
</style>

@ -0,0 +1,139 @@
<template>
<div>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content">
<div class="searchwrap" style="display: flex;align-items: center;">
<div>
<el-input v-model="select.name" placeholder="请输入配置名称"></el-input>
</div>
<div>
<el-button type="primary" size="small" @click="getList()"></el-button>
</div>
<div>
<el-button type="primary" size="small" @click="editInfo('add')"></el-button>
</div>
</div>
</div>
</lx-header>
</div>
</div>
<div>
<xy-table :list="list" :total="total" :table-item="table_item">
<template v-slot:btns>
<el-table-column align='center' label="操作" width="180" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="editInfo('editor',scope.row.id)"></el-button>
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
<el-button type="danger" size="small" slot="reference">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</template>
</xy-table>
</div>
<add-info ref="addInfo" @refresh="getList()"></add-info>
</div>
</template>
<script>
import addInfo from './components/addInfo.vue';
import {
index,
destroy
} from "@/api/info/configs.js"
export default {
components: {
addInfo
},
data() {
return {
select: {
name: '',
page: 1,
page_size: 10,
},
list: [],
total: 0,
table_item: [{
prop: 'name',
label: '配置名称',
align: 'center',
width: 180
}, {
prop: 'key',
label: '英文标识',
align: 'center',
width: 180,
}, {
prop: 'value',
label: '配置值',
align: 'left',
}]
}
},
created() {
this.getList()
},
methods: {
async getList() {
const res = await index({
page: this.select.page,
page_size: this.select.page_size,
filter: [{
key: 'name',
op: 'like',
value: this.select.name
}]
})
this.list = res.data
this.total = res.total
},
editInfo(type, id) {
if (id) {
this.$refs.addInfo.id = id
}
this.$refs.addInfo.type = type
this.$refs.addInfo.isShow = true
},
deleteList(id) {
var that = this;
destroy({
id: id
}).then(response => {
this.$Message.success('删除成功');
this.getList()
}).catch(error => {
console.log(error)
reject(error)
})
}
}
}
</script>
<style lang="scss" scoped>
.searchwrap {
display: flex;
align-items: center;
&>div {
display: flex;
align-items: center;
margin-right: 10px;
span {
min-width: 70px;
}
}
}
</style>

@ -0,0 +1,182 @@
<template>
<div>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content">
<div class="searchwrap" style="display: flex;align-items: center;">
<div>
<el-input v-model="select.name" placeholder="请输入姓名"></el-input>
</div>
<div>
<el-button type="primary" size="small" @click="getList()"></el-button>
</div>
<div>
<el-button type="primary" size="small" @click="editTeacher('add')"></el-button>
</div>
<div>
<el-button type="primary" size="small" @click="importTable()"></el-button>
<el-button type="primary" size="small" @click="exportExcel()"></el-button>
</div>
</div>
</div>
</lx-header>
</div>
</div>
<div>
<xy-table :list="list" :total="total" :table-item="table_item">
<template v-slot:btns>
<el-table-column align='center' label="操作" width="180" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="editTeacher('editor',scope.row.id)"></el-button>
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
<el-button type="danger" size="small" slot="reference">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</template>
</xy-table>
</div>
<add-teacher ref="addTeacher" @refresh="getList()"></add-teacher>
<imports ref="imports" :table-name="'teachers'" @refresh="getList()"></imports>
</div>
</template>
<script>
import addTeacher from './components/addTeacher.vue';
import {
index,
destroy
} from "@/api/info/teachers.js"
import imports from "@/views/component/imports.vue"
import * as XLSX from "xlsx";
import {
saveAs
} from "file-saver";
export default {
components: {
addTeacher,
imports
},
data() {
return {
select: {
name: '',
page: 1,
page_size: 10,
},
list: [],
total: 0,
table_item: [{
prop: 'name',
label: '姓名',
align: 'center',
width: 180
}, {
prop: 'sex',
label: '性别',
align: 'center',
width: 180,
}, {
prop: 'introduce',
label: '介绍',
align: 'left',
}]
}
},
created() {
this.getList()
},
methods: {
async getList() {
const res = await index({
page: this.select.page,
page_size: this.select.page_size,
filter: [{
key: 'name',
op: 'like',
value: this.select.name
}]
})
this.list = res.data
this.total = res.total
},
async exportExcel() {
let sheetName = `教师${new Date().getTime().toString()}`
const res = await index(Object.assign(this.select, {
page: 1,
page_size: 9999,
// is_export:1
}))
if (res.data) {
let headers = this.table_item.map(i => {
return {
key: i.prop,
title: i.label
}
})
const data = res.data.map(row => headers.map(header => row[header.key]));
data.unshift(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`);
}
},
editTeacher(type, id) {
if (id) {
this.$refs.addTeacher.id = id
}
this.$refs.addTeacher.type = type
this.$refs.addTeacher.isShow = true
},
deleteList(id) {
var that = this;
destroy({
id: id
}).then(response => {
this.$Message.success('删除成功');
this.getList()
}).catch(error => {
console.log(error)
reject(error)
})
},
importTable() {
this.$refs.imports.show()
}
}
}
</script>
<style lang="scss" scoped>
.searchwrap {
display: flex;
align-items: center;
&>div {
display: flex;
align-items: center;
margin-right: 10px;
span {
min-width: 70px;
}
}
}
</style>

@ -193,7 +193,9 @@
},
methods: {
goApply(){
window.location.href = '/admin/#/course/apply_list'
this.$router.push({
path: '/course/apply_list'
})
},
}
}

@ -120,7 +120,9 @@
},
methods: {
goAttendance(){
window.location.href = '/admin/#/course/attendance'
this.$router.push({
path: '/course/attendance'
})
},
editClass(type, id) {

@ -24,6 +24,27 @@
</el-select>
</div>
</div>
</template>
<template v-slot:pic>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold;">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>课程封面
</div>
<div class="xy-table-item-content">
<el-upload
accept="picture"
:limit="1"
class="avatar-uploader"
list-type="picture-card"
:action="action"
:show-file-list="true"
:on-error="uploadFail"
:on-success="uploadSuccess"
:before-upload="uploadBefore">
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</div>
</template>
<template v-slot:menu>
<div class="xy-table-item">
@ -167,7 +188,8 @@
data() {
return {
isShow: false,
type: 'add',
type: 'add',
action:'',
id: '',
type_options: [{
id: 0,
@ -178,7 +200,8 @@
}],
form: {
name: '',
type: '',
type: '',
pic:'',
menu: '',
level: '',
period: '',
@ -219,9 +242,21 @@
},
created() {},
methods: {
clickSubmit() {
this.$refs.dialog.submit()
uploadFail(err){
console.log(err)
},
uploadSuccess(response){
// console.log(response)
// this.form.pic = response.url
},
uploadBefore(file){
// if((file.size/1000) > 2024){
// Message({
// type:'warning',
// message:'2M'
// })
// return false
// }
},
submit() {
if (this.id) {

@ -9,7 +9,6 @@
</div>
<div class="xy-table-item-content" style="flex-grow:1;text-align:center">
<div>
<!-- <el-image src="../../../assets/logo-mini.png" :preview-src-list="['../../../assets/logo-mini.png']"></el-image> -->
<img style="height:300px" src="../../../assets/logo-mini.png" alt="">
</div>
<div>
@ -22,7 +21,6 @@
<template v-slot:footerContent>
<div></div>
<!-- <el-button type="primary" plain style='margin-left:5px;margin-bottom:5px;' @click="isShow=false"></el-button> -->
</template>
</xy-dialog>

@ -0,0 +1,137 @@
<template>
<div>
<xy-dialog ref="dialog" :width="50" :is-show.sync="isShow" :type="'form'" title="查看课程" :form="form">
<template v-slot:settings>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold;width:0;display: none;">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>
</div>
<div class="xy-table-item-content" style="flex-grow: 1;">
<div class="content">
<div>
<div>课程名称</div>
<div>第六期高级科创人才研修班</div>
</div>
<div>
<div>开课日期</div>
<div>2024.3.1-2024.9.1</div>
</div>
<div>
<div>类别</div>
<div>正常课程</div>
</div>
<div>
<div>课程封面</div>
<div><img class="pic" src="../../../assets/logo-mini.png"></img></div>
</div>
<div class="top_bottom">
<div>课程简介</div>
<div>正常课程</div>
</div>
<div>
<div>开课人数</div>
<div>30</div>
</div>
<div>
<div>所在班级</div>
<div>会议室</div>
</div>
<div>
<div>面向学员的企业性质</div>
<div>上市企业</div>
</div>
<div>
<div>所属行业</div>
<div>材料</div>
</div>
<div>
<div>状态</div>
<div>已结束</div>
</div>
<div class="top_bottom">
<div>课程设置</div>
<div>
123
</div>
</div>
</div>
</div>
</div>
</template>
<template v-slot:footerContent>
<el-button type="primary" plain style='margin-left:5px;margin-bottom:5px;' @click="isShow=false"></el-button>
</template>
</xy-dialog>
</div>
</template>
<script>
export default {
components: {
},
data() {
return {
isShow: false,
type: 'add',
id: '',
form: {
settings: '',
},
}
},
created() {},
methods: {
getDetail() {
show({
id: this.id,
table_name: 'new_plans',
}).then(res => {
})
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
// this.getDetail()
}
} else {
this.id = ''
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .settings {
flex-basis: 100%;
}
.content {
&>div {
display: flex;
// >div:first-child{
// width:140px;
// text-align: right;
// }
}
.pic {
width: 150px;
height: 150px;
}
.top_bottom{
flex-direction: column;
}
}
</style>

@ -14,24 +14,15 @@
end-placeholder="结束日期">
</el-date-picker>
</div>
<div>
<div>
<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>
</el-select>
</div>
<div>
<el-select v-model="select.status" placeholder="请选择课程状态" clearable>
<el-option v-for="item in status_options" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
<div>
<el-button type="primary" size="small">查询</el-button>
</div>
<!-- <div>
<el-button type="primary" size="small" @click="editCourse('add')"></el-button>
</div> -->
</div>
</div>
@ -42,27 +33,26 @@
<div>
<xy-table :list="list" :total="total" :table-item="table_item">
<template v-slot:btns>
<el-table-column align='center' label="操作" width="320" header-align="center">
<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="danger" size="small">删除</el-button>
<el-button type="primary" size="small">通讯录</el-button>
<el-button type="primary" size="small">二维码</el-button>
<el-button type="primary" size="small" @click="showCourse"></el-button>
<el-button type="primary" size="small" @click="goTxl"></el-button>
<el-button type="primary" size="small" @click="goPay"></el-button>
</template>
</el-table-column>
</template>
</xy-table>
</div>
<add-course ref="addCourse"></add-course>
<show-course ref="showCourse"></show-course>
</div>
</template>
<script>
import addCourse from './components/addCourse.vue';
export default {
components:{
addCourse
<script>
import showCourse from './components/showCourse.vue';
export default {
components: {
showCourse
},
data() {
return {
@ -78,14 +68,11 @@
id: 1,
value: '短期课程'
}],
status_options: [{
id: 0,
value: '进行中'
}, {
id: 1,
value: '未开始'
list: [{
name: '第六期高级科创人才研修班',
daterange: '2024.3.1-2024.9.1',
type: '短期课程'
}],
list: [],
total: 0,
table_item: [{
prop: 'name',
@ -101,11 +88,6 @@
label: '类别',
align: 'center',
width: 160,
}, {
prop: 'status',
label: '发布状态',
align: 'center',
width: 180,
}]
}
@ -114,25 +96,25 @@
},
methods: {
editCourse(type,id){
this.$refs.addCourse.type = type
this.$refs.addCourse.isShow = true
showCourse(type, id) {
this.$refs.showCourse.type = type
this.$refs.showCourse.isShow = true
},
deleteList() {
var that = this;
destroy({
id: this.id,
table_name: 'new_plans'
}).then(response => {
this.$Message.success('操作成功');
this.isShow = false
this.$emit('refresh')
}).catch(error => {
console.log(error)
reject(error)
goTxl() {
this.$router.push({
path: '/course/txl'
})
},
goPay() {
this.$router.push({
path: '/course/pay',
query: {
type: 'history'
}
})
}
}
}
</script>

@ -44,8 +44,14 @@
<template v-slot:btns>
<el-table-column align='center' label="操作" width="380" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="editCourse('add',scope.row.id)"></el-button>
<el-button type="danger" size="small">删除</el-button>
<el-button type="primary" size="small" @click="editCourse('add',scope.row.id)"></el-button>
<el-popconfirm
style="margin:0 10px"
@confirm="deleteList(scope.row.id)"
title="确定删除吗?"
>
<el-button type="danger" size="small" slot="reference">删除</el-button>
</el-popconfirm>
<el-button type="primary" size="small" @click="toTxl"></el-button>
<el-button type="primary" size="small" @click="toPay"></el-button>
<el-button type="primary" size="small" @click="showQrCode"></el-button>
@ -139,10 +145,14 @@
this.$refs.showCode.isShow = true
},
toTxl() {
window.location.href = '/admin/#/course/txl'
this.$router.push({
path: '/course/txl'
})
},
toPay(){
window.location.href = '/admin/#/course/pay'
this.$router.push({
path: '/course/pay'
})
},
deleteList() {
var that = this;

@ -26,10 +26,10 @@
<div>
<el-button type="primary" size="small">导出</el-button>
</div>
<div>
<div v-if="url_type=='pay'">
<el-button type="primary" size="small" @click="showCheckPay"></el-button>
</div>
<div>
<div v-if="url_type=='pay'">
<el-button type="primary" size="small" @click="showSendMessage"></el-button>
</div>
</div>
@ -43,11 +43,12 @@
<xy-table :list="list" :total="total" :showIndex='false' :table-item="table_item"
@selection-change="selectionChange">
<template v-slot:btns>
<el-table-column align='center' fixed="right" label="操作" width="80" header-align="center">
<el-table-column v-if="url_type=='pay'" align='center' fixed="right" label="操作" width="80" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="showCheckPay"></el-button>
</template>
</el-table-column>
</el-table-column>
<div v-else></div>
</template>
</xy-table>
</div>
@ -58,14 +59,16 @@
<script>
import checkPay from './components/checkPay.vue';
import sendMessage from './components/sendMessage.vue';
import sendMessage from './components/sendMessage.vue';
import {getQueryParam} from '@/utils'
export default {
components: {
checkPay,
sendMessage
},
data() {
return {
return {
url_type:'pay',
select: {
name: '',
daterange: '',
@ -156,8 +159,8 @@
}
},
created() {
created() {
this.url_type = this.$route.query.type?this.$route.query.type:'pay'
},
methods: {

@ -0,0 +1,187 @@
<template>
<div>
<xy-dialog ref="dialog" :width="70" :is-show.sync="isShow" :type="'form'"
:title="type === 'add' ? '新增通知公告' : '编辑通知公告'" :form="form" :rules='rules' @submit="submit">
<template v-slot:biaoti>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>标题
</div>
<div class="xy-table-item-content">
<el-input v-model="form.biaoti" placeholder="请输入标题" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:leibie>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>类别
</div>
<div class="xy-table-item-content">
<el-select v-model="form.leibie" placeholder="请选择类别" clearable style="width: 100%;">
<el-option v-for="item in leibie_options" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:neirong>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>内容
</div>
<div class="xy-table-item-content" style="flex-grow: 1;">
<my-tinymce v-if="showTinymce" @input="saveContent" :value="form.neirong"></my-tinymce>
</div>
</div>
</template>
<template v-slot:shifoutongbugongzhonghao>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>是否同步公众号
</div>
<div class="xy-table-item-content">
<el-select v-model="form.shifoutongbugongzhonghao" placeholder="请选择" clearable style="width: 100%;">
<el-option v-for="item in gzh_options" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:zhuangtai>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>状态
</div>
<div class="xy-table-item-content">
<el-select v-model="form.zhuangtai" placeholder="请选择" clearable style="width: 100%;">
<el-option v-for="item in zt_options" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
show
} from "@/api/system/baseForm.js"
import {
deepCopy,
isNull
} from "@/utils";
export default {
components: {
},
data() {
return {
isShow: false,
type: 'add',
id: '',
showTinymce:false,
table_name: 'notices',
leibie_options: [{
id: 1,
value: '公告'
}, {
id: 2,
value: '通知'
}],
gzh_options: [{
id: 0,
value: '否'
}, {
id: 1,
value: '是'
}],
zt_options: [{
id: 0,
value: '待发布'
}, {
id: 1,
value: '发布'
}],
form: {
biaoti: '',
leibie: '',
neirong: '',
shifoutongbugongzhonghao: 0,
zhuangtai: 1
},
rules: {
biaoti: [{
required: true,
message: '请输入标题'
}],
leibie: [{
required: true,
message: '请选择类别'
}]
}
}
},
created() {},
methods: {
saveContent(e){
this.form.neirong = e
},
submit() {
if (this.id) {
this.form.id = this.id
}
if (this.type == 'add') {
this.form.id = ''
}
save({
table_name: this.table_name,
...this.form
}).then(res => {
this.$message({
type: 'success',
message: this.type === 'add' ? '新增成功' : '编辑成功'
})
this.isShow = false
this.$emit('refresh')
})
},
getDetail() {
show({
id: this.id,
table_name: this.table_name,
}).then(res => {
this.form = this.base.requestToForm(res,this.form)
this.showTinymce = true
})
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type="add"
this.showTinymce = false
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .neirong{
flex-basis: 100%;
}
</style>

@ -0,0 +1,199 @@
<template>
<div>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content">
<div class="searchwrap" style="display: flex;align-items: center;">
<div>
<el-input v-model="select.biaoti" placeholder="请输入标题"></el-input>
</div>
<div>
<el-select v-model="select.leibie" placeholder="请选择类别" clearable>
<el-option v-for="item in leibie_options" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
<div>
<el-button type="primary" size="small" @click="getList"></el-button>
</div>
<div>
<el-button type="primary" size="small" @click="editNotice('add')"></el-button>
</div>
</div>
</div>
</lx-header>
</div>
</div>
<div>
<xy-table :list="list" :total="total" :table-item="table_item">
<template v-slot:btns>
<el-table-column align='center' label="操作" width="180" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="editNotice('editor',scope.row.id)"></el-button>
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
<el-button type="danger" size="small" slot="reference">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</template>
</xy-table>
</div>
<add-notice ref="addNotice" @refresh="getList"></add-notice>
</div>
</template>
<script>
import addNotice from './components/addNotice.vue';
import {
index,
destroy
} from "@/api/system/baseForm.js"
export default {
components: {
addNotice
},
data() {
return {
select: {
biaoti: '',
leibie: '',
table_name: 'notices',
page: 1,
page_size: 10
},
leibie_options: [{
id: 1,
value: '公告'
}, {
id: 2,
value: '通知'
}],
gzh_options:[{
id:0,
value:'否'
},{
id:1,
value:'是'
}],
zt_options:[{
id:0,
value:'待发布'
},{
id:1,
value:'发布'
}],
list: [],
total: 0,
table_item: [{
prop: 'biaoti',
label: '标题',
align: 'left'
}, {
prop: 'leibie',
label: '类别',
align: 'center',
width: 160,
customFn: (row) => {
return this.leibie_options.map(item=>{
if(item.id===row.leibie){
return item.value
}
})
}
}, {
prop: 'shifoutongbugongzhonghao',
label: '是否同步公众号',
align: 'center',
width: 160,
customFn: (row) => {
return this.gzh_options.map(item=>{
if(item.id===row.shifoutongbugongzhonghao){
return item.value
}
})
}
}, {
prop: 'zhuangtai',
label: '发布状态',
align: 'center',
width: 160,
customFn: (row) => {
return this.zt_options.map(item=>{
if(item.id===row.zhuangtai){
return item.value
}
})
}
}]
}
},
created() {
this.getList()
},
methods: {
editNotice(type, id) {
if(type=='editor'){
this.$refs.addNotice.id = id
}
this.$refs.addNotice.type = type
this.$refs.addNotice.isShow = true
},
async getList() {
const res = await index({
page_size: this.select.page_size,
page: this.select.page,
table_name: this.select.table_name,
filter: [{
"key": "biaoti",
"op": "like",
"value": this.select.biaoti
},
{
"key": "leibie",
"op": "eq",
"value": this.select.leibie
}
],
})
this.list = res.data
this.total = res.total
},
deleteList(id) {
var that = this;
destroy({
id: id,
table_name: this.select.table_name
}).then(response => {
this.$Message.success('操作成功');
this.getList()
}).catch(error => {
console.log(error)
reject(error)
})
},
}
}
</script>
<style lang="scss" scoped>
.searchwrap {
display: flex;
align-items: center;
&>div {
display: flex;
align-items: center;
margin-right: 10px;
span {
min-width: 70px;
}
}
}
</style>
Loading…
Cancel
Save