保存进度!
This commit is contained in:
27
企业级管理系统/web/项目源码/src/hook/dialogHook.js
Normal file
27
企业级管理系统/web/项目源码/src/hook/dialogHook.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/** props */
|
||||
export const propsType = {
|
||||
flag: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: "30%"
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: "消息"
|
||||
}
|
||||
}
|
||||
/** 自定义hook */
|
||||
export function dialogHook(emit){
|
||||
/** dialog关闭 */
|
||||
const close = (form) => {
|
||||
emit("update:flag", false)
|
||||
// 重置表单
|
||||
form && form.value.handlerFormReset();
|
||||
};
|
||||
return {
|
||||
close
|
||||
};
|
||||
}
|
19
企业级管理系统/web/项目源码/src/hook/infoHook.js
Normal file
19
企业级管理系统/web/项目源码/src/hook/infoHook.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { reactive } from "vue";
|
||||
import { GetCategory } from "@/api/info";
|
||||
/** 自定义hook */
|
||||
export function categoryHook(){
|
||||
const infoData = reactive({
|
||||
category_options: []
|
||||
})
|
||||
/** 获取分类 */
|
||||
const handlerGetCategory = () => {
|
||||
return GetCategory().then(response => {
|
||||
// return response.data;
|
||||
infoData.category_options = response.data;
|
||||
});
|
||||
};
|
||||
return {
|
||||
infoData,
|
||||
handlerGetCategory
|
||||
};
|
||||
}
|
17
企业级管理系统/web/项目源码/src/hook/permissionHook.js
Normal file
17
企业级管理系统/web/项目源码/src/hook/permissionHook.js
Normal file
@@ -0,0 +1,17 @@
|
||||
// api
|
||||
import { GetPermission } from "@a/account";
|
||||
// store
|
||||
import { useStore } from "vuex";
|
||||
/** 自定义hook */
|
||||
export function permissionHook(){
|
||||
|
||||
console.log(store)
|
||||
/** 获取分类 */
|
||||
const getPermission = () => {
|
||||
|
||||
GetPermission().then(response => {
|
||||
store.dispatch("permission/getPermissionAction")
|
||||
})
|
||||
};
|
||||
return { getPermission }
|
||||
}
|
Reference in New Issue
Block a user