瀏覽代碼

api重构

zhuangyunsheng 2 月之前
父節點
當前提交
a820264588
共有 33 個文件被更改,包括 184 次插入275 次删除
  1. 45 0
      src/api/model/milestone.js
  2. 76 0
      src/api/model/project.js
  3. 0 113
      src/api/model/system.js
  4. 4 4
      src/config/route.js
  5. 1 1
      src/router/index.js
  6. 1 1
      src/views/dataMock/aihazard/detail.vue
  7. 1 1
      src/views/dataMock/broadcast/detail.vue
  8. 1 1
      src/views/dataMock/carwash/detail.vue
  9. 1 1
      src/views/dataMock/edgeprot/detail.vue
  10. 1 1
      src/views/dataMock/elevator/detail.vue
  11. 1 1
      src/views/dataMock/env/detail.vue
  12. 1 1
      src/views/dataMock/parking/detail.vue
  13. 1 1
      src/views/dataMock/perimeter/detail.vue
  14. 1 1
      src/views/dataMock/smoke/detail.vue
  15. 1 1
      src/views/dataMock/spray/detail.vue
  16. 1 1
      src/views/dataMock/standard/detail.vue
  17. 1 1
      src/views/dataMock/tower/detail.vue
  18. 1 1
      src/views/dataMock/warehouse/detail.vue
  19. 1 1
      src/views/home/index.vue
  20. 2 2
      src/views/milestone/matters/components/record/detail.vue
  21. 10 21
      src/views/milestone/matters/components/record/index.vue
  22. 2 2
      src/views/milestone/matters/detail.vue
  23. 3 3
      src/views/milestone/matters/index.vue
  24. 3 3
      src/views/milestone/plan/components/record/detail.vue
  25. 2 2
      src/views/milestone/plan/components/record/index.vue
  26. 0 77
      src/views/milestone/plan/detail.vue
  27. 1 18
      src/views/milestone/plan/index.vue
  28. 1 1
      src/views/project/acceptItems/detail.vue
  29. 2 2
      src/views/project/acceptItems/index.vue
  30. 12 6
      src/views/project/maintenance/detail.vue
  31. 3 3
      src/views/project/maintenance/index.vue
  32. 3 3
      src/views/project/maintenance/items.vue
  33. 0 0
      src/views/project/info/main.js

+ 45 - 0
src/api/model/milestone.js

@@ -0,0 +1,45 @@
+import config from "@/config"
+import http from "@/utils/request"
+
+export default {
+    plan: {
+		name: "获取里程碑节点",
+        url: `${config.API_URL}/ops/opsPlan`,
+        all: async function (data = {}) {
+			return await http.post(`${this.url}/getList`, data);
+		},
+
+        add: async function (data = {}) {
+			return await http.post(`${this.url}/save`, data);
+		},
+
+        edit: async function (data = {}) {
+			return await http.post(`${this.url}/update`, data);
+		},
+
+        del: async function (data = {}) {
+			return await http.post(`${this.url}/remove`, data);
+		}
+    },
+
+    matters: {
+        name: "节点事项",
+        url: `${config.API_URL}/ops/opsTodo`,
+        get: async function (data = {}) {
+			return await http.post(`${this.url}/getPage`, data);
+		},
+
+        all: async function (data = {}) {
+			return await http.post(`${this.url}/getList`, data);
+		},
+
+        edit: async function (data = {}) {
+			return await http.post(`${this.url}/update`, data);
+		},
+
+        // 一键复制
+        copyData: async function (data = {}) {
+			return await http.post(`${this.url}/copyData`, data);
+		}
+    }
+}

+ 76 - 0
src/api/model/project.js

@@ -0,0 +1,76 @@
+import config from "@/config"
+import http from "@/utils/request"
+
+export default {
+	info: {
+		name: "获取项目",
+		url: `${config.API_URL}/ops/projectInfo`,
+        dept: async function (data = {}) {
+			return await http.post(`${this.url}/getName`, data);
+		},
+
+        get: async function (data = {}) {
+			return await http.post(`${this.url}/getPage`, data);
+		},
+
+		all: async function (data = {}) {
+			return await http.post(`${this.url}/getList`, data);
+		},
+
+        detail: async function (data = {}) {
+			return await http.post(`${this.url}/getById`, data);
+		},
+
+        add: async function (data = {}) {
+			return await http.post(`${this.url}/save`, data);
+		},
+
+        edit: async function (data = {}) {
+			return await http.post(`${this.url}/update`, data);
+		},
+
+        del: async function (data = {}) {
+			return await http.post(`${this.url}/remove`, data);
+		},
+
+        bindItem: {
+            url: `${config.API_URL}/ops/acceptanceProject`,
+            name: "项目绑定应用项",
+            get: async function (data = {}) {
+                return await http.post(`${this.url}/getList`, data);
+            },
+
+            judgment: async function (data = {}) {
+                return await http.post(`${this.url}/getOne`, data);
+            },
+
+            add: async function (data = {}) {
+                return await http.post(`${this.url}/save`, data);
+            }
+        }
+	},
+
+    acceptItems: {
+		name: "获取应用项",
+		url: `${config.API_URL}/ops/acceptanceItems`,
+        get: async function (data = {}) {
+			return await http.post(`${this.url}/getPage`, data);
+		},
+
+        all: async function (data = {}) {
+			return await http.post(`${this.url}/getList`, data);
+		},
+
+        add: async function (data = {}) {
+			return await http.post(`${this.url}/save`, data);
+		},
+
+        edit: async function (data = {}) {
+			return await http.post(`${this.url}/update`, data);
+		},
+
+        del: async function (data = {}) {
+			return await http.post(`${this.url}/remove`, data);
+		}
+	}
+}

+ 0 - 113
src/api/model/system.js

@@ -2,119 +2,6 @@ import config from "@/config"
 import http from "@/utils/request"
 
 export default {
-	project: {
-		name: "获取项目",
-		url: `${config.API_URL}/ops/projectInfo`,
-        dept: async function (data = {}) {
-			return await http.post(`${this.url}/getName`, data);
-		},
-
-        get: async function (data = {}) {
-			return await http.post(`${this.url}/getPage`, data);
-		},
-
-		all: async function (data = {}) {
-			return await http.post(`${this.url}/getList`, data);
-		},
-
-        detail: async function (data = {}) {
-			return await http.post(`${this.url}/getById`, data);
-		},
-
-        add: async function (data = {}) {
-			return await http.post(`${this.url}/save`, data);
-		},
-
-        edit: async function (data = {}) {
-			return await http.post(`${this.url}/update`, data);
-		},
-
-        del: async function (data = {}) {
-			return await http.post(`${this.url}/remove`, data);
-		},
-
-        bindItem: {
-            url: `${config.API_URL}/ops/acceptanceProject`,
-            name: "项目绑定应用项",
-            get: async function (data = {}) {
-                return await http.post(`${this.url}/getList`, data);
-            },
-
-            judgment: async function (data = {}) {
-                return await http.post(`${this.url}/getOne`, data);
-            },
-
-            add: async function (data = {}) {
-                return await http.post(`${this.url}/save`, data);
-            }
-        }
-	},
-
-    acceptItems: {
-		name: "获取应用项",
-		url: `${config.API_URL}/ops/acceptanceItems`,
-        get: async function (data = {}) {
-			return await http.post(`${this.url}/getPage`, data);
-		},
-
-        all: async function (data = {}) {
-			return await http.post(`${this.url}/getList`, data);
-		},
-
-        add: async function (data = {}) {
-			return await http.post(`${this.url}/save`, data);
-		},
-
-        edit: async function (data = {}) {
-			return await http.post(`${this.url}/update`, data);
-		},
-
-        del: async function (data = {}) {
-			return await http.post(`${this.url}/remove`, data);
-		}
-	},
-
-    milestone: {
-		name: "获取里程碑",
-        url: `${config.API_URL}/ops/opsPlan`,
-        all: async function (data = {}) {
-			return await http.post(`${this.url}/getList`, data);
-		},
-
-        add: async function (data = {}) {
-			return await http.post(`${this.url}/save`, data);
-		},
-
-        edit: async function (data = {}) {
-			return await http.post(`${this.url}/update`, data);
-		},
-
-        del: async function (data = {}) {
-			return await http.post(`${this.url}/remove`, data);
-		}
-    },
-
-    todoTask: {
-        name: "待办任务",
-        url: `${config.API_URL}/ops/opsTodo`,
-        get: async function (data = {}) {
-			return await http.post(`${this.url}/getPage`, data);
-		},
-
-        all: async function (data = {}) {
-			return await http.post(`${this.url}/getList`, data);
-		},
-
-        edit: async function (data = {}) {
-			return await http.post(`${this.url}/update`, data);
-		},
-
-        // 一键复制
-        copyData: async function (data = {}) {
-			return await http.post(`${this.url}/copyData`, data);
-		}
-    },
-
     device: {
 		name: "设备查询",
 		url: `${config.API_URL}/api/deviceStock/getDevicePage`,

+ 4 - 4
src/config/route.js

@@ -21,13 +21,13 @@ const routes = [
         name: "project",
         path: "/project",
         meta: { title: "项目管理", icon: "ix:projects" },
-        redirect: "/project/maintenance",
+        redirect: "/project/info",
         children: [
             {
-                name: "projectMaintenance",
-                path: "/project/maintenance",
+                name: "projectInfo",
+                path: "/project/info",
                 meta: { title: "项目维护", icon: "ant-design:cloud-upload-outlined" },
-                component: "project/maintenance"
+                component: "project/info"
             },
             {
                 name: "acceptItems",

+ 1 - 1
src/router/index.js

@@ -122,7 +122,7 @@ function loadComponent(component) {
 }
 
 router.getProject = async fpiId => {
-    let projectRes = await api.system.project.all();
+    let projectRes = await api.project.info.all();
     tool.data.set("PROJECT", projectRes);
     (!tool.data.get("PROJECT_ID") || fpiId && fpiId == tool.data.get("PROJECT_ID")) && tool.data.set("PROJECT_ID", null);
 }

+ 1 - 1
src/views/dataMock/aihazard/detail.vue

@@ -177,7 +177,7 @@ const dataTimeRange = async () => {
         projectId: form.value.targetProjectId,
         itemName: XEUtils.last(route.meta.title.split("-"))
     }
-    const res = await API.system.project.bindItem.judgment(query);
+    const res = await API.project.info.bindItem.judgment(query);
     acceptItem.value = res || {};
 }
 

+ 1 - 1
src/views/dataMock/broadcast/detail.vue

@@ -101,7 +101,7 @@ const dataTimeRange = async () => {
         projectId: form.value.targetProjectId,
         itemName: XEUtils.last(route.meta.title.split("-"))
     }
-    const res = await API.system.project.bindItem.judgment(query);
+    const res = await API.project.info.bindItem.judgment(query);
     acceptItem.value = res || {};
 }
 

+ 1 - 1
src/views/dataMock/carwash/detail.vue

@@ -135,7 +135,7 @@ const dataTimeRange = async () => {
         projectId: form.value.targetProjectId,
         itemName: XEUtils.last(route.meta.title.split("-"))
     }
-    const res = await API.system.project.bindItem.judgment(query);
+    const res = await API.project.info.bindItem.judgment(query);
     acceptItem.value = res || {};
 }
 

+ 1 - 1
src/views/dataMock/edgeprot/detail.vue

@@ -118,7 +118,7 @@ const dataTimeRange = async () => {
         projectId: form.value.targetProjectId,
         itemName: XEUtils.last(route.meta.title.split("-"))
     }
-    const res = await API.system.project.bindItem.judgment(query);
+    const res = await API.project.info.bindItem.judgment(query);
     acceptItem.value = res || {};
 }
 

+ 1 - 1
src/views/dataMock/elevator/detail.vue

@@ -209,7 +209,7 @@ const dataTimeRange = async () => {
         projectId: form.value.targetProjectId,
         itemName: XEUtils.last(route.meta.title.split("-"))
     }
-    const res = await API.system.project.bindItem.judgment(query);
+    const res = await API.project.info.bindItem.judgment(query);
     acceptItem.value = res || {};
 }
 

+ 1 - 1
src/views/dataMock/env/detail.vue

@@ -178,7 +178,7 @@ const dataTimeRange = async () => {
         projectId: form.value.targetProjectId,
         itemName: XEUtils.last(route.meta.title.split("-"))
     }
-    const res = await API.system.project.bindItem.judgment(query);
+    const res = await API.project.info.bindItem.judgment(query);
     acceptItem.value = res || {};
 }
 

+ 1 - 1
src/views/dataMock/parking/detail.vue

@@ -158,7 +158,7 @@ const dataTimeRange = async () => {
         projectId: form.value.targetProjectId,
         itemName: XEUtils.last(route.meta.title.split("-"))
     }
-    const res = await API.system.project.bindItem.judgment(query);
+    const res = await API.project.info.bindItem.judgment(query);
     acceptItem.value = res || {};
 }
 

+ 1 - 1
src/views/dataMock/perimeter/detail.vue

@@ -169,7 +169,7 @@ const dataTimeRange = async () => {
         projectId: form.value.targetProjectId,
         itemName: XEUtils.last(route.meta.title.split("-"))
     }
-    const res = await API.system.project.bindItem.judgment(query);
+    const res = await API.project.info.bindItem.judgment(query);
     acceptItem.value = res || {};
 }
 

+ 1 - 1
src/views/dataMock/smoke/detail.vue

@@ -99,7 +99,7 @@ const dataTimeRange = async () => {
         projectId: form.value.targetProjectId,
         itemName: XEUtils.last(route.meta.title.split("-"))
     }
-    const res = await API.system.project.bindItem.judgment(query);
+    const res = await API.project.info.bindItem.judgment(query);
     acceptItem.value = res || {};
 }
 

+ 1 - 1
src/views/dataMock/spray/detail.vue

@@ -85,7 +85,7 @@ const dataTimeRange = async () => {
         projectId: form.value.targetProjectId,
         itemName: XEUtils.last(route.meta.title.split("-"))
     }
-    const res = await API.system.project.bindItem.judgment(query);
+    const res = await API.project.info.bindItem.judgment(query);
     acceptItem.value = res || {};
 }
 

+ 1 - 1
src/views/dataMock/standard/detail.vue

@@ -137,7 +137,7 @@ const dataTimeRange = async () => {
         projectId: form.value.targetProjectId,
         itemName: XEUtils.last(route.meta.title.split("-"))
     }
-    const res = await API.system.project.bindItem.judgment(query);
+    const res = await API.project.info.bindItem.judgment(query);
     acceptItem.value = res || {};
 }
 

+ 1 - 1
src/views/dataMock/tower/detail.vue

@@ -209,7 +209,7 @@ const dataTimeRange = async () => {
         projectId: form.value.targetProjectId,
         itemName: XEUtils.last(route.meta.title.split("-"))
     }
-    const res = await API.system.project.bindItem.judgment(query);
+    const res = await API.project.info.bindItem.judgment(query);
     acceptItem.value = res || {};
 }
 

+ 1 - 1
src/views/dataMock/warehouse/detail.vue

@@ -99,7 +99,7 @@ const dataTimeRange = async () => {
         projectId: form.value.targetProjectId,
         itemName: XEUtils.last(route.meta.title.split("-"))
     }
-    const res = await API.system.project.bindItem.judgment(query);
+    const res = await API.project.info.bindItem.judgment(query);
     acceptItem.value = res || {};
 }
 

+ 1 - 1
src/views/home/index.vue

@@ -119,7 +119,7 @@ const projectChange = projectId => {
 const getItems = projectId => {
     // 先查询当前项目的应用项
     loading.value = true;
-    API.system.project.bindItem.get({ projectId }).then(res => {
+    API.project.info.bindItem.get({ projectId }).then(res => {
         loading.value = false;
         const sortArr = XEUtils.orderBy(XEUtils.get(res, "data", []), [["item.itemCategory", "asc"], ["item.createTime", "asc"]]);
         acceptItem.value = XEUtils.map(sortArr, item => ({ ...item, name: XEUtils.get(item, "item.acceptItem", "") }));

+ 2 - 2
src/views/milestone/matters/components/record/detail.vue

@@ -39,7 +39,7 @@ const treeSelectProps = reactive({
 })
 
 const getTreeData = async projectId => {
-    const planRes = await API.system.milestone.all({ projectId });
+    const planRes = await API.milestone.plan.all({ projectId });
     treeSelectProps.data = XEUtils.toArrayTree(planRes, { parentKey: "parentId", key: "id", sortKey: "nodeSeq" });
     treeSelectProps.defaultExpandedKeys = XEUtils.map(XEUtils.toTreeArray(XEUtils.searchTree(treeSelectProps.data, item => item.id === form.value.planId)), item => item.id);
 }
@@ -61,7 +61,7 @@ const submit = () => {
             !form.value.planId && XEUtils.set(data, "planId", "-");
 
             isSaving.value = true;
-            API.system.todoTask.edit(data).then(() => {
+            API.milestone.matters.edit(data).then(() => {
                 isSaving.value = false;
                 ElMessage.success("操作成功");
                 visible.value = false;

+ 10 - 21
src/views/milestone/matters/components/record/index.vue

@@ -1,6 +1,9 @@
 <template>
-    <scTable ref="xGridTable" :apiObj="hasAPI && $API.system.todoTask" :formConfig="formConfig" :paramsColums="paramsColums" :toolbarConfig="toolbarConfig" :columns="columns" :pagerConfig="pagerConfig">
+    <scTable ref="xGridTable" :apiObj="hasAPI && $API.milestone.matters" :formConfig="formConfig" :paramsColums="paramsColums" :toolbarConfig="toolbarConfig" :columns="columns" :pagerConfig="pagerConfig">
         <template #action="{ row }">
+            <el-button type="success" link @click="table_done(row)">
+                <template #icon><sc-iconify icon="ant-design:check-outlined"></sc-iconify></template>完成
+            </el-button>
             <el-button type="primary" link @click="table_bind(row)">
                 <template #icon><sc-iconify icon="mdi:relation-only-one-to-one"></sc-iconify></template>关联里程碑
             </el-button>
@@ -36,7 +39,6 @@ const proConfig = reactive({
 })
 
 const selectConfig = reactive({
-    span: 5,
     visible,
     options: objectToArray(nodeStatusDic),
     events: {
@@ -44,18 +46,6 @@ const selectConfig = reactive({
     }
 })
 
-const datetimerangeConfig = reactive({
-    visible,
-    span: 7,
-    resetValue: () => [],
-    props: {
-        type: "datetimerange",
-        startPlaceholder: "开始时间",
-        endPlaceholder: "结束时间",
-        format: "YYYY-MM-DD HH:mm"
-    }
-})
-
 const toolbarConfig = reactive({
     enabled: true,
     print: false
@@ -70,8 +60,7 @@ const formConfig = reactive({
     items: [
         mapFormItemSelect("projectId", "所属项目", proConfig),
         mapFormItemInput("content", "事项内容"),
-        mapFormItemSelect("status", "事项状态", selectConfig),
-        mapFormItemDatePicker("finishTime", "完成时间", datetimerangeConfig),
+        mapFormItemSelect("status", "事项状态", selectConfig)
     ]
 })
 
@@ -80,9 +69,7 @@ const paramsColums = reactive([
     { column: "projectId", field: visible.value ? "" : "projectIdNot" },
     visible.value ? { column: "projectIdNot" } : {},
     { column: "content" },
-    { column: "status" },
-    { column: "finishTimeBegin", field: "finishTime[0]" },
-    { column: "finishTimeEnd", field: "finishTime[1]" }
+    { column: "status" }
 ])
 
 const columns = reactive([
@@ -91,8 +78,7 @@ const columns = reactive([
     { type: "html", field: "content", title: "事项内容", minWidth: 200, sortable: true },
     { visible, field: "status", title: "事项状态", minWidth: 100, align: "center", editRender: { name: "$cell-tag" }, formatter: ({ cellValue }) => XEUtils.get(nodeStatusDic, cellValue, cellValue) },
     { visible, type: "html", field: "finishTime", title: "完成时间", minWidth: 160, sortable: true },
-    { visible, type: "html", field: "deadlineTime", title: "截止时间", minWidth: 160, sortable: true },
-    { title: "操作", fixed: "right", width: 140, align: "center", slots: { default: "action" } }
+    { visible, title: "操作", fixed: "right", width: 170, align: "center", slots: { default: "action" } }
 ])
 
 // 显示隐藏 筛选表单
@@ -110,6 +96,9 @@ const table_bind = row => {
     nextTick(() => recordRef.value?.setData(row));
 }
 
+const table_done = row => {
+}
+
 defineExpose({
     refreshTable
 })

+ 2 - 2
src/views/milestone/matters/detail.vue

@@ -1,5 +1,5 @@
 <template>
-    <el-dialog v-model="visible" title="任务初始化" :width="480" :close-on-click-modal="false" @closed="$emit('closed')">
+    <el-dialog v-model="visible" title="事项初始化" :width="480" :close-on-click-modal="false" @closed="$emit('closed')">
         <el-form ref="formRef" :model="form" :rules="rules" label-width="120">
             <el-form-item label="所属项目" prop="targetProjectId">
                 <el-select v-model="form.targetProjectId" filterable placeholder="请选择所属项目">
@@ -39,7 +39,7 @@ const submit = key => {
     formRef.value.validate(valid => {
         if (valid) {
             isSaving.value = true;
-            API.system.todoTask.copyData(form.value).then(() => {
+            API.milestone.matters.copyData(form.value).then(() => {
                 isSaving.value = false;
                 ElMessage.success("操作成功");
                 visible.value = false;

+ 3 - 3
src/views/milestone/matters/index.vue

@@ -2,8 +2,8 @@
 	<el-container class="is-vertical">
         <sc-page-header>
             <template #extra-right>
-                <el-button v-if="activeName == 'record'" type="primary" @click="table_copy">
-                    <template #icon><sc-iconify icon="mdi:file-document-refresh-outline"></sc-iconify></template>任务初始化
+                <el-button v-if="activeName == 'record'" type="primary" @click="table_init">
+                    <template #icon><sc-iconify icon="mdi:file-document-refresh-outline"></sc-iconify></template>事项初始化
                 </el-button>
             </template>
         </sc-page-header>
@@ -32,7 +32,7 @@ const dialog = ref(false);
 const table_add = () => componentRef.value.table_add();
 const table_refresh = () => componentRef.value.refreshTable();
 
-const table_copy = () => {
+const table_init = () => {
     dialog.value = true;
     nextTick(() => mockRef.value?.open());
 }

+ 3 - 3
src/views/milestone/plan/components/record/detail.vue

@@ -128,10 +128,10 @@ const treeSelectProps = reactive({
 const todoTasks = ref([]);
 const filterTodoL = computed(() => XEUtils.filter(todoTasks.value, item => item.planId == "-" || item.planId == form.value.id));
 const getTreeData = async projectId => {
-    const planRes = await API.system.milestone.all({ orderBy: "nodeSeq_asc", projectId });
+    const planRes = await API.milestone.plan.all({ orderBy: "nodeSeq_asc", projectId });
     treeSelectProps.data = XEUtils.toArrayTree([{ id: "0", nodeName: "根目录" }, ...planRes], { parentKey: "parentId", key: "id" });
     
-    const taskRes = await API.system.todoTask.all({ orderBy: "sortNum_asc", projectId });
+    const taskRes = await API.milestone.matters.all({ orderBy: "sortNum_asc", projectId });
     todoTasks.value = taskRes;
 }
 
@@ -157,7 +157,7 @@ const submit = () => {
     formRef.value.validate(valid => {
         if (valid) {
             isSaving.value = true;
-            API.system.milestone[XEUtils.first(mode.value.split("_"))](form.value).then(() => {
+            API.milestone.plan[XEUtils.first(mode.value.split("_"))](form.value).then(() => {
                 isSaving.value = false;
                 ElMessage.success("操作成功");
                 visible.value = false;

+ 2 - 2
src/views/milestone/plan/components/record/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <scTable ref="xGridTable" :apiObj="hasAPI && $API.system.milestone" apiKey="all" :formConfig="formConfig" :paramsColums="paramsColums" :toolbarConfig="toolbarConfig" :columns="columns" :pagerConfig="pagerConfig" :options="options" v-bind="props.options">
+    <scTable ref="xGridTable" :apiObj="hasAPI && $API.milestone.plan" apiKey="all" :formConfig="formConfig" :paramsColums="paramsColums" :toolbarConfig="toolbarConfig" :columns="columns" :pagerConfig="pagerConfig" :options="options" v-bind="props.options">
         <template #action="{ $grid, rowid }">
             <el-button type="primary" link @click="table_add($grid.getData(XEUtils.findIndexOf($grid.getData(), item => item.id == rowid)))">
                 <template #icon><sc-iconify icon="ant-design:cloud-upload-outlined"></sc-iconify></template>新增子节点
@@ -140,7 +140,7 @@ const table_del = ({ id }) => {
         confirmButtonText: "确定",
         cancelButtonText: "取消"
     }).then(() => {
-        API.system.milestone.del({ id }).then(() => {
+        API.milestone.plan.del({ id }).then(() => {
             ElMessage.success("操作成功");
             refreshTable();
         });

+ 0 - 77
src/views/milestone/plan/detail.vue

@@ -1,77 +0,0 @@
-<template>
-    <el-dialog v-model="visible" title="一键复制" fullscreen :close-on-click-modal="false" @closed="$emit('closed')">
-
-        <el-form ref="formRef" :model="form" :rules="rules" label-width="126">
-            <data-table ref="tableRef" isTemp hideHandler :options="tableOptions"></data-table>
-        </el-form>
-
-        <template #footer>
-            <el-button :loading="isSaving" type="primary" auto-insert-space @click="submit">提交</el-button>
-            <el-button auto-insert-space @click="visible = false">取消</el-button>
-        </template>
-    </el-dialog>
-</template>
-
-<script setup>
-import moment from "moment";
-import XEUtils from "xe-utils";
-import API from "@/api";
-import TOOL from "@/utils/tool";
-import dataTable from "./components/record";
-
-const $emit = defineEmits(["success", "closed"]);
-const visible = ref(false);
-const isSaving = ref(false);
-
-const form = ref({
-    targetProjectId: TOOL.data.get("PROJECT_ID"),
-    orderBy: "nodeSeq_asc",
-    projectIdNot: 1
-});
-
-const rules = reactive({
-    targetProjectId: [{ required: true, message: "请选择模拟项目" }],
-})
-
-const tableRef = ref();
-const tableOptions = reactive({
-    maxHeight: 1048,
-    toolbarConfig: { enabled: true, print: false, zoom: false },
-    formConfig: { enabled: false, data: form }
-})
-const refreshTable = () => tableRef.value.refreshTable();
-
-const open = () => {
-    visible.value = true;
-}
-
-const formRef = ref();
-const submit = key => {
-    formRef.value.validate(valid => {
-        if (valid) {
-            // if (tableRef.value?.getTableTotal() == 0) return ElMessage.warning("暂无相关数据,请调整条件后重试。");
-            // const data = XEUtils.omit(form.value, "sourceProjectId", "sourceProjectIdNot", "source", "sourceTime", "recordNum");
-            // XEUtils.set(data, "sourceBeginTime", XEUtils.first(form.value.sourceTime));
-            // XEUtils.set(data, "sourceEndTime", XEUtils.last(form.value.sourceTime));
-            // isSaving.value = true;
-            // API.aihazard.dataMock[apiKey.value](data).then(() => {
-            //     isSaving.value = false;
-            //     ElMessage.success("操作成功");
-            //     visible.value = false;
-            //     $emit("success");
-            // }).catch(() => isSaving.value = false);
-        } else {
-            return false;
-        }
-    });
-}
-
-defineExpose({
-    open
-})
-</script>
-
-<style lang="scss" scoped>
-.el-form {margin-top: 5px;padding-right: var(--el-message-close-size, 16px);}
-.el-form :deep(.el-main) {padding-right: 0;padding-bottom: 0;}
-</style>

+ 1 - 18
src/views/milestone/plan/index.vue

@@ -1,12 +1,6 @@
 <template>
 	<el-container class="is-vertical">
-        <sc-page-header addText="新增节点" @add="table_add" @expand="table_expand">
-            <template #extra-right>
-                <!-- <el-button v-if="activeName == 'record'" type="primary" @click="table_copy">
-                    <template #icon><sc-iconify icon="ant-design:copy-outlined"></sc-iconify></template>一键复制
-                </el-button> -->
-            </template>
-        </sc-page-header>
+        <sc-page-header addText="新增节点" @add="table_add" @expand="table_expand"></sc-page-header>
 
         <el-tabs v-model="activeName">
             <el-tab-pane v-for="(label, key) in workerStates" :key="key" :label="label" :name="key"></el-tab-pane>
@@ -14,29 +8,18 @@
 
         <component ref="componentRef" :is="allcomp[activeName]" />
 	</el-container>
-
-    <mock-detail v-if="dialog" ref="mockRef" @success="table_refresh" @closed="dialog = false"></mock-detail>
 </template>
 
 <script setup>
 import { workerStates } from "../main";
 import allcomp from "./components";
-import mockDetail from "./detail";
 
 const activeName = ref("record");
 
 const componentRef = ref();
-const mockRef = ref();
-const dialog = ref(false);
-
 const table_add = () => componentRef.value.table_add();
 const table_expand = () => componentRef.value.table_expand();
 const table_refresh = () => componentRef.value.refreshTable();
-
-const table_copy = () => {
-    dialog.value = true;
-    nextTick(() => mockRef.value?.open());
-}
 </script>
 
 <style lang="scss" scoped>

+ 1 - 1
src/views/project/acceptItems/detail.vue

@@ -64,7 +64,7 @@ const submit = () => {
     formRef.value.validate(valid => {
         if (valid) {
             isSaving.value = true;
-            API.system.acceptItems[mode.value](form.value).then(res => {
+            API.project.acceptItems[mode.value](form.value).then(res => {
                 isSaving.value = false;
                 ElMessage.success("操作成功");
                 visible.value = false;

+ 2 - 2
src/views/project/acceptItems/index.vue

@@ -3,7 +3,7 @@
         <sc-page-header></sc-page-header>
         <!-- <sc-page-header @add="table_add"></sc-page-header> -->
 
-        <scTable ref="xGridTable" :apiObj="$API.system.acceptItems" apiKey="all" :formConfig="formConfig" :paramsColums="paramsColums" :toolbarConfig="toolbarConfig" :columns="columns" :options="options">
+        <scTable ref="xGridTable" :apiObj="$API.project.acceptItems" apiKey="all" :formConfig="formConfig" :paramsColums="paramsColums" :toolbarConfig="toolbarConfig" :columns="columns" :options="options">
             <template #action="{ row }">
                 <el-button type="primary" link @click="table_edit(row)">
                     <template #icon><sc-iconify icon="ant-design:edit-outlined"></sc-iconify></template>修改
@@ -109,7 +109,7 @@ const table_del = ({ id }) => {
         confirmButtonText: "确定",
         cancelButtonText: "取消"
     }).then(() => {
-        API.system.acceptItems.del({ id }).then(() => {
+        API.project.acceptItems.del({ id }).then(() => {
             ElMessage.success("操作成功");
             refreshTable();
         });

+ 12 - 6
src/views/project/maintenance/detail.vue

@@ -358,10 +358,16 @@ const open = async () => {
 const setData = async fpiId => {
     await open();
     mode.value = "edit";
-    API.system.project.detail({ fpiId }).then(res => {
-        XEUtils.objectEach(form.value, (_, key) => {
+    API.project.info.detail({ fpiId }).then(res => {
+        XEUtils.objectEach(XEUtils.omit(form.value, "longitude", "latitude"), (_, key) => {
             if (key == "projectFirmName") XEUtils.set(form.value, "deptId", XEUtils.get(XEUtils.findTree(props.treeSelectProps.data, item => item.name == XEUtils.get(res.project, key)), "item.deptId", null));
-            else if (key == "folders") {
+            else if (key == "projectCoordinates") {
+                const longitude = XEUtils.divide(XEUtils.get(res.position, "longitude"), 1000000) || null;
+                const latitude = XEUtils.divide(XEUtils.get(res.position, "latitude"), 1000000) || null;
+                XEUtils.set(form.value, "longitude", longitude);
+                XEUtils.set(form.value, "latitude", latitude);
+                longitude && latitude && XEUtils.set(form.value, key, longitude + "," + latitude);
+            } else if (key == "folders") {
                 XEUtils.objectEach(form.value.folders, (_, folder_key) => {
                     XEUtils.set(form.value, `${key}.${folder_key}.entities`, XEUtils.map(XEUtils.get(res.project, `${key}.${folder_key}.entities`), ({ id, mineType, name, path }) => ({ id, mineType, name, path })));
                 });
@@ -374,7 +380,7 @@ const setData = async fpiId => {
             });
         });
 
-		drawMap();
+		form.value.projectCoordinates && drawMap();
     });
 }
 
@@ -405,7 +411,7 @@ const initMap = async () => {
 }
 
 const drawMap = () => {
-    geocoder.getAddress(XEUtils.get(form.value, "projectCoordinates", "").split(","), (status, result) => {
+    geocoder.getAddress(form.value.projectCoordinates.split(","), (status, result) => {
         if (status === "complete" && result.regeocode) {
             form.value.longitude = XEUtils.first(form.value.projectCoordinates.split(","));
             form.value.latitude = XEUtils.last(form.value.projectCoordinates.split(","));
@@ -530,7 +536,7 @@ const submit = () => {
             }
 
             isSaving.value = true;
-            API.system.project[mode.value](query).then(res => {
+            API.project.info[mode.value](query).then(res => {
                 isSaving.value = false;
                 ElMessage.success("操作成功");
                 visible.value = false;

+ 3 - 3
src/views/project/maintenance/index.vue

@@ -2,7 +2,7 @@
 	<el-container class="is-vertical">
         <sc-page-header @add="table_add"></sc-page-header>
 
-        <scTable ref="xGridTable" :apiObj="$API.system.project" :formConfig="formConfig" :paramsColums="paramsColums" :toolbarConfig="toolbarConfig" :columns="columns">
+        <scTable ref="xGridTable" :apiObj="$API.project.info" :formConfig="formConfig" :paramsColums="paramsColums" :toolbarConfig="toolbarConfig" :columns="columns">
             <template #tree_select>
                 <el-tree-select v-model="formConfig.data.projectFirmName" v-bind="treeSelectProps"></el-tree-select>
             </template>
@@ -78,7 +78,7 @@ const columns = reactive([
 
 // 获取组织树
 const getSelectTreeData = async () => {
-    const res = await API.system.project.dept();
+    const res = await API.project.info.dept();
     treeSelectProps.data = XEUtils.toArrayTree(XEUtils.filter(res, item => item.firmNature !== "学校"), { parentKey: "pid", key: "deptId" });
 }
 
@@ -118,7 +118,7 @@ const table_del = ({ fpiId }) => {
         confirmButtonText: "确定",
         cancelButtonText: "取消"
     }).then(() => {
-        API.system.project.del({ fpiId }).then(() => {
+        API.project.info.del({ fpiId }).then(() => {
             ElMessage.success("操作成功");
             refreshTable("add", fpiId);
         });

+ 3 - 3
src/views/project/maintenance/items.vue

@@ -129,8 +129,8 @@ const refreshTable = () => {
 const getAcceptItems = (projectId) => {
     nextTick(() => xGridTable.value?.toggleTableLoading(true));
     Promise.all([
-        API.system.acceptItems.all({ orderBy: "itemCategory_asc,createTime_asc" }),
-        API.system.project.bindItem.get({ projectId })
+        API.project.acceptItems.all({ orderBy: "itemCategory_asc,createTime_asc" }),
+        API.project.info.bindItem.get({ projectId })
     ]).then(([itemsRes, infoRes]) => {
         let count = 0;
         XEUtils.arrayEach(itemsRes, item => {
@@ -171,7 +171,7 @@ const submit = () => {
     XEUtils.set(query, "data", XEUtils.map(acceptItems.value, item => ({ itemId: item.id, ...XEUtils.pick(item, "beginTime", "endTime", "replaceIds") })));
     
     isSaving.value = true;
-    API.system.project.bindItem.add(query).then(res => {
+    API.project.info.bindItem.add(query).then(res => {
         isSaving.value = false;
         ElMessage.success("操作成功");
         visible.value = false;

src/views/project/maintenance/main.js → src/views/project/info/main.js