若以框架会生成
import { parseTime, resetForm, addDateRange, selectDictLabel, download, download2, handleTree, handleTree1, selectShowName, nvl } from "@/utils/ruoyi";
全局挂载
Vue.prototype.addDateRange = addDateRange
<el-date-picker
clearable
size="small"
style="width: 250px"
v-model="dateRange"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
dateRange:【】
listLog(this.addDateRange(this.queryParams, this.dateRange)).then(
response => {
this.logList = response.rows;
console.log(" this.logList", this.logList);
this.total = response.total;
this.loading = false;
}
);
重置的时候把 dateRange置空
<el-table-column
label="登录状态"
align="center"
prop="status"
:formatter="statusFormat"
/>
statusOptions:【】
一进入页面就转换
this.getDicts("sys_common_status").then(response => {
this.statusOptions = response.data;
});
这个是方法
// 登录状态字典翻译
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status);
},