新增商圈、修复地图没有打开过(初始化)之前,进行了表格搜索,再打开地图时不能准确同步表格内的数据、订单导出时新增小区地址

This commit is contained in:
cloud 2022-06-26 15:19:55 +08:00
parent 001eb16193
commit beefcf575f
12 changed files with 237 additions and 89 deletions

View File

@ -40,6 +40,12 @@ class ajax extends appadmin
if (!empty($_M['form']['district'])) $where .= " AND v_district= '{$_M['form']['district']}'"; if (!empty($_M['form']['district'])) $where .= " AND v_district= '{$_M['form']['district']}'";
// 其他条件 // 其他条件
if (!empty($_M['form']['vhcname']) || $_M['form']['vhcname'] === '0' || $_M['form']['vhcname'] === 0) {
$vhcname = stringto_array($_M['form']['vhcname'], ',');
// 社区类型,分类
$where .= " AND " . $this->tsql->where_arr(['v_hcname' => $vhcname]);
}
if (!empty($_M['form']['vtype']) || $_M['form']['vtype'] === '0' || $_M['form']['vtype'] === 0) { if (!empty($_M['form']['vtype']) || $_M['form']['vtype'] === '0' || $_M['form']['vtype'] === 0) {
$vtype = stringto_array($_M['form']['vtype'], ','); $vtype = stringto_array($_M['form']['vtype'], ',');
// 社区类型,分类 // 社区类型,分类

View File

@ -62,6 +62,7 @@ class info_off extends appadmin
$field = [ $field = [
'v_name' => $this->form['v_name'], 'v_name' => $this->form['v_name'],
'v_type' => $this->form['v_type'], 'v_type' => $this->form['v_type'],
'v_hcname' => $this->form['v_hcname'],
'v_province' => $this->form['v_province'], 'v_province' => $this->form['v_province'],
'v_city' => $this->form['v_city'], 'v_city' => $this->form['v_city'],
'v_district' => $this->form['v_district'], 'v_district' => $this->form['v_district'],

View File

@ -5,7 +5,7 @@ defined('IN_MET') or exit('No permission');
load::own_class('appadmin'); load::own_class('appadmin');
load::own_func('appcmp'); load::own_func('appcmp');
/* /**
* 配置 * 配置
* 包含其他功能初始化 * 包含其他功能初始化
*/ */
@ -13,17 +13,17 @@ load::own_func('appcmp');
class select extends appadmin class select extends appadmin
{ {
/* /**
* @$querys string 搜索内容 * @param string $querys 搜索内容
* @$tname string 指定的查询表 * @param string $tname 指定的查询表
* @$fiend string 作为返回ID的值 * @param string $fiend 作为返回ID的值
* @$source string 查询来源页面,用于区分用哪个页面来查询的好做一些特殊处理 * @param string $source 查询来源页面,用于区分用哪个页面来查询的好做一些特殊处理
* @$allnone string 是否显示默认值全部,或者当没有搜索结果时将搜索内容当作值返回 * @param string $allnone 是否显示默认值全部,或者当没有搜索结果时将搜索内容当作值返回
* @$condition string 页面查询限制条件,采用$$$作为多条件分割,|||作为字段名和值的分割 * @param string $condition 页面查询限制条件,采用$$$作为多条件分割,|||作为字段名和值的分割
* @$default string 默认值 * @param string $default 默认值
* @$division string 默认值分隔符 * @param string $division 默认值分隔符
* *
* @$where string sql判断语句 * @param string $where sql判断语句
*/ */
//搜索内容 //搜索内容
@ -124,7 +124,11 @@ class select extends appadmin
if (strlen($this->querys) == 0) return false; if (strlen($this->querys) == 0) return false;
switch ($this->tname) { switch ($this->tname) {
case 'village': case 'village':
$this->where = " v_name LIKE '%{$this->querys}%' "; if ($this->fiend === 'v_hcname') {
$this->where = " v_hcname LIKE '%{$this->querys}%' ";
} else {
$this->where = " v_name LIKE '%{$this->querys}%' ";
}
break; break;
case 'customer': case 'customer':
$this->where = " c_allname LIKE '%{$this->querys}%' "; $this->where = " c_allname LIKE '%{$this->querys}%' ";
@ -174,7 +178,11 @@ class select extends appadmin
global $_M, $_YW; global $_M, $_YW;
switch ($this->tname) { switch ($this->tname) {
case 'village': case 'village':
$fiend = [$val['v_name'], $val['v_province'] . $val['v_city'] . $val['v_district'] . $val['v_address']]; if ($this->fiend === 'v_hcname') {
$fiend = [$val['v_hcname']];
} else {
$fiend = [$val['v_name'], $val['v_province'] . $val['v_city'] . $val['v_district'] . $val['v_address']];
}
break; break;
case 'customer': case 'customer':
$fiend = [$val['c_name'], $val['c_allname'], $val['c_province'] . $val['c_city'] . $val['c_district'] . $val['c_address']]; $fiend = [$val['c_name'], $val['c_allname'], $val['c_province'] . $val['c_city'] . $val['c_district'] . $val['c_address']];
@ -210,7 +218,7 @@ class select extends appadmin
global $_M, $_YW; global $_M, $_YW;
switch ($this->tname) { switch ($this->tname) {
case 'village': case 'village':
$fiend = 'v_name'; $fiend = $this->fiend === 'v_hcname' ? 'v_hcname' : 'v_name';
break; break;
case 'customer': case 'customer':
$fiend = 'c_name'; $fiend = 'c_name';
@ -256,6 +264,9 @@ class select extends appadmin
if ($this->tname == 'weuser') { if ($this->tname == 'weuser') {
$val['nickname'] = urldecode($val['nickname']); $val['nickname'] = urldecode($val['nickname']);
} }
// 当搜索的字段 值不存在时 跳过后续处理
if (!$val[ $fiend ] && $val[ $fiend ] == 0) continue;
// 将信息按照字母分组
$letter = getstrcharter($val[ $fiend ]); $letter = getstrcharter($val[ $fiend ]);
$selectlist[ $letter ][] = $val; $selectlist[ $letter ][] = $val;
} }

View File

@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b); return extendStatics(d, b);
}; };
return function (d, b) { return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b); extendStatics(d, b);
function __() { this.constructor = d; } function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@ -257,7 +259,7 @@ var APPMAP;
enableAutoPan: true, enableAutoPan: true,
title: value.v_name title: value.v_name
}; };
var content = "<p>" + value.v_province + value.v_city + value.v_district + value.v_address + "</p>"; var content = "<p>".concat(value.v_province).concat(value.v_city).concat(value.v_district).concat(value.v_address, "</p>");
return function (e) { return function (e) {
var p = e.target; var p = e.target;
var point = _this.lnglatToPoints(p.getPosition().lng, p.getPosition().lat); var point = _this.lnglatToPoints(p.getPosition().lng, p.getPosition().lat);
@ -285,7 +287,7 @@ var APPMAP;
this.addMapOverlay(this.showMap, this.inputLng, this.inputLat, true); this.addMapOverlay(this.showMap, this.inputLng, this.inputLat, true);
}; };
showMap.prototype.getMapType = function () { showMap.prototype.getMapType = function () {
return this.mapType = $('#showmap').data('type') === 'showmap' ? false : true; return this.mapType = $('#showmap').data('type') !== 'showmap';
}; };
showMap.prototype.watchCity = function () { showMap.prototype.watchCity = function () {
var _this = this; var _this = this;
@ -502,7 +504,7 @@ var APPMAP;
}; };
_this.villageFilterList = {}; _this.villageFilterList = {};
_this.villageList = {}; _this.villageList = {};
$(document).on('change', 'select[name="vtype"]', function () { $(document).on('change', 'select[name="vtype"], select[name="vhcname"]', function () {
_this.filter(); _this.filter();
}); });
_this.watch(_this, 'selectProv', function () { _this.watch(_this, 'selectProv', function () {
@ -518,13 +520,6 @@ var APPMAP;
setTimeout(function () { setTimeout(function () {
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
_this.selectInitMap(); _this.selectInitMap();
_this.ajaxlnglatList(_this.selectMap, {
id: '',
province: _this.selectProv,
city: _this.selectCity,
district: _this.selectDist,
allinfo: 'all'
}, true);
_this.drawingManagerInit(); _this.drawingManagerInit();
_this.drawingManager.addEventListener("overlaycomplete", function (e) { _this.drawingManager.addEventListener("overlaycomplete", function (e) {
var overlay = e.overlay; var overlay = e.overlay;
@ -572,6 +567,7 @@ var APPMAP;
}); });
if (_this.selectMapInitType === false) if (_this.selectMapInitType === false)
_this.selectMapInitType = true; _this.selectMapInitType = true;
_this.filter();
}, 100); }, 100);
}); });
$('#selectMapId .mapreset').on('click', function (e) { $('#selectMapId .mapreset').on('click', function (e) {
@ -692,7 +688,7 @@ var APPMAP;
}; };
selectMap.prototype.addHtmlShow = function (domclass) { selectMap.prototype.addHtmlShow = function (domclass) {
var _this = this; var _this = this;
var dom = $("." + domclass).find('ul'); var dom = $(".".concat(domclass)).find('ul');
var listNum = domclass === 'filterList' ? 0 : (Object.keys(this.villageList).length || 0); var listNum = domclass === 'filterList' ? 0 : (Object.keys(this.villageList).length || 0);
var initListNum = 0; var initListNum = 0;
$.each(this.villageFilterList, function (i, val) { $.each(this.villageFilterList, function (i, val) {
@ -712,7 +708,7 @@ var APPMAP;
}; };
selectMap.prototype.htmlLi = function (key, val) { selectMap.prototype.htmlLi = function (key, val) {
var address = val.v_city + val.v_district + val.v_address; var address = val.v_city + val.v_district + val.v_address;
return "<li class=\"list-group-item village-list-item\" data-id=\"" + key + "\">\n <h5>" + val.v_name + "</h5>\n <button type=\"button\" class=\"float-right close\">\n <i class=\"icon wb-close m-0 font-danger\" aria-hidden=\"true\"></i>\n </button>\n <p>\u5730\u5740\uFF1A" + address + "</p>\n </li>"; return "<li class=\"list-group-item village-list-item\" data-id=\"".concat(key, "\">\n <h5>").concat(val.v_name, "</h5>\n <button type=\"button\" class=\"float-right close\">\n <i class=\"icon wb-close m-0 font-danger\" aria-hidden=\"true\"></i>\n </button>\n <p>\u5730\u5740\uFF1A").concat(address, "</p>\n </li>");
}; };
selectMap.prototype.mapresetClose = function () { selectMap.prototype.mapresetClose = function () {
var hashCode = this.overlaysCache.hashCode; var hashCode = this.overlaysCache.hashCode;
@ -772,10 +768,16 @@ var APPMAP;
inputVid.trigger('change'); inputVid.trigger('change');
}; };
selectMap.prototype.filter = function () { selectMap.prototype.filter = function () {
var vtype; if (!this.selectMapInitType)
return false;
var vtype = '', vhcname = '';
if ($('select[name="vhcname"]').length) {
var vhcnameArr = $('select[name="vhcname"]').val();
vhcname = vhcnameArr ? vhcnameArr.join(',') : '';
}
if ($('select[name="vtype"]').length) { if ($('select[name="vtype"]').length) {
vtype = $('select[name="vtype"]').val(); var vtypeArr = $('select[name="vtype"]').val();
vtype = vtype ? vtype.join(',') : ''; vtype = vtypeArr ? vtypeArr.join(',') : '';
} }
$('#selectMapId .mapreset').trigger('click'); $('#selectMapId .mapreset').trigger('click');
this.selectMap.clearOverlays(); this.selectMap.clearOverlays();
@ -785,6 +787,7 @@ var APPMAP;
city: this.selectCity, city: this.selectCity,
district: this.selectDist, district: this.selectDist,
vtype: vtype, vtype: vtype,
vhcname: vhcname,
allinfo: 'all' allinfo: 'all'
}, true); }, true);
this.citySyncMap(this.selectMap, this.level()); this.citySyncMap(this.selectMap, this.level());

View File

@ -31,6 +31,21 @@ $met_title = $data['met_title'];
{$data.para.v_type_radio} {$data.para.v_type_radio}
</dd> </dd>
</dl> </dl>
<dl>
<dt><label class='form-control-label'>选择商圈</label></dt>
<dd class="form-group">
<select name='v_hcname' class="form-control" data-plugin="select2"
data-select2-url="{$data.url.select}"
data-tname="{$data.tname}"
data-fiend="v_hcname"
data-allnone="3"
data-source="add_village"
data-default="{$data.data.v_hcname}"
data-placeholder="输入所属商圈" >
<option value=""></option>
</select>
</dd>
</dl>
<dl> <dl>
<dt><label class='form-control-label'>场所地址</label></dt> <dt><label class='form-control-label'>场所地址</label></dt>
<dd> <dd>

View File

@ -293,7 +293,15 @@ class appadmin extends admin
{ {
global $_M, $_YW; global $_M, $_YW;
$village = $this->tsql->table('village')->where(['id' => $id])->one(); $village = $this->tsql->table('village')->where(['id' => $id])->one();
return $village[ $key ]; if (is_array($key)) {
$arr = [];
foreach ($key as $val) {
$arr[ $val ] = $village[ $val ];
}
return $arr;
} else {
return $village[ $key ];
}
} }
//公司名称 //公司名称
@ -338,7 +346,7 @@ class appadmin extends admin
public function str_color($state, $str, $weight = 'unset') public function str_color($state, $str, $weight = 'unset')
{ {
global $_M, $_YW; global $_M, $_YW;
$color = ['red-600', 'green-600', 'cyan-600', 'blue-600','orange-600','purple-600']; $color = ['red-600', 'green-600', 'cyan-600', 'blue-600', 'orange-600', 'purple-600'];
return '<font class="' . $color[ $state ] . ' font-weight-' . $weight . '">' . $str . '</font>'; return '<font class="' . $color[ $state ] . ' font-weight-' . $weight . '">' . $str . '</font>';
} }

View File

@ -310,7 +310,7 @@ class table_theme
global $_M, $_YW; global $_M, $_YW;
$url = $this->select2['url'] ?: $_YW['url']['select']; $url = $this->select2['url'] ?: $_YW['url']['select'];
list($name, $title, $value) = self::fiend_data($this->select2['_fiend']); list($name, $title, $value) = self::fiend_data($this->select2['_fiend']);
$condition = $this->select2['condition'] ?: 'p_type|||0'; $condition = array_key_exists('condition', $this->select2) ? $this->select2['condition'] : 'p_type|||0';
return '<div class="form-group m-t-5"> return '<div class="form-group m-t-5">
<div class="input-group"> <div class="input-group">
<div class="input-group-addon">' . $title . '</div> <div class="input-group-addon">' . $title . '</div>
@ -643,6 +643,15 @@ class table_theme
$this->search[] = self::input_search('v_text', '输入搜索内容'); $this->search[] = self::input_search('v_text', '输入搜索内容');
$this->search[] = self::input_search('v_address', '输入地址'); $this->search[] = self::input_search('v_address', '输入地址');
$this->search[] = self::input_search('v_name', '输入场所名称'); $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'; $this->selctCityConfig['class'] = 'city-js';
$html .= self::th_select_city(); $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->selctCityConfig['class'] = 'search-city-js';
$this->search['left'][] = self::th_select_city(); $this->search['left'][] = self::th_select_city();
@ -904,6 +913,16 @@ class table_theme
$para = [['正常-按照广告位置排序', 0], ['推荐-将适合投放的提前排序', 1], ['选中-将选择中广告位提前排序', 2]]; $para = [['正常-按照广告位置排序', 0], ['推荐-将适合投放的提前排序', 1], ['选中-将选择中广告位提前排序', 2]];
$this->search['left'][] = self::para_select($para, ['eaps_order', '广告位排序', $_M['form']['eaps_order']], true, false); $this->search['left'][] = self::para_select($para, ['eaps_order', '广告位排序', $_M['form']['eaps_order']], true, false);
$tsql = load::own_class('tsql', 'new'); $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 = [ $this->select2 = [
'_fiend' => ['e_vid', '选择场所', $_M['form']['e_vid']], '_fiend' => ['e_vid', '选择场所', $_M['form']['e_vid']],
'placeholder' => '输入场所名称', 'placeholder' => '输入场所名称',
@ -1094,16 +1113,27 @@ class table_theme
]; ];
$this->search[] = self::input_select_search_multiple(); $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->selctCityConfig['class'] = 'search-city-js';
$this->search[] = self::th_select_city(); $this->search[] = self::th_select_city();
$html = ''; $html = '';
// 地图区域 // 地图区域
$this->selctCityConfig['type'] = 1; $this->selctCityConfig['type'] = 1;
$this->selctCityConfig['class'] = 'city-js'; $this->selctCityConfig['class'] = 'city-js';
$html .= self::th_select_city(); $html .= self::th_select_city();
$this->search[] = self::th_toolmap('地图筛选',$html); $this->search[] = self::th_toolmap('地图筛选', $html);
} }
//底部按钮 //底部按钮

View File

@ -29,32 +29,50 @@ trait tdata
{ {
global $_M, $_YW; global $_M, $_YW;
$idArr = $vidArr = []; $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'])) { if (is_array($this->form['vtype'])) {
$vtype = arrayto_string($this->form['vtype'], ','); $vtype = arrayto_string($this->form['vtype'], ',');
$vid = $this->tsql->table('village')->qfield('id')->where("v_type IN({$vtype})")->all(); $vid = $this->tsql->table('village')->qfield('id')->where("v_type IN({$vtype})")->all();
$idArr = array_column($vid, 'id'); $idArr = $countvid($idArr, array_column($vid, 'id'));
if (count($idArr) == 0) $idArr = [-1];
} }
// 地图选择
if ($this->form['v_id']) { if ($this->form['v_id']) {
$vidArr = stringto_array($this->form['v_id'], ','); $vidArr = stringto_array($this->form['v_id'], ',');
// 取社区类型和地图筛选的交集重叠ID社区类型没有操作则直接按照地图筛选结果 // 取社区类型和地图筛选的交集重叠ID社区类型没有操作则直接按照地图筛选结果
// $idArr = count($idArr) > 0?array_intersect($vidArr,$idArr):$vidArr; // $idArr = count($idArr) > 0?array_intersect($vidArr,$idArr):$vidArr;
if (count($idArr) > 0) { $idArr = $countvid($idArr, $vidArr);
$idArr = array_intersect($vidArr, $idArr);
// 如果交集为空则确实通过此条件进行了筛选就要通知SQL没有任何值满足当前条件将ID设置为0肯定查找不到
if (count($idArr) == 0) $idArr = [-1];
} else {
$idArr = $vidArr;
}
} }
$funWhere = function ($idArr, &$where) { $funWhere = function ($idArr, &$where) {
if (count($idArr) > 0) { if (count($idArr) > 0) {
$strId = arrayto_string($idArr, ','); $strId = arrayto_string($idArr, ',');
$where .= " AND id IN({$strId}) "; $where .= " AND id IN({$strId}) ";
} }
}; };
//区域 //区域
$v_province = $this->form['v_province'] && $this->form['v_province'] != '请选择' ? $this->form['v_province'] : ''; $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'] : ''; $v_city = $this->form['v_city'] && $this->form['v_city'] != '请选择' ? $this->form['v_city'] : '';
@ -149,6 +167,7 @@ trait tdata
// 社区类型 // 社区类型
// 先查询出需要的ID // 先查询出需要的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'], ','); if (isset($this->form['jsadd_vtype'])) $this->form['vtype'] = stringto_array($this->form['jsadd_vtype'], ',');
$idArr = self::fun_sqlk_vid(); $idArr = self::fun_sqlk_vid();
// 通过ID筛选掉不需要的 // 通过ID筛选掉不需要的
@ -413,7 +432,7 @@ trait tdata
$this->search_other = ['e_aps', 'e_bno', 'e_vid', 'e_enable']; $this->search_other = ['e_aps', 'e_bno', 'e_vid', 'e_enable'];
$where .= self::td_search(); $where .= self::td_search();
case 'village': case 'village':
$this->search_input = ['v_name', 'v_text']; $this->search_input = ['v_name', 'v_text', 'v_hcname'];
$where .= self::td_search(); $where .= self::td_search();
$this->search_link = ['v_province', 'v_city', 'v_district', 'v_address']; $this->search_link = ['v_province', 'v_city', 'v_district', 'v_address'];

View File

@ -27,6 +27,7 @@ trait tfield
return [ return [
'v_name' => '场所名称', 'v_name' => '场所名称',
'v_type' => '场所分类', 'v_type' => '场所分类',
'v_hcname' => '所属商圈',
'v_totalstr' => '广告状态', 'v_totalstr' => '广告状态',
'v_address' => '场所地址', 'v_address' => '场所地址',
'v_lxname' => '联系人', 'v_lxname' => '联系人',
@ -62,9 +63,11 @@ trait tfield
// 导出专用 // 导出专用
$barray = [ $barray = [
'e_enable' => '状态', 'e_enable' => '状态',
'e_number' => '广告位编号', // 'e_number' => '广告位编号',
'e_size' => '广告位规格', 'e_size' => '广告位规格',
'e_vid' => '场所名称', 'e_vid' => '场所名称',
'v_vaddress' => '场所地址',
'v_hcname' => '所属商圈',
'e_bno' => '门口方位', 'e_bno' => '门口方位',
'e_aps' => '广告位位置', 'e_aps' => '广告位位置',
'h_cid' => '签定的公司', 'h_cid' => '签定的公司',
@ -217,6 +220,7 @@ trait tfield
$array = [ $array = [
'v_name' => '场所名称', 'v_name' => '场所名称',
'v_type' => '场所分类', 'v_type' => '场所分类',
'v_hcname' => '所属商圈',
'v_district' => '所属区域', 'v_district' => '所属区域',
'v_address' => '场所地址', 'v_address' => '场所地址',
'v_enum' => '广告位', 'v_enum' => '广告位',

View File

@ -93,22 +93,43 @@ trait tlist
{ {
global $_M, $_YW; global $_M, $_YW;
//门口方位 //门口方位
if (empty(self::$para['e_bno'])) if (empty(self::$para['e_bno'])) self::$para['e_bno'] = parent::translate(3);
self::$para['e_bno'] = parent::translate(3);
//广告位置 //广告位置
if (empty(self::$para['e_aps'])) if (empty(self::$para['e_aps'])) self::$para['e_aps'] = parent::translate();
self::$para['e_aps'] = parent::translate();
//场所 //场所
if (empty(self::$village[ $val['e_vid'] ])) if (array_key_exists('v_hcname', $val) || array_key_exists('v_vaddress', $val)) {
self::$village[ $val['e_vid'] ] = parent::villagelist($val['e_vid']); //小区
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) { 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_bno'] = self::$para['e_bno'][ $val['e_bno'] ];
$val['e_aps'] = self::$para['e_aps'][ $val['e_aps'] ]; $val['e_aps'] = self::$para['e_aps'][ $val['e_aps'] ];
} else { } 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 = [ $villages = [
self::$village[ $val['e_vid'] ], $evidname,
self::$para['e_bno'][ $val['e_bno'] ], self::$para['e_bno'][ $val['e_bno'] ],
self::$para['e_aps'][ $val['e_aps'] ] self::$para['e_aps'][ $val['e_aps'] ]
]; ];
@ -223,6 +244,9 @@ trait tlist
$addtourl = $this->own_name_info . __FUNCTION__ . '&id=' . $val['id']; $addtourl = $this->own_name_info . __FUNCTION__ . '&id=' . $val['id'];
$this->btn[] = '<a href="' . $addtourl . '" class="btn btn-success btn-sm">编辑</a>'; $this->btn[] = '<a href="' . $addtourl . '" class="btn btn-success btn-sm">编辑</a>';
} }
//跳过标记突出处理
$this->skip_field = ['v_hcname'];
return self::assemble($key, $base, $val, $checked); 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['ltype'] = parent::state_color($s_type, ['已经结束', self::$para['ltype'][ $val['l_schedule'] ]]);
$val['h_cid'] = self::$customer[ $val['h_cid'] ]; $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['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); self::eaddress($val, 'l_address', $this->bsign);
return self::assemble($key, $base, $val, $checked, false); return self::assemble($key, $base, $val, $checked, false);
} }
@ -589,6 +615,8 @@ trait tlist
$val['endtitle'] = $val['endtitle'] ? '<a href="' . $scheduleurlid . $val['endid'] . '">' . $val['endtitle'] . '</a>' : ''; $val['endtitle'] = $val['endtitle'] ? '<a href="' . $scheduleurlid . $val['endid'] . '">' . $val['endtitle'] . '</a>' : '';
$val['nowtitle'] = $val['nowtitle'] ? '<a href="' . $scheduleurlid . $val['nowid'] . '">' . $val['nowtitle'] . '</a>' : ''; $val['nowtitle'] = $val['nowtitle'] ? '<a href="' . $scheduleurlid . $val['nowid'] . '">' . $val['nowtitle'] . '</a>' : '';
$val['nexttitle'] = $val['nexttitle'] ? '<a href="' . $scheduleurlid . $val['nextid'] . '">' . $val['nexttitle'] . '</a>' : ''; $val['nexttitle'] = $val['nexttitle'] ? '<a href="' . $scheduleurlid . $val['nextid'] . '">' . $val['nexttitle'] . '</a>' : '';
// 显示商圈
$val['v_hcname'] = '';
self::eaddress($val, 'e_address'); self::eaddress($val, 'e_address');
$val['endtime'] = strtotime($val['endtime']) < $curtime ? '<span class="line_through blue-grey-400">' . $val['endtime'] . '</span>' : $val['endtime']; $val['endtime'] = strtotime($val['endtime']) < $curtime ? '<span class="line_through blue-grey-400">' . $val['endtime'] . '</span>' : $val['endtime'];

View File

@ -411,7 +411,7 @@ namespace APPMAP {
getMapType() { getMapType() {
// true 则进行标记 // true 则进行标记
// false 不进行地图标记 // false 不进行地图标记
return this.mapType = $('#showmap').data('type') === 'showmap' ? false : true; return this.mapType = $('#showmap').data('type') !== 'showmap';
} }
watchCity() { watchCity() {
@ -710,13 +710,19 @@ namespace APPMAP {
constructor() { constructor() {
super(); 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.filter()
}) })
this.watch(this, 'selectProv', () => { this.watch(this, 'selectProv', () => {
this.filter() this.filter()
}) })
this.watch(this, 'allCity', () => { this.watch(this, 'allCity', () => {
this.filter() this.filter()
}) })
@ -731,16 +737,18 @@ namespace APPMAP {
// 解决因页面产品滚动条导致的点击地图获取的经纬度不准确问题 // 解决因页面产品滚动条导致的点击地图获取的经纬度不准确问题
// 让滚动条回滚到顶部 // 让滚动条回滚到顶部
document.body.scrollTop = document.documentElement.scrollTop = 0 document.body.scrollTop = document.documentElement.scrollTop = 0
// 初始化模态框 // 初始化地图
this.selectInitMap() this.selectInitMap()
// ajax查找 当前地区点的标注并添加在地图上 // ajax查找 当前地区点的标注并添加在地图上
this.ajaxlnglatList(this.selectMap, { // 问题一:地图没有打开过(初始化)之前,进行了表格搜索,再打开地图时不能准确同步表格内的数据
id: '', // 旧的方案
province: this.selectProv, // this.ajaxlnglatList(this.selectMap, {
city: this.selectCity, // id: '',
district: this.selectDist, // province: this.selectProv,
allinfo: 'all' // city: this.selectCity,
}, true) // district: this.selectDist,
// allinfo: 'all'
// }, true)
// 初始化绘制工具 // 初始化绘制工具
this.drawingManagerInit() this.drawingManagerInit()
// 绘制结束后的回调 // 绘制结束后的回调
@ -802,6 +810,8 @@ namespace APPMAP {
}); });
// 标记为已经初始化过 // 标记为已经初始化过
if (this.selectMapInitType === false) this.selectMapInitType = true if (this.selectMapInitType === false) this.selectMapInitType = true
// 新的方案,解决问题一
this.filter();
}, 100) }, 100)
}); });
@ -1084,11 +1094,21 @@ namespace APPMAP {
// 根据条件筛选小区 // 根据条件筛选小区
filter() { 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) { if ($('select[name="vtype"]').length) {
vtype = $('select[name="vtype"]').val() let vtypeArr = $('select[name="vtype"]').val()
vtype = vtype ? vtype.join(',') : '' vtype = vtypeArr ? vtypeArr.join(',') : ''
} }
// 需要将缓存全部删除掉 // 需要将缓存全部删除掉
@ -1102,6 +1122,7 @@ namespace APPMAP {
city: this.selectCity, city: this.selectCity,
district: this.selectDist, district: this.selectDist,
vtype: vtype, vtype: vtype,
vhcname: vhcname,
allinfo: 'all' allinfo: 'all'
}, true) }, true)
// 调整地图核心位置 // 调整地图核心位置

View File

@ -36,7 +36,7 @@
*/ */
$(function () { $(function () {
var myDate = new Date().getTime() 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({ $.ajax({
type : "GET", type : "GET",
@ -61,12 +61,12 @@ $(function () {
}) })
// 表格数据加载状态 // 表格数据加载状态
$('#tableslist').on('processing.dt', function (e, settings, processing) { $('#tableslist').on('processing.dt', function (e, settings, processing) {
if(processing) { if (processing) {
$self.tableProcessing(this) $self.tableProcessing(this)
} }
}) })
$('#tables-list').on('processing.dt', function (e, settings, processing) { $('#tables-list').on('processing.dt', function (e, settings, processing) {
if(processing) { if (processing) {
$self.tableProcessing(this) $self.tableProcessing(this)
} }
}) })
@ -79,12 +79,14 @@ $(function () {
var my = $(this); var my = $(this);
event.preventDefault(); event.preventDefault();
my.parents('form').metSubmit(0); my.parents('form').metSubmit(0);
var obj = my.parents("form").serialize(), var obj = my.parents("form").serialize(),
href = my.data('url'), href = my.data('url'),
veaps = $('select[name="veaps"]').val(), veaps = $('select[name="veaps"]').val(),
vtype = $('select[name="vtype"]').val(); vhcname = $('select[name="vhcname"]').val(),
vtype = $('select[name="vtype"]').val();
// 单独给get传递增加veaps的值 // 单独给get传递增加veaps的值
if (!$self.isEmpty(veaps)) obj += '&jsadd_veaps=' + veaps.join(','); 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(','); if (!$self.isEmpty(vtype)) obj += '&jsadd_vtype=' + vtype.join(',');
window.location.href = href + '&' + obj; window.location.href = href + '&' + obj;
}) })
@ -221,9 +223,9 @@ $(function () {
var starttime = $('#date_timepicker_start'), var starttime = $('#date_timepicker_start'),
endtime = $('#date_timepicker_end'); endtime = $('#date_timepicker_end');
starttime.datetimepicker({ starttime.datetimepicker({
lang : M.synchronous == 'cn' ? 'ch' : 'en', lang : M.synchronous == 'cn' ? 'ch' : 'en',
timepicker : starttime.attr("data-day-type") == 2 ? true : false, 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', format : starttime.attr("data-day-type") == 2 ? 'Y-m-d H:i:s' : 'Y-m-d',
// value:starttime.val()?starttime.val():'', // value:starttime.val()?starttime.val():'',
// onShow:function( ct ){ // onShow:function( ct ){
// this.setOptions({ // this.setOptions({
@ -235,9 +237,9 @@ $(function () {
} }
}); });
endtime.datetimepicker({ endtime.datetimepicker({
lang : M.synchronous == 'cn' ? 'ch' : 'en', lang : M.synchronous == 'cn' ? 'ch' : 'en',
timepicker : endtime.attr("data-day-type") == 2 ? true : false, 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', format : endtime.attr("data-day-type") == 2 ? 'Y-m-d H:i:s' : 'Y-m-d',
// value:endtime.val()?endtime.val():'', // value:endtime.val()?endtime.val():'',
// onShow:function( ct ){ // onShow:function( ct ){
// this.setOptions({ // this.setOptions({
@ -303,7 +305,7 @@ $(function () {
dom.next().val(type); dom.next().val(type);
$self.tableaajx(dom); $self.tableaajx(dom);
}, },
ownsubmit : function ($form, typestr) { ownsubmit : function ($form, typestr) {
// 插入submit_type字段 // 插入submit_type字段
if ($form.find('[name="submit_type"]').length) $form.append('<input type="hidden" name="submit_type" value=""/>'); if ($form.find('[name="submit_type"]').length) $form.append('<input type="hidden" name="submit_type" value=""/>');
$form.find('[name="submit_type"]').val(typestr); $form.find('[name="submit_type"]').val(typestr);
@ -319,11 +321,11 @@ $(function () {
$form.find('[name="all_id"]').val(all_id); $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 colspan = tbody.data('colspan')
var html= `<tr> var html = `<tr>
<td colspan="${colspan}"> <td colspan="${colspan}">
<div class="h-50 vertical-align text-xs-center"><div class="loader vertical-align-middle loader-default"></div></div> <div class="h-50 vertical-align text-xs-center"><div class="loader vertical-align-middle loader-default"></div></div>
</td> </td>