feat: 优化文章优化Tab

This commit is contained in:
刘国栋
2026-02-04 22:21:19 +08:00
parent 8f7f082c3d
commit bf2551d529
2 changed files with 47 additions and 48 deletions
+2 -3
View File
@@ -798,14 +798,13 @@ with tab3:
with st.container(border=True): with st.container(border=True):
st.markdown("粘贴或上传已写文章,一键提升 GEO 效果(结构化、可引用、自然植入品牌)") st.markdown("粘贴或上传已写文章,一键提升 GEO 效果(结构化、可引用、自然植入品牌)")
with st.form("opt_form", clear_on_submit=False): # 输入方式与文章内容放在表单外,以便粘贴/上传后能触发重跑,从而正确更新「开始优化」按钮的可用状态
input_mode = st.radio( input_mode = st.radio(
"输入方式", "输入方式",
["粘贴文本", "上传文件(TXT/MD"], ["粘贴文本", "上传文件(TXT/MD"],
horizontal=True, horizontal=True,
key="opt_input_mode", key="opt_input_mode",
) )
if input_mode == "粘贴文本": if input_mode == "粘贴文本":
original_article = st.text_area( original_article = st.text_area(
"粘贴文章内容", height=360, key="opt_text" "粘贴文章内容", height=360, key="opt_text"
@@ -823,7 +822,6 @@ with tab3:
except Exception as e: except Exception as e:
st.error(f"上传文件解析失败:{e}") st.error(f"上传文件解析失败:{e}")
original_article = "" original_article = ""
if original_article: if original_article:
st.text_area( st.text_area(
"上传内容预览", "上传内容预览",
@@ -833,6 +831,7 @@ with tab3:
key="opt_upload_preview", key="opt_upload_preview",
) )
with st.form("opt_form", clear_on_submit=False):
target_platform = st.selectbox( target_platform = st.selectbox(
"目标平台(影响文风,可选)", "目标平台(影响文风,可选)",
[ [
+15 -15
View File
@@ -52,33 +52,33 @@ div[data-testid="stButton"] button[kind="primary"],
div[data-testid="stFormSubmitButton"] button[kind="primary"] { div[data-testid="stFormSubmitButton"] button[kind="primary"] {
# background-color: var(--primary) !important; # background-color: var(--primary) !important;
# color: white !important; # color: white !important;
border-radius: var(--radius) !important; # border-radius: var(--radius) !important;
# border: none !important; # border: none !important;
} }
button[kind="secondary"], # button[kind="secondary"],
div[data-testid="stButton"] button[kind="secondary"] { # div[data-testid="stButton"] button[kind="secondary"] {
background: #FFFFFF !important; # background: #FFFFFF !important;
border: 1px solid var(--border) !important; # border: 1px solid var(--border) !important;
# color: var(--text) !important; # # color: var(--text) !important;
border-radius: var(--radius) !important; # border-radius: var(--radius) !important;
} # }
button:focus, button:focus-visible { # button:focus, button:focus-visible {
box-shadow: 0 0 0 3px rgba(37,99,235,0.12) !important; # box-shadow: 0 0 0 3px rgba(37,99,235,0.12) !important;
outline: none !important; # outline: none !important;
} # }
/* 输入 */ /* 输入 */
.stTextInput input, .stTextArea textarea, .stSelectbox div[data-baseweb="select"] { .stTextInput input, .stTextArea textarea, .stSelectbox div[data-baseweb="select"] {
border-radius: 10px !important; border-radius: 10px !important;
} }
.stTextInput input, .stTextArea textarea { .stTextInput input, .stTextArea textarea {
border: 1px solid var(--border) !important; # border: 1px solid var(--border) !important;
padding: 0.75rem !important; padding: 0.75rem !important;
} }
.stTextInput input:focus, .stTextArea textarea:focus { .stTextInput input:focus, .stTextArea textarea:focus {
border-color: var(--primary) !important; # border-color: var(--primary) !important;
box-shadow: 0 0 0 3px rgba(37,99,235,0.12) !important; box-shadow: 0 0 0 3px rgba(37,99,235,0.12) !important;
} }
@@ -98,7 +98,7 @@ button:focus, button:focus-visible {
.stTabs [role="tab"]:focus-visible { .stTabs [role="tab"]:focus-visible {
outline: none !important; outline: none !important;
box-shadow: none !important; box-shadow: none !important;
border: none !important; # border: none !important;
} }
/* Tabs 产品化 */ /* Tabs 产品化 */