提交 5947eb9e authored 作者: 刘守彩's avatar 刘守彩

feat: utils update

上级 17e54a2d
...@@ -204,7 +204,7 @@ export default { ...@@ -204,7 +204,7 @@ export default {
} }
} }
// 获取达到条件的日期是星期X // 获取达到条件的日期是星期X
const thisWeek = this.formatDate( const thisWeek = this.$formatDate(
new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'), new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'),
'week' 'week'
); );
...@@ -231,7 +231,7 @@ export default { ...@@ -231,7 +231,7 @@ export default {
} else if (this.dayRule == 'weekDay') { } else if (this.dayRule == 'weekDay') {
// 如果指定了是星期几 // 如果指定了是星期几
// 获取当前日期是属于星期几 // 获取当前日期是属于星期几
const thisWeek = this.formatDate( const thisWeek = this.$formatDate(
new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'),
'week' 'week'
); );
...@@ -251,7 +251,7 @@ export default { ...@@ -251,7 +251,7 @@ export default {
} else if (this.dayRule == 'assWeek') { } else if (this.dayRule == 'assWeek') {
// 如果指定了是第几周的星期几 // 如果指定了是第几周的星期几
// 获取每月1号是属于星期几 // 获取每月1号是属于星期几
const thisWeek = this.formatDate( const thisWeek = this.$formatDate(
new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'),
'week' 'week'
); );
...@@ -281,7 +281,7 @@ export default { ...@@ -281,7 +281,7 @@ export default {
} }
} }
// 获取月末最后一天是星期几 // 获取月末最后一天是星期几
const thisWeek = this.formatDate( const thisWeek = this.$formatDate(
new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'), new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'),
'week' 'week'
); );
...@@ -576,7 +576,7 @@ export default { ...@@ -576,7 +576,7 @@ export default {
} }
}, },
// 格式化日期格式如:2017-9-19 18:04:33 // 格式化日期格式如:2017-9-19 18:04:33
formatDate(value, type) { $formatDate(value, type) {
// 计算日期相关值 // 计算日期相关值
const time = typeof value === 'number' ? new Date(value) : value; const time = typeof value === 'number' ? new Date(value) : value;
const Y = time.getFullYear(); const Y = time.getFullYear();
...@@ -609,7 +609,7 @@ export default { ...@@ -609,7 +609,7 @@ export default {
// 检查日期是否存在 // 检查日期是否存在
checkDate(value) { checkDate(value) {
const time = new Date(value); const time = new Date(value);
const format = this.formatDate(time); const format = this.$formatDate(time);
return value === format; return value === format;
} }
} }
......
...@@ -4,21 +4,25 @@ import { download } from '@/utils/request'; ...@@ -4,21 +4,25 @@ import { download } from '@/utils/request';
import { getDicts } from '@/api/system/dict/data'; import { getDicts } from '@/api/system/dict/data';
import { getConfigKey } from '@/api/system/config'; import { getConfigKey } from '@/api/system/config';
import { import {
parseTime,
resetForm, resetForm,
addDateRange, addDateRange,
selectDictLabel, selectDictLabel,
selectDictLabels, selectDictLabels,
handleTree handleTree
} from '@/utils/ruoyi'; } from '@/utils/ruoyi';
import { formatDate, debounce, throttle, cloneDeep } from '@/utils/index';
// 全局方法挂载 // 全局方法挂载
Vue.prototype.getDicts = getDicts; Vue.prototype.$getDicts = getDicts;
Vue.prototype.getConfigKey = getConfigKey; Vue.prototype.$getConfigKey = getConfigKey;
Vue.prototype.parseTime = parseTime; Vue.prototype.$resetForm = resetForm;
Vue.prototype.resetForm = resetForm; Vue.prototype.$addDateRange = addDateRange;
Vue.prototype.addDateRange = addDateRange; Vue.prototype.$selectDictLabel = selectDictLabel;
Vue.prototype.selectDictLabel = selectDictLabel; Vue.prototype.$selectDictLabels = selectDictLabels;
Vue.prototype.selectDictLabels = selectDictLabels; Vue.prototype.$download = download;
Vue.prototype.download = download; Vue.prototype.$handleTree = handleTree;
Vue.prototype.handleTree = handleTree;
Vue.prototype.$formatDate = formatDate;
Vue.prototype.$debounce = debounce;
Vue.prototype.$throttle = throttle;
Vue.prototype.$cloneDeep = cloneDeep;
/**
* 通用js方法封装处理
* Copyright (c) 2019 ruoyi
*/
// 日期格式化
export function parseTime(time, pattern) {
if (arguments.length === 0 || !time) {
return null;
}
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}';
let date;
if (typeof time === 'object') {
date = time;
} else {
if (typeof time === 'string' && /^[0-9]+$/.test(time)) {
time = parseInt(time);
} else if (typeof time === 'string') {
time = time
.replace(new RegExp(/-/gm), '/')
.replace('T', ' ')
.replace(new RegExp(/\.[\d]{3}/gm), '');
}
if (typeof time === 'number' && time.toString().length === 10) {
time = time * 1000;
}
date = new Date(time);
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
};
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key];
// Note: getDay() returns 0 on Sunday
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value];
}
if (result.length > 0 && value < 10) {
value = '0' + value;
}
return value || 0;
});
return time_str;
}
// 表单重置 // 表单重置
export function resetForm(refName) { export function resetForm(refName) {
if (this.$refs[refName]) { if (this.$refs[refName]) {
......
...@@ -345,7 +345,7 @@ ...@@ -345,7 +345,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="下次执行时间:">{{ <el-form-item label="下次执行时间:">{{
parseTime(form.nextValidTime) $formatDate(form.nextValidTime)
}}</el-form-item> }}</el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
...@@ -463,7 +463,7 @@ export default { ...@@ -463,7 +463,7 @@ export default {
}, },
// 任务组名字典翻译 // 任务组名字典翻译
jobGroupFormat(row, column) { jobGroupFormat(row, column) {
return this.selectDictLabel(this.dict.type.sys_job_group, row.jobGroup); return this.$selectDictLabel(this.dict.type.sys_job_group, row.jobGroup);
}, },
// 取消按钮 // 取消按钮
cancel() { cancel() {
...@@ -482,7 +482,7 @@ export default { ...@@ -482,7 +482,7 @@ export default {
concurrent: 1, concurrent: 1,
status: '0' status: '0'
}; };
this.resetForm('form'); this.$resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -491,7 +491,7 @@ export default { ...@@ -491,7 +491,7 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
// 多选框选中数据 // 多选框选中数据
...@@ -616,7 +616,7 @@ export default { ...@@ -616,7 +616,7 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download( this.$download(
'monitor/job/export', 'monitor/job/export',
{ {
...this.queryParams ...this.queryParams
......
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
width="180" width="180"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ $formatDate(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -298,7 +298,7 @@ export default { ...@@ -298,7 +298,7 @@ export default {
/** 查询调度日志列表 */ /** 查询调度日志列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listJobLog(this.addDateRange(this.queryParams, this.dateRange)).then( listJobLog(this.$addDateRange(this.queryParams, this.dateRange)).then(
(response) => { (response) => {
this.jobLogList = response.rows; this.jobLogList = response.rows;
this.total = response.total; this.total = response.total;
...@@ -319,7 +319,7 @@ export default { ...@@ -319,7 +319,7 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
// 多选框选中数据 // 多选框选中数据
...@@ -361,7 +361,7 @@ export default { ...@@ -361,7 +361,7 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download( this.$download(
'/monitor/jobLog/export', '/monitor/jobLog/export',
{ {
...this.queryParams ...this.queryParams
......
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
width="180" width="180"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.loginTime) }}</span> <span>{{ $formatDate(scope.row.loginTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
</ty-table> </ty-table>
...@@ -232,7 +232,7 @@ export default { ...@@ -232,7 +232,7 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
this.$_syncQueryUrl(this.queryParams); this.$_syncQueryUrl(this.queryParams);
list(this.addDateRange(this.queryParams, this.dateRange)).then( list(this.$addDateRange(this.queryParams, this.dateRange)).then(
(response) => { (response) => {
this.list = response.rows; this.list = response.rows;
this.total = response.total; this.total = response.total;
...@@ -248,7 +248,7 @@ export default { ...@@ -248,7 +248,7 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order); this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
}, },
...@@ -307,7 +307,7 @@ export default { ...@@ -307,7 +307,7 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download( this.$download(
'monitor/logininfor/export', 'monitor/logininfor/export',
{ {
...this.queryParams ...this.queryParams
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
width="180" width="180"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.loginTime) }}</span> <span>{{ $formatDate(scope.row.loginTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -145,7 +145,7 @@ export default { ...@@ -145,7 +145,7 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
/** 强退按钮操作 */ /** 强退按钮操作 */
......
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
:sort-orders="['descending', 'ascending']" :sort-orders="['descending', 'ascending']"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.operTime) }}</span> <span>{{ $formatDate(scope.row.operTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="操作时间:">{{ <el-form-item label="操作时间:">{{
parseTime(form.operTime) $formatDate(form.operTime)
}}</el-form-item> }}</el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
...@@ -334,7 +334,7 @@ export default { ...@@ -334,7 +334,7 @@ export default {
/** 查询登录日志 */ /** 查询登录日志 */
getList() { getList() {
this.loading = true; this.loading = true;
list(this.addDateRange(this.queryParams, this.dateRange)).then( list(this.$addDateRange(this.queryParams, this.dateRange)).then(
(response) => { (response) => {
this.list = response.rows; this.list = response.rows;
this.total = response.total; this.total = response.total;
...@@ -344,7 +344,7 @@ export default { ...@@ -344,7 +344,7 @@ export default {
}, },
// 操作日志类型字典翻译 // 操作日志类型字典翻译
typeFormat(row, column) { typeFormat(row, column) {
return this.selectDictLabel( return this.$selectDictLabel(
this.dict.type.sys_oper_type, this.dict.type.sys_oper_type,
row.businessType row.businessType
); );
...@@ -357,7 +357,7 @@ export default { ...@@ -357,7 +357,7 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order); this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
}, },
...@@ -406,7 +406,7 @@ export default { ...@@ -406,7 +406,7 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download( this.$download(
'monitor/operlog/export', 'monitor/operlog/export',
{ {
...this.queryParams ...this.queryParams
......
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
width="180" width="180"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ $formatDate(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -298,7 +298,7 @@ export default { ...@@ -298,7 +298,7 @@ export default {
/** 查询参数列表 */ /** 查询参数列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listConfig(this.addDateRange(this.queryParams, this.dateRange)).then( listConfig(this.$addDateRange(this.queryParams, this.dateRange)).then(
(response) => { (response) => {
this.configList = response.rows; this.configList = response.rows;
this.total = response.total; this.total = response.total;
...@@ -321,7 +321,7 @@ export default { ...@@ -321,7 +321,7 @@ export default {
configType: 'Y', configType: 'Y',
remark: undefined remark: undefined
}; };
this.resetForm('form'); this.$resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -331,7 +331,7 @@ export default { ...@@ -331,7 +331,7 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
...@@ -392,7 +392,7 @@ export default { ...@@ -392,7 +392,7 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download( this.$download(
'system/config/export', 'system/config/export',
{ {
...this.queryParams ...this.queryParams
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
width="200" width="200"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ $formatDate(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -283,7 +283,7 @@ export default { ...@@ -283,7 +283,7 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
listDept(this.queryParams).then((response) => { listDept(this.queryParams).then((response) => {
this.deptList = this.handleTree(response.data, 'deptId'); this.deptList = this.$handleTree(response.data, 'deptId');
this.loading = false; this.loading = false;
}); });
}, },
...@@ -315,7 +315,7 @@ export default { ...@@ -315,7 +315,7 @@ export default {
email: undefined, email: undefined,
status: '0' status: '0'
}; };
this.resetForm('form'); this.$resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -323,7 +323,7 @@ export default { ...@@ -323,7 +323,7 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
...@@ -335,7 +335,7 @@ export default { ...@@ -335,7 +335,7 @@ export default {
this.open = true; this.open = true;
this.title = '添加部门'; this.title = '添加部门';
listDept().then((response) => { listDept().then((response) => {
this.deptOptions = this.handleTree(response.data, 'deptId'); this.deptOptions = this.$handleTree(response.data, 'deptId');
}); });
}, },
/** 展开/折叠操作 */ /** 展开/折叠操作 */
...@@ -354,7 +354,7 @@ export default { ...@@ -354,7 +354,7 @@ export default {
this.open = true; this.open = true;
this.title = '修改部门'; this.title = '修改部门';
listDeptExcludeChild(row.deptId).then((response) => { listDeptExcludeChild(row.deptId).then((response) => {
this.deptOptions = this.handleTree(response.data, 'deptId'); this.deptOptions = this.$handleTree(response.data, 'deptId');
if (this.deptOptions.length == 0) { if (this.deptOptions.length == 0) {
const noResultsOptions = { const noResultsOptions = {
deptId: this.form.parentId, deptId: this.form.parentId,
......
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
width="180" width="180"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ $formatDate(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -380,7 +380,7 @@ export default { ...@@ -380,7 +380,7 @@ export default {
status: '0', status: '0',
remark: undefined remark: undefined
}; };
this.resetForm('form'); this.$resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -394,7 +394,7 @@ export default { ...@@ -394,7 +394,7 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.queryParams.dictType = this.defaultDictType; this.queryParams.dictType = this.defaultDictType;
this.handleQuery(); this.handleQuery();
}, },
...@@ -466,7 +466,7 @@ export default { ...@@ -466,7 +466,7 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download( this.$download(
'system/dict/data/export', 'system/dict/data/export',
{ {
...this.queryParams ...this.queryParams
......
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
width="180" width="180"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ $formatDate(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -294,7 +294,7 @@ export default { ...@@ -294,7 +294,7 @@ export default {
/** 查询字典类型列表 */ /** 查询字典类型列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listType(this.addDateRange(this.queryParams, this.dateRange)).then( listType(this.$addDateRange(this.queryParams, this.dateRange)).then(
(response) => { (response) => {
this.typeList = response.rows; this.typeList = response.rows;
this.total = response.total; this.total = response.total;
...@@ -316,7 +316,7 @@ export default { ...@@ -316,7 +316,7 @@ export default {
status: '0', status: '0',
remark: undefined remark: undefined
}; };
this.resetForm('form'); this.$resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -326,7 +326,7 @@ export default { ...@@ -326,7 +326,7 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
...@@ -387,7 +387,7 @@ export default { ...@@ -387,7 +387,7 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download( this.$download(
'system/dict/type/export', 'system/dict/type/export',
{ {
...this.queryParams ...this.queryParams
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime"> <el-table-column label="创建时间" align="center" prop="createTime">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ $formatDate(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -424,7 +424,7 @@ export default { ...@@ -424,7 +424,7 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
listMenu(this.queryParams).then((response) => { listMenu(this.queryParams).then((response) => {
this.menuList = this.handleTree(response.data, 'menuId'); this.menuList = this.$handleTree(response.data, 'menuId');
this.loading = false; this.loading = false;
}); });
}, },
...@@ -444,7 +444,7 @@ export default { ...@@ -444,7 +444,7 @@ export default {
listMenu().then((response) => { listMenu().then((response) => {
this.menuOptions = []; this.menuOptions = [];
const menu = { menuId: 0, menuName: '主类目', children: [] }; const menu = { menuId: 0, menuName: '主类目', children: [] };
menu.children = this.handleTree(response.data, 'menuId'); menu.children = this.$handleTree(response.data, 'menuId');
this.menuOptions.push(menu); this.menuOptions.push(menu);
}); });
}, },
...@@ -467,7 +467,7 @@ export default { ...@@ -467,7 +467,7 @@ export default {
visible: '0', visible: '0',
status: '0' status: '0'
}; };
this.resetForm('form'); this.$resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -475,7 +475,7 @@ export default { ...@@ -475,7 +475,7 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
......
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
width="100" width="100"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <span>{{ $formatDate(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -312,7 +312,7 @@ export default { ...@@ -312,7 +312,7 @@ export default {
noticeContent: undefined, noticeContent: undefined,
status: '0' status: '0'
}; };
this.resetForm('form'); this.$resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -321,7 +321,7 @@ export default { ...@@ -321,7 +321,7 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
// 多选框选中数据 // 多选框选中数据
......
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
width="180" width="180"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ $formatDate(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -275,7 +275,7 @@ export default { ...@@ -275,7 +275,7 @@ export default {
status: '0', status: '0',
remark: undefined remark: undefined
}; };
this.resetForm('form'); this.$resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -284,7 +284,7 @@ export default { ...@@ -284,7 +284,7 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
// 多选框选中数据 // 多选框选中数据
...@@ -345,7 +345,7 @@ export default { ...@@ -345,7 +345,7 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download( this.$download(
'system/post/export', 'system/post/export',
{ {
...this.queryParams ...this.queryParams
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
width="180" width="180"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ $formatDate(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -204,7 +204,7 @@ export default { ...@@ -204,7 +204,7 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
// 多选框选中数据 // 多选框选中数据
......
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
width="180" width="180"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ $formatDate(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -441,7 +441,7 @@ export default { ...@@ -441,7 +441,7 @@ export default {
/** 查询角色列表 */ /** 查询角色列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listRole(this.addDateRange(this.queryParams, this.dateRange)).then( listRole(this.$addDateRange(this.queryParams, this.dateRange)).then(
(response) => { (response) => {
this.roleList = response.rows; this.roleList = response.rows;
this.total = response.total; this.total = response.total;
...@@ -533,7 +533,7 @@ export default { ...@@ -533,7 +533,7 @@ export default {
deptCheckStrictly: true, deptCheckStrictly: true,
remark: undefined remark: undefined
}; };
this.resetForm('form'); this.$resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -543,7 +543,7 @@ export default { ...@@ -543,7 +543,7 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
// 多选框选中数据 // 多选框选中数据
...@@ -698,7 +698,7 @@ export default { ...@@ -698,7 +698,7 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download( this.$download(
'system/role/export', 'system/role/export',
{ {
...this.queryParams ...this.queryParams
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
width="180" width="180"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ $formatDate(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -152,7 +152,7 @@ export default { ...@@ -152,7 +152,7 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
/** 选择授权用户操作 */ /** 选择授权用户操作 */
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
width="180" width="180"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ $formatDate(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
...@@ -225,7 +225,7 @@ ...@@ -225,7 +225,7 @@
width="160" width="160"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ $formatDate(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -615,7 +615,7 @@ export default { ...@@ -615,7 +615,7 @@ export default {
created() { created() {
this.getList(); this.getList();
this.getDeptTree(); this.getDeptTree();
this.getConfigKey('sys.user.initPassword').then((response) => { this.$getConfigKey('sys.user.initPassword').then((response) => {
this.initPassword = response.msg; this.initPassword = response.msg;
}); });
}, },
...@@ -623,7 +623,7 @@ export default { ...@@ -623,7 +623,7 @@ export default {
/** 查询用户列表 */ /** 查询用户列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then( listUser(this.$addDateRange(this.queryParams, this.dateRange)).then(
(response) => { (response) => {
this.userList = response.rows; this.userList = response.rows;
this.total = response.total; this.total = response.total;
...@@ -683,7 +683,7 @@ export default { ...@@ -683,7 +683,7 @@ export default {
postIds: [], postIds: [],
roleIds: [] roleIds: []
}; };
this.resetForm('form'); this.$resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -693,7 +693,7 @@ export default { ...@@ -693,7 +693,7 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
this.resetForm('queryForm'); this.$resetForm('queryForm');
this.queryParams.deptId = undefined; this.queryParams.deptId = undefined;
this.$refs.tree.setCurrentKey(null); this.$refs.tree.setCurrentKey(null);
this.handleQuery(); this.handleQuery();
...@@ -800,7 +800,7 @@ export default { ...@@ -800,7 +800,7 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download( this.$download(
'system/user/export', 'system/user/export',
{ {
...this.queryParams ...this.queryParams
...@@ -815,7 +815,7 @@ export default { ...@@ -815,7 +815,7 @@ export default {
}, },
/** 下载模板操作 */ /** 下载模板操作 */
importTemplate() { importTemplate() {
this.download( this.$download(
'system/user/importTemplate', 'system/user/importTemplate',
{}, {},
`user_template_${new Date().getTime()}.xlsx` `user_template_${new Date().getTime()}.xlsx`
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论