添加 lint,解决 /@/ 找不到路径问题

This commit is contained in:
icssoa 2021-03-31 16:48:59 +08:00
parent 43d3d9a89a
commit a6b3e9118e
101 changed files with 2701 additions and 1281 deletions

76
.eslintrc.js Normal file
View File

@ -0,0 +1,76 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
},
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
sourceType: 'module',
jsxPragma: 'React',
ecmaFeatures: {
jsx: true,
tsx: true,
},
},
extends: [
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended',
],
rules: {
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'vue/component-name-in-template-casing': ["error", "kebab-case"],
'vue/component-definition-name-casing': ["error", "kebab-case"],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^h$',
varsIgnorePattern: '^h$',
},
],
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^h$',
varsIgnorePattern: '^h$',
},
],
'space-before-function-paren': 'off',
'vue/attributes-order': 'off',
'vue/one-component-per-file': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/max-attributes-per-line': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/attribute-hyphenation': 'off',
// 'vue/html-self-closing': 'off',
'vue/require-default-prop': 'off',
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'never',
component: 'always',
},
svg: 'always',
math: 'always',
},
],
},
};

9
.prettierrc Normal file
View File

@ -0,0 +1,9 @@
{
"tabWidth": 4,
"useTabs": true,
"semi": true,
"jsxBracketSameLine": true,
"singleQuote": false,
"printWidth": 100,
"trailingComma": "none"
}

View File

@ -34,8 +34,8 @@
"",
"<script lang=\"ts\">",
"import { defineComponent, inject, reactive } from \"vue\";",
"import { CrudLoad, Upsert, Table } from \"@/crud/types\";",
"import { useRefs } from \"@/core\";",
"import { CrudLoad, Upsert, Table } from \"/@/crud/types\";",
"import { useRefs } from \"/@/core\";",
"",
"export default defineComponent({",
" setup() {",

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"editor.cursorSmoothCaretAnimation": true
}

View File

@ -4,7 +4,9 @@
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
"serve": "vite preview"
"serve": "vite preview",
"lint:prettier": "prettier --write --loglevel warn \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"",
"lint:eslint": "eslint \"{src,mock}/**/*.{vue,ts,tsx}\" --fix"
},
"dependencies": {
"array.prototype.flat": "^1.2.4",
@ -32,9 +34,16 @@
"vuex": "^4.0.0-0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"@vitejs/plugin-vue": "^1.1.5",
"@vitejs/plugin-vue-jsx": "^1.1.2",
"@vue/compiler-sfc": "^3.0.5",
"eslint": "^7.23.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^7.8.0",
"prettier": "^2.2.1",
"sass": "^1.32.8",
"sass-loader": "^11.0.1",
"svg-sprite-loader": "^6.0.2",

View File

@ -1,8 +1,8 @@
* {
padding: 0;
margin: 0;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
"Microsoft YaHei", "微软雅黑", Arial, sans-serif;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
"微软雅黑", Arial, sans-serif;
}
*::-webkit-scrollbar {

View File

@ -6,8 +6,7 @@ import { MenuItem } from "/@/cool/modules/base/types";
const routerMode = "history";
// 开发模式
const isDev: boolean = true;
const isDev = import.meta.env.MODE === "development";
// Host
const host = "https://show.cool-admin.com";
@ -39,13 +38,13 @@ const app: any = store.get("__app__") || {
showAMenu: false, // 是否显示一级菜单栏
showRouteNav: true, // 是否显示路由导航栏
showProcess: true, // 是否显示页面进程栏
customMenu: false, // 自定义菜单
customMenu: false // 自定义菜单
},
theme: {
color: "", // 主题色
url: "", // 主题样式地址
},
url: "" // 主题样式地址
}
};
// 自定义菜单列表

View File

@ -9,8 +9,8 @@ export default {
name: "upload",
options: {
icon: "el-icon-picture",
text: "选择图片",
},
text: "选择图片"
}
},
{
name: "crud",
@ -20,11 +20,11 @@ export default {
dict: {
sort: {
prop: "order",
order: "sort",
},
},
},
},
order: "sort"
}
}
}
}
},
// 客服聊天
"chat",
@ -35,6 +35,6 @@ export default {
// 示例页
"demo",
// 主题切换
"theme",
],
"theme"
]
};

View File

@ -46,7 +46,7 @@ function resize() {
}
}
window.onload = function() {
window.onload = function () {
window.addEventListener("resize", resize);
resize();
};

View File

@ -11,9 +11,7 @@ if (app.theme) {
createLink(url, "theme-style");
}
document
.getElementsByTagName("body")[0]
.style.setProperty("--color-primary", color);
document.getElementsByTagName("body")[0].style.setProperty("--color-primary", color);
}
// 字体图标库加载
@ -27,7 +25,7 @@ if (iconfontUrl) {
const svgFiles = import.meta.globEager("/src/icons/svg/**/*.svg");
function iconList() {
let list: string[] = [];
const list: string[] = [];
for (const i in svgFiles) {
list.push(basename(i).replace(".svg", ""));

View File

@ -21,12 +21,12 @@ export default defineComponent({
src: String,
size: {
type: String,
default: "large",
default: "large"
},
shape: {
type: String,
default: "circle",
},
default: "circle"
}
},
setup(props) {
@ -35,14 +35,14 @@ export default defineComponent({
const style = computed(() => {
return {
height: size,
width: size,
width: size
};
});
return {
style,
style
};
},
}
});
</script>

View File

@ -1,11 +1,6 @@
<template>
<div class="cl-codemirror" ref="editorRef">
<textarea
class="cl-code"
id="editor"
:height="height"
:width="width"
></textarea>
<div ref="editorRef" class="cl-codemirror">
<textarea id="editor" class="cl-code" :height="height" :width="width"></textarea>
</div>
</template>
@ -27,7 +22,7 @@ export default defineComponent({
modelValue: null,
height: String,
width: String,
options: Object,
options: Object
},
emits: ["update:modelValue", "load"],
@ -64,18 +59,15 @@ export default defineComponent({
onMounted(function () {
nextTick(() => {
//
editor = CodeMirror.fromTextArea(
editorRef.value.querySelector("#editor"),
{
mode: "javascript",
theme: "ambiance",
styleActiveLine: true,
lineNumbers: true,
lineWrapping: true,
indentUnit: 4,
...props.options,
}
);
editor = CodeMirror.fromTextArea(editorRef.value.querySelector("#editor"), {
mode: "javascript",
theme: "ambiance",
styleActiveLine: true,
lineNumbers: true,
lineWrapping: true,
indentUnit: 4,
...props.options
});
//
editor.on("change", (e: any) => {
@ -105,9 +97,9 @@ export default defineComponent({
});
return {
editorRef,
editorRef
};
},
}
});
</script>

View File

@ -1,19 +1,18 @@
<template>
<div class="cl-dept-check" v-loading="loading">
<div v-loading="loading" class="cl-dept-check">
<p v-if="title">{{ title }}</p>
<div class="cl-dept-check__search">
<el-input placeholder="输入关键字进行过滤" v-model="keyword" size="small"> </el-input>
<el-input v-model="keyword" placeholder="输入关键字进行过滤" size="small" />
<el-switch
v-model="form.relevance"
:active-value="1"
:inactive-value="0"
v-model="form.relevance"
@change="onCheckStrictlyChange"
></el-switch
>是否关联上下级
/>
</div>
<div class="cl-dept-check__tree" v-if="visible">
<div v-if="visible" class="cl-dept-check__tree">
<el-tree
ref="treeRef"
highlight-current
@ -28,8 +27,7 @@
:filter-node-method="filterNode"
:check-strictly="!form.relevance"
@check-change="onCheckChange"
>
</el-tree>
/>
</div>
</div>
</template>

View File

@ -12,50 +12,41 @@
<li v-if="drag && !isMini">
<el-tooltip content="拖动排序">
<i
class="el-icon-s-operation"
@click="isDrag = true"
></i>
<i class="el-icon-s-operation" @click="isDrag = true"></i>
</el-tooltip>
</li>
<li class="no" v-show="isDrag">
<el-button type="text" size="mini" @click="treeOrder(true)"
>保存</el-button
>
<el-button type="text" size="mini" @click="treeOrder(false)"
>取消</el-button
>
<li v-show="isDrag" class="no">
<el-button type="text" size="mini" @click="treeOrder(true)">保存</el-button>
<el-button type="text" size="mini" @click="treeOrder(false)">取消</el-button>
</li>
</ul>
</div>
<div class="cl-dept-tree__container" @contextmenu.prevent="openCM">
<el-tree
v-loading="loading"
node-key="id"
highlight-current
default-expand-all
:data="list"
:props="{
label: 'name',
label: 'name'
}"
:draggable="isDrag"
:allow-drag="allowDrag"
:allow-drop="allowDrop"
:expand-on-click-node="false"
v-loading="loading"
@node-contextmenu="openCM"
>
<template #default="{ node, data }">
<div class="cl-dept-tree__node">
<span class="cl-dept-tree__node-label" @click="rowClick(data)">{{
node.label
}}</span>
<span
class="cl-dept-tree__node-label"
@click="rowClick(data)"
>{{ node.label }}</span
>
<span
class="cl-dept-tree__node-icon"
v-if="isMini"
class="cl-dept-tree__node-icon"
@click="openCM($event, data, node)"
>
<i class="el-icon-more"></i>
@ -65,7 +56,7 @@
</el-tree>
</div>
<cl-form :ref="setRefs('form')"></cl-form>
<cl-form :ref="setRefs('form')" />
</div>
</template>
@ -82,14 +73,16 @@ export default defineComponent({
props: {
drag: {
type: Boolean,
default: true,
default: true
},
level: {
type: Number,
default: 99,
},
default: 99
}
},
emits: ["list-change", "row-click", "user-add"],
setup(props, { emit }) {
const { refs, setRefs } = useRefs();
@ -134,9 +127,7 @@ export default defineComponent({
// ids
function rowClick(e: any) {
ContextMenu.close();
const ids = e.children
? revDeepTree(e.children).map((e) => e.id)
: [];
const ids = e.children ? revDeepTree(e.children).map((e) => e.id) : [];
ids.unshift(e.id);
emit("row-click", { item: e, ids });
}
@ -149,7 +140,7 @@ export default defineComponent({
title: "编辑部门",
width: "550px",
props: {
labelWidth: "100px",
labelWidth: "100px"
},
items: [
{
@ -159,13 +150,13 @@ export default defineComponent({
component: {
name: "el-input",
props: {
placeholder: "请填写部门名称",
},
placeholder: "请填写部门名称"
}
},
rules: {
required: true,
message: "部门名称不能为空",
},
message: "部门名称不能为空"
}
},
{
label: "上级部门",
@ -174,9 +165,9 @@ export default defineComponent({
component: {
name: "el-input",
props: {
disabled: true,
},
},
disabled: true
}
}
},
{
label: "排序",
@ -187,10 +178,10 @@ export default defineComponent({
props: {
"controls-position": "right",
min: 0,
max: 100,
},
},
},
max: 100
}
}
}
],
on: {
submit: (data: any, { done, close }: any) => {
@ -198,7 +189,7 @@ export default defineComponent({
id: e.id,
parentId: e.parentId,
name: data.name,
orderNum: data.orderNum,
orderNum: data.orderNum
})
.then(() => {
ElMessage.success(`新增部门${data.name}成功`);
@ -209,8 +200,8 @@ export default defineComponent({
ElMessage.error(err);
done();
});
},
},
}
}
});
}
@ -220,7 +211,7 @@ export default defineComponent({
$service.system.dept
.delete({
ids: [e.id],
deleteUser: f,
deleteUser: f
})
.then(() => {
if (f) {
@ -237,16 +228,12 @@ export default defineComponent({
});
};
ElMessageBox.confirm(
`该操作会删除 “${e.name}” 部门的所有用户,是否确认?`,
"提示",
{
type: "warning",
confirmButtonText: "直接删除",
cancelButtonText: "保留用户",
distinguishCancelAndClose: true,
}
)
ElMessageBox.confirm(`该操作会删除 “${e.name}” 部门的所有用户,是否确认?`, "提示", {
type: "warning",
confirmButtonText: "直接删除",
cancelButtonText: "保留用户",
distinguishCancelAndClose: true
})
.then(() => {
del(true);
})
@ -261,7 +248,7 @@ export default defineComponent({
function treeOrder(f: boolean) {
if (f) {
ElMessageBox.confirm("部门架构已发生改变,是否保存?", "提示", {
type: "warning",
type: "warning"
})
.then(() => {
const ids: any[] = [];
@ -285,7 +272,7 @@ export default defineComponent({
return {
id: e.id,
parentId: e.parentId,
orderNum: i,
orderNum: i
};
})
)
@ -322,10 +309,10 @@ export default defineComponent({
rowEdit({
name: "",
parentName: d.name,
parentId: d.id,
parentId: d.id
});
done();
},
}
},
{
label: "编辑",
@ -333,7 +320,7 @@ export default defineComponent({
callback: (_: any, done: Function) => {
rowEdit(d);
done();
},
}
},
{
label: "删除",
@ -342,7 +329,7 @@ export default defineComponent({
callback: (_: any, done: Function) => {
rowDel(d);
done();
},
}
},
{
label: "新增成员",
@ -350,9 +337,9 @@ export default defineComponent({
callback: (_: any, done: Function) => {
emit("user-add", d);
done();
},
},
],
}
}
]
});
}
@ -374,9 +361,9 @@ export default defineComponent({
rowClick,
rowEdit,
rowDel,
treeOrder,
treeOrder
};
},
}
});
</script>

View File

@ -7,8 +7,7 @@
detail-data
:show-button="false"
@confirm="onUploadSpaceConfirm"
>
</cl-upload-space>
/>
</div>
</template>
@ -26,7 +25,7 @@ export default defineComponent({
options: Object,
modelValue: null,
height: [String, Number],
width: [String, Number],
width: [String, Number]
},
emits: ["update:modelValue", "load"],
@ -60,12 +59,7 @@ export default defineComponent({
files.forEach((file, i) => {
const [type] = file.type.split("/");
quill.insertEmbed(
cursorIndex.value + i,
type,
file.url,
Quill.sources.USER
);
quill.insertEmbed(cursorIndex.value + i, type, file.url, Quill.sources.USER);
});
//
@ -80,16 +74,12 @@ export default defineComponent({
//
const style = computed<any>(() => {
const height = isNumber(props.height)
? props.height + "px"
: props.height;
const width = isNumber(props.width)
? props.width + "px"
: props.width;
const height = isNumber(props.height) ? props.height + "px" : props.height;
const width = isNumber(props.width) ? props.width + "px" : props.width;
return {
height,
width,
width
};
});
@ -127,10 +117,10 @@ export default defineComponent({
[{ font: [] }],
[{ align: [] }],
["clean"],
["link", "image"],
],
["link", "image"]
]
},
...props.options,
...props.options
});
//
@ -157,9 +147,9 @@ export default defineComponent({
style,
setRefs,
setContent,
onUploadSpaceConfirm,
onUploadSpaceConfirm
};
},
}
});
</script>
@ -259,12 +249,8 @@ export default defineComponent({
content: "衬线字体";
}
.ql-snow
.ql-picker.ql-font
.ql-picker-label[data-value="monospace"]::before,
.ql-snow
.ql-picker.ql-font
.ql-picker-item[data-value="monospace"]::before {
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
content: "等宽字体";
}
}

View File

@ -1,6 +1,6 @@
<template>
<svg :class="svgClass" :style="style" aria-hidden="true">
<use :xlink:href="iconName"></use>
<use :xlink:href="iconName" />
</svg>
</template>
@ -13,36 +13,32 @@ export default defineComponent({
props: {
name: {
type: String,
type: String
},
className: {
type: String,
type: String
},
size: {
type: [String, Number],
},
type: [String, Number]
}
},
setup(props) {
const style = ref<any>({
fontSize: isNumber(props.size) ? props.size + "px" : props.size,
fontSize: isNumber(props.size) ? props.size + "px" : props.size
});
const iconName = computed<string>(() => `#icon-${props.name}`);
const svgClass = computed<Array<string>>(() => {
return [
"icon-svg",
`icon-svg__${props.name}`,
String(props.className || ""),
];
return ["icon-svg", `icon-svg__${props.name}`, String(props.className || "")];
});
return {
style,
iconName,
svgClass,
svgClass
};
},
}
});
</script>

View File

@ -1,19 +1,12 @@
<template>
<div class="cl-menu-file">
<el-select
v-model="path"
allow-create
filterable
clearable
placeholder="请选择"
>
<el-select v-model="path" allow-create filterable clearable placeholder="请选择">
<el-option
v-for="(item, index) in list"
:key="index"
:label="item.value"
:value="item.value"
>
</el-option>
/>
</el-select>
</div>
</template>
@ -29,7 +22,7 @@ function findFiles() {
for (const i in files) {
if (!i.includes("components")) {
list.push({
value: i.substr(5),
value: i.substr(5)
});
}
}
@ -43,8 +36,8 @@ export default defineComponent({
props: {
modelValue: {
type: String,
default: "",
},
default: ""
}
},
emits: ["update:modelValue"],
@ -69,9 +62,9 @@ export default defineComponent({
return {
path,
list,
list
};
},
}
});
</script>

View File

@ -8,13 +8,13 @@
popper-class="popper-menu-icon"
>
<el-row :gutter="10" class="list scroller1">
<el-col :span="3" :xs="4" v-for="(item, index) in list" :key="index">
<el-col v-for="(item, index) in list" :key="index" :span="3" :xs="4">
<el-button
size="mini"
:class="{ 'is-active': item === name }"
@click="onChange(item)"
>
<icon-svg :name="item"></icon-svg>
<icon-svg :name="item" />
</el-button>
</el-col>
</el-row>
@ -26,7 +26,7 @@
clearable
@click="open"
@input="onChange"
></el-input>
/>
</template>
</el-popover>
</div>
@ -60,7 +60,7 @@ export default defineComponent({
watch(
() => props.modelValue,
val => {
(val) => {
name.value = val;
}
);

View File

@ -8,7 +8,7 @@
:options="options"
:props="{ multiple: true }"
@change="onChange"
></el-cascader>
/>
</div>
</template>
@ -21,8 +21,8 @@ export default defineComponent({
props: {
modelValue: {
type: String,
default: "",
},
default: ""
}
},
emits: ["update:modelValue"],
@ -38,10 +38,7 @@ export default defineComponent({
//
function onChange(row: any) {
emit(
"update:modelValue",
row.map((e: any) => e.join(":")).join(",")
);
emit("update:modelValue", row.map((e: any) => e.join(":")).join(","));
}
//
@ -80,7 +77,7 @@ export default defineComponent({
d.push({
label: key,
value: key,
children: isLast ? null : [],
children: isLast ? null : []
});
if (!isLast) {
@ -99,21 +96,19 @@ export default defineComponent({
watch(
() => props.modelValue,
(val: string) => {
value.value = val
? val.split(",").map((e: string) => e.split(":"))
: [];
value.value = val ? val.split(",").map((e: string) => e.split(":")) : [];
},
{
immediate: true,
immediate: true
}
);
return {
value,
options,
onChange,
onChange
};
},
}
});
</script>

View File

@ -6,16 +6,8 @@
background-color="transparent"
@select="onSelect"
>
<el-menu-item
v-for="(item, index) in list"
:index="`${index}`"
:key="index"
>
<icon-svg
v-if="item.icon"
:name="item.icon"
:size="18"
></icon-svg>
<el-menu-item v-for="(item, index) in list" :key="index" :index="`${index}`">
<icon-svg v-if="item.icon" :name="item.icon" :size="18" />
<span>{{ item.name }}</span>
</el-menu-item>
</el-menu>
@ -45,9 +37,7 @@ export default defineComponent({
const index = ref<string>("0");
//
const list = computed(() =>
store.getters.menuGroup.filter((e: any) => e.isShow)
);
const list = computed(() => store.getters.menuGroup.filter((e: any) => e.isShow));
//
function onSelect(index: number) {
@ -87,9 +77,9 @@ export default defineComponent({
return {
index,
list,
onSelect,
onSelect
};
},
}
});
</script>

View File

@ -6,7 +6,7 @@
width="500px"
popper-class="popper-menu-tree"
>
<el-input size="small" v-model="keyword">
<el-input v-model="keyword" size="small">
<template #prefix>
<i class="el-input__icon el-icon-search"></i>
</template>
@ -25,11 +25,10 @@
:default-expanded-keys="expandedKeys"
:filter-node-method="filterNode"
@current-change="onCurrentChange"
>
</el-tree>
/>
<template #reference>
<el-input v-model="name" readonly placeholder="请选择"></el-input>
<el-input v-model="name" readonly placeholder="请选择" />
</template>
</el-popover>
</div>
@ -91,7 +90,7 @@ export default defineComponent({
//
const name = computed(() => {
const item = list.value.find(e => e.id == props.modelValue);
const item = list.value.find((e) => e.id == props.modelValue);
return item ? item.name : "一级菜单";
});
@ -103,7 +102,7 @@ export default defineComponent({
treeRef.value.filter(val);
});
onMounted(function() {
onMounted(function () {
refresh();
});

View File

@ -4,19 +4,19 @@
<i class="el-icon-arrow-left"></i>
</div>
<div class="app-process__scroller" :ref="setRefs('scroller')">
<div :ref="setRefs('scroller')" class="app-process__scroller">
<div
class="app-process__item"
v-for="(item, index) in list"
:key="index"
:ref="setRefs(`item-${index}`)"
class="app-process__item"
:class="{ active: item.active }"
:data-index="index"
@click="onTap(item)"
@contextmenu.stop.prevent="openCM($event, item)"
>
<span>{{ item.label }}</span>
<i class="el-icon-close" v-if="index > 0" @mousedown.stop="onDel(index)"></i>
<i v-if="index > 0" class="el-icon-close" @mousedown.stop="onDel(index)"></i>
</div>
</div>
@ -138,7 +138,7 @@ export default {
watch(
() => route.path,
function(val) {
function (val) {
adScroll(list.value.findIndex((e: any) => e.value === val) || 0);
}
);

View File

@ -1,8 +1,8 @@
<template>
<div class="cl-role-perms" v-loading="loading">
<div v-loading="loading" class="cl-role-perms">
<p v-if="title">{{ title }}</p>
<el-input placeholder="输入关键字进行过滤" v-model="keyword" size="small"> </el-input>
<el-input v-model="keyword" placeholder="输入关键字进行过滤" size="small" />
<div class="scroller">
<el-tree
@ -18,8 +18,7 @@
:default-checked-keys="checked"
:filter-node-method="filterNode"
@check-change="save"
>
</el-tree>
/>
</div>
</div>
</template>
@ -40,6 +39,8 @@ export default defineComponent({
title: String
},
emits: ["update:modelValue"],
setup(props, { emit }) {
const $service = inject<any>("service");
@ -68,7 +69,7 @@ export default defineComponent({
//
const fn = (list: any[]) => {
list.forEach(e => {
list.forEach((e) => {
if (e.children) {
fn(e.children);
} else {
@ -79,7 +80,7 @@ export default defineComponent({
fn(list.value);
checked.value = ids.filter(id => (val || []).includes(id));
checked.value = ids.filter((id) => (val || []).includes(id));
}
//

View File

@ -1,11 +1,6 @@
<template>
<el-select v-model="value" v-bind="props" multiple @change="onChange">
<el-option
v-for="(item, index) in list"
:value="item.id"
:label="item.name"
:key="index"
></el-option>
<el-option v-for="(item, index) in list" :key="index" :value="item.id" :label="item.name" />
</el-select>
</template>

View File

@ -1,21 +1,15 @@
<template>
<div class="cl-route-nav">
<p class="title" v-if="browser.isMini">
<p v-if="browser.isMini" class="title">
{{ lastName }}
</p>
<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 && item.meta.label) || item.name
}}</el-breadcrumb-item
>
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item v-for="(item, index) in list" :key="index">{{
(item.meta && item.meta.label) || item.name
}}</el-breadcrumb-item>
</el-breadcrumb>
</template>
</div>
@ -75,7 +69,7 @@ export default defineComponent({
}
},
{
immediate: true,
immediate: true
}
);
@ -87,9 +81,9 @@ export default defineComponent({
return {
list,
lastName,
browser,
browser
};
},
}
});
</script>

View File

@ -1,5 +1,5 @@
<template>
<error-page :code="404" desc="找不到您要查找的页面"></error-page>
<error-page :code="404" desc="找不到您要查找的页面" />
</template>
<script>

View File

@ -1,5 +1,5 @@
<template>
<error-page :code="500" desc="糟糕,出了点问题"></error-page>
<error-page :code="500" desc="糟糕,出了点问题" />
</template>
<script>

View File

@ -1,5 +1,5 @@
<template>
<error-page :code="502" desc="马上回来"></error-page>
<error-page :code="502" desc="马上回来" />
</template>
<script>

View File

@ -5,7 +5,7 @@
<template v-if="token || isLogout">
<div class="router">
<el-select size="medium" filterable prefix-icon="el-icon-search" v-model="url">
<el-select v-model="url" size="medium" filterable prefix-icon="el-icon-search">
<el-option v-for="(item, index) in routes" :key="index" :value="item.path">
<span style="float: left">{{ item.name }}</span>
<span style="float: right">{{ item.path }}</span>

View File

@ -1,5 +1,5 @@
<template>
<div class="page-iframe" v-loading="loading" element-loading-text="拼命加载中">
<div v-loading="loading" class="page-iframe" element-loading-text="拼命加载中">
<iframe :src="url" frameborder="0"></iframe>
</div>
</template>

View File

@ -1,7 +1,7 @@
<template>
<div class="login-captcha" @click="refresh">
<div class="svg" v-html="svg" v-if="svg"></div>
<img class="base64" :src="base64" alt="" v-else />
<div v-if="svg" class="svg" v-html="svg"></div>
<img v-else class="base64" :src="base64" alt="" />
</div>
</template>

View File

@ -7,51 +7,46 @@
<el-form class="form" size="medium" :disabled="saving">
<el-form-item label="用户名">
<el-input
placeholder="请输入用户名"
v-model="form.username"
placeholder="请输入用户名"
maxlength="20"
auto-complete="off"
></el-input>
/>
</el-form-item>
<el-form-item label="密码">
<el-input
v-model="form.password"
type="password"
placeholder="请输入密码"
v-model="form.password"
maxlength="20"
auto-complete="off"
></el-input>
/>
</el-form-item>
<el-form-item label="验证码" class="captcha">
<el-input
v-model="form.verifyCode"
placeholder="请输入图片验证码"
maxlength="4"
v-model="form.verifyCode"
auto-complete="off"
@keyup.enter="toLogin"
></el-input>
/>
<captcha
:ref="setRefs('captcha')"
class="value"
v-model="form.captchaId"
class="value"
@change="
() => {
form.verifyCode = '';
}
"
></captcha>
/>
</el-form-item>
</el-form>
<el-button
round
size="mini"
class="submit-btn"
@click="toLogin"
:loading="saving"
<el-button round size="mini" class="submit-btn" :loading="saving" @click="toLogin"
>登录</el-button
>
</div>
@ -68,13 +63,13 @@ import { useRefs } from "/@/core";
export default defineComponent({
components: {
Captcha,
Captcha
},
setup() {
const router = useRouter();
const store = useStore();
const { refs, setRefs } = useRefs();
const { refs, setRefs }: any = useRefs();
const saving = ref<boolean>(false);
@ -83,7 +78,7 @@ export default defineComponent({
username: "admin",
password: "123456",
captchaId: "",
verifyCode: "",
verifyCode: ""
});
//
@ -130,9 +125,9 @@ export default defineComponent({
form,
saving,
toLogin,
setRefs,
setRefs
};
},
}
});
</script>

View File

@ -17,7 +17,7 @@ const state = {
// 左侧菜单
menu: [],
// 权限列表
permission: storage.get("permission") || [],
permission: storage.get("permission") || []
};
const getters = {
@ -28,7 +28,7 @@ const getters = {
// 视图路由
routes: (state: any) => state.routes,
// 权限列表
permission: (state: any) => state.permission,
permission: (state: any) => state.permission
};
const actions = {
@ -59,9 +59,9 @@ const actions = {
isShow: isEmpty(e.isShow) ? true : e.isShow,
meta: {
label: e.name,
keepAlive: e.keepAlive,
keepAlive: e.keepAlive
},
children: [],
children: []
};
});
@ -97,11 +97,11 @@ const actions = {
});
} else {
next({
menus: revDeepTree(menuList),
menus: revDeepTree(menuList)
});
}
});
},
}
};
const mutations = {
@ -141,12 +141,12 @@ const mutations = {
SET_PERMIESSION(state: any, list: Array<any>) {
state.permission = list;
storage.set("permission", list);
},
}
};
export default {
state,
getters,
actions,
mutations,
mutations
};

View File

@ -25,7 +25,7 @@ const actions = {
// 用户退出
userLogout({ dispatch }: any): Promise<any> {
return new Promise(resolve => {
return new Promise((resolve) => {
store.$service.common.userLogout().done(() => {
dispatch("userRemove").then(() => {
resolve(null);

View File

@ -39,8 +39,5 @@ export function createLink(url: string, id?: string) {
link.id = id;
}
document
.getElementsByTagName("head")
?.item(0)
?.appendChild(link);
document.getElementsByTagName("head")?.item(0)?.appendChild(link);
}

View File

@ -2,31 +2,21 @@
<div class="page-my-info">
<div class="title">基本信息</div>
<el-form
size="small"
label-width="100px"
:model="form"
:disabled="saving"
>
<el-form size="small" label-width="100px" :model="form" :disabled="saving">
<el-form-item label="头像">
<cl-upload v-model="form.headImg"></cl-upload>
<cl-upload v-model="form.headImg" />
</el-form-item>
<el-form-item label="昵称">
<el-input
v-model="form.nickName"
placeholder="请填写昵称"
></el-input>
<el-input v-model="form.nickName" placeholder="请填写昵称" />
</el-form-item>
<el-form-item label="密码">
<el-input type="password" v-model="form.password"></el-input>
<el-input v-model="form.password" type="password" />
</el-form-item>
<el-form-item label="">
<el-button type="primary" @click="save" :disabled="saving"
>保存修改</el-button
>
<el-button type="primary" :disabled="saving" @click="save">保存修改</el-button>
</el-form-item>
</el-form>
</div>
@ -60,7 +50,7 @@ export default defineComponent({
.userUpdate({
headImg,
nickName,
password,
password
})
.then(() => {
form.password = "";
@ -78,9 +68,9 @@ export default defineComponent({
return {
form,
saving,
save,
save
};
},
}
});
</script>

View File

@ -1,7 +1,7 @@
<template>
<cl-crud :ref="setRefs('crud')" @load="onLoad">
<el-row type="flex">
<cl-refresh-btn></cl-refresh-btn>
<cl-refresh-btn />
<el-button
v-permission="$service.system.log.permission.clear"
@ -14,26 +14,26 @@
<cl-filter label="日志保存天数">
<el-input-number
v-model="day"
controls-position="right"
size="mini"
:max="10000"
:min="1"
v-model="day"
@blur="saveDay"
></el-input-number>
/>
</cl-filter>
<cl-flex1 />
<cl-search-key placeholder="请输入请求地址, 参数ip地址"></cl-search-key>
<cl-search-key placeholder="请输入请求地址, 参数ip地址" />
</el-row>
<el-row>
<cl-table v-bind="table"></cl-table>
<cl-table v-bind="table" />
</el-row>
<el-row type="flex">
<cl-flex1></cl-flex1>
<cl-pagination></cl-pagination>
<cl-flex1 />
<cl-pagination />
</el-row>
</cl-crud>
</template>

View File

@ -11,10 +11,10 @@
<template #column-name="{ scope }">
<span>{{ scope.row.name }}</span>
<el-tag
v-if="!scope.row.isShow"
size="mini"
effect="dark"
type="danger"
v-if="!scope.row.isShow"
style="margin-left: 10px"
>隐藏</el-tag
>
@ -22,7 +22,7 @@
<!-- 图标 -->
<template #column-icon="{ scope }">
<icon-svg :name="scope.row.icon" size="16px" style="margin-top: 5px"></icon-svg>
<icon-svg :name="scope.row.icon" size="16px" style="margin-top: 5px" />
</template>
<!-- 权限 -->
@ -39,7 +39,7 @@
<!-- 路由 -->
<template #column-router="{ scope }">
<el-link type="primary" :href="scope.row.router" v-if="scope.row.type == 1">{{
<el-link v-if="scope.row.type == 1" type="primary" :href="scope.row.router">{{
scope.row.router
}}</el-link>
<span v-else>{{ scope.row.router }}</span>
@ -48,18 +48,18 @@
<!-- 路由缓存 -->
<template #column-keepAlive="{ scope }">
<template v-if="scope.row.type == 1">
<i class="el-icon-check" v-if="scope.row.keepAlive"></i>
<i class="el-icon-close" v-else></i>
<i v-if="scope.row.keepAlive" class="el-icon-check"></i>
<i v-else class="el-icon-close"></i>
</template>
</template>
<!-- 行新增 -->
<template #slot-add="{ scope }">
<el-button
v-if="scope.row.type != 2"
type="text"
size="mini"
@click="upsertAppend(scope.row)"
v-if="scope.row.type != 2"
>新增</el-button
>
</template>
@ -67,12 +67,12 @@
</el-row>
<el-row type="flex">
<cl-flex1></cl-flex1>
<cl-pagination :props="{ layout: 'total' }"></cl-pagination>
<cl-flex1 />
<cl-pagination :props="{ layout: 'total' }" />
</el-row>
<!-- 编辑 -->
<cl-upsert v-bind="upsert"></cl-upsert>
<cl-upsert v-bind="upsert" />
</cl-crud>
</template>
@ -100,7 +100,7 @@ export default defineComponent({
//
function onRefresh(_: any, { render }: RefreshOp) {
$service.system.menu.list().then((list: any[]) => {
list.map(e => {
list.map((e) => {
e.permList = e.perms ? e.perms.split(",") : [];
});

View File

@ -1,35 +1,31 @@
<template>
<cl-crud @load="onLoad">
<el-row type="flex">
<cl-refresh-btn></cl-refresh-btn>
<cl-add-btn></cl-add-btn>
<cl-multi-delete-btn></cl-multi-delete-btn>
<cl-flex1></cl-flex1>
<cl-search-key></cl-search-key>
<cl-refresh-btn />
<cl-add-btn />
<cl-multi-delete-btn />
<cl-flex1 />
<cl-search-key />
</el-row>
<el-row>
<cl-table v-bind="table"></cl-table>
<cl-table v-bind="table" />
</el-row>
<el-row type="flex">
<cl-flex1></cl-flex1>
<cl-pagination></cl-pagination>
<cl-flex1 />
<cl-pagination />
</el-row>
<cl-upsert :ref="setRefs('upsert')" v-bind="upsert" @open="onUpsertOpen">
<template #slot-content="{ scope }">
<div class="editor" v-for="(item, index) in tab.list" :key="index">
<div v-for="(item, index) in tab.list" :key="index" class="editor">
<template v-if="tab.index == index">
<el-button class="change-btn" size="mini" @click="changeTab(item.to)">{{
item.label
}}</el-button>
<component
:is="item.component"
height="300px"
v-model="scope.data"
></component>
<component :is="item.component" v-model="scope.data" height="300px" />
</template>
</div>
</template>

View File

@ -18,15 +18,15 @@
size="mini"
:disabled="!perms.enable"
@change="onEnableChange($event, scope.row)"
></el-switch>
/>
</template>
<!-- 配置按钮 -->
<template #slot-conf="{ scope }">
<el-button
v-if="scope.row.view && perms.edit"
type="text"
size="mini"
v-if="scope.row.view && perms.edit"
@click="openConf(scope.row)"
>配置</el-button
>
@ -42,7 +42,7 @@
</cl-crud>
<!-- 表单 -->
<cl-form :ref="setRefs('form')"></cl-form>
<cl-form :ref="setRefs('form')" />
</div>
</template>
@ -65,9 +65,9 @@ export default defineComponent({
const perms = reactive<any>({
edit: checkPerm({
and: [config, getConfig],
and: [config, getConfig]
}),
enable: checkPerm(enable),
enable: checkPerm(enable)
});
// crud
@ -75,8 +75,8 @@ export default defineComponent({
ctx.service($service.plugin.info)
.set("dict", {
api: {
page: "list",
},
page: "list"
}
})
.done();
app.refresh();
@ -91,7 +91,7 @@ export default defineComponent({
});
render(list, {
total: res.length,
total: res.length
});
});
}
@ -101,7 +101,7 @@ export default defineComponent({
$service.plugin.info
.enable({
namespace: item.namespace,
enable: val,
enable: val
})
.then(() => {
ElMessage.success(val ? "开启成功" : "关闭成功");
@ -114,7 +114,7 @@ export default defineComponent({
//
async function openConf({ name, namespace, view }: any) {
const form = await $service.plugin.info.getConfig({
namespace,
namespace
});
let items = [];
@ -134,7 +134,7 @@ export default defineComponent({
$service.plugin.info
.config({
namespace,
config: data,
config: data
})
.then(() => {
ElMessage.success("保存成功");
@ -144,8 +144,8 @@ export default defineComponent({
ElMessage.error(err);
done();
});
},
},
}
}
});
}
@ -154,8 +154,8 @@ export default defineComponent({
props: {
"default-sort": {
prop: "createTime",
order: "descending",
},
order: "descending"
}
},
"context-menu": [
"refresh",
@ -166,47 +166,47 @@ export default defineComponent({
callback: (_: any, done: Function) => {
openConf(scope);
done();
},
}
};
},
}
],
columns: [
{
label: "名称",
prop: "name",
minWidth: 140,
minWidth: 140
},
{
label: "作者",
prop: "author",
minWidth: 120,
minWidth: 120
},
{
label: "联系方式",
prop: "contact",
showOverflowTooltip: true,
minWidth: 180,
minWidth: 180
},
{
label: "功能描述",
prop: "description",
showOverflowTooltip: true,
minWidth: 150,
minWidth: 150
},
{
label: "版本号",
prop: "version",
minWidth: 110,
minWidth: 110
},
{
label: "是否启用",
prop: "enable",
minWidth: 110,
minWidth: 110
},
{
label: "命名空间",
prop: "namespace",
minWidth: 110,
minWidth: 110
},
{
label: "状态",
@ -216,37 +216,37 @@ export default defineComponent({
{
label: "缺少配置",
value: 0,
type: "warning",
type: "warning"
},
{
label: "可用",
value: 1,
type: "success",
type: "success"
},
{
label: "配置错误",
value: 2,
type: "danger",
type: "danger"
},
{
label: "未知错误",
value: 3,
type: "danger",
},
],
type: "danger"
}
]
},
{
label: "创建时间",
prop: "createTime",
width: 150,
sortable: "custom",
sortable: "custom"
},
{
type: "op",
width: 120,
buttons: ["slot-conf"],
},
],
buttons: ["slot-conf"]
}
]
});
return {
@ -257,8 +257,8 @@ export default defineComponent({
onLoad,
onRefresh,
onEnableChange,
openConf,
openConf
};
},
}
});
</script>

View File

@ -9,7 +9,7 @@
</el-row>
<el-row>
<cl-table v-bind="table"> </cl-table>
<cl-table v-bind="table" />
</el-row>
<el-row type="flex">
@ -17,7 +17,7 @@
<cl-pagination />
</el-row>
<cl-upsert v-model="form" v-bind="upsert"></cl-upsert>
<cl-upsert v-model="form" v-bind="upsert" />
</cl-crud>
</template>

View File

@ -7,7 +7,7 @@
@row-click="onDeptRowClick"
@user-add="onDeptUserAdd"
@list-change="onDeptListChange"
></cl-dept-tree>
/>
</div>
<!-- 成员列表 -->
@ -22,27 +22,21 @@
</div>
<div class="container">
<cl-crud
:ref="setRefs('crud')"
:on-refresh="onRefresh"
@load="onLoad"
>
<cl-crud :ref="setRefs('crud')" :on-refresh="onRefresh" @load="onLoad">
<el-row type="flex">
<cl-refresh-btn></cl-refresh-btn>
<cl-add-btn></cl-add-btn>
<cl-multi-delete-btn></cl-multi-delete-btn>
<cl-refresh-btn />
<cl-add-btn />
<cl-multi-delete-btn />
<el-button
v-permission="
$service.system.user.permission.move
"
v-permission="$service.system.user.permission.move"
size="mini"
type="success"
:disabled="selects.ids.length == 0"
@click="toMove()"
>转移</el-button
>
<cl-flex1></cl-flex1>
<cl-search-key></cl-search-key>
<cl-flex1 />
<cl-search-key />
</el-row>
<el-row>
@ -58,15 +52,13 @@
size="medium"
:src="scope.row.headImg"
:style="{ margin: 'auto' }"
>
</cl-avatar>
/>
</template>
<!-- 权限 -->
<template #column-roleName="{ scope }">
<el-tag
v-for="(item, index) in scope.row
.roleNameList"
v-for="(item, index) in scope.row.roleNameList"
:key="index"
disable-transitions
size="small"
@ -79,9 +71,7 @@
<!-- 单个转移 -->
<template #slot-move-btn="{ scope }">
<el-button
v-permission="
$service.system.user.permission.move
"
v-permission="$service.system.user.permission.move"
type="text"
size="mini"
@click="toMove(scope.row)"
@ -92,8 +82,8 @@
</el-row>
<el-row type="flex">
<cl-flex1></cl-flex1>
<cl-pagination></cl-pagination>
<cl-flex1 />
<cl-pagination />
</el-row>
<cl-upsert
@ -104,9 +94,7 @@
<template #slot-tips>
<div>
<i class="el-icon-warning"></i>
<span style="margin-left: 6px"
>新增用户默认密码为123456</span
>
<span style="margin-left: 6px">新增用户默认密码为123456</span>
</div>
</template>
</cl-upsert>
@ -116,10 +104,7 @@
</div>
<!-- 部门移动 -->
<cl-dept-move
:ref="setRefs('dept-move')"
@success="refresh({ page: 1 })"
></cl-dept-move>
<cl-dept-move :ref="setRefs('dept-move')" @success="refresh({ page: 1 })" />
</div>
</template>
@ -143,7 +128,7 @@ export default defineComponent({
//
const selects = reactive<any>({
dept: {},
ids: [],
ids: []
});
//
@ -154,53 +139,53 @@ export default defineComponent({
props: {
"default-sort": {
prop: "createTime",
order: "descending",
},
order: "descending"
}
},
columns: [
{
type: "selection",
width: 60,
width: 60
},
{
prop: "headImg",
label: "头像",
label: "头像"
},
{
prop: "name",
label: "姓名",
minWidth: 150,
minWidth: 150
},
{
prop: "username",
label: "用户名",
minWidth: 150,
minWidth: 150
},
{
prop: "nickName",
label: "昵称",
minWidth: 150,
minWidth: 150
},
{
prop: "departmentName",
label: "部门名称",
minWidth: 150,
minWidth: 150
},
{
prop: "roleName",
label: "角色",
headerAlign: "center",
minWidth: 200,
minWidth: 200
},
{
prop: "phone",
label: "手机号码",
minWidth: 150,
minWidth: 150
},
{
prop: "remark",
label: "备注",
minWidth: 150,
minWidth: 150
},
{
prop: "status",
@ -210,27 +195,27 @@ export default defineComponent({
{
label: "启用",
value: 1,
type: "success",
type: "success"
},
{
label: "禁用",
value: 0,
type: "danger",
},
],
type: "danger"
}
]
},
{
prop: "createTime",
label: "创建时间",
sortable: "custom",
minWidth: 150,
minWidth: 150
},
{
type: "op",
buttons: ["slot-move-btn", "edit", "delete"],
width: 160,
},
],
width: 160
}
]
});
//
@ -244,9 +229,9 @@ export default defineComponent({
name: "cl-upload",
props: {
text: "选择头像",
icon: "el-icon-picture",
},
},
icon: "el-icon-picture"
}
}
},
{
prop: "name",
@ -255,13 +240,13 @@ export default defineComponent({
component: {
name: "el-input",
props: {
placeholder: "请填写姓名",
},
placeholder: "请填写姓名"
}
},
rules: {
required: true,
message: "姓名不能为空",
},
message: "姓名不能为空"
}
},
{
prop: "nickName",
@ -270,13 +255,13 @@ export default defineComponent({
component: {
name: "el-input",
props: {
placeholder: "请填写昵称",
},
placeholder: "请填写昵称"
}
},
rules: {
required: true,
message: "昵称不能为空",
},
message: "昵称不能为空"
}
},
{
prop: "username",
@ -285,15 +270,15 @@ export default defineComponent({
component: {
name: "el-input",
props: {
placeholder: "请填写用户名",
},
placeholder: "请填写用户名"
}
},
rules: [
{
required: true,
message: "用户名不能为空",
},
],
message: "用户名不能为空"
}
]
},
{
prop: "password",
@ -304,16 +289,16 @@ export default defineComponent({
name: "el-input",
props: {
placeholder: "请填写密码",
type: "password",
},
type: "password"
}
},
rules: [
{
min: 6,
max: 16,
message: "密码长度在 6 到 16 个字符",
},
],
message: "密码长度在 6 到 16 个字符"
}
]
},
{
prop: "roleIdList",
@ -324,14 +309,14 @@ export default defineComponent({
name: "cl-role-select",
props: {
props: {
"multiple-limit": 3,
},
},
"multiple-limit": 3
}
}
},
rules: {
required: true,
message: "角色不能为空",
},
message: "角色不能为空"
}
},
{
prop: "phone",
@ -340,9 +325,9 @@ export default defineComponent({
component: {
name: "el-input",
props: {
placeholder: "请填写手机号码",
},
},
placeholder: "请填写手机号码"
}
}
},
{
prop: "email",
@ -351,9 +336,9 @@ export default defineComponent({
component: {
name: "el-input",
props: {
placeholder: "请填写邮箱",
},
},
placeholder: "请填写邮箱"
}
}
},
{
prop: "remark",
@ -364,9 +349,9 @@ export default defineComponent({
props: {
placeholder: "请填写备注",
type: "textarea",
rows: 4,
},
},
rows: 4
}
}
},
{
prop: "status",
@ -377,23 +362,23 @@ export default defineComponent({
options: [
{
label: "开启",
value: 1,
value: 1
},
{
label: "关闭",
value: 0,
},
],
},
value: 0
}
]
}
},
{
prop: "tips",
hidden: ":isEdit",
component: {
name: "slot-tips",
},
},
],
name: "slot-tips"
}
}
]
});
//
@ -406,7 +391,7 @@ export default defineComponent({
isExpand.value = !val;
},
{
immediate: true,
immediate: true
}
);
@ -450,7 +435,7 @@ export default defineComponent({
next({
...data,
departmentId,
departmentId
});
}
@ -465,7 +450,7 @@ export default defineComponent({
refresh({
page: 1,
departmentIds: ids,
departmentIds: ids
});
//
@ -477,7 +462,7 @@ export default defineComponent({
//
function onDeptUserAdd(item: any) {
refs.value.crud.rowAppend({
departmentId: item.id,
departmentId: item.id
});
}
@ -522,9 +507,9 @@ export default defineComponent({
onDeptUserAdd,
onDeptListChange,
deptExpand,
toMove,
toMove
};
},
}
});
</script>

View File

@ -31,8 +31,8 @@
<template #slot-session>
<button v-if="session">
<i class="el-icon-notebook-2" v-if="sessionVisible" @click="closeSession()"></i>
<i class="el-icon-arrow-left" v-else @click="openSession()"></i>
<i v-if="sessionVisible" class="el-icon-notebook-2" @click="closeSession()"></i>
<i v-else class="el-icon-arrow-left" @click="openSession()"></i>
</button>
</template>
</cl-dialog>
@ -40,8 +40,8 @@
<!-- MP3 -->
<div class="mp3">
<audio
style="display: none"
:ref="setRefs('sound')"
style="display: none"
src="../static/notify.mp3"
controls
></audio>
@ -82,6 +82,8 @@ export default defineComponent({
}
},
emits: ["message"],
setup(_, { emit }) {
const store = useStore();
const { refs, setRefs } = useRefs();
@ -223,7 +225,7 @@ export default defineComponent({
}
// socket
(function() {
(function () {
// socket = io(`${socketUrl}?isAdmin=true&token=${store.getters.token}`);
// socket.on("connect", () => {
// console.log("socket connect");
@ -246,7 +248,7 @@ export default defineComponent({
});
//
onUnmounted(function() {
onUnmounted(function () {
if (socket) {
socket.close();
}

View File

@ -10,9 +10,9 @@
<div class="tool-emoji">
<div class="tool-emoji__scroller scroller1">
<div
class="tool-emoji__item"
v-for="(item, index) in list"
:key="index"
class="tool-emoji__item"
@click="select(item)"
>
<img :src="item" />
@ -127,6 +127,8 @@ const emoji = {
};
export default defineComponent({
emits: ["select"],
setup(_, { emit }) {
const store = useStore();
@ -134,7 +136,7 @@ export default defineComponent({
const visible = ref<boolean>(false);
//
const list = ref<any[]>(emoji.list.map(e => emoji.url + e));
const list = ref<any[]>(emoji.list.map((e) => emoji.url + e));
//
const popoverWidth = computed(() => {

View File

@ -1,6 +1,6 @@
<template>
<div class="icon-voice">
<icon-svg :name="`voice${index}`"></icon-svg>
<icon-svg :name="`voice${index}`" />
</div>
</template>

View File

@ -59,13 +59,9 @@
resize="none"
:rows="5"
@keyup.enter="onTextSend"
></el-input>
/>
<el-button
type="primary"
size="mini"
:disabled="!text"
@click="onTextSend"
<el-button type="primary" size="mini" :disabled="!text" @click="onTextSend"
>发送</el-button
>
</div>
@ -79,7 +75,7 @@ import Emoji from "./emoji.vue";
export default defineComponent({
components: {
Emoji,
Emoji
},
setup() {
@ -92,7 +88,7 @@ export default defineComponent({
//
const emoji = reactive<any>({
visible: false,
visible: false
});
//
@ -116,7 +112,7 @@ export default defineComponent({
contentType: data.contentType,
type: 0,
content: data.content,
sessionId: id,
sessionId: id
});
}
@ -131,14 +127,14 @@ export default defineComponent({
function next(options = {}) {
const data = {
content: {
[`${key}Url`]: "",
[`${key}Url`]: ""
},
type: 0,
uid: file.uid,
loading: true,
progress: "0%",
contentType: chat.modes.indexOf(key),
...options,
...options
};
append(data);
@ -163,12 +159,12 @@ export default defineComponent({
next({
content: {
imageUrl,
imageUrl
},
style: {
height: height + "px",
width: width + "px",
},
width: width + "px"
}
});
};
@ -186,8 +182,8 @@ export default defineComponent({
store.commit("UPDATE_MESSAGE", {
file,
data: {
progress: e.percent + "%",
},
progress: e.percent + "%"
}
});
}
@ -198,10 +194,10 @@ export default defineComponent({
data: {
loading: false,
content: {
[`${key}Url`]: res.data,
},
[`${key}Url`]: res.data
}
},
callback: send,
callback: send
});
}
@ -213,8 +209,8 @@ export default defineComponent({
type: 0,
contentType: 0,
content: {
text: text.value,
},
text: text.value
}
};
send(data, true);
@ -231,10 +227,10 @@ export default defineComponent({
send(
{
content: {
imageUrl: res.data,
imageUrl: res.data
},
type: 0,
contentType: 1,
contentType: 1
},
true
);
@ -246,10 +242,10 @@ export default defineComponent({
send(
{
content: {
imageUrl: url,
imageUrl: url
},
type: 0,
contentType: 2,
contentType: 2
},
true
);
@ -260,10 +256,10 @@ export default defineComponent({
send(
{
content: {
videoUrl: url,
videoUrl: url
},
type: 0,
contentType: 4,
contentType: 4
},
true
);
@ -279,9 +275,9 @@ export default defineComponent({
onTextSend,
onImageSelect,
onEmojiSelect,
onVideoSelect,
onVideoSelect
};
},
}
});
</script>

View File

@ -1,23 +1,15 @@
<template>
<div
class="cl-chat-message"
v-loading="!visible && loading"
element-loading-text="消息加载中"
>
<div v-loading="!visible && loading" class="cl-chat-message" element-loading-text="消息加载中">
<div
class="cl-chat-message__scroller scroller1"
:ref="setRefs('scroller')"
class="cl-chat-message__scroller scroller1"
:style="{
opacity: visible ? 1 : 0,
opacity: visible ? 1 : 0
}"
>
<!-- 加载更多 -->
<div class="cl-chat-message__more" v-show="list.length > 0">
<el-button
round
size="mini"
:loading="loading"
@click="onLoadmore"
<div v-show="list.length > 0" class="cl-chat-message__more">
<el-button round size="mini" :loading="loading" @click="onLoadmore"
>加载更多</el-button
>
</div>
@ -25,16 +17,13 @@
<!-- 消息列表 -->
<div class="cl-chat-message__list">
<div
class="cl-chat-message__item"
v-for="item in list"
:key="item.id || item.uid"
:class="[
item.type == 0 ? `is-right` : `is-left`,
`is-${item.mode}`,
]"
class="cl-chat-message__item"
:class="[item.type == 0 ? `is-right` : `is-left`, `is-${item.mode}`]"
>
<!-- 日期 -->
<div class="date" v-if="item._date">
<div v-if="item._date" class="date">
<span>{{ item._date }}</span>
</div>
@ -50,8 +39,8 @@
<span class="name">{{ item.nickName }}</span>
<div
class="content"
v-loading="item.loading"
class="content"
:element-loading-text="item.progress"
@click="onTap(item)"
>
@ -65,9 +54,7 @@
<el-image
:key="item.uid"
:src="item.content.imageUrl"
:preview-src-list="[
item.content.imageUrl,
]"
:preview-src-list="[item.content.imageUrl]"
:z-index="3000"
:style="item.style"
>
@ -88,12 +75,8 @@
<!-- 语音 -->
<template v-else-if="item.mode === 'voice'">
<icon-voice
:play="item.isPlay"
></icon-voice>
<span class="duration"
>{{ item.content.duration }}"</span
>
<icon-voice :play="item.isPlay" />
<span class="duration">{{ item.content.duration }}"</span>
</template>
<!-- 视频 -->
@ -119,12 +102,7 @@
<!-- 音频 -->
<div class="voice">
<audio
style="display: none"
ref="voice"
:src="voice.url"
controls
></audio>
<audio ref="voice" style="display: none" :src="voice.url" controls></audio>
</div>
</div>
</div>
@ -132,15 +110,7 @@
</template>
<script lang="ts">
import {
computed,
defineComponent,
inject,
nextTick,
onUnmounted,
reactive,
ref,
} from "vue";
import { computed, defineComponent, inject, nextTick, onUnmounted, reactive, ref } from "vue";
import dayjs from "dayjs";
import { ElMessage } from "element-plus";
import { useStore } from "vuex";
@ -152,7 +122,7 @@ import AvatarUrl from "../static/images/custom-avatar.png";
export default defineComponent({
components: {
IconVoice,
IconVoice
},
setup() {
@ -175,13 +145,13 @@ export default defineComponent({
const pagination = reactive<any>({
page: 1,
size: 20,
total: 0,
total: 0
});
//
const voice = reactive<any>({
url: "",
timer: null,
timer: null
});
//
@ -210,19 +180,14 @@ export default defineComponent({
}
//
const content = isString(e.content)
? JSON.parse(e.content)
: e.content;
const content = isString(e.content) ? JSON.parse(e.content) : e.content;
//
const nickName =
e.type == 0 ? userInfo.nickName : session.value.nickname;
const nickName = e.type == 0 ? userInfo.nickName : session.value.nickname;
//
const avatarUrl =
e.type == 0
? userInfo.avatarUrl || AvatarUrl
: session.value.headimgurl;
e.type == 0 ? userInfo.avatarUrl || AvatarUrl : session.value.headimgurl;
return {
...e,
@ -230,7 +195,7 @@ export default defineComponent({
content,
avatarUrl,
nickName,
mode: chat.modes[e.contentType],
mode: chat.modes[e.contentType]
};
});
});
@ -270,7 +235,7 @@ export default defineComponent({
if (refs.value.scroller) {
refs.value.scroller.scrollTo({
top: 99999,
behavior: visible.value ? "smooth" : "auto",
behavior: visible.value ? "smooth" : "auto"
});
}
});
@ -287,7 +252,7 @@ export default defineComponent({
...params,
sessionId: session.value.id,
order: "createTime",
sort: "desc",
sort: "desc"
};
//
@ -371,9 +336,9 @@ export default defineComponent({
onTap,
refresh,
onLoadmore,
scrollToBottom,
scrollToBottom
};
},
}
});
</script>

View File

@ -5,7 +5,7 @@
</el-badge>
<!-- 聊天盒子 -->
<cl-chat ref="chat" @message="updateNum"></cl-chat>
<cl-chat ref="chat" @message="updateNum" />
</div>
</template>
@ -16,7 +16,7 @@ export default {
data() {
return {
visible: false,
number: 0,
number: 0
};
},
@ -38,8 +38,8 @@ export default {
openChatBox() {
this.$refs["chat"].open();
this.number = 0;
},
},
}
}
};
</script>

View File

@ -16,15 +16,15 @@
clearable
@clear="onSearch"
@keyup.enter="onSearch"
></el-input>
/>
</div>
<!-- 会话列表 -->
<ul class="cl-chat-session__list scroller1" v-loading="loading">
<ul v-loading="loading" class="cl-chat-session__list scroller1">
<li
class="cl-chat-session__item"
v-for="(item, index) in list"
:key="index"
class="cl-chat-session__item"
:class="{
'is-active': session ? item.id == session.id : false
}"
@ -194,7 +194,7 @@ export default defineComponent({
mitt.on("session.refresh", refresh);
//
onUnmounted(function() {
onUnmounted(function () {
mitt.off("session.refresh", refresh);
});

View File

@ -4,12 +4,12 @@ import Clipboard from "clipboard";
function copyboard() {
const clipboard = new Clipboard("._copy-btn");
clipboard.on("success", e => {
clipboard.on("success", (e) => {
ElMessage.success("复制成功");
e.clearSelection();
});
clipboard.on("error", err => {
clipboard.on("error", (err) => {
console.error(err);
ElMessage.success("复制失败");
});

View File

@ -1,7 +1,7 @@
<template>
<div class="demo-adv-search">
<cl-adv-btn></cl-adv-btn>
<cl-adv-search :items="items" :op-list="opList"></cl-adv-search>
<cl-adv-btn />
<cl-adv-search :items="items" :op-list="opList" />
</div>
</template>
@ -10,8 +10,6 @@ import { AdvSearchItem } from "/@/crud/types";
import { defineComponent, ref } from "vue";
export default defineComponent({
name: "demo-adv-search",
setup() {
const items = ref<AdvSearchItem[]>([
{

View File

@ -10,8 +10,6 @@ import { ElMessage } from "element-plus";
import { defineComponent } from "vue";
export default defineComponent({
name: "demo__context-menu",
setup() {
function open(event: any) {
ContextMenu.open(event, {

View File

@ -9,7 +9,7 @@
@opened="onOpened"
@closed="onClosed"
>
<el-alert type="success" title="行云又被风吹散,见了依前是梦中"> </el-alert>
<el-alert type="success" title="行云又被风吹散,见了依前是梦中" />
</cl-dialog>
</div>
</template>
@ -18,8 +18,6 @@
import { defineComponent, ref } from "vue";
export default defineComponent({
name: "demo__dialog",
setup() {
const visible = ref<boolean>(false);

View File

@ -27,7 +27,7 @@
prop: 'createTime'
}
]"
></cl-table>
/>
</cl-crud>
</template>
@ -39,7 +39,7 @@
:prop="'vads.' + index + '.val'"
:rules="{ required: true, message: '请输入' }"
>
<el-input v-model="item.val"></el-input>
<el-input v-model="item.val" />
</el-form-item>
<el-button @click="addVad(scope.vads)">添加行</el-button>
@ -55,8 +55,6 @@ import { TestService } from "../../utils/service";
import { CrudLoad, FormItem, FormRef } from "/@/crud/types";
export default defineComponent({
name: "demo-form",
setup() {
const formRef = ref<FormRef>();

View File

@ -1,5 +1,5 @@
<template>
<cl-query field="status" :list="list"></cl-query>
<cl-query field="status" :list="list" />
</template>
<script lang="ts">
@ -7,8 +7,6 @@ import { QueryList } from "/@/crud/types";
import { defineComponent, ref } from "vue";
export default defineComponent({
name: "demo__query",
setup() {
const list = ref<QueryList[]>([
{

View File

@ -1,6 +1,6 @@
<template>
<div class="demo-table">
<cl-table :columns="columns"></cl-table>
<cl-table :columns="columns" />
</div>
</template>
@ -9,8 +9,6 @@ import { TableColumn } from "/@/crud/types";
import { defineComponent, ref } from "vue";
export default defineComponent({
name: "demo-table",
setup() {
const columns = ref<TableColumn[]>([
{

View File

@ -6,8 +6,6 @@
import { defineComponent, ref } from "vue";
export default defineComponent({
name: "render-test",
setup() {
const value = ref<string>("Value" + Math.random());

View File

@ -1,6 +1,6 @@
<template>
<div class="demo-upsert">
<cl-upsert ref="upsertRef" :items="items"></cl-upsert>
<cl-upsert ref="upsertRef" :items="items" />
</div>
</template>
@ -9,8 +9,6 @@ import { UpsertItem, UpsertRef } from "/@/crud/types";
import { defineComponent, ref } from "vue";
export default defineComponent({
name: "demo-upsert",
setup() {
const upsertRef = ref<UpsertRef>();

View File

@ -5,8 +5,8 @@
svg图片库
</div>
<div class="c _svg">
<el-tooltip content="icon-like" v-for="(item, index) in list" :key="index">
<icon-svg :size="18" :name="`icon-${item}`"></icon-svg>
<el-tooltip v-for="(item, index) in list" :key="index" content="icon-like">
<icon-svg :size="18" :name="`icon-${item}`" />
</el-tooltip>
</div>
<div class="f">

View File

@ -6,7 +6,7 @@
</div>
<div class="c">
<el-button size="small" v-copy="'https://www.cool-admin.com/'">
<el-button v-copy="'https://www.cool-admin.com/'" size="small">
https://www.cool-admin.com
</el-button>
</div>

View File

@ -75,8 +75,8 @@ export const TestService = {
},
info: (d: any) => {
console.log("GET[info]", d);
return new Promise(resolve => {
resolve(UserList.find(e => e.id == d.id));
return new Promise((resolve) => {
resolve(UserList.find((e) => e.id == d.id));
});
},
add: (d: any) => {
@ -92,14 +92,14 @@ export const TestService = {
console.log("POST[delete]", d);
const ids = d.ids.split(",");
ids.forEach((id: any) => {
const index = UserList.findIndex(e => e.id == id);
const index = UserList.findIndex((e) => e.id == id);
UserList.splice(index, 1);
});
return Promise.resolve();
},
update: (d: any) => {
console.log("POST[update]", d);
const item = UserList.find(e => e.id == d.id);
const item = UserList.find((e) => e.id == d.id);
Object.assign(item, d);
return Promise.resolve();
}

View File

@ -2,28 +2,28 @@
<div class="demo">
<cl-crud @load="onLoad">
<el-row>
<cl-refresh-btn></cl-refresh-btn>
<cl-add-btn></cl-add-btn>
<cl-multi-delete-btn></cl-multi-delete-btn>
<demo-dialog></demo-dialog>
<demo-context-menu></demo-context-menu>
<demo-form></demo-form>
<demo-query></demo-query>
<cl-flex1></cl-flex1>
<cl-search-key field="name"></cl-search-key>
<demo-adv-search></demo-adv-search>
<cl-refresh-btn />
<cl-add-btn />
<cl-multi-delete-btn />
<demo-dialog />
<demo-context-menu />
<demo-form />
<demo-query />
<cl-flex1 />
<cl-search-key field="name" />
<demo-adv-search />
</el-row>
<el-row>
<demo-table></demo-table>
<demo-table />
</el-row>
<el-row>
<cl-flex1></cl-flex1>
<cl-pagination></cl-pagination>
<cl-flex1 />
<cl-pagination />
</el-row>
<demo-upsert></demo-upsert>
<demo-upsert />
</cl-crud>
</div>
</template>
@ -50,7 +50,7 @@ export default defineComponent({
"demo-adv-search": AdvSearch,
"demo-table": Table,
"demo-upsert": Upsert,
"demo-form": Form,
"demo-form": Form
},
setup() {
@ -60,9 +60,9 @@ export default defineComponent({
}
return {
onLoad,
onLoad
};
},
}
});
</script>

View File

@ -1,15 +1,8 @@
<template>
<div class="demo scroller1">
<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"></component>
<el-col v-for="(item, index) in list" :key="index" :xs="24" :sm="12" :md="8" :lg="6">
<component :is="item" />
</el-col>
</el-row>
</div>
@ -34,7 +27,7 @@ export default {
BClCrud,
BClContextMenu,
BErrorPage,
BClEditorQuill,
BClEditorQuill
},
setup() {
@ -46,10 +39,10 @@ export default {
"b-v-copy",
"b-cl-context-menu",
"b-error-page",
"b-cl-editor-quill",
],
"b-cl-editor-quill"
]
};
},
}
};
</script>

View File

@ -1,6 +1,6 @@
<template>
<div class="page-editor-quill">
<cl-editor-quill v-model="content" :height="400"></cl-editor-quill>
<cl-editor-quill v-model="content" :height="400" />
</div>
</template>

View File

@ -2,7 +2,7 @@
<div class="demo-upload scroller1">
<div class="demo-upload__item">
<p>文件空间</p>
<cl-upload-space v-model="urls"></cl-upload-space>
<cl-upload-space v-model="urls" />
<p style="margin-top: 10px">选择的文件</p>
@ -11,33 +11,33 @@
:key="index"
:src="item"
:style="{ width: '100px', marginRight: '10px' }"
></el-image>
/>
</div>
<div class="demo-upload__item">
<p>普通上传</p>
<cl-upload></cl-upload>
<cl-upload />
</div>
<div class="demo-upload__item">
<p>指定类型上传 accept=.jpg,.png</p>
<cl-upload accept=".jpg,.png"></cl-upload>
<cl-upload accept=".jpg,.png" />
</div>
<div class="demo-upload__item">
<p>多图上传 picture-card</p>
<cl-upload multiple :limit="3" listType="picture-card"></cl-upload>
<cl-upload multiple :limit="3" list-type="picture-card" />
</div>
<div class="demo-upload__item">
<p>文件上传 text</p>
<cl-upload v-model="urls" multiple :limit="5" accept="*" list-type="text"></cl-upload>
<cl-upload v-model="urls" multiple :limit="5" accept="*" list-type="text" />
</div>
<div class="demo-upload__item">
<p>自定义</p>
<cl-upload icon="el-icon-picture" text="选择图片" :size="[120, 200]"></cl-upload>
<cl-upload icon="el-icon-picture" text="选择图片" :size="[120, 200]" />
</div>
<div class="demo-upload__item">

View File

@ -34,7 +34,7 @@ export default {
nearestWeekday: ["最近的工作日(周一至周五)至本月", "日"],
someWeekday: ["在这个月的第", "个"]
},
Week: ["天", "一", "二", "三", "四", "五", "六"].map(val => "星期" + val),
Week: ["天", "一", "二", "三", "四", "五", "六"].map((val) => "星期" + val),
Month: {
name: "月",
every: "每一月",

View File

@ -2,9 +2,7 @@
<div class="vue-cron">
<el-tabs type="border-card">
<el-tab-pane>
<template #label>
<i class="el-icon-date"></i> {{ text.Seconds.name }}
</template>
<template #label> <i class="el-icon-date"></i> {{ text.Seconds.name }} </template>
<div class="vue-cron__item">
<el-row>
<el-radio v-model="second.cronEvery" label="1">{{
@ -15,38 +13,28 @@
<el-radio v-model="second.cronEvery" label="2"
>{{ text.Seconds.interval[0] }}
<el-input-number
size="small"
v-model="second.incrementIncrement"
size="small"
:min="1"
:max="60"
></el-input-number>
/>
{{ text.Seconds.interval[1] || "" }}
<el-input-number
size="small"
v-model="second.incrementStart"
size="small"
:min="0"
:max="59"
></el-input-number>
/>
{{ text.Seconds.interval[2] || "" }}
</el-radio>
</el-row>
<el-row>
<el-radio
class="long"
v-model="second.cronEvery"
label="3"
<el-radio v-model="second.cronEvery" class="long" label="3"
>{{ text.Seconds.specific }}
<el-select
size="small"
multiple
v-model="second.specificSpecific"
>
<el-option
v-for="val in 60"
:key="val"
:value="val - 1"
>{{ val - 1 }}</el-option
>
<el-select v-model="second.specificSpecific" size="small" multiple>
<el-option v-for="val in 60" :key="val" :value="val - 1">{{
val - 1
}}</el-option>
</el-select>
</el-radio>
</el-row>
@ -54,18 +42,18 @@
<el-radio v-model="second.cronEvery" label="4"
>{{ text.Seconds.cycle[0] }}
<el-input-number
size="small"
v-model="second.rangeStart"
size="small"
:min="1"
:max="60"
></el-input-number>
/>
{{ text.Seconds.cycle[1] || "" }}
<el-input-number
size="small"
v-model="second.rangeEnd"
size="small"
:min="0"
:max="59"
></el-input-number>
/>
{{ text.Seconds.cycle[2] || "" }}
</el-radio>
</el-row>
@ -86,38 +74,28 @@
<el-radio v-model="minute.cronEvery" label="2"
>{{ text.Minutes.interval[0] }}
<el-input-number
size="small"
v-model="minute.incrementIncrement"
size="small"
:min="1"
:max="60"
></el-input-number>
/>
{{ text.Minutes.interval[1] }}
<el-input-number
size="small"
v-model="minute.incrementStart"
size="small"
:min="0"
:max="59"
></el-input-number>
/>
{{ text.Minutes.interval[2] || "" }}
</el-radio>
</el-row>
<el-row>
<el-radio
class="long"
v-model="minute.cronEvery"
label="3"
<el-radio v-model="minute.cronEvery" class="long" label="3"
>{{ text.Minutes.specific }}
<el-select
size="small"
multiple
v-model="minute.specificSpecific"
>
<el-option
v-for="val in 60"
:key="val"
:value="val - 1"
>{{ val - 1 }}</el-option
>
<el-select v-model="minute.specificSpecific" size="small" multiple>
<el-option v-for="val in 60" :key="val" :value="val - 1">{{
val - 1
}}</el-option>
</el-select>
</el-radio>
</el-row>
@ -125,27 +103,25 @@
<el-radio v-model="minute.cronEvery" label="4"
>{{ text.Minutes.cycle[0] }}
<el-input-number
size="small"
v-model="minute.rangeStart"
size="small"
:min="1"
:max="60"
></el-input-number>
/>
{{ text.Minutes.cycle[1] }}
<el-input-number
size="small"
v-model="minute.rangeEnd"
size="small"
:min="0"
:max="59"
></el-input-number>
/>
{{ text.Minutes.cycle[2] }}
</el-radio>
</el-row>
</div>
</el-tab-pane>
<el-tab-pane>
<template #label>
<i class="el-icon-date"></i> {{ text.Hours.name }}
</template>
<template #label> <i class="el-icon-date"></i> {{ text.Hours.name }} </template>
<div class="vue-cron__item">
<el-row>
<el-radio v-model="hour.cronEvery" label="1">{{
@ -156,38 +132,28 @@
<el-radio v-model="hour.cronEvery" label="2"
>{{ text.Hours.interval[0] }}
<el-input-number
size="small"
v-model="hour.incrementIncrement"
size="small"
:min="0"
:max="23"
></el-input-number>
/>
{{ text.Hours.interval[1] }}
<el-input-number
size="small"
v-model="hour.incrementStart"
size="small"
:min="0"
:max="23"
></el-input-number>
/>
{{ text.Hours.interval[2] }}
</el-radio>
</el-row>
<el-row>
<el-radio
class="long"
v-model="hour.cronEvery"
label="3"
<el-radio v-model="hour.cronEvery" class="long" label="3"
>{{ text.Hours.specific }}
<el-select
size="small"
multiple
v-model="hour.specificSpecific"
>
<el-option
v-for="val in 24"
:key="val"
:value="val - 1"
>{{ val - 1 }}</el-option
>
<el-select v-model="hour.specificSpecific" size="small" multiple>
<el-option v-for="val in 24" :key="val" :value="val - 1">{{
val - 1
}}</el-option>
</el-select>
</el-radio>
</el-row>
@ -195,53 +161,46 @@
<el-radio v-model="hour.cronEvery" label="4"
>{{ text.Hours.cycle[0] }}
<el-input-number
size="small"
v-model="hour.rangeStart"
size="small"
:min="0"
:max="23"
></el-input-number>
/>
{{ text.Hours.cycle[1] }}
<el-input-number
size="small"
v-model="hour.rangeEnd"
size="small"
:min="0"
:max="23"
></el-input-number>
/>
{{ text.Hours.cycle[2] }}
</el-radio>
</el-row>
</div>
</el-tab-pane>
<el-tab-pane>
<template #label>
<i class="el-icon-date"></i> {{ text.Day.name }}
</template>
<template #label> <i class="el-icon-date"></i> {{ text.Day.name }} </template>
<div class="vue-cron__item">
<el-row>
<el-radio v-model="day.cronEvery" label="1">{{
text.Day.every
}}</el-radio>
<el-radio v-model="day.cronEvery" label="1">{{ text.Day.every }}</el-radio>
</el-row>
<el-row>
<el-radio v-model="day.cronEvery" label="2"
>{{ text.Day.intervalWeek[0] }}
<el-input-number
size="small"
v-model="week.incrementIncrement"
size="small"
:min="1"
:max="7"
></el-input-number>
/>
{{ text.Day.intervalWeek[1] }}
<el-select
size="small"
v-model="week.incrementStart"
>
<el-select v-model="week.incrementStart" size="small">
<el-option
v-for="val in 7"
:key="val"
:label="text.Week[val - 1]"
:value="val"
></el-option>
/>
</el-select>
{{ text.Day.intervalWeek[2] }}
</el-radio>
@ -250,62 +209,43 @@
<el-radio v-model="day.cronEvery" label="3"
>{{ text.Day.intervalDay[0] }}
<el-input-number
size="small"
v-model="day.incrementIncrement"
size="small"
:min="1"
:max="31"
></el-input-number>
/>
{{ text.Day.intervalDay[1] }}
<el-input-number
size="small"
v-model="day.incrementStart"
size="small"
:min="1"
:max="31"
></el-input-number>
/>
{{ text.Day.intervalDay[2] }}
</el-radio>
</el-row>
<el-row>
<el-radio class="long" v-model="day.cronEvery" label="4"
<el-radio v-model="day.cronEvery" class="long" label="4"
>{{ text.Day.specificWeek }}
<el-select
size="small"
multiple
v-model="week.specificSpecific"
>
<el-select v-model="week.specificSpecific" size="small" multiple>
<el-option
v-for="val in 7"
:key="val"
:label="text.Week[val - 1]"
:value="
[
'SUN',
'MON',
'TUE',
'WED',
'THU',
'FRI',
'SAT',
][val - 1]
['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'][val - 1]
"
></el-option>
/>
</el-select>
</el-radio>
</el-row>
<el-row>
<el-radio class="long" v-model="day.cronEvery" label="5"
<el-radio v-model="day.cronEvery" class="long" label="5"
>{{ text.Day.specificDay }}
<el-select
size="small"
multiple
v-model="day.specificSpecific"
>
<el-option
v-for="val in 31"
:key="val"
:value="val"
>{{ val }}</el-option
>
<el-select v-model="day.specificSpecific" size="small" multiple>
<el-option v-for="val in 31" :key="val" :value="val">{{
val
}}</el-option>
</el-select>
</el-radio>
</el-row>
@ -322,16 +262,13 @@
<el-row>
<el-radio v-model="day.cronEvery" label="8"
>{{ text.Day.lastWeek[0] }}
<el-select
size="small"
v-model="day.cronLastSpecificDomDay"
>
<el-select v-model="day.cronLastSpecificDomDay" size="small">
<el-option
v-for="val in 7"
:key="val"
:label="text.Week[val - 1]"
:value="val"
></el-option>
/>
</el-select>
{{ text.Day.lastWeek[1] || "" }}
</el-radio>
@ -339,11 +276,11 @@
<el-row>
<el-radio v-model="day.cronEvery" label="9">
<el-input-number
size="small"
v-model="day.cronDaysBeforeEomMinus"
size="small"
:min="1"
:max="31"
></el-input-number>
/>
{{ text.Day.beforeEndMonth[0] }}
</el-radio>
</el-row>
@ -351,11 +288,11 @@
<el-radio v-model="day.cronEvery" label="10"
>{{ text.Day.nearestWeekday[0] }}
<el-input-number
size="small"
v-model="day.cronDaysNearestWeekday"
size="small"
:min="1"
:max="31"
></el-input-number>
/>
{{ text.Day.nearestWeekday[1] }}
</el-radio>
</el-row>
@ -363,14 +300,14 @@
<el-radio v-model="day.cronEvery" label="11"
>{{ text.Day.someWeekday[0] }}
<el-input-number
size="small"
v-model="week.cronNthDayNth"
size="small"
:min="1"
:max="5"
></el-input-number>
/>
<el-select
size="small"
v-model="week.cronNthDayDay"
size="small"
style="margin-left: 5px"
>
<el-option
@ -378,7 +315,7 @@
:key="val"
:label="text.Week[val - 1]"
:value="val"
></el-option>
/>
</el-select>
{{ text.Day.someWeekday[1] }}
</el-radio>
@ -400,37 +337,25 @@
<el-radio v-model="month.cronEvery" label="2"
>{{ text.Month.interval[0] }}
<el-input-number
size="small"
v-model="month.incrementIncrement"
size="small"
:min="0"
:max="12"
></el-input-number>
/>
{{ text.Month.interval[1] }}
<el-input-number
size="small"
v-model="month.incrementStart"
size="small"
:min="0"
:max="12"
></el-input-number>
/>
</el-radio>
</el-row>
<el-row>
<el-radio
class="long"
v-model="month.cronEvery"
label="3"
<el-radio v-model="month.cronEvery" class="long" label="3"
>{{ text.Month.specific }}
<el-select
size="small"
multiple
v-model="month.specificSpecific"
>
<el-option
v-for="val in 12"
:key="val"
:label="val"
:value="val"
></el-option>
<el-select v-model="month.specificSpecific" size="small" multiple>
<el-option v-for="val in 12" :key="val" :label="val" :value="val" />
</el-select>
</el-radio>
</el-row>
@ -438,26 +363,24 @@
<el-radio v-model="month.cronEvery" label="4"
>{{ text.Month.cycle[0] }}
<el-input-number
size="small"
v-model="month.rangeStart"
size="small"
:min="1"
:max="12"
></el-input-number>
/>
{{ text.Month.cycle[1] }}
<el-input-number
size="small"
v-model="month.rangeEnd"
size="small"
:min="1"
:max="12"
></el-input-number>
/>
</el-radio>
</el-row>
</div>
</el-tab-pane>
<el-tab-pane v-if="showYear || false">
<template #label>
<i class="el-icon-date"></i> {{ text.Year.name }}
</template>
<template #label> <i class="el-icon-date"></i> {{ text.Year.name }} </template>
<div class="vue-cron__item">
<el-row>
<el-radio v-model="year.cronEvery" label="1">{{
@ -468,38 +391,35 @@
<el-radio v-model="year.cronEvery" label="2"
>{{ text.Year.interval[0] }}
<el-input-number
size="small"
v-model="year.incrementIncrement"
size="small"
:min="1"
:max="99"
></el-input-number>
/>
{{ text.Year.interval[1] }}
<el-input-number
size="small"
v-model="year.incrementStart"
size="small"
:min="2018"
:max="2118"
></el-input-number>
/>
</el-radio>
</el-row>
<el-row>
<el-radio
class="long"
v-model="year.cronEvery"
label="3"
<el-radio v-model="year.cronEvery" class="long" label="3"
>{{ text.Year.specific }}
<el-select
v-model="year.specificSpecific"
size="small"
filterable
multiple
v-model="year.specificSpecific"
>
<el-option
v-for="val in 100"
:key="val"
:label="2017 + val"
:value="2017 + val"
></el-option>
/>
</el-select>
</el-radio>
</el-row>
@ -507,18 +427,18 @@
<el-radio v-model="year.cronEvery" label="4"
>{{ text.Year.cycle[0] }}
<el-input-number
size="small"
v-model="year.rangeStart"
size="small"
:min="2018"
:max="2118"
></el-input-number>
/>
{{ text.Year.cycle[1] }}
<el-input-number
size="small"
v-model="year.rangeEnd"
size="small"
:min="2018"
:max="2118"
></el-input-number>
/>
</el-radio>
</el-row>
</div>
@ -541,9 +461,9 @@ export default {
props: {
modelValue: {
type: String,
default: "",
default: ""
},
showYear: Boolean,
showYear: Boolean
},
emits: ["update:modelValue", "change", "close"],
@ -556,7 +476,7 @@ export default {
incrementIncrement: 5,
rangeStart: "",
rangeEnd: "",
specificSpecific: [],
specificSpecific: []
},
minute: {
cronEvery: "",
@ -564,7 +484,7 @@ export default {
incrementIncrement: 5,
rangeStart: "",
rangeEnd: "",
specificSpecific: [],
specificSpecific: []
},
hour: {
cronEvery: "",
@ -572,7 +492,7 @@ export default {
incrementIncrement: 5,
rangeStart: "",
rangeEnd: "",
specificSpecific: [],
specificSpecific: []
},
day: {
cronEvery: "",
@ -583,7 +503,7 @@ export default {
specificSpecific: [],
cronLastSpecificDomDay: 1,
cronDaysBeforeEomMinus: "",
cronDaysNearestWeekday: "",
cronDaysNearestWeekday: ""
},
week: {
cronEvery: "",
@ -591,7 +511,7 @@ export default {
incrementIncrement: 1,
specificSpecific: [],
cronNthDayDay: 1,
cronNthDayNth: 1,
cronNthDayNth: 1
},
month: {
cronEvery: "",
@ -599,7 +519,7 @@ export default {
incrementIncrement: 5,
rangeStart: "",
rangeEnd: "",
specificSpecific: [],
specificSpecific: []
},
year: {
cronEvery: "",
@ -607,7 +527,7 @@ export default {
incrementIncrement: 1,
rangeStart: "",
rangeEnd: "",
specificSpecific: [],
specificSpecific: []
},
output: {
second: "",
@ -616,17 +536,11 @@ export default {
day: "",
month: "",
Week: "",
year: "",
},
year: ""
}
};
},
watch: {
data() {
this.rest(this.$data);
},
},
computed: {
text() {
return Language;
@ -639,10 +553,7 @@ export default {
seconds = "*";
break;
case "2":
seconds =
this.second.incrementStart +
"/" +
this.second.incrementIncrement;
seconds = this.second.incrementStart + "/" + this.second.incrementIncrement;
break;
case "3":
this.second.specificSpecific.forEach((val) => {
@ -651,8 +562,7 @@ export default {
seconds = seconds.slice(0, -1);
break;
case "4":
seconds =
this.second.rangeStart + "-" + this.second.rangeEnd;
seconds = this.second.rangeStart + "-" + this.second.rangeEnd;
break;
}
return seconds;
@ -665,10 +575,7 @@ export default {
minutes = "*";
break;
case "2":
minutes =
this.minute.incrementStart +
"/" +
this.minute.incrementIncrement;
minutes = this.minute.incrementStart + "/" + this.minute.incrementIncrement;
break;
case "3":
this.minute.specificSpecific.forEach((val) => {
@ -677,8 +584,7 @@ export default {
minutes = minutes.slice(0, -1);
break;
case "4":
minutes =
this.minute.rangeStart + "-" + this.minute.rangeEnd;
minutes = this.minute.rangeStart + "-" + this.minute.rangeEnd;
break;
}
return minutes;
@ -691,10 +597,7 @@ export default {
hours = "*";
break;
case "2":
hours =
this.hour.incrementStart +
"/" +
this.hour.incrementIncrement;
hours = this.hour.incrementStart + "/" + this.hour.incrementIncrement;
break;
case "3":
this.hour.specificSpecific.forEach((val) => {
@ -720,10 +623,7 @@ export default {
days = "?";
break;
case "3":
days =
this.day.incrementStart +
"/" +
this.day.incrementIncrement;
days = this.day.incrementStart + "/" + this.day.incrementIncrement;
break;
case "5":
this.day.specificSpecific.forEach((val) => {
@ -759,10 +659,7 @@ export default {
weeks = "?";
break;
case "2":
weeks =
this.week.incrementStart +
"/" +
this.week.incrementIncrement;
weeks = this.week.incrementStart + "/" + this.week.incrementIncrement;
break;
case "4":
this.week.specificSpecific.forEach((val) => {
@ -778,8 +675,7 @@ export default {
weeks = "?";
break;
case "11":
weeks =
this.week.cronNthDayDay + "#" + this.week.cronNthDayNth;
weeks = this.week.cronNthDayDay + "#" + this.week.cronNthDayNth;
break;
}
return weeks;
@ -792,10 +688,7 @@ export default {
months = "*";
break;
case "2":
months =
this.month.incrementStart +
"/" +
this.month.incrementIncrement;
months = this.month.incrementStart + "/" + this.month.incrementIncrement;
break;
case "3":
this.month.specificSpecific.forEach((val) => {
@ -817,10 +710,7 @@ export default {
years = "*";
break;
case "2":
years =
this.year.incrementStart +
"/" +
this.year.incrementIncrement;
years = this.year.incrementStart + "/" + this.year.incrementIncrement;
break;
case "3":
this.year.specificSpecific.forEach((val) => {
@ -837,10 +727,16 @@ export default {
cron() {
return `${this.secondsText || "*"} ${this.minutesText || "*"} ${
this.hoursText || "*"
} ${this.daysText || "*"} ${this.monthsText || "*"} ${
this.weeksText || "?"
} ${this.showYear ? this.yearsText || "*" : ""}`;
},
} ${this.daysText || "*"} ${this.monthsText || "*"} ${this.weeksText || "?"} ${
this.showYear ? this.yearsText || "*" : ""
}`;
}
},
watch: {
data() {
this.rest(this.$data);
}
},
methods: {
@ -869,8 +765,8 @@ export default {
}
}
}
},
},
}
}
};
</script>

View File

@ -2,7 +2,7 @@
<div class="system-task">
<div class="box scroller1">
<!-- 系统用户自定义已停止 -->
<div class="block" :class="[`_${item.key}`]" v-for="(item, index) in list" :key="index">
<div v-for="(item, index) in list" :key="index" class="block" :class="[`_${item.key}`]">
<div class="header">
<!-- 图标 -->
<i class="icon" :class="item.icon"></i>
@ -19,22 +19,22 @@
<li
v-else
@click="refreshTask({ page: 1 })"
class="refresh-btn"
v-permission="perm.delete"
class="refresh-btn"
@click="refreshTask({ page: 1 })"
>
<i class="el-icon-refresh"></i>
<span>刷新</span>
</li>
<li @click="edit(item.params)" class="add-btn" v-permission="perm.add">
<li v-permission="perm.add" class="add-btn" @click="edit(item.params)">
<i class="el-icon-plus"></i>
<span>添加</span>
</li>
</ul>
</div>
<div class="container scroller1" :ref="setRefs(`${item.key}-scroller`)">
<div :ref="setRefs(`${item.key}-scroller`)" class="container scroller1">
<draggable
v-model="list[index].list"
v-bind="drag.options"
@ -42,17 +42,17 @@
item-key="id"
:data-type="item.params.type"
:data-status="item.params.status"
@end="e => onDragEnd(e, item)"
@end="(e) => onDragEnd(e, item)"
>
<template #item="{element}">
<template #item="{ element }">
<li
:key="element.id"
:data-id="element.id"
@contextmenu.stop.prevent="openCM($event, element)"
class="_drag"
@contextmenu.stop.prevent="openCM($event, element)"
>
<div class="h">
<span class="type _warning" v-show="element.status === 0">
<span v-show="element.status === 0" class="type _warning">
{{ element.type === 0 ? "系统" : "用户" }}
</span>
<span class="name">{{ element.name }}</span>
@ -74,8 +74,8 @@
<div class="op">
<div
class="op-item"
v-if="element.status === 0"
class="op-item"
@click="start(element)"
>
<i class="el-icon-video-play"></i>
@ -83,30 +83,30 @@
</div>
<div
class="op-item"
v-else
@click="stop(element)"
v-permission="perm.stop"
class="op-item"
@click="stop(element)"
>
<i class="el-icon-video-pause"></i>
<span>暂停</span>
</div>
<div
class="op-item"
@click="edit(element)"
v-permission="{
and: [perm.update, perm.info]
}"
class="op-item"
@click="edit(element)"
>
<i class="el-icon-edit"></i>
<span>编辑</span>
</div>
<div
v-permission="perm.log"
class="op-item"
@click="findLog(element)"
v-permission="perm.log"
>
<i class="el-icon-tickets"></i>
<span>查看日志</span>
@ -116,31 +116,29 @@
</template>
<template #header>
<div class="empty" v-if="list[index].list.length == 0">
暂无数据
</div>
<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"
type="text"
size="mini"
@click="moreTask(index, item)"
v-if="item.pagination.total >= item.pagination.size"
>查看更多</el-button
>
</div>
<div class="footer">
<button class="btn-add" @click="edit(item.params)" v-permission="perm.add">
<button v-permission="perm.add" class="btn-add" @click="edit(item.params)">
<i class="el-icon-plus"></i>
</button>
</div>
</div>
<!-- 日志 -->
<div class="block _log" v-permission="perm.log">
<div v-permission="perm.log" class="block _log">
<div class="header">
<!-- 标题 -->
<span class="label">日志</span>
@ -150,8 +148,8 @@
<!-- 是否异常 -->
<el-checkbox-group
class="status"
v-model="logs.filters.status"
class="status"
@change="filterLog"
>
<el-checkbox :label="0">异常</el-checkbox>
@ -171,11 +169,11 @@
</ul>
</div>
<div class="container" v-loading="logs.loading" element-loading-text="拼命加载中">
<div v-loading="logs.loading" class="container" element-loading-text="拼命加载中">
<ul
class="scroller1"
:ref="setRefs('log-scroller')"
v-infinite-scroll="moreLog"
class="scroller1"
>
<li
v-for="(item, index) in logs.list"
@ -343,7 +341,7 @@ export default defineComponent({
const { index, more } = options || {};
const arr = index === undefined || index === null ? list.map((e, i) => i) : [index];
arr.forEach(async k => {
arr.forEach(async (k) => {
const item = list[k];
Object.assign(item.params, {
@ -759,9 +757,9 @@ export default defineComponent({
}
ContextMenu.open(e, {
list: menus.filter(e => {
list: menus.filter((e) => {
return checkPerm({
and: e.perm.map(a => perm.value[a])
and: e.perm.map((a) => perm.value[a])
});
})
});

View File

@ -1,11 +1,11 @@
<template>
<div class="cl-theme">
<li @click="open">
<icon-svg :size="18" name="icon-theme"></icon-svg>
<icon-svg :size="18" name="icon-theme" />
</li>
<!-- 系统设置 -->
<el-drawer title="系统设置" v-model="drawer.visible" size="300px">
<el-drawer v-model="drawer.visible" title="系统设置" size="300px">
<div class="cl-theme__container">
<div class="cl-theme__color is-card">
<p>主题</p>
@ -19,13 +19,13 @@
>
<li
:style="{
backgroundColor: item.color,
backgroundColor: item.color
}"
@click="setTheme(item)"
>
<i
class="el-icon-check"
v-show="item.color == form.theme.color"
class="el-icon-check"
></i>
</li>
</el-tooltip>
@ -38,24 +38,15 @@
<ul>
<li v-if="!browser.isMini">
<span>显示一级菜单栏</span>
<el-switch
size="mini"
v-model="form.conf.showAMenu"
></el-switch>
<el-switch v-model="form.conf.showAMenu" size="mini" />
</li>
<li>
<span>显示路由导航栏</span>
<el-switch
size="mini"
v-model="form.conf.showRouteNav"
></el-switch>
<el-switch v-model="form.conf.showRouteNav" size="mini" />
</li>
<li>
<span>显示页面进程栏</span>
<el-switch
size="mini"
v-model="form.conf.showProcess"
></el-switch>
<el-switch v-model="form.conf.showProcess" size="mini" />
</li>
</ul>
</div>
@ -70,7 +61,7 @@
:closable="false"
show-icon
title="手动修改配置文件可设置为默认主题、布局。"
></el-alert>
/>
<el-button
round
@ -91,18 +82,18 @@
title="修改说明"
width="800px"
:props="{
'append-to-body': true,
'append-to-body': true
}"
>
<ul class="cl-theme__desc">
<li>
<p class="cl-theme__desc-label">修改主题色</p>
<cl-codemirror v-model="desc.color"></cl-codemirror>
<cl-codemirror v-model="desc.color" />
</li>
<li>
<p class="cl-theme__desc-label">修改应用配置</p>
<cl-codemirror v-model="desc.conf"></cl-codemirror>
<cl-codemirror v-model="desc.conf" />
</li>
</ul>
</cl-dialog>
@ -118,43 +109,43 @@ export default {
name: "cl-theme",
props: {
list: Array,
list: Array
},
data() {
return {
drawer: {
visible: false,
visible: false
},
desc: {
visible: false,
color: "",
conf: "",
conf: ""
},
themes: [
{
label: "钴蓝",
name: "blue",
color: "#4165d7",
color: "#4165d7"
},
{
label: "极黑",
name: "black",
color: "#2f3447",
color: "#2f3447"
},
{
label: "果绿",
name: "green",
color: "#51C21A",
color: "#51C21A"
},
{
label: "酱紫",
name: "purple",
color: "#d0378d",
},
color: "#d0378d"
}
],
isDev,
form: {},
form: {}
};
},
@ -163,7 +154,7 @@ export default {
themeList() {
return isArray(this.list) ? this.list : this.themes;
},
}
},
watch: {
@ -172,15 +163,15 @@ export default {
immediate: true,
handler(val) {
this.form = cloneDeep(val);
},
}
},
form: {
deep: true,
handler(val) {
this.$store.commit("UPDATE_APP", val);
},
},
}
}
},
methods: {
@ -203,19 +194,14 @@ export default {
const theme = document.getElementById("theme-style");
const style = theme || document.createElement("link");
style.href = `${
this.modules.theme.options.sourceUrl || "/theme/"
}${name}.css`;
style.href = `${this.modules.theme.options.sourceUrl || "/theme/"}${name}.css`;
if (!theme) {
style.type = "text/css";
style.rel = "stylesheet";
style.id = "theme-style";
document
.getElementsByTagName("head")
.item(0)
.appendChild(style);
document.getElementsByTagName("head").item(0).appendChild(style);
}
//
@ -223,9 +209,7 @@ export default {
this.form.theme.url = style.href;
// css
document
.getElementsByTagName("body")[0]
.style.setProperty("--color-primary", color);
document.getElementsByTagName("body")[0].style.setProperty("--color-primary", color);
},
//
@ -246,8 +230,8 @@ export default {
}
}
`;
},
},
}
}
};
</script>

View File

@ -6,11 +6,11 @@
`cl-upload--${listType}`,
{
'is-multiple': multiple,
'is-drag': drag,
},
'is-drag': drag
}
]"
>
<el-input class="cl-upload__hidden" type="hidden"></el-input>
<el-input class="cl-upload__hidden" type="hidden" />
<el-upload
:action="action"
@ -25,9 +25,10 @@
:show-file-list="_showFileList"
:auto-upload="autoUpload"
:disabled="disabled"
v-loading="_loading"
:headers="{
Authorization: token,
...headers,
...headers
}"
:http-request="action ? undefined : httpRequest"
:on-remove="_onRemove"
@ -38,15 +39,12 @@
:before-upload="_beforeUpload"
:before-remove="beforeRemove"
:style="_style"
v-loading="_loading"
>
<slot>
<!-- 多图上传 -->
<template v-if="listType == 'picture-card'">
<i :class="['cl-upload__icon', _icon]"></i>
<span class="cl-upload__text" v-if="_text">{{
_text
}}</span>
<span v-if="_text" class="cl-upload__text">{{ _text }}</span>
</template>
<!-- 文件上传 -->
@ -61,10 +59,7 @@
<template v-if="_file">
<div class="cl-upload__cover">
<!-- 图片 -->
<img
v-if="_file.type == 'image'"
:src="_file.url"
/>
<img v-if="_file.type == 'image'" :src="_file.url" />
<!-- 文件名 -->
<span v-else>{{ _file.name }}</span>
@ -73,8 +68,8 @@
<!-- 功能按钮 -->
<div class="cl-upload__actions">
<span
class="cl-upload__actions-preview"
v-if="_file.type == 'image'"
class="cl-upload__actions-preview"
@click.stop="_onPreview(_file)"
>
<i class="el-icon-zoom-in"></i>
@ -92,9 +87,7 @@
<!-- 空态 -->
<template v-else>
<i :class="['cl-upload__icon', _icon]"></i>
<span class="cl-upload__text" v-if="_text">{{
_text
}}</span>
<span v-if="_text" class="cl-upload__text">{{ _text }}</span>
</template>
</template>
</slot>
@ -102,10 +95,10 @@
</div>
<cl-dialog
title="图片预览"
v-model="preview.visible"
title="图片预览"
:props="{
width: previewWidth,
width: previewWidth
}"
>
<img style="width: 100%" :src="preview.url" alt="" />
@ -133,19 +126,19 @@ export default {
// uuid
rename: {
type: Boolean,
default: undefined,
default: undefined
},
// (MB)
limitSize: Number,
//
previewWidth: {
type: String,
default: "500px",
default: "500px"
},
//
action: {
type: String,
default: "",
default: ""
},
//
headers: Object,
@ -160,7 +153,7 @@ export default {
//
showFileList: {
type: Boolean,
default: undefined,
default: undefined
},
//
drag: Boolean,
@ -169,12 +162,12 @@ export default {
//
listType: {
type: String,
default: "default",
default: "default"
},
//
autoUpload: {
type: Boolean,
default: true,
default: true
},
//
disabled: Boolean,
@ -197,7 +190,7 @@ export default {
//
beforeUpload: Function,
//
beforeRemove: Function,
beforeRemove: Function
},
emits: ["update:modelValue", "change"],
@ -209,8 +202,8 @@ export default {
loading: false,
preview: {
visible: false,
url: null,
},
url: null
}
};
},
@ -278,7 +271,7 @@ export default {
_urls() {
const format = {
image: ["bmp", "jpg", "jpeg", "png", "tif", "gif", "svg"],
image: ["bmp", "jpg", "jpeg", "png", "tif", "gif", "svg"]
};
return this.urls
@ -304,26 +297,24 @@ export default {
arr = [this._size, this._size];
}
const [height, width] = arr.map((e) =>
isNumber(e) ? `${e}px` : e
);
const [height, width] = arr.map((e) => (isNumber(e) ? `${e}px` : e));
if (this.listType == "default" && !this.drag) {
return {
height,
width,
width
};
} else {
return {};
}
},
}
},
watch: {
modelValue: {
immediate: true,
handler: "parseValue",
},
handler: "parseValue"
}
},
methods: {
@ -353,7 +344,7 @@ export default {
return {
url,
name: basename(url),
uid: url,
uid: url
};
});
@ -423,9 +414,7 @@ export default {
if (this._limitSize) {
if (file.size / 1024 / 1024 >= this._limitSize) {
this.$message.error(
`上传文件大小不能超过 ${this._limitSize}MB!`
);
this.$message.error(`上传文件大小不能超过 ${this._limitSize}MB!`);
this.done();
return false;
}
@ -433,7 +422,7 @@ export default {
if (this.beforeUpload) {
return this.beforeUpload(file, {
done: this.done,
done: this.done
});
}
@ -447,7 +436,7 @@ export default {
this.append({
url: res.data,
name: file.raw.name,
uid: file.raw.uid,
uid: file.raw.uid
});
//
@ -476,10 +465,7 @@ export default {
// uuid
if (this._rename) {
fileName =
uuidv4() +
"." +
last((file.name || "").split("."));
fileName = uuidv4() + "." + last((file.name || "").split("."));
}
data.append("key", `app/${fileName}`);
@ -491,17 +477,15 @@ export default {
url: res.host,
method: "POST",
headers: {
"Content-Type": "multipart/form-data",
"Content-Type": "multipart/form-data"
},
data,
onUploadProgress: (e) => {
if (this.onProgress) {
e.percent = parseInt(
(e.loaded / e.total) * 100
);
e.percent = parseInt((e.loaded / e.total) * 100);
this.onProgress(e, req.file);
}
},
}
})
.then((url) => {
if (mode === "local") {
@ -517,7 +501,7 @@ export default {
if (mode == "local") {
next({
host: "/upload",
host: "/upload"
});
} else {
this.$service.common
@ -553,8 +537,8 @@ export default {
//
uploadMode() {
return this.$service.common.uploadMode().then((res) => res.mode);
},
},
}
}
};
</script>

View File

@ -9,7 +9,7 @@
<div class="cl-upload-space-category__search">
<el-button type="primary" size="mini" @click="edit()">添加分类</el-button>
<el-input v-model="keyword" placeholder="输入关键字过滤" size="mini"></el-input>
<el-input v-model="keyword" placeholder="输入关键字过滤" size="mini" />
</div>
<div class="cl-upload-space-category__list">
@ -28,7 +28,7 @@
</ul>
</div>
<cl-form ref="form"></cl-form>
<cl-form ref="form" />
</div>
</template>
@ -39,11 +39,13 @@ import { isEmpty } from "/@/core/utils";
export default {
name: "cl-upload-space-category",
inject: ["space"],
props: {
modelValue: [Number]
},
inject: ["space"],
emits: ["update:modelValue", "change"],
data() {
return {
@ -57,7 +59,7 @@ export default {
...mapGetters(["browser"]),
flist() {
return this.list.filter(e => e.name.includes(this.keyword));
return this.list.filter((e) => e.name.includes(this.keyword));
}
},
@ -77,7 +79,7 @@ export default {
methods: {
//
refresh() {
return this.$service.space.type.list().then(res => {
return this.$service.space.type.list().then((res) => {
res.unshift({
name: "全部文件",
id: null
@ -131,7 +133,7 @@ export default {
next.then(() => {
this.refresh();
close();
}).catch(err => {
}).catch((err) => {
this.$message.error(err);
done();
});
@ -195,7 +197,7 @@ export default {
this.refresh();
})
.catch(err => {
.catch((err) => {
this.$message.error(err);
});
})

View File

@ -14,7 +14,7 @@
<template v-else>
<!-- 图片 -->
<template v-if="type === 'image'">
<el-image fit="cover" :src="value.url" lazy></el-image>
<el-image fit="cover" :src="value.url" lazy />
</template>
<!-- 视频 -->
@ -39,7 +39,7 @@
<div class="cl-upload-space-item__size"></div>
<!-- 遮罩层 -->
<div class="cl-upload-space-item__mask" v-if="isSelected">
<div v-if="isSelected" class="cl-upload-space-item__mask">
<span>{{ index + 1 }}</span>
</div>
</div>
@ -49,15 +49,17 @@
export default {
name: "cl-upload-space-item",
inject: ["space"],
props: {
value: Object
},
inject: ["space"],
emits: ["select", "remove"],
computed: {
index() {
return this.space.selection.findIndex(e => e.id === this.value.id);
return this.space.selection.findIndex((e) => e.id === this.value.id);
},
isSelected() {

View File

@ -1,22 +1,20 @@
<template>
<div class="cl-upload-space__wrap">
<slot>
<el-button v-if="showButton" size="mini" @click="open"
>点击上传</el-button
>
<el-button v-if="showButton" size="mini" @click="open">点击上传</el-button>
</slot>
<!-- 弹框 -->
<cl-dialog
v-model="visible"
title="文件空间"
height="630px"
width="1000px"
keep-alive
v-model="visible"
:props="{
'close-on-click-modal': false,
'append-to-body': true,
customClass: 'dialog-upload-space',
customClass: 'dialog-upload-space'
}"
:controls="['slot-expand', 'cl-flex1', 'fullscreen', 'close']"
>
@ -28,9 +26,7 @@
<div class="cl-upload-space__content">
<!-- 操作栏 -->
<div class="cl-upload-space__header scroller1">
<el-button size="mini" @click="refresh()"
>刷新</el-button
>
<el-button size="mini" @click="refresh()">刷新</el-button>
<cl-upload
style="margin: 0 10px"
@ -48,9 +44,7 @@
:on-progress="onProgress"
:before-upload="beforeUpload"
>
<el-button size="mini" type="primary"
>点击上传</el-button
>
<el-button size="mini" type="primary">点击上传</el-button>
</cl-upload>
<el-button
@ -72,8 +66,8 @@
<!-- 文件区域 -->
<div
class="cl-upload-space__file scroller1"
v-loading="loading"
class="cl-upload-space__file scroller1"
element-loading-text="拼命加载中"
>
<!-- 文件列表 -->
@ -82,17 +76,17 @@
<file-item
v-for="item in list"
:key="item.id"
v-loading="item.loading"
:value="item"
:element-loading-text="item.progress"
v-loading="item.loading"
@select="select"
@remove="remove"
></file-item>
/>
</div>
</template>
<!-- 空态 -->
<div class="cl-upload-space__file-empty" v-else>
<div v-else class="cl-upload-space__file-empty">
<cl-upload
drag
:action="action"
@ -127,7 +121,7 @@
refresh({ page });
}
"
></el-pagination>
/>
</div>
</div>
</div>
@ -136,15 +130,11 @@
<template #slot-expand>
<button>
<i
class="el-icon-notebook-2"
v-if="category.visible"
class="el-icon-notebook-2"
@click="category.visible = false"
></i>
<i
class="el-icon-arrow-left"
v-else
@click="category.visible = true"
></i>
<i v-else class="el-icon-arrow-left" @click="category.visible = true"></i>
</button>
</template>
</cl-dialog>
@ -160,18 +150,29 @@ import { mapGetters } from "vuex";
export default {
name: "cl-upload-space",
components: {
Category,
FileItem
},
provide() {
return {
space: this
};
},
props: {
//
action: String,
//
limit: {
type: Number,
default: 9,
default: 9
},
// (MB)
limitSize: {
type: Number,
default: 10,
default: 10
},
//
disabled: Boolean,
@ -188,20 +189,11 @@ export default {
//
showButton: {
type: Boolean,
default: true,
},
default: true
}
},
components: {
Category,
FileItem,
},
provide() {
return {
space: this,
};
},
emits: ["update:modelValue", "confirm"],
data() {
return {
@ -209,15 +201,15 @@ export default {
loading: false,
category: {
id: null,
visible: true,
visible: true
},
selection: [],
list: [],
pagination: {
page: 1,
size: 12,
total: 0,
},
total: 0
}
};
},
@ -230,7 +222,7 @@ export default {
isSelected() {
return !isEmpty(this.selection);
},
}
},
watch: {
@ -238,8 +230,8 @@ export default {
immediate: true,
handler(val) {
this.category.visible = val ? false : true;
},
},
}
}
},
methods: {
@ -267,7 +259,7 @@ export default {
.add({
url: res.data,
type: item.type,
classifyId: item.classifyId,
classifyId: item.classifyId
})
.then((res) => {
item.loading = false;
@ -297,7 +289,7 @@ export default {
uid,
classifyId: this.category.id,
loading: true,
progress: "0%",
progress: "0%"
});
},
@ -322,7 +314,7 @@ export default {
...this.pagination,
...params,
classifyId: this.category.id,
type: this.accept,
type: this.accept
})
.then((res) => {
this.pagination = res.pagination;
@ -370,7 +362,7 @@ export default {
const ids = selection.map((e) => e.id);
this.$confirm("此操作将删除文件, 是否继续?", "提示", {
type: "warning",
type: "warning"
})
.then(() => {
this.$message.success("删除成功");
@ -386,15 +378,15 @@ export default {
//
this.$service.space.info
.delete({
ids,
ids
})
.catch((err) => {
this.$message.error(err);
});
})
.catch(() => null);
},
},
}
}
};
</script>

View File

@ -66,19 +66,14 @@ export function cloneDeep(obj: any) {
}
export function clone(obj: any) {
return Object.create(
Object.getPrototypeOf(obj),
Object.getOwnPropertyDescriptors(obj)
);
return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
}
export function deepMerge(a: any, b: any) {
let k;
for (k in b) {
a[k] =
a[k] && a[k].toString() === "[object Object]"
? deepMerge(a[k], b[k])
: (a[k] = b[k]);
a[k] && a[k].toString() === "[object Object]" ? deepMerge(a[k], b[k]) : (a[k] = b[k]);
}
return a;
}
@ -97,14 +92,7 @@ export function getUrlParam(name: string) {
export function isPc() {
const userAgentInfo = navigator.userAgent;
const Agents = [
"Android",
"iPhone",
"SymbianOS",
"Windows Phone",
"iPad",
"iPod",
];
const Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
let flag = true;
for (let v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
@ -132,9 +120,7 @@ export function getBrowser() {
let tag = "";
const isTocuh =
"ontouchstart" in window ||
ua.indexOf("touch") !== -1 ||
ua.indexOf("mobile") !== -1;
"ontouchstart" in window || ua.indexOf("touch") !== -1 || ua.indexOf("mobile") !== -1;
if (isTocuh) {
if (ua.indexOf("ipad") !== -1) {
tag = "pad";
@ -173,10 +159,7 @@ export function getBrowser() {
}
// 操作平台
const plat =
ua.indexOf("android") > 0
? "android"
: navigator.platform.toLowerCase();
const plat = ua.indexOf("android") > 0 ? "android" : navigator.platform.toLowerCase();
// 屏幕信息
let screen = "full";
@ -220,7 +203,7 @@ export function getBrowser() {
isIOS,
isPC,
isMini,
screen,
screen
};
}
@ -234,7 +217,7 @@ export function href(path: string, newWindow?: boolean) {
let url = "";
if (routerMode == "history") {
url = origin + path;
url = origin + import.meta.env.BASE_URL + path.substr(1);
} else {
url = origin + search + "#" + path;
}
@ -254,9 +237,9 @@ export function deepTree(list: Array<any>) {
const newList: Array<any> = [];
const map: any = {};
list.forEach((e) => (map[e.id] = e));
list.forEach(e => (map[e.id] = e));
list.forEach((e) => {
list.forEach(e => {
const parent = map[e.parentId];
if (parent) {
@ -267,7 +250,7 @@ export function deepTree(list: Array<any>) {
});
const fn = (list: Array<any>) => {
list.map((e) => {
list.map(e => {
if (e.children instanceof Array) {
e.children = orderBy(e.children, "orderNum");
@ -286,7 +269,7 @@ export function revDeepTree(list: Array<any> = []) {
let id = 0;
const deep = (list: Array<any>, parentId: any) => {
list.forEach((e) => {
list.forEach(e => {
if (!e.id) {
e.id = id++;
}

View File

@ -345,8 +345,7 @@
position: absolute;
bottom: -1px;
left: 0;
transition: transform 0.3s ease-in-out,
width 0.2s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);
transition: transform 0.3s ease-in-out, width 0.2s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);
}
}

View File

@ -123,12 +123,12 @@ export default defineComponent({
}
}
onMounted(function() {
onMounted(function () {
if (visible.value) {
// 添加到 body 下
document.body.appendChild(refs.value["context-menu"]);
// 关闭事件
(document.documentElement || document.body).addEventListener("mousedown", e => {
(document.documentElement || document.body).addEventListener("mousedown", (e) => {
const el = refs.value["context-menu"];
if (!contains(el, e.target) && el != e.target) {
close();
@ -156,7 +156,7 @@ export default defineComponent({
return (
<div class={["cl-context-menu__box", level > 1 && "is-append"]}>
{list
.filter(e => !e.hidden)
.filter((e) => !e.hidden)
.map((e, i) => {
const id = `${pId}-${i}`;

View File

@ -152,7 +152,7 @@ export default defineComponent({
}
}
onMounted(function() {
onMounted(function () {
setDialog();
});

View File

@ -40,7 +40,7 @@ export default defineComponent({
function update(val: string | number) {
nextTick(() => {
const index = list.value.findIndex(e => e.value === val);
const index = list.value.findIndex((e) => e.value === val);
const item = refs.value[`tab-${index}`];
// 下划线位置
@ -64,7 +64,7 @@ export default defineComponent({
emit("change", val);
}
onMounted(function() {
onMounted(function () {
if (isArray(props.labels) && props.labels.length > 0) {
list.value = props.labels;
update(isEmpty(props.modelValue) ? list.value[0].value : props.modelValue);

View File

@ -341,7 +341,7 @@ export default defineComponent({
{/* Form item */}
<div class="cl-form-item">
{["prepend", "component", "append"].map(
name => {
(name) => {
return (
e[name] && (
<div

View File

@ -42,7 +42,7 @@ export default {
// 默认选择
list.value = (props.list || []).map((e: any) => {
e.active = arr.some(v => v === e.value);
e.active = arr.some((v) => v === e.value);
return e;
});
};
@ -105,7 +105,7 @@ export default {
<button
class={{ "is-active": item.active }}
key={index}
onClick={event => {
onClick={(event) => {
ctx.selectItem(event, item);
}}>
<span>{item.label}</span>

View File

@ -200,7 +200,7 @@ export default defineComponent({
}
}
})
.filter(e => Boolean(e) && !e.hidden);
.filter((e) => Boolean(e) && !e.hidden);
// 打开菜单
if (list.length > 0) {
@ -270,7 +270,7 @@ export default defineComponent({
}
})();
onMounted(function() {
onMounted(function () {
calcMaxHeight();
});

View File

@ -16,7 +16,7 @@ export function useFormApi({ refs }: any) {
"clearValidate",
"validateField",
"validate"
].forEach(e => {
].forEach((e) => {
apis[e] = (...args: any[]) => {
return refs.value.form[e](...args);
};

View File

@ -118,7 +118,7 @@ export default defineComponent({
// 打开表单
function open() {
return new Promise(resolve => {
return new Promise((resolve) => {
if (!refs.value.form) {
return false;
}

View File

@ -16,11 +16,7 @@ const parseNode = (vnode: any, options: any) => {
if (rn) {
return rn({ scope });
} else {
return (
<cl-error-message
title={`组件渲染失败,未找到插槽:${vnode.name}`}
/>
);
return <cl-error-message title={`组件渲染失败,未找到插槽:${vnode.name}`} />;
}
}
@ -41,7 +37,7 @@ const parseNode = (vnode: any, options: any) => {
const props = {
...vnode,
...vnode.attrs,
...vnode.props,
...vnode.props
};
delete props._children;
@ -50,7 +46,7 @@ const parseNode = (vnode: any, options: any) => {
return h(resolveComponent(vnode.name), props, {
default: () => {
return vnode._children;
},
}
});
};
@ -107,37 +103,21 @@ export function renderNode(vnode: any, { prop, scope, slots }: any) {
}
return (
<el-option
key={i}
label={label}
value={value}
{...e.props}
/>
<el-option key={i} label={label} value={value} {...e.props} />
);
}
// 单选框组
else if (vnode.name == "el-radio-group") {
return h(
<el-radio
key={i}
label={e.value}
></el-radio>,
e.props,
{
default() {
return <span>{e.label}</span>;
},
return h(<el-radio key={i} label={e.value}></el-radio>, e.props, {
default() {
return <span>{e.label}</span>;
}
);
});
}
// 多选框组
else if (vnode.name == "el-checkbox-group") {
return (
<el-checkbox
key={i}
label={e.value}
{...e.props}
>
<el-checkbox key={i} label={e.value} {...e.props}>
{e.label}
</el-checkbox>
);
@ -153,9 +133,7 @@ export function renderNode(vnode: any, { prop, scope, slots }: any) {
return parseNode(vnode, { prop, scope, slots });
}
} else {
return (
<cl-error-message title={`组件渲染失败,组件 name 不能为空`} />
);
return <cl-error-message title={`组件渲染失败,组件 name 不能为空`} />;
}
}
}

View File

@ -3,15 +3,15 @@
<div class="page-layout__mask" @click="collapseMenu(true)"></div>
<div class="page-layout__left">
<slider></slider>
<slider />
</div>
<div class="page-layout__right">
<div class="page-layout__topbar">
<topbar></topbar>
<topbar />
</div>
<div class="page-layout__process" v-if="app.conf.showProcess">
<div v-if="app.conf.showProcess" class="page-layout__process">
<cl-process />
</div>

View File

@ -6,7 +6,7 @@
</div>
<div class="app-slider__menu">
<cl-menu-slider></cl-menu-slider>
<cl-menu-slider />
</div>
</div>
</template>

View File

@ -1,18 +1,16 @@
<template>
<div class="app-topbar">
<div class="app-topbar__collapse" @click="collapse">
<i
:class="[menuCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold']"
></i>
<i :class="[menuCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold']"></i>
</div>
<!-- 一级菜单 -->
<div class="app-topbar__menu" v-if="app.conf.showAMenu">
<div v-if="app.conf.showAMenu" class="app-topbar__menu">
<cl-menu-topbar />
</div>
<!-- 路由导航 -->
<div class="app-topbar__route-nav" v-if="app.conf.showRouteNav">
<div v-if="app.conf.showRouteNav" class="app-topbar__route-nav">
<cl-route-nav />
</div>
@ -33,21 +31,15 @@
<!-- 用户信息 -->
<div class="app-topbar__user">
<el-dropdown
trigger="click"
:hide-on-click="false"
@command="onCommand"
>
<span class="el-dropdown-link" v-if="userInfo">
<el-dropdown trigger="click" :hide-on-click="false" @command="onCommand">
<span v-if="userInfo" class="el-dropdown-link">
<span class="name">{{ userInfo.nickName }}</span>
<img class="avatar" :src="userInfo.headImg" alt />
</span>
<template #dropdown>
<el-dropdown-menu class="dropdown-menu__user">
<el-dropdown-item command="my"
>个人中心</el-dropdown-item
>
<el-dropdown-item command="my">个人中心</el-dropdown-item>
<el-dropdown-item command="exit">退出</el-dropdown-item>
</el-dropdown-menu>
</template>
@ -104,9 +96,9 @@ export default defineComponent({
modules,
app,
onCommand,
collapse,
collapse
};
},
}
});
</script>

View File

@ -2,7 +2,7 @@ import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
// 忽略规则
const ignore: any = {
token: ["/login", "/403", "/404", "/500", "/502"],
token: ["/login", "/403", "/404", "/500", "/502"]
};
const routes: Array<RouteRecordRaw> = [
@ -14,20 +14,20 @@ const routes: Array<RouteRecordRaw> = [
{
path: "/",
name: "数据统计",
component: () => import("/@/views/home/index.vue"),
},
],
component: () => import("/@/views/home/index.vue")
}
]
},
{
path: "/:catchAll(.*)",
name: "404",
redirect: "/404",
},
redirect: "/404"
}
];
const router = createRouter({
history: createWebHistory(),
routes,
routes
});
export default router;

View File

@ -32,11 +32,11 @@ axios.interceptors.request.use(
const token = store.getters.token || "";
if (config.url) {
if (!ignore.token.some(e => config.url.includes(e))) {
if (!ignore.token.some((e) => config.url.includes(e))) {
config.headers["Authorization"] = token;
}
if (!ignore.NProgress.some(e => config.url.includes(e))) {
if (!ignore.NProgress.some((e) => config.url.includes(e))) {
NProgress.start();
}
}
@ -68,13 +68,13 @@ axios.interceptors.request.use(
isRefreshing = true;
store.dispatch("refreshToken").then((token: string) => {
requests.forEach(cb => cb(token));
requests.forEach((cb) => cb(token));
requests = [];
isRefreshing = false;
});
}
return new Promise(resolve => {
return new Promise((resolve) => {
// 继续请求
requests.push((token: string) => {
// 重新设置 token
@ -87,14 +87,14 @@ axios.interceptors.request.use(
return config;
},
error => {
(error) => {
return Promise.reject(error);
}
);
// Response
axios.interceptors.response.use(
res => {
(res) => {
NProgress.done();
const { code, data, message } = res.data;
@ -109,7 +109,7 @@ axios.interceptors.response.use(
return Promise.reject(message);
}
},
async error => {
async (error) => {
NProgress.done();
if (error.response) {

View File

@ -5,7 +5,7 @@
</div>
<div class="category-ratio__container">
<v-chart :option="chartOption" autoresize></v-chart>
<v-chart :option="chartOption" autoresize />
</div>
</div>
</template>

View File

@ -7,7 +7,7 @@
</div>
<div class="card__container">
<el-progress :percentage="50" :stroke-width="8"></el-progress>
<el-progress :percentage="50" :stroke-width="8" />
</div>
<div class="card__footer">

View File

@ -7,7 +7,7 @@
</div>
<div class="card__container">
<v-chart :option="chartOption" autoresize></v-chart>
<v-chart :option="chartOption" autoresize />
</div>
<div class="card__footer">

View File

@ -7,7 +7,7 @@
</div>
<div class="card__container">
<v-chart :option="chartOption" autoresize></v-chart>
<v-chart :option="chartOption" autoresize />
</div>
<div class="card__footer">

View File

@ -19,7 +19,7 @@
</div>
</div>
<v-chart :option="chartOption" autoresize></v-chart>
<v-chart :option="chartOption" autoresize />
</div>
</el-col>
@ -36,7 +36,7 @@
</div>
</div>
<v-chart :option="chartOption" autoresize></v-chart>
<v-chart :option="chartOption" autoresize />
</div>
</el-col>
</el-row>
@ -50,34 +50,34 @@
border: false,
'default-sort': {
prop: 'ud',
order: 'descending',
},
order: 'descending'
}
}"
:context-menu="false"
:columns="[
{
label: '排名',
prop: 'index',
width: 60,
width: 60
},
{
label: '搜索关键词',
prop: 'keyWord',
'min-width': 100,
'min-width': 100
},
{
label: '用户数',
prop: 'users',
'min-width': 100,
'min-width': 100
},
{
label: '周涨幅',
prop: 'ud',
sortable: 'custom',
'min-width': 100,
},
'min-width': 100
}
]"
></cl-table>
/>
</el-row>
</cl-crud>
</div>
@ -96,7 +96,7 @@ export default defineComponent({
left: 0,
top: 0,
right: 0,
bottom: 0,
bottom: 0
},
xAxis: {
type: "category",
@ -112,24 +112,24 @@ export default defineComponent({
"16:00",
"18:00",
"20:00",
"22:00",
"22:00"
],
boundaryGap: false,
boundaryGap: false
},
yAxis: {
type: "value",
splitLine: {
show: false,
show: false
},
axisTick: {
show: false,
show: false
},
axisLine: {
show: false,
show: false
},
axisLabel: {
show: false,
},
show: false
}
},
series: [
{
@ -151,7 +151,7 @@ export default defineComponent({
"1100",
"1000",
"1118",
"1322",
"1322"
],
areaStyle: {
normal: {
@ -163,29 +163,29 @@ export default defineComponent({
[
{
offset: 0,
color: "#D1E5FF",
color: "#D1E5FF"
},
{
offset: 1,
color: "#FFFFFF",
},
color: "#FFFFFF"
}
],
false
),
},
)
}
},
itemStyle: {
normal: {
color: "#4165d7",
},
color: "#4165d7"
}
},
lineStyle: {
normal: {
width: 2,
},
},
},
],
width: 2
}
}
}
]
});
function onLoad({ ctx, app }: any) {
@ -197,41 +197,41 @@ export default defineComponent({
index: 1,
keyWord: "无线耳机",
users: 983,
ud: 5,
ud: 5
},
{
index: 1,
keyWord: "运动耳机",
users: 763,
ud: -3,
ud: -3
},
{
index: 1,
keyWord: "蓝牙音箱",
users: 328,
ud: 7,
ud: 7
},
{
index: 1,
keyWord: "4k显示屏",
users: 144,
ud: 4,
ud: 4
},
{
index: 1,
keyWord: "罗技 G530",
users: 121,
ud: -1,
},
],
ud: -1
}
]
});
},
}
}).done();
app.refresh();
}
return { chartOption, onLoad };
},
}
});
</script>

View File

@ -27,8 +27,7 @@
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
/>
</div>
<ul class="sales-rank__list">

View File

@ -10,7 +10,7 @@
</div>
<div class="tab-chart__container">
<v-chart :option="chartOption" autoresize></v-chart>
<v-chart :option="chartOption" autoresize />
</div>
</div>
</template>
@ -20,9 +20,6 @@ import { defineComponent, reactive } from "vue";
import { isPc } from "/@/core/utils";
export default defineComponent({
data() {
return {};
},
setup() {
const barWidth = isPc() ? 25 : 15;
const chartOption = reactive<any>({
@ -111,6 +108,9 @@ export default defineComponent({
return {
chartOption
};
},
data() {
return {};
}
});
</script>

View File

@ -3,22 +3,22 @@
<el-row :gutter="15">
<el-col :lg="6" :md="12" :xs="24">
<div class="card">
<count-sales></count-sales>
<count-sales />
</div>
</el-col>
<el-col :lg="6" :md="12" :xs="24">
<div class="card">
<count-views></count-views>
<count-views />
</div>
</el-col>
<el-col :lg="6" :md="12" :xs="24">
<div class="card">
<count-paid></count-paid>
<count-paid />
</div>
</el-col>
<el-col :lg="6" :md="12" :xs="24">
<div class="card">
<count-effect></count-effect>
<count-effect />
</div>
</el-col>
</el-row>
@ -26,12 +26,12 @@
<el-row :gutter="15">
<el-col :lg="14" :xs="24">
<div class="card">
<tab-chart></tab-chart>
<tab-chart />
</div>
</el-col>
<el-col :lg="10" :xs="24">
<div class="card">
<sales-rank></sales-rank>
<sales-rank />
</div>
</el-col>
</el-row>
@ -39,12 +39,12 @@
<el-row :gutter="15">
<el-col :lg="14" :sm="24">
<div class="card card--last">
<hot-search></hot-search>
<hot-search />
</div>
</el-col>
<el-col :lg="10" :sm="24">
<div class="card card--last">
<category-ratio></category-ratio>
<category-ratio />
</div>
</el-col>
</el-row>
@ -71,8 +71,8 @@ export default defineComponent({
CountEffect,
TabChart,
SalesRank,
HotSearch,
},
HotSearch
}
});
</script>

View File

@ -9,7 +9,11 @@
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"],
"types": ["vite/client", "vite-svg-loader"]
"types": ["vite/client", "vite-svg-loader"],
"paths": {
"/@/*": ["./src/*"],
"/#/*": ["./types/*"]
}
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
}

View File

@ -1,6 +1,6 @@
// @ts-nocheck
import path from "path";
import { defineConfig } from "vite";
import type { UserConfig, ConfigEnv } from 'vite';
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import { svgBuilder } from "./src/core/utils/svg";
@ -11,35 +11,47 @@ function resolve(dir: string) {
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx(), svgBuilder("./src/icons/svg/")],
resolve: {
alias: {
"/@": resolve("src"),
"/#": resolve("types"),
export default ({ command, mode }: ConfigEnv): UserConfig => {
return {
base: "/",
plugins: [vue(), vueJsx(), svgBuilder("./src/icons/svg/")],
resolve: {
alias: {
"/@": resolve("src"),
"/#": resolve("types")
}
},
},
css: {
preprocessorOptions: {
scss: {
additionalData: "@import './src/assets/css/common.scss';",
},
css: {
preprocessorOptions: {
scss: {
additionalData: "@import './src/assets/css/common.scss';"
}
}
},
},
server: {
port: 9000,
proxy: {
"/dev": {
target: "http://127.0.0.1:8001",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/dev/, ""),
server: {
port: 9000,
hmr: {
overlay: true,
},
proxy: {
"/dev": {
target: "http://127.0.0.1:8001",
changeOrigin: true,
rewrite: path => path.replace(/^\/dev/, "")
},
"/pro": {
target: "https://show.cool-admin.com",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/pro/, "/api"),
},
"/pro": {
target: "https://show.cool-admin.com",
changeOrigin: true,
rewrite: path => path.replace(/^\/pro/, "/api")
}
}
},
},
});
optimizeDeps: {
include: [
],
exclude: ['vue-demi'],
},
};
};

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More