feat: 编辑备注改为多行输入框
This commit is contained in:
@@ -449,7 +449,7 @@ INDEX_TEMPLATE = '''
|
|||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">备注</label>
|
<label class="form-label">备注</label>
|
||||||
<input type="text" id="editNote" class="form-control">
|
<textarea id="editNote" class="form-control" rows="3"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -721,7 +721,11 @@ async function openEditModal(id) {
|
|||||||
// 保存编辑
|
// 保存编辑
|
||||||
async function saveEdit() {
|
async function saveEdit() {
|
||||||
const id = document.getElementById('editId').value;
|
const id = document.getElementById('editId').value;
|
||||||
const type = currentDetailId ? (await fetch(`${API_BASE}/items/${currentDetailId}`).then(r => r.json())).data.type : 'text';
|
|
||||||
|
// 获取当前条目的类型
|
||||||
|
const detailRes = await fetch(`${API_BASE}/items/${currentDetailId}`);
|
||||||
|
const detailData = await detailRes.json();
|
||||||
|
const type = detailData.data.type;
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
title: document.getElementById('editTitle').value,
|
title: document.getElementById('editTitle').value,
|
||||||
|
|||||||
Reference in New Issue
Block a user