Merge branch 'dev' of codeup.aliyun.com:61c14a7efa282c88e103c23f/oak-general-business into dev
This commit is contained in:
commit
75bab03a7f
|
|
@ -26,5 +26,8 @@ declare const _default: {
|
|||
coordinate: number[];
|
||||
};
|
||||
})[];
|
||||
subway: import("../general-app-domain/Subway/Schema").CreateOperationData[];
|
||||
station: import("../general-app-domain/Station/Schema").CreateOperationData[];
|
||||
subwayStation: import("../general-app-domain/SubwayStation/Schema").CreateOperationData[];
|
||||
};
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -2,10 +2,16 @@
|
|||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var userRole_1 = require("./userRole");
|
||||
var area_1 = require("./area");
|
||||
var subway_1 = require("./subway");
|
||||
var station_1 = require("./station");
|
||||
var subwayStation_1 = require("./subwayStation");
|
||||
exports.default = {
|
||||
user: userRole_1.users,
|
||||
role: userRole_1.roles,
|
||||
mobile: userRole_1.mobiles,
|
||||
token: userRole_1.tokens,
|
||||
area: area_1.area,
|
||||
subway: subway_1.subway,
|
||||
station: station_1.station,
|
||||
subwayStation: subwayStation_1.subwayStation,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
import { CreateOperationData as Station } from "../general-app-domain/Station/Schema";
|
||||
export declare const station: Station[];
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,2 @@
|
|||
import { CreateOperationData as Subway } from "../general-app-domain/Subway/Schema";
|
||||
export declare const subway: Subway[];
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.subway = void 0;
|
||||
exports.subway = [
|
||||
{
|
||||
id: "330100023133",
|
||||
name: "1号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "330100023132",
|
||||
name: "1号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000150789",
|
||||
name: "绍兴1号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "330100020003",
|
||||
name: "2号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000092651",
|
||||
name: "3号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000096933",
|
||||
name: "3号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000029624",
|
||||
name: "4号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000065767",
|
||||
name: "5号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000073754",
|
||||
name: "6号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000062493",
|
||||
name: "6号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000099060",
|
||||
name: "7号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000099066",
|
||||
name: "8号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000166808",
|
||||
name: "9号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000122963",
|
||||
name: "10号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000130963",
|
||||
name: "16号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000101230",
|
||||
name: "19号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000150702",
|
||||
name: "杭海城际",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000109349",
|
||||
name: "S1线",
|
||||
areaId: "330300",
|
||||
},
|
||||
];
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
import { CreateOperationData as SubwayStation } from "../general-app-domain/SubwayStation/Schema";
|
||||
export declare const subwayStation: SubwayStation[];
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -32,14 +32,30 @@ exports.default = OakComponent({
|
|||
qrCodeType: '',
|
||||
},
|
||||
data: {
|
||||
period: 5,
|
||||
period: 15,
|
||||
userEntityGrantId: '',
|
||||
unit: 'minute',
|
||||
maxes: {
|
||||
minute: 4320,
|
||||
hour: 72,
|
||||
minute: 3 * 24 * 60,
|
||||
hour: 3 * 24,
|
||||
day: 3,
|
||||
},
|
||||
defaultPeriods: {
|
||||
minute: 15,
|
||||
hour: 1,
|
||||
day: 1,
|
||||
},
|
||||
unitArr: [
|
||||
{
|
||||
label: '分钟',
|
||||
value: 'minute',
|
||||
},
|
||||
{
|
||||
label: '小时',
|
||||
value: 'hour',
|
||||
},
|
||||
],
|
||||
unitIndex: 0,
|
||||
},
|
||||
lifetimes: {
|
||||
ready: function () {
|
||||
|
|
@ -103,7 +119,18 @@ exports.default = OakComponent({
|
|||
this.setPeriod(count);
|
||||
},
|
||||
setUnit: function (u) {
|
||||
var defaultPeriods = this.state.defaultPeriods;
|
||||
this.setState({ unit: u });
|
||||
this.setPeriod(defaultPeriods[u]);
|
||||
},
|
||||
setUnitMp: function (e) {
|
||||
var unitArr = this.state.unitArr;
|
||||
var value = e.detail.value;
|
||||
var unitObj = unitArr[value];
|
||||
this.setState({
|
||||
unitIndex: value,
|
||||
});
|
||||
this.setUnit(unitObj.value);
|
||||
},
|
||||
onBack: function () {
|
||||
this.navigateBack();
|
||||
|
|
|
|||
|
|
@ -72,4 +72,27 @@
|
|||
.confirm-btn {
|
||||
align-self: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
.unit-box {
|
||||
margin-left: 32rpx;
|
||||
|
||||
height: 50rpx;
|
||||
width: 120rpx;
|
||||
border: 1px solid @oak-color-primary;
|
||||
color: @oak-color-primary;
|
||||
border-radius: 10rpx;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.unit {
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.icon {
|
||||
color: @oak-color-primary !important;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,48 +1,24 @@
|
|||
<!-- index.wxml -->
|
||||
<view class="page-body">
|
||||
<block wx:if="{{!!userEntityGrantId}}">
|
||||
<l-notice-bar
|
||||
front-icon-name="notification"
|
||||
show="{{true}}"
|
||||
>
|
||||
<block wx:if="{{!!userEntityGrantId}}">
|
||||
<l-notice-bar front-icon-name="notification" show="{{true}}">
|
||||
请通过分享或者截屏二维码方式分享权限
|
||||
</l-notice-bar>
|
||||
<view class="ueg-container">
|
||||
<userEntityGrant-detail
|
||||
oakId="{{userEntityGrantId}}"
|
||||
oakAutoUnmount="{{true}}"
|
||||
oakPath="$userRelation/upsert/byUserEntityGrant-userEntityGrant/detail"
|
||||
/>
|
||||
<view
|
||||
class="share"
|
||||
>
|
||||
<l-button
|
||||
size="medium"
|
||||
type="success"
|
||||
open-type="share"
|
||||
>
|
||||
<userEntityGrant-detail oakId="{{userEntityGrantId}}" oakAutoUnmount="{{true}}" oakPath="$userRelation/upsert/byUserEntityGrant-userEntityGrant/detail" />
|
||||
<view class="share">
|
||||
<l-button size="medium" type="success" open-type="share">
|
||||
分享
|
||||
</l-button>
|
||||
</view
|
||||
</view>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<view class="list-item">
|
||||
</block>
|
||||
<block wx:else>
|
||||
<view class="list-item">
|
||||
<view class="label">权限:</view>
|
||||
<view class="value">
|
||||
<l-radio-group
|
||||
placement="row"
|
||||
l-class="radio-container"
|
||||
bind:linchange="setRelationMp"
|
||||
current="{{relation}}"
|
||||
>
|
||||
<l-radio
|
||||
wx:for-items="{{relations}}"
|
||||
wx:key="index"
|
||||
key="{{item}}"
|
||||
l-class="radio"
|
||||
size="48rpx"
|
||||
>
|
||||
<l-radio-group placement="row" l-class="radio-container" bind:linchange="setRelationMp" current="{{relation}}">
|
||||
<l-radio wx:for-items="{{relations}}" wx:key="index" key="{{item}}" l-class="radio" size="48rpx">
|
||||
{{t(entity + ':r.' + item)}}
|
||||
</l-radio>
|
||||
</l-radio-group>
|
||||
|
|
@ -51,51 +27,37 @@
|
|||
<view class="list-item">
|
||||
<view class="label">人次:</view>
|
||||
<view class="value">
|
||||
<l-radio-group
|
||||
placement="row"
|
||||
l-class="radio-container"
|
||||
bind:linchange="setNumberMp"
|
||||
current="{{number}}"
|
||||
>
|
||||
<l-radio
|
||||
wx:key="1"
|
||||
key="1"
|
||||
size="48rpx"
|
||||
l-class="radio"
|
||||
>
|
||||
<l-radio-group placement="row" l-class="radio-container" bind:linchange="setNumberMp" current="{{number}}">
|
||||
<l-radio wx:key="1" key="1" size="48rpx" l-class="radio">
|
||||
单人次
|
||||
</l-radio>
|
||||
<l-radio
|
||||
wx:key="10000"
|
||||
key="10000"
|
||||
size="48rpx"
|
||||
>
|
||||
<l-radio wx:key="10000" key="10000" size="48rpx">
|
||||
不限人次
|
||||
</l-radio>
|
||||
</l-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-item">
|
||||
<view class="label">有效期:</view>
|
||||
<view class="value-period">
|
||||
<l-counter
|
||||
count="{{period}}"
|
||||
max="120"
|
||||
min="5"
|
||||
round-float="{{true}}"
|
||||
bind:linchange="setPeriodMp"
|
||||
/>
|
||||
<view style="margin-left: 30rpx">
|
||||
<l-counter count="{{period}}" max="{{ maxes[unit] }}" min="1" round-float="{{true}}" bind:linchange="setPeriodMp" />
|
||||
<!-- <view style="margin-left: 30rpx">
|
||||
分钟
|
||||
</view>
|
||||
</view> -->
|
||||
<picker range="{{unitArr}}" range-key="label" value="{{unitIndex}}" bind:change="setUnitMp">
|
||||
<view class="unit-box">
|
||||
<view class="unit">
|
||||
{{unitArr[unitIndex].label}}
|
||||
</view>
|
||||
|
||||
<l-icon l-class="icon" name="down" size="18" />
|
||||
</view>
|
||||
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view style="flex: 1" />
|
||||
<l-button
|
||||
size="long"
|
||||
type="default"
|
||||
bind:lintap="confirm"
|
||||
>
|
||||
<l-button size="long" type="default" bind:lintap="confirm">
|
||||
确定
|
||||
</l-button>
|
||||
</block>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ export default function render(props: WebComponentProps<EntityDict, 'userEntityG
|
|||
userEntityGrantId: string;
|
||||
unit: Unit;
|
||||
maxes: Record<Unit, number>;
|
||||
unitArr: Array<{
|
||||
label: string;
|
||||
value: Unit;
|
||||
}>;
|
||||
}, {
|
||||
confirm: () => Promise<void>;
|
||||
onBack: () => void;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ var antd_1 = require("antd");
|
|||
var detail_1 = tslib_1.__importDefault(require("../../../../pages/userEntityGrant/detail"));
|
||||
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
|
||||
function render(props) {
|
||||
var _a = props.data, relations = _a.relations, userEntityGrant = _a.userEntityGrant, userEntityGrantId = _a.userEntityGrantId, period = _a.period, unit = _a.unit, maxes = _a.maxes;
|
||||
var _a = props.data, relations = _a.relations, userEntityGrant = _a.userEntityGrant, userEntityGrantId = _a.userEntityGrantId, period = _a.period, unit = _a.unit, maxes = _a.maxes, unitArr = _a.unitArr;
|
||||
var _b = userEntityGrant || {}, relation = _b.relation, type = _b.type, number = _b.number, entity = _b.entity;
|
||||
var _c = props.methods, update = _c.update, t = _c.t, onBack = _c.onBack, confirm = _c.confirm, setInit = _c.setInit, setPeriod = _c.setPeriod, setUnit = _c.setUnit;
|
||||
var P = !!userEntityGrantId ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Alert, { showIcon: true, message: "\u8BF7\u5C06\u4E8C\u7EF4\u7801\u53D1\u7ED9\u5F85\u5206\u4EAB\u6743\u9650\u7684\u7528\u6237\u626B\u63CF", type: "info", style: { marginBottom: 16 } }), (0, jsx_runtime_1.jsx)(detail_1.default, { showBack: false, oakId: userEntityGrantId, oakAutoUnmount: true, oakPath: "$userRelation/upsert/byUserEntityGrant-userEntityGrant/detail" }), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ style: {
|
||||
|
|
@ -41,18 +41,11 @@ function render(props) {
|
|||
required: true,
|
||||
message: '请选择一个时效',
|
||||
},
|
||||
], help: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ style: { marginBottom: 16 } }, { children: "\u652F\u6301\u5206\u949F\u3001\u5C0F\u65F6\u9009\u62E9" })) }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.InputNumber, { min: 1, max: maxes[unit], value: period, onChange: function (value) { return setPeriod(value); }, addonAfter: (0, jsx_runtime_1.jsxs)(antd_1.Select, tslib_1.__assign({ value: unit, style: { width: 80 }, onChange: function (v) {
|
||||
], help: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ style: { marginBottom: 16 } }, { children: "\u652F\u6301\u5206\u949F\u3001\u5C0F\u65F6\u9009\u62E9" })), tooltip: "\u901A\u8FC7\u914D\u7F6E\u5B9E\u73B0\u5728\u89C4\u5B9A\u7684\u65F6\u6548\u5185\u626B\u63CF\u4E8C\u7EF4\u7801\u4E0D\u8FC7\u671F\u7684\u6548\u679C\u3002" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.InputNumber, { min: 1, max: maxes[unit], value: period, onChange: function (value) { return setPeriod(value); },
|
||||
// addonAfter="分钟"
|
||||
addonAfter: (0, jsx_runtime_1.jsx)(antd_1.Select, tslib_1.__assign({ value: unit, style: { width: 80 }, onChange: function (v) {
|
||||
setUnit(v);
|
||||
if (v === 'minute') {
|
||||
setPeriod(5);
|
||||
}
|
||||
else if (v === 'hour') {
|
||||
setPeriod(1);
|
||||
}
|
||||
else if (v === 'day') {
|
||||
setPeriod(1);
|
||||
}
|
||||
} }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Select.Option, tslib_1.__assign({ value: "minute" }, { children: "\u5206\u949F" })), (0, jsx_runtime_1.jsx)(antd_1.Select.Option, tslib_1.__assign({ value: "hour" }, { children: "\u5C0F\u65F6" }))] })) }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 4 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () { return confirm(); } }, { children: "\u63D0\u4EA4" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ onClick: function () { return onBack(); } }, { children: "\u8FD4\u56DE" }))] }) }))] })));
|
||||
} }, { children: unitArr.map(function (ele, index) { return ((0, jsx_runtime_1.jsx)(antd_1.Select.Option, tslib_1.__assign({ value: ele.value }, { children: ele.label }), index)); }) })) }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 4 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () { return confirm(); } }, { children: "\u63D0\u4EA4" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ onClick: function () { return onBack(); } }, { children: "\u8FD4\u56DE" }))] }) }))] })));
|
||||
return (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: P }));
|
||||
}
|
||||
exports.default = render;
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@
|
|||
"copy-xml": "copyfiles -u 1 src/**/*.xml lib/ & copyfiles -u 1 src/**/*.wxml lib/",
|
||||
"build": "tsc && npm run copy-js && npm run copy-less && npm run copy-wxs && npm run copy-svg && npm run copy-xml",
|
||||
"gen:areaDebug": "ts-node ./scripts/generateAreaDebug.ts",
|
||||
"gen:subway": "ts-node ./scripts/local/getAmapSubway.ts",
|
||||
"clean:dir": "ts-node ./scripts/cleanDtsAndJs",
|
||||
"test": "ts-node ./test/test.ts",
|
||||
"prepare": "rimraf node_modules/react & rimraf node_modules/react-dom & rimraf node_modules/react-router",
|
||||
|
|
|
|||
|
|
@ -1,63 +1,60 @@
|
|||
/**
|
||||
* 用于更新高德数据库中的adCode信息到本地src/data/area.json中
|
||||
*/
|
||||
import 'isomorphic-fetch';
|
||||
import assert from 'assert';
|
||||
import { writeFileSync } from 'fs-extra';
|
||||
import { FormCreateData } from 'oak-domain/lib/types/Entity';
|
||||
import { OpSchema as Area } from '../src/general-app-domain/Area/Schema';
|
||||
|
||||
|
||||
const KEY = '4f3d4499850ba51429b9dece8cedd8d2';
|
||||
|
||||
async function acquireAmap(keyWords: string, subdistrict: number) {
|
||||
const url = `https://restapi.amap.com/v3/config/district?keywords=${encodeURIComponent(keyWords)}&subdistrict=${subdistrict}&key=${KEY}`;
|
||||
|
||||
const res = await fetch(url);
|
||||
return res.json();
|
||||
}
|
||||
|
||||
|
||||
function processRepeatedAdCode(districts: any[], parentAdCode: string) {
|
||||
// 高德的street的adCode和父亲相同,这里统一处理一下
|
||||
let jdCount = 0;
|
||||
let zCount = 100;
|
||||
let oCount = 400;
|
||||
let xCount = 200;
|
||||
const districts2 = districts.map(
|
||||
(ele) => {
|
||||
const { name, adcode } = ele;
|
||||
let ele2 = ele;
|
||||
if (adcode === parentAdCode) {
|
||||
if (name.endsWith('街道')) {
|
||||
ele2 = Object.assign(ele, { adcode: parseInt(adcode) * 1000 + jdCount });
|
||||
jdCount++;
|
||||
}
|
||||
else if (name.endsWith('镇')) {
|
||||
ele2 = Object.assign(ele, { adcode: parseInt(adcode) * 1000 + zCount });
|
||||
zCount++;
|
||||
}
|
||||
else if (name.endsWith('乡')) {
|
||||
ele2 = Object.assign(ele, { adcode: parseInt(adcode) * 1000 + xCount });
|
||||
xCount++;
|
||||
}
|
||||
else {
|
||||
ele2 = Object.assign(ele, { adcode: parseInt(adcode) * 1000 + oCount });
|
||||
oCount++;
|
||||
}
|
||||
}
|
||||
return ele2;
|
||||
}
|
||||
);
|
||||
return districts2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 省份直接取到街道,然后存储
|
||||
* @param provinceName
|
||||
* @returns {*}
|
||||
*/
|
||||
/* function getProvince(provinceName) {
|
||||
import "isomorphic-fetch";
|
||||
import assert from "assert";
|
||||
import { writeFileSync } from "fs-extra";
|
||||
import { FormCreateData } from "oak-domain/lib/types/Entity";
|
||||
import { OpSchema as Area } from "../../src/general-app-domain/Area/Schema";
|
||||
|
||||
const KEY = "4f3d4499850ba51429b9dece8cedd8d2";
|
||||
|
||||
async function acquireAmap(keyWords: string, subdistrict: number) {
|
||||
const url = `https://restapi.amap.com/v3/config/district?keywords=${encodeURIComponent(
|
||||
keyWords
|
||||
)}&subdistrict=${subdistrict}&key=${KEY}`;
|
||||
|
||||
const res = await fetch(url);
|
||||
return res.json();
|
||||
}
|
||||
|
||||
function processRepeatedAdCode(districts: any[], parentAdCode: string) {
|
||||
// 高德的street的adCode和父亲相同,这里统一处理一下
|
||||
let jdCount = 0;
|
||||
let zCount = 100;
|
||||
let oCount = 400;
|
||||
let xCount = 200;
|
||||
const districts2 = districts.map((ele) => {
|
||||
const { name, adcode } = ele;
|
||||
let ele2 = ele;
|
||||
if (adcode === parentAdCode) {
|
||||
if (name.endsWith("街道")) {
|
||||
ele2 = Object.assign(ele, {
|
||||
adcode: parseInt(adcode) * 1000 + jdCount,
|
||||
});
|
||||
jdCount++;
|
||||
} else if (name.endsWith("镇")) {
|
||||
ele2 = Object.assign(ele, { adcode: parseInt(adcode) * 1000 + zCount });
|
||||
zCount++;
|
||||
} else if (name.endsWith("乡")) {
|
||||
ele2 = Object.assign(ele, { adcode: parseInt(adcode) * 1000 + xCount });
|
||||
xCount++;
|
||||
} else {
|
||||
ele2 = Object.assign(ele, { adcode: parseInt(adcode) * 1000 + oCount });
|
||||
oCount++;
|
||||
}
|
||||
}
|
||||
return ele2;
|
||||
});
|
||||
return districts2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 省份直接取到街道,然后存储
|
||||
* @param provinceName
|
||||
* @returns {*}
|
||||
*/
|
||||
/* function getProvince(provinceName) {
|
||||
return acquireAmap(provinceName, 3)
|
||||
.then(
|
||||
(result) => {
|
||||
|
|
@ -79,66 +76,63 @@
|
|||
}
|
||||
);
|
||||
} */
|
||||
|
||||
|
||||
async function main() {
|
||||
const areaTotal: FormCreateData<Area>[] = [];
|
||||
function saveAreas(areas: any[], parentId: string | null, depth: 0 | 1 | 2 | 3 | 4, dest: FormCreateData<Area>[]) {
|
||||
areas.forEach(
|
||||
(ele) => {
|
||||
const { adcode, center, citycode, level, name } = ele;
|
||||
const coords = center.split(',');
|
||||
dest.push({
|
||||
code: adcode,
|
||||
level,
|
||||
parentId,
|
||||
name,
|
||||
depth,
|
||||
id: adcode,
|
||||
center: {
|
||||
type: 'point',
|
||||
coordinate: [parseFloat(coords[0]), parseFloat(coords[1])],
|
||||
},
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
const result = await acquireAmap('中国', 1);
|
||||
const { districts } = result;
|
||||
const country = districts[0];
|
||||
saveAreas([country], null, 0, areaTotal);
|
||||
const { districts: provinces, adcode: countryCode } = country;
|
||||
|
||||
saveAreas(provinces, countryCode, 1, areaTotal);
|
||||
|
||||
// 完整的数据
|
||||
for (const dist of provinces) {
|
||||
const result2 = await acquireAmap(dist.name, 3);
|
||||
const { districts: cities, adcode: provinceCode } = result2.districts[0];
|
||||
saveAreas(cities, provinceCode, 2, areaTotal);
|
||||
for (const city of cities) {
|
||||
const { districts, adcode: cityCode } = city;
|
||||
const districts2 = processRepeatedAdCode(districts, cityCode);
|
||||
saveAreas(districts2, cityCode, 3, areaTotal);
|
||||
districts2.forEach(
|
||||
(district) => {
|
||||
const { districts: streets, adcode: districtCode } = district;
|
||||
const streets2 = processRepeatedAdCode(streets, districtCode);
|
||||
saveAreas(streets2, districtCode, 4, areaTotal);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
writeFileSync(`${__dirname}/../area.json`, JSON.stringify(areaTotal));
|
||||
}
|
||||
|
||||
|
||||
main().then(
|
||||
() => console.log('success')
|
||||
);
|
||||
/*
|
||||
|
||||
async function main() {
|
||||
const areaTotal: FormCreateData<Area>[] = [];
|
||||
function saveAreas(
|
||||
areas: any[],
|
||||
parentId: string | null,
|
||||
depth: 0 | 1 | 2 | 3 | 4,
|
||||
dest: FormCreateData<Area>[]
|
||||
) {
|
||||
areas.forEach((ele) => {
|
||||
const { adcode, center, citycode, level, name } = ele;
|
||||
const coords = center.split(",");
|
||||
dest.push({
|
||||
code: adcode,
|
||||
level,
|
||||
parentId,
|
||||
name,
|
||||
depth,
|
||||
id: adcode,
|
||||
center: {
|
||||
type: "point",
|
||||
coordinate: [parseFloat(coords[0]), parseFloat(coords[1])],
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const result = await acquireAmap("中国", 1);
|
||||
const { districts } = result;
|
||||
const country = districts[0];
|
||||
saveAreas([country], null, 0, areaTotal);
|
||||
const { districts: provinces, adcode: countryCode } = country;
|
||||
|
||||
saveAreas(provinces, countryCode, 1, areaTotal);
|
||||
|
||||
// 完整的数据
|
||||
for (const dist of provinces) {
|
||||
const result2 = await acquireAmap(dist.name, 3);
|
||||
const { districts: cities, adcode: provinceCode } = result2.districts[0];
|
||||
saveAreas(cities, provinceCode, 2, areaTotal);
|
||||
for (const city of cities) {
|
||||
const { districts, adcode: cityCode } = city;
|
||||
const districts2 = processRepeatedAdCode(districts, cityCode);
|
||||
saveAreas(districts2, cityCode, 3, areaTotal);
|
||||
districts2.forEach((district) => {
|
||||
const { districts: streets, adcode: districtCode } = district;
|
||||
const streets2 = processRepeatedAdCode(streets, districtCode);
|
||||
saveAreas(streets2, districtCode, 4, areaTotal);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
writeFileSync(`${__dirname}/../area.json`, JSON.stringify(areaTotal));
|
||||
}
|
||||
|
||||
main().then(() => console.log("success"));
|
||||
/*
|
||||
acquireAmap('中国', 1)
|
||||
.then(
|
||||
(result) => {
|
||||
|
|
@ -169,4 +163,3 @@
|
|||
process.exit(-1);
|
||||
}
|
||||
); */
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1 @@
|
|||
[{"id":"330100023133","name":"1号线","areaId":"330100"},{"id":"330100023132","name":"1号线","areaId":"330100"},{"id":"900000150789","name":"绍兴1号线","areaId":"330100"},{"id":"330100020003","name":"2号线","areaId":"330100"},{"id":"900000092651","name":"3号线","areaId":"330100"},{"id":"900000096933","name":"3号线","areaId":"330100"},{"id":"900000029624","name":"4号线","areaId":"330100"},{"id":"900000065767","name":"5号线","areaId":"330100"},{"id":"900000073754","name":"6号线","areaId":"330100"},{"id":"900000062493","name":"6号线","areaId":"330100"},{"id":"900000099060","name":"7号线","areaId":"330100"},{"id":"900000099066","name":"8号线","areaId":"330100"},{"id":"900000166808","name":"9号线","areaId":"330100"},{"id":"900000122963","name":"10号线","areaId":"330100"},{"id":"900000130963","name":"16号线","areaId":"330100"},{"id":"900000101230","name":"19号线","areaId":"330100"},{"id":"900000150702","name":"杭海城际","areaId":"330100"},{"id":"900000109349","name":"S1线","areaId":"330300"}]
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,10 +1,16 @@
|
|||
import { users, roles, mobiles, tokens } from './userRole';
|
||||
import { area } from './area';
|
||||
import { users, roles, mobiles, tokens } from "./userRole";
|
||||
import { area } from "./area";
|
||||
import { subway } from "./subway";
|
||||
import { station } from "./station";
|
||||
import { subwayStation } from "./subwayStation";
|
||||
|
||||
export default {
|
||||
user: users,
|
||||
role: roles,
|
||||
mobile: mobiles,
|
||||
token: tokens,
|
||||
area,
|
||||
};
|
||||
user: users,
|
||||
role: roles,
|
||||
mobile: mobiles,
|
||||
token: tokens,
|
||||
area,
|
||||
subway,
|
||||
station,
|
||||
subwayStation,
|
||||
};
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,93 @@
|
|||
import { CreateOperationData as Subway } from "../general-app-domain/Subway/Schema";
|
||||
export const subway: Subway[] = [
|
||||
{
|
||||
id: "330100023133",
|
||||
name: "1号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "330100023132",
|
||||
name: "1号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000150789",
|
||||
name: "绍兴1号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "330100020003",
|
||||
name: "2号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000092651",
|
||||
name: "3号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000096933",
|
||||
name: "3号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000029624",
|
||||
name: "4号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000065767",
|
||||
name: "5号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000073754",
|
||||
name: "6号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000062493",
|
||||
name: "6号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000099060",
|
||||
name: "7号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000099066",
|
||||
name: "8号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000166808",
|
||||
name: "9号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000122963",
|
||||
name: "10号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000130963",
|
||||
name: "16号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000101230",
|
||||
name: "19号线",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000150702",
|
||||
name: "杭海城际",
|
||||
areaId: "330100",
|
||||
},
|
||||
{
|
||||
id: "900000109349",
|
||||
name: "S1线",
|
||||
areaId: "330300",
|
||||
},
|
||||
];
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -72,4 +72,27 @@
|
|||
.confirm-btn {
|
||||
align-self: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
.unit-box {
|
||||
margin-left: 32rpx;
|
||||
|
||||
height: 50rpx;
|
||||
width: 120rpx;
|
||||
border: 1px solid @oak-color-primary;
|
||||
color: @oak-color-primary;
|
||||
border-radius: 10rpx;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.unit {
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.icon {
|
||||
color: @oak-color-primary !important;
|
||||
}
|
||||
}
|
||||
|
|
@ -33,14 +33,30 @@ export default OakComponent({
|
|||
qrCodeType: '' as QrCodeType,
|
||||
},
|
||||
data: {
|
||||
period: 5,
|
||||
period: 15,
|
||||
userEntityGrantId: '',
|
||||
unit: 'minute' as Unit,
|
||||
maxes: {
|
||||
minute: 4320, // 60 * 24 * 3
|
||||
hour: 72,
|
||||
minute: 3 * 24 * 60,
|
||||
hour: 3 * 24,
|
||||
day: 3,
|
||||
},
|
||||
defaultPeriods: {
|
||||
minute: 15,
|
||||
hour: 1,
|
||||
day: 1,
|
||||
},
|
||||
unitArr: [
|
||||
{
|
||||
label: '分钟',
|
||||
value: 'minute',
|
||||
},
|
||||
{
|
||||
label: '小时',
|
||||
value: 'hour',
|
||||
},
|
||||
],
|
||||
unitIndex: 0,
|
||||
},
|
||||
lifetimes: {
|
||||
ready() {
|
||||
|
|
@ -112,7 +128,18 @@ export default OakComponent({
|
|||
this.setPeriod(count);
|
||||
},
|
||||
setUnit(u: Unit) {
|
||||
const { defaultPeriods } = this.state;
|
||||
this.setState({ unit: u });
|
||||
this.setPeriod(defaultPeriods[u as Unit]);
|
||||
},
|
||||
setUnitMp(e: any) {
|
||||
const { unitArr } = this.state;
|
||||
const { value } = e.detail;
|
||||
const unitObj = unitArr[value];
|
||||
this.setState({
|
||||
unitIndex: value,
|
||||
});
|
||||
this.setUnit(unitObj.value as Unit);
|
||||
},
|
||||
onBack() {
|
||||
this.navigateBack();
|
||||
|
|
|
|||
|
|
@ -80,14 +80,24 @@
|
|||
<view class="value-period">
|
||||
<l-counter
|
||||
count="{{period}}"
|
||||
max="120"
|
||||
min="5"
|
||||
max="{{ maxes[unit] }}"
|
||||
min="1"
|
||||
round-float="{{true}}"
|
||||
bind:linchange="setPeriodMp"
|
||||
/>
|
||||
<view style="margin-left: 30rpx">
|
||||
<!-- <view style="margin-left: 30rpx">
|
||||
分钟
|
||||
</view>
|
||||
</view> -->
|
||||
<picker range="{{unitArr}}" range-key="label" value="{{unitIndex}}" bind:change="setUnitMp">
|
||||
<view class="unit-box">
|
||||
<view class="unit">
|
||||
{{unitArr[unitIndex].label}}
|
||||
</view>
|
||||
|
||||
<l-icon l-class="icon" name="down" size="18" />
|
||||
</view>
|
||||
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view style="flex: 1" />
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ export default function render(
|
|||
userEntityGrantId: string;
|
||||
unit: Unit;
|
||||
maxes: Record<Unit, number>;
|
||||
unitArr: Array<{ label: string; value: Unit }>;
|
||||
},
|
||||
{
|
||||
confirm: () => Promise<void>;
|
||||
|
|
@ -46,6 +47,7 @@ export default function render(
|
|||
period,
|
||||
unit,
|
||||
maxes,
|
||||
unitArr,
|
||||
} = props.data;
|
||||
const { relation, type, number, entity } = userEntityGrant || {};
|
||||
const { update, t, onBack, confirm, setInit, setPeriod, setUnit } =
|
||||
|
|
@ -137,7 +139,10 @@ export default function render(
|
|||
message: '请选择一个时效',
|
||||
},
|
||||
]}
|
||||
help={<div style={{ marginBottom: 16 }}>支持分钟、小时选择</div>}
|
||||
help={
|
||||
<div style={{ marginBottom: 16 }}>支持分钟、小时选择</div>
|
||||
}
|
||||
tooltip="通过配置实现在规定的时效内扫描二维码不过期的效果。"
|
||||
>
|
||||
<>
|
||||
<InputNumber
|
||||
|
|
@ -145,26 +150,23 @@ export default function render(
|
|||
max={maxes[unit]}
|
||||
value={period}
|
||||
onChange={(value) => setPeriod(value!)}
|
||||
// addonAfter="分钟"
|
||||
addonAfter={
|
||||
<Select
|
||||
value={unit}
|
||||
style={{ width: 80 }}
|
||||
onChange={(v) => {
|
||||
setUnit(v);
|
||||
if (v === 'minute') {
|
||||
setPeriod(5);
|
||||
} else if (v === 'hour') {
|
||||
setPeriod(1);
|
||||
} else if (v === 'day') {
|
||||
setPeriod(1);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Select.Option value="minute">
|
||||
分钟
|
||||
</Select.Option>
|
||||
<Select.Option value="hour">小时</Select.Option>
|
||||
{/* <Select.Option value="day">天</Select.Option> */}
|
||||
{unitArr.map((ele, index) => (
|
||||
<Select.Option
|
||||
key={index}
|
||||
value={ele.value}
|
||||
>
|
||||
{ele.label}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue