🔱: [client] sync upgrade with 12 commits [trident-sync]

refactor: 1.11.0
refactor: 1.11.0
refactor: 1.11.0
refactor: 1.11.0
refactor: ts化
refactor: ts化
feat: 全面TS化
perf: 全面ts化
refactor: 继续优化ts
perf: ts定义优化
fix: 修复wangeditor无法上传视频的bug
This commit is contained in:
GitHub Actions Bot
2023-03-16 19:24:01 +00:00
parent f344c58f26
commit 6ec697b010
375 changed files with 2210 additions and 3618 deletions
@@ -2,22 +2,8 @@
<div class="fs-multiple-page-control-group">
<div class="fs-multiple-page-control-content">
<div class="fs-multiple-page-control-content-inner">
<a-tabs
class="fs-multiple-page-control fs-multiple-page-sort"
:active-key="page.getCurrent"
type="editable-card"
hide-add
@tabClick="handleClick"
@edit="handleTabEdit"
@contextmenu="handleContextmenu"
>
<a-tab-pane
v-for="item in page.getOpened"
:key="item.fullPath"
:tab="item.meta?.title || '未命名'"
:name="item.fullPath"
:closable="isTabClosable(item)"
/>
<a-tabs class="fs-multiple-page-control fs-multiple-page-sort" :active-key="page.getCurrent" type="editable-card" hide-add @tabClick="handleClick" @edit="handleTabEdit">
<a-tab-pane v-for="item in page.getOpened" :key="item.fullPath" :tab="item.meta?.title || '未命名'" :name="item.fullPath" :closable="isTabClosable(item)" />
</a-tabs>
<!-- <fs-contextmenu v-model:visible="contextmenuFlag" :x="contentmenuX" :y="contentmenuY">-->
<!-- <fs-contextmenu-list-->
@@ -33,7 +19,7 @@
<span class="iconify" data-icon="ion:close-circle" data-inline="false"></span>
<template #icon><DownOutlined /></template>
<template #overlay>
<a-menu @click="(command) => handleControlItemClick(command)">
<a-menu @click="(command:any) => handleControlItemClick(command)">
<a-menu-item key="left">
<fs-icon name="arrow-left" class="fs-mr-10" />
关闭左侧
@@ -57,8 +43,7 @@
</div>
</template>
<script>
import Sortable from "sortablejs";
<script lang="ts">
import { usePageStore } from "../../../store/modules/page";
import { computed } from "vue";
export default {
@@ -119,14 +104,14 @@ export default {
* @description 计算某个标签页是否可关闭
* @param {Object} page 其中一个标签页
*/
isTabClosable(page) {
isTabClosable(page: any) {
return page.name !== "index";
},
/**
* @description 右键菜单功能点击
* @param {Object} event 事件
*/
handleContextmenu(event) {
handleContextmenu(event: any) {
let target = event.target;
// fix https://github.com/fs-projects/fs-admin/issues/54
let flag = false;
@@ -148,7 +133,7 @@ export default {
* @description 右键菜单的 row-click 事件
* @param {String} command 事件类型
*/
contextmenuClick(command) {
contextmenuClick(command: any) {
this.handleControlItemClick(command, this.tagName);
},
/**
@@ -156,7 +141,7 @@ export default {
* @param {String} command 事件类型
* @param {String} tagName tab 名称
*/
handleControlItemClick(command, tagName = null) {
handleControlItemClick(command: any, tagName: any = null) {
//if (tagName) this.contextmenuFlag = false;
const params = { pageSelect: tagName };
switch (command.key) {
@@ -182,9 +167,9 @@ export default {
* @param {object} tab 标签
* @param {object} event 事件
*/
handleClick(tab) {
handleClick(tab: any) {
// 找到点击的页面在 tag 列表里是哪个
const page = this.page.getOpened.find((page) => page.fullPath === tab);
const page = this.page.getOpened.find((page: any) => page.fullPath === tab);
if (page) {
const { name, params, query } = page;
this.$router.push({ name, params, query });
@@ -194,12 +179,12 @@ export default {
* @description 点击 tab 上的删除按钮触发这里
* @param {String} tagName tab 名称
*/
handleTabEdit(tagName, action) {
handleTabEdit(tagName: any, action: any) {
if (action === "remove") {
this.close({ tagName });
}
}
}
} as any
};
</script>
<style lang="less">