|
@@ -106,21 +106,17 @@
|
|
|
<TextEdit v-model="showTextEdit" @addText="addText" />
|
|
|
<!--绘制提示信息-->
|
|
|
<div v-show="tipTitle !== ''" class="tipTitle">{{ tipTitle }}</div>
|
|
|
- <Dialog v-model="showEdit" title="预案管理" width="450px" height="200px" style="position: absolute; top: 1280px">
|
|
|
- <el-input v-model="editData.pattern_name" />
|
|
|
- <div class="footer">
|
|
|
- <el-button :loading="buttonLoading" type="primary" @click="submitForm">确定</el-button>
|
|
|
- <el-button @click="cancel">取消</el-button>
|
|
|
- </div>
|
|
|
- </Dialog>
|
|
|
+ <!--保存修改弹窗-->
|
|
|
+ <EditDialog v-if="showEdit" v-model="showEdit" :editData="editData" @submit="handleSubmit" />
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup name="OnlinePlotting">
|
|
|
import { nanoid } from 'nanoid';
|
|
|
import { deepClone } from '@/utils';
|
|
|
import { useHistory } from '@/hooks/useHistory';
|
|
|
-import { createPattern, deletePatternById, getPatternInfo, getPatternList, updatePatternInfo } from '@/api/globalMap/onlinePlotting';
|
|
|
+import { deletePatternById, getPatternInfo, getPatternList } from '@/api/globalMap/onlinePlotting';
|
|
|
import TextEdit from '@/views/globalMap/RightMenu/OnlinePlotting/TextEdit.vue';
|
|
|
+import EditDialog from '@/views/globalMap/RightMenu/OnlinePlotting/EditDialog.vue';
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const getDrawTool = inject('getDrawTool');
|
|
@@ -508,7 +504,15 @@ let editData = ref({
|
|
|
content: {}
|
|
|
});
|
|
|
let showEdit = ref(false);
|
|
|
-let buttonLoading = ref(false);
|
|
|
+const handleSubmit = () => {
|
|
|
+ showEdit.value = false;
|
|
|
+ editData.value = {
|
|
|
+ id: '',
|
|
|
+ pattern_name: '',
|
|
|
+ content: {}
|
|
|
+ };
|
|
|
+ getList();
|
|
|
+}
|
|
|
const handleQuery = () => {
|
|
|
queryParams.page = 1;
|
|
|
getList();
|
|
@@ -535,30 +539,6 @@ const handleEdit = (id) => {
|
|
|
});
|
|
|
showEdit.value = true;
|
|
|
};
|
|
|
-const submitForm = () => {
|
|
|
- buttonLoading.value = true;
|
|
|
- const flag = !!editData.value.id;
|
|
|
- const method = flag ? updatePatternInfo : createPattern;
|
|
|
- method(editData.value)
|
|
|
- .then(() => {
|
|
|
- proxy.$modal.msgSuccess(flag ? '更新成功' : '保存成功');
|
|
|
- showEdit.value = false;
|
|
|
- editData.value = {
|
|
|
- id: '',
|
|
|
- pattern_name: '',
|
|
|
- content: {}
|
|
|
- };
|
|
|
- getList();
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- buttonLoading.value = false;
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
-const cancel = () => {
|
|
|
- buttonLoading.value = false;
|
|
|
- showEdit.value = false;
|
|
|
-};
|
|
|
const handleShowDialog = () => {
|
|
|
editData.value = {
|
|
|
id: '',
|
|
@@ -842,11 +822,7 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-.footer {
|
|
|
- margin-top: 20px;
|
|
|
- display: flex;
|
|
|
- justify-content: flex-end;
|
|
|
-}
|
|
|
+
|
|
|
.color-container {
|
|
|
width: 80px;
|
|
|
height: 50px;
|
|
@@ -879,4 +855,5 @@ onMounted(() => {
|
|
|
background: url('@/assets/images/inputIcon2.png') no-repeat;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
</style>
|