Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ function App() {
const [xRange, setXRange] = useState({ min: undefined, max: undefined });
const [maxStep, setMaxStep] = useState(0);
const [sidebarVisible, setSidebarVisible] = useState(true);
const [useStepKeyword, setUseStepKeyword] = useState(false);
const [stepKeyword, setStepKeyword] = useState('step:');

const handleFilesUploaded = useCallback((files) => {
const filesWithDefaults = files.map(file => ({
Expand Down Expand Up @@ -340,7 +342,29 @@ function App() {
<h4 className="text-xs font-medium text-gray-700 mb-2">📊 图表显示</h4>
<p className="text-xs text-gray-500">上传文件后自动展示所有已配置的指标图表</p>
</div>

<div className="border-t pt-3">
<h4 className="text-xs font-medium text-gray-700 mb-2">Step 设置</h4>
<label className="inline-flex items-center text-xs text-gray-700">
<input
type="checkbox"
className="mr-2"
checked={useStepKeyword}
onChange={(e) => setUseStepKeyword(e.target.checked)}
/>
使用关键词定位 step
</label>
{useStepKeyword && (
<input
type="text"
value={stepKeyword}
onChange={(e) => setStepKeyword(e.target.value)}
className="mt-2 w-full px-2 py-1 text-xs border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500 focus:outline-none"
placeholder="step:"
aria-label="step keyword"
/>
)}
</div>

<div className="border-t pt-3">
<h4 className="text-xs font-medium text-gray-700 mb-2">基准线设置</h4>
<div className="space-y-3">
Expand Down Expand Up @@ -414,6 +438,8 @@ function App() {
xRange={xRange}
onXRangeChange={setXRange}
onMaxStepChange={setMaxStep}
useStepKeyword={useStepKeyword}
stepKeyword={stepKeyword}
/>
</section>
</main>
Expand All @@ -425,6 +451,7 @@ function App() {
onClose={handleConfigClose}
onSave={handleConfigSave}
globalParsingConfig={globalParsingConfig}
stepKeyword={stepKeyword}
/>
</div>
);
Expand Down
Loading