diff --git a/package.json b/package.json index 0ae6359..270fd77 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,8 @@ "vue-meta": "2.4.0", "vue-router": "3.4.9", "vuedraggable": "2.24.3", - "vuex": "3.6.0" + "vuex": "3.6.0", + "xlsx": "^0.18.5" }, "devDependencies": { "@vue/cli-plugin-babel": "4.4.6", diff --git a/src/api/ManageApi/index.js b/src/api/ManageApi/index.js index d5af084..e139bb9 100644 --- a/src/api/ManageApi/index.js +++ b/src/api/ManageApi/index.js @@ -1,35 +1,211 @@ +// src/api/ManageApi/index.js import request from '@/utils/request'; // 企业--基本信息==展示 export function getBasicInformationById(id) { - return request({ - url: `/gysl/basicInformation/${id}`, - method: 'get' - }); + return request({ + url: `/gysl/basicInformation/${id}`, + method: 'get' + }); } // 企业--基本信息==修改 export function updateBasicInformation(data) { - return request({ - url: `/gysl/basicInformation/edit`, - method: 'post', - data - }); + return request({ + url: `/gysl/basicInformation/edit`, + method: 'post', + data + }); } // 通过主键查询单条基本信息(企业规划信息) export function getProgrammeInformationById(id) { - return request({ - url: `/gysl/planInformation/${id}`, - method: 'get' - }); - } - - // 修改规划信息 - export function updateProgrammeInformation(data) { - return request({ - url: `/gysl/planInformation/edit`, - method: 'post', - data - }); - } \ No newline at end of file + return request({ + url: `/gysl/planInformation/${id}`, + method: 'get' + }); +} + +// 基本信息的导出功能 +export function exportBasicInformation(params) { + return request({ + url: `/gysl/basicInformation/export`, + method: 'post', + data: params, + responseType: 'blob' + }); +} + +// 项目评价清单 +// 分页查询项目评价清单 +export function getProjectEvaluationList(params) { + return request({ + url: '/gysl/xmpjqd/page', + method: 'get', + params + }); +} + +// 项目评价配置接口 +// 新增数据 +export function addProjectEvaluation(data) { + return request({ + url: '/gysl/pjpz/add', + method: 'post', + data + }); +} + +// 删除数据 +export function deleteProjectEvaluation(idList) { + return request({ + url: '/gysl/pjpz/delete', + method: 'delete', + params: { idList } + }); +} + +// 修改数据 +export function updateProjectEvaluation(data) { + return request({ + url: '/gysl/pjpz/edit', + method: 'post', + data + }); +} + +// 分页查询所有数据 +export function getProjectEvaluationPage(params) { + return request({ + url: '/gysl/pjpz/page', + method: 'get', + params + }); +} + +// 修改规划信息 +export function updateProgrammeInformation(data) { + return request({ + url: `/gysl/planInformation/edit`, + method: 'post', + data + }); +} + +// 要素指标管理 +// 新增要素或者指标 +export function addElement(data) { + return request({ + url: '/gysl/mx/add', + method: 'post', + data + }); +} + +// 查询所有要素 +export function getAllElements(params) { + return request({ + url: '/gysl/mx/page', + method: 'get', + params + }); +} + +// 编辑要素或者指标 +export function editElemention(data) { + return request({ + url: '/gysl/mx/edit', + method: 'post', + data + }); +} + +// 删除指标 +export function deleteElemention(id) { + return request({ + url: `/gysl/mx/delete`, + method: 'delete' + }); +} + +// 目录管理 +// 新增目录 +export function addCatalog(data) { + return request({ + url: '/gysl/ml/add', + method: 'post', + data + }); +} + +// 删除目录 +export function deleteCatalog(idList) { + return request({ + url: `/gysl/ml/delete`, + method: 'delete', + params: { idList } + }); +} + +// 修改目录 +export function editCatalog(data) { + return request({ + url: '/gysl/ml/edit', + method: 'post', + data + }); +} + +// 查询所有目录 +export function getAllCatalogs(params) { + return request({ + url: '/gysl/ml/page', + method: 'get', + params + }); +} + +// 项目知识库管理 +// 新增数据 +export function addXmzsk(data) { + return request({ + url: '/gysl/xmzsk/add', + method: 'post', + data + }); +} + +// 删除数据 +export function deleteXmzsk(idList) { + return request({ + url: '/gysl/xmzsk/delete', + method: 'delete', + params: { idList } + }); +} + +// 修改数据 +export function updateXmzsk(data) { + return request({ + url: '/gysl/xmzsk/edit', + method: 'post', + data + }); +} + +// 分页查询所有数据 +export function getXmzskPage(params) { + return request({ + url: '/gysl/xmzsk/page', + method: 'get', + params + }); +} + +// 通过主键查询单条数据 +export function getXmzskById(id) { + return request({ + url: `/gysl/xmzsk/${id}`, + method: 'get' + }); +} \ No newline at end of file diff --git a/src/components/ImageUpload2/index.vue b/src/components/ImageUpload2/index.vue new file mode 100644 index 0000000..7fa2c0b --- /dev/null +++ b/src/components/ImageUpload2/index.vue @@ -0,0 +1,232 @@ + + + + + + \ No newline at end of file diff --git a/src/components/Mars2dMap/index.vue b/src/components/Mars2dMap/index.vue index ca21abe..3290b9b 100644 --- a/src/components/Mars2dMap/index.vue +++ b/src/components/Mars2dMap/index.vue @@ -30,7 +30,6 @@ export default { map.destroy(); delete this[`map${this.withKeyId}`]; } - console.log(">>>>> 地图卸载完成 >>>>"); }, methods: { async initMap() { @@ -55,7 +54,6 @@ export default { ); this.$emit("onload", this[`map${this.withKeyId}`]); - console.log("Map二维地图构造参数", mapOptions); }, }, }; diff --git a/src/views/compilation/knowledge/index.vue b/src/views/compilation/knowledge/index.vue index e21cf3d..f167dd8 100644 --- a/src/views/compilation/knowledge/index.vue +++ b/src/views/compilation/knowledge/index.vue @@ -1,355 +1,380 @@ - - - - - - \ No newline at end of file +}; + + + \ No newline at end of file diff --git a/src/views/components/ProjectDetails/Basic.vue b/src/views/components/ProjectDetails/Basic.vue index bbb319e..9149e44 100644 --- a/src/views/components/ProjectDetails/Basic.vue +++ b/src/views/components/ProjectDetails/Basic.vue @@ -21,7 +21,7 @@ - +
项目代表性照片 @@ -39,159 +39,170 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 取 消 - 确 定 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取 消 + 确 定 + + - + \ No newline at end of file diff --git a/src/views/components/ProjectDetails/Months.vue b/src/views/components/ProjectDetails/Months.vue index a123ece..9bf43a6 100644 --- a/src/views/components/ProjectDetails/Months.vue +++ b/src/views/components/ProjectDetails/Months.vue @@ -30,28 +30,22 @@ {{ scope.row.name }} - - - + - - + + + - + - - +
@@ -74,28 +68,32 @@ export default { { date: '2016-05-02', name: '大众电脑生成制造基地', - address: ' 1518 弄', + number:1000, + address: ' 编辑 删除', data: '1000', status: '在建' }, { date: '2016-05-04', name: '大众电脑生成制造基地', - address: ' 1517 弄', + number:1000, + address: ' 编辑 删除', data: '1500', status: '拟建' }, { date: '2016-05-01', name: '大众电脑生成制造基地', - address: ' 1519 弄', + number:1000, + address: ' 编辑 删除', data: '2000', status: '已建' }, { date: '2016-05-03', name: '大众电脑生成制造基地', - address: ' 1516 弄', + number:1000, + address: ' 编辑 删除', data: '2500', status: '在建' } diff --git a/src/views/components/ProjectDetails/Programme.vue b/src/views/components/ProjectDetails/Programme.vue index cd05649..f1e404e 100644 --- a/src/views/components/ProjectDetails/Programme.vue +++ b/src/views/components/ProjectDetails/Programme.vue @@ -1,333 +1,354 @@ - - - - \ No newline at end of file +}; + + + \ No newline at end of file diff --git a/src/views/components/ProjectDetails/Projectpicture.vue b/src/views/components/ProjectDetails/Projectpicture.vue index ca6fc19..89da388 100644 --- a/src/views/components/ProjectDetails/Projectpicture.vue +++ b/src/views/components/ProjectDetails/Projectpicture.vue @@ -60,7 +60,6 @@ export default { }, data() { return { - size: '', evaluations: [ { element: '总投资额', ranking: '100' }, { element: '层数', ranking: '20' }, diff --git a/src/views/components/ProjectDetails/Projectpicturetwo.vue b/src/views/components/ProjectDetails/Projectpicturetwo.vue index 139961f..771b90b 100644 --- a/src/views/components/ProjectDetails/Projectpicturetwo.vue +++ b/src/views/components/ProjectDetails/Projectpicturetwo.vue @@ -71,22 +71,9 @@ - - - - - - - - - - - - - 上传图片 - - + + + 取消 @@ -98,10 +85,10 @@ + + diff --git a/src/views/components/dialog/basicinfo.vue b/src/views/components/dialog/basicinfo.vue index 1259a14..c0657a2 100644 --- a/src/views/components/dialog/basicinfo.vue +++ b/src/views/components/dialog/basicinfo.vue @@ -220,9 +220,6 @@ export default { getBasicInformationById(id) .then(response => { this.form = response.data; - }) - .catch(error => { - console.error('数据获取失败:', error); }); }, // 新增或修改资产确认按钮 @@ -237,11 +234,6 @@ export default { this.loading = false; this.$message.success('修改成功'); this.$router.push({ name: 'ProjectDetails', params: this.queryData }); - }) - .catch(error => { - console.error('修改失败:', error); - this.$message.error('修改失败,请重试!'); - this.loading = false; }); } else { createBasicInformation(formData) @@ -249,11 +241,6 @@ export default { this.loading = false; this.$message.success('新增成功'); this.$router.push({ name: 'ProjectDetails', params: this.queryData }); - }) - .catch(error => { - console.error('新增失败:', error); - this.$message.error('新增失败,请重试!'); - this.loading = false; }); } } else { diff --git a/src/views/evalute/config/index.vue b/src/views/evalute/config/index.vue index 39ccaad..47a93d3 100644 --- a/src/views/evalute/config/index.vue +++ b/src/views/evalute/config/index.vue @@ -1,327 +1,238 @@ - - - - - - \ No newline at end of file +}; + + + \ No newline at end of file diff --git a/src/views/evalute/evalist/index.vue b/src/views/evalute/evalist/index.vue index f09ee58..1e17fb7 100644 --- a/src/views/evalute/evalist/index.vue +++ b/src/views/evalute/evalist/index.vue @@ -1,348 +1,179 @@ - - - - - - - \ No newline at end of file +}; + + + \ No newline at end of file diff --git a/src/views/manage-info/index.vue b/src/views/manage-info/index.vue index dc93f16..174d5ca 100644 --- a/src/views/manage-info/index.vue +++ b/src/views/manage-info/index.vue @@ -22,7 +22,7 @@
- +
diff --git a/src/views/manage/index.vue b/src/views/manage/index.vue index 52eae46..8b75098 100644 --- a/src/views/manage/index.vue +++ b/src/views/manage/index.vue @@ -6,8 +6,7 @@ - + @@ -19,8 +18,7 @@ - + @@ -49,33 +47,31 @@
项目清单
- 下载模板 - 批量导入 + 下载模板 + 批量导入
- 新增 + 导出 - 修改 + + + 导出材料 + + + 单片材料 + 报告 + 项目手册 + + - - 删除 - - - 导出 - -
- + @@ -84,19 +80,16 @@ + - +
@@ -113,8 +106,7 @@ - {{ dict.label - }} + {{ dict.label }} @@ -126,17 +118,12 @@ 取 消 - + - +
将文件拖到此处,或点击上传
- 仅允许导入xls、xlsx格式文件。
@@ -206,11 +193,8 @@ export default { isUploading: false, // 是否更新已经存在的用户数据 updateSupport: 0, - // 设置上传的请求头部 - // headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 - // url: process.env.VUE_APP_BASE_API + "/tc/assetApp/importData" - // url: location.origin + "/api/tc/assetApp/importData" + url: location.origin + "/api/system/post/importData" }, }; }, @@ -245,6 +229,9 @@ export default { this.postList = response.rows; this.total = response.total; this.loading = false; + }).catch(error => { + console.error('获取项目列表失败', error); + this.loading = false; }); }, // 取消按钮 @@ -276,9 +263,9 @@ export default { }, // 多选框选中数据 handleSelectionChange(selection) { - this.ids = selection.map(item => item.postId) - this.single = selection.length != 1 - this.multiple = !selection.length + this.ids = selection.map(item => item.postId); + this.single = selection.length !== 1; + this.multiple = !selection.length; }, /** 新增按钮操作 */ handleAdd() { @@ -289,34 +276,40 @@ export default { /** 修改按钮操作 */ handleUpdate(row) { this.reset(); - const postId = row.postId || this.ids + const postId = row.postId || this.ids[0]; getPost(postId).then(response => { this.form = response.data; this.open = true; this.title = "修改项目"; + }).catch(error => { + console.error('获取项目详情失败', error); }); }, /** 详情按钮操作 */ getInfo(row) { this.$store.commit("SET_CRUMBS", this.$route.meta.title + "详情"); - const postIds = row.postId || this.ids; - this.$router.push({ path: `/manage-info/${postIds}` }); + const postIds = row.postId || this.ids[0]; + this.$router.push({ path: `/manage-info/${postIds}` }); }, /** 提交按钮 */ - submitForm: function () { + submitForm() { this.$refs["form"].validate(valid => { if (valid) { - if (this.form.postId != undefined) { + if (this.form.postId !== undefined) { updatePost(this.form).then(response => { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); + }).catch(error => { + console.error('修改项目失败', error); }); } else { addPost(this.form).then(response => { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); + }).catch(error => { + console.error('新增项目失败', error); }); } } @@ -324,25 +317,83 @@ export default { }, /** 删除按钮操作 */ handleDelete(row) { - const postIds = row.postId || this.ids; - this.$modal.confirm('是否确认删除项目编号为"' + postIds + '"的数据项?' + '删除这条信息之后有可能找不回来了,请思考一下哟!').then(function () { - return delPost(postIds); - }).then(() => { - this.getList(); - this.$modal.msgSuccess("删除成功"); - }).catch(() => { }); + const postIds = row.postId || this.ids.join(','); + this.$modal.confirm('是否确认删除项目编号为"' + postIds + '"的数据项?删除这条信息之后有可能找不回来了,请思考一下哟!').then(() => { + delPost(postIds).then(() => { + this.getList(); + this.$modal.msgSuccess("删除成功"); + }).catch(error => { + console.error('删除项目失败', error); + }); + }).catch(() => {}); }, /** 导出按钮操作 */ handleExport() { this.download('system/post/export', { ...this.queryParams - }, `post_${new Date().getTime()}.xlsx`) + }, `post_${new Date().getTime()}.xlsx`); + }, + handleExportCommand(command) { + let fileName = ''; + switch (command) { + case 'single-material': + fileName = 'single-material'; + break; + case 'report': + fileName = 'report'; + break; + case 'project-manual': + fileName = 'project-manual'; + break; + default: + this.$message.error('未知的导出类型'); + return; + } + this.download(`system/post/export/${fileName}`, { + ...this.queryParams + }, `${fileName}_${new Date().getTime()}.xlsx`).then(() => { + this.$message.success('下载成功'); + }).catch(() => { + this.$message.error('下载失败'); + }); + }, + download(url, params, fileName) { + return new Promise((resolve, reject) => { + const request = new XMLHttpRequest(); + request.open('GET', `${process.env.VUE_APP_BASE_API}/${url}`, true); + request.responseType = 'blob'; + request.onload = () => { + if (request.status === 200) { + const blob = new Blob([request.response], { type: 'application/vnd.ms-excel' }); + const link = document.createElement('a'); + link.href = window.URL.createObjectURL(blob); + link.download = fileName; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + resolve(); + } else { + reject(new Error('下载失败')); + } + }; + request.onerror = () => { + reject(new Error('下载失败')); + }; + request.send(); + }); + }, + // 下载模板 + downloadTemplate() { + this.download('system/post/template', {}, `template_${new Date().getTime()}.xlsx`).then(() => { + this.$message.success('模板下载成功'); + }).catch(() => { + this.$message.error('模板下载失败'); + }); } } }; - + \ No newline at end of file diff --git a/src/views/oriented/content/index.vue b/src/views/oriented/content/index.vue index a803731..e8e22d8 100644 --- a/src/views/oriented/content/index.vue +++ b/src/views/oriented/content/index.vue @@ -1,377 +1,415 @@ - \ No newline at end of file diff --git a/src/views/oriented/subdivide/index.vue b/src/views/oriented/subdivide/index.vue index eb425c4..008b571 100644 --- a/src/views/oriented/subdivide/index.vue +++ b/src/views/oriented/subdivide/index.vue @@ -377,4 +377,5 @@ export default { margin-top: 1rem; margin-bottom: 1rem; } + \ No newline at end of file diff --git a/src/views/tongjifenxi/index.vue b/src/views/tongjifenxi/index.vue new file mode 100644 index 0000000..e1a03f0 --- /dev/null +++ b/src/views/tongjifenxi/index.vue @@ -0,0 +1,3 @@ + \ No newline at end of file