处理自动填充问题

lijinlongNew
许宏杰 1 month ago
parent f6c1ca74b5
commit 81c15afe63

@ -1,8 +1,20 @@
<!-- 资产管理 -- 电子邮件 -->
<template>
<el-row :gutter="20" style="height: 100%;background-color: #F2F4F6;display: flex;">
<el-row
:gutter="20"
style="height: 100%; background-color: #f2f4f6; display: flex"
>
<!--部门数据-->
<el-col :span="3" :xs="24" style="margin-right: 10px;height: 100%; background-color: #fff;padding-top: 20px;">
<el-col
:span="3"
:xs="24"
style="
margin-right: 10px;
height: 100%;
background-color: #fff;
padding-top: 20px;
"
>
<div class="head-container">
<el-tree
:data="deptOptions"
@ -17,20 +29,32 @@
/>
</div>
</el-col>
<el-col :span="20" :xs="24" style="height: 100%;flex: 1;">
<el-col :span="20" :xs="24" style="height: 100%; flex: 1">
<div class="L-main" id="L-size-main">
<div class="content-search" id="L-header">
<div class="search-title">查询条件</div>
<el-form :inline="true" ref="queryForm" :model="formInline" size="small" class="demo-form-inline">
<el-form
:inline="true"
ref="queryForm"
:model="formInline"
size="small"
class="demo-form-inline"
>
<el-row>
<el-col :span="6">
<el-form-item label="所属单位:" prop="dwmc">
<el-input v-model="formInline.dwmc" placeholder="请输入所属单位"></el-input>
<el-input
v-model="formInline.dwmc"
placeholder="请输入所属单位"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="电子邮箱后缀:" prop="dzyxhz">
<el-input v-model="formInline.dzyxhz" placeholder="请输入电子邮箱后缀"></el-input>
<el-input
v-model="formInline.dzyxhz"
placeholder="请输入电子邮箱后缀"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
@ -47,10 +71,17 @@
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6" style="text-align: right;">
<el-col :span="6" style="text-align: right">
<el-form-item class="unit-form">
<el-button size="mini" @click="resetQuery('queryFrom')"></el-button>
<el-button size="mini" type="primary" @click="handleQuery('queryFrom')"></el-button>
<el-button size="mini" @click="resetQuery('queryFrom')"
>重置</el-button
>
<el-button
size="mini"
type="primary"
@click="handleQuery('queryFrom')"
>查询</el-button
>
</el-form-item>
</el-col>
</el-row>
@ -83,7 +114,9 @@
</div>
<main>
<div class="search-title">
<span class="search-title-span">资产列表</span>
<span class="search-title-span"
>资产列表蓝色为单位新增资产</span
>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
@ -92,7 +125,8 @@
icon="el-icon-upload2"
size="mini"
@click="handleImport"
>导入</el-button>
>导入</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -101,7 +135,8 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
>导出</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -110,45 +145,146 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增资产</el-button>
>新增资产</el-button
>
</el-col>
</el-row>
</div>
<section>
<el-table v-loading="loading" :data="tableData" :height="tabHeader" :row-class-name="tableRowClassName" :max-height="tabHeader">
<el-table-column type="index" width="50" label="序号" align="center"/>
<el-table-column label="所属单位" key="ssdw" prop="ssdw" align="center" />
<el-table-column label="电子邮箱后缀" key="dzyxhz" prop="dzyxhz" align="center" />
<el-table-column label="邮件系统供应商" key="yjxtgys" prop="yjxtgys" align="center">
<el-table
v-loading="loading"
:data="tableData"
:height="tabHeader"
:row-class-name="tableRowClassName"
:max-height="tabHeader"
>
<el-table-column
type="index"
width="50"
label="序号"
align="center"
/>
<el-table-column
label="所属单位"
key="ssdw"
prop="ssdw"
align="center"
>
<template slot-scope="scope">
<span
:style="{ color: scope.row.xzType == 1 ? 'blue' : '' }"
>{{ scope.row.ssdw }}</span
>
</template>
</el-table-column>
<el-table-column
label="电子邮箱后缀"
key="dzyxhz"
prop="dzyxhz"
align="center"
/>
<el-table-column
label="邮件系统供应商"
key="yjxtgys"
prop="yjxtgys"
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="status" prop="status" class-name="table-status" 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"
>
<template slot-scope="scope">
<span v-if="scope.row.yjxtzc == 1" style="color: #16B771;">
<span v-if="scope.row.yjxtzc == 1" style="color: #16b771">
正常
</span>
<span v-if="scope.row.yjxtzc == 2" style="color: #F58A0C;">
<span v-if="scope.row.yjxtzc == 2" style="color: #f58a0c">
关停
</span>
</template>
</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">
<div style="display: flex;align-items: center;justify-content: center;">
<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;">
<span class="look-info" style="color: #1485EF;margin-right: 15px;">查看</span>
<div
style="
display: flex;
align-items: center;
justify-content: center;
"
>
<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"
/>
<span
class="look-info"
style="color: #1485ef; margin-right: 15px"
>查看</span
>
</div>
<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;">
<span class="look-info" style="color: #1485EF;margin-right: 15px;">编辑</span>
<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"
/>
<span
class="look-info"
style="color: #1485ef; margin-right: 15px"
>编辑</span
>
</div>
<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;">
<span class="look-info" style="color: #F50C0C;margin-right: 15px;">删除</span>
<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"
/>
<span
class="look-info"
style="color: #f50c0c; margin-right: 15px"
>删除</span
>
</div>
</div>
</template>
@ -165,7 +301,12 @@
></my-pagination>
</main>
<!-- 资产导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1"
@ -179,13 +320,21 @@
drag
>
<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" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div> -->
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
@ -198,33 +347,37 @@
</el-row>
</template>
<script>
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 { assetEmailList, deleteAssetEmail, schema } from "@/api/auditPagesApi/index";
import {
assetEmailList,
deleteAssetEmail,
schema,
} from "@/api/auditPagesApi/index";
export default {
dicts: ['zc_xtzt','zc_xtlx'],
components:{myPagination},
dicts: ["zc_xtzt", "zc_xtlx"],
components: { myPagination },
data() {
return {
//
deptOptions: undefined,
defaultProps: {
children: "children",
label: "label"
label: "label",
},
formInline:{
dzyxhz:"",
dwmc:"",
startTime:"",
endTime:"",
current:1,
size:10,
formInline: {
dzyxhz: "",
dwmc: "",
startTime: "",
endTime: "",
current: 1,
size: 10,
},
time:[],
total:0,
tableData:[],
loading:false,
time: [],
total: 0,
tableData: [],
loading: false,
tabHeader: undefined,
//
upload: {
@ -240,29 +393,29 @@ export default {
headers: { Authorization: "Bearer " + getToken() },
//
// url: process.env.VUE_APP_BASE_API + "/tc/assetEmail/importData"
url: location.origin + "/api/tc/assetEmail/importData"
url: location.origin + "/api/tc/assetEmail/importData",
},
}
};
},
mounted(){
if( Object.keys(this.$route.params).length != 0) {
mounted() {
if (Object.keys(this.$route.params).length != 0) {
this.formInline = this.$route.params;
}else{
this.formInline.current = 1
this.formInline.size = 20
} else {
this.formInline.current = 1;
this.formInline.size = 20;
}
this.getList();
this.getDeptTree();
this.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
window.addEventListener("resize", this.cancalDebounce);
},
destroyed() {
window.removeEventListener('resize', this.cancalDebounce);
window.removeEventListener("resize", this.cancalDebounce);
},
methods:{
methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
schema({type:3}).then(response => {
schema({ type: 3 }).then((response) => {
this.deptOptions = response.data;
});
},
@ -277,16 +430,16 @@ export default {
this.handleQuery();
},
//
getList(){
getList() {
this.loading = true;
assetEmailList(this.formInline).then(res=>{
assetEmailList(this.formInline).then((res) => {
this.loading = false;
this.total = res.data.total;
this.tableData = res.data.records;
})
});
},
//
resetQuery(){
resetQuery() {
this.resetForm("queryForm");
this.time = [];
this.formInline.deptId = undefined;
@ -294,35 +447,42 @@ export default {
this.handleQuery();
},
//
handleQuery(){
handleQuery() {
this.formInline.current = 1;
if(this.time) {
this.formInline.startTime = this.time[0]
this.formInline.endTime = this.time[1]
if (this.time) {
this.formInline.startTime = this.time[0];
this.formInline.endTime = this.time[1];
}
this.getList();
},
//
getPagination(pages){
getPagination(pages) {
this.formInline.current = pages.page;
this.formInline.size = pages.limit;
this.getList();
},
//
handleImport(){
handleImport() {
this.upload.open = true;
},
//
handleExport(){
this.download('/tc/assetEmail/export', {
...this.formInline
}, `电子邮件资产${new Date().getTime()}.xlsx`)
handleExport() {
this.download(
"/tc/assetEmail/export",
{
...this.formInline,
},
`电子邮件资产${new Date().getTime()}.xlsx`
);
},
/** 下载模板操作 */
importTemplate() {
this.download('/tc/assetEmail/importTemplate', {
}, `电子邮件资产导入模板${new Date().getTime()}.xlsx`)
this.download(
"/tc/assetEmail/importTemplate",
{},
`电子邮件资产导入模板${new Date().getTime()}.xlsx`
);
},
//
handleFileUploadProgress(event, file, fileList) {
@ -333,7 +493,13 @@ export default {
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.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
@ -341,60 +507,72 @@ export default {
this.$refs.upload.submit();
},
//
handleAdd(){
this.$router.push({name: 'AssetsAuth',query: {
pageType: "add",
type:3,
}})
handleAdd() {
this.$router.push({
name: "AssetsAuth",
query: {
pageType: "add",
type: 3,
},
});
},
//
goInfo(row,id){
if(id == 1) {
this.$router.push({name: 'AssetsAuth',query: {
pageType: "look",
type:3,
id:row.id,
queryData:this.formInline
}})
} else if(id == 2) {
this.$router.push({name: 'AssetsAuth',query: {
pageType: "change",
type:3,
id:row.id,
queryData:this.formInline
}})
} else if(id == 3) {
goInfo(row, id) {
if (id == 1) {
this.$router.push({
name: "AssetsAuth",
query: {
pageType: "look",
type: 3,
id: row.id,
queryData: this.formInline,
},
});
} else if (id == 2) {
this.$router.push({
name: "AssetsAuth",
query: {
pageType: "change",
type: 3,
id: row.id,
queryData: this.formInline,
},
});
} else if (id == 3) {
const userIds = row.id;
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
return deleteAssetEmail(userIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
this.$modal
.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?')
.then(function () {
return deleteAssetEmail(userIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}
},
//
edit(){
},
edit() {},
//
delInfo(){},
delInfo() {},
// table
tableRowClassName({row, rowIndex}){
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 !== 0) {
return 'evenNumber-row';
return "evenNumber-row";
}
return '';
return "";
},
//
cancalDebounce(){
const element = document.getElementById('L-size-main'); // ID
const header = document.getElementById('L-header'); // ID
const pagination = document.getElementById('L-pagination'); // ID
cancalDebounce() {
const element = document.getElementById("L-size-main"); // ID
const header = document.getElementById("L-header"); // ID
const pagination = document.getElementById("L-pagination"); // ID
const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight - 110;
}
},
},
}
};
</script>

@ -1,8 +1,20 @@
<!--assetsManage/assets-->
<template>
<el-row :gutter="20" style="height: 100%;background-color: #F2F4F6;display: flex;">
<el-row
:gutter="20"
style="height: 100%; background-color: #f2f4f6; display: flex"
>
<!--部门数据-->
<el-col :span="3" :xs="24" style="margin-right: 10px;height: 100%; background-color: #fff;padding-top: 20px;">
<el-col
:span="3"
:xs="24"
style="
margin-right: 10px;
height: 100%;
background-color: #fff;
padding-top: 20px;
"
>
<div class="head-container">
<el-tree
:data="deptOptions"
@ -17,25 +29,38 @@
/>
</div>
</el-col>
<el-col :span="20" :xs="24" style="height: 100%;flex: 1;">
<el-col :span="20" :xs="24" style="height: 100%; flex: 1">
<div class="L-main" id="L-size-main">
<div class="content-search" id="L-header">
<div class="search-title">查询条件</div>
<el-form :inline="true" ref="queryForm" :model="formInline" size="small" class="demo-form-inline">
<el-form
:inline="true"
ref="queryForm"
:model="formInline"
size="small"
class="demo-form-inline"
>
<el-row>
<el-col :span="7">
<el-form-item label="系统名称:" prop="xtmc">
<el-input v-model="formInline.xtmc" placeholder="请输入系统名称"></el-input>
<el-input
v-model="formInline.xtmc"
placeholder="请输入系统名称"
></el-input>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="系统类型:" prop="xtlx">
<el-select v-model="formInline.xtlx" placeholder="请选择系统类型">
<el-select
v-model="formInline.xtlx"
placeholder="请选择系统类型"
>
<el-option
v-for="dict in dict.type.zc_xtlx"
:key="dict.value"
:label="dict.label"
:value="dict.value">
:value="dict.value"
>
</el-option>
</el-select>
</el-form-item>
@ -58,25 +83,39 @@
<el-row>
<el-col :span="7">
<el-form-item label="单位名称:" prop="dwmc">
<el-input v-model="formInline.dwmc" placeholder="请输入单位名称"></el-input>
<el-input
v-model="formInline.dwmc"
placeholder="请输入单位名称"
></el-input>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="系统状态:" prop="xtzt">
<el-select v-model="formInline.xtzt" placeholder="请选择系统状态">
<el-select
v-model="formInline.xtzt"
placeholder="请选择系统状态"
>
<el-option
v-for="dict in dict.type.zc_xtzt"
:key="dict.value"
:label="dict.label"
:value="dict.value">
:value="dict.value"
>
</el-option>
</el-select>
</el-form-item>
</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-button size="mini" @click="resetQuery('queryFrom')"></el-button>
<el-button size="mini" type="primary" @click="handleQuery('queryFrom')"></el-button>
<el-button size="mini" @click="resetQuery('queryFrom')"
>重置</el-button
>
<el-button
size="mini"
type="primary"
@click="handleQuery('queryFrom')"
>查询</el-button
>
</el-form-item>
</el-col>
</el-row>
@ -84,7 +123,9 @@
</div>
<main>
<div class="search-title">
<span class="search-title-span">资产列表</span>
<span class="search-title-span"
>资产列表蓝色为单位新增资产</span
>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
@ -93,7 +134,8 @@
icon="el-icon-upload2"
size="mini"
@click="handleImport"
>导入</el-button>
>导入</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -102,7 +144,8 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
>导出</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -111,61 +154,166 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增资产</el-button>
>新增资产</el-button
>
</el-col>
</el-row>
</div>
<section>
<el-table v-loading="loading" :data="tableData" :height="tabHeader" :row-class-name="tableRowClassName" :max-height="tabHeader">
<el-table-column type="index" width="50" label="序号" 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
v-loading="loading"
:data="tableData"
:height="tabHeader"
:row-class-name="tableRowClassName"
:max-height="tabHeader"
>
<el-table-column
type="index"
width="50"
label="序号"
align="center"
/>
<el-table-column
label="系统名称"
key="xtmc"
width="200px"
prop="xtmc"
align="center"
>
<template slot-scope="scope">
<dict-tag :options="dict.type.zc_xtlx" :value="scope.row.xtlx"/>
<span
:style="{ color: scope.row.xzType == 1 ? 'blue' : '' }"
>{{ scope.row.xtmc }}</span
>
</template>
</el-table-column>
<el-table-column label="单位名称" key="dwmc" prop="dwmc" align="center">
<el-table-column
label="系统类型"
key="xtlx"
prop="xtlx"
align="center"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.zc_xtlx"
:value="scope.row.xtlx"
/>
</template>
</el-table-column>
<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="status" prop="status" class-name="table-status" 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"
>
<template slot-scope="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 v-if="scope.row.xtzt == 2" style="color: #f58a0c">
测试中
</span>
<span v-if="scope.row.xtzt == 3" style="color: #1485EF;">
<span v-if="scope.row.xtzt == 3" style="color: #1485ef">
使用中
</span>
<span v-if="scope.row.xtzt == 4" style="color: #29A07A;">
<span v-if="scope.row.xtzt == 4" style="color: #29a07a">
维护中
</span>
<span v-if="scope.row.xtzt == 5" style="color: #F50C0C;">
<span v-if="scope.row.xtzt == 5" style="color: #f50c0c">
关停
</span>
<span v-if="scope.row.xtzt == 6" style="color: #F50C0C;">
<span v-if="scope.row.xtzt == 6" style="color: #f50c0c">
备用
</span>
</template>
</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">
<div style="display: flex;align-items: center;justify-content: center;">
<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;">
<span class="look-info" style="color: #1485EF;margin-right: 15px;">查看</span>
<div
style="
display: flex;
align-items: center;
justify-content: center;
"
>
<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"
/>
<span
class="look-info"
style="color: #1485ef; margin-right: 15px"
>查看</span
>
</div>
<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;">
<span class="look-info" style="color: #1485EF;margin-right: 15px;">编辑</span>
<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"
/>
<span
class="look-info"
style="color: #1485ef; margin-right: 15px"
>编辑</span
>
</div>
<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;">
<span class="look-info" style="color: #F50C0C;margin-right: 15px;">删除</span>
<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"
/>
<span
class="look-info"
style="color: #f50c0c; margin-right: 15px"
>删除</span
>
</div>
</div>
</template>
@ -182,7 +330,12 @@
></my-pagination>
</main>
<!-- 资产导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1"
@ -196,13 +349,21 @@
drag
>
<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" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div> -->
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
@ -215,35 +376,35 @@
</el-row>
</template>
<script>
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 { assetUnit, deleteAssetInfo, schema } from "@/api/auditPagesApi/index";
export default {
dicts: ['zc_xtzt','zc_xtlx'],
components:{myPagination},
dicts: ["zc_xtzt", "zc_xtlx"],
components: { myPagination },
data() {
return {
//
deptOptions: undefined,
defaultProps: {
children: "children",
label: "label"
label: "label",
},
formInline:{
xtmc:"",
xtlx:"",
time:[],
startTime:"",
endTime:"",
dwmc:"",
xtzt:"",
current:1,
size:20,
formInline: {
xtmc: "",
xtlx: "",
time: [],
startTime: "",
endTime: "",
dwmc: "",
xtzt: "",
current: 1,
size: 20,
},
total:0,
tableData:[],
loading:false,
total: 0,
tableData: [],
loading: false,
tabHeader: undefined,
//
upload: {
@ -259,31 +420,31 @@ export default {
headers: { Authorization: "Bearer " + getToken() },
//
// url: process.env.VUE_APP_BASE_API + "/tc/assetCurrent/import"
url: location.origin + "/api/tc/assetCurrent/importData"
url: location.origin + "/api/tc/assetCurrent/importData",
},
}
};
},
mounted(){
if( Object.keys(this.$route.params).length != 0) {
console.log(this.$route.params,"params");
mounted() {
if (Object.keys(this.$route.params).length != 0) {
console.log(this.$route.params, "params");
this.formInline = this.$route.params;
}else{
this.formInline.current = 1
this.formInline.size = 20
} else {
this.formInline.current = 1;
this.formInline.size = 20;
}
this.getList();
this.getDeptTree();
this.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
window.addEventListener("resize", this.cancalDebounce);
},
destroyed() {
window.removeEventListener('resize', this.cancalDebounce);
window.removeEventListener("resize", this.cancalDebounce);
},
methods:{
methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
schema({type:0}).then(response => {
schema({ type: 0 }).then((response) => {
this.deptOptions = response.data;
});
},
@ -298,54 +459,61 @@ export default {
this.handleQuery();
},
//
getList(){
getList() {
this.loading = true;
console.log(this.formInline);
assetUnit('get',this.formInline).then(res=>{
assetUnit("get", this.formInline).then((res) => {
this.loading = false;
this.total = res.data.total;
this.tableData = res.data.records;
})
});
},
//
resetQuery(){
resetQuery() {
this.resetForm("queryForm");
this.formInline.deptId = undefined;
this.$refs.tree.setCurrentKey(null);
this.handleQuery();
},
//
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.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();
},
//
getPagination(pages){
getPagination(pages) {
this.formInline.current = pages.page;
this.formInline.size = pages.limit;
this.getList();
},
//
handleImport(){
handleImport() {
this.upload.open = true;
},
//
handleExport(){
this.download('/tc/assetCurrent/export', {
...this.formInline
}, `web资产${new Date().getTime()}.xlsx`)
handleExport() {
this.download(
"/tc/assetCurrent/export",
{
...this.formInline,
},
`web资产${new Date().getTime()}.xlsx`
);
},
/** 下载模板操作 */
importTemplate() {
this.download('/tc/assetCurrent/importTemplate', {
}, `web资产导入模板${new Date().getTime()}.xlsx`)
this.download(
"/tc/assetCurrent/importTemplate",
{},
`web资产导入模板${new Date().getTime()}.xlsx`
);
},
//
handleFileUploadProgress(event, file, fileList) {
@ -356,7 +524,13 @@ export default {
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.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
@ -364,60 +538,72 @@ export default {
this.$refs.upload.submit();
},
//
handleAdd(){
this.$router.push({name: 'AssetsAuth',query: {
pageType: "add",
type:0,
}})
handleAdd() {
this.$router.push({
name: "AssetsAuth",
query: {
pageType: "add",
type: 0,
},
});
},
//
goInfo(row,id){
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) {
goInfo(row, id) {
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(() => {});
}
this.$modal
.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?')
.then(function () {
return deleteAssetInfo(userIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}
},
//
edit(){
},
edit() {},
//
delInfo(){},
delInfo() {},
// table
tableRowClassName({row, rowIndex}){
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 !== 0) {
return 'evenNumber-row';
return "evenNumber-row";
}
return '';
return "";
},
//
cancalDebounce(){
const element = document.getElementById('L-size-main'); // ID
const header = document.getElementById('L-header'); // ID
const pagination = document.getElementById('L-pagination'); // ID
cancalDebounce() {
const element = document.getElementById("L-size-main"); // ID
const header = document.getElementById("L-header"); // ID
const pagination = document.getElementById("L-pagination"); // ID
const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight - 110;
}
},
},
}
};
</script>

@ -1,8 +1,20 @@
<!-- 资产管理 -- 移动应用系统 -->
<template>
<el-row :gutter="20" style="height: 100%;background-color: #F2F4F6;display: flex;">
<el-row
:gutter="20"
style="height: 100%; background-color: #f2f4f6; display: flex"
>
<!--部门数据-->
<el-col :span="3" :xs="24" style="margin-right: 10px;height: 100%; background-color: #fff;padding-top: 20px;">
<el-col
:span="3"
:xs="24"
style="
margin-right: 10px;
height: 100%;
background-color: #fff;
padding-top: 20px;
"
>
<div class="head-container">
<el-tree
:data="deptOptions"
@ -17,20 +29,32 @@
/>
</div>
</el-col>
<el-col :span="20" :xs="24" style="height: 100%;flex: 1;">
<el-col :span="20" :xs="24" style="height: 100%; flex: 1">
<div class="L-main" id="L-size-main">
<div class="content-search" id="L-header">
<div class="search-title">查询条件</div>
<el-form :inline="true" ref="queryForm" :model="formInline" size="small" class="demo-form-inline">
<el-form
:inline="true"
ref="queryForm"
:model="formInline"
size="small"
class="demo-form-inline"
>
<el-row>
<el-col :span="6">
<el-form-item label="所属单位:" prop="dwmc">
<el-input v-model="formInline.dwmc" placeholder="请输入所属单位"></el-input>
<el-input
v-model="formInline.dwmc"
placeholder="请输入所属单位"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="移动应用名称:" prop="yymc">
<el-input v-model="formInline.yymc" placeholder="请输入移动应用名称"></el-input>
<el-input
v-model="formInline.yymc"
placeholder="请输入移动应用名称"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
@ -47,10 +71,17 @@
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6" style="text-align: right;">
<el-col :span="6" style="text-align: right">
<el-form-item class="unit-form">
<el-button size="mini" @click="resetQuery('queryFrom')"></el-button>
<el-button size="mini" type="primary" @click="handleQuery('queryFrom')"></el-button>
<el-button size="mini" @click="resetQuery('queryFrom')"
>重置</el-button
>
<el-button
size="mini"
type="primary"
@click="handleQuery('queryFrom')"
>查询</el-button
>
</el-form-item>
</el-col>
</el-row>
@ -83,7 +114,9 @@
</div>
<main>
<div class="search-title">
<span class="search-title-span">资产列表</span>
<span class="search-title-span"
>资产列表蓝色为单位新增资产</span
>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
@ -92,7 +125,8 @@
icon="el-icon-upload2"
size="mini"
@click="handleImport"
>导入</el-button>
>导入</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -101,7 +135,8 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
>导出</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -110,22 +145,62 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增资产</el-button>
>新增资产</el-button
>
</el-col>
</el-row>
</div>
<section>
<el-table v-loading="loading" :data="tableData" :height="tabHeader" :row-class-name="tableRowClassName" :max-height="tabHeader">
<el-table-column type="index" width="50" label="序号" align="center"/>
<el-table-column label="移动应用名称" key="appName" prop="appName" align="center" />
<el-table-column label="所属单位" key="ssdw" prop="ssdw" align="center" />
<el-table
v-loading="loading"
:data="tableData"
:height="tabHeader"
:row-class-name="tableRowClassName"
:max-height="tabHeader"
>
<el-table-column
type="index"
width="50"
label="序号"
align="center"
/>
<el-table-column
label="移动应用名称"
key="appName"
prop="appName"
align="center"
>
<template slot-scope="scope">
<span
:style="{ color: scope.row.xzType == 1 ? 'blue' : '' }"
>{{ scope.row.appName }}</span
>
</template>
</el-table-column>
<el-table-column
label="所属单位"
key="ssdw"
prop="ssdw"
align="center"
/>
<!-- <el-table-column label="icp备案状态" 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="status" prop="status" class-name="table-status" 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"
>
<!-- <template slot-scope="scope">
<span v-if="scope.row.icpState == 1" style="color: #F58A0C;">
未备案
@ -138,43 +213,99 @@
</span>
</template> -->
<template slot-scope="scope">
<span v-if="scope.row.appState == 1" style="color: #16B771;">
<span v-if="scope.row.appState == 1" style="color: #16b771">
正常
</span>
<span v-if="scope.row.appState == 2" style="color: #F58A0C;">
<span v-if="scope.row.appState == 2" style="color: #f58a0c">
注销
</span>
<span v-if="scope.row.appState == 3" style="color: #1485EF;">
<span v-if="scope.row.appState == 3" style="color: #1485ef">
迁移
</span>
<span v-if="scope.row.appState == 4" style="color: #29A07A;">
<span v-if="scope.row.appState == 4" style="color: #29a07a">
受限
</span>
<span v-if="scope.row.appState == 5" style="color: #F50C0C;">
<span v-if="scope.row.appState == 5" style="color: #f50c0c">
违规
</span>
<span v-if="scope.row.appState == 6" style="color: #F58A0C;">
<span v-if="scope.row.appState == 6" style="color: #f58a0c">
未知
</span>
<span v-if="scope.row.appState == 7" style="color: #F50C0C;">
<span v-if="scope.row.appState == 7" style="color: #f50c0c">
关停
</span>
</template>
</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">
<div style="display: flex;align-items: center;justify-content: center;">
<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;">
<span class="look-info" style="color: #1485EF;margin-right: 15px;">查看</span>
<div
style="
display: flex;
align-items: center;
justify-content: center;
"
>
<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"
/>
<span
class="look-info"
style="color: #1485ef; margin-right: 15px"
>查看</span
>
</div>
<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;">
<span class="look-info" style="color: #1485EF;margin-right: 15px;">编辑</span>
<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"
/>
<span
class="look-info"
style="color: #1485ef; margin-right: 15px"
>编辑</span
>
</div>
<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;">
<span class="look-info" style="color: #F50C0C;margin-right: 15px;">删除</span>
<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"
/>
<span
class="look-info"
style="color: #f50c0c; margin-right: 15px"
>删除</span
>
</div>
</div>
</template>
@ -191,7 +322,12 @@
></my-pagination>
</main>
<!-- 资产导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1"
@ -205,13 +341,21 @@
drag
>
<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" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div> -->
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
@ -224,33 +368,37 @@
</el-row>
</template>
<script>
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 { assetAppList, deleteAssetApp, schema } from "@/api/auditPagesApi/index";
import {
assetAppList,
deleteAssetApp,
schema,
} from "@/api/auditPagesApi/index";
export default {
dicts: ['zc_xtzt','zc_xtlx'],
components:{myPagination},
dicts: ["zc_xtzt", "zc_xtlx"],
components: { myPagination },
data() {
return {
//
deptOptions: undefined,
defaultProps: {
children: "children",
label: "label"
label: "label",
},
formInline:{
dwmc:"",
yymc:"",
startTime:"",
endTime:"",
current:1,
size:10,
formInline: {
dwmc: "",
yymc: "",
startTime: "",
endTime: "",
current: 1,
size: 10,
},
time:[],
total:0,
tableData:[],
loading:false,
time: [],
total: 0,
tableData: [],
loading: false,
tabHeader: undefined,
//
upload: {
@ -266,29 +414,29 @@ export default {
headers: { Authorization: "Bearer " + getToken() },
//
// url: process.env.VUE_APP_BASE_API + "/tc/assetApp/importData"
url: location.origin + "/api/tc/assetApp/importData"
url: location.origin + "/api/tc/assetApp/importData",
},
}
};
},
mounted(){
if( Object.keys(this.$route.params).length != 0) {
mounted() {
if (Object.keys(this.$route.params).length != 0) {
this.formInline = this.$route.params;
}else{
this.formInline.current = 1
this.formInline.size = 20
} else {
this.formInline.current = 1;
this.formInline.size = 20;
}
this.getList();
this.getDeptTree();
this.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
window.addEventListener("resize", this.cancalDebounce);
},
destroyed() {
window.removeEventListener('resize', this.cancalDebounce);
window.removeEventListener("resize", this.cancalDebounce);
},
methods:{
methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
schema({type:4}).then(response => {
schema({ type: 4 }).then((response) => {
this.deptOptions = response.data;
});
},
@ -303,16 +451,16 @@ export default {
this.handleQuery();
},
//
getList(){
getList() {
this.loading = true;
assetAppList(this.formInline).then(res=>{
assetAppList(this.formInline).then((res) => {
this.loading = false;
this.total = res.data.total;
this.tableData = res.data.records;
})
});
},
//
resetQuery(){
resetQuery() {
this.resetForm("queryForm");
this.time = [];
this.formInline.deptId = undefined;
@ -320,35 +468,42 @@ export default {
this.handleQuery();
},
//
handleQuery(){
handleQuery() {
this.formInline.current = 1;
if(this.time) {
this.formInline.startTime = this.time[0]
this.formInline.endTime = this.time[1]
if (this.time) {
this.formInline.startTime = this.time[0];
this.formInline.endTime = this.time[1];
}
this.getList();
},
//
getPagination(pages){
getPagination(pages) {
this.formInline.current = pages.page;
this.formInline.size = pages.limit;
this.getList();
},
//
handleImport(){
handleImport() {
this.upload.open = true;
},
//
handleExport(){
this.download('/tc/assetApp/export', {
...this.formInline
}, `移动应用程序资产${new Date().getTime()}.xlsx`)
handleExport() {
this.download(
"/tc/assetApp/export",
{
...this.formInline,
},
`移动应用程序资产${new Date().getTime()}.xlsx`
);
},
/** 下载模板操作 */
importTemplate() {
this.download('/tc/assetApp/importTemplate', {
}, `移动应用程序资产导入模板${new Date().getTime()}.xlsx`)
this.download(
"/tc/assetApp/importTemplate",
{},
`移动应用程序资产导入模板${new Date().getTime()}.xlsx`
);
},
//
handleFileUploadProgress(event, file, fileList) {
@ -359,7 +514,13 @@ export default {
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.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
@ -367,60 +528,72 @@ export default {
this.$refs.upload.submit();
},
//
handleAdd(){
this.$router.push({name: 'AssetsAuth',query: {
pageType: "add",
type:4,
}})
handleAdd() {
this.$router.push({
name: "AssetsAuth",
query: {
pageType: "add",
type: 4,
},
});
},
//
goInfo(row,id){
if(id == 1) {
this.$router.push({name: 'AssetsAuth',query: {
pageType: "look",
type:4,
id:row.id,
queryData:this.formInline
}})
} else if(id == 2) {
this.$router.push({name: 'AssetsAuth',query: {
pageType: "change",
type:4,
id:row.id,
queryData:this.formInline
}})
} else if(id == 3) {
goInfo(row, id) {
if (id == 1) {
this.$router.push({
name: "AssetsAuth",
query: {
pageType: "look",
type: 4,
id: row.id,
queryData: this.formInline,
},
});
} else if (id == 2) {
this.$router.push({
name: "AssetsAuth",
query: {
pageType: "change",
type: 4,
id: row.id,
queryData: this.formInline,
},
});
} else if (id == 3) {
const userIds = row.id;
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
return deleteAssetApp(userIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
this.$modal
.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?')
.then(function () {
return deleteAssetApp(userIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}
},
//
edit(){
},
edit() {},
//
delInfo(){},
delInfo() {},
// table
tableRowClassName({row, rowIndex}){
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 !== 0) {
return 'evenNumber-row';
return "evenNumber-row";
}
return '';
return "";
},
//
cancalDebounce(){
const element = document.getElementById('L-size-main'); // ID
const header = document.getElementById('L-header'); // ID
const pagination = document.getElementById('L-pagination'); // ID
cancalDebounce() {
const element = document.getElementById("L-size-main"); // ID
const header = document.getElementById("L-header"); // ID
const pagination = document.getElementById("L-pagination"); // ID
const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight - 110;
}
},
},
}
};
</script>

@ -1,8 +1,20 @@
<!-- 资产管理 -- 公众号 -->
<template>
<el-row :gutter="20" style="height: 100%;background-color: #F2F4F6;display: flex;">
<el-row
:gutter="20"
style="height: 100%; background-color: #f2f4f6; display: flex"
>
<!--部门数据-->
<el-col :span="3" :xs="24" style="margin-right: 10px;height: 100%; background-color: #fff;padding-top: 20px;">
<el-col
:span="3"
:xs="24"
style="
margin-right: 10px;
height: 100%;
background-color: #fff;
padding-top: 20px;
"
>
<div class="head-container">
<el-tree
:data="deptOptions"
@ -17,20 +29,32 @@
/>
</div>
</el-col>
<el-col :span="20" :xs="24" style="height: 100%;flex: 1;">
<el-col :span="20" :xs="24" style="height: 100%; flex: 1">
<div class="L-main" id="L-size-main">
<div class="content-search" id="L-header">
<div class="search-title">查询条件</div>
<el-form :inline="true" ref="queryForm" :model="formInline" size="small" class="demo-form-inline">
<el-form
:inline="true"
ref="queryForm"
:model="formInline"
size="small"
class="demo-form-inline"
>
<el-row>
<el-col :span="6">
<el-form-item label="所属单位:" prop="dwmc">
<el-input v-model="formInline.dwmc" placeholder="请输入所属单位"></el-input>
<el-input
v-model="formInline.dwmc"
placeholder="请输入所属单位"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="公众号名称:" prop="gzhmc">
<el-input v-model="formInline.gzhmc" placeholder="请输入公众号名称"></el-input>
<el-input
v-model="formInline.gzhmc"
placeholder="请输入公众号名称"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
@ -47,10 +71,17 @@
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6" style="text-align: right;">
<el-col :span="6" style="text-align: right">
<el-form-item class="unit-form">
<el-button size="mini" @click="resetQuery('queryFrom')"></el-button>
<el-button size="mini" type="primary" @click="handleQuery('queryFrom')"></el-button>
<el-button size="mini" @click="resetQuery('queryFrom')"
>重置</el-button
>
<el-button
size="mini"
type="primary"
@click="handleQuery('queryFrom')"
>查询</el-button
>
</el-form-item>
</el-col>
</el-row>
@ -83,7 +114,9 @@
</div>
<main>
<div class="search-title">
<span class="search-title-span">资产列表</span>
<span class="search-title-span"
>资产列表蓝色为单位新增资产</span
>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
@ -92,7 +125,8 @@
icon="el-icon-upload2"
size="mini"
@click="handleImport"
>导入</el-button>
>导入</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -101,7 +135,8 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
>导出</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -110,62 +145,166 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增资产</el-button>
>新增资产</el-button
>
</el-col>
</el-row>
</div>
<section>
<el-table v-loading="loading" :data="tableData" :height="tabHeader" :row-class-name="tableRowClassName" :max-height="tabHeader">
<el-table-column type="index" width="50" label="序号" align="center"/>
<el-table-column label="公众号名称" key="gzhmc" prop="gzhmc" align="center" />
<el-table-column label="所属单位" key="ssdw" prop="ssdw" align="center" />
<el-table
v-loading="loading"
:data="tableData"
:height="tabHeader"
:row-class-name="tableRowClassName"
:max-height="tabHeader"
>
<el-table-column
type="index"
width="50"
label="序号"
align="center"
/>
<el-table-column
label="公众号名称"
key="gzhmc"
prop="gzhmc"
align="center"
>
<template slot-scope="scope">
<span
:style="{ color: scope.row.xzType == 1 ? 'blue' : '' }"
>{{ scope.row.gzhmc }}</span
>
</template>
</el-table-column>
<el-table-column
label="所属单位"
key="ssdw"
prop="ssdw"
align="center"
/>
<!-- <el-table-column label="单位名称" key="dwmc" prop="dwmc" align="center">
</el-table-column> -->
<el-table-column label="新增时间" key="createTime" prop="createTime" align="center" />
<el-table-column label="平台类型" key="ptlx" prop="ptlx" align="center">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_ptlx_type" :value="scope.row.ptlx"/>
</template>
</el-table-column>
<el-table-column label="公众号状态" key="status" prop="status" class-name="table-status" align="center">
<el-table-column
label="新增时间"
key="createTime"
prop="createTime"
align="center"
/>
<el-table-column
label="平台类型"
key="ptlx"
prop="ptlx"
align="center"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.sys_ptlx_type"
:value="scope.row.ptlx"
/>
</template>
</el-table-column>
<el-table-column
label="公众号状态"
key="status"
prop="status"
class-name="table-status"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.gzhzt == 1" style="color: #16B771;">
<span v-if="scope.row.gzhzt == 1" style="color: #16b771">
正常
</span>
<span v-if="scope.row.gzhzt == 2" style="color: #F58A0C;">
<span v-if="scope.row.gzhzt == 2" style="color: #f58a0c">
注销
</span>
<span v-if="scope.row.gzhzt == 3" style="color: #1485EF;">
<span v-if="scope.row.gzhzt == 3" style="color: #1485ef">
迁移
</span>
<span v-if="scope.row.gzhzt == 4" style="color: #29A07A;">
<span v-if="scope.row.gzhzt == 4" style="color: #29a07a">
受限
</span>
<span v-if="scope.row.gzhzt == 5" style="color: #F50C0C;">
<span v-if="scope.row.gzhzt == 5" style="color: #f50c0c">
违规
</span>
<span v-if="scope.row.gzhzt == 6" style="color: #F58A0C;">
<span v-if="scope.row.gzhzt == 6" style="color: #f58a0c">
未知
</span>
<span v-if="scope.row.gzhzt == 6" style="color: #F58A0C;">
<span v-if="scope.row.gzhzt == 6" style="color: #f58a0c">
关停
</span>
</template>
</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">
<div style="display: flex;align-items: center;justify-content: center;">
<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;">
<span class="look-info" style="color: #1485EF;margin-right: 15px;">查看</span>
<div
style="
display: flex;
align-items: center;
justify-content: center;
"
>
<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"
/>
<span
class="look-info"
style="color: #1485ef; margin-right: 15px"
>查看</span
>
</div>
<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;">
<span class="look-info" style="color: #1485EF;margin-right: 15px;">编辑</span>
<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"
/>
<span
class="look-info"
style="color: #1485ef; margin-right: 15px"
>编辑</span
>
</div>
<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;">
<span class="look-info" style="color: #F50C0C;margin-right: 15px;">删除</span>
<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"
/>
<span
class="look-info"
style="color: #f50c0c; margin-right: 15px"
>删除</span
>
</div>
</div>
</template>
@ -182,7 +321,12 @@
></my-pagination>
</main>
<!-- 资产导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1"
@ -196,13 +340,21 @@
drag
>
<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" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div> -->
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
@ -215,33 +367,37 @@
</el-row>
</template>
<script>
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 { assetOfficialAccountList, deleteAssetOfficialAccount, schema } from "@/api/auditPagesApi/index";
import {
assetOfficialAccountList,
deleteAssetOfficialAccount,
schema,
} from "@/api/auditPagesApi/index";
export default {
dicts: ['zc_xtzt','zc_xtlx','sys_ptlx_type'],
components:{myPagination},
dicts: ["zc_xtzt", "zc_xtlx", "sys_ptlx_type"],
components: { myPagination },
data() {
return {
//
deptOptions: undefined,
defaultProps: {
children: "children",
label: "label"
label: "label",
},
formInline:{
gzhmc:"",
dwmc:"",
startTime:"",
endTime:"",
current:1,
size:10,
formInline: {
gzhmc: "",
dwmc: "",
startTime: "",
endTime: "",
current: 1,
size: 10,
},
time:[],
total:0,
tableData:[],
loading:false,
time: [],
total: 0,
tableData: [],
loading: false,
tabHeader: undefined,
//
upload: {
@ -257,29 +413,29 @@ export default {
headers: { Authorization: "Bearer " + getToken() },
//
// url: process.env.VUE_APP_BASE_API + "/tc/assetOfficialAccount/importData"
url: location.origin + "/api/tc/assetOfficialAccount/importData"
url: location.origin + "/api/tc/assetOfficialAccount/importData",
},
}
};
},
mounted(){
if( Object.keys(this.$route.params).length != 0) {
mounted() {
if (Object.keys(this.$route.params).length != 0) {
this.formInline = this.$route.params;
}else{
this.formInline.current = 1
this.formInline.size = 20
} else {
this.formInline.current = 1;
this.formInline.size = 20;
}
this.getList();
this.getDeptTree();
this.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
window.addEventListener("resize", this.cancalDebounce);
},
destroyed() {
window.removeEventListener('resize', this.cancalDebounce);
window.removeEventListener("resize", this.cancalDebounce);
},
methods:{
methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
schema({type:2}).then(response => {
schema({ type: 2 }).then((response) => {
this.deptOptions = response.data;
});
},
@ -294,16 +450,16 @@ export default {
this.handleQuery();
},
//
getList(){
getList() {
this.loading = true;
assetOfficialAccountList(this.formInline).then(res=>{
assetOfficialAccountList(this.formInline).then((res) => {
this.loading = false;
this.total = res.data.total;
this.tableData = res.data.records;
})
});
},
//
resetQuery(){
resetQuery() {
this.resetForm("queryForm");
this.time = [];
this.formInline.deptId = undefined;
@ -311,35 +467,42 @@ export default {
this.handleQuery();
},
//
handleQuery(){
handleQuery() {
this.formInline.current = 1;
if(this.time) {
this.formInline.startTime = this.time[0]
this.formInline.endTime = this.time[1]
if (this.time) {
this.formInline.startTime = this.time[0];
this.formInline.endTime = this.time[1];
}
this.getList();
},
//
getPagination(pages){
getPagination(pages) {
this.formInline.current = pages.page;
this.formInline.size = pages.limit;
this.getList();
},
//
handleImport(){
handleImport() {
this.upload.open = true;
},
//
handleExport(){
this.download('/tc/assetOfficialAccount/export', {
...this.formInline
}, `公众号资产${new Date().getTime()}.xlsx`)
handleExport() {
this.download(
"/tc/assetOfficialAccount/export",
{
...this.formInline,
},
`公众号资产${new Date().getTime()}.xlsx`
);
},
/** 下载模板操作 */
importTemplate() {
this.download('/tc/assetOfficialAccount/importTemplate', {
}, `公众号资产导入模板${new Date().getTime()}.xlsx`)
this.download(
"/tc/assetOfficialAccount/importTemplate",
{},
`公众号资产导入模板${new Date().getTime()}.xlsx`
);
},
//
handleFileUploadProgress(event, file, fileList) {
@ -350,7 +513,13 @@ export default {
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.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
@ -358,60 +527,72 @@ export default {
this.$refs.upload.submit();
},
//
handleAdd(){
this.$router.push({name: 'AssetsAuth',query: {
pageType: "add",
type:2,
}})
handleAdd() {
this.$router.push({
name: "AssetsAuth",
query: {
pageType: "add",
type: 2,
},
});
},
//
goInfo(row,id){
if(id == 1) {
this.$router.push({name: 'AssetsAuth',query: {
pageType: "look",
type:2,
id:row.id,
queryData:this.formInline
}})
} else if(id == 2) {
this.$router.push({name: 'AssetsAuth',query: {
pageType: "change",
type:2,
id:row.id,
queryData:this.formInline
}})
} else if(id == 3) {
goInfo(row, id) {
if (id == 1) {
this.$router.push({
name: "AssetsAuth",
query: {
pageType: "look",
type: 2,
id: row.id,
queryData: this.formInline,
},
});
} else if (id == 2) {
this.$router.push({
name: "AssetsAuth",
query: {
pageType: "change",
type: 2,
id: row.id,
queryData: this.formInline,
},
});
} else if (id == 3) {
const userIds = row.id;
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
return deleteAssetOfficialAccount(userIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
this.$modal
.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?')
.then(function () {
return deleteAssetOfficialAccount(userIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}
},
//
edit(){
},
edit() {},
//
delInfo(){},
delInfo() {},
// table
tableRowClassName({row, rowIndex}){
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 !== 0) {
return 'evenNumber-row';
return "evenNumber-row";
}
return '';
return "";
},
//
cancalDebounce(){
const element = document.getElementById('L-size-main'); // ID
const header = document.getElementById('L-header'); // ID
const pagination = document.getElementById('L-pagination'); // ID
cancalDebounce() {
const element = document.getElementById("L-size-main"); // ID
const header = document.getElementById("L-header"); // ID
const pagination = document.getElementById("L-pagination"); // ID
const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight - 110;
}
},
},
}
};
</script>

@ -1,8 +1,20 @@
<!-- 资产管理 -- 小程序 -->
<template>
<el-row :gutter="20" style="height: 100%;background-color: #F2F4F6;display: flex;">
<el-row
:gutter="20"
style="height: 100%; background-color: #f2f4f6; display: flex"
>
<!--部门数据-->
<el-col :span="3" :xs="24" style="margin-right: 10px;height: 100%; background-color: #fff;padding-top: 20px;">
<el-col
:span="3"
:xs="24"
style="
margin-right: 10px;
height: 100%;
background-color: #fff;
padding-top: 20px;
"
>
<div class="head-container">
<el-tree
:data="deptOptions"
@ -17,20 +29,33 @@
/>
</div>
</el-col>
<el-col :span="20" :xs="24" style="height: 100%;flex: 1;">
<el-col :span="20" :xs="24" style="height: 100%; flex: 1">
<div class="L-main" id="L-size-main">
<div class="content-search" id="L-header">
<div class="search-title">查询条件</div>
<el-form :inline="true" ref="queryForm" :model="formInline" size="small" class="demo-form-inline" label-width="100px">
<el-form
:inline="true"
ref="queryForm"
:model="formInline"
size="small"
class="demo-form-inline"
label-width="100px"
>
<el-row>
<el-col :span="6">
<el-form-item label="所属单位:" prop="dwmc">
<el-input v-model="formInline.dwmc" placeholder="请输入所属单位"></el-input>
<el-input
v-model="formInline.dwmc"
placeholder="请输入所属单位"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="小程序名称:" prop="xcxmc">
<el-input v-model="formInline.xcxmc" placeholder="请输入小程序名称"></el-input>
<el-input
v-model="formInline.xcxmc"
placeholder="请输入小程序名称"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
@ -47,10 +72,17 @@
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6" style="text-align: right;">
<el-col :span="6" style="text-align: right">
<el-form-item class="unit-form">
<el-button size="mini" @click="resetQuery('queryFrom')"></el-button>
<el-button size="mini" type="primary" @click="handleQuery('queryFrom')"></el-button>
<el-button size="mini" @click="resetQuery('queryFrom')"
>重置</el-button
>
<el-button
size="mini"
type="primary"
@click="handleQuery('queryFrom')"
>查询</el-button
>
</el-form-item>
</el-col>
</el-row>
@ -78,7 +110,9 @@
</div>
<main>
<div class="search-title">
<span class="search-title-span">资产列表</span>
<span class="search-title-span"
>资产列表蓝色为单位新增资产</span
>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
@ -87,7 +121,8 @@
icon="el-icon-upload2"
size="mini"
@click="handleImport"
>导入</el-button>
>导入</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -96,7 +131,8 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
>导出</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -105,61 +141,148 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增资产</el-button>
>新增资产</el-button
>
</el-col>
</el-row>
</div>
<section>
<el-table v-loading="loading" :data="tableData" :height="tabHeader" :row-class-name="tableRowClassName" :max-height="tabHeader">
<el-table-column type="index" width="50" label="序号" align="center"/>
<el-table-column label="小程序名称" key="xcxmc" prop="xcxmc" align="center">
<!-- <template slot-scope="scope">
<dict-tag :options="dict.type.zc_xtlx" :value="scope.row.xtlx"/>
</template> -->
<el-table
v-loading="loading"
:data="tableData"
:height="tabHeader"
:row-class-name="tableRowClassName"
:max-height="tabHeader"
>
<el-table-column
type="index"
width="50"
label="序号"
align="center"
/>
<el-table-column
label="小程序名称"
key="xcxmc"
prop="xcxmc"
align="center"
>
<template slot-scope="scope">
<span
:style="{ color: scope.row.xzType == 1 ? 'blue' : '' }"
>{{ scope.row.xcxmc }}</span
>
</template>
</el-table-column>
<el-table-column label="所属单位" key="ssdw" prop="ssdw" align="center" />
<el-table-column
label="所属单位"
key="ssdw"
prop="ssdw"
align="center"
/>
<!-- <el-table-column label="单位名称" key="dwmc" prop="dwmc" align="center">
</el-table-column> -->
<!-- <el-table-column label="新增时间" key="createTime" prop="createTime" align="center" /> -->
<el-table-column label="小程序状态" key="state" prop="state" class-name="table-status" align="center">
<el-table-column
label="小程序状态"
key="state"
prop="state"
class-name="table-status"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.state == 1" style="color: #16B771;">
<span v-if="scope.row.state == 1" style="color: #16b771">
正常
</span>
<span v-if="scope.row.state == 2" style="color: #F58A0C;">
<span v-if="scope.row.state == 2" style="color: #f58a0c">
注销
</span>
<span v-if="scope.row.state == 3" style="color: #1485EF;">
<span v-if="scope.row.state == 3" style="color: #1485ef">
迁移
</span>
<span v-if="scope.row.state == 4" style="color: #29A07A;">
<span v-if="scope.row.state == 4" style="color: #29a07a">
受限
</span>
<span v-if="scope.row.state == 5" style="color: #F50C0C;">
<span v-if="scope.row.state == 5" style="color: #f50c0c">
违规
</span>
<span v-if="scope.row.state == 6" style="color: #F58A0C;">
<span v-if="scope.row.state == 6" style="color: #f58a0c">
未知
</span>
<span v-if="scope.row.state == 7" style="color: #F50C0C;">
<span v-if="scope.row.state == 7" style="color: #f50c0c">
关停
</span>
</template>
</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">
<div style="display: flex;align-items: center;justify-content: center;">
<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;">
<span class="look-info" style="color: #1485EF;margin-right: 15px;">查看</span>
<div
style="
display: flex;
align-items: center;
justify-content: center;
"
>
<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"
/>
<span
class="look-info"
style="color: #1485ef; margin-right: 15px"
>查看</span
>
</div>
<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;">
<span class="look-info" style="color: #1485EF;margin-right: 15px;">编辑</span>
<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"
/>
<span
class="look-info"
style="color: #1485ef; margin-right: 15px"
>编辑</span
>
</div>
<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;">
<span class="look-info" style="color: #F50C0C;margin-right: 15px;">删除</span>
<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"
/>
<span
class="look-info"
style="color: #f50c0c; margin-right: 15px"
>删除</span
>
</div>
</div>
</template>
@ -176,7 +299,12 @@
></my-pagination>
</main>
<!-- 资产导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1"
@ -190,13 +318,21 @@
drag
>
<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" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div> -->
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
@ -209,33 +345,37 @@
</el-row>
</template>
<script>
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 { miniProgramsList, deleteMiniPrograms, schema } from "@/api/auditPagesApi/index";
import {
miniProgramsList,
deleteMiniPrograms,
schema,
} from "@/api/auditPagesApi/index";
export default {
dicts: ['gzh_state'],
components:{myPagination},
dicts: ["gzh_state"],
components: { myPagination },
data() {
return {
//
deptOptions: undefined,
defaultProps: {
children: "children",
label: "label"
label: "label",
},
formInline:{
dwmc:"",
xcxmc:"",
startTime:"",
endTime:"",
current:1,
size:10,
formInline: {
dwmc: "",
xcxmc: "",
startTime: "",
endTime: "",
current: 1,
size: 10,
},
time:[],
total:0,
tableData:[],
loading:false,
time: [],
total: 0,
tableData: [],
loading: false,
tabHeader: undefined,
//
upload: {
@ -251,29 +391,29 @@ export default {
headers: { Authorization: "Bearer " + getToken() },
//
// url: process.env.VUE_APP_BASE_API + "/tc/miniPrograms/importData"
url: location.origin + "/api/tc/miniPrograms/importData"
url: location.origin + "/api/tc/miniPrograms/importData",
},
}
};
},
mounted(){
if( Object.keys(this.$route.params).length != 0) {
mounted() {
if (Object.keys(this.$route.params).length != 0) {
this.formInline = this.$route.params;
}else{
this.formInline.current = 1
this.formInline.size = 20
} else {
this.formInline.current = 1;
this.formInline.size = 20;
}
this.getList();
this.getDeptTree();
this.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
window.addEventListener("resize", this.cancalDebounce);
},
destroyed() {
window.removeEventListener('resize', this.cancalDebounce);
window.removeEventListener("resize", this.cancalDebounce);
},
methods:{
methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
schema({type:1}).then(response => {
schema({ type: 1 }).then((response) => {
this.deptOptions = response.data;
});
},
@ -288,16 +428,16 @@ export default {
this.handleQuery();
},
//
getList(){
getList() {
this.loading = true;
miniProgramsList(this.formInline).then(res=>{
miniProgramsList(this.formInline).then((res) => {
this.loading = false;
this.total = res.data.total;
this.tableData = res.data.records;
})
});
},
//
resetQuery(){
resetQuery() {
this.resetForm("queryForm");
this.time = [];
this.formInline.deptId = undefined;
@ -305,34 +445,41 @@ export default {
this.handleQuery();
},
//
handleQuery(){
handleQuery() {
this.formInline.current = 1;
if(this.time) {
this.formInline.startTime = this.time[0]
this.formInline.endTime = this.time[1]
if (this.time) {
this.formInline.startTime = this.time[0];
this.formInline.endTime = this.time[1];
}
this.getList();
},
//
getPagination(pages){
getPagination(pages) {
this.formInline.current = pages.page;
this.formInline.size = pages.limit;
this.getList();
},
//
handleImport(){
handleImport() {
this.upload.open = true;
},
//
handleExport(){
this.download('/tc/miniPrograms/export', {
...this.formInline
}, `小程序资产${new Date().getTime()}.xlsx`)
handleExport() {
this.download(
"/tc/miniPrograms/export",
{
...this.formInline,
},
`小程序资产${new Date().getTime()}.xlsx`
);
},
/** 下载模板操作 */
importTemplate() {
this.download('/tc/miniPrograms/importTemplate', {
}, `小程序资产导入模板${new Date().getTime()}.xlsx`)
this.download(
"/tc/miniPrograms/importTemplate",
{},
`小程序资产导入模板${new Date().getTime()}.xlsx`
);
},
//
handleFileUploadProgress(event, file, fileList) {
@ -343,7 +490,13 @@ export default {
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.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
@ -351,60 +504,72 @@ export default {
this.$refs.upload.submit();
},
//
handleAdd(){
this.$router.push({name: 'AssetsAuth',query: {
pageType: "add",
type:1,
}})
handleAdd() {
this.$router.push({
name: "AssetsAuth",
query: {
pageType: "add",
type: 1,
},
});
},
//
goInfo(row,id){
if(id == 1) {
this.$router.push({name: 'AssetsAuth',query: {
pageType: "look",
type:1,
id:row.id,
queryData:this.formInline
}})
} else if(id == 2) {
this.$router.push({name: 'AssetsAuth',query: {
pageType: "change",
type:1,
id:row.id,
queryData:this.formInline
}})
} else if(id == 3) {
goInfo(row, id) {
if (id == 1) {
this.$router.push({
name: "AssetsAuth",
query: {
pageType: "look",
type: 1,
id: row.id,
queryData: this.formInline,
},
});
} else if (id == 2) {
this.$router.push({
name: "AssetsAuth",
query: {
pageType: "change",
type: 1,
id: row.id,
queryData: this.formInline,
},
});
} else if (id == 3) {
const userIds = row.id;
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
return deleteMiniPrograms(userIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
this.$modal
.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?')
.then(function () {
return deleteMiniPrograms(userIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}
},
//
edit(){
},
edit() {},
//
delInfo(){},
delInfo() {},
// table
tableRowClassName({row, rowIndex}){
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 !== 0) {
return 'evenNumber-row';
return "evenNumber-row";
}
return '';
return "";
},
//
cancalDebounce(){
const element = document.getElementById('L-size-main'); // ID
const header = document.getElementById('L-header'); // ID
const pagination = document.getElementById('L-pagination'); // ID
cancalDebounce() {
const element = document.getElementById("L-size-main"); // ID
const header = document.getElementById("L-header"); // ID
const pagination = document.getElementById("L-pagination"); // ID
const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight - 110;
}
},
},
}
};
</script>

Loading…
Cancel
Save