费用申请

szh-new
lijingjia 5 months ago
parent f2f819ea11
commit 5004dc3485

@ -16,6 +16,7 @@
<TableSetting <TableSetting
v-if="showTableSetting" v-if="showTableSetting"
:setting="tableSetting" :setting="tableSetting"
:id="id"
@columns-change="handleColumnChange" @columns-change="handleColumnChange"
/> />
</div> </div>
@ -52,6 +53,10 @@
type: [String, Array] as PropType<string | string[]>, type: [String, Array] as PropType<string | string[]>,
default: '', default: '',
}, },
id: {
type: Number,
default: 0
}
}, },
emits: ['columns-change'], emits: ['columns-change'],
setup(_, { emit }) { setup(_, { emit }) {

@ -161,8 +161,14 @@
Icon, Icon,
}, },
emits: ['columns-change'], emits: ['columns-change'],
props: {
id: {
type: Number,
default: 0
}
},
setup(_, { emit, attrs }) { setup(props, { emit, attrs }) {
const { t } = useI18n() const { t } = useI18n()
const table = useTableContext() const table = useTableContext()
@ -505,6 +511,7 @@
}) })
if (!type) { if (!type) {
let Apidata = { let Apidata = {
id: props.id,
permissionId: '', permissionId: '',
content: JSON.stringify({ content: JSON.stringify({
columns: data, columns: data,

@ -5,6 +5,7 @@
<ColumnSetting <ColumnSetting
v-if="getSetting.setting" v-if="getSetting.setting"
:get-popup-container="getTableContainer" :get-popup-container="getTableContainer"
:id="id"
@columns-change="handleColumnChange" @columns-change="handleColumnChange"
/> />
<FullScreenSetting v-if="getSetting.fullScreen" :get-popup-container="getTableContainer" /> <FullScreenSetting v-if="getSetting.fullScreen" :get-popup-container="getTableContainer" />
@ -34,6 +35,10 @@
type: Object as PropType<TableSetting>, type: Object as PropType<TableSetting>,
default: () => ({}), default: () => ({}),
}, },
id: {
type: Number,
default: 0
}
}, },
emits: ['columns-change'], emits: ['columns-change'],
setup(props, { emit }) { setup(props, { emit }) {

@ -11,7 +11,7 @@ export function useTableHeader(
handlers: InnerHandlers, handlers: InnerHandlers,
) { ) {
const getHeaderProps = computed((): Recordable => { const getHeaderProps = computed((): Recordable => {
const { title, showTableSetting, titleHelpMessage, tableSetting } = unref(propsRef) const { title, showTableSetting, titleHelpMessage, tableSetting, id } = unref(propsRef)
const hideTitle = !slots.tableTitle && !title && !slots.toolbar && !showTableSetting const hideTitle = !slots.tableTitle && !title && !slots.toolbar && !showTableSetting
if (hideTitle && !isString(title)) { if (hideTitle && !isString(title)) {
return {} return {}
@ -25,6 +25,7 @@ export function useTableHeader(
TableHeader, TableHeader,
{ {
title, title,
id,
titleHelpMessage, titleHelpMessage,
showTableSetting, showTableSetting,
tableSetting, tableSetting,

@ -151,5 +151,10 @@ export const basicProps = {
showSearchForm: { showSearchForm: {
type: Boolean, type: Boolean,
default: true default: true
},
// 表格的id增加全选使用
id: {
type: Number,
default: 0
} }
} }

@ -214,7 +214,8 @@ export interface BasicTableProps<T = any> {
// 分页配置 // 分页配置
pagination?: PaginationProps | boolean pagination?: PaginationProps | boolean
// loading加载 // loading加载
loading?: boolean loading?: boolean,
id?: Number,
/** /**
* The column contains children to display * The column contains children to display

@ -1,3 +1,5 @@
import { router } from "/@/router"
import { useMultipleTabStore } from '/@/store/modules/multipleTab'
// 格式表格时间 // 格式表格时间
export function formatTableData(v) { export function formatTableData(v) {
if (v) { if (v) {
@ -8,3 +10,27 @@ export function formatTableData(v) {
return '' return ''
} }
} }
/* ()
* topath: path
*/
export function closePage(topath) {
const tabStore = useMultipleTabStore()
// 当前路由
const fullPath = router?.currentRoute?._value?.fullPath
// 有目标路径则跳转
if (topath) {
router.push(topath)
} else {
// 父级路由
const parent = router?.options?.history?.state?.back
console.log(router)
// 如果存在父级路由,直接返回父级
if (parent) {
router.push(parent)
} else {
// 否则返回上一级路由
router.back()
}
}
}

@ -95,7 +95,8 @@
showIndexColumn: true, showIndexColumn: true,
canResize: false, canResize: false,
rowSelection: { type: 'checkbox' }, rowSelection: { type: 'checkbox' },
immediate: false immediate: false,
id: 1
}) })
// //
const add = () => { const add = () => {

@ -8,6 +8,7 @@
<a-spin :spinning="dloading"> <a-spin :spinning="dloading">
<div class="ds-card"> <div class="ds-card">
<a-button @click="save" type="link">保存</a-button> <a-button @click="save" type="link">保存</a-button>
<a-button @click="deleteItem" type="link">删除</a-button>
</div> </div>
<!-- 表单区域 --> <!-- 表单区域 -->
<div class="form-area"> <div class="form-area">
@ -47,6 +48,7 @@
import { onMounted, ref } from 'vue' import { onMounted, ref } from 'vue'
import { BasicTable, useTable } from '/@/components/Table' import { BasicTable, useTable } from '/@/components/Table'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import { closePage } from '/@/hooks/web/common'
import { BasicForm, useForm } from '/@/components/Form' import { BasicForm, useForm } from '/@/components/Form'
import ApplyInfo from './components/applyInfo.vue' import ApplyInfo from './components/applyInfo.vue'
// //
@ -153,6 +155,10 @@
init() init()
}) })
} }
//
const deleteItem = () => {
closePage()
}
// //
const init = () => { const init = () => {
const id = route.query.id const id = route.query.id

Loading…
Cancel
Save