Browse Source

合并代码

newStyle
风继续吹 1 year ago
parent
commit
c3a301aca4
6 changed files with 80 additions and 15 deletions
  1. +3
    -2
      src/main.js
  2. +63
    -0
      src/util/function.js
  3. +1
    -3
      src/views/Receive/index.vue
  4. +6
    -3
      src/views/Template/Pinspeakwords.vue
  5. +6
    -6
      src/views/building/table.js
  6. +1
    -1
      src/views/houseData/analyse.vue

+ 3
- 2
src/main.js View File

@@ -21,7 +21,10 @@ import basicContainer from './components/basic-container/main'
import api from './api'
import AvueUeditor from 'avue-plugin-ueditor'
import './util/indexedDb/index'
import functions from './util/function'

//全局防抖函数
Vue.use(functions)
Vue.use(AvueUeditor);

import VueQuillEditor from 'vue-quill-editor' //vue-quill-editor其它文件可在应用页面直接引入
@@ -75,8 +78,6 @@ iconfontVersion.forEach(ele => {

Vue.config.productionTip = false
import APlayer from '@moefe/vue-aplayer';


Vue.use(APlayer, {
productionTip: true,
});


+ 63
- 0
src/util/function.js View File

@@ -0,0 +1,63 @@
let timeout = null
let timer, flag
/**
* 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
*
* @param {Function} func 要执行的回调函数
* @param {Number} wait 延时的时间
* @param {Boolean} immediate 是否立即执行
* @return null
*/
function debounce(func, params, wait = 1000, immediate = false) {
// 清除定时器
if (timeout !== null) clearTimeout(timeout)
// 立即执行,此类情况一般用不到
if (immediate) {
var callNow = !timeout
timeout = setTimeout(function () {
timeout = null
}, wait)
if (callNow) typeof func === 'function' && func(params)
} else {
// 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
timeout = setTimeout(function () {
typeof func === 'function' && func(params)
}, wait)
}
}
/**
* 节流原理:在一定时间内,只能触发一次
*
* @param {Function} func 要执行的回调函数
* @param {Number} wait 延时的时间
* @param {Boolean} immediate 是否立即执行
* @return null
*/
function throttle(func, params, wait = 500, immediate = true,) {
if (immediate) {
if (!flag) {
flag = true
// 如果是立即执行,则在wait毫秒内开始时执行
typeof func === 'function' && func(params)
timer = setTimeout(() => {
flag = false
}, wait)
}

} else {
if (!flag) {
flag = true
// 如果是非立即执行,则在wait毫秒内的结束处执行
timer = setTimeout(() => {
flag = false
typeof func === 'function' && func(params)
}, wait)
}
}
}
export default {
install(Vue) {
Vue.prototype.$debounce = debounce
Vue.prototype.$throttle = throttle
}
}

+ 1
- 3
src/views/Receive/index.vue View File

@@ -2771,10 +2771,8 @@ export default {
}

.mydesc {
position: absolute;
position: sticky;
bottom: 0;
left: 0;
right: 0;
padding: 0 10px;
height: 40px;
border-top: 1px solid #ccc;


+ 6
- 3
src/views/Template/Pinspeakwords.vue View File

@@ -315,7 +315,7 @@
style="margin-left: 30px"
type="primary"
size="mini"
@click="submitForm"
@click="$debounce(submitForm)"
>保存</el-button
>
</div>
@@ -436,6 +436,7 @@ export default {
.findByRepetitionName({
name: this.inparams.templateName,
houseId: this.houseId,
tempId: this.Templateid,
})
.then((res) => {
if (res.code != 0) {
@@ -778,6 +779,7 @@ export default {
window.history.back();
},
submitForm() {
console.log('q23e')
let list = this.newlist;

if (list.length == 0) {
@@ -963,11 +965,12 @@ export default {
});
return;
}

this.saveRate(params);
this.saveRate(params)
},
// 评分保存 新增模板
saveRate(params) {
console.log('调用')

// if(!params.templateName) {
// this.$message({


+ 6
- 6
src/views/building/table.js View File

@@ -226,12 +226,12 @@ export default {
minWidth: '100px',
sortable: true,
},
{
label: "活跃顾问",
prop: "activeAccount",
minWidth: '100px',
sortable: true,
},
// {
// label: "活跃顾问",
// prop: "activeAccount",
// minWidth: '100px',
// sortable: true,
// },
{
label: "接待量",
prop: "sumReception",


+ 1
- 1
src/views/houseData/analyse.vue View File

@@ -107,7 +107,7 @@
</div>
<div class="jinbox-box">
<div class="boxbaifenbi"
:style="{ 'background': i + 1 == 1 ? 'linear-gradient(270deg, #F88881 0%, #E6625B 100%)' : i + 1 == 2 ? 'linear-gradient(270deg, #FFC940 0%, #FF981E 100%)' : i + 1 == 3 ? 'linear-gradient(270deg, #FFE800 0%, #FFCC00 100%)' : 'inear-gradient(270deg, #7BB1FF 0%, #618FFF 100%)', 'width': item.zxl1 + '%' }">
:style="{ 'background': i + 1 == 1 ? 'linear-gradient(270deg, #F88881 0%, #E6625B 100%)' : i + 1 == 2 ? 'linear-gradient(270deg, #FFC940 0%, #FF981E 100%)' : i + 1 == 3 ? 'linear-gradient(270deg, #FFE800 0%, #FFCC00 100%)' : 'inear-gradient(270deg, #7BB1FF 0%, #618FFF 100%)', 'width': (item.zxl1||0) + '%' }">
</div>
</div>
<div class="jinboxbott">{{ item.zxl }}</div>


Loading…
Cancel
Save