merge(dev): partner dropdown label company-name
CI / verify (push) Has been cancelled

This commit is contained in:
2026-08-02 13:07:41 +08:00
2 changed files with 25 additions and 9 deletions
+10 -3
View File
@@ -306,7 +306,14 @@ type StoreRow = {
category?: { id: string; name: string; parentId?: string | null } | null;
};
type PartnerOption = { id: string; companyName: string };
type PartnerOption = { id: string; companyName: string; name?: string };
function partnerOptionLabel(p: PartnerOption): string {
const company = (p.companyName || '').trim();
const person = (p.name || '').trim();
if (company && person) return `${company}-${person}`;
return company || person || p.id;
}
type CityOption = {
id: string;
name: string;
@@ -799,7 +806,7 @@ export default function StoresPage() {
optionFilterProp="label"
style={{ width: 180 }}
placeholder="全部"
options={filterPartners.map((p) => ({ value: p.id, label: p.companyName || p.id }))}
options={filterPartners.map((p) => ({ value: p.id, label: partnerOptionLabel(p) }))}
/>
</Form.Item>
<Form.Item name="status" label="营业状态">
@@ -1129,7 +1136,7 @@ export default function StoresPage() {
loading={optionsLoading}
optionFilterProp="label"
placeholder={optionsLoading ? '加载中…' : '请选择开城合伙人'}
options={partners.map((p) => ({ value: p.id, label: p.companyName }))}
options={partners.map((p) => ({ value: p.id, label: partnerOptionLabel(p) }))}
onChange={(partnerAccountId) => {
const codes = createForm.getFieldValue('regionCodes') as string[] | undefined;
if (codes?.length === 3) bindRegionSelection(codes, partnerAccountId);
+15 -6
View File
@@ -48,14 +48,19 @@ load_env() {
fi
}
load_env
# CLI 覆盖 deploy.env(须在 load_env 之后解析)
CLI_ENV=""
CLI_BRANCH=""
while [[ $# -gt 0 ]]; do
case "$1" in
--env) DUKANG_DEPLOY_ENV="$2"; shift 2 ;;
--env) CLI_ENV="$2"; shift 2 ;;
--host) DEPLOY_HOST="$2"; shift 2 ;;
--user) DEPLOY_USER="$2"; shift 2 ;;
--port) DEPLOY_PORT="$2"; shift 2 ;;
--key) DEPLOY_SSH_KEY="$2"; shift 2 ;;
--branch) GIT_BRANCH="$2"; shift 2 ;;
--branch) CLI_BRANCH="$2"; shift 2 ;;
--check) CHECK_ONLY=true; shift ;;
-h|--help) usage; exit 0 ;;
--)
@@ -67,11 +72,13 @@ while [[ $# -gt 0 ]]; do
esac
done
load_env
if [[ -n "$CLI_ENV" ]]; then
DUKANG_DEPLOY_ENV="$CLI_ENV"
fi
# 兼容旧调用:未传 --env 时,若 GIT_BRANCH=main 视为生产,否则 staging
if [[ -z "$DUKANG_DEPLOY_ENV" ]]; then
if [[ "${GIT_BRANCH:-}" == "main" || "${GIT_BRANCH:-}" == "master" ]]; then
if [[ "${CLI_BRANCH:-${GIT_BRANCH:-}}" == "main" || "${CLI_BRANCH:-${GIT_BRANCH:-}}" == "master" ]]; then
DUKANG_DEPLOY_ENV=production
else
DUKANG_DEPLOY_ENV=staging
@@ -96,7 +103,8 @@ if [[ "$DUKANG_DEPLOY_ENV" == "staging" ]]; then
elif [[ "$APP_ROOT" == "/opt/dukang" ]]; then
APP_ROOT="/opt/dukang-staging"
fi
GIT_BRANCH="${GIT_BRANCH:-dev}"
# 测试固定默认 devCLI --branch 优先,忽略 deploy.env 里误配的 main
GIT_BRANCH="${CLI_BRANCH:-dev}"
PORT_GREP='819[0-4]'
else
APP_ROOT="${PROD_APP_ROOT:-${APP_ROOT:-/opt/dukang}}"
@@ -105,7 +113,8 @@ else
elif [[ "$APP_ROOT" == "/opt/dukang-staging" ]]; then
APP_ROOT="/opt/dukang"
fi
GIT_BRANCH="${GIT_BRANCH:-main}"
# 生产固定默认 mainCLI --branch 优先,忽略 deploy.env 里误配的 dev
GIT_BRANCH="${CLI_BRANCH:-main}"
PORT_GREP='809[0-4]'
fi