' . $title . '
@@ -643,6 +643,15 @@ class table_theme
$this->search[] = self::input_search('v_text', '输入搜索内容');
$this->search[] = self::input_search('v_address', '输入地址');
$this->search[] = self::input_search('v_name', '输入场所名称');
+ $this->select2 = [
+ '_fiend' => ['v_hcname', '选择商圈', $_M['form']['v_hcname']],
+ 'placeholder' => '输入搜索商圈',
+ 'fiend' => 'v_hcname',
+ 'tname' => 'village',
+ 'source' => 'search',
+ 'allnone' => 2
+ ];
+ $this->search[] = self::input_select_search();
}
//底部按钮
@@ -895,8 +904,8 @@ class table_theme
$this->selctCityConfig['class'] = 'city-js';
$html .= self::th_select_city();
- $this->search['left'][] = self::th_toolmap('地图筛选',$html);
-
+ $this->search['left'][] = self::th_toolmap('地图筛选', $html);
+
// 区域
$this->selctCityConfig['class'] = 'search-city-js';
$this->search['left'][] = self::th_select_city();
@@ -904,6 +913,16 @@ class table_theme
$para = [['正常-按照广告位置排序', 0], ['推荐-将适合投放的提前排序', 1], ['选中-将选择中广告位提前排序', 2]];
$this->search['left'][] = self::para_select($para, ['eaps_order', '广告位排序', $_M['form']['eaps_order']], true, false);
$tsql = load::own_class('tsql', 'new');
+ $this->select2 = [
+ '_fiend' => ['vhcname', '选择商圈'],
+ 'placeholder' => '可选择多个商圈',
+ 'fiend' => 'v_hcname',
+ 'tname' => 'village',
+ 'source' => 'search',
+ 'allnone' => 0,
+ 'condition' => ''
+ ];
+ $this->search['left'][] = self::input_select_search_multiple();
$this->select2 = [
'_fiend' => ['e_vid', '选择场所', $_M['form']['e_vid']],
'placeholder' => '输入场所名称',
@@ -1094,16 +1113,27 @@ class table_theme
];
$this->search[] = self::input_select_search_multiple();
+ $this->select2 = [
+ '_fiend' => ['vhcname', '选择商圈'],
+ 'placeholder' => '可选择多个商圈',
+ 'fiend' => 'v_hcname',
+ 'tname' => 'village',
+ 'source' => 'search',
+ 'allnone' => 0,
+ 'condition' => ''
+ ];
+ $this->search[] = self::input_select_search_multiple();
+
// 区域
$this->selctCityConfig['class'] = 'search-city-js';
- $this->search[] = self::th_select_city();
+ $this->search[] = self::th_select_city();
$html = '';
// 地图区域
$this->selctCityConfig['type'] = 1;
$this->selctCityConfig['class'] = 'city-js';
$html .= self::th_select_city();
- $this->search[] = self::th_toolmap('地图筛选',$html);
+ $this->search[] = self::th_toolmap('地图筛选', $html);
}
//底部按钮
diff --git a/include/traits/tdata.class.php b/include/traits/tdata.class.php
index 93967f4..9014488 100644
--- a/include/traits/tdata.class.php
+++ b/include/traits/tdata.class.php
@@ -29,32 +29,50 @@ trait tdata
{
global $_M, $_YW;
$idArr = $vidArr = [];
+
+ $countvid = function ($idArr = [], $newvid = []) {
+ // if (count($newvid) == 0) $newvid = [-1];
+ if (count($idArr) > 0) {
+ $idArr = array_intersect($newvid, $idArr);
+ // 如果交集为空,则确实通过此条件进行了筛选,就要通知SQL没有任何值满足当前条件,将ID设置为0,肯定查找不到
+ // if (count($idArr) == 0) $idArr = [-1];
+ } else {
+ $idArr = $newvid;
+ }
+ if (count($idArr) == 0) $idArr = [-1];
+ return $idArr;
+ };
+
+ // 所属商圈
+ if (array_key_exists('vhcname', $this->form) && is_array($this->form['vhcname'])) {
+ $arrvhcname = array_map(function ($para) { return "'{$para}'"; }, $this->form['vhcname']);
+ $vhcname = arrayto_string($arrvhcname, ',');
+ $vid = $this->tsql->table('village')->qfield('id')->where("v_hcname IN({$vhcname}) ")->all();
+ $idArr = $countvid($idArr, array_column($vid, 'id'));
+ }
+
+ // 场所类型
if (is_array($this->form['vtype'])) {
$vtype = arrayto_string($this->form['vtype'], ',');
$vid = $this->tsql->table('village')->qfield('id')->where("v_type IN({$vtype})")->all();
- $idArr = array_column($vid, 'id');
- if (count($idArr) == 0) $idArr = [-1];
+ $idArr = $countvid($idArr, array_column($vid, 'id'));
}
+
+ // 地图选择
if ($this->form['v_id']) {
$vidArr = stringto_array($this->form['v_id'], ',');
// 取社区类型和地图筛选的交集,重叠ID,社区类型没有操作则直接按照地图筛选结果
// $idArr = count($idArr) > 0?array_intersect($vidArr,$idArr):$vidArr;
- if (count($idArr) > 0) {
- $idArr = array_intersect($vidArr, $idArr);
- // 如果交集为空,则确实通过此条件进行了筛选,就要通知SQL没有任何值满足当前条件,将ID设置为0,肯定查找不到
- if (count($idArr) == 0) $idArr = [-1];
- } else {
- $idArr = $vidArr;
- }
+ $idArr = $countvid($idArr, $vidArr);
}
-
+
$funWhere = function ($idArr, &$where) {
if (count($idArr) > 0) {
$strId = arrayto_string($idArr, ',');
$where .= " AND id IN({$strId}) ";
}
};
-
+
//区域
$v_province = $this->form['v_province'] && $this->form['v_province'] != '请选择' ? $this->form['v_province'] : '';
$v_city = $this->form['v_city'] && $this->form['v_city'] != '请选择' ? $this->form['v_city'] : '';
@@ -149,6 +167,7 @@ trait tdata
// 社区类型
// 先查询出需要的ID
+ if (isset($this->form['jsadd_vhcname'])) $this->form['vhcname'] = stringto_array($this->form['jsadd_vhcname'], ',');
if (isset($this->form['jsadd_vtype'])) $this->form['vtype'] = stringto_array($this->form['jsadd_vtype'], ',');
$idArr = self::fun_sqlk_vid();
// 通过ID筛选掉不需要的
@@ -413,7 +432,7 @@ trait tdata
$this->search_other = ['e_aps', 'e_bno', 'e_vid', 'e_enable'];
$where .= self::td_search();
case 'village':
- $this->search_input = ['v_name', 'v_text'];
+ $this->search_input = ['v_name', 'v_text', 'v_hcname'];
$where .= self::td_search();
$this->search_link = ['v_province', 'v_city', 'v_district', 'v_address'];
diff --git a/include/traits/tfield.class.php b/include/traits/tfield.class.php
index 2da484f..0be5282 100644
--- a/include/traits/tfield.class.php
+++ b/include/traits/tfield.class.php
@@ -27,6 +27,7 @@ trait tfield
return [
'v_name' => '场所名称',
'v_type' => '场所分类',
+ 'v_hcname' => '所属商圈',
'v_totalstr' => '广告状态',
'v_address' => '场所地址',
'v_lxname' => '联系人',
@@ -62,9 +63,11 @@ trait tfield
// 导出专用
$barray = [
'e_enable' => '状态',
- 'e_number' => '广告位编号',
+ // 'e_number' => '广告位编号',
'e_size' => '广告位规格',
'e_vid' => '场所名称',
+ 'v_vaddress' => '场所地址',
+ 'v_hcname' => '所属商圈',
'e_bno' => '门口方位',
'e_aps' => '广告位位置',
'h_cid' => '签定的公司',
@@ -217,6 +220,7 @@ trait tfield
$array = [
'v_name' => '场所名称',
'v_type' => '场所分类',
+ 'v_hcname' => '所属商圈',
'v_district' => '所属区域',
'v_address' => '场所地址',
'v_enum' => '广告位',
diff --git a/include/traits/tlist.class.php b/include/traits/tlist.class.php
index 3bc6f3e..3e12b8a 100644
--- a/include/traits/tlist.class.php
+++ b/include/traits/tlist.class.php
@@ -93,22 +93,43 @@ trait tlist
{
global $_M, $_YW;
//门口方位
- if (empty(self::$para['e_bno']))
- self::$para['e_bno'] = parent::translate(3);
+ if (empty(self::$para['e_bno'])) self::$para['e_bno'] = parent::translate(3);
//广告位置
- if (empty(self::$para['e_aps']))
- self::$para['e_aps'] = parent::translate();
+ if (empty(self::$para['e_aps'])) self::$para['e_aps'] = parent::translate();
//场所
- if (empty(self::$village[ $val['e_vid'] ]))
- self::$village[ $val['e_vid'] ] = parent::villagelist($val['e_vid']);
+ if (array_key_exists('v_hcname', $val) || array_key_exists('v_vaddress', $val)) {
+ //小区
+ if (empty(self::$village[ $val['e_vid'] ])) self::$village[ $val['e_vid'] ] = parent::villagelist($val['e_vid'], ['v_name', 'v_hcname', 'v_district', 'v_city', 'v_province', 'v_address']);
+ } else {
+ //小区
+ if (empty(self::$village[ $val['e_vid'] ])) self::$village[ $val['e_vid'] ] = parent::villagelist($val['e_vid']);
+ }
if ($sign) {
- $val['e_vid'] = self::$village[ $val['e_vid'] ];
+ if (array_key_exists('v_hcname', $val) || array_key_exists('v_vaddress', $val)) {
+ $evid = $val['e_vid'];
+ $val['e_vid'] = self::$village[ $evid ]['v_name'];
+ $val['v_hcname'] = self::$village[ $evid ]['v_hcname'];
+ // $val['v_vaddress'] = self::$village[ $evid ]['v_province'] . self::$village[ $evid ]['v_city'] . self::$village[ $evid ]['v_district'] . self::$village[ $evid ]['v_address'];
+ $val['v_vaddress'] = self::$village[ $evid ]['v_district'] . self::$village[ $evid ]['v_address'];
+ } else {
+ $val['e_vid'] = self::$village[ $val['e_vid'] ];
+ }
$val['e_bno'] = self::$para['e_bno'][ $val['e_bno'] ];
$val['e_aps'] = self::$para['e_aps'][ $val['e_aps'] ];
} else {
+ if (array_key_exists('v_hcname', $val) || array_key_exists('v_vaddress', $val)) {
+ $evid = $val['e_vid'];
+ $v_hcname = self::$village[ $evid ]['v_hcname'];
+ $evidname = self::$village[ $evid ]['v_name'];
+ if ($v_hcname) $evidname .= "(" . $v_hcname . ")";
+ // $val['v_vaddress'] = self::$village[ $evid ]['v_province'] . self::$village[ $evid ]['v_city'] . self::$village[ $evid ]['v_district'] . self::$village[ $evid ]['v_address'];
+ $val['v_vaddress'] = self::$village[ $evid ]['v_district'] . self::$village[ $evid ]['v_address'];
+ } else {
+ $evidname = self::$village[ $val['e_vid'] ];
+ }
$villages = [
- self::$village[ $val['e_vid'] ],
+ $evidname,
self::$para['e_bno'][ $val['e_bno'] ],
self::$para['e_aps'][ $val['e_aps'] ]
];
@@ -223,6 +244,9 @@ trait tlist
$addtourl = $this->own_name_info . __FUNCTION__ . '&id=' . $val['id'];
$this->btn[] = '
编辑';
}
+
+ //跳过标记突出处理
+ $this->skip_field = ['v_hcname'];
return self::assemble($key, $base, $val, $checked);
}
@@ -245,6 +269,8 @@ trait tlist
$val['ltype'] = parent::state_color($s_type, ['已经结束', self::$para['ltype'][ $val['l_schedule'] ]]);
$val['h_cid'] = self::$customer[ $val['h_cid'] ];
$val['e_enable'] = $val['e_enable'] == 0 || $this->bsign == false ? parent::state_color($val['e_enable'], ['禁用', '启用']) : '';
+ // 显示商圈
+ $val['v_hcname'] = $val['v_vaddress'] = '';
self::eaddress($val, 'l_address', $this->bsign);
return self::assemble($key, $base, $val, $checked, false);
}
@@ -589,6 +615,8 @@ trait tlist
$val['endtitle'] = $val['endtitle'] ? '
' . $val['endtitle'] . '' : '';
$val['nowtitle'] = $val['nowtitle'] ? '
' . $val['nowtitle'] . '' : '';
$val['nexttitle'] = $val['nexttitle'] ? '
' . $val['nexttitle'] . '' : '';
+ // 显示商圈
+ $val['v_hcname'] = '';
self::eaddress($val, 'e_address');
$val['endtime'] = strtotime($val['endtime']) < $curtime ? '
' . $val['endtime'] . '' : $val['endtime'];
diff --git a/src/admin/templates/js/bmaps.ts b/src/admin/templates/js/bmaps.ts
index 16b1ec9..c7399cf 100644
--- a/src/admin/templates/js/bmaps.ts
+++ b/src/admin/templates/js/bmaps.ts
@@ -411,7 +411,7 @@ namespace APPMAP {
getMapType() {
// true 则进行标记
// false 不进行地图标记
- return this.mapType = $('#showmap').data('type') === 'showmap' ? false : true;
+ return this.mapType = $('#showmap').data('type') !== 'showmap';
}
watchCity() {
@@ -710,13 +710,19 @@ namespace APPMAP {
constructor() {
super();
- // 在地图弹窗内进行小区条件筛选
- $(document).on('change', 'select[name="vtype"]', () => {
+ // 商圈触发
+ // $(document).on('change', 'select[name="vhcname"]', () => {
+ // this.filter()
+ // })
+ // 场所类型触发
+ $(document).on('change', 'select[name="vtype"], select[name="vhcname"]', () => {
this.filter()
})
+
this.watch(this, 'selectProv', () => {
this.filter()
})
+
this.watch(this, 'allCity', () => {
this.filter()
})
@@ -731,16 +737,18 @@ namespace APPMAP {
// 解决因页面产品滚动条导致的点击地图获取的经纬度不准确问题
// 让滚动条回滚到顶部
document.body.scrollTop = document.documentElement.scrollTop = 0
- // 初始化模态框
+ // 初始化地图
this.selectInitMap()
// ajax查找 当前地区点的标注并添加在地图上
- this.ajaxlnglatList(this.selectMap, {
- id: '',
- province: this.selectProv,
- city: this.selectCity,
- district: this.selectDist,
- allinfo: 'all'
- }, true)
+ // 问题一:地图没有打开过(初始化)之前,进行了表格搜索,再打开地图时不能准确同步表格内的数据
+ // 旧的方案
+ // this.ajaxlnglatList(this.selectMap, {
+ // id: '',
+ // province: this.selectProv,
+ // city: this.selectCity,
+ // district: this.selectDist,
+ // allinfo: 'all'
+ // }, true)
// 初始化绘制工具
this.drawingManagerInit()
// 绘制结束后的回调
@@ -802,6 +810,8 @@ namespace APPMAP {
});
// 标记为已经初始化过
if (this.selectMapInitType === false) this.selectMapInitType = true
+ // 新的方案,解决问题一
+ this.filter();
}, 100)
});
@@ -1084,11 +1094,21 @@ namespace APPMAP {
// 根据条件筛选小区
filter() {
+ // 若之前没有打开过地图则不执行
+ if (!this.selectMapInitType) return false
// 获取指定的值
- let vtype: any
+ let vtype: string = '', vhcname: string = ''
+
+ // 商圈
+ if ($('select[name="vhcname"]').length) {
+ let vhcnameArr = $('select[name="vhcname"]').val()
+ vhcname = vhcnameArr ? vhcnameArr.join(',') : ''
+ }
+
+ // 类型
if ($('select[name="vtype"]').length) {
- vtype = $('select[name="vtype"]').val()
- vtype = vtype ? vtype.join(',') : ''
+ let vtypeArr = $('select[name="vtype"]').val()
+ vtype = vtypeArr ? vtypeArr.join(',') : ''
}
// 需要将缓存全部删除掉
@@ -1102,6 +1122,7 @@ namespace APPMAP {
city: this.selectCity,
district: this.selectDist,
vtype: vtype,
+ vhcname: vhcname,
allinfo: 'all'
}, true)
// 调整地图核心位置
diff --git a/src/admin/templates/js/own.js b/src/admin/templates/js/own.js
index 15e1ae2..73ba28d 100644
--- a/src/admin/templates/js/own.js
+++ b/src/admin/templates/js/own.js
@@ -36,7 +36,7 @@
*/
$(function () {
var myDate = new Date().getTime()
- $.include(M.url.own_tem + 'js/appcheck.min.js?'+myDate);
+ $.include(M.url.own_tem + 'js/appcheck.min.js?' + myDate);
$.ajax({
type : "GET",
@@ -61,12 +61,12 @@ $(function () {
})
// 表格数据加载状态
$('#tableslist').on('processing.dt', function (e, settings, processing) {
- if(processing) {
+ if (processing) {
$self.tableProcessing(this)
}
})
$('#tables-list').on('processing.dt', function (e, settings, processing) {
- if(processing) {
+ if (processing) {
$self.tableProcessing(this)
}
})
@@ -79,12 +79,14 @@ $(function () {
var my = $(this);
event.preventDefault();
my.parents('form').metSubmit(0);
- var obj = my.parents("form").serialize(),
- href = my.data('url'),
- veaps = $('select[name="veaps"]').val(),
- vtype = $('select[name="vtype"]').val();
+ var obj = my.parents("form").serialize(),
+ href = my.data('url'),
+ veaps = $('select[name="veaps"]').val(),
+ vhcname = $('select[name="vhcname"]').val(),
+ vtype = $('select[name="vtype"]').val();
// 单独给get传递增加veaps的值
if (!$self.isEmpty(veaps)) obj += '&jsadd_veaps=' + veaps.join(',');
+ if (!$self.isEmpty(vhcname)) obj += '&jsadd_vhcname=' + vhcname.join(',');
if (!$self.isEmpty(vtype)) obj += '&jsadd_vtype=' + vtype.join(',');
window.location.href = href + '&' + obj;
})
@@ -221,9 +223,9 @@ $(function () {
var starttime = $('#date_timepicker_start'),
endtime = $('#date_timepicker_end');
starttime.datetimepicker({
- lang : M.synchronous == 'cn' ? 'ch' : 'en',
- timepicker : starttime.attr("data-day-type") == 2 ? true : false,
- format : starttime.attr("data-day-type") == 2 ? 'Y-m-d H:i:s' : 'Y-m-d',
+ lang : M.synchronous == 'cn' ? 'ch' : 'en',
+ timepicker: starttime.attr("data-day-type") == 2 ? true : false,
+ format : starttime.attr("data-day-type") == 2 ? 'Y-m-d H:i:s' : 'Y-m-d',
// value:starttime.val()?starttime.val():'',
// onShow:function( ct ){
// this.setOptions({
@@ -235,9 +237,9 @@ $(function () {
}
});
endtime.datetimepicker({
- lang : M.synchronous == 'cn' ? 'ch' : 'en',
- timepicker : endtime.attr("data-day-type") == 2 ? true : false,
- format : endtime.attr("data-day-type") == 2 ? 'Y-m-d H:i:s' : 'Y-m-d',
+ lang : M.synchronous == 'cn' ? 'ch' : 'en',
+ timepicker: endtime.attr("data-day-type") == 2 ? true : false,
+ format : endtime.attr("data-day-type") == 2 ? 'Y-m-d H:i:s' : 'Y-m-d',
// value:endtime.val()?endtime.val():'',
// onShow:function( ct ){
// this.setOptions({
@@ -303,7 +305,7 @@ $(function () {
dom.next().val(type);
$self.tableaajx(dom);
},
- ownsubmit : function ($form, typestr) {
+ ownsubmit : function ($form, typestr) {
// 插入submit_type字段
if ($form.find('[name="submit_type"]').length) $form.append('
');
$form.find('[name="submit_type"]').val(typestr);
@@ -319,11 +321,11 @@ $(function () {
$form.find('[name="all_id"]').val(all_id);
}
},
- tableProcessing:function (_this_){
+ tableProcessing: function (_this_) {
// 表格数据加载状态
- var tbody = $(_this_).find('tbody')
+ var tbody = $(_this_).find('tbody')
var colspan = tbody.data('colspan')
- var html= `
+ var html = `
|
|