refactor: nikeName -> nickName

This commit is contained in:
taojinlong 2022-09-28 15:45:36 +08:00
parent bf118ffb7a
commit 14f206493a
7 changed files with 610 additions and 623 deletions

View File

@ -2,74 +2,73 @@
<el-row style="text-align: left">
<el-row class="top-operate">
<el-col :span="12">
<el-button v-show="position==='templateLog'"
<el-button
v-show="position==='templateLog'"
class="btn"
type="primary"
icon="el-icon-plus"
@click="applyNew()"
>{{$t('commons.create')}}</el-button>
>{{ $t('commons.create') }}</el-button>
<span>&nbsp;</span>
</el-col>
<el-col :span="12" class="right-user">
<el-input
ref="search"
v-model="nickName"
:placeholder="$t('app_template.search_by_keyword')"
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>
>{{ $t("user.filter")
}}<template v-if="filterTexts.length">
({{ cacheCondition.length }})
</template>
</deBtn>
</el-col>
</el-row>
<div class="filter-texts" v-if="filterTexts.length">
<div v-if="filterTexts.length" class="filter-texts">
<span class="sum">{{ paginationConfig.total }}</span>
<span class="title">{{ $t("user.result_one") }}</span>
<el-divider direction="vertical"></el-divider>
<el-divider direction="vertical" />
<i
@click="scrollPre"
v-if="showScroll"
class="el-icon-arrow-left arrow-filter"
></i>
@click="scrollPre"
/>
<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 v-for="(ele, index) in filterTexts" :key="ele" class="text">
{{ ele }} <i class="el-icon-close" @click="clearOneFilter(index)" />
</p>
</div>
<i
@click="scrollNext"
v-if="showScroll"
class="el-icon-arrow-right arrow-filter"
></i>
@click="scrollNext"
/>
<el-button
type="text"
class="clear-btn"
icon="el-icon-delete"
@click="clearFilter"
>{{ $t("user.clear_filter") }}</el-button
>
>{{ $t("user.clear_filter") }}</el-button>
</div>
<div
class="table-container"
id="resize-for-filter"
class="table-container"
:class="[filterTexts.length ? 'table-container-filter' : '']"
>
<grid-table
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
:tableData="data"
:table-data="data"
:columns="[]"
:pagination="paginationConfig"
@sort-change="sortChange"
@ -113,22 +112,22 @@
</grid-table>
</div>
<keep-alive>
<filterUser ref="filterUser" @search="filterDraw"></filterUser>
</keep-alive>
<filterUser ref="filterUser" @search="filterDraw" />
</keep-alive>
</el-row>
</template>
<script>
import DeLayoutContent from "@/components/business/DeLayoutContent";
import GridTable from "@/components/gridTable/index.vue";
import filterUser from './filterUser';
import _ from 'lodash';
import DeLayoutContent from '@/components/business/DeLayoutContent'
import GridTable from '@/components/gridTable/index.vue'
import filterUser from './filterUser'
import _ from 'lodash'
import keyEnter from '@/components/msgCfm/keyEnter.js'
import {
addOrder,
formatOrders,
} from "@/utils/index";
import { logGrid } from "@/api/appTemplateMarket/log";
formatOrders
} from '@/utils/index'
import { logGrid } from '@/api/appTemplateMarket/log'
export default {
name: 'AppTemplateLog',
components: { GridTable, DeLayoutContent, filterUser },
@ -150,133 +149,133 @@ export default {
paginationConfig: {
currentPage: 1,
pageSize: 10,
total: 0,
total: 0
},
data: [],
orderConditions: [],
nikeName: "",
nickName: '',
showScroll: false,
filterTexts: [],
cacheCondition: [],
};
cacheCondition: []
}
},
watch: {
filterTexts: {
handler() {
this.getScrollStatus();
this.getScrollStatus()
},
deep: true,
deep: true
},
appTemplateId:{
appTemplateId: {
handler() {
this.search()
},
}
}
},
mounted() {
this.search();
this.resizeObserver();
this.search()
this.resizeObserver()
},
methods: {
applyNew(){
applyNew() {
this.$emit('applyNew')
},
sortChange({ column, prop, order }) {
this.orderConditions = [];
this.orderConditions = []
if (!order) {
this.initSearch();
return;
this.initSearch()
return
}
this.orderConditions = [];
addOrder({ field: prop, value: order }, this.orderConditions);
this.initSearch();
this.orderConditions = []
addOrder({ field: prop, value: order }, this.orderConditions)
this.initSearch()
},
getScrollStatus() {
this.$nextTick(() => {
const dom = document.querySelector(".filter-texts-container");
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth;
});
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();
});
if (!this.filterTexts.length) return
this.layoutResize()
})
this.resizeForFilter.observe(
document.querySelector("#resize-for-filter")
);
document.querySelector('#resize-for-filter')
)
},
layoutResize: _.debounce(function () {
this.getScrollStatus();
layoutResize: _.debounce(function() {
this.getScrollStatus()
}, 200),
scrollPre() {
const dom = document.querySelector(".filter-texts-container");
dom.scrollLeft -= 10;
const dom = document.querySelector('.filter-texts-container')
dom.scrollLeft -= 10
if (dom.scrollLeft <= 0) {
dom.scrollLeft = 0;
dom.scrollLeft = 0
}
},
scrollNext() {
const dom = document.querySelector(".filter-texts-container");
dom.scrollLeft += 10;
const width = dom.scrollWidth - dom.offsetWidth;
const dom = document.querySelector('.filter-texts-container')
dom.scrollLeft += 10
const width = dom.scrollWidth - dom.offsetWidth
if (dom.scrollLeft > width) {
dom.scrollLeft = width;
dom.scrollLeft = width
}
},
handleSizeChange(pageSize) {
this.paginationConfig.currentPage = 1;
this.paginationConfig.pageSize = pageSize;
this.search();
this.paginationConfig.currentPage = 1
this.paginationConfig.pageSize = pageSize
this.search()
},
handleCurrentChange(currentPage) {
this.paginationConfig.currentPage = currentPage;
this.search();
this.paginationConfig.currentPage = currentPage
this.search()
},
initSearch() {
this.handleCurrentChange(1);
this.handleCurrentChange(1)
},
clearFilter() {
this.$refs.filterUser.clearFilter();
this.$refs.filterUser.clearFilter()
},
clearOneFilter(index) {
this.$refs.filterUser.clearOneFilter(index);
this.$refs.filterUser.search();
this.$refs.filterUser.clearOneFilter(index)
this.$refs.filterUser.search()
},
filterDraw(condition, filterTexts = []) {
this.cacheCondition = condition;
this.filterTexts = filterTexts;
this.initSearch();
this.cacheCondition = condition
this.filterTexts = filterTexts
this.initSearch()
},
filterShow() {
this.$refs.filterUser.init();
this.$refs.filterUser.init()
},
search() {
if(this.position==='templateLog'&&!this.appTemplateId){
if (this.position === 'templateLog' && !this.appTemplateId) {
return
}
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
if (this.nikeName) {
param.keyWord = this.nikeName;
conditions: [...this.cacheCondition]
}
if(this.appTemplateId){
if (this.nickName) {
param.keyWord = this.nickName
}
if (this.appTemplateId) {
param.conditions.push({
field: "app_template_id",
operator: "eq",
value: this.appTemplateId,
field: 'app_template_id',
operator: 'eq',
value: this.appTemplateId
})
}
const { currentPage, pageSize } = this.paginationConfig;
const { currentPage, pageSize } = this.paginationConfig
logGrid(currentPage, pageSize, param).then((response) => {
this.data = response.data.listObject;
this.paginationConfig.total = response.data.itemCount;
});
},
},
};
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
})
}
}
}
</script>
<style lang="scss" scoped>
.table-container {

View File

@ -25,7 +25,7 @@
width="400"
trigger="click"
>
<panel-detail-info></panel-detail-info>
<panel-detail-info />
<i
slot="reference"
class="el-icon-warning icon-class"
@ -164,15 +164,15 @@ import { starStatus, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine'
import bus from '@/utils/bus'
import { queryAll } from '@/api/panel/pdfTemplate'
import ShareHead from '@/views/panel/GrantAuth/ShareHead'
import {export2AppCheck, initPanelData, updatePanelStatus} from '@/api/panel/panel'
import { export2AppCheck, initPanelData, updatePanelStatus } from '@/api/panel/panel'
import { proxyInitPanelData } from '@/api/panel/shareProxy'
import { dataURLToBlob } from '@/components/canvas/utils/utils'
import { findResourceAsBase64 } from '@/api/staticResource/staticResource'
import PanelDetailInfo from "@/views/panel/list/common/PanelDetailInfo";
import PanelDetailInfo from '@/views/panel/list/common/PanelDetailInfo'
export default {
name: 'PanelViewShow',
components: {PanelDetailInfo, Preview, SaveToTemplate, PDFPreExport, ShareHead },
components: { PanelDetailInfo, Preview, SaveToTemplate, PDFPreExport, ShareHead },
props: {
activeTab: {
type: String,
@ -354,12 +354,12 @@ export default {
_this.dataLoading = false
}
},
downLoadToApp(){
downLoadToApp() {
this.dataLoading = true
export2AppCheck(this.$store.state.panel.panelInfo.id).then(rsp=>{
if(rsp.data.checkStatus){
export2AppCheck(this.$store.state.panel.panelInfo.id).then(rsp => {
if (rsp.data.checkStatus) {
this.saveAppFile(rsp.data)
}else{
} else {
this.dataLoading = false
this.$message({
message: rsp.data.checkMes,
@ -496,7 +496,7 @@ export default {
if (this.showType === 1 && this.shareUserId !== null) {
const param = { userId: this.shareUserId }
proxyInitPanelData(this.panelInfo.id, param, null)
} else { initPanelData(this.panelInfo.id,false) }
} else { initPanelData(this.panelInfo.id, false) }
},
changePublishState() {
if (this.panelInfo.status === 'publish') {

View File

@ -7,7 +7,7 @@
<el-col :span="14" class="right-user">
<el-input
ref="search"
v-model="nikeName"
v-model="nickName"
:placeholder="$t('system_parameter_setting.search_keywords')"
prefix-icon="el-icon-search"
class="name-email-search"
@ -122,7 +122,7 @@ export default {
return {
userDrawer: false,
dsTableDetail: {},
nikeName: '',
nickName: '',
loading: false,
dsTableData: [],
tableData: [],
@ -134,7 +134,7 @@ export default {
},
methods: {
initSearch() {
this.filterTable = this.tableData.filter(ele => ele.name.includes(this.nikeName))
this.filterTable = this.tableData.filter(ele => ele.name.includes(this.nickName))
},
selectDataset(row) {
this.dsTableDetail = row

View File

@ -9,64 +9,62 @@
</el-col>
<el-col :span="12" class="right-user">
<el-input
ref="search"
v-model="nickName"
:placeholder="$t('system_parameter_setting.by_event_details')"
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>
>{{ $t("user.filter")
}}<template v-if="filterTexts.length">
({{ cacheCondition.length }})
</template>
</deBtn>
</el-col>
</el-row>
<div class="filter-texts" v-if="filterTexts.length">
<div v-if="filterTexts.length" class="filter-texts">
<span class="sum">{{ paginationConfig.total }}</span>
<span class="title">{{ $t("user.result_one") }}</span>
<el-divider direction="vertical"></el-divider>
<el-divider direction="vertical" />
<i
@click="scrollPre"
v-if="showScroll"
class="el-icon-arrow-left arrow-filter"
></i>
@click="scrollPre"
/>
<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 v-for="(ele, index) in filterTexts" :key="ele" class="text">
{{ ele }} <i class="el-icon-close" @click="clearOneFilter(index)" />
</p>
</div>
<i
@click="scrollNext"
v-if="showScroll"
class="el-icon-arrow-right arrow-filter"
></i>
@click="scrollNext"
/>
<el-button
type="text"
class="clear-btn"
icon="el-icon-delete"
@click="clearFilter"
>{{ $t("user.clear_filter") }}</el-button
>
>{{ $t("user.clear_filter") }}</el-button>
</div>
<div
class="table-container"
id="resize-for-filter"
class="table-container"
:class="[filterTexts.length ? 'table-container-filter' : '']"
>
<grid-table
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
:tableData="data"
:table-data="data"
:columns="[]"
:pagination="paginationConfig"
@sort-change="sortChange"
@ -108,22 +106,22 @@
</grid-table>
</div>
<keep-alive>
<filterUser ref="filterUser" @search="filterDraw"></filterUser>
</keep-alive>
<filterUser ref="filterUser" @search="filterDraw" />
</keep-alive>
</de-layout-content>
</template>
<script>
import DeLayoutContent from "@/components/business/DeLayoutContent";
import GridTable from "@/components/gridTable/index.vue";
import filterUser from './filterUser';
import _ from 'lodash';
import DeLayoutContent from '@/components/business/DeLayoutContent'
import GridTable from '@/components/gridTable/index.vue'
import filterUser from './filterUser'
import _ from 'lodash'
import keyEnter from '@/components/msgCfm/keyEnter.js'
import {
addOrder,
formatOrders,
} from "@/utils/index";
import { logGrid, exportExcel } from "@/api/system/log";
formatOrders
} from '@/utils/index'
import { logGrid, exportExcel } from '@/api/system/log'
export default {
components: { GridTable, DeLayoutContent, filterUser },
mixins: [keyEnter],
@ -133,150 +131,150 @@ export default {
paginationConfig: {
currentPage: 1,
pageSize: 10,
total: 0,
total: 0
},
data: [],
orderConditions: [],
nikeName: "",
nickName: '',
showScroll: false,
filterTexts: [],
cacheCondition: [],
};
cacheCondition: []
}
},
watch: {
filterTexts: {
handler() {
this.getScrollStatus();
this.getScrollStatus()
},
deep: true,
},
deep: true
}
},
mounted() {
this.search();
this.resizeObserver();
this.search()
this.resizeObserver()
},
methods: {
exportConfirm() {
this.$confirm(this.$t("log.confirm"), "", {
confirmButtonText: this.$t("commons.confirm"),
cancelButtonText: this.$t("commons.cancel"),
type: "warning",
this.$confirm(this.$t('log.confirm'), '', {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
})
.then(() => {
this.exportData();
this.exportData()
})
.catch(() => {
// this.$info(this.$t('commons.delete_cancel'))
});
})
},
exportData() {
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
if (this.nikeName) {
param.keyWord = this.nikeName;
conditions: [...this.cacheCondition]
}
if (this.nickName) {
param.keyWord = this.nickName
}
exportExcel(param).then((res) => {
const blob = new Blob([res], { type: "application/vnd.ms-excel" });
const link = document.createElement("a");
link.style.display = "none";
link.href = URL.createObjectURL(blob);
link.download = "DataEase操作日志.xls"; //
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
});
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
const link = document.createElement('a')
link.style.display = 'none'
link.href = URL.createObjectURL(blob)
link.download = 'DataEase操作日志.xls' //
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
})
},
sortChange({ column, prop, order }) {
this.orderConditions = [];
this.orderConditions = []
if (!order) {
this.initSearch();
return;
this.initSearch()
return
}
this.orderConditions = [];
addOrder({ field: prop, value: order }, this.orderConditions);
this.initSearch();
this.orderConditions = []
addOrder({ field: prop, value: order }, this.orderConditions)
this.initSearch()
},
getScrollStatus() {
this.$nextTick(() => {
const dom = document.querySelector(".filter-texts-container");
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth;
});
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();
});
if (!this.filterTexts.length) return
this.layoutResize()
})
this.resizeForFilter.observe(
document.querySelector("#resize-for-filter")
);
document.querySelector('#resize-for-filter')
)
},
layoutResize: _.debounce(function () {
this.getScrollStatus();
layoutResize: _.debounce(function() {
this.getScrollStatus()
}, 200),
scrollPre() {
const dom = document.querySelector(".filter-texts-container");
dom.scrollLeft -= 10;
const dom = document.querySelector('.filter-texts-container')
dom.scrollLeft -= 10
if (dom.scrollLeft <= 0) {
dom.scrollLeft = 0;
dom.scrollLeft = 0
}
},
scrollNext() {
const dom = document.querySelector(".filter-texts-container");
dom.scrollLeft += 10;
const width = dom.scrollWidth - dom.offsetWidth;
const dom = document.querySelector('.filter-texts-container')
dom.scrollLeft += 10
const width = dom.scrollWidth - dom.offsetWidth
if (dom.scrollLeft > width) {
dom.scrollLeft = width;
dom.scrollLeft = width
}
},
handleSizeChange(pageSize) {
this.paginationConfig.currentPage = 1;
this.paginationConfig.pageSize = pageSize;
this.search();
this.paginationConfig.currentPage = 1
this.paginationConfig.pageSize = pageSize
this.search()
},
handleCurrentChange(currentPage) {
this.paginationConfig.currentPage = currentPage;
this.search();
this.paginationConfig.currentPage = currentPage
this.search()
},
initSearch() {
this.handleCurrentChange(1);
this.handleCurrentChange(1)
},
clearFilter() {
this.$refs.filterUser.clearFilter();
this.$refs.filterUser.clearFilter()
},
clearOneFilter(index) {
this.$refs.filterUser.clearOneFilter(index);
this.$refs.filterUser.search();
this.$refs.filterUser.clearOneFilter(index)
this.$refs.filterUser.search()
},
filterDraw(condition, filterTexts = []) {
this.cacheCondition = condition;
this.filterTexts = filterTexts;
this.initSearch();
this.cacheCondition = condition
this.filterTexts = filterTexts
this.initSearch()
},
filterShow() {
this.$refs.filterUser.init();
this.$refs.filterUser.init()
},
search() {
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
if (this.nikeName) {
param.keyWord = this.nikeName;
conditions: [...this.cacheCondition]
}
const { currentPage, pageSize } = this.paginationConfig;
if (this.nickName) {
param.keyWord = this.nickName
}
const { currentPage, pageSize } = this.paginationConfig
logGrid(currentPage, pageSize, param).then((response) => {
this.data = response.data.listObject;
this.paginationConfig.total = response.data.itemCount;
});
},
},
};
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
})
}
}
}
</script>
<style lang="scss" scoped>
.table-container {

View File

@ -6,110 +6,104 @@
type="primary"
icon="el-icon-circle-plus-outline"
@click="() => selectDataset()"
>{{ $t("dataset.add_task") }}</deBtn
>
>{{ $t("dataset.add_task") }}</deBtn>
<deBtn
:disabled="!multipleSelection.length"
secondary
@click="confirmDelete"
>{{ $t("organization.delete") }}</deBtn
>
>{{ $t("organization.delete") }}</deBtn>
</el-col>
<el-col :span="14" class="right-user">
<el-input
ref="search"
v-model="nickName"
:placeholder="$t('components.by_task_name')"
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="!filterTexts.length"
:plain="!!filterTexts.length"
icon="iconfont icon-icon-filter"
@click="filterShow"
>{{ $t("user.filter")
}}<template v-if="filterTexts.length">
({{ filterTexts.length }})
</template>
>{{ $t("user.filter")
}}<template v-if="filterTexts.length">
({{ filterTexts.length }})
</template>
</deBtn>
<el-dropdown trigger="click" :hide-on-click="false">
<deBtn secondary icon="el-icon-setting">{{ $t("user.list") }}</deBtn>
<el-dropdown-menu class="list-colums-slect" slot="dropdown">
<el-dropdown-menu slot="dropdown" class="list-colums-slect">
<p class="title">{{ $t("user.list_info") }}</p>
<el-checkbox
:indeterminate="isIndeterminate"
v-model="checkAll"
:indeterminate="isIndeterminate"
@change="handleCheckAllChange"
>{{ $t("dataset.check_all") }}</el-checkbox
>
>{{ $t("dataset.check_all") }}</el-checkbox>
<el-checkbox-group
v-model="checkedColumnNames"
@change="handleCheckedColumnNamesChange"
>
<el-checkbox
v-for="column in columnNames"
:label="column.props"
:key="column.props"
>{{ $t(column.label) }}</el-checkbox
>
:label="column.props"
>{{ $t(column.label) }}</el-checkbox>
</el-checkbox-group>
</el-dropdown-menu>
</el-dropdown>
</el-col>
</el-row>
<div class="filter-texts" v-if="filterTexts.length">
<div v-if="filterTexts.length" class="filter-texts">
<span class="sum">{{ paginationConfig.total }}</span>
<span class="title">{{ $t("user.result_one") }}</span>
<el-divider direction="vertical"></el-divider>
<el-divider direction="vertical" />
<i
@click="scrollPre"
v-if="showScroll"
class="el-icon-arrow-left arrow-filter"
></i>
@click="scrollPre"
/>
<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 v-for="(ele, index) in filterTexts" :key="ele" class="text">
{{ ele }} <i class="el-icon-close" @click="clearOneFilter(index)" />
</p>
</div>
<i
@click="scrollNext"
v-if="showScroll"
class="el-icon-arrow-right arrow-filter"
></i>
@click="scrollNext"
/>
<el-button
type="text"
class="clear-btn"
icon="el-icon-delete"
@click="clearFilter"
>{{ $t("user.clear_filter") }}</el-button
>
>{{ $t("user.clear_filter") }}</el-button>
</div>
<div
class="table-container"
id="resize-for-filter"
class="table-container"
:class="[filterTexts.length ? 'table-container-filter' : '']"
>
<grid-table
ref="multipleTable"
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
:tableData="data"
:table-data="data"
:columns="checkedColumnNames"
:multipleSelection="multipleSelection"
:multiple-selection="multipleSelection"
:pagination="paginationConfig"
@selection-change="handleSelectionChange"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
ref="multipleTable"
>
<el-table-column type="selection" width="55" />
<el-table-column
min-width="178"
key="name"
min-width="178"
prop="name"
:label="$t('dataset.task_name')"
>
@ -117,20 +111,19 @@
<span>
<el-link
@click="jumpTaskRecord(scope.row)"
>{{ scope.row.name }}</el-link
>
>{{ scope.row.name }}</el-link>
</span>
</template>
</el-table-column>
<el-table-column
min-width="178"
key="datasetName"
min-width="178"
prop="datasetName"
:label="$t('dataset.task.dataset')"
/>
<el-table-column
min-width="100"
key="rate"
min-width="100"
prop="rate"
:label="$t('dataset.execute_rate')"
>
@ -148,8 +141,8 @@
</el-table-column>
<el-table-column
prop="lastExecTime"
key="lastExecTime"
prop="lastExecTime"
min-width="178"
:label="$t('dataset.task.last_exec_time')"
>
@ -161,8 +154,8 @@
</el-table-column>
<el-table-column
prop="lastExecStatus"
key="lastExecStatus"
prop="lastExecStatus"
min-width="140"
:label="$t('dataset.task.last_exec_status')"
>
@ -170,18 +163,18 @@
<span
v-if="scope.row.lastExecStatus"
:class="[`de-${scope.row.lastExecStatus}`, 'de-status']"
>{{
$t(`dataset.${scope.row.lastExecStatus.toLocaleLowerCase()}`)
}}
<svg-icon style="cursor: pointer;" v-if="scope.row.lastExecStatus === 'Error'" @click="showErrorMassage(scope.row.msg)" icon-class="icon-maybe" class="field-icon-location" />
>{{
$t(`dataset.${scope.row.lastExecStatus.toLocaleLowerCase()}`)
}}
<svg-icon v-if="scope.row.lastExecStatus === 'Error'" style="cursor: pointer;" icon-class="icon-maybe" class="field-icon-location" @click="showErrorMassage(scope.row.msg)" />
</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column
prop="nextExecTime"
key="nextExecTime"
prop="nextExecTime"
min-width="178"
:label="$t('dataset.task.next_exec_time')"
>
@ -189,54 +182,54 @@
<span
v-if="
scope.row.nextExecTime &&
scope.row.nextExecTime !== -1 &&
scope.row.rate !== 'SIMPLE' &&
scope.row.status !== 'Pending'
scope.row.nextExecTime !== -1 &&
scope.row.rate !== 'SIMPLE' &&
scope.row.status !== 'Pending'
"
>
{{ scope.row.nextExecTime | timestampFormatDate }}
</span>
<span v-if="!scope.row.nextExecTime || scope.row.rate === 'SIMPLE'"
>-</span
>
<span
v-if="!scope.row.nextExecTime || scope.row.rate === 'SIMPLE'"
>-</span>
</template>
</el-table-column>
<el-table-column
min-width="120"
key="status"
min-width="120"
prop="status"
:label="$t('dataset.task.task_status')"
>
<template slot-scope="scope">
<span :class="[`de-${scope.row.status}`, 'de-status']"
>{{ $t(`dataset.task.${scope.row.status.toLocaleLowerCase()}`) }}
<span
:class="[`de-${scope.row.status}`, 'de-status']"
>{{ $t(`dataset.task.${scope.row.status.toLocaleLowerCase()}`) }}
</span>
</template>
</el-table-column>
<el-table-column
slot="__operation"
:label="$t('commons.operating')"
key="__operation"
:label="$t('commons.operating')"
fixed="right"
width="84"
>
<template slot-scope="scope">
<el-button
@click="selectDataset(scope.row)"
class="text-btn mar3 mar6"
type="text"
>{{
$t(disableEdit(scope.row) ? "auth.view" : "commons.edit")
}}</el-button
>
@click="selectDataset(scope.row)"
>{{
$t(disableEdit(scope.row) ? "auth.view" : "commons.edit")
}}</el-button>
<el-dropdown
size="medium"
trigger="click"
@command="(type) => handleCommand(type, scope.row)"
>
<i @click.stop class="el-icon-more"></i>
<el-dropdown-menu class="de-card-dropdown" slot="dropdown">
<i class="el-icon-more" @click.stop />
<el-dropdown-menu slot="dropdown" class="de-card-dropdown">
<template
v-if="!['Stopped', 'Exec'].includes(scope.row.status)"
>
@ -273,7 +266,7 @@
</div>
<keep-alive>
<filterUser ref="filterUser" @search="filterDraw"></filterUser>
<filterUser ref="filterUser" @search="filterDraw" />
</keep-alive>
<el-dialog
@ -296,58 +289,58 @@
<script>
const columnOptions = [
{
label: "dataset.task_name",
props: "name",
label: 'dataset.task_name',
props: 'name'
},
{
label: "dataset.task.dataset",
props: "datasetName",
label: 'dataset.task.dataset',
props: 'datasetName'
},
{
label: "dataset.execute_rate",
props: "rate",
label: 'dataset.execute_rate',
props: 'rate'
},
{
label: "dataset.task.last_exec_time",
props: "lastExecTime",
label: 'dataset.task.last_exec_time',
props: 'lastExecTime'
},
{
label: "dataset.task.last_exec_status",
props: "lastExecStatus",
label: 'dataset.task.last_exec_status',
props: 'lastExecStatus'
},
{
label: "dataset.task.next_exec_time",
props: "nextExecTime",
label: 'dataset.task.next_exec_time',
props: 'nextExecTime'
},
{
label: "dataset.task.task_status",
props: "status",
},
];
import { formatOrders } from "@/utils/index";
import { datasetTaskList, post } from "@/api/dataset/dataset";
import cron from "@/components/cron/cron";
import TableSelector from "@/views/chart/view/TableSelector";
import { hasDataPermission } from "@/utils/permission";
import GridTable from "@/components/gridTable/index.vue";
import filterUser from "./filterUser.vue";
import msgCfm from "@/components/msgCfm/index";
import _ from "lodash";
label: 'dataset.task.task_status',
props: 'status'
}
]
import { formatOrders } from '@/utils/index'
import { datasetTaskList, post } from '@/api/dataset/dataset'
import cron from '@/components/cron/cron'
import TableSelector from '@/views/chart/view/TableSelector'
import { hasDataPermission } from '@/utils/permission'
import GridTable from '@/components/gridTable/index.vue'
import filterUser from './filterUser.vue'
import msgCfm from '@/components/msgCfm/index'
import _ from 'lodash'
import keyEnter from '@/components/msgCfm/keyEnter.js'
export default {
name: "DatasetTaskList",
name: 'DatasetTaskList',
components: { GridTable, cron, filterUser, TableSelector },
mixins: [msgCfm, keyEnter],
props: {
transCondition: {
type: Object,
default: () => {},
},
default: () => {}
}
},
data() {
return {
nikeName: "",
nickName: '',
showScroll: false,
checkAll: true,
multipleSelection: [],
@ -358,7 +351,7 @@ export default {
paginationConfig: {
currentPage: 1,
pageSize: 10,
total: 0,
total: 0
},
cacheCondition: [],
data: [],
@ -366,290 +359,290 @@ export default {
selectDatasetFlag: false,
table: {},
show_error_massage: false,
error_massage: "",
customType: ["db", "sql", "api"],
};
error_massage: '',
customType: ['db', 'sql', 'api']
}
},
watch: {
filterTexts: {
handler() {
this.getScrollStatus();
this.getScrollStatus()
},
deep: true,
},
deep: true
}
},
created() {
const { taskId, name } = this.transCondition;
const { taskId, name } = this.transCondition
if (taskId) {
this.nikeName = name;
this.nickName = name
}
this.search();
this.search()
this.timer = setInterval(() => {
this.search(false);
}, 10000);
this.search(false)
}, 10000)
},
beforeDestroy() {
clearInterval(this.timer);
clearInterval(this.timer)
},
mounted() {
this.resizeObserver();
this.resizeObserver()
},
methods: {
getScrollStatus() {
this.$nextTick(() => {
const dom = document.querySelector(".filter-texts-container");
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth;
});
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();
});
if (!this.filterTexts.length) return
this.layoutResize()
})
this.resizeForFilter.observe(
document.querySelector("#resize-for-filter")
);
document.querySelector('#resize-for-filter')
)
},
layoutResize: _.debounce(function () {
this.getScrollStatus();
layoutResize: _.debounce(function() {
this.getScrollStatus()
}, 200),
scrollPre() {
const dom = document.querySelector(".filter-texts-container");
dom.scrollLeft -= 10;
const dom = document.querySelector('.filter-texts-container')
dom.scrollLeft -= 10
if (dom.scrollLeft <= 0) {
dom.scrollLeft = 0;
dom.scrollLeft = 0
}
},
scrollNext() {
const dom = document.querySelector(".filter-texts-container");
dom.scrollLeft += 10;
const width = dom.scrollWidth - dom.offsetWidth;
const dom = document.querySelector('.filter-texts-container')
dom.scrollLeft += 10
const width = dom.scrollWidth - dom.offsetWidth
if (dom.scrollLeft > width) {
dom.scrollLeft = width;
dom.scrollLeft = width
}
},
clearFilter() {
this.$refs.filterUser.clearFilter();
this.$refs.filterUser.clearFilter()
},
clearOneFilter(index) {
this.$refs.filterUser.clearOneFilter(index);
this.$refs.filterUser.search();
this.$refs.filterUser.clearOneFilter(index)
this.$refs.filterUser.search()
},
filterDraw(condition, filterTexts = []) {
this.cacheCondition = condition;
this.filterTexts = filterTexts;
this.initSearch();
this.cacheCondition = condition
this.filterTexts = filterTexts
this.initSearch()
},
filterShow() {
this.$refs.filterUser.init();
this.$refs.filterUser.init()
},
handleCommand(key, row) {
switch (key) {
case "exec":
this.execTask(row);
return;
break;
case "delete":
this.deleteTask(row);
return;
break;
case 'exec':
this.execTask(row)
return
break
case 'delete':
this.deleteTask(row)
return
break
default:
break;
break
}
this.changeTaskStatus(row);
this.changeTaskStatus(row)
},
handleSelectionChange(val) {
this.multipleSelection = val;
this.multipleSelection = val
},
handleCheckAllChange(val) {
this.checkedColumnNames = val
? columnOptions.map((ele) => ele.props)
: [];
this.isIndeterminate = false;
: []
this.isIndeterminate = false
},
handleCheckedColumnNamesChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.columnNames.length;
const checkedCount = value.length
this.checkAll = checkedCount === this.columnNames.length
this.isIndeterminate =
checkedCount > 0 && checkedCount < this.columnNames.length;
checkedCount > 0 && checkedCount < this.columnNames.length
},
handleSizeChange(pageSize) {
this.paginationConfig.currentPage = 1;
this.paginationConfig.pageSize = pageSize;
this.search();
this.paginationConfig.currentPage = 1
this.paginationConfig.pageSize = pageSize
this.search()
},
handleCurrentChange(currentPage) {
this.paginationConfig.currentPage = currentPage;
this.search();
this.paginationConfig.currentPage = currentPage
this.search()
},
initSearch() {
this.handleCurrentChange(1);
this.handleCurrentChange(1)
},
search(showLoading = true) {
const { taskId, name } = this.transCondition;
const { taskId, name } = this.transCondition
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
if (this.nikeName) {
conditions: [...this.cacheCondition]
}
if (this.nickName) {
param.conditions.push({
field: `dataset_table_task.name`,
operator: "like",
value: this.nikeName,
});
operator: 'like',
value: this.nickName
})
}
if (taskId && this.nikeName === name) {
if (taskId && this.nickName === name) {
param.conditions.push({
operator: "eq",
operator: 'eq',
value: taskId,
field: "dataset_table_task.id",
});
field: 'dataset_table_task.id'
})
}
const { currentPage, pageSize } = this.paginationConfig;
const { currentPage, pageSize } = this.paginationConfig
datasetTaskList(currentPage, pageSize, param, showLoading).then(
(response) => {
const multipleSelection = this.multipleSelection.map(ele => ele.id)
this.data = response.data.listObject;
this.paginationConfig.total = response.data.itemCount;
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
if (multipleSelection.length) {
this.$nextTick(() => {
this.data.forEach(row => {
if (multipleSelection.includes(row.id)) {
this.$refs.multipleTable.toggleRowSelection(row);
this.$refs.multipleTable.toggleRowSelection(row)
}
});
})
})
}
}
);
)
},
batchDelete() {
post(
"/dataset/task/batchDelete",
'/dataset/task/batchDelete',
this.multipleSelection.map((ele) => ele.id),
false
).then(() => {
this.initSearch();
this.openMessageSuccess("commons.delete_success");
});
this.initSearch()
this.openMessageSuccess('commons.delete_success')
})
},
confirmDelete() {
const options = {
title: "确定删除该任务吗?",
type: "primary",
cb: this.batchDelete,
};
this.handlerConfirm(options);
title: '确定删除该任务吗?',
type: 'primary',
cb: this.batchDelete
}
this.handlerConfirm(options)
},
taskStatus(item) {
post("/dataset/task/lastExecStatus", item, false).then((response) => {
post('/dataset/task/lastExecStatus', item, false).then((response) => {
if (!item.lastExecStatus) {
item.lastExecStatus = response.data.lastExecStatus;
item.lastExecStatus = response.data.lastExecStatus
}
if (!item.lastExecTime) {
item.lastExecTime = response.data.lastExecTime;
item.lastExecTime = response.data.lastExecTime
}
item.msg = response.data.msg;
});
item.msg = response.data.msg
})
},
changeTaskStatus(task) {
const { status } = task;
if (!["Pending", "Underway"].includes(status)) {
return;
const { status } = task
if (!['Pending', 'Underway'].includes(status)) {
return
}
const param = {
...task,
status: status === "Underway" ? "Pending" : "Underway",
};
post("/dataset/task/updateStatus", param)
status: status === 'Underway' ? 'Pending' : 'Underway'
}
post('/dataset/task/updateStatus', param)
.then((response) => {
if (response.success) {
task.status = param.status;
task.status = param.status
this.$message({
message: this.$t("dataset.task.change_success"),
type: "success",
showClose: true,
});
message: this.$t('dataset.task.change_success'),
type: 'success',
showClose: true
})
} else {
this.initSearch(false);
this.initSearch(false)
}
})
.catch(() => {
this.initSearch(false);
});
this.initSearch(false)
})
},
execTask(task) {
this.$confirm(
this.$t("dataset.task.confirm_exec"),
this.$t("dataset.tips"),
this.$t('dataset.task.confirm_exec'),
this.$t('dataset.tips'),
{
confirmButtonText: this.$t("dataset.confirm"),
cancelButtonText: this.$t("dataset.cancel"),
type: "warning",
confirmButtonText: this.$t('dataset.confirm'),
cancelButtonText: this.$t('dataset.cancel'),
type: 'warning'
}
)
.then(() => {
post("/dataset/task/execTask", task).then((response) => {
this.initSearch(true);
});
post('/dataset/task/execTask', task).then((response) => {
this.initSearch(true)
})
})
.catch(() => {});
.catch(() => {})
},
selectDataset(row) {
if (row) {
const { datasetName, id } = row;
const { datasetName, id } = row
this.$router.push({
path: "/task-ds-form",
path: '/task-ds-form',
query: {
datasetName,
id,
},
});
id
}
})
} else {
this.$router.push("/task-ds-form");
this.$router.push('/task-ds-form')
}
},
disableEdit(task) {
return (
task.rate === "SIMPLE" ||
task.status === "Stopped" ||
!hasDataPermission("manage", task.privileges)
);
task.rate === 'SIMPLE' ||
task.status === 'Stopped' ||
!hasDataPermission('manage', task.privileges)
)
},
disableExec(task) {
return (
task.status === "Stopped" ||
task.status === "Pending" ||
task.rate === "SIMPLE" ||
!hasDataPermission("manage", task.privileges)
);
task.status === 'Stopped' ||
task.status === 'Pending' ||
task.rate === 'SIMPLE' ||
!hasDataPermission('manage', task.privileges)
)
},
disableDelete(task) {
return false;
return false
// !hasDataPermission('manage',task.privileges)
},
deleteTask(task) {
const options = {
title: "确定删除该任务吗?",
type: "primary",
title: '确定删除该任务吗?',
type: 'primary',
cb: () => {
post("/dataset/task/delete/" + task.id, null).then((response) => {
this.openMessageSuccess("commons.delete_success");
this.initSearch();
});
},
};
this.handlerConfirm(options);
post('/dataset/task/delete/' + task.id, null).then((response) => {
this.openMessageSuccess('commons.delete_success')
this.initSearch()
})
}
}
this.handlerConfirm(options)
},
showErrorMassage(massage) {
this.show_error_massage = true;
this.error_massage = massage;
this.show_error_massage = true
this.error_massage = massage
},
jumpTaskRecord(item) {
this.$emit("jumpTaskRecord", item);
},
},
};
this.$emit('jumpTaskRecord', item)
}
}
}
</script>
<style scoped>
@ -920,4 +913,4 @@ export default {
cursor: pointer;
}
}
</style>
</style>

View File

@ -6,60 +6,58 @@
</el-col>
<el-col :span="14" class="right-user">
<el-input
ref="search"
v-model="nickName"
:placeholder="$t('components.by_task_name')"
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>
>{{ $t("user.filter")
}}<template v-if="filterTexts.length">
({{ cacheCondition.length }})
</template>
</deBtn>
</el-col>
</el-row>
<div class="filter-texts" v-if="filterTexts.length">
<div v-if="filterTexts.length" class="filter-texts">
<span class="sum">{{ paginationConfig.total }}</span>
<span class="title">{{ $t("user.result_one") }}</span>
<el-divider direction="vertical"></el-divider>
<el-divider direction="vertical" />
<i
@click="scrollPre"
v-if="showScroll"
class="el-icon-arrow-left arrow-filter"
></i>
@click="scrollPre"
/>
<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 v-for="(ele, index) in filterTexts" :key="ele" class="text">
{{ ele }} <i class="el-icon-close" @click="clearOneFilter(index)" />
</p>
</div>
<i
@click="scrollNext"
v-if="showScroll"
class="el-icon-arrow-right arrow-filter"
></i>
@click="scrollNext"
/>
<el-button
type="text"
class="clear-btn"
icon="el-icon-delete"
@click="clearFilter"
>{{ $t("user.clear_filter") }}</el-button
>
>{{ $t("user.clear_filter") }}</el-button>
</div>
<div id="resize-for-filter" class="table-container">
<grid-table
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
:tableData="data"
:table-data="data"
:columns="[]"
:pagination="paginationConfig"
@size-change="handleSizeChange"
@ -74,8 +72,7 @@
"
style="font-size: 12px"
@click="jumpTask(scope.row)"
>{{ scope.row.name }}</el-link
>
>{{ scope.row.name }}</el-link>
</span>
</template>
</el-table-column>
@ -99,15 +96,15 @@
<span
v-if="scope.row.status"
:class="[`de-${scope.row.status}`, 'de-status']"
>{{ $t(`dataset.${scope.row.status.toLocaleLowerCase()}`) }}
<svg-icon style="cursor: pointer;" v-if="scope.row.status === 'Error'" @click="showErrorMassage(scope.row.info)" icon-class="icon-maybe" class="field-icon-location" />
>{{ $t(`dataset.${scope.row.status.toLocaleLowerCase()}`) }}
<svg-icon v-if="scope.row.status === 'Error'" style="cursor: pointer;" icon-class="icon-maybe" class="field-icon-location" @click="showErrorMassage(scope.row.info)" />
</span>
<span v-else>-</span>
</template>
</el-table-column>
</grid-table>
<keep-alive>
<filterUser ref="filterUser" @search="filterDraw"></filterUser>
<filterUser ref="filterUser" @search="filterDraw" />
</keep-alive>
</div>
<el-dialog
@ -131,284 +128,284 @@
import {
formatCondition,
formatOrders,
formatQuickCondition,
} from "@/utils/index";
import { exportExcel, post } from "@/api/dataset/dataset";
import GridTable from "@/components/gridTable/index.vue";
import filterUser from "./filterUserRecord.vue";
import _ from "lodash";
formatQuickCondition
} from '@/utils/index'
import { exportExcel, post } from '@/api/dataset/dataset'
import GridTable from '@/components/gridTable/index.vue'
import filterUser from './filterUserRecord.vue'
import _ from 'lodash'
import keyEnter from '@/components/msgCfm/keyEnter.js'
export default {
name: "TaskRecord",
name: 'TaskRecord',
components: { GridTable, filterUser },
mixins: [keyEnter],
props: {
param: {
type: Object,
default: () => {},
default: () => {}
},
transCondition: {
type: Object,
default: () => {},
},
default: () => {}
}
},
data() {
return {
columns: [],
nikeName: "",
nickName: '',
showScroll: false,
filterTexts: [],
cacheCondition: [],
paginationConfig: {
currentPage: 1,
pageSize: 10,
total: 0,
total: 0
},
data: [],
orderConditions: [],
show_error_massage: false,
error_massage: "",
error_massage: '',
matchLogId: null,
lastRequestComplete: true,
};
},
created() {
const { taskId: id, name: label } = this.transCondition;
if (id) {
this.nikeName = label;
lastRequestComplete: true
}
const { taskId, name, logId } = (this.param || {});
if (this.param !== null && taskId) {
this.matchLogId = logId || this.matchLogId;
this.transCondition.taskId = taskId;
this.transCondition.name = name;
this.nikeName = name;
}
this.createTimer();
},
mounted() {
this.resizeObserver();
},
watch: {
filterTexts: {
handler() {
this.getScrollStatus();
this.getScrollStatus()
},
deep: true,
},
deep: true
}
},
created() {
const { taskId: id, name: label } = this.transCondition
if (id) {
this.nickName = label
}
const { taskId, name, logId } = (this.param || {})
if (this.param !== null && taskId) {
this.matchLogId = logId || this.matchLogId
this.transCondition.taskId = taskId
this.transCondition.name = name
this.nickName = name
}
this.createTimer()
},
mounted() {
this.resizeObserver()
},
beforeDestroy() {
this.destroyTimer();
this.destroyTimer()
},
methods: {
exportConfirm() {
this.$confirm(this.$t("log.confirm"), "", {
confirmButtonText: this.$t("commons.confirm"),
cancelButtonText: this.$t("commons.cancel"),
type: "warning",
this.$confirm(this.$t('log.confirm'), '', {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
})
.then(() => {
this.exportData();
this.exportData()
})
.catch(() => {
// this.$info(this.$t('commons.delete_cancel'))
});
})
},
exportData() {
const { taskId, name } = this.transCondition;
const { taskId, name } = this.transCondition
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
if (this.nikeName) {
conditions: [...this.cacheCondition]
}
if (this.nickName) {
param.conditions.push({
field: `dataset_table_task.name`,
operator: "like",
value: this.nikeName,
});
operator: 'like',
value: this.nickName
})
}
if (taskId && this.nikeName === name) {
if (taskId && this.nickName === name) {
param.conditions.push({
operator: "eq",
operator: 'eq',
value: taskId,
field: "dataset_table_task.id",
});
field: 'dataset_table_task.id'
})
}
exportExcel(param).then((res) => {
const blob = new Blob([res], { type: "application/vnd.ms-excel" });
const link = document.createElement("a");
link.style.display = "none";
link.href = URL.createObjectURL(blob);
link.download = "DataEase" + this.$t("dataset.sync_log") + ".xls";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
});
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
const link = document.createElement('a')
link.style.display = 'none'
link.href = URL.createObjectURL(blob)
link.download = 'DataEase' + this.$t('dataset.sync_log') + '.xls'
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
})
},
getScrollStatus() {
this.$nextTick(() => {
const dom = document.querySelector(".filter-texts-container");
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth;
});
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();
});
if (!this.filterTexts.length) return
this.layoutResize()
})
this.resizeForFilter.observe(
document.querySelector("#resize-for-filter")
);
document.querySelector('#resize-for-filter')
)
},
layoutResize: _.debounce(function () {
this.getScrollStatus();
layoutResize: _.debounce(function() {
this.getScrollStatus()
}, 200),
scrollPre() {
const dom = document.querySelector(".filter-texts-container");
dom.scrollLeft -= 10;
const dom = document.querySelector('.filter-texts-container')
dom.scrollLeft -= 10
if (dom.scrollLeft <= 0) {
dom.scrollLeft = 0;
dom.scrollLeft = 0
}
},
scrollNext() {
const dom = document.querySelector(".filter-texts-container");
dom.scrollLeft += 10;
const width = dom.scrollWidth - dom.offsetWidth;
const dom = document.querySelector('.filter-texts-container')
dom.scrollLeft += 10
const width = dom.scrollWidth - dom.offsetWidth
if (dom.scrollLeft > width) {
dom.scrollLeft = width;
dom.scrollLeft = width
}
},
clearFilter() {
this.$refs.filterUser.clearFilter();
this.$refs.filterUser.clearFilter()
},
clearOneFilter(index) {
this.$refs.filterUser.clearOneFilter(index);
this.$refs.filterUser.search();
this.$refs.filterUser.clearOneFilter(index)
this.$refs.filterUser.search()
},
filterDraw(condition, filterTexts = []) {
this.cacheCondition = condition;
this.filterTexts = filterTexts;
this.initSearch();
this.cacheCondition = condition
this.filterTexts = filterTexts
this.initSearch()
},
filterShow() {
this.$refs.filterUser.init();
this.$refs.filterUser.init()
},
createTimer() {
this.initSearch();
this.initSearch()
if (!this.timer) {
this.timer = setInterval(() => {
this.timerSearch(false);
}, 15000);
this.timerSearch(false)
}, 15000)
}
},
destroyTimer() {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
clearInterval(this.timer)
this.timer = null
}
},
handleSizeChange(pageSize) {
this.paginationConfig.currentPage = 1;
this.paginationConfig.pageSize = pageSize;
this.search();
this.paginationConfig.currentPage = 1
this.paginationConfig.pageSize = pageSize
this.search()
},
handleCurrentChange(currentPage) {
this.paginationConfig.currentPage = currentPage;
this.search();
this.paginationConfig.currentPage = currentPage
this.search()
},
initSearch() {
this.handleCurrentChange(1);
this.handleCurrentChange(1)
},
timerSearch(showLoading = true) {
if (!this.lastRequestComplete) {
return;
return
} else {
this.lastRequestComplete = false;
this.lastRequestComplete = false
}
const { taskId, name } = this.transCondition;
const { taskId, name } = this.transCondition
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
if (this.nikeName) {
conditions: [...this.cacheCondition]
}
if (this.nickName) {
param.conditions.push({
field: `dataset_table_task.name`,
operator: "like",
value: this.nikeName,
});
operator: 'like',
value: this.nickName
})
}
if (taskId && this.nikeName === name) {
if (taskId && this.nickName === name) {
param.conditions.push({
operator: "eq",
operator: 'eq',
value: taskId,
field: "dataset_table_task.id",
});
field: 'dataset_table_task.id'
})
}
post(
"/dataset/taskLog/list/notexcel/" +
'/dataset/taskLog/list/notexcel/' +
this.paginationConfig.currentPage +
"/" +
'/' +
this.paginationConfig.pageSize,
param,
showLoading
)
.then((response) => {
this.data = response.data.listObject;
this.paginationConfig.total = response.data.itemCount;
this.lastRequestComplete = true;
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
this.lastRequestComplete = true
})
.catch(() => {
this.lastRequestComplete = true;
});
this.lastRequestComplete = true
})
},
search(condition, showLoading = true) {
const { taskId, name } = this.transCondition;
const { taskId, name } = this.transCondition
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
if (this.nikeName) {
conditions: [...this.cacheCondition]
}
if (this.nickName) {
param.conditions.push({
field: `dataset_table_task.name`,
operator: "like",
value: this.nikeName,
});
operator: 'like',
value: this.nickName
})
}
if (taskId && this.nikeName === name) {
if (taskId && this.nickName === name) {
param.conditions.push({
operator: "eq",
operator: 'eq',
value: taskId,
field: "dataset_table_task.id",
});
field: 'dataset_table_task.id'
})
}
post(
"/dataset/taskLog/list/notexcel/" +
'/dataset/taskLog/list/notexcel/' +
this.paginationConfig.currentPage +
"/" +
'/' +
this.paginationConfig.pageSize,
param,
showLoading
).then((response) => {
this.data = response.data.listObject;
this.paginationConfig.total = response.data.itemCount;
});
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
})
},
showErrorMassage(massage) {
this.show_error_massage = true;
this.error_massage = massage;
this.show_error_massage = true
this.error_massage = massage
},
jumpTask(item) {
this.$emit("jumpTask", item);
this.$emit('jumpTask', item)
},
rowClassMethod({ row, rowIndex }) {
if (this.matchLogId && this.matchLogId === row.id) {
return "row-match-class";
return 'row-match-class'
}
return "";
},
},
};
return ''
}
}
}
</script>
<style scoped>

View File

@ -16,7 +16,7 @@
<el-col :span="12" class="right-user">
<el-input
ref="search"
v-model="nikeName"
v-model="nickName"
:placeholder="$t('role.search_by_name_email')"
prefix-icon="el-icon-search"
class="name-email-search"
@ -151,13 +151,13 @@
prop="roles"
:label="$t('commons.role')"
>
<template slot-scope="scope">
<el-tooltip popper-class="de-table-tooltips" class="item" effect="dark" placement="top">
<!-- // {{}} HTML -->
<div v-html="filterRoles(scope.row.roles)" slot="content"></div>
<div class="de-one-line">{{ filterRoles(scope.row.roles) }}</div>
</el-tooltip>
</template>
<template slot-scope="scope">
<el-tooltip popper-class="de-table-tooltips" class="item" effect="dark" placement="top">
<!-- // {{}} HTML -->
<div slot="content" v-html="filterRoles(scope.row.roles)" />
<div class="de-one-line">{{ filterRoles(scope.row.roles) }}</div>
</el-tooltip>
</template>
</el-table-column>
<el-table-column
@ -366,7 +366,7 @@ export default {
cacheCondition: [],
depts: null,
roles: [],
nikeName: '',
nickName: '',
userRoles: [],
orderConditions: [],
isPluginLoaded: false,
@ -540,11 +540,11 @@ export default {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition]
}
if (this.nikeName) {
if (this.nickName) {
param.conditions.push({
field: `concat(nick_name, ',' , email)`,
operator: 'like',
value: this.nikeName
value: this.nickName
})
}
const { currentPage, pageSize } = this.paginationConfig