mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-04 20:00:17 +01:00
This commit is contained in:
parent
92aa808182
commit
cd1a4b6ffb
4 changed files with 28 additions and 18 deletions
|
|
@ -5,9 +5,10 @@ import {fetchPost} from "../../../util/fetch";
|
|||
import {escapeHtml} from "../../../util/escape";
|
||||
import {transaction} from "../../wysiwyg/transaction";
|
||||
import {unicode2Emoji} from "../../../emoji";
|
||||
import {getColIconByType} from "./col";
|
||||
import {getColIconByType, getColId} from "./col";
|
||||
import {showMessage} from "../../../dialog/message";
|
||||
import {getNameByOperator} from "./calc";
|
||||
import {getFieldsByData} from "./view";
|
||||
|
||||
const updateCol = (options: {
|
||||
target: HTMLElement,
|
||||
|
|
@ -20,7 +21,7 @@ const updateCol = (options: {
|
|||
return;
|
||||
}
|
||||
options.target.querySelector(".b3-menu__accelerator").textContent = itemElement.querySelector(".b3-list-item__text").textContent;
|
||||
const colData = options.data.view.columns.find((item) => {
|
||||
const colData = getFieldsByData(options.data).find((item) => {
|
||||
if (item.id === options.colId) {
|
||||
if (!item.rollup) {
|
||||
item.rollup = {};
|
||||
|
|
@ -166,8 +167,8 @@ export const getRollupHTML = (options: { data?: IAV, cellElements?: HTMLElement[
|
|||
if (options.colData) {
|
||||
colData = options.colData;
|
||||
} else {
|
||||
options.data.view.columns.find((item) => {
|
||||
if (item.id === options.cellElements[0].dataset.colId) {
|
||||
getFieldsByData(options.data).find((item) => {
|
||||
if (item.id === getColId(options.cellElements[0], options.data.viewType)) {
|
||||
colData = item;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -201,7 +202,7 @@ export const bindRollupData = (options: {
|
|||
const goSearchRollupTargetElement = options.menuElement.querySelector('[data-type="goSearchRollupTarget"]') as HTMLElement;
|
||||
let targetKeyAVId = "";
|
||||
if (oldValue.relationKeyID) {
|
||||
options.data.view.columns.find((item) => {
|
||||
getFieldsByData(options.data).find((item) => {
|
||||
if (item.id === oldValue.relationKeyID) {
|
||||
goSearchRollupColElement.querySelector(".b3-menu__accelerator").textContent = item.name;
|
||||
targetKeyAVId = item.relation.avID;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue