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", "name": "front-next",
"version": "5.9.0", "version": "5.9.1",
"scripts": { "scripts": {
"dev": "vite --host", "dev": "vite --host",
"build": "vite build", "build": "vite build",

View File

@ -35,15 +35,6 @@ router.beforeResolve(() => {
Loading.close(); 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) { router.append = function (data) {
const list = isArray(data) ? data : [data]; const list = isArray(data) ? data : [data];

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,19 +5,21 @@
</div> </div>
<div class="dept-check__tree"> <div class="dept-check__tree">
<el-tree <el-scrollbar max-height="200px">
ref="Tree" <el-tree
node-key="id" ref="Tree"
show-checkbox node-key="id"
:data="list" show-checkbox
:props="{ :data="list"
label: 'name', :props="{
children: 'children' label: 'name',
}" children: 'children'
:filter-node-method="filterNode" }"
:check-strictly="checkStrictly" :filter-node-method="filterNode"
@check="onCheckChange" :check-strictly="checkStrictly"
/> @check="onCheckChange"
/>
</el-scrollbar>
</div> </div>
</div> </div>
</template> </template>
@ -95,9 +97,7 @@ useUpsert({
border: 1px solid var(--el-border-color); border: 1px solid var(--el-border-color);
margin-top: 5px; margin-top: 5px;
border-radius: 3px; border-radius: 3px;
max-height: 200px;
box-sizing: border-box; box-sizing: border-box;
overflow-x: hidden;
padding: 5px 0; padding: 5px 0;
} }
} }

View File

@ -28,42 +28,44 @@
</div> </div>
<div class="dept-tree__container" @contextmenu.stop.prevent="onContextMenu"> <div class="dept-tree__container" @contextmenu.stop.prevent="onContextMenu">
<el-tree <el-scrollbar>
v-loading="loading" <el-tree
node-key="id" v-loading="loading"
default-expand-all node-key="id"
:data="list" default-expand-all
:props="{ :data="list"
label: 'name' :props="{
}" label: 'name'
:draggable="isDrag" }"
:allow-drag="allowDrag" :draggable="isDrag"
:allow-drop="allowDrop" :allow-drag="allowDrag"
:expand-on-click-node="false" :allow-drop="allowDrop"
@node-contextmenu="onContextMenu" :expand-on-click-node="false"
> @node-contextmenu="onContextMenu"
<template #default="{ node, data }"> >
<div class="dept-tree__node"> <template #default="{ node, data }">
<span <div class="dept-tree__node">
class="dept-tree__node-label" <span
:class="{ class="dept-tree__node-label"
'is-active': data.id == info?.id :class="{
}" 'is-active': data.id == info?.id
@click="rowClick(data)" }"
>{{ node.label }}</span @click="rowClick(data)"
> >{{ node.label }}</span
<span >
v-if="app.browser.isMini" <span
class="dept-tree__node-icon" v-if="app.browser.isMini"
@click="onContextMenu($event, data, node)" class="dept-tree__node-icon"
> @click="onContextMenu($event, data, node)"
<el-icon> >
<more-filled /> <el-icon>
</el-icon> <more-filled />
</span> </el-icon>
</div> </span>
</template> </div>
</el-tree> </template>
</el-tree>
</el-scrollbar>
</div> </div>
<cl-form ref="Form" /> <cl-form ref="Form" />
@ -407,8 +409,6 @@ onMounted(function () {
&__container { &__container {
height: calc(100% - 40px); height: calc(100% - 40px);
overflow-y: auto;
overflow-x: hidden;
:deep(.el-tree-node__content) { :deep(.el-tree-node__content) {
height: 36px; height: 36px;

View File

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

View File

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

View File

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

View File

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

View File

@ -11,7 +11,7 @@
</div> </div>
<div class="list" v-loading="session?.loading"> <div class="list" v-loading="session?.loading">
<div class="scroller1"> <el-scrollbar class="scroller">
<div <div
class="item" class="item"
v-for="(item, index) in list" v-for="(item, index) in list"
@ -38,9 +38,13 @@
<p class="date">{{ item.createTime }}</p> <p class="date">{{ item.createTime }}</p>
</div> </div>
</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>
</div> </div>
</template> </template>
@ -111,7 +115,7 @@ async function toDetail(item: Chat.Session) {
height: calc(100% - 51px); height: calc(100% - 51px);
overflow: hidden; overflow: hidden;
.scroller1 { .scroller {
height: 100%; height: 100%;
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -12,27 +12,31 @@
> >
</div> </div>
<ul class="scroller1"> <div class="list">
<li <el-scrollbar>
v-for="(item, index) in list" <ul>
:key="index" <li
class="item" v-for="(item, index) in list"
:class="{ :key="index"
'is-active': active == item.id class="item"
}" :class="{
@click="select(item)" 'is-active': active == item.id
@contextmenu=" }"
(e) => { @click="select(item)"
onContextMenu(e, item); @contextmenu="
} (e) => {
" onContextMenu(e, item);
> }
<span>{{ item.name }} - {{ item.key }}</span> "
<el-icon v-show="active == item.id"><arrow-right-bold /></el-icon> >
</li> <span>{{ item.name }} - {{ item.key }}</span>
<el-icon v-show="active == item.id"><arrow-right-bold /></el-icon>
</li>
<el-empty v-if="list.length == 0" :image-size="80" /> <el-empty v-if="list.length == 0" :image-size="80" />
</ul> </ul>
</el-scrollbar>
</div>
<!-- 表单 --> <!-- 表单 -->
<cl-form ref="Form"></cl-form> <cl-form ref="Form"></cl-form>
@ -215,12 +219,13 @@ onMounted(() => {
padding: 0 10px; padding: 0 10px;
} }
ul { .list {
max-height: calc(100% - 40px); height: calc(100% - 40px);
padding: 10px; padding: 10px;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden auto; }
ul {
li { li {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -1,203 +1,216 @@
<template> <template>
<div class="view-task"> <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 class="header"> <div
<!-- 图标 --> v-for="(item, index) in list"
<i class="icon" :class="item.icon"></i> :key="index"
<!-- 标题 --> class="block"
<span class="label">{{ item.label }}</span> :class="[`_${item.key}`]"
<!-- 数量 --> >
<span class="num">({{ item.pagination.total }})</span> <div class="header">
<span class="flex1"></span> <!-- 图标 -->
<!-- 操作按钮 --> <i class="icon" :class="item.icon"></i>
<ul class="op-btn"> <!-- 标题 -->
<li <span class="label">{{ item.label }}</span>
v-permission="perm.delete" <!-- 数量 -->
class="refresh-btn" <span class="num">({{ item.pagination.total }})</span>
@click="refreshTask({ page: 1 })" <span class="flex1"></span>
> <!-- 操作按钮 -->
<el-icon><refresh /></el-icon> <ul class="op-btn">
<span>刷新</span> <li
</li> v-permission="perm.delete"
class="refresh-btn"
@click="refreshTask({ page: 1 })"
>
<el-icon><refresh /></el-icon>
<span>刷新</span>
</li>
<li v-permission="perm.add" class="add-btn" @click="edit(item.params)"> <li v-permission="perm.add" class="add-btn" @click="edit(item.params)">
<el-icon><circle-plus /></el-icon> <el-icon><circle-plus /></el-icon>
<span>添加</span> <span>添加</span>
</li> </li>
</ul> </ul>
</div>
<div :ref="setRefs(`${item.key}-scroller`)" class="container scroller1">
<draggable
v-model="list[index].list"
v-bind="drag.options"
tag="ul"
item-key="id"
:data-type="item.params.type"
:data-status="item.params.status"
@end="onDragEnd"
>
<template #item="{ element }">
<li
:key="element.id"
:data-id="element.id"
class="_drag"
@contextmenu.stop.prevent="openCM($event, element)"
>
<div class="h">
<span v-show="element.status === 0" class="type _warning">
{{ element.type === 0 ? "系统" : "用户" }}
</span>
<span class="name">{{ element.name }}</span>
</div>
<div class="remark">{{ element.remark }}</div>
<div class="f">
<template v-if="element.status">
<span class="date">{{
element.nextRunTime || "..."
}}</span>
<span class="start">进行中</span>
</template>
<template v-else>
<span>...</span>
<span class="stop">已停止</span>
</template>
</div>
<div class="op">
<div
v-if="element.status === 0"
class="op-item"
@click="start(element)"
>
<el-icon><video-play /></el-icon>
<span>开始</span>
</div>
<div
v-else
v-permission="perm.stop"
class="op-item"
@click="stop(element)"
>
<el-icon><video-pause /></el-icon>
<span>暂停</span>
</div>
<div
v-permission="{
and: [perm.update, perm.info]
}"
class="op-item"
@click="edit(element)"
>
<el-icon><edit-pen /></el-icon>
<span>编辑</span>
</div>
<div
v-permission="perm.log"
class="op-item"
@click="findLog(element)"
>
<el-icon><tickets /></el-icon>
<span>查看日志</span>
</div>
</div>
</li>
</template>
<template #header>
<div v-if="list[index].list.length == 0" class="empty">
暂无数据
</div>
</template>
</draggable>
<el-button
v-if="item.pagination.total >= item.pagination.size"
class="more"
text
@click="moreTask(index)"
>查看更多</el-button
>
</div>
<div class="footer">
<button v-permission="perm.add" class="btn-add" @click="edit(item.params)">
<el-icon><plus /></el-icon>
</button>
</div>
</div> </div>
<div :ref="setRefs(`${item.key}-scroller`)" class="container scroller1"> <!-- 日志 -->
<draggable <div v-permission="perm.log" class="block _log">
v-model="list[index].list" <div class="header">
v-bind="drag.options" <!-- 标题 -->
tag="ul" <span class="label">日志</span>
item-key="id" <!-- 数量 -->
:data-type="item.params.type" <span class="num">({{ logs.pagination.total }})</span>
:data-status="item.params.status" <span class="flex1"></span>
@end="onDragEnd"
<!-- 是否异常 -->
<el-checkbox-group
v-model="logs.filters.status"
class="status"
@change="filterLog"
>
<el-checkbox :label="0">异常</el-checkbox>
</el-checkbox-group>
<!-- 操作按钮 -->
<ul class="op-btn">
<li @click="refreshLog({ page: 1 })">
<el-icon><refresh /></el-icon>
<span>刷新</span>
</li>
<li v-if="logs.current" class="_current-log" @click="allLog">
<span>{{ logs.current.name }}</span>
<el-icon><close /></el-icon>
</li>
</ul>
</div>
<div
v-loading="logs.loading"
class="container"
element-loading-text="拼命加载中"
> >
<template #item="{ element }"> <ul
:ref="setRefs('log-scroller')"
class="scroller1"
:infinite-scroll-disabled="logs.list.length == logs.pagination.total"
v-infinite-scroll="moreLog"
>
<li <li
:key="element.id" v-for="(item, index) in logs.list"
:data-id="element.id" :key="index"
class="_drag" :class="{ _error: item.status == 0 }"
@contextmenu.stop.prevent="openCM($event, element)" @click="expandLog(item)"
> >
<div class="h"> <div class="h">
<span v-show="element.status === 0" class="type _warning"> <span class="name"
{{ element.type === 0 ? "系统" : "用户" }} >{{ Number(index) + 1 }} · {{ item.taskName }}</span
</span> >
<span class="name">{{ element.name }}</span>
</div> </div>
<div class="remark">{{ element.remark }}</div> <div class="remark" :class="{ _ellipsis: !item._expand }">
{{ item.detail || "..." }}
</div>
<div class="f"> <div class="f">
<template v-if="element.status"> <span>执行时间{{ item.createTime }}</span>
<span class="date">{{ element.nextRunTime || "..." }}</span>
<span class="start">进行中</span>
</template>
<template v-else>
<span>...</span>
<span class="stop">已停止</span>
</template>
</div>
<div class="op">
<div
v-if="element.status === 0"
class="op-item"
@click="start(element)"
>
<el-icon><video-play /></el-icon>
<span>开始</span>
</div>
<div
v-else
v-permission="perm.stop"
class="op-item"
@click="stop(element)"
>
<el-icon><video-pause /></el-icon>
<span>暂停</span>
</div>
<div
v-permission="{
and: [perm.update, perm.info]
}"
class="op-item"
@click="edit(element)"
>
<el-icon><edit-pen /></el-icon>
<span>编辑</span>
</div>
<div
v-permission="perm.log"
class="op-item"
@click="findLog(element)"
>
<el-icon><tickets /></el-icon>
<span>查看日志</span>
</div>
</div> </div>
</li> </li>
</template>
<template #header> <div class="empty" v-if="logs.list.length == 0">暂无数据</div>
<div v-if="list[index].list.length == 0" class="empty">暂无数据</div> </ul>
</template> </div>
</draggable>
<el-button
v-if="item.pagination.total >= item.pagination.size"
class="more"
text
@click="moreTask(index)"
>查看更多</el-button
>
</div>
<div class="footer">
<button v-permission="perm.add" class="btn-add" @click="edit(item.params)">
<el-icon><plus /></el-icon>
</button>
</div> </div>
</div> </div>
</el-scrollbar>
<!-- 日志 -->
<div v-permission="perm.log" class="block _log">
<div class="header">
<!-- 标题 -->
<span class="label">日志</span>
<!-- 数量 -->
<span class="num">({{ logs.pagination.total }})</span>
<span class="flex1"></span>
<!-- 是否异常 -->
<el-checkbox-group
v-model="logs.filters.status"
class="status"
@change="filterLog"
>
<el-checkbox :label="0">异常</el-checkbox>
</el-checkbox-group>
<!-- 操作按钮 -->
<ul class="op-btn">
<li @click="refreshLog({ page: 1 })">
<el-icon><refresh /></el-icon>
<span>刷新</span>
</li>
<li v-if="logs.current" class="_current-log" @click="allLog">
<span>{{ logs.current.name }}</span>
<el-icon><close /></el-icon>
</li>
</ul>
</div>
<div v-loading="logs.loading" class="container" element-loading-text="拼命加载中">
<ul
:ref="setRefs('log-scroller')"
class="scroller1"
:infinite-scroll-disabled="logs.list.length == logs.pagination.total"
v-infinite-scroll="moreLog"
>
<li
v-for="(item, index) in logs.list"
:key="index"
:class="{ _error: item.status == 0 }"
@click="expandLog(item)"
>
<div class="h">
<span class="name"
>{{ Number(index) + 1 }} · {{ item.taskName }}</span
>
</div>
<div class="remark" :class="{ _ellipsis: !item._expand }">
{{ item.detail || "..." }}
</div>
<div class="f">
<span>执行时间{{ item.createTime }}</span>
</div>
</li>
<li v-if="logs.list.length == 0">
<div class="empty">暂无数据</div>
</li>
</ul>
</div>
</div>
</div>
<!-- 表单 --> <!-- 表单 -->
<cl-form ref="Form" /> <cl-form ref="Form" />
@ -759,14 +772,15 @@ onMounted(() => {
} }
.view-task { .view-task {
height: 100%;
.box { .box {
display: flex; display: flex;
height: 100%; height: 100%;
overflow-x: auto;
} }
.block { .block {
height: 100%; height: calc(100% - 10px);
width: 400px; width: 400px;
margin-right: 10px; margin-right: 10px;
flex-shrink: 0; flex-shrink: 0;
@ -917,7 +931,7 @@ onMounted(() => {
position: absolute; position: absolute;
left: 0; left: 0;
top: 1px; top: 1px;
color: #222; color: var(--color-primary);
} }
} }
@ -1113,7 +1127,7 @@ onMounted(() => {
&:hover { &:hover {
.remark { .remark {
color: #444; color: var(--color-primary);
} }
} }
} }

View File

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