|
@@ -13,7 +13,8 @@ import manyFormula from "@/components/formula/manyFormula.vue";
|
|
const emit = defineEmits(["updateDialog"]);
|
|
const emit = defineEmits(["updateDialog"]);
|
|
const formRef = ref();
|
|
const formRef = ref();
|
|
const drawer = ref(false);
|
|
const drawer = ref(false);
|
|
-const disabledShow = ref<any>(true);
|
|
|
|
|
|
+// 延迟组件传递数据
|
|
|
|
+const showData = ref(false);
|
|
const direction = ref<DrawerProps["direction"]>("rtl");
|
|
const direction = ref<DrawerProps["direction"]>("rtl");
|
|
// 表单
|
|
// 表单
|
|
const formulaOne = ref();
|
|
const formulaOne = ref();
|
|
@@ -39,16 +40,11 @@ const formLabelAlign = reactive({
|
|
});
|
|
});
|
|
// 抽屉逻辑
|
|
// 抽屉逻辑
|
|
const open = row => {
|
|
const open = row => {
|
|
- console.log("编辑", row);
|
|
|
|
- Object.assign(formLabelAlign, row);
|
|
|
|
- // console.log(1111, JSON.parse(formLabelAlign.formula));
|
|
|
|
|
|
+ Object.assign(formLabelAlign, JSON.parse(JSON.stringify(row)));
|
|
let dataJSon = JSON.parse(row.formula);
|
|
let dataJSon = JSON.parse(row.formula);
|
|
formulaOne.value = dataJSon.noConditionFormula;
|
|
formulaOne.value = dataJSon.noConditionFormula;
|
|
- // if (formLabelAlign.formulaType == 0) {
|
|
|
|
- // } else {
|
|
|
|
- // formula
|
|
|
|
- // }
|
|
|
|
drawer.value = true;
|
|
drawer.value = true;
|
|
|
|
+ showData.value = true;
|
|
};
|
|
};
|
|
// 公式
|
|
// 公式
|
|
const countNoConditionFormulaClick = (data: any) => {
|
|
const countNoConditionFormulaClick = (data: any) => {
|
|
@@ -57,28 +53,9 @@ const countNoConditionFormulaClick = (data: any) => {
|
|
defineExpose({
|
|
defineExpose({
|
|
open
|
|
open
|
|
});
|
|
});
|
|
-const handleClose = (done: () => void) => {
|
|
|
|
- if (disabledShow.value) {
|
|
|
|
- disabledShow.value = true;
|
|
|
|
- drawer.value = false;
|
|
|
|
- } else {
|
|
|
|
- ElMessageBox.confirm("配置项未保存,确认关闭", {
|
|
|
|
- type: "warning"
|
|
|
|
- }).then(() => {
|
|
|
|
- formRef.value.clearValidate(); // 清除验证错误
|
|
|
|
- formRef.value.resetFields(); // 重置表单字段
|
|
|
|
- disabledShow.value = true;
|
|
|
|
- drawer.value = false;
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
-const cancelClick = () => {
|
|
|
|
- formRef.value.validate(valid => {
|
|
|
|
- if (valid) {
|
|
|
|
- disabledShow.value = true;
|
|
|
|
- drawer.value = true;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+const handleClose = () => {
|
|
|
|
+ showData.value = false;
|
|
|
|
+ drawer.value = false;
|
|
};
|
|
};
|
|
// 公式验证
|
|
// 公式验证
|
|
const dialogFormVisibleFormula = ref(false);
|
|
const dialogFormVisibleFormula = ref(false);
|
|
@@ -312,6 +289,7 @@ const postUpdateApi = async () => {
|
|
<div class="w-full flex item-center">
|
|
<div class="w-full flex item-center">
|
|
<div class="mr-4"><el-text>得分 =</el-text></div>
|
|
<div class="mr-4"><el-text>得分 =</el-text></div>
|
|
<jishuanqi
|
|
<jishuanqi
|
|
|
|
+ v-if="showData"
|
|
:outerConditionValue="formulaOne"
|
|
:outerConditionValue="formulaOne"
|
|
@handClick="countNoConditionFormulaClick"
|
|
@handClick="countNoConditionFormulaClick"
|
|
/>
|
|
/>
|
|
@@ -333,6 +311,7 @@ const postUpdateApi = async () => {
|
|
>
|
|
>
|
|
<div class="w-full flex item-center">
|
|
<div class="w-full flex item-center">
|
|
<manyFormula
|
|
<manyFormula
|
|
|
|
+ v-if="showData"
|
|
:formulaJSON="formulaOne"
|
|
:formulaJSON="formulaOne"
|
|
@handUpdataClick="countNoConditionFormulaClick"
|
|
@handUpdataClick="countNoConditionFormulaClick"
|
|
/>
|
|
/>
|
|
@@ -343,7 +322,7 @@ const postUpdateApi = async () => {
|
|
</template>
|
|
</template>
|
|
<template #footer>
|
|
<template #footer>
|
|
<div>
|
|
<div>
|
|
- <el-button @click="cancelClick">取消</el-button>
|
|
|
|
|
|
+ <el-button @click="handleClose">取消</el-button>
|
|
<el-button type="primary" @click="confirmClick">确认</el-button>
|
|
<el-button type="primary" @click="confirmClick">确认</el-button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|