Commit 4bab3eb5 authored by 张耀's avatar 张耀

Merge branch 'dev' into zy

parents 461a5ae7 0c04363c
This diff is collapsed.
...@@ -28,11 +28,11 @@ http { ...@@ -28,11 +28,11 @@ http {
# redirect server error pages to the static page /50x.html # redirect server error pages to the static page /50x.html
# #
error_page 500 502 503 504 /50x.html; error_page 500 502 503 504 /50x.html;
location /apaas/ui { location /so/manage/ui {
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html index.htm; index index.html index.htm;
try_files $uri $uri/ /apaas/ui/index.html; try_files $uri $uri/ /so/manage/ui/index.html;
} }
} }
......
root = true
[*]
charset = utf-8
insert_final_newline = true
end_of_line = lf
indent_style = space
indent_size = 2
max_line_length = 120
node_modules node_modules
.DS_Store .DS_Store
.vscode
dist dist
dist-ssr dist-ssr
*.local *.local
\ No newline at end of file
/**
* 优先级高于.editorconfig
* https://prettier.io/docs/en/options.html
* 单引号,双引号,末尾是否逗号,是否需要分号根据团队需要配置
* 但是prettier对vue template的格式化能力有限,建议多观察是否满足需要,最佳实践还是要结合eslint进行风格统一
*/
module.exports = {
arrowParens: "always",
bracketSameLine: true, // https://prettier.io/docs/en/options.html#bracket-line
bracketSpacing: true,
embeddedLanguageFormatting: "auto",
htmlWhitespaceSensitivity: "css",
insertPragma: false,
jsxSingleQuote: false,
printWidth: 100, // 如果属性过多需要换行,减少该值
proseWrap: "preserve",
quoteProps: "as-needed",
requirePragma: false,
semi: true,
singleAttributePerLine: false,
singleQuote: false, // 双引号
tabWidth: 2, // 缩进
trailingComma: "es5",
useTabs: false, // 不要用tab缩进
vueIndentScriptAndStyle: false,
endOfLine: "lf",
};
{
"recommendations": ["esbenp.prettier-vscode"]
}
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"GitCommitPlugin.ShowEmoji": false
}
...@@ -4,11 +4,12 @@ ...@@ -4,11 +4,12 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>apaas5</title> <title>智能运维管理平台</title>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
<script type="module" src="/src/main.js"></script> <script type="module" src="/src/main.js"></script>
<script src="/config/configmap.js"></script>
</body> </body>
</html> </html>
......
This diff is collapsed.
{ {
"version": "1.0.0", "version": "3.0.1",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"version": "node version.js",
"serve": "vite preview" "serve": "vite preview"
}, },
"dependencies": { "dependencies": {
...@@ -12,9 +13,13 @@ ...@@ -12,9 +13,13 @@
"ace-builds": "^1.9.6", "ace-builds": "^1.9.6",
"axios": "^0.21.1", "axios": "^0.21.1",
"clipboard": "^2.0.11", "clipboard": "^2.0.11",
"crypto-js": "^4.1.1",
"echarts": "^5.3.3", "echarts": "^5.3.3",
"element-plus": "^2.2.9", "element-plus": "^2.2.19",
"github-markdown-css": "^5.1.0",
"html2canvas": "^1.4.1", "html2canvas": "^1.4.1",
"markdown-it": "^13.0.1",
"mavon-editor": "^3.0.0",
"sass": "^1.35.1", "sass": "^1.35.1",
"string-format": "^2.0.0", "string-format": "^2.0.0",
"uuid": "^8.3.2", "uuid": "^8.3.2",
...@@ -30,4 +35,4 @@ ...@@ -30,4 +35,4 @@
"@vue/compiler-sfc": "^3.2.31", "@vue/compiler-sfc": "^3.2.31",
"vite": "^3.0.0" "vite": "^3.0.0"
} }
} }
\ No newline at end of file
window.defaultConfig = {
session_validity_max: 30
};
\ No newline at end of file
public/favicon.ico

569 Bytes | W: | H:

public/favicon.ico

4.19 KB | W: | H:

public/favicon.ico
public/favicon.ico
public/favicon.ico
public/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
<template> <template>
<div id="app"> <div id="app" @click="readFlag = false">
<el-config-provider> <el-config-provider>
<bg-menu :path="nowParent.path" v-if="menuShow"></bg-menu> <bg-menu :path="nowParent.path" @openMsg="openMsg"></bg-menu>
<div class="container" :class="menuShow ? '' : 'full_screen'" v-if="pageShow"> <div class="container" v-if="pageShow">
<bg-nav :highlightParentRule="highlightParentRule" :title="nowParent.menuName" width="208px" :list="nowParent.children" v-show="navShow" class="con-nav" /> <!-- <bg-nav :highlightParentRule="highlightParentRule" :title="nowParent.menuName" width="208px" :list="nowParent.children" v-show="navShow" class="con-nav" /> -->
<bg-nav
v-if="nowParent.children"
:highlightParentRule="highlightParentRule"
width="208px"
:list="nowParent.children"
v-show="navShow"
class="con-nav" />
<div class="bg-main view"> <div class="bg-main view">
<router-view /> <router-view />
</div> </div>
</div> </div>
<div class="container" v-else-if="$route.path=='/login'"> <div class="container" v-else-if="$route.path == '/login'">
<div class="bg-main view"> <div class="bg-main view">
<login></login> <login></login>
</div> </div>
</div> </div>
<div class="container" v-else-if="$route.path=='/404'"> <div class="container" v-else-if="$route.path == '/register'">
<div class="bg-main view">
<register></register>
</div>
</div>
<div class="container" v-else-if="$route.path == '/password'">
<div class="bg-main view">
<password></password>
</div>
</div>
<div class="container" v-else-if="$route.path == '/404'">
<div class="bg-main view"> <div class="bg-main view">
<page404></page404> <page404></page404>
</div> </div>
</div> </div>
<!-- <msg v-model="readFlag"></msg> -->
</el-config-provider> </el-config-provider>
</div> </div>
</template> </template>
<script> <script>
import bgMenu from '@/components/bg-menu.vue' import bgMenu from "@/components/bg-menu.vue";
import login from '@/page/login/index.vue' import login from "@/page/login/index.vue";
import page404 from '@/page/404.vue' import page404 from "@/page/404.vue";
import register from "@/page/register/index.vue";
import password from "@/page/password/index.vue";
import { clearCookie } from "@/services/cookie.js";
import { resetRouter } from "@/router/index";
import $axios from "@/request/http.js";
export default { export default {
components:{ components: {
bgMenu, bgMenu,
login, login,
page404, page404,
register,
password,
}, },
computed:{ computed: {
msgBoxFlag(){ msgBoxFlag() {
return this.$store.state.msgBoxFlag return this.$store.state.msgBoxFlag;
}, },
userInfo() { userInfo() {
return this.$store.state.userInfo || {}; return this.$store.state.userInfo || {};
}, },
navMenu(){ navMenu() {
return this.$store.state.menu return this.$store.state.menu;
}, },
menuObj(){ menuObj() {
return this.$store.state.menuObj return this.$store.state.menuObj;
}, },
navShow(){ navShow() {
return false||!['/','/404','/login'].includes(this.$route.path) return false || !["/", "/404", "/login", "/register", "/password"].includes(this.$route.path);
}, },
pageShow(){ pageShow() {
return false||!['/404','/login'].includes(this.$route.path) return false || !["/404", "/login", "/register", "/password"].includes(this.$route.path);
}, },
rowPath(){ rowPath() {
if(this.pageShow&&this.$store.state.userInfo){ if (this.pageShow && this.$store.state.userInfo) {
return this.menuObj[this.$route.path].rowPath return this.menuObj[this.$route.path] && this.menuObj[this.$route.path].rowPath;
}else{ } else {
return '' return "";
} }
}, },
nowParent(){ nowParent() {
if(this.pageShow&&this.$store.state.userInfo){ if (this.pageShow && this.$store.state.userInfo) {
// return this.navMenu[this.rowPath.slice(1,4)] return this.rowPath ? this.navMenu[this.rowPath.slice(1, 2)] : "";
// return this.pathToData(this.navMenu,this.rowPath) } else {
return this.navMenu[1] return "";
}else{
return ''
} }
}, },
menuShow() {
return false||!["/ui-example"].includes(this.$route.path)
}
}, },
watch:{ watch: {
msgBoxFlag(n,o){ msgBoxFlag(n, o) {
this.readFlag = !this.readFlag this.readFlag = !this.readFlag;
} },
userInfo: {
handler() {
this.initMsg();
},
deep: true,
},
}, },
data(){ data() {
return{ return {
readFlag:false, readFlag: false,
menuIndex:'', menuIndex: "",
} };
},
created() {
// this.initMsg()
}, },
created(){ mounted() {
// this.getSysOptions();
// 用户登录状态有效检测
if (this.userInfo) {
setInterval(() => {
$axios.get("/apaas/system/v5/user/login/check");
}, 15 * 1000);
}
}, },
methods:{ methods: {
pathToData(data,path){ openMsg(data) {
this.readFlag = !this.readFlag;
let arr = path.split('.') },
let temp = null initMsg() {
let tempName = '' if (this.userInfo && this.userInfo.system_id) {
let tempPath = '' this.$trace.setOptionValue("userId", this.userInfo.system_id);
arr.forEach((e,idx) => { // this.$trace.setOptionValue('userType',this.userInfo.userType)
// this.$trace.setOptionValue('roleId',this.userInfo.roleIds.join(','))
if(idx==1){ this.$trace.setOptionValue("organization", this.userInfo.organization_id);
temp = data[e] }
tempName = data[e].menuName },
tempPath = data[e].path pathToData(data, path) {
data = data[e] let arr = path.split(".");
let temp = null;
let tempName = "";
let tempPath = "";
arr.forEach((e, idx) => {
if (idx == 1) {
temp = data[e];
tempName = data[e].menuName;
tempPath = data[e].path;
data = data[e];
} }
if(idx==2){ if (idx == 2) {
if(data.children&&data.children.length){ if (data.children && data.children.length) {
temp = data.children[e] temp = data.children[e];
data = data.children[e] data = data.children[e];
} }
} }
}); });
return { return {
menuName:tempName, menuName: tempName,
path:tempPath, path: tempPath,
children:[temp] children: [temp],
} };
}, },
highlightParentRule(pathArr){ highlightParentRule(pathArr) {
return pathArr.includes(this.$route.path) return pathArr.includes(this.$route.path);
}, },
ada(){ ada() {},
console.log(12312); },
} };
}
}
</script> </script>
<style> <style>
#app{ #app {
height: 100%; height: 100%;
} }
.container{ .container {
width: 100%; width: 100%;
height: calc(100% - 56px); height: calc(100% - 56px);
overflow: hidden; overflow: hidden;
...@@ -137,10 +180,10 @@ export default { ...@@ -137,10 +180,10 @@ export default {
.full_screen .bg-main { .full_screen .bg-main {
overflow-x: hidden; overflow-x: hidden;
} }
.con-nav{ .con-nav {
float: left; float: left;
} }
.view{ .view {
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
background-color: #ebedf2; background-color: #ebedf2;
......
This diff is collapsed.
src/assets/imgs/home_ic_user.png

3.95 KB | W: | H:

src/assets/imgs/home_ic_user.png

5.5 KB | W: | H:

src/assets/imgs/home_ic_user.png
src/assets/imgs/home_ic_user.png
src/assets/imgs/home_ic_user.png
src/assets/imgs/home_ic_user.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/imgs/img_data-complete.png

41.1 KB | W: | H:

src/assets/imgs/img_data-complete.png

9.49 KB | W: | H:

src/assets/imgs/img_data-complete.png
src/assets/imgs/img_data-complete.png
src/assets/imgs/img_data-complete.png
src/assets/imgs/img_data-complete.png
  • 2-up
  • Swipe
  • Onion skin
:root { :root {
--font-color: #404a62; --font-color: #404a62;
/* --el-color-primary-light-9: #f7f7f9; */ /* --el-color-primary-light-9: #f7f7f9; */
--el-color-white: #ffffff;
--el-color-black: #1a1a1a;
--el-color-primary: #2b4695;
--el-color-primary-light-3: #6b7eb5;
--el-color-primary-light-5: #95a3ca;
--el-color-primary-light-7: #c0c8df;
--el-color-primary-light-8: #d5daea;
--el-color-primary-light-9: #eaedf5;
--el-color-primary-dark-2: #223877;
--el-color-success: #429e8a;
--el-color-success-light-3: #7bbbad;
--el-color-success-light-5: #a1cfc5;
--el-color-success-light-7: #c7e2dc;
--el-color-success-light-8: #d9ece8;
--el-color-success-light-9: #ecf5f4;
--el-color-success-dark-2: #357e6e;
--el-color-warning: #e56600;
--el-color-warning-light-3: #ed944d;
--el-color-warning-light-5: #f2b380;
--el-color-warning-light-7: #f7d1b3;
--el-color-warning-light-8: #fae0cc;
--el-color-warning-light-9: #fcf0e6;
--el-color-warning-dark-2: #b75200;
--el-color-danger: #d75138;
--el-color-danger-light-3: #e38674;
--el-color-danger-light-5: #eba89c;
--el-color-danger-light-7: #f3cbc4;
--el-color-danger-light-8: #f7dcd7;
--el-color-danger-light-9: #fbeeeb;
--el-color-danger-dark-2: #ac412d;
--el-color-error: #d75138;
--el-color-error-light-3: #e38674;
--el-color-error-light-5: #eba89c;
--el-color-error-light-7: #f3cbc4;
--el-color-error-light-8: #f7dcd7;
--el-color-error-light-9: #fbeeeb;
--el-color-error-dark-2: #ac412d;
--el-color-info: #404a62;
--el-color-info-light-3: #7a8191;
--el-color-info-light-5: #a0a5b1;
--el-color-info-light-7: #c6c9d0;
--el-color-info-light-8: #d9dbe0;
--el-color-info-light-9: #ecedf0;
--el-color-info-dark-2: #333b4e;
--el-bg-color: #ffffff;
--el-bg-color-page: #f2f3f5;
--el-bg-color-overlay: #ffffff;
--el-text-color-primary: #202531;
--el-text-color-regular: #404a62;
--el-text-color-secondary: #909bb6;
--el-text-color-placeholder: #a9b1c7;
--el-text-color-disabled: #a9b1c7;
--el-border-color: #dadee7;
--el-border-color-light: #e3e5eb;
--el-border-color-lighter: #e6e9ef;
--el-border-color-extra-light: #edf0f5;
--el-border-color-dark: #d1d5de;
--el-border-color-darker: #cbced7;
--el-fill-color: #f0f2f5;
--el-fill-color-light: #f2f3f7;
--el-fill-color-lighter: #f7f7f9;
--el-fill-color-extra-light: #fafcff;
--el-fill-color-dark: #ebedf0;
--el-fill-color-darker: #e6e8eb;
--el-fill-color-blank: #ffffff;
--el-component-size: 36px;
}
--el-color-white: #ffffff;
--el-color-black: #1a1a1a;
--el-color-primary: #2b4695;
--el-color-primary-light-3: #6b7eb5;
--el-color-primary-light-5: #95a3ca;
--el-color-primary-light-7: #c0c8df;
--el-color-primary-light-8: #d5daea;
--el-color-primary-light-9: #eaedf5;
--el-color-primary-dark-2: #223877;
--el-color-success: #429e8a;
--el-color-success-light-3: #7bbbad;
--el-color-success-light-5: #a1cfc5;
--el-color-success-light-7: #c7e2dc;
--el-color-success-light-8: #d9ece8;
--el-color-success-light-9: #ecf5f4;
--el-color-success-dark-2: #357e6e;
--el-color-warning: #e56600;
--el-color-warning-light-3: #ed944d;
--el-color-warning-light-5: #f2b380;
--el-color-warning-light-7: #f7d1b3;
--el-color-warning-light-8: #fae0cc;
--el-color-warning-light-9: #fcf0e6;
--el-color-warning-dark-2: #b75200;
--el-color-danger: #d75138;
--el-color-danger-light-3: #e38674;
--el-color-danger-light-5: #eba89c;
--el-color-danger-light-7: #f3cbc4;
--el-color-danger-light-8: #f7dcd7;
--el-color-danger-light-9: #fbeeeb;
--el-color-danger-dark-2: #ac412d;
--el-color-error: #d75138;
--el-color-error-light-3: #e38674;
--el-color-error-light-5: #eba89c;
--el-color-error-light-7: #f3cbc4;
--el-color-error-light-8: #f7dcd7;
--el-color-error-light-9: #fbeeeb;
--el-color-error-dark-2: #ac412d;
--el-color-info: #404a62;
--el-color-info-light-3: #7a8191;
--el-color-info-light-5: #a0a5b1;
--el-color-info-light-7: #c6c9d0;
--el-color-info-light-8: #d9dbe0;
--el-color-info-light-9: #ecedf0;
--el-color-info-dark-2: #333b4e;
--el-bg-color: #ffffff;
--el-bg-color-page: #f2f3f5;
--el-bg-color-overlay: #ffffff;
--el-text-color-primary: #202531;
--el-text-color-regular: #404a62;
--el-text-color-secondary: #909bb6;
--el-text-color-placeholder: #a9b1c7;
--el-text-color-disabled: #a9b1c7;
--el-border-color: #dadee7;
--el-border-color-light: #e3e5eb;
--el-border-color-lighter: #e6e9ef;
--el-border-color-extra-light: #edf0f5;
--el-border-color-dark: #d1d5de;
--el-border-color-darker: #cbced7;
--el-fill-color: #f0f2f5;
--el-fill-color-light: #f2f3f7;
--el-fill-color-lighter: #f7f7f9;
--el-fill-color-extra-light: #fafcff;
--el-fill-color-dark: #ebedf0;
--el-fill-color-darker: #e6e8eb;
--el-fill-color-blank: #ffffff;
}
.text-hide1{
.text-hide1{ overflow: hidden;
overflow: hidden; text-overflow:ellipsis;
text-overflow:ellipsis; white-space: nowrap;
white-space: nowrap; }
} .log_content_nor::-webkit-scrollbar {
width: 0px; /*对垂直流动条有效*/
.log_content_nor::-webkit-scrollbar { height: 0px; /*对水平流动条有效*/
width: 0px; /*对垂直流动条有效*/ }
height: 0px; /*对水平流动条有效*/ \ No newline at end of file
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -7,32 +7,27 @@ ...@@ -7,32 +7,27 @@
'is-active': modelValue === btn.value, 'is-active': modelValue === btn.value,
}" }"
:key="btn.value" :key="btn.value"
@click="selectBtn(btn)" @click="selectBtn(btn)">
>
{{ btn.name }} {{ btn.name }}
</li> </li>
</ul> </ul>
</div> </div>
</template> </template>
<script> <script setup>
export default { const props = defineProps({
name: "BgBtns", modelValue: {
props: { type: [String, Number],
modelValue: { default: "",
type: [String, Number],
default: "",
},
options: {
type: Array,
default: () => [],
},
}, },
emits: ["update:modelValue"], options: {
methods: { type: Array,
selectBtn({ value }) { default: () => [],
this.$emit("update:modelValue", value);
},
}, },
});
const emit = defineEmits(["update:modelValue"]);
const selectBtn = ({ value }) => {
emit("update:modelValue", value);
}; };
</script> </script>
...@@ -12,18 +12,15 @@ ...@@ -12,18 +12,15 @@
</div> </div>
</template> </template>
<script> <script setup>
export default { const props = defineProps({
name: "BgCard", title: {
props: { type: String,
title: { default: "",
type: String,
default: "",
},
icon: {
type: String,
default: "",
},
}, },
}; icon: {
type: String,
default: "",
},
});
</script> </script>
...@@ -2,72 +2,69 @@ ...@@ -2,72 +2,69 @@
<VAceEditor <VAceEditor
v-model:value="states.content" v-model:value="states.content"
class="vue-ace-editor" class="vue-ace-editor"
:class="{'vue-ace-editor-disable':props.disabled}" :class="{ 'vue-ace-editor-disable': props.disabled }"
@input="codeChange" @input="codeChange"
:lang="props.lang" :lang="props.lang"
:theme="props.theme" :theme="props.theme"
:options="{ :options="{
useWorker: true, useWorker: true,
readOnly: props.disabled, readOnly: props.disabled,
wrap: true wrap: true,
}" }" />
/>
</template> </template>
<script setup> <script setup>
import { reactive, toRefs, watch,onMounted } from "vue"; import { reactive, toRefs, watch, onMounted } from "vue";
import { VAceEditor } from "vue3-ace-editor"; import { VAceEditor } from "vue3-ace-editor";
import ace from 'ace-builds'; import ace from "ace-builds";
import modeJsonUrl from 'ace-builds/src-noconflict/mode-json?url'; import modeJsonUrl from "ace-builds/src-noconflict/mode-json?url";
import modeJavascriptUrl from 'ace-builds/src-noconflict/mode-javascript?url'; import modeJavascriptUrl from "ace-builds/src-noconflict/mode-javascript?url";
import modeHtmlUrl from 'ace-builds/src-noconflict/mode-html?url'; import modeHtmlUrl from "ace-builds/src-noconflict/mode-html?url";
import themeGithubUrl from 'ace-builds/src-noconflict/theme-github?url'; import themeGithubUrl from "ace-builds/src-noconflict/theme-github?url";
import themeChromeUrl from 'ace-builds/src-noconflict/theme-chrome?url'; import themeChromeUrl from "ace-builds/src-noconflict/theme-chrome?url";
import themeMonokaiUrl from 'ace-builds/src-noconflict/theme-monokai?url'; import themeMonokaiUrl from "ace-builds/src-noconflict/theme-monokai?url";
import workerBaseUrl from 'ace-builds/src-noconflict/worker-base?url'; import workerBaseUrl from "ace-builds/src-noconflict/worker-base?url";
import workerJsonUrl from 'ace-builds/src-noconflict/worker-json?url'; import workerJsonUrl from "ace-builds/src-noconflict/worker-json?url";
import workerJavascriptUrl from 'ace-builds/src-noconflict/worker-javascript?url'; import workerJavascriptUrl from "ace-builds/src-noconflict/worker-javascript?url";
import workerHtmlUrl from 'ace-builds/src-noconflict/worker-html?url'; import workerHtmlUrl from "ace-builds/src-noconflict/worker-html?url";
ace.config.setModuleUrl('ace/mode/json', modeJsonUrl); ace.config.setModuleUrl("ace/mode/json", modeJsonUrl);
ace.config.setModuleUrl('ace/mode/javascript', modeJavascriptUrl); ace.config.setModuleUrl("ace/mode/javascript", modeJavascriptUrl);
ace.config.setModuleUrl('ace/mode/html', modeHtmlUrl); ace.config.setModuleUrl("ace/mode/html", modeHtmlUrl);
ace.config.setModuleUrl('ace/theme/github', themeGithubUrl); ace.config.setModuleUrl("ace/theme/github", themeGithubUrl);
ace.config.setModuleUrl('ace/theme/chrome', themeChromeUrl); ace.config.setModuleUrl("ace/theme/chrome", themeChromeUrl);
ace.config.setModuleUrl('ace/theme/monokai', themeMonokaiUrl); ace.config.setModuleUrl("ace/theme/monokai", themeMonokaiUrl);
ace.config.setModuleUrl('ace/mode/base', workerBaseUrl); ace.config.setModuleUrl("ace/mode/base", workerBaseUrl);
ace.config.setModuleUrl('ace/mode/json_worker', workerJsonUrl); ace.config.setModuleUrl("ace/mode/json_worker", workerJsonUrl);
ace.config.setModuleUrl('ace/mode/javascript_worker', workerJavascriptUrl); ace.config.setModuleUrl("ace/mode/javascript_worker", workerJavascriptUrl);
ace.config.setModuleUrl('ace/mode/html_worker', workerHtmlUrl); ace.config.setModuleUrl("ace/mode/html_worker", workerHtmlUrl);
const props = defineProps( const props = defineProps({
{ modelValue: {
modelValue: { type: String,
type:String, default: "",
default:"", },
}, disabled: {
disabled:{ type: Boolean,
type:Boolean, default: false,
default:false },
}, // lang:{
// lang:{ // type:String,
// type:String, // default:"json"
// default:"json" // },
// }, // theme:{
// theme:{ // type:String,
// type:String, // default:"themeChromeUrl"
// default:"themeChromeUrl" // },
// }, width: {
width:{ type: String,
type:String, default: "100%",
default:"100%" },
}, });
} const emit = defineEmits(["update:modelValue"]);
) // watch(
const emit = defineEmits(['update:modelValue']) // props.modelValue,
watch( // (n,o) => {
props.modelValue, // states.content = n
(n,o) => { // }
states.content = n // )
}
)
const states = reactive({ const states = reactive({
lang: "json", lang: "json",
...@@ -75,32 +72,32 @@ const states = reactive({ ...@@ -75,32 +72,32 @@ const states = reactive({
content: "", content: "",
}); });
watch( // watch(
states.content, // states.content,
(n,o) => { // (n,o) => {
emit("update:modelValue", n); // emit("update:modelValue", n);
} // }
) // )
const codeChange = (val,val1,val2)=>{ const codeChange = () => {
emit("update:modelValue", val1.renderer.content.innerText); emit("update:modelValue", states.content);
} };
onMounted(() => { onMounted(() => {
let obj = ""; let obj = "";
// console.log(typeof JSON.parse(this.datas)); try {
try { if (typeof JSON.parse(props.modelValue) == "object") {
if (typeof JSON.parse(props.modelValue) == "object") { obj = JSON.stringify(JSON.parse(props.modelValue), null, "\t");
obj = JSON.stringify(JSON.parse(props.modelValue), null, "\t"); } else {
}
} catch (e) {
obj = props.modelValue; obj = props.modelValue;
} }
states.content = obj } catch (e) {
}) obj = props.modelValue;
}
const {content} = toRefs(states) states.content = obj;
});
const { content } = toRefs(states);
</script> </script>
<style scoped> <style scoped>
...@@ -114,48 +111,48 @@ const {content} = toRefs(states) ...@@ -114,48 +111,48 @@ const {content} = toRefs(states)
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
} }
.vue-ace-editor :deep() .ace_scrollbar-v{ .vue-ace-editor :deep() .ace_scrollbar-v {
width: 0px!important; width: 0px !important;
} }
.vue-ace-editor :deep() .ace_gutter{ .vue-ace-editor :deep() .ace_gutter {
font-size: 14px; font-size: 14px;
color: #ffffff; color: #ffffff;
background-color: #262626; background-color: #262626;
} }
.vue-ace-editor :deep() .ace_gutter-cell{ .vue-ace-editor :deep() .ace_gutter-cell {
line-height: 22px; line-height: 22px;
background-color: #262626; background-color: #262626;
} }
.vue-ace-editor :deep() .ace_print-margin{ .vue-ace-editor :deep() .ace_print-margin {
width: 0; width: 0;
} }
.vue-ace-editor :deep() .ace_scroller{ .vue-ace-editor :deep() .ace_scroller {
background-color: #1a1a1a; background-color: #1a1a1a;
color: #fff; color: #fff;
caret-color:#fff; caret-color: #fff;
} }
/* 光标颜色 */ /* 光标颜色 */
.vue-ace-editor :deep() .ace_cursor{ .vue-ace-editor :deep() .ace_cursor {
color: #fff; color: #fff;
} }
.vue-ace-editor-disable :deep() .ace_scrollbar-v{ .vue-ace-editor-disable :deep() .ace_scrollbar-v {
width: 6px!important; width: 6px !important;
} }
.vue-ace-editor-disable :deep() .ace_gutter{ .vue-ace-editor-disable :deep() .ace_gutter {
background-color: #202531; background-color: #202531;
} }
.vue-ace-editor-disable :deep() .ace_gutter-cell{ .vue-ace-editor-disable :deep() .ace_gutter-cell {
background-color: #202531; background-color: #202531;
} }
.vue-ace-editor-disable :deep() .ace_scroller{ .vue-ace-editor-disable :deep() .ace_scroller {
background-color: #fff; background-color: #fff;
color: #202531; color: #202531;
} }
/* 光标颜色 */ /* 光标颜色 */
.vue-ace-editor-disable :deep() .ace_cursor{ .vue-ace-editor-disable :deep() .ace_cursor {
color: #000; color: #000;
} }
</style> </style>
<template> <template>
<div class="detail_box"> <div class="detail_box">
<div class="detail_text text_clip" :style="index==data.length-1?last_width:unit_width" v-for="(item,index) in data" :key="'data'+index"> <div
<span>{{item.title}}</span> class="detail_text text_clip"
<!-- 拓展功能 --> :style="index == data.length - 1 ? last_width : unit_width"
<template v-if="item.slot"> v-for="(item, index) in data"
<span> :key="'data' + index">
<slot v-bind:item="item" :name="item.slot"></slot> <span>{{ item.title }}</span>
</span> <!-- 拓展功能 -->
</template> <template v-if="item.slot">
<!-- 原有下载功能 --> <span>
<template v-else> <slot v-bind:item="item" :name="item.slot"></slot>
<span v-if="!item.urls" :title="item.info" @click="down_file(item.url)" :style="item.url?{color:'#515fe7',cursor:'pointer'}:''">{{item.info}}</span> </span>
<span v-else :title="item.info"> </template>
<span v-for="(it,idx) in item.urls" @click="down_file(it)" style="color:#515fe7;cursor:pointer;" :key="'urls'+idx">{{helper.downloadFileFormatNew(it)}}</span> <!-- 原有下载功能 -->
</span> <template v-else>
</template> <span
</div> v-if="!item.urls"
<div class="bg" :style="{top:(2*index+1)*42+'px'}" v-for="(item,index) in bg_num" :key="'bg'+index"></div> :title="item.info"
@click="down_file(item.url)"
:style="item.url ? { color: '#515fe7', cursor: 'pointer' } : ''"
>{{ item.info }}</span
>
<span v-else :title="item.info">
<span
v-for="(it, idx) in item.urls"
@click="down_file(it)"
style="color: #515fe7; cursor: pointer"
:key="'urls' + idx"
>{{ helper.downloadFileFormatNew(it) }}</span
>
</span>
</template>
</div> </div>
<div
class="bg"
:style="{ top: (2 * index + 1) * 42 + 'px' }"
v-for="(item, index) in bg_num"
:key="'bg' + index"></div>
</div>
</template> </template>
<script> <script setup>
import helper from './utils/index.js' import { reactive, ref, onBeforeMount, toRefs, watch } from "vue";
console.log(helper); import helper from "./utils/index.js";
export default { const props = defineProps({
props: { data: {
data:{ type: Array,
type: Array, default: () => [],
default: () => [], },
}, layout: {
layout:{ line_num: 4,
line_num:4 },
} });
},
components: {
}, const unit_width = ref(0);
data() { const last_width = ref(0);
return { const bg_num = ref(0);
helper,
unit_width:0,
last_width:0,
bg_num:0,
};
},
watch: {
data:{
handler: function(n, o) {
if(this.layout.line_num){
this.unit_width = {width:100/this.layout.line_num +'%'}
}
if(this.layout.line_num&&n.length%this.layout.line_num!==0){//计算最后一个格子的宽度
this.last_width = {width:(this.layout.line_num-(n.length%this.layout.line_num)+1)/this.layout.line_num*100+'%'}
}else{
this.last_width = {width:100/this.layout.line_num +'%'}
}
if(n.length<this.layout.line_num){
return
}else{
this.bg_num = Math.floor((Math.ceil(n.length/this.layout.line_num))/2)
}
},
immediate: true
}
},
computed: {
},
created() {
},
mounted() {
}, watch(
methods: { () => props.data,
down_file(url){ (n, o) => {
if(url){ if (props.layout.line_num) {
console.log(url); unit_width.value = { width: 100 / props.layout.line_num + "%" };
const a = document.createElement("a"); // 创建a标签 }
a.setAttribute("download", ""); // download属性 if (props.layout.line_num && n.length % props.layout.line_num !== 0) {
a.setAttribute("href", url); // href链接 //计算最后一个格子的宽度
a.click(); // 自执行点击事件 last_width.value = {
} width: ((props.layout.line_num - (n.length % this.layout.line_num) + 1) / this.layout.line_num) * 100 + "%",
} };
}, } else {
last_width.value = { width: 100 / props.layout.line_num + "%" };
}
if (n.length < props.layout.line_num) {
return;
} else {
bg_num.value = Math.floor(Math.ceil(n.length / props.layout.line_num) / 2);
}
}
);
const down_file = (url) => {
if (url) {
const a = document.createElement("a"); // 创建a标签
a.setAttribute("download", ""); // download属性
a.setAttribute("href", url); // href链接
a.click(); // 自执行点击事件
}
}; };
</script> </script>
<style scoped> <style scoped>
.detail_box{ .detail_box {
width: 100%; width: 100%;
border-bottom: 1px solid #e3e5ef; border-bottom: 1px solid #e3e5ef;
border-right: 1px solid #e3e5ef; border-right: 1px solid #e3e5ef;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
} }
.detail_box .detail_text{ .detail_box .detail_text {
width: 25%; width: 25%;
height: 42px; height: 42px;
line-height: 42px; line-height: 42px;
...@@ -107,16 +108,16 @@ export default { ...@@ -107,16 +108,16 @@ export default {
position: relative; position: relative;
z-index: 1; z-index: 1;
} }
.detail_box .detail_text span:nth-of-type(1){ .detail_box .detail_text span:nth-of-type(1) {
color: #616f94; color: #616f94;
} }
.detail_box .detail_text span:nth-of-type(2){ .detail_box .detail_text span:nth-of-type(2) {
color: #404a62; color: #404a62;
} }
.bg{ .bg {
background-color:#f7f8f9; background-color: #f7f8f9;
width: 100%; width: 100%;
height: 42px; height: 42px;
position: absolute; position: absolute;
} }
</style> </style>
<template> <template>
<div class="out-detail"> <div class="out-detail">
<div class="row-box" v-for="(item,index) in list" :style="{width:item.width}" :key="'row-box'+index"> <div class="row-box" v-for="(item, index) in list" :style="{ width: item.width }" :key="'row-box' + index">
<p class="detail-module" v-if="!item.slot"> <p class="detail-module" v-if="!item.slot">
<span :style="{width:itemWidth}">{{item.label}}</span> <span :style="{ width: itemWidth }">{{ item.label }}</span>
<span class="text_clip" :title="item.value" v-if="!item.childSlot">{{item.value}}</span> <span class="text_clip" :title="item.value" v-if="!item.childSlot">{{ item.value }}</span>
<span v-else> <span v-else>
<slot :name="item.childSlot" :data="item"></slot> <slot :name="item.childSlot" :data="item"></slot>
</span> </span>
</p> </p>
<template v-else> <template v-else>
<slot :name="item.slot" :data="item"></slot> <slot :name="item.slot" :data="item"></slot>
</template> </template>
</div>
</div> </div>
</div>
</template> </template>
<script> <script setup>
export default { const props = defineProps({
props: { list: {
list:{ type: Array,
type:Array, default: () => [],
default:()=>[] },
}, itemWidth: {
itemWidth:{ type: String,
type:String, default: "",
default:'' },
} });
},
components: {
},
data() {
return {
};
},
watch: {
},
computed: {
},
created() {
},
mounted() {
},
methods: {
},
};
</script> </script>
<style scoped> <style scoped>
.out-detail{ .out-detail {
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
border-right: solid 1px #dadee7; border-right: solid 1px #dadee7;
border-bottom: solid 1px #dadee7; border-bottom: solid 1px #dadee7;
} }
.row-box{ .row-box {
width: 50%; width: 50%;
flex-grow:1; flex-grow: 1;
text-align: left; text-align: left;
line-height: 48px; line-height: 48px;
min-height: 48px; min-height: 48px;
border-left: solid 1px #dadee7; border-left: solid 1px #dadee7;
border-top: solid 1px #dadee7; border-top: solid 1px #dadee7;
font-size: 14px; font-size: 14px;
color: #404a62; color: #404a62;
} }
.row-box .detail-module{ .row-box .detail-module {
height: 100%; height: 100%;
display: flex; display: flex;
} }
.row-box .detail-module span{ .row-box .detail-module span {
height: 100%; height: 100%;
display: inline-block; display: inline-block;
padding-left: 15px; padding-left: 15px;
box-sizing: border-box; box-sizing: border-box;
} }
.row-box .detail-module span:nth-of-type(1){ .row-box .detail-module span:nth-of-type(1) {
background-color: #f7f7f9; background-color: #f7f7f9;
min-width: 114px; min-width: 114px;
border-right: solid 1px #dadee7; border-right: solid 1px #dadee7;
} }
.row-box .detail-module span:nth-of-type(2){ .row-box .detail-module span:nth-of-type(2) {
flex-grow:1; flex-grow: 1;
} }
</style> </style>
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
:class="{ :class="{
current: activeName === item.name, current: activeName === item.name,
}" }"
@click="changeActiveName(item, index)" @click="changeActiveName(item, index)">
>
{{ item.label }} {{ item.label }}
</li> </li>
<li> <li>
...@@ -44,8 +43,7 @@ ...@@ -44,8 +43,7 @@
:class="{ :class="{
current: activeName === item.name, current: activeName === item.name,
}" }"
@click="changeActiveName(item, index)" @click="changeActiveName(item, index)">
>
{{ item.label }} {{ item.label }}
</li> </li>
<li> <li>
...@@ -60,84 +58,76 @@ ...@@ -60,84 +58,76 @@
</div> </div>
</template> </template>
<script> <script setup>
export default { import { ref, provide, reactive, onBeforeMount, onMounted, onUnmounted, nextTick, toRefs, useSlots } from "vue";
name: "BgDetail",
provide() { const slots = useSlots();
return {
getActiveName: () => { const activeName = ref("");
return this.activeName;
}, const bgDetail = ref(null);
getIsTabs: () => { provide("getActiveName", activeName.value);
return false;
}, provide("getIsTabs", false);
};
}, const showFixedBars = ref(false);
data() {
return { const state = reactive({
activeName: "", scrollCallback: null,
showFixedBars: false, });
scrollCallback: null,
}; const calcTabs = () => {
}, let tabSlots = [];
methods: {
calcTabs() { if (slots.default()) {
let tabSlots = []; tabSlots = slots
.default()
if (this.$slots.default) { .filter((vnode) => vnode.tag && vnode.componentOptions && vnode.componentOptions.Ctor.options.name === "BgTab")
tabSlots = this.$slots.default .map((vnode) => vnode.componentOptions.propsData);
.filter( }
(vnode) =>
vnode.tag && return tabSlots;
vnode.componentOptions &&
vnode.componentOptions.Ctor.options.name === "BgTab"
)
.map((vnode) => vnode.componentOptions.propsData);
}
return tabSlots;
},
changeActiveName({ name }, index) {
let targetEl = this.$el.querySelectorAll(`.bg-tab`)[index];
let targetCtx = document.querySelector(`.bg-main`);
targetCtx.scrollTop = targetEl && targetEl.offsetTop - 165;
this.activeName = name;
this.scrollCallback = () => {
this.activeName = name;
};
},
scrollAction() {
let targetCtx = document.querySelector(`.bg-main`);
let ctxScrollTop = targetCtx.scrollTop || 0;
let targetEls = this.$el.querySelectorAll(`.bg-tab`);
let tabs = this.calcTabs();
for (let i = 0; i < targetEls.length; i++) {
let targetEl = targetEls[i];
if (ctxScrollTop >= targetEl.offsetTop) {
this.activeName = tabs[i].name;
}
}
this.showFixedBars = ctxScrollTop > 222;
this.scrollCallback && this.scrollCallback();
this.scrollCallback = null;
},
},
mounted() {
this.$nextTick(() => {
let tabs = this.calcTabs();
this.activeName = tabs[0] && tabs[0].name;
this.scrollAction();
window.addEventListener("scroll", this.scrollAction, true);
});
},
destroyed() {
window.removeEventListener("scroll", this.scrollAction, true);
},
}; };
const changeActiveName = ({ name }, index) => {
let targetEl = bgDetail.value.querySelectorAll(`.bg-tab`)[index];
let targetCtx = document.querySelector(`.bg-main`);
targetCtx.scrollTop = targetEl && targetEl.offsetTop - 165;
activeName.value = name;
state.scrollCallback = () => {
activeName.value = name;
};
};
const scrollAction = () => {
let targetCtx = document.querySelector(`.bg-main`);
let ctxScrollTop = targetCtx.scrollTop || 0;
let targetEls = bgDetail.value.querySelectorAll(`.bg-tab`);
let tabs = calcTabs();
for (let i = 0; i < targetEls.length; i++) {
let targetEl = targetEls[i];
if (ctxScrollTop >= targetEl.offsetTop) {
activeName.value = tabs[i].name;
}
}
showFixedBars.value = ctxScrollTop > 222;
state.scrollCallback && state.scrollCallback();
state.scrollCallback = null;
};
onMounted(() => {
nextTick().then(() => {
let tabs = calcTabs();
activeName.value = tabs[0] && tabs[0].name;
scrollAction();
window.addEventListener("scroll", scrollAction, true);
});
});
onUnmounted(() => {
window.removeEventListener("scroll", scrollAction, true);
});
</script> </script>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import {createI18n} from 'vue-i18n' import {createI18n} from 'vue-i18n/index'
import lang from './index' import lang from './index'
const i18n = createI18n({ const i18n = createI18n({
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment