完善后台诉求列表
This commit is contained in:
parent
dd8d756149
commit
7d229466e3
@ -71,7 +71,7 @@ class Article extends BaseController
|
||||
->page($params['page'])
|
||||
->limit($params['limit'])
|
||||
->order('id desc')
|
||||
->field('id,title,user_id,county,township,village,image,view_time')
|
||||
->field('id,title,user_id,content,county,township,village,image,view_time')
|
||||
|
||||
->select();
|
||||
$result = ['total' => $total, 'data' => $list];
|
||||
|
@ -34,11 +34,66 @@ class Feedback extends BaseController
|
||||
public function index()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$params= get_params();
|
||||
$params['category_id']=$this->category_id;
|
||||
(new Article())->index($params);
|
||||
$params = get_params();
|
||||
$where[]= ['status','=',1];
|
||||
if (isset($params['keywords']) && !empty($params['keywords'])){
|
||||
$where[]=['title','like','%'.$params['keywords'].'%'];
|
||||
}
|
||||
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
|
||||
$www['admin_id'] = $this->adminInfo['id'];
|
||||
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
|
||||
if ($user_address) {
|
||||
if ($user_address['auth_range'] == 1) {
|
||||
$where[]= ['county','=',$user_address['area_id']];
|
||||
$where[] =['township','=', $user_address['street_id']];
|
||||
$where[] =['village','=', $user_address['village_id']];
|
||||
} elseif ($user_address['auth_range'] == 2) {
|
||||
$where[]= ['county','=',$user_address['area_id']];
|
||||
$where[] =['township','=', $user_address['street_id']];
|
||||
}
|
||||
}
|
||||
}
|
||||
$category_id =$params['category_id'];
|
||||
|
||||
if($category_id){
|
||||
$map[] = ['category_id','in',$category_id];
|
||||
}else{
|
||||
$map = [];
|
||||
}
|
||||
$total = Db::table('fa_article')
|
||||
->where($where)
|
||||
->where($map)
|
||||
->count();
|
||||
|
||||
$list = Db::table('fa_article')
|
||||
->withAttr('nickname',function ($value,$data){
|
||||
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('name');
|
||||
})
|
||||
->withAttr('area',function ($value,$data){
|
||||
return Db::table('fa_geo_area')->where('area_code',$data['county'])->value('area_name');
|
||||
})
|
||||
->withAttr('street',function ($value,$data){
|
||||
return Db::table('fa_geo_street')->where('street_code',$data['township'])->value('street_name');
|
||||
})
|
||||
->withAttr('village',function ($value,$data){
|
||||
return Db::table('fa_geo_village')->where('village_id',$data['village'])->value('village_name');
|
||||
})
|
||||
->where($where)
|
||||
->where($map)
|
||||
->page($params['page'])
|
||||
->limit($params['limit'])
|
||||
->order('id desc')
|
||||
->field('id,title,user_id,content,is_solve,county,township,village,image,view_time')
|
||||
->select();
|
||||
|
||||
$result = ['total' => $total, 'data' => $list];
|
||||
|
||||
return table_assign(0, '', $result);
|
||||
}
|
||||
return view('nk/article/index',['url'=>$this->url]);
|
||||
|
||||
View::assign('url', $this->url);
|
||||
|
||||
return view();
|
||||
}
|
||||
/**
|
||||
* 添加
|
||||
@ -76,12 +131,30 @@ class Feedback extends BaseController
|
||||
*/
|
||||
public function read()
|
||||
{
|
||||
$params = get_params();
|
||||
(new Article())->read($params);
|
||||
$param= get_params();
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
|
||||
return view('nk/article/read',['url'=>$this->url]);
|
||||
$detail = Db::table('fa_article')->where('id',$id)->find();
|
||||
|
||||
if ($detail) {
|
||||
|
||||
$detail['comment'] = Db::table('fa_article_comment')
|
||||
->where('vote_id',$id)
|
||||
->withAttr('user_info',function ($value,$data){
|
||||
return Db::table('fa_szxc_information_usermsg')->where('user_id', $data['user_id'])->value('name');
|
||||
})
|
||||
->select();
|
||||
|
||||
View::assign('detail', $detail);
|
||||
View::assign('admin_id', $this->adminInfo['id']);
|
||||
return view();
|
||||
|
||||
}else{
|
||||
throw new \think\exception\HttpException(404, '找不到页面');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
|
221
app/admin/view/nk/feedback/add.html
Normal file
221
app/admin/view/nk/feedback/add.html
Normal file
@ -0,0 +1,221 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.editormd-code-toolbar select {display: inline-block}
|
||||
.editormd li {list-style: inherit;}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">新建文章</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td class="layui-td-gray">文章标题<font>*</font></td>
|
||||
<td colspan="7"><input type="text" name="title" lay-verify="required" lay-reqText="请输入文章标题"
|
||||
autocomplete="off" placeholder="请输入文章标题" class="layui-input"></td>
|
||||
</tr>
|
||||
{notempty name="is_vote"}
|
||||
<tr>
|
||||
<td class="layui-td-gray">结束时间<font>*</font></td>
|
||||
<td colspan="7"> <input type="text" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input" id="test1" name="end_time">
|
||||
<input type="hidden" name="is_vote" value="1">
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
<tr>
|
||||
<td class="layui-td-gray" style="vertical-align:top;">文章摘要</td>
|
||||
<td colspan="3">
|
||||
<textarea name="describe" placeholder="请输入摘要,不能超过200个字" class="layui-textarea"></textarea>
|
||||
</td>
|
||||
<td class="layui-td-gray" style="vertical-align:top;">缩略图</td>
|
||||
<td>
|
||||
<div class="layui-upload">
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">上传缩略图(尺寸:640x360)</button>
|
||||
<div class="layui-upload-list" id="upload_box_thumb" style="width: 120px; height:66px; overflow: hidden;">
|
||||
<img src="" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" width="100" style="max-width: 100%; height:66px;"/>
|
||||
<input type="hidden" name="image" value="">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{if {:session('gougu_admin')['group_access']==1}
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray" style="vertical-align:top;">区县</td>
|
||||
<td colspan="3">
|
||||
<div class="layui-col-md6">
|
||||
<div >
|
||||
<select name="county" lay-filter="area_id" >
|
||||
{volist name='street' id='vo'}
|
||||
<option value="{$vo.code}" >{$vo.name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray" style="vertical-align:top;">街道/镇</td>
|
||||
<td colspan="3">
|
||||
<div class="layui-col-md6">
|
||||
<div >
|
||||
<div id="demo1" ></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray" style="vertical-align:top;">村/社区</td>
|
||||
<td colspan="3">
|
||||
<div class="layui-col-md6">
|
||||
<div >
|
||||
<div id="demo2" ></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">用户<font>*</font></td>
|
||||
<td colspan="3">
|
||||
<div class="layui-col-md6">
|
||||
<select name="user_id" lay-verify="required" lay-search="">
|
||||
<option value="" >请选择</option>
|
||||
{volist name='users' id='vo'}
|
||||
<option value="{$vo.user_id}" >{$vo.name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td colspan="6" class="layui-td-gray" style="text-align:left">文章内容</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<textarea class="layui-textarea" id="container_content"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/xm-select.js"></script>
|
||||
<script>
|
||||
const editorType = '{$editor}';
|
||||
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
||||
var group_access = "{:session('gougu_admin')['group_access']}"
|
||||
function gouguInit() {
|
||||
var form =layui.form, tool = layui.tool,tagspicker = layui.tagpicker,laydate=layui.laydate;
|
||||
laydate.render({
|
||||
elem: '#test1' //指定元素
|
||||
});
|
||||
//上传缩略图
|
||||
var upload_thumb = layui.upload.render({
|
||||
elem: '#upload_btn_thumb',
|
||||
url: '/admin/api/upload',
|
||||
done: function (res) {
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
//上传成功
|
||||
$('#upload_box_thumb input').attr('value', res.data.filepath);
|
||||
$('#upload_box_thumb img').attr('src', res.data.filepath);
|
||||
}
|
||||
});
|
||||
|
||||
street();
|
||||
village();
|
||||
form.on('select(area_id)', function (data) {
|
||||
street(data.value)
|
||||
});
|
||||
function street (id) {
|
||||
var demo1 = xmSelect.render({
|
||||
name: 'township',
|
||||
el: '#demo1',
|
||||
initValue: [],
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'code',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
disabled: group_access == 2 ||group_access == 4? true : false,
|
||||
on: function (data) {
|
||||
var arr = data.arr;
|
||||
if(arr.length > 0){
|
||||
village(arr[0]['code']);
|
||||
}else{
|
||||
village();
|
||||
}
|
||||
},
|
||||
})
|
||||
$.get('/api/geo/street?pcode=' + id, function (result) {
|
||||
demo1.update({
|
||||
data: result.data
|
||||
})
|
||||
});
|
||||
}
|
||||
function village (id) {
|
||||
var demo2 = xmSelect.render({
|
||||
name: 'village',
|
||||
el: '#demo2',
|
||||
initValue: [],
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'id',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
disabled: group_access == 2 ? true : false,
|
||||
})
|
||||
$.get('/api/geo/village?pcode=' + id, function (result) {
|
||||
demo2.update({
|
||||
data: result.data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
var editor = layui.tinymce;
|
||||
var edit = editor.render({
|
||||
selector: "#container_content",
|
||||
height: 500
|
||||
});
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
data.field.content = tinyMCE.editors['container_content'].getContent();
|
||||
if (data.field.content == '') {
|
||||
layer.msg('请先完善文章内容');
|
||||
return false;
|
||||
}
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.tabRefresh(71);
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
tool.post('{$url[1]}', data.field, callback);
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
240
app/admin/view/nk/feedback/edit.html
Normal file
240
app/admin/view/nk/feedback/edit.html
Normal file
@ -0,0 +1,240 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.editormd-code-toolbar select {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.editormd li {
|
||||
list-style: inherit;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">编辑文章表</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td class="layui-td-gray">文章标题<font>*</font></td>
|
||||
<td colspan="7"><input type="text" name="title" lay-verify="required" lay-reqText="请输入文章标题"
|
||||
autocomplete="off" placeholder="请输入文章标题" class="layui-input"
|
||||
value="{$detail.title}"></td>
|
||||
</tr>
|
||||
{notempty name="is_vote"}
|
||||
<tr>
|
||||
<td class="layui-td-gray">结束时间<font>*</font></td>
|
||||
<td colspan="7"> <input type="text" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input" id="test1" name="end_time">
|
||||
<input type="hidden" name="is_vote" value="1">
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
<tr>
|
||||
<td class="layui-td-gray" style="vertical-align:top;">摘要</td>
|
||||
<td colspan="3">
|
||||
<textarea name="describe" placeholder="请输入摘要,不能超过200个字"
|
||||
class="layui-textarea">{$detail.describe}</textarea>
|
||||
</td>
|
||||
<td class="layui-td-gray" style="vertical-align:top;">缩略图</td>
|
||||
<td>
|
||||
<div class="layui-upload">
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">
|
||||
上传缩略图(尺寸:640x360)
|
||||
</button>
|
||||
<div class="layui-upload-list" id="upload_box_thumb"
|
||||
style="width: 120px; height:66px; overflow: hidden;">
|
||||
<img src="{$detail.image}"
|
||||
onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;"
|
||||
style="max-width: 100%; height:66px;"/>
|
||||
<input type="hidden" name="image" value="{$detail.image}">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{if {:session('gougu_admin')['group_access']==1}
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray" style="vertical-align:top;">区县</td>
|
||||
<td colspan="3">
|
||||
<div class="layui-col-md6">
|
||||
<div >
|
||||
<select name="county" lay-filter="area_id">
|
||||
{volist name='street' id='vo'}
|
||||
<option value="{$vo.code}" {if $detail.county==$vo.code} selected {/if}>{$vo.name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray" style="vertical-align:top;">街道/镇</td>
|
||||
<td colspan="3">
|
||||
<div class="layui-col-md6">
|
||||
<div >
|
||||
<div id="demo1" ></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray" style="vertical-align:top;">村/社区</td>
|
||||
<td colspan="3">
|
||||
<div class="layui-col-md6">
|
||||
<div >
|
||||
<div id="demo2" ></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">用户<font>*</font></td>
|
||||
<td colspan="3">
|
||||
<div class="layui-col-md6">
|
||||
<select name="user_id" lay-verify="required" lay-search="">
|
||||
<option value="" >请选择</option>
|
||||
{volist name='users' id='vo'}
|
||||
<option value="{$vo.user_id}" {if $detail.user_id==$vo.user_id} selected {/if}>{$vo.name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
<tr>
|
||||
<td colspan="6" class="layui-td-gray" style="text-align:left">文章内容</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<textarea placeholder="请输入内容" class="layui-textarea"
|
||||
id="container_content">{$detail.content}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<input type="hidden" name="id" value="{$detail.id}"/>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/xm-select.js"></script>
|
||||
<script>
|
||||
const editorType = '{$editor}';
|
||||
var moduleInit;
|
||||
if (editorType == 1) {
|
||||
moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
||||
} else {
|
||||
moduleInit = ['tool', 'tagpicker', 'editormd'];
|
||||
}
|
||||
var group_access = "{:session('gougu_admin')['group_access']}";
|
||||
var area_id = "{$detail.county}";
|
||||
var street_id = "{$detail.township}";
|
||||
function gouguInit() {
|
||||
var form =layui.form, tool = layui.tool,tagspicker = layui.tagpicker,laydate=layui.laydate;
|
||||
laydate.render({
|
||||
elem: '#test1' //指定元素
|
||||
});
|
||||
//上传缩略图
|
||||
var upload_thumb = layui.upload.render({
|
||||
elem: '#upload_btn_thumb',
|
||||
url: '/admin/api/upload',
|
||||
done: function (res) {
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败');
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
$('#upload_box_thumb input').attr('value', res.data.filepath);
|
||||
$('#upload_box_thumb img').attr('src', res.data.filepath);
|
||||
}
|
||||
});
|
||||
if (area_id != 0) {
|
||||
street(area_id)
|
||||
}
|
||||
if (street_id != 0) {
|
||||
village(street_id)
|
||||
}
|
||||
form.on('select(area_id)', function (data) {
|
||||
street(data.value)
|
||||
});
|
||||
function street (id) {
|
||||
var demo1 = xmSelect.render({
|
||||
name: 'township',
|
||||
el: '#demo1',
|
||||
initValue: ["{$detail.township}"],
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'code',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
disabled: group_access == 2 ||group_access == 4? true : false,
|
||||
on: function (data) {
|
||||
var arr = data.arr;
|
||||
if(arr.length > 0){
|
||||
village(arr[0]['code']);
|
||||
}else{
|
||||
village();
|
||||
}
|
||||
},
|
||||
})
|
||||
$.get('/api/geo/street?pcode=' + id, function (result) {
|
||||
demo1.update({
|
||||
data: result.data
|
||||
})
|
||||
});
|
||||
}
|
||||
function village (id) {
|
||||
var demo2 = xmSelect.render({
|
||||
name: 'village',
|
||||
el: '#demo2',
|
||||
initValue: ["{$detail.village}"],
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'id',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
disabled: group_access == 2 ? true : false,
|
||||
})
|
||||
$.get('/api/geo/village?pcode=' + id, function (result) {
|
||||
demo2.update({
|
||||
data: result.data
|
||||
})
|
||||
});
|
||||
}
|
||||
var editor = layui.tinymce;
|
||||
var edit = editor.render({
|
||||
selector: "#container_content",
|
||||
height: 500
|
||||
});
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
data.field.content = tinyMCE.editors['container_content'].getContent();
|
||||
if (data.field.content == '') {
|
||||
layer.msg('请先完善文章内容');
|
||||
return false;
|
||||
}
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
tool.post("{$url[2]}", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
178
app/admin/view/nk/feedback/index.html
Normal file
178
app/admin/view/nk/feedback/index.html
Normal file
@ -0,0 +1,178 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-t border-x">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="keywords" placeholder="请输入标题" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
|
||||
</form>
|
||||
<table class="layui-hide" id="article" lay-filter="article"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="status">
|
||||
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="is_home">
|
||||
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
<!-- <span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加内容">+ 添加内容</span> -->
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group">
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs {{# if(d.is_solve == 0){ }}{{# } else { }}layui-hide{{# } }}" lay-event="read">回复</a>
|
||||
<a class="layui-btn layui-btn-green layui-btn-xs {{# if(d.is_solve != 0){ }}{{# } else { }}layui-hide{{# } }}" lay-event="read">查看</a>
|
||||
<!-- <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a> -->
|
||||
|
||||
{if {:session('gougu_admin')['group_access']==1}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table,tool = layui.tool, form = layui.form;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#article',
|
||||
title: '文章表列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '{$url[0]}',
|
||||
page: true,
|
||||
limit: 20,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'left',
|
||||
field: 'id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'area',
|
||||
title: '区县',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'street',
|
||||
title: '乡镇',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'village',
|
||||
title: '街道/村',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'is_solve',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
width:120,
|
||||
templet: function (d)
|
||||
{
|
||||
switch (d.is_solve) {
|
||||
|
||||
case 0:
|
||||
return '待回复';
|
||||
break;
|
||||
case 1:
|
||||
return '已回复';
|
||||
break;
|
||||
|
||||
}
|
||||
return ;
|
||||
}
|
||||
},{
|
||||
field: 'title',
|
||||
title: '文章标题',
|
||||
},{
|
||||
field: 'content',
|
||||
title: '诉求内容',
|
||||
templet: function (d)
|
||||
{
|
||||
return d.content;
|
||||
}
|
||||
},{
|
||||
field: 'nickname',
|
||||
title: '用户',
|
||||
align: 'center',
|
||||
},{
|
||||
field: 'view_time',
|
||||
title: '发布时间',
|
||||
align: 'center',
|
||||
},{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
//监听表头工具栏事件
|
||||
table.on('toolbar(article)', function(obj){
|
||||
if (obj.event === 'add') {
|
||||
tool.side('{$url[1]}');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(article)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'read') {
|
||||
tool.side('{$url[4]}?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'edit') {
|
||||
tool.side('{$url[2]}?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'del') {
|
||||
layer.confirm('确定要删除该记录吗?', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function(index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete('{$url[3]}', { id: data.id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
keywords: data.field.keywords,
|
||||
cate_id: data.field.cate_id
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
87
app/admin/view/nk/feedback/read.html
Normal file
87
app/admin/view/nk/feedback/read.html
Normal file
@ -0,0 +1,87 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style>
|
||||
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="layui-form p-4">
|
||||
<h3 class="pb-3">诉求详情</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td class="layui-td-gray">诉求</td>
|
||||
<td colspan="3">{$detail.title}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">创建时间</td>
|
||||
<td>{$detail.view_time}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">诉求内容</td>
|
||||
<td colspan="5" class="content-article">
|
||||
{$detail.content|raw}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{if in_array($detail.category_id,[149,157,158,148,147,165]) }
|
||||
<tr >
|
||||
<td class="layui-td-gray">回复内容:</td>
|
||||
<td colspan="6">
|
||||
{volist name="$detail.comment" id="vo"}
|
||||
{$vo.user_info}的回复:{$vo.content}<br>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if $detail.is_solve == 0}
|
||||
{if in_array($detail.category_id,[149,157,158,148,147,165]) }
|
||||
<tr >
|
||||
<td class="layui-td-gray">回复:</td>
|
||||
<td colspan="6">
|
||||
<textarea class="layui-textarea" name="reply" ></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
|
||||
</table>
|
||||
{if in_array($detail.category_id,[149,157,158,148,147,165]) }
|
||||
<div class="pt-3">
|
||||
<input type="hidden" name="id" value="{$detail.id}"/>
|
||||
<input type="hidden" name="admin_id" value="{$admin_id}"/>
|
||||
<input type="hidden" name="content" value="{$detail.content}"/>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即回复</button>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
tool.post("/admin/api/reply", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
Loading…
x
Reference in New Issue
Block a user