我的资产一级页面

yanfeiyong
严飞永 2 months ago
parent 70e196a331
commit bda2cae783

@ -1,6 +1,6 @@
.L-main {
height: 100%;
width: 102%;
width: 100%;
display: flex;
flex-direction: column;
background-color: #F2F4F6;

@ -52,7 +52,6 @@ function addIframe() {
.app-main {
/* 84 = navbar + tags-view = 50 + 34 */
height: calc(100vh - 84px);
width: 100%;
}
.fixed-header + .app-main {

@ -389,7 +389,7 @@
@click="submitFileForm"
> </el-button
>
<el-button @click="upload.open = false"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
@ -543,26 +543,25 @@ const getPagination = (pages) => {
formInline.size = pages.limit;
getList();
};
/** 取消按钮 */
function cancel() {
upload.open = false;
}
//
const handleImport = () => {
upload.open = true;
};
//
const handleExport = () => {
download(
"/tc/assetOfficialAccount/export",
{
...formInline,
},
`公众号资产${new Date().getTime()}.xlsx`
);
function handleExport() {
proxy.download("/tc/assetOfficialAccount/export", {
...formInline.value,
},`公众号资产${new Date().getTime()}.xlsx`)
};
/** 下载模板操作 */
const importTemplate = () => {
download(
proxy.download(
"/tc/assetOfficialAccount/importTemplate",
{},
`公众号资产导入模板${new Date().getTime()}.xlsx`

@ -1,36 +1,48 @@
<!-- 资产管理 -- 电子邮件 -->
<template>
<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="medium"
class="demo-form-inline"
>
<el-row>
<!-- <el-col :span="7">
<el-form-item label="所属单位:" prop="dwmc">
<el-input v-model="formInline.dwmc" placeholder="请输入所属单位"></el-input>
</el-form-item>
</el-col> -->
<el-col :span="7">
<el-form-item label="电子邮箱后缀:" prop="dzyxhz">
<el-input v-model="formInline.dzyxhz" placeholder="请输入电子邮箱后缀"></el-input>
<el-input
v-model="formInline.dzyxhz"
placeholder="请输入电子邮箱后缀"
style="width: 95%;"
></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.email_state"
v-for="dict in email_state"
:key="dict.value"
:label="dict.label"
:value="dict.value">
</el-option>
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3" style="text-align: right;">
<el-col :span="3" 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"></el-button>
<el-button
size="mini"
type="primary"
@click="handleQuery"
>查询</el-button
>
</el-form-item>
</el-col>
</el-row>
@ -44,168 +56,236 @@
<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="Plus"
size="mini"
@click="handleAdd"
>新增资产</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="scope">
<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">
<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 v-if="!scope.row.auditState || scope.row.auditState == 2" 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
v-if="!scope.row.auditState || scope.row.auditState == 2"
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>
</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"
v-model:current-page="formInline.current"
></my-pagination>
</main>
</div>
</template>
<script>
import myPagination from "@/views/components/Pagination/index.vue"
// import myDialog from "@/views/components/myDialog/index.vue"
import { assetEmailList, deleteAssetEmail } from "@/api/auditPagesApi/index";
export default {
dicts: ['zc_xtzt','zc_xtlx', 'email_state'],
components:{myPagination},
data() {
return {
formInline:{
dzyxhz:"",
xtzt:"",
// startTime:"",
// endTime:"",
current:1,
size:10,
},
// time:[],
total:0,
tableData:[],
loading:false,
tabHeader: undefined,
}
},
mounted(){
if( Object.keys(this.$route.params).length != 0) {
this.formInline = this.$route.params;
}else{
this.formInline.current = 1
this.formInline.size = 20
<script setup>
import { ref, reactive, onMounted, onUnmounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import myPagination from '@/views/components/Pagination/index.vue'
import { assetEmailList } from '@/api/auditPagesApi/index'
import { Download, Plus } from "@element-plus/icons-vue";
const route = useRoute()
const router = useRouter()
//
const formInline = reactive({
dzyxhz: '',
xtzt: '',
current: 1,
size: 10
})
//
const loading = ref(false)
const total = ref(0)
const tableData = ref([])
const tabHeader = ref(undefined)
//
const { proxy } = getCurrentInstance();
const { email_state } = proxy.useDict(
"email_state"
);
//
const handleAdd = () => {
router.push({
name: 'myAssetsAuth',
query: {
pageType: 'add',
type: 3,
queryData: formInline,
name: 'MyEmail'
}
this.getList();
this.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
},
destroyed() {
window.removeEventListener('resize', this.cancalDebounce);
},
methods:{
//
getList(){
this.loading = true;
assetEmailList(this.formInline).then(res=>{
this.loading = false;
this.total = res.data.total;
this.tableData = res.data.records;
})
},
//
resetQuery(){
this.resetForm("queryForm");
// this.time = [];
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`)
},
//
goInfo(row,id){
this.$router.push({name: 'myAssetsAuth',query: {
pageType: id == 1 ? "look" : "change",
type:3,
id:row.id,
queryData:this.formInline,
name:"MyEmail"
}})
},
// 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;
})
}
const getList = async () => {
loading.value = true
try {
const res = await assetEmailList(formInline)
total.value = res.data.total
tableData.value = res.data.records
} finally {
loading.value = false
}
}
const resetQuery = () => {
formInline.dzyxhz = ''
formInline.xtzt = ''
formInline.current = 1
getList()
}
const handleQuery = () => {
formInline.current = 1
getList()
}
const getPagination = ({ page, limit }) => {
formInline.current = page
formInline.size = limit
getList()
}
const handleExport = () => {
console.log('导出数据:', formInline)
}
const goInfo = (row, id) => {
router.push({
name: 'myAssetsAuth',
query: {
pageType: id === 1 ? 'look' : 'change',
type: 3,
id: row.id,
queryData: formInline,
name: 'MyEmail'
}
},
})
}
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')
if (element && header && pagination) {
const elementHeight = element.offsetHeight
const headerHeight = header.offsetHeight
const paginationtHeight = pagination.offsetHeight
tabHeader.value = elementHeight - headerHeight - paginationtHeight - 110
}
}
</script>
onMounted(() => {
if (Object.keys(route.params).length !== 0) {
Object.assign(formInline, route.params)
} else {
formInline.current = 1
formInline.size = 20
}
getList()
cancalDebounce()
window.addEventListener('resize', cancalDebounce)
})
onUnmounted(() => {
window.removeEventListener('resize', cancalDebounce)
})
</script>

@ -1,17 +1,43 @@
<template>
<div class="L-main" id="L-size-main">
<div class="content-search" id="L-header">
<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="queryFormRef" :model="formInline" size="small" class="demo-form-inline">
<el-form
:inline="true"
ref="queryFormRef"
:model="formInline"
size="medium"
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-form-item
label="系统名称:"
prop="xtmc"
>
<el-input
v-model="formInline.xtmc"
placeholder="请输入"
style="width: 95%"
></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-form-item
label="系统类型:"
prop="xtlx"
>
<el-select
v-model="formInline.xtlx"
placeholder="请选择系统类型"
style="width: 95%"
>
<el-option
v-for="dict in zc_xtlx"
:key="dict.value"
@ -22,8 +48,14 @@
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="系统状态:" prop="xtzt">
<el-select v-model="formInline.xtzt" placeholder="请选择系统状态">
<el-form-item
label="系统状态:"
prop="xtzt"
>
<el-select
v-model="formInline.xtzt"
placeholder="请选择系统状态"
>
<el-option
v-for="dict in zc_xtzt"
:key="dict.value"
@ -33,10 +65,17 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="3" style="text-align: right;">
<el-col
:span="3"
style="text-align: right"
>
<el-form-item class="unit-form">
<el-button size="mini" @click="resetQuery"></el-button>
<el-button size="mini" type="primary" @click="handleQuery"></el-button>
<el-button @click="resetQuery"></el-button>
<el-button
type="primary"
@click="handleQuery"
>查询</el-button
>
</el-form-item>
</el-col>
</el-row>
@ -45,88 +84,203 @@
<main>
<div class="search-title">
<span class="search-title-span">资产列表</span>
<el-row :gutter="10" class="mb8">
<el-row
:gutter="10"
class="mb8"
>
<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="Plus"
size="mini"
@click="handleAdd"
>新增资产</el-button
>
</el-col>
</el-row>
</div>
<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 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"
:max-height="tabHeader"
:row-class-name="tableRowClassName"
>
<el-table-column
type="index"
width="70"
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 #default="scope">
<dict-tag :options="zc_xtlx" :value="scope.row.xtlx"/>
<dict-tag
:options="zc_xtlx"
:value="scope.row.xtlx"
/>
</template>
</el-table-column>
<el-table-column label="单位名称" key="dwmc" prop="dwmc" align="center" />
<el-table-column label="新增时间" key="createTime" prop="createTime" align="center" />
<el-table-column label="系统状态" key="status" prop="status" class-name="table-status" align="center">
<el-table-column
label="单位名称"
key="dwmc"
prop="dwmc"
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="scope">
<span v-if="scope.row.xtzt == 1" style="color: #16B771;">
<span
v-if="scope.row.xtzt == 1"
style="color: #16b771"
>
已安装
</span>
<span v-else-if="scope.row.xtzt == 2" style="color: #F58A0C;">
<span
v-else-if="scope.row.xtzt == 2"
style="color: #f58a0c"
>
测试中
</span>
<span v-else-if="scope.row.xtzt == 3" style="color: #1485EF;">
<span
v-else-if="scope.row.xtzt == 3"
style="color: #1485ef"
>
使用中
</span>
<span v-else-if="scope.row.xtzt == 4" style="color: #29A07A;">
<span
v-else-if="scope.row.xtzt == 4"
style="color: #29a07a"
>
维护中
</span>
<span v-else-if="scope.row.xtzt == 5" style="color: #F50C0C;">
<span
v-else-if="scope.row.xtzt == 5"
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 #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;">查看</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"
>查看</span
>
</div>
<div v-if="!scope.row.auditState || scope.row.auditState == 2 || scope.row.xtzt == '5'" style="display: flex;align-items: center;cursor: pointer;margin-left: 10px;" @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
v-if="
!scope.row.auditState ||
scope.row.auditState == 2 ||
scope.row.xtzt == '5'
"
style="
display: flex;
align-items: center;
cursor: pointer;
margin-left: 10px;
"
@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>
</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>
</div>
</template>
<script setup>
import { ref, onMounted, onUnmounted } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { ref, onMounted, onUnmounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import myPagination from "@/views/components/Pagination/index.vue";
import { assetUnit } from "@/api/auditPagesApi/index";
import { Download, Plus } from "@element-plus/icons-vue";
const router = useRouter();
const route = useRoute();
// Dictionaries - these should be provided via props or composable
const zc_xtzt = ref([]);
const zc_xtlx = ref([]);
const { proxy } = getCurrentInstance();
const { zc_xtzt, zc_xtlx } = proxy.useDict(
"zc_xtzt",
"zc_xtlx"
);
const queryFormRef = ref(null);
const formInline = ref({
@ -144,7 +298,7 @@ const tabHeader = ref(undefined);
const getList = async () => {
try {
loading.value = true;
const res = await assetUnit('get', formInline.value);
const res = await assetUnit("get", formInline.value);
tableData.value = res.data.records;
total.value = res.data.total;
} catch (error) {
@ -172,31 +326,31 @@ const getPagination = (pages) => {
const handleExport = () => {
// Implement export functionality
console.log('Export functionality to be implemented');
console.log("Export functionality to be implemented");
};
const goInfo = (row, id) => {
router.push({
name: 'myAssetsAuth',
name: "myAssetsAuth",
query: {
pageType: id === 1 ? "look" : "change",
type: 0,
id: row.id,
queryData: formInline.value,
name: "MyWebAssets"
}
name: "MyWebAssets",
},
});
};
const tableRowClassName = ({ row, rowIndex }) => {
return rowIndex % 2 !== 0 ? 'evenNumber-row' : '';
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 element = document.getElementById("L-size-main");
const header = document.getElementById("L-header");
const pagination = document.getElementById("L-pagination");
if (element && header && pagination) {
const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight;
@ -212,13 +366,13 @@ onMounted(() => {
formInline.value.current = 1;
formInline.value.size = 20;
}
getList();
cancalDebounce();
window.addEventListener('resize', cancalDebounce);
window.addEventListener("resize", cancalDebounce);
});
onUnmounted(() => {
window.removeEventListener('resize', cancalDebounce);
window.removeEventListener("resize", cancalDebounce);
});
</script>
</script>

@ -1,64 +1,51 @@
<!-- 资产管理 -- 移动应用系统 -->
<template>
<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="mediu"
class="demo-form-inline"
>
<el-row>
<!-- <el-col :span="7">
<el-form-item label="所属单位:" prop="dwmc">
<el-input v-model="formInline.dwmc" placeholder="请输入所属单位"></el-input>
</el-form-item>
</el-col> -->
<el-col :span="7">
<el-form-item label="移动应用名称:" prop="yymc">
<el-input v-model="formInline.yymc" placeholder="请输入移动应用名称"></el-input>
<el-input
v-model="formInline.yymc"
placeholder="请输入移动应用名称"
style="width: 95%;"
></el-input>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="icp备案状态" prop="xtzt">
<el-select v-model="formInline.xtzt" placeholder="请选择icp备案状态">
<el-select
v-model="formInline.xtzt"
placeholder="请选择icp备案状态"
>
<el-option
v-for="dict in dict.type.app_icp_state"
v-for="dict in app_icp_state"
:key="dict.value"
:label="dict.label"
:value="dict.value">
</el-option>
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3" style="text-align: right;">
<el-col :span="7" 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>
@ -69,167 +56,257 @@
<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="Plus"
@click="handleAdd"
>新增资产</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-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="icp备案状态" key="status" prop="status" class-name="table-status" align="center">
<template slot-scope="scope">
<span v-if="scope.row.icpState == 1" style="color: #F58A0C;">
<el-table
v-loading="loading"
:data="tableData"
:height="tabHeader"
:row-class-name="tableRowClassName"
:max-height="tabHeader"
>
<el-table-column
type="index"
width="70"
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="新增时间"
key="createTime"
prop="createTime"
align="center"
/>
<el-table-column
label="icp备案状态"
key="status"
prop="status"
class-name="table-status"
align="center"
>
<template #default="scope">
<span v-if="scope.row.icpState == 1" style="color: #f58a0c">
未备案
</span>
<span v-if="scope.row.icpState == 2" style="color: #16B771;">
<span v-if="scope.row.icpState == 2" style="color: #16b771">
已备案
</span>
<span v-if="scope.row.icpState == 3" style="color: #1485EF;">
<span v-if="scope.row.icpState == 3" style="color: #1485ef">
非网站系统
</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 v-if="!scope.row.auditState || scope.row.auditState == 2" 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
v-if="!scope.row.auditState || scope.row.auditState == 2"
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>
</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"
v-model:current-page="formInline.current"
></my-pagination>
</main>
</div>
</template>
<script>
import myPagination from "@/views/components/Pagination/index.vue"
// import myDialog from "@/views/components/myDialog/index.vue"
import { assetAppList, deleteAssetApp } from "@/api/auditPagesApi/index";
export default {
dicts: ['zc_xtzt','zc_xtlx', 'app_icp_state'],
components:{myPagination},
data() {
return {
formInline:{
xtzt:"",
yymc:"",
// startTime:"",
// endTime:"",
current:1,
size:10,
},
// time:[],
total:0,
tableData:[],
loading:false,
tabHeader: undefined,
<script setup>
import { ref, reactive, onMounted, onUnmounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import myPagination from '@/views/components/Pagination/index.vue'
import { assetAppList } from '@/api/auditPagesApi/index'
import { Download, Plus } from "@element-plus/icons-vue";
//
const route = useRoute()
const router = useRouter()
//
const formInline = reactive({
xtzt: '',
yymc: '',
current: 1,
size: 10
})
//
const loading = ref(false)
const total = ref(0)
const tableData = ref([])
const tabHeader = ref(undefined)
//
const { proxy } = getCurrentInstance();
const { app_icp_state } = proxy.useDict(
"app_icp_state"
);
//
const handleAdd = () => {
router.push({
name: 'myAssetsAuth',
query: {
pageType: 'add',
type: 4,
queryData: formInline,
name: 'MyMobileApplication'
}
},
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.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
},
destroyed() {
window.removeEventListener('resize', this.cancalDebounce);
},
methods:{
//
getList(){
this.loading = true;
assetAppList(this.formInline).then(res=>{
this.loading = false;
this.total = res.data.total;
this.tableData = res.data.records;
})
},
//
resetQuery(){
this.resetForm("queryForm");
this.time = [];
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();
},
//
handleExport(){
this.download('/tc/assetApp/export', {
...this.formInline
}, `移动应用程序资产${new Date().getTime()}.xlsx`)
},
//
goInfo(row,id){
this.$router.push({name: 'myAssetsAuth',query: {
pageType: id == 1 ? "look" : "change",
type:4,
id:row.id,
queryData:this.formInline,
name:"MyMobileApplication"
}})
},
// 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;
})
}
const getList = async () => {
loading.value = true
try {
const res = await assetAppList(formInline)
total.value = res.data.total
tableData.value = res.data.records
} finally {
loading.value = false
}
}
const resetQuery = () => {
formInline.xtzt = ''
formInline.yymc = ''
formInline.current = 1
formInline.size = 10
getList()
}
const handleQuery = () => {
formInline.current = 1
getList()
}
const getPagination = ({ page, limit }) => {
formInline.current = page
formInline.size = limit
getList()
}
const handleExport = () => {
console.log('导出数据:', formInline)
}
const goInfo = (row, id) => {
router.push({
name: 'myAssetsAuth',
query: {
pageType: id === 1 ? 'look' : 'change',
type: 4,
id: row.id,
queryData: formInline,
name: 'MyMobileApplication'
}
},
})
}
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')
if (element && header && pagination) {
const elementHeight = element.offsetHeight
const headerHeight = header.offsetHeight
const paginationtHeight = pagination.offsetHeight
tabHeader.value = elementHeight - headerHeight - paginationtHeight - 110
}
}
</script>
onMounted(() => {
if (Object.keys(route.params).length !== 0) {
Object.assign(formInline, route.params)
} else {
formInline.current = 1
formInline.size = 20
}
getList()
cancalDebounce()
window.addEventListener('resize', cancalDebounce)
})
onUnmounted(() => {
window.removeEventListener('resize', cancalDebounce)
})
</script>

@ -1,17 +1,43 @@
<!-- 我的资产--公众号 -->
<template>
<div class="L-main" id="L-size-main">
<div class="content-search" id="L-header">
<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="queryFormRef" :model="formInline" size="small" class="demo-form-inline">
<el-form
:inline="true"
ref="queryFormRef"
:model="formInline"
size="medium"
class="demo-form-inline"
>
<el-row>
<el-col :span="7">
<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="7">
<el-form-item label="公众号状态:" prop="xtzt">
<el-select v-model="formInline.xtzt" placeholder="请选择公众号状态">
<el-form-item
label="公众号状态:"
prop="xtzt"
>
<el-select
v-model="formInline.xtzt"
placeholder="请选择公众号状态"
>
<el-option
v-for="dict in gzh_state"
:key="dict.value"
@ -21,10 +47,17 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="3" style="text-align: right;">
<el-col
:span="7"
style="text-align: right"
>
<el-form-item class="unit-form">
<el-button size="mini" @click="resetQuery"></el-button>
<el-button size="mini" type="primary" @click="handleQuery"></el-button>
<el-button @click="resetQuery"></el-button>
<el-button
type="primary"
@click="handleQuery"
>查询</el-button
>
</el-form-item>
</el-col>
</el-row>
@ -33,56 +66,166 @@
<main>
<div class="search-title">
<span class="search-title-span">资产列表</span>
<el-row :gutter="10" class="mb8">
<el-row
:gutter="10"
class="mb8"
>
<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="Plus"
@click="handleAdd"
>新增资产</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="createTime" prop="createTime" align="center" />
<el-table-column label="平台类型" key="ptlx" prop="ptlx" align="center">
<el-table
v-loading="loading"
:data="tableData"
:height="tabHeader"
:row-class-name="tableRowClassName"
:max-height="tabHeader"
>
<el-table-column
type="index"
width="70"
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="createTime"
prop="createTime"
align="center"
/>
<el-table-column
label="平台类型"
key="ptlx"
prop="ptlx"
align="center"
>
<template #default="scope">
<dict-tag :options="sys_ptlx_type" :value="scope.row.ptlx"/>
<dict-tag
:options="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="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-else-if="scope.row.gzhzt == 2" style="color: #F58A0C;">注销</span>
<span v-else-if="scope.row.gzhzt == 3" style="color: #1485EF;">迁移</span>
<span v-else-if="scope.row.gzhzt == 4" style="color: #29A07A;">受限</span>
<span v-else-if="scope.row.gzhzt == 5" style="color: #F50C0C;">违规</span>
<span v-else-if="scope.row.gzhzt == 6" style="color: #F58A0C;">未知</span>
<span
v-if="scope.row.gzhzt == 1"
style="color: #16b771"
>正常</span
>
<span
v-else-if="scope.row.gzhzt == 2"
style="color: #f58a0c"
>注销</span
>
<span
v-else-if="scope.row.gzhzt == 3"
style="color: #1485ef"
>迁移</span
>
<span
v-else-if="scope.row.gzhzt == 4"
style="color: #29a07a"
>受限</span
>
<span
v-else-if="scope.row.gzhzt == 5"
style="color: #f50c0c"
>违规</span
>
<span
v-else-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 #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
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 v-if="!scope.row.auditState || scope.row.auditState == 2" 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
v-if="!scope.row.auditState || scope.row.auditState == 2"
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>
</template>
</el-table-column>
</el-table>
</section>
<my-pagination
<my-pagination
id="L-pagination"
:total="total"
:page="formInline.current"
@ -95,114 +238,131 @@
</template>
<script setup>
import { ref, onMounted, onUnmounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import myPagination from "@/views/components/Pagination/index.vue"
import { assetOfficialAccountList } from "@/api/auditPagesApi/index"
import { ref, onMounted, onUnmounted } from "vue";
import { useRoute, useRouter } from "vue-router";
import myPagination from "@/views/components/Pagination/index.vue";
import { assetOfficialAccountList } from "@/api/auditPagesApi/index";
import { Download, Plus } from "@element-plus/icons-vue";
// (使provide/inject)
const gzh_state = ref([])
const sys_ptlx_type = ref([])
const { proxy } = getCurrentInstance();
const { gzh_state, sys_ptlx_type } = proxy.useDict(
"gzh_state",
"sys_ptlx_type"
);
const router = useRouter()
const route = useRoute()
const queryFormRef = ref(null)
const router = useRouter();
const route = useRoute();
const queryFormRef = ref(null);
const formInline = ref({
gzhmc: "",
xtzt: "",
current: 1,
size: 10
})
size: 10,
});
const loading = ref(false)
const tableData = ref([])
const total = ref(0)
const tabHeader = ref(undefined)
const loading = ref(false);
const tableData = ref([]);
const total = ref(0);
const tabHeader = ref(undefined);
//
const getList = async () => {
try {
loading.value = true
const res = await assetOfficialAccountList(formInline.value)
tableData.value = res.data.records
total.value = res.data.total
loading.value = true;
const res = await assetOfficialAccountList(formInline.value);
tableData.value = res.data.records;
total.value = res.data.total;
} catch (error) {
console.error('获取列表失败:', error)
console.error("获取列表失败:", error);
} finally {
loading.value = false
loading.value = false;
}
}
};
//
const resetQuery = () => {
queryFormRef.value?.resetFields()
formInline.value.current = 1
getList()
}
queryFormRef.value?.resetFields();
formInline.value.current = 1;
getList();
};
//
const handleQuery = () => {
formInline.value.current = 1
getList()
}
formInline.value.current = 1;
getList();
};
//
const getPagination = (pages) => {
formInline.value.current = pages.page
formInline.value.size = pages.limit
getList()
}
formInline.value.current = pages.page;
formInline.value.size = pages.limit;
getList();
};
//
const handleExport = () => {
//
console.log('导出功能:', formInline.value)
function handleExport() {
proxy.download(
"/tc/assetOfficialAccount/export",
{
...formInline.value,
},
`公众号资产${new Date().getTime()}.xlsx`
);
}
function handleAdd() {
router.push({
name: "myAssetsAuth",
query: {
pageType: "add",
type: 2,
},
});
}
// /
const goInfo = (row, id) => {
router.push({
name: 'myAssetsAuth',
name: "myAssetsAuth",
query: {
pageType: id === 1 ? "look" : "change",
type: 2,
id: row.id,
queryData: formInline.value,
name: "MyOfficialAccount"
}
})
}
name: "MyOfficialAccount",
},
});
};
//
const tableRowClassName = ({ rowIndex }) => {
return rowIndex % 2 !== 0 ? 'evenNumber-row' : ''
}
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 element = document.getElementById("L-size-main");
const header = document.getElementById("L-header");
const pagination = document.getElementById("L-pagination");
if (element && header && pagination) {
const elementHeight = element.offsetHeight
const headerHeight = header.offsetHeight
const paginationtHeight = pagination.offsetHeight
tabHeader.value = elementHeight - headerHeight - paginationtHeight - 110
const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight;
tabHeader.value = elementHeight - headerHeight - paginationtHeight - 110;
}
}
};
onMounted(() => {
if (Object.keys(route.params).length !== 0) {
formInline.value = route.params
formInline.value = route.params;
}
getList()
cancalDebounce()
window.addEventListener('resize', cancalDebounce)
})
getList();
cancalDebounce();
window.addEventListener("resize", cancalDebounce);
});
onUnmounted(() => {
window.removeEventListener('resize', cancalDebounce)
})
</script>
window.removeEventListener("resize", cancalDebounce);
});
</script>

@ -1,59 +1,53 @@
<!-- 资产管理 -- 小程序 -->
<template>
<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="medium"
class="demo-form-inline"
label-width="100px"
>
<el-row>
<!-- <el-col :span="7">
<el-form-item label="所属单位:" prop="dwmc">
<el-input v-model="formInline.dwmc" placeholder="请输入所属单位"></el-input>
</el-form-item>
</el-col> -->
<el-col :span="7">
<el-form-item label="小程序名称:" prop="xcxmc">
<el-input v-model="formInline.xcxmc" placeholder="请输入小程序名称"></el-input>
<el-input
v-model="formInline.xcxmc"
placeholder="请输入小程序名称"
style="width: 95%;"
></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.gzh_state"
v-for="dict in gzh_state"
:key="dict.value"
:label="dict.label"
:value="dict.value">
:value="dict.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3" style="text-align: right;">
<el-col :span="7" 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="xtzt">
<el-select v-model="formInline.xtzt" placeholder="请选择系统状态">
<el-option
v-for="dict in dict.type.gzh_state"
:key="dict.value"
:label="dict.label"
:value="dict.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="16" style="text-align: right;padding-right: 30px;">
<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>
@ -64,176 +58,264 @@
<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="Plus"
@click="handleAdd"
>新增资产</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-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="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
v-loading="loading"
:data="tableData"
:height="tabHeader"
:row-class-name="tableRowClassName"
:max-height="tabHeader"
>
<el-table-column
type="index"
width="70"
label="序号"
align="center"
/>
<el-table-column
label="小程序名称"
key="xcxmc"
prop="xcxmc"
align="center"
/>
<el-table-column
label="所属单位"
key="ssdw"
prop="ssdw"
align="center"
/>
<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>
</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 v-if="!scope.row.auditState || scope.row.auditState == 2" style="display: flex;align-items: center;cursor: pointer;margin-left: 10px;" @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
v-if="!scope.row.auditState || scope.row.auditState == 2"
style="
display: flex;
align-items: center;
cursor: pointer;
margin-left: 10px;
"
@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>
</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"
v-model:current-page="formInline.current"
></my-pagination>
</main>
</div>
</template>
<script>
import myPagination from "@/views/components/Pagination/index.vue"
// import myDialog from "@/views/components/myDialog/index.vue"
import { miniProgramsList, deleteMiniPrograms } from "@/api/auditPagesApi/index";
export default {
dicts: ['gzh_state'],
components:{myPagination},
data() {
return {
formInline:{
xtzt:"",
xcxmc:"",
// startTime:"",
// endTime:"",
current:1,
size:10,
},
// time:[],
total:0,
tableData:[],
loading:false,
tabHeader: undefined,
<script setup>
import { ref, reactive, onMounted, onUnmounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import myPagination from '@/views/components/Pagination/index.vue'
import { miniProgramsList } from '@/api/auditPagesApi/index'
import { Download, Plus } from "@element-plus/icons-vue";
const route = useRoute()
const router = useRouter()
//
const formInline = reactive({
xtzt: '',
xcxmc: '',
current: 1,
size: 10
})
//
const total = ref(0)
const tableData = ref([])
const loading = ref(false)
const tabHeader = ref(undefined)
const queryForm = ref(null)
const { proxy } = getCurrentInstance();
const { gzh_state } = proxy.useDict(
"gzh_state"
);
//
const handleAdd = () => {
router.push({
name: 'myAssetsAuth',
query: {
pageType: 'add',
type: 1,
queryData: formInline,
name: 'MyProgram'
}
},
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.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
},
destroyed() {
window.removeEventListener('resize', this.cancalDebounce);
},
methods:{
//
getList(){
this.loading = true;
miniProgramsList(this.formInline).then(res=>{
this.loading = false;
this.total = res.data.total;
this.tableData = res.data.records;
})
},
//
resetQuery(){
this.resetForm("queryForm");
// this.time = [];
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();
},
//
handleExport(){
this.download('/tc/miniPrograms/export', {
...this.formInline
}, `小程序资产${new Date().getTime()}.xlsx`)
},
//
goInfo(row,id){
this.$router.push({name: 'myAssetsAuth',query: {
pageType: id == 1 ? "look" : "change",
type:1,
id:row.id,
queryData:this.formInline,
name:"MyProgram"
}})
},
// 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;
})
}
const getList = async () => {
loading.value = true
try {
const res = await miniProgramsList(formInline)
total.value = res.data.total
tableData.value = res.data.records
} finally {
loading.value = false
}
}
const resetQuery = () => {
if (queryForm.value) {
queryForm.value.resetFields()
}
handleQuery()
}
const handleQuery = () => {
formInline.current = 1
getList()
}
const getPagination = ({ page, limit }) => {
formInline.current = page
formInline.size = limit
getList()
}
const handleExport = () => {
console.log('导出数据:', formInline)
}
const goInfo = (row, id) => {
router.push({
name: 'myAssetsAuth',
query: {
pageType: id === 1 ? 'look' : 'change',
type: 1,
id: row.id,
queryData: formInline,
name: 'MyProgram'
}
},
})
}
//
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')
if (element && header && pagination) {
const elementHeight = element.offsetHeight
const headerHeight = header.offsetHeight
const paginationtHeight = pagination.offsetHeight
tabHeader.value = elementHeight - headerHeight - paginationtHeight - 110
}
}
</script>
onMounted(() => {
if (Object.keys(route.params).length !== 0) {
Object.assign(formInline, route.params)
} else {
formInline.current = 1
formInline.size = 20
}
getList()
cancalDebounce()
window.addEventListener('resize', cancalDebounce)
})
onUnmounted(() => {
window.removeEventListener('resize', cancalDebounce)
})
</script>
Loading…
Cancel
Save