Browse Source

列表,编辑相关调整

lijj 2 years ago
parent
commit
2afe8a4233
26 changed files with 1757 additions and 638 deletions
  1. 54 0
      admin/src/main/java/org/springblade/common/enums/ycwh/InformationTypeEnum.java
  2. 50 37
      admin_ui/src/option/ycwh/documentInfo.js
  3. 19 16
      admin_ui/src/option/ycwh/feedback.js
  4. 38 22
      admin_ui/src/option/ycwh/informationInfo.js
  5. 14 14
      admin_ui/src/option/ycwh/memberInfo.js
  6. 54 41
      admin_ui/src/option/ycwh/professionalStyle.js
  7. 27 57
      admin_ui/src/views/ycwh/account.vue
  8. 26 54
      admin_ui/src/views/ycwh/collectInfo.vue
  9. 23 77
      admin_ui/src/views/ycwh/common/constants.js
  10. 53 0
      admin_ui/src/views/ycwh/components/editDocumentInfo/index.scss
  11. 334 0
      admin_ui/src/views/ycwh/components/editDocumentInfo/index.vue
  12. 1 9
      admin_ui/src/views/ycwh/components/editFamousDish/index.vue
  13. 1 9
      admin_ui/src/views/ycwh/components/editFamousLocation/index.vue
  14. 1 9
      admin_ui/src/views/ycwh/components/editFamousStore/index.vue
  15. 53 0
      admin_ui/src/views/ycwh/components/editInformationInfo/index.scss
  16. 340 0
      admin_ui/src/views/ycwh/components/editInformationInfo/index.vue
  17. 53 0
      admin_ui/src/views/ycwh/components/editProfessionalStyle/index.scss
  18. 340 0
      admin_ui/src/views/ycwh/components/editProfessionalStyle/index.vue
  19. 71 58
      admin_ui/src/views/ycwh/documentInfo.vue
  20. 3 3
      admin_ui/src/views/ycwh/famousDish.vue
  21. 3 3
      admin_ui/src/views/ycwh/famousLocation.vue
  22. 3 3
      admin_ui/src/views/ycwh/famousStore.vue
  23. 27 55
      admin_ui/src/views/ycwh/feedback.vue
  24. 71 58
      admin_ui/src/views/ycwh/informationInfo.vue
  25. 27 55
      admin_ui/src/views/ycwh/memberInfo.vue
  26. 71 58
      admin_ui/src/views/ycwh/professionalStyle.vue

+ 54 - 0
admin/src/main/java/org/springblade/common/enums/ycwh/InformationTypeEnum.java

@@ -0,0 +1,54 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.common.enums.ycwh;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.springblade.core.tool.utils.Func;
+
+/**
+ * 系统字典枚举类
+ *
+ * @author Chill
+ */
+@Getter
+@AllArgsConstructor
+public enum InformationTypeEnum {
+	// 名菜、名点、名店、专业风采
+	famous_dish("famous_dish", "名菜"),
+	famous_location("famous_location", "名点"),
+	famous_store("famous_store", "名店"),
+	professional_style("professional_style", "专业风采");
+
+	final String value;
+	final String label;
+
+	private static String getLabelByValue(String v) {
+		if (Func.isBlank(v)) {
+			return null;
+		}
+		String rs = null;
+		for (InformationTypeEnum e : InformationTypeEnum.values()) {
+			if (e.getValue().equals(v)) {
+				rs = e.getLabel();
+				break;
+			}
+		}
+		return rs;
+	}
+
+}

+ 50 - 37
admin_ui/src/option/ycwh/documentInfo.js

@@ -1,16 +1,21 @@
+import { documentTypeOptions } from "@/views/ycwh/common/constants.js";
+
 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 +87,13 @@ export default {
       viewDisplay: false,
       hide: true,
     },
+
     {
-      label: "备注",
-      prop: "remark",
-      type: "input",
-    },
-    {
-      label: "顺序",
-      prop: "sort",
-      type: "input",
-    },
-    {
-      label: "文档类型(用户协议、隐私政策、关于我们等)",
+      label: "文档类型",
       prop: "documentType",
-      type: "input",
+      type: "select",
+      dicData: documentTypeOptions,
+      search: true
     },
     {
       label: "标题",
@@ -106,36 +104,51 @@ export default {
       label: "副标题",
       prop: "subTitle",
       type: "input",
+      overHidden: true,
     },
     {
-      label: "视频(多个用英文逗号隔开)",
+      //    (多个用英文逗号隔开)
+      label: "视频",
       prop: "videos",
-      type: "input",
+      type: "upload",
+      slot: true,
+      width: 250
     },
     {
       label: "内容",
       prop: "content",
       type: "input",
-    },
+      hide: true
+    },
+    //  {
+    //    label: "地址",
+    //    prop: "address",
+    //    type: "input",
+    //  },
+    //  {
+    //    label: "纬度",
+    //    prop: "latitude",
+    //    type: "input",
+    //  },
+    //  {
+    //    label: "经度",
+    //    prop: "longitude",
+    //    type: "input",
+    //  },
+    //  {
+    //    label: "置顶",
+    //    prop: "top",
+    //    type: "input",
+    //  },
+    //  {
+    //    label: "备注",
+    //    prop: "remark",
+    //    type: "input",
+    //  },
     {
-      label: "地址",
-      prop: "address",
-      type: "input",
-    },
-    {
-      label: "纬度",
-      prop: "latitude",
-      type: "input",
-    },
-    {
-      label: "经度",
-      prop: "longitude",
-      type: "input",
-    },
-    {
-      label: "置顶",
-      prop: "top",
+      label: "顺序",
+      prop: "sort",
       type: "input",
     },
   ]
-}
+}

+ 19 - 16
admin_ui/src/option/ycwh/feedback.js

@@ -1,5 +1,6 @@
+import { informationTypeOptions } from "@/views/ycwh/common/constants.js";
 export default {
-  height:'auto',
+  height: 'auto',
   calcHeight: 30,
   tip: false,
   searchShow: true,
@@ -9,8 +10,7 @@ export default {
   viewBtn: true,
   selection: true,
   dialogClickModal: false,
-  column: [
-    {
+  column: [{
       label: "主键",
       prop: "id",
       type: "input",
@@ -82,25 +82,18 @@ export default {
       viewDisplay: false,
       hide: true,
     },
-    {
-      label: "备注",
-      prop: "remark",
-      type: "input",
-    },
-    {
-      label: "顺序",
-      prop: "sort",
-      type: "input",
-    },
     {
       label: "用户ID",
       prop: "memberId",
       type: "input",
     },
     {
-      label: "来源类型(名菜、名点、名店)",
+      //    (名菜、名点、名店)
+      label: "来源类型",
       prop: "sourceType",
-      type: "input",
+      type: "select",
+      dicData: informationTypeOptions,
+      search: true
     },
     {
       label: "来源ID",
@@ -112,5 +105,15 @@ export default {
       prop: "content",
       type: "input",
     },
+    {
+      label: "备注",
+      prop: "remark",
+      type: "input",
+    },
+    {
+      label: "顺序",
+      prop: "sort",
+      type: "input",
+    },
   ]
-}
+}

+ 38 - 22
admin_ui/src/option/ycwh/informationInfo.js

@@ -1,16 +1,21 @@
+import { informationTypeOptions } from "@/views/ycwh/common/constants.js";
+
 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,25 +87,19 @@ export default {
       viewDisplay: false,
       hide: true,
     },
+
     {
-      label: "备注",
-      prop: "remark",
-      type: "input",
-    },
-    {
-      label: "顺序",
-      prop: "sort",
-      type: "input",
-    },
-    {
-      label: "资讯类型(名菜、名点、名店、专业风采等)",
+      //    (名菜、名点、名店、专业风采等)
+      label: "资讯类型",
       prop: "informationType",
-      type: "input",
+      type: "select",
+      dicData: informationTypeOptions,
+      search: true
     },
     {
       label: "封面",
       prop: "cover",
-      type: "input",
+      type: "upload",
     },
     {
       label: "标题",
@@ -111,26 +110,43 @@ export default {
       label: "副标题",
       prop: "subTitle",
       type: "input",
+      overHidden: true,
     },
     {
-      label: "视频(多个用英文逗号隔开)",
+      //    (多个用英文逗号隔开)
+      label: "视频",
       prop: "videos",
-      type: "input",
+      type: "upload",
+      slot: true,
+      width: 250
     },
     {
       label: "内容",
       prop: "content",
       type: "input",
+      hide: true
     },
     {
       label: "浏览量",
       prop: "views",
       type: "input",
+      width: 90
     },
+    //  {
+    //    label: "置顶",
+    //    prop: "top",
+    //    type: "input",
+    //  },
+    //  {
+    //    label: "备注",
+    //    prop: "remark",
+    //    type: "input",
+    //  },
     {
-      label: "置顶",
-      prop: "top",
+      label: "顺序",
+      prop: "sort",
       type: "input",
+      width: 70
     },
   ]
-}
+}

+ 14 - 14
admin_ui/src/option/ycwh/memberInfo.js

@@ -1,5 +1,5 @@
 export default {
-  height:'auto',
+  height: 'auto',
   calcHeight: 30,
   tip: false,
   searchShow: true,
@@ -9,8 +9,7 @@ export default {
   viewBtn: true,
   selection: true,
   dialogClickModal: false,
-  column: [
-    {
+  column: [{
       label: "主键",
       prop: "id",
       type: "input",
@@ -82,16 +81,7 @@ export default {
       viewDisplay: false,
       hide: true,
     },
-    {
-      label: "备注",
-      prop: "remark",
-      type: "input",
-    },
-    {
-      label: "顺序",
-      prop: "sort",
-      type: "input",
-    },
+
     {
       label: "头像",
       prop: "avatar",
@@ -162,5 +152,15 @@ export default {
       prop: "ballnum",
       type: "input",
     },
+    {
+      label: "备注",
+      prop: "remark",
+      type: "input",
+    },
+    {
+      label: "顺序",
+      prop: "sort",
+      type: "input",
+    },
   ]
-}
+}

+ 54 - 41
admin_ui/src/option/ycwh/professionalStyle.js

@@ -1,16 +1,20 @@
+import { informationTypeOptions } from "@/views/ycwh/common/constants.js";
 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",
@@ -83,24 +87,16 @@ export default {
       hide: true,
     },
     {
-      label: "备注",
-      prop: "remark",
-      type: "input",
-    },
-    {
-      label: "顺序",
-      prop: "sort",
-      type: "input",
-    },
-    {
-      label: "风采类型(专业老师、获奖情况、实训室展示等)",
-      prop: "styleType",
-      type: "input",
+      label: "资讯类型",
+      prop: "informationType",
+      type: "select",
+      dicData: informationTypeOptions,
+      search: true
     },
     {
       label: "封面",
       prop: "cover",
-      type: "input",
+      type: "upload",
     },
     {
       label: "标题",
@@ -111,41 +107,58 @@ export default {
       label: "副标题",
       prop: "subTitle",
       type: "input",
+      overHidden: true,
     },
     {
-      label: "视频(多个用英文逗号隔开)",
+      //    (多个用英文逗号隔开)
+      label: "视频",
       prop: "videos",
-      type: "input",
+      type: "upload",
+      slot: true,
+      width: 250
     },
     {
       label: "内容",
       prop: "content",
       type: "input",
-    },
-    {
-      label: "地址",
-      prop: "address",
-      type: "input",
-    },
-    {
-      label: "纬度",
-      prop: "latitude",
-      type: "input",
-    },
-    {
-      label: "经度",
-      prop: "longitude",
-      type: "input",
-    },
+      hide: true
+    },
+    //  {
+    //    label: "地址",
+    //    prop: "address",
+    //    type: "input",
+    //  },
+    //  {
+    //    label: "纬度",
+    //    prop: "latitude",
+    //    type: "input",
+    //  },
+    //  {
+    //    label: "经度",
+    //    prop: "longitude",
+    //    type: "input",
+    //  },
+    //  {
+    //    label: "置顶",
+    //    prop: "top",
+    //    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
     },
   ]
-}
+}

+ 27 - 57
admin_ui/src/views/ycwh/account.vue

@@ -1,49 +1,22 @@
 <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.account_delete"
-                   @click="handleDelete">删 除
-        </el-button>
-        <el-button type="warning"
-                   plain
-                   icon="el-icon-download"
-                   @click="handleExport">导 出
-        </el-button>
+        <!--<el-button type="danger" icon="el-icon-delete" plain v-if="permission.account_delete" @click="handleDelete">删 除</el-button>-->
+        <!--<el-button type="warning" plain icon="el-icon-download" @click="handleExport">导 出</el-button>-->
       </template>
     </avue-crud>
   </basic-container>
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/ycwh/account";
+  import { getList, getDetail, add, update, remove } from "@/api/ycwh/account";
   import option from "@/option/ycwh/account";
-  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';
 
@@ -111,10 +84,10 @@
       },
       rowDel(row) {
         this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
           .then(() => {
             return remove(row.id);
           })
@@ -127,15 +100,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);
           })
@@ -150,10 +123,8 @@
       },
       handleExport() {
         let downloadUrl = `/account/account/export-account?${this.website.tokenHeader}=${getToken()}`;
-        const {
-        } = this.query;
-        let values = {
-        };
+        const {} = this.query;
+        let values = {};
         this.$confirm("是否导出数据?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -167,7 +138,7 @@
         });
       },
       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 +162,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 +174,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;
@@ -222,4 +191,5 @@
 </script>
 
 <style>
-</style>
+
+</style>

+ 26 - 54
admin_ui/src/views/ycwh/collectInfo.vue

@@ -1,35 +1,10 @@
 <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.collectInfo_delete"
-                   @click="handleDelete">删 除
+        <el-button type="danger" icon="el-icon-delete" plain v-if="permission.collectInfo_delete" @click="handleDelete">删 除
         </el-button>
-        <el-button type="warning"
-                   plain
-                   icon="el-icon-download"
-                   @click="handleExport">导 出
+        <el-button type="warning" plain icon="el-icon-download" @click="handleExport">导 出
         </el-button>
       </template>
     </avue-crud>
@@ -37,13 +12,13 @@
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/ycwh/collectInfo";
+  import { getList, getDetail, add, update, remove } from "@/api/ycwh/collectInfo";
   import option from "@/option/ycwh/collectInfo";
-  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';
 
@@ -111,10 +86,10 @@
       },
       rowDel(row) {
         this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
           .then(() => {
             return remove(row.id);
           })
@@ -127,15 +102,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);
           })
@@ -150,10 +125,8 @@
       },
       handleExport() {
         let downloadUrl = `/collect_info/collectInfo/export-collectInfo?${this.website.tokenHeader}=${getToken()}`;
-        const {
-        } = this.query;
-        let values = {
-        };
+        const {} = this.query;
+        let values = {};
         this.$confirm("是否导出数据?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -167,7 +140,7 @@
         });
       },
       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 +164,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,10 +176,8 @@
       onLoad(page, params = {}) {
         this.loading = true;
 
-        const {
-        } = this.query;
-
         let values = {
+          ...this.query
         };
 
         getList(page.currentPage, page.pageSize, values).then(res => {
@@ -222,4 +193,5 @@
 </script>
 
 <style>
-</style>
+
+</style>

+ 23 - 77
admin_ui/src/views/ycwh/common/constants.js

@@ -4,93 +4,39 @@ let todayStr = nowTime.getFullYear() + "-" + (nowTime.getMonth() + 1) + "-" + no
 export const startPickTime = (new Date(todayStr)).getTime();
 // 发布时间可选择的结束日期
 export const endPickTime = startPickTime + 8 * 8.64e7 - 1;
-// aType 0:资讯发布   1:外链转载
 
-export const normalAType = 0;
-export const aTypeOptions = [{
-  label: '资讯发布',
-  value: 0
+export const informationTypeOptions = [{
+  value: 'famous_dish',
+  label: '名菜'
 }, {
-  label: '外链转载',
-  value: 1,
-}]
-
-// 板块类型   ZJGX(0, "走进高新"), GXTC(1, "高新同城"), GXMH(2, "门户首页");
-export const normalPlateType = 1;
-export const plateTypeOptions = [{
-  label: '走进高新',
-  value: 0
+  value: 'famous_location',
+  label: '名点'
 }, {
-  label: '高新同城',
-  value: 1,
-}]
-// 走进高新
-//GXDT(0,"政策资讯"),
-//ZSCD(1,"产业资讯"),
-//GSTZ(4,"活动资讯"),
-//MTKT(5,"高新概况"),
-// 高新同城
-//WHGX(2,"文化高新"),
-//ZHGX(3,"智汇高新");
-// 板块对应的子分类 默认选择的子分类
-export const normalChildType = 2;
-export const childTypeOptions = [{
-  label: '文化高新',
-  value: 2
+  value: 'famous_store',
+  label: '名店'
 }, {
-  label: '智汇高新',
-  value: 3,
+  value: 'famous_store',
+  label: '专业风采'
 }]
 
-export const tabOption = {
-  column: [{
-    label: '文化高新',
-    prop: 2,
-  }, {
-    label: '智汇高新',
-    prop: 3,
-  }]
-
-}
-/** 活动 */
-export const normalAcitivityType = 0
-export const acitivityTypeOptions = [{
-  label: '线下活动',
-  value: 0
+export const professionalStyleOptions = [{
+  value: 'professional_teacher',
+  label: '专业老师'
 }, {
-  label: '线上活动',
-  value: 1,
-}]
-export const acitivityTabOption = {
-  column: [{
-    label: '线下活动',
-    prop: 0,
-  }, {
-    label: '线上活动',
-    prop: 1,
-    disabled: true
-  }]
-
-}
-
-/***/
-export const normalSignChannel = 0
-export const signChannelOptions = [{
-  label: '跳转至报名链接',
-  value: 0
+  value: 'certificate',
+  label: '获奖情况'
 }, {
-  label: '扫二维码报名',
-  value: 1,
+  value: 'training_room',
+  label: '实训室展示'
 }]
 
-// 标签类型
-export const labelTypeOptions = [{
-  label: '文章标签',
-  value: 0
+export const documentTypeOptions = [{
+  value: 'user_agreement',
+  label: '用户协议'
 }, {
-  label: '活动标签',
-  value: 1,
+  value: 'privacy_policy',
+  label: '隐私政策'
 }, {
-  label: '视频',
-  value: 2
+  value: 'about_us',
+  label: '关于我们等'
 }]

+ 53 - 0
admin_ui/src/views/ycwh/components/editDocumentInfo/index.scss

@@ -0,0 +1,53 @@
+.article-form {
+    padding: 0 20px;
+}
+
+.avatar-uploader {
+     :deep(.el-upload) {
+        border: 1px dashed #d9d9d9;
+        border-radius: 6px;
+        cursor: pointer;
+        position: relative;
+        overflow: hidden;
+    }
+     :deep(.el-upload):hover {
+        border-color: #409EFF;
+    }
+}
+
+.avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 178px;
+    height: 178px;
+    line-height: 178px;
+    text-align: center;
+}
+
+.avatar {
+    width: 178px;
+    height: 178px;
+    display: block;
+}
+
+// Collapse 折叠面板 样式修改
+.form-collapse {
+    border: none;
+     :deep(.el-collapse-item .el-collapse-item__header) {
+        margin-bottom: 20px;
+        /* border-bottom: 1px solid #eee !important; */
+        border-bottom-color: #eee !important;
+    }
+     :deep(.el-collapse-item .el-collapse-item__wrap) {
+        border: none;
+    }
+}
+
+.form-title {
+    height: 30px;
+    line-height: 30px;
+    border-left: 5px solid #409eff;
+    font-size: 20px;
+    font-weight: bold;
+    padding-left: 15px;
+}

+ 334 - 0
admin_ui/src/views/ycwh/components/editDocumentInfo/index.vue

@@ -0,0 +1,334 @@
+<template>
+  <el-form ref="form" class="article-form" :model="form" :rules="rules" label-width="85px">
+    <el-form-item label="文档类型" prop="documentInfo">
+      <el-select v-model="form.documentType" placeholder="请选择文档类型">
+        <el-option v-for="item in documentTypeList" :key="item.value" :label="item.label" :value="item.value" />
+      </el-select>
+    </el-form-item>
+    <el-form-item label="标题" prop="title">
+      <el-input v-model="form.title" maxlength="80" show-word-limit />
+    </el-form-item>
+    <el-form-item label="副标题" prop="subTitle">
+      <el-input v-model="form.subTitle" type="textarea" maxlength="90" show-word-limit />
+    </el-form-item>
+    <el-form-item label="内容" prop="content">
+      <!--<content-item v-if="contentItemVisible" ref="contentComp" :html.sync="form.content" />-->
+      <avue-ueditor v-model="form.content" v-bing="editorOptions"></avue-ueditor>
+    </el-form-item>
+    <!--<el-form-item label="附件" prop="attachment">
+        <el-upload class="upload-demo" :http-request="uploadImg" :data="{type:'att'}" :file-list="attachmentList" :on-remove="handleRemoveImg" :on-preview="handlePreview" :accept='["image/jpeg", "image/png", "image/tga", "image/gif", "image/bmp"]'>
+          <el-button size="small" type="primary">点击上传</el-button>
+        </el-upload>
+      </el-form-item>-->
+    <el-form-item label="封面" prop="cover">
+      <div style="display: flex;">
+        <el-upload class="avatar-uploader cover-w16h9" style="margin-right: 30px !important;" :http-request="uploadImg" :data="{type:'img'}" :show-file-list="false" :before-upload="beforeAvatarUpload">
+          <el-image fit="contain" v-if="form.cover" :src="form.cover" class="avatar"></el-image>
+          <el-icon v-else class="el-icon-plus avatar-uploader-icon">
+            <Plus />
+          </el-icon>
+        </el-upload>
+        <!--1.建议长×宽比例为16:9,否则默认拉伸<br /> 2.像素最大不超过960*540<br />3.只能上传jpg/png文件,且不超过5MB-->
+      </div>
+    </el-form-item>
+    <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">
+          <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>
+        </el-upload>
+      </div>
+    </el-form-item>
+    <div style="height: 72px;"></div>
+    <div style="position: fixed;bottom: 0;padding: 20px 0;z-index: 999;">
+      <el-button type="primary" @click="toSave(1)">发布</el-button>
+      <!--<el-button type="primary" @click="toSave(0)">存为草稿</el-button>-->
+      <!--<el-button type="primary" @click="toPreview">预览</el-button>-->
+      <el-button type="info" @click="toCancel">关闭</el-button>
+    </div>
+  </el-form>
+</template>
+
+<script>
+  // import contentItem from "@/components/richtext/tinymce.vue"
+  import {
+    getDetail,
+    add,
+    update
+  } from "@/api/ycwh/documentInfo";
+  import {
+    uploadFile
+  } from "@/api/oss/oss";
+  import { getLazyTree } from "@/api/base/region";
+  //
+  import { documentTypeOptions } from "../../common/constants.js";
+
+  export default {
+    props: ['id'],
+    components: {
+      // contentItem
+    },
+    data() {
+      var checkListNull = (rule, value, cb) => {
+        if(value && value.length > 0) {
+          return cb();
+        }
+        cb(new Error("请选择标签"));
+      };
+      return {
+        loading: false,
+        //
+        documentTypeList: documentTypeOptions,
+        //
+        regionList: [],
+        //
+        attachmentList: [],
+        // 提交内容
+        form: {
+          id: null,
+          documentType: '',
+          title: '',
+          subTitle: '',
+          content: '',
+          cover: '',
+          videos: '',
+          top: '',
+          sort: ''
+        },
+        //
+        contentItemVisible: false,
+        rules: {
+          documentType: [{
+            required: true,
+            message: '请选择文档类型',
+            trigger: 'blur'
+          }],
+          title: [{
+              required: true,
+              message: '请输入标题',
+              trigger: 'blur'
+            },
+            {
+              min: 1,
+              max: 80,
+              message: '长度不能超过80个字',
+              trigger: 'blur'
+            }
+          ],
+          subTitle: [{
+              required: true,
+              message: '请输入副标题',
+              trigger: 'blur'
+            },
+            {
+              min: 1,
+              max: 90,
+              message: '长度不能超过90个字',
+              trigger: 'blur'
+            }
+          ],
+          content: [{
+            required: true,
+            message: '请输入内容',
+            trigger: 'blur'
+          }],
+        },
+        // 富文本相关配置
+        editorOptions: {
+          //普通上传地址
+          action: "https://api.avuejs.com/imgupload",
+          customConfig: {}, //wangEditor编辑的配置
+          //是否启用oss(qiniu/ali)
+          oss: '',
+          headers: {},
+          data: {},
+          propsHttp: {
+            home: '',
+            url: 'url',
+            res: 'data'
+          },
+          //七牛云oss配置
+          qiniu: {
+            AK: "",
+            SK: "",
+            scope: "",
+            url: "",
+            deadline: 1
+          },
+          //阿里云oss配置
+          ali: {
+            region: "",
+            endpoint: "",
+            accessKeyId: "",
+            accessKeySecret: "",
+            bucket: ""
+          }
+        },
+        mapForm: [113.10235504165291, 41.03624227495205, "内蒙古自治区乌兰察布市集宁区新体路街道顺达源广告传媒"],
+      }
+    },
+    watch: {},
+    created() {
+      this.toReloadData()
+    },
+    mounted() {
+      if(this.id && this.id > 0) {
+        this.getDetail(this.id)
+      }
+    },
+    watch: {},
+    methods: {
+      getDetail(id) {
+        if(!(id && id > 0)) {
+          return;
+        }
+        /** 获取对应的文章详情 */
+        getDetail(id).then(res => {
+          if(res.data.success && res.data.data) {
+            let data = res.data.data;
+            if(data.regionId && data.regionId > 0) {
+              data.regionId = data.regionId.toString()
+            }
+            if(data.content) {
+              data.content = decodeURIComponent(data.content)
+            }
+            //
+            this.form = data;
+          }
+        })
+      },
+      toReloadData(data) { //
+        this.form = data || {}
+        this.contentItemVisible = true
+      },
+      toSave(isPublish) {
+        if(this.loading) {
+          return;
+        }
+        this.loading = true;
+        this.$refs.form.validate((valid) => {
+          if(valid) { //校验通过
+            let submitObj = JSON.parse(JSON.stringify(this.form)) //克隆一份数据,避免影响到富文本编辑器
+            submitObj.content = encodeURIComponent(submitObj.content)
+
+            /** id不为空则为编辑,为空则新增 */
+            let saveFunc = submitObj.id ? update : add
+            this.loading = true;
+            //  发布或存为草稿
+            submitObj.isPublish = isPublish || 0;
+            // 处理附件列表
+            if(this.attachmentList && this.attachmentList.length > 0) {
+              submitObj.attachment = ""
+              this.attachmentList.map(e => {
+                if(submitObj.attachment) {
+                  submitObj.attachment += "," + e.name + "::" + e.url
+                } else {
+                  submitObj.attachment += e.name + "::" + e.url
+                }
+              })
+            } else {
+              submitObj.attachment = ''
+            }
+            // content
+            submitObj.content = submitObj.content || ''
+
+            saveFunc(submitObj).then(() => {
+              this.$message({
+                type: "success",
+                message: "保存成功!"
+              })
+              this.$emit("toCancel", true)
+            }, error => {
+              this.loading = false;
+              window.console.log(error)
+            })
+          } else { //校验不通过
+            this.$message.error('存在未完善的内容,请完善后再试!');
+            this.loading = false;
+            return false;
+          }
+        })
+      },
+      toView() {
+        // 预览
+      },
+      toCancel() {
+        this.$emit("toCancel", false)
+      },
+      // 图片上传
+      uploadImg(params) { // 调用接口上传不使用upload上传
+        if(!(params.data && params.data.type)) {
+          // att img
+          return;
+        }
+        let uploadType = params.data.type;
+        //
+        let fd = new FormData();
+        let f = params.file;
+        fd.append("file", f);
+        uploadFile(fd).then(res => {
+          if(res && res.data && res.data.success) {
+            // 提交内容
+            if(uploadType == 'img') {
+              this.form.cover = res.data.data.link;
+              this.$refs.form.validateField(["cover"], () => {
+                // 只触发校验不做其他处理
+              })
+            } else if(uploadType == 'video') {
+              this.form.videos = res.data.data.link;
+              this.$refs.form.validateField(["videos"], () => {
+                // 只触发校验不做其他处理
+              })
+            } else if(uploadType == 'att') {
+              this.attachmentList.push({
+                uid: f.uid,
+                name: f.name,
+                url: res.data.data.link
+              })
+            }
+            this.$forceUpdate();
+          }
+          this.loading = false;
+        }, e => {
+          console.log(e)
+          this.loading = false;
+        });
+      },
+      beforeAvatarUpload(file) {
+        // 封面限制5m    附件暂时不限制
+        //        const isJPG = file.type === 'image/jpeg';
+        //        if(!isJPG) {
+        //          this.$message.error('上传头像图片只能是 JPG 格式!');
+        //        }
+        const isLt5M = (file.size / 1024 / 1024) < 5;
+        if(!isLt5M) {
+          this.$message.error('上传头像图片大小不能超过 5MB!');
+        }
+        return true;
+      },
+      handlePreview(file) {
+        window.open(file.url);
+      },
+      handleRemoveImg(file, fileList) {
+        this.attachmentList = fileList;
+      },
+      toPreview() {
+        let submitObj = JSON.parse(JSON.stringify(this.form)) //克隆一份数据,避免影响到富文本编辑器
+        /** id不为空则为编辑,为空则新增 */
+        this.loading = true;
+        // 标签预览需要处理
+
+        // content
+        submitObj.content = submitObj.content || ''
+        // 新选择的标签、专栏需要单独赋值提供显示
+        // goPreview(this, "article", submitObj, this.tagOptions)
+      }
+    },
+  }
+</script>
+
+<style scoped lang="scss">
+  @import "./index.scss"
+</style>

+ 1 - 9
admin_ui/src/views/ycwh/components/editFamousDish/index.vue

@@ -74,14 +74,6 @@
   } from "@/api/oss/oss";
   import { getLazyTree } from "@/api/base/region";
   //
-  import {
-    startPickTime,
-    endPickTime,
-    normalPlateType,
-    childTypeOptions,
-    normalChildType
-  } from "../../common/constants.js";
-
   export default {
     props: ['id'],
     components: {
@@ -119,7 +111,7 @@
         rules: {
           name: [{
               required: true,
-              message: '请输入名',
+              message: '请输入名',
               trigger: 'blur'
             },
             {

+ 1 - 9
admin_ui/src/views/ycwh/components/editFamousLocation/index.vue

@@ -74,14 +74,6 @@
   } from "@/api/oss/oss";
   import { getLazyTree } from "@/api/base/region";
   //
-  import {
-    startPickTime,
-    endPickTime,
-    normalPlateType,
-    childTypeOptions,
-    normalChildType
-  } from "../../common/constants.js";
-
   export default {
     props: ['id'],
     components: {
@@ -119,7 +111,7 @@
         rules: {
           name: [{
               required: true,
-              message: '请输入名',
+              message: '请输入名',
               trigger: 'blur'
             },
             {

+ 1 - 9
admin_ui/src/views/ycwh/components/editFamousStore/index.vue

@@ -74,14 +74,6 @@
   } from "@/api/oss/oss";
   import { getLazyTree } from "@/api/base/region";
   //
-  import {
-    startPickTime,
-    endPickTime,
-    normalPlateType,
-    childTypeOptions,
-    normalChildType
-  } from "../../common/constants.js";
-
   export default {
     props: ['id'],
     components: {
@@ -119,7 +111,7 @@
         rules: {
           name: [{
               required: true,
-              message: '请输入名',
+              message: '请输入名',
               trigger: 'blur'
             },
             {

+ 53 - 0
admin_ui/src/views/ycwh/components/editInformationInfo/index.scss

@@ -0,0 +1,53 @@
+.article-form {
+    padding: 0 20px;
+}
+
+.avatar-uploader {
+     :deep(.el-upload) {
+        border: 1px dashed #d9d9d9;
+        border-radius: 6px;
+        cursor: pointer;
+        position: relative;
+        overflow: hidden;
+    }
+     :deep(.el-upload):hover {
+        border-color: #409EFF;
+    }
+}
+
+.avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 178px;
+    height: 178px;
+    line-height: 178px;
+    text-align: center;
+}
+
+.avatar {
+    width: 178px;
+    height: 178px;
+    display: block;
+}
+
+// Collapse 折叠面板 样式修改
+.form-collapse {
+    border: none;
+     :deep(.el-collapse-item .el-collapse-item__header) {
+        margin-bottom: 20px;
+        /* border-bottom: 1px solid #eee !important; */
+        border-bottom-color: #eee !important;
+    }
+     :deep(.el-collapse-item .el-collapse-item__wrap) {
+        border: none;
+    }
+}
+
+.form-title {
+    height: 30px;
+    line-height: 30px;
+    border-left: 5px solid #409eff;
+    font-size: 20px;
+    font-weight: bold;
+    padding-left: 15px;
+}

+ 340 - 0
admin_ui/src/views/ycwh/components/editInformationInfo/index.vue

@@ -0,0 +1,340 @@
+<template>
+  <el-form ref="form" class="article-form" :model="form" :rules="rules" label-width="85px">
+    <el-form-item label="资讯类型" prop="informationType">
+      <el-select v-model="form.informationType" placeholder="请选择资讯类型">
+        <el-option v-for="item in informationTypeList" :key="item.value" :label="item.label" :value="item.value" />
+      </el-select>
+    </el-form-item>
+    <el-form-item label="标题" prop="title">
+      <el-input v-model="form.title" maxlength="80" show-word-limit />
+    </el-form-item>
+    <el-form-item label="副标题" prop="subTitle">
+      <el-input v-model="form.subTitle" type="textarea" maxlength="90" show-word-limit />
+    </el-form-item>
+    <el-form-item label="内容" prop="content">
+      <!--<content-item v-if="contentItemVisible" ref="contentComp" :html.sync="form.content" />-->
+      <avue-ueditor v-model="form.content" v-bing="editorOptions"></avue-ueditor>
+    </el-form-item>
+    <!--<el-form-item label="附件" prop="attachment">
+        <el-upload class="upload-demo" :http-request="uploadImg" :data="{type:'att'}" :file-list="attachmentList" :on-remove="handleRemoveImg" :on-preview="handlePreview" :accept='["image/jpeg", "image/png", "image/tga", "image/gif", "image/bmp"]'>
+          <el-button size="small" type="primary">点击上传</el-button>
+        </el-upload>
+      </el-form-item>-->
+
+    <el-form-item label="封面" prop="cover">
+      <div style="display: flex;">
+        <el-upload class="avatar-uploader cover-w16h9" style="margin-right: 30px !important;" :http-request="uploadImg" :data="{type:'img'}" :show-file-list="false" :before-upload="beforeAvatarUpload">
+          <el-image fit="contain" v-if="form.cover" :src="form.cover" class="avatar"></el-image>
+          <el-icon v-else class="el-icon-plus avatar-uploader-icon">
+            <Plus />
+          </el-icon>
+        </el-upload>
+        <!--1.建议长×宽比例为16:9,否则默认拉伸<br /> 2.像素最大不超过960*540<br />3.只能上传jpg/png文件,且不超过5MB-->
+      </div>
+    </el-form-item>
+    <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">
+          <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>
+        </el-upload>
+      </div>
+    </el-form-item>
+    <div style="height: 72px;"></div>
+    <div style="position: fixed;bottom: 0;padding: 20px 0;z-index: 999;">
+      <el-button type="primary" @click="toSave(1)">发布</el-button>
+      <!--<el-button type="primary" @click="toSave(0)">存为草稿</el-button>-->
+      <!--<el-button type="primary" @click="toPreview">预览</el-button>-->
+      <el-button type="info" @click="toCancel">关闭</el-button>
+    </div>
+  </el-form>
+</template>
+
+<script>
+  // import contentItem from "@/components/richtext/tinymce.vue"
+  import {
+    getDetail,
+    add,
+    update
+  } from "@/api/ycwh/informationInfo";
+  import {
+    uploadFile
+  } from "@/api/oss/oss";
+  import { getLazyTree } from "@/api/base/region";
+  //
+  import { informationTypeOptions } from "../../common/constants.js";
+
+  export default {
+    props: ['id'],
+    components: {
+      // contentItem
+    },
+    data() {
+      var checkListNull = (rule, value, cb) => {
+        if(value && value.length > 0) {
+          return cb();
+        }
+        cb(new Error("请选择标签"));
+      };
+      return {
+        loading: false,
+        //
+        informationTypeList: informationTypeOptions,
+        //
+        regionList: [],
+        //
+        attachmentList: [],
+        // 提交内容
+        form: {
+          id: null,
+          informationInfoType: '',
+          title: '',
+          subTitle: '',
+          content: '',
+          // 标签
+          videos: null,
+          top: '',
+          sort: ''
+        },
+        //
+        contentItemVisible: false,
+        rules: {
+          informationInfoType: [{
+            required: true,
+            message: '请选择资讯类型',
+            trigger: 'blur'
+          }],
+          title: [{
+              required: true,
+              message: '请输入标题',
+              trigger: 'blur'
+            },
+            {
+              min: 1,
+              max: 80,
+              message: '长度不能超过80个字',
+              trigger: 'blur'
+            }
+          ],
+          subTitle: [{
+              required: true,
+              message: '请输入副标题',
+              trigger: 'blur'
+            },
+            {
+              min: 1,
+              max: 90,
+              message: '长度不能超过90个字',
+              trigger: 'blur'
+            }
+          ],
+          cover: [{
+            required: true,
+            message: '请上传封面',
+            trigger: 'blur',
+          }],
+          content: [{
+            required: true,
+            message: '请输入内容',
+            trigger: 'blur'
+          }],
+        },
+        // 富文本相关配置
+        editorOptions: {
+          //普通上传地址
+          action: "https://api.avuejs.com/imgupload",
+          customConfig: {}, //wangEditor编辑的配置
+          //是否启用oss(qiniu/ali)
+          oss: '',
+          headers: {},
+          data: {},
+          propsHttp: {
+            home: '',
+            url: 'url',
+            res: 'data'
+          },
+          //七牛云oss配置
+          qiniu: {
+            AK: "",
+            SK: "",
+            scope: "",
+            url: "",
+            deadline: 1
+          },
+          //阿里云oss配置
+          ali: {
+            region: "",
+            endpoint: "",
+            accessKeyId: "",
+            accessKeySecret: "",
+            bucket: ""
+          }
+        },
+        mapForm: [113.10235504165291, 41.03624227495205, "内蒙古自治区乌兰察布市集宁区新体路街道顺达源广告传媒"],
+      }
+    },
+    watch: {},
+    created() {
+      this.toReloadData()
+    },
+    mounted() {
+      if(this.id && this.id > 0) {
+        this.getDetail(this.id)
+      }
+    },
+    watch: {},
+    methods: {
+      getDetail(id) {
+        if(!(id && id > 0)) {
+          return;
+        }
+        /** 获取对应的文章详情 */
+        getDetail(id).then(res => {
+          if(res.data.success && res.data.data) {
+            let data = res.data.data;
+            if(data.regionId && data.regionId > 0) {
+              data.regionId = data.regionId.toString()
+            }
+            if(data.content) {
+              data.content = decodeURIComponent(data.content)
+            }
+            //
+            this.form = data;
+          }
+        })
+      },
+      toReloadData(data) { //
+        this.form = data || {}
+        this.contentItemVisible = true
+      },
+      toSave(isPublish) {
+        if(this.loading) {
+          return;
+        }
+        this.loading = true;
+        this.$refs.form.validate((valid) => {
+          if(valid) { //校验通过
+            let submitObj = JSON.parse(JSON.stringify(this.form)) //克隆一份数据,避免影响到富文本编辑器
+            submitObj.content = encodeURIComponent(submitObj.content)
+
+            /** id不为空则为编辑,为空则新增 */
+            let saveFunc = submitObj.id ? update : add
+            this.loading = true;
+            //  发布或存为草稿
+            submitObj.isPublish = isPublish || 0;
+            // 处理附件列表
+            if(this.attachmentList && this.attachmentList.length > 0) {
+              submitObj.attachment = ""
+              this.attachmentList.map(e => {
+                if(submitObj.attachment) {
+                  submitObj.attachment += "," + e.name + "::" + e.url
+                } else {
+                  submitObj.attachment += e.name + "::" + e.url
+                }
+              })
+            } else {
+              submitObj.attachment = ''
+            }
+            // content
+            submitObj.content = submitObj.content || ''
+
+            saveFunc(submitObj).then(() => {
+              this.$message({
+                type: "success",
+                message: "保存成功!"
+              })
+              this.$emit("toCancel", true)
+            }, error => {
+              this.loading = false;
+              window.console.log(error)
+            })
+          } else { //校验不通过
+            this.$message.error('存在未完善的内容,请完善后再试!');
+            this.loading = false;
+            return false;
+          }
+        })
+      },
+      toView() {
+        // 预览
+      },
+      toCancel() {
+        this.$emit("toCancel", false)
+      },
+      // 图片上传
+      uploadImg(params) { // 调用接口上传不使用upload上传
+        if(!(params.data && params.data.type)) {
+          // att img
+          return;
+        }
+        let uploadType = params.data.type;
+        //
+        let fd = new FormData();
+        let f = params.file;
+        fd.append("file", f);
+        uploadFile(fd).then(res => {
+          if(res && res.data && res.data.success) {
+            // 提交内容
+            if(uploadType == 'img') {
+              this.form.cover = res.data.data.link;
+              this.$refs.form.validateField(["cover"], () => {
+                // 只触发校验不做其他处理
+              })
+            } else if(uploadType == 'video') {
+              this.form.videos = res.data.data.link;
+              this.$refs.form.validateField(["videos"], () => {
+                // 只触发校验不做其他处理
+              })
+            } else if(uploadType == 'att') {
+              this.attachmentList.push({
+                uid: f.uid,
+                name: f.name,
+                url: res.data.data.link
+              })
+            }
+            this.$forceUpdate();
+          }
+          this.loading = false;
+        }, e => {
+          console.log(e)
+          this.loading = false;
+        });
+      },
+      beforeAvatarUpload(file) {
+        // 封面限制5m    附件暂时不限制
+        //        const isJPG = file.type === 'image/jpeg';
+        //        if(!isJPG) {
+        //          this.$message.error('上传头像图片只能是 JPG 格式!');
+        //        }
+        const isLt5M = (file.size / 1024 / 1024) < 5;
+        if(!isLt5M) {
+          this.$message.error('上传头像图片大小不能超过 5MB!');
+        }
+        return true;
+      },
+      handlePreview(file) {
+        window.open(file.url);
+      },
+      handleRemoveImg(file, fileList) {
+        this.attachmentList = fileList;
+      },
+      toPreview() {
+        let submitObj = JSON.parse(JSON.stringify(this.form)) //克隆一份数据,避免影响到富文本编辑器
+        /** id不为空则为编辑,为空则新增 */
+        this.loading = true;
+        // 标签预览需要处理
+
+        // content
+        submitObj.content = submitObj.content || ''
+        // 新选择的标签、专栏需要单独赋值提供显示
+        // goPreview(this, "article", submitObj, this.tagOptions)
+      }
+    },
+  }
+</script>
+
+<style scoped lang="scss">
+  @import "./index.scss"
+</style>

+ 53 - 0
admin_ui/src/views/ycwh/components/editProfessionalStyle/index.scss

@@ -0,0 +1,53 @@
+.article-form {
+    padding: 0 20px;
+}
+
+.avatar-uploader {
+     :deep(.el-upload) {
+        border: 1px dashed #d9d9d9;
+        border-radius: 6px;
+        cursor: pointer;
+        position: relative;
+        overflow: hidden;
+    }
+     :deep(.el-upload):hover {
+        border-color: #409EFF;
+    }
+}
+
+.avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 178px;
+    height: 178px;
+    line-height: 178px;
+    text-align: center;
+}
+
+.avatar {
+    width: 178px;
+    height: 178px;
+    display: block;
+}
+
+// Collapse 折叠面板 样式修改
+.form-collapse {
+    border: none;
+     :deep(.el-collapse-item .el-collapse-item__header) {
+        margin-bottom: 20px;
+        /* border-bottom: 1px solid #eee !important; */
+        border-bottom-color: #eee !important;
+    }
+     :deep(.el-collapse-item .el-collapse-item__wrap) {
+        border: none;
+    }
+}
+
+.form-title {
+    height: 30px;
+    line-height: 30px;
+    border-left: 5px solid #409eff;
+    font-size: 20px;
+    font-weight: bold;
+    padding-left: 15px;
+}

+ 340 - 0
admin_ui/src/views/ycwh/components/editProfessionalStyle/index.vue

@@ -0,0 +1,340 @@
+<template>
+  <el-form ref="form" class="article-form" :model="form" :rules="rules" label-width="85px">
+    <el-form-item label="风采类型" prop="professionalStyle">
+      <el-select v-model="form.styleType" placeholder="请选择风采类型">
+        <el-option v-for="item in professionalStyleList" :key="item.value" :label="item.label" :value="item.value" />
+      </el-select>
+    </el-form-item>
+    <el-form-item label="标题" prop="title">
+      <el-input v-model="form.title" maxlength="80" show-word-limit />
+    </el-form-item>
+    <el-form-item label="副标题" prop="subTitle">
+      <el-input v-model="form.subTitle" type="textarea" maxlength="90" show-word-limit />
+    </el-form-item>
+    <el-form-item label="内容" prop="content">
+      <!--<content-item v-if="contentItemVisible" ref="contentComp" :html.sync="form.content" />-->
+      <avue-ueditor v-model="form.content" v-bing="editorOptions"></avue-ueditor>
+    </el-form-item>
+    <!--<el-form-item label="附件" prop="attachment">
+        <el-upload class="upload-demo" :http-request="uploadImg" :data="{type:'att'}" :file-list="attachmentList" :on-remove="handleRemoveImg" :on-preview="handlePreview" :accept='["image/jpeg", "image/png", "image/tga", "image/gif", "image/bmp"]'>
+          <el-button size="small" type="primary">点击上传</el-button>
+        </el-upload>
+      </el-form-item>-->
+
+    <el-form-item label="封面" prop="cover">
+      <div style="display: flex;">
+        <el-upload class="avatar-uploader cover-w16h9" style="margin-right: 30px !important;" :http-request="uploadImg" :data="{type:'img'}" :show-file-list="false" :before-upload="beforeAvatarUpload">
+          <el-image fit="contain" v-if="form.cover" :src="form.cover" class="avatar"></el-image>
+          <el-icon v-else class="el-icon-plus avatar-uploader-icon">
+            <Plus />
+          </el-icon>
+        </el-upload>
+        <!--1.建议长×宽比例为16:9,否则默认拉伸<br /> 2.像素最大不超过960*540<br />3.只能上传jpg/png文件,且不超过5MB-->
+      </div>
+    </el-form-item>
+    <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">
+          <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>
+        </el-upload>
+      </div>
+    </el-form-item>
+    <div style="height: 72px;"></div>
+    <div style="position: fixed;bottom: 0;padding: 20px 0;z-index: 999;">
+      <el-button type="primary" @click="toSave(1)">发布</el-button>
+      <!--<el-button type="primary" @click="toSave(0)">存为草稿</el-button>-->
+      <!--<el-button type="primary" @click="toPreview">预览</el-button>-->
+      <el-button type="info" @click="toCancel">关闭</el-button>
+    </div>
+  </el-form>
+</template>
+
+<script>
+  // import contentItem from "@/components/richtext/tinymce.vue"
+  import {
+    getDetail,
+    add,
+    update
+  } from "@/api/ycwh/professionalStyle";
+  import {
+    uploadFile
+  } from "@/api/oss/oss";
+  import { getLazyTree } from "@/api/base/region";
+  //
+  import { professionalStyleOptions } from "../../common/constants.js";
+
+  export default {
+    props: ['id'],
+    components: {
+      // contentItem
+    },
+    data() {
+      var checkListNull = (rule, value, cb) => {
+        if(value && value.length > 0) {
+          return cb();
+        }
+        cb(new Error("请选择标签"));
+      };
+      return {
+        loading: false,
+        //
+        professionalStyleList: professionalStyleOptions,
+        //
+        regionList: [],
+        //
+        attachmentList: [],
+        // 提交内容
+        form: {
+          id: null,
+          styleType: '',
+          title: '',
+          subTitle: '',
+          content: '',
+          // 标签
+          videos: null,
+          top: '',
+          sort: ''
+        },
+        //
+        contentItemVisible: false,
+        rules: {
+          styleType: [{
+            required: true,
+            message: '请选择风采类型',
+            trigger: 'blur'
+          }],
+          title: [{
+              required: true,
+              message: '请输入标题',
+              trigger: 'blur'
+            },
+            {
+              min: 1,
+              max: 80,
+              message: '长度不能超过80个字',
+              trigger: 'blur'
+            }
+          ],
+          subTitle: [{
+              required: true,
+              message: '请输入副标题',
+              trigger: 'blur'
+            },
+            {
+              min: 1,
+              max: 90,
+              message: '长度不能超过90个字',
+              trigger: 'blur'
+            }
+          ],
+          cover: [{
+            required: true,
+            message: '请上传封面',
+            trigger: 'blur',
+          }],
+          content: [{
+            required: true,
+            message: '请输入内容',
+            trigger: 'blur'
+          }],
+        },
+        // 富文本相关配置
+        editorOptions: {
+          //普通上传地址
+          action: "https://api.avuejs.com/imgupload",
+          customConfig: {}, //wangEditor编辑的配置
+          //是否启用oss(qiniu/ali)
+          oss: '',
+          headers: {},
+          data: {},
+          propsHttp: {
+            home: '',
+            url: 'url',
+            res: 'data'
+          },
+          //七牛云oss配置
+          qiniu: {
+            AK: "",
+            SK: "",
+            scope: "",
+            url: "",
+            deadline: 1
+          },
+          //阿里云oss配置
+          ali: {
+            region: "",
+            endpoint: "",
+            accessKeyId: "",
+            accessKeySecret: "",
+            bucket: ""
+          }
+        },
+        mapForm: [113.10235504165291, 41.03624227495205, "内蒙古自治区乌兰察布市集宁区新体路街道顺达源广告传媒"],
+      }
+    },
+    watch: {},
+    created() {
+      this.toReloadData()
+    },
+    mounted() {
+      if(this.id && this.id > 0) {
+        this.getDetail(this.id)
+      }
+    },
+    watch: {},
+    methods: {
+      getDetail(id) {
+        if(!(id && id > 0)) {
+          return;
+        }
+        /** 获取对应的文章详情 */
+        getDetail(id).then(res => {
+          if(res.data.success && res.data.data) {
+            let data = res.data.data;
+            if(data.regionId && data.regionId > 0) {
+              data.regionId = data.regionId.toString()
+            }
+            if(data.content) {
+              data.content = decodeURIComponent(data.content)
+            }
+            //
+            this.form = data;
+          }
+        })
+      },
+      toReloadData(data) { //
+        this.form = data || {}
+        this.contentItemVisible = true
+      },
+      toSave(isPublish) {
+        if(this.loading) {
+          return;
+        }
+        this.loading = true;
+        this.$refs.form.validate((valid) => {
+          if(valid) { //校验通过
+            let submitObj = JSON.parse(JSON.stringify(this.form)) //克隆一份数据,避免影响到富文本编辑器
+            submitObj.content = encodeURIComponent(submitObj.content)
+
+            /** id不为空则为编辑,为空则新增 */
+            let saveFunc = submitObj.id ? update : add
+            this.loading = true;
+            //  发布或存为草稿
+            submitObj.isPublish = isPublish || 0;
+            // 处理附件列表
+            if(this.attachmentList && this.attachmentList.length > 0) {
+              submitObj.attachment = ""
+              this.attachmentList.map(e => {
+                if(submitObj.attachment) {
+                  submitObj.attachment += "," + e.name + "::" + e.url
+                } else {
+                  submitObj.attachment += e.name + "::" + e.url
+                }
+              })
+            } else {
+              submitObj.attachment = ''
+            }
+            // content
+            submitObj.content = submitObj.content || ''
+
+            saveFunc(submitObj).then(() => {
+              this.$message({
+                type: "success",
+                message: "保存成功!"
+              })
+              this.$emit("toCancel", true)
+            }, error => {
+              this.loading = false;
+              window.console.log(error)
+            })
+          } else { //校验不通过
+            this.$message.error('存在未完善的内容,请完善后再试!');
+            this.loading = false;
+            return false;
+          }
+        })
+      },
+      toView() {
+        // 预览
+      },
+      toCancel() {
+        this.$emit("toCancel", false)
+      },
+      // 图片上传
+      uploadImg(params) { // 调用接口上传不使用upload上传
+        if(!(params.data && params.data.type)) {
+          // att img
+          return;
+        }
+        let uploadType = params.data.type;
+        //
+        let fd = new FormData();
+        let f = params.file;
+        fd.append("file", f);
+        uploadFile(fd).then(res => {
+          if(res && res.data && res.data.success) {
+            // 提交内容
+            if(uploadType == 'img') {
+              this.form.cover = res.data.data.link;
+              this.$refs.form.validateField(["cover"], () => {
+                // 只触发校验不做其他处理
+              })
+            } else if(uploadType == 'video') {
+              this.form.videos = res.data.data.link;
+              this.$refs.form.validateField(["videos"], () => {
+                // 只触发校验不做其他处理
+              })
+            } else if(uploadType == 'att') {
+              this.attachmentList.push({
+                uid: f.uid,
+                name: f.name,
+                url: res.data.data.link
+              })
+            }
+            this.$forceUpdate();
+          }
+          this.loading = false;
+        }, e => {
+          console.log(e)
+          this.loading = false;
+        });
+      },
+      beforeAvatarUpload(file) {
+        // 封面限制5m    附件暂时不限制
+        //        const isJPG = file.type === 'image/jpeg';
+        //        if(!isJPG) {
+        //          this.$message.error('上传头像图片只能是 JPG 格式!');
+        //        }
+        const isLt5M = (file.size / 1024 / 1024) < 5;
+        if(!isLt5M) {
+          this.$message.error('上传头像图片大小不能超过 5MB!');
+        }
+        return true;
+      },
+      handlePreview(file) {
+        window.open(file.url);
+      },
+      handleRemoveImg(file, fileList) {
+        this.attachmentList = fileList;
+      },
+      toPreview() {
+        let submitObj = JSON.parse(JSON.stringify(this.form)) //克隆一份数据,避免影响到富文本编辑器
+        /** id不为空则为编辑,为空则新增 */
+        this.loading = true;
+        // 标签预览需要处理
+
+        // content
+        submitObj.content = submitObj.content || ''
+        // 新选择的标签、专栏需要单独赋值提供显示
+        // goPreview(this, "article", submitObj, this.tagOptions)
+      }
+    },
+  }
+</script>
+
+<style scoped lang="scss">
+  @import "./index.scss"
+</style>

+ 71 - 58
admin_ui/src/views/ycwh/documentInfo.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.documentInfo_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.documentInfo_add" @click="toEdit()">新增</el-button>
+      </template>
+      <template #menu="scope">
+        <el-button type="text" icon="el-icon-edit" v-if="permission.documentInfo_edit" @click="toEdit(scope.row)">编辑</el-button>
+        <el-button type="text" icon="el-icon-delete" v-if="permission.documentInfo_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/documentInfo";
+  import { getList, getDetail, add, update, remove } from "@/api/ycwh/documentInfo";
   import option from "@/option/ycwh/documentInfo";
-  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/editDocumentInfo/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 = `/document_info/documentInfo/export-documentInfo?${this.website.tokenHeader}=${getToken()}`;
-        const {
-        } = this.query;
-        let values = {
-        };
+        let downloadUrl = `/famous_dish/documentInfo/export-documentInfo?${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,10 +199,8 @@
       onLoad(page, params = {}) {
         this.loading = true;
 
-        const {
-        } = this.query;
-
         let values = {
+          ...this.query
         };
 
         getList(page.currentPage, page.pageSize, values).then(res => {
@@ -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>

+ 3 - 3
admin_ui/src/views/ycwh/famousDish.vue

@@ -199,9 +199,9 @@
       onLoad(page, params = {}) {
         this.loading = true;
 
-        const {} = this.query;
-
-        let values = {};
+        let values = {
+          ...this.query
+        };
 
         getList(page.currentPage, page.pageSize, values).then(res => {
           const data = res.data.data;

+ 3 - 3
admin_ui/src/views/ycwh/famousLocation.vue

@@ -199,9 +199,9 @@
       onLoad(page, params = {}) {
         this.loading = true;
 
-        const {} = this.query;
-
-        let values = {};
+        let values = {
+          ...this.query
+        };
 
         getList(page.currentPage, page.pageSize, values).then(res => {
           const data = res.data.data;

+ 3 - 3
admin_ui/src/views/ycwh/famousStore.vue

@@ -199,9 +199,9 @@
       onLoad(page, params = {}) {
         this.loading = true;
 
-        const {} = this.query;
-
-        let values = {};
+        let values = {
+          ...this.query
+        };
 
         getList(page.currentPage, page.pageSize, values).then(res => {
           const data = res.data.data;

+ 27 - 55
admin_ui/src/views/ycwh/feedback.vue

@@ -1,49 +1,24 @@
 <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.feedback_delete"
-                   @click="handleDelete">删 除
-        </el-button>
-        <el-button type="warning"
-                   plain
-                   icon="el-icon-download"
-                   @click="handleExport">导 出
+        <el-button type="danger" icon="el-icon-delete" plain v-if="permission.feedback_delete" @click="handleDelete">删 除
         </el-button>
+        <!--<el-button type="warning" plain icon="el-icon-download" @click="handleExport">导 出
+        </el-button>-->
       </template>
     </avue-crud>
   </basic-container>
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/ycwh/feedback";
+  import { getList, getDetail, add, update, remove } from "@/api/ycwh/feedback";
   import option from "@/option/ycwh/feedback";
-  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';
 
@@ -111,10 +86,10 @@
       },
       rowDel(row) {
         this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
           .then(() => {
             return remove(row.id);
           })
@@ -127,15 +102,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);
           })
@@ -150,10 +125,8 @@
       },
       handleExport() {
         let downloadUrl = `/feedback/feedback/export-feedback?${this.website.tokenHeader}=${getToken()}`;
-        const {
-        } = this.query;
-        let values = {
-        };
+        const {} = this.query;
+        let values = {};
         this.$confirm("是否导出数据?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -167,7 +140,7 @@
         });
       },
       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 +164,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,10 +176,8 @@
       onLoad(page, params = {}) {
         this.loading = true;
 
-        const {
-        } = this.query;
-
         let values = {
+          ...this.query
         };
 
         getList(page.currentPage, page.pageSize, values).then(res => {
@@ -222,4 +193,5 @@
 </script>
 
 <style>
-</style>
+
+</style>

+ 71 - 58
admin_ui/src/views/ycwh/informationInfo.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.informationInfo_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.informationInfo_add" @click="toEdit()">新增</el-button>
+      </template>
+      <template #menu="scope">
+        <el-button type="text" icon="el-icon-edit" v-if="permission.informationInfo_edit" @click="toEdit(scope.row)">编辑</el-button>
+        <el-button type="text" icon="el-icon-delete" v-if="permission.informationInfo_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/informationInfo";
+  import { getList, getDetail, add, update, remove } from "@/api/ycwh/informationInfo";
   import option from "@/option/ycwh/informationInfo";
-  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/editInformationInfo/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 = `/information_info/informationInfo/export-informationInfo?${this.website.tokenHeader}=${getToken()}`;
-        const {
-        } = this.query;
-        let values = {
-        };
+        let downloadUrl = `/famous_dish/informationInfo/export-informationInfo?${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,10 +199,8 @@
       onLoad(page, params = {}) {
         this.loading = true;
 
-        const {
-        } = this.query;
-
         let values = {
+          ...this.query
         };
 
         getList(page.currentPage, page.pageSize, values).then(res => {
@@ -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>

+ 27 - 55
admin_ui/src/views/ycwh/memberInfo.vue

@@ -1,49 +1,24 @@
 <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.memberInfo_delete"
-                   @click="handleDelete">删 除
-        </el-button>
-        <el-button type="warning"
-                   plain
-                   icon="el-icon-download"
-                   @click="handleExport">导 出
+        <el-button type="danger" icon="el-icon-delete" plain v-if="permission.memberInfo_delete" @click="handleDelete">删 除
         </el-button>
+        <!--<el-button type="warning" plain icon="el-icon-download" @click="handleExport">导 出
+        </el-button>-->
       </template>
     </avue-crud>
   </basic-container>
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/ycwh/memberInfo";
+  import { getList, getDetail, add, update, remove } from "@/api/ycwh/memberInfo";
   import option from "@/option/ycwh/memberInfo";
-  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';
 
@@ -111,10 +86,10 @@
       },
       rowDel(row) {
         this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
           .then(() => {
             return remove(row.id);
           })
@@ -127,15 +102,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);
           })
@@ -150,10 +125,8 @@
       },
       handleExport() {
         let downloadUrl = `/member_info/memberInfo/export-memberInfo?${this.website.tokenHeader}=${getToken()}`;
-        const {
-        } = this.query;
-        let values = {
-        };
+        const {} = this.query;
+        let values = {};
         this.$confirm("是否导出数据?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -167,7 +140,7 @@
         });
       },
       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 +164,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,10 +176,8 @@
       onLoad(page, params = {}) {
         this.loading = true;
 
-        const {
-        } = this.query;
-
         let values = {
+          ...this.query
         };
 
         getList(page.currentPage, page.pageSize, values).then(res => {
@@ -222,4 +193,5 @@
 </script>
 
 <style>
-</style>
+
+</style>

+ 71 - 58
admin_ui/src/views/ycwh/professionalStyle.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.professionalStyle_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.professionalStyle_add" @click="toEdit()">新增</el-button>
+      </template>
+      <template #menu="scope">
+        <el-button type="text" icon="el-icon-edit" v-if="permission.professionalStyle_edit" @click="toEdit(scope.row)">编辑</el-button>
+        <el-button type="text" icon="el-icon-delete" v-if="permission.professionalStyle_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/professionalStyle";
+  import { getList, getDetail, add, update, remove } from "@/api/ycwh/professionalStyle";
   import option from "@/option/ycwh/professionalStyle";
-  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/editProfessionalStyle/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 = `/professional_style/professionalStyle/export-professionalStyle?${this.website.tokenHeader}=${getToken()}`;
-        const {
-        } = this.query;
-        let values = {
-        };
+        let downloadUrl = `/famous_dish/professionalStyle/export-professionalStyle?${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,10 +199,8 @@
       onLoad(page, params = {}) {
         this.loading = true;
 
-        const {
-        } = this.query;
-
         let values = {
+          ...this.query
         };
 
         getList(page.currentPage, page.pageSize, values).then(res => {
@@ -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>