|
@@ -56,6 +56,12 @@
|
|
:pageSize="queryPage.pageSize"
|
|
:pageSize="queryPage.pageSize"
|
|
@handlePage="handlePage"
|
|
@handlePage="handlePage"
|
|
>
|
|
>
|
|
|
|
+ <template #title-column-value="{ scope }">
|
|
|
|
+ <template v-if="scope.row.status === '1'">
|
|
|
|
+ <el-link class="__cus-table_column-view" @click="onView(scope.row)">{{scope.row.title}}</el-link>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else>{{scope.row.title}}</template>
|
|
|
|
+ </template>
|
|
<template #publishTime-column-value="{ scope }">
|
|
<template #publishTime-column-value="{ scope }">
|
|
{{scope.row.publishTime ? $util.YMDHms(scope.row.publishTime) : scope.row.publishTime}}
|
|
{{scope.row.publishTime ? $util.YMDHms(scope.row.publishTime) : scope.row.publishTime}}
|
|
</template>
|
|
</template>
|
|
@@ -67,16 +73,19 @@
|
|
</template>
|
|
</template>
|
|
<template #do-column-value="{ scope }">
|
|
<template #do-column-value="{ scope }">
|
|
<div class="__cus-table_do">
|
|
<div class="__cus-table_do">
|
|
- <div class="__cus-table_do-green __hover" @click="onView(scope.row)">
|
|
|
|
|
|
+ <div class="__cus-table_do-green __hover" @click="onView(scope.row)" v-if="scope.row.status === '1'">
|
|
<SvgIcon name="view" size="16"/>查看
|
|
<SvgIcon name="view" size="16"/>查看
|
|
</div>
|
|
</div>
|
|
- <div class="__cus-table_do-blue __hover" @click="onEdit(scope.row)">
|
|
|
|
|
|
+ <div class="__cus-table_do-blue __hover" @click="onEdit(scope.row)" v-if="scope.row.status === '2'">
|
|
<SvgIcon name="edit" size="16"/>编辑
|
|
<SvgIcon name="edit" size="16"/>编辑
|
|
</div>
|
|
</div>
|
|
-<!-- <div class="__cus-table_do-green __hover">-->
|
|
|
|
-<!-- <SvgIcon name="publish" size="16"/>发布-->
|
|
|
|
-<!-- </div>-->
|
|
|
|
- <div class="__cus-table_do-red __hover">
|
|
|
|
|
|
+ <div class="__cus-table_do-green __hover" @click="onPublish(scope.row)" v-if="scope.row.status === '2'">
|
|
|
|
+ <SvgIcon name="publish" size="16"/>发布
|
|
|
|
+ </div>
|
|
|
|
+ <div class="__cus-table_do-blue __hover" @click="onRevoke(scope.row)" v-if="scope.row.status === '1'">
|
|
|
|
+ <SvgIcon name="back" size="16"/>撤回
|
|
|
|
+ </div>
|
|
|
|
+ <div class="__cus-table_do-red __hover" @click="onDel(scope.row)" v-if="scope.row.status === '2'">
|
|
<SvgIcon name="del" size="16"/>删除
|
|
<SvgIcon name="del" size="16"/>删除
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -85,7 +94,7 @@
|
|
</template>
|
|
</template>
|
|
</CusContent>
|
|
</CusContent>
|
|
</div>
|
|
</div>
|
|
- <DetailCom v-model:show="showDetail" :transfer="transfer"/>
|
|
|
|
|
|
+ <DetailCom v-model:show="showDetail" :transfer="transfer" @refresh="handleSearch()"/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -105,8 +114,7 @@ import {
|
|
import {useStore} from 'vuex'
|
|
import {useStore} from 'vuex'
|
|
import {useRouter, useRoute} from 'vue-router'
|
|
import {useRouter, useRoute} from 'vue-router'
|
|
import DetailCom from './detail.vue'
|
|
import DetailCom from './detail.vue'
|
|
-import {getNoticeList} from "@/api/modules/notice";
|
|
|
|
-import { ElMessage } from 'element-plus';
|
|
|
|
|
|
+import {ElMessage, ElMessageBox} from 'element-plus';
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: '',
|
|
name: '',
|
|
@@ -143,7 +151,7 @@ export default defineComponent({
|
|
{value: "publishTime", label: "发布时间", show: true, width: 180},
|
|
{value: "publishTime", label: "发布时间", show: true, width: 180},
|
|
{value: "type", label: "类型", show: true},
|
|
{value: "type", label: "类型", show: true},
|
|
{value: "status", label: "状态", show: true},
|
|
{value: "status", label: "状态", show: true},
|
|
- {value: "do", label: "操作", show: true, width: 260},
|
|
|
|
|
|
+ {value: "do", label: "操作", show: true, popover: true, width: 260},
|
|
],
|
|
],
|
|
showDetail: false,
|
|
showDetail: false,
|
|
transfer: {}
|
|
transfer: {}
|
|
@@ -178,8 +186,8 @@ export default defineComponent({
|
|
for (const [k, v] of Object.entries(state.back_queryForm)) {
|
|
for (const [k, v] of Object.entries(state.back_queryForm)) {
|
|
if (that.$util.isValue(v)) {
|
|
if (that.$util.isValue(v)) {
|
|
if (k === 'publishDate') {
|
|
if (k === 'publishDate') {
|
|
- queryParams['bTime'] = v[0]
|
|
|
|
- queryParams['eTime'] = v[1]
|
|
|
|
|
|
+ queryParams['beginTime'] = v[0]
|
|
|
|
+ queryParams['endTime'] = v[1]
|
|
} else {
|
|
} else {
|
|
queryParams[k] = v
|
|
queryParams[k] = v
|
|
}
|
|
}
|
|
@@ -225,6 +233,66 @@ export default defineComponent({
|
|
}
|
|
}
|
|
state.showDetail = true
|
|
state.showDetail = true
|
|
}
|
|
}
|
|
|
|
+ const onDel = (val) => {
|
|
|
|
+ ElMessageBox.confirm(`是否删除${val.title}?`, "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ }).then(() => {
|
|
|
|
+ state.loading = true
|
|
|
|
+ that.$api.delNoticeDelete({id: val.id}).then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ ElMessage.success(res.message)
|
|
|
|
+ handleSearch()
|
|
|
|
+ } else {
|
|
|
|
+ ElMessage.error(res.message)
|
|
|
|
+ state.loading = false
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ state.loading = false
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => {})
|
|
|
|
+ }
|
|
|
|
+ const onPublish = (val) => {
|
|
|
|
+ ElMessageBox.confirm(`是否发布${val.title}?`, "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ }).then(() => {
|
|
|
|
+ state.loading = true
|
|
|
|
+ that.$api.getNoticePublish({id: val.id}).then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ ElMessage.success(res.message)
|
|
|
|
+ handleSearch()
|
|
|
|
+ } else {
|
|
|
|
+ ElMessage.error(res.message)
|
|
|
|
+ state.loading = false
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ state.loading = false
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => {})
|
|
|
|
+ }
|
|
|
|
+ const onRevoke = (val) => {
|
|
|
|
+ ElMessageBox.confirm(`是否撤回${val.title}?`, "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ }).then(() => {
|
|
|
|
+ state.loading = true
|
|
|
|
+ that.$api.getNoticeRevoke({id: val.id}).then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ ElMessage.success(res.message)
|
|
|
|
+ handleSearch()
|
|
|
|
+ } else {
|
|
|
|
+ ElMessage.error(res.message)
|
|
|
|
+ state.loading = false
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ state.loading = false
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => {})
|
|
|
|
+ }
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
state.back_queryForm = JSON.parse(JSON.stringify(state.queryForm))
|
|
state.back_queryForm = JSON.parse(JSON.stringify(state.queryForm))
|
|
initDictionary()
|
|
initDictionary()
|
|
@@ -240,6 +308,9 @@ export default defineComponent({
|
|
onAdd,
|
|
onAdd,
|
|
onEdit,
|
|
onEdit,
|
|
onView,
|
|
onView,
|
|
|
|
+ onDel,
|
|
|
|
+ onRevoke,
|
|
|
|
+ onPublish
|
|
}
|
|
}
|
|
},
|
|
},
|
|
})
|
|
})
|