|
|
@@ -11,6 +11,7 @@ export function StockMain() {
|
|
|
const [searchParams] = useSearchParams();
|
|
|
const codeFromUrl = searchParams.get('code');
|
|
|
const [stockCode, setStockCode] = useState(codeFromUrl || undefined);//|| '001339'
|
|
|
+ const [showCode, setShowCode] = useState(false);
|
|
|
const classroom = searchParams.get('classroom');
|
|
|
const {
|
|
|
pushExamData,
|
|
|
@@ -161,6 +162,8 @@ export function StockMain() {
|
|
|
stockData={stockData}
|
|
|
memoData={memoData}
|
|
|
trades={trades}
|
|
|
+ width="100%"
|
|
|
+ scaleBarFullWidth={true}
|
|
|
/>
|
|
|
|
|
|
{/* 添加画线工具栏 */}
|
|
|
@@ -178,13 +181,23 @@ export function StockMain() {
|
|
|
<div className="flex items-center space-x-6">
|
|
|
{/* 查询输入框 */}
|
|
|
<div className="flex items-center space-x-2">
|
|
|
- <input
|
|
|
- type="text"
|
|
|
- value={stockCode}
|
|
|
- onChange={(e) => setStockCode(e.target.value)}
|
|
|
- placeholder="输入股票代码"
|
|
|
- className="px-3 py-2 text-sm bg-gray-700 text-white rounded-md border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
- />
|
|
|
+ <div className="relative">
|
|
|
+ <input
|
|
|
+ type={showCode ? "text" : "password"}
|
|
|
+ value={stockCode}
|
|
|
+ onChange={(e) => setStockCode(e.target.value)}
|
|
|
+ placeholder="输入股票代码"
|
|
|
+ maxLength={6}
|
|
|
+ className="px-3 py-2 pr-10 text-sm bg-gray-700 text-white rounded-md border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
+ />
|
|
|
+ <button
|
|
|
+ type="button"
|
|
|
+ onClick={() => setShowCode(!showCode)}
|
|
|
+ className="absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-white"
|
|
|
+ >
|
|
|
+ {showCode ? '👁️' : '👁️🗨️'}
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
<button
|
|
|
onClick={handleQuery}
|
|
|
className="px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors"
|