|
@@ -8,14 +8,15 @@
|
|
|
<el-color-picker v-model="mouseToolState.color" popper-class="custom-color-picker" show-alpha size="large" />
|
|
|
<el-button size="large" @click="changeDrawing">{{ drawing ? '关闭' : '开启' }}</el-button>
|
|
|
<div class="flex">
|
|
|
- <div class="draw-item" @click="handleUndo">撤销</div>
|
|
|
+ <div class="draw-item" @click="handleUndo">撤回</div>
|
|
|
+ <div class="draw-item" @click="handleShowDialog">保存</div>
|
|
|
</div>
|
|
|
<div class="tabs1">
|
|
|
<div v-for="(item, index) in menu" :key="index" :class="menuActive1 === index ? 'tab tab_active' : 'tab'" @click="clickTab(index)">
|
|
|
{{ item.name }}
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-show="menuActive1 === 0" class="tab-content">
|
|
|
+ <div v-if="menuActive1 === 0" class="tab-content">
|
|
|
<div class="tabs2">
|
|
|
<div
|
|
|
v-for="(item, index) in menu[menuActive1].children"
|
|
@@ -37,7 +38,30 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-show="menuActive1 === 1" class="tab-content">历史预案</div>
|
|
|
+ <div v-else-if="menuActive1 === 1" class="tab-content3">
|
|
|
+ <div>
|
|
|
+ <div>合并</div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-input v-model="queryParams.pattern_name" placeholder="请输入标题关键字" size="large" @keydown.enter="handleQuery" />
|
|
|
+ </div>
|
|
|
+ <div class="custom-table">
|
|
|
+ <div class="tr">
|
|
|
+ <div class="th">预案名称</div>
|
|
|
+ <div class="th">操作</div>
|
|
|
+ </div>
|
|
|
+ <div v-for="(item, index) in patternList" :key="index" class="tr">
|
|
|
+ <div class="td">
|
|
|
+ <div>{{ item.pattern_name }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="td td2">
|
|
|
+ <el-icon class="icon" @click="handleDelete(item.id)"><Delete /></el-icon>
|
|
|
+ <el-icon class="icon" @click="handleEdit(item.id)"><EditPen /></el-icon>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--添加文字-->
|
|
|
<div v-show="textEditState.showTextEdit" class="text-edit-container">
|
|
|
<el-input v-model="textEditState.text" :rows="8" type="textarea" />
|
|
|
<div class="edit-box">
|
|
@@ -57,13 +81,23 @@
|
|
|
</div>
|
|
|
<!--绘制提示信息-->
|
|
|
<div v-show="tipTitle !== ''" class="tipTitle">{{ tipTitle }}</div>
|
|
|
+
|
|
|
+ <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>
|
|
|
+ <el-button @click="cancel">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </Dialog>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { nanoid } from 'nanoid';
|
|
|
import { deepClone } from '@/utils';
|
|
|
import { useHistory } from '@/hooks/useHistory';
|
|
|
+import { deletePatternById, getPatternInfo, getPatternList, updatePatternInfo } from '@/api/globalMap/onlinePlotting';
|
|
|
|
|
|
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const getDrawTool = inject('getDrawTool');
|
|
|
const getMap = inject('getMap');
|
|
|
const { currentState, commit, undo, history, future } = useHistory();
|
|
@@ -193,7 +227,6 @@ const clickTab = (value: number) => {
|
|
|
const clickTab2 = (value: number) => {
|
|
|
menuActive2.value = value;
|
|
|
};
|
|
|
-let drawOptions = {};
|
|
|
// 点击三级菜单
|
|
|
const clickTab3 = (item, index) => {
|
|
|
const type = item.value;
|
|
@@ -433,6 +466,72 @@ const removeOverlayByIndex = (index: number) => {
|
|
|
overlays.splice(index, 1);
|
|
|
overlaysData.splice(index, 1);
|
|
|
};
|
|
|
+
|
|
|
+// 历史预案
|
|
|
+const queryParams = reactive({
|
|
|
+ page: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ pattern_name: ''
|
|
|
+});
|
|
|
+const patternList = ref([]);
|
|
|
+let total = ref(0);
|
|
|
+let editData = ref({
|
|
|
+ id: '',
|
|
|
+ pattern_name: ''
|
|
|
+});
|
|
|
+let showEdit = ref(false);
|
|
|
+let buttonLoading = ref(false);
|
|
|
+const handleQuery = () => {
|
|
|
+ queryParams.page = 1;
|
|
|
+ getList();
|
|
|
+};
|
|
|
+const getList = () => {
|
|
|
+ // if (menuActive1.value === 1 && menu.value[menuActive1.value].name == '历史预案') {
|
|
|
+ getPatternList(queryParams).then((res) => {
|
|
|
+ patternList.value = res.data;
|
|
|
+ total.value = res.total;
|
|
|
+ });
|
|
|
+ // }
|
|
|
+};
|
|
|
+const handleDelete = (id: number) => {
|
|
|
+ proxy?.$modal.confirm('是否确认删除选择的数据项?').then(() => {
|
|
|
+ deletePatternById(id).then(() => {
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+const handleEdit = (id) => {
|
|
|
+ getPatternInfo(id).then((res) => {
|
|
|
+ editData.value = res.data;
|
|
|
+ editData.value.id = id;
|
|
|
+ });
|
|
|
+ showEdit.value = true;
|
|
|
+};
|
|
|
+const submitForm = () => {
|
|
|
+ buttonLoading.value = true;
|
|
|
+ updatePatternInfo(editData.value.id, editData.value)
|
|
|
+ .then((res) => {
|
|
|
+ proxy.$modal.msgSuccess('更新成功');
|
|
|
+ showEdit.value = false;
|
|
|
+ getList();
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ buttonLoading.value = false;
|
|
|
+ editData.value = {
|
|
|
+ id: '',
|
|
|
+ pattern_name: ''
|
|
|
+ };
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const cancel = () => {
|
|
|
+ buttonLoading.value = false;
|
|
|
+ showEdit.value = false;
|
|
|
+};
|
|
|
+const handleShowDialog = () => {};
|
|
|
+onMounted(() => {
|
|
|
+ getList();
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -518,4 +617,48 @@ const removeOverlayByIndex = (index: number) => {
|
|
|
background-color: rgba(0, 0, 0, 0.4);
|
|
|
border-radius: 10px;
|
|
|
}
|
|
|
+.tab-content3 {
|
|
|
+ .custom-table {
|
|
|
+ width: 100%;
|
|
|
+ .tr {
|
|
|
+ display: flex;
|
|
|
+ font-size: 32px;
|
|
|
+ .th {
|
|
|
+ background-color: #edf2fb;
|
|
|
+ padding: 9px 20px;
|
|
|
+ flex: 1;
|
|
|
+ border-left: 1px solid #dce0e7;
|
|
|
+ border-top: 1px solid #dce0e7;
|
|
|
+ border-bottom: 1px solid #dce0e7;
|
|
|
+ &:last-child {
|
|
|
+ flex: unset;
|
|
|
+ width: 150px;
|
|
|
+ border-right: 1px solid #dce0e7;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .td {
|
|
|
+ background-color: #ffffff;
|
|
|
+ padding: 9px 20px;
|
|
|
+ flex: 1;
|
|
|
+ border-left: 1px solid #dce0e7;
|
|
|
+ border-top: 1px solid #dce0e7;
|
|
|
+ border-bottom: 1px solid #dce0e7;
|
|
|
+ &:last-child {
|
|
|
+ flex: unset;
|
|
|
+ width: 150px;
|
|
|
+ border-right: 1px solid #dce0e7;
|
|
|
+ }
|
|
|
+ .icon {
|
|
|
+ margin: 0 10px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.footer {
|
|
|
+ margin-top: 20px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+}
|
|
|
</style>
|