update:参数库审核
This commit is contained in:
115
src/components/common/approveDel/index.vue
Normal file
115
src/components/common/approveDel/index.vue
Normal file
@@ -0,0 +1,115 @@
|
||||
<template>
|
||||
<Dialog
|
||||
v-model="visible"
|
||||
diaTitle="选择删除审核流程"
|
||||
:width="400"
|
||||
@close="closeFun"
|
||||
>
|
||||
<div class="content">
|
||||
<div class="tip">
|
||||
<el-icon class="icon" :size="16">
|
||||
<Warning />
|
||||
</el-icon>
|
||||
<span>数据将在审核通过后自动删除</span>
|
||||
</div>
|
||||
<div class="form">
|
||||
<TableForm
|
||||
ref="TableFormRef"
|
||||
:data="formData"
|
||||
tableName="APPROVE_DEL_FORM"
|
||||
@change="changeFun"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div>
|
||||
<el-button @click="closeFun">{{ $t('通用.取消') }}</el-button>
|
||||
<el-button type="primary" @click="submitFun">{{ $t('通用.确定') }}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import { Warning } from '@element-plus/icons-vue';
|
||||
import Dialog from '@/components/common/dialog/index.vue';
|
||||
import TableForm from '@/components/common/table/tableForm.vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean;
|
||||
api: any;
|
||||
params?: any;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
modelValue: false,
|
||||
api: null,
|
||||
params: {},
|
||||
});
|
||||
|
||||
watch(() => props.modelValue, (val: boolean) => {
|
||||
visible.value = val;
|
||||
if (!val) {
|
||||
if (TableFormRef.value) {
|
||||
TableFormRef.value.resetFun();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'confirm']);
|
||||
const TableFormRef = ref<any>();
|
||||
const formData = ref<any>({});
|
||||
const visible = ref(false);
|
||||
|
||||
const changeFun = (data: any) => {
|
||||
const { key, val } = data;
|
||||
if (key === 'templateId') {
|
||||
formData.value.templateName = val.label;
|
||||
}
|
||||
};
|
||||
|
||||
const submitFun = async() => {
|
||||
const valid = await TableFormRef.value.validateFun();
|
||||
if (valid) {
|
||||
if (props.api) {
|
||||
const params = {
|
||||
...props.params,
|
||||
...formData.value,
|
||||
};
|
||||
props.api(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('操作成功');
|
||||
closeFun();
|
||||
emit('confirm');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const closeFun = () => {
|
||||
emit('update:modelValue', false);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
.tip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-bottom: 10px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
color: var(--el-text-color-secondary);
|
||||
.icon {
|
||||
color: var(--el-color-danger);
|
||||
cursor: pointer;
|
||||
}
|
||||
span {
|
||||
padding-left: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -238,8 +238,8 @@ const stopDragFun = () => {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
right: 20px;
|
||||
bottom: 20px;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background-color: var(--el-color-primary);
|
||||
|
||||
@@ -12,7 +12,7 @@ const lang = {
|
||||
'返回上一级': '返回上一级',
|
||||
'预览': '预览',
|
||||
'下载': '下载',
|
||||
'审核模版': '审核模板',
|
||||
'审核模版': '审核模版',
|
||||
'请选择审核模版': '请选择审核模版',
|
||||
'确认删除吗': '确认删除吗?',
|
||||
'上一步': '上一步',
|
||||
|
||||
@@ -37,7 +37,7 @@ watchEffect(() => {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.header {
|
||||
margin-bottom: 24px;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
}
|
||||
.label {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<template>
|
||||
<approvalTypeHeader :data="data" />
|
||||
<div class="content">
|
||||
<div class="table">
|
||||
<BaseTable ref="baseTableRef" tableName="PARAMETER_LIST" hidePagination />
|
||||
@@ -17,6 +18,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import BaseTable from '@/components/common/table/baseTable.vue';
|
||||
import ApprovalTypeHeader from './approvalTypeHeader.vue';
|
||||
|
||||
interface Props {
|
||||
data: any;
|
||||
|
||||
@@ -76,6 +76,11 @@
|
||||
:lib-type-info="currentNode"
|
||||
@createFun="creatLibParamObjFun"
|
||||
/>
|
||||
<ApproveDel
|
||||
v-model="approveDelShow"
|
||||
:api="deleteSimulationParameterApi"
|
||||
:params="delParams"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -89,6 +94,7 @@ import addParamType from './components/addParamType.vue';
|
||||
import addParamObject from './components/addParamObject.vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import UploadFile from '@/components/common/uploadFile/index.vue';
|
||||
import ApproveDel from '@/components/common/approveDel/index.vue';
|
||||
|
||||
const currentNodeKey = ref<any>('');
|
||||
const currentNode = ref<any>({});
|
||||
@@ -99,6 +105,8 @@ const showTree = ref(true);
|
||||
const libTreeRef = ref();
|
||||
const paramTableRef = ref();
|
||||
const infoShow = ref(false);
|
||||
const approveDelShow = ref(false);
|
||||
const delParams = ref<any>({});
|
||||
|
||||
const props = {
|
||||
label: 'label',
|
||||
@@ -240,6 +248,14 @@ const creatLibParamObjFun = async(data: any) => {
|
||||
};
|
||||
|
||||
const deleteParamFun = (flag:any) => {
|
||||
if (flag === 'param') {
|
||||
delParams.value = {
|
||||
type: currentNode.value.type,
|
||||
id: currentNode.value.id,
|
||||
};
|
||||
approveDelShow.value = true;
|
||||
return;
|
||||
}
|
||||
ElMessageBox.confirm(
|
||||
`确认要删除这个${flag === 'lib' ? '参数库' : flag === 'type' ? '参数库分类' : '参数对象'}吗?`,
|
||||
'警告',
|
||||
|
||||
Reference in New Issue
Block a user