Przeglądaj źródła

名点 名店相关

lijj 2 lat temu
rodzic
commit
1ebb30dad3

+ 27 - 18
admin_ui/src/option/ycwh/famousDish.js

@@ -8,9 +8,11 @@ export default {
   index: true,
   addBtn: false,
   editBtn: false,
-  viewBtn: true,
+  viewBtn: false,
+  delBtn: false,
   selection: true,
   dialogClickModal: false,
+  menuWidth: 150,
   column: [{
       label: "主键",
       prop: "id",
@@ -87,7 +89,7 @@ export default {
     {
       label: "封面",
       prop: "cover",
-      type: "input",
+      type: "upload",
     },
     {
       label: "名称",
@@ -98,17 +100,20 @@ export default {
       label: "副标题",
       prop: "subTitle",
       type: "input",
+      overHidden: true,
     },
     {
       label: "视频",
       prop: "videos",
-      type: "input",
+      type: "upload",
+      slot: true,
+      width: 250
     },
-//  {
-//    label: "内容",
-//    prop: "content",
-//    type: "input",
-//  },
+    //  {
+    //    label: "内容",
+    //    prop: "content",
+    //    type: "input",
+    //  },
     //  {
     //    label: "所属地区id",
     //    prop: "regionId",
@@ -118,6 +123,8 @@ export default {
       label: "地址",
       prop: "address",
       type: "input",
+      width: 250,
+      overHidden: true,
     },
     //  {
     //    label: "纬度",
@@ -129,25 +136,27 @@ export default {
     //    prop: "longitude",
     //    type: "input",
     //  },
-    {
-      label: "置顶",
-      prop: "top",
-      type: "input",
-    },
+    //  {
+    //    label: "置顶",
+    //    prop: "top",
+    //    type: "input",
+    //  },
     {
       label: "浏览量",
       prop: "views",
       type: "input",
+      width: 90
     },
-//  {
-//    label: "备注",
-//    prop: "remark",
-//    type: "input",
-//  },
+    //  {
+    //    label: "备注",
+    //    prop: "remark",
+    //    type: "input",
+    //  },
     {
       label: "顺序",
       prop: "sort",
       type: "input",
+      width: 70
     },
   ]
 }

+ 55 - 44
admin_ui/src/option/ycwh/famousLocation.js

@@ -1,16 +1,19 @@
 export default {
-  height:'auto',
+  height: 'auto',
   calcHeight: 30,
   tip: false,
   searchShow: true,
   searchMenuSpan: 6,
   border: true,
   index: true,
-  viewBtn: true,
+  addBtn: false,
+  editBtn: false,
+  viewBtn: false,
+  delBtn: false,
   selection: true,
   dialogClickModal: false,
-  column: [
-    {
+  menuWidth: 150,
+  column: [{
       label: "主键",
       prop: "id",
       type: "input",
@@ -82,20 +85,11 @@ export default {
       viewDisplay: false,
       hide: true,
     },
-    {
-      label: "备注",
-      prop: "remark",
-      type: "input",
-    },
-    {
-      label: "顺序",
-      prop: "sort",
-      type: "input",
-    },
+
     {
       label: "封面",
       prop: "cover",
-      type: "input",
+      type: "upload",
     },
     {
       label: "名称",
@@ -106,46 +100,63 @@ export default {
       label: "副标题",
       prop: "subTitle",
       type: "input",
+      overHidden: true,
     },
     {
-      label: "视频(多个用英文逗号隔开)",
+      label: "视频",
       prop: "videos",
-      type: "input",
-    },
-    {
-      label: "内容",
-      prop: "content",
-      type: "input",
-    },
-    {
-      label: "所属地区id",
-      prop: "regionId",
-      type: "input",
-    },
+      type: "upload",
+      slot: true,
+      width: 250
+    },
+    //  {
+    //    label: "内容",
+    //    prop: "content",
+    //    type: "input",
+    //  },
+    //  {
+    //    label: "所属地区id",
+    //    prop: "regionId",
+    //    type: "input",
+    //  },
     {
       label: "地址",
       prop: "address",
       type: "input",
-    },
-    {
-      label: "纬度",
-      prop: "latitude",
-      type: "input",
-    },
+      width: 250,
+      overHidden: true,
+    },
+    //  {
+    //    label: "纬度",
+    //    prop: "latitude",
+    //    type: "input",
+    //  },
+    //  {
+    //    label: "经度",
+    //    prop: "longitude",
+    //    type: "input",
+    //  },
+    //  {
+    //    label: "置顶",
+    //    prop: "top",
+    //    type: "input",
+    //  },
     {
-      label: "经度",
-      prop: "longitude",
-      type: "input",
-    },
-    {
-      label: "置顶",
-      prop: "top",
+      label: "浏览量",
+      prop: "views",
       type: "input",
+      width: 90
     },
+    //  {
+    //    label: "备注",
+    //    prop: "remark",
+    //    type: "input",
+    //  },
     {
-      label: "浏览量",
-      prop: "views",
+      label: "顺序",
+      prop: "sort",
       type: "input",
+      width: 70
     },
   ]
-}
+}

+ 55 - 44
admin_ui/src/option/ycwh/famousStore.js

@@ -1,16 +1,19 @@
 export default {
-  height:'auto',
+  height: 'auto',
   calcHeight: 30,
   tip: false,
   searchShow: true,
   searchMenuSpan: 6,
   border: true,
   index: true,
-  viewBtn: true,
+  addBtn: false,
+  editBtn: false,
+  viewBtn: false,
+  delBtn: false,
   selection: true,
   dialogClickModal: false,
-  column: [
-    {
+  menuWidth: 150,
+  column: [{
       label: "主键",
       prop: "id",
       type: "input",
@@ -82,20 +85,11 @@ export default {
       viewDisplay: false,
       hide: true,
     },
-    {
-      label: "备注",
-      prop: "remark",
-      type: "input",
-    },
-    {
-      label: "顺序",
-      prop: "sort",
-      type: "input",
-    },
+
     {
       label: "封面",
       prop: "cover",
-      type: "input",
+      type: "upload",
     },
     {
       label: "名称",
@@ -106,46 +100,63 @@ export default {
       label: "副标题",
       prop: "subTitle",
       type: "input",
+      overHidden: true,
     },
     {
-      label: "视频(多个用英文逗号隔开)",
+      label: "视频",
       prop: "videos",
-      type: "input",
-    },
-    {
-      label: "内容",
-      prop: "content",
-      type: "input",
-    },
-    {
-      label: "所属地区id",
-      prop: "regionId",
-      type: "input",
-    },
+      type: "upload",
+      slot: true,
+      width: 250
+    },
+    //  {
+    //    label: "内容",
+    //    prop: "content",
+    //    type: "input",
+    //  },
+    //  {
+    //    label: "所属地区id",
+    //    prop: "regionId",
+    //    type: "input",
+    //  },
     {
       label: "地址",
       prop: "address",
       type: "input",
-    },
-    {
-      label: "纬度",
-      prop: "latitude",
-      type: "input",
-    },
+      width: 250,
+      overHidden: true,
+    },
+    //  {
+    //    label: "纬度",
+    //    prop: "latitude",
+    //    type: "input",
+    //  },
+    //  {
+    //    label: "经度",
+    //    prop: "longitude",
+    //    type: "input",
+    //  },
+    //  {
+    //    label: "置顶",
+    //    prop: "top",
+    //    type: "input",
+    //  },
     {
-      label: "经度",
-      prop: "longitude",
-      type: "input",
-    },
-    {
-      label: "置顶",
-      prop: "top",
+      label: "浏览量",
+      prop: "views",
       type: "input",
+      width: 90
     },
+    //  {
+    //    label: "备注",
+    //    prop: "remark",
+    //    type: "input",
+    //  },
     {
-      label: "浏览量",
-      prop: "views",
+      label: "顺序",
+      prop: "sort",
       type: "input",
+      width: 70
     },
   ]
-}
+}

+ 15 - 4
admin_ui/src/views/ycwh/components/editArticle/index.vue

@@ -1,6 +1,6 @@
 <template>
   <el-form ref="form" class="article-form" :model="form" :rules="rules" label-width="85px">
-    <el-form-item label="名" prop="name">
+    <el-form-item label="名" prop="name">
       <el-input v-model="form.name" maxlength="80" show-word-limit />
     </el-form-item>
     <el-form-item label="副标题" prop="subTitle">
@@ -30,7 +30,7 @@
     <el-form-item label="视频" prop="videos">
       <div style="display: flex;">
         <el-upload class="avatar-uploader cover-w16h9" style="margin-right: 30px !important;" :http-request="uploadImg" :data="{type:'video'}" :show-file-list="false" :before-upload="beforeAvatarUpload">
-          <el-image fit="contain" v-if="form.videos" :src="form.cover" class="avatar"></el-image>
+          <video fit="contain" v-if="form.videos" :src="form.videos" class="avatar"></video>
           <el-icon v-else class="el-icon-plus avatar-uploader-icon">
             <Plus />
           </el-icon>
@@ -39,7 +39,9 @@
     </el-form-item>
     <el-form-item label="所属地区" prop="regionId">
       <div style="display: flex;">
-        <el-input v-model="form.regionId" placeholder="请选择所属地区"></el-input>
+        <el-select v-model="form.regionId" placeholder="请选择所属区域">
+          <el-option v-for="item in regionList" :key="item.id" :label="item.name" :value="item.id" />
+        </el-select>
       </div>
     </el-form-item>
     <el-form-item label="详细地址" prop="address">
@@ -70,6 +72,7 @@
   import {
     uploadFile
   } from "@/api/oss/oss";
+  import { getLazyTree } from "@/api/base/region";
   //
   import {
     startPickTime,
@@ -94,6 +97,8 @@
       return {
         loading: false,
         //
+        regionList: [],
+        //
         attachmentList: [],
         // 提交内容
         form: {
@@ -139,7 +144,7 @@
           cover: [{
             required: true,
             message: '请上传封面',
-            trigger: 'blur'
+            trigger: 'blur',
           }],
           content: [{
             required: true,
@@ -199,6 +204,7 @@
       if(this.id && this.id > 0) {
         this.getDetail(this.id)
       }
+      this.getRegionList();
     },
     watch: {
       'mapForm' () {
@@ -210,6 +216,11 @@
       },
     },
     methods: {
+      getRegionList() {
+        getLazyTree("44").then(res => {
+          this.regionList = res.data.data || [];
+        })
+      },
       showMap(formType) {
         if(formType === 'input') {
           if(!(this.form.longitude && this.form.latitude)) {

+ 15 - 5
admin_ui/src/views/ycwh/famousDish.vue

@@ -2,11 +2,14 @@
   <basic-container>
     <avue-crud :option="option" v-model:search="search" v-model:page="page" v-model="form" :table-loading="loading" :data="data" :permission="permissionList" :before-open="beforeOpen" ref="crud" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
       <template #menu-left>
-        <el-button type="primary" icon="el-icon-plus" @click="toEdit()">新增</el-button>
-        <el-button type="danger" icon="el-icon-delete" plain v-if="permission.famousDish_delete" @click="handleDelete">删 除
-        </el-button>
-        <el-button type="warning" plain icon="el-icon-download" @click="handleExport">导 出
-        </el-button>
+        <el-button type="primary" icon="el-icon-plus" v-if="permission.famousDish_add" @click="toEdit()">新增</el-button>
+      </template>
+      <template #menu="scope">
+        <el-button type="text" icon="el-icon-edit" v-if="permission.famousDish_edit" @click="toEdit(scope.row)">编辑</el-button>
+        <el-button type="text" icon="el-icon-delete" v-if="permission.famousDish_delete" @click="handleDelete(scope.row.id)">删 除</el-button>
+      </template>
+      <template #videos="scope">
+        <video v-if="scope.row.videos" :src="scope.row.videos" style="width: 200px; height: 112px; border: 1px dashed #d9d9d9" controls></video>
       </template>
     </avue-crud>
     <el-dialog :title="dialogTitle" fullscreen v-model="dialogVisible" :modal-append-to-body="false" :close-on-click-modal="false" @close="closeDialog()" top="5vh" width="70%">
@@ -26,6 +29,7 @@
   import NProgress from 'nprogress';
   import 'nprogress/nprogress.css';
   //
+  import { getLazyTree } from "@/api/base/region";
   import editArticle from "./components/editArticle/index.vue"
 
   export default {
@@ -70,7 +74,13 @@
         return ids.join(",");
       }
     },
+    created() {},
     methods: {
+      getRegionList() {
+        getLazyTree("4404").then(res => {
+          debugger
+        })
+      },
       rowSave(row, done, loading) {
         add(row).then(() => {
           this.onLoad(this.page);

+ 72 - 59
admin_ui/src/views/ycwh/famousLocation.vue

@@ -1,55 +1,47 @@
 <template>
   <basic-container>
-    <avue-crud :option="option"
-               v-model:search="search"
-               v-model:page="page"
-               v-model="form"
-               :table-loading="loading"
-               :data="data"
-               :permission="permissionList"
-               :before-open="beforeOpen"
-               ref="crud"
-               @row-update="rowUpdate"
-               @row-save="rowSave"
-               @row-del="rowDel"
-               @search-change="searchChange"
-               @search-reset="searchReset"
-               @selection-change="selectionChange"
-               @current-change="currentChange"
-               @size-change="sizeChange"
-               @refresh-change="refreshChange"
-               @on-load="onLoad">
+    <avue-crud :option="option" v-model:search="search" v-model:page="page" v-model="form" :table-loading="loading" :data="data" :permission="permissionList" :before-open="beforeOpen" ref="crud" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
       <template #menu-left>
-        <el-button type="danger"
-                   icon="el-icon-delete"
-                   plain
-                   v-if="permission.famousLocation_delete"
-                   @click="handleDelete">删 除
-        </el-button>
-        <el-button type="warning"
-                   plain
-                   icon="el-icon-download"
-                   @click="handleExport">导 出
-        </el-button>
+        <el-button type="primary" icon="el-icon-plus" v-if="permission.famousLocation_add" @click="toEdit()">新增</el-button>
+      </template>
+      <template #menu="scope">
+        <el-button type="text" icon="el-icon-edit" v-if="permission.famousLocation_edit" @click="toEdit(scope.row)">编辑</el-button>
+        <el-button type="text" icon="el-icon-delete" v-if="permission.famousLocation_delete" @click="handleDelete(scope.row.id)">删 除</el-button>
+      </template>
+      <template #videos="scope">
+        <video v-if="scope.row.videos" :src="scope.row.videos" style="width: 200px; height: 112px; border: 1px dashed #d9d9d9" controls></video>
       </template>
     </avue-crud>
+    <el-dialog :title="dialogTitle" fullscreen v-model="dialogVisible" :modal-append-to-body="false" :close-on-click-modal="false" @close="closeDialog()" top="5vh" width="70%">
+      <edit-article v-if="dialogVisible" :id="currentArticle?currentArticle.id:''" @afterSave="afterSave" @toCancel="closeDialog" />
+    </el-dialog>
   </basic-container>
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/ycwh/famousLocation";
+  import { getList, getDetail, add, update, remove } from "@/api/ycwh/famousLocation";
   import option from "@/option/ycwh/famousLocation";
-  import {mapGetters} from "vuex";
-  import {exportBlob} from "@/api/common";
-  import {getToken} from '@/utils/auth';
-  import {downloadXls} from "@/utils/util";
-  import {dateNow} from "@/utils/date";
+  import { mapGetters } from "vuex";
+  import { exportBlob } from "@/api/common";
+  import { getToken } from '@/utils/auth';
+  import { downloadXls } from "@/utils/util";
+  import { dateNow } from "@/utils/date";
   import NProgress from 'nprogress';
   import 'nprogress/nprogress.css';
+  //
+  import { getLazyTree } from "@/api/base/region";
+  import editArticle from "./components/editArticle/index.vue"
 
   export default {
+    components: {
+      editArticle
+    },
     data() {
       return {
+        dialogTitle: '',
+        currentArticle: null,
+        dialogVisible: false,
+        //
         form: {},
         query: {},
         search: {},
@@ -82,7 +74,13 @@
         return ids.join(",");
       }
     },
+    created() {},
     methods: {
+      getRegionList() {
+        getLazyTree("4404").then(res => {
+          debugger
+        })
+      },
       rowSave(row, done, loading) {
         add(row).then(() => {
           this.onLoad(this.page);
@@ -111,10 +109,10 @@
       },
       rowDel(row) {
         this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
           .then(() => {
             return remove(row.id);
           })
@@ -127,15 +125,15 @@
           });
       },
       handleDelete() {
-        if (this.selectionList.length === 0) {
+        if(this.selectionList.length === 0) {
           this.$message.warning("请选择至少一条数据");
           return;
         }
         this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
           .then(() => {
             return remove(this.ids);
           })
@@ -149,11 +147,9 @@
           });
       },
       handleExport() {
-        let downloadUrl = `/famous_location/famousLocation/export-famousLocation?${this.website.tokenHeader}=${getToken()}`;
-        const {
-        } = this.query;
-        let values = {
-        };
+        let downloadUrl = `/famous_dish/famousLocation/export-famousLocation?${this.website.tokenHeader}=${getToken()}`;
+        const {} = this.query;
+        let values = {};
         this.$confirm("是否导出数据?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -161,13 +157,13 @@
         }).then(() => {
           NProgress.start();
           exportBlob(downloadUrl, values).then(res => {
-            downloadXls(res.data, `名${dateNow()}.xlsx`);
+            downloadXls(res.data, `名${dateNow()}.xlsx`);
             NProgress.done();
           })
         });
       },
       beforeOpen(done, type) {
-        if (["edit", "view"].includes(type)) {
+        if(["edit", "view"].includes(type)) {
           getDetail(this.form.id).then(res => {
             this.form = res.data.data;
           });
@@ -191,10 +187,10 @@
         this.selectionList = [];
         this.$refs.crud.toggleSelection();
       },
-      currentChange(currentPage){
+      currentChange(currentPage) {
         this.page.currentPage = currentPage;
       },
-      sizeChange(pageSize){
+      sizeChange(pageSize) {
         this.page.pageSize = pageSize;
       },
       refreshChange() {
@@ -203,11 +199,9 @@
       onLoad(page, params = {}) {
         this.loading = true;
 
-        const {
-        } = this.query;
+        const {} = this.query;
 
-        let values = {
-        };
+        let values = {};
 
         getList(page.currentPage, page.pageSize, values).then(res => {
           const data = res.data.data;
@@ -216,10 +210,29 @@
           this.loading = false;
           this.selectionClear();
         });
+      },
+      // 新增文章相关
+      toEdit(row) {
+        if(row && row.id) {
+          this.dialogTitle += '编辑';
+          this.currentArticle = row;
+        } else {
+          this.dialogTitle += '新增'
+          this.currentArticle = null
+        }
+        this.dialogVisible = true;
+      },
+      closeDialog(needReflash) {
+        this.currentArticle = null;
+        if(needReflash) {
+          this.refreshChange();
+        }
+        this.dialogVisible = false;
       }
     }
   };
 </script>
 
 <style>
-</style>
+
+</style>

+ 72 - 59
admin_ui/src/views/ycwh/famousStore.vue

@@ -1,55 +1,47 @@
 <template>
   <basic-container>
-    <avue-crud :option="option"
-               v-model:search="search"
-               v-model:page="page"
-               v-model="form"
-               :table-loading="loading"
-               :data="data"
-               :permission="permissionList"
-               :before-open="beforeOpen"
-               ref="crud"
-               @row-update="rowUpdate"
-               @row-save="rowSave"
-               @row-del="rowDel"
-               @search-change="searchChange"
-               @search-reset="searchReset"
-               @selection-change="selectionChange"
-               @current-change="currentChange"
-               @size-change="sizeChange"
-               @refresh-change="refreshChange"
-               @on-load="onLoad">
+    <avue-crud :option="option" v-model:search="search" v-model:page="page" v-model="form" :table-loading="loading" :data="data" :permission="permissionList" :before-open="beforeOpen" ref="crud" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
       <template #menu-left>
-        <el-button type="danger"
-                   icon="el-icon-delete"
-                   plain
-                   v-if="permission.famousStore_delete"
-                   @click="handleDelete">删 除
-        </el-button>
-        <el-button type="warning"
-                   plain
-                   icon="el-icon-download"
-                   @click="handleExport">导 出
-        </el-button>
+        <el-button type="primary" icon="el-icon-plus" v-if="permission.famousStore_add" @click="toEdit()">新增</el-button>
+      </template>
+      <template #menu="scope">
+        <el-button type="text" icon="el-icon-edit" v-if="permission.famousStore_edit" @click="toEdit(scope.row)">编辑</el-button>
+        <el-button type="text" icon="el-icon-delete" v-if="permission.famousStore_delete" @click="handleDelete(scope.row.id)">删 除</el-button>
+      </template>
+      <template #videos="scope">
+        <video v-if="scope.row.videos" :src="scope.row.videos" style="width: 200px; height: 112px; border: 1px dashed #d9d9d9" controls></video>
       </template>
     </avue-crud>
+    <el-dialog :title="dialogTitle" fullscreen v-model="dialogVisible" :modal-append-to-body="false" :close-on-click-modal="false" @close="closeDialog()" top="5vh" width="70%">
+      <edit-article v-if="dialogVisible" :id="currentArticle?currentArticle.id:''" @afterSave="afterSave" @toCancel="closeDialog" />
+    </el-dialog>
   </basic-container>
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/ycwh/famousStore";
+  import { getList, getDetail, add, update, remove } from "@/api/ycwh/famousStore";
   import option from "@/option/ycwh/famousStore";
-  import {mapGetters} from "vuex";
-  import {exportBlob} from "@/api/common";
-  import {getToken} from '@/utils/auth';
-  import {downloadXls} from "@/utils/util";
-  import {dateNow} from "@/utils/date";
+  import { mapGetters } from "vuex";
+  import { exportBlob } from "@/api/common";
+  import { getToken } from '@/utils/auth';
+  import { downloadXls } from "@/utils/util";
+  import { dateNow } from "@/utils/date";
   import NProgress from 'nprogress';
   import 'nprogress/nprogress.css';
+  //
+  import { getLazyTree } from "@/api/base/region";
+  import editArticle from "./components/editArticle/index.vue"
 
   export default {
+    components: {
+      editArticle
+    },
     data() {
       return {
+        dialogTitle: '',
+        currentArticle: null,
+        dialogVisible: false,
+        //
         form: {},
         query: {},
         search: {},
@@ -82,7 +74,13 @@
         return ids.join(",");
       }
     },
+    created() {},
     methods: {
+      getRegionList() {
+        getLazyTree("4404").then(res => {
+          debugger
+        })
+      },
       rowSave(row, done, loading) {
         add(row).then(() => {
           this.onLoad(this.page);
@@ -111,10 +109,10 @@
       },
       rowDel(row) {
         this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
           .then(() => {
             return remove(row.id);
           })
@@ -127,15 +125,15 @@
           });
       },
       handleDelete() {
-        if (this.selectionList.length === 0) {
+        if(this.selectionList.length === 0) {
           this.$message.warning("请选择至少一条数据");
           return;
         }
         this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
           .then(() => {
             return remove(this.ids);
           })
@@ -149,11 +147,9 @@
           });
       },
       handleExport() {
-        let downloadUrl = `/famous_store/famousStore/export-famousStore?${this.website.tokenHeader}=${getToken()}`;
-        const {
-        } = this.query;
-        let values = {
-        };
+        let downloadUrl = `/famous_dish/famousStore/export-famousStore?${this.website.tokenHeader}=${getToken()}`;
+        const {} = this.query;
+        let values = {};
         this.$confirm("是否导出数据?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -161,13 +157,13 @@
         }).then(() => {
           NProgress.start();
           exportBlob(downloadUrl, values).then(res => {
-            downloadXls(res.data, `名${dateNow()}.xlsx`);
+            downloadXls(res.data, `名${dateNow()}.xlsx`);
             NProgress.done();
           })
         });
       },
       beforeOpen(done, type) {
-        if (["edit", "view"].includes(type)) {
+        if(["edit", "view"].includes(type)) {
           getDetail(this.form.id).then(res => {
             this.form = res.data.data;
           });
@@ -191,10 +187,10 @@
         this.selectionList = [];
         this.$refs.crud.toggleSelection();
       },
-      currentChange(currentPage){
+      currentChange(currentPage) {
         this.page.currentPage = currentPage;
       },
-      sizeChange(pageSize){
+      sizeChange(pageSize) {
         this.page.pageSize = pageSize;
       },
       refreshChange() {
@@ -203,11 +199,9 @@
       onLoad(page, params = {}) {
         this.loading = true;
 
-        const {
-        } = this.query;
+        const {} = this.query;
 
-        let values = {
-        };
+        let values = {};
 
         getList(page.currentPage, page.pageSize, values).then(res => {
           const data = res.data.data;
@@ -216,10 +210,29 @@
           this.loading = false;
           this.selectionClear();
         });
+      },
+      // 新增文章相关
+      toEdit(row) {
+        if(row && row.id) {
+          this.dialogTitle += '编辑';
+          this.currentArticle = row;
+        } else {
+          this.dialogTitle += '新增'
+          this.currentArticle = null
+        }
+        this.dialogVisible = true;
+      },
+      closeDialog(needReflash) {
+        this.currentArticle = null;
+        if(needReflash) {
+          this.refreshChange();
+        }
+        this.dialogVisible = false;
       }
     }
   };
 </script>
 
 <style>
-</style>
+
+</style>