Browse Source

上下架轮播图和公告的操作

dev-V1.10.2-temp
wangmingyong 4 months ago
parent
commit
8788ad9f1b
  1. 12
      zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/noticeInfo/add.vue
  2. 10
      zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/noticeInfo/draft.vue
  3. 14
      zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/noticeInfo/edit.vue
  4. 8
      zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/noticeInfo/index.vue
  5. 64
      zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/EnforcementInfoSection.vue

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

@ -49,8 +49,10 @@ import { getCurrentInstance, reactive, ref } from 'vue';
import type { ComponentInternalInstance } from 'vue'; import type { ComponentInternalInstance } from 'vue';
import type { FormRules } from 'element-plus'; import type { FormRules } from 'element-plus';
import { ElForm, ElMessage } from 'element-plus'; import { ElForm, ElMessage } from 'element-plus';
import { useRoute } from 'vue-router';
import { addNoticeInfo } from '@/api/supervision/noticeInfo'; import { addNoticeInfo } from '@/api/supervision/noticeInfo';
const route = useRoute();
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const formRef = ref<InstanceType<typeof ElForm>>(); const formRef = ref<InstanceType<typeof ElForm>>();
const submitting = ref(false); const submitting = ref(false);
@ -92,7 +94,10 @@ const submitForm = async (status: number, successMessage: string) => {
}); });
if (res.code === 200) { if (res.code === 200) {
ElMessage.success(successMessage); ElMessage.success(successMessage);
proxy?.$tab.closePage(); const targetPath = route.query.from === 'draft'
? '/supervision/noticeInfo/draft'
: '/general-manage/supervision-noticeInfo';
proxy?.$tab.closeOpenPage({ path: targetPath });
} else { } else {
ElMessage.error(res.msg || '操作失败'); ElMessage.error(res.msg || '操作失败');
} }
@ -105,7 +110,10 @@ const submitForm = async (status: number, successMessage: string) => {
}; };
const handleCancel = () => { const handleCancel = () => {
proxy?.$tab.closePage(); const targetPath = route.query.from === 'draft'
? '/supervision/noticeInfo/draft'
: '/general-manage/supervision-noticeInfo';
proxy?.$tab.closeOpenPage({ path: targetPath });
}; };
const handleSaveDraft = () => { const handleSaveDraft = () => {

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

@ -69,8 +69,8 @@
<el-table-column prop="targetPlatformLabel" label="内容发布到" width="140" show-overflow-tooltip /> <el-table-column prop="targetPlatformLabel" label="内容发布到" width="140" show-overflow-tooltip />
<el-table-column label="操作" width="160" fixed="right"> <el-table-column label="操作" width="160" fixed="right">
<template #default="scope"> <template #default="scope">
<el-button size="small" type="text" @click="handleEdit(scope.row)">编辑</el-button> <el-button size="small" text type="primary" @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" class="delete-btn" @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -165,11 +165,11 @@ const handleReset = () => {
}; };
const handleAdd = () => { const handleAdd = () => {
router.push('/supervision/noticeInfo/add'); router.push('/supervision/noticeInfo/add?from=draft');
}; };
const handleBack = () => { const handleBack = () => {
proxy?.$tab.closePage(); proxy?.$tab.closeOpenPage({ path: '/general-manage/supervision-noticeInfo' });
}; };
const handleBatchDelete = () => { const handleBatchDelete = () => {
@ -199,7 +199,7 @@ const handleSelectionChange = (selection: NoticeInfoVo[]) => {
}; };
const handleEdit = (row: NoticeInfoVo) => { const handleEdit = (row: NoticeInfoVo) => {
router.push(`/supervision/noticeInfo/edit/${row.id}`); router.push(`/supervision/noticeInfo/edit/${row.id}?from=draft`);
}; };
const handleDelete = async (row: NoticeInfoVo) => { const handleDelete = async (row: NoticeInfoVo) => {

14
zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/noticeInfo/edit.vue

@ -95,12 +95,15 @@ const submitForm = async (status: number, successMessage: string) => {
targetPlatform: form.targetPlatform, targetPlatform: form.targetPlatform,
displayDays: form.displayDays, displayDays: form.displayDays,
publishTime: form.publishTime, publishTime: form.publishTime,
status, // status,
isDelete: 0 // isDelete: status === 2 ? 0 : 1
}); });
if (res.code === 200) { if (res.code === 200) {
ElMessage.success(successMessage); ElMessage.success(successMessage);
proxy?.$tab.closePage(); const targetPath = route.query.from === 'draft'
? '/supervision/noticeInfo/draft'
: '/general-manage/supervision-noticeInfo';
proxy?.$tab.closeOpenPage({ path: targetPath });
} else { } else {
ElMessage.error(res.msg || '操作失败'); ElMessage.error(res.msg || '操作失败');
} }
@ -113,7 +116,10 @@ const submitForm = async (status: number, successMessage: string) => {
}; };
const handleCancel = () => { const handleCancel = () => {
proxy?.$tab.closePage(); const targetPath = route.query.from === 'draft'
? '/supervision/noticeInfo/draft'
: '/general-manage/supervision-noticeInfo';
proxy?.$tab.closeOpenPage({ path: targetPath });
}; };
const handleSaveDraft = () => { const handleSaveDraft = () => {

8
zdxt-web-client/zdxt-admin-plus-ui/src/views/supervision/noticeInfo/index.vue

@ -87,14 +87,14 @@
<template #default="scope"> <template #default="scope">
<el-button <el-button
size="small" size="small"
type="text" text type="primary"
:class="scope.row.status === 2 ? 'offline-btn' : 'online-btn'" :class="scope.row.status === 2 ? 'offline-btn' : 'online-btn'"
@click="handleStatusChange(scope.row)" @click="handleStatusChange(scope.row)"
> >
{{ scope.row.status === 2 ? '下架' : '上架' }} {{ scope.row.status === 2 ? '下架' : '上架' }}
</el-button> </el-button>
<el-button size="small" type="text" @click="handleEdit(scope.row)">编辑</el-button> <el-button size="small" text type="primary" @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" class="delete-btn" @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -265,7 +265,7 @@ const handleStatusChange = (row: NoticeInfoVo) => {
displayDays: row.displayDays, displayDays: row.displayDays,
publishTime: row.publishTime, publishTime: row.publishTime,
status: newStatus, status: newStatus,
isDelete: 0 // isDelete: newStatus === 2 ? 0 : 1
}); });
if (res.code === 200) { if (res.code === 200) {
ElMessage.success(`${actionText}成功`); ElMessage.success(`${actionText}成功`);

64
zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/EnforcementInfoSection.vue

@ -93,18 +93,19 @@
<div v-if="!formData.isNewJoint" class="union-list-container"> <div v-if="!formData.isNewJoint" class="union-list-container">
<van-loading v-if="unionLoading" size="20" /> <van-loading v-if="unionLoading" size="20" />
<div v-else-if="unionList.length === 0" class="empty-tip">暂无联合执法数据</div> <div v-else-if="unionList.length === 0" class="empty-tip">暂无联合执法数据</div>
<div v-else class="union-list"> <van-radio-group v-else v-model="formData.uniteCheck" direction="vertical" class="union-list" @change="onUnionChange">
<div <van-radio
v-for="item in unionList" v-for="item in unionList"
:key="item.id" :key="item.id"
:name="String(item.id)"
class="union-item" class="union-item"
:class="{ active: formData.uniteCheck === item.id }"
@click="selectUnion(item)"
> >
<div class="union-item-title">{{ item.bureauDeptName || '联合执法' }}</div> <div class="union-item-content">
<div class="union-item-desc">{{ item.deptTexts || item.lawText || '' }}</div> <div class="union-item-title">{{ item.bureauDeptName || '联合执法' }}</div>
</div> <div class="union-item-desc">{{ item.deptTexts || item.lawText || '' }}</div>
</div> </div>
</van-radio>
</van-radio-group>
</div> </div>
</div> </div>
<!-- 隐藏字段用于验证联合执法 --> <!-- 隐藏字段用于验证联合执法 -->
@ -198,7 +199,7 @@ const unionList = ref([]);
const unionLoading = ref(false); const unionLoading = ref(false);
onMounted(() => { onMounted(() => {
const range = getEnforcementTimeDateRange(10); const range = getEnforcementTimeDateRange(7);
minDate.value = range.minDate; minDate.value = range.minDate;
maxDate.value = range.maxDate; maxDate.value = range.maxDate;
defaultPickerValue = range.currentDate; defaultPickerValue = range.currentDate;
@ -224,6 +225,7 @@ const fetchUnionList = () => {
unionLoading.value = false; unionLoading.value = false;
if (res && res.data) { if (res && res.data) {
unionList.value = res.data; unionList.value = res.data;
console.log('联合执法列表:', unionList.value);
} }
}, (err) => { }, (err) => {
unionLoading.value = false; unionLoading.value = false;
@ -232,8 +234,20 @@ const fetchUnionList = () => {
}; };
const selectUnion = (item) => { const selectUnion = (item) => {
props.formData.unionNo = item.unionNo || ''; if (props.formData.uniteCheck === item.id) {
props.formData.uniteCheck = item.id || ''; props.formData.unionNo = '';
props.formData.uniteCheck = '';
} else {
props.formData.unionNo = item.unionNo || '';
props.formData.uniteCheck = item.id || '';
}
};
const onUnionChange = (id) => {
const item = unionList.value.find(item => String(item.id) === id);
if (item) {
props.formData.unionNo = item.unionNo || '';
}
}; };
const openTimePicker = () => { const openTimePicker = () => {
@ -462,6 +476,7 @@ const onAfterReadImage = (file) => {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.16rem; gap: 0.16rem;
padding: 0;
} }
.union-item { .union-item {
@ -472,24 +487,23 @@ const onAfterReadImage = (file) => {
transition: all 0.2s; transition: all 0.2s;
&:active { &:active {
transform: scale(0.98); background: #f5f5f5;
} }
&.active { .union-item-content {
border-color: #1367fe; flex: 1;
background: rgba(19, 103, 254, 0.05);
}
.union-item-title { .union-item-title {
font-size: 14px; font-size: 14px;
color: #333; color: #333;
font-weight: 500; font-weight: 500;
} }
.union-item-desc { .union-item-desc {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
margin-top: 0.08rem; margin-top: 0.08rem;
}
} }
} }
} }

Loading…
Cancel
Save