优化页面
This commit is contained in:
@@ -8,11 +8,11 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"github.com/astaxie/beego"
|
||||||
"github.com/george518/PPGo_Job/models"
|
"github.com/george518/PPGo_Job/models"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"github.com/astaxie/beego"
|
|
||||||
"encoding/json"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type NotifyTplController struct {
|
type NotifyTplController struct {
|
||||||
@@ -85,6 +85,10 @@ func (self *NotifyTplController) AjaxSave() {
|
|||||||
notifyTpl.Content = strings.TrimSpace(self.GetString("content"))
|
notifyTpl.Content = strings.TrimSpace(self.GetString("content"))
|
||||||
notifyTpl.Status, _ = self.GetInt("status")
|
notifyTpl.Status, _ = self.GetInt("status")
|
||||||
|
|
||||||
|
if notifyTpl.Type == models.NotifyTplTypeSystem {
|
||||||
|
self.ajaxMsg("系统模板禁止更新", MSG_ERR)
|
||||||
|
}
|
||||||
|
|
||||||
if notifyTpl.TplType == 1 || notifyTpl.TplType == 2 || notifyTpl.TplType == 3 {
|
if notifyTpl.TplType == 1 || notifyTpl.TplType == 2 || notifyTpl.TplType == 3 {
|
||||||
m := make(map[string]string)
|
m := make(map[string]string)
|
||||||
err := json.Unmarshal([]byte(notifyTpl.Content), &m)
|
err := json.Unmarshal([]byte(notifyTpl.Content), &m)
|
||||||
@@ -93,10 +97,6 @@ func (self *NotifyTplController) AjaxSave() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if notifyTpl.Type == models.NotifyTplTypeSystem {
|
|
||||||
self.ajaxMsg("系统模板禁止更新", MSG_ERR)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := notifyTpl.Update(); err != nil {
|
if err := notifyTpl.Update(); err != nil {
|
||||||
self.ajaxMsg("更新失败,"+err.Error(), MSG_ERR)
|
self.ajaxMsg("更新失败,"+err.Error(), MSG_ERR)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label mw200">模板内容</label>
|
<label class="layui-form-label mw200">模板内容</label>
|
||||||
<div class="layui-input-inline mw400">
|
<div class="layui-input-inline mw400">
|
||||||
<textarea rows="10" name="content" id="content" placeholder="请输入模板内容" class="layui-textarea"></textarea>
|
<textarea rows="100" name="content" id="content" style="height: 300px" placeholder="请输入模板内容" class="layui-textarea"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-mid layui-word-aux" style="padding: 0px 0px !important;">
|
<div class="layui-form-mid layui-word-aux" style="padding: 0px 0px !important;">
|
||||||
<pre class="layui-code" style="margin: 0;">
|
<pre class="layui-code" style="margin: 0;">
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label mw200">模板内容</label>
|
<label class="layui-form-label mw200">模板内容</label>
|
||||||
<div class="layui-input-inline mw400">
|
<div class="layui-input-inline mw400">
|
||||||
<textarea rows="10" name="content" id="content" lay-verify="required" placeholder="请输入模板内容"
|
<textarea rows="100" name="content" id="content" style="height: 300px" lay-verify="required" placeholder="请输入模板内容"
|
||||||
class="layui-textarea">{{.notifyTpl.content}}</textarea>
|
class="layui-textarea">{{.notifyTpl.content}}</textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-mid layui-word-aux" style="padding: 0px 0px !important;">
|
<div class="layui-form-mid layui-word-aux" style="padding: 0px 0px !important;">
|
||||||
|
|||||||
Reference in New Issue
Block a user