@@ -83,3 +83,5 @@ Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js | |||
/Learun.Framework.Ultimate V7/Learun.Application.Web/Properties/PublishProfiles | |||
/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/images/QRCode | |||
/Learun.Framework.Ultimate V7/Learun.Application.WebApi/logs/ | |||
/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Log/LogInfo | |||
/Learun.Framework.Ultimate V7/Learun.Application.Web/Log/LogInfo/20250106 |
@@ -18,6 +18,7 @@ using Learun.Cache.Factory; | |||
using Newtonsoft.Json; | |||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||
using Learun.Application.TwoDevelopment.PersonnelManagement; | |||
using Learun.Application.WeChat; | |||
namespace Learun.Application.Web.Controllers | |||
{ | |||
@@ -58,7 +59,10 @@ namespace Learun.Application.Web.Controllers | |||
private StuConsumptionIBLL stuConsumptionIBLL = new StuConsumptionBLL(); | |||
private MealCardRunTabIBLL mealCardRunTabIBLL = new MealCardRunTabBLL(); | |||
private Sys_UpdateRecordIBLL sys_UpdateRecordIBLL = new Sys_UpdateRecordBLL(); | |||
/// <summary> | |||
/// 标记登录的浏览器 | |||
/// </summary> | |||
private string LoginUserMarkKey = "Learun_ADMS_V7_Mark"; | |||
#region 统一身份认证3.0 | |||
/// <summary> | |||
/// 退出 | |||
@@ -951,6 +955,7 @@ namespace Learun.Application.Web.Controllers | |||
{ | |||
try | |||
{ | |||
//var user = LoginUserInfo.Get(); | |||
string redi = Request.QueryString["redi"]; | |||
if (!string.IsNullOrEmpty(redi)) | |||
{ | |||
@@ -966,6 +971,11 @@ namespace Learun.Application.Web.Controllers | |||
functionVisitEntity.PDate = DateTime.Now; | |||
functionVisitEntity.PUId = userid; | |||
var userinfo = userBll.GetEntityByUserId(userid); | |||
var type = 0;//1学生 0教师 | |||
if (userinfo.F_Description == "学生") | |||
{ | |||
type = 1; | |||
} | |||
functionVisitEntity.PUName = userinfo.F_RealName; | |||
if (uplist == null) | |||
{ | |||
@@ -980,22 +990,37 @@ namespace Learun.Application.Web.Controllers | |||
{ | |||
if (!string.IsNullOrEmpty(perfun.FInterfaceUrl)) | |||
{ | |||
if (!string.IsNullOrEmpty(perfun.UPUserName) && !string.IsNullOrEmpty(perfun.UPPass)) | |||
var url = perfun.FUrl; | |||
var token = OperatorHelper.Instance.AddLoginUser(userinfo.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息 | |||
string loginMark = WebHelper.GetCookie(LoginUserMarkKey).ToString(); | |||
if (url.Contains("?")) | |||
{ | |||
var user = LoginUserInfo.Get(); | |||
functionVisitEntity.PIsLoginSuccess = true; | |||
functionVisitEntity.PContent = "成功转到统一认证网站:" + perfun.FUrl; | |||
functionVisitIbll.SaveEntity(null, functionVisitEntity); | |||
return Redirect(perfun.FInterfaceUrl + "?u=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(perfun.UPUserName, secretkey), publickey) + "&p=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(perfun.UPPass, secretkey), publickey) + "&t=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(DateTime.Now.ToString("yyyyMMddHHmmss"), secretkey), publickey) + "&ip=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(GetIP(), secretkey), publickey)+"&m=" + DESEncrypt.Encrypt(user.loginMark) + "&t=" + DESEncrypt.Encrypt(user.token)); | |||
url += "&appkey=" + Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) + "&name=" + DESEncrypt.Encrypt(userinfo.F_RealName, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&no=" + DESEncrypt.Encrypt(userinfo.F_IdentityCardNo, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&acc=" + DESEncrypt.Encrypt(userinfo.F_EnCode, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&type=" + type + "&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token); | |||
} | |||
else | |||
{ | |||
functionVisitEntity.PIsLoginSuccess = false; | |||
functionVisitEntity.PContent = "用户未配置转到用户名密码配置页面"; | |||
functionVisitIbll.SaveEntity(null, functionVisitEntity); | |||
//用户未配置转到用户名密码配置页面 | |||
return Redirect("/SSOSystem/FirstLogin?sysid=" + sysid + "&openid=" + openid); | |||
url += "?appkey=" + Md5Helper.Encrypt(Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), 32) + "&name=" + DESEncrypt.Encrypt(userinfo.F_RealName, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&no=" + DESEncrypt.Encrypt(userinfo.F_IdentityCardNo, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&acc=" + DESEncrypt.Encrypt(userinfo.F_EnCode, Util.DESEncrypt.Decrypt(perfun.FSecret, ConfigurationManager.AppSettings["SSOPublicSecret"]), false) + "&type=" + type + "&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token); | |||
} | |||
return Redirect(url); | |||
//if (!string.IsNullOrEmpty(perfun.UPUserName) && !string.IsNullOrEmpty(perfun.UPPass)) | |||
//{ | |||
// var token = OperatorHelper.Instance.AddLoginUser(userinfo.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息 | |||
// string loginMark = WebHelper.GetCookie(LoginUserMarkKey).ToString(); | |||
// functionVisitEntity.PIsLoginSuccess = true; | |||
// functionVisitEntity.PContent = "成功转到统一认证网站:" + perfun.FUrl; | |||
// functionVisitIbll.SaveEntity(null, functionVisitEntity); | |||
// //return Redirect(perfun.FInterfaceUrl + "?u=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(perfun.UPUserName, secretkey), publickey) + "&p=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(perfun.UPPass, secretkey), publickey) + "&t=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(DateTime.Now.ToString("yyyyMMddHHmmss"), secretkey), publickey) + "&ip=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(GetIP(), secretkey), publickey)+"&m=" + DESEncrypt.Encrypt(loginMark) + "&t=" + DESEncrypt.Encrypt(token)); | |||
//} | |||
//else | |||
//{ | |||
// functionVisitEntity.PIsLoginSuccess = false; | |||
// functionVisitEntity.PContent = "用户未配置转到用户名密码配置页面"; | |||
// functionVisitIbll.SaveEntity(null, functionVisitEntity); | |||
// //用户未配置转到用户名密码配置页面 | |||
// return Redirect("/SSOSystem/FirstLogin?sysid=" + sysid + "&openid=" + openid); | |||
//} | |||
} | |||
else | |||
{ | |||
@@ -1,7 +1,7 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<connectionStrings> | |||
<add name="BaseDb" connectionString="Server=8.141.155.183,53314;Initial Catalog=adms7ultimate2_枝江;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" /> | |||
<add name="CollegeMIS" connectionString="Server=8.141.155.183,53314;Initial Catalog=CollegeMIS_枝江;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" /> | |||
<add name="BaseDb" connectionString="Server=8.141.155.183,53314;Initial Catalog=adms7ultimate2_长阳;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" /> | |||
<add name="CollegeMIS" connectionString="Server=8.141.155.183,53314;Initial Catalog=CollegeMIS_长阳;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" /> | |||
<add name="hangfireString" connectionString="Server=8.141.155.183,53314;Initial Catalog=Hangfire;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" /> | |||
</connectionStrings> |
@@ -191,9 +191,9 @@ | |||
<!--下发新闻配置--> | |||
<add key="SiteId" value="39"/> | |||
<add key="ChannelId" value="49"/> | |||
<add key="ChannelId" value="61"/> | |||
<!--秘钥--> | |||
<add key="ApiKey" value="fafc361a-40c1-4060-8eee-ea796640c39c"/> | |||
<add key="ApiKey" value="b2ede71b-0e79-4d72-bb2d-39209583a5ca"/> | |||
<!--CMS地址--> | |||
<add key="Ports" value="192.168.50.127:8007"/> | |||
<add key="Ports" value="192.168.10.65:8061"/> | |||
</appSettings> |
@@ -202,20 +202,25 @@ namespace Learun.Application.OA | |||
{ | |||
newEntity.F_Status = "0"; | |||
} | |||
} | |||
this.BaseRepository().Update(newEntity); | |||
this.BaseRepository().Update(newEntity); | |||
if (newEntity.IsSend == "1" && status == 2) | |||
{ | |||
BaseRepository() | |||
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson) VALUES (newid(),2222,'准备开始run task') "); | |||
Task.Run(async () => { sendNew(newEntity); }); | |||
if (newEntity.IsSend == "1" && status == 2) | |||
{ | |||
BaseRepository().ExecuteBySql($"insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson,F_Module,F_OperateTime) VALUES (newid(),2222,'准备开始run task','{newEntity.F_NewsId}','{DateTime.Now}') "); | |||
try | |||
{ | |||
Task.Run(async () => { sendNew(newEntity); }); | |||
} | |||
catch (Exception ex) | |||
{ | |||
BaseRepository().ExecuteBySql($"insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson,F_Module,F_OperateTime) VALUES (newid(),2222,'run task 报错:{ex.Message}','{newEntity.F_NewsId}','{DateTime.Now}') "); | |||
} | |||
} | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
BaseRepository() | |||
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson) VALUES (newid(),2222,'run task 报错"+ex.Message+"') "); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
@@ -242,8 +247,7 @@ namespace Learun.Application.OA | |||
string ports = ConfigurationManager.AppSettings["Ports"]; | |||
#endregion | |||
BaseRepository() | |||
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson) VALUES (newid(),2222,'准备开始组装实体') "); | |||
BaseRepository().ExecuteBySql($"insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson,F_Module,F_OperateTime) VALUES (newid(),2222,'准备开始组装实体','{newEntity.F_NewsId}','{DateTime.Now}') "); | |||
SemdNewList SendNew = new SemdNewList | |||
{ | |||
Title = newEntity.F_FullHead, | |||
@@ -259,12 +263,10 @@ namespace Learun.Application.OA | |||
{ | |||
{ "X-SS-API-KEY", ApiKey } | |||
}; | |||
BaseRepository() | |||
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson) VALUES (newid(),2222,'准备开始post cms') "); | |||
BaseRepository().ExecuteBySql($"insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson,F_Module,F_OperateTime) VALUES (newid(),2222,'准备开始post cms','{newEntity.F_NewsId}','{DateTime.Now}') "); | |||
string responses = HttpMethods.HttpPosts("http://" + ports + "/api/v1/contents/" + siteId + "/" + channelId, SendNew.ToJson(), ApiId); | |||
BaseRepository() | |||
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson) VALUES (newid(),2222,'"+HttpUtility.UrlEncode(responses)+"') "); | |||
BaseRepository().ExecuteBySql($"insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson,F_Module,F_OperateTime) VALUES (newid(),2222,'post cms响应结果:{HttpUtility.UrlEncode(responses)}','{newEntity.F_NewsId}','{DateTime.Now}') "); | |||
//#region 修改审核状态 | |||
//string Nid = JsonConvert.DeserializeObject<Root>(responses).value.id; | |||
@@ -287,8 +289,7 @@ namespace Learun.Application.OA | |||
} | |||
catch (Exception ex) | |||
{ | |||
BaseRepository() | |||
.ExecuteBySql("insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson) VALUES (newid(),2222,'"+ex.Message + "') "); | |||
BaseRepository().ExecuteBySql($"insert INTO LR_Base_Log(F_LogId,F_CategoryId,F_SourceContentJson,F_Module,F_OperateTime) VALUES (newid(),2222,'下发官网异常:{ex.Message}','{newEntity.F_NewsId}','{DateTime.Now}') "); | |||
} | |||
} | |||
@@ -298,10 +299,10 @@ namespace Learun.Application.OA | |||
return this.BaseRepository().FindList<NewsEntity>().Count(); | |||
} | |||
public Dictionary<int,int> GetNewMonthSum() | |||
public Dictionary<int, int> GetNewMonthSum() | |||
{ | |||
var dt = new DateTime(DateTime.Now.Year, 1, 1); | |||
var ls = this.BaseRepository().FindList<NewsEntity>(x=>x.F_CreateDate>=dt).Select(x => new { Year = x.F_CreateDate.Value.Year, Month = x.F_CreateDate.Value.Month }).GroupBy(x => new { x.Year, x.Month }).ToDictionary(x => x.Key.Month, a => a.Count()); | |||
var ls = this.BaseRepository().FindList<NewsEntity>(x => x.F_CreateDate >= dt).Select(x => new { Year = x.F_CreateDate.Value.Year, Month = x.F_CreateDate.Value.Month }).GroupBy(x => new { x.Year, x.Month }).ToDictionary(x => x.Key.Month, a => a.Count()); | |||
return ls; | |||
} | |||
} | |||
@@ -1295,6 +1295,19 @@ | |||
"style": { | |||
"navigationBarTitleText": "信息化办公设备" | |||
} | |||
}, | |||
// 部门周计划 | |||
{ | |||
"path": "pages/EducationalAdministration/departmentWeek/list", | |||
"style": { | |||
"navigationBarTitleText": "部门周计划" | |||
} | |||
}, | |||
{ | |||
"path": "pages/EducationalAdministration/departmentWeek/single", | |||
"style": { | |||
"navigationBarTitleText": "部门周计划" | |||
} | |||
} | |||
], | |||
@@ -0,0 +1,394 @@ | |||
<template> | |||
<view class="page"> | |||
<!-- 主列表页 --> | |||
<view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;"> | |||
<!-- 顶部条目/分页信息栏 --> | |||
<l-customlist-banner @buttonClick="sideOpen = true"> | |||
{{ tips }} | |||
<view v-if="!searchData.Status" @click="action('push')" | |||
class="customlist-banner-action-btn line-red text-sm pushBtn" style="border: currentColor 1px solid"> | |||
<l-icon type="top" /> | |||
一键发布 | |||
</view> | |||
</l-customlist-banner> | |||
<!-- 滚动列表,跨端支持上拉/下拉 --> | |||
<l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="list"> | |||
<l-customlist :tips="loadState" showTips> | |||
<!-- 单条记录 --> | |||
<view class="customlist-item" v-for="(item, index) of list" :key="item.Id"> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">部门:</text> | |||
{{ displayListItem(item, 'Department') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">周别:</text> | |||
{{ displayListItem(item, 'Week') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">标题:</text> | |||
{{ displayListItem(item, 'Title') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">发布人:</text> | |||
{{ displayListItem(item, 'CreateUser') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">发布日期:</text> | |||
{{ displayListItem(item, 'CreateTime') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">状态:</text> | |||
{{ displayListItem(item, 'Status') }} | |||
</view> | |||
<view class="customlist-banner-action"> | |||
<view v-if="item.Status == '0'" @click="action('submit', item.ID)" | |||
class="customlist-banner-action-btn line-red text-sm" style="border: currentColor 1px solid"> | |||
<l-icon type="top" /> | |||
提交 | |||
</view> | |||
<view v-if="item.Status == '0'" @click="action('delete', item.ID)" | |||
class="customlist-banner-action-btn line-red text-sm" style="border: currentColor 1px solid"> | |||
<l-icon type="delete" /> | |||
删除 | |||
</view> | |||
<view v-if="item.Status == '0'" @click="action('edit', item.ID)" | |||
class="customlist-banner-action-btn line-blue text-sm" style="border: currentColor 1px solid"> | |||
<l-icon type="edit" /> | |||
编辑 | |||
</view> | |||
<view @click="action('view', item.ID)" class="customlist-banner-action-btn line-blue text-sm" | |||
style="border: currentColor 1px solid"> | |||
<l-icon type="search" /> | |||
查看 | |||
</view> | |||
</view> | |||
</view> | |||
</l-customlist> | |||
</l-scroll-list> | |||
</view> | |||
<!-- 关闭侧边抽屉按钮 --> | |||
<view @click="sideOpen = false" :class="sideOpen ? 'show' : ''" class="sideclose"> | |||
<l-icon type="pullright" color="blue" /> | |||
</view> | |||
<!-- 侧边栏,用于设置查询条件 --> | |||
<scroll-view :class="sideOpen ? 'show' : ''" class="sidepage" scroll-y> | |||
<view v-if="ready" class="padding"> | |||
<l-select @input="queryData.Week=$event" :value="queryData.Week" | |||
:range="dataSource.Week" title="周别" @change="searchChange" /> | |||
<l-organize-picker @input="queryData.Department=$event" :value="queryData.Department" :multiple="false" | |||
title="部门" type="department" @change="searchChange"/> | |||
<l-organize-picker @input="queryData.CreateUser=$event" :value="queryData.CreateUser" :multiple="false" | |||
type="user" title="发布人" @change="searchChange"/> | |||
<!-- 重置查询条件按钮 --> | |||
<view class="padding-tb"> | |||
<l-button @click="reset" line="orange" class="block" block>重置查询条件</l-button> | |||
</view> | |||
</view> | |||
</scroll-view> | |||
<l-customlist-add v-if="!sideOpen" @click="action('add')" /> | |||
</view> | |||
</template> | |||
<script> | |||
/* | |||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 上海力软信息技术有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-10-16 15:39 | |||
* 描 述:工作日志 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/EducationalAdministration/Journal/list", "style": { "navigationBarTitleText": "表单列表页" } } | |||
* | |||
* (navigationBarTitleText 字段为本页面的标题文本,可以修改) | |||
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件) | |||
*/ | |||
import moment from 'moment' | |||
import get from 'lodash/get' | |||
import set from 'lodash/set' | |||
import pickBy from 'lodash/pickBy' | |||
import mapValues from 'lodash/mapValues' | |||
export default { | |||
data() { | |||
return { | |||
// 数据项的数据类型、结构 | |||
scheme: { | |||
Department: { type: 'select' }, | |||
CreateUser: { type: 'select' }, | |||
Title: { type: 'text' }, | |||
Week: { type: 'select' }, | |||
CreateTime: { type: 'datetime', dateformat: 0 }, | |||
Status: { type: 'select' }, | |||
}, | |||
// 查询条件 | |||
searchData: {}, | |||
defaultQueryData: {}, | |||
queryData: { | |||
}, | |||
// 时间查询参数 | |||
dateRange: null, | |||
// 数据源 | |||
dataSource: { | |||
Department: Object.entries(this.GET_GLOBAL('department')).map(e => { | |||
return { | |||
value: e[0], | |||
text: e[1].name | |||
} | |||
}), | |||
CreateUser: Object.entries(this.GET_GLOBAL('user')).map(e => { | |||
return { | |||
value: e[0], | |||
text: e[1].name | |||
} | |||
}), | |||
Week: Object.values(this.GET_GLOBAL('dataDictionary').Week).map(t => ({ | |||
value: t.value, | |||
text: t.text | |||
})), | |||
Status: [{ value: 0, text: '草稿' }, { value: 1, text: '审批中' }, { value: 2, text: '审批通过' }, { value: 3, text: '发布' }, { value: 4, text: '作废' }] | |||
}, | |||
// 页面相关参数 | |||
ready: false, | |||
tips: '加载中...', | |||
loadState: '向下翻以加载更多', | |||
sideOpen: false, | |||
// 列表与分页信息 | |||
page: 1, | |||
total: 2, | |||
list: [] | |||
} | |||
}, | |||
async onLoad({ Status }) { | |||
if(Status){ | |||
this.queryData.Status = Status | |||
this.searchData.Status = Status | |||
} | |||
await this.init() | |||
}, | |||
onUnload() { | |||
this.OFF('list-change') | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init() { | |||
this.ON('list-change', this.reset) | |||
// 拉取加载列表和数据源 | |||
await Promise.all([ | |||
]) | |||
await this.fetchList() | |||
// 初始化查询条件 | |||
this.defaultQueryData = this.COPY(this.queryData) | |||
this.ready = true | |||
}, | |||
// 拉取列表 | |||
async fetchList(isConcat = true) { | |||
if (this.page > this.total) { return } | |||
this.loadState = '数据加载中...' | |||
const result = await this.HTTP_GET( | |||
'learun/departmentWeek/pagelist', | |||
{ | |||
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序) | |||
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序 | |||
pagination: { rows: 10, page: this.page, sidx: 'CreateTime', sord: 'DESC', }, | |||
queryJson: JSON.stringify(this.searchData) | |||
}, | |||
'加载数据时出错' | |||
) | |||
if (!result) { return } | |||
this.total = result.total | |||
this.page = result.page + 1 | |||
this.list = isConcat ? this.list.concat(result.rows) : result.rows; | |||
this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项` | |||
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多' | |||
}, | |||
// 刷新清空列表 | |||
async refreshList(isConcat = true) { | |||
this.page = 1 | |||
this.total = 2 | |||
this.list = [] | |||
await this.fetchList(isConcat) | |||
}, | |||
// 列表下拉 | |||
pullDown() { | |||
this.refreshList().then(() => { | |||
this.$refs.list.stopPullDown() | |||
}) | |||
}, | |||
// 设置搜索条件 | |||
async searchChange() { | |||
const result = {} | |||
// 时间查询相关参数 | |||
if (this.dateRange) { | |||
result.StartTime = this.dateRange.start | |||
result.EndTime = this.dateRange.end | |||
} | |||
// 将其他查询项添加到查询 JSON 中 | |||
const queryObj = pickBy(this.queryData, t => (Array.isArray(t) ? t.length > 0 : t)) | |||
Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t))) | |||
this.searchData = result | |||
await this.refreshList(false) | |||
}, | |||
// 点击「清空查询条件」按钮 | |||
reset() { | |||
this.queryData = this.COPY(this.defaultQueryData) | |||
this.searchChange() | |||
}, | |||
// 点击「编辑」、「查看」、「添加」、「删除」按钮 | |||
async action(type, id = '') { | |||
switch (type) { | |||
case 'view': | |||
this.NAV_TO(`./single?type=view&id=${id}`) | |||
return | |||
case 'add': | |||
this.NAV_TO('./single?type=create') | |||
return | |||
case 'edit': | |||
this.NAV_TO(`./single?type=edit&id=${id}`) | |||
return | |||
case 'submit': | |||
if (!(await this.CONFIRM('提交项目', '是否确认提交该项?', true))) { | |||
return | |||
} | |||
this.HTTP_POST('learun/departmentWeek/changeStatusById', id, '提交失败').then( | |||
success => { | |||
if (!success) { | |||
return | |||
} | |||
this.TOAST('提交成功', 'success') | |||
this.refreshList() | |||
}) | |||
return | |||
case 'push': | |||
if (!(await this.CONFIRM('提交项目', '是否确认发布已审核通过的项目?', true))) { | |||
return | |||
} | |||
this.HTTP_POST('learun/departmentWeek/pushForm', id, '发布失败').then( | |||
success => { | |||
if (!success) { | |||
return | |||
} | |||
this.TOAST('发布成功', 'success') | |||
this.refreshList() | |||
}) | |||
return | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除该项吗?', true))) { | |||
return | |||
} | |||
this.HTTP_POST('learun/departmentWeek/deleteForm', id, '删除失败').then( | |||
success => { | |||
if (!success) { | |||
return | |||
} | |||
this.TOAST('删除成功', 'success') | |||
this.refreshList() | |||
}) | |||
return | |||
default: | |||
return | |||
} | |||
}, | |||
// 显示列表中的标题项 | |||
displayListItem(item, field) { | |||
const fieldItem = this.scheme[field] | |||
const value = item[field] | |||
switch (fieldItem.type) { | |||
case 'currentInfo': | |||
case 'organize': | |||
return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType), `${value}.name`, '') | |||
case 'radio': | |||
case 'select': | |||
const selectItem = this.dataSource[field].find(t => t.value == String(value)) | |||
return get(selectItem, 'text', '') | |||
case 'checkbox': | |||
if (!value || value.split(',').length <= 0) { return '' } | |||
const checkboxItems = value.split(',') | |||
return this.dataSource[field].filter(t => checkboxItems.includes(t.value)).map(t => t.text).join(',') | |||
case 'datetime': | |||
if (!value) { return '' } | |||
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年M月D日' : 'YYYY-MM-DD HH:mm') | |||
default: return value === null || value === undefined ? '' : value | |||
} | |||
} | |||
} | |||
} | |||
</script> | |||
<style lang="less" scoped> | |||
@import '~@/common/css/sidepage.less'; | |||
@import '~@/common/css/customlist.less'; | |||
.customlist-banner-action { | |||
margin-top: 20rpx; | |||
text-align: right; | |||
.customlist-banner-action-btn { | |||
display: inline-block; | |||
padding: 4px 6px; | |||
margin: 0 3px; | |||
border-radius: 3px; | |||
text-align: center; | |||
} | |||
} | |||
.pushBtn{ | |||
position: absolute; | |||
right: 42px; | |||
top: 9px; | |||
padding: 2px; | |||
display: inline-block; | |||
} | |||
</style> |
@@ -0,0 +1,285 @@ | |||
<template> | |||
<view class="page"> | |||
<view v-if="ready"> | |||
<l-select @input="setValue('DepartmentWeek.CreateUser', $event)" | |||
:value="getValue('DepartmentWeek.CreateUser')" :range="dataSource.DepartmentWeek.CreateUser" title="发布人" | |||
required disabled /> | |||
<l-select @input="setValue('DepartmentWeek.Department', $event)" | |||
:value="getValue('DepartmentWeek.Department')" :range="dataSource.DepartmentWeek.Department" title="部门" | |||
required disabled /> | |||
<l-input @input="setValue('DepartmentWeek.Title', $event)" :disabled="!edit" | |||
:value="getValue('DepartmentWeek.Title')" title="标题" required /> | |||
<l-select @input="setValue('DepartmentWeek.Week', $event)" :value="getValue('DepartmentWeek.Week')" | |||
:range="dataSource.DepartmentWeek.Week" title="周别" required :disabled="!edit" /> | |||
<l-datetime-picker @input="setValue('DepartmentWeek.CreateTime', $event)" | |||
:value="getValue('DepartmentWeek.CreateTime')" disabled title="发布时间" required /> | |||
<view class="tableTitle"> | |||
一、常规工作安排 | |||
</view> | |||
<l-customform-table @input="setValue('DepartmentWeek.Firset',$event)" :value="getValue('DepartmentWeek.Firset')" | |||
:item="scheme.DepartmentWeek.Firset" :edit="edit" /> | |||
<view class="hasNotData" v-if="!current.DepartmentWeek.Firset.length"> | |||
暂无数据 | |||
</view> | |||
<view class="tableTitle"> | |||
二、特色、创新(小微改革)工作安排 | |||
</view> | |||
<l-customform-table @input="setValue('DepartmentWeek.Second',$event)" :value="getValue('DepartmentWeek.Second')" | |||
:item="scheme.DepartmentWeek.Second" :edit="edit" /> | |||
<view class="hasNotData" v-if="!current.DepartmentWeek.Second.length"> | |||
暂无数据 | |||
</view> | |||
<!-- <l-textarea @input="setValue('DepartmentWeek.Remark', $event)" :value="getValue('DepartmentWeek.Remark')" | |||
:readonly="!edit" title="备注" /> --> | |||
<!-- <l-upload-file @input="setValue('DepartmentWeek.FilePath', $event)" | |||
:value="getValue('DepartmentWeek.FilePath')" tableName="DepartmentWeek" fieldName="FilePath" title="附件" | |||
:number="9" :readonly="!edit" /> --> | |||
</view> | |||
<view v-if="ready && edit && current.DepartmentWeek" class="bg-white margin-tb padding" | |||
style="padding-top: 0; overflow: hidden;"> | |||
<l-button v-if="edit" @click="action('save')" size="lg" color="green" class="block margin-top" block> | |||
提交保存 | |||
</l-button> | |||
<!-- <l-button v-if="!edit && mode !== 'create'" @click="action('edit')" size="lg" line="orange" class="block margin-top" block> | |||
编辑本页 | |||
</l-button> | |||
<l-button v-if="edit && mode !== 'create'" @click="action('reset')" size="lg" line="red" class="block margin-top" block> | |||
取消编辑 | |||
</l-button> | |||
<l-button v-if="!edit && mode !== 'create'" @click="action('delete')" size="lg" line="red" class="block margin-top" block> | |||
删除 | |||
</l-button> --> | |||
</view> | |||
</view> | |||
</template> | |||
<script> | |||
/* | |||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 上海力软信息技术有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-10-20 09:25 | |||
* 描 述:活动安排 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/PersonnelManagement/BookBorrow/single", "style": { "navigationBarTitleText": "表单详情页" } } | |||
* | |||
* (navigationBarTitleText 字段为本页面的标题文本,可以修改) | |||
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件) | |||
*/ | |||
import get from 'lodash/get' | |||
import set from 'lodash/set' | |||
import moment from 'moment' | |||
import customPageMixins from '@/common/custompage.js' | |||
export default { | |||
mixins: [customPageMixins], | |||
data() { | |||
return { | |||
// 页面相关参数 | |||
id: null, | |||
mode: null, | |||
edit: null, | |||
ready: false, | |||
// 表单数据 | |||
current: {}, | |||
origin: {}, | |||
// 表单项数据结构 | |||
scheme: { | |||
DepartmentWeek: { | |||
Title: { type: 'text', title: '标题', verify: "NotNull" }, | |||
Week: { type: 'select', title: '周别', verify: "NotNull" }, | |||
Department: { type: 'select', title: '部门', verify: "NotNull" }, | |||
CreateUser: { type: 'select', title: '发布人', verify: "NotNull" }, | |||
CreateTime: { type: 'datetime', title: '发布日期', verify: "NotNull" }, | |||
Firset: { | |||
type: 'girdtable', title: '常规工作安排', __defaultItem__: {}, fieldsData: [ | |||
{ field: 'MainWork', type: 'input', name: '主要工作' }, | |||
{ field: 'TimeLimitFinish', type: 'input', name: '完成时限' }, | |||
{ field: 'PersonAndDepartment', type: 'input', name: '负责人及关联部门' }, | |||
{ field: 'QuestSpecialProject', type: 'input', name: '对接专项任务' }, | |||
{ field: 'Remark', type: 'input', name: '备注' }, | |||
] | |||
}, | |||
Second: { | |||
type: 'girdtable', title: '特色、创新(小微改革)工作安排', __defaultItem__: {}, fieldsData: [ | |||
{ field: 'MainWork', type: 'input', name: '主要工作' }, | |||
{ field: 'TimeLimitFinish', type: 'input', name: '完成时限' }, | |||
{ field: 'PersonAndDepartment', type: 'input', name: '负责人及关联部门' }, | |||
{ field: 'QuestSpecialProject', type: 'input', name: '对接专项任务' }, | |||
{ field: 'Remark', type: 'input', name: '备注' }, | |||
] | |||
}, | |||
}, | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
DepartmentWeek: { | |||
Department: Object.entries(this.GET_GLOBAL('department')).map(e => { | |||
return { | |||
value: e[0], | |||
text: e[1].name | |||
} | |||
}), | |||
CreateUser: Object.entries(this.GET_GLOBAL('user')).map(e => { | |||
return { | |||
value: e[0], | |||
text: e[1].name | |||
} | |||
}), | |||
Week: Object.values(this.GET_GLOBAL('dataDictionary').Week).map(t => ({ | |||
value: t.value, | |||
text: t.text | |||
})), | |||
}, | |||
} | |||
} | |||
}, | |||
async onLoad({ type, id }) { | |||
await this.init(type, id) | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init(type, id) { | |||
this.LOADING('加载数据中...') | |||
this.id = id | |||
this.mode = type | |||
this.edit = ['create', 'edit'].includes(this.mode) | |||
// 拉取表单数据,同时拉取所有来自数据源的选单数据 | |||
await Promise.all([ | |||
]) | |||
await this.fetchForm() | |||
this.ready = true | |||
this.HIDE_LOADING() | |||
}, | |||
// 加载表单数据 | |||
async fetchForm() { | |||
if (this.mode === 'create') { | |||
this.origin = await this.getDefaultForm() | |||
let userInfo = this.GET_GLOBAL('loginUser'); | |||
// 赋值当前部门人员数据 | |||
this.origin.DepartmentWeek.Department = userInfo.departmentId | |||
this.origin.DepartmentWeek.CreateUser = userInfo.userId | |||
// 表格默认值 | |||
this.origin.DepartmentWeek.Firset = [] | |||
this.origin.DepartmentWeek.Second = [] | |||
} else { | |||
const result = await this.HTTP_GET('learun/departmentWeek/getFormData', this.id) | |||
this.origin = await this.formatFormData({ DepartmentWeek: { ...result.DepartmentWeek, Firset: result.Firset || [], Second: result.Second || [] } }) | |||
} | |||
this.current = this.COPY(this.origin) | |||
}, | |||
// 点击 「编辑」、「重置」、「保存」、「删除」 按钮 | |||
async action(type) { | |||
switch (type) { | |||
case 'edit': | |||
this.edit = true | |||
break | |||
case 'reset': | |||
this.current = this.COPY(this.origin) | |||
this.edit = false | |||
break | |||
case 'save': | |||
const verifyResult = this.verifyForm() | |||
if (verifyResult.length > 0) { | |||
this.CONFIRM('表单验证失败', verifyResult.join('\n')) | |||
return | |||
} | |||
if (!(await this.CONFIRM('提交确认', '确定要提交本页表单内容吗?', true))) { | |||
return | |||
} | |||
this.LOADING('正在提交...') | |||
const postData = await this.getPostData(this.id) | |||
// 处理表格数据 | |||
let strEntity = JSON.parse(postData.strEntity) | |||
postData.Firset = JSON.stringify(strEntity.Firset) | |||
delete strEntity.Firset | |||
postData.Second = JSON.stringify(strEntity.Second) | |||
delete strEntity.Second | |||
// 赋值部门和人员数据 | |||
// let userInfo = this.GET_GLOBAL('loginUser'); | |||
// let obj = this.dataSource.DepartmentWeek.Department.find(e => e.value == this.origin.DepartmentWeek.Department) | |||
// strEntity.DepartmentName = obj ? obj.text : '' | |||
// strEntity.CreatUserName = userInfo.realName | |||
postData.strEntity = JSON.stringify(strEntity) | |||
// console.log(postData,JSON.parse(postData.strEntity)) | |||
// this.HIDE_LOADING() | |||
// return | |||
this.HTTP_POST('learun/departmentWeek/saveForm', postData, '表单提交保存失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('list-change') | |||
this.TOAST('提交保存成功') | |||
setTimeout(() => { | |||
this.NAV_BACK() | |||
}, 600) | |||
}) | |||
break | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) { | |||
return | |||
} | |||
this.LOADING('提交删除中...') | |||
this.HTTP_POST('learun/departmentWeekk/deleteForm', this.id, '删除失败').then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('list-change') | |||
this.NAV_BACK() | |||
this.this.TOAST('删除成功', 'success') | |||
}) | |||
break | |||
default: break | |||
} | |||
}, | |||
// 获取表单值 | |||
getValue(path) { | |||
return get(this.current, path) | |||
}, | |||
// 设置表单值 | |||
setValue(path, val) { | |||
set(this.current, path, val) | |||
}, | |||
} | |||
} | |||
</script> | |||
<style> | |||
.tableTitle{ | |||
font-size: 15px; | |||
color: #2f2f2f; | |||
padding: 14px; | |||
} | |||
.hasNotData{ | |||
text-align: center; | |||
font-size: 14px; | |||
padding: 14px; | |||
color: #666; | |||
} | |||
</style> |
@@ -611,6 +611,8 @@ export default { | |||
let categoryId = null; | |||
if (titleName == "待办事项") { | |||
this.NAV_TO("/pages/nworkflow/myflow/list", {tab:1}, true); | |||
}else if (titleName == "周工作计划") { | |||
this.NAV_TO("/pages/EducationalAdministration/departmentWeek/list",{Status:3}); | |||
}else{ | |||
if(titleName == "通知公告")categoryId= 1; | |||
if(titleName == "校园新闻")categoryId= 2; | |||