Sfoglia il codice sorgente

Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev

liaofei 2 anni fa
parent
commit
66d4a2db27

+ 10 - 11
template/admin/src/main.js

@@ -16,13 +16,11 @@ import router from './router';
 import store from './store';
 
 import ViewUI from 'view-design';
-// import ViewUI from 'view-design'
 Vue.prototype.bus = new Vue();
 import Router from 'vue-router';
 import Auth from '@/libs/wechat';
 import 'view-design/dist/styles/iview.css';
 import { i18n } from '@/i18n/index.js';
-// import i18n from '@/locale';
 
 import config from '@/config';
 import importDirective from '@/directive';
@@ -31,7 +29,6 @@ import installPlugin from '@/plugin';
 import './index.less';
 import '@/assets/icons/iconfont.css';
 import '@/assets/iconfont/iconfont.css';
-import './assets/iconfont/iconfont.css';
 import '@/theme/index.scss';
 import Element from 'element-ui';
 import 'element-ui/lib/theme-chalk/index.css';
@@ -73,8 +70,6 @@ import timeOptions from '@/libs/timeOptions';
 import scroll from '@/libs/loading';
 import * as tools from '@/libs/tools';
 import VueTreeList from 'vue-tree-list';
-import { getHeaderName, getHeaderSider, getMenuSider, getSiderSubmenu } from '@/libs/system';
-import { getMenuopen } from '@/libs/util';
 
 // 复制到粘贴板插件
 import VueClipboard from 'vue-clipboard2';
@@ -101,9 +96,6 @@ import settings from '@/setting';
 
 Vue.prototype.$routeProStr = settings.routePre;
 
-// 实际打包时应该不引入mock
-/* eslint-disable */
-if (process.env.NODE_ENV !== 'production') require('@/mock');
 window.Promise = Promise;
 Vue.prototype.$modalForm = modalForm;
 Vue.prototype.$modalSure = modalSure;
@@ -168,7 +160,7 @@ import vuescroll from 'vuescroll';
 
 Vue.use(vuescroll);
 
-// register global utility filters
+// 注册全局 过滤器
 Object.keys(filters).forEach((key) => {
   Vue.filter(key, filters[key]);
 });
@@ -204,8 +196,15 @@ new Vue({
           }
         });
       }
-
-      if (to.name == 'product_productAdd') {
+      console.log(to.name);
+      if (
+        [
+          'product_productAdd',
+          'marketing_bargainCreate',
+          'marketing_storeSeckillCreate',
+          'marketing_storeIntegralCreate',
+        ].includes(to.name)
+      ) {
         let route = to.matched[1].path.split(':')[0];
         this.$store.state.menus.oneLvRoutes.map((e) => {
           if (route.indexOf(e.path) != -1) {

+ 6 - 13
template/admin/src/pages/marketing/storeBargain/index.vue

@@ -83,9 +83,9 @@
           </i-switch>
         </template>
         <template slot-scope="{ row, index }" slot="action">
-          <a v-if="row.stop_status === 0" @click="edit(row)">编辑</a>
+          <a v-if="row.stop_status === 0" @click="edit(row, 0)">编辑</a>
           <Divider v-if="row.stop_status === 0" type="vertical" />
-          <a @click="copy(row)">复制</a>
+          <a @click="edit(row, 1)">复制</a>
           <Divider type="vertical" />
           <a @click="del(row, '删除砍价商品', index)">删除</a>
           <Divider type="vertical" />
@@ -234,9 +234,8 @@ export default {
   methods: {
     // 添加
     add() {
-      this.$router.push({ path: this.$routeProStr + '/marketing/store_bargain/create/0/0' });
+      this.$router.push({ path: this.$routeProStr + '/marketing/store_bargain/create' });
     },
-    // 导出
     // 用户导出
     async exportList() {
       this.tableFrom.status = this.tableFrom.status || '';
@@ -267,16 +266,10 @@ export default {
         });
       });
     },
-    // 编辑
-    edit(row) {
+    // 编辑 / 复制  type 0 编辑 1 复制
+    edit(row, type) {
       this.$router.push({
-        path: this.$routeProStr + '/marketing/store_bargain/create/' + row.id + '/0',
-      });
-    },
-    // 一键复制
-    copy(row) {
-      this.$router.push({
-        path: this.$routeProStr + '/marketing/store_bargain/create/' + row.id + '/1',
+        path: this.$routeProStr + `/marketing/store_bargain/create/${row.id}/${type}`,
       });
     },
     // 删除

+ 10 - 9
template/admin/src/pages/setting/storage/index.vue

@@ -384,7 +384,7 @@
         <div class="confignv"><span class="configtit">记录类型:</span>CNAME</div>
         <div class="confignv">
           <span class="configtit">记录值:</span>{{ configData.cname }}
-          <span class="copy copy-data" :data-clipboard-text="configData.cname">复制</span>
+          <span class="copy copy-data" @click="insertCopy(configData.cname)">复制</span>
         </div>
       </div>
       <div slot="footer"></div>
@@ -559,15 +559,16 @@ export default {
       this.changeTab(res.data.type.toString());
     });
   },
-  mounted: function () {
-    this.$nextTick(function () {
-      const clipboard = new ClipboardJS('.copy-data');
-      clipboard.on('success', () => {
-        this.$Message.success('复制成功');
-      });
-    });
-  },
   methods: {
+    insertCopy(text) {
+      this.$copyText(text)
+        .then((message) => {
+          this.$Message.success('复制成功');
+        })
+        .catch((err) => {
+          this.$Message.error('复制失败');
+        });
+    },
     changeSave(type) {
       saveType(type)
         .then((res) => {