公告删除

main
fengxinyhyl 6 months ago
parent 75ac0335ab
commit 7bfcc4a8a2
  1. 13
      app/controller/admin/system/notice/SystemNotice.php
  2. 3
      route/admin/notice.php
  3. 4
      view/admin/.env.development
  4. 8
      view/admin/src/api/system.js
  5. 19
      view/admin/src/views/station/notice/index.vue

@ -69,4 +69,17 @@ class SystemNotice extends BaseController
return app('json')->success('发布成功'); return app('json')->success('发布成功');
} }
/**
* @param SystemNoticeValidate $validate
* @return \think\response\Json
* @author xaboy
* @day 2020/11/6
*/
public function delete()
{
$id = $this->request->param("notice_id");
$this->repository->delete($id);
return app('json')->success('操作成功');
}
} }

@ -25,6 +25,9 @@ Route::group(function () {
Route::post('create', '/create')->name('systemNoticeCreate')->option([ Route::post('create', '/create')->name('systemNoticeCreate')->option([
'_alias' => '系统公告发布', '_alias' => '系统公告发布',
]); ]);
Route::post('delete', '/delete')->name('systemNoticeDelete')->option([
'_alias' => '系统公告删除',
]);
})->prefix('admin.system.notice.SystemNotice')->option([ })->prefix('admin.system.notice.SystemNotice')->option([
'_path' => '/station/notice', '_path' => '/station/notice',
'_auth' => true, '_auth' => true,

@ -4,11 +4,11 @@ ENV = 'development'
// http://mer.crmeb.net/admin // http://mer.crmeb.net/admin
# base api # base api
# VUE_APP_BASE_API = 'http://0.0.0.0:8324' # VUE_APP_BASE_API = 'http://0.0.0.0:8324'
VUE_APP_BASE_API = 'https://b2.njrenzhou.com' VUE_APP_BASE_API = 'https://admin.huitongzx.cn'
# socket 连接地址 # socket 连接地址
#VUE_APP_WS_URL = 'ws://0.0.0.0:8324' #VUE_APP_WS_URL = 'ws://0.0.0.0:8324'
VUE_APP_WS_URL = 'wss://b2.njrenzhou.com' VUE_APP_WS_URL = 'wss://admin.huitongzx.cn'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled. # to control whether the babel-plugin-dynamic-import-node plugin is enabled.

@ -212,6 +212,12 @@ export function createNotice(data) {
export function stationNewsList(data) { export function stationNewsList(data) {
return request.get(`notice/lst`, data) return request.get(`notice/lst`, data)
} }
/**
* @description 公告列表 -- 删除
*/
export function deleteNotice(data) {
return request.post(`notice/delete`, data)
}
/** /**
* @description 配置 * @description 配置
*/ */
@ -319,4 +325,4 @@ export function serviceLoginApi(id) {
*/ */
export function cityDataDelete(id) { export function cityDataDelete(id) {
return request.delete(`/store/city/delete/${id}`) return request.delete(`/store/city/delete/${id}`)
} }

@ -75,6 +75,11 @@
</el-form> </el-form>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" min-width="100" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleDelete(scope.row.notice_id, scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<div class="block"> <div class="block">
<el-pagination <el-pagination
@ -163,9 +168,10 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { stationNewsList, createNotice } from '@/api/system' import {stationNewsList, createNotice, deleteNotice} from '@/api/system'
import { merCategoryListApi, merSelectApi } from '@/api/product' import { merCategoryListApi, merSelectApi } from '@/api/product'
import { fromList } from "@/libs/constants.js"; import { fromList } from "@/libs/constants.js";
import {expressDeleteApi} from "@/api/freight";
export default { export default {
name: 'SystemLog', name: 'SystemLog',
data() { data() {
@ -246,6 +252,17 @@ export default {
this.timeVal = []; this.timeVal = [];
this.getList(1); this.getList(1);
}, },
//
handleDelete(id, idx) {
this.$modalSure().then(() => {
deleteNotice({notice_id: id}).then(({ message }) => {
this.$message.success(message)
this.tableData.data.splice(idx, 1)
}).catch(({ message }) => {
this.$message.error(message)
})
})
},
// //
getList(num) { getList(num) {
this.listLoading = true this.listLoading = true

Loading…
Cancel
Save