feat: 操作日志样式新增 模版管理优化 国际化样式bug 日期组件自定义主题

This commit is contained in:
dataeaseShu 2022-08-29 18:16:07 +08:00
parent 47ae49047f
commit 319f29d3aa
22 changed files with 1110 additions and 307 deletions

View File

@ -0,0 +1,56 @@
<template>
<div class="de-date-pick">
<el-date-picker
:value="value"
size="small"
:disabled="disabled"
type="daterange"
@input="handleChange"
range-separator="-"
:start-placeholder="$t('commons.date.start_date')"
:end-placeholder="$t('commons.date.end_date')"
>
</el-date-picker>
<svg-icon icon-class="icon_calendar_outlined" class="calendar-outlined" />
</div>
</template>
<script>
export default {
name: "DeDatePick",
props: {
disabled: Boolean,
value: Array,
},
methods: {
handleChange(val) {
this.$emit("input", val);
},
},
};
</script>
<style lang="scss">
.de-date-pick {
width: 256px;
position: relative;
.el-input__icon {
display: none;
}
.el-range-input {
text-align: left;
}
.el-date-editor {
padding-left: 12px;
width: 100%;
}
.calendar-outlined {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 13px;
}
}
</style>

View File

@ -0,0 +1,76 @@
<template>
<el-input
:value="value"
:placeholder="placeholder"
:type="type"
:disabled="disabled"
class="de-pwd-input"
@input="handleInput"
@change="handleChange"
>
<svg-icon
@click="handleClick"
v-if="!showPwd || buttonDisabled"
slot="suffix"
icon-class="de_pwd_invisible"
/>
<svg-icon
@click="handleClick"
v-else
slot="suffix"
icon-class="de_pwd_visible"
/>
</el-input>
</template>
<script>
import { log } from "@antv/g2plot/lib/utils";
export default {
name: "DePwd",
inject: {
elForm: {
default: "",
},
},
props: {
disabled: Boolean,
placeholder: String,
value: String,
},
data() {
return {
showPwd: false,
};
},
computed: {
buttonDisabled() {
return this.$options.propsData.hasOwnProperty("disabled")
? this.disabled
: (this.elForm || {}).disabled;
},
type() {
return !this.showPwd || this.buttonDisabled ? "password" : "text";
},
},
methods: {
handleClick() {
if (this.buttonDisabled) return;
this.showPwd = !this.showPwd;
},
handleInput(val) {
this.$emit("input", val);
},
handleChange(val) {
this.$emit("change", val);
},
},
};
</script>
<style lang="scss">
.de-pwd-input {
.el-input__suffix {
right: 12px;
font-size: 16px;
}
}
</style>

View File

@ -296,6 +296,16 @@ export default {
border:1px solid var(--BrDateColor, #dfe4ed) !important; border:1px solid var(--BrDateColor, #dfe4ed) !important;
background: var(--BgDateColor, #FFFFFF) !important; background: var(--BgDateColor, #FFFFFF) !important;
.el-picker-panel__sidebar {
background: var(--BgDateColor, #FFFFFF) !important;
border-right: 1px solid var(--BrDateColor, #dfe4ed) !important;
.el-picker-panel__shortcut {
color: var(--DateColor, #606266);
}
}
.popper__arrow, .popper__arrow,
.popper__arrow::after { .popper__arrow::after {
display: none !important; display: none !important;
@ -310,6 +320,10 @@ export default {
border-bottom:1px solid var(--BrDateColor, #e6ebf5) !important; border-bottom:1px solid var(--BrDateColor, #e6ebf5) !important;
} }
.el-date-table td.in-range:not(.end-date):not(.start-date) div span {
color: #3370ff;
}
.el-date-range-picker__header, .el-date-range-picker__header,
.el-date-table th, .el-date-table th,
.el-date-table__row, .el-date-table__row,

View File

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.9823 11.9244C9.89439 12.8051 8.50885 13.3327 7.00008 13.3327C3.50228 13.3327 0.666748 10.4972 0.666748 6.99935C0.666748 3.50155 3.50228 0.666016 7.00008 0.666016C10.4979 0.666016 13.3334 3.50155 13.3334 6.99935C13.3334 8.50811 12.8058 9.89365 11.9251 10.9816L14.6737 13.7301C14.8039 13.8603 14.8039 14.0714 14.6737 14.2015L14.2023 14.673C14.0721 14.8031 13.8611 14.8031 13.7309 14.673L10.9823 11.9244ZM12.0001 6.99935C12.0001 4.23793 9.7615 1.99935 7.00008 1.99935C4.23866 1.99935 2.00008 4.23793 2.00008 6.99935C2.00008 9.76077 4.23866 11.9993 7.00008 11.9993C9.7615 11.9993 12.0001 9.76077 12.0001 6.99935Z" fill="#646A73"/>
</svg>

After

Width:  |  Height:  |  Size: 743 B

View File

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.00022 9.99975C7.56203 9.99975 7.13323 9.96523 6.71734 9.89921L6.38535 11.1382C6.33771 11.316 6.15493 11.4216 5.9771 11.3739L5.33315 11.2014C5.15533 11.1537 5.0498 10.9709 5.09745 10.7931L5.42255 9.57985C4.88013 9.39561 4.37096 9.15494 3.90491 8.86629L2.8454 9.9258C2.71522 10.056 2.50417 10.056 2.37399 9.9258L1.90259 9.4544C1.77242 9.32422 1.77242 9.11317 1.90259 8.98299L2.83565 8.04994C2.35424 7.59918 1.95209 7.0852 1.64812 6.52421C1.64492 6.51832 1.64162 6.51215 1.63823 6.50575C1.5136 6.27038 1.56023 5.97574 1.75709 5.79635C1.92051 5.64743 2.03596 5.5461 2.13639 5.44567C2.14538 5.43669 2.15521 5.42666 2.16569 5.41583C2.31108 5.2656 2.55902 5.32152 2.64417 5.51246C3.47427 7.37398 5.46211 8.66641 8.00022 8.66641C10.4321 8.66641 12.4664 7.40872 13.2829 5.68239C13.3042 5.63747 13.328 5.5809 13.3519 5.52084C13.4276 5.33064 13.6741 5.27325 13.8188 5.41801C13.9259 5.52508 14.0687 5.66784 14.2471 5.8463C14.4235 6.0227 14.4713 6.29211 14.356 6.51334C14.3279 6.56715 14.3006 6.61785 14.2774 6.65816C13.9638 7.20109 13.5572 7.69751 13.0754 8.1321L13.9263 8.98299C14.0565 9.11317 14.0565 9.32422 13.9263 9.4544L13.4549 9.9258C13.3247 10.056 13.1136 10.056 12.9835 9.9258L11.9888 8.93112C11.5521 9.19111 11.0792 9.40958 10.5779 9.57985L10.903 10.7931C10.9506 10.9709 10.8451 11.1537 10.6673 11.2014L10.0233 11.3739C9.84552 11.4216 9.66274 11.316 9.61509 11.1382L9.2831 9.89921C8.86721 9.96523 8.43842 9.99975 8.00022 9.99975Z" fill="#BBBFC4"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.98994 12.333C10.1486 12.333 12.1472 10.9599 14.0001 7.99101C12.1949 5.03272 10.2008 3.66634 7.98994 3.66634C5.77984 3.66634 3.7929 5.0321 2.00009 7.99099C3.84053 10.9605 5.83206 12.333 7.98994 12.333ZM1.00172 8.59304C0.787049 8.22763 0.785596 7.77336 0.995302 7.40508C1.00277 7.39196 1.00993 7.37945 1.01672 7.36768C2.9521 4.01123 5.27627 2.33301 7.98923 2.33301C10.7133 2.33301 13.0518 4.02495 15.0049 7.40884C15.0107 7.41898 15.0168 7.42969 15.0232 7.44089C15.2208 7.7869 15.2193 8.21401 15.0172 8.55738C13.0127 11.9634 10.67 13.6663 7.98923 13.6663C5.31784 13.6663 2.98867 11.9752 1.00172 8.59304ZM8.00009 10.6663C6.52733 10.6663 5.33342 9.47243 5.33342 7.99967C5.33342 6.52692 6.52733 5.33301 8.00009 5.33301C9.47285 5.33301 10.6668 6.52692 10.6668 7.99967C10.6668 9.47243 9.47285 10.6663 8.00009 10.6663ZM8.00009 9.33301C8.73647 9.33301 9.33342 8.73605 9.33342 7.99967C9.33342 7.26329 8.73647 6.66634 8.00009 6.66634C7.26371 6.66634 6.66675 7.26329 6.66675 7.99967C6.66675 8.73605 7.26371 9.33301 8.00009 9.33301Z" fill="#BBBFC4"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.00022 9.99975C7.56203 9.99975 7.13323 9.96523 6.71734 9.89921L6.38535 11.1382C6.33771 11.316 6.15493 11.4216 5.9771 11.3739L5.33315 11.2014C5.15533 11.1537 5.0498 10.9709 5.09745 10.7931L5.42255 9.57985C4.88013 9.39561 4.37096 9.15494 3.90491 8.86629L2.8454 9.9258C2.71522 10.056 2.50417 10.056 2.37399 9.9258L1.90259 9.4544C1.77242 9.32422 1.77242 9.11317 1.90259 8.98299L2.83565 8.04994C2.35424 7.59918 1.95209 7.0852 1.64812 6.52421C1.64492 6.51832 1.64162 6.51215 1.63823 6.50575C1.5136 6.27038 1.56023 5.97574 1.75709 5.79635C1.92051 5.64743 2.03596 5.5461 2.13639 5.44567C2.14538 5.43669 2.15521 5.42666 2.16569 5.41583C2.31108 5.2656 2.55902 5.32152 2.64417 5.51246C3.47427 7.37398 5.46211 8.66641 8.00022 8.66641C10.4321 8.66641 12.4664 7.40872 13.2829 5.68239C13.3042 5.63747 13.328 5.5809 13.3519 5.52084C13.4276 5.33064 13.6741 5.27325 13.8188 5.41801C13.9259 5.52508 14.0687 5.66784 14.2471 5.8463C14.4235 6.0227 14.4713 6.29211 14.356 6.51334C14.3279 6.56715 14.3006 6.61785 14.2774 6.65816C13.9638 7.20109 13.5572 7.69751 13.0754 8.1321L13.9263 8.98299C14.0565 9.11317 14.0565 9.32422 13.9263 9.4544L13.4549 9.9258C13.3247 10.056 13.1136 10.056 12.9835 9.9258L11.9888 8.93112C11.5521 9.19111 11.0792 9.40958 10.5779 9.57985L10.903 10.7931C10.9506 10.9709 10.8451 11.1537 10.6673 11.2014L10.0233 11.3739C9.84552 11.4216 9.66274 11.316 9.61509 11.1382L9.2831 9.89921C8.86721 9.96523 8.43842 9.99975 8.00022 9.99975Z" fill="#BBBFC4"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.98994 12.333C10.1486 12.333 12.1472 10.9599 14.0001 7.99101C12.1949 5.03272 10.2008 3.66634 7.98994 3.66634C5.77984 3.66634 3.7929 5.0321 2.00009 7.99099C3.84053 10.9605 5.83206 12.333 7.98994 12.333ZM1.00172 8.59304C0.787049 8.22763 0.785596 7.77336 0.995302 7.40508C1.00277 7.39196 1.00993 7.37945 1.01672 7.36768C2.9521 4.01123 5.27627 2.33301 7.98923 2.33301C10.7133 2.33301 13.0518 4.02495 15.0049 7.40884C15.0107 7.41898 15.0168 7.42969 15.0232 7.44089C15.2208 7.7869 15.2193 8.21401 15.0172 8.55738C13.0127 11.9634 10.67 13.6663 7.98923 13.6663C5.31784 13.6663 2.98867 11.9752 1.00172 8.59304ZM8.00009 10.6663C6.52733 10.6663 5.33342 9.47243 5.33342 7.99967C5.33342 6.52692 6.52733 5.33301 8.00009 5.33301C9.47285 5.33301 10.6668 6.52692 10.6668 7.99967C10.6668 9.47243 9.47285 10.6663 8.00009 10.6663ZM8.00009 9.33301C8.73647 9.33301 9.33342 8.73605 9.33342 7.99967C9.33342 7.26329 8.73647 6.66634 8.00009 6.66634C7.26371 6.66634 6.66675 7.26329 6.66675 7.99967C6.66675 8.73605 7.26371 9.33301 8.00009 9.33301Z" fill="#BBBFC4"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -97,8 +97,8 @@ export default {
font-family: PingFang SC; font-family: PingFang SC;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #646a73; color: var(--SiderTextColor, #646a73);
background: #fff; background-color: var(--SiderBG, #ffffff);
cursor: pointer; cursor: pointer;
i { i {

View File

@ -1196,4 +1196,20 @@ div:focus {
position: absolute; position: absolute;
right: 12px; right: 12px;
bottom: 12px; bottom: 12px;
}
.de-input-search {
.el-input__inner {
padding-left: 36px;
}
.el-input__prefix {
left: 12px;
display: flex;
align-items: center;
justify-content: center;
svg {
font-size: 16px;
}
}
} }

View File

@ -72,7 +72,7 @@ export default {
background: #ffffff; background: #ffffff;
border: 1px solid var(--deCardStrokeColor, #dee0e3); border: 1px solid var(--deCardStrokeColor, #dee0e3);
border-radius: 4px; border-radius: 4px;
margin: 0 12.5px 25px 12.5px; margin: 0 24px 25px 0;
.card-img-model { .card-img-model {
border-bottom: 1px solid var(--deCardStrokeColor, #dee0e3); border-bottom: 1px solid var(--deCardStrokeColor, #dee0e3);
height: 144px; height: 144px;

View File

@ -2,11 +2,13 @@
<div class="de-template-list"> <div class="de-template-list">
<el-input <el-input
v-model="templateFilterText" v-model="templateFilterText"
:placeholder="$t('panel.filter_keywords')" :placeholder="$t('system_parameter_setting.search_keywords')"
size="small" size="small"
class="de-input-search"
clearable clearable
prefix-icon="el-icon-search" >
/> <svg-icon slot="prefix" icon-class="de-search"></svg-icon>
</el-input>
<el-empty <el-empty
:image="noneImg" :image="noneImg"
v-if="!templateListComputed.length && templateFilterText === ''" v-if="!templateListComputed.length && templateFilterText === ''"
@ -85,8 +87,8 @@ export default {
return { return {
templateFilterText: "", templateFilterText: "",
activeTemplate: "", activeTemplate: "",
noneImg: require('@/assets/None.png'), noneImg: require("@/assets/None.png"),
nothingImg: require('@/assets/nothing.png'), nothingImg: require("@/assets/nothing.png"),
}; };
}, },
computed: { computed: {
@ -127,12 +129,12 @@ export default {
}, },
templateDelete(template) { templateDelete(template) {
const options = { const options = {
title: 'system_parameter_setting.delete_this_category', title: "system_parameter_setting.delete_this_category",
content: 'system_parameter_setting.also_be_deleted', content: "system_parameter_setting.also_be_deleted",
type: "primary", type: "primary",
cb: () => this.$emit("templateDelete", template.id), cb: () => this.$emit("templateDelete", template.id),
}; };
this.handlerConfirm(options); this.handlerConfirm(options);
}, },
templateEdit(template) { templateEdit(template) {
this.$emit("templateEdit", template); this.$emit("templateEdit", template);
@ -163,7 +165,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
border-radius: 4px; border-radius: 4px;
color: var(--deTextPrimary, #1F2329); color: var(--deTextPrimary, #1f2329);
font-family: "PingFang SC"; font-family: "PingFang SC";
font-style: normal; font-style: normal;
font-weight: 500; font-weight: 500;

View File

@ -152,8 +152,8 @@ export default {
currentTemplateLabel: "", currentTemplateLabel: "",
currentTemplateId: "", currentTemplateId: "",
templateList: [], templateList: [],
templateMiniWidth: 262, templateMiniWidth: 286,
templateCurWidth: 262, templateCurWidth: 286,
formType: "", formType: "",
originName: "", originName: "",
templateDialog: { templateDialog: {
@ -187,9 +187,8 @@ export default {
const curSeparator = Math.trunc( const curSeparator = Math.trunc(
templateMainDom.offsetWidth / _this.templateMiniWidth templateMainDom.offsetWidth / _this.templateMiniWidth
); );
console.log(1, curSeparator);
_this.templateCurWidth = _this.templateCurWidth =
Math.trunc(templateMainDom.offsetWidth / curSeparator) - 50; Math.trunc(templateMainDom.offsetWidth / curSeparator) - 24 - curSeparator;
}); });
}); });
}, },
@ -387,7 +386,7 @@ export default {
.de-tabs-right { .de-tabs-right {
flex: 1; flex: 1;
background: #fff; background: #fff;
padding: 24px 12px 24px 12px; padding: 24px 0 24px 24px;
overflow: hidden; overflow: hidden;
.template-box { .template-box {
@ -403,6 +402,7 @@ export default {
.active-template { .active-template {
margin: 4px 0 20px 0; margin: 4px 0 20px 0;
padding-right: 24px;
font-family: "PingFang SC"; font-family: "PingFang SC";
font-style: normal; font-style: normal;
font-weight: 500; font-weight: 500;

View File

@ -15,9 +15,10 @@
<!--基础配置表单--> <!--基础配置表单-->
<el-form ref="formInline" v-loading="loading" :model="formInline" :rules="rules" <el-form ref="formInline" v-loading="loading" :model="formInline" :rules="rules"
class="demo-form-inline de-form-item" :disabled="show" label-width="80px" label-position="right" size="small"> class="demo-form-inline de-form-item" :disabled="show" label-width="80px" label-position="right" size="small">
<el-form-item prop="frontTimeOut"> <el-form-item prop="frontTimeOut" class="de-i118">
<template slot="label"> <template slot="label">
{{ $t('system_parameter_setting.request_timeout')}} {{ $t('system_parameter_setting.request_timeout')}}
<i class="is-require"></i>
<el-tooltip class="item" effect="dark" :content="$t('system_parameter_setting.front_time_out')" <el-tooltip class="item" effect="dark" :content="$t('system_parameter_setting.front_time_out')"
placement="top"> placement="top">
<i class="el-icon-warning-outline tips"></i> <i class="el-icon-warning-outline tips"></i>
@ -253,9 +254,8 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.demo-form-inline { .demo-form-inline {
.tips { .tips {
position: absolute; margin-left: 2px;
left: 100px; position: relative;
top: 5px;
z-index: 10; z-index: 10;
} }
@ -265,3 +265,15 @@ export default {
} }
} }
</style> </style>
<style lang="scss">
.de-i118 {
.el-form-item__label::after {
display: none;
}
.is-require::after {
content: "*";
color: #f54a45;
margin-left: 2px;
}
}
</style>

View File

@ -41,7 +41,7 @@
<el-input v-model="form.configuration.username" /> <el-input v-model="form.configuration.username" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('datasource.password')"> <el-form-item :label="$t('datasource.password')">
<el-input v-model="form.configuration.password" show-password /> <dePwd v-model="form.configuration.password"/>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="$t('datasource.query_port')" :label="$t('datasource.query_port')"
@ -162,11 +162,13 @@ import { engineInfo, validate, save } from "@/api/system/engine";
import i18n from "@/lang"; import i18n from "@/lang";
import operater from "./operater"; import operater from "./operater";
import msgCfm from '@/components/msgCfm' import msgCfm from '@/components/msgCfm'
import dePwd from '@/components/deCustomCm/dePwd.vue'
export default { export default {
name: "ClusterMode", name: "ClusterMode",
mixins: [msgCfm], mixins: [msgCfm],
components: { components: {
operater, operater,
dePwd
}, },
data() { data() {
return { return {

View File

@ -68,14 +68,9 @@
:label="$t('system_parameter_setting.SMTP_password')" :label="$t('system_parameter_setting.SMTP_password')"
prop="password" prop="password"
> >
<el-input <dePwd
ref="input"
v-model="formInline.password" v-model="formInline.password"
:placeholder="$t('system_parameter_setting.SMTP_password')" :placeholder="$t('system_parameter_setting.SMTP_password')"
autocomplete="new-password"
show-password
type="text"
@focus="changeType"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('system_parameter_setting.test_recipients')"> <el-form-item :label="$t('system_parameter_setting.test_recipients')">
@ -90,13 +85,9 @@
<i class="el-icon-warning-outline tips-not-absolute"></i> <i class="el-icon-warning-outline tips-not-absolute"></i>
</el-tooltip> </el-tooltip>
</template> </template>
<el-input <dePwd
ref="input"
v-model="formInline.recipient" v-model="formInline.recipient"
:placeholder="$t('system_parameter_setting.test_recipients')" :placeholder="$t('system_parameter_setting.test_recipients')"
autocomplete="new-password"
show-password
type="text"
/> />
</el-form-item> </el-form-item>
<el-form-item label="邮箱服务器配置"> <el-form-item label="邮箱服务器配置">
@ -134,12 +125,13 @@
import { emailInfo, updateInfo, validate } from "@/api/system/email"; import { emailInfo, updateInfo, validate } from "@/api/system/email";
import operater from "./operater"; import operater from "./operater";
import msgCfm from '@/components/msgCfm' import msgCfm from '@/components/msgCfm'
import dePwd from '@/components/deCustomCm/dePwd.vue'
export default { export default {
name: "EmailSetting", name: "EmailSetting",
mixins: [msgCfm], mixins: [msgCfm],
components: { components: {
operater, operater,
dePwd
}, },
data() { data() {
return { return {
@ -183,9 +175,6 @@ export default {
this.query(); this.query();
}, },
methods: { methods: {
changeType() {
this.$refs.input = "password";
},
query() { query() {
emailInfo().then((response) => { emailInfo().then((response) => {
this.formInline = response.data; this.formInline = response.data;

View File

@ -93,7 +93,7 @@
:label="$t('kettle.passwd')" :label="$t('kettle.passwd')"
prop="configuration.passwd" prop="configuration.passwd"
> >
<el-input :placeholder="$t('components.input_a_password')" v-model="form.configuration.passwd" show-password /> <dePwd :placeholder="$t('components.input_a_password')" v-model="form.configuration.passwd"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
@ -122,11 +122,12 @@ import {
} from "@/api/system/kettle"; } from "@/api/system/kettle";
import i18n from "@/lang"; import i18n from "@/lang";
import GridTable from "@/components/gridTable/index.vue"; import GridTable from "@/components/gridTable/index.vue";
import dePwd from '@/components/deCustomCm/dePwd.vue'
import msgCfm from '@/components/msgCfm' import msgCfm from '@/components/msgCfm'
export default { export default {
name: "KettleSetting", name: "KettleSetting",
components: { GridTable }, components: { GridTable, dePwd },
mixins: [msgCfm], mixins: [msgCfm],
data() { data() {
return { return {
@ -339,7 +340,7 @@ export default {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
border-radius: 2px; border-radius: 2px;
width: 40px; padding: 1px 6px;
height: 24px; height: 24px;
} }
</style> </style>

View File

@ -0,0 +1,403 @@
<template>
<el-drawer
:title="$t('user.filter_method')"
:visible.sync="userDrawer"
custom-class="user-drawer-task"
size="680px"
v-closePress
direction="rtl"
>
<div class="filter">
<span>{{ $t("log.optype") }}</span>
<div class="filter-item">
<span
class="item"
@click="statusChange(item.value)"
:class="[activeType.includes(item.value) ? 'active' : '']"
:key="item.label"
v-for="item in types"
>{{ $t(item.label) }}</span
>
</div>
</div>
<div class="el-drawer__body-cont">
<div class="filter">
<span>{{ $t("log.user") }}</span>
<div class="filter-item">
<span
@click="activeUserChange(ele.id)"
class="item"
:class="[activeUser.includes(ele.id) ? 'active' : '']"
:key="ele.id"
v-for="ele in usersValueCopy"
>{{ ele.username }}</span
>
<el-popover
placement="bottom"
popper-class="user-popper"
width="200"
trigger="click"
>
<el-select
ref="userSelect"
v-model="usersValue"
multiple
filterable
:placeholder="$t('commons.please_select')"
@change="changeUser"
@remove-tag="changeUser"
value-key="id"
>
<el-option
v-for="item in usersComputed"
:key="item.username"
:label="item.username"
:value="item"
/>
</el-select>
<span class="more" slot="reference">+ {{ $t("panel.more") }}</span>
</el-popover>
</div>
</div>
<div class="filter">
<span>{{ $t("dedaterange.label") }}</span>
<div class="filter-item">
<DeDatePick v-model="dataRange"></DeDatePick>
</div>
</div>
</div>
<div class="foot">
<el-button class="btn normal" @click="reset">{{
$t("commons.reset")
}}</el-button>
<el-button type="primary" class="btn" @click="search">{{
$t("commons.adv_search.search")
}}</el-button>
</div>
</el-drawer>
</template>
<script>
import { dateFormat } from "@/views/system/task/options.js";
import { opTypes } from "@/api/system/log";
import { post } from "@/api/dataset/dataset";
import DeDatePick from '@/components/deCustomCm/deDatePick.vue'
export default {
components: {
DeDatePick
},
data() {
return {
types: [],
treeLoading: false,
filterTextMap: [],
dataRange: [],
usersValue: [],
activeUser: [],
users: [],
userCahe: [],
activeType: [],
userDrawer: false,
};
},
computed: {
usersComputed() {
return this.users.filter((ele) => !this.activeUser.includes(ele.id));
},
usersValueCopy() {
return this.userCahe.filter((ele) => this.activeUser.includes(ele.id));
},
},
mounted() {
this.loadUsers();
this.loadType();
},
methods: {
loadType() {
opTypes().then((res) => {
this.types = res.data.map((item) => {
return { label: item.name, value: item.id };
});
});
},
loadUsers() {
post("/api/user/userLists", {}, false).then((res) => {
this.users = res.data;
});
},
changeUser() {
if (
this.userCahe.length >
this.usersValue.length + this.activeUser.length
) {
this.userCahe = this.userCahe.filter((ele) =>
this.usersValue
.map((ele) => ele.id)
.concat(this.activeUser)
.includes(ele.id)
);
return;
}
const userIdx = this.usersValue.findIndex(
(ele) =>
!this.userCahe
.map((ele) => ele.id)
.concat(this.activeUser)
.includes(ele.id)
);
if (userIdx === -1) return;
this.activeUser.push(this.usersValue[userIdx].id);
this.userCahe.push(this.usersValue[userIdx]);
this.usersValue.splice(userIdx, 1);
},
activeUserChange(id) {
const userIndex = this.activeUser.findIndex((ele) => ele === id);
if (userIndex === -1) {
this.activeUser.push(id);
this.usersValue = this.usersValue.filter((ele) => ele.id !== id);
} else {
this.activeUser.splice(userIndex, 1);
const user = this.userCahe.find((ele) => ele.id === id);
this.usersValue.push(user);
}
},
clearFilter() {
this.dataRange = [];
this.usersValue = [];
this.activeUser = [];
this.activeType = [];
this.userCahe = [];
this.$emit("search", [], []);
},
clearOneFilter(index) {
(this.filterTextMap[index] || []).forEach((ele) => {
this[ele] = [];
});
},
statusChange(value, type) {
const statusIndex = this.activeType.findIndex((ele) => ele === value);
if (statusIndex === -1) {
this.activeType.push(value);
} else {
this.activeType.splice(statusIndex, 1);
}
},
search() {
this.userDrawer = false;
this.$emit("search", this.formatCondition(), this.formatText());
},
formatText() {
this.filterTextMap = [];
const params = [];
if (this.activeType.length) {
params.push(
`${this.$t('log.optype')}:${this.activeType
.map((item) =>
this.types.find((itx) => itx.value === item).label
)
.join("、")}`
);
this.filterTextMap.push([`activeType`]);
}
if (this.activeUser.length) {
let str = `${this.$t("log.user")}:${this.activeUser.reduce(
(pre, next) =>
(this.users.find((ele) => ele.id === next) || {}).username +
"、" +
pre,
""
)}`;
params.push(str.slice(0, str.length - 1));
this.filterTextMap.push([
"usersValue",
"activeUser",
"users",
"userCahe",
]);
}
if (this.dataRange.length) {
params.push(
`${this.$t("dedaterange.label")}:${this.dataRange
.map((ele) => {
return dateFormat("YYYY-mm-dd", ele);
})
.join("-")}`
);
this.filterTextMap.push(["dataRange"]);
}
return params;
},
formatCondition() {
const fildMap = {
optype: this.activeType,
"user_id": this.activeUser,
};
const conditions = [];
Object.keys(fildMap).forEach((ele) => {
if (fildMap[ele].length) {
conditions.push({
field: ele,
operator: "in",
value: fildMap[ele],
});
}
});
const [min, max] = this.dataRange;
if (min && max) {
conditions.push({
field: "time",
operator: "between",
value: [+min, +max],
});
}
return conditions;
},
init() {
this.userDrawer = true;
},
reset() {
this.clearFilter();
this.userDrawer = false;
},
},
};
</script>
<style lang="scss">
.user-drawer-task {
.el-drawer__body-cont {
height: 100%;
box-sizing: border-box;
overflow: hidden;
width: 100%;
padding-bottom: 80px;
}
.el-drawer__header {
padding: 16px 24px;
margin: 0;
font-family: PingFang SC;
font-size: 16px;
font-weight: 500;
line-height: 24px;
color: #1f2329;
position: relative;
box-sizing: border-box;
height: 57px;
mix-blend-mode: normal;
border-bottom: 1px solid rgba(187, 191, 196, 0.5);
.el-drawer__close-btn {
position: absolute;
right: 24px;
top: 16px;
padding: 4px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
}
.el-drawer__close-btn:hover {
background: #e9e9ea;
}
}
.el-drawer__body {
padding: 12px 24px 24px 24px;
position: relative;
}
.filter {
display: flex;
min-height: 46px;
> :nth-child(1) {
color: #1f2329;
font-family: "PingFang SC";
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 24px;
white-space: nowrap;
width: 116px;
}
.filter-item {
flex: 1;
.item,
.more {
font-family: PingFang SC;
white-space: nowrap;
font-size: 14px;
font-weight: 400;
line-height: 24px;
margin-right: 12px;
text-align: center;
padding: 1px 6px;
background: #f5f6f7;
border-radius: 2px;
cursor: pointer;
display: inline-block;
margin-bottom: 12px;
}
.active,
.more:hover {
background: rgba(51, 112, 255, 0.1);
color: #0c296e;
}
.more {
white-space: nowrap;
}
}
}
.btn {
border-radius: 4px;
padding: 5px 26px 5px 26px;
font-family: PingFang SC;
font-size: 14px;
font-weight: 400;
line-height: 20px;
letter-spacing: 0px;
text-align: center;
border: none;
box-sizing: border-box;
}
.normal {
color: #1f2329;
border: 1px solid #bbbfc4;
margin-left: 12px;
}
.foot {
position: absolute;
height: 80px;
width: 100%;
padding: 24px;
right: 0;
bottom: 0;
text-align: right;
background: #ffffff;
box-shadow: 0px -1px 4px rgba(0, 0, 0, 0.05);
}
}
.user-popper {
padding: 0;
background: #fff;
.popper__arrow {
display: none;
}
}
.tree-select {
.el-select-dropdown__empty,
.el-scrollbar__wrap,
.popper__arrow {
display: none !important;
}
}
.user-popper.dept {
height: 400px;
overflow: auto;
}
</style>

View File

@ -1,162 +1,393 @@
<template> <template>
<layout-content :header="$t('log.title')"> <de-layout-content :header="$t('log.title')">
<complex-table <el-row class="top-operate">
v-loading="$store.getters.loadingMap[$store.getters.currentPath]" <el-col :span="12">
:data="data" <deBtn v-permission="['log:export']" secondary @click="exportConfirm">{{
:columns="columns" $t("zip.export")
:search-config="searchConfig" }}</deBtn>
:pagination-config="paginationConfig" &nbsp; &nbsp;
@select="select" </el-col>
@search="search" <el-col :span="12" class="right-user">
@sort-change="sortChange" <el-input
:placeholder="$t('通过事件详情搜索')"
prefix-icon="el-icon-search"
class="name-email-search"
size="small"
clearable
ref="search"
v-model="nikeName"
@blur="initSearch"
@clear="initSearch"
>
</el-input>
<deBtn
:secondary="!cacheCondition.length"
:plain="!!cacheCondition.length"
icon="iconfont icon-icon-filter"
@click="filterShow"
>{{ $t("user.filter")
}}<template v-if="filterTexts.length">
({{ cacheCondition.length }})
</template>
</deBtn>
</el-col>
</el-row>
<div class="filter-texts" v-if="filterTexts.length">
<span class="sum">{{ paginationConfig.total }}</span>
<span class="title">{{ $t("user.result_one") }}</span>
<el-divider direction="vertical"></el-divider>
<i
@click="scrollPre"
v-if="showScroll"
class="el-icon-arrow-left arrow-filter"
></i>
<div class="filter-texts-container">
<p class="text" v-for="(ele, index) in filterTexts" :key="ele">
{{ ele }} <i @click="clearOneFilter(index)" class="el-icon-close"></i>
</p>
</div>
<i
@click="scrollNext"
v-if="showScroll"
class="el-icon-arrow-right arrow-filter"
></i>
<el-button
type="text"
class="clear-btn"
icon="el-icon-delete"
@click="clearFilter"
>{{ $t("user.clear_filter") }}</el-button
>
</div>
<div
class="table-container"
id="resize-for-filter"
:class="[filterTexts.length ? 'table-container-filter' : '']"
> >
<template #toolbar> <grid-table
<el-button v-permission="['log:export']" icon="el-icon-download" size="mini" @click="exportConfirm">{{ $t('log.export') }}</el-button> v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
</template> :tableData="data"
:columns="[]"
<el-table-column :show-overflow-tooltip="true" prop="opType" :label="$t('log.optype')" width="140"> :pagination="paginationConfig"
<template v-slot:default="{row}"> @sort-change="sortChange"
<span>{{ row.opType + row.sourceType }}</span> @size-change="handleSizeChange"
</template> @current-change="handleCurrentChange"
</el-table-column> >
<el-table-column :show-overflow-tooltip="true" prop="detail" :label="$t('log.detail')" /> <el-table-column
<el-table-column :show-overflow-tooltip="true" prop="user" :label="$t('log.user')" width="100" /> show-overflow-tooltip
<el-table-column :show-overflow-tooltip="true" prop="time" sortable="custom" :label="$t('log.time')" width="180"> prop="opType"
<template v-slot:default="scope"> :label="$t('log.optype')"
<span>{{ scope.row.time | timestampFormatDate }}</span> width="140"
</template> >
</el-table-column> <template v-slot:default="{ row }">
</complex-table> <span>{{ row.opType + row.sourceType }}</span>
</layout-content> </template>
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="detail"
:label="$t('log.detail')"
/>
<el-table-column
show-overflow-tooltip
prop="user"
:label="$t('log.user')"
width="100"
/>
<el-table-column
show-overflow-tooltip
prop="time"
sortable="custom"
:label="$t('log.time')"
width="180"
>
<template v-slot:default="scope">
<span>{{ scope.row.time | timestampFormatDate }}</span>
</template>
</el-table-column>
</grid-table>
</div>
<keep-alive>
<filterUser ref="filterUser" @search="filterDraw"></filterUser>
</keep-alive>
</de-layout-content>
</template> </template>
<script> <script>
import LayoutContent from '@/components/business/LayoutContent' import DeLayoutContent from "@/components/business/DeLayoutContent";
import ComplexTable from '@/components/business/complex-table' import GridTable from "@/components/gridTable/index.vue";
import { formatCondition, formatQuickCondition, addOrder, formatOrders } from '@/utils/index' import filterUser from './filterUser'
import { logGrid, opTypes, exportExcel } from '@/api/system/log' import {
formatCondition,
formatQuickCondition,
addOrder,
formatOrders,
} from "@/utils/index";
import { logGrid, exportExcel } from "@/api/system/log";
export default { export default {
components: { GridTable, DeLayoutContent, filterUser },
components: { ComplexTable, LayoutContent },
data() { data() {
return { return {
columns: [], columns: [],
searchConfig: {
useQuickSearch: false,
useComplexSearch: true,
quickPlaceholder: this.$t('log.search_by_key'),
components: [
{
field: 'optype',
label: this.$t('log.optype'),
component: 'FuComplexMixSelect',
options: [],
multiple: true,
class: 'de-log-filter',
defaultOperator: 'in',
filterable: true,
'reserve-keyword': true
},
{ field: 'nick_name', label: this.$t('log.user'), component: 'DeComplexInput', class: 'de-log-filter' },
{ field: 'time', label: this.$t('log.time'), component: 'FuComplexDateTime', defaultOperator: 'between', class: 'de-log-filter' }
]
},
paginationConfig: { paginationConfig: {
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
total: 0 total: 0,
}, },
data: [], data: [],
types: [],
orderConditions: [], orderConditions: [],
last_condition: null nikeName: "",
showScroll: false,
} filterTexts: [],
cacheCondition: [],
};
}, },
watch: {
created() { filterTexts: {
this.types = [] handler() {
opTypes().then(res => { this.getScrollStatus();
const datas = res.data },
datas.forEach(item => { deep: true,
this.types.push({ 'label': item.name, 'value': item.id }) },
})
this.searchConfig.components[0].options = this.types
})
}, },
mounted() { mounted() {
this.search() this.search();
this.resizeObserver();
}, },
methods: { methods: {
exportConfirm() { exportConfirm() {
this.$confirm(this.$t('log.confirm'), '', { this.$confirm(this.$t("log.confirm"), "", {
confirmButtonText: this.$t('commons.confirm'), confirmButtonText: this.$t("commons.confirm"),
cancelButtonText: this.$t('commons.cancel'), cancelButtonText: this.$t("commons.cancel"),
type: 'warning' type: "warning",
}).then(() => {
this.exportData()
}).catch(() => {
// this.$info(this.$t('commons.delete_cancel'))
}) })
.then(() => {
this.exportData();
})
.catch(() => {
// this.$info(this.$t('commons.delete_cancel'))
});
}, },
exportData() { exportData() {
let condition = this.last_condition let condition = this.last_condition;
condition = formatQuickCondition(condition, 'key') condition = formatQuickCondition(condition, "key");
const temp = formatCondition(condition) const temp = formatCondition(condition);
const param = temp || {} const param = temp || {};
param['orders'] = formatOrders(this.orderConditions) param["orders"] = formatOrders(this.orderConditions);
exportExcel(param).then(res => { exportExcel(param).then((res) => {
const blob = new Blob([res], { type: 'application/vnd.ms-excel' }) const blob = new Blob([res], { type: "application/vnd.ms-excel" });
const link = document.createElement('a') const link = document.createElement("a");
link.style.display = 'none' link.style.display = "none";
link.href = URL.createObjectURL(blob) link.href = URL.createObjectURL(blob);
link.download = 'DataEase操作日志.xls' // link.download = "DataEase操作日志.xls"; //
document.body.appendChild(link) document.body.appendChild(link);
link.click() link.click();
document.body.removeChild(link) document.body.removeChild(link);
}) });
}, },
sortChange({ column, prop, order }) { sortChange({ column, prop, order }) {
this.orderConditions = [] this.orderConditions = [];
if (!order) { if (!order) {
this.search(this.last_condition) this.initSearch();
return return;
} }
this.orderConditions = [] this.orderConditions = [];
addOrder({ field: prop, value: order }, this.orderConditions) addOrder({ field: prop, value: order }, this.orderConditions);
this.search(this.last_condition) this.initSearch();
}, },
select(selection) { getScrollStatus() {
this.$nextTick(() => {
const dom = document.querySelector(".filter-texts-container");
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth;
});
}, },
resizeObserver() {
this.resizeForFilter = new ResizeObserver((entries) => {
if (!this.filterTexts.length) return;
this.layoutResize();
});
this.resizeForFilter.observe(
document.querySelector("#resize-for-filter")
);
},
layoutResize: _.debounce(function () {
this.getScrollStatus();
}, 200),
scrollPre() {
const dom = document.querySelector(".filter-texts-container");
dom.scrollLeft -= 10;
if (dom.scrollLeft <= 0) {
dom.scrollLeft = 0;
}
},
scrollNext() {
const dom = document.querySelector(".filter-texts-container");
dom.scrollLeft += 10;
const width = dom.scrollWidth - dom.offsetWidth;
if (dom.scrollLeft > width) {
dom.scrollLeft = width;
}
},
handleSizeChange(pageSize) {
this.paginationConfig.currentPage = 1;
this.paginationConfig.pageSize = pageSize;
this.search();
},
handleCurrentChange(currentPage) {
this.paginationConfig.currentPage = currentPage;
this.search();
},
initSearch() {
this.handleCurrentChange(1);
},
clearFilter() {
this.$refs.filterUser.clearFilter();
},
clearOneFilter(index) {
this.$refs.filterUser.clearOneFilter(index);
this.$refs.filterUser.search();
},
filterDraw(condition, filterTexts = []) {
this.cacheCondition = condition;
this.filterTexts = filterTexts;
this.initSearch();
},
filterShow() {
this.$refs.filterUser.init();
},
search() {
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
if (this.nikeName) {
param.conditions.push({
field: `nick_name`,
operator: "like",
value: this.nikeName,
});
}
const { currentPage, pageSize } = this.paginationConfig;
logGrid(currentPage, pageSize, param).then((response) => {
this.data = response.data.listObject;
this.paginationConfig.total = response.data.itemCount;
});
},
},
};
</script>
<style lang="scss" scoped>
.table-container {
height: calc(100% - 50px);
}
search(condition) { .table-container-filter {
this.last_condition = condition height: calc(100% - 110px);
condition = formatQuickCondition(condition, 'key') }
const temp = formatCondition(condition) .filter-texts {
const param = temp || {} display: flex;
param['orders'] = formatOrders(this.orderConditions) align-items: center;
const { currentPage, pageSize } = this.paginationConfig margin: 17px 0;
logGrid(currentPage, pageSize, param).then(response => { font-family: "PingFang SC";
this.data = response.data.listObject font-weight: 400;
this.paginationConfig.total = response.data.itemCount
}) .sum {
color: #1f2329;
}
.title {
color: #999999;
margin-left: 8px;
}
.text {
max-width: 280px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding: 1px 22px 1px 6px;
display: inline-block;
align-items: center;
color: #0c296e;
font-size: 14px;
line-height: 22px;
background: rgba(51, 112, 255, 0.1);
border-radius: 2px;
margin: 0;
margin-right: 8px;
position: relative;
i {
position: absolute;
right: 2px;
top: 50%;
transform: translateY(-50%);
cursor: pointer;
} }
}
.clear-btn {
color: #646a73;
}
.clear-btn:hover {
color: #3370ff;
}
.filter-texts-container::-webkit-scrollbar {
display: none;
}
.arrow-filter {
font-size: 16px;
width: 24px;
height: 24px;
cursor: pointer;
color: #646a73;
display: flex;
justify-content: center;
align-items: center;
}
.arrow-filter:hover {
background: rgba(31, 35, 41, 0.1);
border-radius: 4px;
}
.el-icon-arrow-right.arrow-filter {
margin-left: 5px;
}
.el-icon-arrow-left.arrow-filter {
margin-right: 5px;
}
.filter-texts-container {
flex: 1;
overflow-x: auto;
white-space: nowrap;
height: 24px;
} }
} }
</script> .top-operate {
margin-bottom: 16px;
.right-user {
text-align: right;
display: flex;
align-items: center;
justify-content: flex-end;
<style scoped> .de-button {
margin-left: 12px;
}
.el-input--medium .el-input__icon {
line-height: 32px;
}
}
.name-email-search {
width: 240px;
}
}
</style> </style>

View File

@ -13,8 +13,8 @@
clearable clearable
ref="search" ref="search"
v-model="nikeName" v-model="nikeName"
@blur="clearSearch" @blur="initSearch"
@clear="clearSearch" @clear="initSearch"
> >
</el-input> </el-input>
<deBtn <deBtn
@ -200,11 +200,6 @@ export default {
this.destroyTimer(); this.destroyTimer();
}, },
methods: { methods: {
clearSearch() {
this.cachId = "";
this.$emit("reset");
this.initSearch();
},
exportConfirm() { exportConfirm() {
this.$confirm(this.$t("log.confirm"), "", { this.$confirm(this.$t("log.confirm"), "", {
confirmButtonText: this.$t("commons.confirm"), confirmButtonText: this.$t("commons.confirm"),

View File

@ -115,15 +115,7 @@
<div class="filter"> <div class="filter">
<span>{{ $t("dedaterange.label") }}</span> <span>{{ $t("dedaterange.label") }}</span>
<div class="filter-item"> <div class="filter-item">
<el-date-picker <DeDatePick v-model="dataRange"></DeDatePick>
v-model="dataRange"
size="small"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</div> </div>
</div> </div>
</div> </div>
@ -143,8 +135,12 @@ import { filterDataset, dateFormat } from "./options";
import { allRoles } from "@/api/system/user"; import { allRoles } from "@/api/system/user";
import { getDatasetTree, treeByDatasetId } from "@/api/system/dept"; import { getDatasetTree, treeByDatasetId } from "@/api/system/dept";
import { queryAuthModel } from "@/api/authModel/authModel"; import { queryAuthModel } from "@/api/authModel/authModel";
import DeDatePick from '@/components/deCustomCm/deDatePick.vue'
export default { export default {
components: {
DeDatePick
},
data() { data() {
return { return {
treeLoading: false, treeLoading: false,

View File

@ -7,127 +7,120 @@
v-closePress v-closePress
direction="rtl" direction="rtl"
> >
<div class="el-drawer__body-cont"> <div class="el-drawer__body-cont">
<div class="filter">
<div class="filter"> <span>{{ $t("dataset.datalist") }}</span>
<span>{{ $t("dataset.datalist") }}</span> <div class="filter-item">
<div class="filter-item"> <span
<span class="item"
class="item" @click="activeDatasetChange(ele.id)"
@click="activeDatasetChange(ele.id)" :class="[activeDataset.includes(ele.id) ? 'active' : '']"
:class="[activeDataset.includes(ele.id) ? 'active' : '']" :key="ele.id"
:key="ele.id" v-for="ele in selectDatasetsCahe"
v-for="ele in selectDatasetsCahe" >{{ ele.name }}</span
>{{ ele.name }}</span >
>
<el-popover
placement="bottom"
popper-class="user-popper"
width="200"
trigger="click"
>
<el-popover <el-popover
placement="bottom" placement="bottom"
popper-class="user-popper dept" popper-class="user-popper"
width="200" width="200"
trigger="click" trigger="click"
v-loading="treeLoading"
> >
<el-tree <el-popover
ref="datasetTreeRef" placement="bottom"
current-node-key="id" popper-class="user-popper dept"
:data="treeData" width="200"
node-key="id" trigger="click"
highlight-current v-loading="treeLoading"
:filter-node-method="filterNode"
:expand-on-click-node="true"
@node-click="nodeClick"
> >
<span slot-scope="{ data }" class="custom-tree-node"> <el-tree
<span v-if="data.modelInnerType === 'group'"> ref="datasetTreeRef"
<svg-icon icon-class="scene" class="ds-icon-scene" /> current-node-key="id"
<span :data="treeData"
style=" node-key="id"
margin-left: 6px; highlight-current
white-space: nowrap; :filter-node-method="filterNode"
overflow: hidden; :expand-on-click-node="true"
text-overflow: ellipsis; @node-click="nodeClick"
" >
:title="data.name" <span slot-scope="{ data }" class="custom-tree-node">
>{{ data.name }}</span <span v-if="data.modelInnerType === 'group'">
> <svg-icon icon-class="scene" class="ds-icon-scene" />
</span> <span
<span v-else> style="
<span> margin-left: 6px;
<svg-icon white-space: nowrap;
:icon-class="`ds-${data.modelInnerType}`" overflow: hidden;
:class="`ds-icon-${data.modelInnerType}`" text-overflow: ellipsis;
/> "
:title="data.name"
>{{ data.name }}</span
>
</span>
<span v-else>
<span>
<svg-icon
:icon-class="`ds-${data.modelInnerType}`"
:class="`ds-icon-${data.modelInnerType}`"
/>
</span>
<span
style="
margin-left: 6px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
"
:title="data.name"
>{{ data.name }}</span
>
</span> </span>
<span
style="
margin-left: 6px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
"
:title="data.name"
>{{ data.name }}</span
>
</span> </span>
</span> </el-tree>
</el-tree>
<el-select <el-select
ref="datasetSelect" ref="datasetSelect"
v-model="selectDatasets" v-model="selectDatasets"
slot="reference" slot="reference"
popper-class="tree-select" popper-class="tree-select"
multiple multiple
:placeholder="$t('commons.please_select')" :placeholder="$t('commons.please_select')"
value-key="id" value-key="id"
> >
<el-option <el-option
v-for="item in selectDatasets" v-for="item in selectDatasets"
:key="item.name" :key="item.name"
:label="item.name" :label="item.name"
:value="item" :value="item"
/> />
</el-select> </el-select>
</el-popover>
<span class="more" slot="reference">+ {{ $t("panel.more") }}</span>
</el-popover> </el-popover>
<span class="more" slot="reference">+ {{ $t("panel.more") }}</span> </div>
</el-popover>
</div> </div>
</div> <div v-for="ele in filterDataset" :key="ele.name" class="filter">
<div v-for="ele in filterDataset" :key="ele.name" class="filter"> <span>{{ $t(ele.name) }}</span>
<span>{{ $t(ele.name) }}</span> <div class="filter-item">
<div class="filter-item"> <span
<span class="item"
class="item" @click="statusChange(item.value, ele.activeType)"
@click="statusChange(item.value, ele.activeType)" :class="[
:class="[active[ele.activeType].includes(item.value) ? 'active' : '']" active[ele.activeType].includes(item.value) ? 'active' : '',
:key="item.name" ]"
v-for="item in ele.list" :key="item.name"
>{{ $t(item.name) }}</span v-for="item in ele.list"
> >{{ $t(item.name) }}</span
>
</div>
</div> </div>
</div>
<div class="filter"> <div class="filter">
<span>{{ $t("dedaterange.label") }}</span> <span>{{ $t("dedaterange.label") }}</span>
<div class="filter-item"> <div class="filter-item">
<el-date-picker <DeDatePick v-model="dataRange"></DeDatePick>
v-model="dataRange" </div>
size="small"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</div> </div>
</div> </div>
</div>
<div class="foot"> <div class="foot">
<el-button class="btn normal" @click="reset">{{ <el-button class="btn normal" @click="reset">{{
$t("commons.reset") $t("commons.reset")
@ -142,8 +135,12 @@
<script> <script>
import { filterDatasetRecord, dateFormat } from "./options"; import { filterDatasetRecord, dateFormat } from "./options";
import { queryAuthModel } from "@/api/authModel/authModel"; import { queryAuthModel } from "@/api/authModel/authModel";
import DeDatePick from "@/components/deCustomCm/deDatePick.vue";
export default { export default {
components: {
DeDatePick,
},
data() { data() {
return { return {
treeLoading: false, treeLoading: false,
@ -197,7 +194,7 @@ export default {
clearFilter() { clearFilter() {
this.active = { this.active = {
execStatus: [], execStatus: [],
} };
this.dataRange = []; this.dataRange = [];
this.activeDataset = []; this.activeDataset = [];
this.selectDatasets = []; this.selectDatasets = [];
@ -206,15 +203,15 @@ export default {
this.$emit("search", [], []); this.$emit("search", [], []);
}, },
clearOneFilter(index) { clearOneFilter(index) {
(this.filterTextMap[index] || []).forEach(ele => { (this.filterTextMap[index] || []).forEach((ele) => {
const eleKey = ele.split('.'); const eleKey = ele.split(".");
if (eleKey.length === 2) { if (eleKey.length === 2) {
const [p, c ] = eleKey; const [p, c] = eleKey;
this[p][c] = [] this[p][c] = [];
} else { } else {
this[ele] = [] this[ele] = [];
} }
}) });
}, },
statusChange(value, type) { statusChange(value, type) {
const statusIndex = this.active[type].findIndex((ele) => ele === value); const statusIndex = this.active[type].findIndex((ele) => ele === value);
@ -271,15 +268,14 @@ export default {
"datasetCahe", "datasetCahe",
]); ]);
} }
[ ["dataset.task.last_exec_status"].forEach((ele, index) => {
"dataset.task.last_exec_status", const { activeType: type, list } = this.filterDataset[index];
].forEach((ele, index) => {
const { activeType: type, list } =
this.filterDataset[index];
if (this.active[type].length) { if (this.active[type].length) {
params.push( params.push(
`${this.$t(ele)}:${this.active[type] `${this.$t(ele)}:${this.active[type]
.map((item) => this.$t(list.find((itx) => itx.value === item).name)) .map((item) =>
this.$t(list.find((itx) => itx.value === item).name)
)
.join("、")}` .join("、")}`
); );
this.filterTextMap.push([`active.${type}`]); this.filterTextMap.push([`active.${type}`]);
@ -312,14 +308,14 @@ export default {
}); });
} }
}); });
const [ min, max ] = this.dataRange; const [min, max] = this.dataRange;
if (min && max) { if (min && max) {
console.log(1, +min, +max); console.log(1, +min, +max);
conditions.push({ conditions.push({
field: 'dataset_table_task.last_exec_time', field: "dataset_table_task.last_exec_time",
operator: "between", operator: "between",
value: [ +min, +max ], value: [+min, +max],
}) });
} }
return conditions; return conditions;
}, },
@ -336,7 +332,6 @@ export default {
<style lang="scss"> <style lang="scss">
.user-drawer-task { .user-drawer-task {
.el-drawer__body-cont { .el-drawer__body-cont {
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
@ -344,7 +339,7 @@ export default {
width: 100%; width: 100%;
padding-bottom: 80px; padding-bottom: 80px;
} }
.el-drawer__header { .el-drawer__header {
padding: 16px 24px; padding: 16px 24px;
margin: 0; margin: 0;
@ -449,7 +444,7 @@ export default {
right: 0; right: 0;
bottom: 0; bottom: 0;
text-align: right; text-align: right;
background: #FFFFFF; background: #ffffff;
box-shadow: 0px -1px 4px rgba(0, 0, 0, 0.05); box-shadow: 0px -1px 4px rgba(0, 0, 0, 0.05);
} }
} }