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

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 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>
@ -165,11 +165,11 @@ const handleReset = () => {
};
const handleAdd = () => {
router.push('/supervision/noticeInfo/add');
router.push('/supervision/noticeInfo/add?from=draft');
};
const handleBack = () => {
proxy?.$tab.closePage();
proxy?.$tab.closeOpenPage({ path: '/general-manage/supervision-noticeInfo' });
};
const handleBatchDelete = () => {
@ -199,7 +199,7 @@ const handleSelectionChange = (selection: 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) => {

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,
displayDays: form.displayDays,
publishTime: form.publishTime,
status,
isDelete: 0
// status,
// isDelete: status === 2 ? 0 : 1
});
if (res.code === 200) {
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 {
ElMessage.error(res.msg || '操作失败');
}
@ -113,7 +116,10 @@ const submitForm = async (status: number, successMessage: string) => {
};
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 = () => {

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

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

Loading…
Cancel
Save