1
continuous-integration/drone/push Build is passing Details

uat_us
wangxiaoshuang 2024-10-18 14:07:36 +08:00
parent bc15ac1cd3
commit 9c98cfb668
1 changed files with 50 additions and 41 deletions

View File

@ -39,14 +39,14 @@
size="mini" size="mini"
@click="getList" @click="getList"
> >
{{ $t("common:button:search") }} {{ $t('common:button:search') }}
</el-button> </el-button>
<el-button <el-button
size="mini" size="mini"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="handleReset" @click="handleReset"
> >
{{ $t("common:button:reset") }} {{ $t('common:button:reset') }}
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -67,7 +67,7 @@
sortable="custom" sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ $fd("EventTypeName", scope.row.EventTypeName) }}</span> <span>{{ $fd('EventTypeName', scope.row.EventTypeName) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -80,7 +80,7 @@
<el-tag <el-tag
:type="['info', 'success', 'primary'][scope.row.EventState]" :type="['info', 'success', 'primary'][scope.row.EventState]"
> >
{{ $fd("EventState", scope.row.EventState) }} {{ $fd('EventState', scope.row.EventState) }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -98,10 +98,10 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" @click="view(scope.row)"> <el-button size="mini" type="text" @click="view(scope.row)">
{{ $t("common:button:view") }} {{ $t('common:button:view') }}
</el-button> </el-button>
<el-button size="mini" type="text" @click="rePublish(scope.row)"> <el-button size="mini" type="text" @click="rePublish(scope.row)">
{{ $t("system:event:button:rePublish") }} {{ $t('system:event:button:rePublish') }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -123,21 +123,21 @@
</div> </div>
</template> </template>
<script> <script>
import { getEventStoreRecordList, rePublishEvent } from "@/api/admin"; import { getEventStoreRecordList, rePublishEvent } from '@/api/admin'
import Pagination from "@/components/Pagination"; import Pagination from '@/components/Pagination'
import BaseModel from "@/components/BaseModel"; import BaseModel from '@/components/BaseModel'
const searchDataDefault = () => { const searchDataDefault = () => {
return { return {
EventState: null, EventState: null,
EventTypeName: null, EventTypeName: null,
Asc: true, Asc: true,
SortField: "", SortField: '',
PageIndex: 1, PageIndex: 1,
PageSize: 20, PageSize: 20,
}; }
}; }
export default { export default {
name: "event", name: 'event',
components: { Pagination, BaseModel }, components: { Pagination, BaseModel },
data() { data() {
return { return {
@ -147,70 +147,79 @@ export default {
loading: false, loading: false,
PublishVersionList: [], PublishVersionList: [],
selectTableList: [], selectTableList: [],
model_cfg: { visible: false, title: "", width: "500px" }, model_cfg: { visible: false, title: '', width: '500px' },
info: null, info: null,
}; }
}, },
mounted() { mounted() {
this.getList(); this.getList()
}, },
methods: { methods: {
getList() { getList() {
this.loading = true; this.loading = true
getEventStoreRecordList(this.searchData) getEventStoreRecordList(this.searchData)
.then((res) => { .then((res) => {
this.loading = false; this.loading = false
this.list = res.Result.CurrentPageData; this.list = res.Result.CurrentPageData
this.total = res.Result.TotalCount; this.total = res.Result.TotalCount
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false
}); })
}, },
async rePublish(row) { async rePublish(row) {
try { try {
this.loading = true; this.loading = true
let res = await rePublishEvent({ let res = await rePublishEvent({
EventId: row.Id, EventId: row.Id,
}); })
if (res.IsSuccess) { if (res.IsSuccess) {
this.$message.success( this.$message.success(
this.$t("system:event:message:rePublishSuccess") this.$t('system:event:message:rePublishSuccess')
); )
this.getList(); this.getList()
} }
} catch (err) { } catch (err) {
this.loading = false; this.loading = false
console.log(err); console.log(err)
} }
}, },
// //
handleReset() { handleReset() {
this.searchData = searchDataDefault(); this.searchData = searchDataDefault()
this.getList(); this.getList()
}, },
// //
handleSortByColumn(column) { handleSortByColumn(column) {
if (column.order === "ascending") { if (column.order === 'ascending') {
this.searchData.Asc = true; this.searchData.Asc = true
} else { } else {
this.searchData.Asc = false; this.searchData.Asc = false
} }
this.searchData.SortField = column.prop; this.searchData.SortField = column.prop
this.searchData.PageIndex = 1; this.searchData.PageIndex = 1
this.getList(); this.getList()
}, },
// //
handleSelectionChange(val) { handleSelectionChange(val) {
this.selectTableList = val; this.selectTableList = val
}, },
// //
view(row) { view(row) {
this.info = row.EventData; let info = JSON.parse(row.EventData)
this.model_cfg.visible = true; let message = ''
if (info) {
Object.keys(info).forEach((key) => {
message += `<div style="margin-bottom:10px">
<span style="color:#F56C6C">${key}</span><span style="color:#67C23A">${info[key]}</span>
</div>`
})
}
this.info = message
this.model_cfg.visible = true
}, },
}, },
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.event { .event {