|
@@ -296,7 +296,9 @@
|
|
|
requestUtil.async(`https://web_history.tianyunperfect.cn/memos/update`, 'post', data, {}).then(res => {
|
|
|
showMsg('保存成功', 1);
|
|
|
hideModel();
|
|
|
- search();
|
|
|
+ // 根据id ,更新当前页面
|
|
|
+ document.getElementById(tmpId).innerText = formatTimeStr(document.getElementById('created_ts').value) + "\n" + content;
|
|
|
+
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -365,6 +367,7 @@
|
|
|
|
|
|
|
|
|
let tmpDiv = document.createElement('div');
|
|
|
+ tmpDiv.id = item['id'];
|
|
|
tmpDiv.innerText = formatTimeStr(item['created_ts']) + "\n" + item['content'];
|
|
|
// 样式加上border,点击跳转到对应的url https://memos.tianyunperfect.cn/m/ + item['resource_name']
|
|
|
tmpDiv.style.border = '1px solid #000';
|
|
@@ -377,8 +380,9 @@
|
|
|
tmpDiv.style.display = 'inline-block';
|
|
|
tmpDiv.ondblclick = function () {
|
|
|
tmpId = item['id'];
|
|
|
- quillModel.root.innerHTML = item['content'];
|
|
|
- document.getElementById('created_ts').value = formatTimeStr(item['created_ts']);
|
|
|
+ let innerText = document.getElementById(item['id']).innerText;
|
|
|
+ quillModel.root.innerHTML = innerText.split('\n').slice(1).join('\n');
|
|
|
+ document.getElementById('created_ts').value = formatTimeStr(innerText.split('\n')[0]);
|
|
|
showModel();
|
|
|
// focus
|
|
|
quillModel.focus();
|