diff --git a/app/controller/admin/system/notice/SystemNotice.php b/app/controller/admin/system/notice/SystemNotice.php index a8733e3..2925cb1 100644 --- a/app/controller/admin/system/notice/SystemNotice.php +++ b/app/controller/admin/system/notice/SystemNotice.php @@ -69,4 +69,17 @@ class SystemNotice extends BaseController 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('操作成功'); + } + } diff --git a/route/admin/notice.php b/route/admin/notice.php index ef1e159..cca9c64 100644 --- a/route/admin/notice.php +++ b/route/admin/notice.php @@ -25,6 +25,9 @@ Route::group(function () { Route::post('create', '/create')->name('systemNoticeCreate')->option([ '_alias' => '系统公告发布', ]); + Route::post('delete', '/delete')->name('systemNoticeDelete')->option([ + '_alias' => '系统公告删除', + ]); })->prefix('admin.system.notice.SystemNotice')->option([ '_path' => '/station/notice', '_auth' => true, diff --git a/view/admin/.env.development b/view/admin/.env.development index 2997b1b..2203f33 100644 --- a/view/admin/.env.development +++ b/view/admin/.env.development @@ -4,11 +4,11 @@ ENV = 'development' // http://mer.crmeb.net/admin # base api # 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 连接地址 #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, # to control whether the babel-plugin-dynamic-import-node plugin is enabled. diff --git a/view/admin/src/api/system.js b/view/admin/src/api/system.js index e164bc5..adf93ab 100644 --- a/view/admin/src/api/system.js +++ b/view/admin/src/api/system.js @@ -212,6 +212,12 @@ export function createNotice(data) { export function stationNewsList(data) { return request.get(`notice/lst`, data) } +/** + * @description 公告列表 -- 删除 + */ +export function deleteNotice(data) { + return request.post(`notice/delete`, data) +} /** * @description 配置 */ @@ -319,4 +325,4 @@ export function serviceLoginApi(id) { */ export function cityDataDelete(id) { return request.delete(`/store/city/delete/${id}`) -} \ No newline at end of file +} diff --git a/view/admin/src/views/station/notice/index.vue b/view/admin/src/views/station/notice/index.vue index 6cc0f0e..fba9960 100644 --- a/view/admin/src/views/station/notice/index.vue +++ b/view/admin/src/views/station/notice/index.vue @@ -75,6 +75,11 @@ + + +
// +---------------------------------------------------------------------- -import { stationNewsList, createNotice } from '@/api/system' +import {stationNewsList, createNotice, deleteNotice} from '@/api/system' import { merCategoryListApi, merSelectApi } from '@/api/product' import { fromList } from "@/libs/constants.js"; +import {expressDeleteApi} from "@/api/freight"; export default { name: 'SystemLog', data() { @@ -246,6 +252,17 @@ export default { this.timeVal = []; 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) { this.listLoading = true