|
@@ -84,8 +84,7 @@
|
|
|
<div v-show="tipTitle !== ''" class="tipTitle">{{ tipTitle }}</div>
|
|
|
</div>
|
|
|
|
|
|
-
|
|
|
- <Dialog v-model="showEdit" title="编辑" width="450px" height="200px" style="position: fixed; top: 1280px">
|
|
|
+ <Dialog v-model="showEdit" title="预案管理" width="450px" height="200px" style="position: fixed; top: 1280px">
|
|
|
<el-input v-model="editData.pattern_name" />
|
|
|
<div class="footer">
|
|
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确定</el-button>
|
|
@@ -98,7 +97,13 @@
|
|
|
import { nanoid } from 'nanoid';
|
|
|
import { deepClone } from '@/utils';
|
|
|
import { useHistory } from '@/hooks/useHistory';
|
|
|
-import { deletePatternById, getPatternInfo, getPatternList, updatePatternInfo } from '@/api/globalMap/onlinePlotting';
|
|
|
+import {
|
|
|
+ createPattern,
|
|
|
+ deletePatternById,
|
|
|
+ getPatternInfo,
|
|
|
+ getPatternList,
|
|
|
+ updatePatternInfo
|
|
|
+} from '@/api/globalMap/onlinePlotting';
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const getDrawTool = inject('getDrawTool');
|
|
@@ -480,7 +485,8 @@ const patternList = ref([]);
|
|
|
let total = ref(0);
|
|
|
let editData = ref({
|
|
|
id: '',
|
|
|
- pattern_name: ''
|
|
|
+ pattern_name: '',
|
|
|
+ content: {}
|
|
|
});
|
|
|
let showEdit = ref(false);
|
|
|
let buttonLoading = ref(false);
|
|
@@ -512,18 +518,22 @@ const handleEdit = (id) => {
|
|
|
};
|
|
|
const submitForm = () => {
|
|
|
buttonLoading.value = true;
|
|
|
- updatePatternInfo(editData.value.id, editData.value)
|
|
|
- .then((res) => {
|
|
|
- proxy.$modal.msgSuccess('更新成功');
|
|
|
+ const flag = !!editData.value.id;
|
|
|
+ const method = flag ? updatePatternInfo : createPattern;
|
|
|
+ debugger
|
|
|
+ method(editData.value)
|
|
|
+ .then(() => {
|
|
|
+ proxy.$modal.msgSuccess(flag ? '更新成功' : '保存成功');
|
|
|
showEdit.value = false;
|
|
|
+ editData.value = {
|
|
|
+ id: '',
|
|
|
+ pattern_name: '',
|
|
|
+ content: {}
|
|
|
+ };
|
|
|
getList();
|
|
|
})
|
|
|
.finally(() => {
|
|
|
buttonLoading.value = false;
|
|
|
- editData.value = {
|
|
|
- id: '',
|
|
|
- pattern_name: ''
|
|
|
- };
|
|
|
});
|
|
|
};
|
|
|
|
|
@@ -531,7 +541,14 @@ const cancel = () => {
|
|
|
buttonLoading.value = false;
|
|
|
showEdit.value = false;
|
|
|
};
|
|
|
-const handleShowDialog = () => {};
|
|
|
+const handleShowDialog = () => {
|
|
|
+ editData.value = {
|
|
|
+ id: '',
|
|
|
+ pattern_name: '',
|
|
|
+ content: currentState.value
|
|
|
+ };
|
|
|
+ showEdit.value = true;
|
|
|
+};
|
|
|
onMounted(() => {
|
|
|
getList();
|
|
|
});
|
|
@@ -632,6 +649,7 @@ onMounted(() => {
|
|
|
.tab-content3 {
|
|
|
.custom-table {
|
|
|
width: 100%;
|
|
|
+ color: #000;
|
|
|
.tr {
|
|
|
display: flex;
|
|
|
font-size: 32px;
|