This commit is contained in:
KangKang0928 2024-08-07 17:55:31 +08:00
parent e68d52a92c
commit 49dcea6704
152 changed files with 1752 additions and 37164 deletions

View File

@ -1,54 +0,0 @@
/*
* @author: ym
* @Date: 2021-10-31 13:01:13
* @LastEditTime: 2021-10-31 13:38:31
* @LastEditors: ym
* @Description:
* @FilePath: \background-front-end\src\api\modules\active-manage.js
*/
//===================== 活动 =============================
import $http from '../../utils/httpRequest'
// 资讯管理=================================================
// 增
export const saveActivityInfo=(content)=>{
return $http.post('/activity/redactivityinfo/save',JSON.stringify(content))
}
// 删
export const deleteRedActivityInfo=(idList)=>{
return $http.post('/activity/redactivityinfo/delete',JSON.stringify(idList));
}
// 改
export const updateRedActivityInfo=(ids)=>{
return $http.post('/activity/redactivityinfo/update',JSON.stringify(ids))
}
// 查
export const getActivityInfoListByParams=(obj)=>{
return $http({
url:'/activity/redactivityinfo/getActivityInfoListByParams',
method: 'get',
params: $http.adornParams(obj)
})
}
// 轮播图管理=================================================
// 增
export const saveActivityImage=(content)=>{
return $http.post('/activity/redactivityimage/save',JSON.stringify(content))
}
// 删
export const deleteRedActivityImage=(idList)=>{
return $http.post('/activity/redactivityimage/delete',JSON.stringify(idList));
}
// 改
export const updateRedActivityImage=(ids)=>{
return $http.post('/activity/redactivityimage/update',JSON.stringify(ids))
}
// 查
export const getRedActivityImage=(obj)=>{
return $http({
url:'/activity/redactivityimage/list',
method: 'get',
params: $http.adornParams(obj)
})
}

View File

@ -1,88 +0,0 @@
/*
* @Author: cwl
* @Date: 2021-12-23 14:12:02
* @LastEditTime: 2022-01-01 20:48:32
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\api\modules\active-match.js
*/
import $http from '../../utils/httpRequest'
//===================== 活动/赛事管理 =============================
export function addActiveMatch(data){
return $http({
url:'/activity/redactivitymatch/save',
method:'post',
data
})
}
export function getActiveMatch(params){
return $http({
url:'/activity/redactivitymatch/getListDetails',
params
})
}
export function delActiveMatch(data){
return $http({
url:'/activity/redactivitymatch/delete',
method:'post',
data
})
}
export function updateActiveMatch(data){
return $http({
url:'/activity/redactivitymatch/update',
method:'post',
data
})
}
//===================== 报名信息=============================
export function getActiveSignUp(params){
return $http({
url:'/activity/redactivitysignup/list',
params
})
}
//===================== 作品审核=============================
export function getWorksExamine(params){
return $http({
url:'/activity/redactivityworks/list',
params
})
}
export function setWorksExamine(data){
return $http({
url:'/activity/redactivityworks/setWorks',
method:'post',
data
})
}
export function getWorksAwardList(id){
return $http({
url:'/activity/reduseraward/list/'+id,
id
})
}
export function delelteWorksAward(data){
return $http({
url:'/activity/reduseraward/delete',
method:'post',
data
})
}
export function addWorksAward(data){
return $http({
url:'/activity/reduseraward/save',
method:'post',
data
})
}
export function updateWorksAward(data){
return $http({
url:'/activity/reduseraward/update',
method:'post',
data
})
}

View File

@ -1,15 +0,0 @@
import $http from '../../utils/httpRequest'
export const appOperate={
updateTheme(currentTheme){
return $http.post(`/sys/config/update`,{
id:2,
paramKey:"THEME",
paramValue:currentTheme
})
},
//检查主题
getTheme(){
return $http.get("/sys/config/info/2");
}
}

View File

@ -1,33 +0,0 @@
/*
* @Author: chenkangxu
* @Date: 2022-06-19 00:07:43
* @LastEditTime: 2022-06-20 17:43:17
* @LastEditors: 陈伟亮 1186723967@qq.com
* @Description:
* @Github:
*/
import $http from "../../utils/httpRequest";
export const approval = {
content: (obj) => {
return $http({
url: "/content/redcontentinfo/examine",
method: "get",
params: $http.adornParams(obj)
});
},
poetry: obj => {
return $http({
url: "/localService/redpoetry/examine",
method: "get",
params: $http.adornParams(obj)
});
},
course: obj => {
return $http({
url: "/localService/redstudycourse/examine",
method: "get",
params: $http.adornParams(obj)
});
}
};

View File

@ -1,85 +0,0 @@
/*
* @Author: ym
* @Date: 2021-10-09 10:15:18
* @LastEditTime: 2022-06-18 18:47:19
* @LastEditors: 陈伟亮 1186723967@qq.com
* @Description: In User Settings Edit
* @FilePath: \background-front-end\src\api\modules\content-manage.js
*/
//===================== 内容 =============================
import $http from '../../utils/httpRequest'
import $httpComment from '../../utils/httpRequestComment'
// 资讯管理=================================================
// 增
export const saveNewContent=(content)=>{
return $http.post('/content/redcontentinfo/saveNewContent',JSON.stringify(content))
}
// 删
export const deleteRedContentInfo=(idList)=>{
return $http.post('/content/redcontentinfo/delete',JSON.stringify(idList));
}
// 改
export const updateRedContentInfo=(ids)=>{
return $http.post('/content/redcontentinfo/update',JSON.stringify(ids))
}
// 查
export const getContentInfoListByParams=(obj)=>{
return $http({
url:'/content/redcontentinfo/getContentInfoListByParams',
method: 'get',
params: $http.adornParams(obj)
})
}
// 查分类
export const getContentTypeListNoPage=()=>{
return $http.get('/management/reddatacontentmaintype/getContentTypeListNoPage');
}
// 轮播图管理
// 增
export const saveContentImage=(content)=>{
return $http.post('/content/redcontentimage/save',JSON.stringify(content))
}
// 删
export const deleteContentImage=(idList)=>{
return $http.post('/content/redcontentimage/delete',JSON.stringify(idList));
}
// 改
export const updateContentImage=(ids)=>{
return $http.post('/content/redcontentimage/update',JSON.stringify(ids))
}
// 查
export const getContentImage=(obj)=>{
return $http({
url:'/content/redcontentimage/getListByParams',
method: 'get',
params: $http.adornParams(obj)
})
}
// 查询评论
export const getCommentList=(obj)=>{
let url='';
switch(obj.type){
case 'CONTENTIMG': url='/content/redcontentimage'; break;
case 'CONTENTINFO': url='/content/redcontentinfo'; break;
case 'CONTENTLOCALINFO': url='/content/redcontentlocalinfo'; break;
case 'STUDYIMG': url='/study/redstudyimage'; break;
case 'STUDYINFO': url='/study/redstudyinfo'; break;
case 'ACTIVITY' :url="/activity/redactivitymatch";break;
}
delete obj.type
return $httpComment({
url:url+'/listComment',
method: 'post',
params:obj
})
}
// 地方后台查
export const getLocalContentInfoListByParams=(obj)=>{
return $http({
url:'/content/redcontentlocalinfo/getContentLocalInfoListByParams',
method: 'post',
data: $http.adornParams(obj)
})
}

View File

@ -1,242 +0,0 @@
/*
* @Author: ym
* @Date: 2021-09-28 16:17:10
* @LastEditTime: 2022-09-02 23:04:36
* @LastEditors: chenkangxu
* @Description: In User Settings Edit
* @FilePath: \background-front-end\src\api\modules\data-dictionary.js
*/
import $http from '../../utils/httpRequest'
//===================== 内容分类 =============================
// 新增分类
export const saveNewContentType=(mainTypeName)=>{
return $http.post('/management/reddatacontentmaintype/saveNewContentType',JSON.stringify(mainTypeName))
}
// 新增子分类
export const saveNewContentSecondType=(secondTypeName,mainTypeId)=>{
return $http.post('/management/reddatacontentsecondtype/saveNewSecondType',{
secondTypeName:secondTypeName,
mainTypeId:mainTypeId
})
}
// 修改子类
export const updateContentSecType=(obj)=>{
return $http.post('/management/reddatacontentsecondtype/update',JSON.stringify(obj))
}
//修改父类
export const updateContentMainType=(obj)=>{
return $http.post(`/management/reddatacontentmaintype/update`,JSON.stringify(obj))
}
// 批量修改子排序
export const updateContentSecSort=(list)=>{
return $http.post('/management/reddatacontentsecondtype/updateSort',JSON.stringify(list))
}
// 批量修改排序
export const updateTypeSort=(list)=>{
return $http.post('/management/reddatacontentmaintype/updateSort',JSON.stringify(list))
}
// 根据id批量删除部门
export const deleteType=(idList)=>{
return $http.post('/management/reddatacontentmaintype/delete',JSON.stringify(idList));
}
// 根据id批量删除子部门
export const deleteContentSecType=(idList)=>{
return $http.post('/management/reddatacontentsecondtype/delete',JSON.stringify(idList));
}
// 查询分类
export const getContentTypeList=()=>{
return $http.get('/management/reddatacontentmaintype/getMainSecondTypeList');
}
//===================== 古诗词分类 =============================
// 新增主分类
export const saveNewMainType=(mainTypeName)=>{
return $http.post('/management/reddatapoetrymaintype/saveNewMainType',{
mainTypeName:mainTypeName
})
}
// 新增子分类
export const saveNewSecondType=(secondTypeName,mainTypeId)=>{
return $http.post('/management/reddatapoetrysecondtype/saveNewSecondType',{
secondTypeName:secondTypeName,
mainTypeId:mainTypeId
})
}
// 修改主类
export const updateMainType=(obj)=>{
return $http.post('/management/reddatapoetrymaintype/update',JSON.stringify(obj))
}
// 修改子类
export const updateSecType=(obj)=>{
return $http.post('/management/reddatapoetrysecondtype/update',JSON.stringify(obj))
}
// 批量修改主排序
export const updatePSort=(list)=>{
return $http.post('/management/reddatapoetrymaintype/updateSort',JSON.stringify(list))
}
// 批量修改子排序
export const updateSPSort=(list)=>{
return $http.post('/management/reddatapoetrysecondtype/updateSort',JSON.stringify(list))
}
// 根据id批量删除主部门
export const deleteMainType=(idList)=>{
return $http.post('/management/reddatapoetrymaintype/delete',JSON.stringify(idList));
}
// 根据id批量删除子部门
export const deleteSecType=(idList)=>{
return $http.post('/management/reddatapoetrysecondtype/delete',JSON.stringify(idList));
}
// 查询分类
export const getMainSecondTypeList=()=>{
return $http.get('/management/reddatapoetrymaintype/getMainSecondTypeList');
}
//===================== 打卡地 =============================
// 新增分类
export const saveNewFootprintType=(footprintTypeName)=>{
return $http.post('/management/reddatafootprinttype/saveNewFootprintType',JSON.stringify(footprintTypeName))
}
// 批量修改排序
export const updateFootprintTypeSort=(list)=>{
return $http.post('/management/reddatafootprinttype/updateFootprintTypeSort',JSON.stringify(list))
}
// 根据id批量删除
export const deleteFootprint=(idList)=>{
return $http.post('/management/reddatafootprinttype/delete',JSON.stringify(idList));
}
// 查询分类
export const getListByParams=()=>{
return $http.get('/management/reddatafootprinttype/getList');
}
//==================== 手抄报分类 =============================
export function getHandCopyTypeList(){
return $http({
url:'/management/reddatahandcopytype/getList',
method:'get',
})
}
export function saveHandCopyType(data){
return $http({
url:'/management/reddatahandcopytype/save',
method:'post',
data
})
}
export function updateHandCopySort(data){
return $http({
url:'/management/reddatahandcopytype/updateHandCopySort ',
method:'post',
data
})
}
export function deleteHandCopySort(data){
return $http({
url:'/management/reddatahandcopytype/delete ',
method:'post',
data
})
}
//==================== 活动/赛事分类 =============================
//活动分类
export function getActivityTypeList(){
return $http({
url:'/management/reddataactivitytype/getList',
method:'get',
})
}
export function saveActivityType(data){
return $http({
url:'/management/reddataactivitytype/save',
method:'post',
data
})
}
export function updateActivitySort(data){
return $http({
url:'/management/reddataactivitytype/updateActivitySort ',
method:'post',
data
})
}
export function deleteActivitySort(data){
return $http({
url:'/management/reddataactivitytype/delete ',
method:'post',
data
})
}
//赛事分类
export function getMatchTypeList(){
return $http({
url:'/management/reddatamatchtype/getList',
method:'get',
})
}
export function saveMatchType(data){
return $http({
url:'/management/reddatamatchtype/save',
method:'post',
data
})
}
export function updateMatchSort(data){
return $http({
url:'/management/reddatamatchtype/updateMatchSort ',
method:'post',
data
})
}
export function deleteMatchSort(data){
return $http({
url:'/management/reddatamatchtype/delete ',
method:'post',
data
})
}
//专题分类增删改查
export function courseThemeSave(data){
return $http({
url:'/localService/redcoursetheme/save',
method:'post',
data
})
}
export function courseThemeDelete(data){
return $http({
url:'/localService/redcoursetheme/delete',
method:'post',
data
})
}
export function courseThemeUpdate(data){
return $http({
url:'/localService/redcoursetheme/update',
method:'post',
data
})
}
export function courseThemeList(params){
return $http({
url:'/localService/redcoursetheme/list',
method:'get',
params
})
}
export function courseThemeSort(data){
return $http({
url:'/localService/redcoursetheme/updateSort',
method:'post',
data
})
}
export function courseThemeAll(params){
return $http({
url:'/localService/redcoursetheme/getListNoPage',
method:'get',
params
})
}

View File

@ -1,27 +0,0 @@
import $http from '../../utils/httpRequest'
// 新增部门√
export const addDepartment=(departmentName,parentId,parentName,responseUser,departmentRemark,departmentNumber)=>{
return $http.post('/sys/sysdepartment/save',{
departmentName,parentId,parentName,responseUser,departmentRemark,departmentNumber
})
}
// 修改部门√
export const updateDepartment=(departmentId,departmentName,parentId,parentName,responseUser,departmentRemark,departmentNumber)=>{
return $http.post('/sys/sysdepartment/update',{
departmentId,departmentName,parentId,parentName,responseUser,departmentRemark,departmentNumber
})
}
// 根据id批量删除部门√
export const deleteDepartmentsByIdArray=(departmentIdArray)=>{
return $http.post('/sys/sysdepartment/delete',JSON.stringify(departmentIdArray));
}
// 查询部门√
export const queryDepartmentById=(departmentId)=>{
return $http.get('/sys/sysdepartment/info/'+departmentId);
}
// 查询全部部门√
export const queryAllDepartments=()=>{
return $http.get('/sys/sysdepartment/list');
}

View File

@ -1,15 +0,0 @@
import axios from 'axios'
let request=axios.create({
baseURL:'http://123.57.0.201:8080'
})
export function UploadFile (data) {
// console.log(111)
return request({
url: '/csc/oss/upload',
headers: {
'Content-Type': 'multipart/form-data'
},
method: 'post',
data
})
}

View File

@ -1,98 +0,0 @@
/*
* @Author: ym
* @Date: 2021-09-28 16:17:10
* @LastEditTime: 2022-01-20 15:42:09
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \background-front-end\src\api\modules\footprint.js
*/
import $http from '../../utils/httpRequest'
/**
* 系统管理 意见反馈 查询删除
* @param {*} mainTypeName
* @returns
*/
// 查询景点所属分类列表
export const getFootprintTypeList=()=>{
return $http.post('/management/reddatafootprinttype/getFootprintTypeListNoPage');
}
// 查询景点列表
export const getFootPrintByParams=(data)=>{
return $http({
url:'/footprint/redfootprint/getFootPrintByParams',
method: 'get',
params: $http.adornParams(data)
})
}
//根据id获取景点/打卡地详情
export const getFootprintInfo=(url)=>{
return $http({
url: '/footprint/redfootprint/info/' + url,
method: 'get',
})
}
//添加一个景点 / 打卡地
export const saveNewFootprint=(data)=>{
return $http({
url:'/footprint/redfootprint/saveNewFootprint',
method: 'post',
data: $http.adornData(data)
})
}
//编辑修改打卡地 修改景点
export const editFootprint=(data)=>{
return $http({
url:'/footprint/redfootprint/update',
method: 'post',
data: $http.adornData(data)
})
}
//编辑批量删除打卡地 修改景点
export const deleteFootprintList=(data)=>{
return $http({
url:'/footprint/redfootprint/delete',
method: 'post',
data
})
}
// 查询景点路线列表
export const getFootprintLineList=(params)=>{
return $http({
url:"/footprint/redfootprintline/list",
method:'post',
params
})
}
// 添加景点路线
export const saveFootprintLine=(data)=>{
return $http({
url:"/footprint/redfootprintline/save",
method:'post',
data
})
}
// 编辑景点路线
export const updateFootprintLine=(data)=>{
return $http({
url:"/footprint/redfootprintline/update",
method:'post',
data
})
}
// 删除景点路线
export const deleteFootprintLine=(data)=>{
return $http({
url:"/footprint/redfootprintline/delete",
method:'post',
data
})
}
// 获取景点路线详情
export const getFootprintLineDetail=(id)=>{
return $http({
url:"/footprint/redfootprintline/info/"+id,
method:'get',
})
}

View File

@ -1,23 +0,0 @@
/*
* @Author: your name
* @Date: 2021-12-20 16:29:03
* @LastEditTime: 2021-12-20 16:31:37
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\api\modules\integral-statistics.js
*/
import $http from '../../utils/httpRequest'
// 查询积分详情
export const getIntegralDetail=(params)=>{
return $http({
url:'/score/detail',
params
})
}
// 查询积分概览
export const getIntegralOverview=()=>{
return $http({
url:'/score/count/table'
})
}

View File

@ -1,132 +0,0 @@
/*
* @author: ym
* @Date: 2021-10-10 13:45:17
* @LastEditTime: 2021-10-10 14:46:44
* @LastEditors: ym
* @Description:
* @FilePath: \background-front-end\src\api\modules\intetral.js
*/
import $http from '../../utils/httpRequest'
import dayjs from 'dayjs'
//**********未严格命名 */
//查询升级所需积分
export function findUploadIntegral(data){
return $http({
url:'/integral/redintegralupgrade/info/1'
})
}
//保存升级所需积分
export function saveUploadIntegral(upgradeId,integral){
return $http({
url:'/integral/redintegralupgrade/update',
method:'post',
data:{
integral,
upgradeId
}
})
}
//查看段位列表
export function findLevelType(){
return $http({
url:'/integral/redintegrallevel/list',
})
}
export function savelevelType(data){
return $http({
url:'/integral/redintegrallevel/update',
method:'post',
data
})
}
//**********未严格命名(结尾) */
//查询所有红星币规则
export function getRedCoinRule(params){
return $http({
url:'/integral/redstarcoinrule/getRedCoinRuleByParams',
params
})
}
//添加红星币规则
export function addRedCoinRule(data){
console.log(data)
return $http({
url:'/integral/redstarcoinrule/saveNewRule',
method:'post',
data
})
}
//删除红星币规则
export function deleteRedCoinRule(data){
return $http({
url:'/integral/redstarcoinrule/delete',
method:'post',
data
})
}
//更新红星币规则
export function updateRedCoinRule(data){
return $http({
url:'/integral/redstarcoinrule/update',
method:'post',
data
})
}
//查询所有积分规则
export function getIntegralRule(params){
return $http({
url:'/integral/redintegralrule/getRuleListByParams',
params
})
}
//添加积分规则
export function addIntegralRule(data){
return $http({
url:'/integral/redintegralrule/saveNewRule',
method:'post',
data
})
}
//更新所有积分规则
export function updateIntegralRule(data){
return $http({
url:'/integral/redintegralrule/update',
method:'post',
data
})
}
//删除所有积分规则
export function deleteIntegralRule(data){
return $http({
url:'/integral/redintegralrule/delete',
method:'post',
data
})
}
//查询积分协议
export function getInteralAgreement(data){
return $http({
url:'/integral/redintegralruleinfo/getInfoByContentType/'+data
})
}
//保存积分协议
export function saveInteralAgreement(ruleInfoId,ruleInfoContent,contentType){
return $http({
url:'/integral/redintegralruleinfo/update',
method:'post',
data:{
ruleInfoId,
ruleInfoContent,
contentType
}
})
}

View File

@ -1,101 +0,0 @@
import $http from '@/utils/httpRequest.js'
export const local_admin = {
/**
* 登录
* @param {object} params LoginParam
* @param {number} params.type
* @param {string} params.role
* @param {string} params.username
* @param {string} params.password
* @param {string} params.mobile
* @param {string} params.code
* @returns
*/
loginByAccount: (params) => {
return $http.post(`/auth/login`, {
...params,
type: 1
})
},
loginByMobile: (params) => {
return $http.post(`/merchant-api/auth/sms/login`, {
...params,
type: 2
})
},
getYZM(mobile) {
return $http.get(`/merchant-api/auth/login/code?mobile=${mobile}`);
},
getInfo() {
return $http.get(`/merchant-api/auth/info`);
},
//获取教育局列表
getEducationBureauList() {
return $http.get(`/org/area_edu`);
},
//获取学校分页
getSchoolPage: (data) => {
return $http.request({
url: `/school/page`,
method: 'get',
params: data
})
},
//添加学校
addSchool: (data) => {
return $http.post(`/school/add`, data);
},
//获取数据字典
getDictionary: (categoryId) => {
return $http.get(`/common/dict?categoryId=${categoryId}`);
},
//获取省市区
getArea: () => {
return $http.get(`/common/pca`);
},
//更新年级
updateGrade: (gradeId,data) => {
return $http.put(`/grade/update?gradeId=${gradeId}`, data);
},
//添加年级
addGrade: (data) => {
return $http.post(`/grade/add`, data);
},
//获取年级列表
getGradeList: () => {
return $http.get(`/grade/list`);
},
//删除年级
removeGrade: (gradeId) => {
return $http.delete(`/grade/delete?gradeId=${gradeId}`)
},
//添加班级
addClass:(data)=>{
return $http.post(`/clazz/add`,data);
},
//编辑班级
updateClass:(data)=>{
return $http.post(`/clazz/update?clazzId=${data.clazzId}`,data)
},
//获取班级列表
getClassList:()=>{
return $http.get(`/clazz/list`);
},
//删除班级
removeClass:(clazzId)=>{
return $http.delete(`/clazz/delete?clazzId=${clazzId}`)
},
//添加教师
addTeacher:(data)=>{
return $http.post(`/teacher/add`,data);
},
//获取教师分页
getTeacherPage:(data)=>{
return $http.request({
url:'/teacher/page',
method:'get',
params:data
})
}
}

View File

@ -1,5 +0,0 @@
import $http from "@/utils/httpRequest.js"
export const login={
}

View File

@ -0,0 +1,54 @@
import $http from '@/utils/httpRequest.js'
export const mer_admin = {
/**
* 登录
* @param {object} params LoginParam
* @param {number} params.type
* @param {string} params.role
* @param {string} params.username
* @param {string} params.password
* @param {string} params.mobile
* @param {string} params.code
* @returns
*/
loginByAccount: (params) => {
return $http.post(`/auth/login`, {
...params,
type: 1
})
},
loginByMobile: (params) => {
return $http.post(`/merchant-api/auth/sms/login`, {
...params,
type: 2
})
},
getYZM(mobile) {
return $http.get(`/merchant-api/auth/login/code?mobile=${mobile}`);
},
getInfo() {
return $http.get(`/merchant-api/auth/info`);
},
//商品管理
//保存商品信息
saveProduct:(data)=>{
return $http.post(`/merchant-api/product/save`,data);
},
//保存商品基本信息
saveProductBase:(data)=>{
return $http.post(`/merchant-api/product/save/basic`,data);
},
//返回商品分类以及列表(聚合)
getPolyProduct:(data)=>{
return $http.post(`/merchant-api/product/polymerization/list`,data);
},
//商品分页
getProductPage:(data)=>{
return $http.post(`/merchant-api/product/page`,data);
},
//商户商品分类
getProductCategory:()=>{
return $http.get(`/merchant-api/product/category/list?shopId=${JSON.parse(sessionStorage.getItem('userInfo')).shopId}`);
}
}

View File

@ -1,140 +0,0 @@
import $http from '../../utils/httpRequestUser'
// 个人中心接口
export const my={
// 认证
identifyCode(inviteCode){
return $http.post(`/user/redstudent/identifyCode`,inviteCode);
},
// 意见反馈
feedback(form){
return $http.post(`/user/redsystemfeedback/save`,form);
},
// ==================最近/学习记录 start==========================//
//获取历史记录
getStudyRecords(){
return $http.post(`/talk/userrecent/list`);
},
//清空历史记录
cleanRecently(){
return $http.get('talk/userrecent/delete');
},
// ==================最近/学习记录 end==========================//
//===================我的 start================================//
//获取用户信息
getUserInfo(){
return $http.get(`/user/reduser/getUserInfo`);
},
//=================积分 start================================//
//获取积分任务完成信息
getPointsTaskInfo(){
return $http.get(`/score/list`);
},
//获取最近7天积分明细
getPointsTask7Detail(){
return $http.get(`/score/weekList`)
},
// 获取特定日期的积分明细
getPointTaskDateDeatil(date){
return $http.post(`/score/getListByDay`,{
date
})
},
//获取积分说明
getPointExplain(contentType=1){
return $http.get(`/score/redintegralruleinfo/getInfo/${contentType}`);
},
//=================积分 end=================================//
// ================个人信息 start==========================//
// 更新用户信息
updateUserInfo(role,redPassportNumber,ids,data){
return $http.post(`/user/reduser/updateUserInfo`,{...data,role,...ids,redPassportNumber})
},
//=================个人信息 end===========================//
// ================红星榜 start==========================//
//获取顶部通用数据
getRedStarBoardData(){
return $http.get(`/score/getRedStarData`);
},
//获取足迹打卡榜单
getFootmarkRank(){
return $http.get(`/score/getFootprintRank`);
},
// 获取积分榜单
getPointRank(){
return $http.get(`/score/getRedStarRank`);
},
//=================红星榜 end=============================//
//================红色生涯 start=========================//
//获取红色生涯(获取时间轴)
getMyRedCareer(page=1,limit=20){
return $http.get(`/user/reduser/getRedCareer?page=${page}&limit=${limit}`)
},
//获取证书
getMyReward(){
return $http.get(`/activity/reduseraward/getAwardByUser`)
},
//================红色生涯 end==========================//
//================红星小铺 start============================//
// 获取分类列表
getGoodsTypeList(){
return $http.get(`/shop/dataproducttype/list`)
},
// 根据分类获取商品
getGoodsByType(productTypeName="",page=1,limit=20){
return $http.get(`/shop/shopproduct/list?productTypeName=${productTypeName}&page=${page}&limit=${limit}`)
},
//兑换记录
getExchangeRecord(page=1,limit=10){
return $http.get(`/shop/shoporder/list?page=${page}&limit=${limit}`)
},
//兑换详情
getExchangeRecordInfo(orderId){
return $http.get(`/shop/shoporder/info/${orderId}`)
},
//兑换/下单
buyGood(data){
return $http.post(`/shop/shoporder/save`,data)
},
//获取最近一周的红星币
geRedCointWeekList(){
return $http.get(`/shop/coinrecord/getWeekList`);
},
//根据日期查看获取的红星币明细
getRedCoinListByDay(date){
return $http.post(`/shop/coinrecord/getListByDay`,{
date
})
},
//================红星小铺 end============================//
//===============红色护照 start==========================//
getRedPassport(){
return $http.get(`/user/reduser/getRedPassport`)
},
//上传照片
uploadPhoto(redUserId,userPhoto){
return $http.post(`/user/reduser/update`,{
redUserId,userPhoto
})
},
//===============红色护照 end=============================//
//===============消息 start===========================//
//获取消息列表 总列表
getReportList(page,limit){
return $http.get(`/report/list`)
},
// 获取消息列表详情
getReportInfoList(type,page=1,limit=10){
return $http.get(`/report/listInfo?type=${type}&page=${page}&limit=${limit}`)
},
//==============消息 end==============================//
//==============咨询 start==============================//
getProblemResovleList(page=1,limit=10){
return $http.get(`/system/redsystemproblemsolve/list?page=${page}&limit=${limit}`);
},
// =============咨询 end ================================//
//通过第一次的欢迎仪式,通过后isFirst变为1
doneWelcomeCeremony(){
return $http.get(`/user/reduser/updateFirst`);
}
}

View File

@ -1,39 +0,0 @@
/*
* @Author: ym
* @Date: 2021-09-25 16:08:51
* @LastEditTime: 2021-09-25 16:20:08
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \piecework-treasure\src\api\modules\notice-management.js
*/
import $http from '../../utils/httpRequest'
// 添加新公告
export const addReport=(reportTitle,reportContent)=>{
return $http.post('/sys/report/save',{
reportTitle,reportContent
})
}
// 修改通知
export const updateReport=(reportId,reportTitle,reportContent)=>{
return $http.post('/sys/report/update',{
reportId,reportTitle,reportContent
})
}
// 删除通知
export const deleteReportsByIds=(reportIdsArray)=>{
return $http.post('/sys/report/delete',JSON.stringify(reportIdsArray))
}
// 日期条件都不传就查询全部 支持1.只传日期 2.传日期加条件
export const getReportsList=(condition,beginDay,endDay,page=1,limit=10)=>{
// 2010-08-29 00:00:00 2022-08-29 00:00:00
return $http.get(`/sys/report/list?page=${page}&limit=${limit}&beginDay=${beginDay}&endDay=${endDay}&condition=${condition}`)
}
// 通知详情
export const getReportInfo=(reportId)=>{
return $http.get(`/sys/report/info/${id}`)
}

View File

@ -1,39 +0,0 @@
//管理下属机构,总后台管理地方后台
import $http from '../../utils/httpRequest'
export const org={
//获取组织列表
getOrgList(){
return $http.get('/organization/list')
},
//创建机构
createOrg(data){
return $http.post('/organization/add',data)
},
//删除机构
deleteOrg(orgId){
return $http.put(`/organization/delete?orgId=${orgId}`)
},
//编辑机构
editOrg(orgId,data){
return $http.put(`/organization/update?orgId=${orgId}`,data)
},
//修改机构地方管理后台管理账号密码
//支持jsdoc
/**
* @param {Object} data
* @param {String} data.id
* @param {String} data.password
*/
changeAccountPassword(data){
return $http.put('/organization/update_local_password',data)
},
//分配地方后台管理账号
assignAccount(data){
return $http.post('/organization/assign_local_account',data)
},
//重新分配地方后台管理账号
reassignAccount(data){
return $http.post('/organization/reassign_local_account',data)
}
}

View File

@ -1,75 +0,0 @@
/*
* @Author: chenkangxu
* @Date: 2021-09-26 12:46:12
* @LastEditTime: 2021-09-26 22:15:17
* @LastEditors: chenkangxu
* @Description: 生产管理模块api
* @Github:
*/
import $http from '../../utils/httpRequest'
// #region 款式生产
/**
* @description: 新增款式
* @param {Object} data
* @return {*}
*/
export const addPattern=(data)=>{
/**
* {
createNumber: (...)
deliveryDay: (...)
orderNumber: (...)
patternCreateTime: (...)
patternName: (...)
patternNumber: (...)
patternRemark: (...)
* }
*/
return $http.post('/create/pattern/save',data)
}
/**
* @description: 查看款式
* @param {*}
* @return {*}
*/
export const getPatternInfo=(pattekrnId)=>{
return $http.get('/create/pattern/info/'+pattekrnId)
}
/**
* @description: 删除款式
* @param {*}
* @return {*}
*/
export const deletePatternsByIdsArray=(IdsArray)=>{
return $http.post('/create/pattern/delete',JSON.stringify(IdsArray))
}
/**
* @description: 修改款式和款式状态修改
* @param {*}
* @return {*}
*/
export const updatePattern=(patternId,patternName,workStatus)=>{
return $http.post('/create/pattern/update',{
patternId,patternName,workStatus
})
}
/**
* @description: 查看全部款式
* @param {*}
* @return {*}
*/
export const getPatternList=(data,page=1,limit=10)=>{
return $http.get(`/create/pattern/list?page=${page}&limit=${limit}&${data.timeType=='创建时间'?'':'D'}beginDay=${data.startDate}&${data.timeType=='创建时间'?'':'D'}endDay=${data.endDate}&workStatus=${data.status=='所有状态'?'':data.status}&isExistProcess=${data.onlyNoProcess}&condition=${data.filter}`);
}
/**
* @description: 查询对应款式得全部工序
* @param {*}
* @return {*}
*/
export const getProcessOfPattern=(patternId)=>{
return $http.get(`/create/process/listByPattern/${patternId}`)
}
// #endregion

View File

@ -1,217 +0,0 @@
/*
* @author: ym
* @Date: 2021-10-11 19:24:45
* @LastEditTime: 2022-08-03 17:38:13
* @LastEditors: 陈伟亮 1186723967@qq.com
* @Description:
* @FilePath: \background-front-end\src\api\modules\service.js
*/
//===================== 服务 =============================
import $http from '../../utils/httpRequest'
// 轮播图管理
// 增
export const saveLocalServiceImage=(content)=>{
return $http.post('/localService/redstudyimage/save',JSON.stringify(content))
}
// 删
export const deleteLocalServiceImage=(idList)=>{
return $http.post('/localService/redstudyimage/delete',JSON.stringify(idList));
}
// 改
export const updateLocalServiceImage=(ids)=>{
return $http.post('/localService/redstudyimage/update',JSON.stringify(ids))
}
// 查
export const getLocalServiceImage=(obj)=>{
return $http({
url:'/localService/redstudyimage/getListByParams',
method: 'get',
params: $http.adornParams(obj)
})
}
// 课程
// 增
export const saveNewCourse=(content)=>{
return $http.post('/localService/redstudycourse/saveNewCourse',JSON.stringify(content))
}
// 删
export const deleteRedCourse=(ids)=>{
return $http.post('/localService/redstudycourse/delete',ids);
}
// 改
export const updateRedCourse=(content)=>{
return $http.post('/localService/redstudycourse/updateCourse',JSON.stringify(content))
}
// 查
export const getCourseListByParams=(obj)=>{
return $http({
url:'/localService/redstudycourse/getCourseListByParams',
method: 'get',
params: $http.adornParams(obj)
})
}
// 修改课程排序号
export const updateCourseListSort=(data)=>{
console.log(data)
return $http({
url:'/localService/redstudycourse/updateBatchSort',
method: 'post',
data
})
}
// 古诗词
// 增
export const saveRedPoetry=(content)=>{
return $http.post('/localService/redpoetry/save',JSON.stringify(content))
}
// 删
export const deleteRedPoetry=(ids)=>{
return $http.post('/localService/redpoetry/delete',JSON.stringify(ids));
}
// 改
export const updateRedPoetry=(content)=>{
return $http.post('/localService/redpoetry/update',JSON.stringify(content))
}
// 查
export const getPoetryByParams=(obj)=>{
return $http({
url:'/localService/redpoetry/getPoetryByParams',
method: 'get',
params: $http.adornParams(obj)
})
}
//教育局学校管理
// 增 教育局超管
export const saveNewEducation=(content)=>{
return $http.post('/localService/rededucation/saveNewEducation',JSON.stringify(content))
}
// 增 学校超管
export const saveNewSchool=(content)=>{
return $http.post('/localService/redschool/saveNewSchool',JSON.stringify(content))
}
// // 删
// export const deleteRedPoetry=(ids)=>{
// return $http.post('/localService/redpoetry/delete',JSON.stringify(ids));
// }
// 改
// 修改教育局
export function updateEducation (content) {
return $http.post('/localService/rededucation/updateEducation',JSON.stringify(content))
}
// 修改角色
export function updateSchool (content) {
return $http.post('/localService/redschool/updateSchool',JSON.stringify(content))
}
// 查 教育局
export const getEducationByParams=(obj)=>{
return $http({
url:'/localService/rededucation/getList',
method: 'get',
params: $http.adornParams(obj)
})
}
// 查 学校
export const getSchoolByParams=(obj)=>{
return $http({
url:'/localService/redschool/getList',
method: 'get',
params: $http.adornParams(obj)
})
}
// 获取角色列表, 根据当前用户
export const selectRoles=()=>{
return $http({
url:'/sys/role/select'
})
}
// 查 详情
export const getEducationInfo=(id)=>{
return $http({
url:'/localService/rededucation/info/'+id,
method: 'get'
})
}
//=================手抄报管理==================
//查询
export function getHandlCopyManagementList(params){
return $http({
url:'/localService/redhandcopy/getListByParams',
method:'get',
params
})
}
//修改
export function updateHandlCopyManagement(data){
return $http({
url:'/localService/redhandcopy/update',
method:'post',
data
})
}
//删除
export function deleteHandlCopyManagementList(data){
return $http({
url:'/localService/redhandcopy/delete',
method:'post',
data
})
}
//添加
export function saveHandlCopyManagement(data){
return $http({
url:'/localService/redhandcopy/save',
method:'post',
data
})
}
//=================资讯管理==================
// 增
export const saveServiceNewInfo=(content)=>{
return $http.post('/localService/redstudyinfo/save',JSON.stringify(content))
}
// 删
export const deleteServiceNewInfo=(idList)=>{
return $http.post('/localService/redstudyinfo/delete',JSON.stringify(idList));
}
// 改
export const updateServiceNewInfo=(ids)=>{
return $http.post('/localService/redstudyinfo/update',JSON.stringify(ids))
}
// 查
export const geServiceNewInfoListByParams=(obj)=>{
return $http({
url:'/localService/redstudyinfo/getStudyInfoListByParams',
method: 'get',
params: $http.adornParams(obj)
})
}
export const service={
//添加题库
addQuestionBatch(data){
return $http.post(`/project/pruserprojectitem/saveBatch`,JSON.stringify(data))
},
//删除某个题目
deleteQuestion(questionIdsArray){
return $http.post(`/project/pruserprojectitem/delete`,JSON.stringify(questionIdsArray));
},
//修改某个题目
editQuestion(data){
data.expand=JSON.stringify(data.expand)
data.regList=JSON.stringify(data.regList)
return $http.post(`/project/pruserprojectitem/update`,data)
},
//获取题库列表
getQuestionList(params){
return $http.get(`/project/pruserprojectitem/list`,{params});
}
}

View File

@ -1,49 +0,0 @@
/*
* @author: ym
* @Date: 2021-11-02 13:39:40
* @LastEditTime: 2021-11-02 13:43:07
* @LastEditors: ym
* @Description:
* @FilePath: \background-front-end\src\api\modules\shop-system.js
*/
import $http from '../../utils/httpRequest'
//===================== 商品分类 =============================
// 新增分类
export const saveDataProductType=(typeName)=>{
return $http.post('/management/reddataproducttype/save',JSON.stringify(typeName))
}
// 批量修改
export const updateProductTypeSort=(list)=>{
return $http.post('/management/reddataproducttype/updateProductTypeSort',JSON.stringify(list))
}
// // 根据id批量删除
export const deleteProductType=(idList)=>{
return $http.post('/management/reddataproducttype/delete',JSON.stringify(idList));
}
// 查询分类
export const getProductTypeListByParams=()=>{
return $http.get('/management/reddataproducttype/getList');
}
//===================== 商品管理 =============================
// 新增分类
export const saveProduct=(obj)=>{
return $http.post('/shop/redshopproduct/save',JSON.stringify(obj))
}
// 批量修改
export const updateProduct=(obj)=>{
return $http.post('/shop/redshopproduct/update',JSON.stringify(obj))
}
// // 根据id批量删除
export const deleteProduct=(idList)=>{
return $http.post('/shop/redshopproduct/delete',JSON.stringify(idList));
}
// 查询分类
export const getProductListByParams=(obj)=>{
return $http.request({
method: 'get',
params:obj,
url:"/shop/redshopproduct/getListByParams"
})
// return $http.get('/shop/redshopproduct/getListByParams',JSON.stringify(obj));
}

View File

@ -1,389 +0,0 @@
import $http from '../../utils/httpRequestUser.js'
// 学习接口
export const study = {
// 获取轮播图列表
getStudySwiper() {
return $http.get(`/study/redstudyimage/getList`);
},
// 获取学习资讯列表
getStudyNews(page = 1, limit = 20) {
return $http.get(`/study/redstudyinfo/list?page=${page}&limit=${limit}`)
},
// 获取资讯详情
getStudyNewsInfo(contentInfoId) {
return $http.get(`/study/redstudyinfo/info/${contentInfoId}`)
},
//获取轮播图资讯
getStudySwiperInfo(contentInfoId) {
return $http.get(`/study/redstudyimage/info/${contentInfoId}`)
},
//=============教师观察start==============//
//判断是否为老师
judgeIsTeacher() {
return $http.get(`/user/redteacher/isTeacher`);
},
// 获取邀请码
createInviteCode(teacherId) {
return $http.get(`/user/redteacher/createCode/${teacherId}`)
},
// 获取成员列表和创建的邀请码
getClassInfoByTeacherId(teacherId) {
return $http.get(`/user/redteacher/getClassInfoByTeacherId/${teacherId}`)
},
// 获取申请列表
getStudentApplyList(teacherId) {
return $http.get(`/user/redteacher/getStudentApplyList/${teacherId}`)
},
// 申请通过
getAgreeApply(userId) {
return $http.get(`/user/redteacher/getAgreeApply/${userId}`)
},
// 申请通过
deleteStudent(studentId) {
return $http.get(`/user/redteacher/deleteStudent/${studentId}`)
},
//查询爱国主义课程学习情况
getStudentStudyStatus(courseId /* 课程id */ , teacherId /* 教师id */ ) {
return $http.get(`/user/redteacher/getUserStudyList?courseId=${courseId}&teacherId=${teacherId}`);
},
//获取当前老师的所有管理的课程(每个老师的课程都是一样的)
getAllCourseByTeacherId() {
return $http.get(`/user/redteacher/getCourseList`)
},
// 催学生
urgeStudents(userIdsAndCourseIdsArray) {
return $http.post(`/report/pushStudent`, JSON.stringify(userIdsAndCourseIdsArray))
},
//=============教师观察end===================//
// ============爱国主义教育start================//
// 获取爱国主义课程列表
getPatriotismCourseList(page = 1, limit = 20) {
return $http.get(`/study/redstudycourse/getList?page=${page}&limit=${limit}`);
},
// 获取爱国主页课程详情
getPatriotismCourseInfo(courseId /* 课程id */ ) {
return $http.get(`/study/redstudycourse/getCourseInfoById/${courseId}`)
},
// 完成课程的接口
finishCourse(courseId) {
return $http.get(`/study/redstudycourse/videoIsOver/${courseId}`);
},
// 提交试卷 接口文档https://easydoc.net/s/80870525/lFkazUXb/ccBRVOz7
submitExam(data) {
return $http.post(`/study/redstudycourse/submitPaper`, data)
},
//=============爱国主义教育end===================//
//=============古诗词学习start=================//
//获取古诗分类
getPoetryType() {
return $http.get(`/study/reddatapoetrymaintype/list`);
},
// 获取古诗列表
getPoetryList(secondTypeId /* 古诗类型id */ , page, limit) {
return $http.get(`/study/redpoetry/list?secondTypeId=${secondTypeId}&page=${page}&limit=${limit}`)
},
//古诗全文搜索
searchPoetryByName(searchName) {
return $http.get(`/study/redpoetry/searchPoetry?searchName=${searchName}`)
},
//获取古诗详情
getPoetryInfo(poetryId /* 古诗id */ ) {
return $http.post(`/study/redpoetry/info/${poetryId}`)
},
//=============古诗词学习end==================//
//============手抄报start===================//
// 获取手抄报类型
getHandPaperType() {
return $http.get(`/study/reddatahandcopytype/list`);
},
// 获取手抄报列表
getHandPaperList(typeId, searchName = '') {
return $http.get(`/study/redhandcopy/list?typeId=${typeId}&searchName=${searchName}`);
},
// 获取手抄报详情
getHandPaperInfo(handPaperId) {
return $http.post(`/study/redhandcopy/info/${handPaperId}`);
},
//手抄报点赞
likePaper(articleId) {
return $http.post(`/study/redhandcopy/up`, {
articleId
})
},
//手抄报取消点赞
cancelLikePaper(articleId) {
return $http.post(`/study/redhandcopy/cancelup`, {
articleId
})
},
//===========手抄报end================//
//==========立德树人以及家教家风 start============//
//获取立德树人列表 废弃
getMoralityEducationList(page = 1, limit = 20) {
return $http.get(`/study/redstudyinfo/getFamilyList`);
},
//获取家教家风列表 废弃
getFamilyStyleList(page = 1, limit = 20) {
return $http.get(`/study/redstudyinfo/getVirtueList`);
},
//统一获取立德树人、爱国主义、家教家风
getRedStudyCourse(courseType, page = 1, limit = 20,searchName='',courseGrade=1,courseThemeId="") {
return $http.get(`/study/redstudycourse/getList?courseType=${courseType}&page=${page}&limit=${limit}&title=${searchName}&courseGrade=${courseGrade}&courseThemeId=${courseThemeId}`)
},
//==========立德树人以及家教家风 end============//
//==========课堂 start=========================//
// 创建课堂
/**
* @description 创建课堂
* @param {String} courseName 课程名称
* @param {String} courseUrl 课程图片
*/
createClassroom(courseName, courseUrl) {
return $http.post(`/course/save`, {
courseName,
courseUrl
})
},
/**
* @description 删除课堂
* @param {Array<String>} courseIdsArray 要删除的课程id数组
*/
deleteClassroom(courseIdsArray) {
return $http.post(`/course/delete`, JSON.stringify(courseIdsArray))
},
/**
* @description 修改课堂信息
* @param {String} courseId 要更改的课堂id
* @param {String} courseName 要更改的名字
* @param {String} courseUrl 要更改的课堂图片OSS地址
*/
updateClassroom(courseId, courseName, courseUrl) {
return $http.post(`/course/update`, {
courseId,
courseName,
courseUrl
})
},
/**
* @description 查看对应的课堂详情
* @param {String} courseId 要查看的课堂id
*/
getClassroomInfo(courseId) {
return $http.get(`/course/info/${courseId}`);
},
/**
* @description 查询课堂列表
*/
getClassroomsList(page = 1, litmit = 10) {
return $http.get(`/course/list?page=${page}&litmit=${litmit}`);
},
/**
* @description 批量拉学生进课堂
* @param {String[]} userIds 课堂id
* * @param {String} courseId 课堂id
*/
saveStudents(userIds,courseId){
return $http.post(`/course/saveStudents`,{
userIds,
courseId
})
},
/**
* @description 获取课堂邀请码
* @param {String} courseId 课堂id
*/
getInviteCode(courseId) {
return $http.get(`/course/createCode/${courseId}`);
},
/**
* @description 根据邀请码加入课堂
* @param {String} inviteCode 邀请码
*/
joinInClassroomByInviteCode(inviteCode) {
return $http.get(`/course/saveUserByCode/${inviteCode}`)
},
/**
* @description 发布讨论
* @param {String} talkTitle 讨论标题
* @param {String} talkContent 讨论内容
* @param {String} courseId 要发布到的课堂id
*/
createTalk(talkTitle, talkContent, courseId) {
return $http.post(`/talk/talk/save`, {
talkTitle,
talkContent,
courseId
})
},
/**
* @description 获取对应的课堂里的讨论列表
* @param {String} courseId 对应的课堂id
*/
getTalkList(courseId,page=1,limit=10) {
return $http.get(`/talk/talk/list?courseId=${courseId}&page=${page}&limit=${limit}`);
},
/**
* @description 删除讨论
* @param {Array<String>} talkIdsArray 对应的讨论id数组
*/
deleteTalk(talkIdsArray) {
return $http.post(`/talk/talk/delete`, JSON.stringify(talkIdsArray));
},
/**
* @description 更新讨论
* @param {String} talkId 讨论id
* @param {String} talkTitle 讨论标题
* @param {String} talkContent 话题内容
*/
updateTalk(talkId,talkTitle,talkContent) {
return $http.post(`/talk/talk/update`, {
talkId,talkTitle,talkContent
})
},
/**
* @description 获取讨论详情
* @param {String} talkId 讨论id
*/
getTalkInfo(talkId){
return $http.post(`/talk/talk/info/${talkId}`);
},
/**
* @description 回复讨论
* @param {String} parentId 回复的talkId
* @param {String} commentContent 回复内容
* @param {String} commentImg 回复的图片
*/
replyTalk(talkId,commentContent,commentImg){
return $http.post(`/talk/talk/saveComment`,{
parentId:talkId,commentContent,commentImg
})
},
/**
* @description 删除回复的讨论
* @param {Array<String>} commentIdsArray 要删除的回复id的数组
*/
deleteReplyTalk(commentIdsArray){
return $http.post(`/talk/comment/delete`,JSON.stringify(commentIdsArray));
},
/**
* @description 查询课堂的所有学生
*/
classroomStudentList(courseId,name='',page=1,limit=10){
return $http.get(`/course/usercourse/list?courseId=${courseId}&name=${name}&page=${page}&limit=${limit}`);
},
/**
* @description 移除学生
*/
removeStudent(ucIdsArray){
return $http.post(`/course/usercourse/delete`,JSON.stringify(ucIdsArray));
},
//==========课堂 end===========================//
//==========动态 分享 start======================//
/**
* @description 获取该课堂的所有动态与分享 目前就两种成绩分享和文章分享
* @param {String} 要分享到的课堂id
* @param {String} page limit
*/
getShareList(courseId,page,limit){
return $http.get(`/user/share/list?courseId=${courseId}&page=${page}&limit=${limit}`)
},
/**
* @description 分享到课堂
* @param {Object} data {articleType,articleId,comment,courseId,score}
**/
shareToClassroom(data){
return $http.post(`/user/share/save`,data)
},
/**
* @description 删除我的分享
* @param {Array<String>} shareIdsArray 分享id字符串数组
**/
deleteMyShare(shareIdsArray){
return $http.post(`/user/share/delete`,JSON.stringify(shareIdsArray));
},
//==========动态 分享 end========================//
//===============提升练习 start==================//
/**
* @description 根据练习类型获取提升练习列表
* @param {String} practiceType 练习类型
* @param {String} searchName 模糊搜索
**/
getPracticesListByType(practiceType,page,limit,searchName='',courseThemeId){
return $http.get(`/study/redteacherpractice/getListByType?page=${page}&limit=${limit}&practiceType=${practiceType}&practiceName=${searchName}&courseThemeId=${courseThemeId}`);
},
/**
* @description 根据练习id获取练习详情
* @param {String} practiceId 练习id
**/
getPracticeInfoById(practiceId){
return $http.get(`/study/redteacherpractice/getPracticeInfoById/${practiceId}`)
},
/**
* @description 提交练习
* @param {Object} data 对应的数据
**/
submitPractice(data){
return $http.post(`/study/redteacherpractice/submitPractice`,data)
},
//===============提升练习 end====================//
//===============教师发布提升练习 题库 start================//
/**
* @description 获取对应专题的题库数据
*/
getPracticeList(itemType,page=1,limit=10,courseThemeId=''){
return $http.get(`/project/pruserprojectitem/list?page=${page}&limit=${limit}&itemType=${itemType}&courseThemeId=${courseThemeId}`)
},
/**
* @description 根据勾选的题库进行发布随堂练习
*/
sendNewPractice(data){
return $http.post(`/study/redteacherpractice/saveNewPractice`,data)
},
/**
* @description 查询我发布的练习
*/
getMyPublishedPractice(practiceType,page=1,limit=10,searchName='',courseThemeId){
return $http.request({
url:"/study/redteacherpractice/getPracticeByTeacher",
method:"get",
data:{
page,limit,searchName,practiceType,courseThemeId
}
})
},
/**
* @description 查看当前练习的详情以及完成情况
* @param {String} practiceId
*/
getMyPublishedPracticeInfo(practiceId){
return $http.get(`/study/redteacherpractice/getPracticeDetailsById/${practiceId}`)
},
/**
* @description 移除我发布的随堂练习
* @param {Array<String>} practiceIdsArray 随堂练习id数组
*/
removeMyPublishedPractice(practiceIdsArray){
return $http.post(`/study/redteacherpractice/deletePractice`,JSON.stringify(practiceIdsArray))
},
//===============教师发布提升练习 end================//
/**
* @description 获取学习模块下的分类 如点击思想教育获取下列的伟大领袖红色印记英烈人物爱国情怀
*/
getStudySecondModule(courseType){
return $http.get(`/study/redcoursetheme/getListByType?courseType=${courseType}`)
},
/**
* @@description 获取待学习的课程列表
*/
getStudyingCourseList(courseGrade=1,courseType='',courseThemeId=''){
return $http.get(`/study/redstudycourse/getNotStudyCourse?courseGrade=${courseGrade}&courseType=${courseType}&courseThemeId=${courseThemeId}`)
}
}

View File

@ -1,65 +0,0 @@
/*
* @Author: ym
* @Date: 2021-09-28 16:17:10
* @LastEditTime: 2022-08-11 18:37:54
* @LastEditors: 陈伟亮 1186723967@qq.com
* @Description: In User Settings Edit
* @FilePath: \piecework-treasure\src\api\modules\content-type.js
*/
import $http from '../../utils/httpRequest'
/**
* 系统管理 意见反馈 查询删除
* @param {*} mainTypeName
* @returns
*/
// 根据id批量删除意见反馈
export const deleteFeedback=(idList)=>{
return $http.post('/management/redsystemfeedback/delete',JSON.stringify(idList));
}
// 查询意见反馈列表
export const getFeedbackByParams=()=>{
return $http.get('/management/redsystemfeedback/getFeedbackByParams');
}
//保存公告
export const addReport=(reportTitle,reportContent,reportType='system')=>{
return $http.post(`/report/save`,{
reportType,reportTitle,reportContent
});
}
//查看全部公告
export const getReportsList=(page=1,limit=10)=>{
return $http.get(`/report/list?page=${page}&limit=${limit}`)
}
// 查看公告
export const getReportInfo=(reportId)=>{
return $http.get(`/report/info/${reportId}`)
}
// 删除公告
export const deleteReportsByIds=(ids)=>{
return $http.post(`/report/delete`,JSON.stringify(ids))
}
//修改公告
export const updateReport=(reportId,reportTitle,reportContent)=>{
return $http.post(`/report/update`,{
reportId,reportTitle,reportContent
})
}
//修改公告
export const savePreviewRichText=(data)=>{
return $http.post(`/text/redtext/save`,data)
}
/**
* 系统管理 常见问题 增删改查
* @param {*} mainTypeName
* @returns
*/
//上传富文本图片
export const richTextImgUpload=(url)=>{
return $http({
url: '/sys/oss/upload',
method: 'post',
data: {text:url}
})
}

View File

@ -1,61 +0,0 @@
/*
* @Author: your name
* @Date: 2021-10-08 17:39:17
* @LastEditTime: 2022-01-02 15:07:46
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\api\modules\user.js
*/
import $http from '../../utils/httpRequest'
//查询会员列表
export function getUserList(params){
return $http({
url:'/redMember/reduser/getUserListByParams',
params
})
}
//查询会员详情
export function getUserDetail(id){
return $http({
url:'/redMember/reduser/info/'+id,
})
}
//更新会员信息
export function updateUserList(data){
return $http({
url:'redMember/reduser/update',
method:'post',
data
})
}
//查询用户协议
export function getUserAgreement(){
return $http({
url:'/redMember/redpublishagreement/info/1',
})
}
//保存用户协议
export function saveUserAgreement(data){
return $http({
url:'/redMember/redpublishagreement/update',
method:'post',
data
})
}
// 查询红色护照
export function getUserRedPassport(){
return $http({
url:'/redMember/redpassport/info/1',
})
}
// 保存红色护照
export function saveUserRedPassport(data){
return $http({
url:'/redMember/redpassport/update',
method:'post',
data
})
}

View File

@ -1,35 +0,0 @@
/*
* @Author: ym
* @Date: 2021-09-23 20:34:59
* @LastEditTime: 2021-09-27 22:01:58
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \piecework-treasure\src\api\modules\userManage.js
*/
import $http from '../../utils/httpRequest'
// 批量查询人员
export const queryUser=(obj)=>{
return $http.get(`/sys/user/list?page=${obj.page}&limit=${obj.limit}&departmentName=${obj.departmentName}&userTypeName=${obj.userTypeName}&wokerTypeName=${obj.workerTypeName}&userStatus=${obj.userStatus}&condition=${obj.condition}`);
}
// 添加人员
export const saveUser=(obj)=>{
return $http.post('/sys/user/save',JSON.stringify(obj));
}
// 查询人员
export const selectUser=(id)=>{
return $http.get('/sys/user/info/'+id);
}
// 修改人员
export const editUser=(obj)=>{
return $http.post('/sys/user/update',JSON.stringify(obj));
}
// 删除人员
export const deleteUser=(obj)=>{
return $http.post('/sys/user/delete',JSON.stringify(obj));
}
// 批量修改
// [{"userId":3,"userStatus":"测试1"},{"userId":4,"userStatus":"测试2"}]
export const updateBatch=(obj)=>{
return $http.post('/sys/user/updateBatch',JSON.stringify(obj));
}

View File

@ -1,39 +0,0 @@
/*
* @Author: chenkangxu
* @Date: 2022-08-26 16:59:26
* @LastEditTime: 2022-08-26 17:00:07
* @LastEditors: chenkangxu
* @Description:
* @Github:
*/
import $http from '@/utils/httpRequest'
export const version={
addAppVersion:(data)=>{
return $http({
url: '/sys/version/save',
method:'post',
data
})
},
delAppVersion:(data)=>{
return $http({
url: '/sys/version/delete',
method:'post',
data
})
},
updateAppVersion:(data)=>{
return $http({
url: '/sys/version/update',
method:'post',
data
})
},
getAppVersion:(params)=>{
return $http({
url: '/sys/version/list',
method:'post',
params
})
}
}

33
src/filters/accounts.js Normal file
View File

@ -0,0 +1,33 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
//财务过滤器
/**
* 资金流水 交易类型
*/
export function transactionTypeFilter(status) {
const statusMap = {
pay_order: '订单支付',
refund_order: '订单退款',
};
return statusMap[status];
}
/**
* 转账类型
*/
export function transferTypeFilter(status) {
const statusMap = {
bank: '银行卡',
alipay: '支付宝',
wechat: '微信',
};
return statusMap[status];
}

294
src/filters/commFilter.js Normal file
View File

@ -0,0 +1,294 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import * as constants from '@/utils/constants.js';
import { formatDates } from '@/utils/index';
// 公共过滤器
export function filterEmpty(val) {
let _result = '-';
if (!val) {
return _result;
}
_result = val;
return _result;
}
// 时间过滤器
export function formatDate(time) {
if (time !== 0) {
const date = new Date(time * 1000);
return formatDates(date, 'yyyy-MM-dd hh:mm');
}
}
export function filterYesOrNo(value) {
return value ? '是' : '否';
}
export function filterShowOrHide(value) {
return value ? '显示' : '不显示';
}
export function filterShowOrHideForFormConfig(value) {
return value === '0' ? '显示' : '不显示';
}
export function filterYesOrNoIs(value) {
return value ? '否' : '是';
}
export function filterCategroyType(value) {
return constants.categoryType.filter((item) => value === item.value)[0].name;
}
export function filterConfigCategory(value) {
return constants.configCategory.filter((item) => value === item.value)[0].label;
}
/**
* @description 公众号回复类型
*/
export function keywordStatusFilter(status) {
const statusMap = {
text: '文字消息',
image: '图片消息',
news: '图文消息',
voice: '声音消息',
};
return statusMap[status];
}
/**
* @description 优惠券类别
*/
export function couponCategoryFilter(status) {
const statusMap = {
1: '店铺',
2: '商品',
3: '通用',
4: '品类',
5: '品牌',
6: '跨店',
};
return statusMap[status];
}
/**
* @description 优惠券类型
*/
export function couponTypeFilter(status) {
const statusMap = {
1: '商家券',
2: '商品券',
3: '平台券',
};
return statusMap[status];
}
/**
* @description 优惠券领取方式
*/
export function couponUserTypeFilter(status) {
const statusMap = {
1: '手动领取',
2: '赠送券',
};
return statusMap[status];
}
/**
* @description 文章分类
*/
export function articleTypeFilter(status) {
if (!status) {
return '';
}
let arrayList = JSON.parse(localStorage.getItem('articleClass'));
if (arrayList.filter((item) => Number(status) === Number(item.id)).length < 1) {
return '';
}
return arrayList.filter((item) => Number(status) === Number(item.id))[0].name;
}
/**
* @description 支付状态
*/
export function payStatusFilter(status) {
const statusMap = {
false: '未支付',
true: '已支付',
};
return statusMap[status];
}
/**
* @description 提现方式
*/
export function extractTypeFilter(status) {
const statusMap = {
bank: '银行卡',
alipay: '支付宝',
weixin: '微信',
};
return statusMap[status];
}
/**
* @description 充值类型
*/
export function rechargeTypeFilter(status) {
const statusMap = {
public: '微信公众号',
weixinh5: '微信H5支付',
routine: '小程序',
};
return statusMap[status];
}
/**
* @description 财务审核状态
*/
export function extractStatusFilter(status) {
const statusMap = {
'-1': '已拒绝',
0: '审核中',
1: '已提现',
};
return statusMap[status];
}
/**
* @description 砍价状态
*/
export function bargainStatusFilter(status) {
const statusMap = {
1: '进行中',
2: '未完成',
3: '已成功',
};
return statusMap[status];
}
/**
* @description 砍价状态
*/
export function bargainColorFilter(status) {
const statusMap = {
1: '',
2: 'danger',
3: 'success',
};
return statusMap[status];
}
/**
* @description 拼团状态
*/
export function groupStatusFilter(status) {
const statusMap = {
1: '进行中',
2: '已成功',
3: '未完成',
};
return statusMap[status];
}
/**
* @description 拼团状态
*/
export function groupColorFilter(status) {
const statusMap = {
1: '',
2: 'success',
3: 'danger',
};
return statusMap[status];
}
/**
* @description 一号通tab值
*/
export function onePassTypeFilter(status) {
const statusMap = {
sms: '短信',
copy: '商品采集',
expr_query: '物流查询',
expr_dump: '电子面单打印',
};
return statusMap[status];
}
/**
* @description 视频号草稿商品微信审核状态
*/
export function editStatusFilter(status) {
const statusMap = {
'-1': '违规/风控系统下',
'-2': '平台下架',
'-3': '商家下架',
1: '未审核',
2: '审核中',
3: '审核失败',
4: '审核成功',
};
return statusMap[status];
}
/**
* @description 视频号草稿商品平台审核状态
*/
export function platformStatusFilter(status) {
const statusMap = {
1: '未审核',
2: '审核中',
3: '审核失败',
4: '审核成功',
};
return statusMap[status];
}
/**
* @description 视频号正式商品状态
*/
export function videoStatusFilter(status) {
const statusMap = {
0: '初始值',
5: '上架',
11: '自主下架',
13: '违规下架/风控系统下架',
};
return statusMap[status];
}
/**
* @description 角色类型
*/
export function roleTypeFilter(status) {
const statusMap = {
platform: '平台',
merchant: '商户',
system: '系统',
};
return statusMap[status];
}
/**
* @description 秒杀商品活动状态
*
*/
export function activityStatusFilter(status) {
const statusMap = {
0: '未开始',
1: '进行中',
2: '已结束',
};
return statusMap[status];
}

86
src/filters/index.js Normal file
View File

@ -0,0 +1,86 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
// import parseTime, formatTime and set to filter
export { parseTime, formatTime } from '@/utils';
export * from '../filters/commFilter';
export * from '../filters/user';
export * from '../filters/order';
export * from '../filters/wx';
export * from '../filters/merchant';
export * from '../filters/accounts';
export * from '../filters/product';
/**
* Show plural label if time is plural number
* @param {number} time
* @param {string} label
* @return {string}
*/
function pluralize(time, label) {
if (time === 1) {
return time + label;
}
return time + label + 's';
}
/**
* @param {number} time
*/
export function timeAgo(time) {
const between = Date.now() / 1000 - Number(time);
if (between < 3600) {
return pluralize(~~(between / 60), ' minute');
} else if (between < 86400) {
return pluralize(~~(between / 3600), ' hour');
} else {
return pluralize(~~(between / 86400), ' day');
}
}
/**
* Number formatting
* like 10000 => 10k
* @param {number} num
* @param {number} digits
*/
export function numberFormatter(num, digits) {
const si = [
{ value: 1e18, symbol: 'E' },
{ value: 1e15, symbol: 'P' },
{ value: 1e12, symbol: 'T' },
{ value: 1e9, symbol: 'G' },
{ value: 1e6, symbol: 'M' },
{ value: 1e3, symbol: 'k' },
];
for (let i = 0; i < si.length; i++) {
if (num >= si[i].value) {
return (num / si[i].value).toFixed(digits).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, '$1') + si[i].symbol;
}
}
return num.toString();
}
/**
* 10000 => "10,000"
* @param {number} num
*/
export function toThousandFilter(num) {
return (+num || 0).toString().replace(/^-?\d+/g, (m) => m.replace(/(?=(?!\b)(\d{3})+$)/g, ','));
}
/**
* Upper case first char
* @param {String} string
*/
export function uppercaseFirst(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}

33
src/filters/merchant.js Normal file
View File

@ -0,0 +1,33 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
//商户过滤器
/**
* 商户创建类型
*/
export function merCreateTypeFilter(status) {
const statusMap = {
admin: '管理员创建',
apply: '商户入驻申请',
};
return statusMap[status];
}
/**
* 商户类别
*/
export function selfTypeFilter(status) {
const statusMap = {
true: '自营',
false: '非自营',
};
return statusMap[status];
}

96
src/filters/order.js Normal file
View File

@ -0,0 +1,96 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
//订单过滤器
/**
* @description 支付状态
*/
export function paidFilter(status) {
const statusMap = {
true: '已支付',
false: '未支付',
};
return statusMap[status];
}
/**
* @description 订单状态
* 2,已收货待评价
*/
export function orderStatusFilter(status) {
const statusMap = {
0: '待付款',
1: '待发货',
2: '部分发货',
3: '待核销',
4: '待收货',
5: '已收货',
6: '已完成',
9: '已取消',
};
return statusMap[status];
}
/**
* @description 订单中的退款状态
*/
export function orderRefundStatusFilter(status) {
const statusMap = {
0: '未退款',
1: '申请退款中',
2: '部分退款',
3: '已退款',
};
return statusMap[status];
}
/**
* @description 退款单退款状态
*
*/
export function refundStatusFilter(status) {
const statusMap = {
0: '待审核',
1: '商家拒绝',
2: '退款中',
3: '退款成功',
4: '用户退货',
5: '商家待收货',
6: '已撤销',
};
return statusMap[status];
}
/**
* @description 支付方式
*/
export function payTypeFilter(status) {
const statusMap = {
weixin: '微信',
alipay: '支付宝',
yue: '余额',
};
return statusMap[status];
}
/**
* @description 订单类型
*/
export function orderTypeFilter(status) {
const statusMap = {
0: '普通订单',
1: '视频号订单',
2: '秒杀订单',
5: '云盘订单',
6: '卡密订单',
};
return statusMap[status];
}

88
src/filters/product.js Normal file
View File

@ -0,0 +1,88 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
/**
* @description 直播商品审核状态
*/
export function liveReviewStatusFilter(status) {
const statusMap = {
0: '商户创建/撤回',
1: '平台待审核/商户重新提交审核',
2: '平台审核通过/微信审核中',
3: '平台审核失败',
4: '微信审核成功',
5: '微信审核失败',
};
return statusMap[status];
}
/**
* @description 直播状态
*/
export function broadcastStatusFilter(status) {
const statusMap = {
101: '直播中',
102: '未开始',
103: '已结束',
104: '禁播',
105: '暂停',
106: '异常',
107: '已过期',
};
return statusMap[status];
}
/**
* @description 直播间审核状态
*/
export function roomReviewStatusFilter(status) {
const statusMap = {
0: '平台待审核',
1: '平台审核失败',
2: '微信审核失败',
3: '微信审核成功',
};
return statusMap[status];
}
/**
* @description 直播间开启关闭状态
*/
export function roomShowFilter(status) {
const statusMap = {
0: '开启',
1: '关闭',
};
return statusMap[status];
}
/**
* @description 直播商品价格类型
*/
export function priceTypeFilter(status) {
const statusMap = {
1: '一口价',
2: '价格区间',
3: '折扣价',
};
return statusMap[status];
}
/**
* @description 商品类型
*/
export function productTpyeFilter(status) {
const statusMap = {
0: '普通商品',
5: '云盘商品',
6: '卡密商品',
};
return statusMap[status];
}

53
src/filters/user.js Normal file
View File

@ -0,0 +1,53 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
//会员过滤器
/**
* 等级
*/
export function levelFilter(status) {
if (!status) {
return '';
}
let arrayList = JSON.parse(localStorage.getItem('levelKey'));
let array = arrayList.filter((item) => status === item.id);
if (array.length) {
return array[0].name;
} else {
return '';
}
}
/**
* 用户注册类型
*/
export function registerTypeFilter(status) {
const statusMap = {
wechat: '公众号',
routine: '小程序',
h5: 'H5',
iosWx: '微信ios',
androidWx: '微信安卓',
ios: 'ios',
};
return statusMap[status];
}
/**
* 用户类型
*/
export function filterIsPromoter(status) {
const statusMap = {
true: '推广员',
false: '普通用户',
};
return statusMap[status];
}

39
src/filters/wx.js Normal file
View File

@ -0,0 +1,39 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
//小程序 微信过滤器
import Cookies from 'js-cookie';
/**
* @description 小程序所属类目
*/
export function wxCategoryFilter(status) {
if (!status) {
return '';
}
if (!Cookies.get('WxCategory')) {
return;
}
let arrayList = JSON.parse(Cookies.get('WxCategory'));
if (arrayList.filter((item) => Number(status) === Number(item.id)).length < 1) {
return '';
}
return arrayList.filter((item) => Number(status) === Number(item.id))[0].name;
}
/**
* @description 小程序模板类型
*/
export function wxTypeFilter(status) {
const statusMap = {
2: '一次性订阅',
3: '长期订阅',
};
return statusMap[status];
}

View File

@ -30,494 +30,93 @@ export default {
"menuId": getUUID(),
"parentId": 0,
"parentName": null,
"name": "课程管理",
"name": "商品",
"url": "local-course/resources",
"perms": "",
"type": 1,
"elIcon": "el-icon-menu",
"orderNum": 0,
"open": null,
list: []
},
{
"menuId": getUUID(),
"parentId": 0,
"parentName": null,
"name": "教务管理",
"url": "local-affairs",
"perms": "",
"type": 0,
"elIcon": "el-icon-office-building",
"orderNum": 0,
"open": null,
list: [
{
"menuId": getUUID(),
"parentId": 2,
"parentName": null,
"name": "年级管理",
"url": "local-affairs/grade",
"perms": "",
"type": 1,
"icon": "log",
"orderNum": 0,
"open": null,
"list": []
},
{
"menuId": getUUID(),
"parentId": 2,
"parentName": null,
"name": "班级管理",
"url": "local-affairs/class",
"perms": "",
"type": 1,
"icon": "log",
"orderNum": 0,
"open": null,
"list": []
},
{
"menuId": getUUID(),
"parentId": 2,
"parentName": null,
"name": "教师管理",
"url": "local-teacher/teacher",
"perms": "",
"type": 1,
"icon": "log",
"orderNum": 0,
"open": null,
"list": []
},
{
"menuId": getUUID(),
"parentId": 0,
"parentName": null,
"name": "学校管理",
"url": "local-school/school",
"perms": "",
"type": 1,
"elIcon": "el-icon-school",
"orderNum": 0,
"open": null,
list: []
},
]
},
{
"menuId": getUUID(),
"parentId": 0,
"parentName": null,
"name": "活动管理",
"url": "",
"perms": "",
"type": 0,
"elIcon": "el-icon-star-off",
"orderNum": 0,
"open": null,
"list": [
{
"menuId": getUUID(),
"parentId": 127,
"parentName": null,
"name": "活动管理",
"url": "active-match/active-match-management",
"perms": "",
"type": 1,
"icon": "log",
"orderNum": 0,
"open": null,
"list": []
},
{
"menuId": getUUID(),
"parentId": 127,
"parentName": null,
"name": "报名信息",
"url": "active-match/active-sign-up",
"perms": "",
"type": 1,
"icon": "tubiao",
"orderNum": 0,
"open": null,
"list": []
},
// {
// "menuId": getUUID(),
// "parentId": 127,
// "parentName": null,
// "name": "赛事管理",
// "url": "active-match/match-management",
// "perms": "matchManagement",
// "type": 1,
// "icon": "shoucangfill",
// "orderNum": 0,
// "open": null,
// "list": []
// },
{
"menuId": getUUID(),
"parentId": 127,
"parentName": null,
"name": "作品审核",
"url": "active-match/works-examine",
"perms": "",
"type": 1,
"icon": "zhedie",
"orderNum": 0,
"open": null,
"list": []
}
]
},
{
"menuId": getUUID(),
"parentId": 0,
"parentName": null,
"name": "教学管理",
"url": "local-teach-manage",
"perms": "",
"type": 0,
"elIcon": "el-icon-notebook-2",
"orderNum": 0,
"open": null,
list: [{
"menuId": getUUID(),
"parentId": 2,
"parentId": 0,
"parentName": null,
"name": "课程教学",
"url": "course-teach",
"name": "商品管理",
"url": "product/index",
"perms": "",
"type": 1,
"icon": "log",
"elIcon": "el-icon-menu",
"orderNum": 0,
"open": null,
"list": []
}, {
"menuId": getUUID(),
"parentId": 2,
"parentName": null,
"name": "课程评价",
"url": "course-evaluation",
"perms": "",
"type": 1,
"icon": "log",
"orderNum": 0,
"open": null,
"list": []
},
{
"menuId": getUUID(),
"parentId": 2,
"parentName": null,
"name": "期末综评",
"url": "final-evaluation",
"perms": "",
"type": 1,
"icon": "log",
"orderNum": 0,
"open": null,
"list": []
},
]
},
{
"menuId": 45,
"parentId": 0,
"parentName": null,
"name": "足迹管理",
"url": "",
"perms": "",
"type": 0,
"icon": "dangdifill",
"orderNum": 5,
"open": null,
"list": [
{
"menuId": 135,
"parentId": 45,
"parentName": null,
"name": "路线管理",
"url": "/footprint-management/footprint-line",
"perms": "",
"type": 1,
"icon": "dangdifill",
"orderNum": 0,
"open": null,
"list": []
},
{
"menuId": 133,
"parentId": 45,
"parentName": null,
"name": "打卡规则",
"url": "/footprint-management/footprint-rule",
"perms": "",
"type": 1,
"icon": "log",
"orderNum": 0,
"open": null,
"list": []
},
{
"menuId": 46,
"parentId": 45,
"parentName": null,
"name": "打卡地管理",
"url": "/footprint-management/punch-in-management",
"perms": "",
"type": 1,
"icon": "daohang",
"orderNum": 0,
"open": null,
"list": []
}
]
},
{
"menuId": getUUID(),
"parentId": 45,
"parentName": null,
"name": "作业管理",
"url": "/local-homework/teacher",
"perms": "",
"type": 1,
// "icon": "daohang",
"elIcon":"el-icon-notebook-2",
"orderNum": 0,
"open": null,
"list": []
},
{
"menuId": getUUID(),
"parentName": null,
"name": "教师优秀示范课",
"url": "/local-excellent-teacher-course",
"perms": "",
"type": 1,
"elIcon": "el-icon-medal",
"orderNum": 0,
"open": null,
"list": []
},
{
"menuId": getUUID(),
"parentName": null,
"name": "学生优秀作品展",
"url": "/local-excellent-student-work",
"perms": "",
"type": 1,
"elIcon": "el-icon-medal",
"orderNum": 0,
"open": null,
"list": []
},
{
"menuId": getUUID(),
"parentName": null,
"name": "系统管理",
"url": "sys",
"perms": null,
"type": 0,
"icon": "system",
"orderNum": 0,
"open": null,
"list": [
// {
// "menuId": 132,
// "parentId": 1,
// "parentName": null,
// "name": "公告管理",
// "url": "/sys/report-management",
// "perms": "",
// "type": 1,
// "icon": "log",
// "orderNum": 0,
// "open": null,
// "list": []
// },
// {
// "menuId": 2,
// "parentId": 1,
// "parentName": null,
// "name": "管理员列表",
// "url": "sys/user",
// "perms": null,
// "type": 1,
// "icon": "admin",
// "orderNum": 1,
// "open": null,
// "list": []
// },
{
"menuId": getUUID(),
"parentId": 1,
"parentName": null,
"name": "角色管理",
"url": "sys/role",
"perms": null,
"type": 1,
"icon": "role",
"orderNum": 2,
"open": null,
"list": []
},
{
"menuId": getUUID(),
"parentId": 1,
"parentName": null,
"name": "资源管理",
"url": "sys/menu",
"perms": null,
"type": 1,
"icon": "menu",
"orderNum": 3,
"open": null,
"list": []
},
// {
// "menuId": 37,
// "parentId": 1,
// "parentName": null,
// "name": "意见反馈",
// "url": "sys/feedback",
// "perms": "",
// "type": 1,
// "icon": "bianji",
// "orderNum": 5,
// "open": null,
// "list": []
// },
// {
// "menuId": 29,
// "parentId": 1,
// "parentName": null,
// "name": "系统日志",
// "url": "sys/log",
// "perms": "sys:log:list",
// "type": 1,
// "icon": "log",
// "orderNum": 7,
// "open": null,
// "list": []
// },
// {
// "menuId": 40,
// "parentId": 1,
// "parentName": null,
// "name": "常见问题及解答",
// "url": "sys/common-problem",
// "perms": "",
// "type": 1,
// "icon": "bianji",
// "orderNum": 9,
// "open": null,
// "list": []
// },
{
"menuId": getUUID(),
"parentId": 1,
"parentName": null,
"name": "组织机构管理",
"url": "sys/org",
"perms": "",
"type": 1,
"icon": "bianji",
"orderNum": 10,
"open": null,
"list": []
}
]
},
{
"menuId": getUUID(),
"parentName": null,
"name": "统计分析",
"perms": "",
"type": 0,
"icon": "bianji",
"orderNum": 10,
"open": null,
"list": [{
"menuId": getUUID(),
"parentName": null,
"name": "区域内学校基本信息统计",
"url": "/local-statistics/region-school",
"perms": "",
"type": 1,
"icon": "bianji",
"orderNum": 10,
"open": null,
"list": []
}, {
"menuId": getUUID(),
"parentName": null,
"name": "课程开展情况统计",
"url": "sys/org",
"perms": "",
"type": 1,
"icon": "bianji",
"orderNum": 10,
"open": null,
"list": []
}, {
"menuId": getUUID(),
"parentName": null,
"name": "课程完成明细统计",
"url": "sys/org",
"perms": "",
"type": 1,
"icon": "bianji",
"orderNum": 10,
"open": null,
"list": []
}, {
"menuId": getUUID(),
"parentName": null,
"name": "作业明细统计",
"url": "sys/org",
"perms": "",
"type": 1,
"icon": "bianji",
"orderNum": 10,
"open": null,
"list": []
}, {
"menuId": getUUID(),
"parentName": null,
"name": "评价明细统计",
"url": "sys/org",
"perms": "",
"type": 1,
"icon": "bianji",
"orderNum": 10,
"open": null,
"list": []
}, {
"menuId": getUUID(),
"parentName": null,
"name": "优秀示范课程明细统计",
"url": "sys/org",
"perms": "",
"type": 1,
"icon": "bianji",
"orderNum": 10,
"open": null,
"list": []
}, {
"menuId": getUUID(),
"parentName": null,
"name": "优秀作品明细统计",
"url": "sys/org",
"perms": "",
"type": 1,
"icon": "bianji",
"orderNum": 10,
"open": null,
"list": []
list: []
}]
},
// {
// "menuId": getUUID(),
// "parentId": 0,
// "parentName": null,
// "name": "教务管理",
// "url": "local-affairs",
// "perms": "",
// "type": 0,
// "elIcon": "el-icon-office-building",
// "orderNum": 0,
// "open": null,
// list: [
// {
// "menuId": getUUID(),
// "parentId": 2,
// "parentName": null,
// "name": "年级管理",
// "url": "local-affairs/grade",
// "perms": "",
// "type": 1,
// "icon": "log",
// "orderNum": 0,
// "open": null,
// "list": []
// },
// {
// "menuId": getUUID(),
// "parentId": 2,
// "parentName": null,
// "name": "班级管理",
// "url": "local-affairs/class",
// "perms": "",
// "type": 1,
// "icon": "log",
// "orderNum": 0,
// "open": null,
// "list": []
// },
// {
// "menuId": getUUID(),
// "parentId": 2,
// "parentName": null,
// "name": "教师管理",
// "url": "local-teacher/teacher",
// "perms": "",
// "type": 1,
// "icon": "log",
// "orderNum": 0,
// "open": null,
// "list": []
// },
// {
// "menuId": getUUID(),
// "parentId": 0,
// "parentName": null,
// "name": "学校管理",
// "url": "local-school/school",
// "perms": "",
// "type": 1,
// "elIcon": "el-icon-school",
// "orderNum": 0,
// "open": null,
// list: []
// },
// ]
// },
],
"code": 0,
"permissions": []

View File

@ -153,7 +153,7 @@ export default {
// this.getCaptcha();
});
} else {
this.$api.local_admin
this.$api.mer_admin
.loginByAccount({
role: _loginTypeMapper[this.loginType],
username: this.dataForm.userName,
@ -183,7 +183,7 @@ export default {
};
this.$refs["loginByYZMRef"].validate((valid) => {
console.log("验证码登录");
this.$api.local_admin
this.$api.mer_admin
.loginByMobile({
// role: _loginTypeMapper[this.loginType],
mobile: this.loginByYZMForm.mobile,
@ -207,7 +207,7 @@ export default {
this.$message.error("请输入正确的手机号码");
return;
}
this.$api.local_admin.getYZM(this.loginByYZMForm.mobile).then((res) => {
this.$api.mer_admin.getYZM(this.loginByYZMForm.mobile).then((res) => {
this.mobileCodeCountDown = 60;
this.mobileCodeCountDownTimer = setInterval(() => {
this.mobileCodeCountDown--;

View File

@ -1,529 +0,0 @@
<template>
<div class="_tablepage">
<searchForm
:searchForm="pageData.searchForm"
:searchData="pageData.queryData"
:searchHandle="pageData.searchHandle"
>
</searchForm>
<cusTable
:loading="loading"
:isSelection="true"
:isIndex="true"
:isPagination="true"
:isHandle="true"
:tableCols="pageData.tableCols"
:tableHandles="pageData.tableHandles"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
@handleCurrentChange="searchTableList"
@selectChange="selectChange"
@handleSizeChange="searchTableList"
></cusTable>
<modal
ref="modalRef"
:modalConfig="pageData.modalConfig"
:modalForm="pageData.modalForm"
:modalData="pageData.modalData"
:modalHandles="pageData.modalHandles"
@closeModal="closeModal()"
></modal>
</div>
</template>
<script>
import modal from "../../../components/common/modal/modal.vue";
import searchForm from "../../../components/common/searchform/searchForm.vue";
import cusTable from "../../../components/common/table/custable.vue";
export default {
components: { searchForm, cusTable, modal },
data() {
return {
//
loading:false,
typeList: [],
pageData: {
// start
searchForm: [
{ type: "Input", label: "关键字", prop: "searchName",placeholder:'标题、来源、编辑者名称',width:'230px' },
{
type: "Select",
label: "内容类型",
prop: "isVideo",
options: [{
label:'资讯',value:0
},{label:'视频',value:1}],
},
{
type: "DateTimeRange",
label: "发布时间范围",
prop: "time",
},
],
// end
// start
queryData: {
searchName: "",
contentTypeId: "",
time: [],
isVideo:0
},
// end
//start
searchHandle: [
{
label: "查询",
type: "primary",
handle: () => this.searchTableList(),
auth: "reportDatasource_search",
},
{
label: "重置",
type: "warning",
handle: () => this.resetSearch(),
auth: "reportDatasource_search",
},
],
//end
//start
tableData: [],
//end
// start
tableHandles: [
{
label: "新增",
type: "primary",
handle: () => this.showModal(this.commonConstants.modalType.insert),
auth: "reportDatasource_insert",
},
{
label: "批量删除",
type: "danger",
handle: () => this.deleteBatch(),
auth: "reportDatasource_batchDelete",
},
],
// end
selectList: [], //
//start
tablePage: {
currentPage: 1,
pageSize: 5,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
//end
//start
tableCols: [
{ label: "标题", prop: "title", align: "center" },
{ label: "副标题", prop: "subtitle", align: "center" },
{ label: "资讯来源", prop: "source", align: "center" },
{ label: "编辑者", prop: "editorName", align: "center" },
{ label: "作者", prop: "author", align: "center" },
{ label: "封面", type: "image", prop: "imageUrl", align: "center" },
{ label: "外链", prop: "contentLink", align: "center" },
{ label: "阅读数", prop: "readNumber", align: "center" },
{ label: "喜欢", prop: "likeNumber", align: "center" },
{ label: "收藏数", prop: "collectNumber", align: "center" },
{
label: "操作",
prop: "operation",
align: "center",
type: "button",
width:'180px',
fixed: "right",
btnList: [
{
label: "预览",
type: "text",
auth: "reportDatasource_getDetail",
handle: (row) =>
this.showModal(this.commonConstants.modalType.detail, row),
},
{
label: "编辑",
type: "text",
auth: "reportDatasource_update",
handle: (row) =>
this.showModal(this.commonConstants.modalType.update, row),
},
{
label: "删除",
type: "text",
auth: "reportDatasource_delete",
handle: (row) => this.deleteOne(row.contentInfoId),
},
],
},
],
//end
//modal start
modalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "80vw", //
modalRef: "modalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
modalForm: [
{
type: "Input",
label: "标题",
prop: "title",
rules: { required: true, maxLength: 100 },
width: "900px",
},
{
type: "Input",
label: "副标题",
prop: "subtitle",
rules: { maxLength: 100 },
width: "900px",
},
{
type: "Input",
label: "资讯来源",
prop: "source",
rules: { required: true, maxLength: 100 },
width: "300px",
},
{
type: "Input",
label: "作者",
prop: "author",
rules: { maxLength: 100 },
width: "300px",
},
{
type: "Input",
label: "编辑者",
prop: "editorName",
rules: { maxLength: 100 },
width: "300px",
},
{
type: "Input",
label: "外链",
prop: "contentLink",
rules: { maxLength: 100 },
width: "300px",
},
{
type: "Input",
label: "关键词",
prop: "keywords",
rules: { maxLength: 100 },
width: "300px",
},
{
type:'Radio',
prop:'isVideo',
label:'内容类型',
radios:[{label:'资讯',value:'0'},{label:'视频',value:'1'}],
width: "300px",
},
{
type: "Upload",
label: "封面",
fileUrl: "imageUrl",
prop: "fileList",
accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
},
{
type: "Tinymce",
label: "资讯内容",
prop: "content",
rules: { required: true },
width: "1200px",
},
],
newModalForm:[
{
type: "Upload",
label: "封面",
fileUrl: "imageUrl",
prop: "fileList",
accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
},
],//
videoModalForm:[
{
type: "Upload",
label: "封面",
fileUrl: "imageUrl",
prop: "fileList",
accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
},
{
type: "Upload",
label: "视频",
fileUrl: "videoUrl",
prop: "fileListVideo",
listType:'text',
width: "300px",
isVideo:true,
rules:{required:true},
accept:'.mp4,.avi,.mov,.rmvb,.flv,.MP4,.AVI,.MOV,.RMVB,.FLV',
tips:'请上传视频文件'
},
],//
//modal end
//modal start
modalData: {
userId: "",
content: "",
fileUrl: "",
fileList: [],
isVideo:'0',
videoUrl:'',
source:'',
fileListVideo:[]
},
//modal end
//modal start
modalHandles: [
{ label: "取消", type: "default", handle: () => this.closeModal() },
{ label: "提交", type: "primary", handle: () => this.save() },
],
//modal end
},
};
},
watch:{
"pageData.modalData.isVideo":{
handler:function(val,oldval){
// console.log(val)
if(val==='1'&&oldval==='0'){
this.pageData.modalForm.splice(-1-this.pageData.newModalForm.length,this.pageData.newModalForm.length,...this.pageData.videoModalForm)
}
else if(val==='0'&&oldval==='1'){
this.pageData.modalForm.splice(-1-this.pageData.videoModalForm.length,this.pageData.videoModalForm.length,...this.pageData.newModalForm)
}
}
},
"pageData.modalData.fileList":{
handler:function(val){
if(val&&val.length===0){
this.pageData.modalData.imageUrl=''
}
}
},
"pageData.modalData.fileListVideo":{
handler:function(val){
if(val&&val.length===0){
this.pageData.modalData.videoUrl=''
}
}
}
},
activated() {
this.searchTableList();
},
methods: {
/**
* @description: 获取表格数据
* @param {type}
* @return:
* @author: ym
*/
searchTableList() {
this.loading=true;
// obj
var obj = {};
Object.assign(obj, this.pageData.queryData, this.pageData.tablePage);
obj.page = this.pageData.tablePage.currentPage;
obj.limit = this.pageData.tablePage.pageSize;
delete obj["pageSizeRange"];
if (obj.time.length == 2) {
obj.startTime = obj.time[0];
obj.endTime = obj.time[1];
}
delete obj.time
//
this.$api.getActivityInfoListByParams(obj).then((res) => {
this.commonUtil.tableAssignment(
res.data.page,
this.pageData.tablePage,
this.pageData.tableData
);
})
.finally(()=>{
this.loading=false;
})
},
//
resetSearch() {
this.commonUtil.clearObj(this.pageData.queryData);
this.searchTableList();
},
/**
* @description: modal显示
* @param {type} 类型 1新增2编辑 3详情
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
showModal(type, row) {
this.commonUtil.clearObj(this.pageData.modalData); //modalData
this.$nextTick(()=>{
this.$refs["modalRef"].$refs["modalFormRef"].clearValidate(); //
})
this.pageData.modalData.source=this.$newSource//
this.pageData.modalData.isVideo='0'//isVideo watch
this.commonUtil.showModal(this.pageData.modalConfig, type);
if (type != this.commonConstants.modalType.insert) {
this.getDetail(row);
}
},
/**
* @description: 获取详细数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
getDetail(row) {
if(row.imageUrl){
row.fileList=[{
url:row.imageUrl
}]
}
if(row.videoUrl){
row.fileListVideo=[{
url:row.videoUrl
// +'?x-oss-process=video/snapshot,t_10000,m_fast'
}]
}
row.isVideo=row.isVideo+''
this.$nextTick(()=>{
this.pageData.modalData = JSON.parse(JSON.stringify(row));
})
},
/**
* @description: 关闭modal
* @param
* @return:
* @author: ym
*/
closeModal() {
this.pageData.modalConfig.show = false; //modal
},
/**
* @description: 保存数据
* @param {type}
* @return:
* @author: ym
*/
save() {
this.pageData.modalData.userId = this.$store.state.user.id;
this.$refs["modalRef"].$refs["modalFormRef"].validate((valid) => {
if (valid) {
let content = this.pageData.modalData;
if(content.isVideo==0){
content.videoUrl=''
}
if (
this.pageData.modalConfig.type ==
this.commonConstants.modalType.insert
) {
this.$api.saveActivityInfo(content).then((res) => {
this.searchTableList();
});
} else {
this.$api.updateRedActivityInfo(content).then((res) => {
this.searchTableList();
});
}
this.closeModal();
} else {
return false;
}
});
},
/**
* @description: 删除一条数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
deleteOne(id) {
let ids = [];
ids[0] = id;
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil
.showConfirm(obj)
.then(async () => {
await this.$api.deleteRedActivityInfo(ids).then((res) => {
this.searchTableList();
});
})
.catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
},
/**
* @description: 批量删除
* @param {type}
* @return:
* @author: ym
*/
deleteBatch() {
const length = this.pageData.selectList.length;
if (length == 0) {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList(
"error.batchdelete.empty",
null
),
type: this.commonConstants.messageType.error,
});
} else {
let ids = [];
for (let i = 0; i < length; i++) {
ids.push("" + this.pageData.selectList[i].contentInfoId);
}
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil
.showConfirm(obj)
.then(() => {
this.$api.deleteRedActivityInfo(ids).then((res) => {
this.searchTableList();
});
})
.catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
}
},
selectChange(rows) {
this.pageData.selectList = rows;
},
},
};
</script>
<style lang="scss" scoped>
.content-dialog ::v-deep .el-dialog__body{
padding: 0px;
}
</style>

View File

@ -1,541 +0,0 @@
<template>
<div class="_tablepage">
<searchForm
:searchForm="pageData.searchForm"
:searchData="pageData.queryData"
:searchHandle="pageData.searchHandle"
>
</searchForm>
<cusTable
:loading="loading"
:isSelection="true"
:isIndex="true"
:isPagination="true"
:isHandle="true"
:tableCols="pageData.tableCols"
:tableHandles="pageData.tableHandles"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
@handleCurrentChange="searchTableList"
@selectChange="selectChange"
@handleSizeChange="searchTableList"
></cusTable>
<modal
ref="modalRef"
:modalConfig="pageData.modalConfig"
:modalForm="pageData.modalForm"
:modalData="pageData.modalData"
:modalHandles="pageData.modalHandles"
@closeModal="closeModal()"
></modal>
</div>
</template>
<script>
import modal from "../../../components/common/modal/modal.vue";
import searchForm from "../../../components/common/searchform/searchForm.vue";
import cusTable from "../../../components/common/table/custable.vue";
export default {
components: { searchForm, cusTable, modal },
data() {
return {
//
loading:false,
typeList: [],
pageData: {
// start
searchForm: [
{ type: "Input", label: "关键字", prop: "searchName",placeholder:'标题、来源、编辑者名称',width:'230px' },
{
type: "Select",
label: "内容类型",
prop: "isVideo",
options: [{
label:'资讯',value:0
},{label:'视频',value:1}],
},
{
type: "DateTimeRange",
label: "发布时间范围",
prop: "time",
},
],
// end
// start
queryData: {
searchName: "",
contentTypeId: "",
time: [],
isVideo:0
},
// end
//start
searchHandle: [
{
label: "查询",
type: "primary",
handle: () => this.searchTableList(),
auth: "reportDatasource_search",
},
{
label: "重置",
type: "warning",
handle: () => this.resetSearch(),
auth: "reportDatasource_search",
},
],
//end
//start
tableData: [],
//end
// start
tableHandles: [
{
label: "新增",
type: "primary",
handle: () => this.showModal(this.commonConstants.modalType.insert),
auth: "reportDatasource_insert",
},
{
label: "批量删除",
type: "danger",
handle: () => this.deleteBatch(),
auth: "reportDatasource_batchDelete",
},
],
// end
selectList: [], //
//start
tablePage: {
currentPage: 1,
pageSize: 5,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
//end
//start
tableCols: [
{ label: "标题", prop: "title", align: "center" },
{ label: "副标题", prop: "subtitle", align: "center" },
{ label: "资讯来源", prop: "source", align: "center" },
{ label: "编辑者", prop: "editorName", align: "center" },
{ label: "作者", prop: "author", align: "center" },
{ label: "封面", type: "image", prop: "imageUrl", align: "center" },
{ label: "外链", prop: "contentLink", align: "center" },
{ label: "阅读数", prop: "readNumber", align: "center" },
{ label: "喜欢", prop: "likeNumber", align: "center" },
{ label: "收藏数", prop: "collectNumber", align: "center" },
{ label: "是否轮播", prop: "status", align: "center",type:'switch' ,
values:[1,0],
change:(row)=>{
this.$api.updateRedActivityImage(row).then((res) => {
this.searchTableList();
});
}},
{
label: "操作",
prop: "operation",
align: "center",
width:'180',
type: "button",
fixed: "right",
btnList: [
{
label: "预览",
type: "text",
auth: "reportDatasource_getDetail",
handle: (row) =>
this.showModal(this.commonConstants.modalType.detail, row),
},
{
label: "编辑",
type: "text",
auth: "reportDatasource_update",
handle: (row) =>
this.showModal(this.commonConstants.modalType.update, row),
},
{
label: "删除",
type: "text",
auth: "reportDatasource_delete",
handle: (row) => this.deleteOne(row.contentInfoId),
},
],
},
],
//end
//modal start
modalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "80vw", //
modalRef: "modalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
modalForm: [
{
type: "Input",
label: "标题",
prop: "title",
rules: { required: true, maxLength: 100 },
width: "900px",
},
{
type: "Input",
label: "副标题",
prop: "subtitle",
rules: { maxLength: 100 },
width: "900px",
},
{
type: "Input",
label: "资讯来源",
prop: "source",
rules: { required: true, maxLength: 100 },
width: "300px",
},
{
type: "Input",
label: "作者",
prop: "author",
rules: { maxLength: 100 },
width: "300px",
},
{
type: "Input",
label: "编辑者",
prop: "editorName",
rules: { maxLength: 100 },
width: "300px",
},
{
type: "Input",
label: "外链",
prop: "contentLink",
rules: { maxLength: 100 },
width: "300px",
},
{
type: "Input",
label: "关键词",
prop: "keywords",
rules: { maxLength: 100 },
width: "300px",
},
{
type:'Radio',
prop:'isVideo',
label:'内容类型',
radios:[{label:'资讯',value:'0'},{label:'视频',value:'1'}],
width: "300px",
},
{
type: "Upload",
label: "封面",
fileUrl: "imageUrl",
prop: "fileList",
rules:{required:true},
accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
},
{
type: "Tinymce",
label: "资讯内容",
prop: "content",
rules: { required: true },
width: "1200px",
},
],
//modal end
//modal end
newModalForm:[
{
type: "Upload",
label: "封面",
fileUrl: "imageUrl",
prop: "fileList",
accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
rules:{required:true}
},
],//
videoModalForm:[
{
type: "Upload",
label: "封面",
fileUrl: "imageUrl",
prop: "fileList",
accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
},
{
type: "Upload",
label: "视频",
fileUrl: "videoUrl",
prop: "fileListVideo",
listType:'text',
rules:{required:true},
width: "300px",
isVideo:true,
accept:'.mp4,.avi,.mov,.rmvb,.flv,.MP4,.AVI,.MOV,.RMVB,.FLV',
tips:'请上传视频文件'
},
],//
//modal start
modalData: {
userId: "",
content: "",
fileUrl: "",
source:'',
isVideo:'0',
mainTypeId:'',
fileList: [],
status:0,
videoUrl:'',
fileListVideo:[]
},
//modal end
//modal start
modalHandles: [
{ label: "取消", type: "default", handle: () => this.closeModal() },
{ label: "提交", type: "primary", handle: () => this.save() },
],
//modal end
},
};
},
watch:{
"pageData.modalData.isVideo":{
handler:function(val,oldval){
// console.log(val)
if(val==='1'&&oldval==='0'){
this.pageData.modalForm.splice(-1-this.pageData.newModalForm.length,this.pageData.newModalForm.length,...this.pageData.videoModalForm)
}
else if(val==='0'&&oldval==='1'){
this.pageData.modalForm.splice(-1-this.pageData.videoModalForm.length,this.pageData.videoModalForm.length,...this.pageData.newModalForm)
}
}
},
"pageData.modalData.fileList":{
handler:function(val){
if(val&&val.length===0){
this.pageData.modalData.imageUrl=''
}
}
},
"pageData.modalData.fileListVideo":{
handler:function(val){
if(val&&val.length===0){
this.pageData.modalData.videoUrl=''
}
}
}
},
activated() {
this.searchTableList();
},
methods: {
/**
* @description: 获取表格数据
* @param {type}
* @return:
* @author: ym
*/
searchTableList() {
this.loading=true;
// obj
var obj = {};
Object.assign(obj, this.pageData.queryData, this.pageData.tablePage);
obj.page = this.pageData.tablePage.currentPage;
obj.limit = this.pageData.tablePage.pageSize;
delete obj["pageSizeRange"];
if (obj.time.length == 2) {
obj.startTime = obj.time[0];
obj.endTime = obj.time[1];
}
delete obj.time
//
this.$api.getRedActivityImage(obj).then((res) => {
this.commonUtil.tableAssignment(
res.data.page,
this.pageData.tablePage,
this.pageData.tableData
);
})
.finally(()=>{
this.loading=false
})
},
//
resetSearch() {
this.commonUtil.clearObj(this.pageData.queryData);
this.searchTableList();
},
/**
* @description: modal显示
* @param {type} 类型 1新增2编辑 3详情
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
showModal(type, row) {
this.commonUtil.clearObj(this.pageData.modalData); //modalData
this.$nextTick(()=>{
this.$refs["modalRef"].$refs["modalFormRef"].clearValidate(); //
})
this.pageData.modalData.isVideo='0'//isVideo watch
this.pageData.modalData.source=this.$newSource//
this.commonUtil.showModal(this.pageData.modalConfig, type);
if (type != this.commonConstants.modalType.insert) {
this.getDetail(row);
}
},
/**
* @description: 获取详细数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
getDetail(row) {
if(row.imageUrl){
row.fileList=[{
url:row.imageUrl
}]
}
if(row.videoUrl){
row.fileListVideo=[{
url:row.videoUrl
// +'?x-oss-process=video/snapshot,t_10000,m_fast'
}]
}
row.isVideo=row.isVideo+''
this.$nextTick(()=>{
this.pageData.modalData = JSON.parse(JSON.stringify(row));
})
},
/**
* @description: 关闭modal
* @param
* @return:
* @author: ym
*/
closeModal() {
this.pageData.modalConfig.show = false; //modal
},
/**
* @description: 保存数据
* @param {type}
* @return:
* @author: ym
*/
save() {
this.pageData.modalData.userId = this.$store.state.user.id;
this.$refs["modalRef"].$refs["modalFormRef"].validate((valid) => {
if (valid) {
let content = this.pageData.modalData;
if(content.isVideo==0){
content.videoUrl=''
}
if (
this.pageData.modalConfig.type ==
this.commonConstants.modalType.insert
) {
this.$api.saveActivityImage(content).then((res) => {
this.searchTableList();
});
} else {
this.$api.updateRedActivityImage(content).then((res) => {
this.searchTableList();
});
}
this.closeModal();
} else {
return false;
}
});
},
/**
* @description: 删除一条数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
deleteOne(id) {
let ids = [];
ids[0] = id;
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil
.showConfirm(obj)
.then(async () => {
await this.$api.deleteRedActivityImage(ids).then((res) => {
this.searchTableList();
});
})
.catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
},
/**
* @description: 批量删除
* @param {type}
* @return:
* @author: ym
*/
deleteBatch() {
const length = this.pageData.selectList.length;
if (length == 0) {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList(
"error.batchdelete.empty",
null
),
type: this.commonConstants.messageType.error,
});
} else {
let ids = [];
for (let i = 0; i < length; i++) {
ids.push("" + this.pageData.selectList[i].contentInfoId);
}
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil
.showConfirm(obj)
.then(() => {
this.$api.deleteRedActivityImage(ids).then((res) => {
this.searchTableList();
});
})
.catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
}
},
selectChange(rows) {
this.pageData.selectList = rows;
},
},
};
</script>
<style lang="scss" scoped>
.content-dialog ::v-deep .el-dialog__body{
padding: 0px;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -1,134 +0,0 @@
<!--
* @Author: your name
* @Date: 2021-12-25 14:30:37
* @LastEditTime: 2022-04-16 19:52:46
* @LastEditors: chenkangxu
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\views\modules\active-match\active-sign-up.vue
-->
<template>
<div>
<searchForm
:searchForm="searchSetting.searchForm"
:searchData="searchSetting.searchData"
/>
<cesTable
:loading="loading"
:tableCols="pageData.tableCols"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
:tableHandles="pageData.tableHandles"
@handleCurrentChange="findAll"
@handleSizeChange="findAll"
/>
<activeMatchModal ref="activeMatchModal" :form="searchSetting.searchData" />
</div>
</template>
<script>
import searchForm from '../../../components/common/searchform/searchForm.vue'
import cesTable from '../../../components/common/table/custable.vue'
import activeMatchModal from './components/active-match-modal.vue'
export default {
components:{
searchForm,
cesTable,
activeMatchModal
},
data(){
return{
//
loading:false,
pageData:{
tableCols:[
{label:"姓名",prop:'name'},
{label:"学校",prop:'schoolName'},
{label:"年级",prop:'studentGrade'},
{label:"班级",prop:'studentClass'},
{label:"分组",prop:'studentGroup'},
{label:"手机号",prop:'cellphone'}
],
tableData:[],
tablePage:{
currentPage: 1,
pageSize: 5,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
tableHandles:[
// {label:'/',type:'primary',handle:()=>{
// this.$refs.activeMatchModal.modalConfig.show=true
// }}
]
},
searchSetting:{
searchForm:[
{label:'活动名称',prop:'activityName',readonly:true,size:"mini",type:'Input',focus:()=>{this.$refs.activeMatchModal.modalConfig.show=true}},
{label:'姓名',prop:'name',type:'Input',size:"mini"},
{label:'电话',prop:'cellphone',type:'Input',size:"mini"},
{label:'分组',prop:'studentGroup',type:'Select',size:"mini",options:[
{label:'小学组',value:'小学组'},
{label:'初中组',value:'初中组'},
{label:'高中组',value:'高中组'}
]},
{name:'查询',type:'Button',style:'primary',size:"mini",
// disabled:()=>{
// if(this.searchSetting.searchData.activityId===''){
// return true
// }else{
// return false
// }
// // return true
// },
handle:()=>{
if(this.searchSetting.searchData.activityId===''){
this.$message({
type:'warning',
message:"请先选择活动/赛事!"
})
setTimeout(()=>{
//
this.$refs.activeMatchModal.modalConfig.show=true
},800)
}
else
this.findAll()
}},
{name:'重置',type:'Button',size:"mini",style:'warning',handle:()=>{
this.resetSearchForm()
}}
],
searchData:{
name:'',
activityName:'',
activityId:'',
cellphone:'',
studentGroup:''
}
}
}
},
methods:{
findAll(){
this.loading=true;
let data=JSON.parse(JSON.stringify(this.searchSetting.searchData))
data.timeEntityList=''
this.$api.getActiveSignUp(data).then(res=>{
this.pageData.tableData=res.data.page.list;
this.pageData.tablePage.pageTotal=res.data.page.totalCount
})
.finally(()=>{
this.loading=false;
})
},
resetSearchForm(){
for(let item in this.searchSetting.searchData){
this.searchSetting.searchData[item]=''
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -1,535 +0,0 @@
<!--
* @Author: your name
* @Date: 2021-12-23 14:12:41
* @LastEditTime: 2022-04-16 19:49:58
* @LastEditors: chenkangxu
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\views\modules\active-match\active-match-management.vue
-->
<template>
<div>
<searchForm
:searchForm="searchSetting.searchForm"
:searchData="searchSetting.searchData"
/>
<cesTable
:loading="loading"
ref="table"
:highlight-current-row="true"
:tableCols="pageData.tableCols"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
@currentChange="currentChange"
@handleCurrentChange="findAll"
@handleSizeChange="findAll"
/>
</div>
</template>
<script>
import searchForm from "../../../../components/common/searchform/searchForm.vue";
import cesTable from "../../../../components/common/table/custable.vue";
export default {
components: {
cesTable,
searchForm,
},
watch: {
"modalSetting.modalData.fileList": {
handler: function (val) {
if (val && val.length === 0) {
this.modalSetting.modalData.imageUrl = "";
}
},
},
},
data() {
return {
//
loading:false,
modalSetting: {
modalConfig: {
show: false,
width: "1200px",
title: "添加活动/赛事",
key: false,
},
baseForm: [
{
label: "活动详情",
prop: "activityExplain",
type: "Input",
width: "600px",
},
{
label: "活动详情",
prop: "activityExplain",
type: "Tinymce",
width: "600px",
},
//线
{
label: "时间线",
width: "900px",
prop: "timeEntityList",
type: "Table",
isPagination: false,
tableCols: [
{
label: "时间节点名称",
prop: "content",
type: "formInput",
validate: true,
rules: {
content: { required: true, message: "时间节点名称不能为空" },
},
isDisabled: (row, index) => {
if (
index === 0 ||
index ===
this.modalSetting.modalData.timeEntityList.length - 1
) {
return true;
} else {
return false;
}
},
},
{
label: "开始时间",
prop: "startTime",
validate: true,
type: "formDate",
pickerOptions: (row, index) => {
return {
disabledDate: (time) => {
// console.log(index)
if (index === 0) {
if (
this.modalSetting.modalData.timeEntityList.length ===
2
) {
let date = new Date(
this.modalSetting.modalData.timeEntityList[1].endTime
);
return (
time.getTime() > date.getTime() ||
time.getTime() < Date.now()
);
} else {
let date = new Date(
this.modalSetting.modalData.timeEntityList[1].startTime
);
return (
time.getTime() > date.getTime() ||
time.getTime() < Date.now()
);
}
} else {
if (index === 1) {
let date1 = new Date(
this.modalSetting.modalData.timeEntityList[0].startTime
);
let date2 = new Date(row.endTime);
return (
time.getTime() < date1.getTime() ||
time.getTime() > date2.getTime() ||
time.getTime() < Date.now()
);
} else {
let date1 = new Date(
this.modalSetting.modalData.timeEntityList[
index - 1
].endTime
);
let date2 = new Date(row.endTime);
return (
time.getTime() < date1.getTime() ||
time.getTime() > date2.getTime() ||
time.getTime() < Date.now()
);
}
}
},
};
},
rules: {
startTime: { required: true, message: "开始时间不能为空" },
},
disabled: (row, index) => {
if (
index ===
this.modalSetting.modalData.timeEntityList.length - 1
) {
return true;
} else {
return false;
}
},
},
{
label: "结束时间",
prop: "endTime",
validate: true,
type: "formDate",
pickerOptions: (row, index) => {
return {
disabledDate: (time) => {
if (
index ===
this.modalSetting.modalData.timeEntityList.length - 1
) {
if (
this.modalSetting.modalData.timeEntityList.length ===
2
) {
let date = new Date(
this.modalSetting.modalData.timeEntityList[0].startTime
);
return (
time.getTime() < date.getTime() ||
time.getTime < Date.now()
);
} else {
let date = new Date(
this.modalSetting.modalData.timeEntityList[
index - 1
].endTime
);
return (
time.getTime() < date.getTime() ||
time.getTime < Date.now()
);
}
} else {
if (
index ===
this.modalSetting.modalData.timeEntityList.length - 2
) {
let date1 = new Date(row.startTime);
let date2 = new Date(
this.modalSetting.modalData.timeEntityList[
index + 1
].endTime
);
return (
time.getTime() < date1.getTime() ||
time.getTime() > date2.getTime() ||
time.getTime < Date.now()
);
} else {
let date1 = new Date(row.startTime);
let date2 = new Date(
this.modalSetting.modalData.timeEntityList[
index + 1
].startTime
);
return (
time.getTime() < date1.getTime() ||
time.getTime() > date2.getTime() ||
time.getTime < Date.now()
);
}
}
},
};
},
defaultTime: "23:59:59",
rules: {
endTime: { required: true, message: "结束时间不能为空" },
},
disabled: (row, index) => {
if (index === 0) {
return true;
} else {
return false;
}
},
},
{
label: "操作",
width: "60px",
type: "button",
btnList: [
{
label: "删除",
type: "text",
disabled: (row, index) => {
if (
index === 0 ||
index ===
this.modalSetting.modalData.timeEntityList.length - 1
) {
return true;
} else {
return false;
}
},
handle: (row, index) => {
this.$confirm("确认删除该时间节点?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.modalSetting.modalData.timeEntityList.splice(
index,
1
);
let ref =
"cesForm" +
(this.modalSetting.modalData.timeEntityList.length -
1);
this.$nextTick(() => {
// console.log(ref)
// console.log(this.$refs.modal.$refs.modalFormTable[0].$refs)
this.$refs.modal.$refs.modalFormTable[0].$refs[
ref
][1].clearValidate();
});
this.$message({
type: "success",
message: "删除成功!",
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
},
],
},
],
tableHandles: [
{
label: "添加",
type: "primary",
handle: () => {
this.modalSetting.modalData.timeEntityList.splice(
this.modalSetting.modalData.timeEntityList.length - 1,
0,
{}
);
},
},
],
},
{
label: "开始时间/结束时间",
prop: "time",
type: "DateTimeRange",
pickerOptions: {
disabledDate: (time) => {
return time.getTime() < Date.now();
},
},
defaultTime: ["00:00:00", "23:59:59"],
},
{
label:'活动地址',
prop:'address',
type:'Input',
width:'600px'
}
],
modalForm: [],
modalHandles: [
{
label: "确认",
type: "primary",
handle: () => {
// console.log(this.$refs.modal.$refs.modalFormTable[0].$refs.cesForm0)
this.save();
},
},
],
modalData: {
title: "",
imageUrl: "",
isWebExplain: 1,
activityExplain: "",
fileList: [],
startTime: "",
endTime: "",
time: [],
activityTypeId: "",
activityOrMatch: "活动",
status: "未开始",
isOnline: "线上活动",
signUpMoney: "",
sponsor: this.$newSource,
timeEntityList: [
{ content: "开始时间", startTime: "", endTime: "" },
{ content: "结束时间", startTime: "", endTime: "" },
],
noticeEntityList: [],
},
},
pageData: {
tableData: [],
tableCols: [
{ label: "标题", prop: "title" },
{ label: "背景图", prop: "imageUrl", type: "image" },
{ label: "活动状态", prop: "status" },
{ label: "活动分类", prop: "title" },
{ label: "活动类型", prop: "activityOrMatch" },
{ label: "线上/线下", prop: "isOnline" },
{ label: "报名所需红星币", prop: "signUpMoney" },
{ label: "报名人数", prop: "signUpPeople" },
{ label: "阅读量", prop: "readNumber" },
{ label: "主办方", prop: "sponsor" },
{
label: "活动时间",
width: "300px",
formatter: (prop, row) => {
return row.startTime + " - " + row.endTime;
},
},
],
tableHandles: [
{
label: "新增活动",
type: "primary",
handle: () => {
this.resetModalForm('活动');
this.modalSetting.modalData.activityOrMatch='活动'
this.modalSetting.modalConfig.title = "添加活动";
this.modalSetting.modalConfig.show = true;
this.changeForm('活动',1,'线下活动')
},
},
{
label: "新增赛事",
type: "primary",
handle: () => {
this.resetModalForm('赛事');
this.modalSetting.modalData.activityOrMatch='赛事'
this.modalSetting.modalConfig.title = "添加赛事";
this.modalSetting.modalConfig.show = true;
this.changeForm("赛事", 1,'线上活动');
},
},
],
tablePage: {
currentPage: 1,
pageSize: 5,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
},
searchSetting: {
searchForm: [
{ label: "标题", prop: "searchName", type: "Input",size:"mini" },
{
label: "分类",
prop: "activityTypeId",
default: true,
type: "Select",
options: [],size:"mini",
},
{
label: "类型",
prop: "activityOrMatch",
type: "Select",size:"mini",
options: [
{ label: "活动", value: "活动" },
{ label: "赛事", value: "赛事" },
],
},
{
label: "状态",
prop: "status",
default: true,
type: "Select",size:"mini",
options: [
{ label: "未开始", value: "未开始" },
{ label: "进行中", value: "进行中" },
{ label: "已结束", value: "已结束" },
],
},
{
label: "线上/线下",
prop: "isOnline",
default: true,
type: "Select",size:"mini",
options: [
{ label: "线上", value: "线上活动" },
{ label: "线下", value: "线下活动" },
],
},
{
name: "查询",
type: "Button",
style: "primary",size:"mini",
handle: () => {
this.$nextTick(()=>{
this.$refs.table.$refs.cesTable.setCurrentRow()
})
this.findAll()},
},
{
name: "重置",
type: "Button",size:"mini",
handle: () => this.resetSearchForm(),
},
],
searchData: {
searchName: "",
activityTypeId: "",
activityOrMatch: "赛事",
status: "",
isOnline: "",
},
},
options:[]
};
},
methods: {
findAll() {
this.loading=true;
this.$nextTick(()=>{
// console.log(this.$refs.table)
this.$refs.table.$refs.cesTable.setCurrentRow()
})
let obj = this.searchSetting.searchData;
obj.page = this.pageData.tablePage.currentPage;
obj.limit = this.pageData.tablePage.pageSize;
this.$api.getActiveMatch(obj).then((res) => {
this.pageData.tableData = res.data.page.list;
this.pageData.tablePage.pageTotal = res.data.page.totalCount;
})
.finally(()=>{
this.loading=false;
})
},
resetSearchForm() {
// console.log(1)
for (let item in this.searchSetting.searchData) {
if (item === "activityOrMatch") {
this.searchSetting.searchData[item] = "赛事";
} else {
this.searchSetting.searchData[item] = "";
}
}
},
getType(){
this.$api.getActivityTypeList().then((res) => {
let options = res.data.list.map((item) => {
return { label: item.activityTypeName, value: item.activityTypeId };
});
this.options=options
this.searchSetting.searchForm[1].options = options;
});
},
currentChange(row){
this.$emit('getActivity',row)
}
},
};
</script>

View File

@ -1,88 +0,0 @@
<!--
* @Author: your name
* @Date: 2021-12-25 15:12:53
* @LastEditTime: 2022-01-02 20:30:20
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\views\modules\active-match\components\active-match-modal.vue
-->
<template>
<div>
<modal :modalConfig="modalConfig" :modalHandles="modalHandles">
<activeTable @getActivity="getActivity" ref="activeTable" slot="dialog__content"/>
</modal>
</div>
</template>
<script>
import activeTable from './active-match-management.vue'
import modal from '../../../../components/common/modal/modal.vue'
export default {
components: { modal,activeTable },
watch:{
'modalConfig.show':{
handler:function(val){
if(val){
this.flag=false
this.$nextTick(()=>{
if(this.isOnline!==''){
let form= this.$refs.activeTable.searchSetting.searchForm
this.$refs.activeTable.searchSetting.searchData.isOnline=this.isOnline
for(let i=0;i<this.$refs.activeTable.searchSetting.searchForm.length;i++){
if(this.$refs.activeTable.searchSetting.searchForm[i].label==='线上/线下'){
this.$refs.activeTable.searchSetting.searchForm.splice(i,1);
break
}
}
}
this.$refs.activeTable.findAll()
this.$refs.activeTable.getType()
})
}
// else{
// this.$nextTick(()=>{
// // this.$refs.activeTable.$refs.table.$refs.cesTable.setCurrentRow()
// })
// }
}
}
},
data(){
return{
modalConfig:{
title:'选择活动/赛事',
show:false,
width:'80vw'
},
modalHandles:[{
label:'确认',
type:'primary',
disabled:()=>{
if(this.flag) return false
else return true
},
handle:()=>{
this.modalConfig.show=false
this.form.activityName=this.row.title
this.form.timeEntityList=this.row.timeEntityList
this.form.activityId=this.row.activityId
}
}],
flag:false,
row:{}
}
},
methods:{
getActivity(row){
this.flag=true
this.row=row
}
},
props:{
form:{type:Object,default:()=>{}},
isOnline:{type:String,default:''}
}
}
</script>

View File

@ -1,191 +0,0 @@
<!--
* @Author: your name
* @Date: 2022-01-01 20:17:56
* @LastEditTime: 2022-01-02 14:37:26
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\views\modules\active-match\components\award-modal.vue
-->
<template>
<div>
<modal :modalConfig="modalConfig">
<cesTable
:isIndex="true"
:tableCols="pageData.tableCols"
:tableData="pageData.tableData"
:tableHandles="pageData.tableHandles"
:isPagination="false"
slot="dialog__content"
/>
</modal>
<!-- 表格添加的弹窗 -->
<modal
ref="modal"
:modalConfig="modalSetting.modalConfig"
:modalForm="modalSetting.modalForm"
:modalData="modalSetting.modalData"
:modalHandles="modalSetting.modalHandles"
/>
</div>
</template>
<script>
import cesTable from "../../../../components/common/table/custable.vue";
import modal from "../../../../components/common/modal/modal.vue";
export default {
components: {
modal,
cesTable,
},
watch: {
"modalConfig.show": {
handler: function (val) {
if (val) {
this.$nextTick(() => {
this.findAll();
});
}
},
},
"modalSetting.modalData.fileList": {
handler: function (val) {
if (val && val.length === 0) {
this.modalSetting.modalData.imageUrl = "";
}
},
},
},
data() {
return {
pageData: {
tableCols: [
{
label: "奖状图片",
type: "elImage",
prop: "imageUrl",
// width: "200px",
},
{ label: "颁奖时间", prop: "createTime" },
{
label: "操作",
type: "button",
btnList: [
{
label: "编辑",
type: "text",
handle: (row) => {
this.modalSetting.modalData = JSON.parse(JSON.stringify(row));
this.modalSetting.modalData.fileList = [
{ url: row.imageUrl },
];
this.modalSetting.modalConfig.title = "编辑";
this.modalSetting.modalConfig.show = true;
},
},
{
label: "删除",
type: "text",
handle: (row) => {
this.$confirm("是否确认删除该奖状?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$api.delelteWorksAward([row.awardId]).then((res) => {
this.findAll();
});
})
.catch(() => {});
},
},
],
},
],
tableData: [],
tableHandles: [
{
label: "颁奖",
type: "primary",
handle: () => {
this.clearModal();
this.modalSetting.modalConfig.title = "颁奖";
this.modalSetting.modalConfig.show = true;
},
},
],
},
modalConfig: {
show: false,
title: "颁奖信息",
width: "900px",
},
//
modalSetting: {
modalConfig: {
show: false,
title: "颁奖",
},
modalData: {
fileList: [],
imageUrl: "",
},
modalHandles: [
{
label: "确认",
type: "primary",
handle: () => {
let data = {};
data.imageUrl = this.modalSetting.modalData.imageUrl;
data.userId = this.form.userId;
data.workId = this.form.workId;
data.activityId = this.form.activityId;
if (this.modalSetting.modalConfig.title === "编辑") {
data.awardId = this.modalSetting.modalData.awardId;
this.$api.updateWorksAward(data).then((res) => {
this.modalSetting.modalConfig.show = false;
this.findAll();
});
} else {
this.$api.addWorksAward(data).then((res) => {
this.modalSetting.modalConfig.show = false;
this.findAll();
});
}
},
},
],
modalForm: [
{
label: "奖状图片",
type: "Upload",
prop: "fileList",
fileUrl: "imageUrl",
rules: { required: true },
},
],
},
};
},
methods: {
findAll() {
// console.log(this.form)
this.$api.getWorksAwardList(this.form.workId).then((res) => {
this.pageData.tableData = res.data.list;
});
},
clearModal() {
for (let item in this.modalSetting.modalData) {
if (item === "fileList") this.modalSetting.modalData[item] = [];
else this.modalSetting.modalData[item] = "";
}
this.$nextTick(() => {
// console.log(this.$refs.modal)
this.$refs.modal.$refs.modalFormRef.clearValidate();
});
},
},
props: {
form: { tyep: Object, default: () => {} },
},
};
</script>

View File

@ -1,113 +0,0 @@
<!--
* @Author: your name
* @Date: 2021-12-30 16:39:54
* @LastEditTime: 2022-03-27 15:26:48
* @LastEditors: chenkangxu
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\views\modules\active-match\components\works-modal.vue
-->
<template>
<div>
<modal :modalConfig="modalConfig">
<div slot="dialog__content">
<modelType style="margin-top: 0px" class="title" content="作品展示" />
<video
v-if="form.isVideo === 1"
style="display: block; margin: auto; width: 60%"
:src="form.videoUrl"
controls
></video>
<div class="content" v-if="form.isVideo === 0">
<el-image
:preview-src-list="
item ? [item] : [require('@/assets/images/noimg.svg')]
"
style="height: 300px; margin-right: 20px"
v-for="item in form.imageUrls"
:key="item"
:src="item ? item : require('@/assets/images/noimg.svg')"
alt=""
></el-image>
</div>
<modelType class="title" content="作品标题" />
<div class="content" style="font-size: 18px">{{ form.workTitle }}</div>
<modelType class="title" content="作者" />
<div class="content" style="font-size: 14px; color: rgb(120, 120, 120)">
{{ form.name }}
</div>
<modelType class="title" content="作品详情" />
<div
class="content"
style="font-size: 20px"
v-html="form.introduce"
></div>
<modelType class="title" content="获奖情况" />
<div class="content">
<el-image
:preview-src-list="
item.imageUrl
? [item.imageUrl]
: [require('@/assets/images/noimg.svg')]
"
style="height: 300px; margin-right: 20px"
v-for="item in awardList"
:key="item.imageUrl"
:src="
item.imageUrl
? item.imageUrl
: require('@/assets/images/noimg.svg')
"
alt=""
></el-image>
</div>
</div>
</modal>
</div>
</template>
<script>
import modelType from "@/components/modelType/modelType.vue";
import modal from "../../../../components/common/modal/modal.vue";
export default {
components: {
modal,
modelType,
},
watch: {
"modalConfig.show": {
handler: function (val) {
if (val) {
this.$api.getWorksAwardList(this.form.workId).then((res) => {
this.awardList = res.data.list;
});
}
},
},
},
data() {
return {
modalConfig: {
title: "查看作品",
show: false,
width: "60vw",
},
awardList: [],
};
},
props: {
form: { type: Object, default: () => {} },
},
};
</script>
<style lang="scss" scoped>
.title {
font-size: 20px;
margin-bottom: 30px;
font-weight: 600;
margin-top: 30px;
}
.content {
margin: auto;
width: calc(100% - 40px);
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -1,301 +0,0 @@
<!--
* @Author: your name
* @Date: 2021-12-25 14:30:37
* @LastEditTime: 2022-04-16 19:57:10
* @LastEditors: chenkangxu
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\views\modules\active-match\active-sign-up.vue
-->
<template>
<div>
<searchForm
labelWidth="70px"
:searchForm="searchForm"
:searchData="searchSetting.searchData"
/>
<cesTable
:loading="loading"
:isIndex="true"
:tableCols="pageData.tableCols"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
:tableHandles="pageData.tableHandles"
@handleCurrentChange="findAll"
@handleSizeChange="findAll"
/>
<activeMatchModal ref="activeMatchModal" isOnline="线上活动" :form="searchSetting.searchData" />
<!-- 审核modal -->
<modal
:modalConfig="modalSetting.modalConfig"
:modalForm="modalSetting.modalForm"
:modalData="modalSetting.modalData"
:modalHandles="modalSetting.modalHandles"
/>
<worksModal ref="worksModal" :form="row" />
<awardModal ref="awardModal" :form="row"/>
</div>
</template>
<script>
import worksModal from './components/works-modal.vue'
import modal from '../../../components/common/modal/modal.vue'
import searchForm from '../../../components/common/searchform/searchForm.vue'
import cesTable from '../../../components/common/table/custable.vue'
import activeMatchModal from './components/active-match-modal.vue'
import awardModal from './components/award-modal.vue'
export default {
components:{
searchForm,
cesTable,
awardModal,
modal,
worksModal,
activeMatchModal
},
data(){
return{
//
loading:false,
pageData:{
tableCols:[
{label:"姓名",prop:'name'},
{label:"学校",prop:'schoolName'},
{label:"类型",prop:'isVideo',formatter:(prop,row)=>{
return row[prop]==0?'图文':'视频'
}},
{label:"分组",prop:'studentGroup'},
{label:"手机号",prop:'cellphone'},
{label:'得票数',prop:'votes'},
{label:'轮次',formatter:(prop,row)=>{
let str='已通过所有轮次'
// console.log(this.options.length)
if(this.options.length===0) return str
if(this.options.length===1){
if(row.firstRise===0) return this.options[0].content
else return str
}
if(this.options.length===2){
if(row.firstRise===0) return this.options[0].content
else if(row.secondRise===0) return this.options[1].content
else return str
}
if(this.options.length===3){
if(row.firstRise===0) return this.options[0].content
else if(row.secondRise===0) return this.options[1].content
else if(row.thirdRise===0) return this.options[2].content
else return str
}
}},
{label:'审核情况',prop:'status',formatter:(prop,row)=>{
return row[prop]==0?'未审核':row[prop]==1?'审核通过':'审核未通过'
},
},
{
label:'操作', width:'210px',type:'button',btnList:[
{
label:'查看作品',
type:'text',
handle:(row)=>{
this.row=JSON.parse(JSON.stringify(row))
this.row.introduce=this.row.introduce.replace(/\n/g,"<br>")
if(row.isVideo===0){
this.row.imageUrl=this.row.imageUrl.split(',')
}
this.$refs.worksModal.modalConfig.show=true
}
},
{
label:'审核',
type:'text',
handle:(row)=>{
this.modalSetting.modalData=JSON.parse(JSON.stringify(row))
this.modalSetting.modalConfig.show=true
}
},
{
label:'晋级',
type:'text',
handle:(row)=>{
if(row.status!=1){
this.$message({
type:'warning',
message:'请审核通过后再执行晋级操作!'
})
}else{
this.$confirm('是否确定晋级该作品?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(() => {
let data=JSON.parse(JSON.stringify(row));
if(data.firstRise===0) data.firstRise=1;
else if(data.secondRise===0) data.secondRise=1;
else if(data.thirdRise===0) data.thirdRise=1;
this.$api.setWorksExamine(data).then(res=>{
this.findAll()
})
}).catch(() => {
});
}
},
disabled:(row)=>{
if(this.options.length===0||(this.options.length===1&&row.firstRise===1))return true;
else if(this.options.length===2&&row.secondRise===1)return true;
else if(this.options.length===3&&row.thirdRise===1)return true;
else return false
}
},
{
label:'颁奖',
type:'text',
handle:(row)=>{
this.row=JSON.parse(JSON.stringify(row));
this.row.introduce=this.row.introduce.replace(/\n/g,"<br>")
if(row.isVideo===0){
this.row.imageUrl=this.row.imageUrl.split(',')
}
this.$refs.awardModal.modalConfig.show=true
}
}
]
}
],
tableData:[],
tablePage:{
currentPage: 1,
pageSize: 5,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
tableHandles:[]
},
searchSetting:{
searchData:{
name:'',
activityName:'',
activityId:'',
cellphone:'',
studentGroup:'小学组',
status:1,
round:'',
timeEntityList:[],
}
},
modalSetting:{
modalConfig:{
title:'审核',
show:false
},
modalForm:[{
label:'审核情况',
type:'Radio',
prop:'status',
radios:[{label:'未审核',value:0},{label:'审核未通过',value:2},{label:'审核通过',value:1}]
}],
modalData:{},
modalHandles:[{
label:'确认',
type:'primary',
handle:()=>{
this.$api.setWorksExamine(this.modalSetting.modalData).then(res=>{
this.modalSetting.modalConfig.show=false
this.findAll()
})
}
}]
},
options:[],//
row:{}
}
},
methods:{
findAll(){
this.loading=true;
let data=JSON.parse(JSON.stringify(this.searchSetting.searchData))
data.timeEntityList=''
this.$api.getWorksExamine(data).then(res=>{
this.pageData.tableData=res.data.page.list;
this.pageData.tablePage.pageTotal=res.data.page.totalCount
})
.finally(()=>{
this.loading=false;
})
},
resetSearchForm(){
for(let item in this.searchSetting.searchData){
if(item==='timeEntityList') this.searchSetting.searchData[item]=[]
else if(item==='studentGroup') this.searchSetting.searchData[item]='小学组'
else if(item==='status') this.searchSetting.searchData[item]=1
else this.searchSetting.searchData[item]=''
}
}
},
watch:{
"searchSetting.searchData.timeEntityList":{
handler:function(val){
// console.log(11)
let arr=JSON.parse(JSON.stringify(val))
arr.pop();
arr.shift();
this.options=arr.map((item,index)=>{
return {label:index+1,value:index+1,content:item.content}
})
// console.log(arr,this.options)
// this.options
}
}
},
computed:{
searchForm(){
return [
{label:'活动名称',prop:'activityName',readonly:true,type:'Input',size:"mini",focus:()=>{this.$refs.activeMatchModal.modalConfig.show=true}},
{label:'姓名',prop:'name',type:'Input',size:"mini"},
{label:'轮次',prop:'round',type:'Select',options:this.options,size:"mini"},
{label:'电话',prop:'cellphone',type:'Input',size:"mini"},
{label:'分组',prop:'studentGroup',type:'Select',options:[
{label:'小学组',value:'小学组'},
{label:'初中组',value:'初中组'},
{label:'高中组',value:'高中组'}
],size:"mini"},
{label:'审核情况',prop:'status',type:'Select',options:[
{label:'未审核',value:0},
{label:'审核通过',value:1},
{label:'审核未通过',value:2}
],size:"mini"},
{name:'查询',type:'Button',style:'primary',size:"mini",
// disabled:()=>{
// if(this.searchSetting.searchData.activityId===''){
// return true
// }else{
// return false
// }
// // return true
// },
handle:()=>{
if(this.searchSetting.searchData.activityId===''){
this.$message({
type:'warning',
message:"请先选择活动/赛事!"
})
setTimeout(() => {
this.$refs.activeMatchModal.modalConfig.show=true
}, 800);
}
else
this.findAll()
}},
{name:'重置',type:'Button',style:'warning',handle:()=>{
this.resetSearchForm()
},size:"mini"}
]
}
}
}
</script>
<style scoped>
</style>

View File

@ -1,50 +0,0 @@
<template>
<el-form>
<h2>主题设置</h2>
<el-form-item label="app、官网主题">
<el-radio-group :value="globalTheme" v-loading="themeChangeLoading" @input="change">
<el-radio label="default" border>默认主题</el-radio>
<el-radio label="mourning" border>哀悼主题</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</template>
<script>
export default {
data(){
return {
globalTheme:"default",
themeChangeLoading:false,
}
},
activated(){
this.themeChangeLoading=true;
this.$api.appOperate.getTheme()
.then(res=>{
console.log(res);
this.globalTheme=res.data.config.paramValue;
})
.finally(() => {
this.themeChangeLoading=false
})
},
methods:{
change(e){
this.themeChangeLoading=true;
this.$api.appOperate.updateTheme(e)
.then(res=>{
console.log(e);
this.globalTheme=e;
})
.catch(e=>{
})
.finally(() => {
this.themeChangeLoading=false;
})
}
}
}
</script>

View File

@ -1,672 +0,0 @@
<template>
<div class="_tablepage">
<searchForm
ref="searchForm"
:searchForm="pageData.searchForm"
:searchData="pageData.queryData"
:searchHandle="pageData.searchHandle"
>
</searchForm>
<obj-table-plus
style="height: 60vh"
@query="searchTableList"
ref="oTable"
v-model="pageData.tableData"
:isPagination="true"
:tableCols="pageData.tableCols"
:tableProp="tableProp"
:toolbarProp="{}"
:tableEvent="{ 'select-change': selectChange }"
/>
<!-- <cusTable
:loading="loading"
:isSelection="true"
:isIndex="true"
:isPagination="true"
:isHandle="true"
:tableCols="pageData.tableCols"
:tableHandles="pageData.tableHandles"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
@handleCurrentChange="searchTableList"
@selectChange="selectChange"
@handleSizeChange="searchTableList"
></cusTable> -->
<modal
ref="modalRef"
:modalConfig="pageData.modalConfig"
:modalForm="pageData.modalForm"
:modalData="pageData.modalData"
:modalHandles="pageData.modalHandles"
@closeModal="closeModal()"
></modal>
<!-- 审核弹窗 -->
<ApprovalModal type="content" ref="ApprovalModal" @refresh="$refs.oTable.refresh()"/>
</div>
</template>
<script>
import ApprovalModal from '../popup/approval.vue'
import modal from "@/components/common/modal/modal.vue";
import searchForm from "@/components/common/searchform/searchForm.vue";
import cusTable from "@/components/common/table/custable.vue";
export default {
components: { searchForm, cusTable, modal,ApprovalModal },
data() {
return {
//
tableProp: {
height: "auto",
},
typeList: [],
pageData: {
// start
searchForm: [
{
type: "Input",
label: "关键字",
size: "mini",
prop: "searchName",
placeholder: "标题、来源、编辑者名称",
width: "230px",
},
// {
// type: "Cascader",
// label: "",
// size:"mini",
// prop: "mainTypeId",//
// data: [],
// },
{
type: "Select",
label: "内容类型",
size: "mini",
prop: "searchType",
options: [
{
label: "内容轮播图",
value: 3,
},
{
label: "学习轮播图",
value: 4,
},
{
label: "地方内容",
value: 2,
},
{
label: "红色内容",
value: 1,
},
],
},
{
type: "Select",
prop: "isVideo",
label: "信息类型",
size: "mini",
options: [
{ label: "资讯", value: 0 },
{ label: "视频", value: 1 },
],
width: "300px",
},
{
size: "mini",
type: "DateTimeRange",
label: "发布时间范围",
prop: "time",
},
{
type: "Select",
label: "审核状态",
prop: "examineStatus",
default:true,
size: "mini",
options: [
{ label: "未审核", value: 0 },
{ label: "审核通过", value: 1 },
{ label: "审核未通过", value: 2 },
],
},
],
// end
// start
queryData: {
searchName: "",
mainTypeId: "",
time: [],
searchType: 3,
isVideo: 0,
examineStatus:'',
},
// end
//start
searchHandle: [
{
label: "查询",
size: "mini",
type: "primary",
handle: () => this.$refs.oTable.reload(),
auth: "reportDatasource_search",
},
{
label: "重置",
size: "mini",
type: "warning",
handle: () => this.resetSearch(),
auth: "reportDatasource_search",
},
],
//end
//start
tableData: [],
//end
// start
tableHandles: [
// {
// label: "",
// type: "primary",
// handle: () => this.showModal(this.commonConstants.modalType.insert),
// auth: "reportDatasource_insert",
// },
// {
// label: "",
// type: "danger",
// handle: () => this.deleteBatch(),
// auth: "reportDatasource_batchDelete",
// },
],
// end
selectList: [], //
//start
tablePage: {
currentPage: 1,
pageSize: 5,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
//end
//start
tableCols: [
{ title: "标题", field: "title", align: "center", fixed: "left" },
{ title: "副标题", field: "subtitle", align: "center" },
{ title: "主分类名", field: "mainTypeName", align: "center" },
{ title: "子分类名", field: "secondTypeName", align: "center" },
{ title: "资讯来源", field: "source", align: "center" },
{ title: "编辑者", field: "editorName", align: "center" },
{ title: "作者", field: "author", align: "center" },
{
title: "封面",
type: "jsx",
field: "imageUrl",
align: "center",
render: ({ row }) => {
// @/assets/images/noimg.svg
return (
<el-image
fit="cover"
src={
row.imageUrl
? row.imageUrl
: require("@/assets/images/noimg.svg")
}
></el-image>
);
},
},
// { title: "", field: "contentLink", align: "center" },
{ title: "阅读数", field: "readNumber", align: "center" },
{ title: "点赞数", field: "likeNumber", align: "center" },
{ title: "评论数", field: "commentNumber", align: "center" },
{ title: "收藏数", field: "collectNumber", align: "center" },
{
title: "审核状态",
field: "createTime",
align: "center",
// "title-help":{message: ''},
type: "jsx",
render: ({ row }) => {
switch (row.examineStatus) {
case 0:
return (
<span>
<span style="color:gray">未审核</span>
</span>
);
case 1:
return (
<span>
<span style="color:green">审核通过</span>
</span>
);
case 2:
return (
<span>
<span style="color:red">审核未通过</span>
</span>
);
default:
return (<span></span>);
}
},
},
{
title: "操作",
field: "operation",
align: "center",
type: "button",
fixed: "right",
btnList: [
{
label: "查看",
type: "text",
auth: "reportDatasource_getDetail",
handle: (row) =>
this.showModal(this.commonConstants.modalType.detail, row),
},
{
label: "审核",
type: "text",
handle: (row) =>
this.$refs.ApprovalModal.show({...row,contentType:this.pageData.queryData.searchType})
},
],
},
],
//end
//modal start
modalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "80vw", //
modalRef: "modalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
modalForm: [
{
type: "Input",
label: "标题",
prop: "title",
// rules: { required: true, maxLength: 100 },
width: "900px",
placeholder: "",
disabled: () => true,
},
{
type: "Input",
label: "副标题",
prop: "subtitle",
// rules: { maxLength: 100 },
width: "900px",
placeholder: "",
disabled: () => true,
},
{
type: "Cascader",
label: "资讯分类",
prop: "mainTypeId", //
data: [],
// rules: { required: true },
width: "300px",
disabled: () => true,
},
{
type: "Input",
label: "资讯来源",
prop: "source",
// rules: { required: true, maxLength: 100 },
width: "300px",
disabled: () => true,
placeholder: "",
},
{
type: "Input",
label: "作者",
prop: "author",
// rules: { maxLength: 100 },
width: "300px",
disabled: () => true,
placeholder: "",
},
{
type: "Input",
label: "编辑者",
prop: "editorName",
// rules: { maxLength: 100 },
width: "300px",
disabled: () => true,
placeholder: "",
},
// {
// type: "Input",
// label: "",
// prop: "contentLink",
// rules: { maxLength: 100 },
// width: "300px",
// },
{
type: "Input",
label: "关键词",
prop: "keywords",
// rules: { maxLength: 100 },
width: "300px",
disabled: () => true,
placeholder: "",
},
{
type: "Radio",
prop: "isVideo",
label: "内容类型",
radios: [
{ label: "资讯", value: "0" },
{ label: "视频", value: "1" },
],
width: "300px",
disabled: () => true,
},
{
type: "Img",
label: "封面",
prop: "imageUrl",
// prop: "fileList",
// accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
},
{
type: "ShowTinymce",
label: "资讯内容",
prop: "content",
// rules: { required: true },
width: "1000px",
},
],
newModalForm: [
{
type: "Upload",
label: "封面",
fileUrl: "imageUrl",
prop: "fileList",
accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
},
], //
videoModalForm: [
{
type: "Upload",
label: "封面",
fileUrl: "imageUrl",
prop: "fileList",
accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
},
{
type: "Upload",
label: "视频",
fileUrl: "videoUrl",
prop: "fileListVideo",
listType: "text",
// rules: { required: true },
width: "300px",
isVideo: true,
accept: ".mp4,.avi,.mov,.rmvb,.flv,.MP4,.AVI,.MOV,.RMVB,.FLV",
tips: "请上传视频文件",
},
], //
//modal end
//modal start
modalData: {
userId: "",
content: "",
fileUrl: "",
fileList: [],
isVideo: "0",
videoUrl: "",
source: "",
fileListVideo: [],
},
//modal end
//modal start
modalHandles: [
{ label: "取消", type: "default", handle: () => this.closeModal() },
{ label: "提交", type: "primary", handle: () => this.save() },
],
//modal end
},
parentId: "",
};
},
activated() {
this.$refs.oTable.refresh();
this.searchContentType();
},
watch: {
"pageData.modalData.isVideo": {
handler: function (val, oldval) {
if (val === "1" && oldval === "0") {
this.pageData.modalForm.splice(
-1 - this.pageData.newModalForm.length,
this.pageData.newModalForm.length,
...this.pageData.videoModalForm
);
} else if (val === "0" && oldval === "1") {
this.pageData.modalForm.splice(
-1 - this.pageData.videoModalForm.length,
this.pageData.videoModalForm.length,
...this.pageData.newModalForm
);
}
},
},
"pageData.modalData.fileList": {
handler: function (val) {
if (val && val.length === 0) {
this.pageData.modalData.imageUrl = "";
}
},
},
"pageData.modalData.fileListVideo": {
handler: function (val) {
if (val && val.length === 0) {
this.pageData.modalData.videoUrl = "";
}
},
},
"pageData.queryData.searchType": {
handler: function (val) {
this.$refs.oTable.reload();
},
},
},
methods: {
/**
* @description: 获取表格数据
* @param {type}
* @return:
* @author: ym
*/
searchTableList(pageNo, pageSize) {
// obj
var obj = {};
Object.assign(obj, this.pageData.queryData, this.pageData.tablePage);
obj.page = this.pageData.tablePage.currentPage;
obj.limit = this.pageData.tablePage.pageSize;
let data = obj.mainTypeId;
obj.mainTypeId = data[0] ? data[0] : "";
obj.secondTypeId = data[1] ? data[1] : "";
delete obj["pageSizeRange"];
if (obj.time.length == 2) {
obj.startTime = obj.time[0];
obj.endTime = obj.time[1];
}
delete obj.time;
//
let searchType = this.pageData.queryData.searchType;
if (searchType == 3) {
this.$api
.getContentImage({ ...obj, page: pageNo, limit: pageSize })
.then((res) => {
this.$refs.oTable.complete(
res.data.page.list,
res.data.page.totalCount
);
});
} else if (searchType == 4) {
this.$api
.getLocalServiceImage({ ...obj, page: pageNo, limit: pageSize })
.then((res) => {
this.$refs.oTable.complete(
res.data.page.list,
res.data.page.totalCount
);
});
} else if (searchType == 2) {
this.$api
.getLocalContentInfoListByParams({
...obj,
page: pageNo,
limit: pageSize,
})
.then((res) => {
this.$refs.oTable.complete(
res.data.page.list,
res.data.page.totalCount
);
});
} else if (searchType == 1) {
this.$api
.getContentInfoListByParams({ ...obj, page: pageNo, limit: pageSize })
.then((res) => {
this.$refs.oTable.complete(
res.data.page.list,
res.data.page.totalCount
);
});
}
// this.$api.getContentInfoListByParams({...obj,page:pageNo,limit:pageSize}).then((res) => {
// this.$refs.oTable.complete(
// res.data.page.list,
// res.data.page.totalCount
// );
// });
},
//
searchContentType() {
this.$api.getContentTypeList().then((res) => {
let data = res.data.list.map((item) => {
if (item.mainTypeName === "##") {
item.label = "地方";
} else {
item.label = item.mainTypeName;
}
item.value = item.mainTypeId;
item.children = item.children.map((item1) => {
item1.label = item1.secondTypeName;
item1.value = item1.secondTypeId;
return item1;
});
if (item.children.length === 0) {
delete item.children;
}
return item;
});
this.pageData.searchForm[1].data = data;
this.pageData.modalForm[2].data = data;
});
},
//
resetSearch() {
// this.commonUtil.clearObj(this.pageData.queryData);
this.$refs.searchForm.$refs.searchFormRef.resetFields();
// this.searchTableList();
this.$refs.oTable.reload();
},
/**
* @description: modal显示
* @param {type} 类型 1新增2编辑 3详情
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
showModal(type, row) {
this.commonUtil.clearObj(this.pageData.modalData); //modalData
this.$nextTick(() => {
this.$refs["modalRef"].$refs["modalFormRef"].clearValidate(); //
});
this.pageData.modalData.source = this.$newSource; //
this.pageData.modalData.isVideo = "0"; //isVideo watch
this.commonUtil.showModal(this.pageData.modalConfig, type);
if (type != this.commonConstants.modalType.insert) {
this.getDetail(row);
}
},
/**
* @description: 获取详细数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
getDetail(row) {
if (row.imageUrl) {
row.fileList = [
{
url: row.imageUrl,
},
];
}
if (row.videoUrl) {
row.fileListVideo = [
{
url: row.videoUrl,
// +'?x-oss-process=video/snapshot,t_10000,m_fast'
},
];
}
if (row.secondTypeId && typeof row.mainTypeId === "string") {
row.mainTypeId = [row.mainTypeId, row.secondTypeId];
}
row.isVideo = row.isVideo + "";
this.$nextTick(() => {
this.pageData.modalData = JSON.parse(JSON.stringify(row));
});
// console.log(this.pageData.modalData)
},
/**
* @description: 关闭modal
* @param
* @return:
* @author: ym
*/
closeModal() {
this.pageData.modalConfig.show = false; //modal
},
selectChange(rows) {
this.pageData.selectList = rows;
},
},
};
</script>
<style lang="scss" scoped>
.content-dialog ::v-deep .el-dialog__body {
padding: 0px;
}
>>> .el-input.is-disabled .el-input__inner {
background-color: #fff;
color: rgb(100, 100, 100);
cursor: default;
}
>>> .el-cascader .el-input .el-icon-arrow-down::before {
content: "";
/* cursor:default; */
}
>>> .el-input.is-disabled .el-input__icon {
cursor: default;
}
</style>

View File

@ -1,409 +0,0 @@
<template>
<div class="_tablepage">
<searchForm
ref="searchForm"
:searchForm="pageData.searchForm"
:searchData="pageData.queryData"
:searchHandle="pageData.searchHandle"
labelWidth="120px"
>
</searchForm>
<obj-table-plus
style="height: 60vh"
@query="searchTableList"
ref="oTable"
v-model="pageData.tableData"
:isPagination="true"
:tableCols="pageData.tableCols"
:tableHandles="pageData.tableHandles"
:tableProp="tableProp"
:toolbarProp="{}"
:tableEvent="{ 'select-change': selectChange }"
/>
<DetailModal ref="DetailModal" />
<!-- 发布时间modal -->
<modal
ref="modal"
:modalConfig="modalSetting.modalConfig"
:modalForm="modalSetting.modalForm"
:modalData="modalSetting.modalData"
:modalHandles="modalSetting.modalHandles"
/>
<!-- 审核弹窗 -->
<ApprovalModal type="course" ref="ApprovalModal" @refresh="$refs.oTable.refresh()"/>
</div>
</template>
<script>
import ApprovalModal from '../popup/approval.vue'
import DetailModal from './popup/detail.vue'
import Modal from "../../../../components/common/modal/modal.vue";
import Custable from "../../../../components/common/table/custable.vue";
import SearchForm from "../../../../components/common/searchform/searchForm.vue";
export default {
components: { Modal, Custable, SearchForm,DetailModal ,ApprovalModal},
data() {
return {
typeList: [],
tableProp: {
height: "auto",
},
pageData: {
// start
searchForm: [
{ type: "Input", label: "标题/课程简介", prop: "searchName" },
{
type: "Cascader",
label: "课程类型",
prop: "courseType",
rules: {
required: true,
message: "请选择课程类型",
trigger: "blur",
},
props: {
lazy: true,
lazyLoad: (node, reslove) => {
if (node.data.leaf) {
reslove();
} else {
this.$api
.courseThemeAll({ courseType: node.value })
.then((res) => {
reslove(
res.data.list.map((item) => {
return {
label: item.themeName,
value: item.courseThemeId,
leaf: true,
};
})
);
});
}
},
checkStrictly: true,
},
data: this.commonConstants.courseType,
},
{
type: "Select",
label: "审核状态",
prop: "examineStatus",
default:true,
options: [
{ label: "未审核", value: 0 },
{ label: "审核通过", value: 1 },
{ label: "审核未通过", value: 2 },
],
},
{
type: "Select",
label: "年级",
prop: "courseGrade",
default:true,
options: [
{ label: "低年级", value: 2 },
{ label: "中年级", value: 3 },
// { label: "", value: 4 },
{ label: "高年级", value: 5 },
],
},
],
// end
// start
queryData: {
searchName: "",
courseType: "红心向党",
examineStatus:'',
courseGrade:''
},
// end
//start
searchHandle: [
{
label: "查询",
type: "primary",
submit: true,
handle: () => this.$refs.oTable.reload(),
auth: "reportDatasource_search",
},
{
label: "重置",
type: "warning",
handle: () => this.resetSearch(),
auth: "reportDatasource_search",
},
],
//end
//start
tableData: [],
//end
// start
tableHandles: [
// {
// label: "",
// type: "primary",
// handle: () => this.showModal(this.commonConstants.modalType.insert),
// auth: "reportDatasource_insert",
// },
// {
// label: "",
// type: "danger",
// handle: () => this.deleteBatch(),
// auth: "reportDatasource_batchDelete",
// },
],
// end
selectList: [], //
//start
tablePage: {
currentPage: 1,
pageSize: 5,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
//end
//start
tableCols: [
{ title: "标题", field: "title", align: "center" },
{ title: "封面", field: "image",type:'image', align: "center" },
{ title: "试卷名称", field: "paperName", align: "center" },
{
title: "发布时间",
field: "releaseTime",
align: "center",
type: "jsx",
render: ({ row }) => {
let publish = () => {
if (!row.releaseTime) {
this.modalSetting.modalConfig.show = true;
this.modalSetting.row = row;
// console.log(row)
}
};
if (row.releaseTime) {
return <span>{row.releaseTime}</span>;
} else {
return (
<el-button type="text" on-click={publish}>
发布
</el-button>
);
}
},
// formatter: (prop, row) => {
// if (!row[prop]) {
// return "";
// }
// },
// itemClass: (row) => {
// if (!row.releaseTime) {
// return "el-button el-button--text el-button--medium";
// }
// },
// click: (row) => {
// if (!row.releaseTime) {
// this.modalSetting.modalConfig.show = true;
// this.modalSetting.row = row;
// // console.log(row)
// }
// },
},
{ title: "课程分类", field: "courseType", align: "center" },
{
title: "审核状态",
field: "createTime",
align: "center",
// "title-help":{message: ''},
type: "jsx",
render: ({ row }) => {
switch (row.examineStatus) {
case 0:
return (
<span>
<span style="color:gray">未审核</span>
</span>
);
case 1:
return (
<span>
<span style="color:green">审核通过</span>
</span>
);
case 2:
return (
<span>
<span style="color:red">审核未通过</span>
</span>
);
default:
return (<span></span>);
}
},
},
{
title: "操作",
align: "center",
type: "button",
fixed: "right",
btnList: [
{
label: "查看",
type: "text",
auth: "reportDatasource_update",
handle: (row) =>
this.showModal(this.commonConstants.modalType.update, row),
},
{
label: "审核",
type: "text",
handle: (row) =>
this.$refs.ApprovalModal.show(row)
},
],
},
],
},
modalSetting: {
modalConfig: {
show: false,
title: "发布",
},
modalForm: [
{
label: "发布时间",
prop: "releaseTime",
type: "DateTime",
rules: { required: true },
},
],
modalData: {
releaseTime: "",
},
row: {},
modalHandles: [
{
label: "确认",
type: "primary",
handle: () => {
this.updateReleaseTime();
},
},
],
},
//
isUpdate: false,
updateData: {},
};
},
activated() {
this.$refs.oTable.refresh();
},
methods: {
/**
* @description: 获取表格数据
* @param {type}
* @return:
* @author: ym
*/
searchTableList(pageNo,pageSize) {
// obj
var obj = {};
Object.assign(obj, this.pageData.queryData, this.pageData.tablePage);
// obj.page = this.pageData.tablePage.currentPage;
// obj.limit = this.pageData.tablePage.pageSize;
delete obj["pageSizeRange"];
if (obj.courseType.length == 0) {
obj.courseType = "";
obj.courseThemeId = "";
} else if (obj.courseType.length == 1) {
obj.courseType = obj.courseType[0];
obj.courseThemeId = "";
} else if (obj.courseType.length == 2) {
obj.courseThemeId = obj.courseType[1];
obj.courseType = obj.courseType[0];
}
//
this.$api
.getCourseListByParams({...obj,page:pageNo,limit:pageSize})
.then((res) => {
this.$refs.oTable.complete(res.data.page.list,res.data.page.totalCount)
})
},
//
resetSearch() {
this.$refs.searchForm.$refs.searchFormRef.resetFields();
this.$refs.oTable.reload()
},
/**
* @description: modal显示
* @param {type} 类型 1新增2编辑 3详情
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
showModal(type, row) {
// console.log(type, row);
if (row && row.releaseTime) {
row.isSubmit = true;
} else if (row) {
row.isSubmit = false;
}
if (type != this.commonConstants.modalType.insert) {
this.isUpdate = true;
this.updateData = JSON.parse(JSON.stringify(row));
} else {
this.isUpdate = false;
this.updateData = {};
}
this.$refs.DetailModal.modalConfig.show = true;
this.$refs.DetailModal.modalData=this.updateData
},
/**
* @description: 关闭modal
* @param
* @return:
* @author: ym
*/
closeModal() {
// this.$refs["modalRef"].$refs["modalFormRef"].resetFields(); //
// this.pageData.modalConfig.show = false; //modal
// this.commonUtil.clearObj(this.pageData.modalData); //modalData
},
updateReleaseTime() {
this.$refs.modal.$refs.modalFormRef.validate((valid) => {
if (valid) {
let data = Object.assign({}, this.modalSetting.row);
data.releaseTime = this.modalSetting.modalData.releaseTime;
this.$api.updateRedCourse(data).then((res) => {
this.modalSetting.modalData.releaseTime = "";
this.$nextTick(() => {
this.$refs.modal.$refs.modalFormRef.clearValidate();
});
this.modalSetting.modalConfig.show = false;
this.$refs.oTable.reload();
});
} else {
return false;
}
});
},
selectChange(rows) {
this.pageData.selectList = rows;
},
},
};
</script>
<style lang="scss" scoped>
.content-dialog ::v-deep .el-dialog__body {
padding: 0px;
}
</style>

View File

@ -1,133 +0,0 @@
<!--
* @Author: 陈伟亮 1186723967@qq.com
* @Date: 2022-06-18 21:28:41
* @LastEditors: 陈伟亮 1186723967@qq.com
* @LastEditTime: 2022-06-18 22:14:16
* @FilePath: \background-front-end\src\views\modules\approval\course\popup\detail.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div>
<modal
:modalConfig="modalConfig"
:modalForm="modalForm"
:modalData="modalData"
/>
</div>
</template>
<script>
import modal from "@/components/common/modal/modal.vue";
export default {
components: {
modal,
},
data() {
return {
modalConfig: {
title: "查看",
show: false,
width: "70vw",
},
modalForm: [
{
type: "Input",
label: "课程标题",
prop: "title",
// rules: { required: true, maxLength: 100 },
width: "900px",
disabled: () => true,
},
{
type: "Textarea",
label: "课程描述",
prop: "content",
// rules: { required: true, maxLength: 500 },
width: "900px",
disabled: () => true,
},
{
type: "Select",
label: "课程分类",
prop: "courseType",
// rules: { required: true },
default: false,
options: [
{ label: "爱国主义", value: "爱国主义" },
{ label: "立德树人", value: "立德树人" },
{ label: "家教家风", value: "家教家风" },
],
width: "900px",
disabled: () => true,
},
{
//
label: "立即发布",
type: "Switch",
prop: "isSubmit",
disabled: () => {
return true;
},
},
// {
// type: "Input",
// label: "",
// prop: "paperName",
// rules: { required: true, maxLength: 100 },
// },
{
type: "Img",
label: "课程封面",
prop:'image',
// fileUrl: "image",
// prop: "fileList",
// accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
// rules: { required: true },
},
{
type: "Video",
label: "视频",
prop:'videoUrl',
// fileUrl: "videoUrl",
// prop: "fileListVideo",
// listType: "text",
// rules: { required: true },
width: "900px",
// isVideo: true,
// accept: ".mp4,.avi,.mov,.rmvb,.flv,.MP4,.AVI,.MOV,.RMVB,.FLV",
// tips: "",
},
{
type:'Paper',
label:'试卷',
prop:'projectDTO',
width:'900px'
}
],
modalData: {},
};
},
};
</script>
<style scoped>
>>> .el-input.is-disabled .el-input__inner {
background-color: #fff;
color: rgb(100, 100, 100);
cursor: default;
}
>>> .el-textarea.is-disabled .el-textarea__inner {
background-color: #fff;
color: rgb(100, 100, 100);
cursor: default;
}
>>> .el-cascader .el-input .el-icon-arrow-down::before {
content: "";
/* cursor:default; */
}
>>> .el-input.is-disabled .el-input__icon {
cursor: default;
}
>>> .el-switch.is-disabled .el-switch__core, .el-switch.is-disabled .el-switch__label{
cursor:default
}
</style>

View File

@ -1,497 +0,0 @@
<template>
<div class="_tablepage">
<searchForm
:searchForm="pageData.searchForm"
:searchData="pageData.queryData"
:searchHandle="pageData.searchHandle"
labelWidth="120px"
>
</searchForm>
<obj-table-plus
style="height: 60vh"
@query="searchTableList"
ref="oTable"
v-model="pageData.tableData"
:isPagination="true"
:tableCols="pageData.tableCols"
:tableHandles="pageData.tableHandles"
:tableProp="tableProp"
:tableEvent="{ 'select-change': selectChange }"
:toolbarProp="{}"
>
</obj-table-plus>
<modal
class="modal"
ref="modalRef"
:modalConfig="pageData.modalConfig"
:modalForm="pageData.modalForm"
:modalData="pageData.modalData"
:modalHandles="pageData.modalHandles"
@closeModal="closeModal()"
></modal>
<!-- 审核弹窗 -->
<ApprovalModal type="poetry" ref="ApprovalModal" @refresh="$refs.oTable.refresh()"/>
</div>
</template>
<script>
import ApprovalModal from '../popup/approval.vue'
import Modal from "@/components/common/modal/modal.vue";
import SearchForm from "@/components/common/searchform/searchForm.vue";
export default {
components: { Modal, SearchForm ,ApprovalModal},
watch: {
"pageData.modalData.fileListVideo": {
handler: function (val) {
if (val && val.length === 0) {
this.pageData.modalData.videoUrl = "";
}
},
},
"pageData.modalData.fileListAudio": {
handler: function (val) {
if (val && val.length === 0) {
this.pageData.modalData.audioUrl = "";
}
},
},
},
data() {
return {
//
loading: false,
typeList: [],
tableProp: {
height: "auto",
},
pageData: {
// start
searchForm: [
{
type: "Cascader",
label: "古诗词分类",
prop: "typeId",
props: { checkStrictly: true },
data: [],
},
{ type: "Input", label: "标题/作者/朝代", prop: "searchName" },
{
type: "Select",
label: "审核状态",
prop: "examineStatus",
default:true,
options: [
{ label: "未审核", value: 0 },
{ label: "审核通过", value: 1 },
{ label: "审核未通过", value: 2 },
],
},
],
// end
// start
queryData: {
searchName: "",
typeId: [],
examineStatus:'',
},
// end
//start
searchHandle: [
{
label: "查询",
type: "primary",
handle: () => {
this.$refs.oTable.reload();
},
auth: "reportDatasource_search",
},
{
label: "重置",
type: "warning",
handle: () => {
this.pageData.queryData = {
searchName: "",
typeId: [],
examineStatus: "",
};
this.$refs.oTable.reload();
},
auth: "reportDatasource_search",
},
],
//end
//start
tableData: [],
//end
// start
// tableHandles: [
// {
// label: "",
// type: "primary",
// handle: () => this.showModal(this.commonConstants.modalType.insert),
// auth: "reportDatasource_insert",
// },
// {
// label: "",
// type: "danger",
// handle: () => this.deleteBatch(),
// auth: "reportDatasource_batchDelete",
// },
// ],
// end
selectList: [], //
//start
tableCols: [
{ title: "标题", field: "title", align: "center" },
{ title: "副标题", field: "subtitle", align: "center" },
{ title: "作者", field: "author", align: "center" },
{ title: "朝代", field: "dynasty", align: "center" },
{ title: "修改时间", field: "createTime", align: "center" },
{
title: "审核状态",
field: "createTime",
align: "center",
// "title-help":{message: ''},
type: "jsx",
render: ({ row }) => {
switch (row.examineStatus) {
case 0:
return (
<span>
<span style="color:gray">未审核</span>
</span>
);
case 1:
return (
<span>
<span style="color:green">审核通过</span>
</span>
);
case 2:
return (
<span>
<span style="color:red">审核未通过</span>
</span>
);
default:
return (<span></span>);
}
},
},
{
title: "操作",
field: "operation",
align: "center",
type: "button",
fixed: "right",
btnList: [
{
label: "查看",
type: "text",
auth: "reportDatasource_update",
handle: (row) =>
this.showModal(this.commonConstants.modalType.update, row),
},
{
label: "审核",
type: "text",
handle: (row) =>
this.$refs.ApprovalModal.show(row)
},
],
},
],
//end
//modal start
modalConfig: {
title: "查看", //,:
show: false, //
formEditDisabled: false, //
width: "1200px", //
modalRef: "modalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
modalForm: [
{
type: "Input",
label: "标题",
prop: "title",
// rules: { required: true, maxLength: 100 },
width: "900px",
disabled: () => true,
},
{
type: "Input",
label: "副标题",
prop: "subtitle",
// rules: { maxLength: 100 },
width: "900px",
disabled: () => true,
},
{
type: "Cascader",
label: "古诗词分类",
prop: "typeId",
data: [],
// rules: { required: true },
props: { multiple: true, checkStrictly: true },
disabled: () => true,
},
{
type: "Input",
label: "作者",
prop: "author",
// rules: { maxLength: 100 ,required: true},
width: "300px",
disabled: () => true,
},
{
type: "Input",
label: "朝代",
prop: "dynasty",
// rules: { maxLength: 100, required: true },
width: "300px",
disabled: () => true,
},
{
type: "ShowTinymce",
label: "注释",
prop: "notes",
width: "1000px",
},
{
type: "ShowTinymce",
label: "翻译",
prop: "translate",
// rules: { required: true },
width: "1000px",
},
{
type: "ShowTinymce",
label: "古诗词正文",
prop: "content",
// rules: { required: true },
width: "1000px",
},
{
type: "Video",
label: "视频",
prop: "videoUrl",
// fileUrl: "videoUrl",
// prop: "fileListVideo",
// listType: "text",
width: "800px",
// isVideo: true,
// accept: ".mp4,.avi,.mov,.rmvb,.flv,.MP4,.AVI,.MOV,.RMVB,.FLV",
// tips: "",
},
{
type: "Audio",
label: "音频",
prop: "audioUrl",
// prop: "fileListAudio",
// width: "300px",
// listType: "text",
// accept: ".cda,.wav,.mp3,.wma,.CDA,.WAV,.MP3,.WMA",
// tips: "",
},
],
//modal end
//modal start
modalData: {
title: "",
fileListVideo: [],
fileListAudio: [],
videoUrl: "",
audioUrl: "",
},
//modal end
//modal start
modalHandles: [
{ label: "取消", type: "default", handle: () => this.closeModal() },
// { label: "", type: "primary", handle: () => this.save() },
],
//modal end
},
};
},
created() {
console.log(123);
},
activated() {
this.$refs.oTable.refresh();
this.searchContentType();
},
methods: {
/**
* @description: 获取表格数据
* @param {type}
* @return:
* @author: ym
*/
searchTableList(pageNo, pageSize) {
this.loading = true;
// obj
var obj = {};
console.log(this.pageData.queryData);
this.pageData.queryData.typeId[0]
? (this.pageData.queryData.mainTypeId =
this.pageData.queryData.typeId[0])
: delete this.pageData.queryData["mainTypeId"];
this.pageData.queryData.typeId[1]
? (this.pageData.queryData.secondTypeId =
this.pageData.queryData.typeId[1])
: delete this.pageData.queryData["secondTypeId"];
Object.assign(obj, this.pageData.queryData);
delete obj["typeId"];
//
this.$api
.getPoetryByParams({ ...obj, limit: pageSize, page: pageNo })
.then((res) => {
// this.commonUtil.tableAssignment(
// pageNo,
// pageSize,
// this.pageData.tableData
// );
console.log("resresres", res);
this.$refs.oTable.complete(
res.data.page.list,
res.data.page.totalCount
);
})
.catch(() => {
this.$refs.oTable.complete(false);
});
},
//
searchContentType() {
this.$api.getMainSecondTypeList().then((res) => {
this.pageData.searchForm[0].data = this.addChildren(res.data.list);
this.pageData.modalForm[2].data = this.pageData.searchForm[0].data;
console.log("this.pageData.searchForm", this.pageData.searchForm);
});
},
addChildren(arr) {
if (Array.isArray(arr) && arr.length > 0) {
let outPut = [];
arr.forEach((item, index) => {
outPut.push({
children: item.children ? this.addChildren(item.children) : "",
label: item.secondTypeId ? item.secondTypeName : item.mainTypeName,
// value: item.secondTypeId ? item.secondTypeName : item.mainTypeName,
value: item.secondTypeId ? item.secondTypeId : item.mainTypeId,
id: item.secondTypeId ? item.secondTypeId : item.mainTypeId,
});
});
return outPut;
} else {
return arr;
}
},
/**
* @description: modal显示
* @param {type} 类型 1新增2编辑 3详情
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
showModal(type, row) {
console.log(type);
this.commonUtil.clearObj(this.pageData.modalData); //modalData
this.$nextTick(() => {
this.$refs["modalRef"].$refs["modalFormRef"].clearValidate(); //
});
this.pageData.modalConfig.show = true;
// this.commonUtil.showModal(this.pageData.modalConfig, type);
if (type != this.commonConstants.modalType.insert) {
this.getDetail(row);
}
},
/**
* @description: 获取详细数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
getDetail(row) {
if (row.videoUrl) {
row.fileListVideo = [
{
url: row.videoUrl,
},
];
}
if (row.audioUrl) {
row.fileListAudio = [
{
url: row.audioUrl,
},
];
}
this.pageData.modalData = JSON.parse(JSON.stringify(row));
let mainTypeIds = this.pageData.modalData.mainTypeIds.split(",");
let secondTypeIds = this.pageData.modalData.secondTypeIds.split(",");
let data = this.pageData.searchForm[0].data;
let typeId = [];
mainTypeIds.forEach((mainTypeId) => {
let mainIndex;
data.forEach((item, index) => {
if (item.value === mainTypeId) {
mainIndex = index;
return;
}
});
secondTypeIds.forEach((secondTypeId) => {
data[mainIndex].children.forEach((item1) => {
if (item1.value === secondTypeId) {
typeId.push([mainTypeId, secondTypeId]);
}
});
});
});
this.pageData.modalData.typeId = typeId;
// console.log(mainTypeIds,secondTypeIds);
},
/**
* @description: 关闭modal
* @param
* @return:
* @author: ym
*/
closeModal() {
this.pageData.modalConfig.show = false; //modal
},
selectChange(rows) {
this.pageData.selectList = rows;
},
routerTo(row) {
this.$store.commit("setParameters", {
key: "datasourceId",
value: row.id,
});
this.$router.push({ name: "datesourceDictCode" });
},
},
};
</script>
<style scoped>
>>> .el-input.is-disabled .el-input__inner {
background-color: #fff;
color: rgb(100, 100, 100);
cursor: default;
}
>>> .el-cascader .el-input .el-icon-arrow-down::before {
content: "";
/* cursor:default; */
}
>>> .el-input.is-disabled .el-input__icon {
cursor: default;
}
/* .modal ::v-deep */
</style>

View File

@ -1,117 +0,0 @@
<!--
* @Author: 陈伟亮 1186723967@qq.com
* @Date: 2022-06-20 15:44:39
* @LastEditors: 陈伟亮 1186723967@qq.com
* @LastEditTime: 2022-06-20 17:52:29
* @FilePath: \background-front-end\src\views\modules\approval\popup\approval.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<Modal
:modalConfig="modalConfig"
:modalForm="modalForm"
:modalData="modalData"
:modalHandles="modalHandles"
/>
</template>
<script>
import Modal from "@/components/common/modal/modal.vue";
import {mapState} from 'vuex'
export default {
components: {
Modal,
},
props: {
//poetry,content,course
type: {
type: String,
default: "",
},
},
data() {
return {
modalConfig: {
title: "审核情况",
show: false,
},
modalData: {
examineReason: "",
examineStatus: "",
},
modalForm: [
{
label: "审核状态",
type: "Select",
prop: "examineStatus",
options: [
{ label: "未审核", value: 0 },
{ label: "审核通过", value: 1 },
{ label: "审核未通过", value: 2 },
],
rules: { required: true },
},
{
label: "审核原因",
type: "Textarea",
prop: "examineReason",
width: "400px",
rows: 6,
},
],
modalHandles: [
{
label: "取消",
handle: () => {
this.modalConfig.show = false;
},
},
{
label: "确认",
type: "primary",
loading:false,
submit:true,
handle: () => {
this.modalHandles[1].loading=true
let { examineReason, examineStatus } = this.modalData;
let obj = {
examineReason,
examineStatus,
userId:this.user.id
};
console.log(this.modalData)
switch (this.type) {
case "poetry":
obj.poetryId = this.modalData.poetryId;
break;
case "content":
obj.contentInfoId = this.modalData.contentInfoId;
obj.contentType=this.modalData.contentType;
break;
case "course":
obj.courseId = this.modalData.courseId;
break;
}
this.$api.approval[this.type](obj).then((res) => {
this.$emit("refresh");
this.modalConfig.show=false
}).finally(()=>{
this.modalHandles[1].loading=false;
});
},
},
],
};
},
computed:{
...mapState(['user'])
},
methods: {
show(row) {
this.modalData =JSON.parse(JSON.stringify(row));
this.modalConfig.show = true;
},
},
};
</script>
<style lang="">
</style>

View File

@ -1,896 +0,0 @@
<template>
<div class="_tablepage">
<searchForm
ref="searchForm"
:searchForm="pageData.searchForm"
:searchData="pageData.queryData"
:searchHandle="pageData.searchHandle"
>
</searchForm>
<!-- <cusTable
:loading="loading"
:isSelection="true"
:isIndex="true"
:isPagination="true"
:isHandle="true"
:tableCols="pageData.tableCols"
:tableHandles="pageData.tableHandles"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
@handleCurrentChange="searchTableList"
@selectChange="selectChange"
@handleSizeChange="searchTableList"
></cusTable> -->
<obj-table-plus
style="height: 60vh"
@query="searchTableList"
ref="oTable"
v-model="pageData.tableData"
:isPagination="true"
:tableCols="pageData.tableCols"
:tableProp="tableProp"
:toolbarProp="toolbarProp"
:toolbarEvent="toolbarEvent"
:tableEvent="tableEvent"
:enableAutoQuery="false"
/>
<modal
class="modal"
ref="modalRef"
:modalConfig="pageData.modalConfig"
:modalForm="pageData.modalForm"
:modalData="pageData.modalData"
:modalHandles="pageData.modalHandles"
@closeModal="closeModal()"
></modal>
<comment ref="comment" :parentId="parentId" type="CONTENTINFO" />
<see ref="see" />
</div>
</template>
<script>
import see from "./popup/new-content-see.vue";
import comment from "../../../components/comment/comment.vue";
import modal from "../../../components/common/modal/modal.vue";
import searchForm from "../../../components/common/searchform/searchForm.vue";
import cusTable from "../../../components/common/table/custable.vue";
export default {
components: { searchForm, cusTable, modal, comment, see },
data() {
return {
//
loading: false,
typeList: [],
tableProp: {
height: "auto",
},
toolbarProp: {
buttons: [
{
status: "primary",
name: "新增",
code: "add",
},
{
status: "danger",
name: "批量删除",
code: "delBatch",
},
],
},
tableEvent: {
"checkbox-change": this.selectChange,
"checkbox-all": this.selectChange,
},
toolbarEvent: {
"button-click": ({ code }) => {
if (code == "add") {
this.showModal(this.commonConstants.modalType.insert);
} else if (code == "delBatch") {
this.deleteBatch();
}
},
},
pageData: {
// start
searchForm: [
{
type: "Input",
label: "关键字",
size: "mini",
prop: "searchName",
placeholder: "标题、来源、编辑者名称",
width: "230px",
},
{
type: "Cascader",
label: "资讯分类",
size: "mini",
prop: "mainTypeId", //
data: [],
},
{
type: "Select",
label: "内容类型",
size: "mini",
prop: "isVideo",
options: [
{
label: "资讯",
value: 0,
},
{ label: "视频", value: 1 },
],
},
{
size: "mini",
type: "DateTimeRange",
label: "发布时间范围",
prop: "time",
},
{
type: "Select",
label: "审核状态",
prop: "examineStatus",
default: true,
size: "mini",
options: [
{ label: "未审核", value: 0 },
{ label: "审核通过", value: 1 },
{ label: "审核未通过", value: 2 },
],
},
],
// end
// start
queryData: {
searchName: "",
mainTypeId: "",
time: [],
isVideo: 0,
examineStatus: "",
},
// end
//start
searchHandle: [
{
label: "查询",
size: "mini",
type: "primary",
handle: () => this.$refs.oTable.reload(),
auth: "reportDatasource_search",
},
{
label: "重置",
size: "mini",
type: "warning",
handle: () => this.resetSearch(),
auth: "reportDatasource_search",
},
],
//end
//start
tableData: [],
//end
// start
tableHandles: [
{
label: "新增",
type: "primary",
handle: () => this.showModal(this.commonConstants.modalType.insert),
auth: "reportDatasource_insert",
},
{
label: "批量删除",
type: "danger",
handle: () => this.deleteBatch(),
auth: "reportDatasource_batchDelete",
},
],
// end
selectList: [], //
//start
tablePage: {
currentPage: 1,
pageSize: 5,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
//end
//start
tableCols: [
{ type: "checkbox", width: "60px", fixed: "left" },
{
title: "标题",
field: "title",
align: "center",
"min-width": 160,
fixed: "left",
},
{
title: "副标题",
field: "subtitle",
align: "center",
"min-width": 100,
},
{
title: "主分类名",
field: "mainTypeName",
align: "center",
"min-width": 100,
},
{
title: "子分类名",
field: "secondTypeName",
align: "center",
"min-width": 100,
},
{
title: "资讯来源",
field: "source",
align: "center",
"min-width": 100,
},
{
title: "编辑者",
field: "editorName",
align: "center",
"min-width": 100,
},
{ title: "作者", field: "author", align: "center", "min-width": 100 },
{
title: "封面",
type: "jsx",
field: "imageUrl",
align: "center",
"min-width": 100,
render: ({ row }) => {
// @/assets/images/noimg.svg
return (
<el-image
fit="cover"
src={
row.imageUrl
? row.imageUrl
: require("@/assets/images/noimg.svg")
}
></el-image>
);
},
},
// { title: "", field: "contentLink", align: "center" },
{
title: "阅读数",
field: "readNumber",
align: "center",
"min-width": 100,
},
{
title: "点赞数",
field: "likeNumber",
align: "center",
"min-width": 100,
},
{
title: "评论数",
field: "commentNumber",
align: "center",
"min-width": 100,
},
{
title: "收藏数",
field: "collectNumber",
align: "center",
"min-width": 100,
},
{
title: "审核状态",
field: "createTime",
align: "center",
// "title-help":{message: ''},
type: "jsx",
"min-width": 100,
render: ({ row }) => {
switch (row.examineStatus) {
case 0:
return (
<span>
<span style="color:gray">未审核</span>
</span>
);
case 1:
return (
<span>
<span style="color:green">审核通过</span>
</span>
);
case 2:
return (
<span>
<span style="color:red">审核未通过</span>
</span>
);
default:
return <span></span>;
}
},
},
{
title: "操作",
field: "operation",
align: "center",
type: "jsx",
fixed: "right",
width: "200px",
render: ({ row }) => {
const com = () => {
if (row.examineStatus == 1) {
return (
<el-button
type="text"
size="mini"
onClick={() => {
this.parentId = row.contentInfoId;
this.$refs.comment.modalConfig.show = true;
}}
>
查看评论
</el-button>
);
} else if (row.examineStatus == 2) {
return (
<el-button
type="text"
size="mini"
onClick={() =>
this.$confirm("确认重新提交吗?", "提示").then(
(action) => {
if (action == "confirm") {
this.$api
.updateRedContentInfo({
...row,
examineStatus: 0,
})
.then((res) => {
this.$refs.oTable.refresh();
});
}
}
)
}
>
重新提交
</el-button>
);
}
};
return (
<div>
{com()}
<el-button
type="text"
size="mini"
onClick={
() => this.$refs.see.show(row)
// this.showModal(this.commonConstants.modalType.detail, row)
}
>
查看
</el-button>
<el-button
type="text"
size="mini"
onClick={() =>
this.showModal(this.commonConstants.modalType.update, row)
}
>
编辑
</el-button>
<el-button
type="text"
size="mini"
onClick={() => this.deleteOne(row.contentInfoId)}
>
删除
</el-button>
</div>
);
},
},
],
//end
//modal start
modalConfig: {
title: "新增资讯", //,:
show: false, //
formEditDisabled: false, //
// width: "80vw", //
modalRef: "modalRef", //modal
type: "1", // 1 2 3
fullscreen:true
},
//modal end
//modal start
modalForm: [
{
type: "Input",
label: "标题",
prop: "title",
rules: { required: true, maxLength: 64 },
width: "796px",
showWordLimit:true,
maxlength:64,
placeholder:"请在这里输入标题"
},
{
type: "Input",
label: "副标题",
prop: "subtitle",
rules: { maxLength: 64 },
width: "796px",
showWordLimit:true,
maxlength:64,
},
{
type: "Input",
label: "作者",
prop: "author",
rules: { maxLength: 10 },
width: "796px",
maxlength:10,
showWordLimit:true,
},
{
type: "Tinymce",
label: "资讯内容",
prop: "content",
rules: { required: true },
width: "800px",
//tinymce initconfig
config:{
toolbar_sticky:true,
// fixed_toolbar_container:"#tinymce_fixed_toolbar",
max_height:Infinity,
min_height:300,
skin:"oxide-sticky",
placeholder:"从这里开始填写正文",
border:"0 0 0 0"
},
//
toolbars:['undo redo fontsizeselect bold italic underline strikethrough forecolor backcolor removeformat subscript superscript blockquote alignleft aligncenter alignright alignjustify lineheightcustom indent2em wlindent hr bullist numlist link image charmap insertdatetime media table emoticons preview print tpImportword wlxiumi' ]
},
{
type: "Cascader",
label: "资讯分类",
prop: "mainTypeId", //
data: [],
rules: { required: true },
width: "300px",
},
{
type: "Input",
label: "资讯来源",
prop: "source",
rules: { required: true, maxLength: 100 },
width: "300px",
},
{
type: "Input",
label: "编辑者",
prop: "editorName",
rules: { maxLength: 100 },
width: "300px",
},
// {
// type: "Input",
// label: "",
// prop: "contentLink",
// rules: { maxLength: 100 },
// width: "300px",
// },
{
type: "Input",
label: "关键词",
prop: "keywords",
rules: { maxLength: 100 },
width: "300px",
},
{
type: "Radio",
prop: "isVideo",
label: "内容类型",
border:true,
radios: [
{ label: "资讯", value: "0" },
{ label: "视频", value: "1" },
],
width: "300px",
},
{
type: "Upload",
label: "封面",
fileUrl: "imageUrl",
prop: "fileList",
drag:true,
accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
}
],
newModalForm: [
{
type: "Upload",
label: "封面",
fileUrl: "imageUrl",
prop: "fileList",
drag:true,
accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
},
], //
videoModalForm: [
{
type: "Upload",
label: "封面",
fileUrl: "imageUrl",
prop: "fileList",
drag:true,
accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
},
{
type: "Upload",
label: "视频",
fileUrl: "videoUrl",
prop: "fileListVideo",
drag:true,
listType: "text",
rules: { required: true },
width: "300px",
isVideo: true,
accept: ".mp4,.avi,.mov,.rmvb,.flv,.MP4,.AVI,.MOV,.RMVB,.FLV",
tips: "请上传视频文件",
},
], //
//modal end
//modal start
modalData: {
userId: "",
content: "",
fileUrl: "",
fileList: [],
isVideo: "0",
videoUrl: "",
source: "",
fileListVideo: [],
},
//modal end
//modal start
modalHandles: [
{ label: "取消", type: "default",icon:"el-icon-close",handle: () => this.closeModal() },
{ label: "提交", type: "primary",loading:false,icon:"el-icon-upload2",handle: (item) => this.save(item) },
],
//modal end
},
parentId: "",
};
},
activated() {
if(this.pageData.queryData.mainTypeId){
this.$refs.oTable.refresh();
}
this.searchContentType();
},
watch: {
"pageData.modalData.isVideo": {
handler: function (val, oldval) {
// console.log(val)
if (val === "1" && oldval === "0") {
this.pageData.modalForm.splice(
0 - this.pageData.newModalForm.length,
this.pageData.newModalForm.length,
...this.pageData.videoModalForm
);
} else if (val === "0" && oldval === "1") {
this.pageData.modalForm.splice(
0 - this.pageData.videoModalForm.length,
this.pageData.videoModalForm.length,
...this.pageData.newModalForm
);
}
},
},
"pageData.modalData.fileList": {
handler: function (val) {
if (val && val.length === 0) {
this.pageData.modalData.imageUrl = "";
}
},
},
"pageData.modalData.fileListVideo": {
handler: function (val) {
if (val && val.length === 0) {
this.pageData.modalData.videoUrl = "";
}
},
},
},
methods: {
/**
* @description: 获取表格数据
* @param {type}
* @return:
* @author: ym
*/
searchTableList(pageNo, pageSize) {
// obj
var obj = {};
Object.assign(obj, this.pageData.queryData, this.pageData.tablePage);
let data = obj.mainTypeId;
obj.mainTypeId = data[0] ? data[0] : "";
obj.secondTypeId = data[1] ? data[1] : "";
delete obj["pageSizeRange"];
if (obj.time.length == 2) {
obj.startTime = obj.time[0];
obj.endTime = obj.time[1];
}
delete obj.time;
//
this.$api
.getContentInfoListByParams({ ...obj, page: pageNo, limit: pageSize })
.then((res) => {
this.$refs.oTable.complete(
res.data.page.list,
res.data.page.totalCount
);
// this.commonUtil.tableAssignment(
// res.data.page,
// this.pageData.tablePage,
// this.pageData.tableData
// );
});
},
//
searchContentType() {
this.$api.getContentTypeList().then((res) => {
let data = res.data.list.map((item) => {
// console.log(item.mainTypeName==='##')
if (item.mainTypeName === "##") {
item.label = "地方";
} else {
item.label = item.mainTypeName;
}
item.value = item.mainTypeId;
item.children = item.children.map((item1) => {
item1.label = item1.secondTypeName;
item1.value = item1.secondTypeId;
return item1;
});
if (item.children.length === 0) {
delete item.children;
}
return item;
}).filter(item=>item.label!='地方');
// console.log(data)
this.pageData.searchForm[1].data = data;
//
this.pageData.modalForm[4].data = data;
//
this.$refs.see.modalForm[2].data = data;
//
if(!this.pageData.queryData.mainTypeId){
if(data[0]&&data[0].children&&data[0].children.length!=0){
this.pageData.queryData.mainTypeId=[data[0].value,data[0].children[0].value]
}else{
this.pageData.queryData.mainTypeId=[data[0].value]
}
this.$refs.oTable.refresh()
}
});
},
//
resetSearch() {
// this.commonUtil.clearObj(this.pageData.queryData);
let mainTypeId=this.pageData.queryData.mainTypeId
this.$refs.searchForm.$refs.searchFormRef.resetFields();
this.pageData.queryData.mainTypeId=mainTypeId
this.$refs.oTable.reload();
},
/**
* @description: modal显示
* @param {type} 类型 1新增2编辑 3详情
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
showModal(type, row) {
this.commonUtil.clearObj(this.pageData.modalData); //modalData
this.$nextTick(() => {
this.$refs["modalRef"].$refs["modalFormRef"].clearValidate(); //
});
this.pageData.modalData.source = this.$newSource; //
this.pageData.modalData.isVideo = "0"; //isVideo watch
this.commonUtil.showModal(this.pageData.modalConfig, type);
if (type != this.commonConstants.modalType.insert) {
this.getDetail(row);
}
},
/**
* @description: 获取详细数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
getDetail(row) {
if (row.imageUrl) {
row.fileList = [
{
url: row.imageUrl,
},
];
}
if (row.videoUrl) {
row.fileListVideo = [
{
url: row.videoUrl,
// +'?x-oss-process=video/snapshot,t_10000,m_fast'
},
];
}
if (row.secondTypeId && typeof row.mainTypeId === "string") {
row.mainTypeId = [row.mainTypeId, row.secondTypeId];
}
row.isVideo = row.isVideo + "";
this.$nextTick(() => {
this.pageData.modalData = JSON.parse(JSON.stringify(row));
});
// console.log(this.pageData.modalData)
},
/**
* @description: 关闭modal
* @param
* @return:
* @author: ym
*/
closeModal() {
this.pageData.modalConfig.show = false; //modal
},
/**
* @description: 保存数据
* @param {type}
* @return:
* @author: ym
*/
save(item) {
this.pageData.modalData.userId = this.$store.state.user.id;
this.$refs["modalRef"].$refs["modalFormRef"].validate((valid) => {
if (valid) {
let content = this.pageData.modalData;
console.log(content.content);
let data = content.mainTypeId;
if (typeof data !== "string") {
content.mainTypeId = data[0] ? data[0] : "";
content.secondTypeId = data[1] ? data[1] : "";
}
if (content.isVideo == 0) {
content.videoUrl = "";
}
this.$set(item,'loading',true);
if (
this.pageData.modalConfig.type ==
this.commonConstants.modalType.insert
) {
this.$api.saveNewContent(content).then((res) => {
this.$refs.oTable.refresh();
this.closeModal();
}).finally(()=>this.$set(item,'loading',false))
} else {
//
// if(content.examineStatus==1){
// content.examineStatus=0
// }
this.$api.updateRedContentInfo(content).then((res) => {
this.$refs.oTable.refresh();
this.closeModal();
}).finally(()=>this.$set(item,'loading',false))
}
} else {
return false;
}
});
},
/**
* @description: 删除一条数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
deleteOne(id) {
let ids = [];
ids[0] = id;
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil
.showConfirm(obj)
.then(async () => {
await this.$api.deleteRedContentInfo(ids).then((res) => {
this.$refs.oTable.refresh();
});
})
.catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
},
/**
* @description: 批量删除
* @param {type}
* @return:
* @author: ym
*/
deleteBatch() {
const length = this.pageData.selectList.length;
if (length == 0) {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList(
"error.batchdelete.empty",
null
),
type: this.commonConstants.messageType.error,
});
} else {
let ids = [];
for (let i = 0; i < length; i++) {
ids.push("" + this.pageData.selectList[i].contentInfoId);
}
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil
.showConfirm(obj)
.then(() => {
this.$api.deleteRedContentInfo(ids).then((res) => {
this.$refs.oTable.refresh();
});
})
.catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
}
},
selectChange({ records, reserves }) {
// console.log(val)
this.pageData.selectList = [...records, ...reserves];
console.log(123);
},
},
};
</script>
<style lang="scss" scoped>
.content-dialog ::v-deep .el-dialog__body {
padding: 0px;
}
.modal ::v-deep .el-dialog-div{
padding-top: 40px;
.el-form{
width: 910px;
margin: 0 auto;
}
}
</style>

View File

@ -1,215 +0,0 @@
<template >
<Modal
ref="modalRef"
:modalConfig="modalConfig"
:modalForm="modalForm"
:modalData="modalData"
>
<div slot="dialog__before" class="examine ">
<div class="mb-2">
审核状态<span :style="examineStatusStyle" >{{examineStatus}}</span>
</div>
<div class="mb-2">审核人员{{modalData.examineName}}</div>
<div class="mb-2">审核原因{{modalData.examineReason}}</div>
</div>
</Modal>
</template>
<script>
import Modal from "@/components/common/modal/modal.vue";
export default {
components: {
Modal,
},
props:{
//
contentTypeData:{
type:Array,
default:()=>[]
}
},
computed:{
examineStatus(){
switch (this.modalData.examineStatus){
case 0:
return '未审核';
case 1:
return '审核通过';
case 2:
return '审核未通过'
}
},
examineStatusStyle(){
switch (this.modalData.examineStatus){
case 0:
return 'color:gray';
case 1:
return 'color:green';
case 2:
return 'color:red'
}
}
},
data() {
return {
modalConfig: {
title: "查看", //,:
show: false, //
formEditDisabled: false, //
width: "80vw", //
modalRef: "modalRef", //modal
type: "1", // 1 2 3,
fullscreen:true
},
//modal end
//modal start
modalForm: [
{
type: "Input",
label: "标题",
prop: "title",
// rules: { required: true, maxLength: 100 },
width: "900px",
disabled: () => true,
},
{
type: "Input",
label: "副标题",
prop: "subtitle",
// rules: { maxLength: 100 },
width: "900px",
disabled: () => true,
},
{
type: "Cascader",
label: "资讯分类",
prop: "mainTypeId", //
data: [],
// rules: { required: true },
width: "300px",
disabled: () => true,
},
{
type: "Input",
label: "资讯来源",
prop: "source",
// rules: { required: true, maxLength: 100 },
width: "300px",
disabled: () => true,
},
{
type: "Input",
label: "作者",
prop: "author",
// rules: { maxLength: 100 },
width: "300px",
disabled: () => true,
},
{
type: "Input",
label: "编辑者",
prop: "editorName",
// rules: { maxLength: 100 },
width: "300px",
disabled: () => true,
},
// {
// type: "Input",
// label: "",
// prop: "contentLink",
// rules: { maxLength: 100 },
// width: "300px",
// },
{
type: "Input",
label: "关键词",
prop: "keywords",
// rules: { maxLength: 100 },
width: "300px",
disabled: () => true,
},
{
type: "Radio",
prop: "isVideo",
label: "内容类型",
radios: [
{ label: "资讯", value: "0" },
{ label: "视频", value: "1" },
],
width: "300px",
disabled: () => true,
},
{
type: "Img",
label: "封面",
prop: "imageUrl",
width: "300px",
},
{
type: "ShowTinymce",
label: "资讯内容",
prop: "content",
// rules: { required: true },
width: "100%",
},
],
videoModalForm: [
{
type: "Video",
label: "视频",
prop: "videoUrl",
width: "900px",
},
], //
modalData: {},
};
},
methods: {
show(row) {
if (row.secondTypeId && typeof row.mainTypeId === "string") {
row.mainTypeId = [row.mainTypeId, row.secondTypeId];
}
row.isVideo = row.isVideo + "";
let haveVideo=this.modalForm.filter(item=>item.label=='视频').length
if(row.isVideo=='1'&&!haveVideo){
this.modalForm.splice(8,0,...this.videoModalForm)
}
else if(row.isVideo=='0'&&haveVideo){
this.modalForm.splice(8,1)
}
console.log(this.modalForm)
this.modalData = JSON.parse(JSON.stringify(row));
this.modalConfig.show = true;
},
},
};
</script>
<style scoped>
.examine{
box-shadow: 0px 0px 5px rgb(240,240,240);
margin:10px 20px 20px 20px ;
padding:10px
}
.mb-2{
margin-bottom:10px
}
>>> .el-input.is-disabled .el-input__inner {
background-color: #fff;
color: rgb(100, 100, 100);
cursor: default;
}
>>> .el-cascader .el-input .el-icon-arrow-down::before {
content: "";
/* cursor:default; */
}
>>> .el-input.is-disabled .el-input__icon {
cursor: default;
}
>>> .el-form{
margin: 20px;
box-shadow: 0px 0px 5px rgb(240,240,240);
padding-top:20px;
}
</style>

View File

@ -1,223 +0,0 @@
<template >
<Modal
ref="modalRef"
:modalConfig="modalConfig"
:modalForm="modalForm"
:modalData="modalData"
>
<div slot="dialog__before" class="examine ">
<div class="mb-2">
审核状态<span :style="examineStatusStyle" >{{examineStatus}}</span>
</div>
<div class="mb-2">审核人员{{modalData.examineName}}</div>
<div class="mb-2">审核原因{{modalData.examineReason}}</div>
</div>
</Modal>
</template>
<script>
import Modal from "@/components/common/modal/modal.vue";
export default {
components: {
Modal,
},
props:{
//
contentTypeData:{
type:Array,
default:()=>[]
}
},
computed:{
examineStatus(){
switch (this.modalData.examineStatus){
case 0:
return '未审核';
case 1:
return '审核通过';
case 2:
return '审核未通过'
}
},
examineStatusStyle(){
switch (this.modalData.examineStatus){
case 0:
return 'color:gray';
case 1:
return 'color:green';
case 2:
return 'color:red'
}
}
},
data() {
return {
modalConfig: {
title: "查看", //,:
show: false, //
formEditDisabled: false, //
width: "80vw", //
modalRef: "modalRef", //modal
type: "1", // 1 2 3
fullscreen:true
},
//modal end
//modal start
modalForm: [
{
type: "Input",
label: "标题",
prop: "title",
// rules: { required: true, maxLength: 100 },
width: "900px",
disabled: () => true,
},
{
type: "Input",
label: "副标题",
prop: "subtitle",
// rules: { maxLength: 100 },
width: "900px",
disabled: () => true,
},
{
type: "Cascader",
label: "资讯分类",
prop: "mainTypeId", //
data: [],
// rules: { required: true },
width: "300px",
disabled: () => true,
},
{
type: "Input",
label: "资讯来源",
prop: "source",
// rules: { required: true, maxLength: 100 },
width: "300px",
disabled: () => true,
},
{
type: "Input",
label: "作者",
prop: "author",
// rules: { maxLength: 100 },
width: "300px",
disabled: () => true,
},
{
type: "Input",
label: "编辑者",
prop: "editorName",
// rules: { maxLength: 100 },
width: "300px",
disabled: () => true,
},
{
type: "InputNumber",
label: "排序",
prop: "imageSort",
// rules: { maxLength: 100 },
width: "300px",
disabled:()=>true
},
// {
// type: "Input",
// label: "",
// prop: "contentLink",
// rules: { maxLength: 100 },
// width: "300px",
// },
{
type: "Input",
label: "关键词",
prop: "keywords",
// rules: { maxLength: 100 },
width: "300px",
disabled: () => true,
},
{
type: "Radio",
prop: "isVideo",
label: "内容类型",
radios: [
{ label: "资讯", value: "0" },
{ label: "视频", value: "1" },
],
width: "300px",
disabled: () => true,
},
{
type: "Img",
label: "封面",
prop: "imageUrl",
width: "300px",
},
{
type: "ShowTinymce",
label: "资讯内容",
prop: "content",
// rules: { required: true },
width: "100%",
},
],
videoModalForm: [
{
type: "Video",
label: "视频",
prop: "videoUrl",
width: "900px",
},
], //
modalData: {},
};
},
methods: {
show(row) {
if (row.secondTypeId && typeof row.mainTypeId === "string") {
row.mainTypeId = [row.mainTypeId, row.secondTypeId];
}
row.isVideo = row.isVideo + "";
let haveVideo=this.modalForm.filter(item=>item.label=='视频').length
if(row.isVideo=='1'&&!haveVideo){
this.modalForm.splice(9,0,...this.videoModalForm)
}
else if(row.isVideo=='0'&&haveVideo){
this.modalForm.splice(9,1)
}
// console.log(this.modalForm)
this.modalData = JSON.parse(JSON.stringify(row));
this.modalConfig.show = true;
},
},
};
</script>
<style scoped>
.examine{
box-shadow: 0px 0px 5px rgb(240,240,240);
margin:10px 20px 20px 20px ;
padding:10px
}
.mb-2{
margin-bottom:10px
}
>>> .el-input.is-disabled .el-input__inner {
background-color: #fff;
color: rgb(100, 100, 100);
cursor: default;
}
>>> .el-cascader .el-input .el-icon-arrow-down::before {
content: "";
/* cursor:default; */
}
>>> .el-input.is-disabled .el-input__icon {
cursor: default;
}
>>> .el-form{
margin: 20px;
box-shadow: 0px 0px 5px rgb(240,240,240);
padding-top:20px;
}
</style>

View File

@ -1,838 +0,0 @@
<template>
<div class="_tablepage">
<searchForm
ref="searchForm"
:searchForm="pageData.searchForm"
:searchData="pageData.queryData"
:searchHandle="pageData.searchHandle"
>
</searchForm>
<!-- <cusTable
:loading="loading"
:isSelection="true"
:isIndex="true"
:isPagination="true"
:isHandle="true"
:tableCols="pageData.tableCols"
:tableHandles="pageData.tableHandles"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
@handleCurrentChange="searchTableList"
@selectChange="selectChange"
@handleSizeChange="searchTableList"
></cusTable> -->
<obj-table-plus
style="height: 60vh"
@query="searchTableList"
ref="oTable"
v-model="pageData.tableData"
:isPagination="true"
:tableCols="pageData.tableCols"
:tableProp="tableProp"
:toolbarProp="toolbarProp"
:toolbarEvent="toolbarEvent"
:tableEvent="{
'checkbox-change': selectChange,
'checkbox-all': selectChange,
}"
/>
<modal
class="modal"
ref="modalRef"
:modalConfig="pageData.modalConfig"
:modalForm="pageData.modalForm"
:modalData="pageData.modalData"
:modalHandles="pageData.modalHandles"
@closeModal="closeModal()"
></modal>
<comment ref="comment" :parentId="parentId" type="CONTENTIMG" />
<see ref="see" />
</div>
</template>
<script>
import see from "./popup/swiper-image-see.vue";
import comment from "@/components/comment/comment.vue";
import modal from "../../../components/common/modal/modal.vue";
import searchForm from "../../../components/common/searchform/searchForm.vue";
import cusTable from "../../../components/common/table/custable.vue";
export default {
components: { searchForm, cusTable, modal, comment, see },
data() {
return {
//
typeList: [],
tableProp: {
height: "auto",
},
toolbarProp: {
buttons: [
{
status: "primary",
name: "新增",
code: "add",
},
{
status: "danger",
name: "批量删除",
code: "delBatch",
},
],
},
toolbarEvent: {
"button-click": ({ code }) => {
if (code == "add") {
this.showModal(this.commonConstants.modalType.insert);
} else if (code == "delBatch") {
this.deleteBatch();
}
},
},
pageData: {
// start
searchForm: [
{
type: "Input",
size: "mini",
label: "关键字",
prop: "searchName",
placeholder: "标题、来源、编辑者名称",
width: "230px",
},
{
type: "Cascader",
label: "资讯分类",
size: "mini",
prop: "mainTypeId", //
data: [],
},
{
type: "Select",
label: "内容类型",
prop: "isVideo",
size: "mini",
options: [
{
label: "资讯",
value: 0,
},
{ label: "视频", value: 1 },
],
},
{
type: "DateTimeRange",
size: "mini",
label: "发布时间范围",
prop: "time",
},
{
type: "Select",
label: "审核状态",
prop: "examineStatus",
default: true,
size: "mini",
options: [
{ label: "未审核", value: 0 },
{ label: "审核通过", value: 1 },
{ label: "审核未通过", value: 2 },
],
},
],
// end
// start
queryData: {
searchName: "",
contentTypeId: "",
time: [],
mainTypeId: "",
isVideo: 0,
examineStatus: "",
},
// end
//start
searchHandle: [
{
label: "查询",
type: "primary",
size: "mini",
handle: () => this.$refs.oTable.reload(),
auth: "reportDatasource_search",
},
{
label: "重置",
type: "warning",
size: "mini",
handle: () => {
this.$refs.searchForm.$refs.searchFormRef.resetFields();
this.$refs.oTable.reload();
},
auth: "reportDatasource_search",
},
],
//end
//start
tableData: [],
//end
// start
tableHandles: [
{
label: "新增",
type: "primary",
handle: () => this.showModal(this.commonConstants.modalType.insert),
auth: "reportDatasource_insert",
},
{
label: "批量删除",
type: "danger",
handle: () => this.deleteBatch(),
auth: "reportDatasource_batchDelete",
},
],
// end
selectList: [], //
//start
tablePage: {
currentPage: 1,
pageSize: 5,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
//end
//start
tableCols: [
{ type: "checkbox", width: "60px", fixed: "left" },
{ title: "标题", field: "title", align: "center" ,'min-width':160,fixed:'left'},
{ title: "副标题", field: "subtitle", align: "center" ,'min-width':100,},
{ title: "主分类名称", field: "mainTypeName", align: "center" ,'min-width':100, },
{ title: "子分类名称", field: "secondTypeName", align: "center" ,'min-width':100, },
{ title: "资讯来源", field: "source", align: "center" ,'min-width':100,},
{ title: "编辑者", field: "editorName", align: "center" ,'min-width':100,},
{ title: "作者", field: "author", align: "center" ,'min-width':100,},
{
title: "封面",
type: "jsx",
field: "imageUrl",
align: "center"
,'min-width':100,
render: ({ row }) => {
// @/assets/images/noimg.svg
return (
<el-image
fit="cover"
src={
row.imageUrl
? row.imageUrl
: require("@/assets/images/noimg.svg")
}
></el-image>
);
},
},
// { title: "", field: "contentLink", align: "center" },
// { title: "", field: "readNumber", align: "center" },
// { title: "", field: "likeNumber", align: "center" },
// { title: "", field: "commentNumber", align: "center" },
// { title: "", field: "collectNumber", align: "center" },
{ title: "排序", field: "imageSort", align: "center" ,'min-width':100, },
{
title: "审核状态",
field: "createTime",
align: "center",
// "title-help":{message: ''},
type: "jsx"
,'min-width':100,
render: ({ row }) => {
switch (row.examineStatus) {
case 0:
return (
<span>
<span style="color:gray">未审核</span>
</span>
);
case 1:
return (
<span>
<span style="color:green">审核通过</span>
</span>
);
case 2:
return (
<span>
<span style="color:red">审核未通过</span>
</span>
);
default:
return <span></span>;
}
},
},
{
title: "是否轮播",
field: "status",
align: "center",
type: "switch",
'min-width':100,
values: [1, 0],
change: (row) => {
this.$api.updateContentImage(row).then((res) => {
this.$refs.oTable.refresh();
});
},
},
{
title: "操作",
field: "operation",
align: "center",
type: "jsx",
fixed: "right",
width: "200px",
render: ({ row }) => {
const com = () => {
if (row.examineStatus == 1) {
return (
<el-button
type="text"
size="mini"
onClick={() => {
this.parentId = row.contentInfoId;
this.$refs.comment.modalConfig.show = true;
}}
>
查看评论
</el-button>
);
} else if (row.examineStatus == 2) {
return (
<el-button
type="text"
size="mini"
onClick={() =>
this.$confirm("确认重新提交吗?", "提示").then(
(action) => {
if (action == "confirm") {
this.$api
.updateContentImage({
...row,
examineStatus: 0,
})
.then((res) => {
this.$refs.oTable.refresh();
});
}
}
)
}
>
重新提交
</el-button>
);
}
};
return (
<div>
{com()}
<el-button
type="text"
size="mini"
onClick={
() => this.$refs.see.show(row)
// this.showModal(this.commonConstants.modalType.detail, row)
}
>
查看
</el-button>
<el-button
type="text"
size="mini"
onClick={() =>
this.showModal(this.commonConstants.modalType.update, row)
}
>
编辑
</el-button>
<el-button
type="text"
size="mini"
onClick={() => this.deleteOne(row.contentInfoId)}
>
删除
</el-button>
</div>
);
},
},
],
//end
//modal start
modalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "80vw", //
modalRef: "modalRef", //modal
type: "1", // 1 2 3
fullscreen:true
},
//modal end
//modal start
modalForm: [
{
type: "Input",
label: "标题",
prop: "title",
rules: { required: true, maxLength: 100 },
width: "796px",
},
{
type: "Input",
label: "副标题",
prop: "subtitle",
rules: { maxLength: 100 },
width: "796px",
},
{
type: "Input",
label: "作者",
prop: "author",
rules: { maxLength: 100 },
width: "300px",
},
{
type: "Tinymce",
label: "资讯内容",
prop: "content",
rules: { required: true },
width: "800px",
config:{
toolbar_sticky:true,
// fixed_toolbar_container:"#tinymce_fixed_toolbar",
max_height:Infinity,
min_height:300,
skin:"oxide-sticky",
placeholder:"从这里开始填写正文",
border:"0 0 0 0"
},
//
toolbars:['undo redo fontsizeselect bold italic underline strikethrough forecolor backcolor removeformat subscript superscript blockquote alignleft aligncenter alignright alignjustify lineheightcustom indent2em wlindent hr bullist numlist link image charmap insertdatetime media table emoticons preview print tpImportword wlxiumi' ]
},
{
type: "Cascader",
label: "资讯分类",
prop: "mainTypeId", //
data: [],
rules: { required: true },
width: "300px",
},
{
type: "Input",
label: "资讯来源",
prop: "source",
// rules: { required: true, maxLength: 100 },
width: "300px",
},
{
type: "Input",
label: "编辑者",
prop: "editorName",
rules: { maxLength: 100 },
width: "300px",
},
// {
// type: "Input",
// label: "",
// prop: "contentLink",
// rules: { maxLength: 100 },
// width: "300px",
// },
{
type: "InputNumber",
label: "排序",
prop: "imageSort",
// rules: { maxLength: 100 },
width: "300px",
},
{
type: "Input",
label: "关键词",
prop: "keywords",
rules: { maxLength: 100 },
width: "300px",
},
{
type: "Radio",
prop: "isVideo",
label: "内容类型",
border:true,
radios: [
{ label: "资讯", value: "0" },
{ label: "视频", value: "1" },
],
width: "300px",
},
{
type: "Upload",
label: "封面",
fileUrl: "imageUrl",
prop: "fileList",
rules: { required: true },
accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
drag:true
},
],
//modal end
newModalForm: [
{
type: "Upload",
label: "封面",
fileUrl: "imageUrl",
prop: "fileList",
accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
rules: { required: true },
drag:true
},
], //
videoModalForm: [
{
type: "Upload",
label: "封面",
fileUrl: "imageUrl",
prop: "fileList",
accept: ".jpg,.jpeg,.png,.JPG,.JPEG",
width: "300px",
drag:true
},
{
type: "Upload",
label: "视频",
fileUrl: "videoUrl",
prop: "fileListVideo",
listType: "text",
rules: { required: true },
width: "300px",
isVideo: true,
drag:true,
accept: ".mp4,.avi,.mov,.rmvb,.flv,.MP4,.AVI,.MOV,.RMVB,.FLV",
tips: "请上传视频文件",
},
], //
//modal start
modalData: {
userId: "",
source: "",
content: "",
fileUrl: "",
isVideo: "0",
mainTypeId: "",
fileList: [],
status: 0,
videoUrl: "",
fileListVideo: [],
imageSort: 0,
},
//modal end
//modal start
modalHandles: [
{ label: "取消", type: "default",icon:"el-icon-close", handle: () => this.closeModal() },
{ label: "提交", type: "primary",icon:"el-icon-upload2", handle: () => this.save() },
],
//modal end
},
parentId: "",
};
},
watch: {
"pageData.modalData.isVideo": {
handler: function (val, oldval) {
// console.log(val)
if (val === "1" && oldval === "0") {
this.pageData.modalForm.splice(
0 - this.pageData.newModalForm.length,
this.pageData.newModalForm.length,
...this.pageData.videoModalForm
);
} else if (val === "0" && oldval === "1") {
this.pageData.modalForm.splice(
0 - this.pageData.videoModalForm.length,
this.pageData.videoModalForm.length,
...this.pageData.newModalForm
);
}
},
},
"pageData.modalData.fileList": {
handler: function (val) {
if (val && val.length === 0) {
this.pageData.modalData.imageUrl = "";
}
},
},
"pageData.modalData.fileListVideo": {
handler: function (val) {
if (val && val.length === 0) {
this.pageData.modalData.videoUrl = "";
}
},
},
},
activated() {
this.$refs.oTable.refresh();
this.searchContentType();
},
methods: {
/**
* @description: 获取表格数据
* @param {type}
* @return:
* @author: ym
*/
searchTableList(pageNo, pageSize) {
this.loading = true;
// obj
var obj = {};
Object.assign(obj, this.pageData.queryData, this.pageData.tablePage);
let data = obj.mainTypeId;
obj.mainTypeId = data[0] ? data[0] : "";
obj.secondTypeId = data[1] ? data[1] : "";
delete obj["pageSizeRange"];
if (obj.time.length == 2) {
obj.startTime = obj.time[0];
obj.endTime = obj.time[1];
}
delete obj.time;
//
this.$api
.getContentImage({ ...obj, page: pageNo, limit: pageSize })
.then((res) => {
this.$refs.oTable.complete(
res.data.page.list,
res.data.page.totalCount
);
// this.commonUtil.tableAssignment(
// res.data.page,
// this.pageData.tablePage,
// this.pageData.tableData
// );
// this.loading = false;
});
},
//
resetSearch() {
// this.commonUtil.clearObj(this.pageData.queryData);
this.$refs.searchForm.$refs.searchFormRef.resetFields();
this.$refs.oTable.reload();
},
searchContentType() {
this.$api.getContentTypeList().then((res) => {
let data = res.data.list.map((item) => {
if (item.mainTypeName === "##") {
item.label = "地方";
} else {
item.label = item.mainTypeName;
}
item.value = item.mainTypeId;
item.children = item.children.map((item1) => {
item1.label = item1.secondTypeName;
item1.value = item1.secondTypeId;
return item1;
});
if (item.children.length === 0) {
delete item.children;
}
return item;
}).filter(item=>item.label!="地方");//
// console.log(data)
this.pageData.searchForm[1].data = data;
this.pageData.modalForm[4].data = data;
this.$refs.see.modalForm[2].data = data;
});
},
/**
* @description: modal显示
* @param {type} 类型 1新增2编辑 3详情
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
showModal(type, row) {
this.commonUtil.clearObj(this.pageData.modalData); //modalData
this.$nextTick(() => {
this.$refs["modalRef"].$refs["modalFormRef"].clearValidate(); //
});
this.pageData.modalData.source = this.$newSource; //
this.pageData.modalData.isVideo = "0"; //isVideo watch
this.commonUtil.showModal(this.pageData.modalConfig, type);
if (type != this.commonConstants.modalType.insert) {
this.getDetail(row);
}
},
/**
* @description: 获取详细数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
getDetail(row) {
if (row.imageUrl) {
row.fileList = [
{
url: row.imageUrl,
},
];
}
if (row.videoUrl) {
row.fileListVideo = [
{
url: row.videoUrl,
// +'?x-oss-process=video/snapshot,t_10000,m_fast'
},
];
}
if (row.secondTypeId && typeof row.mainTypeId === "string") {
row.mainTypeId = [row.mainTypeId, row.secondTypeId];
}
row.isVideo = row.isVideo + "";
this.$nextTick(() => {
this.pageData.modalData = JSON.parse(JSON.stringify(row));
});
},
/**
* @description: 关闭modal
* @param
* @return:
* @author: ym
*/
closeModal() {
this.pageData.modalConfig.show = false; //modal
},
/**
* @description: 保存数据
* @param {type}
* @return:
* @author: ym
*/
save() {
this.pageData.modalData.userId = this.$store.state.user.id;
this.$refs["modalRef"].$refs["modalFormRef"].validate((valid) => {
if (valid) {
let content = this.pageData.modalData;
let data = content.mainTypeId;
if (typeof data !== "string") {
content.mainTypeId = data[0] ? data[0] : "";
content.secondTypeId = data[1] ? data[1] : "";
}
if (content.isVideo == 0) {
content.videoUrl = "";
}
if (
this.pageData.modalConfig.type ==
this.commonConstants.modalType.insert
) {
this.$api.saveContentImage(content).then((res) => {
this.$refs.oTable.refresh();
});
} else {
//
// if(content.examineStatus==1){
// content.examineStatus=0
// }
this.$api.updateContentImage(content).then((res) => {
this.$refs.oTable.refresh();
});
}
this.closeModal();
} else {
return false;
}
});
},
/**
* @description: 删除一条数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
deleteOne(id) {
let ids = [];
ids[0] = id;
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil
.showConfirm(obj)
.then(async () => {
await this.$api.deleteContentImage(ids).then((res) => {
this.$refs.oTable.refresh();
});
})
.catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
},
/**
* @description: 批量删除
* @param {type}
* @return:
* @author: ym
*/
deleteBatch() {
const length = this.pageData.selectList.length;
if (length == 0) {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList(
"error.batchdelete.empty",
null
),
type: this.commonConstants.messageType.error,
});
} else {
let ids = [];
for (let i = 0; i < length; i++) {
ids.push("" + this.pageData.selectList[i].contentInfoId);
}
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil
.showConfirm(obj)
.then(() => {
this.$api.deleteContentImage(ids).then((res) => {
this.$refs.oTable.refresh();
});
})
.catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
}
},
selectChange({ records, reserves }) {
// console.log(val)
this.pageData.selectList = [...records, ...reserves];
},
},
};
</script>
<style lang="scss" scoped>
.content-dialog ::v-deep .el-dialog__body {
padding: 0px;
}
.modal ::v-deep .el-dialog-div{
padding-top: 40px;
.el-form{
width: 910px;
margin: 0 auto;
}
}
</style>

View File

@ -1,207 +0,0 @@
<!--
* @Author: cwl
* @Date: 2021-11-10 19:54:12
* @LastEditTime: 2022-04-07 21:15:43
* @LastEditors: chenkangxu
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\views\modules\data-dictionary\handcopy-type.vue
-->
<template>
<div>
<cesTable
:isPagination="false"
:tableData="tableData"
:tableCols="tableCols"
:tableHandles="tableHandles"
:isIndex="true"
:isSelection="true"
@selectChange="selectChange"
/>
<!-- 添加编辑弹窗 -->
<modal
ref="modal"
labelWidth="140px"
:modalConfig="modalSetting.modalConfig"
:modalForm="modalSetting.modalForm"
:modalData="modalSetting.modalData"
:modalHandles="modalSetting.modalHandles"
@closeModal="closeModal('modal')"
/>
<modal
ref="sortModal"
:modalConfig="sortModalSetting.modalConfig"
:modalForm="sortModalSetting.modalForm"
:modalData="sortModalSetting.modalData"
:modalHandles="sortModalSetting.modalHandles"
></modal>
</div>
</template>
<script>
import modal from '../../../components/common/modal/modal.vue'
import cesTable from '../../../components/common/table/custable.vue'
export default {
components:{
cesTable,
modal
},
activated(){
this.findAll()
},
data(){
return{
tableCols:[
{label:'分类名',prop:'activityTypeName'},
{label:'分类Id',prop:'activityTypeId'},
{label:'修改时间',prop:'createTime'},
{label:'操作',type:'button',btnList:[
{label:'编辑',type:'text',handle:(row)=>{
this.commonUtil.showModal(this.modalSetting.modalConfig,this.commonConstants.modalType.update)
this.$nextTick(()=>{
this.modalSetting.modalData=JSON.parse(JSON.stringify(row));
})
}},
{label:'删除',type:'text',handle:(row)=>this.del(row.activityTypeId)}
]}
],
selectList:[],
tableData:[],
tableHandles:[
{label:'新增',type:'primary',handle:()=>{
this.commonUtil.showModal(this.modalSetting.modalConfig,this.commonConstants.modalType.insert)
}},
{label:'排序',type:'success',handle:()=>{
this.sortModalSetting.modalForm[0].data=this.tableData
this.commonUtil.showModal(this.sortModalSetting.modalConfig,this.commonConstants.modalType.update)
}},
{label:'批量删除',type:'danger',handle:()=>this.del()},
],
modalSetting:{
modalConfig:{
show:false,
title:this.commonConstants.modalTitle.insert,
},
modalForm:[
{label:'活动/比赛分类名',prop:'activityTypeName',type:'Input',rules:{required:true}},
],
modalData:{
activityTypeName:''
},
modalHandles:[
{label:'确认',type:'primary',handle:()=>{
this.$refs.modal.$refs.modalFormRef.validate((valid) => {
if (valid) {
this.save()
} else {
return false;
}
});
}}
]
},
sortModalSetting:{
modalConfig:{
show:false,
title:this.commonConstants.modalTitle.insert,
},
modalForm:[
{
type: "Draggable",
label: "拖拽排序",
data: [],
prop: "activityTypeName",
key: "activityTypeSort",
},
],
modalData:{
sort:[]
},
modalHandles:[
{label:'确认',type:'primary',handle:()=>{
this.$api.updateActivitySort(this.sortModalSetting.modalForm[0].data).then(res=>{
this.sortModalSetting.modalConfig.show=false
this.findAll()
})
}}
]
}
}
},
methods:{
findAll(){
this.$api.getActivityTypeList().then(res=>{
this.tableData=res.data.list
})
},
closeModal(ref){
this.resetFields(ref);
},
resetFields(ref){
this.$refs[ref].$refs.modalFormRef.resetFields()
},
selectChange(val){
this.selectList=val
},
save(){
let data=this.modalSetting.modalData
if(this.modalSetting.modalConfig.title===this.commonConstants.modalTitle.insert)
{
this.$api.saveActivityType(data).then(res=>{
this.modalSetting.modalConfig.show=false
this.resetFields('modal')
this.findAll()
})
}
else{
this.$api.updateActivitySort([data]).then(res=>{
this.modalSetting.modalConfig.show=false
this.findAll()
})
}
},
del(val){
let data=[]
if(val){
data.push(val)
}
else{
data=this.selectList.map(item=>item.activityTypeId)
}
if (data.length == 0) {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList(
"error.batchdelete.empty",
null
),
type: this.commonConstants.messageType.error,
});
}
else{
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil.showConfirm(obj).then(()=>{
this.$api.deleteActivitySort(data).then(res=>{
this.findAll()
})
}).catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
}
}
}
}
</script>

View File

@ -1,122 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:before-close="close"
:visible.sync="visible"
>
<el-form ref="form" :model="departmentInfo" label-width="100px" :rules="formRules">
<el-form-item label="分类名称:" prop="departmentNumber">
<el-input style="width:300px;" v-model="departmentInfo.mainTypeName"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">添加</el-button>
</span>
</el-dialog>
</template>
<script>
import { isEmail, isMobile } from "@/utils/validate";
export default {
data() {
var validatePassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) {
callback(new Error("密码不能为空"));
} else {
callback();
}
};
var validateComfirmPassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) {
callback(new Error("确认密码不能为空"));
} else if (this.dataForm.password !== value) {
callback(new Error("确认密码与密码输入不一致"));
} else {
callback();
}
};
var validateEmail = (rule, value, callback) => {
if (!isEmail(value)) {
callback(new Error("邮箱格式错误"));
} else {
callback();
}
};
var validateMobile = (rule, value, callback) => {
if (!isMobile(value)) {
callback(new Error("手机号格式错误"));
} else {
callback();
}
};
return {
//
departmentInfo: {
mainTypeName:"",
},
roleList: [],
dataForm: {
id: 0,
userName: "",
password: "",
comfirmPassword: "",
salt: "",
email: "",
mobile: "",
roleIdList: [],
status: 1,
},
//
formRules: {
mainTypeName: [
{ required: true, message: '请输入分类名称', trigger: 'blur' }
],
},
};
},
props: {
visible: {
type: Boolean,
default: false,
},
companyStructural: {
type: [Object, Array],
default: () => {
return [];
},
},
},
methods: {
close(){
this.$emit('close')
},
//
dataFormSubmit() {
this.$refs["form"].validate(async (valid) => {
if (valid) {
let {data}=await this.$api.saveNewContentType(
this.departmentInfo.mainTypeName
)
if (data && data.code === 0) {
this.$message({
message: "添加成功",
type: "success",
duration: 1500,
onClose: () => {
//
this.$emit('close')
//
this.$emit("refreshDataList");
},
});
} else {
this.$message.error(data.msg);
}
}
});
},
},
};
</script>

View File

@ -1,122 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:before-close="close"
:visible.sync="visible"
>
<el-form ref="form" :model="departmentInfo" label-width="100px" :rules="formRules">
<el-form-item label="分类名称:" prop="departmentNumber">
<el-input style="width:300px;" v-model="departmentInfo.footprintTypeName"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">添加</el-button>
</span>
</el-dialog>
</template>
<script>
import { isEmail, isMobile } from "@/utils/validate";
export default {
data() {
var validatePassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) {
callback(new Error("密码不能为空"));
} else {
callback();
}
};
var validateComfirmPassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) {
callback(new Error("确认密码不能为空"));
} else if (this.dataForm.password !== value) {
callback(new Error("确认密码与密码输入不一致"));
} else {
callback();
}
};
var validateEmail = (rule, value, callback) => {
if (!isEmail(value)) {
callback(new Error("邮箱格式错误"));
} else {
callback();
}
};
var validateMobile = (rule, value, callback) => {
if (!isMobile(value)) {
callback(new Error("手机号格式错误"));
} else {
callback();
}
};
return {
//
departmentInfo: {
footprintTypeName:"",
},
roleList: [],
dataForm: {
id: 0,
userName: "",
password: "",
comfirmPassword: "",
salt: "",
email: "",
mobile: "",
roleIdList: [],
status: 1,
},
//
formRules: {
footprintTypeName: [
{ required: true, message: '请输入分类名称', trigger: 'blur' }
],
},
};
},
props: {
visible: {
type: Boolean,
default: false,
},
companyStructural: {
type: [Object, Array],
default: () => {
return [];
},
},
},
methods: {
close(){
this.$emit('close')
},
//
dataFormSubmit() {
this.$refs["form"].validate(async (valid) => {
if (valid) {
let {data}=await this.$api.saveNewFootprintType(
this.departmentInfo.footprintTypeName
)
if (data && data.code === 0) {
this.$message({
message: "添加成功",
type: "success",
duration: 1500,
onClose: () => {
//
this.$emit('close')
//
this.$emit("refreshDataList");
},
});
} else {
this.$message.error(data.msg);
}
}
});
},
},
};
</script>

View File

@ -1,122 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:before-close="close"
:visible.sync="visible"
>
<el-form ref="form" :model="departmentInfo" label-width="100px" :rules="formRules">
<el-form-item label="分类名称:" prop="departmentNumber">
<el-input style="width:300px;" v-model="departmentInfo.mainTypeName"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">添加</el-button>
</span>
</el-dialog>
</template>
<script>
import { isEmail, isMobile } from "@/utils/validate";
export default {
data() {
var validatePassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) {
callback(new Error("密码不能为空"));
} else {
callback();
}
};
var validateComfirmPassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) {
callback(new Error("确认密码不能为空"));
} else if (this.dataForm.password !== value) {
callback(new Error("确认密码与密码输入不一致"));
} else {
callback();
}
};
var validateEmail = (rule, value, callback) => {
if (!isEmail(value)) {
callback(new Error("邮箱格式错误"));
} else {
callback();
}
};
var validateMobile = (rule, value, callback) => {
if (!isMobile(value)) {
callback(new Error("手机号格式错误"));
} else {
callback();
}
};
return {
//
departmentInfo: {
mainTypeName:"",
},
roleList: [],
dataForm: {
id: 0,
userName: "",
password: "",
comfirmPassword: "",
salt: "",
email: "",
mobile: "",
roleIdList: [],
status: 1,
},
//
formRules: {
mainTypeName: [
{ required: true, message: '请输入分类名称', trigger: 'blur' }
],
},
};
},
props: {
visible: {
type: Boolean,
default: false,
},
companyStructural: {
type: [Object, Array],
default: () => {
return [];
},
},
},
methods: {
close(){
this.$emit('close')
},
//
dataFormSubmit() {
this.$refs["form"].validate(async (valid) => {
if (valid) {
let {data}=await this.$api.saveNewContentType(
this.departmentInfo.mainTypeName
)
if (data && data.code === 0) {
this.$message({
message: "添加成功",
type: "success",
duration: 1500,
onClose: () => {
//
this.$emit('close')
//
this.$emit("refreshDataList");
},
});
} else {
this.$message.error(data.msg);
}
}
});
},
},
};
</script>

View File

@ -1,610 +0,0 @@
<template>
<div class="_tablepage">
<!-- <searchForm
:searchForm="pageData.searchForm"
:searchData="pageData.queryData"
:searchHandle="pageData.searchHandle"
>
</searchForm> -->
<cusTable
:isSelection="false"
:isIndex="true"
:isPagination="false"
:isHandle="true"
:tableCols="pageData.tableCols"
:tableHandles="pageData.tableHandles"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
@selectChange="selectChange"
></cusTable>
<modal
ref="modalRef"
:modalConfig="pageData.modalConfig"
:modalForm="pageData.modalForm"
:modalData="pageData.modalData"
:modalHandles="pageData.modalHandles"
@closeModal="closeModal()"
></modal>
<modal
ref="sortModalRef"
:modalConfig="pageData.sortModalConfig"
:modalForm="pageData.sortModalForm"
:modalData="pageData.sortModalData"
:modalHandles="pageData.sortModalHandles"
@closeModal="closeSortModal()"
></modal>
<modal
ref="secModalRef"
:modalConfig="pageData.secModalConfig"
:modalForm="pageData.secModalForm"
:modalData="pageData.secModalData"
:modalHandles="pageData.secModalHandles"
@closeModal="closeSecModal()"
></modal>
<modal
ref="secSortModalRef"
:modalConfig="pageData.secSortModalConfig"
:modalForm="pageData.secSortModalForm"
:modalData="pageData.secSortModalData"
:modalHandles="pageData.secSortModalHandles"
@closeModal="closeSecSortModal()"
></modal>
</div>
</template>
<script>
import modal from "../../../components/common/modal/modal.vue";
import searchForm from "../../../components/common/searchform/searchForm.vue";
import cusTable from "../../../components/common/table/custable.vue";
export default {
components: { searchForm, cusTable, modal },
data() {
return {
typeList: [],
pageData: {
//start
tableData: [],
//end
// start
tableHandles: [
{
label: "新增主类",
type: "primary",
handle: () => this.showModal(this.commonConstants.modalType.insert),
auth: "reportDatasource_insert",
},
{
label: "主类排序",
type: "success",
handle: () =>
this.showSortModal(this.commonConstants.modalType.update),
auth: "reportType_insert",
},
],
// end
selectList: [], //
//start
tablePage: {
currentPage: 1,
pageSize: 5,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
//end
//start
tableCols: [
{ label: "分类名", prop: "mainTypeName", align: "center" ,formatter:(prop,row)=>{
if(row[prop]==='##'){
return '地方'
}
else return row[prop]
}},
{ label: "子类名称", prop: "secondTypeName", align: "center" },
{ label: "修改时间", prop: "createTime", align: "center",formatter:(prop,row)=>{return row[prop]}},
{label:"是否显示",prop:"isShow",align:'center',type:"switch",width:"100",change:this.showToggle},
{
label: "操作",
prop: "operation",
align: "center",
type: "button",
fixed: "right",
btnList: [
{
label: "新增子类",
type: "text",
auth: "reportType_getDetail",
disabled: (row) => {
return row.children ? false : true;
},
handle: (row) =>
this.showSecModal(this.commonConstants.modalType.insert, row),
},
{
label: "修改",
type: "text",
auth: "reportDatasource_update",
handle: (row) =>
row.children
? this.showModal(this.commonConstants.modalType.update, row)
: this.showSecModal(
this.commonConstants.modalType.update,
row
),
},
{
label: "子类排序",
type: "text",
auth: "reportType_getDetail",
disabled: (row) => {
return row.children && row.children.length > 1 ? false : true;
},
handle: (row) =>
this.showSecSortModal(
row.children,
this.commonConstants.modalType.update
),
},
{
label: "删除",
type: "text",
auth: "reportDatasource_delete",
handle: (row) =>
this.deleteOne(row, row.children ? "main" : "sec"),
},
],
},
],
//end
//modal start
modalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "80vw", //
modalRef: "modalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
modalForm: [
{
type: "Input",
label: "主类分类名",
prop: "mainTypeName",
rules: { required: true },
width: "300px",
},
],
//modal end
//modal start
modalData: {
mainTypeName: "",
},
//modal end
//modal start
modalHandles: [
{ label: "取消", type: "default", handle: () => this.closeModal() },
{ label: "提交", type: "primary", handle: () => this.save() },
],
//modal end
//modal start
sortModalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "700px", //
modalRef: "sortModalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
sortModalForm: [
{
type: "Draggable",
label: "拖拽排序",
data: [],
prop: "mainTypeName",
key: "mainTypeSort",
},
],
//modal end
//modal start
secModalData: {
//modal
secondTypeName: "", //
},
//modal end
//modal start
secModalHandles: [
{
label: "取消",
type: "default",
handle: () => this.closeSecModal(),
},
{ label: "提交", type: "primary", handle: () => this.saveSec() },
],
//modal end
//modal start
secModalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "700px", //
modalRef: "secModalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
secModalForm: [
{
type: "Input",
label: "子类名称",
prop: "secondTypeName",
rules: { required: true, maxLength: 50 },
},
],
//modal end
//modal start
sortModalData: {
//modal
sort: [], //
},
//modal end
//modal start
sortModalHandles: [
{
label: "取消",
type: "default",
handle: () => this.closeSortModal(),
},
{ label: "提交", type: "primary", handle: () => this.saveSort() },
],
//modal start
secSortModalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "700px", //
modalRef: "secSortModalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
secSortModalForm: [
{
type: "Draggable",
label: "拖拽排序",
data: [],
prop: "secondTypeName",
key: "secondTypeId",
},
],
//modal end
//modal start
secSortModalData: {
//modal
sort: [], //
},
//modal end
//modal start
secSortModalHandles: [
{
label: "取消",
type: "default",
handle: () => this.closeSecSortModal(),
},
{ label: "提交", type: "primary", handle: () => this.saveSecSort() },
],
//modal end
//modal end
},
};
},
activated() {
this.searchTableList();
},
methods: {
/**
* @description: 获取表格数据
* @param {type}
* @return:
* @author: ym
*/
async searchTableList() {
//
let res = await this.$api.getContentTypeList()
//
for (let i = 0; i < res.data.list.length; i++) {
if (res.data.list[i].children.length > 0) {
res.data.list[i].id = res.data.list[i].mainTypeId;
for (let j = 0; j < res.data.list[i].children.length; j++) {
res.data.list[i].children[j].id =
res.data.list[i].children[j].secondTypeId;
}
} else {
}
}
this.commonUtil.tableAssignment(
res.data,
this.pageData.tablePage,
this.pageData.tableData
);
},
//
resetSearch() {
this.commonUtil.clearObj(this.pageData.queryData);
this.searchTableList();
},
showSecModal(type, row) {
//
this.commonUtil.showModal(this.pageData.secModalConfig, type);
if (type != this.commonConstants.modalType.insert) {
this.getDetail(row, "sec");
} else {
this.pageData.secModalData.mainTypeId = row.mainTypeId;
}
},
/**
* @description: modal显示
* @param {type} 类型 1新增2编辑 3详情
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
showModal(type, row) {
this.commonUtil.showModal(this.pageData.modalConfig, type);
if (type != this.commonConstants.modalType.insert) {
this.getDetail(row);
}
},
showSortModal(type) {
this.pageData.sortModalForm[0].data = this.pageData.tableData;
this.commonUtil.showModal(this.pageData.sortModalConfig, type);
},
showSecSortModal(list, type) {
this.pageData.secSortModalForm[0].data = list;
this.commonUtil.showModal(this.pageData.secSortModalConfig, type);
},
/**
* @description: 获取详细数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
getDetail(row,type) {
if (type == "sec") {
this.pageData.secModalData = JSON.parse(JSON.stringify(row)); //
} else {
this.pageData.modalData = JSON.parse(JSON.stringify(row)); //
}
},
/**
* @description: 关闭modal
* @param
* @return:
* @author: ym
*/
closeModal() {
this.$refs["modalRef"].$refs["modalFormRef"].resetFields(); //
this.pageData.modalConfig.show = false; //modal
this.commonUtil.clearObj(this.pageData.modalData); //modalData
},
closeSortModal() {
this.$refs["sortModalRef"].$refs["modalFormRef"].resetFields(); //
this.pageData.sortModalConfig.show = false; //modal
this.commonUtil.clearObj(this.pageData.sortModalData); //modalData
},
closeSecModal() {
this.$refs["secModalRef"].$refs["modalFormRef"].resetFields(); //
this.pageData.secModalConfig.show = false; //modal
this.commonUtil.clearObj(this.pageData.secModalData); //modalData
},
closeSecSortModal() {
this.$refs["secSortModalRef"].$refs["modalFormRef"].resetFields(); //
this.pageData.secSortModalConfig.show = false; //modal
this.commonUtil.clearObj(this.pageData.secSortModalData); //modalData
},
/**
* @description: 保存数据
* @param {type}
* @return:
* @author: ym
*/
save() {
this.$refs["modalRef"].$refs["modalFormRef"].validate((valid) => {
if (valid) {
let content = this.pageData.modalData;
if (
this.pageData.modalConfig.type ==
this.commonConstants.modalType.insert
) {
console.log(content);
this.$api.saveNewContentType(content).then((res) => {
this.searchTableList();
});
} else {
let list = [content];
this.$api.updateContentMainType(content).then((res) => {
this.searchTableList();
});
}
this.closeModal();
} else {
return false;
}
});
},
async saveSort() {
let { data } = await this.$api.updateTypeSort(
this.pageData.sortModalForm[0].data
);
this.closeSortModal();
this.searchTableList();
},
saveSec() {
this.$refs["secModalRef"].$refs["modalFormRef"].validate((valid) => {
if (valid) {
if (
this.pageData.secModalConfig.type ==
this.commonConstants.modalType.insert
) {
this.$api
.saveNewContentSecondType(
this.pageData.secModalData.secondTypeName,
this.pageData.secModalData.mainTypeId
)
.then((res) => {
this.closeSecModal();
this.searchTableList();
});
} else {
this.$api.updateContentSecType(this.pageData.secModalData).then((res) => {
this.closeSecModal();
this.searchTableList();
});
}
} else {
return false;
}
});
},
async saveSecSort() {
let { data } = await this.$api.updateContentSecSort(
this.pageData.secSortModalForm[0].data
);
this.closeSecSortModal();
this.searchTableList();
},
/**
* @description: 删除一条数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
deleteOne(row, type) {
let array = [];
if (type == "main") {
array[0] = row.mainTypeId;
this.$msgbox({
title: `确认删除?`,
message: "此操作将永久删除父类以及子类",
showCancelButton: true,
confirmButtonText: "确定",
cancelButtonText: "取消",
callback: async (action) => {
if (action === "confirm") {
this.$api.deleteType(array).then((res) => {
if (res.data.code == 0) {
this.commonUtil.showMessage({
message: "删除成功",
type: this.commonConstants.messageType.success,
});
this.searchTableList();
} else {
this.commonUtil.showMessage({
message: res.data.msg,
type: this.commonConstants.messageType.error,
});
}
});
} else {
this.$message({
type: "info",
message: "已取消删除",
});
}
},
});
} else {
array[0] = row.secondTypeId;
this.$msgbox({
title: `确认删除?`,
message: "此操作将永久该分类",
showCancelButton: true,
confirmButtonText: "确定",
cancelButtonText: "取消",
callback: async (action) => {
if (action === "confirm") {
this.$api.deleteContentSecType(array).then((res) => {
if (res.data.code == 0) {
this.searchTableList();
}
});
} else {
this.$message({
type: "info",
message: "已取消删除",
});
}
},
});
}
},
/**
* @description: 批量删除
* @param {type}
* @return:
* @author: ym
*/
deleteBatch() {
const length = this.pageData.selectList.length;
if (length == 0) {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList(
"error.batchdelete.empty",
null
),
type: this.commonConstants.messageType.error,
});
} else {
let ids = [];
for (let i = 0; i < length; i++) {
ids.push("" + this.pageData.selectList[i].mainTypeId);
}
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil
.showConfirm(obj)
.then(() => {
this.$api.deleteType(ids).then((res) => {
this.searchTableList();
});
})
.catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
}
},
selectChange(rows) {
this.pageData.selectList = rows;
rows = []
},
//
showToggle(row){
if(row.secondTypeId){
this.$api.updateContentSecType({secondTypeId:row.secondTypeId,isShow:row.isShow})
.catch(err=>{
row.isShow=!row.isShow;
})
}else{
this.$api.updateContentMainType({mainTypeId:row.mainTypeId,isShow:row.isShow})
.catch(err=>{
row.isShow=!row.isShow;
})
}
}
},
};
</script>
<style lang="scss" scoped>
.content-dialog ::v-deep .el-dialog__body {
padding: 0px;
}
</style>

View File

@ -1,447 +0,0 @@
<template>
<div class="_tablepage">
<searchForm
:searchForm="pageData.searchForm"
:searchData="pageData.queryData"
:searchHandle="pageData.searchHandle"
:hasBottomButton="false"
>
</searchForm>
<!-- <cusTable
:isSelection="true"
:isIndex="true"
:isPagination="false"
:isHandle="true"
:tableCols="pageData.tableCols"
:tableHandles="pageData.tableHandles"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
@selectChange="selectChange"
></cusTable> -->
<obj-table-plus
style="height: 60vh"
@query="searchTableList"
ref="oTable"
v-model="pageData.tableData"
:isPagination="true"
:tableCols="pageData.tableCols"
:toolbarProp="toolbarProp"
:toolbarEvent="toolbarEvent"
:tableProp="tableProp"
:tableEvent="{ 'checkbox-change': selectChange ,'checkbox-all':selectChange}"
/>
<modal
ref="modalRef"
:modalConfig="pageData.modalConfig"
:modalForm="pageData.modalForm"
:modalData="pageData.modalData"
:modalHandles="pageData.modalHandles"
@closeModal="closeModal()"
></modal>
<modal
ref="sortModalRef"
:modalConfig="pageData.sortModalConfig"
:modalForm="pageData.sortModalForm"
:modalData="pageData.sortModalData"
:modalHandles="pageData.sortModalHandles"
@closeModal="closeSortModal()"
></modal>
</div>
</template>
<script>
import modal from "../../../components/common/modal/modal.vue";
import searchForm from "../../../components/common/searchform/searchForm.vue";
import cusTable from "../../../components/common/table/custable.vue";
export default {
components: { searchForm, cusTable, modal },
data() {
return {
typeList: [],
tableProp: {
height: "auto",
},
toolbarProp: {
buttons: [
{
name: "新增",
status: "primary",
code: "新增",
},
{
name: "排序",
status: "success",
code: "排序",
},
{
name: "批量删除",
status: "danger",
code: "批量删除",
},
],
},
toolbarEvent: {
"button-click": ({ code }) => {
if (code == "新增") {
this.showModal(this.commonConstants.modalType.insert);
} else if (code == "排序") {
this.showSortModal(this.commonConstants.modalType.update);
} else if (code == "批量删除") {
this.deleteBatch();
}
},
},
pageData: {
//start
tableData: [],
//end
// start
tableHandles: [
{
label: "新增",
type: "primary",
handle: () => this.showModal(this.commonConstants.modalType.insert),
auth: "reportDatasource_insert",
},
{
label: "排序",
type: "success",
handle: () =>
this.showSortModal(this.commonConstants.modalType.update),
auth: "reportType_insert",
},
{
label: "批量删除",
type: "danger",
handle: () => this.deleteBatch(),
},
],
// end
selectList: [], //
//start
tablePage: {
currentPage: 1,
pageSize: 5,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
//end
//start
tableCols: [
{type:'checkbox',width:50},
{ title: "分类名", field: "themeName", align: "center" },
{ title: "类型", field: "courseType", align: "center" },
{ title: "修改时间", field: "createTime", align: "center" },
{
title: "操作",
align: "center",
type: "button",
fixed: "right",
btnList: [
{
label: "编辑",
type: "text",
auth: "reportDatasource_update",
handle: (row) =>
this.showModal(this.commonConstants.modalType.update, row),
},
{
label: "删除",
type: "text",
auth: "reportDatasource_delete",
handle: (row) => this.deleteOne(row.courseThemeId),
},
],
},
],
//end
//modal start
modalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
// width: "80vw", //
modalRef: "modalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
modalForm: [
{
type: "Input",
label: "分类名称",
prop: "themeName",
rules: { required: true },
width: "300px",
},
{
type:'Select',
label:'类型',
prop:'courseType',
width:'300px',
rules: { required: true },
options:this.commonConstants.courseType,
}
],
//modal end
//modal start
modalData: {
themeName: "",
courseType:''
},
//modal end
//modal start
modalHandles: [
{ label: "取消", type: "default", handle: () => this.closeModal() },
{ label: "提交", type: "primary", handle: () => this.save() },
],
//modal end
//modal start
sortModalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "700px", //
modalRef: "sortModalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
sortModalForm: [
{
type: "Draggable",
label: "拖拽排序",
data: [],
prop: "themeName",
key: "themeName",
},
],
//modal end
//modal start
sortModalData: {
//modal
sort: [], //
},
//modal end
//modal start
sortModalHandles: [
{
label: "取消",
type: "default",
handle: () => this.closeSortModal(),
},
{ label: "提交", type: "primary", handle: () => this.saveSort() },
],
//modal end
searchForm: [
{
label: "课程类型",
type: "Select",
prop: "courseType",
options: this.commonConstants.courseType,
},
{
name: "查询",
style: "primary",
type: "Button",
handle: () => {
this.$refs.oTable.reload();
},
},
],
queryData: {
courseType: "红心向党",
},
},
};
},
activated() {
this.$refs.oTable.refresh();
},
methods: {
/**
* @description: 获取表格数据
* @param {type}
* @return:
* @author: ym
*/
searchTableList(pageNo,pageSize) {
//
this.$api.courseThemeList({courseType:this.pageData.queryData.courseType,page:pageNo,limit:pageSize}).then((res) => {
console.log(res.data.list);
this.$refs.oTable.complete(res.data.page.list,res.data.page.totalCount)
});
this.pageData.selectList = new Array();
},
//
resetSearch() {
this.commonUtil.clearObj(this.pageData.queryData);
this.searchTableList();
},
/**
* @description: modal显示
* @param {type} 类型 1新增2编辑 3详情
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
showModal(type, row) {
this.commonUtil.showModal(this.pageData.modalConfig, type);
if (type != this.commonConstants.modalType.insert) {
this.getDetail(row);
}
},
showSortModal(type) {
this.pageData.sortModalForm[0].data = this.pageData.tableData;
this.commonUtil.showModal(this.pageData.sortModalConfig, type);
},
/**
* @description: 获取详细数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
getDetail(row) {
this.pageData.modalData = JSON.parse(JSON.stringify(row));
},
/**
* @description: 关闭modal
* @param
* @return:
* @author: ym
*/
closeModal() {
this.$refs["modalRef"].$refs["modalFormRef"].resetFields(); //
this.pageData.modalConfig.show = false; //modal
this.commonUtil.clearObj(this.pageData.modalData); //modalData
},
closeSortModal() {
this.$refs["sortModalRef"].$refs["modalFormRef"].resetFields(); //
this.pageData.sortModalConfig.show = false; //modal
this.commonUtil.clearObj(this.pageData.sortModalData); //modalData
},
/**
* @description: 保存数据
* @param {type}
* @return:
* @author: ym
*/
save() {
this.$refs["modalRef"].$refs["modalFormRef"].validate((valid) => {
if (valid) {
let content = this.pageData.modalData;
// console.log(content)
if (
this.pageData.modalConfig.type ==
this.commonConstants.modalType.insert
) {
console.log(content);
this.$api.courseThemeSave(content).then((res) => {
this.$refs.oTable.refresh()
this.closeModal();
});
} else {
this.$api.courseThemeUpdate(content).then((res) => {
this.$refs.oTable.refresh()
this.closeModal();
});
}
} else {
return false;
}
});
},
async saveSort() {
let { data } = await this.$api.courseThemeSort(
this.pageData.sortModalForm[0].data
);
this.closeSortModal();
this.$refs.oTable.refresh()
// this.searchTableList();
},
/**
* @description: 删除一条数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
deleteOne(id) {
let ids = [];
ids[0] = id;
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil
.showConfirm(obj)
.then(async () => {
await this.$api.courseThemeDelete(ids).then((res) => {
this.$refs.oTable.refresh();
});
})
.catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
},
/**
* @description: 批量删除
* @param {type}
* @return:
* @author: ym
*/
deleteBatch() {
const length = this.pageData.selectList.length;
if (length == 0) {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList(
"error.batchdelete.empty",
null
),
type: this.commonConstants.messageType.error,
});
} else {
let ids = [];
console.log(this.pageData.selectList);
for (let i = 0; i < length; i++) {
ids.push("" + this.pageData.selectList[i].courseThemeId);
}
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil
.showConfirm(obj)
.then(() => {
console.log(ids);
this.$api.courseThemeDelete(ids).then((res) => {
this.$refs.oTable.refresh();
});
})
.catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
}
},
selectChange({records,reserves}) {
// console.log(val)
this.pageData.selectList = [...records,...reserves];
},
},
};
</script>
<style lang="scss" scoped>
.content-dialog ::v-deep .el-dialog__body {
padding: 0px;
}
</style>

View File

@ -1,374 +0,0 @@
<template>
<div class="_tablepage">
<!-- <searchForm
:searchForm="pageData.searchForm"
:searchData="pageData.queryData"
:searchHandle="pageData.searchHandle"
>
</searchForm> -->
<cusTable
:isSelection="true"
:isIndex="true"
:isPagination="false"
:isHandle="true"
:tableCols="pageData.tableCols"
:tableHandles="pageData.tableHandles"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
@selectChange="selectChange"
></cusTable>
<modal
ref="modalRef"
:modalConfig="pageData.modalConfig"
:modalForm="pageData.modalForm"
:modalData="pageData.modalData"
:modalHandles="pageData.modalHandles"
@closeModal="closeModal()"
></modal>
<modal
ref="sortModalRef"
:modalConfig="pageData.sortModalConfig"
:modalForm="pageData.sortModalForm"
:modalData="pageData.sortModalData"
:modalHandles="pageData.sortModalHandles"
@closeModal="closeSortModal()"
></modal>
</div>
</template>
<script>
import modal from "../../../components/common/modal/modal.vue";
import searchForm from "../../../components/common/searchform/searchForm.vue";
import cusTable from "../../../components/common/table/custable.vue";
export default {
components: { searchForm, cusTable, modal },
data() {
return {
typeList: [],
pageData: {
//start
tableData: [],
//end
// start
tableHandles: [
{
label: "新增",
type: "primary",
handle: () => this.showModal(this.commonConstants.modalType.insert),
auth: "reportDatasource_insert",
},
{
label: "排序",
type: "success",
handle: () =>
this.showSortModal(this.commonConstants.modalType.update),
auth: "reportType_insert",
},
{
label: "批量删除",
type: "danger",
handle: () => this.deleteBatch(),
},
],
// end
selectList: [], //
//start
tablePage: {
currentPage: 1,
pageSize: 5,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
//end
//start
tableCols: [
{ label: "分类名", prop: "footprintTypeName", align: "center" },
{ label: "分类ID", prop: "footprintTypeId", align: "center" },
{ label: "修改时间", prop: "createTime", align: "center" },
{
label: "操作",
prop: "operation",
align: "center",
type: "button",
fixed: "right",
btnList: [
{
label: "编辑",
type: "text",
auth: "reportDatasource_update",
handle: (row) =>
this.showModal(this.commonConstants.modalType.update, row),
},
{
label: "删除",
type: "text",
auth: "reportDatasource_delete",
handle: (row) => this.deleteOne(row.footprintTypeId),
},
],
},
],
//end
//modal start
modalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "80vw", //
modalRef: "modalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
modalForm: [
{
type: "Input",
label: "打卡地分类",
prop: "footprintTypeName",
rules: { required: true },
width: "300px",
},
],
//modal end
//modal start
modalData: {
footprintTypeName: "",
},
//modal end
//modal start
modalHandles: [
{ label: "取消", type: "default", handle: () => this.closeModal() },
{ label: "提交", type: "primary", handle: () => this.save() },
],
//modal end
//modal start
sortModalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "700px", //
modalRef: "sortModalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
sortModalForm: [
{
type: "Draggable",
label: "拖拽排序",
data: [],
prop: "footprintTypeName",
key: "footprintTypeSort",
},
],
//modal end
//modal start
sortModalData: {
//modal
sort: [], //
},
//modal end
//modal start
sortModalHandles: [
{
label: "取消",
type: "default",
handle: () => this.closeSortModal(),
},
{ label: "提交", type: "primary", handle: () => this.saveSort() },
],
//modal end
},
};
},
activated() {
this.searchTableList();
},
methods: {
/**
* @description: 获取表格数据
* @param {type}
* @return:
* @author: ym
*/
searchTableList() {
//
this.$api.getListByParams().then((res) => {
console.log(res.data.list);
this.commonUtil.tableAssignment(
res.data,
this.pageData.tablePage,
this.pageData.tableData
);
});
this.pageData.selectList = new Array
},
//
resetSearch() {
this.commonUtil.clearObj(this.pageData.queryData);
this.searchTableList();
},
/**
* @description: modal显示
* @param {type} 类型 1新增2编辑 3详情
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
showModal(type, row) {
this.commonUtil.showModal(this.pageData.modalConfig, type);
if (type != this.commonConstants.modalType.insert) {
this.getDetail(row);
}
},
showSortModal(type) {
this.pageData.sortModalForm[0].data = this.pageData.tableData;
this.commonUtil.showModal(this.pageData.sortModalConfig, type);
},
/**
* @description: 获取详细数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
getDetail(row) {
this.pageData.modalData = JSON.parse(JSON.stringify(row));
},
/**
* @description: 关闭modal
* @param
* @return:
* @author: ym
*/
closeModal() {
this.$refs["modalRef"].$refs["modalFormRef"].resetFields(); //
this.pageData.modalConfig.show = false; //modal
this.commonUtil.clearObj(this.pageData.modalData); //modalData
},
closeSortModal() {
this.$refs["sortModalRef"].$refs["modalFormRef"].resetFields(); //
this.pageData.sortModalConfig.show = false; //modal
this.commonUtil.clearObj(this.pageData.sortModalData); //modalData
},
/**
* @description: 保存数据
* @param {type}
* @return:
* @author: ym
*/
save() {
this.$refs["modalRef"].$refs["modalFormRef"].validate((valid) => {
if (valid) {
let content = this.pageData.modalData;
if (
this.pageData.modalConfig.type ==
this.commonConstants.modalType.insert
) {
console.log(content);
this.$api.saveNewFootprintType(content).then((res) => {
this.searchTableList();
});
} else {
let list = [content];
this.$api.updateFootprintTypeSort(list).then((res) => {
this.searchTableList();
});
}
this.closeModal();
} else {
return false;
}
});
},
async saveSort() {
let { data } = await this.$api.updateFootprintTypeSort(
this.pageData.sortModalForm[0].data
);
this.closeSortModal();
this.searchTableList();
},
/**
* @description: 删除一条数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
deleteOne(id) {
let ids = [];
ids[0] = id;
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil
.showConfirm(obj)
.then(async () => {
await this.$api.deleteFootprint(ids).then((res) => {
this.searchTableList();
});
})
.catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
},
/**
* @description: 批量删除
* @param {type}
* @return:
* @author: ym
*/
deleteBatch() {
const length = this.pageData.selectList.length;
if (length == 0) {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList(
"error.batchdelete.empty",
null
),
type: this.commonConstants.messageType.error,
});
} else {
let ids = [];
console.log(this.pageData.selectList);
for (let i = 0; i < length; i++) {
ids.push("" + this.pageData.selectList[i].footprintTypeId);
}
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil
.showConfirm(obj)
.then(() => {
console.log(ids);
this.$api.deleteFootprint(ids).then((res) => {
this.searchTableList();
});
})
.catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
}
},
selectChange(rows) {
console.log(rows);
this.pageData.selectList = rows;
rows = []
},
},
};
</script>
<style lang="scss" scoped>
.content-dialog ::v-deep .el-dialog__body {
padding: 0px;
}
</style>

View File

@ -1,207 +0,0 @@
<!--
* @Author: cwl
* @Date: 2021-11-10 19:54:12
* @LastEditTime: 2022-04-07 21:15:29
* @LastEditors: chenkangxu
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\views\modules\data-dictionary\handcopy-type.vue
-->
<template>
<div>
<cesTable
:isPagination="false"
:tableData="tableData"
:tableCols="tableCols"
:tableHandles="tableHandles"
:isIndex="true"
:isSelection="true"
@selectChange="selectChange"
/>
<!-- 添加编辑弹窗 -->
<modal
ref="modal"
labelWidth="120px"
:modalConfig="modalSetting.modalConfig"
:modalForm="modalSetting.modalForm"
:modalData="modalSetting.modalData"
:modalHandles="modalSetting.modalHandles"
@closeModal="closeModal('modal')"
/>
<modal
ref="sortModal"
:modalConfig="sortModalSetting.modalConfig"
:modalForm="sortModalSetting.modalForm"
:modalData="sortModalSetting.modalData"
:modalHandles="sortModalSetting.modalHandles"
></modal>
</div>
</template>
<script>
import modal from '../../../components/common/modal/modal.vue'
import cesTable from '../../../components/common/table/custable.vue'
export default {
components:{
cesTable,
modal
},
activated(){
this.findAll()
},
data(){
return{
tableCols:[
{label:'分类名',prop:'handCopyTypeName'},
{label:'分类Id',prop:'handCopyTypeId'},
{label:'修改时间',prop:'createTime'},
{label:'操作',type:'button',btnList:[
{label:'编辑',type:'text',handle:(row)=>{
this.commonUtil.showModal(this.modalSetting.modalConfig,this.commonConstants.modalType.update)
this.$nextTick(()=>{
this.modalSetting.modalData=JSON.parse(JSON.stringify(row));
})
}},
{label:'删除',type:'text',handle:(row)=>this.del(row.handCopyTypeId)}
]}
],
selectList:[],
tableData:[],
tableHandles:[
{label:'新增',type:'primary',handle:()=>{
this.commonUtil.showModal(this.modalSetting.modalConfig,this.commonConstants.modalType.insert)
}},
{label:'排序',type:'success',handle:()=>{
this.sortModalSetting.modalForm[0].data=this.tableData
this.commonUtil.showModal(this.sortModalSetting.modalConfig,this.commonConstants.modalType.update)
}},
{label:'批量删除',type:'danger',handle:()=>this.del()},
],
modalSetting:{
modalConfig:{
show:false,
title:this.commonConstants.modalTitle.insert,
},
modalForm:[
{label:'手抄报分类名',prop:'handCopyTypeName',type:'Input',rules:{required:true}},
],
modalData:{
handCopyTypeName:''
},
modalHandles:[
{label:'确认',type:'primary',handle:()=>{
this.$refs.modal.$refs.modalFormRef.validate((valid) => {
if (valid) {
this.save()
} else {
return false;
}
});
}}
]
},
sortModalSetting:{
modalConfig:{
show:false,
title:this.commonConstants.modalTitle.insert,
},
modalForm:[
{
type: "Draggable",
label: "拖拽排序",
data: [],
prop: "handCopyTypeName",
key: "handCopyTypeSort",
},
],
modalData:{
sort:[]
},
modalHandles:[
{label:'确认',type:'primary',handle:()=>{
this.$api.updateHandCopySort(this.sortModalSetting.modalForm[0].data).then(res=>{
this.sortModalSetting.modalConfig.show=false
this.findAll()
})
}}
]
}
}
},
methods:{
findAll(){
this.$api.getHandCopyTypeList().then(res=>{
this.tableData=res.data.list
})
},
closeModal(ref){
this.resetFields(ref);
},
resetFields(ref){
this.$refs[ref].$refs.modalFormRef.resetFields()
},
selectChange(val){
this.selectList=val
},
save(){
let data=this.modalSetting.modalData
if(this.modalSetting.modalConfig.title===this.commonConstants.modalTitle.insert)
{
this.$api.saveHandCopyType(data).then(res=>{
this.modalSetting.modalConfig.show=false
this.resetFields('modal')
this.findAll()
})
}
else{
this.$api.updateHandCopySort([data]).then(res=>{
this.modalSetting.modalConfig.show=false
this.findAll()
})
}
},
del(val){
let data=[]
if(val){
data.push(val)
}
else{
data=this.selectList.map(item=>item.handCopyTypeId)
}
if (data.length == 0) {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList(
"error.batchdelete.empty",
null
),
type: this.commonConstants.messageType.error,
});
}
else{
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil.showConfirm(obj).then(()=>{
this.$api.deleteHandCopySort(data).then(res=>{
this.findAll()
})
}).catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
}
}
}
}
</script>

View File

@ -1,197 +0,0 @@
<template>
<div>
<cesTable
:isPagination="false"
:tableData="tableData"
:tableCols="tableCols"
:tableHandles="tableHandles"
:isIndex="true"
:isSelection="true"
@selectChange="selectChange"
/>
<!-- 添加编辑弹窗 -->
<modal
ref="modal"
labelWidth="140px"
:modalConfig="modalSetting.modalConfig"
:modalForm="modalSetting.modalForm"
:modalData="modalSetting.modalData"
:modalHandles="modalSetting.modalHandles"
@closeModal="closeModal('modal')"
/>
<modal
ref="sortModal"
:modalConfig="sortModalSetting.modalConfig"
:modalForm="sortModalSetting.modalForm"
:modalData="sortModalSetting.modalData"
:modalHandles="sortModalSetting.modalHandles"
></modal>
</div>
</template>
<script>
import modal from '../../../components/common/modal/modal.vue'
import cesTable from '../../../components/common/table/custable.vue'
export default {
components:{
cesTable,
modal
},
activated(){
this.findAll()
},
data(){
return{
tableCols:[
{label:'分类名',prop:'activityTypeName'},
{label:'分类Id',prop:'activityTypeId'},
{label:'修改时间',prop:'createTime'},
{label:'操作',type:'button',btnList:[
{label:'编辑',type:'text',handle:(row)=>{
this.commonUtil.showModal(this.modalSetting.modalConfig,this.commonConstants.modalType.update)
this.$nextTick(()=>{
this.modalSetting.modalData=JSON.parse(JSON.stringify(row));
})
}},
{label:'删除',type:'text',handle:(row)=>this.del(row.activityTypeId)}
]}
],
selectList:[],
tableData:[],
tableHandles:[
{label:'新增',type:'primary',handle:()=>{
this.commonUtil.showModal(this.modalSetting.modalConfig,this.commonConstants.modalType.insert)
}},
{label:'排序',type:'success',handle:()=>{
this.sortModalSetting.modalForm[0].data=this.tableData
this.commonUtil.showModal(this.sortModalSetting.modalConfig,this.commonConstants.modalType.update)
}},
{label:'批量删除',type:'danger',handle:()=>this.del()},
],
modalSetting:{
modalConfig:{
show:false,
title:this.commonConstants.modalTitle.insert,
},
modalForm:[
{label:'活动/比赛分类名',prop:'activityTypeName',type:'Input',rules:{required:true}},
],
modalData:{
activityTypeName:''
},
modalHandles:[
{label:'确认',type:'primary',handle:()=>{
this.$refs.modal.$refs.modalFormRef.validate((valid) => {
if (valid) {
this.save()
} else {
return false;
}
});
}}
]
},
sortModalSetting:{
modalConfig:{
show:false,
title:this.commonConstants.modalTitle.insert,
},
modalForm:[
{
type: "Draggable",
label: "拖拽排序",
data: [],
prop: "activityTypeName",
key: "activityTypeSort",
},
],
modalData:{
sort:[]
},
modalHandles:[
{label:'确认',type:'primary',handle:()=>{
this.$api.updateMatchSort(this.sortModalSetting.modalForm[0].data).then(res=>{
this.sortModalSetting.modalConfig.show=false
this.findAll()
})
}}
]
}
}
},
methods:{
findAll(){
this.$api.getMatchTypeList().then(res=>{
this.tableData=res.data.list
})
},
closeModal(ref){
this.resetFields(ref);
},
resetFields(ref){
this.$refs[ref].$refs.modalFormRef.resetFields()
},
selectChange(val){
this.selectList=val
},
save(){
let data=this.modalSetting.modalData
if(this.modalSetting.modalConfig.title===this.commonConstants.modalTitle.insert)
{
this.$api.saveMatchType(data).then(res=>{
this.modalSetting.modalConfig.show=false
this.resetFields('modal')
this.findAll()
})
}
else{
this.$api.updateMatchSort([data]).then(res=>{
this.modalSetting.modalConfig.show=false
this.findAll()
})
}
},
del(val){
let data=[]
if(val){
data.push(val)
}
else{
data=this.selectList.map(item=>item.activityTypeId)
}
if (data.length == 0) {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList(
"error.batchdelete.empty",
null
),
type: this.commonConstants.messageType.error,
});
}
else{
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil.showConfirm(obj).then(()=>{
this.$api.deleteMatchSort(data).then(res=>{
this.findAll()
})
}).catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
}
}
}
}
</script>

View File

@ -1,574 +0,0 @@
<!--
* @Author: ym
* @Date: 2021-09-21 12:30:58
* @LastEditTime: 2022-04-07 21:10:05
* @LastEditors: chenkangxu
* @Description: In User Settings Edit
* @FilePath: \background-front-end\src\views\modules\data-dictionary\poetry-type.vue
-->
<template>
<div class="_tablepage">
<!-- <searchForm
:searchForm="pageData.searchForm"
:searchData="pageData.queryData"
:searchHandle="pageData.searchHandle"
>
</searchForm> -->
<cusTable
:isSelection="false"
:isIndex="true"
:isPagination="false"
:isHandle="true"
:tableCols="pageData.tableCols"
:tableHandles="pageData.tableHandles"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
></cusTable>
<modal
ref="modalRef"
:modalConfig="pageData.modalConfig"
:modalForm="pageData.modalForm"
:modalData="pageData.modalData"
:modalHandles="pageData.modalHandles"
@closeModal="closeModal()"
></modal>
<modal
ref="secModalRef"
:modalConfig="pageData.secModalConfig"
:modalForm="pageData.secModalForm"
:modalData="pageData.secModalData"
:modalHandles="pageData.secModalHandles"
@closeModal="closeSecModal()"
></modal>
<modal
ref="sortModalRef"
:modalConfig="pageData.sortModalConfig"
:modalForm="pageData.sortModalForm"
:modalData="pageData.sortModalData"
:modalHandles="pageData.sortModalHandles"
@closeModal="closeSortModal()"
></modal>
<modal
ref="secSortModalRef"
:modalConfig="pageData.secSortModalConfig"
:modalForm="pageData.secSortModalForm"
:modalData="pageData.secSortModalData"
:modalHandles="pageData.secSortModalHandles"
@closeModal="closeSecSortModal()"
></modal>
</div>
</template>
<script>
import modal from "../../../components/common/modal/modal.vue";
import searchForm from "../../../components/common/searchform/searchForm.vue";
import cusTable from "../../../components/common/table/custable.vue";
export default {
components: { searchForm, cusTable, modal },
data() {
return {
pageData: {
// start
searchForm: [
{ type: "Input", label: "类型名称", prop: "reportTypeName" },
],
// end
// start
queryData: {
reportTypeName: "", //
},
// end
//start
searchHandle: [
{
label: "查询",
type: "primary",
handle: () => this.searchTableList(),
auth: "reportType_search",
},
{
label: "重置",
type: "warning",
handle: () => this.resetSearch(),
auth: "reportType_search",
},
],
//end
//start
tableData: [],
//end
// start
tableHandles: [
{
label: "新增主类",
type: "primary",
handle: () =>
this.showModal(this.commonConstants.modalType.insert, "main"),
auth: "reportType_insert",
},
{
label: "主类排序",
type: "success",
handle: () =>
this.showSortModal(this.commonConstants.modalType.update),
auth: "reportType_insert",
},
// {
// label: "",
// type: "danger",
// handle: () => this.deleteBatch(),
// auth: "reportType_batchDelete",
// },
],
// end
selectList: [], //
//start
tablePage: {
currentPage: 1,
pageSize: 10,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
//end
//start
tableCols: [
{ label: "主类名称", prop: "mainTypeName", align: "center" },
{ label: "子类名称", prop: "secondTypeName", align: "center" },
{ label: "修改时间", prop: "createTime", align: "center",formatter:(prop,row)=>{return row[prop]}},
{
label: "操作",
prop: "operation",
align: "center",
type: "button",
btnList: [
{
label: "新增子类",
type: "text",
auth: "reportType_getDetail",
disabled: (row) => {
return row.children ? false : true;
},
handle: (row) =>
this.showSecModal(this.commonConstants.modalType.insert, row),
},
{
label: "修改",
type: "text",
auth: "reportType_update",
handle: (row) =>
row.children
? this.showModal(this.commonConstants.modalType.update, row)
: this.showSecModal(
this.commonConstants.modalType.update,
row
),
},
{
label: "子类排序",
type: "text",
auth: "reportType_getDetail",
disabled: (row) => {
return row.children && row.children.length > 1 ? false : true;
},
handle: (row) =>
this.showSecSortModal(
row.children,
this.commonConstants.modalType.update
),
},
{
label: "删除",
type: "text",
auth: "reportType_delete",
handle: (row) =>
this.deleteOne(row, row.children ? "main" : "sec"),
},
],
},
],
//end
//modal start
modalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "700px", //
modalRef: "modalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
modalForm: [
{
type: "Input",
label: "主类名称",
prop: "mainTypeName",
rules: { required: true, maxLength: 50 },
},
],
//modal end
//modal start
modalData: {
//modal
mainTypeName: "", //
},
//modal end
//modal start
modalHandles: [
{ label: "取消", type: "default", handle: () => this.closeModal() },
{ label: "提交", type: "primary", handle: () => this.save() },
],
//modal end
//modal start
secModalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "700px", //
modalRef: "secModalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
secModalForm: [
{
type: "Input",
label: "子类名称",
prop: "secondTypeName",
rules: { required: true, maxLength: 50 },
},
],
//modal end
//modal start
secModalData: {
//modal
secondTypeName: "", //
},
//modal end
//modal start
secModalHandles: [
{
label: "取消",
type: "default",
handle: () => this.closeSecModal(),
},
{ label: "提交", type: "primary", handle: () => this.saveSec() },
],
//modal end
//modal start
sortModalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "700px", //
modalRef: "sortModalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
sortModalForm: [
{
type: "Draggable",
label: "拖拽排序",
data: [],
prop: "mainTypeName",
key: "mainTypeId",
},
],
//modal end
//modal start
sortModalData: {
//modal
sort: [], //
},
//modal end
//modal start
sortModalHandles: [
{
label: "取消",
type: "default",
handle: () => this.closeSortModal(),
},
{ label: "提交", type: "primary", handle: () => this.saveSort() },
],
//modal end
//modal start
secSortModalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "700px", //
modalRef: "secSortModalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
secSortModalForm: [
{
type: "Draggable",
label: "拖拽排序",
data: [],
prop: "secondTypeName",
key: "secondTypeId",
},
],
//modal end
//modal start
secSortModalData: {
//modal
sort: [], //
},
//modal end
//modal start
secSortModalHandles: [
{
label: "取消",
type: "default",
handle: () => this.closeSecSortModal(),
},
{ label: "提交", type: "primary", handle: () => this.saveSecSort() },
],
//modal end
},
};
},
activated() {
this.searchTableList();
},
methods: {
/**
* @description: 获取表格数据
* @param {type}
* @return:
* @author: ym
*/
async searchTableList() {
let res = await this.$api.getMainSecondTypeList();
//
for (let i = 0; i < res.data.list.length; i++) {
if (res.data.list[i].children.length > 0) {
res.data.list[i].id = res.data.list[i].mainTypeId;
for (let j = 0; j < res.data.list[i].children.length; j++) {
res.data.list[i].children[j].id =
res.data.list[i].children[j].secondTypeId;
}
} else {
}
}
this.commonUtil.tableAssignment(
res.data,
this.pageData.tablePage,
this.pageData.tableData
);
},
/**
* @description: modal显示
* @param {type} 类型 1新增2编辑 3详情
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
showModal(type, row) {
//
this.commonUtil.showModal(this.pageData.modalConfig, type);
if (type != this.commonConstants.modalType.insert) {
this.getDetail(row);
}
},
showSecModal(type, row) {
//
this.commonUtil.showModal(this.pageData.secModalConfig, type);
if (type != this.commonConstants.modalType.insert) {
this.getDetail(row, "sec");
} else {
this.pageData.secModalData.mainTypeId = row.mainTypeId;
}
},
showSortModal(type) {
this.pageData.sortModalForm[0].data = this.pageData.tableData;
this.commonUtil.showModal(this.pageData.sortModalConfig, type);
},
showSecSortModal(list, type) {
this.pageData.secSortModalForm[0].data = list;
this.commonUtil.showModal(this.pageData.secSortModalConfig, type);
},
/**
* @description: 获取详细数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
getDetail(row, type) {
if (type == "sec") {
this.pageData.secModalData = JSON.parse(JSON.stringify(row)); //
} else {
this.pageData.modalData = JSON.parse(JSON.stringify(row)); //
}
},
/**
* @description: 关闭modal
* @param
* @return:
* @author: ym
*/
closeModal() {
this.$refs["modalRef"].$refs["modalFormRef"].resetFields(); //
this.pageData.modalConfig.show = false; //modal
this.commonUtil.clearObj(this.pageData.modalData); //modalData
},
closeSecModal() {
this.$refs["secModalRef"].$refs["modalFormRef"].resetFields(); //
this.pageData.secModalConfig.show = false; //modal
this.commonUtil.clearObj(this.pageData.secModalData); //modalData
},
closeSortModal() {
this.$refs["sortModalRef"].$refs["modalFormRef"].resetFields(); //
this.pageData.sortModalConfig.show = false; //modal
this.commonUtil.clearObj(this.pageData.sortModalData); //modalData
},
closeSecSortModal() {
this.$refs["secSortModalRef"].$refs["modalFormRef"].resetFields(); //
this.pageData.secSortModalConfig.show = false; //modal
this.commonUtil.clearObj(this.pageData.secSortModalData); //modalData
},
/**
* @description: 保存数据
* @param {type}
* @return:
* @author: ym
*/
save() {
this.$refs["modalRef"].$refs["modalFormRef"].validate((valid) => {
if (valid) {
if (
this.pageData.modalConfig.type ==
this.commonConstants.modalType.insert
) {
this.$api
.saveNewMainType(this.pageData.modalData.mainTypeName)
.then((res) => {
this.closeModal();
this.searchTableList();
});
} else {
this.$api.updateMainType(this.pageData.modalData).then((res) => {
this.closeModal();
this.searchTableList();
});
}
} else {
return false;
}
});
},
saveSec() {
this.$refs["secModalRef"].$refs["modalFormRef"].validate((valid) => {
if (valid) {
if (
this.pageData.secModalConfig.type ==
this.commonConstants.modalType.insert
) {
this.$api
.saveNewSecondType(
this.pageData.secModalData.secondTypeName,
this.pageData.secModalData.mainTypeId
)
.then((res) => {
this.closeSecModal();
this.searchTableList();
});
} else {
this.$api.updateSecType(this.pageData.secModalData).then((res) => {
this.closeSecModal();
this.searchTableList();
});
}
} else {
return false;
}
});
},
async saveSort() {
let { data } = await this.$api.updatePSort(
this.pageData.sortModalForm[0].data
);
this.closeSortModal();
this.searchTableList();
},
async saveSecSort() {
let { data } = await this.$api.updateSPSort(
this.pageData.secSortModalForm[0].data
);
this.closeSecSortModal();
this.searchTableList();
},
/**
* @description: 删除一条数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
deleteOne(row, type) {
let array = [];
if (type == "main") {
array[0] = row.mainTypeId;
this.$msgbox({
title: `确认删除?`,
message: "此操作将永久删除父类以及子类",
showCancelButton: true,
confirmButtonText: "确定",
cancelButtonText: "取消",
callback: async (action) => {
if (action === "confirm") {
this.$api.deleteMainType(array).then((res) => {
if (res.data.code == 0) {
this.commonUtil.showMessage({
message: "删除成功",
type: this.commonConstants.messageType.success,
});
this.searchTableList();
} else {
this.commonUtil.showMessage({
message: res.data.msg,
type: this.commonConstants.messageType.error,
});
}
});
} else {
this.$message({
type: "info",
message: "已取消删除",
});
}
},
});
} else {
array[0] = row.secondTypeId;
this.$msgbox({
title: `确认删除?`,
message: "此操作将永久该分类",
showCancelButton: true,
confirmButtonText: "确定",
cancelButtonText: "取消",
callback: async (action) => {
if (action === "confirm") {
this.$api.deleteSecType(array).then((res) => {
if (res.data.code == 0) {
this.searchTableList();
}
});
} else {
this.$message({
type: "info",
message: "已取消删除",
});
}
},
});
}
},
},
};
</script>

View File

@ -1,108 +0,0 @@
<!--
* @Author: your name
* @Date: 2022-01-20 14:59:01
* @LastEditTime: 2022-01-25 21:51:01
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\views\modules\footprint-management\components\footprint-line-modal.vue
-->
<template>
<div>
<modal :modalConfig="modalConfig">
<cesTable slot="dialog__content"
:tableCols="tableCols"
:tableData="tableData"
:isPagination="false"
:isIndex="true"
/>
</modal>
</div>
</template>
<script>
import modal from '../../../../components/common/modal/modal.vue'
import cesTable from '../../../../components/common/table/custable.vue'
export default {
components:{
modal,cesTable
},
data(){
return{
modalConfig:{
show:false,
title:'详情',
width:'1200px'
},
tableData:[],
tableCols:[
{ label: "景点名称", prop: "footprintName", align: "center" },
{ label: "景点图片", prop: "images", align: "center", type: "elImage",limit:3 },
// {
// label: "",
// prop: "footprintContent",
// align: "center",
// width: "280px",
// },
{
label: "详细地址",
prop: "address",
align: "center",
width: "280px",
},
{
label: "联系电话",
prop: "cellphone",
align: "center",
width: "150px",
},
{
label: "参观票价",
prop: "ticketPrice",
align: "center",
width: "100px",
},
{ label: "开放时间", prop: "openTime", align: "center" },
// {
// label: "",
// prop: "footprintTypeName",
// align: "center",
// width: "120px",
// },
// {
// label: "",
// prop: "operation",
// align: "center",
// type: "button",
// width: "210px",
// btnList: [
// {
// label: "",
// type: "text",
// handle: (row) => this.showDetail(row.footprintId),
// },
// {
// label: "",
// type: "text",
// handle: (row) => this.addOrUpdateHandle(row.footprintId),
// },
// {
// label: "",
// type: "text",
// handle: (row) => this.deleteOne(row),
// },
// ],
// },
],
}
},
methods:{
findAll(id){
this.$api.getFootprintLineDetail(id).then(res=>{
this.tableData=res.data.data.list.map(item=>{
item.images=item.images.split(',');
return item
})
})
}
}
}
</script>

View File

@ -1,65 +0,0 @@
<!--
* @Author: your name
* @Date: 2022-01-20 14:59:01
* @LastEditTime: 2022-08-23 15:58:38
* @LastEditors: chenkangxu
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\views\modules\footprint-management\components\footprint-line-modal.vue
-->
<template>
<div>
<modal :modalConfig="modalConfig" :modalHandles="modalHandles">
<footPrintLine ref="footPrintLine" @getFootprintLine="getFootprintLine" slot="dialog__content"
/>
</modal>
</div>
</template>
<script>
import modal from '../../../../components/common/modal/modal.vue'
import footPrintLine from './footprint-line.vue'
export default {
components:{
modal,footPrintLine
},
watch:{
"modalConfig.show":{
handler:function(val){
if(val){
this.$nextTick(()=>{
this.$refs.footPrintLine.findAll()
this.flag=false
})
}
}
}
},
data(){
return{
modalConfig:{
show:false,
title:'支线列表'
},
modalHandles:[{label:'确认',type:'primary',disabled:()=>{
if(this.flag) return false
else return true
},handle:()=>{
this.form.footprintLineId=this.row.footprintLineId
this.$set(this.form,'footprintLineName',this.row.lineName)
this.modalConfig.show=false
}}],
row:{},
flag:false
}
},
props:{
form:{type:Object,default:()=>{}}
},
methods:{
getFootprintLine(row){
this.row=row
this.flag=true
}
}
}
</script>

View File

@ -1,228 +0,0 @@
<!--
* @Author: your name
* @Date: 2022-01-20 15:17:37
* @LastEditTime: 2022-08-23 15:59:09
* @LastEditors: chenkangxu
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\views\modules\footprint-management\components\footprint-line.vue
-->
<template>
<div style="padding:0 20px;">
<cesTable
ref="table"
:tableCols="pageData.tableCols"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
:tableHandles="pageData.tableHandles"
:isSelection="false"
:highlightCurrentRow="true"
@currentChange="currentChange"
@selectChange="handleSelectChange"
@handleSizeChange="findAll"
@handleCurrentChange="findAll"
:isIndex="true"
/>
<modal
ref="modal"
:modalConfig="modalSetting.modalConfig"
:modalForm="modalSetting.modalForm"
:modalData="modalSetting.modalData"
:modalHandles="modalSetting.modalHandles"
/>
<detailModal ref="detailModal" />
</div>
</template>
<script>
import detailModal from './footprint-line-detail-modal.vue'
import modal from "../../../../components/common/modal/modal.vue";
import cesTable from "../../../../components/common/table/custable.vue";
export default {
components: {
cesTable,
modal,
detailModal
},
data() {
return {
pageData: {
tableCols: [
{ label: "支线名称", prop: "lineName", align: "center" },
{ label: "奖励积分数", prop: "score", align: "center" },
{ label: "创建时间", prop: "createTime", align: "center" },
// {
// label: "",
// type: "button",
// align: "center",
// btnList: [
// { label: "", type: "text", handle: (row) => {
// this.$refs.detailModal.modalConfig.show=true
// this.$refs.detailModal.findAll(row.footprintLineId)
// } },
// {
// label: "",
// type: "text",
// handle: (row) => {
// this.modalSetting.modalConfig.title = "";
// let data = JSON.parse(JSON.stringify(row));
// data.score = data.score + "";
// this.modalSetting.modalData = data;
// this.modalSetting.modalConfig.show = true;
// },
// },
// {
// label: "",
// type: "text",
// handle: (row) => {
// this.del(row.footprintLineId);
// },
// },
// ],
// },
],
tableData: [],
tablePage: {
currentPage: 1,
pageSize: 5,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
tableHandles: [
// {
// label: "",
// type: "primary",
// handle: () => {
// (this.modalSetting.modalConfig.title = ""), this.clearObj();
// this.modalSetting.modalConfig.show = true;
// this.clearValidate();
// },
// },
// {
// label: "",
// type: "danger",
// handle: () => {
// if (this.pageData.selectList.length === 0) {
// this.$message({
// type: "warning",
// message: "",
// });
// } else {
// this.del();
// }
// },
// },
],
selectList: [],
},
modalSetting: {
modalConfig: {
show: false,
title: "添加",
width: "1200px",
},
modalData: {
content: "",
score: "",
lineName: "",
},
modalForm: [
{
label: "支线名称",
prop: "lineName",
type: "Input",
width: "300px",
rules: { required: true },
},
{
label: "奖励积分数",
prop: "score",
type: "Input",
width: "300px",
rules: { required: true, type: "integer" },
},
{
label: "描述",
prop: "content",
type: "Tinymce",
width: "900px",
rules: { required: true },
},
],
modalHandles: [
{ label: "确认", type: "primary", handle: () => this.submit() },
],
},
};
},
activated() {
this.findAll();
},
methods: {
findAll() {
this.$nextTick(()=>{
// console.log(this.$refs.table)
this.$refs.table.$refs.cesTable.setCurrentRow()
})
let data = {};
data.page = this.pageData.tablePage.currentPage;
data.limit = this.pageData.tablePage.pageSize;
this.$api.getFootprintLineList(data).then((res) => {
this.pageData.tablePage.pageTotal = res.data.page.totalCount;
this.pageData.tableData = res.data.page.list
});
},
clearObj() {
for (let item in this.modalSetting.modalData) {
this.modalSetting.modalData[item] = "";
}
},
clearValidate() {
this.$nextTick(() => {
this.$refs.modal.$refs.modalFormRef.clearValidate();
});
},
handleSelectChange(val) {
this.pageData.selectList = val;
},
submit() {
let data = JSON.parse(JSON.stringify(this.modalSetting.modalData));
data.score = Number(data.score);
let type = this.modalSetting.modalConfig.title;
if (type === "添加") {
this.$api.saveFootprintLine(data).then((res) => {
this.modalSetting.modalConfig.show = false;
this.findAll();
});
} else {
this.$api.updateFootprintLine(data).then((res) => {
this.modalSetting.modalConfig.show = false;
this.findAll();
});
}
},
currentChange(row){
this.$emit('getFootprintLine',row)
},
del(id) {
let data;
if (id) {
data = [id];
} else {
data = this.pageData.selectList.map((item) => item.footprintLineId);
}
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$api.deleteFootprintLine(data).then((res) => {
this.findAll();
});
})
.catch(() => {});
},
},
};
</script>

View File

@ -1,256 +0,0 @@
<!--
* @Author: chenkangxu
* @Date: 2022-09-01 20:28:53
* @LastEditTime: 2022-09-20 21:39:14
* @LastEditors: chenkangxu
* @Description: VR场景上传表
* @Github:
-->
<template>
<obj-table-plus
class="vr-table"
height="80vh"
:enable-auto-query="false"
ref="oTable"
:isPagination="false"
v-model="tableData"
:tableProp="tableProp"
:tableCols="tableCols"
:toolbarProp="{}"
>
</obj-table-plus>
</template>
<script>
import FileUpload from "@/components/common/upload/fileUpload.vue";
export default {
model: {
prop: "tableData",
event: "updateTableData",
},
components: {
FileUpload,
},
data() {
return {
tableProp: {},
};
},
props: {
tableData: {
type: Array,
default: () => [
{
title: "场景1",
isEdit: false,
info: "场景1介绍",
url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F4k%2Fs%2F02%2F2109242332225H9-0-lp.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1664628119&t=5cb5d6c78e078d4d467fba5bc433c123",
},
{
title: "场景1",
isEdit: false,
info: "场景1介绍",
url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F4k%2Fs%2F02%2F2109242332225H9-0-lp.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1664628119&t=5cb5d6c78e078d4d467fba5bc433c123",
},
{
title: "场景1",
isEdit: false,
info: "场景1介绍",
url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F4k%2Fs%2F02%2F2109242332225H9-0-lp.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1664628119&t=5cb5d6c78e078d4d467fba5bc433c123",
},
],
},
},
computed: {
tableCols() {
return [
{
title: "场景名称",
field: "title",
type: "jsx",
'min-width':"300px",
resizable:false,
align:"center",
render: (e) => {
let { row, rowIndex } = e;
const change = (value) => {
this.$set(row, "title", value);
};
return (
<el-form-item
label-width="0"
style="margin-bottom:0 !important;"
inline={true}
rules={{
required: true,
message: "场景名称不能为空",
trigger: ["blur", "change"],
}}
prop={"vrList." + rowIndex + ".title"}
>
<el-input
value={row.title}
onInput={change}
onBlur={blur}
></el-input>
</el-form-item>
);
},
},
{
title: "场景介绍",
field: "info",
resizable:false,
type: "jsx",
align:"center",
'min-width':"300px",
render: (e) => {
let { row, rowIndex } = e;
const change = (value) => {
this.$set(row, "info", value);
};
return (
<el-form-item
label-width="0"
style="margin-bottom:0 !important;"
inline={true}
rules={{
required: true,
message: "场景介绍不能为空",
trigger: ["blur", "change"],
}}
prop={"vrList." + rowIndex + ".info"}
>
<el-input
value={row.info}
onInput={change}
onBlur={blur}
></el-input>
</el-form-item>
);
},
},
{
title: "场景全景图",
field: "url",
width:"340px",
align:"center",
type: "jsx",
resizable:false,
render: ({ row,rowIndex}) => {
const updateFileUrl = (e) => {
this.$set(row, "url", e);
};
const removeFileList=(e)=>{
if(e.length<=0) this.$set(row, "url", "");
}
let fileList=row.url?[{url:row.url}]:[]
return (
<el-form-item
label-width="0"
style="margin-bottom:0 !important;height:170px;"
inline={true}
rules={{
required: true,
message: "场景全景图不能为空",
trigger: ["blur", "change"],
}}
prop={"vrList." + rowIndex + ".url"}
>
<file-upload
listType="picture-card"
onUpdateFileUrl={updateFileUrl}
onRemoveFileList={removeFileList}
fileUrl={row.url}
limit={1}
fileList={fileList}
accept=".jpg,.jpeg,.png,.JPG,.JPEG"
drag={false}
showTips={false}
enableImageCompressor={true}
>
</file-upload>
</el-form-item>
);
},
},
{
title: "操作",
width:"200px",
align:"center",
resizable:false,
type: "jsx",
render: ({ row,rowIndex }) => {
const add = () => {
this.tableData.splice(rowIndex+1,0,{
title:"",info:"",url:""
})
};
const remove = () => {
let deleteData=this.tableData.find((item,index)=>index==rowIndex);
console.log(deleteData);
if(deleteData.info.length>0 || deleteData.title.length>0 || deleteData.url.length>0){
this.$confirm(`场景名称:${deleteData.title},场景介绍:${deleteData.info}`,"确认删除此行?")
.then(()=>{
this.$emit("updateTableData",this.tableData.filter((item,index)=>index!=rowIndex))
})
}else{
this.$emit("updateTableData",this.tableData.filter((item,index)=>index!=rowIndex))
}
};
const copy=()=>{
this.tableData.splice(rowIndex+1,0,{
title:row.title,info:row.info,url:""
})
}
return (
<div>
<el-tooltip class="item" effect="dark" content="复制一份场景介绍都一样的行(不包含图片)" placement="top">
<el-button
size="middle"
onClick={copy}
plain
circle
icon="el-icon-document-copy"
type="info"
>
</el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="新增下一行" placement="top">
<el-button
size="middle"
onClick={add}
icon="el-icon-plus"
plain
type="primary"
circle
></el-button>
</el-tooltip>
{this.tableData.length>1?
<el-tooltip class="item" effect="dark" content="删除本行" placement="top">
<el-button
size="middle"
onClick={remove}
icon="el-icon-minus"
plain
type="danger"
circle
></el-button>
</el-tooltip>
:null}
</div>
);
},
},
];
},
},
};
</script>
<style lang="scss" scoped>
.vr-table{
margin-bottom: 40px;
}
</style>

View File

@ -1,217 +0,0 @@
<!--
* @Author: your name
* @Date: 2022-01-20 13:31:53
* @LastEditTime: 2022-04-07 21:40:29
* @LastEditors: chenkangxu
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\views\modules\footprint-management\footpint-line.vue
-->
<template>
<div>
<cesTable
:tableCols="pageData.tableCols"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
:tableHandles="pageData.tableHandles"
:isSelection="true"
@selectChange="handleSelectChange"
@handleSizeChange="findAll"
@handleCurrentChange="findAll"
:isIndex="true"
/>
<modal
ref="modal"
:modalConfig="modalSetting.modalConfig"
:modalForm="modalSetting.modalForm"
:modalData="modalSetting.modalData"
:modalHandles="modalSetting.modalHandles"
/>
<detailModal ref="detailModal" />
</div>
</template>
<script>
import detailModal from './components/footprint-line-detail-modal.vue'
import modal from "../../../components/common/modal/modal.vue";
import cesTable from "../../../components/common/table/custable.vue";
export default {
components: {
cesTable,
modal,
detailModal
},
data() {
return {
pageData: {
tableCols: [
{ label: "支线名称", prop: "lineName", align: "center" },
{ label: "奖励积分数", prop: "score", align: "center" },
{ label: "修改时间", prop: "createTime", align: "center" },
{
label: "操作",
type: "button",
align: "center",
btnList: [
{ label: "详情", type: "text", handle: (row) => {
this.$refs.detailModal.modalConfig.show=true
this.$refs.detailModal.findAll(row.footprintLineId)
} },
{
label: "编辑",
type: "text",
handle: (row) => {
this.modalSetting.modalConfig.title = "编辑";
let data = JSON.parse(JSON.stringify(row));
data.score = data.score + "";
this.modalSetting.modalData = data;
this.modalSetting.modalConfig.show = true;
},
},
{
label: "删除",
type: "text",
handle: (row) => {
this.del(row.footprintLineId);
},
},
],
},
],
tableData: [],
tablePage: {
currentPage: 1,
pageSize: 5,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
tableHandles: [
{
label: "添加",
type: "primary",
handle: () => {
(this.modalSetting.modalConfig.title = "添加"), this.clearObj();
this.modalSetting.modalConfig.show = true;
this.clearValidate();
},
},
{
label: "批量删除",
type: "danger",
handle: () => {
if (this.pageData.selectList.length === 0) {
this.$message({
type: "warning",
message: "请至少选择一条数据",
});
} else {
this.del();
}
},
},
],
selectList: [],
},
modalSetting: {
modalConfig: {
show: false,
title: "添加",
width: "1200px",
},
modalData: {
content: "",
score: "",
lineName: "",
},
modalForm: [
{
label: "支线名称",
prop: "lineName",
type: "Input",
width: "300px",
rules: { required: true },
},
{
label: "奖励积分数",
prop: "score",
type: "Input",
width: "300px",
rules: { required: true, type: "integer" },
},
{
label: "描述",
prop: "content",
type: "Tinymce",
width: "900px",
rules: { required: true },
},
],
modalHandles: [
{ label: "确认", type: "primary", handle: () => this.submit() },
],
},
};
},
activated() {
this.findAll();
},
methods: {
findAll() {
let data = {};
data.page = this.pageData.tablePage.currentPage;
data.limit = this.pageData.tablePage.pageSize;
this.$api.getFootprintLineList(data).then((res) => {
this.pageData.tablePage.pageTotal = res.data.page.totalCount;
this.pageData.tableData = res.data.page.list;
});
},
clearObj() {
for (let item in this.modalSetting.modalData) {
this.modalSetting.modalData[item] = "";
}
},
clearValidate() {
this.$nextTick(() => {
this.$refs.modal.$refs.modalFormRef.clearValidate();
});
},
handleSelectChange(val) {
this.pageData.selectList = val;
},
submit() {
let data = JSON.parse(JSON.stringify(this.modalSetting.modalData));
data.score = Number(data.score);
let type = this.modalSetting.modalConfig.title;
if (type === "添加") {
this.$api.saveFootprintLine(data).then((res) => {
this.modalSetting.modalConfig.show = false;
this.findAll();
});
} else {
this.$api.updateFootprintLine(data).then((res) => {
this.modalSetting.modalConfig.show = false;
this.findAll();
});
}
},
del(id) {
let data;
if (id) {
data = [id];
} else {
data = this.pageData.selectList.map((item) => item.footprintLineId);
}
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$api.deleteFootprintLine(data).then((res) => {
this.findAll();
});
})
.catch(() => {});
},
},
};
</script>

View File

@ -1,59 +0,0 @@
<!--
* @author: ym
* @Date: 2021-10-10 13:45:17
* @LastEditTime: 2022-01-19 14:05:06
* @LastEditors: Please set LastEditors
* @Description:
* @FilePath: \background-front-end\src\views\modules\integral\agreement\reminder.vue
-->
<template>
<div :key="check">
<notice/>
<Tinymce
v-model="tinymceData.content"
placeholder="请输入表单描述"
/>
<div style="padding:20px 0">
<el-button type="primary" @click="save">保存</el-button>
</div>
</div>
</template>
<script>
import notice from '@/components/tinymce/notice.vue'
import Tinymce from "@/components/tinymce/index.vue";
export default {
components: {
Tinymce,
notice
},
activated() {
this.check=true;
this.find();
},
deactivated(){
this.check=false
},
data() {
return {
tinymceData: {
content: "",
},
footprintData: {},
check:true
};
},
methods: {
find() {
this.$api.getInteralAgreement(4).then((res) => {
this.footprintData = res.data.obj;
this.tinymceData.content = res.data.obj.ruleInfoContent;
});
},
save(){
this.$api.saveInteralAgreement(this.footprintData.ruleInfoId,this.tinymceData.content,this.footprintData.contentType)
}
},
};
</script>

View File

@ -1,413 +0,0 @@
<template>
<div>
<el-dialog
:title="!!dataForm.footprintTypeId ? '编辑' : '新增'"
:close-on-click-modal="false"
:visible.sync="visible"
width="1000px"
fullscreen
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="120px"
>
<el-form-item label="景点名称:" prop="footprintName">
<el-input
v-model="dataForm.footprintName"
placeholder="请输入景点名称"
></el-input>
</el-form-item>
<el-form-item label="景点图片:" prop="images">
<el-upload
class="upload-demo"
:action="$uploadUrl"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList"
drag
:on-success="(res, file) => handleAvatarSuccess(res, file)"
list-type="picture"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-form-item>
<!-- <el-form-item label="景点介绍:" prop="footprintContent">
<el-input
type="textarea"
:rows="8"
placeholder="请描述景点概况"
v-model="dataForm.footprintContent"
>
</el-input>
<span style="float: right;color: #909399;margin-right: 15px;">{{}}</span>
</el-form-item> -->
<el-form-item label="景点等级:" prop="footprintGrade">
<el-select
v-model="dataForm.footprintGrade"
>
<el-option
v-for="op in [{label:'市级景点',value:1},{label:'省级景点',value:2},{label:'国家景点',value:3}]"
:label="op.label"
:value=" op.value"
:key="op.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="所在省市:" prop="pos">
<el-cascader
v-model="dataForm.pos"
:options="cc"
filterable
:props="{
expandTrigger: 'hover',
checkStrictly: false
}
"
></el-cascader>
<!-- <el-input
v-model="dataForm.city"
placeholder="请输入景点所在城市"
></el-input> -->
</el-form-item>
<el-form-item label="详细地址:" prop="address">
<el-input
v-model="dataForm.address"
placeholder="请输入景点详细地址"
></el-input>
</el-form-item>
<el-form-item label="联系电话:" prop="cellphone">
<el-input
v-model="dataForm.cellphone"
placeholder="请输入景点联系电话"
></el-input>
</el-form-item>
<el-form-item label="参观价格:" prop="ticketPrice">
<!-- <el-input-number placeholder="请输入景点参观票价" v-model="dataForm.ticketPrice" :controls="false" ></el-input-number> -->
<el-input
v-model="dataForm.ticketPrice"
placeholder="请输入景点参观票价"
></el-input>
</el-form-item>
<el-form-item label="开放时间:" prop="openTime">
<el-input
v-model="dataForm.openTime"
placeholder="请输入景点开放具体时间"
></el-input>
</el-form-item>
<el-form-item label="所属支线:" prop="footprintLineId">
<div style="display:flex">
<el-input
:disabled="true"
v-model="dataForm.footprintLineName"
placeholder=""
></el-input>
<el-button type="primary" size="small" style="margin-left:35px;height:40px" @click="$refs.footPrintLineModal.modalConfig.show=true">选择支线</el-button>
<el-button size="small" style="margin-left:35px;height:40px" @click="dataForm.footprintLineId=''">清空</el-button>
</div>
</el-form-item>
<el-form-item label="选择类型:" prop="footprintTypeId">
<el-select
v-model="dataForm.footprintTypeId"
placeholder="请选择景点分类"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<div style="display: flex">
<el-form-item label="经度:" prop="longitude">
<el-input disabled v-model="dataForm.longitude" placeholder=""></el-input>
</el-form-item>
<el-form-item label="纬度:" prop="latitude">
<el-input disabled v-model="dataForm.latitude" placeholder=""></el-input>
</el-form-item>
<el-button icon="el-icon-position" type="primary" size="small" style="margin-left:35px;height:40px" @click="openMap()">定位</el-button>
</div>
<el-form-item label="是否有VR打卡:" prop="hasVr">
<el-switch v-model="dataForm.hasVr"></el-switch>
</el-form-item>
<footprint-vr-table v-if="dataForm.hasVr==true" v-model="dataForm.vrList"/>
<!-- VR全景图 start-->
<!-- VR全景图 end-->
<el-form-item label="景点介绍:" prop="footprintContent">
<tinymce v-model="dataForm.footprintContent"></tinymce>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
<!-- 地图组件 -->
<punch-in-map v-if="mapVisible" ref="punchInMap"
@refreshMapIp="refreshMapIp" @getPos="getPos"></punch-in-map>
</el-dialog>
<footPrintLineModal :form="dataForm" ref="footPrintLineModal" />
</div>
</template>
<script>
import footPrintLineModal from './components/footprint-line-modal.vue'
import PunchInMap from "./punch-in-map.vue"
import tinymce from '../../../components/tinymce/index.vue';
import cc from '../../../utils/country-level2-data'
import FootprintVrTable from './components/footprint-vr-table.vue';
export default {
components: {
PunchInMap,
tinymce,
footPrintLineModal,
FootprintVrTable
},
data() {
return {
mapVisible: false,
visible: false,
//
options: [],
fileList: [],
footprintId: "",
dataForm: {
footprintName: "",
footprintContent: "",
address: "",
cellphone: "",
ticketPrice:'0',
openTime: "",
longitude: "",
latitude: "",
footprintLineId:'',
images: "",
footprintTypeId: "",
city: "",
userId: "",
footprintGrade:'',
//VR
hasVr:false,
//
vrList:[]
},
dataRule: {
footprintName: [
{ required: true, message: "景点名称不能为空", trigger: "blur" },
{ max: 30, message: "长度不能超过30", trigger: "blur" },
],
ticketPrice:[{required:true,message:'请输入参观价格'},
{ type: 'string', pattern:/^[+-]?(0|([1-9]\d*))(\.\d+)?$/g,message: '请输入数字类型的数据', trigger: 'change' }
],
images:{required:true,message:'景点图片必须上传'},
footprintContent: [
{ required: true, message: "景点介绍不能为空", trigger: "blur" },
],
address: [
{ required: true, message: "地址不能为空", trigger: "blur" },
{ max: 30, message: "长度不能超过50", trigger: "blur" },
],
openTime: [
{ required: true, message: "开放时间不能为空", trigger: "blur" },
{ max: 50, message: "字数超过限制", trigger: "blur" },
],
footprintTypeId: [
{ required: true, message: "景点类型不能为空", trigger: "blur" },
],
pos: [
{ required: true, message: "所在省市不能为空", trigger: "blur" },
],
footprintGrade:{required:true,message:'景点等级不能为空'},
longitude:{required:true,message:'经度不能为空'},
latitude:{required:true,message:'纬度不能为空'}
},
cc:cc,
tempKey: -666666, // key, tree. #
};
},
computed: {
userId: {
get() {
return this.$store.state.user.id;
},
},
},
mounted() {
//
this.getFootprintTypeList();
console.log(this.dataForm);
},
methods: {
//
async getFootprintTypeList() {
let list = await this.$api.getFootprintTypeList();
console.log("当前景点分类列表", list.data.list);
for (var i = 0; i < list.data.list.length; i++) {
var obj = new Object();
obj.value = list.data.list[i].footprintTypeId;
obj.label = list.data.list[i].footprintTypeName;
this.options.push(obj);
}
},
//
async init(id) {
this.fileList = [];
if (id == null) {
this.commonUtil.clearObj(this.dataForm); //modalData
this.footprintId = "";
// console.log("545456565");
Object.keys(this.dataForm).forEach((key) => {
this.dataForm[key] = "";
});
this.dataForm.ticketPrice='0'
this.dataForm.hasVr=false;
this.dataForm.vrList=[{title:"",info:"",url:""}];
} else {
this.footprintId = id + "";
var obj = await this.$api.getFootprintInfo(this.footprintId);
this.dataForm.footprintName = obj.data.redFootprint.footprintName;
this.dataForm.footprintContent = obj.data.redFootprint.footprintContent;
this.dataForm.address = obj.data.redFootprint.address;
this.dataForm.cellphone = obj.data.redFootprint.cellphone;
this.dataForm.ticketPrice = obj.data.redFootprint.ticketPrice+'';
this.dataForm.openTime = obj.data.redFootprint.openTime;
this.dataForm.longitude = obj.data.redFootprint.longitude;
this.dataForm.latitude = obj.data.redFootprint.latitude;
this.dataForm.images = obj.data.redFootprint.images;
this.dataForm.footprintGrade=obj.data.redFootprint.footprintGrade
// this.dataForm.city = obj.data.redFootprint.city;
this.dataForm.pos = [obj.data.redFootprint.province,obj.data.redFootprint.city];
this.dataForm.footprintTypeId = obj.data.redFootprint.footprintTypeId;
let list = obj.data.redFootprint.images.split(",");
//vr
this.dataForm.hasVr=obj.data.redFootprint.hasVr;
//vr
if(this.dataForm.hasVr==true){
this.dataForm.vrList=obj.data.redFootprint.vrList;
}else{
this.dataForm.vrList=[{title:"",info:"",url:""}];
}
// [
// {
// title: "1",
// isEdit: false,
// info: "1",
// url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F4k%2Fs%2F02%2F2109242332225H9-0-lp.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1664628119&t=5cb5d6c78e078d4d467fba5bc433c123",
// },
// {
// title: "2",
// isEdit: false,
// info: "1",
// url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F4k%2Fs%2F02%2F2109242332225H9-0-lp.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1664628119&t=5cb5d6c78e078d4d467fba5bc433c123",
// },
// {
// title: "1",
// isEdit: false,
// info: "1",
// url: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F4k%2Fs%2F02%2F2109242332225H9-0-lp.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1664628119&t=5cb5d6c78e078d4d467fba5bc433c123",
// },
// ];
for (let i = 0; i < list.length&&list[i]!==''; i++) {
var fileObj = {};
fileObj["url"] = list[i];
this.fileList.push(fileObj);
}
}
this.$forceUpdate();
this.visible = true;
this.$nextTick(()=>{
this.$refs.dataForm.clearValidate()
})
},
//
dataFormSubmit() {
//
this.dataForm.images = "";
for (var i = 0; i < this.fileList.length; i++) {
this.dataForm.images = this.dataForm.images + this.fileList[i].url;
if (i < this.fileList.length - 1)
this.dataForm.images = this.dataForm.images + ",";
}
this.dataForm.userId = this.userId;
this.dataForm.province=this.dataForm.pos&&this.dataForm.pos[0]
this.dataForm.city=this.dataForm.pos&&this.dataForm.pos[1]
//vrJSON
this.dataForm.vrJson=JSON.stringify(this.dataForm.vrList);
console.log(this.dataForm);
this.$refs["dataForm"].validate(async (valid) => {
if (valid) {
if (this.footprintId === "" || this.footprintId.length <= 0) {
this.$api.saveNewFootprint(this.dataForm).then(res=>{
this.visible = false;
this.$emit('refreshDataList')
});
} else {
this.dataForm['footprintId'] = this.footprintId;
this.$api.editFootprint(this.dataForm).then(res=>{
this.visible = false;
this.$emit('refreshDataList')
});
}
}
});
},
//
handleRemove(file, fileList) {
for (var i = 0; i < this.fileList.length; i++) {
if (this.fileList[i].url == file.url) {
this.fileList.splice(i, 1);
}
}
console.log(file.url);
},
handlePreview(file) {
console.log(file);
},
handleAvatarSuccess(res, file) {
var imageObj = {};
imageObj["url"] = file.response.url;
this.fileList.push(imageObj);
},
//
openMap(){
this.mapVisible = true;
if(this.dataForm.longitude&&this.dataForm.latitude){
this.$refs.punchInMap.center=[this.dataForm.longitude,this.dataForm.latitude]
}
this.$nextTick(() => {
this.$refs.punchInMap.init();
});
// console.log(3231213)
},
refreshMapIp(){
console.log(3231213)
},
//
getPos(data){
// console.log(data)
this.dataForm.longitude=data[0]
this.dataForm.latitude=data[1]
}
},
};
</script>
<style lang="scss" scope>
</style>

View File

@ -1,473 +0,0 @@
<!--
* @Author: ym
* @Date: 2021-09-21 12:30:58
* @LastEditTime: 2022-04-15 21:50:41
* @LastEditors: chenkangxu
* @Description: In User Settings Edit
* @FilePath: \piecework-treasure\src\views\modules\human-management\person-management\person-management.vue
-->
<template>
<div class="mod-role">
<el-form
:inline="true"
:model="dataForm"
@keyup.enter.native="searchtablelist()"
>
<el-form-item
label="搜索" label-width="100px">
<el-input
size="mini"
v-model="dataForm.searchName"
placeholder="搜索景点名称/城市地址"
clearable
></el-input>
</el-form-item>
<!-- 景点类型筛选 -->
<el-form-item label="景点类型" label-width="100px">
<el-select
clearable
size="mini"
v-model="dataForm.footprintTypeId"
placeholder="请选择景点分类"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<!-- 景点等级筛选 -->
<el-form-item label="景点等级" label-width="100px">
<el-select
clearable
size="mini"
v-model="dataForm.footprintGrade"
placeholder="请选择景点等级"
>
<el-option
v-for="item in [{label:'市级景点',value:1},{label:'省级景点',value:2},{label:'国家景点',value:3}]"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<!-- 日期选择器 -->
<el-form-item label="创建日期" label-width="100px">
<div class="block">
<el-date-picker
size="mini"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
v-model="dataForm.timeValue"
type="datetimerange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
>
</el-date-picker>
</div>
</el-form-item>
<el-form-item>
<el-button type="primary" size="mini" @click="searchtablelist()">查询</el-button>
<el-button type="warning" size="mini" @click="clearData()">重置</el-button>
</el-form-item>
</el-form>
<el-button
type="primary"
@click="addOrUpdateHandle()"
style="marginBottom: 20px"
>新增打卡地</el-button
>
<el-button
type="danger"
@click="deleteBatch()"
:disabled="pageData.selectList.length <= 0"
>批量删除</el-button
>
<obj-table
:loading="loading"
:isSelection="true"
:isIndex="false"
:isPagination="true"
:isHandle="true"
:tableCols="pageData.tableCols"
:tableHandles="pageData.tableHandles"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
@handleCurrentChange="searchtablelist()"
@selectChange="selectChange"
@handleSizeChange="searchtablelist()"
></obj-table>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="searchtablelist"
></add-or-update>
<!-- 景点详情显示 -->
<el-dialog title="打卡地详情" :visible.sync="detailVisible" width="60%">
<el-form label-width="120px">
<el-form-item label="景点名称:">
<el-input
v-model="footprintDetail.footprintName"
:readonly="true"
></el-input>
</el-form-item>
<el-form-item label="景点图片:">
<div style="display: flex">
<div
v-for="(item, index) in footprintDetail.images"
:key="index"
:style="{
width: '90px',
height: '90px',
backgroundImage: 'url(' + item + ')',
backgroundSize: 'cover',
marginLeft: '10px',
}"
@click="shopPicture(item)"
></div>
</div>
</el-form-item>
<el-form-item label="景点介绍:">
<div
class="rich_text_info"
v-html="footprintDetail.footprintContent"></div>
</el-form-item>
<el-form-item label="详细地址:">
<el-input
v-model="footprintDetail.address"
:readonly="true"
></el-input>
</el-form-item>
<el-form-item label="联系电话:">
<el-input
v-model="footprintDetail.cellphone"
:readonly="true"
></el-input>
</el-form-item>
<el-form-item label="参观票价:">
<el-input
v-model="footprintDetail.ticketPrice"
:readonly="true"
></el-input>
</el-form-item>
<el-form-item label="开放时间:">
<el-input
v-model="footprintDetail.openTime"
:readonly="true"
></el-input>
</el-form-item>
<el-form-item label="上次修改时间:">
<el-input
v-model="footprintDetail.updateTime"
:readonly="true"
></el-input>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import AddOrUpdate from "./punch-in-add-or-update";
import objTable from "../../../components/common/table/custable.vue";
export default {
components: {
AddOrUpdate,
objTable,
},
data() {
return {
//
loading:false,
dataForm: {
footprintTypeId: "",
searchName: "",
timeValue: "",
footprintGrade:''
},
addOrUpdateVisible: false,
detailVisible: false,
pickerOptions: {
shortcuts: [
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
},
},
],
},
options: [],
//
footprintDetail: {},
pageData: {
tableData: [],
// end
selectList: [], //
//start
tablePage: {
currentPage: 1,
pageSize: 10,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50, 100],
},
//end
//start
tableCols: [
{ label: "景点名称", prop: "footprintName", align: "center",fixed:"left",width:"200px" },
{ label: "景点图片", prop: "images", align: "center", type: "elImage",limit:1 },
{
label: "修改时间",
prop: "updateTime",
align: "center",
width:"160px"
},
{
label: "详细地址",
prop: "address",
align: "center",
width: "280px",
},
{
label: "联系电话",
prop: "cellphone",
align: "center",
width: "150px",
},
{
label: "参观票价",
prop: "ticketPrice",
align: "center",
width: "100px",
},
{ label: "开放时间", prop: "openTime", align: "center" },
{
label: "景点类型",
prop: "footprintTypeName",
align: "center",
width: "120px",
},
{
label: "操作",
prop: "operation",
align: "center",
type: "button",
width: "210px",
fixed:"right",
btnList: [
{
label: "详情",
type: "text",
handle: (row) => this.showDetail(row.footprintId),
},
{
label: "编辑",
type: "text",
handle: (row) => this.addOrUpdateHandle(row.footprintId),
},
{
label: "删除",
type: "text",
handle: (row) => this.deleteOne(row),
},
],
},
],
},
};
},
activated() {
//
this.getFootprintTypeList();
//
this.searchtablelist();
},
computed: {},
methods: {
//
async getFootprintTypeList() {
let list = await this.$api.getFootprintTypeList();
console.log("当前景点分类列表", list.data.list);
let arr=[]
for (var i = 0; i < list.data.list.length; i++) {
var obj = new Object();
obj.value = list.data.list[i].footprintTypeId;
obj.label = list.data.list[i].footprintTypeName;
arr.push(obj);
}
this.options=arr
},
// /
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
//
async searchtablelist() {
this.loading=true;
// get
var dataParams = {};
dataParams["page"] = this.pageData.tablePage.currentPage;
dataParams["limit"] = this.pageData.tablePage.pageSize;
dataParams["searchName"] = this.dataForm.searchName;
dataParams["footprintTypeId"] = this.dataForm.footprintTypeId;
dataParams["startTime"] = this.dataForm.timeValue[0];
dataParams["endTime"] = this.dataForm.timeValue[1];
dataParams['footprintGrade']=this.dataForm.footprintGrade
console.log("123212231231312123", dataParams);
let res = await this.$api.getFootPrintByParams(dataParams);
this.pageData.tableData = res.data.page.list;
this.pageData.tablePage.currentPage = res.data.page.currPage;
this.pageData.tablePage.pageTotal = res.data.page.totalCount;
//
for (let i = 0; i < this.pageData.tableData.length; i++) {
var list = this.pageData.tableData[i].images.split(",");
this.pageData.tableData[i].images = list;
this.pageData.tableData[i].ticketPrice =
this.pageData.tableData[i].ticketPrice + "元/人";
if (this.pageData.tableData[i].footprintContent.length > 40) {
this.pageData.tableData[i].footprintContent =
this.pageData.tableData[i].footprintContent.substring(0, 40) +
" ···";
}
if (this.pageData.tableData[i].cellphone === "") {
this.pageData.tableData[i].cellphone = "暂无";
}
}
this.loading=false;
},
resetSearch() {
this.commonUtil.clearObj(this.pageData.queryData);
this.searchtablelist();
},
//
deleteOne(row) {
this.$msgbox({
title: "确认删除该打卡点吗?",
message: "此操作将永久删除",
showCancelButton: true,
confirmButtonText: "确定",
cancelButtonText: "取消",
callback: async (action) => {
if (action === "confirm") {
let array = new Array();
array.push(row.footprintId);
// console.log("111111111111111111111111111111111111111111sadasdasd",array)
await this.$api.deleteFootprintList(array);
// console.log(res);
this.$message({
type: "success",
message: "删除成功!",
});
this.searchtablelist();
} else {
this.$message({
type: "info",
message: "已取消删除",
});
}
},
});
},
//
deleteBatch() {
// console.log("",this.pageData.selectList);
this.$msgbox({
title: "确认删除选中的打卡点吗?",
message: "此操作将永久删除",
showCancelButton: true,
confirmButtonText: "确定",
cancelButtonText: "取消",
callback: async (action) => {
if (action === "confirm") {
let array = new Array();
for (var i = 0; i < this.pageData.selectList.length; i++) {
array.push(this.pageData.selectList[i].footprintId);
}
// console.log("1232122312313121233232234234234",array)
await this.$api.deleteFootprintList(array);
// console.log(res);
this.$message({
type: "success",
message: "删除成功!",
});
this.searchtablelist();
} else {
this.$message({
type: "info",
message: "已取消删除",
});
}
},
});
},
//
selectChange(rows) {
this.pageData.selectList = rows;
},
//
getRoles() {},
//
clearData() {
(this.dataForm.timeValue = ""),
(this.dataForm.footprintTypeId = ""),
(this.dataForm.searchName = "");
this.dataForm.footprintGrade=''
},
//
async showDetail(footprintId) {
this.detailVisible = true;
console.log(footprintId);
var obj = await this.$api.getFootprintInfo(footprintId);
this.footprintDetail = obj.data.redFootprint;
var list = this.footprintDetail.images.split(",");
this.footprintDetail.images = list;
this.footprintDetail.ticketPrice =
this.footprintDetail.ticketPrice + "元/人";
},
},
};
</script>
<style lang='scss' scoped>
.rich_text_info{
width:100%;height:500px;overflow-y:scroll;margin:20px 0;
}
</style>

View File

@ -1,208 +0,0 @@
<template>
<el-dialog
title="定位"
:visible.sync="dialogVisible"
width="80%"
:close-on-click-modal="false"
:modal="false"
:before-close="handleClose"
>
<div>
<div class="amap-page-container">
<el-amap-search-box
ref="searchBox"
class="search-box"
:search-option="searchOption"
:on-search-result="onSearchResult"
></el-amap-search-box>
<el-amap
class="amap-wrapper"
ref="map"
vid="amapDemo"
:amap-manager="amapManager"
:center="center"
:zoom="zoom"
:plugin="plugin"
:events="events"
>
<el-amap-marker :position="center"></el-amap-marker>
</el-amap>
<!-- 展示经纬度 -->
<div class="pos-contain">
<div class="pos longitude">经度:{{ center[0] }}</div>
<div class="pos latitude">纬度:{{ center[1] }}</div>
</div>
</div>
</div>
<!-- 确定按钮 -->
<div style="display: flex; justify-content: end">
<el-button type="primary" style="margin-top: 20px" @click="handleClick"
>确认</el-button
>
</div>
</el-dialog>
</template>
<script>
//
import { AMapManager } from "vue-amap";
let amapManager = new AMapManager();
let Geocoder; //
export default {
data() {
let self = this;
return {
dialogVisible: false,
amapManager,
zoom: 12,
input: "",
markers: [],
searchOption: {
city: "全国",
},
center: [120.19, 30.26],
events: {
init: (o) => {
// Geocoder=o
o.getCity((result) => {
// console.log(result);
});
},
moveend: () => {},
zoomchange: () => {},
click: (e) => {
self.center = [e.lnglat.lng, e.lnglat.lat];
console.log(self.center)
// console.log(Geocoder);
Geocoder.getAddress(self.center, function (status, result) {
//
// console.log(status === "complete" && result.info === "OK")
if (status === "complete" && result.info === "OK") {
self.input = result.regeocode.formattedAddress;
self.$refs.searchBox.keyword = self.input;
}
});
},
},
plugin: [
{
pName: "Geocoder", //使AMap.Geocoder
events: {
init(o) {
Geocoder = o; // o AMap.Geocoder Geocoder使
//self.center function
o.getAddress(self.center, function (status, result) {
if (status === "complete" && result.info === "OK") {
//result.regeocode.formattedAddress
self.input = result.regeocode.formattedAddress;
//input
self.$refs.searchBox.keyword = self.input;
}
});
},
},
},
{
showMarker: true, //true
pName: "Geolocation", // AMap-Geolocation
events: {
init(o) {
//getCurrentPosition
// data()center
o.getCurrentPosition((status, result) => {
// console.log('11111,',result.position)
if (result && result.position) {
let lng = result.position.lng;
let lat = result.position.lat;
self.center = [lng, lat];
self.loaded = true;
self.zoom = 14;
Geocoder.getAddress(self.center, function (status, result) {
//
// console.log(status === "complete" && result.info === "OK")
if (status === "complete" && result.info === "OK") {
self.input = result.regeocode.formattedAddress;
self.$refs.searchBox.keyword = self.input;
}
});
self.$nextTick();
}
});
},
},
},
],
};
},
methods: {
init() {
this.dialogVisible = true;
// this.$emit("refreshMapIp");
},
handleClose(done) {
this.$confirm("确认关闭?")
.then((_) => {
done();
})
.catch((_) => {});
},
//
onSearchResult(pois) {
// console.log(this.input)
console.log(document.querySelector(".search-box-wrapper input").value);
// this.input = document.querySelector(".search-box-wrapper input").value;
console.log(pois);
//
// console.log(pois)
this.center = [pois[0].lng, pois[0].lat];
},
//
handleClick() {
this.$emit("getPos", this.center);
this.dialogVisible = false;
},
},
};
</script>
<style lang="scss" scoped>
.amap-wrapper {
width: 100%;
height: 900px;
}
.amap-page-container {
position: relative;
}
.search-box {
position: absolute;
top: 20px;
left: 20px;
}
.pos-contain {
position: absolute;
bottom: 21.5px;
left: 60px;
}
.pos {
background: #fff;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15);
border-radius: 2px 3px 3px 2px;
// width: 80px;
padding: 6px 6px;
// height: 40px;
// line-height: 40px;
text-align: center;
font-size: 18px;
float: left;
}
.latitude {
// left:120px;
margin-left: 20px;
}
</style>

View File

@ -1,400 +0,0 @@
<!--
* @Author: cwl
* @Date: 2021-12-20 16:20:14
* @LastEditTime: 2022-04-16 19:35:51
* @LastEditors: chenkangxu
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\views\modules\integral-statistics\integral-detail.vue
-->
<template>
<div class="_tablepage">
<searchForm
ref="searchForm"
:searchForm="pageData.searchForm"
:searchData="pageData.queryData"
:searchHandle="pageData.searchHandle"
>
</searchForm>
<cusTable
:loading="loading"
:isIndex="true"
:isPagination="true"
:isHandle="true"
:tableCols="pageData.tableCols"
:tableHandles="pageData.tableHandles"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
@handleCurrentChange="searchTableList"
@selectChange="selectChange"
@handleSizeChange="searchTableList"
></cusTable>
<modal
ref="modalRef"
:modalConfig="pageData.modalConfig"
:modalForm="pageData.modalForm"
:modalData="pageData.modalData"
:modalHandles="pageData.modalHandles"
@closeModal="closeModal()"
>
<paper slot="dialog__content" :paper="paper" :problemList="problemList" />
</modal>
</div>
</template>
<script>
import modal from "../../../components/common/modal/modal.vue";
import searchForm from "../../../components/common/searchform/searchForm.vue";
import cusTable from "../../../components/common/table/custable.vue";
export default {
components: { searchForm, cusTable, modal },
data() {
return {
//
loading:false,
typeList: [],
pageData: {
// start
searchForm: [
{ type: "Input", label: "姓名", prop: "name" },
{ type: "Input", label: "红色护照号", prop: "redPassportNumber" },
{ type: "Input", label: "手机号", prop: "cellphone" },
],
// end
// start
queryData: {
name: "",
redPassportNumber: "",
cellphone: '',
},
// end
//start
searchHandle: [
{
label: "查询",
type: "primary",
handle: () => {
this.$refs.searchForm.$refs.searchFormRef.validate(valid=>{
if (valid) {
this.searchTableList()
} else {
// console.log('error submit!!');
return false;
}
})
},
auth: "reportDatasource_search",
},
{
label: "重置",
type: "warning",
handle: () => this.resetSearch(),
auth: "reportDatasource_search",
},
],
//end
//start
tableData: [],
//end
// start
tableHandles: [
{label:'导出Excel',type:'primary',handle:()=>{
// console.log(document.querySelector("#table1"))
// document.querySelector("#cesTable")
// obj
var obj = {};
Object.assign(obj, this.pageData.queryData, this.pageData.tablePage);
obj.page = 1;
obj.limit = 99999;
delete obj["pageSizeRange"];
this.$api.getIntegralDetail(obj).then((res) => {
this.$exportExcel(res.data.page.list,this.pageData.tableCols);
});
}}
// {
// label: "",
// type: "primary",
// handle: () => this.showModal(this.commonConstants.modalType.insert),
// auth: "reportDatasource_insert",
// },
// {
// label: "",
// type: "danger",
// handle: () => this.deleteBatch(),
// auth: "reportDatasource_batchDelete",
// },
],
// end
selectList: [], //
//start
tablePage: {
currentPage: 1,
pageSize: 5,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50],
},
//end
//start
tableCols: [
{ label: "姓名", prop: "name", align: "center" },
{ label: "红色护照号", prop: "redPassportNumber", align: "center" },
{ label: "性别", prop: "sex", align: "center" },
{ label: "联系电话", prop: "cellphone", align: "center" },
{ label: "地址/所在地", prop: "address", align: "center" },
{ label: "今日积分", prop: "todayScore", align: "center" },
{ label: "总积分", prop: "integral", align: "center" },
{ label: "红星币", prop: "starCoin", align: "center" },
{ label: "等级", prop: "levelType", align: "center",type:'html',html:(row)=>{
let i=0;
let str='';
let url=require('../../../assets/images/badge.png')
while(i<row.levelType){
str+= `<div style="vertical-align:top;display:inline-block;width:20px;height:20px;background:url(${url});background-size:100% 100%"></div>`
i++
}
return str;
}
},
// {
// label: "",
// align: "center",
// type: "button",
// fixed: "right",
// btnList: [
// {
// label: "",
// type: "text",
// auth: "reportDatasource_update",
// handle: (row) =>
// this.showModal(this.commonConstants.modalType.update, row),
// },
// {
// label: "",
// type: "text",
// auth: "reportDatasource_delete",
// handle: (row) => this.deleteOne(row.contentInfoId),
// },
// ],
// },
],
//end
//modal start
modalConfig: {
title: "新增", //,:
show: false, //
formEditDisabled: false, //
width: "80vw", //
modalRef: "modalRef", //modal
type: "1", // 1 2 3
},
//modal end
//modal start
modalForm: [
],
//modal end
//modal start
modalData: {
userId: "",
name: "",
},
//modal end
//modal start
modalHandles: [
{ label: "取消", type: "default", handle: () => this.closeModal() },
{ label: "提交", type: "primary", handle: () => this.save() },
],
//modal end
GradeList:[],//
},
paper:{},
problemList:[],//
};
},
activated() {
this.searchTableList();
},
methods: {
/**
* @description: 获取表格数据
* @param {type}
* @return:
* @author: ym
*/
searchTableList() {
this.loading=true;
// obj
var obj = {};
Object.assign(obj, this.pageData.queryData, this.pageData.tablePage);
obj.page = this.pageData.tablePage.currentPage;
obj.limit = this.pageData.tablePage.pageSize;
delete obj["pageSizeRange"];
//
this.$api.getIntegralDetail(obj).then((res) => {
this.paper=res.data.data
this.commonUtil.tableAssignment(
res.data.page,
this.pageData.tablePage,
this.pageData.tableData
);
})
.finally(()=>{
this.loading=false;
})
},
//
resetSearch() {
this.commonUtil.clearObj(this.pageData.queryData);
this.searchTableList();
},
/**
* @description: modal显示
* @param {type} 类型 1新增2编辑 3详情
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
showModal(type, row) {
this.pageData.modalData.fileList = [];
this.problemList=row.problemList
this.commonUtil.showModal(this.pageData.modalConfig, type);
// if (type != this.commonConstants.modalType.insert) {
// this.pageData.modalForm[0].disabled = true;
// this.getDetail(row);
// } else {
// this.pageData.modalForm[0].disabled = false;
// }
},
/**
* @description: 获取详细数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
getDetail(row) {
this.pageData.modalData = JSON.parse(JSON.stringify(row));
},
/**
* @description: 关闭modal
* @param
* @return:
* @author: ym
*/
closeModal() {
// this.$refs["modalRef"].$refs["modalFormRef"].resetFields(); //
this.pageData.modalConfig.show = false; //modal
// this.commonUtil.clearObj(this.pageData.modalData); //modalData
},
/**
* @description: 保存数据
* @param {type}
* @return:
* @author: ym
*/
save() {
this.pageData.modalData.userId = this.$store.state.user.id;
this.$refs["modalRef"].$refs["modalFormRef"].validate((valid) => {
if (valid) {
let content = this.pageData.modalData;
if (
this.pageData.modalConfig.type ==
this.commonConstants.modalType.insert
) {
this.$api.giveTeacher(content).then((res) => {
this.searchTableList();
});
} else {
this.$api.updateRedTeacher(content).then((res) => {
this.searchTableList();
});
}
this.closeModal();
} else {
return false;
}
});
},
/**
* @description: 删除一条数据
* @param {id} 数据唯一标识
* @return:
* @author: ym
*/
deleteOne(id) {
let ids = [];
ids[0] = id;
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil
.showConfirm(obj)
.then(async () => {
await this.$api.deleteRedContentInfo(ids).then((res) => {
this.searchTableList();
});
})
.catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
},
/**
* @description: 批量删除
* @param {type}
* @return:
* @author: ym
*/
deleteBatch() {
const length = this.pageData.selectList.length;
if (length == 0) {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList(
"error.batchdelete.empty",
null
),
type: this.commonConstants.messageType.error,
});
} else {
let ids = [];
for (let i = 0; i < length; i++) {
ids.push("" + this.pageData.selectList[i].contentInfoId);
}
let obj = {
messageContent: this.commonUtil.getMessageFromList(
"confirm.delete",
null
),
};
this.commonUtil
.showConfirm(obj)
.then(() => {
this.$api.deleteRedContentInfo(ids).then((res) => {
this.searchTableList();
});
})
.catch(() => {
this.commonUtil.showMessage({
message: this.commonUtil.getMessageFromList("error.cancel", null),
type: this.commonConstants.messageType.info,
});
});
}
},
selectChange(rows) {
this.pageData.selectList = rows;
},
},
};
</script>

View File

@ -1,304 +0,0 @@
<!--
* @Author: cwl
* @Date: 2021-12-20 16:20:02
* @LastEditTime: 2022-04-16 19:33:04
* @LastEditors: chenkangxu
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\views\modules\integral-statistics\integral-overview.vue
-->
<template>
<div class="_tablepage">
<div class="title">
<div style="margin-bottom: 20px">数据说明</div>
<div>以下数据统计概览为当前账号所属教育局/学校下的学生积分概况</div>
</div>
<div class="ImpNumber">
<div class="ImpNumber-content">
<div style="font-size: 16px; margin-bottom: 5px">总用户数</div>
<div style="font-size: 16px; margin-bottom: 12px">
{{ statisticsData.userNumber }}
</div>
<div style="font-size: 14px">
用户数比较前一天上涨<span
:style="{
paddingLeft: '3px',
color:
Number(statisticsData.upUserPercent * 100).toFixed(2) > 0
? 'red'
: Number(statisticsData.upUserPercent * 100).toFixed(2) < 0
? 'green'
: '',
}"
>{{
Number(statisticsData.upUserPercent * 100).toFixed(2) + "%"
}}</span
>
</div>
<div
class="ImpNumber-content-img"
:style="{
background:
'url(' + require('../../../assets/images/totalUser.svg') + ')',
backgroundSize: '100% 100%',
}"
></div>
</div>
<div class="ImpNumber-content">
<div style="font-size: 16px; margin-bottom: 5px">今日活跃人数</div>
<div style="font-size: 16px; margin-bottom: 12px">
{{ statisticsData.todayActive }}
</div>
<div style="font-size: 14px">
活跃人数比较前一天上涨<span
:style="{
paddingLeft: '3px',
color:
Number(statisticsData.upActivePercent * 100).toFixed(2) > 0
? 'red'
: Number(statisticsData.upActivePercent * 100).toFixed(2) < 0
? 'green'
: '',
}"
>{{ Number(statisticsData.upActivePercent * 100).toFixed(2) }}</span
>
</div>
<div
class="ImpNumber-content-img"
:style="{
background:
'url(' + require('../../../assets/images/activeUser.svg') + ')',
backgroundSize: '100% 100%',
}"
></div>
</div>
<div class="ImpNumber-content">
<div style="font-size: 16px; margin-bottom: 20px">平均分</div>
<div style="font-size: 20px">
{{ Number(statisticsData.avgScore).toFixed(2) }}
</div>
<div
class="ImpNumber-content-img"
:style="{
background:
'url(' + require('../../../assets/images/average.svg') + ')',
backgroundSize: '100% 100%',
}"
></div>
</div>
<div class="ImpNumber-content" style="margin-right: 0px">
<div style="font-size: 16px; margin-bottom: 20px">最高分</div>
<div style="font-size: 20px">
{{ statisticsData.maxScore }}
</div>
<div
class="ImpNumber-content-img"
:style="{
background:
'url(' + require('../../../assets/images/upUser.svg') + ')',
backgroundSize: '100% 100%',
}"
></div>
</div>
</div>
<div id="chart" style="height: 400px; width: 100%"></div>
<div id="chart1" style="height: 400px; width: 100%"></div>
</div>
</template>
<script>
import * as echarts from "echarts";
import modal from "../../../components/common/modal/modal.vue";
import searchForm from "../../../components/common/searchform/searchForm.vue";
import cusTable from "../../../components/common/table/custable.vue";
export default {
components: { searchForm, cusTable, modal },
data() {
return {
statisticsData: {},
};
},
activated() {
this.findAll();
},
watch: {},
methods: {
findAll() {
this.$api.getIntegralOverview().then((res) => {
this.statisticsData = res.data.data;
this.initChart();
});
},
initChart() {
var chartDom = document.getElementById("chart");
var chartDom1 = document.getElementById("chart1");
var myChart = echarts.init(chartDom);
var myChart1 = echarts.init(chartDom1);
var option;
let xAxisData = [];
let seriesData = [];
let arr = this.statisticsData.activeUserList;
for (let i = 0; i < arr.length; i++) {
xAxisData.push(arr[i].date);
seriesData.push(arr[i].number);
}
let xAxisData1 = [];
let seriesData1 = [];
let arr1 = this.statisticsData.scoreList;
for (let i = 0; i < arr1.length; i++) {
xAxisData1.push(arr1[i].date);
seriesData1.push(arr1[i].score);
}
// console.log(xAxisData1,seriesData1)
option = {
xAxis: {
type: "category",
data: xAxisData,
},
yAxis: {
type: "value",
minInterval: 1,
},
title: [
{
left: "center",
text: "每日活跃人数",
},
],
tooltip: {
trigger: "axis",
},
grid: {
x: 30,
y: 40,
x2: 30,
y2: 45,
},
series: [
{
itemStyle: {
normal: {
color: "#E00000",
lineStyle: {
color: "#E00000",
},
},
},
data: seriesData,
type: "line",
smooth: true,
},
],
};
let option1 = {
xAxis: {
type: "category",
data: xAxisData1,
},
tooltip: {
trigger: "axis",
},
yAxis: {
type: "value",
minInterval: 1,
},
title: [
{
left: "center",
text: "每日发放积分",
},
],
grid: {
x: 30,
y: 40,
x2: 30,
y2: 45,
},
series: [
{
itemStyle: {
normal: {
color: "#E00000",
lineStyle: {
color: "#E00000",
},
},
},
data: seriesData1,
type: "line",
smooth: true,
},
],
};
option1 && myChart1.setOption(option1);
option && myChart.setOption(option);
},
},
};
</script>
<style lang="scss" scoped>
.title {
// height: 50px;
padding: 10px;
border: 1px solid #1e90ff;
color: rgb(100, 100, 100);
background-color: rgba(135, 206, 250, 0.2);
margin-bottom: 10px;
}
.ImpNumber {
width: 100%;
display: flex;
flex-wrap: wrap;
font-size: 0px;
margin-bottom: 15px;
.ImpNumber-content {
display: inline-block;
vertical-align: top;
padding: 20px;
margin: 10px;
margin-right: 20px;
background: rgb(250, 250, 250);
min-width: 250px;
position: relative;
color: rgb(100, 100, 100);
.detail {
padding-left: 20px;
position: relative;
color: #00bfff;
cursor: pointer;
.detail-table {
position: absolute;
height: 16px;
width: 200px;
// background: red;
padding-left: 10px;
left: 48px;
top: 0px;
display: none;
.detail-table-content {
position: relative;
z-index: 999;
top: -50px;
height: 500px;
width: 500px;
}
}
}
.detail:hover {
.detail-table {
display: block;
}
}
.ImpNumber-content-img {
position: absolute;
width: 50px;
height: 50px;
background: red;
right: 20px;
top: 18px;
// border-radius: 50%;
}
}
}
</style>

View File

@ -1,66 +0,0 @@
<!--
* @author: ym
* @Date: 2021-10-10 13:45:17
* @LastEditTime: 2022-01-02 19:53:23
* @LastEditors: Please set LastEditors
* @Description:
* @FilePath: \background-front-end\src\views\modules\integral\agreement\integralDescription.vue
-->
<template>
<div :key="check">
<notice/>
<Tinymce
v-model="tinymceData.content"
placeholder="请输入表单描述"
/>
<div style="padding:20px 0">
<el-button type="primary" @click="save">保存</el-button>
</div>
</div>
</template>
<script>
import notice from '@/components/tinymce/notice.vue'
import Tinymce from "@/components/tinymce/index.vue";
export default {
components: {
Tinymce,
notice
},
activated() {
this.check = true;
// console.log(this.check)
this.find();
},
deactivated() {
this.check = false;
// console.log(this.check)
},
data() {
return {
tinymceData: {
content: "",
},
integralData: {},
check: true,
};
},
methods: {
find() {
this.$api.getInteralAgreement(1).then((res) => {
this.integralData = res.data.obj;
this.tinymceData.content = res.data.obj.ruleInfoContent;
});
},
save() {
this.$api
.saveInteralAgreement(
this.integralData.ruleInfoId,
this.tinymceData.content,
this.integralData.contentType
)
},
},
};
</script>

View File

@ -1,64 +0,0 @@
<!--
* @author: ym
* @Date: 2021-10-10 13:45:17
* @LastEditTime: 2022-01-02 19:53:46
* @LastEditors: Please set LastEditors
* @Description:
* @FilePath: \background-front-end\src\views\modules\integral\agreement\redStarCoinDescription.vue
-->
<template>
<div :key="check">
<notice />
<Tinymce
v-model="tinymceData.content"
placeholder="请输入表单描述"
/>
<div style="padding:20px 0">
<el-button type="primary" @click="save">保存</el-button>
</div>
</div>
</template>
<script>
import notice from '@/components/tinymce/notice.vue'
import Tinymce from "@/components/tinymce/index.vue";
export default {
components: {
Tinymce,
notice
},
activated() {
this.check = true;
this.find();
},
deactivated() {
this.check = false;
},
data() {
return {
tinymceData: {
content: "",
},
integralData: {},
check: true,
};
},
methods: {
find() {
this.$api.getInteralAgreement(3).then((res) => {
this.integralData = res.data.obj;
this.tinymceData.content = res.data.obj.ruleInfoContent;
});
},
save() {
this.$api
.saveInteralAgreement(
this.integralData.ruleInfoId,
this.tinymceData.content,
this.integralData.contentType
)
},
},
};
</script>

View File

@ -1,59 +0,0 @@
<!--
* @author: ym
* @Date: 2021-10-10 13:45:17
* @LastEditTime: 2022-01-02 19:54:05
* @LastEditors: Please set LastEditors
* @Description:
* @FilePath: \background-front-end\src\views\modules\integral\agreement\reminder.vue
-->
<template>
<div :key="check">
<notice/>
<Tinymce
v-model="tinymceData.content"
placeholder="请输入表单描述"
/>
<div style="padding:20px 0">
<el-button type="primary" @click="save">保存</el-button>
</div>
</div>
</template>
<script>
import notice from '@/components/tinymce/notice.vue'
import Tinymce from "@/components/tinymce/index.vue";
export default {
components: {
Tinymce,
notice
},
activated() {
this.check=true;
this.find();
},
deactivated(){
this.check=false
},
data() {
return {
tinymceData: {
content: "",
},
integralData: {},
check:true
};
},
methods: {
find() {
this.$api.getInteralAgreement(2).then((res) => {
this.integralData = res.data.obj;
this.tinymceData.content = res.data.obj.ruleInfoContent;
});
},
save(){
this.$api.saveInteralAgreement(this.integralData.ruleInfoId,this.tinymceData.content,this.integralData.contentType)
}
},
};
</script>

View File

@ -1,417 +0,0 @@
<template>
<div>
<!-- 表格 -->
<cus-table
:loading="loading"
:isSelection="true"
:isIndex="true"
:isPagination="true"
:isHandle="true"
:tableCols="pageData.tableCols"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
:tableHandles="pageData.tableHandles"
@handleSizeChange="findAll()"
@handleCurrentChange="findAll()"
@selectChange="selectChange"
/>
<!-- dialog -->
<modal
:modalConfig="modalSetting.modalConfig"
:modalData="modalSetting.modalData"
:modalForm="modalSetting.modalForm"
:modalHandles="modalSetting.modalHandles"
labelWidth="140px"
ref="modal"
/>
</div>
</template>
<script>
import modal from "../../../components/common/modal/modal.vue";
import cusTable from "../../../components/common/table/custable.vue";
export default {
components: {
cusTable,
modal
},
activated() {
this.findAll();
},
data() {
return {
//
loading:false,
pageData: {
tableData: [], //
tableCols: [
//
// {
// label: "",
// prop: "ruleType",
// align: "center",
// formatter: (prop, row, codeType) =>
// this.getRuleType(prop, row, codeType),
// },
{
label: "规则详情",
prop: "ruleInfo",
align: "center",
},
{
label: "单次奖励积分数",
prop: "integral",
align: "center",
},
{
label: "上限奖励次数",
prop: "integralLimit",
align: "center",
},
{
label: "每日上限/分数",
align: "center",
prop:'integralAll'
},
{
label: "修改时间",
prop: "createTime",
align: "center",
},
{
label: "操作",
type: "button",
align: "center",
width: "150px",
btnList: [
{
label: "编辑",
type: "text",
size: "small",
handle: (row) => this.showDialog("edit", row),
},
{
label: "删除",
type: "text",
size: "small",
handle: (row) => this.deleteStarCoin(row.integralRuleId),
},
],
},
],
tablePage: {
currentPage: 1,
pageSize: 10,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50, 100],
}, //
tableHandles:[{
label:'添加',
type:'primary',
handle:()=>this.showDialog('add')
},
{
label:'批量删除',
type:'danger',
handle:()=>this.deleteStarCoin()
}]//
},
modalSetting: {
modalForm: [
{
label: "规则详情",
type: "Textarea",
prop: "ruleInfo",
rules: { required: true },
},
{
label: "规则类型",
type: "Select",
prop: "ruleType",
options: [
{
label: "登录",
value: 1,
},
{
label: "有效阅读资讯",
value: 2,
},
{
label: "有效观看视频",
value: 3,
},
{
label: "完成爱国主义学习并交卷",
value: 4,
},
{
label: "发表一次观点/评论",
value: 5,
},
{
label: "参加一次比赛/活动",
value: 6,
},
{
label: "打卡成功一次",
value: 7,
},
],
rules: { required: true },
},
{
label: "单次奖励积分数",
type: "Input",
prop: "integral",
rules: { type: "number" },
rules: { required: true },
},
{
label: "上限奖励次数",
type: "Input",
prop: "integralLimit",
rules: { type: "number" },
rules: { required: true },
},
],
baseModalForm1:[
{
label: "规则详情",
type: "Textarea",
prop: "ruleInfo",
rules: { required: true },
},
{
label: "规则类型",
type: "Select",
prop: "ruleType",
options: [
{
label: "登录",
value: 1,
},
{
label: "有效阅读资讯",
value: 2,
},
{
label: "有效观看视频",
value: 3,
},
{
label: "完成爱国主义学习并交卷",
value: 4,
},
{
label: "发表一次观点/评论",
value: 5,
},
{
label: "参加一次比赛/活动",
value: 6,
},
{
label: "打卡成功一次",
value: 7,
},
],
rules: { required: true },
},
{
label: "单次奖励积分数",
type: "Input",
prop: "integral",
rules: { type: "number" },
rules: { required: true },
},
{
label: "上限奖励次数",
type: "Input",
prop: "integralLimit",
rules: { type: "number" },
rules: { required: true },
},
],
baseModalForm2:[
{
label: "规则详情",
type: "Textarea",
prop: "ruleInfo",
rules: { required: true },
},
{
label: "规则类型",
type: "Select",
prop: "ruleType",
options: [
{
label: "登录",
value: 1,
},
{
label: "有效阅读资讯",
value: 2,
},
{
label: "有效观看视频",
value: 3,
},
{
label: "完成爱国主义学习并交卷",
value: 4,
},
{
label: "发表一次观点/评论",
value: 5,
},
{
label: "参加一次比赛/活动",
value: 6,
},
{
label: "打卡成功一次",
value: 7,
},
],
rules: { required: true },
},
{
label: "单次奖励积分数",
type: "Input",
prop: "integral",
rules: { type: "number" },
rules: { required: true },
}
],
modalData: {
ruleInfo: "",
ruleType: "",
integral: "",
integralLimit: "",
},
modalConfig: {
show: false,
title: "添加积分规则",
closeOnClick: true,
},
modalHandles: [
{
label: "确认",
type: "primary",
handle: () => this.onSubmit(),
},
],
},
};
},
methods: {
findAll() {
this.loading=true;
let params={}
params.page=this.pageData.tablePage.currentPage
params.limit=this.pageData.tablePage.pageSize
this.$api.getIntegralRule(params).then((res) => {
this.pageData.tableData=res.data.page.list
this.pageData.tablePage.pageTotal = res.data.page.totalCount;
this.loading=false;
});
},
//ruletyperuleTypeName
getRuleType(prop, row, codeType) {
if (row[prop] == 1) return "登录";
else if (row[prop] == 2) return "有效阅读资讯";
else if (row[prop] == 3) return "有效观看视频";
else if (row[prop] == 4) return "完成爱国主义学习并交卷";
else if (row[prop] == 5) return "发表一次观点/评论";
else if (row[prop] == 6) return "参加一次比赛/活动";
else if (row[prop] == 7) return "打卡成功一次";
else return "暂无";
},
//
selectChange(rows) {
this.pageData.selectList = rows;
},
showDialog(type, data) {
if (type === "add") {
this.modalSetting.modalForm=this.modalSetting.baseModalForm1;
this.modalSetting.modalConfig.show = true;
this.modalSetting.modalConfig.title = "添加积分规则";
if(this.$refs["modal"].$refs["modalFormRef"])
{
this.commonUtil.clearObj(this.modalSetting.modalData)
this.$nextTick(()=>{
this.$refs["modal"].$refs["modalFormRef"].clearValidate();
})
}
} else if (type === "edit") {
if(data.isOnly){
this.modalSetting.modalForm=this.modalSetting.baseModalForm2;
}
else{
this.modalSetting.modalForm=this.modalSetting.baseModalForm1;
}
this.modalSetting.modalConfig.show = true;
this.modalSetting.modalConfig.title = "编辑积分规则";
this.$nextTick(()=>{
this.modalSetting.modalData = JSON.parse(JSON.stringify(data));
})
}
},
add() {
this.$api.addIntegralRule(this.modalSetting.modalData).then((res) => {
this.modalSetting.modalConfig.show = false;
this.findAll();
});
},
update() {
this.$api
.updateIntegralRule(this.modalSetting.modalData)
.then((res) => {
this.modalSetting.modalConfig.show = false;
this.findAll();
});
},
onSubmit() {
this.$refs["modal"].$refs["modalFormRef"].validate((valid) => {
if (valid) {
if (this.modalSetting.modalConfig.title === "添加积分规则")
this.add();
else if (this.modalSetting.modalConfig.title === "编辑积分规则")
this.update();
} else {
return false;
}
});
},
deleteStarCoin(id) {
let data = [];
this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
if (id) {
data = [id];
} else {
data=this.pageData.selectList.map((item)=>{
return item.integralRuleId
})
}
this.$api.deleteIntegralRule(data).then((res) => {
if (res.data.msg === "success")
this.findAll()
});
})
.catch(() => {
});
},
},
};
</script>

View File

@ -1,136 +0,0 @@
<template>
<div>
<!-- 表格组件 -->
<cus-table
:isPagination="false"
:isHandle="true"
:tableCols="pageData.tableCols"
:tableData="pageData.tableData"
:isIndex="true"
:loading="loading"
/>
<!-- 编辑dialog -->
<el-dialog
title="编辑段位名称"
:visible.sync="dialogVisible"
width="40%"
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" label-width="100px">
<el-form-item label="段位名称">
<el-input v-model="form.levelTitle" />
</el-form-item>
<el-form-item label="段位等级">
<el-input v-model="form.levelType" />
</el-form-item>
<el-form-item label="段位描述">
<el-input v-model="form.levelDescribe" />
</el-form-item>
<el-form-item label="段位最低分">
<el-input v-model="form.underScore" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">保存</el-button>
<el-button @click="closeDialog">取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import cusTable from '../../../components/common/table/custable.vue'
import {findLevelType,savelevelType} from '../../../api/modules/intetral'
export default {
components:{
cusTable
},
activated(){
this.findAll()
},
data(){
return{
//
loading:false,
pageData:{
//
tableCols:[{
label:'段位等级',
prop:'levelType'
},
{
label:'段位名称',
prop:'levelTitle'
},
{
label:'创建时间',
prop:'createTime'
},
{
label:'更新时间',
prop:'updateTime'
},
{
label:'段位描述',
prop:'levelDescribe'
},
{
label:'段位最低分',
prop:'underScore'
},
{
label:'操作',
type:'button',
width:"55px",
btnList:[
{
label: "编辑",
type: "text",
size: "small",
handle: (row) => this.showDialog(row),
},
]
}],
//
tableData:[]
},
dialogVisible:false,
form:{//dialog
levelId:'',
levelTitle:'',
levelType:'',
levelDescribe:'',
underScore:''
}
}
},
methods:{
findAll(){
this.loading=true;
findLevelType().then(res=>{
this.pageData.tableData=res.data.page.list
this.loading=false
})
},
showDialog(data){
this.form.levelId=data.levelId
this.form.levelTitle=data.levelTitle
this.form.levelType=data.levelType
this.form.levelDescribe=data.levelDescribe
this.form.underScore=data.underScore
this.dialogVisible=true
},
onSubmit(){
savelevelType({...this.form}).then(res=>{
this.dialogVisible=false
this.findAll()
})
},
//
closeDialog() {
this.dialogVisible = false
}
}
}
</script>

View File

@ -1,289 +0,0 @@
<template>
<div>
<!-- 表格 -->
<cus-table
:loading="loading"
:isSelection="true"
:isIndex="true"
:isPagination="true"
:isHandle="true"
:tableCols="pageData.tableCols"
:tableData="pageData.tableData"
:tablePage="pageData.tablePage"
:tableHandles="pageData.tableHandles"
@handleSizeChange="findAll()"
@handleCurrentChange="findAll()"
@selectChange="selectChange"
/>
<!-- 弹窗 -->
<modal
:modalConfig="modalSetting.modalConfig"
:modalData="modalSetting.modalData"
:modalForm="modalSetting.modalForm"
:modalHandles="modalSetting.modalHandles"
labelWidth="140px"
ref="modal"
/>
</div>
</template>
<script>
import modal from "../../../components/common/modal/modal.vue";
import cusTable from "../../../components/common/table/custable.vue";
export default {
components: {
cusTable,
modal,
},
activated() {
this.findAll();
},
data() {
return {
//
loading:false,
pageData: {
tableData: [], //
tableCols: [
//
{
label: "规则类型",
prop: "ruleType",
align: "center",
formatter: (prop, row, codeType) =>
this.getRuleType(prop, row, codeType),
},
{
label: "规则详情",
prop: "ruleInfo",
align: "center",
},
{
label: "红星币数量",
prop: "starCoin",
align: "center",
},
{
label: "赠送所需累计观看",
prop: "cumulativeTimesLimit",
align: "center",
},
{
label: "每日上限次数",
prop: "dailyLimitTimes",
align: "center",
},
{
label: "修改时间",
prop: "createTime",
align: "center",
},
{
label: "操作",
type: "button",
align: "center",
width: "150px",
btnList: [
{
label: "编辑",
type: "text",
size: "small",
handle: (row) => this.showDialog("edit", row),
},
{
label: "删除",
type: "text",
size: "small",
handle: (row) => this.deleteStarCoin(row.starCoinRuleId),
},
],
},
],//
selectList:[],//
tablePage: {
currentPage: 1,
pageSize: 10,
pageTotal: 0,
pageSizeRange: [5, 10, 20, 50, 100],
}, //
tableHandles:[{
label:'添加',
type:'primary',
handle:()=>this.showDialog('add')
},
{
label:'批量删除',
type:'danger',
handle:()=>this.deleteStarCoin()
}]//
},
modalSetting: {
modalForm: [
{
label: "规则详情",
type: "Input",
prop: "ruleInfo",
rules: { required: true },
},
{
label: "规则类型",
type: "Select",
prop: "ruleType",
options: [
{
label: "有效浏览",
value: 1,
},
{
label: "有效观看",
value: 2,
},
// {
// label: "",
// value: 3,
// },
],
rules: { required: true },
},
{
label: "红星币数量",
type: "Input",
prop: "starCoin",
rules: { type: "number" },
rules: { required: true },
},
{
label: "赠送所需累计观看",
type: "Input",
prop: "cumulativeTimesLimit",
rules: { type: "number" },
rules: { required: true },
},
{
label: "每日上限次数",
type: "Input",
prop: "dailyLimitTimes",
rules: { type: "number" },
rules: { required: true },
},
],
modalData: {
ruleInfo: "",
ruleType: "",
starCoin: "",
cumulativeTimesLimit: "",
dailyLimitTimes: "",
},
modalConfig: {
show: false,
title: "添加红星币规则",
closeOnClick: true,
},
modalHandles: [
{
label: "确认",
type: "primary",
handle: () => this.onSubmit(),
},
],
},
};
},
methods: {
findAll() {
this.loading=true;
let params={}
params.page=this.pageData.tablePage.currentPage
params.limit=this.pageData.tablePage.pageSize
this.$api.getRedCoinRule(params).then((res) => {
this.pageData.tableData = res.data.page.list;
this.pageData.tablePage.pageTotal = res.data.page.totalCount;
this.loading=false;
});
},
//ruletyperuleTypeName
getRuleType(prop, row, codeType) {
if (row[prop] == 1) return "有效浏览";
else if (row[prop] == 2) return "有效观看";
// else if (row[prop] == 3) return "";
else return "暂无";
},
add() {
this.$api.addRedCoinRule(this.modalSetting.modalData).then((res) => {
this.modalSetting.modalConfig.show = false;
this.findAll();
});
},
update() {
this.$api
.updateRedCoinRule(this.modalSetting.modalData)
.then((res) => {
this.modalSetting.modalConfig.show = false;
this.findAll();
});
},
onSubmit() {
this.$refs["modal"].$refs["modalFormRef"].validate((valid) => {
if (valid) {
if (this.modalSetting.modalConfig.title === "添加红星币规则")
this.add();
else if (this.modalSetting.modalConfig.title === "编辑红星币规则")
this.update();
} else {
return false;
}
});
},
showDialog(type, data) {
if (type === "add") {
this.modalSetting.modalConfig.show = true;
this.modalSetting.modalConfig.title = "添加红星币规则";
if(this.$refs["modal"].$refs["modalFormRef"]){
this.commonUtil.clearObj(this.modalSetting.modalData)
this.$nextTick(()=>{
this.$refs["modal"].$refs["modalFormRef"].clearValidate();
})
}
} else if (type === "edit") {
this.modalSetting.modalConfig.show = true;
this.modalSetting.modalConfig.title = "编辑红星币规则";
this.$nextTick(()=>{
this.modalSetting.modalData = JSON.parse(JSON.stringify(data));
})
}
},
deleteStarCoin(id) {
let data = [];
this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
if (id) {
data = [id];
} else {
data=this.pageData.selectList.map((item)=>{
return item.starCoinRuleId
})
}
this.$api.deleteRedCoinRule(data).then((res) => {
this.findAll()
});
})
.catch(() => {
});
},
//
selectChange(rows) {
this.pageData.selectList = rows;
},
},
};
</script>

View File

@ -1,53 +0,0 @@
<!--
* @Author: your name
* @Date: 2021-10-30 15:54:44
* @LastEditTime: 2021-12-02 20:05:45
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \background-front-end\src\views\modules\integral\upload.vue
-->
<template>
<div >
<div class="contain">
<div style="font-size:20px;margin-bottom: 10px;">升级所需积分设定:</div>
<el-input class="mt-10" oninput="value=value.replace(/[^\d]/g,'')" v-model="content" />
<el-button class="mt-10" @click="save" type="primary">保存</el-button>
</div>
</div>
</template>
<script>
import {findUploadIntegral,saveUploadIntegral} from '../../../api/modules/intetral'
export default {
data(){
return{
content:'',
id:''
}
},
activated(){
this.find()
},
methods:{
find(){
findUploadIntegral().then(res=>{
this.id=res.data.redIntegralUpgrade.upgradeId
this.content=res.data.redIntegralUpgrade.integral
})
},
save(){
saveUploadIntegral(this.id,this.content)
}
}
}
</script>
<style scoped>
.contain{
width: 350px;
/* margin: auto; */
margin-left: 50px;
margin-top: 50px;
}
.mt-10{
margin-top:10px
}
</style>

View File

@ -1,108 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="100px">
<el-form-item label="bean名称" prop="beanName">
<el-input v-model="dataForm.beanName" placeholder="spring bean名称, 如: testTask"></el-input>
</el-form-item>
<el-form-item label="参数" prop="params">
<el-input v-model="dataForm.params" placeholder="参数"></el-input>
</el-form-item>
<el-form-item label="cron表达式" prop="cronExpression">
<el-input v-model="dataForm.cronExpression" placeholder="如: 0 0 12 * * ?"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
beanName: '',
params: '',
cronExpression: '',
remark: '',
status: 0
},
dataRule: {
beanName: [
{ required: true, message: '用户名不能为空', trigger: 'blur' }
],
cronExpression: [
{ required: true, message: 'cron表达式不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: `/sys/schedule/info/${this.dataForm.id}`,
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.beanName = data.schedule.beanName
this.dataForm.params = data.schedule.params
this.dataForm.cronExpression = data.schedule.cronExpression
this.dataForm.remark = data.schedule.remark
this.dataForm.status = data.schedule.status
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: `/sys/schedule/${!this.dataForm.id ? 'save' : 'update'}`,
method: 'post',
data: this.$http.adornData({
'jobId': this.dataForm.id || undefined,
'beanName': this.dataForm.beanName,
'params': this.dataForm.params,
'cronExpression': this.dataForm.cronExpression,
'remark': this.dataForm.remark,
'status': !this.dataForm.id ? undefined : this.dataForm.status
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@ -1,152 +0,0 @@
<template>
<el-dialog
title="日志列表"
:close-on-click-modal="false"
:visible.sync="visible"
width="75%">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.id" placeholder="任务ID" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
height="460"
style="width: 100%;">
<el-table-column
prop="logId"
header-align="center"
align="center"
width="80"
label="日志ID">
</el-table-column>
<el-table-column
prop="jobId"
header-align="center"
align="center"
width="80"
label="任务ID">
</el-table-column>
<el-table-column
prop="beanName"
header-align="center"
align="center"
label="bean名称">
</el-table-column>
<el-table-column
prop="params"
header-align="center"
align="center"
label="参数">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small">成功</el-tag>
<el-tag v-else @click.native="showErrorInfo(scope.row.logId)" size="small" type="danger" style="cursor: pointer;">失败</el-tag>
</template>
</el-table-column>
<el-table-column
prop="times"
header-align="center"
align="center"
label="耗时(单位: 毫秒)">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
width="180"
label="执行时间">
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false
}
},
methods: {
init () {
this.visible = true
this.getDataList()
},
//
getDataList () {
this.dataListLoading = true
this.$http({
url: '/sys/scheduleLog/list',
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'jobId': this.dataForm.id
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
showErrorInfo (id) {
this.$http({
url: `/sys/scheduleLog/info/${id}`,
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.$alert(data.log.error)
} else {
this.$message.error(data.msg)
}
})
}
}
}
</script>

View File

@ -1,301 +0,0 @@
<template>
<div class="mod-schedule">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.beanName" placeholder="bean名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('sys:schedule:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('sys:schedule:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
<el-button v-if="isAuth('sys:schedule:pause')" type="danger" @click="pauseHandle()" :disabled="dataListSelections.length <= 0">批量暂停</el-button>
<el-button v-if="isAuth('sys:schedule:resume')" type="danger" @click="resumeHandle()" :disabled="dataListSelections.length <= 0">批量恢复</el-button>
<el-button v-if="isAuth('sys:schedule:run')" type="danger" @click="runHandle()" :disabled="dataListSelections.length <= 0">批量立即执行</el-button>
<el-button v-if="isAuth('sys:schedule:log')" type="success" @click="logHandle()">日志列表</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="jobId"
header-align="center"
align="center"
width="80"
label="ID">
</el-table-column>
<el-table-column
prop="beanName"
header-align="center"
align="center"
label="bean名称">
</el-table-column>
<el-table-column
prop="params"
header-align="center"
align="center"
label="参数">
</el-table-column>
<el-table-column
prop="cronExpression"
header-align="center"
align="center"
label="cron表达式">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small">正常</el-tag>
<el-tag v-else size="small" type="danger">暂停</el-tag>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button v-if="isAuth('sys:schedule:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.jobId)">修改</el-button>
<el-button v-if="isAuth('sys:schedule:delete')" type="text" size="small" @click="deleteHandle(scope.row.jobId)">删除</el-button>
<el-button v-if="isAuth('sys:schedule:pause')" type="text" size="small" @click="pauseHandle(scope.row.jobId)">暂停</el-button>
<el-button v-if="isAuth('sys:schedule:resume')" type="text" size="small" @click="resumeHandle(scope.row.jobId)">恢复</el-button>
<el-button v-if="isAuth('sys:schedule:run')" type="text" size="small" @click="runHandle(scope.row.jobId)">立即执行</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<!-- 弹窗, 日志列表 -->
<log v-if="logVisible" ref="log"></log>
</div>
</template>
<script>
import AddOrUpdate from './schedule-add-or-update'
import Log from './schedule-log'
export default {
data () {
return {
dataForm: {
beanName: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false,
logVisible: false
}
},
components: {
AddOrUpdate,
Log
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: '/sys/schedule/list',
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'beanName': this.dataForm.beanName
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.jobId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: '/sys/schedule/delete',
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
},
//
pauseHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.jobId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '暂停' : '批量暂停'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: '/sys/schedule/pause',
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
},
//
resumeHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.jobId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '恢复' : '批量恢复'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: '/sys/schedule/resume',
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
},
//
runHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.jobId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '立即执行' : '批量立即执行'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: '/sys/schedule/run',
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
},
//
logHandle () {
this.logVisible = true
this.$nextTick(() => {
this.$refs.log.init()
})
}
}
}
</script>

View File

@ -1,212 +0,0 @@
<template>
<div>
<obj-modal
ref="modal"
labelWidth="120px"
:modalConfig="modalConfig"
:modalCols="modalCols"
:modalData="modalData"
:modalHandles="modalHandles"
>
</obj-modal>
</div>
</template>
<script>
const BASE_MODAL_DATA = () => {
return {
name: "",
gradeId: "",
sortKey: "",
};
};
const ADD_TITLE = "新增班级";
const EDIT_TITLE = "编辑班级";
import { cloneDeep } from "lodash";
export default {
data() {
return {
isAdd: true,
isLoading: false,
//
tableData: [],
//
tableProp: {},
modalConfig: {
fullscreen: false,
title: "添加机构",
show: false,
width: "500px",
},
modalData: BASE_MODAL_DATA(),
};
},
methods: {
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
}
if (e) {
this.init(cloneDeep(e));
}
return {
add: () => {
this.$set(this.modalConfig, "title", ADD_TITLE);
this.$nextTick(() => {
this.modalData = BASE_MODAL_DATA();
this.$refs.modal?.resetFields();
});
this.isAdd = true;
},
update: () => {
if (this.modalData.provinceCode) {
this.modalData.areaArray.push(this.modalData.provinceCode);
}
if (this.modalData.cityCode) {
this.modalData.areaArray.push(this.modalData.cityCode);
}
if (this.modalData.areaCode) {
this.modalData.areaArray.push(this.modalData.areaCode);
}
this.$set(this.modalConfig, "title", EDIT_TITLE);
this.isAdd = false;
},
};
},
init(row) {
this.modalData = row;
},
},
asyncComputed: {
// async orgOptions() {
// let res = await this.$api.local_admin.getEducationBureauList();
// console.log(res.data.data);
// return res.data.data;
// },
async eduDurationOptions() {
let res = await this.$api.local_admin.getDictionary("edu_duration");
return res.data.data;
},
async getAreaOptions() {
let res = await this.$api.local_admin.getArea();
return res.data.data;
},
async getGradeOptions() {
let res = await this.$api.local_admin.getGradeList();
console.log("res", res);
return res.data.data;
},
},
computed: {
modalCols() {
return [
{
label: "班级名称",
prop: "name",
type: "Input",
labelWidth: "80px",
width: "100%",
require: true,
rules: { required: true, message: "班级名称" },
},
{
label: "所属年级",
prop: "gradeId",
labelWidth: "80px",
width: "100%",
require: true,
rules: { required: true, message: "所属年级" },
type: "jsx",
render: () => {
return (
<el-select
style="width:100%;"
placeholder="请选择班级所属年级"
filterable
v-model={this.modalData.gradeId}
>
{this.getGradeOptions.map((item) => {
return (
<el-option
label={item.name}
value={item.id}
key={item.id}
></el-option>
);
})}
</el-select>
);
},
},
{
label: "排序号",
prop: "sortKey",
type: "Input",
labelWidth: "80px",
width: "100%",
require: true,
rules: { required: true, message: "排序号" },
type: "jsx",
render: () => {
const onChange = () => {};
return (
<el-input-number
style="width:100%;"
v-model={this.modalData.sortKey}
onChange={onChange}
min={0}
label=""
></el-input-number>
);
},
},
];
},
modalHandles() {
return [
{
label: "取消",
icon: "el-icon-close",
handle: () => {
this.toggle();
},
},
{
label: this.isAdd ? "确认添加" : "确认修改",
type: "primary",
icon: "el-icon-check",
loading: this.isLoading,
submit: true,
handle: () => {
setTimeout(() => {
this.isLoading = false;
}, 1000);
console.log(this.modalData);
if (this.isAdd) {
this.$api.local_admin.addClass(this.modalData).then((res) => {
this.$emit("refresh");
this.toggle();
});
} else {
this.$api.local_admin
.updateClass(this.modalData)
.then((res) => {
this.$emit("refresh");
this.toggle();
});
}
// this.api.common.addDict(this.modalData).then((res) => {
// this.emit("refresh");
// this.toggle();
// });
},
},
];
},
},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -1,128 +0,0 @@
<template>
<div style="height: calc(100vh - 92px - 40px)">
<div style="height: 100%">
<obj-table-plus
ref="oTable"
v-model="dataList"
@query="queryList"
:tableProp="tableProp"
:isPagination="false"
:tableCols="tableCols"
>
<div slot="tableTop" class="mb-2">
<el-button type="primary" round @click="add">
<i class="el-icon-plus"></i>
<span>新增</span>
</el-button>
</div>
</obj-table-plus>
<add-or-update ref="addOrUpdate" @refresh="$refs.oTable.reload()" />
</div>
</div>
</template>
<script>
import addOrUpdate from "./class-popup/add-or-update.vue";
export default {
components: { addOrUpdate },
data() {
return {
dataList: [],
tableProp: {
"row-config": {
keyField: "id",
},
"auto-resize": true,
//
"checkbox-config": {
labelField: "",
reserve: true,
},
"show-overflow": false,
"tree-config": {
childrenField: "clazzList",
expandAll: true,
rowField: "id",
parentField: "parentId",
},
height: "auto",
},
};
},
computed: {
tableCols() {
return [
{
title: "年级",
align: "center",
"tree-node": true,
field: "gradeName",
},
{
title: "班级名称",
align: "center",
field: "name",
},
{
title: "操作",
type: "jsx",
align: "center",
render: ({ row, ...others }) => {
console.log("others", others, row);
const edit = () => {
this.$refs.addOrUpdate.toggle({
...row,
gradeId:others.data[Number(others.seq.slice('.')[0])-1].gradeId
}).update();
};
const remove = () => {
this.$api.local_admin.removeClass(row.clazzId).then(() => {
this.$refs.oTable.reload();
});
};
if (others.level == 1) {
return (
<div>
<el-button size="mini" type="primary" onClick={edit}>
编辑
</el-button>
<el-popconfirm
title="确认删除年级?"
onConfirm={remove}
class="ml-2"
>
<el-button slot="reference" size="mini" type="danger">
删除
</el-button>
</el-popconfirm>
</div>
);
} else {
return null;
}
},
},
];
},
},
methods: {
add() {
this.$refs.addOrUpdate.toggle().add();
},
queryList(pageNo, pageSize) {
this.$api.local_admin
.getClassList()
.then((res) => {
console.log(res);
this.$refs.oTable.complete(res.data.data);
})
.catch((err) => {
this.$refs.oTable.complete(false);
});
},
},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -1,177 +0,0 @@
<template>
<div>
<obj-modal
ref="modal"
labelWidth="120px"
:modalConfig="modalConfig"
:modalCols="modalCols"
:modalData="modalData"
:modalHandles="modalHandles"
>
</obj-modal>
</div>
</template>
<script>
const BASE_MODAL_DATA = () => {
return {
name: "",
sortKey: "",
};
};
const ADD_TITLE = "新增年级";
const EDIT_TITLE = "编辑年级";
import { cloneDeep } from "lodash";
export default {
data() {
return {
isAdd: true,
isLoading: false,
//
tableData: [],
//
tableProp: {},
modalConfig: {
fullscreen: false,
title: "添加机构",
show: false,
width: "500px",
},
modalData: BASE_MODAL_DATA(),
};
},
methods: {
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
}
if (e) {
this.init(cloneDeep(e));
}
return {
add: () => {
this.$set(this.modalConfig, "title", ADD_TITLE);
this.$nextTick(() => {
this.modalData = BASE_MODAL_DATA();
this.$refs.modal?.resetFields();
});
this.isAdd = true;
},
update: () => {
if (this.modalData.provinceCode) {
this.modalData.areaArray.push(this.modalData.provinceCode);
}
if (this.modalData.cityCode) {
this.modalData.areaArray.push(this.modalData.cityCode);
}
if (this.modalData.areaCode) {
this.modalData.areaArray.push(this.modalData.areaCode);
}
this.$set(this.modalConfig, "title", EDIT_TITLE);
this.isAdd = false;
},
};
},
init(row) {
this.modalData = row;
},
},
asyncComputed: {
// async orgOptions() {
// let res = await this.$api.local_admin.getEducationBureauList();
// console.log(res.data.data);
// return res.data.data;
// },
async eduDurationOptions() {
let res = await this.$api.local_admin.getDictionary("edu_duration");
return res.data.data;
},
async getAreaOptions() {
let res = await this.$api.local_admin.getArea();
return res.data.data;
},
},
computed: {
modalCols() {
return [
{
label: "年级名称",
prop: "name",
type: "Input",
labelWidth: "80px",
width: "100%",
require: true,
rules: { required: true, message: "年级名称" },
},
{
label: "排序号",
prop: "sortKey",
type: "Input",
labelWidth: "80px",
width: "100%",
require: true,
rules: { required: true, message: "排序号" },
type: "jsx",
render: () => {
const onChange = () => {};
return (
<el-input-number
style="width:100%;"
v-model={this.modalData.sortKey}
onChange={onChange}
min={0}
label=""
></el-input-number>
);
},
},
];
},
modalHandles() {
return [
{
label: "取消",
icon: "el-icon-close",
handle: () => {
this.toggle();
},
},
{
label: this.isAdd ? "确认添加" : "确认修改",
type: "primary",
icon: "el-icon-check",
loading: this.isLoading,
submit: true,
handle: () => {
setTimeout(() => {
this.isLoading = false;
}, 1000);
console.log(this.modalData);
if (this.isAdd) {
this.$api.local_admin.addGrade(this.modalData).then((res) => {
this.$emit("refresh");
this.toggle();
});
} else {
this.$api.local_admin
.updateGrade(this.modalData.id, this.modalData)
.then((res) => {
this.$emit("refresh");
this.toggle();
});
}
// this.api.common.addDict(this.modalData).then((res) => {
// this.emit("refresh");
// this.toggle();
// });
},
},
];
},
},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -1,103 +0,0 @@
<template>
<div style="height: calc(100vh - 92px - 40px)">
<div style="height: 100%">
<obj-table-plus
ref="oTable"
v-model="dataList"
@query="queryList"
:isPagination="false"
:tableCols="tableCols"
>
<div slot="tableTop" class="mb-2">
<el-button type="primary" round @click="add">
<i class="el-icon-plus"></i>
<span>新增</span>
</el-button>
</div>
</obj-table-plus>
<add-or-update ref="addOrUpdate" @refresh="$refs.oTable.reload()" />
</div>
</div>
</template>
<script>
import addOrUpdate from "./grade-popup/add-or-update.vue";
export default {
components: { addOrUpdate },
data() {
return {
dataList: [],
};
},
computed: {
tableCols() {
return [
{
title: "年级名称",
align: "center",
field: "name",
},
{
title: "排序号",
align: "center",
field: "sortKey",
},
{
title: "操作",
type: "jsx",
align: "center",
render: ({ row }) => {
const edit = () => {
this.$refs.addOrUpdate.toggle(row).update();
};
const remove = () => {
this.$api.local_admin.removeGrade(row.id).then(() => {
this.$refs.oTable.reload();
})
};
return (
<div>
<el-button size="mini" type="primary" onClick={edit}>
编辑
</el-button>
<el-popconfirm
title="确认删除年级?"
onConfirm={remove}
class="ml-2"
>
<el-button
slot="reference"
size="mini"
type="danger"
>
删除
</el-button>
</el-popconfirm>
</div>
);
},
},
];
},
},
methods: {
add() {
this.$refs.addOrUpdate.toggle().add();
},
queryList(pageNo, pageSize) {
this.$api.local_admin
.getGradeList()
.then((res) => {
console.log(res);
this.$refs.oTable.complete(res.data.data);
})
.catch((err) => {
this.$refs.oTable.complete(false);
});
},
},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -1,291 +0,0 @@
<template>
<div>
<obj-modal
ref="modal"
labelWidth="120px"
:modalConfig="modalConfig"
:modalCols="modalCols"
:modalData="modalData"
:modalHandles="modalHandles"
>
</obj-modal>
</div>
</template>
<script>
import { cloneDeep } from "lodash";
export default {
data() {
return {
isAdd: true,
isLoading: false,
//
tableData: [],
//
tableProp: {},
modalConfig: {
fullscreen: false,
title: "添加机构",
show: false,
width: "900px",
},
modalData: {
name: "",
eduDuration: '',
contactName: "",
contactPhone: "",
provinceCode: "",
cityCode: "",
areaCode: "",
parentOrgId: '',
areaArray: [],
},
};
},
methods: {
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
}
if (e) {
this.init(cloneDeep(e));
}
return {
add: () => {
this.$set(this.modalConfig, "title", "新增学校");
this.$nextTick(() => {
this.modalData = {
name: "",
eduDuration: '',
contactName: "",
contactPhone: "",
provinceCode: "",
cityCode: "",
areaCode: "",
parentOrgId: '',
areaArray: [],
};
this.$refs.modal?.resetFields();
});
this.isAdd = true;
},
update: () => {
if (this.modalData.provinceCode) {
this.modalData.areaArray.push(this.modalData.provinceCode);
}
if (this.modalData.cityCode) {
this.modalData.areaArray.push(this.modalData.cityCode);
}
if (this.modalData.areaCode) {
this.modalData.areaArray.push(this.modalData.areaCode);
}
this.$set(this.modalConfig, "title", "编辑学校");
this.isAdd = false;
},
};
},
init(row) {
this.modalData = {
...row,
areaArray: [],
contactPhone: row.contactMobile,
};
},
},
asyncComputed: {
async orgOptions() {
let res = await this.$api.local_admin.getEducationBureauList();
console.log(res.data.data);
return res.data.data;
},
async eduDurationOptions() {
let res = await this.$api.local_admin.getDictionary("edu_duration");
return res.data.data;
},
async getAreaOptions() {
let res = await this.$api.local_admin.getArea();
return res.data.data;
},
},
computed: {
modalCols() {
return [
{
label: "学校名称",
prop: "name",
type: "Input",
labelWidth: "120px",
width: "100%",
require: true,
rules: { required: true, message: "学校名称" },
},
{
label: "学制",
prop: "eduDuration",
type: "jsx",
width: "100%",
require: true,
rules: { required: true, message: "请选择学制" },
render: () => {
return (
<el-form-item
style="width: 100%;"
prop="eduDuration"
rules={[{ required: true, message: "请选择学制" }]}
>
<el-select
v-model={this.modalData.eduDuration}
style="width: 100%;"
>
{this.eduDurationOptions.map((item) => {
return (
<el-option
label={item.name}
value={item.value}
key={item.value}
></el-option>
);
})}
</el-select>
</el-form-item>
);
},
},
{
label: "所属教育局",
prop: "parentOrgId",
type: "jsx",
width: "100%",
require: true,
rules: { required: true, message: "所属教育局" },
render: () => {
return (
<el-form-item
style="width: 100%;"
prop="parentOrgId"
rules={[{ required: true, message: "所属教育局" }]}
>
<el-select
v-model={this.modalData.parentOrgId}
style="width: 100%;"
>
{this.orgOptions.map((item) => {
return (
<el-option
label={item.orgName}
value={item.orgId}
key={item.orgId}
></el-option>
);
})}
</el-select>
</el-form-item>
);
},
},
{
label: "联系人",
prop: "contactName",
labelWidth: "120px",
type: "Input",
require: true,
rules: { required: true, message: "联系人" },
},
{
label: "联系人电话",
prop: "contactPhone",
labelWidth: "120px",
type: "Input",
require: true,
rules: { required: true, message: "联系人电话" },
},
{
label: "省市区",
prop: "provinceCode", //provinceCode,cityCode,areaCode
labelWidth: "120px",
type: "jsx",
require: true,
rules: { required: true, message: "省市区" },
render: () => {
const changeArea = (e) => {
console.log(e);
this.modalData.provinceCode = e[0] || "";
this.modalData.cityCode = e[1] || "";
this.modalData.areaCode = e[2] || "";
};
return (
<el-form-item
style="width:100%;"
prop="provinceCode"
rules={[{ required: true, message: "请选择省市区" }]}
>
<el-cascader
style="width:100%;"
onChange={changeArea}
options={this.getAreaOptions}
v-model={this.modalData.areaArray}
props={{
props: {
checkStrictly: true,
label: "name",
value: "code",
emitPath: true,
},
}}
></el-cascader>
</el-form-item>
);
},
},
];
},
modalHandles() {
return [
{
label: "取消",
icon: "el-icon-close",
handle: () => {
this.toggle();
},
},
{
label: this.isAdd ? "确认添加" : "确认修改",
type: "primary",
icon: "el-icon-check",
loading: this.isLoading,
submit: true,
handle: () => {
setTimeout(() => {
this.isLoading = false;
}, 1000);
console.log(this.modalData);
this.$api.local_admin
.addSchool({
name: this.modalData.name,
eduDuration: this.modalData.eduDuration,
contactName: this.modalData.contactName,
contactPhone: this.modalData.contactPhone,
provinceCode: this.modalData.provinceCode,
cityCode: this.modalData.cityCode,
areaCode: this.modalData.areaCode,
parentOrgId: this.modalData.parentOrgId,
})
.then((res) => {
this.$emit("refresh");
this.toggle();
});
// this.api.common.addDict(this.modalData).then((res) => {
// this.emit("refresh");
// this.toggle();
// });
},
},
];
},
},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -1,102 +0,0 @@
<template>
<div style="height: calc(100vh - 92px - 40px)">
<div style="height: 100%">
<obj-table-plus
ref="oTable"
v-model="dataList"
@query="queryList"
:tableCols="tableCols"
>
<div slot="tableTop" class="mb-2">
<el-button type="primary" round @click="add">
<i class="el-icon-plus"></i>
<span>新增</span>
</el-button>
</div>
</obj-table-plus>
<add-or-update ref="addOrUpdate" @refresh="$refs.oTable.reload()" />
</div>
</div>
</template>
<script>
import addOrUpdate from "./popup/add-or-update.vue";
export default {
components: { addOrUpdate },
data() {
return {
dataList: [],
};
},
computed: {
tableCols() {
return [
{
title: "学校名称",
align:"center",
field: "name",
},
{
title: "学校地址",
type: "jsx",
align:"center",
render: ({ row }) => {
return (
<div>
<span>{row.provinceName ? row.provinceName + "/" : ""}</span>
<span>{row.cityName ? row.cityName + "/" : ""}</span>
<span>{row.areaName ? row.areaName : ""}</span>
</div>
);
},
},
{
title: "操作",
type: "jsx",
align:"center",
render: ({ row }) => {
const edit=()=>{
this.$refs.addOrUpdate.toggle(row).update()
}
const remove=()=>{}
return (
<div>
<el-button size="mini" type="primary" onClick={edit} disabled>
编辑
</el-button>
<el-popconfirm title="确认删除学校?" onConfirm={remove} class="ml-2">
<el-button slot="reference" size="mini" type="danger" disabled>
删除
</el-button>
</el-popconfirm>
</div>
);
},
},
];
},
},
methods: {
add() {
this.$refs.addOrUpdate.toggle().add();
},
queryList(pageNo, pageSize) {
this.$api.local_admin
.getSchoolPage({
pageNumber: pageNo,
pageSize: pageSize,
})
.then((res) => {
console.log(res);
this.$refs.oTable.complete(res.data.data.data,Number(res.data.data.total));
})
.catch((err) => {
this.$refs.oTable.complete(false);
});
},
},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -1,13 +0,0 @@
<template>
<div>
区域内学校统计
</div>
</template>
<script>
</script>
<style lang="scss" scoped>
</style>

View File

@ -1,223 +0,0 @@
<template>
<div>
<obj-modal
ref="modal"
labelWidth="100px"
:modalConfig="modalConfig"
:modalCols="modalCols"
:modalData="modalData"
:modalHandles="modalHandles"
>
</obj-modal>
</div>
</template>
<script>
const BASE_MODAL_DATA = () => {
return {
name: "",
sortKey: "",
};
};
const ADD_TITLE = "添加教师";
const EDIT_TITLE = "编辑教师信息";
import { cloneDeep } from "lodash";
export default {
data() {
return {
isAdd: true,
isLoading: false,
//
tableData: [],
//
tableProp: {},
modalConfig: {
fullscreen: false,
title: "添加机构",
show: false,
width: "700px",
},
modalData: BASE_MODAL_DATA(),
};
},
methods: {
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
}
if (e) {
this.init(cloneDeep(e));
}
return {
add: () => {
this.$set(this.modalConfig, "title", ADD_TITLE);
this.$nextTick(() => {
this.modalData = BASE_MODAL_DATA();
this.$refs.modal?.resetFields();
});
this.isAdd = true;
},
update: () => {
if (this.modalData.provinceCode) {
this.modalData.areaArray.push(this.modalData.provinceCode);
}
if (this.modalData.cityCode) {
this.modalData.areaArray.push(this.modalData.cityCode);
}
if (this.modalData.areaCode) {
this.modalData.areaArray.push(this.modalData.areaCode);
}
this.$set(this.modalConfig, "title", EDIT_TITLE);
this.isAdd = false;
},
};
},
init(row) {
this.modalData = row;
},
},
asyncComputed: {
// async orgOptions() {
// let res = await this.$api.local_admin.getEducationBureauList();
// console.log(res.data.data);
// return res.data.data;
// },
async classOptions() {
let res = await this.$api.local_admin.getClassList();
return res.data.data.map(item=>{
item.label=item.gradeName;
item.value=item.gradeId;
item.clazzList=item.clazzList.map(el=>{
el.label=el.name;
el.value=el.clazzId;
return el;
})
if(item.clazzList.length<=0){
item.disabled=true
}
return item;
});
},
async eduDurationOptions() {
let res = await this.$api.local_admin.getDictionary("edu_duration");
return res.data.data;
},
async getAreaOptions() {
let res = await this.$api.local_admin.getArea();
return res.data.data;
},
},
computed: {
modalCols() {
return [
{
label: "教师姓名",
prop: "name",
type: "Input",
width: "100%",
require: true,
rules: { required: true, message: "年级名称" },
},
{
label: "教师手机号",
prop: "mobile",
type: "Input",
width: "100%",
require: true,
rules: { required: true, message: "年级名称" },
},
{
label: "登录密码",
prop: "password",
type: "Input",
width: "100%",
require: true,
rules: { required: true, message: "年级名称" },
},
{
label: "关联班级",
type: "jsx",
width: "100%",
require: true,
rules: { required: true, message: "选择教师管理的班级" },
render: () => {
return (
<el-cascader
show-all-levels={false}
class="w-100"
placeholder="请选择教师所管理的班级"
filterable={true}
v-model={this.modalData.clazzList}
options={this.classOptions}
props={{
props: {
checkStrictly: false,
multiple:true,
label: "label",
children:'clazzList',
value: "value",
emitPath: false,
},
}}
clearable={true}
></el-cascader>
);
},
}
];
},
modalHandles() {
return [
{
label: "取消",
icon: "el-icon-close",
handle: () => {
this.toggle();
},
},
{
label: this.isAdd ? "确认添加" : "确认修改",
type: "primary",
icon: "el-icon-check",
loading: this.isLoading,
submit: true,
handle: () => {
setTimeout(() => {
this.isLoading = false;
}, 1000);
console.log(this.modalData);
if (this.isAdd) {
this.$api.local_admin.addTeacher({
...this.modalData,
clazzList:this.modalData.clazzList.map(value=>{
return {
clazzId:value
}
}),
}).then((res) => {
this.$emit("refresh");
this.toggle();
});
} else {
// this.$api.local_admin
// .updateGrade(this.modalData.id, this.modalData)
// .then((res) => {
// this.$emit("refresh");
// this.toggle();
// });
}
// this.api.common.addDict(this.modalData).then((res) => {
// this.emit("refresh");
// this.toggle();
// });
},
},
];
},
},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -1,115 +0,0 @@
<template>
<div style="height: calc(100vh - 92px - 40px)">
<div style="height: 100%">
<obj-table-plus
ref="oTable"
v-model="dataList"
@query="queryList"
:tableCols="tableCols"
>
<div slot="tableTop" class="mb-2">
<el-button type="primary" round @click="add">
<i class="el-icon-plus"></i>
<span>新增</span>
</el-button>
</div>
</obj-table-plus>
<add-or-update ref="addOrUpdate" @refresh="$refs.oTable.reload()" />
</div>
</div>
</template>
<script>
import addOrUpdate from "./popup/add-or-update.vue";
export default {
components: { addOrUpdate },
data() {
return {
dataList: [],
};
},
computed: {
tableCols() {
return [
{
title: "教师姓名",
align: "center",
field: "name",
},
{
title: "教师手机号",
align: "center",
field: "mobile",
},
{
title: "关联年级",
align: "center",
field: "gradeStr",
},
{
title: "关联班级",
align: "center",
field: "clazzStr",
},
{
title: "操作",
type: "jsx",
show:false,
align: "center",
render: ({ row }) => {
const edit = () => {
this.$refs.addOrUpdate.toggle(row).update();
};
const remove = () => {
this.$api.local_admin.removeGrade(row.id).then(() => {
this.$refs.oTable.reload();
});
};
return (
<div>
<el-button size="mini" type="primary" onClick={edit}>
编辑
</el-button>
<el-popconfirm
title="确认删除年级?"
onConfirm={remove}
class="ml-2"
>
<el-button slot="reference" size="mini" type="danger">
删除
</el-button>
</el-popconfirm>
</div>
);
},
},
];
},
},
methods: {
add() {
this.$refs.addOrUpdate.toggle().add();
},
queryList(pageNo, pageSize) {
this.$api.local_admin
.getTeacherPage({
pageNumber: pageNo,
pageSize: pageSize,
})
.then((res) => {
console.log(res);
this.$refs.oTable.complete(
res.data.data.data,
Number(res.data.data.total)
);
})
.catch((err) => {
this.$refs.oTable.complete(false);
});
},
},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -1,133 +0,0 @@
<template>
<el-dialog
title="云存储配置"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
<el-form-item size="mini" label="存储类型">
<el-radio-group v-model="dataForm.type">
<el-radio :label="1">七牛</el-radio>
<el-radio :label="2">阿里云</el-radio>
<el-radio :label="3">腾讯云</el-radio>
</el-radio-group>
</el-form-item>
<template v-if="dataForm.type === 1">
<el-form-item size="mini">
<a href="http://www.renren.io/open/qiniu.html" target="_blank">免费申请(七牛)10GB储存空间</a>
</el-form-item>
<el-form-item label="域名">
<el-input v-model="dataForm.qiniuDomain" placeholder="七牛绑定的域名"></el-input>
</el-form-item>
<el-form-item label="路径前缀">
<el-input v-model="dataForm.qiniuPrefix" placeholder="不设置默认为空"></el-input>
</el-form-item>
<el-form-item label="AccessKey">
<el-input v-model="dataForm.qiniuAccessKey" placeholder="七牛AccessKey"></el-input>
</el-form-item>
<el-form-item label="SecretKey">
<el-input v-model="dataForm.qiniuSecretKey" placeholder="七牛SecretKey"></el-input>
</el-form-item>
<el-form-item label="空间名">
<el-input v-model="dataForm.qiniuBucketName" placeholder="七牛存储空间名"></el-input>
</el-form-item>
</template>
<template v-else-if="dataForm.type === 2">
<el-form-item label="域名">
<el-input v-model="dataForm.aliyunDomain" placeholder="阿里云绑定的域名"></el-input>
</el-form-item>
<el-form-item label="路径前缀">
<el-input v-model="dataForm.aliyunPrefix" placeholder="不设置默认为空"></el-input>
</el-form-item>
<el-form-item label="EndPoint">
<el-input v-model="dataForm.aliyunEndPoint" placeholder="阿里云EndPoint"></el-input>
</el-form-item>
<el-form-item label="AccessKeyId">
<el-input v-model="dataForm.aliyunAccessKeyId" placeholder="阿里云AccessKeyId"></el-input>
</el-form-item>
<el-form-item label="AccessKeySecret">
<el-input v-model="dataForm.aliyunAccessKeySecret" placeholder="阿里云AccessKeySecret"></el-input>
</el-form-item>
<el-form-item label="BucketName">
<el-input v-model="dataForm.aliyunBucketName" placeholder="阿里云BucketName"></el-input>
</el-form-item>
</template>
<template v-else-if="dataForm.type === 3">
<el-form-item label="域名">
<el-input v-model="dataForm.qcloudDomain" placeholder="腾讯云绑定的域名"></el-input>
</el-form-item>
<el-form-item label="路径前缀">
<el-input v-model="dataForm.qcloudPrefix" placeholder="不设置默认为空"></el-input>
</el-form-item>
<el-form-item label="AppId">
<el-input v-model="dataForm.qcloudAppId" placeholder="腾讯云AppId"></el-input>
</el-form-item>
<el-form-item label="SecretId">
<el-input v-model="dataForm.qcloudSecretId" placeholder="腾讯云SecretId"></el-input>
</el-form-item>
<el-form-item label="SecretKey">
<el-input v-model="dataForm.qcloudSecretKey" placeholder="腾讯云SecretKey"></el-input>
</el-form-item>
<el-form-item label="BucketName">
<el-input v-model="dataForm.qcloudBucketName" placeholder="腾讯云BucketName"></el-input>
</el-form-item>
<el-form-item label="Bucket所属地区">
<el-input v-model="dataForm.qcloudRegion" placeholder="如sh可选值 华南gz 华北tj 华东sh"></el-input>
</el-form-item>
</template>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {},
dataRule: {}
}
},
methods: {
init (id) {
this.visible = true
this.$http({
url: '/sys/oss/config',
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
this.dataForm = data && data.code === 0 ? data.config : []
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: '/sys/oss/saveConfig',
method: 'post',
data: this.$http.adornData(this.dataForm)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@ -1,71 +0,0 @@
<template>
<el-dialog
title="上传文件"
:close-on-click-modal="false"
@close="closeHandle"
:visible.sync="visible">
<el-upload
drag
:action="url"
:before-upload="beforeUploadHandle"
:on-success="successHandle"
multiple
:file-list="fileList"
style="text-align: center;">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">只支持jpgpnggif格式的图片</div>
</el-upload>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
url: '',
num: 0,
successNum: 0,
fileList: []
}
},
methods: {
init (id) {
this.url = `/sys/oss/upload?token=${this.$cookie.get('token')}`
this.visible = true
},
//
beforeUploadHandle (file) {
if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
this.$message.error('只支持jpg、png、gif格式的图片')
return false
}
this.num++
},
//
successHandle (response, file, fileList) {
this.fileList = fileList
this.successNum++
if (response && response.code === 0) {
if (this.num === this.successNum) {
this.$confirm('操作成功, 是否继续操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).catch(() => {
this.visible = false
})
}
} else {
this.$message.error(response.msg)
}
},
//
closeHandle () {
this.fileList = []
this.$emit('refreshDataList')
}
}
}
</script>

View File

@ -1,176 +0,0 @@
<template>
<div class="mod-oss">
<el-form :inline="true" :model="dataForm">
<el-form-item>
<el-button type="primary" @click="configHandle()">云存储配置</el-button>
<el-button type="primary" @click="uploadHandle()">上传文件</el-button>
<el-button type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
width="80"
label="ID">
</el-table-column>
<el-table-column
prop="url"
header-align="center"
align="center"
label="URL地址">
</el-table-column>
<el-table-column
prop="createDate"
header-align="center"
align="center"
width="180"
label="创建时间">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 云存储配置 -->
<config v-if="configVisible" ref="config"></config>
<!-- 弹窗, 上传文件 -->
<upload v-if="uploadVisible" ref="upload" @refreshDataList="getDataList"></upload>
</div>
</template>
<script>
import Config from './oss-config'
import Upload from './oss-upload'
export default {
data () {
return {
dataForm: {},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
configVisible: false,
uploadVisible: false
}
},
components: {
Config,
Upload
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: '/sys/oss/list',
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
//
configHandle () {
this.configVisible = true
this.$nextTick(() => {
this.$refs.config.init()
})
},
//
uploadHandle () {
this.uploadVisible = true
this.$nextTick(() => {
this.$refs.upload.init()
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: '/sys/oss/delete',
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
}
}
}
</script>

Some files were not shown because too many files have changed in this diff Show More