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

Merge branch 'dev' into zy

parents 461a5ae7 0c04363c
This diff is collapsed.
......@@ -28,11 +28,11 @@ http {
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location /apaas/ui {
location /so/manage/ui {
root /usr/share/nginx/html;
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
.DS_Store
.vscode
dist
dist-ssr
*.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 @@
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>apaas5</title>
<title>智能运维管理平台</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
<script src="/config/configmap.js"></script>
</body>
</html>
......
This diff is collapsed.
{
"version": "1.0.0",
"version": "3.0.1",
"scripts": {
"dev": "vite",
"build": "vite build",
"version": "node version.js",
"serve": "vite preview"
},
"dependencies": {
......@@ -12,9 +13,13 @@
"ace-builds": "^1.9.6",
"axios": "^0.21.1",
"clipboard": "^2.0.11",
"crypto-js": "^4.1.1",
"echarts": "^5.3.3",
"element-plus": "^2.2.9",
"element-plus": "^2.2.19",
"github-markdown-css": "^5.1.0",
"html2canvas": "^1.4.1",
"markdown-it": "^13.0.1",
"mavon-editor": "^3.0.0",
"sass": "^1.35.1",
"string-format": "^2.0.0",
"uuid": "^8.3.2",
......
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>
<div id="app">
<div id="app" @click="readFlag = false">
<el-config-provider>
<bg-menu :path="nowParent.path" v-if="menuShow"></bg-menu>
<div class="container" :class="menuShow ? '' : 'full_screen'" v-if="pageShow">
<bg-nav :highlightParentRule="highlightParentRule" :title="nowParent.menuName" width="208px" :list="nowParent.children" v-show="navShow" class="con-nav" />
<bg-menu :path="nowParent.path" @openMsg="openMsg"></bg-menu>
<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
v-if="nowParent.children"
:highlightParentRule="highlightParentRule"
width="208px"
:list="nowParent.children"
v-show="navShow"
class="con-nav" />
<div class="bg-main view">
<router-view />
</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">
<login></login>
</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">
<page404></page404>
</div>
</div>
<!-- <msg v-model="readFlag"></msg> -->
</el-config-provider>
</div>
</template>
<script>
import bgMenu from '@/components/bg-menu.vue'
import login from '@/page/login/index.vue'
import page404 from '@/page/404.vue'
import bgMenu from "@/components/bg-menu.vue";
import login from "@/page/login/index.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 {
components:{
components: {
bgMenu,
login,
page404,
register,
password,
},
computed:{
msgBoxFlag(){
return this.$store.state.msgBoxFlag
computed: {
msgBoxFlag() {
return this.$store.state.msgBoxFlag;
},
userInfo() {
return this.$store.state.userInfo || {};
},
navMenu(){
return this.$store.state.menu
navMenu() {
return this.$store.state.menu;
},
menuObj(){
return this.$store.state.menuObj
menuObj() {
return this.$store.state.menuObj;
},
navShow(){
return false||!['/','/404','/login'].includes(this.$route.path)
navShow() {
return false || !["/", "/404", "/login", "/register", "/password"].includes(this.$route.path);
},
pageShow(){
return false||!['/404','/login'].includes(this.$route.path)
pageShow() {
return false || !["/404", "/login", "/register", "/password"].includes(this.$route.path);
},
rowPath(){
if(this.pageShow&&this.$store.state.userInfo){
return this.menuObj[this.$route.path].rowPath
}else{
return ''
rowPath() {
if (this.pageShow && this.$store.state.userInfo) {
return this.menuObj[this.$route.path] && this.menuObj[this.$route.path].rowPath;
} else {
return "";
}
},
nowParent(){
if(this.pageShow&&this.$store.state.userInfo){
// return this.navMenu[this.rowPath.slice(1,4)]
// return this.pathToData(this.navMenu,this.rowPath)
return this.navMenu[1]
}else{
return ''
nowParent() {
if (this.pageShow && this.$store.state.userInfo) {
return this.rowPath ? this.navMenu[this.rowPath.slice(1, 2)] : "";
} else {
return "";
}
},
menuShow() {
return false||!["/ui-example"].includes(this.$route.path)
}
},
watch:{
msgBoxFlag(n,o){
this.readFlag = !this.readFlag
}
watch: {
msgBoxFlag(n, o) {
this.readFlag = !this.readFlag;
},
userInfo: {
handler() {
this.initMsg();
},
data(){
return{
readFlag:false,
menuIndex:'',
deep: true,
},
},
data() {
return {
readFlag: false,
menuIndex: "",
};
},
created() {
// this.initMsg()
},
mounted() {
// this.getSysOptions();
// 用户登录状态有效检测
if (this.userInfo) {
setInterval(() => {
$axios.get("/apaas/system/v5/user/login/check");
}, 15 * 1000);
}
},
created(){
methods: {
openMsg(data) {
this.readFlag = !this.readFlag;
},
methods:{
pathToData(data,path){
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]
initMsg() {
if (this.userInfo && this.userInfo.system_id) {
this.$trace.setOptionValue("userId", this.userInfo.system_id);
// this.$trace.setOptionValue('userType',this.userInfo.userType)
// this.$trace.setOptionValue('roleId',this.userInfo.roleIds.join(','))
this.$trace.setOptionValue("organization", this.userInfo.organization_id);
}
},
pathToData(data, path) {
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(data.children&&data.children.length){
temp = data.children[e]
data = data.children[e]
if (idx == 2) {
if (data.children && data.children.length) {
temp = data.children[e];
data = data.children[e];
}
}
});
return {
menuName:tempName,
path:tempPath,
children:[temp]
}
menuName: tempName,
path: tempPath,
children: [temp],
};
},
highlightParentRule(pathArr){
return pathArr.includes(this.$route.path)
highlightParentRule(pathArr) {
return pathArr.includes(this.$route.path);
},
ada(){
console.log(12312);
}
}
}
ada() {},
},
};
</script>
<style>
#app{
#app {
height: 100%;
}
.container{
.container {
width: 100%;
height: calc(100% - 56px);
overflow: hidden;
......@@ -137,10 +180,10 @@ export default {
.full_screen .bg-main {
overflow-x: hidden;
}
.con-nav{
.con-nav {
float: left;
}
.view{
.view {
height: 100%;
overflow-y: auto;
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 {
--font-color: #404a62;
/* --el-color-primary-light-9: #f7f7f9; */
--el-color-white: #ffffff;
--el-color-black: #1a1a1a;
--el-color-primary: #2b4695;
......@@ -67,17 +66,17 @@
--el-fill-color-dark: #ebedf0;
--el-fill-color-darker: #e6e8eb;
--el-fill-color-blank: #ffffff;
}
--el-component-size: 36px;
}
.text-hide1{
.text-hide1{
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.log_content_nor::-webkit-scrollbar {
}
.log_content_nor::-webkit-scrollbar {
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,18 +7,15 @@
'is-active': modelValue === btn.value,
}"
:key="btn.value"
@click="selectBtn(btn)"
>
@click="selectBtn(btn)">
{{ btn.name }}
</li>
</ul>
</div>
</template>
<script>
export default {
name: "BgBtns",
props: {
<script setup>
const props = defineProps({
modelValue: {
type: [String, Number],
default: "",
......@@ -27,12 +24,10 @@ export default {
type: Array,
default: () => [],
},
},
emits: ["update:modelValue"],
methods: {
selectBtn({ value }) {
this.$emit("update:modelValue", value);
},
},
});
const emit = defineEmits(["update:modelValue"]);
const selectBtn = ({ value }) => {
emit("update:modelValue", value);
};
</script>
......@@ -12,10 +12,8 @@
</div>
</template>
<script>
export default {
name: "BgCard",
props: {
<script setup>
const props = defineProps({
title: {
type: String,
default: "",
......@@ -24,6 +22,5 @@ export default {
type: String,
default: "",
},
},
};
});
</script>
......@@ -2,50 +2,48 @@
<VAceEditor
v-model:value="states.content"
class="vue-ace-editor"
:class="{'vue-ace-editor-disable':props.disabled}"
:class="{ 'vue-ace-editor-disable': props.disabled }"
@input="codeChange"
:lang="props.lang"
:theme="props.theme"
:options="{
useWorker: true,
readOnly: props.disabled,
wrap: true
}"
/>
wrap: true,
}" />
</template>
<script setup>
import { reactive, toRefs, watch,onMounted } from "vue";
import { reactive, toRefs, watch, onMounted } from "vue";
import { VAceEditor } from "vue3-ace-editor";
import ace from 'ace-builds';
import modeJsonUrl from 'ace-builds/src-noconflict/mode-json?url';
import modeJavascriptUrl from 'ace-builds/src-noconflict/mode-javascript?url';
import modeHtmlUrl from 'ace-builds/src-noconflict/mode-html?url';
import themeGithubUrl from 'ace-builds/src-noconflict/theme-github?url';
import themeChromeUrl from 'ace-builds/src-noconflict/theme-chrome?url';
import themeMonokaiUrl from 'ace-builds/src-noconflict/theme-monokai?url';
import workerBaseUrl from 'ace-builds/src-noconflict/worker-base?url';
import workerJsonUrl from 'ace-builds/src-noconflict/worker-json?url';
import workerJavascriptUrl from 'ace-builds/src-noconflict/worker-javascript?url';
import workerHtmlUrl from 'ace-builds/src-noconflict/worker-html?url';
ace.config.setModuleUrl('ace/mode/json', modeJsonUrl);
ace.config.setModuleUrl('ace/mode/javascript', modeJavascriptUrl);
ace.config.setModuleUrl('ace/mode/html', modeHtmlUrl);
ace.config.setModuleUrl('ace/theme/github', themeGithubUrl);
ace.config.setModuleUrl('ace/theme/chrome', themeChromeUrl);
ace.config.setModuleUrl('ace/theme/monokai', themeMonokaiUrl);
ace.config.setModuleUrl('ace/mode/base', workerBaseUrl);
ace.config.setModuleUrl('ace/mode/json_worker', workerJsonUrl);
ace.config.setModuleUrl('ace/mode/javascript_worker', workerJavascriptUrl);
ace.config.setModuleUrl('ace/mode/html_worker', workerHtmlUrl);
const props = defineProps(
{
import ace from "ace-builds";
import modeJsonUrl from "ace-builds/src-noconflict/mode-json?url";
import modeJavascriptUrl from "ace-builds/src-noconflict/mode-javascript?url";
import modeHtmlUrl from "ace-builds/src-noconflict/mode-html?url";
import themeGithubUrl from "ace-builds/src-noconflict/theme-github?url";
import themeChromeUrl from "ace-builds/src-noconflict/theme-chrome?url";
import themeMonokaiUrl from "ace-builds/src-noconflict/theme-monokai?url";
import workerBaseUrl from "ace-builds/src-noconflict/worker-base?url";
import workerJsonUrl from "ace-builds/src-noconflict/worker-json?url";
import workerJavascriptUrl from "ace-builds/src-noconflict/worker-javascript?url";
import workerHtmlUrl from "ace-builds/src-noconflict/worker-html?url";
ace.config.setModuleUrl("ace/mode/json", modeJsonUrl);
ace.config.setModuleUrl("ace/mode/javascript", modeJavascriptUrl);
ace.config.setModuleUrl("ace/mode/html", modeHtmlUrl);
ace.config.setModuleUrl("ace/theme/github", themeGithubUrl);
ace.config.setModuleUrl("ace/theme/chrome", themeChromeUrl);
ace.config.setModuleUrl("ace/theme/monokai", themeMonokaiUrl);
ace.config.setModuleUrl("ace/mode/base", workerBaseUrl);
ace.config.setModuleUrl("ace/mode/json_worker", workerJsonUrl);
ace.config.setModuleUrl("ace/mode/javascript_worker", workerJavascriptUrl);
ace.config.setModuleUrl("ace/mode/html_worker", workerHtmlUrl);
const props = defineProps({
modelValue: {
type:String,
default:"",
type: String,
default: "",
},
disabled:{
type:Boolean,
default:false
disabled: {
type: Boolean,
default: false,
},
// lang:{
// type:String,
......@@ -55,19 +53,18 @@ const props = defineProps(
// type:String,
// default:"themeChromeUrl"
// },
width:{
type:String,
default:"100%"
width: {
type: String,
default: "100%",
},
}
)
const emit = defineEmits(['update:modelValue'])
watch(
props.modelValue,
(n,o) => {
states.content = n
}
)
});
const emit = defineEmits(["update:modelValue"]);
// watch(
// props.modelValue,
// (n,o) => {
// states.content = n
// }
// )
const states = reactive({
lang: "json",
......@@ -75,32 +72,32 @@ const states = reactive({
content: "",
});
watch(
states.content,
(n,o) => {
emit("update:modelValue", n);
}
)
// watch(
// states.content,
// (n,o) => {
// emit("update:modelValue", n);
// }
// )
const codeChange = (val,val1,val2)=>{
emit("update:modelValue", val1.renderer.content.innerText);
}
const codeChange = () => {
emit("update:modelValue", states.content);
};
onMounted(() => {
let obj = "";
// console.log(typeof JSON.parse(this.datas));
try {
if (typeof JSON.parse(props.modelValue) == "object") {
obj = JSON.stringify(JSON.parse(props.modelValue), null, "\t");
} else {
obj = props.modelValue;
}
} catch (e) {
obj = props.modelValue;
}
states.content = obj
})
const {content} = toRefs(states)
states.content = obj;
});
const { content } = toRefs(states);
</script>
<style scoped>
......@@ -114,48 +111,48 @@ const {content} = toRefs(states)
border-radius: 4px;
overflow: hidden;
}
.vue-ace-editor :deep() .ace_scrollbar-v{
width: 0px!important;
.vue-ace-editor :deep() .ace_scrollbar-v {
width: 0px !important;
}
.vue-ace-editor :deep() .ace_gutter{
.vue-ace-editor :deep() .ace_gutter {
font-size: 14px;
color: #ffffff;
background-color: #262626;
}
.vue-ace-editor :deep() .ace_gutter-cell{
.vue-ace-editor :deep() .ace_gutter-cell {
line-height: 22px;
background-color: #262626;
}
.vue-ace-editor :deep() .ace_print-margin{
.vue-ace-editor :deep() .ace_print-margin {
width: 0;
}
.vue-ace-editor :deep() .ace_scroller{
.vue-ace-editor :deep() .ace_scroller {
background-color: #1a1a1a;
color: #fff;
caret-color:#fff;
caret-color: #fff;
}
/* 光标颜色 */
.vue-ace-editor :deep() .ace_cursor{
.vue-ace-editor :deep() .ace_cursor {
color: #fff;
}
.vue-ace-editor-disable :deep() .ace_scrollbar-v{
width: 6px!important;
.vue-ace-editor-disable :deep() .ace_scrollbar-v {
width: 6px !important;
}
.vue-ace-editor-disable :deep() .ace_gutter{
.vue-ace-editor-disable :deep() .ace_gutter {
background-color: #202531;
}
.vue-ace-editor-disable :deep() .ace_gutter-cell{
.vue-ace-editor-disable :deep() .ace_gutter-cell {
background-color: #202531;
}
.vue-ace-editor-disable :deep() .ace_scroller{
.vue-ace-editor-disable :deep() .ace_scroller {
background-color: #fff;
color: #202531;
}
/* 光标颜色 */
.vue-ace-editor-disable :deep() .ace_cursor{
.vue-ace-editor-disable :deep() .ace_cursor {
color: #000;
}
</style>
<template>
<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">
<span>{{item.title}}</span>
<div
class="detail_text text_clip"
:style="index == data.length - 1 ? last_width : unit_width"
v-for="(item, index) in data"
:key="'data' + index">
<span>{{ item.title }}</span>
<!-- 拓展功能 -->
<template v-if="item.slot">
<span>
......@@ -10,93 +14,90 @@
</template>
<!-- 原有下载功能 -->
<template v-else>
<span v-if="!item.urls" :title="item.info" @click="down_file(item.url)" :style="item.url?{color:'#515fe7',cursor:'pointer'}:''">{{item.info}}</span>
<span
v-if="!item.urls"
: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
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 class="bg" :style="{top:(2*index+1)*42+'px'}" v-for="(item,index) in bg_num" :key="'bg'+index"></div>
<div
class="bg"
:style="{ top: (2 * index + 1) * 42 + 'px' }"
v-for="(item, index) in bg_num"
:key="'bg' + index"></div>
</div>
</template>
<script>
import helper from './utils/index.js'
console.log(helper);
export default {
props: {
data:{
<script setup>
import { reactive, ref, onBeforeMount, toRefs, watch } from "vue";
import helper from "./utils/index.js";
const props = defineProps({
data: {
type: Array,
default: () => [],
},
layout:{
line_num:4
}
layout: {
line_num: 4,
},
components: {
});
},
data() {
return {
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 +'%'}
const unit_width = ref(0);
const last_width = ref(0);
const bg_num = ref(0);
watch(
() => props.data,
(n, o) => {
if (props.layout.line_num) {
unit_width.value = { width: 100 / props.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 (props.layout.line_num && n.length % props.layout.line_num !== 0) {
//计算最后一个格子的宽度
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<this.layout.line_num){
return
}else{
this.bg_num = Math.floor((Math.ceil(n.length/this.layout.line_num))/2)
if (n.length < props.layout.line_num) {
return;
} else {
bg_num.value = Math.floor(Math.ceil(n.length / props.layout.line_num) / 2);
}
},
immediate: true
}
);
},
computed: {
},
created() {
},
mounted() {
},
methods: {
down_file(url){
if(url){
console.log(url);
const down_file = (url) => {
if (url) {
const a = document.createElement("a"); // 创建a标签
a.setAttribute("download", ""); // download属性
a.setAttribute("href", url); // href链接
a.click(); // 自执行点击事件
}
}
},
};
</script>
<style scoped>
.detail_box{
.detail_box {
width: 100%;
border-bottom: 1px solid #e3e5ef;
border-right: 1px solid #e3e5ef;
overflow: hidden;
position: relative;
}
.detail_box .detail_text{
.detail_box .detail_text {
width: 25%;
height: 42px;
line-height: 42px;
......@@ -107,14 +108,14 @@ export default {
position: relative;
z-index: 1;
}
.detail_box .detail_text span:nth-of-type(1){
.detail_box .detail_text span:nth-of-type(1) {
color: #616f94;
}
.detail_box .detail_text span:nth-of-type(2){
.detail_box .detail_text span:nth-of-type(2) {
color: #404a62;
}
.bg{
background-color:#f7f8f9;
.bg {
background-color: #f7f8f9;
width: 100%;
height: 42px;
position: absolute;
......
<template>
<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">
<span :style="{width:itemWidth}">{{item.label}}</span>
<span class="text_clip" :title="item.value" v-if="!item.childSlot">{{item.value}}</span>
<span :style="{ width: itemWidth }">{{ item.label }}</span>
<span class="text_clip" :title="item.value" v-if="!item.childSlot">{{ item.value }}</span>
<span v-else>
<slot :name="item.childSlot" :data="item"></slot>
</span>
......@@ -15,46 +15,21 @@
</div>
</template>
<script>
export default {
props: {
list:{
type:Array,
default:()=>[]
<script setup>
const props = defineProps({
list: {
type: Array,
default: () => [],
},
itemWidth:{
type:String,
default:''
}
itemWidth: {
type: String,
default: "",
},
components: {
},
data() {
return {
};
},
watch: {
},
computed: {
},
created() {
},
mounted() {
},
methods: {
},
};
});
</script>
<style scoped>
.out-detail{
.out-detail {
width: 100%;
overflow: hidden;
display: flex;
......@@ -62,9 +37,9 @@ export default {
border-right: solid 1px #dadee7;
border-bottom: solid 1px #dadee7;
}
.row-box{
.row-box {
width: 50%;
flex-grow:1;
flex-grow: 1;
text-align: left;
line-height: 48px;
min-height: 48px;
......@@ -73,22 +48,22 @@ export default {
font-size: 14px;
color: #404a62;
}
.row-box .detail-module{
.row-box .detail-module {
height: 100%;
display: flex;
}
.row-box .detail-module span{
.row-box .detail-module span {
height: 100%;
display: inline-block;
padding-left: 15px;
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;
min-width: 114px;
border-right: solid 1px #dadee7;
}
.row-box .detail-module span:nth-of-type(2){
flex-grow:1;
.row-box .detail-module span:nth-of-type(2) {
flex-grow: 1;
}
</style>
......@@ -9,8 +9,7 @@
:class="{
current: activeName === item.name,
}"
@click="changeActiveName(item, index)"
>
@click="changeActiveName(item, index)">
{{ item.label }}
</li>
<li>
......@@ -44,8 +43,7 @@
:class="{
current: activeName === item.name,
}"
@click="changeActiveName(item, index)"
>
@click="changeActiveName(item, index)">
{{ item.label }}
</li>
<li>
......@@ -60,84 +58,76 @@
</div>
</template>
<script>
export default {
name: "BgDetail",
provide() {
return {
getActiveName: () => {
return this.activeName;
},
getIsTabs: () => {
return false;
},
};
},
data() {
return {
activeName: "",
showFixedBars: false,
<script setup>
import { ref, provide, reactive, onBeforeMount, onMounted, onUnmounted, nextTick, toRefs, useSlots } from "vue";
const slots = useSlots();
const activeName = ref("");
const bgDetail = ref(null);
provide("getActiveName", activeName.value);
provide("getIsTabs", false);
const showFixedBars = ref(false);
const state = reactive({
scrollCallback: null,
};
},
methods: {
calcTabs() {
});
const calcTabs = () => {
let tabSlots = [];
if (this.$slots.default) {
tabSlots = this.$slots.default
.filter(
(vnode) =>
vnode.tag &&
vnode.componentOptions &&
vnode.componentOptions.Ctor.options.name === "BgTab"
)
if (slots.default()) {
tabSlots = slots
.default()
.filter((vnode) => vnode.tag && 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];
};
const changeActiveName = ({ name }, index) => {
let targetEl = bgDetail.value.querySelectorAll(`.bg-tab`)[index];
let targetCtx = document.querySelector(`.bg-main`);
targetCtx.scrollTop = targetEl && targetEl.offsetTop - 165;
this.activeName = name;
this.scrollCallback = () => {
this.activeName = name;
activeName.value = name;
state.scrollCallback = () => {
activeName.value = name;
};
},
scrollAction() {
};
const scrollAction = () => {
let targetCtx = document.querySelector(`.bg-main`);
let ctxScrollTop = targetCtx.scrollTop || 0;
let targetEls = this.$el.querySelectorAll(`.bg-tab`);
let tabs = this.calcTabs();
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) {
this.activeName = tabs[i].name;
activeName.value = 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);
},
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>
......@@ -3,7 +3,7 @@
<span class="bg-filtrate-text">{{ name }}</span>
<div class="bg-filtrate-list">
<el-date-picker
v-model="value"
v-model="useTime"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="~"
......@@ -15,31 +15,27 @@
</div>
</template>
<script>
export default {
name: "BgFilterDate",
model: {
prop: "time",
event: "change",
},
props: {
<script setup>
import { reactive, ref, onBeforeMount, toRefs, computed, watch } from "vue";
const props = defineProps({
name: {
type: String,
default: "",
},
time: {
type: String,
default: "",
},
data() {
return {
value: ""
}
},
computed: {
});
const emit = defineEmits(["update:time"]);
const useTime = computed({
get() {
return props.time;
},
methods: {
change(event) {
this.$emit("change", event);
},
set(value) {
emit("update:time", value);
},
};
});
</script>
<template>
<div
class="bg-filter-group"
:style="{ 'border-bottom': showFlag ? 'none' : '', 'padding-bottom': showFlag ? '8px' : '16px' }">
<div class="top-filter">
<div class="left-slot">
<slot name="left_action"></slot>
</div>
<div class="right-filter">
<el-input
v-if="showSearch"
:placeholder="placeholder"
@keydown.enter="search"
@clear="search"
clearable
v-model.trim="modelValue">
<template #append>
<div class="append-btn" @click="search">
<bg-icon style="font-size: 12px; color: #404a62" icon="#bg-ic-search"></bg-icon>
</div>
</template>
</el-input>
<div class="more-btn" :class="showFlag ? 'more-btn1' : ''" v-if="$slots.filter_group">
<el-button type="default" class="more-filter" @click="moreFilter">
高级搜索
<bg-icon
style="font-size: 8px; color: #404a62; margin-left: 8px"
icon="#bg-ic-arrow-down"
v-if="!showFlag"></bg-icon>
<bg-icon style="font-size: 8px; color: #404a62; margin-left: 8px" icon="#bg-ic-arrow-up" v-else></bg-icon>
</el-button>
</div>
</div>
</div>
<div class="filter-group" v-show="showFlag">
<slot name="filter_group"></slot>
</div>
</div>
</template>
<script setup>
import { computed, onMounted, reactive, toRefs, watch, ref } from "vue";
const state = reactive({
showFlag: false,
modelValue: "",
});
const props = defineProps({
modelValue: {
type: String,
default: "",
},
placeholder: {
type: String,
default: "请输入关键词",
},
showSearch: {
type: Boolean,
default: true,
},
});
watch(props, (n, o) => {
state.modelValue = n.modelValue;
});
watch(
() => state.modelValue,
(n, o) => {
emit("update:modelValue", n);
}
);
const emit = defineEmits(["search", "update:modelValue"]);
const search = () => {
emit("search", state.modelValue);
};
const moreFilter = () => {
state.showFlag = !state.showFlag;
};
onMounted(() => {
state.modelValue = props.modelValue;
});
const { modelValue, showFlag } = toRefs(state);
</script>
......@@ -7,30 +7,24 @@
v-for="(item, index) in fullOptions"
:class="{ current: selection.indexOf(item.value) > -1 }"
:key="'li_' + index"
@click="selectAction(item)"
>
@click="selectAction(item)">
{{ item.name }}
</li>
</ul>
</div>
</template>
<script>
export default {
name: "BgFilter",
model: {
prop: "value",
event: "change",
},
props: {
isCalc:{
type:Boolean,
default:false,
},
value: {
<script setup>
import { computed } from "vue";
const props = defineProps({
modelValue: {
type: [Number, String],
default: "",
},
isCalc: {
type: Boolean,
default: false,
},
name: {
type: String,
default: "",
......@@ -51,34 +45,33 @@ export default {
type: Boolean,
default: false,
},
},
computed: {
fullOptions() {
});
const emit = defineEmits(["update:modelValue"]);
const fullOptions = computed(() => {
return [
{
name: "全部",
value: "",
},
...this.options.map((item) => {
...props.options.map((item) => {
return {
name: item[this.optionName],
value: item[this.optionValue] + "",
name: item[props.optionName],
value: item[props.optionValue] + "",
sub_cate: item.sub_cate ? item.sub_cate : "",
};
}),
];
},
selection() {
let value = this.value + "";
});
const selection = computed(() => {
let value = props.modelValue + "";
return value.split(",");
},
});
},
methods: {
selectAction({ value, name, sub_cate }) {
if (value && this.multiple) {
let selection = [...this.selection].filter((v) => v !== "");
const selectAction = ({ value, name, sub_cate }) => {
if (value && props.multiple) {
let selection = [...props.selection].filter((v) => v !== "");
let index = selection.findIndex((v) => v === value);
if (index > -1) {
......@@ -87,11 +80,9 @@ export default {
selection.push(value);
}
this.$emit("change", selection.join(","));
emit("update:modelValue", selection.join(","));
} else {
this.$emit("change", value, name, sub_cate ? sub_cate : "");
emit("update:modelValue", value, name, sub_cate ? sub_cate : "");
}
},
},
};
</script>
This diff is collapsed.
<template>
<div class="gap-title">
<span>{{ title }}</span>
</div>
</template>
<script setup>
const props = defineProps({
title: {
type: [Number, String],
default: "",
},
});
</script>
<style scoped>
.gap-title {
font-size: 18px;
font-weight: 600;
color: #1a1a1a;
display: flex;
align-items: center;
margin-bottom: 20px;
}
.gap-title span {
margin-right: 8px;
}
.gap-title::before {
content: "";
display: inline-block;
margin-right: 8px;
width: 4px;
height: 14px;
background-color: #3759be;
border-radius: 2px;
}
/* .gap-title::after {
content: "";
display: inline-block;
flex: 1;
border-top: 1px dashed #dadee7;
} */
</style>
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.
......@@ -34,8 +34,8 @@
</template>
<template v-slot:action="{ row,index }">
<bg-table-btn :disabled="disabled||acDisable" :click="()=>{addParam(index)}">增加</bg-table-btn>
<bg-table-btn :disabled="disabled||acDisable" :click="()=>{removeParam(row, index)}">
<bg-table-btn class="can_click_btn" :disabled="disabled||acDisable" :click="()=>{addParam(index)}">增加</bg-table-btn>
<bg-table-btn class="can_click_btn" :disabled="disabled||acDisable" :click="()=>{removeParam(row, index)}">
删除
</bg-table-btn>
</template>
......
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'
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.
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