feat: 统一新增和编辑的回调
parent
8f083493e3
commit
cfa759eea1
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
@ -1,3 +1,10 @@
|
||||
import isDelete from "./src/isDelete";
|
||||
|
||||
export const IsDelete = isDelete;
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-08-14 17:19:37
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-08-20 15:32:48
|
||||
* @FilePath: \General-AI-Platform-Web-Client\src\components\Action\index.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
import isAction from "./src/isAction";
|
||||
export const IsAction = isAction;
|
||||
|
@ -0,0 +1,16 @@
|
||||
.action_model_wrap {
|
||||
.el-dialog__header {
|
||||
display: none;
|
||||
}
|
||||
.el-dialog__body {
|
||||
padding: 40px 24px 14px;
|
||||
}
|
||||
.model_content_box {
|
||||
.icon_box {
|
||||
img {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-08-20 15:31:30
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-08-20 16:00:47
|
||||
* @FilePath: \General-AI-Platform-Web-Client\src\components\TableActionCard\isAction.tsx
|
||||
* @Description: 是否操作行为
|
||||
*/
|
||||
import { defineComponent, PropType } from "vue";
|
||||
import { ElDialog, ElButton } from "element-plus";
|
||||
import warnIcon from "@/assets/modelSetting/warn_icon.png";
|
||||
import "./isAction.scss";
|
||||
// TODO 完善操作交互
|
||||
export default defineComponent({
|
||||
name: "IsDelete",
|
||||
props: {
|
||||
title: {
|
||||
type: String as PropType<string>,
|
||||
default: "提示"
|
||||
},
|
||||
message: {
|
||||
type: String as PropType<string>,
|
||||
default: "确定要操作吗?"
|
||||
},
|
||||
visible: {
|
||||
type: Boolean as PropType<boolean>,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
emits: ["update:visible", "confirm"],
|
||||
setup(props, { emit }) {
|
||||
// const visible = ref(props.visible);
|
||||
|
||||
const handleConfirm = () => {
|
||||
emit("confirm");
|
||||
// visible.value = false;
|
||||
// emit("update:visible", false);
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
// visible.value = false;
|
||||
emit("update:visible", false);
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
// visible.value = false;
|
||||
emit("update:visible", false);
|
||||
// done();
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
val => {
|
||||
visible.value = val;
|
||||
}
|
||||
);
|
||||
|
||||
return () => (
|
||||
<ElDialog
|
||||
className="action_model_wrap el-dialog"
|
||||
visible={props.visible}
|
||||
width="560px"
|
||||
before-close={handleClose}
|
||||
show-close={false}
|
||||
v-slots={{
|
||||
footer: () => (
|
||||
<>
|
||||
<ElButton onClick={handleCancel}>取消</ElButton>
|
||||
<ElButton type="primary" onClick={handleConfirm}>
|
||||
确认
|
||||
</ElButton>
|
||||
</>
|
||||
)
|
||||
}}
|
||||
>
|
||||
<div className="model_content_box">
|
||||
<div className="flex items-center pr-[12px] icon_box">
|
||||
<img src={warnIcon} />
|
||||
<span className="hf-1 pl-[12px]">{props.title}</span>
|
||||
</div>
|
||||
<div className="pl-[36px] pt-[14px]">
|
||||
<span className="pf-1">{props.message}</span>
|
||||
</div>
|
||||
</div>
|
||||
</ElDialog>
|
||||
);
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue