资产管理

main
严飞永 2 days ago
parent cb884c9460
commit 9fc8239c82

@ -18,4 +18,10 @@ onMounted(() => {
:root {
--el-menu-item-height: 30px;
}
/* 饿了么查询表单样式 */
.el-form-item__label {
font-size: 14px;
color: #606266;
font-weight: bold;
}
</style>

@ -59,6 +59,7 @@
.unit-form {
.el-form-item__content {
width: 100%;
margin-left: 15px;
}
}
}
@ -73,7 +74,7 @@
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F2F4F6;
padding: 0px 10px 0px 0px;
padding: 0px 10px 10px 0px;
.search-title-span {
font-family: Alibaba PuHuiTi;

@ -1,15 +1,26 @@
<!-- 资产管理 -- 电子邮件 -->
<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"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
ref="treeRef"
node-key="id"
default-expand-all
highlight-current
@ -17,24 +28,55 @@
/>
</div>
</el-col>
<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">
<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="queryFormRef"
:model="formInline"
:size="size"
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-form-item
label="所属单位:"
prop="dwmc"
>
<el-input
v-model="formInline.dwmc"
placeholder="请输入所属单位"
/>
</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-form-item
label="电子邮箱后缀:"
prop="dzyxhz"
>
<el-input
v-model="formInline.dzyxhz"
placeholder="请输入电子邮箱后缀"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="新增时间:" prop="time">
<el-form-item
label="新增时间:"
prop="time"
>
<el-date-picker
v-model="time"
format="yyyy-MM-dd HH:mm:ss"
@ -43,131 +85,187 @@
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="请选择"
>
</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 @click="resetQuery"></el-button>
<el-button
type="primary"
@click="handleQuery"
>查询</el-button
>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>
<el-col :span="8">
<el-form-item label="单位名称:" prop="dwmc">
<el-input v-model="formInline.dwmc" placeholder="请输入单位名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="系统状态:" prop="xtzt">
<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">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" style="text-align: right;padding-right: 50px;">
<el-form-item>
<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> -->
</el-form>
</div>
<main>
<div class="search-title">
<span class="search-title-span">资产列表</span>
<el-row :gutter="10" class="mb8">
<span class="search-title-span"
>资产列表蓝色为单位新增资产</span
>
<el-row
:gutter="10"
class="mb8"
>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
:icon="Upload"
@click="handleImport"
>导入</el-button>
>导入</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:icon="Download"
@click="handleExport"
>导出</el-button>
>导出</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
:icon="Plus"
@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">
<!-- <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">
<template slot-scope="scope">
<span v-if="scope.row.yjxtzc == 1" style="color: #16B771;">
<el-table
v-loading="loading"
:data="tableData"
:height="tabHeader"
:row-class-name="tableRowClassName"
:max-height="tabHeader"
>
<el-table-column
type="index"
width="60"
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-column
label="新增时间"
key="createTime"
prop="createTime"
align="center"
/>
<el-table-column
label="邮件系统状态"
key="status"
prop="status"
class-name="table-status"
align="center"
>
<template #default="{ row }">
<span
v-if="row.yjxtzc == 1"
style="color: #16b771"
>
正常
</span>
<span v-if="scope.row.yjxtzc == 2" style="color: #F58A0C;">
<span
v-if="row.yjxtzc == 2"
style="color: #f58a0c"
>
关停
</span>
</template>
</el-table-column>
<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>
<el-table-column
label="操作"
prop="userId"
class-name="table-operation"
align="center"
>
<template #default="{ row }">
<div class="operation-container">
<div
class="operation-item"
@click="goInfo(row, 1)"
>
<img
src="@/assets/images/icon-ck@2x.png"
alt="查看"
class="operation-icon"
/>
<span class="look-info">查看</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
class="operation-item"
@click="goInfo(row, 2)"
>
<img
src="@/assets/images/edit.png"
alt="编辑"
class="operation-icon edit-icon"
/>
<span class="look-info">编辑</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
class="operation-item"
@click="goInfo(row, 3)"
>
<img
src="@/assets/images/del.png"
alt="删除"
class="operation-icon"
/>
<span class="look-info delete-text">删除</span>
</div>
</div>
</template>
</el-table-column>
</el-table>
</section>
<my-pagination
<my-pagination
id="L-pagination"
:total="total"
:page="formInline.current"
:limit="formInline.size"
@pagination="getPagination"
:current-page.sync="formInline.current"
></my-pagination>
v-model:current-page="formInline.current"
/>
</main>
<!-- 资产导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-dialog
:title="upload.title"
v-model="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
ref="uploadRef"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
@ -178,223 +276,328 @@
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<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-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">
将文件拖到此处<em>点击上传</em>
</div>
<template #tip>
<div class="el-upload__tip text-center">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</template>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
<template #footer>
<div class="dialog-footer">
<el-button
type="primary"
@click="submitFileForm"
> </el-button
>
<el-button @click="upload.open = false"> </el-button>
</div>
</template>
</el-dialog>
</div>
</el-col>
</el-row>
</template>
<script>
import myPagination from "@/views/components/Pagination/index.vue"
// import myDialog from "@/views/components/myDialog/index.vue"
<script setup>
import { ref, reactive, onMounted, onUnmounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import { ElMessage, ElMessageBox } from "element-plus";
import { Upload, Download, Plus } from "@element-plus/icons-vue";
import { getToken } from "@/utils/auth";
import { assetEmailList, deleteAssetEmail, schema } from "@/api/auditPagesApi/index";
export default {
dicts: ['zc_xtzt','zc_xtlx'],
components:{myPagination},
data() {
return {
//
deptOptions: undefined,
defaultProps: {
children: "children",
label: "label"
},
formInline:{
dzyxhz:"",
dwmc:"",
startTime:"",
endTime:"",
current:1,
size:10,
},
time:[],
total:0,
tableData:[],
loading:false,
tabHeader: undefined,
//
upload: {
//
open: false,
//
title: "电子邮件资产导入",
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
//
// url: process.env.VUE_APP_BASE_API + "/tc/assetEmail/importData"
url: location.origin + "/api/tc/assetEmail/importData"
},
}
},
mounted(){
if( Object.keys(this.$route.params).length != 0) {
this.formInline = this.$route.params;
}else{
this.formInline.current = 1
this.formInline.size = 20
}
this.getList();
this.getDeptTree();
this.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
},
destroyed() {
window.removeEventListener('resize', this.cancalDebounce);
},
methods:{
/** 查询部门下拉树结构 */
getDeptTree() {
schema({type:3}).then(response => {
this.deptOptions = response.data;
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
import {
assetEmailList,
deleteAssetEmail,
schema,
} from "@/api/auditPagesApi/index";
import myPagination from "@/views/components/Pagination/index.vue";
const router = useRouter();
const route = useRoute();
//
const deptOptions = ref([]);
const defaultProps = {
children: "children",
label: "label",
};
const formInline = reactive({
dzyxhz: "",
dwmc: "",
startTime: "",
endTime: "",
current: 1,
size: 10,
deptId: undefined,
});
const time = ref([]);
const total = ref(0);
const tableData = ref([]);
const loading = ref(false);
const tabHeader = ref(undefined);
const treeRef = ref(null);
const queryFormRef = ref(null);
const uploadRef = ref(null);
//
const upload = reactive({
open: false,
title: "电子邮件资产导入",
isUploading: false,
updateSupport: 0,
headers: { Authorization: "Bearer " + getToken() },
url:
import.meta.env.VITE_APP_HJ === "test"
? import.meta.env.VITE_APP_BASE_API +
"/tc/assetOfficialAccount/importData"
: location.origin + "/api/tc/assetOfficialAccount/importData",
});
//
onMounted(() => {
if (Object.keys(route.params).length !== 0) {
Object.assign(formInline, route.params);
} else {
formInline.current = 1;
formInline.size = 20;
}
getList();
getDeptTree();
cancalDebounce();
window.addEventListener("resize", cancalDebounce);
});
onUnmounted(() => {
window.removeEventListener("resize", cancalDebounce);
});
//
/** 查询部门下拉树结构 */
const getDeptTree = async () => {
try {
const response = await schema({ type: 3 });
deptOptions.value = response.data;
} catch (error) {
console.error("获取部门树失败:", error);
}
};
//
const filterNode = (value, data) => {
if (!value) return true;
return data.label.includes(value);
};
//
const handleNodeClick = (data) => {
formInline.deptId = data.id;
handleQuery();
};
//
const getList = async () => {
try {
loading.value = true;
const res = await assetEmailList(formInline);
tableData.value = res.data.records;
total.value = res.data.total;
} catch (error) {
console.error("获取列表失败:", error);
} finally {
loading.value = false;
}
};
//
const resetQuery = () => {
queryFormRef.value?.resetFields();
time.value = [];
formInline.deptId = undefined;
treeRef.value?.setCurrentKey(null);
handleQuery();
};
//
const handleQuery = () => {
formInline.current = 1;
if (time.value) {
[formInline.startTime, formInline.endTime] = time.value;
}
getList();
};
//
const getPagination = (pages) => {
formInline.current = pages.page;
formInline.size = pages.limit;
getList();
};
//
const handleImport = () => {
upload.open = true;
};
//
const handleExport = () => {
download(
"/tc/assetEmail/export",
{
...formInline,
},
//
handleNodeClick(data) {
this.formInline.deptId = data.id;
this.handleQuery();
`电子邮件资产${new Date().getTime()}.xlsx`
);
};
/** 下载模板操作 */
const importTemplate = () => {
download(
"/tc/assetEmail/importTemplate",
{},
`电子邮件资产导入模板${new Date().getTime()}.xlsx`
);
};
//
const handleFileUploadProgress = () => {
upload.isUploading = true;
};
//
const handleFileSuccess = (response) => {
upload.open = false;
upload.isUploading = false;
uploadRef.value?.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 = () => {
uploadRef.value?.submit();
};
//
const handleAdd = () => {
router.push({
name: "AssetsAuth",
query: {
pageType: "add",
type: 3,
},
//
getList(){
this.loading = true;
assetEmailList(this.formInline).then(res=>{
this.loading = false;
this.total = res.data.total;
this.tableData = res.data.records;
});
};
//
const goInfo = (row, id) => {
if (id === 1) {
router.push({
name: "AssetsAuth",
query: {
pageType: "look",
type: 3,
id: row.id,
queryData: formInline,
},
});
} else if (id === 2) {
router.push({
name: "AssetsAuth",
query: {
pageType: "change",
type: 3,
id: row.id,
queryData: formInline,
},
});
} else if (id === 3) {
const userIds = row.id;
ElMessageBox.confirm(`是否确认删除编号为"${userIds}"的数据项?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => deleteAssetEmail(userIds))
.then(() => {
getList();
ElMessage.success("删除成功");
})
},
//
resetQuery(){
this.resetForm("queryForm");
this.time = [];
this.formInline.deptId = undefined;
this.$refs.tree.setCurrentKey(null);
this.handleQuery();
},
//
handleQuery(){
this.formInline.current = 1;
if(this.time) {
this.formInline.startTime = this.time[0]
this.formInline.endTime = this.time[1]
}
this.getList();
},
//
getPagination(pages){
this.formInline.current = pages.page;
this.formInline.size = pages.limit;
this.getList();
},
//
handleImport(){
this.upload.open = true;
},
//
handleExport(){
this.download('/tc/assetEmail/export', {
...this.formInline
}, `电子邮件资产${new Date().getTime()}.xlsx`)
},
/** 下载模板操作 */
importTemplate() {
this.download('/tc/assetEmail/importTemplate', {
}, `电子邮件资产导入模板${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
},
//
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) {
const userIds = row.id;
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
return deleteAssetEmail(userIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
},
//
edit(){
},
//
delInfo(){},
// table
tableRowClassName({row, rowIndex}){
if (rowIndex % 2 !== 0) {
return 'evenNumber-row';
}
return '';
},
//
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;
}
},
}
.catch(() => {});
}
};
// table
const tableRowClassName = ({ rowIndex }) => {
return rowIndex % 2 !== 0 ? "evenNumber-row" : "";
};
//
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 || 0;
const headerHeight = header?.offsetHeight || 0;
const paginationtHeight = pagination?.offsetHeight || 0;
tabHeader.value = elementHeight - headerHeight - paginationtHeight - 110;
};
// ()
const download = (url, params, fileName) => {
//
console.log("下载功能:", url, params, fileName);
};
</script>
<style scoped>
.operation-container {
display: flex;
justify-content: center;
align-items: center;
gap: 15px; /* 控制图标之间的间距 */
}
.operation-item {
display: flex;
align-items: center;
cursor: pointer;
}
.operation-icon {
width: 15px;
margin-right: 5px;
}
.look-info {
font-size: 14px;
color: #409eff;
}
.look-info:hover {
text-decoration: underline;
}
.edit-icon {
width: 15px;
}
.delete-text {
color: #f50c0c;
}
</style>

@ -117,7 +117,7 @@
</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 type="index" width="60" 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">
<template slot-scope="scope">

@ -116,7 +116,7 @@
</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 type="index" width="60" 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-column label="icp备案状态" key="dwmc" prop="dwmc" align="center">

@ -1,8 +1,19 @@
<!-- 资产管理 -- 公众号 -->
<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,24 +28,57 @@
/>
</div>
</el-col>
<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">
<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="size"
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-form-item
label="所属单位:"
prop="dwmc"
>
<el-input
v-model="formInline.dwmc"
style="width: 95%"
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-form-item
label="公众号名称:"
prop="gzhmc"
>
<el-input
v-model="formInline.gzhmc"
placeholder="请输入公众号名称"
style="width: 95%"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="新增时间:" prop="time">
<el-form-item
label="新增时间:"
prop="time"
>
<el-date-picker
v-model="time"
format="yyyy-MM-dd HH:mm:ss"
@ -43,146 +87,262 @@
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="请选择"
>
</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 @click="resetQuery"></el-button>
<el-button
type="primary"
@click="handleQuery"
>查询</el-button
>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>
<el-col :span="8">
<el-form-item label="单位名称:" prop="dwmc">
<el-input v-model="formInline.dwmc" placeholder="请输入单位名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="系统状态:" prop="xtzt">
<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">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" style="text-align: right;padding-right: 50px;">
<el-form-item>
<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> -->
</el-form>
</div>
<main>
<div class="search-title">
<span class="search-title-span">资产列表</span>
<el-row :gutter="10" class="mb8">
<span class="search-title-span"
>资产列表蓝色为单位新增资产</span
>
<el-row
:gutter="10"
class="mb8"
>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
:icon="Upload"
size="medium"
@click="handleImport"
>导入</el-button>
>导入</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:icon="Download"
size="medium"
@click="handleExport"
>导出</el-button>
>导出</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
:icon="Plus"
size="medium"
@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-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">
<template slot-scope="scope">
<span v-if="scope.row.gzhzt == 1" style="color: #16B771;">
<el-table
v-loading="loading"
:data="tableData"
:height="tabHeader"
:row-class-name="tableRowClassName"
:max-height="tabHeader"
>
<el-table-column
type="index"
width="60"
label="序号"
align="center"
/>
<el-table-column
label="公众号名称"
key="gzhmc"
prop="gzhmc"
align="center"
>
<template #default="{ row }">
<span :style="{ color: row.xzType == 1 ? 'blue' : '' }">
{{ row.gzhmc }}
</span>
</template>
</el-table-column>
<el-table-column
label="所属单位"
key="ssdw"
prop="ssdw"
align="center"
/>
<el-table-column
label="新增时间"
key="createTime"
prop="createTime"
align="center"
/>
<el-table-column
label="平台类型"
key="ptlx"
prop="ptlx"
align="center"
>
<template #default="scope">
<dict-tag
:options="dict.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 #default="scope">
<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">
<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>
<el-table-column
label="操作"
prop="userId"
class-name="table-operation"
align="center"
width="250"
>
<template #default="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>
<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>
</el-table-column>
</el-table>
</section>
<my-pagination
<my-pagination
id="L-pagination"
:total="total"
:page="formInline.current"
:limit="formInline.size"
@pagination="getPagination"
:current-page.sync="formInline.current"
></my-pagination>
:current-page.sync="formInline.current"
/>
</main>
<!-- 资产导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-dialog
:title="upload.title"
v-model="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1"
@ -195,223 +355,294 @@
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<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-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">
将文件拖到此处<em>点击上传</em>
</div>
<template #tip>
<div class="el-upload__tip text-center">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</template>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
<template #footer>
<div class="dialog-footer">
<el-button
type="primary"
@click="submitFileForm"
> </el-button
>
<el-button @click="upload.open = false"> </el-button>
</div>
</template>
</el-dialog>
</div>
</el-col>
</el-row>
</template>
<script>
import myPagination from "@/views/components/Pagination/index.vue"
// import myDialog from "@/views/components/myDialog/index.vue"
<script setup>
import { ref, reactive, onMounted, onUnmounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import { getToken } from "@/utils/auth";
import { assetOfficialAccountList, deleteAssetOfficialAccount, schema } from "@/api/auditPagesApi/index";
export default {
dicts: ['zc_xtzt','zc_xtlx','sys_ptlx_type'],
components:{myPagination},
data() {
return {
//
deptOptions: undefined,
defaultProps: {
children: "children",
label: "label"
},
formInline:{
gzhmc:"",
dwmc:"",
startTime:"",
endTime:"",
current:1,
size:10,
},
time:[],
total:0,
tableData:[],
loading:false,
tabHeader: undefined,
//
upload: {
//
open: false,
//
title: "公众号资产导入",
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
//
// url: process.env.VUE_APP_BASE_API + "/tc/assetOfficialAccount/importData"
url: location.origin + "/api/tc/assetOfficialAccount/importData"
},
}
},
mounted(){
if( Object.keys(this.$route.params).length != 0) {
this.formInline = this.$route.params;
}else{
this.formInline.current = 1
this.formInline.size = 20
}
this.getList();
this.getDeptTree();
this.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
},
destroyed() {
window.removeEventListener('resize', this.cancalDebounce);
},
methods:{
/** 查询部门下拉树结构 */
getDeptTree() {
schema({type:2}).then(response => {
this.deptOptions = response.data;
});
import { Upload, Download, Plus } from "@element-plus/icons-vue";
import {
assetOfficialAccountList,
deleteAssetOfficialAccount,
schema,
} from "@/api/auditPagesApi/index";
import myPagination from "@/views/components/Pagination/index.vue";
import DictTag from "@/components/DictTag/index.vue";
const router = useRouter();
const route = useRoute();
//
const deptOptions = ref(undefined);
const defaultProps = reactive({
children: "children",
label: "label",
});
const formInline = reactive({
gzhmc: "",
dwmc: "",
startTime: "",
endTime: "",
current: 1,
size: 10,
deptId: undefined,
});
const time = ref([]);
const total = ref(0);
const tableData = ref([]);
const loading = ref(false);
const tabHeader = ref(undefined);
const tree = ref(null);
const queryForm = ref(null);
const uploadRef = ref(null);
//
const upload = reactive({
open: false,
title: "公众号资产导入",
isUploading: false,
updateSupport: 0,
headers: { Authorization: "Bearer " + getToken() },
url:
import.meta.env.VITE_APP_HJ === "test"
? import.meta.env.VITE_APP_BASE_API +
"/tc/assetOfficialAccount/importData"
: location.origin + "/api/tc/assetOfficialAccount/importData",
});
//
const dict = reactive({
sys_ptlx_type: [],
});
//
onMounted(() => {
if (Object.keys(route.params).length !== 0) {
Object.assign(formInline, route.params);
} else {
formInline.current = 1;
formInline.size = 20;
}
getList();
getDeptTree();
cancalDebounce();
window.addEventListener("resize", cancalDebounce);
});
onUnmounted(() => {
window.removeEventListener("resize", cancalDebounce);
});
//
/** 查询部门下拉树结构 */
const getDeptTree = async () => {
try {
const response = await schema({ type: 2 });
deptOptions.value = response.data;
} catch (error) {
console.error("获取部门树失败:", error);
}
};
//
const filterNode = (value, data) => {
if (!value) return true;
return data.label.indexOf(value) !== -1;
};
//
const handleNodeClick = (data) => {
formInline.deptId = data.id;
handleQuery();
};
//
const getList = async () => {
try {
loading.value = true;
const res = await assetOfficialAccountList(formInline);
tableData.value = res.data.records;
total.value = res.data.total;
} catch (error) {
console.error("获取列表失败:", error);
} finally {
loading.value = false;
}
};
//
const resetQuery = () => {
queryForm.value.resetFields();
time.value = [];
formInline.deptId = undefined;
tree.value.setCurrentKey(null);
handleQuery();
};
//
const handleQuery = () => {
formInline.current = 1;
if (time.value) {
formInline.startTime = time.value[0];
formInline.endTime = time.value[1];
}
getList();
};
//
const getPagination = (pages) => {
formInline.current = pages.page;
formInline.size = pages.limit;
getList();
};
//
const handleImport = () => {
upload.open = true;
};
//
const handleExport = () => {
download(
"/tc/assetOfficialAccount/export",
{
...formInline,
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
`公众号资产${new Date().getTime()}.xlsx`
);
};
/** 下载模板操作 */
const importTemplate = () => {
download(
"/tc/assetOfficialAccount/importTemplate",
{},
`公众号资产导入模板${new Date().getTime()}.xlsx`
);
};
//
const handleFileUploadProgress = (event, file, fileList) => {
upload.isUploading = true;
};
//
const handleFileSuccess = (response, file, fileList) => {
upload.open = false;
upload.isUploading = false;
uploadRef.value.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 = () => {
uploadRef.value.submit();
};
//
const handleAdd = () => {
router.push({
name: "AssetsAuth",
query: {
pageType: "add",
type: 2,
},
//
handleNodeClick(data) {
this.formInline.deptId = data.id;
this.handleQuery();
},
//
getList(){
this.loading = true;
assetOfficialAccountList(this.formInline).then(res=>{
this.loading = false;
this.total = res.data.total;
this.tableData = res.data.records;
});
};
//
const goInfo = (row, id) => {
if (id === 1) {
router.push({
name: "AssetsAuth",
query: {
pageType: "look",
type: 2,
id: row.id,
queryData: formInline,
},
});
} else if (id === 2) {
router.push({
name: "AssetsAuth",
query: {
pageType: "change",
type: 2,
id: row.id,
queryData: formInline,
},
});
} else if (id === 3) {
const userIds = row.id;
ElMessageBox.confirm(`是否确认删除用户编号为"${userIds}"的数据项?`)
.then(() => deleteAssetOfficialAccount(userIds))
.then(() => {
getList();
ElMessage.success("删除成功");
})
},
//
resetQuery(){
this.resetForm("queryForm");
this.time = [];
this.formInline.deptId = undefined;
this.$refs.tree.setCurrentKey(null);
this.handleQuery();
},
//
handleQuery(){
this.formInline.current = 1;
if(this.time) {
this.formInline.startTime = this.time[0]
this.formInline.endTime = this.time[1]
}
this.getList();
},
//
getPagination(pages){
this.formInline.current = pages.page;
this.formInline.size = pages.limit;
this.getList();
},
//
handleImport(){
this.upload.open = true;
},
//
handleExport(){
this.download('/tc/assetOfficialAccount/export', {
...this.formInline
}, `公众号资产${new Date().getTime()}.xlsx`)
},
/** 下载模板操作 */
importTemplate() {
this.download('/tc/assetOfficialAccount/importTemplate', {
}, `公众号资产导入模板${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
},
//
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) {
const userIds = row.id;
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
return deleteAssetOfficialAccount(userIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
},
//
edit(){
},
//
delInfo(){},
// table
tableRowClassName({row, rowIndex}){
if (rowIndex % 2 !== 0) {
return 'evenNumber-row';
}
return '';
},
//
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;
}
},
}
.catch(() => {});
}
};
// table
const tableRowClassName = ({ row, 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 || 0;
const headerHeight = header?.offsetHeight || 0;
const paginationtHeight = pagination?.offsetHeight || 0;
tabHeader.value = elementHeight - headerHeight - paginationtHeight - 110;
};
</script>
<style scoped>
/* 添加你的样式 */
</style>

@ -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,24 +29,57 @@
/>
</div>
</el-col>
<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">
<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="size"
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-form-item
label="所属单位:"
prop="dwmc"
>
<el-input
v-model="formInline.dwmc"
placeholder="请输入所属单位"
style="width: 95%;"
></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-form-item
label="小程序名称:"
prop="xcxmc"
>
<el-input
v-model="formInline.xcxmc"
placeholder="请输入小程序名称"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="新增时间:" prop="time">
<el-form-item
label="新增时间:"
prop="time"
>
<el-date-picker
v-model="time"
format="yyyy-MM-dd HH:mm:ss"
@ -43,14 +88,25 @@
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="请选择"
>
</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,105 +134,226 @@
</div>
<main>
<div class="search-title">
<span class="search-title-span">资产列表</span>
<el-row :gutter="10" class="mb8">
<span class="search-title-span">资产列表蓝色为单位新增资产</span>
<el-row
:gutter="10"
class="mb8"
>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
:icon="Upload"
size="mini"
@click="handleImport"
>导入</el-button>
>导入</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
:icon="Download"
size="mini"
@click="handleExport"
>导出</el-button>
>导出</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
: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">
<el-table
v-loading="loading"
:data="tableData"
:height="tabHeader"
:row-class-name="tableRowClassName"
:max-height="tabHeader"
>
<el-table-column
type="index"
width="60"
label="序号"
align="center"
/>
<el-table-column
label="小程序名称"
key="xcxmc"
prop="xcxmc"
align="center"
>
<template #default="scope">
<span
:style="{ color: scope.row.xzType == 1 ? 'blue' : '' }"
>{{ scope.row.xcxmc }}</span
>
</template>
<!-- <template #default="scope">
<dict-tag :options="dict.type.zc_xtlx" :value="scope.row.xtlx"/>
</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">
<template slot-scope="scope">
<span v-if="scope.row.state == 1" style="color: #16B771;">
<el-table-column
label="小程序状态"
key="state"
prop="state"
class-name="table-status"
align="center"
>
<template #default="scope">
<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">
<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>
<el-table-column
label="操作"
prop="userId"
class-name="table-operation"
align="center"
>
<template #default="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>
<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>
</el-table-column>
</el-table>
</section>
<my-pagination
<my-pagination
id="L-pagination"
:total="total"
:page="formInline.current"
:limit="formInline.size"
@pagination="getPagination"
:current-page.sync="formInline.current"
:current-page.sync="formInline.current"
></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,17 +367,35 @@
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<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">
<el-button type="primary" @click="submitFileForm"> </el-button>
<div
slot="footer"
class="dialog-footer"
>
<el-button
type="primary"
@click="submitFileForm"
> </el-button
>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
@ -208,203 +403,219 @@
</el-col>
</el-row>
</template>
<script>
import myPagination from "@/views/components/Pagination/index.vue"
// import myDialog from "@/views/components/myDialog/index.vue"
<script setup>
import { Upload,Download,Plus } from '@element-plus/icons-vue'
import { ref, onMounted, onUnmounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import myPagination from "@/views/components/Pagination/index.vue";
import { getToken } from "@/utils/auth";
// import { miniProgramsList, deleteMiniPrograms, schema } from "@/api/auditPagesApi/index";
export default {
dicts: ['gzh_state'],
components:{myPagination},
data() {
return {
//
deptOptions: undefined,
defaultProps: {
children: "children",
label: "label"
},
formInline:{
dwmc:"",
xcxmc:"",
startTime:"",
endTime:"",
current:1,
size:10,
},
time:[],
total:0,
tableData:[],
loading:false,
tabHeader: undefined,
//
upload: {
//
open: false,
//
title: "小程序资产导入",
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
//
// url: process.env.VUE_APP_BASE_API + "/tc/miniPrograms/importData"
url: location.origin + "/api/tc/miniPrograms/importData"
},
}
},
mounted(){
if( Object.keys(this.$route.params).length != 0) {
this.formInline = this.$route.params;
}else{
this.formInline.current = 1
this.formInline.size = 20
}
this.getList();
this.getDeptTree();
this.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
},
destroyed() {
window.removeEventListener('resize', this.cancalDebounce);
},
methods:{
/** 查询部门下拉树结构 */
getDeptTree() {
schema({type:1}).then(response => {
this.deptOptions = response.data;
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
import {
miniProgramsList,
deleteMiniPrograms,
schema,
} from "@/api/auditPagesApi/index";
const router = useRouter();
const route = useRoute();
const size = ref('default')
//
const deptOptions = ref(undefined);
const defaultProps = {
children: "children",
label: "label",
};
const formInline = ref({
dwmc: "",
xcxmc: "",
startTime: "",
endTime: "",
current: 1,
size: 10,
});
const time = ref([]);
const total = ref(0);
const tableData = ref([]);
const loading = ref(false);
const tabHeader = ref(undefined);
const upload = ref({
open: false,
title: "小程序资产导入",
isUploading: false,
updateSupport: 0,
headers: { Authorization: "Bearer " + getToken() },
url:
import.meta.env.VITE_APP_HJ === "test"
? import.meta.env.VITE_APP_BASE_API +
"/tc/assetOfficialAccount/importData"
: location.origin + "/api/tc/assetOfficialAccount/importData",
});
function getDeptTree() {
schema({ type: 1 }).then((response) => {
deptOptions.value = response.data;
});
}
function filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
}
function handleNodeClick(data) {
formInline.value.deptId = data.id;
handleQuery();
}
function getList() {
loading.value = true;
miniProgramsList(formInline.value).then((res) => {
loading.value = false;
total.value = res.data.total;
tableData.value = res.data.records;
});
}
function resetQuery() {
// resetForm('queryForm') //
time.value = [];
formInline.value.deptId = undefined;
// this.$refs.tree.setCurrentKey(null)
handleQuery();
}
function handleQuery() {
formInline.value.current = 1;
if (time.value && time.value.length === 2) {
formInline.value.startTime = time.value[0];
formInline.value.endTime = time.value[1];
}
getList();
}
function getPagination(pages) {
formInline.value.current = pages.page;
formInline.value.size = pages.limit;
getList();
}
function handleImport() {
upload.value.open = true;
}
function handleExport() {
download(
"/tc/miniPrograms/export",
{
...formInline.value,
},
//
handleNodeClick(data) {
this.formInline.deptId = data.id;
this.handleQuery();
`小程序资产${new Date().getTime()}.xlsx`
);
}
function importTemplate() {
download(
"/tc/miniPrograms/importTemplate",
{},
`小程序资产导入模板${new Date().getTime()}.xlsx`
);
}
function handleFileUploadProgress(event, file, fileList) {
upload.value.isUploading = true;
}
function handleFileSuccess(response, file, fileList) {
upload.value.open = false;
upload.value.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 });
getList();
}
function submitFileForm() {
this.$refs.upload.submit();
}
function handleAdd() {
router.push({
name: "AssetsAuth",
query: {
pageType: "add",
type: 1,
},
//
getList(){
this.loading = true;
miniProgramsList(this.formInline).then(res=>{
this.loading = false;
this.total = res.data.total;
this.tableData = res.data.records;
});
}
function goInfo(row, id) {
if (id === 1) {
router.push({
name: "AssetsAuth",
query: {
pageType: "look",
type: 1,
id: row.id,
queryData: formInline.value,
},
});
} else if (id === 2) {
router.push({
name: "AssetsAuth",
query: {
pageType: "change",
type: 1,
id: row.id,
queryData: formInline.value,
},
});
} else if (id === 3) {
const userIds = row.id;
this.$modal
.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?')
.then(() => {
return deleteMiniPrograms(userIds);
})
},
//
resetQuery(){
this.resetForm("queryForm");
this.time = [];
this.formInline.deptId = undefined;
this.$refs.tree.setCurrentKey(null);
this.handleQuery();
},
//
handleQuery(){
this.formInline.current = 1;
if(this.time) {
this.formInline.startTime = this.time[0]
this.formInline.endTime = this.time[1]
}
this.getList();
},
//
getPagination(pages){
this.formInline.current = pages.page;
this.formInline.size = pages.limit;
this.getList();
},
//
handleImport(){
this.upload.open = true;
},
//
handleExport(){
this.download('/tc/miniPrograms/export', {
...this.formInline
}, `小程序资产${new Date().getTime()}.xlsx`)
},
/** 下载模板操作 */
importTemplate() {
this.download('/tc/miniPrograms/importTemplate', {
}, `小程序资产导入模板${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
},
//
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) {
const userIds = row.id;
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
return deleteMiniPrograms(userIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
},
//
edit(){
},
//
delInfo(){},
// table
tableRowClassName({row, rowIndex}){
if (rowIndex % 2 !== 0) {
return 'evenNumber-row';
}
return '';
},
//
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;
}
},
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}
}
function tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 !== 0) {
return "evenNumber-row";
}
return "";
}
function cancalDebounce() {
const element = document.getElementById("L-size-main");
const header = document.getElementById("L-header");
const pagination = document.getElementById("L-pagination");
const elementHeight = element?.offsetHeight || 0;
const headerHeight = header?.offsetHeight || 0;
const paginationtHeight = pagination?.offsetHeight || 0;
tabHeader.value = elementHeight - headerHeight - paginationtHeight - 110;
}
//
onMounted(() => {
if (Object.keys(route.params).length !== 0) {
formInline.value = route.params;
} else {
formInline.value.current = 1;
formInline.value.size = 20;
}
getDeptTree();
getList();
cancalDebounce();
window.addEventListener("resize", cancalDebounce);
});
onUnmounted(() => {
window.removeEventListener("resize", cancalDebounce);
});
</script>

@ -87,7 +87,7 @@
</el-form>
<section v-if="index == 1">
<el-table v-loading="loading" :data="tableData" :height="tabHeader" :max-height="tabHeader" :row-class-name="tableRowClassName">
<el-table-column type="index" width="50" label="序号" align="center"/>
<el-table-column type="index" width="60" label="序号" align="center"/>
<el-table-column label="资产名称" key="name" prop="name" align="center" />
<el-table-column label="资产类型" key="type" prop="type" align="center">
<!-- <template slot-scope="scope">
@ -126,7 +126,7 @@
</section>
<section v-if="index == 2">
<el-table v-loading="loading" :data="tableDataTwo" :height="tabHeader" :max-height="tabHeader" :row-class-name="tableRowClassName">
<el-table-column type="index" width="50" label="序号" align="center"/>
<el-table-column type="index" width="60" label="序号" align="center"/>
<el-table-column label="单位名称" key="unitName" width="200px" prop="unitName" align="center" />
<el-table-column label="核查资产数量" key="hczcsl" prop="hczcsl" align="center" />
<el-table-column label="完成数量" key="wcsl" prop="wcsl" align="center">

@ -62,7 +62,7 @@
<section>
<el-table v-loading="loading" :data="tableData" :height="tabHeader" :max-height="tabHeader"
:row-class-name="tableRowClassName">
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column type="index" width="60" label="序号" align="center" />
<el-table-column label="任务编号" key="number" width="200px" prop="number" align="center" />
<el-table-column label="任务名称" key="name" prop="name" align="center" />
<el-table-column label="任务下发时间" key="type" prop="type" align="center">
@ -181,7 +181,7 @@
<el-table v-loading="liebiaoloading" :data="liebiaotableData" :height="tabHeader" :max-height="tabHeader"
:row-class-name="tableRowClassName">
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column type="index" width="60" label="序号" align="center" />
<el-table-column label="任务编号" key="number" width="200px" prop="number" align="center" />
<el-table-column label="任务名称" key="name" prop="name" align="center" />
<el-table-column label="任务下发时间" key="type" prop="type" align="center">

@ -68,7 +68,7 @@
<section>
<el-table v-loading="loading" :data="tableData" :height="tabHeader" :max-height="tabHeader"
:row-class-name="tableRowClassName">
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column type="index" width="60" label="序号" align="center" />
<!-- <el-table-column label="任务编号" key="id" width="200px" prop="id" align="center" /> -->
<el-table-column label="任务名称" key="taskName" prop="taskName" align="center" />
<el-table-column label="任务下发时间" key="taskTime" prop="taskTime" align="center">

@ -125,7 +125,7 @@
</el-tab-pane>
</el-tabs>
<el-table v-loading="loading" :data="tableData" :height="tabHeader" :row-class-name="tableRowClassName">
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column type="index" width="60" label="序号" align="center" />
<!-- <el-table-column label="资产编号" key="id" width="200px" prop="id" align="center" /> -->
<el-table-column :label="xtmcName" prop="xtmc" align="center" />
<!-- <el-table-column label="系统类型" key="xtlx" prop="xtlx" align="center">
@ -196,7 +196,7 @@
</div>
<el-table v-loading="loading" :data="tableDataTwo" :height="tabHeader" :max-height="tabHeader"
:row-class-name="tableRowClassName" style="width: 100%">
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column type="index" width="60" label="序号" align="center" />
<el-table-column label="单位名称" key="dwmc" width="150px" prop="dwmc" align="center" />
<el-table-column label="完成状态" key="taskStatus" prop="taskStatus" class-name="table-status" align="center">
<template slot-scope="scope">

@ -51,7 +51,7 @@
<section>
<el-table v-loading="loading" :data="tableData" :height="tabHeader" :max-height="tabHeader"
:row-class-name="tableRowClassName">
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column type="index" width="60" label="序号" align="center" />
<el-table-column label="资产名称" key="xtmc" prop="xtmc" align="center" v-if="btnShow == 'web'" />
<el-table-column label="所属单位" key="dwmc" prop="dwmc" align="center" v-if="btnShow == 'web'" />
<el-table-column label="资产名称" key="xcxmc" prop="xcxmc" align="center" v-if="btnShow == 'xcx'" />

@ -29,7 +29,7 @@
:data="onlineList.slice((pageNum - 1) * pageSize, pageNum * pageSize)"
style="width: 100%;"
>
<el-table-column label="序号" width="50" type="index" align="center">
<el-table-column label="序号" width="60" type="index" align="center">
<template #default="scope">
<span>{{ (pageNum - 1) * pageSize + scope.$index + 1 }}</span>
</template>

@ -108,7 +108,7 @@
</el-row>
<el-table ref="operlogRef" v-loading="loading" :data="operlogList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column type="selection" width="60" align="center" />
<el-table-column label="日志编号" align="center" prop="operId" />
<el-table-column label="系统模块" align="center" prop="title" :show-overflow-tooltip="true" />
<el-table-column label="操作类型" align="center" prop="businessType">

@ -57,7 +57,7 @@
</el-row>
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column type="selection" width="60" align="center" />
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />

@ -89,7 +89,7 @@
<el-table ref="genRef" v-loading="loading" :data="tableList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
<el-table-column type="selection" align="center" width="55"></el-table-column>
<el-table-column label="序号" type="index" width="50" align="center">
<el-table-column label="序号" type="index" width="60" align="center">
<template #default="scope">
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>

Loading…
Cancel
Save