Commit 659e4ebb by crushh

update: dist

parent fb421d8e
......@@ -8,7 +8,7 @@ import App from './App.vue';
import router from './router';
import { isRequest } from '@/config';
import filters from '@/filters';
import { scrollToError } from '@/utils';
// 复制粘贴
import VueClipboard from 'vue-clipboard2';
Vue.use(VueClipboard);
......@@ -16,7 +16,7 @@ axios.defaults.headers.common = Object.assign(axios.defaults.headers.common, isR
axios.defaults.withCredentials = true;
Vue.config.productionTip = false;
Vue.prototype.axios = axios;
Vue.prototype.scrollToError = scrollToError;
// 开启vue devtools.....
/* eslint-disable-next-line */
Vue.config.devtools = process.env.NODE_ENV !== 'production';
......
......@@ -28,3 +28,21 @@ export function getFirstMenu(list) {
};
return travel(list);
}
/** 表单校验滚动到第一个错误项
* @param {Object} that vue实例
* this.scrollToError(this);
*/
export const scrollToError = that => {
that.$nextTick(_ => {
const isError = document.getElementsByClassName('is-error');
isError[0].scrollIntoView({
// 滚动到指定节点
// 值有start,center,end,nearest,当前显示在视图区域中间
block: 'center',
// 值有auto、instant,smooth,缓动动画(当前是慢速的)
behavior: 'smooth'
});
});
};
......@@ -27,7 +27,7 @@
</template>
</el-table-column>
<el-table-column label="模板名称" min-width="290px" prop="templateName"> </el-table-column>
<el-table-column label="展示数量" min-width="310px" prop="prizeMax"> </el-table-column>
<el-table-column label="展示数量" min-width="310px" prop="viewPrize"> </el-table-column>
<el-table-column label="模板状态" min-width="306px" prop="statusFlag">
<template slot-scope="{ row }">
<el-switch v-model="row.statusFlag" @change="handleSwitch(row.statusFlag, row.templateId)" :active-value="1" :inactive-value="0"></el-switch>
......@@ -101,6 +101,8 @@ export default {
}).then(() => {
fetch.updateTemplateStatus({ statusFlag, templateId }).then((res) => {
this.getList();
}).catch(_=>{
this.list.filter(item=>item.templateId == templateId)[0].statusFlag = statusFlag == 0 ? 1 : 0;
});
});
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment