清单更改

xuhongjie
严飞永 4 weeks ago
parent e912954367
commit 049812229f

@ -192,9 +192,7 @@ export function addCatalog(data) {
return request({ return request({
url: '/gysl/ml/add', url: '/gysl/ml/add',
method: 'post', method: 'post',
data: { data : data
ml: data // 同样包装在ml对象中
}
}); });
} }
@ -203,7 +201,9 @@ export function deleteCatalog(idList) {
return request({ return request({
url: `/gysl/ml/delete`, url: `/gysl/ml/delete`,
method: 'delete', method: 'delete',
params: { idList } params: {
idList: idList.join(',') // 将数组转换为逗号分隔的字符串
}
}); });
} }
@ -212,18 +212,16 @@ export function editCatalog(data) {
return request({ return request({
url: '/gysl/ml/edit', url: '/gysl/ml/edit',
method: 'post', method: 'post',
data: { data
ml: data // 按照接口要求将数据包装在ml对象中
}
}); });
} }
// 查询所有目录 // 查询所有目录
export function getAllCatalogs(params) { export function getAllCatalogs(query) {
return request({ return request({
url: '/gysl/ml/page', url: '/gysl/ml/page',
method: 'get', method: 'get',
params params:query
}); });
} }
@ -242,7 +240,7 @@ export function deleteXmzsk(idList) {
return request({ return request({
url: '/gysl/xmzsk/delete', url: '/gysl/xmzsk/delete',
method: 'delete', method: 'delete',
params: { params: {
idList: idList.join(',') // 将数组转换为逗号分隔的字符串 idList: idList.join(',') // 将数组转换为逗号分隔的字符串
} }
}); });
@ -496,8 +494,8 @@ export function updatexmqt(data) {
data data
}) })
} }
//根据项目id查询信息// 根据项目id查询信息 //根据项目id查询信息
export function getOtherInfoByxmid(query) { export function getOtherInfoByxmId(query) {
return request({ return request({
url: '/gysl/projectOtherInfo/searchId', url: '/gysl/projectOtherInfo/searchId',
method: 'get', method: 'get',
@ -553,7 +551,6 @@ export function getxmmmbById(id) {
//单片材料管理 //单片材料管理
//新增数据 //新增数据
// 新增数据
export function addClgl(data) { export function addClgl(data) {
return request({ return request({
url: '/gysl/dpclgl/add', url: '/gysl/dpclgl/add',
@ -680,14 +677,15 @@ export function getpicturelist(id){
}) })
} }
// 细分产业管理
// 细分产业管理
// 新增数据 // 新增数据
export function addXfcygl(data) { export function addXfcygl(data) {
return request({ return request({
url: '/gysl/xfcygl/add', url: '/gysl/xfcygl/add',
method: 'post', method: 'post',
data data:data
}); });
} }
@ -696,7 +694,9 @@ export function deleteXfcygl(idList) {
return request({ return request({
url: '/gysl/xfcygl/delete', url: '/gysl/xfcygl/delete',
method: 'delete', method: 'delete',
params: { idList } params: {
idList: idList.join(',') // 将数组转换为逗号分隔的字符串
}
}); });
} }
@ -705,16 +705,16 @@ export function updateXfcygl(data) {
return request({ return request({
url: '/gysl/xfcygl/edit', url: '/gysl/xfcygl/edit',
method: 'put', method: 'put',
data data:data
}); });
} }
// 分页查询所有数据 // 分页查询所有数据
export function getXfcyglPage(params) { export function getXfcyglPage(query) {
return request({ return request({
url: '/gysl/xfcygl/page', url: '/gysl/xfcygl/page',
method: 'get', method: 'get',
params params:query
}); });
} }
@ -727,4 +727,12 @@ export function getMessageCount() {
}) })
} }
//月度进展信息 //智能提醒
// 已读智能提醒
export function markSmartReminderAsRead(id) {
return request({
url: `/gysl/jSmartReminders/isRead/${id}`,
method: 'get'
});
}

@ -223,10 +223,6 @@ export default {
this.$message.error(response.msg || '获取数据失败'); this.$message.error(response.msg || '获取数据失败');
} }
}) })
.catch(error => {
this.$message.error('请求失败');
console.error(error);
});
}, },
// //

@ -15,7 +15,7 @@
<!-- 内容区 --> <!-- 内容区 -->
<div class="content"> <div class="content">
<div class="picturediv"> <div class="picturediv">
<div ref="chart" style="width: 30rem; height: 28rem; margin-left: 2rem;"></div> <div ref="chart" style="width: 38rem; height: 28rem;"></div>
</div> </div>
<div class="descriptionsdiv"> <div class="descriptionsdiv">
<div class="tablehead"> <div class="tablehead">

@ -44,7 +44,14 @@ export default {
return index === 0 ? require('@/assets/images/new@2x.png') : require('@/assets/images/other.png'); return index === 0 ? require('@/assets/images/new@2x.png') : require('@/assets/images/other.png');
}, },
formatDate(dateString) { formatDate(dateString) {
if (!dateString) {
// dateString undefined
return '';
}
const date = new Date(dateString); const date = new Date(dateString);
if (isNaN(date.getTime())) {
return '';
}
const year = date.getFullYear(); const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0'); const day = String(date.getDate()).padStart(2, '0');

@ -7,14 +7,14 @@
label-width="200"> label-width="200">
<el-row> <el-row>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="项目名称" style="width: 100%;"> <el-form-item label="项目名称" prop="name" style="width: 100%;">
<el-input v-model="queryParams.name" placeholder="请输入项目名称" clearable <el-input v-model="queryParams.name" placeholder="请输入项目名称" clearable
@keyup.enter.native="handleQuery" /> @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="建设起止时间"> <el-form-item label="建设起止时间">
<el-date-picker v-model="queryParams.startTime" type="date" placeholder="开始日期" <el-date-picker v-model="queryParams.begainTime" type="date" placeholder="开始日期"
style="width: 11rem;"></el-date-picker> style="width: 11rem;"></el-date-picker>
~ ~
<el-date-picker v-model="queryParams.endTime" type="date" placeholder="结束日期" <el-date-picker v-model="queryParams.endTime" type="date" placeholder="结束日期"
@ -96,11 +96,7 @@
</div> </div>
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange" stripe> <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange" stripe>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center"> <el-table-column label="序号" align="center" prop="id" />
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" prop="name" width="200" /> <el-table-column label="项目名称" align="center" prop="name" width="200" />
<el-table-column label="现状分类" align="center" prop="xzfl"> <el-table-column label="现状分类" align="center" prop="xzfl">
<template slot-scope="scope"> <template slot-scope="scope">
@ -160,9 +156,9 @@ export default {
postList: [], postList: [],
// //
statusColors: { statusColors: {
'审核通过': '#6EDABE', '审核通过': '#6EDABE',
'待填报': '#FFBF6B', '待填报': '#FFBF6B',
'待审核': '#7693D8' '待审核': '#7693D8'
}, },
// //
statusMap: { statusMap: {
@ -172,7 +168,7 @@ export default {
}, },
xzflMap: { xzflMap: {
1: '已建', 1: '已建',
2: '建', 2: '建',
3: '拟建' 3: '拟建'
}, },
// //
@ -183,7 +179,6 @@ export default {
name: undefined, name: undefined,
xmfrdwxz: undefined, xmfrdwxz: undefined,
dateRange: [], dateRange: [],
startTime: undefined,
status: undefined status: undefined
}, },
// //
@ -203,51 +198,15 @@ export default {
checkPermi, checkPermi,
checkRole, checkRole,
/** 查询项目列表 */ /** 查询项目列表 */
/** 查询项目列表 */
getList() { getList() {
this.loading = true; this.loading = true;
getBasicInformationPage(this.queryParams).then((response) => {
//
const params = {
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize,
...(this.queryParams.name && { name: this.queryParams.name }),
...(this.queryParams.xzfl && { xzfl: this.queryParams.xzfl }),
...(this.queryParams.xmfrdwxz && { xmfrdwxz: this.queryParams.xmfrdwxz }),
...(this.queryParams.status && { status: this.queryParams.status })
};
//
if (this.queryParams.startTime) {
params.startTime = this.formatDate(this.queryParams.startTime);
}
if (this.queryParams.endTime) {
params.endTime = this.formatDate(this.queryParams.endTime);
}
console.log('最终查询参数:', params); //
getBasicInformationPage(params).then((response) => {
this.postList = response.data.records; this.postList = response.data.records;
this.total = response.data.total; this.total = response.data.total;
this.loading = false; this.loading = false;
}).catch(() => {
this.loading = false;
}); });
}, },
//
formatDate(date) {
if (!date) return null;
const d = new Date(date);
let month = '' + (d.getMonth() + 1);
let day = '' + d.getDate();
const year = d.getFullYear();
if (month.length < 2) month = '0' + month;
if (day.length < 2) day = '0' + day;
return [year, month, day].join('-');
},
/** 导入按钮操作 */ /** 导入按钮操作 */
handleImport() { handleImport() {
this.upload.open = true; this.upload.open = true;
@ -305,7 +264,7 @@ export default {
this.$modal this.$modal
.confirm('是否确认删除项目id为"' + ids + '"的数据项?') .confirm('是否确认删除项目id为"' + ids + '"的数据项?')
.then(() => { .then(() => {
return deleteBasicInformation(ids); // API return deleteBasicInformation(ids);
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
@ -320,19 +279,9 @@ export default {
this.$router.push({ path: `/manage-info/${id}` }); this.$router.push({ path: `/manage-info/${id}` });
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
/** 重置按钮操作 */
resetQuery() { resetQuery() {
this.queryParams = { this.resetForm("queryForm");
pageNum: 1, this.handleQuery();
pageSize: 10,
xzfl: undefined,
name: undefined,
xmfrdwxz: undefined,
startTime: undefined,
endTime: undefined,
status: undefined
};
this.getList();
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */

@ -7,11 +7,7 @@
<div class="title">苏州工业园区工业上楼管理系统</div> <div class="title">苏州工业园区工业上楼管理系统</div>
<div class="logintabs"> <div class="logintabs">
<!-- @tab-click="handleClick" --> <!-- @tab-click="handleClick" -->
<el-tabs <el-tabs v-model="activeName" :stretch="true" color="#216CDC">
v-model="activeName"
:stretch="true"
color = "#216CDC"
>
<el-tab-pane label="企业用户登录" name="first"></el-tab-pane> <el-tab-pane label="企业用户登录" name="first"></el-tab-pane>
<el-tab-pane label="政务人员登录" name="second"></el-tab-pane> <el-tab-pane label="政务人员登录" name="second"></el-tab-pane>
</el-tabs> </el-tabs>
@ -43,9 +39,17 @@
<span v-if="!loading"> </span> <span v-if="!loading"> </span>
<span v-else> ...</span> <span v-else> ...</span>
</el-button> </el-button>
<div style="float: right;" v-if="register"> <el-button v-if="showGovernmentLoginButton" size="medium" type="primary" class="tongyidenglu"
style="width:100%;background: #2B62F1;" @click.native.prevent="handleGovernmentLogin">
<span>政务统一身份认证登录</span>
</el-button>
<el-button v-if="showEnterpriseLoginButton" size="medium" type="primary" class="tongyidenglu"
style="width:100%;background: #2B62F1;" @click.native.prevent="handleEnterpriseLogin">
<span>企业统一身份认证登录</span>
</el-button>
<!-- <div style="float: right;" v-if="register">
<router-link class="link-type" :to="'/register'">立即注册</router-link> <router-link class="link-type" :to="'/register'">立即注册</router-link>
</div> </div> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 底部 --> <!-- 底部 -->
@ -94,11 +98,25 @@ export default {
this.redirect = route.query && route.query.redirect this.redirect = route.query && route.query.redirect
} }
}, },
computed: {
showGovernmentLoginButton() {
return this.activeName === 'second';
},
showEnterpriseLoginButton() {
return this.activeName === 'first';
}
},
created() { created() {
this.getCode() this.getCode()
this.getCookie() this.getCookie()
}, },
methods: { methods: {
handleGovernmentLogin() {
window.location.href = 'https://qyt.sipac.gov.cn/';
},
handleEnterpriseLogin() {
window.location.href = 'https://qytt.sipac.gov.cn/ecobrainportal/login.html';
},
getCode() { getCode() {
getCodeImg().then((res) => { getCodeImg().then((res) => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
@ -158,13 +176,14 @@ export default {
border-radius: 0.16rem; border-radius: 0.16rem;
} }
::v-deep .el-tabs__header { ::v-deep .el-tabs__header {
border-bottom: none !important; border-bottom: none !important;
} }
::v-deep .el-tabs__item { ::v-deep .el-tabs__item {
font-size: 1rem; font-size: 1rem;
padding:0 20px; padding: 0 20px;
color: #3D424C; color: #3D424C;
font-family: Alibaba PuHuiTi; font-family: Alibaba PuHuiTi;
font-weight: 400; font-weight: 400;
@ -179,6 +198,10 @@ export default {
display: none !important; display: none !important;
} }
.tongyidenglu {
margin-top: 1rem;
margin-left: 0rem;
}
.login { .login {
display: flex; display: flex;
@ -188,7 +211,9 @@ export default {
height: 100%; height: 100%;
background-image: url('../assets/images/loginbackground.png'); background-image: url('../assets/images/loginbackground.png');
background-size: cover; background-size: cover;
}.loginleft { }
.loginleft {
width: 35rem; width: 35rem;
height: 40rem; height: 40rem;
background-image: url('../assets/images/loginleft.png'); background-image: url('../assets/images/loginleft.png');
@ -207,7 +232,8 @@ export default {
text-align: center; text-align: center;
margin-top: 1rem; margin-top: 1rem;
} }
.loginitem{
.loginitem {
width: 24rem; width: 24rem;
} }
@ -247,7 +273,8 @@ export default {
text-align: center; text-align: center;
color: #bfbfbf; color: #bfbfbf;
} }
.logintabs{
.logintabs {
margin-top: 2.88rem; margin-top: 2.88rem;
width: 18rem; width: 18rem;
} }
@ -279,12 +306,10 @@ export default {
.login-code-img { .login-code-img {
height: 38px; height: 38px;
} }
.el-tabs__item.is-active { .el-tabs__item.is-active {
color: #216CDC; color: #216CDC;
position: relative; position: relative;
padding-bottom: 0.5rem; padding-bottom: 0.5rem;
} }
</style> </style>

@ -128,15 +128,14 @@ export default {
dialogVisible: false, dialogVisible: false,
indicatorDialogVisible: false, indicatorDialogVisible: false,
form: { form: {
id: null, id: 0,
type: '', type: '',
name: '', name: '',
}, },
indicatorForm: { indicatorForm: {
id: null, id: 0,
jtzb: '', jtzb: '',
xxyq: '', xxyq: '',
elementId: null
}, },
currentElement: null currentElement: null
}; };
@ -177,7 +176,7 @@ export default {
// //
resetForm() { resetForm() {
this.form = { this.form = {
id: null, id: 0,
type: '', type: '',
name: '' name: ''
}; };
@ -186,10 +185,10 @@ export default {
// //
resetIndicatorForm() { resetIndicatorForm() {
this.indicatorForm = { this.indicatorForm = {
id: null, id: 0,
jtzb: '', jtzb: '',
xxyq: '', xxyq: '',
elementId: null elementId: 2
}; };
}, },
@ -201,7 +200,7 @@ export default {
createBy: user.userName, createBy: user.userName,
createId: user.userId, createId: user.userId,
updateBy: user.userName, updateBy: user.userName,
updateId: user.userId updateId: user.userId,
}; };
const api = this.form.id ? editElemention : addElement; const api = this.form.id ? editElemention : addElement;
@ -230,10 +229,16 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteElemention([element.id]).then(() => { // ID2
deleteElemention(2).then(() => {
this.$message.success('删除成功'); this.$message.success('删除成功');
this.fetchElements(); this.fetchElements(); //
}) }).catch(error => {
this.$message.error('删除失败: ' + (error.message || '未知错误'));
});
}).catch(() => {
//
this.$message.info('已取消删除');
}); });
}, },
@ -290,9 +295,7 @@ export default {
deleteElemention([indicator.id]).then(() => { deleteElemention([indicator.id]).then(() => {
this.$message.success('删除成功'); this.$message.success('删除成功');
this.fetchElements(); this.fetchElements();
}).catch(error => { })
this.$message.error('删除失败: ' + (error.message || error));
});
}); });
} }
}, },

@ -1,39 +1,39 @@
<template> <template>
<div> <div>
<!-- 搜索区域 --> <!-- 表单查询项 -->
<div class="headerbox"> <div class="headerbox">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="7rem"> <el-form ref="queryForm" :model="queryParams" size="small" label-width="100px">
<el-row> <el-row>
<el-col :span="9"> <el-col :span="5">
<el-form-item label="上楼目录类别" prop="slmllb" style="width: 100%;"> <el-form-item label="上楼目录类别" prop="slmllb">
<el-select v-model="queryParams.slmllb" placeholder="请选择上楼目录类别" style="width: 26.5rem;"> <el-select v-model="queryParams.slmllb" placeholder="请选择上楼目录类别">
<el-option v-for="dict in dict.type.shangloumulu" :key="dict.value" :label="dict.label" <el-option v-for="dict in dict.type.shangloumulu" :key="dict.value" :label="dict.label"
:value="dict.value" /> :value="dict.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="5">
<el-form-item label="工业大类" prop="gydl" style="width: 100%;"> <el-form-item label="工业大类" prop="gydl" style="width: 100%;">
<el-input v-model="queryParams.gydl" placeholder="请输入工业大类" clearable style="width: 20.5rem;" <el-input v-model="queryParams.gydl" placeholder="请输入工业大类" :fetch-suggestions="querySearchAsync"
@keyup.enter.native="handleQuery" show-word-limit /> @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item label="产业" prop="cy" style="width: 100%;"> <el-form-item label="产业" prop="cy" style="width: 100%;">
<el-input v-model="queryParams.cy" placeholder="请输入产业" clearable style="width: 20.5rem;" <el-input v-model="queryParams.cy" placeholder="请输入产业" clearable style="width: 20.5rem;"
@keyup.enter.native="handleQuery" show-word-limit /> @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="3">
<el-row>
<el-col :span="9">
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="更新时间" prop="updateTime">
<el-date-picker v-model="queryParams.updateTime" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" <el-date-picker v-model="queryParams.updateTime" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:style="{ width: '26.5rem' }" placeholder="选择日期" clearable @change="handleQuery" /> :style="{ width: '13.5rem' }" placeholder="选择日期" clearable @change="handleQuery" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item style="margin-left: 2.5rem;"> <el-form-item style="margin-left: -100px;">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
@ -42,18 +42,24 @@
</el-form> </el-form>
</div> </div>
<!-- 表格 --> <!-- 表格内容-->
<div class="tablebox"> <div class="tablebox">
<!-- 导出行 -->
<div class="tablebtntwo"> <div class="tablebtntwo">
<div> <el-row :gutter="10" class="mb8">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"></el-button> <el-col :span="1.5">
</div> <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"></el-button>
<div class="tablebtn"> </el-col>
<el-button type="primary" size="mini" @click="handleExport"></el-button> </el-row>
<el-button type="primary" size="mini" @click="handleImport"></el-button> <el-row :gutter="10" class="mb8">
</div> <el-col :span="1.5">
<el-button type="primary" icon="el-icon-download" size="mini" @click="handleImport"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-download" size="mini" @click="handleExport"></el-button>
</el-col>
</el-row>
</div> </div>
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" width="60" align="center"> <el-table-column label="序号" width="60" align="center">
@ -61,26 +67,29 @@
{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }} {{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="上楼目录类别" align="center" prop="slmllb" :formatter="formatSlmllb" /> <el-table-column label="上楼目录类别" align="center">
<template slot-scope="scope">
{{ fileTypeMap[scope.row.slmllb] || scope.row.slmllb }}
</template>
</el-table-column>
<el-table-column label="工业大类" align="center" prop="gydl" /> <el-table-column label="工业大类" align="center" prop="gydl" />
<el-table-column label="产业" align="center" prop="cy" /> <el-table-column label="产业" align="center" prop="cy" />
<el-table-column label="更新时间" align="center" prop="updateTime" width="180" /> <el-table-column label="更新时间" align="center" prop="updateTime" width="180" />
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"></el-button>
<el-button size="mini" type="text" icon="el-icon-delete" style="color: #F25353;" <el-button size="mini" type="text" @click="handleUpdate(scope.row)"></el-button>
@click="handleDelete(scope.row)">删除</el-button> <el-button size="mini" type="text" @click="handleDelete(scope.row)" style="color: red;">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList" />
</div> </div>
<!-- 新增/修改对话框 --> <!-- 添加或修改项目对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false"> <el-dialog :title="title" :visible.sync="open" width="40rem" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="7rem">
<el-form-item label="上楼目录类别" prop="slmllb"> <el-form-item label="上楼目录类别" prop="slmllb">
<el-select v-model="form.slmllb" placeholder="请选择上楼目录类别" style="width: 100%;"> <el-select v-model="form.slmllb" placeholder="请选择上楼目录类别" style="width: 100%;">
<el-option v-for="dict in dict.type.shangloumulu" :key="dict.value" :label="dict.label" <el-option v-for="dict in dict.type.shangloumulu" :key="dict.value" :label="dict.label"
@ -88,49 +97,53 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="工业大类" prop="gydl"> <el-form-item label="工业大类" prop="gydl">
<el-input v-model="form.gydl" placeholder="请输入工业大类" maxlength="50" show-word-limit /> <el-input v-model="form.gydl" placeholder="请输入工业大类" maxlength="50" />
</el-form-item> </el-form-item>
<el-form-item label="产业" prop="cy"> <el-form-item label="产业" prop="cy">
<el-input v-model="form.cy" placeholder="请输入产业" maxlength="50" show-word-limit /> <el-input v-model="form.cy" placeholder="请输入产业" maxlength="50" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 导入对话框 --> <!-- 导入对话框 -->
<el-dialog title="数据导入" :visible.sync="upload.open" width="400px" append-to-body :close-on-click-modal="false"> <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload ref="upload" :limit="1" accept=".xlsx,.xls" :headers="upload.headers" :action="upload.url" <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
:disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
:auto-upload="false" drag> :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip"> <div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span> <span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
@click="importTemplate">下载模板</el-link> @click="importTemplate">下载模板</el-link>
</div> </div>
</el-upload> </el-upload>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="upload.open = false"> </el-button>
<el-button type="primary" @click="submitFileForm"> </el-button> <el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { addCatalog, deleteCatalog, editCatalog, getAllCatalogs, exportCatalog } from '@/api/ManageApi/index';
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { getAllCatalogs, addCatalog, editCatalog, deleteCatalog } from "@/api/ManageApi/index";
import fileload from "@/components/FileUpload/index.vue"
export default { export default {
name: "Catalog",
dicts: ['shangloumulu'], dicts: ['shangloumulu'],
components: {
fileload
},
data() { data() {
return { return {
// //
loading: true, loading: true,
// //
ids: [], ids: [],
@ -142,67 +155,96 @@ export default {
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
// //
postList: [], postList: [],
// //
title: "", title: "",
// //
open: false, open: false,
//
detailOpen: false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
slmllb: undefined,
gydl: undefined, gydl: undefined,
cy: undefined, slmllb: undefined,
updateTime: undefined updateTime: undefined
}, },
// //
form: { form: {
id: undefined, id: undefined,
slmllb: undefined,
gydl: undefined, gydl: undefined,
cy: undefined slmllb: undefined,
cy: undefined,
createBy: undefined,
createId: undefined,
createTime: undefined,
updateBy: undefined,
updateId: undefined,
updateTime: undefined
}, },
// //
rules: { rules: {
gydl: [
{ required: true, message: "文件名称不能为空", trigger: "blur" }
],
slmllb: [ slmllb: [
{ required: true, message: "上楼目录类别不能为空", trigger: "change" } { required: true, message: "上楼目录类别不能为空", trigger: "change" }
], ],
gydl: [ scyh: [
{ required: true, message: "工业大类不能为空", trigger: "blur" }, { required: true, message: "上传用户不能为空", trigger: "blur" }
{ max: 50, message: "长度不能超过50个字符", trigger: "blur" }
], ],
cy: [ scsj: [
{ required: true, message: "产业不能为空", trigger: "blur" }, { required: true, message: "上传时间不能为空", trigger: "change" }
{ max: 50, message: "长度不能超过50个字符", trigger: "blur" }
] ]
}, },
// //
fileTypeMap: {
1: "重点鼓励上楼",
2: "有条件上楼",
},
//
upload: { upload: {
//
open: false, open: false,
//
title: "目录导入",
//
isUploading: false, isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() }, headers: { Authorization: "Bearer " + getToken() },
url: process.env.VUE_APP_BASE_API + "/gysl/ml/importMl" //
} // url: process.env.VUE_APP_BASE_API + "/tc/assetCurrent/import"
url: location.origin + "/gysl/ml/importMl",
},
}; };
}, },
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
//
formatSlmllb(row) {
return this.selectDictLabel(this.dict.type.shangloumulu, row.slmllb);
},
/** 查询列表 */ querySearchAsync(queryString, cb) {
let results = [];
// getAllCatalogs API
getAllCatalogs({ gydl: queryString }).then(res => {
res.data.records.forEach(item => {
results.push({
value: item.gydl,
id: item.id,
});
});
});
cb(results);
},
//
getList() { getList() {
this.loading = true; this.loading = true;
console.log('【查询参数】', JSON.stringify(this.queryParams, null, 2));
getAllCatalogs(this.queryParams).then(response => { getAllCatalogs(this.queryParams).then(response => {
console.log('【查询结果】', response.data);
this.postList = response.data.records.map(item => ({ this.postList = response.data.records.map(item => ({
...item, ...item,
updateTime: item.updateTime ? item.updateTime.split(' ')[0] : '' updateTime: item.updateTime ? item.updateTime.split(' ')[0] : ''
@ -210,168 +252,139 @@ export default {
this.total = response.data.total; this.total = response.data.total;
this.loading = false; this.loading = false;
}).catch(error => { }).catch(error => {
console.error('查询失败:', error); console.error('API Request Error:', error);
this.loading = false; this.loading = false;
}); });
}, },
// //
cancel() { cancel() {
this.open = false; this.open = false;
this.reset(); this.reset();
}, },
// //
reset() { reset() {
this.form = { this.form = {
id: undefined, id: undefined,
slmllb: undefined,
gydl: undefined, gydl: undefined,
cy: undefined slmllb: undefined,
fj: undefined,
createBy: undefined,
createId: undefined,
createTime: undefined,
updateBy: undefined,
updateId: undefined,
updateTime: undefined
}; };
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id); this.ids = selection.map(item => item.id);
this.single = selection.length !== 1; this.single = selection.length !== 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "新增目录"; this.title = "新增项目知识库";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id; const catalogId = row.id;
console.log('【获取详情】ID:', id); this.form = { ...row };
this.open = true;
// API this.title = "修改项目知识库";
const detailData = this.postList.find(item => item.id === id);
if (detailData) {
this.form = {
id: detailData.id,
slmllb: detailData.slmllb,
gydl: detailData.gydl,
cy: detailData.cy
};
this.open = true;
this.title = "修改目录";
console.log('【详情数据】', JSON.stringify(this.form, null, 2));
}
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
const user = this.$store.state.user; if (this.form.id !== undefined) {
const currentTime = new Date().toISOString().replace('T', ' ').substring(0, 19); editCatalog(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
const formData = { this.open = false;
...this.form, this.getList();
updateTime: currentTime, }).catch(error => {
updateBy: user.name, console.error('API Request Error:', error);
updateId: user.userId, });
...(this.form.id ? {} : { } else {
createTime: currentTime, addCatalog(this.form).then(response => {
createBy: user.name, this.$modal.msgSuccess("新增成功");
createId: user.userId this.open = false;
}) this.getList();
}; }).catch(error => {
console.error('API Request Error:', error);
const requestData = { ml: formData }; });
console.log('【提交数据】', JSON.stringify(requestData, null, 2)); }
const request = this.form.id
? editCatalog(requestData)
: addCatalog(requestData);
request.then(response => {
this.$modal.msgSuccess(this.form.id ? "修改成功" : "新增成功");
this.open = false;
this.getList();
}).catch(error => {
console.error('提交失败:', error);
this.$modal.msgError(error.response?.data?.msg || "操作失败");
});
} }
}); });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const catalogIds = row.id || this.ids;
console.log('【删除ID】', ids); this.$modal.confirm('是否确认删除项目知识库编号为"' + catalogIds + '"的数据项?').then(() => {
return deleteCatalog([catalogIds]);
this.$modal.confirm('确认删除选中的数据?').then(() => {
return deleteCatalog(ids);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(error => { }).catch(() => { });
console.error('删除失败:', error);
});
}, },
/**导出 */
/** 导出按钮操作 */
handleExport() { handleExport() {
console.log('【导出参数】', JSON.stringify(this.queryParams, null, 2)); this.download(
this.$modal.confirm('确认导出所有数据?').then(() => { "/gysl/ml/exportMl",
return exportCatalog(this.queryParams); {
}).then(response => { ...this.form,
this.download(response.msg); },
}).catch(error => { `目录管理${new Date().getTime()}.xlsx`
console.error('导出失败:', error); );
});
}, },
//
/** 导入按钮操作 */
handleImport() { handleImport() {
this.upload.open = true; this.upload.open = true;
}, },
/** 下载模板操作 */ /** 下载模板操作 */
importTemplate() { importTemplate() {
this.download("/gysl/ml/importTemplate", {}, `目录导入模板_${new Date().getTime()}.xlsx`); this.download(
"/tc/assetCurrent/importTemplate",
{},
`目录导入模板${new Date().getTime()}.xlsx`
);
}, },
// //
handleFileUploadProgress(event, file, fileList) { handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true; this.upload.isUploading = true;
}, },
// //
handleFileSuccess(response, file, fileList) { handleFileSuccess(response, file, fileList) {
this.upload.open = false; this.upload.open = false;
this.upload.isUploading = false; this.upload.isUploading = false;
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true }); this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList(); this.getList();
}, },
// //
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit();
} },
} }
}; };
</script> </script>
@ -393,14 +406,21 @@ export default {
border: 1px solid #eee; border: 1px solid #eee;
} }
.tablebtntwo { .tablehead {
margin: 1rem 0;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center;
} }
.tablebtn { .headbtn {
display: flex; display: flex;
gap: .5rem; }
.tablebtntwo {
margin-top: 1rem;
margin-bottom: 1rem;
width: 100%;
display: flex;
justify-content: space-between;
} }
</style> </style>

@ -1,20 +1,22 @@
<template> <template>
<div> <div>
<!-- 产业导向管理--细分产业管理 --> <!-- 细分产业管理 -->
<!-- 表单查询项 -->
<div class="headerbox"> <div class="headerbox">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" <el-form ref="queryForm" :model="queryParams" size="small" label-width="100px">
label-width="7rem">
<el-row> <el-row>
<el-col :span="9"> <el-col :span="5">
<el-form-item label="产业类别" prop="cylb" style="width: 100%;"> <el-form-item label="产业类别" prop="cylb">
<el-input v-model="queryParams.cylb" placeholder="请输入产业类别" clearable style="width: 26.5rem;" <el-select v-model="queryParams.cylb" placeholder="请选择产业类别">
@keyup.enter.native="handleQuery" /> <el-option v-for="dict in dict.type.cylb" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="5">
<el-form-item label="产业细分" prop="cyxf" style="width: 100%;"> <el-form-item label="产业细分" prop="cyxf" style="width: 100%;">
<el-input v-model="queryParams.cyxf" placeholder="请输入产业细分" clearable style="width: 20rem;" <el-input v-model="queryParams.cyxf" placeholder="请输入产业细分"
@keyup.enter.native="handleQuery" /> :fetch-suggestions="querySearchAsync" @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
@ -26,15 +28,17 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="3">
<el-row>
<el-col :span="9">
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="更新时间" prop="updateTime">
<el-date-picker type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :style="{ width: '26.5rem' }" placeholder="选择日期" clearable v-model="queryParams.updateTime"></el-date-picker> <el-date-picker v-model="queryParams.updateTime" type="date" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" :style="{ width: '13.5rem' }" placeholder="选择日期" clearable
@change="handleQuery" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item style="margin-left: 2.5rem;"> <el-form-item style="margin-left: -70px;">
<el-button type="primary" icon="el-icon-search" size="mini" <el-button type="primary" icon="el-icon-search" size="mini"
@click="handleQuery">查询</el-button> @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -45,37 +49,50 @@
</div> </div>
<!-- 表格内容区 --> <!-- 表格内容区 -->
<div class="tablebox"> <div class="tablebox">
<!-- 标签行 --> <!-- 导出行 -->
<div class="tablehead"> <div class="tablebtntwo">
<div class="tablebtntwo"> <el-row :gutter="10" class="mb8">
<el-row :gutter="10" class="mb8"> <el-col :span="1.5">
<el-col :span="1.5"> <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"></el-button>
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"></el-button> </el-col>
</el-col> </el-row>
</el-row> <el-row :gutter="10" class="mb8">
</div> <el-col :span="1.5">
<div class="headbtn"> <el-button type="primary" icon="el-icon-download" size="mini"
<el-button type="primary" size="mini" @click="handleExport"></el-button> @click="handleImport">导入</el-button>
<el-button type="primary" size="mini" @click="handleImport"></el-button> </el-col>
</div> <el-col :span="1.5">
<el-button type="primary" icon="el-icon-download" size="mini"
@click="handleExport">导出</el-button>
</el-col>
</el-row>
</div> </div>
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="产业类别" align="center" prop="cylb" /> <el-table-column label="序号" width="60" align="center">
<template slot-scope="scope">
{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="产业类别" align="center" prop="cylb">
<template slot-scope="scope">
{{ cylbMap[scope.row.cylb] || scope.row.cylb }}
</template>
</el-table-column>
<el-table-column label="产业细分" align="center" prop="cyxf" /> <el-table-column label="产业细分" align="center" prop="cyxf" />
<el-table-column label="原材料及生产环节" align="center" prop="ycljschj" /> <el-table-column label="原材料及生产环节" align="center" prop="ycljschj" />
<el-table-column label="上楼适应性" align="center"> <el-table-column label="上楼适应性" align="center" prop="slsyx">
<template slot-scope="scope"> <template slot-scope="scope">
{{ slsyxMap[scope.row.slsyx] || scope.row.slsyx }} {{ slsyxMap[scope.row.slsyx] || scope.row.slsyx }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="更新时间" align="center" prop="updateTime" /> <el-table-column label="更新时间" align="center" prop="updateTime" width="180" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" @click="handleEdit(scope.row)"></el-button>
<el-button size="mini" type="text" style="color: #F25353;" <el-button size="mini" type="text" @click="handleUpdate(scope.row)"></el-button>
@click="handleDelete(scope.row)">删除</el-button> <el-button size="mini" type="text" @click="handleDelete(scope.row)"
style="color: red;">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -84,10 +101,13 @@
</div> </div>
<!-- 添加或修改项目对话框 --> <!-- 添加或修改项目对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="40rem" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="160px">
<el-form-item label="产业类别" prop="cylb"> <el-form-item label="产业类别" prop="cylb">
<el-input v-model="form.cylb" placeholder="请输入产业类别" /> <el-select v-model="form.cylb" placeholder="请选择产业类别">
<el-option v-for="dict in dict.type.cylb" :key="dict.value" :label="dict.label"
:value="parseInt(dict.value)"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="产业细分" prop="cyxf"> <el-form-item label="产业细分" prop="cyxf">
<el-input v-model="form.cyxf" placeholder="请输入产业细分" /> <el-input v-model="form.cyxf" placeholder="请输入产业细分" />
@ -96,7 +116,7 @@
<el-input v-model="form.ycljschj" placeholder="请输入原材料及生产环节" /> <el-input v-model="form.ycljschj" placeholder="请输入原材料及生产环节" />
</el-form-item> </el-form-item>
<el-form-item label="上楼适应性" prop="slsyx"> <el-form-item label="上楼适应性" prop="slsyx">
<el-select v-model="form.slsyx" placeholder="请选择文件类型"> <el-select v-model="form.slsyx" placeholder="请选择上楼适应性">
<el-option v-for="dict in dict.type.slsyx" :key="dict.value" :label="dict.label" <el-option v-for="dict in dict.type.slsyx" :key="dict.value" :label="dict.label"
:value="parseInt(dict.value)"></el-option> :value="parseInt(dict.value)"></el-option>
</el-select> </el-select>
@ -107,31 +127,38 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 批量导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body> <!-- 导入对话框 -->
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag> :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip"> <div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span> <span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
@click="importTemplate">下载模板</el-link>
</div> </div>
</el-upload> </el-upload>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button> <el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button> <el-button @click="upload.open = false"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getXfcyglPage, getXfcyglById, deleteXfcygl, addXfcygl, updateXfcygl } from "@/api/ManageApi/index"; import { getXfcyglPage, addXfcygl, updateXfcygl, deleteXfcygl } from "@/api/ManageApi/index";
import fileload from "@/components/FileUpload/index.vue"
export default { export default {
name: "Subdivide", dicts: ['cylb', 'slsyx'],
dicts: ['slsyx'], components: {
fileload
},
data() { data() {
return { return {
// //
@ -146,94 +173,113 @@ export default {
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
// //
postList: [], postList: [],
// //
title: "", title: "",
// //
open: false, open: false,
//
detailOpen: false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
cylb: undefined,
cyxf: undefined, cyxf: undefined,
cylb: undefined,
slsyx: undefined, slsyx: undefined,
dateRange: undefined
}, },
// //
form: {}, form: {
id: undefined,
cyxf: undefined,
cylb: undefined,
ycljschj: undefined,
slsyx: undefined,
createBy: undefined,
createId: undefined,
createTime: undefined,
updateBy: undefined,
updateId: undefined,
updateTime: undefined
},
// //
rules: { rules: {
// cylb: [ cyxf: [
// { required: true, message: "", trigger: "blur" } { required: true, message: "文件名称不能为空", trigger: "blur" }
// ], ],
// cyxf: [ cylb: [
// { required: true, message: "", trigger: "blur" } { required: true, message: "产业类别不能为空", trigger: "change" }
// ], ],
// ycljschj: [ scyh: [
// { required: true, message: "", trigger: "blur" } { required: true, message: "上传用户不能为空", trigger: "blur" }
// ], ],
// slsyx: [ ycljschj: [
// { required: true, message: "", trigger: "change" } { required: true, message: "上传时间不能为空", trigger: "change" }
// ] ]
},
//
cylbMap: {
1: "新一代信息技术",
2: "高端装备制造",
3: "生物医药及大健康",
4: "纳米技术应用及新材料",
5: "人工智能及数字产业",
6: "新能源及绿色产业"
},
//
slsyxMap: {
1: '能上楼',
2: '低楼层'
}, },
//
upload: { upload: {
// //
open: false, open: false,
// //
title: "导入", title: "细分产业导入",
// //
isUploading: false, isUploading: false,
// //
updateSupport: 0, updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
// //
url: process.env.VUE_APP_BASE_API + "/gysl/xfcygl/imporXfcy" // url: process.env.VUE_APP_BASE_API + "/tc/assetCurrent/import"
url: location.origin + "/gysl/xfcygl/exportXfcy",
}, },
//
slsyxMap: {
'1': '能上楼',
'2': '低楼层',
}
}; };
}, },
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
//
handleImport() { querySearchAsync(queryString, cb) {
this.upload.open = true; let results = [];
}, // getXfcyglPage API
// getXfcyglPage({ cyxf: queryString }).then(res => {
handleFileUploadProgress(event, file, fileList) { res.data.records.forEach(item => {
this.upload.isUploading = true; results.push({
}, value: item.cyxf,
// id: item.id,
handleFileSuccess(response, file, fileList) { });
this.upload.open = false; });
this.upload.isUploading = false;
this.$refs.upload.clearFiles(); });
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true }); cb(results);
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}, },
/** 查询项目列表 */ //
getList() { getList() {
this.loading = true; this.loading = true;
const params = { getXfcyglPage(this.queryParams).then(response => {
...this.queryParams, this.postList = response.data.records.map(item => ({
startTime: this.queryParams.dateRange ? this.queryParams.dateRange[0] : undefined, ...item,
endTime: this.queryParams.dateRange ? this.queryParams.dateRange[1] : undefined }));
};
getXfcyglPage(params).then(response => {
this.postList = response.data.records;
this.total = response.data.total; this.total = response.data.total;
this.loading = false; this.loading = false;
}).catch(error => {
console.error('API Request Error:', error);
this.loading = false;
}); });
}, },
// //
@ -245,10 +291,16 @@ export default {
reset() { reset() {
this.form = { this.form = {
id: undefined, id: undefined,
cylb: undefined,
cyxf: undefined, cyxf: undefined,
cylb: undefined,
ycljschj: undefined, ycljschj: undefined,
slsyx: undefined, slsyx: undefined,
createBy: undefined,
createId: undefined,
createTime: undefined,
updateBy: undefined,
updateId: undefined,
updateTime: undefined
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -272,92 +324,84 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加细分产业"; this.title = "新增细分产业";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleEdit(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id; const catalogId = row.id;
getXfcyglById(id).then(response => { this.form = { ...row };
this.form = response.data; this.open = true;
this.open = true; this.title = "修改细分产业";
this.title = "修改细分产业";
});
}, },
/** 提交按钮 */ /** 提交按钮 */
// submitForm
submitForm: function () { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
//
const submitData = {
...this.form,
createBy: '',
createId: 0,
id: 0,
createTime: '',
updateBy: '',
updateId: 0,
updateTime: ''
};
// 便
console.log('准备提交的数据:', JSON.stringify(submitData, null, 2));
if (this.form.id !== undefined) { if (this.form.id !== undefined) {
updateXfcygl(submitData).then(response => { updateXfcygl(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}).catch(error => { }).catch(error => {
console.error('修改失败:', error); console.error('API Request Error:', error);
}); });
} else { } else {
addXfcygl(submitData).then(response => { addXfcygl(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}).catch(error => { }).catch(error => {
console.error('新增失败:', error); console.error('API Request Error:', error);
}); });
} }
} }
}); });
}, },
//
reset() {
this.form = {
id: undefined,
cylb: undefined,
cyxf: undefined,
ycljschj: undefined,
slsyx: undefined,
createBy: this.$store.state.user.name,
createId: this.$store.state.user.userId,
createTime: undefined, //
updateBy: this.$store.state.user.name,
updateId: this.$store.state.user.userId,
updateTime: undefined //
};
this.resetForm("form");
},
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const catalogIds = row.id || this.ids;
this.$modal.confirm('是否确认删除ID为"' + ids + '"的数据项?' + '删除这条信息之后有可能找不回来了,请思考一下哟!').then(function () { this.$modal.confirm('是否确认删除项目知识库编号为"' + catalogIds + '"的数据项?').then(() => {
return deleteXfcygl([ids]); return deleteXfcygl([catalogIds]);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => { }); }).catch(() => { });
}, },
/** 导出按钮操作 */ //
handleExport() { handleImport() {
this.download('/gysl/xfcygl/exportXfcy', { this.upload.open = true;
...this.queryParams },
}, `细分产业管理${new Date().getTime()}.xlsx`); /** 下载模板操作 */
} importTemplate() {
this.download(
"/tc/assetCurrent/importTemplate",
{},
`目录导入模板${new Date().getTime()}.xlsx`
);
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
},
} }
}; };
</script> </script>
@ -392,5 +436,8 @@ export default {
.tablebtntwo { .tablebtntwo {
margin-top: 1rem; margin-top: 1rem;
margin-bottom: 1rem; margin-bottom: 1rem;
width: 100%;
display: flex;
justify-content: space-between;
} }
</style> </style>

@ -0,0 +1,47 @@
upload: {
open: false,
isUploading: false,
headers: { Authorization: "Bearer " + getToken() },
url: process.env.VUE_APP_BASE_API + "/gysl/ml/importMl"
}
/** 导出按钮操作 */
handleExport() {
console.log('【导出参数】', JSON.stringify(this.queryParams, null, 2));
this.$modal.confirm('确认导出所有数据?').then(() => {
return exportCatalog(this.queryParams);
}).then(response => {
this.download(response.msg);
}).catch(error => {
console.error('导出失败:', error);
});
},
/** 导入按钮操作 */
handleImport() {
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download("/gysl/ml/importTemplate", {}, `目录导入模板_${new Date().getTime()}.xlsx`);
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}

@ -37,7 +37,8 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://192.168.0.112:7071/`, // target: `http://192.168.0.112:7071/`,
target: `http://39.101.188.84:7071/`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save