After Width: | Height: | Size: 3.0 MiB |
After Width: | Height: | Size: 2.7 MiB |
After Width: | Height: | Size: 502 KiB |
After Width: | Height: | Size: 588 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 20 KiB |
@ -0,0 +1,77 @@
|
||||
package com.anjiplus.template.gaea.business.filter;
|
||||
|
||||
import com.anji.plus.gaea.constant.GaeaConstant;
|
||||
import org.apache.catalina.util.ParameterMap;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.ognl.IteratorEnumeration;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
import java.io.IOException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author: Raod
|
||||
* @since: 2022-01-26
|
||||
*/
|
||||
@Component
|
||||
@Order(Ordered.HIGHEST_PRECEDENCE + 1)
|
||||
public class UrlDecodeFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
|
||||
ParameterMap<String, String[]> parameterMap = (ParameterMap) httpServletRequest.getParameterMap();
|
||||
ParamHttpServletRequestWrapper wrapper = new ParamHttpServletRequestWrapper(httpServletRequest, parameterMap);
|
||||
|
||||
Enumeration<String> parameterNames = wrapper.getParameterNames();
|
||||
while (parameterNames.hasMoreElements()) {
|
||||
String paramName = parameterNames.nextElement();
|
||||
String parameter = httpServletRequest.getParameter(paramName);
|
||||
if (StringUtils.isNotBlank(parameter)) {
|
||||
String decode = URLDecoder.decode(parameter, GaeaConstant.CHARSET_UTF8);
|
||||
parameterMap.setLocked(false);
|
||||
parameterMap.put(paramName, new String[]{decode});
|
||||
}
|
||||
}
|
||||
filterChain.doFilter(wrapper, servletResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数
|
||||
*/
|
||||
class ParamHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
private ParameterMap<String, String[]> parameterMap;
|
||||
|
||||
public ParamHttpServletRequestWrapper(HttpServletRequest request, ParameterMap<String, String[]> parameterMap) {
|
||||
super(request);
|
||||
this.parameterMap = parameterMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String[]> getParameterMap() {
|
||||
return parameterMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<String> getParameterNames() {
|
||||
|
||||
Set<String> keySet = parameterMap.keySet();
|
||||
IteratorEnumeration iteratorEnumeration = new IteratorEnumeration(keySet.iterator());
|
||||
return iteratorEnumeration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getParameterValues(String name) {
|
||||
return parameterMap.get(name);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.anjiplus.template.gaea.business.modules.reportexcel.util;
|
||||
|
||||
/**
|
||||
* 单元格类型
|
||||
*/
|
||||
public enum CellType {
|
||||
DYNAMIC_MERGE("DYNAMIC_MERGE","动态合并单元格"),
|
||||
DYNAMIC("DYNAMIC","动态单元格"),
|
||||
STATIC("STATIC","静态单元格"),
|
||||
STATIC_AUTO("STATIC_AUTO","静态扩展单元格"),
|
||||
STATIC_MERGE("STATIC_MERGE","静态合并单元格"),
|
||||
STATIC_MERGE_AUTO("STATIC_MERGE_AUTO","静态合并扩展单元格"),
|
||||
BLACK("BLACK","空白单元格");
|
||||
|
||||
private String code;
|
||||
private String name;
|
||||
|
||||
CellType(String code,String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,68 @@
|
||||
use
|
||||
aj_report;
|
||||
|
||||
-- 增加字段
|
||||
ALTER TABLE `aj_report`.`gaea_report` ADD COLUMN `report_author` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '报表作者' AFTER `report_desc`;
|
||||
|
||||
ALTER TABLE `aj_report`.`gaea_report` ADD COLUMN `download_count` bigint(11) NULL DEFAULT NULL COMMENT '报表下载次数' AFTER `report_author`;
|
||||
|
||||
-- root权限更新
|
||||
delete from access_role_authority where role_code = 'root';
|
||||
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'authorityManage', 'insert');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'authorityManage', 'update');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'authorityManage', 'delete');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'authorityManage', 'query');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'roleManage', 'insert');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'roleManage', 'update');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'roleManage', 'delete');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'roleManage', 'query');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'roleManage', 'grantAuthority');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'userManage', 'insert');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'userManage', 'update');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'userManage', 'delete');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'userManage', 'query');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'userManage', 'resetPassword');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'userManage', 'grantRole');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'datasourceManage', 'insert');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'datasourceManage', 'update');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'datasourceManage', 'delete');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'datasourceManage', 'query');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'resultsetManage', 'insert');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'resultsetManage', 'update');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'resultsetManage', 'delete');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'resultsetManage', 'query');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'reportManage', 'insert');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'reportManage', 'update');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'reportManage', 'delete');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'reportManage', 'query');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'bigScreenManage', 'share');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'bigScreenManage', 'view');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'bigScreenManage', 'design');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'bigScreenManage', 'export');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'bigScreenManage', 'import');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'excelManage', 'query');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'excelManage', 'view');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'excelManage', 'export');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'fileManage', 'query');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'fileManage', 'upload');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'fileManage', 'update');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'fileManage', 'delete');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'dictManage', 'query');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'dictManage', 'insert');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'dictManage', 'update');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'dictManage', 'delete');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'dictManage', 'fresh');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'dictItemManage', 'query');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'dictItemManage', 'insert');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'dictItemManage', 'update');
|
||||
INSERT INTO `aj_report`.`access_role_authority`(`id`, `role_code`, `target`, `action`) VALUES (default, 'root', 'dictItemManage', 'delete');
|
||||
|
||||
INSERT INTO `aj_report`.`access_authority`(`id`, `parent_target`, `target`, `target_name`, `action`, `action_name`, `sort`, `enable_flag`, `delete_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `version`) VALUES (237, 'report', 'excelManage', '表格报表', 'insert', '新建表格', 237, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
|
||||
INSERT INTO `aj_report`.`access_authority`(`id`, `parent_target`, `target`, `target_name`, `action`, `action_name`, `sort`, `enable_flag`, `delete_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `version`) VALUES (238, 'report', 'excelManage', '表格报表', 'update', '更新表格', 238, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
|
||||
INSERT INTO `aj_report`.`access_authority`(`id`, `parent_target`, `target`, `target_name`, `action`, `action_name`, `sort`, `enable_flag`, `delete_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `version`) VALUES (239, 'report', 'excelManage', '表格报表', 'view', '查看表格', 239, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
|
||||
INSERT INTO `aj_report`.`access_authority`(`id`, `parent_target`, `target`, `target_name`, `action`, `action_name`, `sort`, `enable_flag`, `delete_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `version`) VALUES (240, 'report', 'excelManage', '表格报表', 'export', '导出表格', 240, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
|
||||
|
||||
|
||||
|
||||
|
@ -1,36 +0,0 @@
|
||||
import request from '@/api/axios'
|
||||
|
||||
// 查询字典
|
||||
export function queryForCodeSelect(params={}) {
|
||||
return request({
|
||||
url: '/auth-service/dict/queryForCodeSelect',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 查询标题
|
||||
export function querytitleByCategory(params) {
|
||||
return request({
|
||||
url: '/auth-service/help/querytitleByCategory',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 关键词查询
|
||||
export function searchKeyWord(params = {}) {
|
||||
return request({
|
||||
url: '/auth-service/help/searchKeyWord',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export function queryById(data) {
|
||||
return request({
|
||||
url: '/auth-service/help/queryById',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
@ -0,0 +1,761 @@
|
||||
{
|
||||
"type": "FeatureCollection",
|
||||
"features": [
|
||||
{
|
||||
"type": "Feature",
|
||||
"properties": {
|
||||
"adcode": 710000,
|
||||
"name": "台湾省",
|
||||
"center": [
|
||||
121.509062,
|
||||
25.044332
|
||||
],
|
||||
"centroid": [
|
||||
120.971485,
|
||||
23.749452
|
||||
],
|
||||
"childrenNum": 0,
|
||||
"level": "province",
|
||||
"acroutes": [
|
||||
100000
|
||||
],
|
||||
"parent": {
|
||||
"adcode": 100000
|
||||
}
|
||||
},
|
||||
"geometry": {
|
||||
"type": "MultiPolygon",
|
||||
"coordinates": [
|
||||
[
|
||||
[
|
||||
[
|
||||
120.443558,
|
||||
22.441245
|
||||
],
|
||||
[
|
||||
120.517584,
|
||||
22.408536
|
||||
],
|
||||
[
|
||||
120.569903,
|
||||
22.361728
|
||||
],
|
||||
[
|
||||
120.640505,
|
||||
22.241347
|
||||
],
|
||||
[
|
||||
120.659209,
|
||||
22.15432
|
||||
],
|
||||
[
|
||||
120.662001,
|
||||
22.066983
|
||||
],
|
||||
[
|
||||
120.651464,
|
||||
22.033165
|
||||
],
|
||||
[
|
||||
120.667691,
|
||||
21.983168
|
||||
],
|
||||
[
|
||||
120.70157,
|
||||
21.927065
|
||||
],
|
||||
[
|
||||
120.743246,
|
||||
21.915569
|
||||
],
|
||||
[
|
||||
120.78155,
|
||||
21.923957
|
||||
],
|
||||
[
|
||||
120.85468,
|
||||
21.883333
|
||||
],
|
||||
[
|
||||
120.87291,
|
||||
21.897387
|
||||
],
|
||||
[
|
||||
120.866482,
|
||||
21.98436
|
||||
],
|
||||
[
|
||||
120.907315,
|
||||
22.033208
|
||||
],
|
||||
[
|
||||
120.904154,
|
||||
22.119757
|
||||
],
|
||||
[
|
||||
120.914955,
|
||||
22.302718
|
||||
],
|
||||
[
|
||||
120.981658,
|
||||
22.528305
|
||||
],
|
||||
[
|
||||
121.015009,
|
||||
22.584168
|
||||
],
|
||||
[
|
||||
121.033292,
|
||||
22.650725
|
||||
],
|
||||
[
|
||||
121.078498,
|
||||
22.669656
|
||||
],
|
||||
[
|
||||
121.170544,
|
||||
22.723133
|
||||
],
|
||||
[
|
||||
121.210481,
|
||||
22.770665
|
||||
],
|
||||
[
|
||||
121.237931,
|
||||
22.836327
|
||||
],
|
||||
[
|
||||
121.324708,
|
||||
22.945666
|
||||
],
|
||||
[
|
||||
121.354687,
|
||||
23.01006
|
||||
],
|
||||
[
|
||||
121.370388,
|
||||
23.084347
|
||||
],
|
||||
[
|
||||
121.409535,
|
||||
23.102669
|
||||
],
|
||||
[
|
||||
121.430294,
|
||||
23.137196
|
||||
],
|
||||
[
|
||||
121.415015,
|
||||
23.195973
|
||||
],
|
||||
[
|
||||
121.440358,
|
||||
23.272096
|
||||
],
|
||||
[
|
||||
121.479558,
|
||||
23.3223
|
||||
],
|
||||
[
|
||||
121.497788,
|
||||
23.419789
|
||||
],
|
||||
[
|
||||
121.521497,
|
||||
23.483198
|
||||
],
|
||||
[
|
||||
121.523078,
|
||||
23.538708
|
||||
],
|
||||
[
|
||||
121.587778,
|
||||
23.76102
|
||||
],
|
||||
[
|
||||
121.621604,
|
||||
23.92075
|
||||
],
|
||||
[
|
||||
121.659381,
|
||||
24.006893
|
||||
],
|
||||
[
|
||||
121.639992,
|
||||
24.064276
|
||||
],
|
||||
[
|
||||
121.643838,
|
||||
24.097713
|
||||
],
|
||||
[
|
||||
121.678085,
|
||||
24.133906
|
||||
],
|
||||
[
|
||||
121.689044,
|
||||
24.174401
|
||||
],
|
||||
[
|
||||
121.809172,
|
||||
24.339055
|
||||
],
|
||||
[
|
||||
121.826717,
|
||||
24.423579
|
||||
],
|
||||
[
|
||||
121.867498,
|
||||
24.478978
|
||||
],
|
||||
[
|
||||
121.885464,
|
||||
24.529677
|
||||
],
|
||||
[
|
||||
121.892524,
|
||||
24.617912
|
||||
],
|
||||
[
|
||||
121.862598,
|
||||
24.671515
|
||||
],
|
||||
[
|
||||
121.837993,
|
||||
24.76015
|
||||
],
|
||||
[
|
||||
121.845053,
|
||||
24.836269
|
||||
],
|
||||
[
|
||||
121.932883,
|
||||
24.938645
|
||||
],
|
||||
[
|
||||
122.012178,
|
||||
25.001469
|
||||
],
|
||||
[
|
||||
121.980776,
|
||||
25.03079
|
||||
],
|
||||
[
|
||||
121.947425,
|
||||
25.031955
|
||||
],
|
||||
[
|
||||
121.917077,
|
||||
25.137908
|
||||
],
|
||||
[
|
||||
121.842155,
|
||||
25.135332
|
||||
],
|
||||
[
|
||||
121.782407,
|
||||
25.160425
|
||||
],
|
||||
[
|
||||
121.750531,
|
||||
25.160716
|
||||
],
|
||||
[
|
||||
121.707327,
|
||||
25.191493
|
||||
],
|
||||
[
|
||||
121.700319,
|
||||
25.226913
|
||||
],
|
||||
[
|
||||
121.655324,
|
||||
25.241859
|
||||
],
|
||||
[
|
||||
121.623026,
|
||||
25.294694
|
||||
],
|
||||
[
|
||||
121.584986,
|
||||
25.308926
|
||||
],
|
||||
[
|
||||
121.535038,
|
||||
25.307515
|
||||
],
|
||||
[
|
||||
121.444415,
|
||||
25.270624
|
||||
],
|
||||
[
|
||||
121.413487,
|
||||
25.238912
|
||||
],
|
||||
[
|
||||
121.371864,
|
||||
25.159885
|
||||
],
|
||||
[
|
||||
121.319281,
|
||||
25.140691
|
||||
],
|
||||
[
|
||||
121.209322,
|
||||
25.127104
|
||||
],
|
||||
[
|
||||
121.133135,
|
||||
25.078728
|
||||
],
|
||||
[
|
||||
121.102102,
|
||||
25.075153
|
||||
],
|
||||
[
|
||||
121.024704,
|
||||
25.040479
|
||||
],
|
||||
[
|
||||
121.009688,
|
||||
24.993649
|
||||
],
|
||||
[
|
||||
120.960899,
|
||||
24.940227
|
||||
],
|
||||
[
|
||||
120.908475,
|
||||
24.852012
|
||||
],
|
||||
[
|
||||
120.892299,
|
||||
24.767526
|
||||
],
|
||||
[
|
||||
120.823753,
|
||||
24.688321
|
||||
],
|
||||
[
|
||||
120.762371,
|
||||
24.658335
|
||||
],
|
||||
[
|
||||
120.688661,
|
||||
24.600678
|
||||
],
|
||||
[
|
||||
120.64277,
|
||||
24.490172
|
||||
],
|
||||
[
|
||||
120.589187,
|
||||
24.432354
|
||||
],
|
||||
[
|
||||
120.546299,
|
||||
24.370413
|
||||
],
|
||||
[
|
||||
120.521009,
|
||||
24.312038
|
||||
],
|
||||
[
|
||||
120.470534,
|
||||
24.24259
|
||||
],
|
||||
[
|
||||
120.451461,
|
||||
24.182691
|
||||
],
|
||||
[
|
||||
120.392029,
|
||||
24.11824
|
||||
],
|
||||
[
|
||||
120.316158,
|
||||
23.984881
|
||||
],
|
||||
[
|
||||
120.278276,
|
||||
23.927798
|
||||
],
|
||||
[
|
||||
120.245768,
|
||||
23.840553
|
||||
],
|
||||
[
|
||||
120.175377,
|
||||
23.807385
|
||||
],
|
||||
[
|
||||
120.102773,
|
||||
23.700981
|
||||
],
|
||||
[
|
||||
120.094817,
|
||||
23.587466
|
||||
],
|
||||
[
|
||||
120.121741,
|
||||
23.504664
|
||||
],
|
||||
[
|
||||
120.107831,
|
||||
23.341264
|
||||
],
|
||||
[
|
||||
120.081434,
|
||||
23.29191
|
||||
],
|
||||
[
|
||||
120.018947,
|
||||
23.073115
|
||||
],
|
||||
[
|
||||
120.029537,
|
||||
23.048623
|
||||
],
|
||||
[
|
||||
120.131382,
|
||||
23.002118
|
||||
],
|
||||
[
|
||||
120.149138,
|
||||
22.896715
|
||||
],
|
||||
[
|
||||
120.200403,
|
||||
22.721101
|
||||
],
|
||||
[
|
||||
120.274272,
|
||||
22.560181
|
||||
],
|
||||
[
|
||||
120.297191,
|
||||
22.531315
|
||||
],
|
||||
[
|
||||
120.443558,
|
||||
22.441245
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
124.542984,
|
||||
25.903911
|
||||
],
|
||||
[
|
||||
124.586346,
|
||||
25.913777
|
||||
],
|
||||
[
|
||||
124.572805,
|
||||
25.93974
|
||||
],
|
||||
[
|
||||
124.541825,
|
||||
25.931031
|
||||
],
|
||||
[
|
||||
124.542984,
|
||||
25.903911
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
123.445286,
|
||||
25.725966
|
||||
],
|
||||
[
|
||||
123.472104,
|
||||
25.713024
|
||||
],
|
||||
[
|
||||
123.508933,
|
||||
25.723237
|
||||
],
|
||||
[
|
||||
123.514834,
|
||||
25.751226
|
||||
],
|
||||
[
|
||||
123.483063,
|
||||
25.768587
|
||||
],
|
||||
[
|
||||
123.444496,
|
||||
25.746514
|
||||
],
|
||||
[
|
||||
123.445286,
|
||||
25.725966
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
119.64597,
|
||||
23.55091
|
||||
],
|
||||
[
|
||||
119.701081,
|
||||
23.550657
|
||||
],
|
||||
[
|
||||
119.678057,
|
||||
23.600041
|
||||
],
|
||||
[
|
||||
119.610089,
|
||||
23.603953
|
||||
],
|
||||
[
|
||||
119.594388,
|
||||
23.577245
|
||||
],
|
||||
[
|
||||
119.566306,
|
||||
23.584732
|
||||
],
|
||||
[
|
||||
119.562565,
|
||||
23.530377
|
||||
],
|
||||
[
|
||||
119.573788,
|
||||
23.505885
|
||||
],
|
||||
[
|
||||
119.609141,
|
||||
23.503864
|
||||
],
|
||||
[
|
||||
119.64597,
|
||||
23.55091
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
123.667207,
|
||||
25.914066
|
||||
],
|
||||
[
|
||||
123.707092,
|
||||
25.916873
|
||||
],
|
||||
[
|
||||
123.678008,
|
||||
25.938667
|
||||
],
|
||||
[
|
||||
123.667207,
|
||||
25.914066
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
119.506031,
|
||||
23.625567
|
||||
],
|
||||
[
|
||||
119.505241,
|
||||
23.575814
|
||||
],
|
||||
[
|
||||
119.472416,
|
||||
23.557136
|
||||
],
|
||||
[
|
||||
119.523207,
|
||||
23.563699
|
||||
],
|
||||
[
|
||||
119.525578,
|
||||
23.624895
|
||||
],
|
||||
[
|
||||
119.506031,
|
||||
23.625567
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
119.49739,
|
||||
23.386683
|
||||
],
|
||||
[
|
||||
119.495125,
|
||||
23.350156
|
||||
],
|
||||
[
|
||||
119.516885,
|
||||
23.349903
|
||||
],
|
||||
[
|
||||
119.49739,
|
||||
23.386683
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
119.557454,
|
||||
23.666474
|
||||
],
|
||||
[
|
||||
119.604083,
|
||||
23.616989
|
||||
],
|
||||
[
|
||||
119.615516,
|
||||
23.660925
|
||||
],
|
||||
[
|
||||
119.586485,
|
||||
23.675974
|
||||
],
|
||||
[
|
||||
119.557454,
|
||||
23.666474
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
121.46823,
|
||||
22.676644
|
||||
],
|
||||
[
|
||||
121.476502,
|
||||
22.64166
|
||||
],
|
||||
[
|
||||
121.513541,
|
||||
22.631833
|
||||
],
|
||||
[
|
||||
121.5147,
|
||||
22.67639
|
||||
],
|
||||
[
|
||||
121.46823,
|
||||
22.676644
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
121.510538,
|
||||
22.087185
|
||||
],
|
||||
[
|
||||
121.507693,
|
||||
22.048523
|
||||
],
|
||||
[
|
||||
121.534089,
|
||||
22.022146
|
||||
],
|
||||
[
|
||||
121.594522,
|
||||
21.995382
|
||||
],
|
||||
[
|
||||
121.604586,
|
||||
22.022699
|
||||
],
|
||||
[
|
||||
121.575028,
|
||||
22.037122
|
||||
],
|
||||
[
|
||||
121.575607,
|
||||
22.084421
|
||||
],
|
||||
[
|
||||
121.510538,
|
||||
22.087185
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
122.097533,
|
||||
25.500168
|
||||
],
|
||||
[
|
||||
122.093581,
|
||||
25.47183
|
||||
],
|
||||
[
|
||||
122.124825,
|
||||
25.475932
|
||||
],
|
||||
[
|
||||
122.097533,
|
||||
25.500168
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
119.421467,
|
||||
23.216684
|
||||
],
|
||||
[
|
||||
119.421309,
|
||||
23.18935
|
||||
],
|
||||
[
|
||||
119.453396,
|
||||
23.217697
|
||||
],
|
||||
[
|
||||
119.421467,
|
||||
23.216684
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
120.355042,
|
||||
22.327259
|
||||
],
|
||||
[
|
||||
120.395454,
|
||||
22.342287
|
||||
],
|
||||
[
|
||||
120.383072,
|
||||
22.355573
|
||||
],
|
||||
[
|
||||
120.355042,
|
||||
22.327259
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,139 @@
|
||||
<template>
|
||||
<el-autocomplete
|
||||
v-model.trim="inputValue"
|
||||
:debounce="500"
|
||||
class="inline-input"
|
||||
:fetch-suggestions="querySearch"
|
||||
:disabled="disabled"
|
||||
@select="handleSelect"
|
||||
@input="changeInput"
|
||||
>
|
||||
<template slot-scope="{ item }">
|
||||
<div class="name">{{ getItemLabel(item, item.value) }}</div>
|
||||
<span class="addr">{{ item[option] }}</span>
|
||||
</template>
|
||||
</el-autocomplete>
|
||||
</template>
|
||||
<script>
|
||||
import request from "@/utils/request";
|
||||
export default {
|
||||
props: {
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: () => {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
default: () => {
|
||||
return "";
|
||||
}
|
||||
},
|
||||
url: {
|
||||
type: String,
|
||||
default: () => {
|
||||
return "";
|
||||
}
|
||||
},
|
||||
appointValue: {
|
||||
type: String,
|
||||
default: () => {
|
||||
return "";
|
||||
}
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: () => {
|
||||
return "";
|
||||
}
|
||||
},
|
||||
option: {
|
||||
type: String,
|
||||
default: () => {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
restaurants: [],
|
||||
inputValue: ""
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(val) {
|
||||
this.echoInput(val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.echoInput(this.value);
|
||||
},
|
||||
methods: {
|
||||
getItemLabel(item, value) {
|
||||
if (this.label.indexOf("${") < 0 && this.label.indexOf("}" < 0)) {
|
||||
return item[this.label];
|
||||
}
|
||||
let reg = /\$\{[a-zA-Z0-9]*\}/g;
|
||||
let list = this.label.match(reg);
|
||||
console.log(list);
|
||||
// ["${id}", "${text}"]
|
||||
let result = this.label;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let sub = list[i];
|
||||
let key = sub.replace("${", "").replace("}", "");
|
||||
result = result.replace(sub, item[key]);
|
||||
}
|
||||
return value + " " + result;
|
||||
},
|
||||
querySearch(queryString, cb) {
|
||||
request({ url: this.url }).then(res => {
|
||||
if (res.code == 200 && res.data) {
|
||||
this.restaurants = res.data;
|
||||
} else {
|
||||
this.restaurants = [];
|
||||
}
|
||||
this.restaurants = JSON.parse(
|
||||
JSON.stringify(this.restaurants).replace(
|
||||
new RegExp(this.appointValue, "g"),
|
||||
"value"
|
||||
)
|
||||
);
|
||||
let results = queryString
|
||||
? this.restaurants.filter(this.createFilter(queryString))
|
||||
: this.restaurants;
|
||||
cb(results);
|
||||
});
|
||||
},
|
||||
createFilter(queryString) {
|
||||
return restaurant => {
|
||||
return (
|
||||
restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ===
|
||||
0
|
||||
);
|
||||
};
|
||||
},
|
||||
handleSelect(item) {
|
||||
this.$emit("input", item.value);
|
||||
this.$emit("change", item.value, item);
|
||||
},
|
||||
changeInput(val) {
|
||||
this.$emit("input", val);
|
||||
this.$emit("change", val);
|
||||
},
|
||||
// 回显
|
||||
echoInput(value) {
|
||||
if (!value) {
|
||||
this.inputValue = "";
|
||||
} else {
|
||||
this.inputValue = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.inline-input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,313 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row>
|
||||
<el-col v-if="selectIsHide('country')" :span="4">
|
||||
<el-select
|
||||
v-model.trim="countryCode"
|
||||
filterable
|
||||
placeholder="请选择国家"
|
||||
:disabled="disabled"
|
||||
clearable
|
||||
@change="countryChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="(option, i) in countryArr"
|
||||
:key="i"
|
||||
:value="option.value"
|
||||
:label="option.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col v-if="selectIsHide('province')" :span="7">
|
||||
<el-select
|
||||
v-model.trim="provinceCode"
|
||||
filterable
|
||||
placeholder="请选择省"
|
||||
:disabled="disabled"
|
||||
clearable
|
||||
@change="provinceChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="(option, i) in casCaredArr"
|
||||
:key="i"
|
||||
:value="option.value"
|
||||
:label="option.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col v-if="selectIsHide('city')" :span="7">
|
||||
<el-select
|
||||
v-model.trim="cityCode"
|
||||
filterable
|
||||
placeholder="请选择市"
|
||||
:disabled="disabled"
|
||||
clearable
|
||||
@change="cityChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="(option, x) in cityArr"
|
||||
:key="x"
|
||||
:value="option.value"
|
||||
:label="option.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col v-if="selectIsHide('area')" :span="6">
|
||||
<el-select
|
||||
v-model.trim="areaCode"
|
||||
filterable
|
||||
placeholder="请选择区"
|
||||
:disabled="disabled"
|
||||
clearable
|
||||
@change="districtChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="(option, y) in districtArr"
|
||||
:key="y"
|
||||
:value="option.value"
|
||||
:label="option.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import { getToken } from "@/utils/auth";
|
||||
export default {
|
||||
name: "Cselect",
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
default: () => "/meta/metaAreaInfo/countryTree"
|
||||
},
|
||||
value: null,
|
||||
singleDisplay: String,
|
||||
disabled: Boolean
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
countryArr: [],
|
||||
casCaredArr: [],
|
||||
cityArr: [],
|
||||
districtArr: [],
|
||||
countryCode: "", // 国code
|
||||
provinceCode: "", // 省code
|
||||
cityCode: "", // 州市code
|
||||
areaCode: "", // 区县code
|
||||
countryName: "",
|
||||
provinceName: "",
|
||||
cityName: "",
|
||||
areaName: ""
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(value) {
|
||||
this.echoSelect(value);
|
||||
this.initData();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initData();
|
||||
this.echoSelect(this.value);
|
||||
},
|
||||
methods: {
|
||||
// singleDisplay 不配显示 country province city area 配那个那个不显示
|
||||
selectIsHide(val) {
|
||||
if (this.singleDisplay === undefined) {
|
||||
return true;
|
||||
} else {
|
||||
return !(this.singleDisplay.indexOf(val) >= 0);
|
||||
}
|
||||
},
|
||||
// 查询数据
|
||||
initData() {
|
||||
this.queryData();
|
||||
},
|
||||
queryData() {
|
||||
axios({
|
||||
url: process.env.VUE_APP_BASE_API + this.url,
|
||||
methods: "get",
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
systemCode: process.env.VUE_APP_SYSTEM_CODE
|
||||
}
|
||||
}).then(res => {
|
||||
const data = res.data;
|
||||
if (data.code != 200 || data.data.length == 0) return;
|
||||
this.countryArr = data.data;
|
||||
!this.selectIsHide("country") &&
|
||||
(this.casCaredArr = data.data[0].children);
|
||||
this.updateCountry();
|
||||
this.updateCity();
|
||||
this.updateDistrict();
|
||||
});
|
||||
},
|
||||
updateCountry() {
|
||||
for (let i in this.countryArr) {
|
||||
let obj = this.countryArr[i];
|
||||
if (obj.value == this.countryCode) {
|
||||
this.casCaredArr = obj.children;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
updateCity() {
|
||||
for (let i in this.casCaredArr) {
|
||||
let obj = this.casCaredArr[i];
|
||||
if (obj.value) {
|
||||
if (obj.value == this.provinceCode) {
|
||||
this.cityArr = obj.children;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
updateDistrict() {
|
||||
for (let i in this.cityArr) {
|
||||
let obj = this.cityArr[i];
|
||||
if (obj.value == this.cityCode) {
|
||||
this.districtArr = obj.children;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 国
|
||||
countryChange(val) {
|
||||
if (val) {
|
||||
this.updateCountry();
|
||||
this.provinceCode = "";
|
||||
this.cityCode = "";
|
||||
this.areaCode = "";
|
||||
const casCared = this.countryArr.find((n, index) => {
|
||||
if (n.value == val) {
|
||||
return n;
|
||||
}
|
||||
});
|
||||
this.countryName = casCared.label;
|
||||
const obj = {
|
||||
countryName: this.countryName,
|
||||
countryCode: this.countryCode,
|
||||
provinceCode: this.provinceCode,
|
||||
cityCode: this.cityCode,
|
||||
areaCode: this.areaCode,
|
||||
provinceName: this.provinceName,
|
||||
cityName: this.cityName,
|
||||
areaName: this.areaName
|
||||
};
|
||||
this.$emit("input", obj);
|
||||
this.$emit("change", obj);
|
||||
} else {
|
||||
this.$emit("input", {});
|
||||
this.$emit("change", {});
|
||||
}
|
||||
},
|
||||
// 省
|
||||
provinceChange(val) {
|
||||
if (val) {
|
||||
this.updateCity();
|
||||
this.cityCode = "";
|
||||
this.areaCode = "";
|
||||
const casCared = this.casCaredArr.find((n, index) => {
|
||||
if (n.value == val) {
|
||||
return n;
|
||||
}
|
||||
});
|
||||
this.provinceName = casCared.label;
|
||||
const obj = {
|
||||
countryName: this.countryName,
|
||||
countryCode: this.countryCode,
|
||||
provinceCode: this.provinceCode,
|
||||
cityCode: this.cityCode,
|
||||
areaCode: this.areaCode,
|
||||
provinceName: this.provinceName,
|
||||
cityName: this.cityName,
|
||||
areaName: this.areaName
|
||||
};
|
||||
this.$emit("input", obj);
|
||||
this.$emit("change", obj);
|
||||
} else {
|
||||
this.$emit("input", {});
|
||||
this.$emit("change", {});
|
||||
}
|
||||
},
|
||||
// 市
|
||||
cityChange(val) {
|
||||
if (val) {
|
||||
this.areaCode = "";
|
||||
this.updateDistrict();
|
||||
const city = this.cityArr.find((n, index) => {
|
||||
if (n.value == val) {
|
||||
return n;
|
||||
}
|
||||
});
|
||||
this.cityName = city.label;
|
||||
const obj = {
|
||||
countryName: this.countryName,
|
||||
countryCode: this.countryCode,
|
||||
provinceCode: this.provinceCode,
|
||||
cityCode: this.cityCode,
|
||||
areaCode: this.areaCode,
|
||||
provinceName: this.provinceName,
|
||||
cityName: this.cityName,
|
||||
areaName: this.areaName
|
||||
};
|
||||
this.$emit("input", obj);
|
||||
this.$emit("change", obj);
|
||||
} else {
|
||||
this.$emit("input", {});
|
||||
this.$emit("change", {});
|
||||
}
|
||||
},
|
||||
// 区
|
||||
districtChange(val) {
|
||||
if (val) {
|
||||
const district = this.districtArr.find((n, index) => {
|
||||
if (n.value == val) {
|
||||
return n;
|
||||
}
|
||||
});
|
||||
this.areaName = district.label;
|
||||
const obj = {
|
||||
countryName: this.countryName,
|
||||
countryCode: this.countryCode,
|
||||
provinceCode: this.provinceCode,
|
||||
cityCode: this.cityCode,
|
||||
areaCode: this.areaCode,
|
||||
provinceName: this.provinceName,
|
||||
cityName: this.cityName,
|
||||
areaName: this.areaName
|
||||
};
|
||||
this.$emit("input", obj);
|
||||
this.$emit("change", obj);
|
||||
} else {
|
||||
this.$emit("input", {});
|
||||
this.$emit("change", {});
|
||||
}
|
||||
},
|
||||
echoSelect(value) {
|
||||
if (!value) {
|
||||
this.countryCode = "";
|
||||
this.provinceCode = "";
|
||||
this.cityCode = "";
|
||||
this.areaCode = "";
|
||||
this.countryName = "";
|
||||
this.provinceName = "";
|
||||
this.cityName = "";
|
||||
this.areaName = "";
|
||||
} else {
|
||||
this.countryName = this.value.countryName;
|
||||
this.countryCode = this.value.countryCode;
|
||||
this.provinceCode = this.value.provinceCode;
|
||||
this.cityCode = this.value.cityCode;
|
||||
this.areaCode = this.value.areaCode || this.value.regionCode;
|
||||
this.provinceName = this.value.provinceName;
|
||||
this.cityName = this.value.cityName;
|
||||
this.areaName = this.value.areaName || this.value.regionName;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -0,0 +1,50 @@
|
||||
<!--
|
||||
* @Descripttion: 右键菜单
|
||||
* @version:
|
||||
* @Author: qianlishi
|
||||
* @Date: 2021-10-21 15:52:03
|
||||
* @LastEditors: qianlishi
|
||||
* @LastEditTime: 2021-10-21 19:40:05
|
||||
-->
|
||||
<template>
|
||||
<div v-show="visible" class="contentmenu" :style="styleObj">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
styleObj: Object,
|
||||
visible: Boolean,
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
watch: {
|
||||
visible(value) {
|
||||
if (value) {
|
||||
document.body.addEventListener('click', this.closeMenu)
|
||||
} else {
|
||||
document.body.removeEventListener('click', this.closeMenu)
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
closeMenu() {
|
||||
this.$emit('update:visible', false)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.contentmenu {
|
||||
position: fixed;
|
||||
z-index: 99999;
|
||||
list-style: none;
|
||||
-webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
|
||||
padding: 0;
|
||||
background: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<el-cascader v-model="selectValue" style="width: 100%" :props="{ lazy: true, lazyLoad: lazyLoad, label: 'text', value: 'id' }" :options="countryCity" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: null,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['countryCity']),
|
||||
selectValue: {
|
||||
get: function() {
|
||||
return [...this.value]
|
||||
},
|
||||
set: function(val) {
|
||||
this.$emit('update:value', val)
|
||||
},
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (this.value && this.value.length > 0) {
|
||||
this.initCity()
|
||||
} else {
|
||||
this.$store.dispatch('dict/add_countryCity', { level: 0 })
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCityName() {
|
||||
const value = this.selectValue
|
||||
const country = this.countryCity.find((item) => item.id === value[0])
|
||||
const province = country.children.find((item) => item.id === value[1])
|
||||
const city = province.children.find((item) => item.id === value[2])
|
||||
const region = city.children.find((item) => item.id === value[3])
|
||||
return [country.text, province.text, city.text, region.text]
|
||||
},
|
||||
// 初始化数据
|
||||
initCity() {
|
||||
const value = this.value
|
||||
// console.log(value)
|
||||
if (!value) {
|
||||
return
|
||||
}
|
||||
const country = this.countryCity.find((item) => item.id === value[0])
|
||||
console.log(country)
|
||||
if (!country || !country.children) {
|
||||
this.getData().then((list) => {
|
||||
this.getData({ country: value[0], level: 1 }).then((list) => {
|
||||
this.getData({ country: value[0], province: value[1], level: 2 }).then((list) => {
|
||||
this.getData({ country: value[0], province: value[1], city: value[2], level: 3, update: true }).then((list) => {})
|
||||
})
|
||||
})
|
||||
})
|
||||
} else {
|
||||
const province = country.children.find((item) => item.id === value[1])
|
||||
if (!province || !province.children) {
|
||||
this.getData({ country: value[0], level: 1 }).then((list) => {
|
||||
this.getData({ country: value[0], province: value[1], level: 2 }).then((list) => {
|
||||
this.getData({ country: value[0], province: value[1], city: value[2], level: 3, update: true }).then((list) => {})
|
||||
})
|
||||
})
|
||||
} else {
|
||||
const city = province.children.find((item) => item.id === value[2])
|
||||
if (!city || !city.children) {
|
||||
this.getData({ country: value[0], province: value[1], level: 2 }).then((list) => {
|
||||
this.getData({ country: value[0], province: value[1], city: value[2], level: 3, update: true }).then((list) => {})
|
||||
})
|
||||
} else {
|
||||
const region = city.children.find((item) => item.id === value[3])
|
||||
if (!region) {
|
||||
this.getData({ country: value[0], province: value[1], city: value[2], level: 3, update: true }).then((list) => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
getData(params) {
|
||||
return this.$store.dispatch('dict/add_countryCity', params)
|
||||
},
|
||||
lazyLoad(node, resolve) {
|
||||
console.log(node)
|
||||
const { level, path, data } = node
|
||||
if (data && data.children) {
|
||||
resolve(data.children)
|
||||
} else {
|
||||
if (level === 0) {
|
||||
return
|
||||
}
|
||||
const params = { country: path[0], province: path[1], city: path[2], level }
|
||||
this.$store.dispatch('dict/add_countryCity', params).then((list) => resolve(list))
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
@ -0,0 +1,209 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:width="dialogWidth"
|
||||
:class="dialogFullScreen ? 'full-screen' : 'notfull-screen'"
|
||||
center
|
||||
:fullscreen="dialogFullScreen"
|
||||
:visible.sync="dialogConfig.dialogVisible"
|
||||
:before-close="handleDialogClose"
|
||||
append-to-body
|
||||
modal-append-to-body
|
||||
>
|
||||
<template v-slot:title>
|
||||
{{ getDialogTitle(dialogConfig.dialogType) }}
|
||||
<button
|
||||
v-if="dialogConfig.isFullScreen"
|
||||
type="button"
|
||||
aria-label="Close"
|
||||
class="el-dialog__headerbtn"
|
||||
style="right: 50px"
|
||||
@click="dialogFullScreen = !dialogFullScreen"
|
||||
>
|
||||
<i class="el-dialog__close el-icon el-icon-full-screen" />
|
||||
</button>
|
||||
</template>
|
||||
<div class="card-body">
|
||||
<div class="anji-card">
|
||||
<div v-if="dialogConfig.isSetColRow" class="card-head">
|
||||
<div class="main-card-header-button">
|
||||
<el-button type="text" @click="handleSetRowColNum(4)"
|
||||
>||||</el-button
|
||||
>
|
||||
<el-button type="text" @click="handleSetRowColNum(3)"
|
||||
>|||</el-button
|
||||
>
|
||||
<el-button type="text" @click="handleSetRowColNum(2)">||</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<slot name="dialogCont" />
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer" class="anji-button">
|
||||
<el-button
|
||||
v-if="isBtnClose"
|
||||
type="danger"
|
||||
plain
|
||||
@click="handleDialogClose"
|
||||
>{{ dialogConfig.isBtnClose.text || "关闭" }}</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="isBtnSave"
|
||||
type="primary"
|
||||
plain
|
||||
@click="handleDialogSave"
|
||||
>{{ dialogConfig.isBtnSave.text || "保存" }}</el-button
|
||||
>
|
||||
<slot name="dialogBtn" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
// 弹框配置文件
|
||||
dialogConfig: {
|
||||
required: true,
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dialogType: "add",
|
||||
dialogWidth: "60%",
|
||||
isFullScreen: true,
|
||||
isSetColRow: true,
|
||||
isBtnClose: {
|
||||
value: true,
|
||||
text: "关闭"
|
||||
},
|
||||
isBtnSave: {
|
||||
value: true,
|
||||
text: "保存"
|
||||
},
|
||||
column: 2,
|
||||
setColumnFn: () => {}
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogFullScreen: false // 弹出框全屏
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
dialogWidth() {
|
||||
if (this.dialogConfig.dialogWidth) {
|
||||
return this.dialogConfig.dialogWidth;
|
||||
} else {
|
||||
if (this.dialogConfig.column == 2) {
|
||||
return "60%";
|
||||
}
|
||||
if (this.dialogConfig.column == 3) {
|
||||
return "70%";
|
||||
}
|
||||
if (this.dialogConfig.column == 4) {
|
||||
return "80%";
|
||||
}
|
||||
}
|
||||
return "60%";
|
||||
},
|
||||
isBtnClose() {
|
||||
return this.dialogConfig.isBtnClose || this.dialogConfig.isBtnClose.value;
|
||||
},
|
||||
isBtnSave() {
|
||||
return this.dialogConfig.isBtnSave || this.dialogConfig.isBtnSave.value;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getDialogTitle(type) {
|
||||
let title = "新增";
|
||||
switch (type) {
|
||||
case "add":
|
||||
title = "新增";
|
||||
break;
|
||||
case "edit":
|
||||
title = "编辑";
|
||||
break;
|
||||
case "view":
|
||||
title = "查看";
|
||||
break;
|
||||
default:
|
||||
title = type;
|
||||
break;
|
||||
}
|
||||
return title;
|
||||
},
|
||||
handleSetRowColNum(val) {
|
||||
const cardRowColSpan = 24 / val;
|
||||
this.dialogConfig.setColumnFn(cardRowColSpan);
|
||||
},
|
||||
handleDialogClose() {
|
||||
this.$emit("handleClose");
|
||||
},
|
||||
handleDialogSave() {
|
||||
this.$emit("handleDialogSave");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.notfull-screen {
|
||||
/deep/.el-dialog__body {
|
||||
background-color: rgb(240, 242, 245);
|
||||
padding: 5px;
|
||||
max-height: 60vh;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
.full-screen {
|
||||
/deep/.el-dialog__body {
|
||||
background-color: rgb(240, 242, 245);
|
||||
padding: 5px;
|
||||
height: calc(100vh - 110px);
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
.anji-card {
|
||||
margin-bottom: 5px;
|
||||
box-sizing: border-box;
|
||||
padding: 0 20px;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
font-size: 14px;
|
||||
font-letiant: tabular-nums;
|
||||
line-height: 1.5;
|
||||
list-style: none;
|
||||
font-feature-settings: "tnum";
|
||||
position: relative;
|
||||
background: #fff;
|
||||
border-radius: 2px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.drawerContainer {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.drawerMain {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
padding: 0 20px;
|
||||
}
|
||||
.footer {
|
||||
border-top: 1px solid #eff0f3;
|
||||
height: 66px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.addForm {
|
||||
text-align: center;
|
||||
}
|
||||
.activeColor /deep/.el-form-item__label {
|
||||
color: #5887fb;
|
||||
}
|
||||
</style>
|