Переглянути джерело

app2.0工作日志管理添加发送功能

应县
ndbs 1 рік тому
джерело
коміт
c4177a63af
4 змінених файлів з 100 додано та 50 видалено
  1. +25
    -5
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/JournalApi.cs
  2. +1
    -5
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JournalSend/JournalSendService.cs
  3. +3
    -2
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/JournalSend/list.vue
  4. +71
    -38
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/JournalSend/single.vue

+ 25
- 5
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/JournalApi.cs Переглянути файл

@@ -32,8 +32,10 @@ namespace Learun.Application.WebApi
Get["/form"] = GetForm;
Post["/delete"] = DeleteForm;
Post["/save"] = SaveForm;
Post["/saveDraft"] = SaveDraft;
Post["/saveDraft"] = SaveDraft;
Post["/savePt"] = SavePt;
Post["/send"] = Send;

}
#region 获取数据

@@ -45,14 +47,20 @@ namespace Learun.Application.WebApi
public Response GetPageList(dynamic _)
{
ReqPageParam parameter = this.GetReqData<ReqPageParam>();
var data = journalIBLL.GetPageList(parameter.pagination, parameter.queryJson).ToList();
var result = data.Where(a => a.JSenderId == userInfo.userId || a.JReceiveId.Contains(userInfo.userId));
var data = journalIBLL.GetPageList(parameter.pagination, parameter.queryJson);
if (data != null)
{
foreach (var item in data)
{
item.JContent = WebHelper.HtmlDecode(item.JContent);
}
}
var jsonData = new
{
rows = result,
rows = data,
total = parameter.pagination.total,
page = parameter.pagination.page,
records = result.Count(),
records = data.Count()
};
return Success(jsonData);
}
@@ -77,6 +85,10 @@ namespace Learun.Application.WebApi
{
string keyValue = this.GetReqData();
var JournalSendData = journalIBLL.GetJournalSendEntityNoHtml(keyValue);
if (JournalSendData != null)
{
JournalSendData.JContent = WebHelper.HtmlDecode(JournalSendData.JContent);
}
var jsonData = new
{
JournalSend = JournalSendData,
@@ -150,6 +162,7 @@ namespace Learun.Application.WebApi
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
JournalSendEntity entity = parameter.strEntity.ToObject<JournalSendEntity>();
var userInfo = LoginUserInfo.Get();
//entity.JContent = WebHelper.HtmlDecode(entity.JContent);
entity.JSenderId = userInfo.userId;
entity.JSender = userInfo.realName;
entity.JIsSend = false;
@@ -158,6 +171,13 @@ namespace Learun.Application.WebApi

return Success("保存成功!");
}

public Response Send(dynamic _)
{
string keyValue = this.GetReqData();
journalIBLL.Send(keyValue);
return Success("发送成功!");
}
#endregion

#region 私有类


+ 1
- 5
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JournalSend/JournalSendService.cs Переглянути файл

@@ -48,11 +48,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
dp.Add("keyword", "%" + queryParam["keyword"].ToString() + "%", DbType.String);
strSql.Append(" AND JTitle Like @keyword ");
}
if (!queryParam["userId"].IsEmpty())
{
dp.Add("userId", "" + queryParam["userId"].ToString() + "", DbType.String);
strSql.Append(" AND JSenderId=@userId ");
}
strSql.Append($" AND (JSenderId='{ LoginUserInfo.Get().userId}' or (JReceiveId like '%{ LoginUserInfo.Get().userId}%' and JIsSend = 1))");
return this.BaseRepository().FindList<JournalSendEntity>(strSql.ToString(), dp, pagination);
}
catch (Exception ex)


+ 3
- 2
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/JournalSend/list.vue Переглянути файл

@@ -28,11 +28,12 @@

<view class="customlist-item-field">
<text class="customlist-item-field-title">日志内容:</text>
{{ displayListItem(item, 'JContent') }}
<view v-html="displayListItem(item, 'JContent')"></view>
</view>


<l-customlist-action :showEdit="user.userId != item.JReceiveId" @edit="action('edit', item.JournalSendId)" :showDelete="user.userId != item.JReceiveId"
<l-customlist-action :showEdit="user.userId != item.JReceiveId && !item.JIsSend" @edit="action('edit', item.JournalSendId)" :showDelete="user.userId != item.JReceiveId && !item.JIsSend"
@delete="action('delete', item.JournalSendId)" @view="action('view', item.JournalSendId)" />
</view>
</l-customlist>


+ 71
- 38
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/JournalSend/single.vue Переглянути файл

@@ -5,23 +5,28 @@
:disabled="!edit" title="日志主题" required />
<l-select @input="setValue('JournalSend.JTypeId', $event)" :value="getValue('JournalSend.JTypeId')"
:disabled="!edit" :range="dataSource.JournalSend.JTypeId" title="日志类型" required />
<!-- <l-organize-picker @input="setValue('JournalSend.JReceiveId', $event)"
:value="getValue('JournalSend.JReceiveId')" :readonly="!edit" type="user" title="接收人" required /> -->
<l-organize-picker @input="setValue('JournalSend.JReceiveId', $event)"
:value="getValue('JournalSend.JReceiveId')" :readonly="!edit" type="user" title="接收人"
:multiple="true"
/>
<l-textarea @input="setValue('JournalSend.JContent', $event)" :value="getValue('JournalSend.JContent')"
:readonly="!edit" title="日志内容" required />
</view>

<view v-if="ready && edit" 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" @click="action('send',true)" size="lg" color="orange" 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"
<!-- <l-button v-if="edit && mode !== 'create'" @click="action('reset')" size="lg" line="red"
class="block margin-top" block>
取消编辑
</l-button>
</l-button> -->
<!-- <l-button v-if="!edit && mode !== 'create'" @click="action('delete')" size="lg" line="red" class="block margin-top" block>
删除
</l-button> -->
@@ -58,6 +63,7 @@

data() {
return {
contentTextArea:"",
// 页面相关参数
id: null,
mode: null,
@@ -82,12 +88,12 @@
dataSource: '0',
verify: "NotNull"
},
// JReceiveId: {
// type: 'organize',
// title: '接收人',
// dataType: 'user',
// verify: "NotNull"
// },
JReceiveId: {
type: 'organize',
title: '接收人',
dataType: 'user',
verify: "NotNull"
},
JContent: {
type: 'textarea',
title: '日志内容',
@@ -125,7 +131,7 @@
this.id = id
this.mode = type
this.edit = ['create', 'edit'].includes(this.mode)
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([

@@ -144,11 +150,43 @@
this.origin = await this.getDefaultForm()
} else {
const result = await this.HTTP_GET('learun/adms/EducationalAdministration/Journal/form', this.id)
let doc = document.createElement("div");
doc.innerHTML = result.JournalSend.JContent;
let value = doc.innerText
result.JournalSend.JContent = value
this.origin = await this.formatFormData(result)
}
this.current = this.COPY(this.origin)
},

async save(tipFlag){
const verifyResult = this.verifyForm()
if (verifyResult.length > 0) {
this.CONFIRM('表单验证失败', verifyResult.join('\n'))
return
}
if (tipFlag && !(await this.CONFIRM('提交确认', '确定要提交本页表单内容吗?', true))) {
return
}
if(tipFlag) this.LOADING('正在提交...')
const postData = await this.getPostData(this.id)
this.HTTP_POST('learun/adms/EducationalAdministration/Journal/savePt', postData, '表单提交保存失败')
.then(success => {
this.HIDE_LOADING()
if (!success) {
return
}
if(tipFlag){
this.EMIT('EducationalAdministrationJournalSend-list-change')
this.NAV_BACK()
this.TOAST('提交保存成功')
}
})
},
// 点击 「编辑」、「重置」、「保存」、「删除」 按钮
async action(type) {
switch (type) {
@@ -164,30 +202,7 @@
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)

this.HTTP_POST('learun/adms/EducationalAdministration/Journal/savePt', postData, '表单提交保存失败')
.then(success => {
this.HIDE_LOADING()
if (!success) {
return
}

this.EMIT('EducationalAdministrationJournalSend-list-change')
this.NAV_BACK()
this.TOAST('提交保存成功')
})
await this.save(true)
break

case 'delete':
@@ -208,7 +223,25 @@
this.this.TOAST('删除成功', 'success')
})
break

case 'send':
await this.save();
if (!(await this.CONFIRM('发送确认', '确定要发送本页表单内容吗?', true))) {
return
}
this.LOADING('正在发送...')
this.HTTP_POST('learun/adms/EducationalAdministration/Journal/send', this.id, '表单发送失败')
.then(success => {
this.HIDE_LOADING()
if (!success) {
return
}
this.EMIT('EducationalAdministrationJournalSend-list-change')
this.NAV_BACK()
this.TOAST('发送成功')
})
break
default:
break
}


Завантаження…
Відмінити
Зберегти