Открыть боковую панель
valov_1205
universo-phaser
Коммиты
5202e643
Коммит
5202e643
создал
Дек 14, 2023
по автору
avathar
Просмотр файлов
#174 рефакторинг выпадающих меню
владелец
cba28162
Изменения
10
Скрыть пробелы
Построчно
Рядом
universo-frontend/src/apps/cards/CreateCardDropDownList.ts
удалено
100644 → 0
Просмотр файла @
cba28162
import
{
COLOR_LIGHT
,
COLOR_PRIMARY
,
COLOR_DARK
}
from
'
../kanbans/Const
'
;
import
GetMaxTextObjectSize
from
'
../kanbans/GetMaxTextObjectSize
'
;
import
CreateTextObject
from
'
../kanbans/CreateTextObject
'
;
import
CreateCardPopupList
from
'
./CreateCardPopupList
'
;
import
{
EndlessCanvas
}
from
'
../spaces-2d/EndlessCanvas
'
;
import
ObjectWrapper
from
'
src/utils/objectWrapper
'
;
const
CreateCardDropDownList
=
function
(
scene
:
EndlessCanvas
,
board
:
ObjectWrapper
,
)
{
const
options
=
[
'
Редактировать карточку
'
,
'
Удалить карточку
'
];
const
maxTextSize
=
GetMaxTextObjectSize
(
scene
,
options
);
const
label
=
scene
.
rexUI
.
add
.
label
({
background
:
scene
.
rexUI
.
add
.
roundRectangle
(
0
,
0
,
2
,
2
,
0
,
COLOR_PRIMARY
)
.
setAlpha
(
0
),
text
:
CreateTextObject
(
scene
,
'
...
'
),
// .setFixedSize(
// maxTextSize.width,
// maxTextSize.height,
// )
space
:
{
left
:
10
,
right
:
10
,
top
:
10
,
bottom
:
10
,
icon
:
10
,
},
})
.
setData
(
'
value
'
,
''
);
let
menu
;
scene
.
rexUI
.
add
.
click
(
label
).
on
(
'
click
'
,
()
=>
{
if
(
!
menu
||
!
menu
.
scene
)
{
//@ts-ignore
const
menuX
=
label
.
getElement
(
'
text
'
).
getTopLeft
().
x
;
const
menuY
=
label
.
bottom
;
menu
=
CreateCardPopupList
(
scene
,
board
,
menuX
-
maxTextSize
.
width
+
GetMaxTextObjectSize
(
scene
,
[
'
...
'
]).
width
/
2
,
menuY
,
options
,
function
(
button
)
{
console
.
log
(
'
Click
'
,
button
.
text
);
// Добавленный console.log
if
(
button
.
text
===
'
Добавить карточку
'
)
{
// Ваш код для добавления новой колонки
}
else
if
(
button
.
text
===
'
Переименовать столбец
'
)
{
// Ваш код для переименования доски
console
.
log
(
'
button
'
,
button
);
}
else
if
(
button
.
text
===
'
Удалить столбец
'
)
{
// Ваш код для переименования доски
console
.
log
(
'
button
'
,
button
);
}
},
);
}
else
{
menu
.
collapse
();
menu
=
undefined
;
}
});
return
label
;
};
export
default
CreateCardDropDownList
;
universo-frontend/src/apps/cards/CreateCardPopupList.ts
удалено
100644 → 0
Просмотр файла @
cba28162
import
{
COLOR_LIGHT
,
COLOR_PRIMARY
,
COLOR_DARK
}
from
'
../kanbans/Const
'
;
import
CreateTextObject
from
'
../kanbans/CreateTextObject
'
;
import
ObjectWrapper
from
'
src/utils/objectWrapper
'
;
import
{
createModal
}
from
'
../kanbans/CreateModal
'
;
import
{
EndlessCanvas
}
from
'
../spaces-2d/EndlessCanvas
'
;
const
CreateCardPopupList
=
function
(
scene
:
EndlessCanvas
,
card
:
ObjectWrapper
,
x
:
number
,
y
:
number
,
options
:
string
[],
onClick
:
(
button
:
Phaser
.
GameObjects
.
Text
)
=>
void
,
)
{
let
textInput
=
''
;
const
items
=
options
.
map
((
option
)
=>
({
label
:
option
}));
const
menu
=
scene
.
rexUI
.
add
.
menu
({
x
:
x
,
y
:
y
,
orientation
:
'
y
'
,
items
:
items
,
createButtonCallback
:
(
item
,
i
,
options
)
=>
{
return
scene
.
rexUI
.
add
.
label
({
background
:
scene
.
rexUI
.
add
.
roundRectangle
(
0
,
0
,
2
,
2
,
0
,
COLOR_DARK
),
text
:
CreateTextObject
(
scene
,
item
.
label
),
space
:
{
left
:
10
,
right
:
10
,
top
:
10
,
bottom
:
10
,
icon
:
10
,
},
});
},
easeIn
:
{
duration
:
500
,
orientation
:
'
y
'
,
},
easeOut
:
{
duration
:
100
,
orientation
:
'
y
'
,
},
});
menu
.
on
(
'
button.click
'
,
(
button
:
Phaser
.
GameObjects
.
Text
)
=>
{
if
(
button
.
text
===
'
Редактировать карточку
'
)
{
createModal
(
scene
,
(
text
)
=>
{
textInput
=
text
;
},
//@ts-ignore
scene
.
store
.
getCurrentState
.
get
(
card
.
uuid
).
name
,
).
then
((
data
)
=>
{
//@ts-ignore
if
(
data
.
text
===
'
Сохранить
'
)
{
if
(
textInput
)
{
const
payload
=
{
nomo
:
textInput
,
uuid
:
card
.
uuid
,
};
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
}
});
}
else
if
(
button
.
text
===
'
Удалить карточку
'
)
{
createModal
(
scene
,
null
,
null
,
'
Удалить карточку
'
,
'
Отменить
'
,
'
Удалить
'
,
).
then
((
button
)
=>
{
//@ts-ignore
if
(
button
.
text
===
'
Удалить
'
)
{
const
payload
=
{
uuid
:
card
.
uuid
,
forigo
:
true
,
};
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
});
}
menu
.
collapse
();
});
return
menu
;
};
export
default
CreateCardPopupList
;
universo-frontend/src/apps/cards/CreateItem.ts
Просмотр файла @
5202e643
...
...
@@ -8,8 +8,9 @@ import {
}
from
'
../kanbans/Const
'
;
import
{
ItemType
}
from
'
src/types/kanban_types
'
;
import
{
EventBus
,
Events
}
from
'
src/boot/eventBus
'
;
import
CreateCardDropDownList
from
'
./CreateCardDropDownList
'
;
import
{
EndlessCanvas
}
from
'
../spaces-2d/EndlessCanvas
'
;
import
CreateDropDownList
from
'
../kanbans/CreateDropDownList
'
;
import
{
createModal
}
from
'
../kanbans/CreateModal
'
;
const
CreateItem
=
(
scene
:
EndlessCanvas
,
card
:
ObjectWrapper
)
=>
{
let
textInput
=
''
;
...
...
@@ -38,7 +39,62 @@ const CreateItem = (scene: EndlessCanvas, card: ObjectWrapper) => {
},
});
const
dropDownButton
=
CreateCardDropDownList
(
scene
,
card
);
const
optionsArr
=
[
{
label
:
'
Редактировать карточку
'
,
id
:
0
,
onClick
:
()
=>
{
console
.
log
(
'
Редактировать карточку
'
);
createModal
(
scene
,
(
text
)
=>
{
textInput
=
text
;
},
//@ts-ignore
scene
.
store
.
getCurrentState
.
get
(
card
.
uuid
).
name
,
).
then
((
data
)
=>
{
//@ts-ignore
if
(
data
.
text
===
'
Сохранить
'
)
{
if
(
textInput
)
{
const
payload
=
{
nomo
:
textInput
,
uuid
:
card
.
uuid
,
};
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
}
});
},
},
{
label
:
'
Удалить карточку
'
,
id
:
1
,
onClick
:
()
=>
{
console
.
log
(
'
Удалить карточку
'
);
createModal
(
scene
,
null
,
null
,
'
Удалить карточку
'
,
'
Отменить
'
,
'
Удалить
'
,
).
then
((
button
)
=>
{
//@ts-ignore
if
(
button
.
text
===
'
Удалить
'
)
{
const
payload
=
{
uuid
:
card
.
uuid
,
forigo
:
true
,
};
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
});
},
},
];
const
dropDownButton
=
CreateDropDownList
(
scene
,
card
,
optionsArr
);
dropDownButton
.
setPosition
(
item
.
width
-
dropDownButton
.
width
,
0
);
item
.
add
(
dropDownButton
);
...
...
universo-frontend/src/apps/kanbans/CreateColumnDropDownList.ts
удалено
100644 → 0
Просмотр файла @
cba28162
import
{
COLOR_LIGHT
,
COLOR_PRIMARY
,
COLOR_DARK
}
from
'
./Const
'
;
import
GetMaxTextObjectSize
from
'
./GetMaxTextObjectSize
'
;
import
CreateTextObject
from
'
./CreateTextObject
'
;
import
CreateColumnPopupList
from
'
./CreateColumnPopupList
'
;
import
{
EndlessCanvas
}
from
'
../spaces-2d/EndlessCanvas
'
;
import
ObjectWrapper
from
'
src/utils/objectWrapper
'
;
const
CreateColumnDropDownList
=
function
(
scene
:
EndlessCanvas
,
board
:
ObjectWrapper
,
)
{
const
options
=
[
'
Добавить карточку
'
,
'
Переименовать столбец
'
,
'
Удалить столбец
'
,
];
const
maxTextSize
=
GetMaxTextObjectSize
(
scene
,
options
);
const
label
=
scene
.
rexUI
.
add
.
label
({
background
:
scene
.
rexUI
.
add
.
roundRectangle
(
0
,
0
,
2
,
2
,
0
,
COLOR_PRIMARY
)
.
setAlpha
(
0
),
text
:
CreateTextObject
(
scene
,
'
...
'
),
// .setFixedSize(
// maxTextSize.width,
// maxTextSize.height,
// )
space
:
{
left
:
10
,
right
:
10
,
top
:
10
,
bottom
:
10
,
icon
:
10
,
},
})
.
setData
(
'
value
'
,
''
);
let
menu
;
scene
.
rexUI
.
add
.
click
(
label
).
on
(
'
click
'
,
()
=>
{
if
(
!
menu
||
!
menu
.
scene
)
{
//@ts-ignore
const
menuX
=
label
.
getElement
(
'
text
'
).
getTopLeft
().
x
;
const
menuY
=
label
.
bottom
;
menu
=
CreateColumnPopupList
(
scene
,
board
,
menuX
-
maxTextSize
.
width
+
GetMaxTextObjectSize
(
scene
,
[
'
...
'
]).
width
/
2
,
menuY
,
options
,
function
(
button
)
{
console
.
log
(
'
Click
'
,
button
.
text
);
// Добавленный console.log
if
(
button
.
text
===
'
Добавить карточку
'
)
{
// Ваш код для добавления новой колонки
}
else
if
(
button
.
text
===
'
Переименовать столбец
'
)
{
// Ваш код для переименования доски
console
.
log
(
'
button
'
,
button
);
}
else
if
(
button
.
text
===
'
Удалить столбец
'
)
{
// Ваш код для переименования доски
console
.
log
(
'
button
'
,
button
);
}
},
);
}
else
{
menu
.
collapse
();
menu
=
undefined
;
}
});
return
label
;
};
export
default
CreateColumnDropDownList
;
universo-frontend/src/apps/kanbans/CreateColumnPanel.ts
Просмотр файла @
5202e643
...
...
@@ -4,7 +4,8 @@ import { DefaultDepth, DragObjectDepth } from './Const';
import
CreateItemsBox
from
'
../cards/CreateItemsBox
'
;
import
{
EndlessCanvas
}
from
'
../spaces-2d/EndlessCanvas
'
;
import
{
EventBus
,
Events
}
from
'
src/boot/eventBus
'
;
import
CreateColumnDropDownList
from
'
./CreateColumnDropDownList
'
;
import
CreateDropDownList
from
'
./CreateDropDownList
'
;
import
{
createModal
}
from
'
./CreateModal
'
;
const
CreateColumnPanel
=
(
scene
:
EndlessCanvas
,
column
:
ObjectWrapper
)
=>
{
const
panel
=
scene
.
rexUI
.
add
...
...
@@ -57,7 +58,92 @@ const CreateTitle = (scene: EndlessCanvas, column: ObjectWrapper, callback) => {
},
});
const
dropDownButton
=
CreateColumnDropDownList
(
scene
,
column
);
const
dropDownOptions
=
[
{
label
:
'
Добавить карточку
'
,
id
:
0
,
onClick
:
()
=>
{
console
.
log
(
'
Добавить карточку
'
);
createModal
(
scene
,
(
text
)
=>
{
textInput
=
text
;
},
''
,
).
then
((
button
)
=>
{
//@ts-ignore
if
(
button
.
text
===
'
Сохранить
'
)
{
if
(
textInput
)
{
const
payload
=
{
nomo
:
textInput
,
//@ts-ignore
kanvasoUuid
:
scene
.
store
.
getKanvaso
[
0
].
node
.
uuid
,
priskribo
:
textInput
,
tipoId
:
4
,
ligiloPosedantoUuid
:
column
.
uuid
,
};
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
}
});
},
},
{
label
:
'
Переименовать столбец
'
,
id
:
1
,
onClick
:
()
=>
{
console
.
log
(
'
Переименовать столбец
'
);
createModal
(
scene
,
(
text
)
=>
{
textInput
=
text
;
},
//@ts-ignore
scene
.
store
.
getCurrentState
.
get
(
column
.
uuid
).
name
,
).
then
((
data
)
=>
{
//@ts-ignore
if
(
data
.
text
===
'
Сохранить
'
)
{
if
(
textInput
)
{
const
payload
=
{
nomo
:
textInput
,
uuid
:
column
.
uuid
,
};
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
}
});
},
},
{
label
:
'
Удалить столбец
'
,
id
:
2
,
onClick
:
()
=>
{
console
.
log
(
'
Удалить столбец
'
);
createModal
(
scene
,
null
,
null
,
'
Удалить столбец
'
,
'
Отменить
'
,
'
Удалить
'
,
).
then
((
button
)
=>
{
//@ts-ignore
if
(
button
.
text
===
'
Удалить
'
)
{
const
payload
=
{
uuid
:
column
.
uuid
,
forigo
:
true
,
};
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
});
},
},
];
const
dropDownButton
=
CreateDropDownList
(
scene
,
column
,
dropDownOptions
);
dropDownButton
.
setPosition
(
title
.
width
-
dropDownButton
.
width
,
0
);
title
.
add
(
dropDownButton
);
...
...
universo-frontend/src/apps/kanbans/CreateColumnPopupList.ts
удалено
100644 → 0
Просмотр файла @
cba28162
import
{
COLOR_LIGHT
,
COLOR_PRIMARY
,
COLOR_DARK
}
from
'
./Const
'
;
import
CreateTextObject
from
'
./CreateTextObject
'
;
import
ObjectWrapper
from
'
src/utils/objectWrapper
'
;
import
{
createModal
}
from
'
./CreateModal
'
;
import
{
EndlessCanvas
}
from
'
../spaces-2d/EndlessCanvas
'
;
const
CreateColumnPopupList
=
function
(
scene
:
EndlessCanvas
,
column
:
ObjectWrapper
,
x
:
number
,
y
:
number
,
options
:
string
[],
onClick
:
(
button
:
Phaser
.
GameObjects
.
Text
)
=>
void
,
)
{
let
textInput
=
''
;
const
items
=
options
.
map
((
option
)
=>
({
label
:
option
}));
const
menu
=
scene
.
rexUI
.
add
.
menu
({
x
:
x
,
y
:
y
,
orientation
:
'
y
'
,
items
:
items
,
createButtonCallback
:
(
item
,
i
,
options
)
=>
{
return
scene
.
rexUI
.
add
.
label
({
background
:
scene
.
rexUI
.
add
.
roundRectangle
(
0
,
0
,
2
,
2
,
0
,
COLOR_DARK
),
text
:
CreateTextObject
(
scene
,
item
.
label
),
space
:
{
left
:
10
,
right
:
10
,
top
:
10
,
bottom
:
10
,
icon
:
10
,
},
});
},
easeIn
:
{
duration
:
500
,
orientation
:
'
y
'
,
},
easeOut
:
{
duration
:
100
,
orientation
:
'
y
'
,
},
});
menu
.
on
(
'
button.click
'
,
(
button
:
Phaser
.
GameObjects
.
Text
)
=>
{
if
(
button
.
text
===
'
Добавить карточку
'
)
{
createModal
(
scene
,
(
text
)
=>
{
textInput
=
text
;
},
''
,
).
then
((
button
)
=>
{
//@ts-ignore
if
(
button
.
text
===
'
Сохранить
'
)
{
if
(
textInput
)
{
const
payload
=
{
nomo
:
textInput
,
//@ts-ignore
kanvasoUuid
:
scene
.
store
.
getKanvaso
[
0
].
node
.
uuid
,
priskribo
:
textInput
,
tipoId
:
4
,
ligiloPosedantoUuid
:
column
.
uuid
,
};
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
}
});
}
else
if
(
button
.
text
===
'
Переименовать столбец
'
)
{
createModal
(
scene
,
(
text
)
=>
{
textInput
=
text
;
},
//@ts-ignore
scene
.
store
.
getCurrentState
.
get
(
column
.
uuid
).
name
,
).
then
((
data
)
=>
{
//@ts-ignore
if
(
data
.
text
===
'
Сохранить
'
)
{
if
(
textInput
)
{
const
payload
=
{
nomo
:
textInput
,
uuid
:
column
.
uuid
,
};
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
}
});
}
else
if
(
button
.
text
===
'
Удалить столбец
'
)
{
createModal
(
scene
,
null
,
null
,
'
Удалить столбец
'
,
'
Отменить
'
,
'
Удалить
'
,
).
then
((
button
)
=>
{
//@ts-ignore
if
(
button
.
text
===
'
Удалить
'
)
{
const
payload
=
{
uuid
:
column
.
uuid
,
forigo
:
true
,
};
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
});
}
menu
.
collapse
();
});
return
menu
;
};
export
default
CreateColumnPopupList
;
universo-frontend/src/apps/kanbans/CreateDropDownList.ts
Просмотр файла @
5202e643
...
...
@@ -4,19 +4,28 @@ import CreateTextObject from './CreateTextObject';
import
CreatePopupList
from
'
./CreatePopupList
'
;
import
{
EndlessCanvas
}
from
'
../spaces-2d/EndlessCanvas
'
;
import
ObjectWrapper
from
'
src/utils/objectWrapper
'
;
type
Options
=
{
id
:
number
;
label
:
string
;
onClick
:
()
=>
void
;
};
const
CreateDropDownList
=
function
(
scene
:
EndlessCanvas
,
board
:
ObjectWrapper
,
optionsArr
?:
Options
[],
labelText
:
string
=
'
...
'
,
)
{
const
options
=
[
'
Добавить столбец
'
,
'
Переименовать доску
'
,
'
Удалить доску
'
];
const
maxTextSize
=
GetMaxTextObjectSize
(
scene
,
options
);
const
maxTextSize
=
GetMaxTextObjectSize
(
scene
,
optionsArr
.
map
((
o
)
=>
o
.
label
),
);
const
labelMaxTextSize
=
GetMaxTextObjectSize
(
scene
,
[
labelText
]);
const
label
=
scene
.
rexUI
.
add
.
label
({
background
:
scene
.
rexUI
.
add
.
roundRectangle
(
0
,
0
,
2
,
2
,
0
,
COLOR_PRIMARY
)
.
setAlpha
(
0
),
text
:
CreateTextObject
(
scene
,
'
...
'
),
text
:
CreateTextObject
(
scene
,
labelText
),
// .setFixedSize(
// maxTextSize.width,
// maxTextSize.height,
...
...
@@ -42,23 +51,9 @@ const CreateDropDownList = function (
menu
=
CreatePopupList
(
scene
,
board
,
menuX
-
maxTextSize
.
width
+
GetMaxTextObjectSize
(
scene
,
[
'
...
'
]).
width
/
2
,
menuX
-
maxTextSize
.
width
+
labelMaxTextSize
.
width
/
2
,
menuY
,
options
,
function
(
button
)
{
console
.
log
(
'
Click
'
,
button
.
text
);
// Добавленный console.log
if
(
button
.
text
===
'
Добавить столбец
'
)
{
// Ваш код для добавления новой колонки
}
else
if
(
button
.
text
===
'
Переименовать доску
'
)
{
// Ваш код для переименования доски
console
.
log
(
'
button
'
,
button
);
}
else
if
(
button
.
text
===
'
Удалить доску
'
)
{
// Ваш код для переименования доски
console
.
log
(
'
button
'
,
button
);
}
},
optionsArr
,
);
}
else
{
menu
.
collapse
();
...
...
universo-frontend/src/apps/kanbans/CreateHeader.ts
Просмотр файла @
5202e643
...
...
@@ -3,6 +3,7 @@ import { COLOR_LIGHT, COLOR_PRIMARY, COLOR_DARK } from './Const';
import
CreateDropDownList
from
'
./CreateDropDownList
'
;
import
{
EndlessCanvas
}
from
'
../spaces-2d/EndlessCanvas
'
;
import
{
EventBus
,
Events
}
from
'
src/boot/eventBus
'
;
import
{
createModal
}
from
'
./CreateModal
'
;
const
CreateHeader
=
function
(
scene
:
EndlessCanvas
,
board
:
ObjectWrapper
)
{
const
sizer
=
scene
.
rexUI
.
add
...
...
@@ -20,8 +21,94 @@ const CreateHeader = function (scene: EndlessCanvas, board: ObjectWrapper) {
headerLabel
.
setText
(
scene
.
store
.
getCurrentState
.
get
(
uuid
).
name
);
}
});
let
textInput
=
''
;
const
dropDownButton
=
CreateDropDownList
(
scene
,
board
);
const
dropDownOptions
=
[
{
label
:
'
Добавить столбец
'
,
id
:
0
,
onClick
:
()
=>
{
console
.
log
(
'
Добавить столбец
'
);
createModal
(
scene
,
function
(
text
)
{
textInput
=
text
;
},
''
,
).
then
((
button
)
=>
{
//@ts-ignore
if
(
button
.
text
===
'
Сохранить
'
)
{
if
(
textInput
)
{
const
payload
=
{
nomo
:
textInput
,
//@ts-ignore
kanvasoUuid
:
scene
.
store
.
getKanvaso
[
0
].
node
.
uuid
,
priskribo
:
textInput
,
tipoId
:
3
,
ligiloPosedantoUuid
:
board
.
childrens
[
0
].
uuid
,
};
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
}
});
},
},
{
label
:
'
Переименовать доску
'
,
id
:
1
,
onClick
:
()
=>
{
console
.
log
(
'
Переименовать доску
'
);
createModal
(
scene
,
function
(
text
)
{
textInput
=
text
;
},
//@ts-ignore
scene
.
store
.
getCurrentState
.
get
(
board
.
uuid
).
name
,
).
then
((
button
)
=>
{
//@ts-ignore
if
(
button
.
text
===
'
Сохранить
'
)
{
if
(
textInput
)
{
const
payload
=
{
nomo
:
textInput
,
uuid
:
board
.
uuid
,
};
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
}
});
},
},
{
label
:
'
Удалить доску
'
,
id
:
2
,
onClick
:
()
=>
{
console
.
log
(
'
Удалить доску
'
);
createModal
(
scene
,
null
,
null
,
'
Удалить доску
'
,
'
Отменить
'
,
'
Удалить
'
,
).
then
((
button
)
=>
{
//@ts-ignore
if
(
button
.
text
===
'
Удалить
'
)
{
const
payload
=
{
uuid
:
board
.
uuid
,
forigo
:
true
,
};
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
});
},
},
];
const
dropDownButton
=
CreateDropDownList
(
scene
,
board
,
dropDownOptions
);
sizer
.
add
(
headerLabel
,
{
proportion
:
1
,
expand
:
true
})
...
...
universo-frontend/src/apps/kanbans/CreatePopupList.ts
Просмотр файла @
5202e643
import
{
COLOR_LIGHT
,
COLOR_PRIMARY
,
COLOR_DARK
}
from
'
./Const
'
;
import
CreateTextObject
from
'
./CreateTextObject
'
;
import
ObjectWrapper
from
'
src/utils/objectWrapper
'
;
import
{
createModal
}
from
'
./CreateModal
'
;
import
{
EndlessCanvas
}
from
'
../spaces-2d/EndlessCanvas
'
;
type
Options
=
{
id
:
number
;
label
:
string
;
onClick
:
()
=>
void
;
};
const
CreatePopupList
=
function
(
scene
:
EndlessCanvas
,
board
:
ObjectWrapper
,
x
:
number
,
y
:
number
,
options
:
string
[],
onClick
:
(
button
:
Phaser
.
GameObjects
.
Text
)
=>
void
,
options
:
Options
[],
)
{
let
textInput
=
''
;
const
items
=
options
.
map
((
option
)
=>
({
label
:
option
}));
const
menu
=
scene
.
rexUI
.
add
.
menu
({
x
:
x
,
y
:
y
,
x
,
y
,
orientation
:
'
y
'
,
items
:
item
s
,
items
:
option
s
,
createButtonCallback
:
(
item
,
i
,
options
)
=>
{
return
scene
.
rexUI
.
add
.
label
({
background
:
scene
.
rexUI
.
add
.
roundRectangle
(
0
,
0
,
2
,
2
,
0
,
COLOR_DARK
),
...
...
@@ -43,72 +43,8 @@ const CreatePopupList = function (
});
menu
.
on
(
'
button.click
'
,
(
button
:
Phaser
.
GameObjects
.
Text
)
=>
{
if
(
button
.
text
===
'
Добавить столбец
'
)
{
createModal
(
scene
,
function
(
text
)
{
textInput
=
text
;
},
''
,
).
then
((
button
)
=>
{
//@ts-ignore
if
(
button
.
text
===
'
Сохранить
'
)
{
if
(
textInput
)
{
const
payload
=
{
nomo
:
textInput
,
//@ts-ignore
kanvasoUuid
:
scene
.
store
.
getKanvaso
[
0
].
node
.
uuid
,
priskribo
:
textInput
,
tipoId
:
3
,
ligiloPosedantoUuid
:
board
.
childrens
[
0
].
uuid
,
};
options
.
find
((
option
)
=>
option
.
label
===
button
.
text
).
onClick
();
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
}
});
}
else
if
(
button
.
text
===
'
Переименовать доску
'
)
{
createModal
(
scene
,
function
(
text
)
{
textInput
=
text
;
},
//@ts-ignore
scene
.
store
.
getCurrentState
.
get
(
board
.
uuid
).
name
,
).
then
((
button
)
=>
{
//@ts-ignore
if
(
button
.
text
===
'
Сохранить
'
)
{
if
(
textInput
)
{
const
payload
=
{
nomo
:
textInput
,
uuid
:
board
.
uuid
,
};
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
}
});
}
else
if
(
button
.
text
===
'
Удалить доску
'
)
{
createModal
(
scene
,
null
,
null
,
'
Удалить доску
'
,
'
Отменить
'
,
'
Удалить
'
,
).
then
((
button
)
=>
{
//@ts-ignore
if
(
button
.
text
===
'
Удалить
'
)
{
const
payload
=
{
uuid
:
board
.
uuid
,
forigo
:
true
,
};
//@ts-ignore
scene
.
store
.
onEditKanvasoObjekto
(
payload
);
}
});
}
menu
.
collapse
();
});
...
...
universo-frontend/src/utils/quasar.config.js
удалено
100644 → 0
Просмотр файла @
cba28162
/* eslint-env node */
/*
* This file runs in a Node context (it's NOT transpiled by Babel), so use only
* the ES6 features that are supported by your Node version. https://node.green/
*/
// Configuration for your app
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js
const
{
configure
}
=
require
(
'
quasar/wrappers
'
);
const
path
=
require
(
'
path
'
);
module
.
exports
=
configure
(
function
(
/* ctx */
)
{
return
{
eslint
:
{
// fix: true,
// include: [],
// exclude: [],
// rawOptions: {},
warnings
:
true
,
errors
:
true
,
},
// https://v2.quasar.dev/quasar-cli-vite/prefetch-feature
// preFetch: true,
// app boot file (/src/boot)
// --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli-vite/boot-files
boot
:
[
'
i18n
'
,
'
apollo
'
],
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
css
:
[
'
app.scss
'
],
// https://github.com/quasarframework/quasar/tree/dev/extras
extras
:
[
// 'ionicons-v4',
// 'mdi-v5',
// 'fontawesome-v6',
// 'eva-icons',
// 'themify',
// 'line-awesome',
// 'roboto-font-latin-ext', // this or either 'roboto-font', NEVER both!
'
roboto-font
'
,
// optional, you are not bound to it
'
material-icons
'
,
// optional, you are not bound to it
],
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#build
build
:
{
target
:
{
browser
:
[
'
es2019
'
,
'
edge88
'
,
'
firefox78
'
,
'
chrome87
'
,
'
safari13.1
'
],
node
:
'
node16
'
,
},
vueRouterMode
:
'
history
'
,
// available values: 'hash', 'history'
// vueRouterBase,
// vueDevtools,
// vueOptionsAPI: false,
// rebuildCache: true, // rebuilds Vite/linter/etc cache on startup
// publicPath: '/',
// analyze: true,
env
:
require
(
'
dotenv
'
).
config
().
parsed
,
// rawDefine: {}
// ignorePublicFolder: true,
// minify: false,
// polyfillModulePreload: true,
// distDir
// extendViteConf (viteConf) {},
// viteVuePluginOptions: {},
vitePlugins
:
[
[
'
@intlify/vite-plugin-vue-i18n
'
,
{
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
// compositionOnly: false,
// if you want to use named tokens in your Vue I18n messages, such as 'Hello {name}',
// you need to set `runtimeOnly: false`
// runtimeOnly: false,
// you need to set i18n resource including paths !
include
:
path
.
resolve
(
__dirname
,
'
./src/i18n/**
'
),
},
],
],
},
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer
devServer
:
{
// https: true
open
:
true
,
// opens browser window automatically
},
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
framework
:
{
config
:
{},
// iconSet: 'material-icons', // Quasar icon set
// lang: 'en-US', // Quasar language pack
// For special cases outside of where the auto-import strategy can have an impact
// (like functional components as one of the examples),
// you can manually specify Quasar components/directives to be available everywhere:
//
// components: [],
// directives: [],
// Quasar plugins
plugins
:
[],
},
// animations: 'all', // --- includes all animations
// https://v2.quasar.dev/options/animations
animations
:
[],
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#sourcefiles
// sourceFiles: {
// rootComponent: 'src/App.vue',
// router: 'src/router/index',
// store: 'src/store/index',
// registerServiceWorker: 'src-pwa/register-service-worker',
// serviceWorker: 'src-pwa/custom-service-worker',
// pwaManifestFile: 'src-pwa/manifest.json',
// electronMain: 'src-electron/electron-main',
// electronPreload: 'src-electron/electron-preload'
// },
// https://v2.quasar.dev/quasar-cli-vite/developing-ssr/configuring-ssr
ssr
:
{
// ssrPwaHtmlFilename: 'offline.html', // do NOT use index.html as name!
// will mess up SSR
// extendSSRWebserverConf (esbuildConf) {},
// extendPackageJson (json) {},
pwa
:
false
,
// manualStoreHydration: true,
// manualPostHydrationTrigger: true,
prodPort
:
3000
,
// The default port that the production server should use
// (gets superseded if process.env.PORT is specified at runtime)
middlewares
:
[
'
render
'
,
// keep this as last one
],
},
// https://v2.quasar.dev/quasar-cli-vite/developing-pwa/configuring-pwa
pwa
:
{
workboxMode
:
'
generateSW
'
,
// or 'injectManifest'
injectPwaMetaTags
:
true
,
swFilename
:
'
sw.js
'
,
manifestFilename
:
'
manifest.json
'
,
useCredentialsForManifestTag
:
false
,
// useFilenameHashes: true,
// extendGenerateSWOptions (cfg) {}
// extendInjectManifestOptions (cfg) {},
// extendManifestJson (json) {}
// extendPWACustomSWConf (esbuildConf) {}
},
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-cordova-apps/configuring-cordova
cordova
:
{
// noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing
},
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-capacitor-apps/configuring-capacitor
capacitor
:
{
hideSplashscreen
:
true
,
},
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-electron-apps/configuring-electron
electron
:
{
// extendElectronMainConf (esbuildConf)
// extendElectronPreloadConf (esbuildConf)
inspectPort
:
5858
,
bundler
:
'
packager
'
,
// 'packager' or 'builder'
packager
:
{
// https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options
// OS X / Mac App Store
// appBundleId: '',
// appCategoryType: '',
// osxSign: '',
// protocol: 'myapp://path',
// Windows only
// win32metadata: { ... }
},
builder
:
{
// https://www.electron.build/configuration/configuration
appId
:
'
test-frontend
'
,
},
},
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-browser-extensions/configuring-bex
bex
:
{
contentScripts
:
[
'
my-content-script
'
],
// extendBexScriptsConf (esbuildConf) {}
// extendBexManifestJson (json) {}
},
};
});
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать