| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <template>
- <page-list
- :list="list"
- :columns="columns"
- :group-actions="groupActions"
- :single-actions="singleActions"
- :export-data-options="exportDataOptions" />
- </template>
- <script>
- import WindowsMixin from '@/mixins/windows'
- import ListMixin from '@/mixins/list'
- import SingleActionsMixin from '../mixins/singleActions'
- import ColumnsMixin from '../mixins/columns'
- import { filterOptions } from '../utils/filters'
- export default {
- name: 'PhoneImageList',
- mixins: [WindowsMixin, ListMixin, ColumnsMixin, SingleActionsMixin],
- props: {
- id: String,
- getParams: {
- type: Object,
- default: () => { },
- },
- },
- data () {
- return {
- list: this.$list.createList(this, {
- id: this.id,
- resource: 'llm_images',
- getParams: this.getParam,
- filterOptions,
- hiddenColumns: [],
- }),
- groupActions: [
- {
- label: this.$t('common.create'),
- action: () => {
- this.createDialog('DesktopImageCreateDialog', {
- onManager: this.onManager,
- })
- },
- meta: () => {
- return {
- buttonType: 'primary',
- validate: true,
- }
- },
- },
- {
- label: this.$t('aice.llm_image.import_community_image'),
- action: () => {
- this.$router.push({ name: 'LlmImageImportCommunity' })
- },
- },
- {
- label: this.$t('table.action.delete'),
- action: () => {
- this.createDialog('DeleteResDialog', {
- vm: this,
- data: this.list.selectedItems,
- columns: this.columns,
- title: this.$t('table.action.delete'),
- name: this.$t('aice.image'),
- onManager: this.onManager,
- })
- },
- meta: () => {
- const ret = { validate: this.list.selected.length }
- if (this.list.selectedItems.some(item => !item.can_delete)) {
- ret.validate = false
- return ret
- }
- return ret
- },
- },
- ],
- }
- },
- computed: {
- exportDataOptions () {
- return {
- downloadType: 'local',
- title: this.$t('aice.image'),
- items: [
- { label: 'ID', key: 'id' },
- ...this.columns,
- ],
- }
- },
- },
- created () {
- this.initSidePageTab('detail')
- this.list.fetchData()
- },
- methods: {
- getParam () {
- const ret = {
- ...this.getParams,
- details: true,
- }
- return ret
- },
- handleOpenSidepage (row) {
- this.sidePageTriggerHandle(this, 'LlmImageSidePage', {
- id: row.id,
- resource: 'llm_images',
- getParams: this.getParam,
- }, {
- list: this.list,
- })
- },
- },
- }
- </script>
- <style>
- </style>
|