diff --git a/src/assets/icons/folder_open.svg b/src/assets/icons/folder_open.svg new file mode 100644 index 00000000..86892377 --- /dev/null +++ b/src/assets/icons/folder_open.svg @@ -0,0 +1,18 @@ + + +folder_open + + diff --git a/src/assets/icons/save.svg b/src/assets/icons/save.svg new file mode 100644 index 00000000..b6457af0 --- /dev/null +++ b/src/assets/icons/save.svg @@ -0,0 +1,18 @@ + + +save + + diff --git a/src/assets/icons/save_alt.svg b/src/assets/icons/save_alt.svg new file mode 100644 index 00000000..e99ade2c --- /dev/null +++ b/src/assets/icons/save_alt.svg @@ -0,0 +1,18 @@ + + +save_alt + + diff --git a/src/components/Selector.vue b/src/components/Selector.vue new file mode 100644 index 00000000..5812c701 --- /dev/null +++ b/src/components/Selector.vue @@ -0,0 +1,93 @@ + + + + diff --git a/src/components/index.ts b/src/components/index.ts index 39ad3e8c..a2214c47 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -16,25 +16,18 @@ */ import Icon from "./Icon.vue"; import TimePicker from "./TimePicker.vue"; -import type { App, Plugin } from "vue"; +import Selector from "./Selector.vue"; +import type { App } from "vue"; import VueGridLayout from "vue-grid-layout"; const components: { [key: string]: any } = { Icon, TimePicker, VueGridLayout, + Selector, }; const componentsName: string[] = Object.keys(components); -const withInstall = (component: T, alias?: string) => { - const comp = component as any; - comp.install = (app: App) => { - app.component(comp.name || comp.displayName, component); - if (alias) { - app.config.globalProperties[alias] = component; - } - }; - return component as T & Plugin; -}; + export default { install: (vue: App): void => { vue.use(components["VueGridLayout"]); diff --git a/src/views/dashboard/Edit.vue b/src/views/dashboard/Edit.vue index 0d4ae911..12c1ed5c 100644 --- a/src/views/dashboard/Edit.vue +++ b/src/views/dashboard/Edit.vue @@ -14,31 +14,49 @@ See the License for the specific language governing permissions and limitations under the License. --> diff --git a/src/views/dashboard/New.vue b/src/views/dashboard/New.vue index 565ff9e7..2598faf0 100644 --- a/src/views/dashboard/New.vue +++ b/src/views/dashboard/New.vue @@ -25,37 +25,21 @@ limitations under the License. -->
{{ t("layer") }}
- - - - + @change="changeLayer" + />
{{ t("entityType") }}
- - - - + @change="changeEntity" + />
@@ -68,7 +52,7 @@ limitations under the License. --> import { reactive } from "vue"; import { useI18n } from "vue-i18n"; import router from "@/router"; -import { ElSelect, ElOption, ElInput, ElButton } from "element-plus"; +import { ElInput, ElButton } from "element-plus"; import { useSelectorStore } from "@/store/modules/selectors"; import { EntityType, Options } from "./data"; import uuid from "@/utils/uuid"; @@ -86,6 +70,12 @@ const onCreate = () => { router.push(path); }; selectorStore.fetchServices("general"); +function changeLayer(val: { label: string; value: string }) { + state.layer = val.value; +} +function changeEntity(val: { label: string; value: string }) { + state.entity = val.value; +}