|
|
@ -2,40 +2,74 @@
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<!-- 表单查询项 -->
|
|
|
|
<!-- 表单查询项 -->
|
|
|
|
<div class="headerbox">
|
|
|
|
<div class="headerbox">
|
|
|
|
<el-form ref="queryForm" :model="queryParams" size="small" label-width="100px">
|
|
|
|
<el-form
|
|
|
|
|
|
|
|
ref="queryForm"
|
|
|
|
|
|
|
|
:model="queryParams"
|
|
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
|
|
label-width="100px"
|
|
|
|
|
|
|
|
>
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="5">
|
|
|
|
<el-col :span="5">
|
|
|
|
<el-form-item label="上楼目录类别" prop="slmllb">
|
|
|
|
<el-form-item label="上楼目录类别" prop="slmllb">
|
|
|
|
<el-select v-model="queryParams.slmllb" placeholder="请选择上楼目录类别">
|
|
|
|
<el-select
|
|
|
|
<el-option v-for="dict in dict.type.shangloumulu" :key="dict.value" :label="dict.label"
|
|
|
|
v-model="queryParams.slmllb"
|
|
|
|
:value="dict.value"></el-option>
|
|
|
|
placeholder="请选择上楼目录类别"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="dict in dict.type.shangloumulu"
|
|
|
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
|
|
|
></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="5">
|
|
|
|
<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="请输入工业大类" :fetch-suggestions="querySearchAsync"
|
|
|
|
<el-input
|
|
|
|
@keyup.enter.native="handleQuery" />
|
|
|
|
v-model="queryParams.gydl"
|
|
|
|
|
|
|
|
placeholder="请输入工业大类"
|
|
|
|
|
|
|
|
: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">
|
|
|
|
<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="请输入产业" style="width: 20.5rem;"
|
|
|
|
<el-input
|
|
|
|
@keyup.enter.native="handleQuery" />
|
|
|
|
v-model="queryParams.cy"
|
|
|
|
|
|
|
|
placeholder="请输入产业"
|
|
|
|
|
|
|
|
style="width: 20.5rem"
|
|
|
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="3">
|
|
|
|
<el-col :span="3">
|
|
|
|
<el-form-item label="更新时间" prop="updateTime">
|
|
|
|
<el-form-item label="更新时间" prop="updateTime">
|
|
|
|
<el-date-picker v-model="queryParams.startTime" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
|
|
|
|
<el-date-picker
|
|
|
|
:style="{ width: '13.5rem' }" placeholder="选择日期" clearable />
|
|
|
|
v-model="queryParams.startTime"
|
|
|
|
|
|
|
|
type="date"
|
|
|
|
|
|
|
|
format="yyyy-MM-dd"
|
|
|
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
|
|
|
:style="{ width: '13.5rem' }"
|
|
|
|
|
|
|
|
placeholder="选择日期"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-form-item style="margin-left: -100px;">
|
|
|
|
<el-form-item style="margin-left: -100px">
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
|
|
|
|
<el-button
|
|
|
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
|
|
type="primary"
|
|
|
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
|
|
|
@click="handleQuery"
|
|
|
|
|
|
|
|
>查询</el-button
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-button icon="el-icon-refresh" @click="resetQuery"
|
|
|
|
|
|
|
|
>重置</el-button
|
|
|
|
|
|
|
|
>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
@ -48,55 +82,109 @@
|
|
|
|
<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" @click="handleAdd">新增</el-button>
|
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"
|
|
|
|
|
|
|
|
>新增</el-button
|
|
|
|
|
|
|
|
>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<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-download" @click="handleImport">导入</el-button>
|
|
|
|
<el-button
|
|
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
|
|
icon="el-icon-download"
|
|
|
|
|
|
|
|
@click="handleImport"
|
|
|
|
|
|
|
|
>导入</el-button
|
|
|
|
|
|
|
|
>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-button type="primary" icon="el-icon-upload2" @click="handleExport">全量导出</el-button>
|
|
|
|
<el-button
|
|
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
|
|
icon="el-icon-upload2"
|
|
|
|
|
|
|
|
@click="handleExport"
|
|
|
|
|
|
|
|
>全量导出</el-button
|
|
|
|
|
|
|
|
>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</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">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
{{ (queryParams.current - 1) * queryParams.size + scope.$index + 1 }}
|
|
|
|
{{
|
|
|
|
|
|
|
|
(queryParams.current - 1) * queryParams.size + scope.$index + 1
|
|
|
|
|
|
|
|
}}
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="上楼目录类别" align="center">
|
|
|
|
<el-table-column label="上楼目录类别" align="center">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<dict-tag :options="dict.type.shangloumulu" :value="scope.row.slmllb" />
|
|
|
|
<dict-tag
|
|
|
|
|
|
|
|
:options="dict.type.shangloumulu"
|
|
|
|
|
|
|
|
:value="scope.row.slmllb"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</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
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
label="更新时间"
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="updateTime"
|
|
|
|
|
|
|
|
width="180"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
label="操作"
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
class-name="small-padding fixed-width"
|
|
|
|
|
|
|
|
>
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-button type="text" @click="handleUpdate(scope.row)">编辑</el-button>
|
|
|
|
<el-button type="text" @click="handleUpdate(scope.row)"
|
|
|
|
<el-button type="text" @click="handleDelete(scope.row)" style="color: red;">删除</el-button>
|
|
|
|
>编辑</el-button
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
|
|
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.current" :limit.sync="queryParams.size"
|
|
|
|
<pagination
|
|
|
|
@pagination="getList" />
|
|
|
|
v-show="total > 0"
|
|
|
|
|
|
|
|
:total="total"
|
|
|
|
|
|
|
|
:page.sync="queryParams.current"
|
|
|
|
|
|
|
|
:limit.sync="queryParams.size"
|
|
|
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改项目对话框 -->
|
|
|
|
<!-- 添加或修改项目对话框 -->
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="40rem" 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="7rem">
|
|
|
|
<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
|
|
|
|
<el-option v-for="dict in dict.type.shangloumulu" :key="dict.value" :label="dict.label"
|
|
|
|
v-model="form.slmllb"
|
|
|
|
:value="parseInt(dict.value)" />
|
|
|
|
placeholder="请选择上楼目录类别"
|
|
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="dict in dict.type.shangloumulu"
|
|
|
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
|
|
|
:value="parseInt(dict.value)"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</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" />
|
|
|
|
<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" />
|
|
|
|
<el-input v-model="form.cy" placeholder="请输入产业" maxlength="50" />
|
|
|
@ -109,16 +197,35 @@
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 导入对话框 -->
|
|
|
|
<!-- 导入对话框 -->
|
|
|
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
|
<el-dialog
|
|
|
|
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
|
|
|
|
:title="upload.title"
|
|
|
|
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
|
|
|
|
:visible.sync="upload.open"
|
|
|
|
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
|
|
|
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"
|
|
|
|
|
|
|
|
: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>仅允许导入xls、xlsx格式文件。</span>
|
|
|
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
|
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
|
|
|
|
<el-link
|
|
|
|
@click="importTemplate">下载模板</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">
|
|
|
@ -126,19 +233,23 @@
|
|
|
|
<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 { getToken } from "@/utils/auth";
|
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
|
import { getAllCatalogs, addCatalog, editCatalog, deleteCatalog } from "@/api/ManageApi/index";
|
|
|
|
import {
|
|
|
|
import fileload from "@/components/FileUpload/index.vue"
|
|
|
|
getAllCatalogs,
|
|
|
|
|
|
|
|
addCatalog,
|
|
|
|
|
|
|
|
editCatalog,
|
|
|
|
|
|
|
|
deleteCatalog,
|
|
|
|
|
|
|
|
} from "@/api/ManageApi/index";
|
|
|
|
|
|
|
|
import fileload from "@/components/FileUpload/index.vue";
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
dicts: ['shangloumulu'],
|
|
|
|
dicts: ["shangloumulu"],
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
fileload
|
|
|
|
fileload,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -168,7 +279,7 @@ export default {
|
|
|
|
size: 10,
|
|
|
|
size: 10,
|
|
|
|
gydl: undefined,
|
|
|
|
gydl: undefined,
|
|
|
|
slmllb: undefined,
|
|
|
|
slmllb: undefined,
|
|
|
|
startTime: undefined
|
|
|
|
startTime: undefined,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 表单参数
|
|
|
|
// 表单参数
|
|
|
|
form: {
|
|
|
|
form: {
|
|
|
@ -181,15 +292,19 @@ export default {
|
|
|
|
createTime: undefined,
|
|
|
|
createTime: undefined,
|
|
|
|
updateBy: undefined,
|
|
|
|
updateBy: undefined,
|
|
|
|
updateId: undefined,
|
|
|
|
updateId: undefined,
|
|
|
|
updateTime: undefined
|
|
|
|
updateTime: undefined,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 表单校验
|
|
|
|
// 表单校验
|
|
|
|
rules: {
|
|
|
|
rules: {
|
|
|
|
gydl: [
|
|
|
|
gydl: [
|
|
|
|
{ required: true, message: "文件名称不能为空", trigger: "blur" }
|
|
|
|
{ required: true, message: "文件名称不能为空", trigger: "blur" },
|
|
|
|
],
|
|
|
|
],
|
|
|
|
slmllb: [
|
|
|
|
slmllb: [
|
|
|
|
{ required: true, message: "上楼目录类别不能为空", trigger: "change" }
|
|
|
|
{
|
|
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
|
|
message: "上楼目录类别不能为空",
|
|
|
|
|
|
|
|
trigger: "change",
|
|
|
|
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 上楼目录类别映射
|
|
|
|
// 上楼目录类别映射
|
|
|
@ -218,32 +333,55 @@ export default {
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
|
|
querySearchAsync(queryString, cb) {
|
|
|
|
querySearchAsync(queryString, cb) {
|
|
|
|
let results = [];
|
|
|
|
let results = [];
|
|
|
|
getAllCatalogs({ gydl: queryString }).then(res => {
|
|
|
|
getAllCatalogs({ gydl: queryString }).then((res) => {
|
|
|
|
res.data.records.forEach(item => {
|
|
|
|
res.data.records.forEach((item) => {
|
|
|
|
results.push({
|
|
|
|
results.push({
|
|
|
|
value: item.gydl,
|
|
|
|
value: item.gydl,
|
|
|
|
id: item.id,
|
|
|
|
id: item.id,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
cb(results);
|
|
|
|
cb(results);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 查询目录列表
|
|
|
|
// 查询目录列表
|
|
|
|
getList() {
|
|
|
|
async getList(deleteId) {
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
getAllCatalogs(this.queryParams).then(response => {
|
|
|
|
if (deleteId) {
|
|
|
|
this.postList = response.data.records.map(item => ({
|
|
|
|
await getAllCatalogs(this.queryParams)
|
|
|
|
...item,
|
|
|
|
.then((response) => {
|
|
|
|
}));
|
|
|
|
if (
|
|
|
|
this.total = response.data.total;
|
|
|
|
response.data.records &&
|
|
|
|
this.loading = false;
|
|
|
|
response.data.records.length === 0 &&
|
|
|
|
}).catch(error => {
|
|
|
|
this.queryParams.current > 1
|
|
|
|
this.loading = false;
|
|
|
|
) {
|
|
|
|
});
|
|
|
|
this.queryParams.current = this.queryParams.current - 1;
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.postList = response.data.records.map((item) => ({
|
|
|
|
|
|
|
|
...item,
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
this.total = response.data.total;
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
getAllCatalogs(this.queryParams)
|
|
|
|
|
|
|
|
.then((response) => {
|
|
|
|
|
|
|
|
this.postList = response.data.records.map((item) => ({
|
|
|
|
|
|
|
|
...item,
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
this.total = response.data.total;
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 取消按钮
|
|
|
|
// 取消按钮
|
|
|
|
cancel() {
|
|
|
|
cancel() {
|
|
|
@ -262,7 +400,7 @@ export default {
|
|
|
|
createTime: undefined,
|
|
|
|
createTime: undefined,
|
|
|
|
updateBy: undefined,
|
|
|
|
updateBy: undefined,
|
|
|
|
updateId: undefined,
|
|
|
|
updateId: undefined,
|
|
|
|
updateTime: undefined
|
|
|
|
updateTime: undefined,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.resetForm("form");
|
|
|
|
this.resetForm("form");
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -278,7 +416,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 多选框选中数据
|
|
|
|
// 多选框选中数据
|
|
|
|
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;
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -298,24 +436,28 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 提交按钮 */
|
|
|
|
/** 提交按钮 */
|
|
|
|
submitForm: function () {
|
|
|
|
submitForm: function () {
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
|
if (valid) {
|
|
|
|
if (valid) {
|
|
|
|
if (this.form.id !== undefined) {
|
|
|
|
if (this.form.id !== undefined) {
|
|
|
|
editCatalog(this.form).then(response => {
|
|
|
|
editCatalog(this.form)
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
.then((response) => {
|
|
|
|
this.open = false;
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
this.getList();
|
|
|
|
this.open = false;
|
|
|
|
}).catch(error => {
|
|
|
|
this.getList();
|
|
|
|
console.error('API Request Error:', error);
|
|
|
|
})
|
|
|
|
});
|
|
|
|
.catch((error) => {
|
|
|
|
|
|
|
|
console.error("API Request Error:", error);
|
|
|
|
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
addCatalog(this.form).then(response => {
|
|
|
|
addCatalog(this.form)
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
.then((response) => {
|
|
|
|
this.open = false;
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
this.getList();
|
|
|
|
this.open = false;
|
|
|
|
}).catch(error => {
|
|
|
|
this.getList();
|
|
|
|
console.error('API Request Error:', error);
|
|
|
|
})
|
|
|
|
});
|
|
|
|
.catch((error) => {
|
|
|
|
|
|
|
|
console.error("API Request Error:", error);
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -323,12 +465,16 @@ export default {
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
handleDelete(row) {
|
|
|
|
handleDelete(row) {
|
|
|
|
const catalogIds = row.id || this.ids;
|
|
|
|
const catalogIds = row.id || this.ids;
|
|
|
|
this.$modal.confirm('是否确认删除该数据项?').then(() => {
|
|
|
|
this.$modal
|
|
|
|
return deleteCatalog([catalogIds]);
|
|
|
|
.confirm("是否确认删除该数据项?")
|
|
|
|
}).then(() => {
|
|
|
|
.then(() => {
|
|
|
|
this.getList();
|
|
|
|
return deleteCatalog([catalogIds]);
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
})
|
|
|
|
}).catch(() => { });
|
|
|
|
.then(() => {
|
|
|
|
|
|
|
|
this.getList(catalogIds);
|
|
|
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(() => {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/**导出 */
|
|
|
|
/**导出 */
|
|
|
|
handleExport() {
|
|
|
|
handleExport() {
|
|
|
@ -363,8 +509,8 @@ export default {
|
|
|
|
this.$refs.upload.clearFiles();
|
|
|
|
this.$refs.upload.clearFiles();
|
|
|
|
this.$alert(
|
|
|
|
this.$alert(
|
|
|
|
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
|
|
|
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
|
|
|
response.msg +
|
|
|
|
response.msg +
|
|
|
|
"</div>",
|
|
|
|
"</div>",
|
|
|
|
"导入结果",
|
|
|
|
"导入结果",
|
|
|
|
{ dangerouslyUseHTMLString: true }
|
|
|
|
{ dangerouslyUseHTMLString: true }
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -374,24 +520,24 @@ export default {
|
|
|
|
submitFileForm() {
|
|
|
|
submitFileForm() {
|
|
|
|
this.$refs.upload.submit();
|
|
|
|
this.$refs.upload.submit();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
<style scoped>
|
|
|
|
.headerbox {
|
|
|
|
.headerbox {
|
|
|
|
background-color: #fff;
|
|
|
|
background-color: #fff;
|
|
|
|
border-radius: .5rem;
|
|
|
|
border-radius: 0.5rem;
|
|
|
|
padding: 1rem;
|
|
|
|
padding: 1rem;
|
|
|
|
margin: .5rem;
|
|
|
|
margin: 0.5rem;
|
|
|
|
border: 1px solid #eee;
|
|
|
|
border: 1px solid #eee;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tablebox {
|
|
|
|
.tablebox {
|
|
|
|
background-color: #fff;
|
|
|
|
background-color: #fff;
|
|
|
|
border-radius: .5rem;
|
|
|
|
border-radius: 0.5rem;
|
|
|
|
padding: 1rem;
|
|
|
|
padding: 1rem;
|
|
|
|
margin: .5rem;
|
|
|
|
margin: 0.5rem;
|
|
|
|
border: 1px solid #eee;
|
|
|
|
border: 1px solid #eee;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -412,4 +558,4 @@ export default {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|