feature-JimuReport-1106-yjl
lijingjia 4 weeks ago
commit 8264ec7c46

@ -12,7 +12,7 @@
"serve": "npm run dev", "serve": "npm run dev",
"dev": "vite", "dev": "vite",
"build": "cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts", "build": "cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts",
"build:test": "cross-env vite build --mode test && esno ./build/script/postBuild.ts", "build:test": "cross-env vite build --mode integration && esno ./build/script/postBuild.ts",
"build:no-cache": "pnpm clean:cache && npm run build", "build:no-cache": "pnpm clean:cache && npm run build",
"report": "cross-env REPORT=true npm run build", "report": "cross-env REPORT=true npm run build",
"type:check": "vue-tsc --noEmit --skipLibCheck", "type:check": "vue-tsc --noEmit --skipLibCheck",

@ -2,11 +2,9 @@
<renderComponent /> <renderComponent />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { VNode } from 'vue' const props = defineProps({
renderProp: [String, Object],
const props = defineProps<{ })
renderProp: VNode
}>()
const renderComponent = { const renderComponent = {
render: () => { render: () => {
return props.renderProp return props.renderProp

@ -3,7 +3,7 @@
<template v-for="(action, index) in getActions" :key="`${index}-${action.label}`"> <template v-for="(action, index) in getActions" :key="`${index}-${action.label}`">
<Tooltip v-if="action.tooltip" v-bind="getTooltip(action.tooltip)"> <Tooltip v-if="action.tooltip" v-bind="getTooltip(action.tooltip)">
<PopConfirmButton v-bind="action"> <PopConfirmButton v-bind="action">
<RenderComponent v-if="action.isCustomIcon" :renderProp="action.icon" /> <RenderComponent v-if="action.isCustomIcon" :renderProp="action.customIcon" />
<template v-else> <template v-else>
<Icon v-if="action.icon" :icon="action.icon" :class="{ 'mr-1': !!action.label }" /> <Icon v-if="action.icon" :icon="action.icon" :class="{ 'mr-1': !!action.label }" />
<template v-if="action.label">{{ action.label }}</template> <template v-if="action.label">{{ action.label }}</template>
@ -11,7 +11,7 @@
</PopConfirmButton> </PopConfirmButton>
</Tooltip> </Tooltip>
<PopConfirmButton v-else v-bind="action"> <PopConfirmButton v-else v-bind="action">
<RenderComponent v-if="action.isCustomIcon" :renderProp="action.icon" /> <RenderComponent v-if="action.isCustomIcon" :renderProp="action.customIcon" />
<template v-else> <template v-else>
<Icon v-if="action.icon" :icon="action.icon" :class="{ 'mr-1': !!action.label }" /> <Icon v-if="action.icon" :icon="action.icon" :class="{ 'mr-1': !!action.label }" />
<template v-if="action.label">{{ action.label }}</template> <template v-if="action.label">{{ action.label }}</template>

@ -7,7 +7,8 @@ export interface ActionItem extends ButtonProps {
label?: string label?: string
color?: 'success' | 'error' | 'warning' color?: 'success' | 'error' | 'warning'
isCustomIcon?: boolean isCustomIcon?: boolean
icon?: string | JSX.Element | VNode icon?: string
customIcon?: string | JSX.Element | VNode
popConfirm?: PopConfirm popConfirm?: PopConfirm
disabled?: boolean disabled?: boolean
divider?: boolean divider?: boolean

@ -49,7 +49,7 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, onMounted } from 'vue' import { ref, onMounted, h } from 'vue'
import type { BankItem } from './columns' import type { BankItem } from './columns'
import { columns, searchFormSchema, bankNoFormat } from './columns' import { columns, searchFormSchema, bankNoFormat } from './columns'
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table' import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'
@ -125,12 +125,11 @@
const getActionOptList = (record): ActionItem[] => { const getActionOptList = (record): ActionItem[] => {
return [ return [
{ {
/* icon: h('i', { customIcon: h('i', {
class: 'iconfont icon-xiazai', class: 'iconfont icon-xiazai',
style: { color: '#257afa', fontSize: '14px' }, style: { color: '#257afa', fontSize: '14px' },
}), }),
isCustomIcon: true, */ isCustomIcon: true,
icon: 'ant-design:cloud-download-outlined',
tooltip: '下载', tooltip: '下载',
onClick: handleDownload.bind(null, record), onClick: handleDownload.bind(null, record),
}, },

@ -32,7 +32,7 @@
class="iconfont icon-fuzhi3" class="iconfont icon-fuzhi3"
style="color: #257afa; font-size: 14px; margin-right: 4px; cursor: pointer" style="color: #257afa; font-size: 14px; margin-right: 4px; cursor: pointer"
v-if="record.invoiceNumber" v-if="record.invoiceNumber"
@click="copyHandle(record)" @click.stop="copyHandle(record)"
></i> ></i>
<span>{{ record.invoiceNumber || '' }}</span> <span>{{ record.invoiceNumber || '' }}</span>
</template> </template>
@ -55,7 +55,7 @@
</a-modal> </a-modal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, defineEmits, computed, watch } from 'vue' import { ref, defineEmits, computed, watch, unref } from 'vue'
import { BasicTable, useTable } from '/@/components/Table' import { BasicTable, useTable } from '/@/components/Table'
import { columns, searchFormSchema } from './columns' import { columns, searchFormSchema } from './columns'
import { GetInvoiceList } from '../../api' import { GetInvoiceList } from '../../api'

@ -56,7 +56,7 @@
class="iconfont icon-fuzhi3" class="iconfont icon-fuzhi3"
style="color: #257afa; font-size: 14px; margin-right: 4px; cursor: pointer" style="color: #257afa; font-size: 14px; margin-right: 4px; cursor: pointer"
v-if="record.invoiceNumber" v-if="record.invoiceNumber"
@click="copyHandle(record)" @click.stop="copyHandle(record)"
></i> ></i>
<span>{{ record.invoiceNumber || '' }}</span> <span>{{ record.invoiceNumber || '' }}</span>
</template> </template>
@ -98,7 +98,7 @@
</a-spin> </a-spin>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed } from 'vue' import { ref, computed, unref } from 'vue'
import { Divider } from 'ant-design-vue' import { Divider } from 'ant-design-vue'
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table' import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'
import SearchTable from './components/SearchTable.vue' import SearchTable from './components/SearchTable.vue'

@ -32,13 +32,13 @@
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<TableAction :actions="getActionOptList(record)" /> <TableAction :actions="getActionOptList(record)" />
</template> </template>
<template v-if="column.dataIndex == 'invoiceNumber'"> <template v-if="column.dataIndex == 'reimbursementId'">
<span>{{ record.invoiceNumber || '' }}</span> <span>{{ record.reimbursementId || '' }}</span>
<i <i
class="iconfont icon-fuzhi3" class="iconfont icon-fuzhi3"
style="color: #257afa; font-size: 14px; margin-left: 4px; cursor: pointer" style="color: #257afa; font-size: 14px; margin-left: 4px; cursor: pointer"
v-if="record.invoiceNumber" v-if="record.reimbursementId"
@click="copyHandle(record)" @click.stop="copyHandle(record)"
></i> ></i>
</template> </template>
<template v-if="column.dataIndex == 'reimbursementType'"> <template v-if="column.dataIndex == 'reimbursementType'">
@ -56,6 +56,7 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { unref, h } from 'vue'
import { ReimbursementGetList, ReimbursementDelete } from './api.js' import { ReimbursementGetList, ReimbursementDelete } from './api.js'
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table' import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'
import { formatParams } from '/@/hooks/web/common' import { formatParams } from '/@/hooks/web/common'
@ -121,14 +122,12 @@
const canEditable = [0, 2, 4].includes(record.reimbursementType) const canEditable = [0, 2, 4].includes(record.reimbursementType)
return [ return [
{ {
icon: canEditable ? 'clarity:note-edit-line' : 'ant-design:file-text-outlined', customIcon: h('i', {
/* icon: canEditable class: 'iconfont icon-chakan',
? 'clarity:note-edit-line' style: { color: '#257afa', fontSize: '16px' },
: h('i', { }),
class: 'iconfont icon-chakan', icon: 'clarity:note-edit-line',
style: { color: '#257afa', fontSize: '16px' }, isCustomIcon: !canEditable,
}), */
// isCustomIcon: !canEditable,
tooltip: canEditable ? '编辑' : '查看', tooltip: canEditable ? '编辑' : '查看',
onClick: GoDetailed.bind(null, record), onClick: GoDetailed.bind(null, record),
}, },
@ -158,8 +157,8 @@
}) })
} }
const copyHandle = (row: BillItem) => { const copyHandle = (row: BillItem) => {
const { clipboardRef, isSuccessRef } = useCopyToClipboard(row.invoiceNumber) const { clipboardRef, isSuccessRef } = useCopyToClipboard(row.reimbursementId)
clipboardRef.value = row.invoiceNumber clipboardRef.value = row.reimbursementId
if (unref(isSuccessRef)) { if (unref(isSuccessRef)) {
createMessage.success('复制成功!') createMessage.success('复制成功!')
} }

@ -51,7 +51,7 @@
class="iconfont icon-fuzhi3" class="iconfont icon-fuzhi3"
style="color: #257afa; font-size: 14px; margin-right: 4px; cursor: pointer" style="color: #257afa; font-size: 14px; margin-right: 4px; cursor: pointer"
v-if="record.invoiceNumber" v-if="record.invoiceNumber"
@click="copyHandle(record)" @click.stop="copyHandle(record)"
></i> ></i>
<span>{{ record.invoiceNumber || '' }}</span> <span>{{ record.invoiceNumber || '' }}</span>
</template> </template>
@ -62,7 +62,7 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { ref, unref } from 'vue'
import { SvgIcon } from '/@/components/Icon' import { SvgIcon } from '/@/components/Icon'
import { BasicTable, useTable } from '/@/components/Table' import { BasicTable, useTable } from '/@/components/Table'
import { GetInfo } from '../api' import { GetInfo } from '../api'

@ -29,7 +29,7 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted } from 'vue' import { onMounted, unref, h } from 'vue'
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table' import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'
import { GetList } from './api' import { GetList } from './api'
import { formatParams } from '/@/hooks/web/common' import { formatParams } from '/@/hooks/web/common'
@ -90,22 +90,20 @@
const getActionOptList = (record): ActionItem[] => { const getActionOptList = (record): ActionItem[] => {
return [ return [
{ {
icon: 'ant-design:file-text-outlined', customIcon: h('i', {
/* icon: h('i', {
class: 'iconfont icon-chakan', class: 'iconfont icon-chakan',
style: { color: '#257afa', fontSize: '16px' }, style: { color: '#257afa', fontSize: '16px' },
}), }),
isCustomIcon: true, */ isCustomIcon: true,
tooltip: '明细', tooltip: '明细',
onClick: handleDetails.bind(null, record), onClick: handleDetails.bind(null, record),
}, },
{ {
icon: 'ant-design:cloud-download-outlined', customIcon: h('i', {
/* icon: h('i', {
class: 'iconfont icon-xiazai', class: 'iconfont icon-xiazai',
style: { color: '#257afa', fontSize: '14px' }, style: { color: '#257afa', fontSize: '14px' },
}), }),
isCustomIcon: true, */ isCustomIcon: true,
tooltip: '下载', tooltip: '下载',
onClick: handleDownload.bind(null, record), onClick: handleDownload.bind(null, record),
}, },

Loading…
Cancel
Save