Browse Source

固定普法服务,轮播图,公告管理的返回路由

dev-V1.10.2-temp
wangmingyong 4 months ago
parent
commit
cd5476e57b
  1. 74
      zdxt-web-client/zdxt-admin-plus-ui/src/views/nos/legalTech.vue
  2. 11
      zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/carouselBanner/add.vue
  3. 2
      zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/carouselBanner/detail.vue
  4. 10
      zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/carouselBanner/draft.vue
  5. 11
      zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/carouselBanner/edit.vue
  6. 11
      zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/carouselBanner/index.vue
  7. 12
      zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/educationServices/add.vue
  8. 2
      zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/educationServices/detail.vue
  9. 12
      zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/educationServices/draft.vue
  10. 10
      zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/educationServices/edit.vue
  11. 6
      zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/educationServices/index.vue
  12. 12
      zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/educationServices/repost.vue

74
zdxt-web-client/zdxt-admin-plus-ui/src/views/nos/legalTech.vue

@ -4,20 +4,14 @@
<div class="search-panel">
<el-form :model="searchForm" inline>
<el-form-item label="时间筛选:">
<el-date-picker
v-model="searchForm.timeRange"
type="datetimerange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="截止时间"
class="date-picker"
format="YYYY-MM-DD HH:mm"
value-format="YYYY-MM-DD HH:mm:ss"
/>
<el-date-picker v-model="searchForm.timeRange" type="datetimerange" range-separator="至"
start-placeholder="开始时间" end-placeholder="截止时间" class="date-picker" format="YYYY-MM-DD HH:mm"
value-format="YYYY-MM-DD HH:mm:ss" />
</el-form-item>
<el-form-item label="执法单位:">
<el-input v-model="searchForm.lawEnforcementAgency" placeholder="请输入关键字" class="search-input" clearable @keyup.enter="handleSearch" />
<el-input v-model="searchForm.lawEnforcementAgency" placeholder="请输入关键字" class="search-input" clearable
@keyup.enter="handleSearch" />
</el-form-item>
<el-form-item>
@ -28,19 +22,27 @@
<el-button @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-button type="primary" @click="handleAdd">新增</el-button>
</div>
<div class="action-bar">
<div class="action-left">
<el-button type="primary" @click="handleAdd">新增</el-button>
</div>
</div>
<!-- 数据表格 -->
<div class="table-container">
<el-table v-loading="loading" :data="tableData" border :header-cell-style="{ backgroundColor: '#f5f7fa', fontWeight: 'bold' }">
<el-table v-loading="loading" :data="tableData" border
:header-cell-style="{ backgroundColor: '#f5f7fa', fontWeight: 'bold' }">
<el-table-column prop="lawEnforcementAgency" label="执法单位" min-width="160" show-overflow-tooltip />
<el-table-column label="法制材料" min-width="200">
<template #default="{ row }">
<div v-if="row.legalMaterials" class="file-cell">
<el-icon class="file-icon"><Paperclip /></el-icon>
<span class="file-name" :title="extractFileName(row.legalMaterials)">{{ extractFileName(row.legalMaterials) }}</span>
<el-icon class="file-icon">
<Paperclip />
</el-icon>
<span class="file-name" :title="extractFileName(row.legalMaterials)">{{
extractFileName(row.legalMaterials) }}</span>
<el-button size="small" @click="downloadFile(row.legalMaterials)">下载</el-button>
</div>
<span v-else>--</span>
@ -50,8 +52,11 @@
<el-table-column label="技术材料" min-width="200">
<template #default="{ row }">
<div v-if="row.technicalMaterials" class="file-cell">
<el-icon class="file-icon"><Paperclip /></el-icon>
<span class="file-name" :title="extractFileName(row.technicalMaterials)">{{ extractFileName(row.technicalMaterials) }}</span>
<el-icon class="file-icon">
<Paperclip />
</el-icon>
<span class="file-name" :title="extractFileName(row.technicalMaterials)">{{
extractFileName(row.technicalMaterials) }}</span>
<el-button size="small" @click="downloadFile(row.technicalMaterials)">下载</el-button>
</div>
<span v-else>--</span>
@ -75,15 +80,9 @@
<!-- 分页 -->
<div class="pagination-container">
<span class="total-text">共 {{ total }} 项数据</span>
<el-pagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:total="total"
:page-sizes="[10, 20, 50, 100]"
layout="prev, pager, next, jumper, ->, total, sizes"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :total="total"
:page-sizes="[10, 20, 50, 100]" layout="prev, pager, next, jumper, ->, total, sizes"
@size-change="handleSizeChange" @current-change="handleCurrentChange" />
</div>
</div>
</template>
@ -119,6 +118,9 @@ const formatDateTime = (time?: string) => {
const BASE_API = import.meta.env.VITE_APP_BASE_API || '';
const FILE_SERVER_PREFIX = import.meta.env.VITE_APP_FILE_SERVER_PREFIX || '';
onMounted(() => {
getList();
});
const isOssId = (val: string) => /^[0-9]+$/.test(val.trim());
const toRelativeFilePath = (val: string) => {
@ -247,9 +249,6 @@ const handleCurrentChange = (val: number) => {
getList();
};
onMounted(() => {
getList();
});
</script>
<style scoped>
@ -284,6 +283,21 @@ onMounted(() => {
.date-picker {
width: 360px;
}
.action-bar {
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
padding: 12px 20px;
border-radius: 8px;
margin-bottom: 16px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}
.action-left {
display: flex;
gap: 8px;
}
.table-container {
background: #fff;

11
zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/carouselBanner/add.vue

@ -70,10 +70,12 @@ import { getCurrentInstance, onMounted, reactive, ref } from 'vue';
import type { ComponentInternalInstance } from 'vue';
import type { FormRules, UploadRequestOptions } from 'element-plus';
import { ElForm, ElMessage } from 'element-plus';
import { useRoute } from 'vue-router';
import { addCarouselBanner } from '@/api/supervision/carouselBanner';
import { getDicts } from '@/api/system/dict/data';
import request from '@/utils/request';
const route = useRoute();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const formRef = ref<InstanceType<typeof ElForm>>();
const submitting = ref(false);
@ -158,7 +160,7 @@ const removeImage = () => {
};
const handleCancel = () => {
proxy?.$tab.closePage();
proxy?.$tab.closeOpenPage({ path: '/general-manage/supervision-carouselBanner' });
};
const submitForm = async (status: number, successMessage: string) => {
@ -181,7 +183,10 @@ const submitForm = async (status: number, successMessage: string) => {
});
if (res.code === 200) {
ElMessage.success(successMessage);
proxy?.$tab.closePage();
const targetPath = route.query.from === 'draft'
? '/supervision/carouselBanner/draft'
: '/general-manage/supervision-carouselBanner';
proxy?.$tab.closeOpenPage({ path: targetPath });
} else {
ElMessage.error(res.msg || '操作失败');
}
@ -320,7 +325,7 @@ onMounted(() => {
.preview-image img {
width: 100%;
height: 100%;
object-fit: cover;
/* object-fit: cover; */
}
.remove-btn {

2
zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/carouselBanner/detail.vue

@ -106,7 +106,7 @@ const loadDetail = async () => {
};
const handleBack = () => {
proxy?.$tab.closePage();
proxy?.$tab.closeOpenPage({ path: '/general-manage/supervision-carouselBanner' });
};
const handleEdit = () => {

10
zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/carouselBanner/draft.vue

@ -74,8 +74,8 @@
</el-table-column>
<el-table-column label="操作" width="160" fixed="right">
<template #default="scope">
<el-button size="small" type="text" @click="handleEdit(scope.row)">编辑</el-button>
<el-button size="small" type="text" class="delete-btn" @click="handleDelete(scope.row)">删除</el-button>
<el-button size="small" text type="primary" @click="handleEdit(scope.row)">编辑</el-button>
<el-button size="small" text type="primary" class="delete-btn" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -170,11 +170,11 @@ const handleReset = () => {
};
const handleAdd = () => {
router.push('/supervision/carouselBanner/add');
router.push('/supervision/carouselBanner/add?from=draft');
};
const handleBack = () => {
proxy?.$tab.closePage();
proxy?.$tab.closeOpenPage({ path: '/general-manage/supervision-carouselBanner'});
};
const handleBatchDelete = () => {
@ -204,7 +204,7 @@ const handleSelectionChange = (selection: CarouselBannerVo[]) => {
};
const handleEdit = (row: CarouselBannerVo) => {
router.push(`/supervision/carouselBanner/edit/${row.id}`);
router.push(`/supervision/carouselBanner/edit/${row.id}?from=draft`);
};
const handleDelete = async (row: CarouselBannerVo) => {

11
zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/carouselBanner/edit.vue

@ -164,7 +164,10 @@ const removeImage = () => {
};
const handleCancel = () => {
proxy?.$tab.closePage();
const targetPath = route.query.from === 'draft'
? '/supervision/carouselBanner/draft'
: '/general-manage/supervision-carouselBanner';
proxy?.$tab.closeOpenPage({ path: targetPath });
};
const submitForm = async (status: number, successMessage: string) => {
@ -182,9 +185,9 @@ const submitForm = async (status: number, successMessage: string) => {
displayDays: form.displayDays,
linkUrl: form.linkUrl,
imageUrl: form.imageUrl,
status,
// status,
type: form.type,
isDelete: 0
// isDelete: status === 2 ? 0 : 1
});
if (res.code === 200) {
ElMessage.success(successMessage);
@ -363,7 +366,7 @@ onMounted(async () => {
.preview-image img {
width: 100%;
height: 100%;
object-fit: cover;
/* object-fit: cover; */
}
.remove-btn {

11
zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/carouselBanner/index.vue

@ -94,17 +94,18 @@
</el-table-column>
<el-table-column label="操作" width="260" fixed="right">
<template #default="scope">
<el-button size="small" type="text" @click="handleView(scope.row)">查看</el-button>
<el-button size="small" type="text" @click="handleEdit(scope.row)">编辑</el-button>
<el-button size="small" text type="primary" @click="handleView(scope.row)">查看</el-button>
<el-button size="small" text type="primary" @click="handleEdit(scope.row)">编辑</el-button>
<el-button
size="small"
type="text"
text
type="primary"
:class="scope.row.status === 2 ? 'offline-btn' : 'online-btn'"
@click="handleStatusChange(scope.row)"
>
{{ scope.row.status === 2 ? '下架' : '上架' }}
</el-button>
<el-button size="small" type="text" class="delete-btn" @click="handleDelete(scope.row)">删除</el-button>
<el-button size="small" text type="primary" class="delete-btn" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -278,7 +279,7 @@ const handleStatusChange = (row: CarouselBannerVo) => {
imageUrl: row.imageUrl,
status: newStatus,
type: row.type ?? 1,
isDelete: 0
// isDelete: newStatus === 2 ? 0 : 1
});
if (res.code === 200) {
ElMessage.success(`${actionText}成功`);

12
zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/educationServices/add.vue

@ -100,6 +100,7 @@ import type { UploadFile, UploadRequestOptions, UploadUserFile } from 'element-p
import { ElMessage, ElForm, FormRules } from 'element-plus';
import { QuillEditor } from '@vueup/vue-quill';
import '@vueup/vue-quill/dist/vue-quill.snow.css';
import { useRoute } from 'vue-router';
import {
addEducationServices,
listPublishDeptOptions,
@ -118,6 +119,7 @@ interface AttachmentItem {
uploadPersonName: string;
}
const route = useRoute();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const userStore = useUserStore();
const formRef = ref<InstanceType<typeof ElForm>>();
@ -199,7 +201,10 @@ const submitForm = async (status: number, successMessage: string) => {
const res: any = await addEducationServices(buildPayload(status));
if (res.code === 200) {
ElMessage.success(successMessage);
proxy?.$tab.closePage();
const targetPath = route.query.from === 'draft'
? '/supervision/educationServices/draft'
: '/general-manage/enforcementcode-educationServices';
proxy?.$tab.closeOpenPage({ path: targetPath });
} else {
ElMessage.error(res.msg || '操作失败');
}
@ -236,7 +241,10 @@ const handlePreview = () => {
};
const handleCancel = () => {
proxy?.$tab.closePage();
const targetPath = route.query.from === 'draft'
? '/supervision/educationServices/draft'
: '/general-manage/enforcementcode-educationServices';
proxy?.$tab.closeOpenPage({ path: targetPath });
};
const handleSaveDraft = () => {

2
zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/educationServices/detail.vue

@ -123,7 +123,7 @@ const loadDetail = async () => {
};
const handleBack = () => {
proxy?.$tab.closePage();
proxy?.$tab.closeOpenPage({ path: '/general-manage/enforcementcode-educationServices' });
};
onMounted(() => {

12
zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/educationServices/draft.vue

@ -103,8 +103,8 @@
<el-table-column label="操作" width="160" fixed="right">
<template #default="scope">
<el-button size="small" type="text" @click="handleEdit(scope.row)">编辑</el-button>
<el-button size="small" type="text" class="delete-btn" @click="handleDelete(scope.row)">删除</el-button>
<el-button size="small" text type="primary" @click="handleEdit(scope.row)">编辑</el-button>
<el-button size="small" text type="primary" class="delete-btn" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -243,15 +243,15 @@ const loadDictOptions = async () => {
};
const handleAdd = () => {
router.push('/supervision/educationServices/add');
router.push('/supervision/educationServices/add?from=draft');
};
const handleRepost = () => {
router.push('/supervision/educationServices/repost');
router.push('/supervision/educationServices/repost?from=draft');
};
const handleBack = () => {
proxy?.$tab.closePage();
proxy?.$tab.closeOpenPage({ path: '/general-manage/enforcementcode-educationServices' });
};
const handleBatchDelete = () => {
@ -281,7 +281,7 @@ const handleSelectionChange = (selection: any[]) => {
};
const handleEdit = (row: any) => {
router.push(`/supervision/educationServices/edit/${row.id}`);
router.push(`/supervision/educationServices/edit/${row.id}?from=draft`);
};
const handleDelete = async (row: any) => {

10
zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/educationServices/edit.vue

@ -227,7 +227,10 @@ const submitForm = async (status: number, successMessage: string) => {
const res: any = await editEducationServices(buildPayload(status));
if (res.code === 200) {
ElMessage.success(successMessage);
proxy?.$tab.closePage();
const targetPath = route.query.from === 'draft'
? '/supervision/educationServices/draft'
: '/general-manage/enforcementcode-educationServices';
proxy?.$tab.closeOpenPage({ path: targetPath });
} else {
ElMessage.error(res.msg || '操作失败');
}
@ -272,7 +275,10 @@ const handlePreview = () => {
};
const handleCancel = () => {
proxy?.$tab.closePage();
const targetPath = route.query.from === 'draft'
? '/supervision/educationServices/draft'
: '/general-manage/enforcementcode-educationServices';
proxy?.$tab.closeOpenPage({ path: targetPath });
};
const handleSaveDraft = () => {

6
zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/educationServices/index.vue

@ -92,9 +92,9 @@
<el-table-column label="操作" width="240" fixed="right">
<template #default="scope">
<el-button size="small" type="text" @click="handleEdit(scope.row)">编辑</el-button>
<el-button size="small" type="text" @click="handleView(scope.row)">查看</el-button>
<el-button size="small" type="text" class="delete-btn" @click="handleDelete(scope.row)">删除</el-button>
<el-button size="small" text type="primary" @click="handleEdit(scope.row)">编辑</el-button>
<el-button size="small" text type="primary" @click="handleView(scope.row)">查看</el-button>
<el-button size="small" text type="primary" class="delete-btn" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>

12
zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/educationServices/repost.vue

@ -52,6 +52,7 @@
import { getCurrentInstance, onMounted, reactive, ref } from 'vue';
import type { ComponentInternalInstance } from 'vue';
import { ElMessage, ElForm, FormRules } from 'element-plus';
import { useRoute } from 'vue-router';
import {
addEducationServices,
listPublishDeptOptions,
@ -59,6 +60,7 @@ import {
} from '@/api/supervision/educationServices';
import { getDicts } from '@/api/system/dict/data';
const route = useRoute();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const formRef = ref<InstanceType<typeof ElForm>>();
const contentTypeOptions = ref<{ label: string; value: number }[]>([]);
@ -96,7 +98,10 @@ const submitForm = async (status: number, successMessage: string) => {
const res: any = await addEducationServices(buildPayload(status));
if (res.code === 200) {
ElMessage.success(successMessage);
proxy?.$tab.closePage();
const targetPath = route.query.from === 'draft'
? '/supervision/educationServices/draft'
: '/general-manage/enforcementcode-educationServices';
proxy?.$tab.closeOpenPage({ path: targetPath });
} else {
ElMessage.error(res.msg || '操作失败');
}
@ -115,7 +120,10 @@ const handlePreview = () => {
};
const handleCancel = () => {
proxy?.$tab.closePage();
const targetPath = route.query.from === 'draft'
? '/supervision/educationServices/draft'
: '/general-manage/enforcementcode-educationServices';
proxy?.$tab.closeOpenPage({ path: targetPath });
};
const handleSaveDraft = () => {

Loading…
Cancel
Save