|
|
@ -32,7 +32,7 @@
|
|
|
|
<el-form-item label="系统类型:" prop="xtlx">
|
|
|
|
<el-form-item label="系统类型:" prop="xtlx">
|
|
|
|
<el-select v-model="formInline.xtlx" placeholder="请选择系统类型">
|
|
|
|
<el-select v-model="formInline.xtlx" placeholder="请选择系统类型">
|
|
|
|
<el-option
|
|
|
|
<el-option
|
|
|
|
v-for="dict in dict.type.zc_xtlx"
|
|
|
|
v-for="dict in zc_xtlx"
|
|
|
|
:key="dict.value"
|
|
|
|
:key="dict.value"
|
|
|
|
:label="dict.label"
|
|
|
|
:label="dict.label"
|
|
|
|
:value="dict.value">
|
|
|
|
:value="dict.value">
|
|
|
@ -65,7 +65,7 @@
|
|
|
|
<el-form-item label="系统状态:" prop="xtzt">
|
|
|
|
<el-form-item label="系统状态:" prop="xtzt">
|
|
|
|
<el-select v-model="formInline.xtzt" placeholder="请选择系统状态">
|
|
|
|
<el-select v-model="formInline.xtzt" placeholder="请选择系统状态">
|
|
|
|
<el-option
|
|
|
|
<el-option
|
|
|
|
v-for="dict in dict.type.zc_xtzt"
|
|
|
|
v-for="dict in zc_xtzt"
|
|
|
|
:key="dict.value"
|
|
|
|
:key="dict.value"
|
|
|
|
:label="dict.label"
|
|
|
|
:label="dict.label"
|
|
|
|
:value="dict.value">
|
|
|
|
:value="dict.value">
|
|
|
@ -75,8 +75,8 @@
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="9" style="text-align: right;padding-right: 35px;">
|
|
|
|
<el-col :span="9" style="text-align: right;padding-right: 35px;">
|
|
|
|
<el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button size="mini" @click="resetQuery('queryFrom')">重置</el-button>
|
|
|
|
<el-button size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
<el-button size="mini" type="primary" @click="handleQuery('queryFrom')">查询</el-button>
|
|
|
|
<el-button size="mini" type="primary" @click="handleQuery">查询</el-button>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
@ -90,7 +90,7 @@
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="info"
|
|
|
|
type="info"
|
|
|
|
plain
|
|
|
|
plain
|
|
|
|
icon="el-icon-upload2"
|
|
|
|
icon="Upload"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
@click="handleImport"
|
|
|
|
@click="handleImport"
|
|
|
|
>导入</el-button>
|
|
|
|
>导入</el-button>
|
|
|
@ -99,7 +99,7 @@
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="warning"
|
|
|
|
type="warning"
|
|
|
|
plain
|
|
|
|
plain
|
|
|
|
icon="el-icon-download"
|
|
|
|
icon="Download"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
@click="handleExport"
|
|
|
|
@click="handleExport"
|
|
|
|
>导出</el-button>
|
|
|
|
>导出</el-button>
|
|
|
@ -108,7 +108,7 @@
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="primary"
|
|
|
|
type="primary"
|
|
|
|
plain
|
|
|
|
plain
|
|
|
|
icon="el-icon-plus"
|
|
|
|
icon="Plus"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
@click="handleAdd"
|
|
|
|
@click="handleAdd"
|
|
|
|
>新增资产</el-button>
|
|
|
|
>新增资产</el-button>
|
|
|
@ -120,51 +120,35 @@
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"/>
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"/>
|
|
|
|
<el-table-column label="系统名称" key="xtmc" width="200px" prop="xtmc" align="center" />
|
|
|
|
<el-table-column label="系统名称" key="xtmc" width="200px" prop="xtmc" align="center" />
|
|
|
|
<el-table-column label="系统类型" key="xtlx" prop="xtlx" align="center">
|
|
|
|
<el-table-column label="系统类型" key="xtlx" prop="xtlx" align="center">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<dict-tag :options="dict.type.zc_xtlx" :value="scope.row.xtlx"/>
|
|
|
|
<dict-tag :options="zc_xtlx" :value="scope.row.xtlx"/>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="单位名称" key="dwmc" prop="dwmc" align="center">
|
|
|
|
<el-table-column label="单位名称" key="dwmc" prop="dwmc" align="center" />
|
|
|
|
<!-- <template slot-scope="scope">
|
|
|
|
|
|
|
|
<dict-tag :options="dict.type.project_middle_type" :value="scope.row.projectMiddleType"/>
|
|
|
|
|
|
|
|
</template> -->
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column label="新增时间" key="createTime" prop="createTime" align="center" />
|
|
|
|
<el-table-column label="新增时间" key="createTime" prop="createTime" align="center" />
|
|
|
|
<el-table-column label="系统状态" key="status" prop="status" class-name="table-status" align="center">
|
|
|
|
<el-table-column label="系统状态" key="status" prop="status" class-name="table-status" align="center">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<span v-if="scope.row.xtzt == 1" style="color: #16B771;">
|
|
|
|
<span v-if="scope.row.xtzt == 1" style="color: #16B771;">已安装</span>
|
|
|
|
已安装
|
|
|
|
<span v-if="scope.row.xtzt == 2" style="color: #F58A0C;">测试中</span>
|
|
|
|
</span>
|
|
|
|
<span v-if="scope.row.xtzt == 3" style="color: #1485EF;">使用中</span>
|
|
|
|
<span v-if="scope.row.xtzt == 2" style="color: #F58A0C;">
|
|
|
|
<span v-if="scope.row.xtzt == 4" style="color: #29A07A;">维护中</span>
|
|
|
|
测试中
|
|
|
|
<span v-if="scope.row.xtzt == 5" style="color: #F50C0C;">关停</span>
|
|
|
|
</span>
|
|
|
|
<span v-if="scope.row.xtzt == 6" style="color: #F50C0C;">备用</span>
|
|
|
|
<span v-if="scope.row.xtzt == 3" style="color: #1485EF;">
|
|
|
|
|
|
|
|
使用中
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span v-if="scope.row.xtzt == 4" style="color: #29A07A;">
|
|
|
|
|
|
|
|
维护中
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span v-if="scope.row.xtzt == 5" style="color: #F50C0C;">
|
|
|
|
|
|
|
|
关停
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span v-if="scope.row.xtzt == 6" style="color: #F50C0C;">
|
|
|
|
|
|
|
|
备用
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="操作" prop="userId" class-name="table-operation" align="center">
|
|
|
|
<el-table-column label="操作" prop="userId" class-name="table-operation" align="center">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<div style="display: flex;align-items: center;justify-content: center;">
|
|
|
|
<div style="display: flex;align-items: center;justify-content: center;">
|
|
|
|
<div style="display: flex;align-items: center;cursor: pointer;" @click="goInfo(scope.row,1)">
|
|
|
|
<div style="display: flex;align-items: center;cursor: pointer;" @click="goInfo(scope.row,1)">
|
|
|
|
<img src="@/assets/images/icon-ck@2x.png" alt="" style="width: 20px;margin-right: 5px;">
|
|
|
|
<el-icon><View /></el-icon>
|
|
|
|
<span class="look-info" style="color: #1485EF;margin-right: 15px;">查看</span>
|
|
|
|
<span class="look-info" style="color: #1485EF;margin-right: 15px;">查看</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display: flex;align-items: center;cursor: pointer;" @click="goInfo(scope.row,2)">
|
|
|
|
<div style="display: flex;align-items: center;cursor: pointer;" @click="goInfo(scope.row,2)">
|
|
|
|
<img src="@/assets/images/edit.png" alt="" style="width: 15px;margin-right: 5px;">
|
|
|
|
<el-icon><Edit /></el-icon>
|
|
|
|
<span class="look-info" style="color: #1485EF;margin-right: 15px;">编辑</span>
|
|
|
|
<span class="look-info" style="color: #1485EF;margin-right: 15px;">编辑</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="display: flex;align-items: center;cursor: pointer;" @click="goInfo(scope.row,3)">
|
|
|
|
<div style="display: flex;align-items: center;cursor: pointer;" @click="goInfo(scope.row,3)">
|
|
|
|
<img src="@/assets/images/del.png" alt="" style="width: 20px;margin-right: 5px;">
|
|
|
|
<el-icon><Delete /></el-icon>
|
|
|
|
<span class="look-info" style="color: #F50C0C;margin-right: 15px;">删除</span>
|
|
|
|
<span class="look-info" style="color: #F50C0C;margin-right: 15px;">删除</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -178,11 +162,16 @@
|
|
|
|
:page="formInline.current"
|
|
|
|
:page="formInline.current"
|
|
|
|
:limit="formInline.size"
|
|
|
|
:limit="formInline.size"
|
|
|
|
@pagination="getPagination"
|
|
|
|
@pagination="getPagination"
|
|
|
|
:current-page.sync="formInline.current"
|
|
|
|
v-model:current-page="formInline.current"
|
|
|
|
></my-pagination>
|
|
|
|
/>
|
|
|
|
</main>
|
|
|
|
</main>
|
|
|
|
<!-- 资产导入对话框 -->
|
|
|
|
<!-- 资产导入对话框 -->
|
|
|
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
|
<el-dialog
|
|
|
|
|
|
|
|
v-model="upload.open"
|
|
|
|
|
|
|
|
:title="upload.title"
|
|
|
|
|
|
|
|
width="400px"
|
|
|
|
|
|
|
|
append-to-body
|
|
|
|
|
|
|
|
>
|
|
|
|
<el-upload
|
|
|
|
<el-upload
|
|
|
|
ref="upload"
|
|
|
|
ref="upload"
|
|
|
|
:limit="1"
|
|
|
|
:limit="1"
|
|
|
@ -195,230 +184,268 @@
|
|
|
|
:auto-upload="false"
|
|
|
|
:auto-upload="false"
|
|
|
|
drag
|
|
|
|
drag
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<i class="el-icon-upload"></i>
|
|
|
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
|
|
|
<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">
|
|
|
|
<template #tip>
|
|
|
|
<!-- <div class="el-upload__tip" slot="tip">
|
|
|
|
<div class="el-upload__tip">
|
|
|
|
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
|
|
|
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
|
</div> -->
|
|
|
|
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
|
|
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
|
</div>
|
|
|
|
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-upload>
|
|
|
|
</el-upload>
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<template #footer>
|
|
|
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
|
<div class="dialog-footer">
|
|
|
|
<el-button @click="upload.open = false">取 消</el-button>
|
|
|
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
|
</div>
|
|
|
|
<el-button @click="upload.open = false">取 消</el-button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
<script setup>
|
|
|
|
|
|
|
|
import { ref, reactive, onMounted, onUnmounted, getCurrentInstance } from 'vue'
|
|
|
|
|
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
import myPagination from "@/views/components/Pagination/index.vue"
|
|
|
|
import myPagination from "@/views/components/Pagination/index.vue"
|
|
|
|
// import myDialog from "@/views/components/myDialog/index.vue"
|
|
|
|
import { getToken } from "@/utils/auth"
|
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
|
import { assetUnit, deleteAssetInfo, schema } from "@/api/auditPagesApi/index"
|
|
|
|
import { assetUnit, deleteAssetInfo, schema } from "@/api/auditPagesApi/index";
|
|
|
|
import { useDict } from '@/utils/dict'
|
|
|
|
export default {
|
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
dicts: ['zc_xtzt','zc_xtlx'],
|
|
|
|
import {
|
|
|
|
components:{myPagination},
|
|
|
|
View,
|
|
|
|
data() {
|
|
|
|
Edit,
|
|
|
|
return {
|
|
|
|
Delete,
|
|
|
|
// 部门树选项
|
|
|
|
Upload,
|
|
|
|
deptOptions: undefined,
|
|
|
|
Download,
|
|
|
|
defaultProps: {
|
|
|
|
Plus,
|
|
|
|
children: "children",
|
|
|
|
UploadFilled
|
|
|
|
label: "label"
|
|
|
|
} from '@element-plus/icons-vue'
|
|
|
|
},
|
|
|
|
|
|
|
|
formInline:{
|
|
|
|
const { proxy } = getCurrentInstance()
|
|
|
|
xtmc:"",
|
|
|
|
const router = useRouter()
|
|
|
|
xtlx:"",
|
|
|
|
|
|
|
|
time:[],
|
|
|
|
// 字典数据
|
|
|
|
startTime:"",
|
|
|
|
const { zc_xtzt, zc_xtlx } = useDict('zc_xtzt', 'zc_xtlx')
|
|
|
|
endTime:"",
|
|
|
|
|
|
|
|
dwmc:"",
|
|
|
|
// 部门树选项
|
|
|
|
xtzt:"",
|
|
|
|
const deptOptions = ref()
|
|
|
|
current:1,
|
|
|
|
const tree = ref(null)
|
|
|
|
size:20,
|
|
|
|
|
|
|
|
},
|
|
|
|
const defaultProps = {
|
|
|
|
total:0,
|
|
|
|
children: "children",
|
|
|
|
tableData:[],
|
|
|
|
label: "label"
|
|
|
|
loading:false,
|
|
|
|
}
|
|
|
|
tabHeader: undefined,
|
|
|
|
|
|
|
|
// 用户导入参数
|
|
|
|
const formInline = reactive({
|
|
|
|
upload: {
|
|
|
|
xtmc: "",
|
|
|
|
// 是否显示弹出层(用户导入)
|
|
|
|
xtlx: "",
|
|
|
|
open: false,
|
|
|
|
time: [],
|
|
|
|
// 弹出层标题(用户导入)
|
|
|
|
startTime: "",
|
|
|
|
title: "web资产导入",
|
|
|
|
endTime: "",
|
|
|
|
// 是否禁用上传
|
|
|
|
dwmc: "",
|
|
|
|
isUploading: false,
|
|
|
|
xtzt: "",
|
|
|
|
// 是否更新已经存在的用户数据
|
|
|
|
current: 1,
|
|
|
|
updateSupport: 0,
|
|
|
|
size: 20,
|
|
|
|
// 设置上传的请求头部
|
|
|
|
})
|
|
|
|
headers: { Authorization: "Bearer " + getToken() },
|
|
|
|
|
|
|
|
// 上传的地址
|
|
|
|
const total = ref(0)
|
|
|
|
// url: process.env.VUE_APP_BASE_API + "/tc/assetCurrent/import"
|
|
|
|
const tableData = ref([])
|
|
|
|
url: location.origin + "/api/tc/assetCurrent/importData"
|
|
|
|
const loading = ref(false)
|
|
|
|
},
|
|
|
|
const tabHeader = ref()
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
// 用户导入参数
|
|
|
|
mounted(){
|
|
|
|
const upload = reactive({
|
|
|
|
if( Object.keys(this.$route.params).length != 0) {
|
|
|
|
// 是否显示弹出层(用户导入)
|
|
|
|
console.log(this.$route.params,"params");
|
|
|
|
open: false,
|
|
|
|
|
|
|
|
// 弹出层标题(用户导入)
|
|
|
|
this.formInline = this.$route.params;
|
|
|
|
title: "web资产导入",
|
|
|
|
}else{
|
|
|
|
// 是否禁用上传
|
|
|
|
this.formInline.current = 1
|
|
|
|
isUploading: false,
|
|
|
|
this.formInline.size = 20
|
|
|
|
// 是否更新已经存在的用户数据
|
|
|
|
|
|
|
|
updateSupport: 0,
|
|
|
|
|
|
|
|
// 设置上传的请求头部
|
|
|
|
|
|
|
|
headers: { Authorization: "Bearer " + getToken() },
|
|
|
|
|
|
|
|
// 上传的地址
|
|
|
|
|
|
|
|
url: location.origin + "/api/tc/assetCurrent/importData"
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 查询部门下拉树结构 */
|
|
|
|
|
|
|
|
const getDeptTree = () => {
|
|
|
|
|
|
|
|
schema({type:0}).then(response => {
|
|
|
|
|
|
|
|
deptOptions.value = response.data
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 筛选节点
|
|
|
|
|
|
|
|
const filterNode = (value, data) => {
|
|
|
|
|
|
|
|
if (!value) return true
|
|
|
|
|
|
|
|
return data.label.indexOf(value) !== -1
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 节点单击事件
|
|
|
|
|
|
|
|
const handleNodeClick = (data) => {
|
|
|
|
|
|
|
|
formInline.deptId = data.id
|
|
|
|
|
|
|
|
handleQuery()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取列表
|
|
|
|
|
|
|
|
const getList = () => {
|
|
|
|
|
|
|
|
loading.value = true
|
|
|
|
|
|
|
|
assetUnit('get', formInline).then(res => {
|
|
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
|
|
total.value = res.data.total
|
|
|
|
|
|
|
|
tableData.value = res.data.records
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 重置
|
|
|
|
|
|
|
|
const resetQuery = () => {
|
|
|
|
|
|
|
|
proxy.$refs["queryForm"].resetFields()
|
|
|
|
|
|
|
|
formInline.deptId = undefined
|
|
|
|
|
|
|
|
tree.value.setCurrentKey(null)
|
|
|
|
|
|
|
|
handleQuery()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询
|
|
|
|
|
|
|
|
const handleQuery = () => {
|
|
|
|
|
|
|
|
formInline.current = 1
|
|
|
|
|
|
|
|
formInline.size = 20
|
|
|
|
|
|
|
|
if(formInline.time) {
|
|
|
|
|
|
|
|
formInline.startTime = formInline.time[0]
|
|
|
|
|
|
|
|
formInline.endTime = formInline.time[1]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
formInline.time = []
|
|
|
|
|
|
|
|
getList()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 页码获取
|
|
|
|
|
|
|
|
const getPagination = (pages) => {
|
|
|
|
|
|
|
|
formInline.current = pages.page
|
|
|
|
|
|
|
|
formInline.size = pages.limit
|
|
|
|
|
|
|
|
getList()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 导入
|
|
|
|
|
|
|
|
const handleImport = () => {
|
|
|
|
|
|
|
|
upload.open = true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 导出
|
|
|
|
|
|
|
|
const handleExport = () => {
|
|
|
|
|
|
|
|
proxy.download('/tc/assetCurrent/export', {
|
|
|
|
|
|
|
|
...formInline
|
|
|
|
|
|
|
|
}, `web资产${new Date().getTime()}.xlsx`)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 下载模板操作 */
|
|
|
|
|
|
|
|
const importTemplate = () => {
|
|
|
|
|
|
|
|
proxy.download('/tc/assetCurrent/importTemplate', {},
|
|
|
|
|
|
|
|
`web资产导入模板${new Date().getTime()}.xlsx`)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 文件上传中处理
|
|
|
|
|
|
|
|
const handleFileUploadProgress = () => {
|
|
|
|
|
|
|
|
upload.isUploading = true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 文件上传成功处理
|
|
|
|
|
|
|
|
const handleFileSuccess = (response, file, fileList) => {
|
|
|
|
|
|
|
|
upload.open = false
|
|
|
|
|
|
|
|
upload.isUploading = false
|
|
|
|
|
|
|
|
proxy.$refs.upload.clearFiles()
|
|
|
|
|
|
|
|
ElMessageBox.alert(
|
|
|
|
|
|
|
|
`<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>${response.msg}</div>`,
|
|
|
|
|
|
|
|
"导入结果",
|
|
|
|
|
|
|
|
{ dangerouslyUseHTMLString: true }
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
getList()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 提交上传文件
|
|
|
|
|
|
|
|
const submitFileForm = () => {
|
|
|
|
|
|
|
|
proxy.$refs.upload.submit()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 新增资产
|
|
|
|
|
|
|
|
const handleAdd = () => {
|
|
|
|
|
|
|
|
router.push({
|
|
|
|
|
|
|
|
name: 'AssetsAuth',
|
|
|
|
|
|
|
|
query: {
|
|
|
|
|
|
|
|
pageType: "add",
|
|
|
|
|
|
|
|
type: 0,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.getList();
|
|
|
|
})
|
|
|
|
this.getDeptTree();
|
|
|
|
}
|
|
|
|
this.cancalDebounce();
|
|
|
|
|
|
|
|
window.addEventListener('resize', this.cancalDebounce);
|
|
|
|
// 查看详情
|
|
|
|
},
|
|
|
|
const goInfo = (row, id) => {
|
|
|
|
destroyed() {
|
|
|
|
if(id === 1) {
|
|
|
|
window.removeEventListener('resize', this.cancalDebounce);
|
|
|
|
router.push({
|
|
|
|
},
|
|
|
|
name: 'AssetsAuth',
|
|
|
|
methods:{
|
|
|
|
query: {
|
|
|
|
/** 查询部门下拉树结构 */
|
|
|
|
pageType: "look",
|
|
|
|
getDeptTree() {
|
|
|
|
type: 0,
|
|
|
|
schema({type:0}).then(response => {
|
|
|
|
id: row.id,
|
|
|
|
this.deptOptions = response.data;
|
|
|
|
queryData: formInline,
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 筛选节点
|
|
|
|
|
|
|
|
filterNode(value, data) {
|
|
|
|
|
|
|
|
if (!value) return true;
|
|
|
|
|
|
|
|
return data.label.indexOf(value) !== -1;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 节点单击事件
|
|
|
|
|
|
|
|
handleNodeClick(data) {
|
|
|
|
|
|
|
|
this.formInline.deptId = data.id;
|
|
|
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 获取列表
|
|
|
|
|
|
|
|
getList(){
|
|
|
|
|
|
|
|
this.loading = true;
|
|
|
|
|
|
|
|
console.log(this.formInline);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assetUnit('get',this.formInline).then(res=>{
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
|
|
this.total = res.data.total;
|
|
|
|
|
|
|
|
this.tableData = res.data.records;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 重置
|
|
|
|
|
|
|
|
resetQuery(){
|
|
|
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
|
|
|
this.formInline.deptId = undefined;
|
|
|
|
|
|
|
|
this.$refs.tree.setCurrentKey(null);
|
|
|
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 查询
|
|
|
|
|
|
|
|
handleQuery(){
|
|
|
|
|
|
|
|
this.formInline.current = 1;
|
|
|
|
|
|
|
|
this.formInline.size = 20
|
|
|
|
|
|
|
|
if(this.formInline.time) {
|
|
|
|
|
|
|
|
this.formInline.startTime = this.formInline.time[0]
|
|
|
|
|
|
|
|
this.formInline.endTime = this.formInline.time[1]
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.formInline.time = [];
|
|
|
|
})
|
|
|
|
this.getList();
|
|
|
|
} else if(id === 2) {
|
|
|
|
},
|
|
|
|
router.push({
|
|
|
|
// 页码获取
|
|
|
|
name: 'AssetsAuth',
|
|
|
|
getPagination(pages){
|
|
|
|
query: {
|
|
|
|
this.formInline.current = pages.page;
|
|
|
|
pageType: "change",
|
|
|
|
this.formInline.size = pages.limit;
|
|
|
|
type: 0,
|
|
|
|
this.getList();
|
|
|
|
id: row.id,
|
|
|
|
},
|
|
|
|
queryData: formInline,
|
|
|
|
// 导入
|
|
|
|
|
|
|
|
handleImport(){
|
|
|
|
|
|
|
|
this.upload.open = true;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 导出
|
|
|
|
|
|
|
|
handleExport(){
|
|
|
|
|
|
|
|
this.download('/tc/assetCurrent/export', {
|
|
|
|
|
|
|
|
...this.formInline
|
|
|
|
|
|
|
|
}, `web资产${new Date().getTime()}.xlsx`)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/** 下载模板操作 */
|
|
|
|
|
|
|
|
importTemplate() {
|
|
|
|
|
|
|
|
this.download('/tc/assetCurrent/importTemplate', {
|
|
|
|
|
|
|
|
}, `web资产导入模板${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();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 新增资产
|
|
|
|
|
|
|
|
handleAdd(){
|
|
|
|
|
|
|
|
this.$router.push({name: 'AssetsAuth',query: {
|
|
|
|
|
|
|
|
pageType: "add",
|
|
|
|
|
|
|
|
type:0,
|
|
|
|
|
|
|
|
}})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 查看详情
|
|
|
|
|
|
|
|
goInfo(row,id){
|
|
|
|
|
|
|
|
console.log(this.formInline,'this.formInline')
|
|
|
|
|
|
|
|
// if(id == 1) {
|
|
|
|
|
|
|
|
// this.$router.push({name: 'AssetsAuth',query: {
|
|
|
|
|
|
|
|
// pageType: "look",
|
|
|
|
|
|
|
|
// type:0,
|
|
|
|
|
|
|
|
// id:row.id,
|
|
|
|
|
|
|
|
// queryData:this.formInline,
|
|
|
|
|
|
|
|
// }})
|
|
|
|
|
|
|
|
// } else if(id == 2) {
|
|
|
|
|
|
|
|
// this.$router.push({name: 'AssetsAuth',query: {
|
|
|
|
|
|
|
|
// pageType: "change",
|
|
|
|
|
|
|
|
// type:0,
|
|
|
|
|
|
|
|
// id:row.id,
|
|
|
|
|
|
|
|
// queryData:this.formInline,
|
|
|
|
|
|
|
|
// }})
|
|
|
|
|
|
|
|
// } else if(id == 3) {
|
|
|
|
|
|
|
|
// const userIds = row.id;
|
|
|
|
|
|
|
|
// this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
|
|
|
|
|
|
|
|
// return deleteAssetInfo(userIds);
|
|
|
|
|
|
|
|
// }).then(() => {
|
|
|
|
|
|
|
|
// this.getList();
|
|
|
|
|
|
|
|
// this.$modal.msgSuccess("删除成功");
|
|
|
|
|
|
|
|
// }).catch(() => {});
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 编辑
|
|
|
|
|
|
|
|
edit(){
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 删除
|
|
|
|
|
|
|
|
delInfo(){},
|
|
|
|
|
|
|
|
// 修改table背景色
|
|
|
|
|
|
|
|
tableRowClassName({row, rowIndex}){
|
|
|
|
|
|
|
|
if (rowIndex % 2 !== 0) {
|
|
|
|
|
|
|
|
return 'evenNumber-row';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return '';
|
|
|
|
})
|
|
|
|
},
|
|
|
|
} else if(id === 3) {
|
|
|
|
// 屏幕尺寸变化
|
|
|
|
const userIds = row.id
|
|
|
|
cancalDebounce(){
|
|
|
|
ElMessageBox.confirm(
|
|
|
|
const element = document.getElementById('L-size-main'); // 通过元素的 ID 获取元素
|
|
|
|
`是否确认删除用户编号为"${userIds}"的数据项?`
|
|
|
|
const header = document.getElementById('L-header'); // 通过元素的 ID 获取元素
|
|
|
|
).then(() => {
|
|
|
|
const pagination = document.getElementById('L-pagination'); // 通过元素的 ID 获取元素
|
|
|
|
return deleteAssetInfo(userIds)
|
|
|
|
const elementHeight = element.offsetHeight;
|
|
|
|
}).then(() => {
|
|
|
|
const headerHeight = header.offsetHeight;
|
|
|
|
getList()
|
|
|
|
const paginationtHeight = pagination.offsetHeight;
|
|
|
|
ElMessage.success("删除成功")
|
|
|
|
this.tabHeader = elementHeight - headerHeight - paginationtHeight - 110;
|
|
|
|
}).catch(() => {})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 修改table背景色
|
|
|
|
|
|
|
|
const tableRowClassName = ({rowIndex}) => {
|
|
|
|
|
|
|
|
if (rowIndex % 2 !== 0) {
|
|
|
|
|
|
|
|
return 'evenNumber-row'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return ''
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 屏幕尺寸变化
|
|
|
|
|
|
|
|
const cancalDebounce = () => {
|
|
|
|
|
|
|
|
const element = document.getElementById('L-size-main')
|
|
|
|
|
|
|
|
const header = document.getElementById('L-header')
|
|
|
|
|
|
|
|
const pagination = document.getElementById('L-pagination')
|
|
|
|
|
|
|
|
const elementHeight = element.offsetHeight
|
|
|
|
|
|
|
|
const headerHeight = header.offsetHeight
|
|
|
|
|
|
|
|
const paginationtHeight = pagination.offsetHeight
|
|
|
|
|
|
|
|
tabHeader.value = elementHeight - headerHeight - paginationtHeight - 110
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
|
|
if(Object.keys(router.currentRoute.value.params).length !== 0) {
|
|
|
|
|
|
|
|
Object.assign(formInline, router.currentRoute.value.params)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
formInline.current = 1
|
|
|
|
|
|
|
|
formInline.size = 20
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
getList()
|
|
|
|
|
|
|
|
getDeptTree()
|
|
|
|
|
|
|
|
cancalDebounce()
|
|
|
|
|
|
|
|
window.addEventListener('resize', cancalDebounce)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
|
|
|
|
window.removeEventListener('resize', cancalDebounce)
|
|
|
|
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|