This commit is contained in:
icssoa 2022-08-21 19:57:23 +08:00
parent 31fa1f43b3
commit 6642be6ccf
26 changed files with 408 additions and 383 deletions

View File

@ -1,6 +1,6 @@
{
"name": "front-next",
"version": "5.9.0",
"version": "5.9.1",
"scripts": {
"dev": "vite --host",
"build": "vite build",

View File

@ -35,15 +35,6 @@ router.beforeResolve(() => {
Loading.close();
});
// 跳转
router.href = function (path) {
const url = import.meta.env.BASE_URL + path;
if (url != location.pathname) {
location.href = url;
}
};
// 添加试图,页面路由
router.append = function (data) {
const list = isArray(data) ? data : [data];

View File

@ -126,26 +126,26 @@ request.interceptors.response.use(
if (status == 401) {
user.logout();
}
} else {
if (isDev) {
ElMessage.error(`${config.url} ${status}`);
} else {
switch (status) {
case 403:
router.href("403");
router.push("/403");
break;
case 500:
router.href("500");
router.push("/500");
break;
case 502:
router.href("502");
router.push("/502");
break;
}
}
}
}
return Promise.reject({ message: error.message });
}

View File

@ -27,7 +27,6 @@ export declare interface Module extends ModuleConfig {
}
export declare interface Router extends VueRouter {
href(path: string): void;
find(path: string): RouteRecordRaw | undefined;
append(data: any[] | any): void;
[key: string]: any;

View File

@ -5,7 +5,9 @@ export const Loading = {
next: null,
async set(list: any[]) {
try {
await Promise.all(list);
} catch (e) {}
this.resolve();
},

View File

@ -70,7 +70,6 @@ watch(
() => props.modelValue,
(val) => {
value.value = val;
console.log(val);
},
{
immediate: true

View File

@ -1,11 +1,16 @@
<template>
<div class="app-process">
<div class="app-process__back" @click="router.back">
<el-icon :size="15"><arrow-left /></el-icon>
<div class="app-process__icon" @click="router.push('/')">
<el-icon size="15"><home-filled /></el-icon>
<span>首页</span>
</div>
<div class="app-process__icon" @click="router.back">
<el-icon :size="15"><arrow-left-bold /></el-icon>
<span>后退</span>
</div>
<div :ref="setRefs('scroller')" class="app-process__scroller">
<el-scrollbar :ref="setRefs('scroller')" class="app-process__scroller">
<div
v-for="(item, index) in process.list"
:key="index"
@ -21,7 +26,7 @@
<close />
</el-icon>
</div>
</div>
</el-scrollbar>
</div>
</template>
@ -29,7 +34,7 @@
import { watch } from "vue";
import { last } from "lodash-es";
import { useCool } from "/@/cool";
import { ArrowLeft, Close } from "@element-plus/icons-vue";
import { ArrowLeftBold, Close, HomeFilled } from "@element-plus/icons-vue";
import { ContextMenu } from "@cool-vue/crud";
import { useBase } from "/$/base";
import { Process } from "/$/base/types";
@ -126,7 +131,7 @@ watch(
margin-bottom: 10px;
padding: 0 10px;
&__back {
&__icon {
display: flex;
justify-content: center;
align-items: center;
@ -135,10 +140,17 @@ watch(
padding: 0 10px;
border-radius: 3px;
margin-right: 10px;
font-size: 12px;
cursor: pointer;
color: #000;
span {
font-size: 12px;
}
.el-icon {
margin-right: 2px;
}
&:hover {
background-color: #eee;
}
@ -147,13 +159,7 @@ watch(
&__scroller {
width: 100%;
flex: 1;
overflow-x: auto;
overflow-y: hidden;
white-space: nowrap;
&::-webkit-scrollbar {
display: none;
}
}
&__item {

View File

@ -6,7 +6,6 @@
<template v-else>
<el-breadcrumb>
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item v-for="(item, index) in list" :key="index">{{
item.meta?.label || item.name
}}</el-breadcrumb-item>
@ -17,7 +16,7 @@
<script lang="ts" name="route-nav" setup>
import { computed } from "vue";
import _ from "lodash-es";
import { flattenDeep, last } from "lodash-es";
import { useCool } from "/@/cool";
import { useBase } from "/$/base";
@ -48,11 +47,11 @@ const list = computed(() => {
}
}
return _(menu.group).map(deep).filter(Boolean).flattenDeep().value();
return flattenDeep(menu.group.map(deep).filter(Boolean));
});
//
const lastName = computed(() => _.last(list.value)?.name);
const lastName = computed(() => last(list.value)?.name);
</script>
<style lang="scss" scoped>

View File

@ -63,13 +63,13 @@ const { router, service } = useCool();
const { user, app } = useBase();
//
function onCommand(name: string) {
async function onCommand(name: string) {
switch (name) {
case "my":
router.push("/my/info");
break;
case "exit":
service.base.comm.logout();
await service.base.comm.logout();
user.logout();
break;
}

View File

@ -1,9 +1,11 @@
<template>
<div class="app-views">
<router-view v-slot="{ Component }">
<el-scrollbar>
<keep-alive :include="caches">
<component :is="Component" />
</keep-alive>
</el-scrollbar>
</router-view>
</div>
</template>
@ -35,7 +37,7 @@ const caches = computed(() => {
box-sizing: border-box;
border-radius: 3px;
& > div {
:deep(.el-scrollbar__view) {
height: 100%;
}
}

View File

@ -17,7 +17,6 @@
<ul class="link">
<li @click="home">回到首页</li>
<li @click="back">返回上一页</li>
<li @click="reLogin">重新登录</li>
</ul>
</template>
@ -59,10 +58,6 @@ async function reLogin() {
user.logout();
}
function back() {
history.back();
}
function home() {
router.push("/");
}

View File

@ -77,7 +77,7 @@ export const useUserStore = defineStore("user", function () {
// 退出
async function logout() {
clear();
router.href("login");
router.push("/login");
}
// 获取用户信息

View File

@ -5,6 +5,7 @@
</div>
<div class="dept-check__tree">
<el-scrollbar max-height="200px">
<el-tree
ref="Tree"
node-key="id"
@ -18,6 +19,7 @@
:check-strictly="checkStrictly"
@check="onCheckChange"
/>
</el-scrollbar>
</div>
</div>
</template>
@ -95,9 +97,7 @@ useUpsert({
border: 1px solid var(--el-border-color);
margin-top: 5px;
border-radius: 3px;
max-height: 200px;
box-sizing: border-box;
overflow-x: hidden;
padding: 5px 0;
}
}

View File

@ -28,6 +28,7 @@
</div>
<div class="dept-tree__container" @contextmenu.stop.prevent="onContextMenu">
<el-scrollbar>
<el-tree
v-loading="loading"
node-key="id"
@ -64,6 +65,7 @@
</div>
</template>
</el-tree>
</el-scrollbar>
</div>
<cl-form ref="Form" />
@ -407,8 +409,6 @@ onMounted(function () {
&__container {
height: calc(100% - 40px);
overflow-y: auto;
overflow-x: hidden;
:deep(.el-tree-node__content) {
height: 36px;

View File

@ -2,7 +2,8 @@
<div class="menu-check">
<el-input v-model="keyword" placeholder="输入关键字进行过滤" />
<div class="menu-check__scroller scroller1">
<div class="menu-check__scroller">
<el-scrollbar max-height="200px">
<el-tree
ref="Tree"
node-key="id"
@ -15,6 +16,7 @@
:filter-node-method="filterNode"
@check="onCheckChange"
/>
</el-scrollbar>
</div>
</div>
</template>
@ -83,8 +85,6 @@ useUpsert({
&__scroller {
border: 1px solid var(--el-border-color);
border-radius: 3px;
max-height: 200px;
box-sizing: border-box;
margin-top: 10px;
padding: 5px 0;
}

View File

@ -6,7 +6,7 @@
popper-class="menu-icon"
trigger="click"
>
<el-row :gutter="10" class="list scroller1">
<el-row :gutter="10" class="list">
<el-col v-for="(item, index) in list" :key="index" :span="2" :xs="4">
<el-button :class="{ 'is-active': item === name }" @click="onChange(item)">
<cl-svg :name="item" />

View File

@ -34,6 +34,8 @@ onMounted(() => {
<style lang="scss" scoped>
.page-iframe {
height: 100%;
iframe {
height: 100%;
width: 100%;

View File

@ -7,10 +7,6 @@
<el-avatar :size="30" shape="square" :src="session?.value.avatar"></el-avatar>
</div>
<span class="name">{{ session?.value.nickName }}聊天中</span>
<ul class="tools">
<li></li>
</ul>
</template>
</div>
@ -65,10 +61,18 @@
<div class="footer">
<div class="tools">
<ul>
<li>
<cl-upload @success="onImageSend" :show-file-list="false">
<el-icon><picture /></el-icon>
<li>
<el-icon><Picture /></el-icon>
</li>
</cl-upload>
<li>
<el-icon><video-camera /></el-icon>
</li>
<li>
<el-icon><microphone /></el-icon>
</li>
</ul>
</div>
@ -97,7 +101,7 @@
import { computed, ref } from "vue";
import { useChat } from "../hooks";
import { useStore } from "../store";
import { Picture } from "@element-plus/icons-vue";
import { Picture, VideoCamera, Microphone } from "@element-plus/icons-vue";
import { useBase } from "/$/base";
import { ContextMenu } from "@cool-vue/crud";
import { useClipboard } from "@vueuse/core";
@ -307,6 +311,10 @@ function onContextMenu(e: Event, item: Chat.Message) {
margin-bottom: 10px;
ul {
display: flex;
align-items: center;
flex: 1;
li {
height: 26px;
width: 26px;

View File

@ -11,7 +11,7 @@
</div>
<div class="list" v-loading="session?.loading">
<div class="scroller1">
<el-scrollbar class="scroller">
<div
class="item"
v-for="(item, index) in list"
@ -38,9 +38,13 @@
<p class="date">{{ item.createTime }}</p>
</div>
</div>
</div>
<el-empty v-if="list.length == 0" image-size="100" description="暂无会话"></el-empty>
<el-empty
v-if="list.length == 0"
:image-size="100"
description="暂无会话"
></el-empty>
</el-scrollbar>
</div>
</div>
</template>
@ -111,7 +115,7 @@ async function toDetail(item: Chat.Session) {
height: calc(100% - 51px);
overflow: hidden;
.scroller1 {
.scroller {
height: 100%;
}

View File

@ -1,5 +1,5 @@
<template>
<div class="demo scroller1">
<div class="demo">
<el-row :gutter="10">
<el-col v-for="(item, index) in list" :key="index" :xs="24" :sm="12" :md="8" :lg="6">
<component :is="item" />

View File

@ -1,14 +1,14 @@
<template>
<div class="editor scroller1">
<div class="item">
<p class="title">Wang</p>
<cl-editor-wang v-model="w" :height="300" />
</div>
<div class="editor">
<el-tabs>
<el-tab-pane label="WangEditor">
<cl-editor-wang v-model="w" :height="400" />
</el-tab-pane>
<div class="item">
<p class="title">Quill</p>
<cl-editor-quill v-model="q" :height="300" />
</div>
<el-tab-pane label="Quill">
<cl-editor-quill v-model="q" :height="400" />
</el-tab-pane>
</el-tabs>
</div>
</template>
@ -20,13 +20,8 @@ const w = ref("Wang");
<style lang="scss" scoped>
.editor {
.title {
font-size: 15px;
margin-bottom: 10px;
}
.item {
margin-bottom: 20px;
}
height: 100%;
background-color: #fff;
padding: 0 10px;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div class="view-home scroller1">
<div class="view-home">
<el-row :gutter="15">
<el-col :lg="6" :md="12" :xs="24">
<div class="card">
@ -64,7 +64,6 @@ import HotSearch from "./components/hot-search.vue";
<style lang="scss">
.view-home {
padding-right: 10px;
.card {
background-color: #fff;
border-radius: 5px;

View File

@ -1,5 +1,5 @@
<template>
<div class="demo scroller1">
<div class="demo">
<el-image
v-for="(item, index) in list"
:key="index"

View File

@ -12,7 +12,9 @@
>
</div>
<ul class="scroller1">
<div class="list">
<el-scrollbar>
<ul>
<li
v-for="(item, index) in list"
:key="index"
@ -33,6 +35,8 @@
<el-empty v-if="list.length == 0" :image-size="80" />
</ul>
</el-scrollbar>
</div>
<!-- 表单 -->
<cl-form ref="Form"></cl-form>
@ -215,12 +219,13 @@ onMounted(() => {
padding: 0 10px;
}
ul {
max-height: calc(100% - 40px);
.list {
height: calc(100% - 40px);
padding: 10px;
box-sizing: border-box;
overflow: hidden auto;
}
ul {
li {
display: flex;
align-items: center;

View File

@ -1,8 +1,14 @@
<template>
<div class="view-task">
<div class="box scroller1">
<el-scrollbar>
<div class="box">
<!-- 系统用户自定义已停止 -->
<div v-for="(item, index) in list" :key="index" class="block" :class="[`_${item.key}`]">
<div
v-for="(item, index) in list"
:key="index"
class="block"
:class="[`_${item.key}`]"
>
<div class="header">
<!-- 图标 -->
<i class="icon" :class="item.icon"></i>
@ -57,7 +63,9 @@
<div class="f">
<template v-if="element.status">
<span class="date">{{ element.nextRunTime || "..." }}</span>
<span class="date">{{
element.nextRunTime || "..."
}}</span>
<span class="start">进行中</span>
</template>
@ -111,7 +119,9 @@
</template>
<template #header>
<div v-if="list[index].list.length == 0" class="empty">暂无数据</div>
<div v-if="list[index].list.length == 0" class="empty">
暂无数据
</div>
</template>
</draggable>
@ -163,7 +173,11 @@
</ul>
</div>
<div v-loading="logs.loading" class="container" element-loading-text="拼命加载中">
<div
v-loading="logs.loading"
class="container"
element-loading-text="拼命加载中"
>
<ul
:ref="setRefs('log-scroller')"
class="scroller1"
@ -191,13 +205,12 @@
</div>
</li>
<li v-if="logs.list.length == 0">
<div class="empty">暂无数据</div>
</li>
<div class="empty" v-if="logs.list.length == 0">暂无数据</div>
</ul>
</div>
</div>
</div>
</el-scrollbar>
<!-- 表单 -->
<cl-form ref="Form" />
@ -759,14 +772,15 @@ onMounted(() => {
}
.view-task {
height: 100%;
.box {
display: flex;
height: 100%;
overflow-x: auto;
}
.block {
height: 100%;
height: calc(100% - 10px);
width: 400px;
margin-right: 10px;
flex-shrink: 0;
@ -917,7 +931,7 @@ onMounted(() => {
position: absolute;
left: 0;
top: 1px;
color: #222;
color: var(--color-primary);
}
}
@ -1113,7 +1127,7 @@ onMounted(() => {
&:hover {
.remark {
color: #444;
color: var(--color-primary);
}
}
}

View File

@ -12,7 +12,8 @@
</div>
<div class="cl-upload-space-category__list">
<ul class="scroller1">
<el-scrollbar>
<ul>
<li
v-for="(item, index) in flist"
:key="index"
@ -24,11 +25,14 @@
@contextmenu.stop.prevent="onContextMenu($event, item)"
>
<span>{{ item.name }}</span>
<el-icon v-show="space.category.id == item.id"><arrow-right-bold /></el-icon>
<el-icon v-show="space.category.id == item.id"
><arrow-right-bold
/></el-icon>
</li>
<el-empty v-if="flist.length == 0" :image-size="80" />
</ul>
</el-scrollbar>
</div>
</div>
@ -257,6 +261,7 @@ onMounted(() => {
margin-bottom: 10px;
border-radius: 3px;
color: #666;
position: relative;
.el-icon {
position: absolute;