zhangdan 4 年 前
コミット
f4428fdca7

+ 16 - 6
src/api/card-voucher-role.js

@@ -2,7 +2,7 @@ import { axios } from '@/utils/request'
 
 // 获取列表数据
 export const getPowerRoleList = params => {
-  const url = `yyrole/queryLike/${params.pageNo}/${params.pageSize}`
+  const url = `ddrole/queryLike/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -15,7 +15,7 @@ export const getPowerRoleList = params => {
 // 改变权限状态接口 flag 0:禁用 1:启用
 export const updateEnableStatus = params => {
   return axios({
-    url: `yyrole/enable/${params.id}/${params.flag}`,
+    url: `ddrole/enable/${params.id}/${params.flag}`,
     data: {},
     method: 'get'
   })
@@ -24,7 +24,7 @@ export const updateEnableStatus = params => {
 // 删除用户接口
 export const delectRolePower = params => {
   return axios({
-    url: `yyrole/delete/${params.id}`,
+    url: `ddrole/delete/${params.id}`,
     data: {},
     method: 'get'
   })
@@ -33,7 +33,7 @@ export const delectRolePower = params => {
 // 新增/编辑保存接口
 export const saveRolePower = params => {
   return axios({
-    url: 'yyrole/save',
+    url: 'ddrole/save',
     data: params,
     method: 'POST'
   })
@@ -41,7 +41,7 @@ export const saveRolePower = params => {
 
 // 获取菜单树数据
 export const getMenuList = params => {
-  const url = `yyrole/findAllMenu/${params.id}`
+  const url = `ddrole/findAllMenu/${params.id}`
   return axios({
     url: url,
     method: 'get'
@@ -50,7 +50,17 @@ export const getMenuList = params => {
 
 // 保存权限分配
 export const addMenuPower = params => {
-  const url = `yyrole/saveRoleMenu`
+  const url = `ddrole/saveRoleMenu`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 查询所有角色
+export const getAllRole = params => {
+  const url = `ddrole/findAll`
   return axios({
     url: url,
     data: params,

+ 12 - 4
src/api/card-voucher-user.js

@@ -36,7 +36,7 @@ export const delectUserPower = params => {
   })
 }
 // 督导名下已选门店列表
-export const getRoleList = params => {
+export const getUsedStoreList = params => {
   return axios({
     url: 'dduser/queryUsedStoreList',
     data: params,
@@ -52,14 +52,14 @@ export const saveUserPower = params => {
   })
 }
 // 解绑 (督导已选门店)
-export const deleteUserStore = params => {
+export const deleteUsedStore = params => {
   return axios({
-    url: 'dduser/deleteUserStore/{id}',
+    url: `dduser/deleteUserStore/${params.id}`,
     data: {},
     method: 'get'
   })
 }
-// 新增门店(督导巡店)
+// 新增保存门店(督导巡店)
 export const saveNewUserStore = params => {
   return axios({
     url: 'dduser/saveUserStore',
@@ -67,3 +67,11 @@ export const saveNewUserStore = params => {
     method: 'POST'
   })
 }
+// 已选组织机构下的门店列表
+export const getOrgUsedStoreList = params => {
+  return axios({
+    url: 'dduser/queryStore',
+    data: params,
+    method: 'POST'
+  })
+}

+ 2 - 2
src/api/data.js

@@ -9,7 +9,7 @@ export function login (parameter) {
 }
 
 export const listLookUp = params => {
-  let url = `/lookup/queryLike`
+  const url = `/lookup/queryLike`
   return axios({
     url: url,
     data: params,
@@ -18,7 +18,7 @@ export const listLookUp = params => {
 }
 
 export const getLookUpData = (params) => {
-  let url = `/lookupItem/query/${params.pageNo}/${params.pageSize}`
+  const url = `/lookupItem/query/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({

+ 1 - 1
src/api/job.js

@@ -1,7 +1,7 @@
 import { axios } from '@/utils/request'
 
 export const listJob = (params) => {
-  let url = `/job/queryJob/${params.pageNo}/${params.pageSize}`
+  const url = `/job/queryJob/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({

+ 6 - 6
src/api/power-role.js

@@ -2,7 +2,7 @@ import { axios } from '@/utils/request'
 
 // 分页查询角色
 export const getPowerRoleList = params => {
-  const url = `role/queryLike/${params.pageNo}/${params.pageSize}`
+  const url = `yyrole/queryLike/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -14,7 +14,7 @@ export const getPowerRoleList = params => {
 // 保存角色
 export const saveRolePower = params => {
   return axios({
-    url: 'role/save',
+    url: 'yyrole/save',
     data: params,
     method: 'POST'
   })
@@ -22,7 +22,7 @@ export const saveRolePower = params => {
 // flag 0:禁用 1:启用  启禁用角色
 export const updateEnableStatus = params => {
   return axios({
-    url: `role/enable/${params.id}/${params.flag}`,
+    url: `yyrole/enable/${params.id}/${params.flag}`,
     data: {},
     method: 'get'
   })
@@ -30,14 +30,14 @@ export const updateEnableStatus = params => {
 // 删除角色
 export const delectRolePower = params => {
   return axios({
-    url: `role/delete/${params.id}`,
+    url: `yyrole/delete/${params.id}`,
     data: {},
     method: 'get'
   })
 }
 // 查询可用所有菜单
 export const getMenuList = params => {
-  const url = `role/findAllMenu/${params.id}`
+  const url = `yyrole/findAllMenu/${params.id}`
   return axios({
     url: url,
     method: 'get'
@@ -45,7 +45,7 @@ export const getMenuList = params => {
 }
 // 保存角色菜单关系
 export const addMenuPower = params => {
-  const url = `role/saveRoleMenu`
+  const url = `yyrole/saveRoleMenu`
   return axios({
     url: url,
     data: params,

+ 6 - 6
src/api/power-user.js

@@ -3,7 +3,7 @@ import { axios } from '@/utils/request'
 // 重置密码
 export const resetPSD = params => {
   return axios({
-    url: 'user/resetPwd',
+    url: 'yyuser/resetPwd',
     data: params,
     method: 'POST'
   })
@@ -11,14 +11,14 @@ export const resetPSD = params => {
 // 启用禁用
 export const updateEnableStatus = params => {
   return axios({
-    url: `user/enable/${params.id}/${params.flag}`,
+    url: `yyuser/enable/${params.id}/${params.flag}`,
     data: {},
     method: 'get'
   })
 }
 // 分页查询用户
 export const getPowerUserList = params => {
-  const url = `user/queryLike/${params.pageNo}/${params.pageSize}`
+  const url = `yyuser/queryLike/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -30,7 +30,7 @@ export const getPowerUserList = params => {
 // 删除用户接口
 export const delectUserPower = params => {
   return axios({
-    url: `user/delete/${params.id}`,
+    url: `yyuser/delete/${params.id}`,
     data: {},
     method: 'get'
   })
@@ -38,7 +38,7 @@ export const delectUserPower = params => {
 // 查询所有角色
 export const getRoleList = params => {
   return axios({
-    url: 'role/findAll',
+    url: 'yyrole/findAll',
     data: params,
     method: 'POST'
   })
@@ -46,7 +46,7 @@ export const getRoleList = params => {
 // 保存用户
 export const saveUserPower = params => {
   return axios({
-    url: 'user/save',
+    url: 'yyuser/save',
     data: params,
     method: 'POST'
   })

+ 53 - 53
src/components/Cron/language/cn.js

@@ -1,54 +1,54 @@
 export default {
-    Seconds:{
-        name:'秒',
-        every:'每一秒钟',
-        interval:['每隔','秒执行 从','秒开始'],
-        specific:'具体秒数(可多选)',
-        cycle:['周期从','到','秒']
-    },
-    Minutes:{
-        name:'分',
-        every:'每一分钟',
-        interval:['每隔','分执行 从','分开始'],
-        specific:'具体分钟数(可多选)',
-        cycle:['周期从','到','分']
-    },
-    Hours:{
-        name:'时',
-        every:'每一小时',
-        interval:['每隔','小时执行 从','小时开始'],
-        specific:'具体小时数(可多选)',
-        cycle:['周期从','到','小时']
-    },
-    Day:{
-        name:'天',
-        every:'每一天',
-        intervalWeek:['每隔','周执行 从','开始'],
-        intervalDay:['每隔','天执行 从','天开始'],
-        specificWeek:'具体星期几(可多选)',
-        specificDay:'具体天数(可多选)',
-        lastDay:'在这个月的最后一天',
-        lastWeekday:'在这个月的最后一个工作日',
-        lastWeek:['在这个月的最后一个'],
-        beforeEndMonth:['在本月底前','天'],
-        nearestWeekday:['最近的工作日(周一至周五)至本月','日'],
-        someWeekday:['在这个月的第','个'],
-    },
-    Week:['天','一','二','三','四','五','六'].map(val=>'星期'+val),
-    Month:{
-        name:'月',
-        every:'每一月',
-        interval:['每隔','月执行 从','月开始'],
-        specific:'具体月数(可多选)',
-        cycle:['从','到','月之间的每个月']
-    },
-    Year:{
-        name:'年',
-        every:'每一年',
-        interval:['每隔','年执行 从','年开始'],
-        specific:'具体年份(可多选)',
-        cycle:['从','到','年之间的每一年']
-    },
-    Save:'保存',
-    Close:'关闭'
-}
+  Seconds: {
+    name: '秒',
+    every: '每一秒钟',
+    interval: ['每隔', '秒执行 从', '秒开始'],
+    specific: '具体秒数(可多选)',
+    cycle: ['周期从', '到', '秒']
+  },
+  Minutes: {
+    name: '分',
+    every: '每一分钟',
+    interval: ['每隔', '分执行 从', '分开始'],
+    specific: '具体分钟数(可多选)',
+    cycle: ['周期从', '到', '分']
+  },
+  Hours: {
+    name: '时',
+    every: '每一小时',
+    interval: ['每隔', '小时执行 从', '小时开始'],
+    specific: '具体小时数(可多选)',
+    cycle: ['周期从', '到', '小时']
+  },
+  Day: {
+    name: '天',
+    every: '每一天',
+    intervalWeek: ['每隔', '周执行 从', '开始'],
+    intervalDay: ['每隔', '天执行 从', '天开始'],
+    specificWeek: '具体星期几(可多选)',
+    specificDay: '具体天数(可多选)',
+    lastDay: '在这个月的最后一天',
+    lastWeekday: '在这个月的最后一个工作日',
+    lastWeek: ['在这个月的最后一个'],
+    beforeEndMonth: ['在本月底前', '天'],
+    nearestWeekday: ['最近的工作日(周一至周五)至本月', '日'],
+    someWeekday: ['在这个月的第', '个']
+  },
+  Week: ['天', '一', '二', '三', '四', '五', '六'].map(val => '星期' + val),
+  Month: {
+    name: '月',
+    every: '每一月',
+    interval: ['每隔', '月执行 从', '月开始'],
+    specific: '具体月数(可多选)',
+    cycle: ['从', '到', '月之间的每个月']
+  },
+  Year: {
+    name: '年',
+    every: '每一年',
+    interval: ['每隔', '年执行 从', '年开始'],
+    specific: '具体年份(可多选)',
+    cycle: ['从', '到', '年之间的每一年']
+  },
+  Save: '保存',
+  Close: '关闭'
+}

+ 53 - 53
src/components/Cron/language/en.js

@@ -1,54 +1,54 @@
 export default {
-    Seconds:{
-        name:'Seconds',
-        every:'Every second',
-        interval:['Every','second(s) starting at second'],
-        specific:'Specific second (choose one or many)',
-        cycle:['Every second between second','and second']
-    },
-    Minutes:{
-        name:'Minutes',
-        every:'Every minute',
-        interval:['Every','minute(s) starting at minute'],
-        specific:'Specific minute (choose one or many)',
-        cycle:['Every minute between minute','and minute']
-    },
-    Hours:{
-        name:'Hours',
-        every:'Every hour',
-        interval:['Every','hour(s) starting at hour'],
-        specific:'Specific hour (choose one or many)',
-        cycle:['Every hour between hour','and hour']
-    },
-    Day:{
-        name:'Day',
-        every:'Every day',
-        intervalWeek:['Every','day(s) starting on'],
-        intervalDay:['Every','day(s) starting at the','of the month'],
-        specificWeek:'Specific day of week (choose one or many)',
-        specificDay:'Specific day of month (choose one or many)',
-        lastDay:'On the last day of the month',
-        lastWeekday:'On the last weekday of the month',
-        lastWeek:['On the last',' of the month'],
-        beforeEndMonth:['day(s) before the end of the month'],
-        nearestWeekday:['Nearest weekday (Monday to Friday) to the','of the month'],
-        someWeekday:['On the','of the month'],
-    },
-    Week:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
-    Month:{
-        name:'Month',
-        every:'Every month',
-        interval:['Every','month(s) starting in'],
-        specific:'Specific month (choose one or many)',
-        cycle:['Every month between','and']
-    },
-    Year:{
-        name:'Year',
-        every:'Any year',
-        interval:['Every','year(s) starting in'],
-        specific:'Specific year (choose one or many)',
-        cycle:['Every year between','and']
-    },
-    Save:'Save',
-    Close:'Close'
-}
+  Seconds: {
+    name: 'Seconds',
+    every: 'Every second',
+    interval: ['Every', 'second(s) starting at second'],
+    specific: 'Specific second (choose one or many)',
+    cycle: ['Every second between second', 'and second']
+  },
+  Minutes: {
+    name: 'Minutes',
+    every: 'Every minute',
+    interval: ['Every', 'minute(s) starting at minute'],
+    specific: 'Specific minute (choose one or many)',
+    cycle: ['Every minute between minute', 'and minute']
+  },
+  Hours: {
+    name: 'Hours',
+    every: 'Every hour',
+    interval: ['Every', 'hour(s) starting at hour'],
+    specific: 'Specific hour (choose one or many)',
+    cycle: ['Every hour between hour', 'and hour']
+  },
+  Day: {
+    name: 'Day',
+    every: 'Every day',
+    intervalWeek: ['Every', 'day(s) starting on'],
+    intervalDay: ['Every', 'day(s) starting at the', 'of the month'],
+    specificWeek: 'Specific day of week (choose one or many)',
+    specificDay: 'Specific day of month (choose one or many)',
+    lastDay: 'On the last day of the month',
+    lastWeekday: 'On the last weekday of the month',
+    lastWeek: ['On the last', ' of the month'],
+    beforeEndMonth: ['day(s) before the end of the month'],
+    nearestWeekday: ['Nearest weekday (Monday to Friday) to the', 'of the month'],
+    someWeekday: ['On the', 'of the month']
+  },
+  Week: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+  Month: {
+    name: 'Month',
+    every: 'Every month',
+    interval: ['Every', 'month(s) starting in'],
+    specific: 'Specific month (choose one or many)',
+    cycle: ['Every month between', 'and']
+  },
+  Year: {
+    name: 'Year',
+    every: 'Any year',
+    interval: ['Every', 'year(s) starting in'],
+    specific: 'Specific year (choose one or many)',
+    cycle: ['Every year between', 'and']
+  },
+  Save: 'Save',
+  Close: 'Close'
+}

+ 3 - 3
src/components/Cron/language/index.js

@@ -2,6 +2,6 @@ import en from './en'
 import cn from './cn'
 
 export default {
-    en,
-    cn
-}
+  en,
+  cn
+}

+ 122 - 122
src/components/WEeditor/editor.vue

@@ -6,146 +6,146 @@
 </template>
 
 <script>
-  import Editor from 'wangeditor'
-  import 'wangeditor/release/wangEditor.min.css'
-  import { uploadImgOnce } from '@/api/data'
-  import { oneOf } from '@/utils/util'
+import Editor from 'wangeditor'
+import 'wangeditor/release/wangEditor.min.css'
+import { uploadImgOnce } from '@/api/data'
+import { oneOf } from '@/utils/util'
 
-  export default {
-    name: 'Editor',
+export default {
+  name: 'Editor',
 
-    props: {
-      value: {
-        type: String,
-        default: ''
-      },
-      /**
+  props: {
+    value: {
+      type: String,
+      default: ''
+    },
+    /**
        * 绑定的值的类型, enum: ['html', 'text']
        */
-      valueType: {
-        type: String,
-        default: 'html',
-        validator: (val) => {
-          return oneOf(val, ['html', 'text'])
-        }
-      },
-      /**
+    valueType: {
+      type: String,
+      default: 'html',
+      validator: (val) => {
+        return oneOf(val, ['html', 'text'])
+      }
+    },
+    /**
        * @description 设置change事件触发时间间隔
        */
-      changeInterval: {
-        type: Number,
-        default: 200
-      },
-      /**
+    changeInterval: {
+      type: Number,
+      default: 200
+    },
+    /**
        * @description 是否开启本地存储
        */
-      cache: {
-        type: Boolean,
-        default: true
-      }
+    cache: {
+      type: Boolean,
+      default: true
+    }
+  },
+  computed: {
+    editorId () {
+      return `editor${this._uid}`
+    }
+  },
+  methods: {
+    setHtml (val) {
+      this.editor.txt.html(val)
+    },
+	  getTxt () {
+      return this.editor.txt.text()
+	  },
+    getEdior () {
+      return new Editor(`#${this.editorId}`)
+    },
+    clearText () {
+      this.editor.txt.clear()
     },
-    computed: {
-      editorId () {
-        return `editor${this._uid}`
+    randomStr (len) {
+      len = len || 32
+      const chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'
+      const maxPos = chars.length
+      let pwd = ''
+      for (let i = 0; i < len; i++) {
+        pwd += chars.charAt(Math.floor(Math.random() * maxPos))
       }
+      return pwd
     },
-    methods: {
-      setHtml (val) {
-        this.editor.txt.html(val)
+    createFileName (filename) {
+      const pos = filename.lastIndexOf('.')
+      const suffix = filename.substring(pos)
+      return this.randomStr(20) + suffix
+    }
+
+  },
+  mounted () {
+    const _this = this
+    this.editor = new Editor(`#${this.editorId}`)
+    this.editor.customConfig.zIndex = 100
+    this.editor.customConfig.onchange = (html) => {
+      const text = this.editor.txt.text()
+      if (this.cache) localStorage.editorCache = html
+      this.$emit('input', this.valueType === 'html' ? html : text)
+      this.$emit('on-change', html, text)
+    }
+    this.editor.customConfig.onchangeTimeout = this.changeInterval
+    this.editor.customConfig.uploadImgServer = process.env.VUE_APP_API_BASE_URL + '/upload'
+    this.editor.customConfig.uploadFileName = 'file'
+    this.editor.customConfig.uploadImgParams = {
+      savePathType: 'ali'
+    }
+    this.editor.customConfig.uploadImgHooks = {
+      before: function (xhr, editor, files) {
+        console.log(xhr, editor, files)
+        // 图片上传之前触发
+        // xhr 是 XMLHttpRequst 对象,editor 是编辑器对象,files 是选择的图片文件
+
+        // 如果返回的结果是 {prevent: true, msg: 'xxxx'} 则表示用户放弃上传
+        // return {
+        //     prevent: true,
+        //     msg: '放弃上传'
+        // }
       },
-	  getTxt () {
-		return this.editor.txt.text()
-	  },
-      getEdior () {
-        return new Editor(`#${this.editorId}`)
+      success: function (xhr, editor, result) {
+        console.log(xhr, editor, result)
+        // 图片上传并返回结果,图片插入成功之后触发
+        // xhr 是 XMLHttpRequst 对象,editor 是编辑器对象,result 是服务器端返回的结果
       },
-      clearText () {
-        this.editor.txt.clear()
+      fail: function (xhr, editor, result) {
+        console.log(xhr, editor, result)
+        // 图片上传并返回结果,但图片插入错误时触发
+        // xhr 是 XMLHttpRequst 对象,editor 是编辑器对象,result 是服务器端返回的结果
       },
-      randomStr (len) {
-        len = len || 32
-        let chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'
-        let maxPos = chars.length
-        let pwd = ''
-        for (let i = 0; i < len; i++) {
-          pwd += chars.charAt(Math.floor(Math.random() * maxPos))
-        }
-        return pwd
+      error: function (xhr, editor) {
+        console.log(xhr, editor)
+        // 图片上传出错时触发
+        // xhr 是 XMLHttpRequst 对象,editor 是编辑器对象
       },
-      createFileName (filename) {
-        let pos = filename.lastIndexOf('.')
-        let suffix = filename.substring(pos)
-        return this.randomStr(20) + suffix
-      }
-
-    },
-    mounted () {
-      let _this = this
-      this.editor = new Editor(`#${this.editorId}`)
-      this.editor.customConfig.zIndex = 100
-      this.editor.customConfig.onchange = (html) => {
-        let text = this.editor.txt.text()
-        if (this.cache) localStorage.editorCache = html
-        this.$emit('input', this.valueType === 'html' ? html : text)
-        this.$emit('on-change', html, text)
-      }
-      this.editor.customConfig.onchangeTimeout = this.changeInterval
-      this.editor.customConfig.uploadImgServer = process.env.VUE_APP_API_BASE_URL + '/upload'
-      this.editor.customConfig.uploadFileName = 'file'
-      this.editor.customConfig.uploadImgParams = {
-          savePathType: 'ali'
+      timeout: function (xhr, editor) {
+        // 图片上传超时时触发
+        // xhr 是 XMLHttpRequst 对象,editor 是编辑器对象
+      },
+      // 如果服务器端返回的不是 {errno:0, data: [...]} 这种格式,可使用该配置
+      // (但是,服务器端返回的必须是一个 JSON 格式字符串!!!否则会报错)
+      customInsert: function (insertImg, result, editor) {
+        // console.log(insertImg, result, editor)
+        // 图片上传并返回结果,自定义插入图片的事件(而不是编辑器自动插入图片!!!)
+        // insertImg 是插入图片的函数,editor 是编辑器对象,result 是服务器端返回的结果
+        // 举例:假如上传图片成功后,服务器端返回的是 {url:'....'} 这种格式,即可这样插入图片:
+        insertImg(result.data)
+        // result 必须是一个 JSON 格式字符串!!!否则报错
       }
-      this.editor.customConfig.uploadImgHooks = {
-          before: function (xhr, editor, files) {
-              console.log(xhr, editor, files)
-              // 图片上传之前触发
-              // xhr 是 XMLHttpRequst 对象,editor 是编辑器对象,files 是选择的图片文件
-              
-              // 如果返回的结果是 {prevent: true, msg: 'xxxx'} 则表示用户放弃上传
-              // return {
-              //     prevent: true,
-              //     msg: '放弃上传'
-              // }
-          },
-          success: function (xhr, editor, result) {
-            console.log(xhr, editor, result)
-              // 图片上传并返回结果,图片插入成功之后触发
-              // xhr 是 XMLHttpRequst 对象,editor 是编辑器对象,result 是服务器端返回的结果
-          },
-          fail: function (xhr, editor, result) {
-              console.log(xhr, editor, result)
-              // 图片上传并返回结果,但图片插入错误时触发
-              // xhr 是 XMLHttpRequst 对象,editor 是编辑器对象,result 是服务器端返回的结果
-          },
-          error: function (xhr, editor) {
-               console.log(xhr, editor)
-              // 图片上传出错时触发
-              // xhr 是 XMLHttpRequst 对象,editor 是编辑器对象
-          },
-          timeout: function (xhr, editor) {
-              // 图片上传超时时触发
-              // xhr 是 XMLHttpRequst 对象,editor 是编辑器对象
-          },
-          // 如果服务器端返回的不是 {errno:0, data: [...]} 这种格式,可使用该配置
-          // (但是,服务器端返回的必须是一个 JSON 格式字符串!!!否则会报错)
-          customInsert: function (insertImg, result, editor) {
-              // console.log(insertImg, result, editor)
-              // 图片上传并返回结果,自定义插入图片的事件(而不是编辑器自动插入图片!!!)
-              // insertImg 是插入图片的函数,editor 是编辑器对象,result 是服务器端返回的结果
-              // 举例:假如上传图片成功后,服务器端返回的是 {url:'....'} 这种格式,即可这样插入图片:
-              insertImg(result.data)
-              // result 必须是一个 JSON 格式字符串!!!否则报错
-          }
-        }
-
-      // create这个方法一定要在所有配置项之后调用
-      this.editor.create()
-      this.editor.txt.clear()
-      // 如果本地有存储加载本地存储内容
-      let html = this.value || localStorage.editorCache
-      if (html) this.editor.txt.html(html)
     }
+
+    // create这个方法一定要在所有配置项之后调用
+    this.editor.create()
+    this.editor.txt.clear()
+    // 如果本地有存储加载本地存储内容
+    const html = this.value || localStorage.editorCache
+    if (html) this.editor.txt.html(html)
   }
+}
 </script>
 
 <style lang="less">

+ 2 - 2
src/layouts/BasicLayout.vue

@@ -110,9 +110,9 @@ export default {
     }
   },
   created () {
-    if(this.mainMenu){
+    if (this.mainMenu) {
       this.menus = this.mainMenu.find((item) => item.path === '/').children
-    }else{
+    } else {
       // 没有权限时只显示首页
       const noqx = asyncRouterMap.find((item) => item.path === '/').children
       this.menus = [noqx.find(item => item.path === '/home')]

+ 2 - 2
src/layouts/UserLayout.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="userLayout" :class="['user-layout-wrapper', device]">
-    <canvas id='canvas'></canvas>
+    <canvas id="canvas"></canvas>
     <div class="container">
       <div class="top">
         <div class="header">
@@ -10,7 +10,7 @@
           </a>
         </div>
         <div class="desc">
-          {{title}}
+          {{ title }}
         </div>
       </div>
 

+ 61 - 61
src/libs/getDate.js

@@ -1,65 +1,65 @@
 // 引入 moment 时间插件
-import moment from "moment";
-//获取今日/昨日/本周/上周/本月/上月 时间
+import moment from 'moment'
+// 获取今日/昨日/本周/上周/本月/上月 时间
 export default {
-    // 获取今日的开始结束时间
-    getToday() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().startOf("day").valueOf()).format("YYYY-MM-DD");
-        obj.endtime = moment(moment().valueOf()).format("YYYY-MM-DD");
-        return obj
-    },
-    // 获取昨日的开始结束时间
-    getYesterday() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().add(-1, 'days').startOf("day").valueOf()).format("YYYY-MM-DD");
-        obj.endtime = moment(moment().add(-1, 'days').endOf('day').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取当前周的开始结束时间
-    getCurrWeekDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().week(moment().week()).startOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD')
-        obj.endtime = moment(moment().week(moment().week()).endOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取上一周的开始结束时间
-    getLastWeekDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().week(moment().week() - 1).startOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD')
-        obj.endtime = moment(moment().week(moment().week() - 1).endOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取当前月的开始结束时间
-    getCurrMonthDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().month(moment().month()).startOf('month').valueOf()).format('YYYY-MM-DD');
-        obj.endtime = moment(moment().month(moment().month()).endOf('month').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取上一个月的开始结束时间
-    getLastMonthDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().month(moment().month() - 1).startOf('month').valueOf()).format('YYYY-MM-DD');
-        obj.endtime = moment(moment().month(moment().month() - 1).endOf('month').valueOf()).format('YYYY-MM-DD');
-        return obj
+  // 获取今日的开始结束时间
+  getToday () {
+    const obj = {
+      starttime: '',
+      endtime: ''
     }
+    obj.starttime = moment(moment().startOf('day').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取昨日的开始结束时间
+  getYesterday () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().add(-1, 'days').startOf('day').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().add(-1, 'days').endOf('day').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取当前周的开始结束时间
+  getCurrWeekDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().week(moment().week()).startOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().week(moment().week()).endOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取上一周的开始结束时间
+  getLastWeekDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().week(moment().week() - 1).startOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().week(moment().week() - 1).endOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取当前月的开始结束时间
+  getCurrMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month()).startOf('month').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().month(moment().month()).endOf('month').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取上一个月的开始结束时间
+  getLastMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month() - 1).startOf('month').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().month(moment().month() - 1).endOf('month').valueOf()).format('YYYY-MM-DD')
+    return obj
+  }
 }

+ 18 - 18
src/main.js

@@ -8,39 +8,39 @@ import store from './store/'
 import { VueAxios } from './utils/request'
 
 // mock
-//import './mock'
+// import './mock'
 
 import bootstrap from './core/bootstrap'
 import './core/use'
 import './permission' // permission control
-import './utils/filter' // global filter
+import './utils/filter'
+
+import VueCookies from 'vue-cookies' // global filter
 
 Vue.config.productionTip = false
 
 // mount axios Vue.$http and this.$http
 Vue.use(VueAxios)
-
-import VueCookies from 'vue-cookies'
 Vue.use(VueCookies)
 Vue.$cookies.config('7d')
 /**
  * 权限检查
  */
 Vue.prototype.$hasPermissions = function (value) {
- let isExist = false;
- const roles = store.getters.roles
- const permissionList = roles.permissionList
- //console.log(permissionsStr,'permissionsStr')
- if (permissionList == undefined || permissionList == null) {
-  return false;
- }
- let has = permissionList.find(item => {
-   return item == value
- })
- if (has) {
-  isExist = true;
- }
- return isExist;
+  let isExist = false
+  const roles = store.getters.roles
+  const permissionList = roles.permissionList
+  // console.log(permissionsStr,'permissionsStr')
+  if (permissionList == undefined || permissionList == null) {
+    return false
+  }
+  const has = permissionList.find(item => {
+    return item == value
+  })
+  if (has) {
+    isExist = true
+  }
+  return isExist
 }
 new Vue({
   router,

+ 105 - 107
src/utils/bg/bg.js

@@ -1,148 +1,146 @@
-export function bgStart(){
+export function bgStart () {
   // Little Canvas things
-  var canvas = document.querySelector("#canvas"),
-      ctx = canvas.getContext('2d');
-  
+  var canvas = document.querySelector('#canvas')
+  var ctx = canvas.getContext('2d')
+
   // Set Canvas to be window size
-  canvas.width = window.innerWidth;
-  canvas.height = window.innerHeight;
-  
+  canvas.width = window.innerWidth
+  canvas.height = window.innerHeight
+
   // Configuration, Play with these
   var config = {
     particleNumber: 800,
     maxParticleSize: 10,
     maxSpeed: 40,
     colorVariation: 50
-  };
-  
+  }
+
   // Colors
   var colorPalette = {
-      bg: {r:12,g:9,b:29},
-      matter: [
-        {r:36,g:18,b:42}, // darkPRPL
-        {r:78,g:36,b:42}, // rockDust
-        {r:252,g:178,b:96}, // solorFlare
-        {r:253,g:238,b:152} // totesASun
-      ]
-  };
-  
+    bg: { r: 12, g: 9, b: 29 },
+    matter: [
+      { r: 36, g: 18, b: 42 }, // darkPRPL
+      { r: 78, g: 36, b: 42 }, // rockDust
+      { r: 252, g: 178, b: 96 }, // solorFlare
+      { r: 253, g: 238, b: 152 } // totesASun
+    ]
+  }
+
   // Some Variables hanging out
-  var particles = [],
-      centerX = canvas.width / 2,
-      centerY = canvas.height / 2,
-      drawBg,
-  
+  var particles = []
+  var centerX = canvas.width / 2
+  var centerY = canvas.height / 2
+  var drawBg
+
   // Draws the background for the canvas, because space
-  drawBg = function (ctx, color) {
-      ctx.fillStyle = "rgb(" + color.r + "," + color.g + "," + color.b + ")";
-      ctx.fillRect(0,0,canvas.width,canvas.height);
-  };
-  
+  var drawBg = function (ctx, color) {
+    ctx.fillStyle = 'rgb(' + color.r + ',' + color.g + ',' + color.b + ')'
+    ctx.fillRect(0, 0, canvas.width, canvas.height)
+  }
+
   // Particle Constructor
   var Particle = function (x, y) {
-      // X Coordinate
-      this.x = x || Math.round(Math.random() * canvas.width);
-      // Y Coordinate
-      this.y = y || Math.round(Math.random() * canvas.height);
-      // Radius of the space dust
-      this.r = Math.ceil(Math.random() * config.maxParticleSize);
-      // Color of the rock, given some randomness
-      this.c = colorVariation(colorPalette.matter[Math.floor(Math.random() * colorPalette.matter.length)],true );
-      // Speed of which the rock travels
-      this.s = Math.pow(Math.ceil(Math.random() * config.maxSpeed), .7);
-      // Direction the Rock flies
-      this.d = Math.round(Math.random() * 360);
-  };
-  
+    // X Coordinate
+    this.x = x || Math.round(Math.random() * canvas.width)
+    // Y Coordinate
+    this.y = y || Math.round(Math.random() * canvas.height)
+    // Radius of the space dust
+    this.r = Math.ceil(Math.random() * config.maxParticleSize)
+    // Color of the rock, given some randomness
+    this.c = colorVariation(colorPalette.matter[Math.floor(Math.random() * colorPalette.matter.length)], true)
+    // Speed of which the rock travels
+    this.s = Math.pow(Math.ceil(Math.random() * config.maxSpeed), 0.7)
+    // Direction the Rock flies
+    this.d = Math.round(Math.random() * 360)
+  }
+
   // Provides some nice color variation
   // Accepts an rgba object
   // returns a modified rgba object or a rgba string if true is passed in for argument 2
   var colorVariation = function (color, returnString) {
-      var r,g,b,a, variation;
-      r = Math.round(((Math.random() * config.colorVariation) - (config.colorVariation/2)) + color.r);
-      g = Math.round(((Math.random() * config.colorVariation) - (config.colorVariation/2)) + color.g);
-      b = Math.round(((Math.random() * config.colorVariation) - (config.colorVariation/2)) + color.b);
-      a = Math.random() + .5;
-      if (returnString) {
-          return "rgba(" + r + "," + g + "," + b + "," + a + ")";
-      } else {
-          return {r,g,b,a};
-      }
-  };
-  
+    var r, g, b, a, variation
+    r = Math.round(((Math.random() * config.colorVariation) - (config.colorVariation / 2)) + color.r)
+    g = Math.round(((Math.random() * config.colorVariation) - (config.colorVariation / 2)) + color.g)
+    b = Math.round(((Math.random() * config.colorVariation) - (config.colorVariation / 2)) + color.b)
+    a = Math.random() + 0.5
+    if (returnString) {
+      return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'
+    } else {
+      return { r, g, b, a }
+    }
+  }
+
   // Used to find the rocks next point in space, accounting for speed and direction
   var updateParticleModel = function (p) {
-      var a = 180 - (p.d + 90); // find the 3rd angle
-      p.d > 0 && p.d < 180 ? p.x += p.s * Math.sin(p.d) / Math.sin(p.s) : p.x -= p.s * Math.sin(p.d) / Math.sin(p.s);
-      p.d > 90 && p.d < 270 ? p.y += p.s * Math.sin(a) / Math.sin(p.s) : p.y -= p.s * Math.sin(a) / Math.sin(p.s);
-      return p;
-  };
-  
+    var a = 180 - (p.d + 90) // find the 3rd angle
+    p.d > 0 && p.d < 180 ? p.x += p.s * Math.sin(p.d) / Math.sin(p.s) : p.x -= p.s * Math.sin(p.d) / Math.sin(p.s)
+    p.d > 90 && p.d < 270 ? p.y += p.s * Math.sin(a) / Math.sin(p.s) : p.y -= p.s * Math.sin(a) / Math.sin(p.s)
+    return p
+  }
+
   // Just the function that physically draws the particles
   // Physically? sure why not, physically.
   var drawParticle = function (x, y, r, c) {
-      ctx.beginPath();
-      ctx.fillStyle = c;
-      ctx.arc(x, y, r, 0, 2*Math.PI, false);
-      ctx.fill();
-      ctx.closePath();
-  };
-  
+    ctx.beginPath()
+    ctx.fillStyle = c
+    ctx.arc(x, y, r, 0, 2 * Math.PI, false)
+    ctx.fill()
+    ctx.closePath()
+  }
+
   // Remove particles that aren't on the canvas
   var cleanUpArray = function () {
-      particles = particles.filter((p) => { 
-        return (p.x > -100 && p.y > -100); 
-      });
-  };
-  
-  
+    particles = particles.filter((p) => {
+      return (p.x > -100 && p.y > -100)
+    })
+  }
+
   var initParticles = function (numParticles, x, y) {
-      for (let i = 0; i < numParticles; i++) {
-          particles.push(new Particle(x, y));
-      }
-      particles.forEach((p) => {
-          drawParticle(p.x, p.y, p.r, p.c);
-      });
-  };
-  
+    for (let i = 0; i < numParticles; i++) {
+      particles.push(new Particle(x, y))
+    }
+    particles.forEach((p) => {
+      drawParticle(p.x, p.y, p.r, p.c)
+    })
+  }
+
   // That thing
-  window.requestAnimFrame = (function() {
+  window.requestAnimFrame = (function () {
     return window.requestAnimationFrame ||
        window.webkitRequestAnimationFrame ||
        window.mozRequestAnimationFrame ||
-       function(callback) {
-          window.setTimeout(callback, 1000 / 60);
-       };
-  })();
-  
-  
+       function (callback) {
+         window.setTimeout(callback, 1000 / 60)
+       }
+  })()
+
   // Our Frame function
   var frame = function () {
     // Draw background first
-    drawBg(ctx, colorPalette.bg);
+    drawBg(ctx, colorPalette.bg)
     // Update Particle models to new position
     particles.map((p) => {
-      return updateParticleModel(p);
-    });
+      return updateParticleModel(p)
+    })
     // Draw em'
     particles.forEach((p) => {
-        drawParticle(p.x, p.y, p.r, p.c);
-    });
+      drawParticle(p.x, p.y, p.r, p.c)
+    })
     // Play the same song? Ok!
-    window.requestAnimFrame(frame);
-  };
-  
+    window.requestAnimFrame(frame)
+  }
+
   // Click listener
-  document.body.addEventListener("click", function (event) {
-      var x = event.clientX,
-          y = event.clientY;
-      cleanUpArray();
-      initParticles(config.particleNumber, x, y);
-  });
-  
+  document.body.addEventListener('click', function (event) {
+    var x = event.clientX
+    var y = event.clientY
+    cleanUpArray()
+    initParticles(config.particleNumber, x, y)
+  })
+
   // First Frame
-  frame();
-  
+  frame()
+
   // First particle explosion
-  initParticles(config.particleNumber);
-}
+  initParticles(config.particleNumber)
+}

+ 134 - 134
src/utils/bg/bg1.js

@@ -1,188 +1,188 @@
-export function bgStart(){
+export function bgStart () {
   /*
   (Book REF) HTML5 Canvas Ch. 5:  Math, Physics, and Animation ::: Uniform Circular Motion
   By Steve Fulton and Jeff Fulton
   */
-  window.requestAnimFrame = (function() {
+  window.requestAnimFrame = (function () {
     return window.requestAnimationFrame ||
       window.webkitRequestAnimationFrame ||
       window.mozRequestAnimationFrame ||
       window.oRequestAnimationFrame ||
       window.msRequestAnimationFrame ||
-      function(callback) {
-        window.setTimeout(callback, 1000 / 60);
-      };
-  })();
- 
-  var c,
-  $,
-  w,
-  h,
-  msX,
-  msY,
-  midX,
-  midY,
-  num = 650,
-  parts = [],
-  begin = 50,
-  repeat = 20,
-  end = Math.PI * 2,
-  flow,
-  force = null,
-  msdn = false;
-  
-  function start() {
-    c = document.getElementById('canvas');
-    $ = c.getContext('2d');
-    w = c.width = window.innerWidth;
-    h = c.height = window.innerHeight;
-    midX = w / 2;
-    midY = h / 2;
-    force = Math.max(w, h) * 0.09;
-    flow = begin;
-  
-    window.requestAnimFrame(create);
-    run();
+      function (callback) {
+        window.setTimeout(callback, 1000 / 60)
+      }
+  })()
+
+  var c
+  var $
+  var w
+  var h
+  var msX
+  var msY
+  var midX
+  var midY
+  var num = 650
+  var parts = []
+  var begin = 50
+  var repeat = 20
+  var end = Math.PI * 2
+  var flow
+  var force = null
+  var msdn = false
+
+  function start () {
+    c = document.getElementById('canvas')
+    $ = c.getContext('2d')
+    w = c.width = window.innerWidth
+    h = c.height = window.innerHeight
+    midX = w / 2
+    midY = h / 2
+    force = Math.max(w, h) * 0.09
+    flow = begin
+
+    window.requestAnimFrame(create)
+    run()
   }
-  
-  function run() {
-    window.requestAnimFrame(run);
-    go();
+
+  function run () {
+    window.requestAnimFrame(run)
+    go()
   }
-  
-  function Part() {
-    this.deg = 0;
-    this.rad = 0;
-    this.x = 0;
-    this.y = 0;
-    this.distX = 0;
-    this.distY = 0;
-    this.color = 'rgb(' + Math.floor(Math.random() * 130) + ',' + Math.floor(Math.random() * 50) + ',' + Math.floor(Math.random() * 100) + ')';
-    this.size;
+
+  function Part () {
+    this.deg = 0
+    this.rad = 0
+    this.x = 0
+    this.y = 0
+    this.distX = 0
+    this.distY = 0
+    this.color = 'rgb(' + Math.floor(Math.random() * 130) + ',' + Math.floor(Math.random() * 50) + ',' + Math.floor(Math.random() * 100) + ')'
+    this.size
   }
-  
-  function create() {
-    var n = num;
+
+  function create () {
+    var n = num
     while (n--) {
-      var p = new Part();
-      p.deg = Math.floor(Math.random() * 360);
-      p.rad = Math.floor(Math.random() * w * 0.5);
-      p.x = p.distX = Math.floor(Math.random() * w);
-      p.y = p.distY = Math.floor(Math.random() * h);
-      p.size = 1 + Math.floor(Math.random() * (p.rad * 0.055));
-      parts[n] = p;
+      var p = new Part()
+      p.deg = Math.floor(Math.random() * 360)
+      p.rad = Math.floor(Math.random() * w * 0.5)
+      p.x = p.distX = Math.floor(Math.random() * w)
+      p.y = p.distY = Math.floor(Math.random() * h)
+      p.size = 1 + Math.floor(Math.random() * (p.rad * 0.055))
+      parts[n] = p
     }
-    c.onmousemove = msmv;
-    c.onmousedown = msdn;
-    c.onmouseup = msup;
-  
-    var int = setInterval(function() {
-      flow--;
-      if (flow === repeat) clearInterval(int);
-    }, 20);
+    c.onmousemove = msmv
+    c.onmousedown = msdn
+    c.onmouseup = msup
+
+    var int = setInterval(function () {
+      flow--
+      if (flow === repeat) clearInterval(int)
+    }, 20)
   }
-  
-  function go() {
-    $.globalCompositeOperation = 'source-over';
-    $.fillStyle = 'hsla(242, 30%, 5%, .55)';
-    $.fillRect(0, 0, w, h);
-    $.globalCompositeOperation = 'lighter';
-    var mx = msX;
-    var my = msY;
-    var bounds = force;
+
+  function go () {
+    $.globalCompositeOperation = 'source-over'
+    $.fillStyle = 'hsla(242, 30%, 5%, .55)'
+    $.fillRect(0, 0, w, h)
+    $.globalCompositeOperation = 'lighter'
+    var mx = msX
+    var my = msY
+    var bounds = force
     if (msdn) {
-      bounds = force * 2;
+      bounds = force * 2
     }
-    var n = num;
+    var n = num
     while (n--) {
-      var p = parts[n];
-      var radi = Math.PI / 180 * p.deg;
-      p.distX = midX + p.rad * Math.cos(radi);
-      p.distY = midY + p.rad * Math.sin(radi) * 0.4;
+      var p = parts[n]
+      var radi = Math.PI / 180 * p.deg
+      p.distX = midX + p.rad * Math.cos(radi)
+      p.distY = midY + p.rad * Math.sin(radi) * 0.4
       if (mx && my) {
-        var react = Math.floor((bounds * 0.5) + Math.random() * (bounds * 0.9));
+        var react = Math.floor((bounds * 0.5) + Math.random() * (bounds * 0.9))
         if (p.distX - mx > 0 &&
           p.distX - mx < bounds &&
           p.distY - my > 0 &&
           p.distY - my < bounds) {
-          p.distX += react;
-          p.distY += react;
+          p.distX += react
+          p.distY += react
         } else if (p.distX - mx > 0 &&
           p.distX - mx < bounds &&
           p.distY - my < 0 &&
           p.distY - my > -bounds) {
-          p.distX += react;
-          p.distY -= react;
+          p.distX += react
+          p.distY -= react
         } else if (p.distX - mx < 0 &&
           p.distX - mx > -bounds &&
           p.distY - my > 0 &&
           p.distY - my < bounds) {
-          p.distX -= react;
-          p.distY += react;
+          p.distX -= react
+          p.distY += react
         } else if (p.distX - mx < 0 &&
           p.distX - mx > -bounds &&
           p.distY - my < 0 &&
           p.distY - my > -bounds) {
-          p.distY -= react;
-          p.distY -= react;
+          p.distY -= react
+          p.distY -= react
         }
       }
-      p.x += ((p.distX - p.x) / flow);
-      p.y += ((p.distY - p.y) / flow);
-      var x = p.x;
-      var y = p.y;
-      var s = p.size * (p.y * 1.5 / h);
+      p.x += ((p.distX - p.x) / flow)
+      p.y += ((p.distY - p.y) / flow)
+      var x = p.x
+      var y = p.y
+      var s = p.size * (p.y * 1.5 / h)
       if (s < 0.1) {
-        s = 0;
+        s = 0
       }
-      $.beginPath();
-      $.fillStyle = p.color;
-      $.arc(x, y, s, 0, end, true);
-      $.fill();
-      $.closePath();
-      var vary;
+      $.beginPath()
+      $.fillStyle = p.color
+      $.arc(x, y, s, 0, end, true)
+      $.fill()
+      $.closePath()
+      var vary
       if (p.size < 2) {
-        vary = 4;
+        vary = 4
       } else if (p.size < 3) {
-        vary = 3;
+        vary = 3
       } else if (p.size < 4) {
-        vary = 2;
+        vary = 2
       } else {
-        vary = 1;
+        vary = 1
       }
-      vary *= (p.y / (h * 0.9));
-      p.deg += vary;
-      p.deg = p.deg % 360;
+      vary *= (p.y / (h * 0.9))
+      p.deg += vary
+      p.deg = p.deg % 360
     }
   }
-  
-  function msmv(e) {
-    var p = getPos(e.target);
-    var sX = window.pageXOffset;
-    var sY = window.pageYOffset;
-    msX = e.clientX - p.x + sX;
-    msY = e.clientY - p.y + sY;
+
+  function msmv (e) {
+    var p = getPos(e.target)
+    var sX = window.pageXOffset
+    var sY = window.pageYOffset
+    msX = e.clientX - p.x + sX
+    msY = e.clientY - p.y + sY
   }
-  
-  function msdn(e) {
-    msdn = true;
+
+  function msdn (e) {
+    msdn = true
   }
-  
-  function msup(e) {
-    msdn = false;
+
+  function msup (e) {
+    msdn = false
   }
-  
-  function getPos(el) {
-    var cosmo = {};
-    cosmo.x = el.offsetLeft;
-    cosmo.y = el.offsetTop;
+
+  function getPos (el) {
+    var cosmo = {}
+    cosmo.x = el.offsetLeft
+    cosmo.y = el.offsetTop
     while (el.offsetParent) {
-      el = el.offsetParent;
-      cosmo.x += el.offsetLeft;
-      cosmo.y += el.offsetTop;
+      el = el.offsetParent
+      cosmo.x += el.offsetLeft
+      cosmo.y += el.offsetTop
     }
-    return cosmo;
+    return cosmo
   }
-  
+
   start()
 }

+ 118 - 119
src/utils/bg/bg2.js

@@ -1,50 +1,50 @@
-export function bgStart(){
+export function bgStart () {
   /**
    * Generates random particles using canvas
-   * 
+   *
    * @class Particles
    * @constructor
    */
-  function Particles(){
-    //particle colors
+  function Particles () {
+    // particle colors
     this.colors = [
       '255, 255, 255',
       '255, 99, 71',
       '19, 19, 19'
     ]
-    //adds gradient to particles on true
-    this.blurry = true;
-    //adds white border
-    this.border = false;
-    //particle radius min/max
-    this.minRadius = 10; 
-    this.maxRadius = 35;
-    //particle opacity min/max
-    this.minOpacity = .005;
-    this.maxOpacity = .5;
-    //particle speed min/max
-    this.minSpeed = .05;
-    this.maxSpeed = .5;
-    //frames per second 
-    this.fps = 60;
-    //number of particles
-    this.numParticles = 75;
-    //required canvas variables
-    this.canvas = document.getElementById('canvas');
-    if(this.canvas){
-      this.ctx = this.canvas.getContext('2d');
+    // adds gradient to particles on true
+    this.blurry = true
+    // adds white border
+    this.border = false
+    // particle radius min/max
+    this.minRadius = 10
+    this.maxRadius = 35
+    // particle opacity min/max
+    this.minOpacity = 0.005
+    this.maxOpacity = 0.5
+    // particle speed min/max
+    this.minSpeed = 0.05
+    this.maxSpeed = 0.5
+    // frames per second
+    this.fps = 60
+    // number of particles
+    this.numParticles = 75
+    // required canvas variables
+    this.canvas = document.getElementById('canvas')
+    if (this.canvas) {
+      this.ctx = this.canvas.getContext('2d')
     }
   }
-  
+
   /**
    * Initializes everything
    * @method init
    */
-  Particles.prototype.init = function(){
-    this.render();
-    this.createCircle();
+  Particles.prototype.init = function () {
+    this.render()
+    this.createCircle()
   }
-  
+
   /**
    * generates random number between min and max values
    * @param  {number} min value
@@ -52,145 +52,144 @@ export function bgStart(){
    * @return {number} random number between min and max
    * @method _rand
    */
-  Particles.prototype._rand = function(min, max){
-    return Math.random() * (max - min) + min;
+  Particles.prototype._rand = function (min, max) {
+    return Math.random() * (max - min) + min
   }
-  
+
   /**
    * Sets canvas size and updates values on resize
    * @method render
    */
-  Particles.prototype.render = function(){ 
-    var self = this,
-        wHeight = window.innerHeight,
-        wWidth = window.innerWidth;
-    
-    self.canvas.width = wWidth;
-    self.canvas.height = wHeight;
-    window.addEventListener('onresize',self.render)
+  Particles.prototype.render = function () {
+    var self = this
+    var wHeight = window.innerHeight
+    var wWidth = window.innerWidth
+
+    self.canvas.width = wWidth
+    self.canvas.height = wHeight
+    window.addEventListener('onresize', self.render)
 
     document.body.style.background = 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAI0lEQVQIW2NkwAT/GdHE/gP5jMiCYAGQIpggXAAmiCIAEgQAAE4FBbECyZcAAAAASUVORK5CYII=) #222'
   }
-  
+
   /**
    * Randomly creates particle attributes
    * @method createCircle
    */
-  Particles.prototype.createCircle = function(){
-    var particle = [];
-  
+  Particles.prototype.createCircle = function () {
+    var particle = []
+
     for (var i = 0; i < this.numParticles; i++) {
-      var self = this,
-          color = self.colors[~~(self._rand(0, self.colors.length))];
-      
+      var self = this
+      var color = self.colors[~~(self._rand(0, self.colors.length))]
+
       particle[i] = {
-        radius    : self._rand(self.minRadius, self.maxRadius),
-        xPos      : self._rand(0, canvas.width),
-        yPos      : self._rand(0, canvas.height),
-        xVelocity : self._rand(self.minSpeed, self.maxSpeed),
-        yVelocity : self._rand(self.minSpeed, self.maxSpeed),
-        color     : 'rgba(' + color + ',' + self._rand(self.minOpacity, self.maxOpacity) + ')'
+        radius: self._rand(self.minRadius, self.maxRadius),
+        xPos: self._rand(0, canvas.width),
+        yPos: self._rand(0, canvas.height),
+        xVelocity: self._rand(self.minSpeed, self.maxSpeed),
+        yVelocity: self._rand(self.minSpeed, self.maxSpeed),
+        color: 'rgba(' + color + ',' + self._rand(self.minOpacity, self.maxOpacity) + ')'
       }
-      
-      //once values are determined, draw particle on canvas
-      self.draw(particle, i);
+
+      // once values are determined, draw particle on canvas
+      self.draw(particle, i)
     }
-    //...and once drawn, animate the particle
-    self.animate(particle);
+    // ...and once drawn, animate the particle
+    self.animate(particle)
   }
-  
+
   /**
    * Draws particles on canvas
    * @param  {array} Particle array from createCircle method
    * @param  {number} i value from createCircle method
    * @method draw
    */
-  Particles.prototype.draw = function(particle, i){
-    var self = this,
-        ctx = self.ctx;
-    
-    if (self.blurry === true ) {
-      //creates gradient if blurry === true
-      var grd = ctx.createRadialGradient(particle[i].xPos, particle[i].yPos, particle[i].radius, particle[i].xPos, particle[i].yPos, particle[i].radius/1.25);
-      
-      grd.addColorStop(1.000, particle[i].color);
-      grd.addColorStop(0.000, 'rgba(34, 34, 34, 0)');
-      ctx.fillStyle = grd;
+  Particles.prototype.draw = function (particle, i) {
+    var self = this
+    var ctx = self.ctx
+
+    if (self.blurry === true) {
+      // creates gradient if blurry === true
+      var grd = ctx.createRadialGradient(particle[i].xPos, particle[i].yPos, particle[i].radius, particle[i].xPos, particle[i].yPos, particle[i].radius / 1.25)
+
+      grd.addColorStop(1.000, particle[i].color)
+      grd.addColorStop(0.000, 'rgba(34, 34, 34, 0)')
+      ctx.fillStyle = grd
     } else {
-      //otherwise sets to solid color w/ opacity value
-      ctx.fillStyle = particle[i].color; 
+      // otherwise sets to solid color w/ opacity value
+      ctx.fillStyle = particle[i].color
     }
-    
+
     if (self.border === true) {
-      ctx.strokeStyle = '#fff';
-      ctx.stroke();
+      ctx.strokeStyle = '#fff'
+      ctx.stroke()
     }
-    
-    ctx.beginPath();
-    ctx.arc(particle[i].xPos, particle[i].yPos, particle[i].radius, 0, 2 * Math.PI, false);
-    ctx.fill();
+
+    ctx.beginPath()
+    ctx.arc(particle[i].xPos, particle[i].yPos, particle[i].radius, 0, 2 * Math.PI, false)
+    ctx.fill()
   }
-  
+
   /**
-   * Animates particles 
+   * Animates particles
    * @param  {array} particle value from createCircle & draw methods
    * @method animate
    */
-  Particles.prototype.animate = function(particle){
-    var self = this,
-            ctx = self.ctx;
-    
-    setInterval(function(){
-      //clears canvas
-      self.clearCanvas();
-      //then redraws particles in new positions based on velocity
+  Particles.prototype.animate = function (particle) {
+    var self = this
+    var ctx = self.ctx
+
+    setInterval(function () {
+      // clears canvas
+      self.clearCanvas()
+      // then redraws particles in new positions based on velocity
       for (var i = 0; i < self.numParticles; i++) {
-        particle[i].xPos += particle[i].xVelocity;
-        particle[i].yPos -= particle[i].yVelocity;
-       
-        //if particle goes off screen call reset method to place it offscreen to the left/bottom
+        particle[i].xPos += particle[i].xVelocity
+        particle[i].yPos -= particle[i].yVelocity
+
+        // if particle goes off screen call reset method to place it offscreen to the left/bottom
         if (particle[i].xPos > self.canvas.width + particle[i].radius || particle[i].yPos > self.canvas.height + particle[i].radius) {
-          self.resetParticle(particle, i);
+          self.resetParticle(particle, i)
         } else {
-          self.draw(particle, i);
+          self.draw(particle, i)
         }
-      }  
-    }, 1000/self.fps); 
+      }
+    }, 1000 / self.fps)
   }
-  
+
   /**
    * Resets position of particle when it goes off screen
    * @param  {array} particle value from createCircle & draw methods
    * @param  {number} i value from createCircle method
    * @method resetParticle
    */
-  Particles.prototype.resetParticle = function(particle, i){
-    var self = this;
-    
-    var random = self._rand(0, 1);
-    
-    if (random > .5) { 
+  Particles.prototype.resetParticle = function (particle, i) {
+    var self = this
+
+    var random = self._rand(0, 1)
+
+    if (random > 0.5) {
       // 50% chance particle comes from left side of window...
-      particle[i].xPos = -particle[i].radius;
-      particle[i].yPos = self._rand(0, self.canvas.height);
+      particle[i].xPos = -particle[i].radius
+      particle[i].yPos = self._rand(0, self.canvas.height)
     } else {
-      //... or bottom of window
-      particle[i].xPos = self._rand(0, self.canvas.width);
-      particle[i].yPos = self.canvas.height + particle[i].radius;   
+      // ... or bottom of window
+      particle[i].xPos = self._rand(0, self.canvas.width)
+      particle[i].yPos = self.canvas.height + particle[i].radius
     }
-    //redraw particle with new values
-    self.draw(particle, i);
+    // redraw particle with new values
+    self.draw(particle, i)
   }
-  
+
   /**
    * Clears canvas between animation frames
    * @method clearCanvas
    */
-  Particles.prototype.clearCanvas = function(){
-    this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
+  Particles.prototype.clearCanvas = function () {
+    this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)
   }
-  
-   
+
   // go go go!
-  var particle = new Particles().init(); 
-}
+  var particle = new Particles().init()
+}

+ 63 - 63
src/utils/bg/bg3.js

@@ -1,24 +1,24 @@
-export function bgStart(){
+export function bgStart () {
   // modified version of random-normal
-  function normalPool(o){var r=0;do{var a=Math.round(normal({mean:o.mean,dev:o.dev}));if(a<o.pool.length&&a>=0)return o.pool[a];r++}while(r<100)}function randomNormal(o){if(o=Object.assign({mean:0,dev:1,pool:[]},o),Array.isArray(o.pool)&&o.pool.length>0)return normalPool(o);var r,a,n,e,l=o.mean,t=o.dev;do{r=(a=2*Math.random()-1)*a+(n=2*Math.random()-1)*n}while(r>=1);return e=a*Math.sqrt(-2*Math.log(r)/r),t*e+l}
-  
-  const NUM_PARTICLES = 100;
-  const PARTICLE_SIZE = 0.5; // View heights
-  const SPEED = 10000; // Milliseconds 
-  
-  let particles = [];
-  
-  function rand(low, high) {
-    return Math.random() * (high - low) + low;
+  function normalPool (o) { var r = 0; do { var a = Math.round(normal({ mean: o.mean, dev: o.dev })); if (a < o.pool.length && a >= 0) return o.pool[a]; r++ } while (r < 100) } function randomNormal (o) { if (o = Object.assign({ mean: 0, dev: 1, pool: [] }, o), Array.isArray(o.pool) && o.pool.length > 0) return normalPool(o); var r; var a; var n; var e; var l = o.mean; var t = o.dev; do { r = (a = 2 * Math.random() - 1) * a + (n = 2 * Math.random() - 1) * n } while (r >= 1);return e = a * Math.sqrt(-2 * Math.log(r) / r), t * e + l }
+
+  const NUM_PARTICLES = 100
+  const PARTICLE_SIZE = 0.5 // View heights
+  const SPEED = 10000 // Milliseconds
+
+  const particles = []
+
+  function rand (low, high) {
+    return Math.random() * (high - low) + low
   }
-  
-  function createParticle(canvas) {
+
+  function createParticle (canvas) {
     const colour = {
       r: 255,
       g: randomNormal({ mean: 125, dev: 20 }),
       b: 50,
-      a: rand(0, 1),
-    };
+      a: rand(0, 1)
+    }
     return {
       x: -2,
       y: -2,
@@ -28,25 +28,25 @@ export function bgStart(){
       offsetY: randomNormal({ mean: 0, dev: 10 }),
       arc: Math.PI * 2,
       startTime: performance.now() - rand(0, SPEED),
-      colour: `rgba(${colour.r}, ${colour.g}, ${colour.b}, ${colour.a})`,
+      colour: `rgba(${colour.r}, ${colour.g}, ${colour.b}, ${colour.a})`
     }
   }
-  
-  function moveParticle(particle, canvas, time) {
-    const progress = ((time - particle.startTime) % particle.duration) / particle.duration;
+
+  function moveParticle (particle, canvas, time) {
+    const progress = ((time - particle.startTime) % particle.duration) / particle.duration
     return {
       ...particle,
       x: progress,
-      y: ((Math.sin(progress * particle.arc) * particle.amplitude) + particle.offsetY),
-    };
+      y: ((Math.sin(progress * particle.arc) * particle.amplitude) + particle.offsetY)
+    }
   }
-  
-  function drawParticle(particle, canvas, ctx) {
-    canvas = document.getElementById('canvas');
-    const vh = canvas.height / 100;
-  
-    ctx.fillStyle = particle.colour;
-    ctx.beginPath();
+
+  function drawParticle (particle, canvas, ctx) {
+    canvas = document.getElementById('canvas')
+    const vh = canvas.height / 100
+
+    ctx.fillStyle = particle.colour
+    ctx.beginPath()
     ctx.ellipse(
       particle.x * canvas.width,
       particle.y * vh + (canvas.height / 2),
@@ -55,68 +55,68 @@ export function bgStart(){
       0,
       0,
       2 * Math.PI
-    );
-    ctx.fill();
+    )
+    ctx.fill()
   }
-  
-  function draw(time, canvas, ctx) {
+
+  function draw (time, canvas, ctx) {
     // Move particles
     particles.forEach((particle, index) => {
-      particles[index] = moveParticle(particle, canvas, time);
+      particles[index] = moveParticle(particle, canvas, time)
     })
-  
+
     // Clear the canvas
-    ctx.clearRect(0, 0, canvas.width, canvas.height);
-  
+    ctx.clearRect(0, 0, canvas.width, canvas.height)
+
     // Draw the particles
     particles.forEach((particle) => {
-      drawParticle(particle, canvas, ctx);
+      drawParticle(particle, canvas, ctx)
     })
-  
+
     // Schedule next frame
-    requestAnimationFrame((time) => draw(time, canvas, ctx));
+    requestAnimationFrame((time) => draw(time, canvas, ctx))
   }
-  
-  function initializeCanvas() {
-    let canvas = document.getElementById('canvas');
-    canvas.width = canvas.offsetWidth * window.devicePixelRatio;
-    canvas.height = canvas.offsetHeight * window.devicePixelRatio;
+
+  function initializeCanvas () {
+    const canvas = document.getElementById('canvas')
+    canvas.width = canvas.offsetWidth * window.devicePixelRatio
+    canvas.height = canvas.offsetHeight * window.devicePixelRatio
     canvas.style.background = 'linear-gradient(to bottom, rgb(10, 10, 50) 0%,rgb(60, 10, 60) 100%)'
     canvas.style.verticalAlign = 'middle'
     canvas.overflow = 'hidden'
-    let ctx = canvas.getContext("2d");
-  
+    let ctx = canvas.getContext('2d')
+
     window.addEventListener('onresize', () => {
-      canvas.width = canvas.offsetWidth * window.devicePixelRatio;
-      canvas.height = canvas.offsetHeight * window.devicePixelRatio;
+      canvas.width = canvas.offsetWidth * window.devicePixelRatio
+      canvas.height = canvas.offsetHeight * window.devicePixelRatio
       canvas.style.background = 'linear-gradient(to bottom, rgb(10, 10, 50) 0%,rgb(60, 10, 60) 100%)'
       canvas.style.verticalAlign = 'middle'
       canvas.overflow = 'hidden'
-      ctx = canvas.getContext("2d");
+      ctx = canvas.getContext('2d')
     })
-  
-    return [canvas, ctx];
+
+    return [canvas, ctx]
   }
-  
-  function startAnimation() {
-    const [canvas, ctx] = initializeCanvas();
-  
+
+  function startAnimation () {
+    const [canvas, ctx] = initializeCanvas()
+
     // Create a bunch of particles
     for (let i = 0; i < NUM_PARTICLES; i++) {
-      particles.push(createParticle(canvas));
+      particles.push(createParticle(canvas))
     }
-    
-    requestAnimationFrame((time) => draw(time, canvas, ctx));
+
+    requestAnimationFrame((time) => draw(time, canvas, ctx))
   };
-  
+
   // Start animation when document is loaded
   (function () {
     if (document.readystate !== 'loading') {
-      startAnimation();
+      startAnimation()
     } else {
       document.addEventListener('DOMContentLoaded', () => {
-        startAnimation();
+        startAnimation()
       })
     }
-  }());
-}
+  }())
+}

+ 100 - 100
src/utils/bg/bg4.js

@@ -1,108 +1,108 @@
-export function bgStart(){
-    //更新页面用requestAnimationFrame替代setTimeout
-    window.requestAnimationFrame = window.requestAnimationFrame 
-    || window.mozRequestAnimationFrame 
-    || window.webkitRequestAnimationFrame 
-    || window.msRequestAnimationFrame;
-    
-    var canvas = document.getElementById('canvas');
-    var ctx = canvas.getContext('2d');
-    
-    var w = canvas.width = canvas.offsetWidth;
-    var h = canvas.height = canvas.offsetHeight;
-    var circles = [];
-    var current_circle = new currentCircle(0, 0);
-    
-    function init(num) {
-      document.getElementById('userLayout').style.background='#333'
-      for(var i = 0; i < num; i ++) {
-        circles.push(new circle(Math.random() * w, Math.random() * h));
+export function bgStart () {
+  // 更新页面用requestAnimationFrame替代setTimeout
+  window.requestAnimationFrame = window.requestAnimationFrame ||
+    window.mozRequestAnimationFrame ||
+    window.webkitRequestAnimationFrame ||
+    window.msRequestAnimationFrame
+
+  var canvas = document.getElementById('canvas')
+  var ctx = canvas.getContext('2d')
+
+  var w = canvas.width = canvas.offsetWidth
+  var h = canvas.height = canvas.offsetHeight
+  var circles = []
+  var current_circle = new currentCircle(0, 0)
+
+  function init (num) {
+    document.getElementById('userLayout').style.background = '#333'
+    for (var i = 0; i < num; i++) {
+      circles.push(new circle(Math.random() * w, Math.random() * h))
+    }
+    draw()
+  }
+
+  function draw () {
+    ctx.clearRect(0, 0, w, h)
+    for (var i = 0; i < circles.length; i++) {
+      circles[i].move(w, h)
+      circles[i].drawCircle(ctx)
+      for (var j = i + 1; j < circles.length; j++) {
+        circles[i].drawLine(ctx, circles[j])
       }
-      draw();
     }
-    
-    function draw() {
-      ctx.clearRect(0, 0, w, h);
-      for(var i = 0; i < circles.length; i ++) {
-        circles[i].move(w, h);
-        circles[i].drawCircle(ctx);
-        for(var j = i + 1; j < circles.length; j++) {
-          circles[i].drawLine(ctx, circles[j]);
-        }
-      } 
-      if (current_circle.x) {
-        current_circle.drawCircle(ctx);
-        for (var k = 0; k < circles.length; k++) {
-          current_circle.drawLine(ctx, circles[k])
-        }
+    if (current_circle.x) {
+      current_circle.drawCircle(ctx)
+      for (var k = 0; k < circles.length; k++) {
+        current_circle.drawLine(ctx, circles[k])
       }
-      requestAnimationFrame(draw);
     }
-    
-    window.onmousemove = function(e) {
-      e = e || window.event;
-      current_circle.x = e.clientX;
-      current_circle.y = e.clientY;
+    requestAnimationFrame(draw)
+  }
+
+  window.onmousemove = function (e) {
+    e = e || window.event
+    current_circle.x = e.clientX
+    current_circle.y = e.clientY
+  }
+  window.onmouseout = function () {
+    current_circle.x = null
+    current_circle.y = null
+  }
+
+  // 创建对象:圆
+  // x, y为坐标点, r为半径, _mx, _my为移动的距离
+  function circle (x, y) {
+    this.x = x
+    this.y = y
+    this.r = Math.random() * 10
+    this._mx = 1 - (Math.random() * 2)
+    this._my = 1 - (Math.random() * 2)
+
+    // canvas画圆
+    this.drawCircle = drawCircle
+    function drawCircle (ctx) {
+      ctx.beginPath()
+      ctx.arc(this.x, this.y, this.r, 0, 360)
+      ctx.fillStyle = 'rgba(204, 204, 204, 0.3)'
+      ctx.fill()
     }
-    window.onmouseout = function() {
-      current_circle.x = null;
-      current_circle.y = null;
-     }
-    
-    //创建对象:圆
-    //x, y为坐标点, r为半径, _mx, _my为移动的距离
-    function circle(x, y) {
-      this.x = x;
-      this.y = y;
-      this.r = Math.random() * 10;
-      this._mx = 1 - (Math.random() * 2);
-      this._my = 1 - (Math.random() * 2);
-      
-      //canvas画圆
-      this.drawCircle = drawCircle;
-      function drawCircle(ctx) {
-        ctx.beginPath();
-        ctx.arc(this.x, this.y, this.r, 0, 360);
-        ctx.fillStyle = 'rgba(204, 204, 204, 0.3)';
-        ctx.fill();
-      }
-      
-      this.move = move;
-      function move(w, h) {
-        this._mx = (this.x < w && this.x > 0) ? this._mx : (-this._mx);
-        this._my = (this.y < h && this.y > 0) ? this._my : (-this._my);
-        this.x += this._mx / 2;
-        this.y += this._my / 2;
-      }
-      
-      //canvas画线
-      //画直线是两个圆连线,为了避免直线过多,给圆圈距离设置了一个值,距离很远的圆圈,就不做连线处理
-      this.drawLine = drawLine;
-      function drawLine(ctx, _circle) {
-        var dx = this.x - _circle.x;
-        var dy = this.y - _circle.y;
-        var d = Math.sqrt(dx * dx + dy * dy);
-        if (d < 150) {
-          ctx.beginPath();
-          ctx.moveTo(this.x, this.y);//起点
-          ctx.lineTo(_circle.x, _circle.y);//终点
-          ctx.strokeStyle = 'rgba(204, 204, 204, 0.3)';
-          ctx.stroke();
-        }
-      }
+
+    this.move = move
+    function move (w, h) {
+      this._mx = (this.x < w && this.x > 0) ? this._mx : (-this._mx)
+      this._my = (this.y < h && this.y > 0) ? this._my : (-this._my)
+      this.x += this._mx / 2
+      this.y += this._my / 2
     }
-    
-    function currentCircle(x, y) {
-      circle.call(this, x, y);
-      
-      this.drawCircle = drawCircle;
-      function drawCircle(ctx) {
-        ctx.beginPath();
-        ctx.arc(this.x, this.y, 8, 0, 360);
-        ctx.fillStyle = 'rgba(255, 77, 54, 0.6)';
-        ctx.fill();
+
+    // canvas画线
+    // 画直线是两个圆连线,为了避免直线过多,给圆圈距离设置了一个值,距离很远的圆圈,就不做连线处理
+    this.drawLine = drawLine
+    function drawLine (ctx, _circle) {
+      var dx = this.x - _circle.x
+      var dy = this.y - _circle.y
+      var d = Math.sqrt(dx * dx + dy * dy)
+      if (d < 150) {
+        ctx.beginPath()
+        ctx.moveTo(this.x, this.y)// 起点
+        ctx.lineTo(_circle.x, _circle.y)// 终点
+        ctx.strokeStyle = 'rgba(204, 204, 204, 0.3)'
+        ctx.stroke()
       }
     }
-    
-    init(100)
-}
+  }
+
+  function currentCircle (x, y) {
+    circle.call(this, x, y)
+
+    this.drawCircle = drawCircle
+    function drawCircle (ctx) {
+      ctx.beginPath()
+      ctx.arc(this.x, this.y, 8, 0, 360)
+      ctx.fillStyle = 'rgba(255, 77, 54, 0.6)'
+      ctx.fill()
+    }
+  }
+
+  init(100)
+}

+ 1 - 1
src/utils/util.js

@@ -70,4 +70,4 @@ export function oneOf (value, validList) {
     }
   }
   return false
-}
+}

+ 3 - 0
src/views/CardVoucherAuth/role/menuModal.vue

@@ -142,8 +142,10 @@ export default {
     isshow (newValue, oldValue) {
       if (newValue) {
         if (this.data) { // 编辑
+          console.log(this.data)
           this.treeData = this.data.allMenuList
           this.id = this.data.role.id
+
           this.roleName = '分配权限' + '(' + this.data.role.name + ')'
           if (this.data.role.menuIds) {
             const arr = this.data.role.menuIds.split(',')
@@ -155,6 +157,7 @@ export default {
             this.expandedKeys = temp
             // 找出叶子节点
             this.findLeaf(this.treeData, temp)
+            console.log(this.treeData, '-----梳妆')
           }
         }
       } else {

+ 18 - 26
src/views/CardVoucherAuth/role/roleList.vue

@@ -28,24 +28,23 @@
     <s-table
       ref="table"
       size="default"
-      rowKey="id"
+      :rowKey="(row)=>row.id"
       :columns="columns"
       :data="loadData"
       bordered
     >
       <span slot="status" slot-scope="text, record">
-        <a-switch checkedChildren="" unCheckedChildren="" v-model="record.isEnable" @change="changeFlagHandle(text, record)"/>
+        <a-switch checkedChildren="启用" unCheckedChildren="禁用" v-model="record.isEnable" @change="changeFlagHandle(text, record)"/>
       </span>
-
       <span slot="action" slot-scope="text, record">
-        <template>
-          <a class="action-button menu-text" @click="openMenuModal(record)">菜单权限</a>
-          <a class="action-button" @click="handleEdit(record)">修改</a>
-          <a v-if="!record.isEnable" class="action-button red-text" @click="delect(record)">删除</a>
-        </template>
+        <a class="action-button menu-text" @click="openMenuModal(record)">菜单权限</a>
+        <a class="action-button" @click="handleEdit(record)">修改</a>
+        <a v-if="!record.isEnable" class="action-button red-text" @click="delect(record)">删除</a>
       </span>
     </s-table>
+    <!-- 新增、编辑角色弹窗 -->
     <roleModal :visible="showModal" :data="itemData" @refresh="refreshTable" @close="showModal = false"></roleModal>
+    <!-- 菜单权限弹窗 -->
     <menuModal :visible="showMenuModal" :data="menuData" @close="showMenuModal = false"></menuModal>
   </a-card>
 </template>
@@ -79,33 +78,33 @@ export default {
           width: '40',
           align: 'center'
         },
+        {
+          title: '创建时间',
+          dataIndex: 'createDate',
+          minWidth: '100',
+          align: 'center'
+        },
         {
           title: '角色名称',
           dataIndex: 'name',
-          width: '100',
+          minWidth: '100',
           align: 'center'
         },
         {
           title: '角色描述',
           dataIndex: 'remarks',
-          width: '100',
+          minWidth: '100',
           align: 'center'
         },
         {
           title: '状态',
-          width: '100',
+          minWidth: '100',
           align: 'center',
           scopedSlots: { customRender: 'status' }
         },
-        {
-          title: '创建时间',
-          dataIndex: 'createDate',
-          width: '120',
-          align: 'center'
-        },
         {
           title: '操作',
-          width: '100',
+          minWidth: '100',
           align: 'center',
           scopedSlots: { customRender: 'action' }
         }
@@ -125,11 +124,6 @@ export default {
       optionAlertShow: false
     }
   },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-      // vm.$refs.table.refresh()
-    })
-  },
   methods: {
     // 刷新列表
     refreshTable () {
@@ -175,13 +169,11 @@ export default {
             id: row.id
           }).then(res => {
             if (res.status == 200) {
-              _this.$message.success('删除成功')
+              _this.$message.success(res.message)
               _this.$refs.table.refresh()
             } else {
               this.$message.error(res.message)
             }
-          }).catch(() => {
-            _this.$message.success('删除失败, 请稍后重试')
           })
         }
       })

+ 0 - 198
src/views/CardVoucherAuth/user/allStoreModal.vue

@@ -1,198 +0,0 @@
-<template>
-  <div>
-    <a-modal v-model="isShow" @cancel="cancel" title="选择关联门店" width="60%" >
-      <a-row :gutter="24">
-        <a-form class="form-box" :form="form" @submit="handleSubmit">
-          <!-- <a-card> -->
-          <a-col :span="8">
-            <a-tree
-              v-model="checkedKeys"
-              checkable
-              :expanded-keys="expandedKeys"
-              :auto-expand-parent="autoExpandParent"
-              :selected-keys="selectedKeys"
-              :tree-data="treeData"
-              @expand="onExpand"
-              @select="onSelect"
-            />
-          </a-col>
-          <a-col span="1" class="divider">
-          </a-col>
-          <a-col :span="15">
-            <a-table :columns="columns" :data-source="data" bordered >
-              <template slot="title" slot-scope="currentPageData">
-                新增门店
-              </template>
-              <span slot="action" slot-scope="text, record">
-                <a-button type="primary" @click="delect(record)" size="small">解绑</a-button>
-              </span>
-            </a-table>
-          </a-col>
-          <!-- </a-card> -->
-          <a-form-item class="footer" :wrapper-col="{ span: 24, offset: 12 }">
-            <a-button type="primary" @click="handleSubmit()">
-              保存
-            </a-button>
-            <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
-              取消
-            </a-button>
-          </a-form-item>
-        </a-form>
-      </a-row>
-    </a-modal>
-  </div>
-</template>
-
-<script>
-const treeData = [
-	  {
-	    title: '陕西区域',
-	    key: '0-0',
-	    children: [
-	      {
-	        title: '西安',
-	        key: '0-0-0',
-	        children: [
-	          { title: '东郊', key: '0-0-0-0', children: [{ title: '咸宁东路', key: '0-0-0-00' }] },
-	          { title: '西郊', key: '0-0-0-1', children: [{ title: '常青二路', key: '0-0-0-99' }] },
-	          { title: '南郊', key: '0-0-0-2', children: [{ title: '西部大道', key: '0-0-0-66' }] },
-			  { title: '北郊', key: '0-0-0-3' }
-	        ]
-	      },
-	      {
-	        title: '咸阳',
-	        key: '0-0-1',
-	        children: [
-	          { title: '东郊', key: '0-0-0-4' },
-	          { title: '西郊', key: '0-0-0-5' },
-	          { title: '南郊', key: '0-0-0-6' },
-	          { title: '北郊', key: '0-0-0-7' }
-	        ]
-	      },
-	      {
-	        title: '渭南',
-	        key: '0-0-2',
-        children: [
-			  { title: '东郊', key: '0-0-0-8' },
-			  { title: '西郊', key: '0-0-0-9' },
-			  { title: '南郊', key: '0-0-0-10' },
-			  { title: '北郊', key: '0-0-0-11' }
-        ]
-	      }
-	    ]
-	  },
-	  {
-	    title: '宁夏区域',
-	    key: '0-1',
-	    children: [
-	      { title: '0-1-0-0', key: '0-1-0-0' },
-	      { title: '0-1-0-1', key: '0-1-0-1' },
-	      { title: '0-1-0-2', key: '0-1-0-2' }
-	    ]
-	  },
-	  {
-	    title: '青海区域',
-	    key: '0-2'
-	  }
-]
-export default {
-  name: 'AllStoreModal',
-  props: {
-		  visible: {
-			  type: Boolean,
-			  default: false
-		 }
-  },
-  data () {
-    return {
-      isShow: this.visible,
-      expandedKeys: ['0-0-0', '0-0-1'],
-	        autoExpandParent: true,
-	        checkedKeys: ['0-0-0'],
-	        selectedKeys: [],
-	        treeData,
-      columns: [
-					  {
-					      title: '序号',
-					    dataIndex: 'no',
-					  minWidth: '100',
-					  align: 'center'
-					  },
-					  {
-					    title: '门店名称',
-					    dataIndex: 'storeName',
-					  minWidth: '100',
-					  align: 'center'
-					  },
-					  {
-					    title: '操作',
-					    key: '操作',
-					  minWidth: '100',
-					  align: 'center',
-					    scopedSlots: { customRender: 'action' }
-					  }
-      ],
-      data: [{
-					  storeName: '常青二路'
-      },
-      {
-					  storeName: '西部大道'
-      },
-      {
-					  storeName: '咸宁东路'
-      }]
-    }
-  },
-  methods: {
-	  cancel (e) {
-	    // this.clear()
-	    this.$emit('close')
-	  },
-	  onExpand (expandedKeys) {
-	        console.log('onExpand', expandedKeys)
-	        // if not set autoExpandParent to false, if children expanded, parent can not collapse.
-	        // or, you can remove all expanded children keys.
-	        this.expandedKeys = expandedKeys
-	        this.autoExpandParent = false
-	      },
-	      onCheck (checkedKeys) {
-	        console.log('onCheck', checkedKeys)
-	        this.checkedKeys = checkedKeys
-	      },
-	      onSelect (selectedKeys, info) {
-	        console.log('onSelect', info)
-	        this.selectedKeys = selectedKeys
-	      },
-		  // 保存
-		  handleSubmit () {
-    },
-    // 取消
-    handleCancel () {
-		  const _this = this
-		  this.$confirm({
-		    title: '提示',
-		    content: '确定取消吗?',
-		    okText: '确定',
-		    cancelText: '取消',
-		    onOk () {
-		      // _this.clear()
-		      _this.cancel()
-		    }
-		  })
-    }
-  },
-  watch: {
-    visible (newValue, oldValue) {
-	  this.isShow = newValue
-    },
-    isShow (newValue, oldValue) {
-    },
-    checkedKeys (val) {
-	      console.log('onCheck', val)
-	    }
-  }
-}
-</script>
-
-<style scoped>
-</style>

+ 230 - 0
src/views/CardVoucherAuth/user/newStoreModal.vue

@@ -0,0 +1,230 @@
+<template>
+  <a-modal v-model="isShow" @cancel="cancel" title="选择关联门店" width="60%">
+    <a-row :gutter="24">
+      <a-form class="form-box" :form="form" @submit="handleSubmit">
+        <a-col :span="10">
+          <a-tree
+            @check="onCheck"
+            @expand="onExpand"
+            @select="onSelect"
+            :expandedKeys="expandedKeys"
+            :autoExpandParent="autoExpandParent"
+            v-model="checkedKeys"
+            :treeData="treeData"
+          />
+        </a-col>
+        <a-col :span="14">
+          <a-table
+            :columns="columns"
+            :data-source="loadData"
+            :pagination="false"
+            bordered
+          >
+            <template slot="title" >
+              选择门店
+            </template>
+            <span slot="action" slot-scope="text, record">
+              <a-button type="danger" v-if="record.usedFlag == 1" @click="delect(record)" size="small">解绑</a-button>
+              <a-button type="primary" v-if="record.usedFlag == 0" @click="handleSubmit(record)" size="small">绑定</a-button>
+            </span>
+          </a-table>
+        </a-col>
+        <!-- <a-col :span="24">
+          <a-form-item class="footer" :wrapper-col="{ span: 24, offset: 12 }">
+            <a-button type="primary" @click="handleSubmit()">
+              保存
+            </a-button>
+            <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+              取消
+            </a-button>
+          </a-form-item>
+        </a-col> -->
+      </a-form>
+    </a-row>
+  </a-modal>
+</template>
+
+<script>
+import { findOrgTree } from '@/api/atorg.js'
+import { STable } from '@/components'
+import { getOrgUsedStoreList, saveNewUserStore, deleteUsedStore } from '@/api/card-voucher-user.js'
+export default {
+  name: 'NewStoreModal',
+  components: {
+    STable
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    ddId: {
+      type: String,
+      default: ''
+    }
+
+  },
+  data () {
+    return {
+      isShow: this.visible,
+      loadData: [],	// 列表数据
+      expandedKeys: [],	// 树节点
+      autoExpandParent: true,	// 自动展开父节点
+      checkedKeys: [],	// 选中的key值
+      checkedData: [],	// 选中的数据
+      treeData: [],		// 组织机构
+      orgId: '',	// 组织机构id
+      storeId: '', // 门店id
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'no',
+          minWidth: '100',
+          align: 'center'
+        },
+        {
+          title: '门店名称',
+          dataIndex: 'storeName',
+          minWidth: '100',
+          align: 'center'
+        },
+        {
+          title: '操作',
+          minWidth: '100',
+          align: 'center',
+          scopedSlots: {
+            customRender: 'action'
+          }
+        }
+      ]
+    }
+  },
+
+  methods: {
+    //  递归函数
+    recursionFun (data) {
+      if (data) {
+        data.map(item => {
+          if (item.children && item.children.length == 0) {
+            item.key = item.id ? 'org' + item.id : ''
+            item.value = item.id ? item.id : ''
+            item.title = item.name ? item.name : ''
+          } else {
+            item.key = item.id ? 'org' + item.id : ''
+            item.value = item.id ? item.id : ''
+            item.title = item.name ? item.name : ''
+            this.recursionFun(item.children)
+          }
+        })
+      }
+      return data
+    },
+    cancel (e) {
+      this.$emit('close')
+    },
+    onExpand (expandedKeys) {
+      // if not set autoExpandParent to false, if children expanded, parent can not collapse.
+      // or, you can remove all expanded children keys.
+      this.expandedKeys = expandedKeys
+      this.autoExpandParent = false
+    },
+    onCheck (checkedKeys, info) {
+      this.checkedData = [...checkedKeys, ...info.halfCheckedKeys]
+      this.checkedKeys = checkedKeys
+    },
+
+    onSelect (selectedKeys, info) {
+      this.selectedKeys = selectedKeys[0]
+      if (this.selectedKeys) {
+        this.orgId = this.selectedKeys.substring(3, this.selectedKeys.length)
+      }
+      this.getListData()
+    },
+    // 获取列表数据
+    getListData () {
+      getOrgUsedStoreList({ orgId: this.orgId }).then(res => {
+        if (res.status == 200) {
+          res.data.map((item, index) => {
+            item.no = index + 1
+          })
+          this.loadData = res.data
+        } else {
+          this.loadData = []
+        }
+      })
+    },
+    // 绑定
+    handleSubmit (record) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认给该督导绑定该门店?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          saveNewUserStore({ userId: _this.ddId, storeId: record.storeId }).then(res => {
+            if (res.status == 200) {
+              _this.getListData()
+              _this.$message.success(res.message)
+            } else {
+              _this.$message.error(res.message)
+            }
+          })
+        }
+      })
+    },
+    // 解绑
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        content: '解绑后数据无法恢复,确认解绑?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          deleteUsedStore({
+            id: row.id
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.getListData()
+            } else {
+              _this.$message.error(res.message)
+            }
+          })
+        }
+      })
+    }
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, { name: 'NewStoreModal' })
+  },
+  watch: {
+    checkedKeys (val) {
+      console.log('onCheck', val)
+    },
+    visible (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    isShow (newValue, oldValue) {
+      if (newValue) {
+        // 获取组织机构树的数据
+        findOrgTree().then(res => {
+          console.log(res, '---------------组织机构')
+          if (res.status == 200) {
+            this.treeData = this.recursionFun(res.data)
+            this.getListData()
+          } else {
+            this.treeData = []
+          }
+        })
+      } else {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+</style>

+ 0 - 120
src/views/CardVoucherAuth/user/storeModal.vue

@@ -1,120 +0,0 @@
-<template>
-  <div>
-    <a-modal v-model="isShow" @cancel="cancel" title="点检关联门店" width="45%">
-      <!-- 新增点检门店按钮 -->
-      <a-button type="primary" icon="plus" @click="openModal" style="margin-bottom: 20px;">新增门店</a-button>
-      <!-- 列表 -->
-      <a-table :columns="columns" :data-source="data" bordered>
-        <template slot="title" slot-scope="currentPageData">
-          已选门店
-        </template>
-        <span slot="action" slot-scope="text, record">
-          <a-button type="primary" @click="delect(record)" size="small">解绑</a-button>
-        </span>
-      </a-table>
-    </a-modal>
-    <!-- 新增点检门店弹窗 -->
-    <allStoreModal :visible="showAllStoreModal" :storeData="storeData" @close="showAllStoreModal=false"></allStoreModal>
-  </div>
-
-</template>
-
-<script>
-import { STable } from '@/components'
-import allStoreModal from './allStoreModal.vue'
-export default {
-  name: 'StoreModal',
-  components: {
-    STable,
-    allStoreModal
-  },
-  props: {
-		  visible: {
-			  type: Boolean,
-			  default: false
-		 }
-  },
-  data () {
-    return {
-      isShow: this.visible,
-	  showAllStoreModal: false,
-      storeData: [],
-	  columns: [
-	    {
-          title: '序号',
-	      dataIndex: 'no',
-		  minWidth: '100',
-		  align: 'center'
-	    },
-	    {
-	      title: '门店名称',
-	      dataIndex: 'storeName',
-		  minWidth: '100',
-		  align: 'center'
-	    },
-	    {
-	      title: '操作',
-	      key: '操作',
-		  minWidth: '100',
-		  align: 'center',
-	      scopedSlots: { customRender: 'action' }
-	    }
-	  ],
-	  data: [{
-	    storeName: '常青二路'
-	  },
-	  {
-	    storeName: '西部大道'
-	  },
-	  {
-	    storeName: '咸宁东路'
-	  }]
-    }
-  },
-  methods: {
-	  cancel (e) {
-	    // this.clear()
-	    this.$emit('close')
-	  },
-	  // 新增点检门店
-	  openModal () {
-		 this.showAllStoreModal = true
-	  },
-	  // 解绑门店
-	 delect (row) {
-	   const _this = this
-	   this.$confirm({
-	     title: '警告',
-	     content: '删除后无法恢复,确认删除?',
-	     okText: '确定',
-	     cancelText: '取消'
-	     // onOk () {
-	     //   delectUserPower({
-	     //     id: row.id
-	     //   }).then(res => {
-	     //     if (res.status == 200) {
-	     //       _this.$message.success('删除成功')
-	     //       _this.$refs.table.refresh()
-	     //     } else {
-	     //       _this.$message.error(res.message)
-	     //     }
-	     //   }).catch(() => {
-	     //     _this.$message.success('删除失败, 请稍后重试')
-	     //   })
-	     // }
-	   })
-	 }
-  },
-  watch: {
-    visible (newValue, oldValue) {
-	  this.isShow = newValue
-    },
-    isShow (newValue, oldValue) {
-    }
-  }
-}
-</script>
-
-<style>
-
-</style>

+ 141 - 0
src/views/CardVoucherAuth/user/usedStoreModal.vue

@@ -0,0 +1,141 @@
+<template>
+  <div>
+    <a-modal v-model="isShow" @cancel="cancel" title="点检关联门店" width="45%">
+      <!-- 新增点检门店按钮 -->
+      <a-button type="primary" icon="plus" @click="openModal" style="margin-bottom: 20px;">新增门店</a-button>
+      <!-- 列表 -->
+      <a-table :columns="columns" :data-source="loadData" :pagination="false" bordered>
+        <template slot="title" >
+          已选门店
+        </template>
+        <span slot="action" slot-scope="text, record">
+          <a-button type="primary" @click="delect(record)" size="small">解绑</a-button>
+        </span>
+      </a-table>
+    </a-modal>
+    <!-- 新增点检门店弹窗 -->
+    <newStoreModal :visible="showAllStoreModal" :ddId="userId" @close="closeModal"></newStoreModal>
+  </div>
+
+</template>
+
+<script>
+import { STable } from '@/components'
+import newStoreModal from './newStoreModal.vue'
+import { getUsedStoreList, deleteUsedStore } from '@/api/card-voucher-user.js'
+export default {
+  name: 'StoreModal',
+  components: {
+    STable,
+    newStoreModal
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    userId: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.visible,
+      showAllStoreModal: false,
+      ddId: '',
+      loadData: [],
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'no',
+          minWidth: '100',
+          align: 'center'
+        },
+        {
+          title: '门店名称',
+          dataIndex: 'storeName',
+          minWidth: '100',
+          align: 'center'
+        },
+        {
+          title: '操作',
+          key: '操作',
+          minWidth: '100',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ]
+    }
+  },
+  methods: {
+	  // 关闭弹窗事件
+	  closeModal () {
+      this.showAllStoreModal = false
+	  this.getListData(this.userId)
+	  },
+    // 获取已选列表数据
+    getListData (id) {
+      getUsedStoreList({ userId: id }).then(res => {
+        if (res.status == 200) {
+          res.data.map((item, index) => {
+            item.no = index + 1
+          })
+          this.loadData = res.data
+        }
+      })
+    },
+    cancel (e) {
+      // this.clear()
+      this.$emit('close')
+    },
+    // 新增点检门店
+    openModal () {
+      this.showAllStoreModal = true
+      this.ddId = this.userId
+    },
+    // 解绑门店
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        content: '删除后无法恢复,确认删除?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          deleteUsedStore({
+            id: row.id
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.getListData()
+            } else {
+              _this.$message.error(res.message)
+            }
+          })
+        }
+      })
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    isShow (val) {
+      if (!val) {
+        this.$emit('close')
+      }
+    },
+    userId (newValue, oldValue) {
+      console.log(newValue)
+      if (newValue && this.isShow) {
+        this.getListData(newValue)
+      }
+    }
+  }
+}
+</script>
+
+<style>
+
+</style>

+ 117 - 151
src/views/CardVoucherAuth/user/userList.vue

@@ -5,17 +5,17 @@
         <a-row :gutter="48">
           <a-col :md="6" :sm="24">
             <a-form-item label="员工姓名">
-              <a-input allowClear v-model.trim="queryParam.name" @pressEnter="$refs.table.refresh(true)" placeholder="请输入员工姓名" />
+              <a-input allowClear v-model.trim="queryParam.name" id="userList-name" @pressEnter="$refs.table.refresh(true)" placeholder="请输入员工姓名" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="手机号码">
-              <a-input allowClear v-model.trim="queryParam.phone" @pressEnter="$refs.table.refresh(true)" placeholder="请输入手机号码" />
+              <a-input allowClear v-model.trim="queryParam.phone" id="userList-phone" @pressEnter="$refs.table.refresh(true)" placeholder="请输入手机号码" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="状态">
-              <v-select code="CHECK_ENABLE_STATE" v-model="queryParam.loginFlag" allowClear placeholder="请选择状态"></v-select>
+              <v-select code="DEVICE_STATUS" id="userList-loginFlag" v-model="queryParam.loginFlag" allowClear placeholder="请选择状态"></v-select>
             </a-form-item>
           </a-col>
           <a-col :md="4" :sm="24" class="flex-sp">
@@ -29,31 +29,16 @@
     <div class="table-operator">
       <a-button type="primary" icon="plus" @click="openModal">新建</a-button>
     </div>
-    <!-- <s-table
+    <s-table
+      :columns="columns"
+      :data="loadData"
       ref="table"
       size="default"
       rowKey="id"
-      :columns="columns"
-      :data="loadData"
       bordered>
-      <span slot="status" slot-scope="text, record">
-        <a-switch checkedChildren="启用" unCheckedChildren="禁用" v-model="record.loginFlag" @change="changeFlagHandle(text, record)" />
-      </span>
-      <div slot="roleNames" slot-scope="text, record" :title="record.roleNames">
-        <span v-if="record.roleNames">{{ record.roleNames.substr(0,12) + '...' }}</span>
-        <span v-else>无</span>
-      </div>
-      <span slot="action" slot-scope="text, record">
-        <template>
-          <div>
-            <a class="action-button" @click="handleEdit(record)">修改</a>
-            <a v-if="record.loginFlag" class="action-button reset-text" @click="resetPassword(record)">重置密码</a>
-            <a v-if="!record.loginFlag" class="action-button red-text" @click="delect(record)">删除</a>
-          </div>
-        </template>
-      </span>
-    </s-table> -->
-    <a-table :columns="columns" :data-source="data" bordered>
+      <template slot="loginFlag" slot-scope="text">
+        <span :style="{ color: text == '1' ? '#12b512' : 'red' }">{{ text == '1' ? '已启用' : '已禁用' }}</span>
+      </template>
       <span slot="action" slot-scope="text, record">
         <!-- 点检关联门店 -->
         <a-tooltip placement="bottom">
@@ -72,7 +57,7 @@
           <template slot="title">
             <span>重置密码</span>
           </template>
-          <a-icon type="unlock" style="font-size: 20px;color: #08c0de;padding: 0 10px;"/>
+          <a-icon type="unlock" style="font-size: 20px;color: #08c0de;padding: 0 10px;"	@click="resetPassword(record)" />
         </a-tooltip>
         <a-tooltip placement="bottom">
           <template slot="title">
@@ -81,11 +66,11 @@
           <a-icon type="delete" style="font-size: 20px;color: red;padding: 0 10px;" @click="delect(record)" />
         </a-tooltip>
       </span>
-    </a-table>
+    </s-table>
     <!-- 新增用户弹窗 -->
     <userModal :visible="showModal" @refresh="$refs.table.refresh(true)" :data="itemData" @close="showModal = false"></userModal>
-    <!-- 点检门店弹窗 -->
-    <storeModal :visible="showStoreModal" @close="showStoreModal=false"></storeModal>
+    <!-- 点检门店弹窗 已选门店 -->
+    <usedStoreModal :visible="showStoreModal" :userId="userId" @close="showStoreModal=false"></usedStoreModal>
   </a-card>
 </template>
 
@@ -95,20 +80,19 @@ import {
   VSelect
 } from '@/components'
 import userModal from './userModal.vue'
-import storeModal from './storeModal.vue'
-// import {
-//   resetPSD,
-//   // updateEnableStatus,
-//   getPowerUserList,
-//   delectUserPower
-// } from '@/api/card-voucher-user.js'
+import usedStoreModal from './usedStoreModal.vue'
+import {
+  resetPSD,
+  getPowerUserList,
+  delectUserPower
+} from '@/api/card-voucher-user.js'
 export default {
   name: 'UserList',
   components: {
     STable,
     VSelect,
     userModal,
-    storeModal
+    usedStoreModal
   },
   data () {
     return {
@@ -119,87 +103,72 @@ export default {
         loginFlag: ''
       },
       showModal: false,
-	  showStoreModal: false,
+      showStoreModal: false,
       itemData: {}, // 编辑行数据
-	  columns: [
-	    {
-          title: '序号',
-	      dataIndex: 'no',
-		  minWidth: '100',
-		  align: 'center'
-	    },
-	    {
-	      title: '创建时间',
-	      dataIndex: 'createDate',
-		  minWidth: '100',
-		  align: 'center'
-	    },
-	    {
-	      title: '员工姓名',
-	      dataIndex: 'name',
-		  minWidth: '100',
-		  align: 'center'
-	    },
-	    {
-	      title: '手机号码',
-	      dataIndex: 'phone',
-		  minWidth: '100',
-		  align: 'center'
-	    },
-        {
-		  title: '角色',
-		  dataIndex: 'userType',
-		  minWidth: '100',
-		  align: 'center'
-        },
-        {
-		  title: '启用状态',
-		  dataIndex: 'status',
-		  minWidth: '100',
-		  align: 'center'
-        },
-	    {
-	      title: '操作',
-	      dataIndex: 'action',
-		  minWidth: '100',
-		  align: 'center',
-	      scopedSlots: { customRender: 'action' }
-	    }
-	  ],
-	  data: [{
-        key: '1',
-        name: 'John Brown',
-        age: 32,
-        address: 'New York No. 1 Lake Park',
-        tags: ['nice', 'developer']
+      userId: '', // 用户id
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        minWidth: '100',
+        align: 'center'
+      },
+      {
+        title: '创建时间',
+        dataIndex: 'createDate',
+        minWidth: '100',
+        align: 'center'
+      },
+      {
+        title: '员工姓名',
+        dataIndex: 'name',
+        minWidth: '100',
+        align: 'center'
+      },
+      {
+        title: '手机号码',
+        dataIndex: 'phone',
+        minWidth: '100',
+        align: 'center'
+      },
+      {
+        title: '角色',
+        dataIndex: 'roleNames',
+        minWidth: '100',
+        align: 'center'
       },
       {
-        key: '2',
-        name: 'Jim Green',
-        age: 42,
-        address: 'London No. 1 Lake Park',
-        tags: ['loser']
+        title: '启用状态',
+        dataIndex: 'loginFlag',
+        minWidth: '100',
+        align: 'center',
+        scopedSlots: {
+		  customRender: 'loginFlag'
+        }
       },
       {
-        key: '3',
-        name: 'Joe Black',
-        age: 32,
-        address: 'Sidney No. 1 Lake Park',
-        tags: ['cool', 'teacher']
-      }],
+        title: '操作',
+        dataIndex: 'action',
+        minWidth: '100',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
       // 加载数据方法 必须为 Promise 对象
-      // loadData: parameter => {
-      //   return getPowerUserList(Object.assign(parameter, this.queryParam)).then(res => {
-      //   //   const no = (res.data.pageNo - 1) * res.data.pageSize
-      //   //   for (let i = 0; i < res.data.list.length; i++) {
-      //   //     const _item = res.data.list[i]
-      //   //     _item.no = no + i + 1
-      //   //     _item.loginFlag = _item.loginFlag + '' === '1'
-      //   //   }
-      //     return res.data
-      //   })
-      // },
-      // optionAlertShow: false
+      loadData: parameter => {
+        return getPowerUserList(Object.assign(parameter, this.queryParam)).then(res => {
+          const no = (res.data.pageNo - 1) * res.data.pageSize
+          for (let i = 0; i < res.data.list.length; i++) {
+            const _item = res.data.list[i]
+            _item.no = no + i + 1
+            // _item.loginFlag = _item.loginFlag + '' === '1'
+          }
+          res.data.count = Number(res.data.count)
+          return res.data
+        })
+      },
+      optionAlertShow: false
     }
   },
   methods: {
@@ -224,43 +193,39 @@ export default {
     // 选择点检门店
     selectStore (row) {
       this.showStoreModal = true
+	  this.userId = row.id
       console.log('wobeidianjile')
     },
     // 重置密码
     resetPassword (row) {
-      // resetPSD({
-      //   id: row.id
-      // }).then(res => {
-      //   if (res.status == 200) {
-      //     this.$message.success('密码重置成功')
-      //   } else {
-      //     this.$message.error(res.message)
-      //   }
-      // }).catch(() => {
-      //   this.$message.success('密码重置失败, 请稍后重试')
-      // })
+      resetPSD({
+        id: row.id
+      }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+        } else {
+          this.$message.error(res.message)
+        }
+      })
     },
     // 删除
     delect (row) {
-      const _this = this
       this.$confirm({
         title: '警告',
-        content: '删除后无法恢复,确认删除?',
+        content: '删除后数据无法恢复,确认删除?',
         okText: '确定',
         cancelText: '取消',
         onOk () {
-        //   delectUserPower({
-        //     id: row.id
-        //   }).then(res => {
-        //     if (res.status == 200) {
-        //       _this.$message.success('删除成功')
-        //       _this.$refs.table.refresh()
-        //     } else {
-        //       _this.$message.error(res.message)
-        //     }
-        //   }).catch(() => {
-        //     _this.$message.success('删除失败, 请稍后重试')
-        //   })
+          delectUserPower({
+            id: row.id
+          }).then(res => {
+            if (res.status == 200) {
+              this.$message.success(res.message)
+              this.refreshTable()
+            } else {
+              this.$message.error(res.message)
+            }
+          })
         }
       })
     },
@@ -275,22 +240,23 @@ export default {
     handleEdit (row) {
       this.showModal = true
       this.itemData = row
-    },
-    // 修改状态
-    changeFlagHandle (text, record) {
-      const _data = {
-        id: record.id,
-        flag: record.loginFlag ? '1' : '0'
-      }
-      // updateEnableStatus(_data).then(res => {
-      //   if (res.status + '' === '200') {
-      //     this.$message.success('修改成功')
-      //   } else {
-      //     this.$message.error(res.message)
-      //     record.loginFlag = !record.loginFlag
-      //   }
-      // })
+	  console.log(this.itemData)
     }
+    // 修改状态
+    // changeFlagHandle (text, record) {
+    //   const _data = {
+    //     id: record.id,
+    //     flag: record.loginFlag ? '1' : '0'
+    //   }
+    //   // updateEnableStatus(_data).then(res => {
+    //   //   if (res.status + '' === '200') {
+    //   //     this.$message.success('修改成功')
+    //   //   } else {
+    //   //     this.$message.error(res.message)
+    //   //     record.loginFlag = !record.loginFlag
+    //   //   }
+    //   // })
+    // }
   }
 }
 </script>

+ 118 - 114
src/views/CardVoucherAuth/user/userModal.vue

@@ -8,9 +8,11 @@
             <a-form-item label="员工姓名" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 placeholder="请输入员工姓名"
+                id="userModal-name"
                 v-decorator="['formData.name', {
                   initialValue: formData.name,
-                  rules: [{ required: true, message: '请输入员工姓名!' },{pattern:'^[^<|>]{1,20}$',message:'请输入不含<或>的字符,最多20个字符'}] }]" />
+                  rules: [{ required: true, message: '请输入员工姓名!' },{pattern:'^[^<|>]{1,20}$',message:'请输入不含<或>的字符,最多20个字符'}] }]"
+                allowClear/>
             </a-form-item>
           </a-col>
           <a-col :span="12">
@@ -18,9 +20,11 @@
             <a-form-item label="手机号码" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 placeholder="请输入手机号码"
+                id="userModal-phone"
                 v-decorator="['formData.phone', {
                   initialValue: formData.phone,
-                  rules: [{ required: true, message: '请输入手机号码!' },{pattern:/^[1][0-9]{10}$/, message: '请输入正确的手机号码!'}] }]" />
+                  rules: [{ required: true, message: '请输入手机号码!' },{pattern:/^[1][0-9]{10}$/, message: '请输入正确的手机号码!'}] }]"
+                allowClear/>
             </a-form-item>
           </a-col>
         </a-row>
@@ -30,6 +34,8 @@
             <a-form-item label="性别" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <v-select
                 code="SEX"
+                id="userModal-sex"
+                placeholder="请选择性别"
                 v-decorator="[
                   'formData.sex',
                   {
@@ -40,54 +46,20 @@
 
             </a-form-item>
           </a-col>
-          <!-- 状态 -->
+          <!-- 角色 -->
           <a-col :span="12">
-            <a-form-item label="状态" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-              <a-radio-group
-                name="radioGroup"
-                v-decorator="[
-                  'formData.loginFlag',
-                  {
-                    initialValue: formData.loginFlag,
-                    rules: [{ required: true, message: '请选择状态!' }] },
-                ]">
-                <a-radio :value="1">是</a-radio>
-                <a-radio :value="0">否</a-radio>
-              </a-radio-group>
-
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <!-- <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-item label="角色" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
+            <a-form-item label="角色" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-select
+                id="userModal-roleNames"
                 v-decorator="[
                   'formData.roleNames',
                   {
                     initialValue: formData.roleNames,
-                    rules: [{ required: true, message: '请选择状态!' }] },
+                    rules: [{ required: true, message: '请选择角色!' }] },
                 ]"
-                mode="multiple"
                 style="width: 100%"
-                placeholder="请选择角色">
-                <a-select-option v-for="item in roleList" :key="item.id" :disabled="item.isEnable == '0' ? true : false">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-        </a-row> -->
-        <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-item label="所属机构" :label-col="{ span:4 }" :wrapper-col="{ span: 20 }">
-              <!-- <a-select
-                v-decorator="[
-                  'formData.roleNames',
-                  {
-                    initialValue: formData.roleNames,
-                    rules: [{ required: true, message: '请选择所属机构!' }] },
-                ]"
-                style="width: 100%"
-                placeholder="请选择所属机构"
+                placeholder="请选择角色"
+                mode="multiple"
               >
                 <a-select-option
                   v-for="item in roleList"
@@ -95,15 +67,49 @@
                   :disabled="item.isEnable == '0' ? true : false"
                 >{{ item.name }}</a-select-option
                 >
-              </a-select>-->
+              </a-select>
+
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-model-item class="form-label" label="所属机构" prop="orgCode" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-tree-select
-                v-model="value"
+                id="userModal-orgCode"
+                v-model="formData.orgCode"
+                allowClear
                 style="width: 100%"
+                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                 :tree-data="treeData"
-                tree-checkable
-                :show-checked-strategy="SHOW_ALL"
-                search-placeholder="Please select"
-              />
+                placeholder="请选择所属机构"
+                treeNodeFilterProp="title"
+                @change="treeChange"
+                v-decorator="[
+                  'formData.orgCode',
+                  {
+                    initialValue: formData.orgCode,
+                    rules: [{ required: true, message: '请选择所属机构!' }] },
+                ]">
+              </a-tree-select>
+            </a-form-model-item>
+          </a-col>
+          <!-- 状态 -->
+          <a-col :span="12">
+            <a-form-item label="状态" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+              <a-radio-group
+                id="userModal-loginFlag"
+                name="radioGroup"
+                v-decorator="[
+                  'formData.loginFlag',
+                  {
+                    initialValue: formData.loginFlag,
+                    rules: [{ required: true, message: '请选择状态!' }] },
+                ]">
+                <a-radio :value="1" id="userModal-loginFlag">是</a-radio>
+                <a-radio :value="0" id="userModal-loginFlag">否</a-radio>
+              </a-radio-group>
+
             </a-form-item>
           </a-col>
         </a-row>
@@ -123,62 +129,27 @@
 <script>
 import {
   STable,
-  VSelect
-} from '@/components'
+  VSelect,
+  Tree } from '@/components'
 import {
-  getRoleList,
   saveUserPower
 } from '@/api/card-voucher-user.js'
-import { TreeSelect } from 'ant-design-vue'
-const SHOW_ALL = TreeSelect.SHOW_ALL
-const treeData = [
-  {
-    title: 'Node1',
-    value: '0-0',
-    key: '0-0',
-    children: [
-      {
-        title: 'Child Node1',
-        value: '0-0-0',
-        key: '0-0-0'
-      }
-    ]
-  },
-  {
-    title: 'Node2',
-    value: '0-1',
-    key: '0-1',
-    children: [
-      {
-        title: 'Child Node3',
-        value: '0-1-0',
-        key: '0-1-0',
-        disabled: true
-      },
-      {
-        title: 'Child Node4',
-        value: '0-1-1',
-        key: '0-1-1'
-      },
-      {
-        title: 'Child Node5',
-        value: '0-1-2',
-        key: '0-1-2'
-      }
-    ]
-  }
-]
+import { getAllRole } from '@/api/card-voucher-role.js'
+import { findOrgTree } from '@/api/atorg.js'
 export default {
   name: 'UserModal',
   components: {
     STable,
-    VSelect
+    VSelect,
+    Tree
   },
   props: {
+    // 弹窗是否显示
     visible: {
       type: Boolean,
       default: false
     },
+    // 编辑督导的数据
     data: {
       type: Object,
       default: function () {
@@ -194,36 +165,72 @@ export default {
       form: this.$form.createForm(this, {
         name: 'miniForm'
       }),
-      roleList: [],
+      roleList: [],	// 角色
+	  parentCodePaths: '', // 组织机构父路径
+	  orgCode: '',	// 组织机构
       formData: {
-        roleNames: undefined, // 角色
-        name: '',
-        loginFlag: '', // 活动状态
-        phone: '',
-        sex: '',
-        remarks: ''
+        orgCode: null,
+        name: '',	// 员工姓名
+        loginFlag: '', // 状态
+        phone: '',	// 手机号码
+        sex: '',	// 性别
+        roleNames: undefined	// 角色
       },
-	  value: ['0-0-0'],
-	  treeData,
-      SHOW_ALL
+      treeData: []
 
     }
   },
   methods: {
-
     cancel (e) {
       this.clear()
       this.$emit('close')
     },
+    // 获取组织机构树的数据
+    getOrgData () {
+      findOrgTree().then(res => {
+        if (res.status == 200) {
+          this.treeData = this.recursionFun(res.data)
+        } else {
+          this.treeData = []
+        }
+      })
+    },
+    //  组织归属  change
+    treeChange (value, label, extra) {
+	  this.parentCodePaths = extra.triggerNode.$options.propsData.dataRef.parentCodePaths
+    },
+    //  递归函数
+    recursionFun (data) {
+      if (data) {
+        data.map(item => {
+          if (item.children && item.children.length == 0) {
+            item.key = item.id ? 'org' + item.id : ''
+            item.value = item.id ? item.id : ''
+            item.title = item.name ? item.name : ''
+          } else {
+            item.key = item.id ? 'org' + item.id : ''
+            item.value = item.id ? item.id : ''
+            item.title = item.name ? item.name : ''
+            this.recursionFun(item.children)
+          }
+        })
+      }
+      return data
+    },
     // 保存提交
     handleSubmit () {
       const _this = this
       this.form.validateFields((err, values) => {
+		  // console.log(values)
         if (!err) {
-          // values.formData.roleNames = values.formData.roleNames.join(',')
+          values.formData.roleNames = values.formData.roleNames.join(',')
+          // values.formData.org.id = values.orgCode
+		  const formData = JSON.parse(JSON.stringify(values.formData))
+		  formData.org = { id: formData.orgCode }
+		  delete formData.orgCode
           saveUserPower(Object.assign({
             id: this.data.id ? this.data.id : ''
-          }, values.formData)).then(res => {
+          }, formData)).then(res => {
             if (res.status == 200) {
               this.$message.success(res.message ? res.message : '保存成功')
               this.$emit('refresh')
@@ -254,16 +261,16 @@ export default {
     clear () {
       this.form.resetFields()
       delete this.formData.id
-      this.formData.roleNames = []
+      this.formData.orgCode = '' // 所属机构
       this.formData.name = ''
       this.formData.loginFlag = ''
       this.formData.phone = ''
       this.formData.sex = ''
-      this.formData.remarks = ''
+      this.formData.roleNames = []
     },
     // 获取角色列表接口
-    getRoleList () {
-      getRoleList().then(res => {
+    getRoleData () {
+      getAllRole().then(res => {
         if (res.status == 200) {
           this.roleList = res.data
         } else {
@@ -272,9 +279,6 @@ export default {
       })
     }
   },
-  // mounted () {
-  //   this.getRoleList()
-  // },
   beforeCreate () {
     this.form = this.$form.createForm(this, {
       name: 'miniForm'
@@ -286,7 +290,10 @@ export default {
     },
     isshow (newValue, oldValue) {
       if (newValue) {
+        this.getOrgData()
+        this.getRoleData()
         if (this.data.id) { // 编辑
+          console.log(this.data.id)
           this.titleText = '编辑用户'
           this.formData = Object.assign({}, this.data)
           delete this.formData.no
@@ -306,7 +313,6 @@ export default {
           } else {
             this.formData.roleNames = []
           }
-
           this.formData.loginFlag = Number(this.formData.loginFlag)
         } else {
           this.titleText = '添加用户'
@@ -320,8 +326,6 @@ export default {
 </script>
 
 <style>
-	.modalBox {}
-
 	.ant-modal-footer {
 		display: none;
 	}

+ 1 - 1
src/views/Home.vue

@@ -13,7 +13,7 @@ export default {
   },
   created () {
   },
-  methods: { 
+  methods: {
   }
 }
 </script>

+ 3 - 3
src/views/evaluation/evaluationItem/AddEvaIndexModal.vue

@@ -8,7 +8,7 @@
             <a-form-item label="考评指标名称:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
               <a-input
                 allowClear
-				id="addEvaIndexModal-name"
+                id="addEvaIndexModal-name"
                 :maxLength="128"
                 v-decorator="[
                   'formData.name',
@@ -110,7 +110,7 @@ export default {
       const _this = this
       this.form.validateFields((err, values) => {
         if (!err) {
-			this.loading = true
+          this.loading = true
           const params = this.itemIndexId ? Object.assign({ assessItemId: this.itemId, id: this.itemIndexId }, values.formData) : Object.assign({ assessItemId: this.itemId }, values.formData)
           // console.log(params, 'ppppppppppppp')
           itemIndexSave(params).then(res => {
@@ -124,7 +124,7 @@ export default {
             } else {
               // this.$message.warning(res.message)
             }
-			this.loading = false
+            this.loading = false
           })
         }
       })

+ 1 - 1
src/views/evaluation/evaluationPlan/AddEvaModal.vue

@@ -26,7 +26,7 @@
             <a-form-item label="适用模式:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
               <v-select
                 ref="orgType"
-				id="addEvaModal-scopeType"
+                id="addEvaModal-scopeType"
                 allowClear
                 mode="multiple"
                 @change="scopeTypeChange"