Merge remote-tracking branch 'origin/dev' into dev
commit
ad3307f863
|
|
@ -28,6 +28,7 @@
|
|||
"animate.css": "^4.1.1",
|
||||
"antd": "6.5.0",
|
||||
"autofit.js": "^3.2.8",
|
||||
"china-division": "^2.7.0",
|
||||
"dayjs": "^1.11.7",
|
||||
"echarts": "^6.0.0",
|
||||
"immer": "^11.1.4",
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@ importers:
|
|||
autofit.js:
|
||||
specifier: ^3.2.8
|
||||
version: 3.2.8
|
||||
china-division:
|
||||
specifier: ^2.7.0
|
||||
version: 2.7.0
|
||||
dayjs:
|
||||
specifier: ^1.11.7
|
||||
version: 1.11.21
|
||||
|
|
@ -2839,6 +2842,9 @@ packages:
|
|||
chardet@0.4.2:
|
||||
resolution: {integrity: sha512-j/Toj7f1z98Hh2cYo2BVr85EpIRWqUi7rtRSGxh/cqUjqrnJe9l9UE7IUGd2vQ2p+kSHLkSzObQPZPLUC6TQwg==}
|
||||
|
||||
china-division@2.7.0:
|
||||
resolution: {integrity: sha512-4uUPAT+1WfqDh5jytq7omdCmHNk3j+k76zEG/2IqaGcYB90c2SwcixttcypdsZ3T/9tN1TTpBDoeZn+Yw/qBEA==}
|
||||
|
||||
chokidar@3.6.0:
|
||||
resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}
|
||||
engines: {node: '>= 8.10.0'}
|
||||
|
|
@ -9664,6 +9670,8 @@ snapshots:
|
|||
|
||||
chardet@0.4.2: {}
|
||||
|
||||
china-division@2.7.0: {}
|
||||
|
||||
chokidar@3.6.0:
|
||||
dependencies:
|
||||
anymatch: 3.1.3
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<% for (const item of $links) { %>
|
||||
<link type="text/css" rel="stylesheet" href="<%= item %>"></link>
|
||||
<% } %>
|
||||
<title>大屏</title>
|
||||
<title>注册</title>
|
||||
<script>
|
||||
(function () {
|
||||
const APP_ENV = {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,53 @@
|
|||
/** 企业信息管理模块下拉选项 */
|
||||
import pcaCode from "china-division/dist/pca-code.json";
|
||||
|
||||
/** 重庆市辖区(区/县) */
|
||||
/** 重庆市辖区(区) */
|
||||
export const CHONGQING_DISTRICTS = [
|
||||
"万州区", "涪陵区", "渝中区", "大渡口区", "江北区", "沙坪坝区", "九龙坡区", "南岸区",
|
||||
"北碚区", "綦江区", "大足区", "渝北区", "巴南区", "黔江区", "长寿区", "江津区",
|
||||
"合川区", "永川区", "南川区", "璧山区", "铜梁区", "潼南区", "荣昌区", "开州区",
|
||||
"梁平区", "武隆区", "城口县", "丰都县", "垫江县", "忠县", "云阳县", "奉节县",
|
||||
"巫山县", "巫溪县", "石柱土家族自治县", "秀山土家族苗族自治县", "酉阳土家族苗族自治县",
|
||||
"彭水苗族土家族自治县",
|
||||
].map((label) => ({ label, value: label }));
|
||||
{ label: "万州区", value: "500101" },
|
||||
{ label: "涪陵区", value: "500102" },
|
||||
{ label: "渝中区", value: "500103" },
|
||||
{ label: "大渡口区", value: "500104" },
|
||||
{ label: "江北区", value: "500105" },
|
||||
{ label: "沙坪坝区", value: "500106" },
|
||||
{ label: "九龙坡区", value: "500107" },
|
||||
{ label: "南岸区", value: "500108" },
|
||||
{ label: "北碚区", value: "500109" },
|
||||
{ label: "綦江区", value: "500110" },
|
||||
{ label: "大足区", value: "500111" },
|
||||
{ label: "渝北区", value: "500112" },
|
||||
{ label: "巴南区", value: "500113" },
|
||||
{ label: "黔江区", value: "500114" },
|
||||
{ label: "长寿区", value: "500115" },
|
||||
{ label: "江津区", value: "500116" },
|
||||
{ label: "合川区", value: "500117" },
|
||||
{ label: "永川区", value: "500118" },
|
||||
{ label: "南川区", value: "500119" },
|
||||
{ label: "璧山区", value: "500120" },
|
||||
{ label: "铜梁区", value: "500151" },
|
||||
{ label: "潼南区", value: "500152" },
|
||||
{ label: "荣昌区", value: "500153" },
|
||||
{ label: "开州区", value: "500154" },
|
||||
{ label: "梁平区", value: "500155" },
|
||||
{ label: "武隆区", value: "500156" },
|
||||
];
|
||||
|
||||
/** 全国县级行政区(非重庆时属地可选,已排除重庆) */
|
||||
export const NATIONAL_COUNTIES = (() => {
|
||||
const result = [];
|
||||
pcaCode.forEach((province) => {
|
||||
if (province.code === "50") return;
|
||||
province.children?.forEach((city) => {
|
||||
city.children?.forEach((county) => {
|
||||
result.push({
|
||||
label: `${province.name}/${city.name}/${county.name}`,
|
||||
value: county.code,
|
||||
name: county.name,
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
return result;
|
||||
})();
|
||||
|
||||
/** 企业状态 */
|
||||
export const ENTERPRISE_STATUS_OPTIONS = [
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import {
|
|||
InputNumber,
|
||||
DatePicker,
|
||||
Space,
|
||||
Radio,
|
||||
} from "antd";
|
||||
import { NS_REGISTER } from "~/enumerate/namespace";
|
||||
import AttachmentUpload from "~/components/AttachmentUpload";
|
||||
|
|
@ -34,6 +35,7 @@ import {
|
|||
} from "~/utils/validators";
|
||||
import {
|
||||
CHONGQING_DISTRICTS,
|
||||
NATIONAL_COUNTIES,
|
||||
ECONOMY_INDUSTRY_OPTIONS,
|
||||
ENTERPRISE_SCALE_OPTIONS,
|
||||
ENTERPRISE_STATUS_OPTIONS,
|
||||
|
|
@ -52,6 +54,9 @@ const RegisterMore = (props) => {
|
|||
const [mapPickerVisible, setMapPickerVisible] = useState(false);
|
||||
const [form] = Form.useForm();
|
||||
const { registerLoading, syncUserToGBSLoading } = register;
|
||||
const isChongqing = Form.useWatch("isChongqing", form);
|
||||
const districtOptions =
|
||||
isChongqing === 2 ? NATIONAL_COUNTIES : CHONGQING_DISTRICTS;
|
||||
const hasRegisterContext = Boolean(
|
||||
router.query?.account && router.query?.registerUserId,
|
||||
);
|
||||
|
|
@ -61,8 +66,17 @@ const RegisterMore = (props) => {
|
|||
data: router.query?.account,
|
||||
});
|
||||
if (res?.data) {
|
||||
const districtCode = res.data.districtCode;
|
||||
const isChongqing = districtCode
|
||||
? CHONGQING_DISTRICTS.some(
|
||||
(d) => d.value === districtCode || d.label === districtCode,
|
||||
)
|
||||
? 1
|
||||
: 2
|
||||
: 1;
|
||||
form.setFieldsValue({
|
||||
...res.data,
|
||||
isChongqing,
|
||||
productionDate: res.data.productionDate
|
||||
? dayjs(res.data.productionDate)
|
||||
: undefined,
|
||||
|
|
@ -182,6 +196,7 @@ const RegisterMore = (props) => {
|
|||
form={form}
|
||||
labelCol={{ span: 10 }}
|
||||
disabled={!hasRegisterContext}
|
||||
initialValues={{ isChongqing: 1 }}
|
||||
>
|
||||
<Row gutter={[16, 16]}>
|
||||
<Col span={12}>
|
||||
|
|
@ -236,6 +251,24 @@ const RegisterMore = (props) => {
|
|||
</Form.Item>
|
||||
<Form.Item name="safetyIndustryCategoryName" noStyle />
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
name="isChongqing"
|
||||
label="是否属于重庆"
|
||||
rules={[{ required: true, message: "请选择是否属于重庆" }]}
|
||||
>
|
||||
<Radio.Group
|
||||
options={[
|
||||
{ label: "是", value: 1 },
|
||||
{ label: "否", value: 2 },
|
||||
]}
|
||||
onChange={() => {
|
||||
form.setFieldValue("districtCode", undefined);
|
||||
form.setFieldValue("districtName", "");
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
name="districtCode"
|
||||
|
|
@ -243,11 +276,16 @@ const RegisterMore = (props) => {
|
|||
rules={[{ required: true, message: "请选择属地" }]}
|
||||
>
|
||||
<Select
|
||||
options={CHONGQING_DISTRICTS}
|
||||
options={districtOptions}
|
||||
placeholder="请选择属地"
|
||||
allowClear
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
onChange={(value, option) => {
|
||||
form.setFieldValue("districtName", option?.label || "");
|
||||
form.setFieldValue(
|
||||
"districtName",
|
||||
option?.name || option?.label || "",
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
|
|
|||
Loading…
Reference in New Issue