Merge pull request '完成编辑按钮与后端接口的对接' (#31) from Brunch_LPQ into main
commit
994dc0be70
@ -0,0 +1,12 @@
|
||||
import { getCurrentInstance } from "vue";
|
||||
import type { ComponentInternalInstance } from "vue";
|
||||
|
||||
export default function useInstance() {
|
||||
const { appContext, proxy } = getCurrentInstance() as ComponentInternalInstance
|
||||
// 获取全局属性
|
||||
const global = appContext.config.globalProperties
|
||||
return {
|
||||
global,
|
||||
proxy
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
// 通用函数类型
|
||||
export type FuncList = () => any
|
||||
|
||||
// 新增和编辑的状态
|
||||
export enum EditType{
|
||||
ADD = '0', //新增
|
||||
EDIT = '1' //编辑
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
// 从Element-plus中导入消息弹出框组件
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
|
||||
export default function myConfirm(text: string): Promise<boolean> {
|
||||
return ElMessageBox.confirm(text, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => true)
|
||||
.catch(() => false)
|
||||
}
|
Loading…
Reference in new issue