Commit dc6ab566 Linchun

第一次提交

0 个父辈
db.json
package-lock.json
yarn.lock
.DS_Store
node_modules
/dist
/build
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
#Electron-builder output
/dist_electron
\ No newline at end of file \ No newline at end of file
# 定时器系统
## Project setup
```
yarn install
```
### Compiles and hot-reloads for development
```
yarn serve
```
### Compiles and minifies for production
```
yarn build
```
### Lints and fixes files
```
yarn lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
### Solve the problem
定时器系统-安装依赖,启动,打包篇
安装依赖过程中先装根目录下的package.json,接着也要安装 dist_electron下的package.json
1,doone-electron 打包过程中
会出现找不到模块,依赖,不是内部命令 不能执行 比如 vue/cli-service
注意重新安装yarn add @vue/cli-service
2,出现进程占用 注意先关闭当前已打开的程序
3,出现.dl等提示程序阻拦 注意让系统允许该程序文件执行 不要拦截
4,最终大法,如果一直报错提示依赖没装好 可以直接删node_modules 重新安装
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
{
"name": "timersys",
"version": "0.1.0",
"private": true,
"author": "linchun",
"description": "electron+vue+elementui+lowdb",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"electron:build": "vue-cli-service electron:build",
"electron:serve": "vue-cli-service electron:serve",
"postinstall": "electron-builder install-app-deps",
"postuninstall": "electron-builder install-app-deps",
"start": "electron .",
"pack": "electron-builder --dir",
"dist": "electron-builder"
},
"main": "background.js",
"dependencies": {
"element-ui": "^2.14.1",
"lowdb": "^1.0.0",
"node-schedule": "^1.3.2",
"vue": "^2.6.11",
"vue-router": "^3.0.1",
"xlsx": "^0.17.4",
"file-saver":"^2.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "^4.5.15",
"babel-eslint": "^10.1.0",
"electron": "^9.0.0",
"electron-builder": "^22.9.1",
"electron-debug": "^1.5.0",
"electron-devtools-installer": "^3.1.1",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-cli-plugin-electron-builder": "~2.0.0-rc.5",
"vue-devtools": "^5.1.4",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
此文件类型无法预览
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- <title><%= htmlWebpackPlugin.options.title %></title> -->
<title>定时器系统</title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
export default {
name: 'electron-vue-demo'
}
</script>
\ No newline at end of file \ No newline at end of file
此文件类型无法预览
此文件类型无法预览
html,body{
overflow-y: hidden!important;
}
.app-container {
padding: 0 20px;
}
/* // 结构样式 */
.border-line{
background:#e6ebf5;
height:1px;
margin-bottom: 10px;
}
.main-content{
padding-top:10px;
}
/* // 分页器 */
.el-pagination{
text-align: right;
padding: 15px 0;
}
\ No newline at end of file \ No newline at end of file
'use strict'
import { app, protocol, BrowserWindow, Tray, Menu} from 'electron'
import { createProtocol } from 'vue-cli-plugin-electron-builder/lib'
const isDevelopment = process.env.NODE_ENV !== 'production'
const path = require('path')
// 创建菜单
let contextMenu = Menu.buildFromTemplate([
{ label: '退出', role: 'close', accelerator: 'CmdOrCtrl+Q', click: function() {app.exit()} }
])
// Scheme must be registered before the app is ready
protocol.registerSchemesAsPrivileged([
{ scheme: 'app', privileges: { secure: true, standard: true } }
])
async function createWindow() {
Menu.setApplicationMenu(null)
// Create the browser window.
const win = new BrowserWindow({
width: 1200,
// width: 1900,
minWidth: 800,
// maxWidth: 1920,
// height: 600,
height: 800,
// maxHeight: 1200,
minHeight: 600,
// fullscreen:true,
center:true,
resizable:true,
// frame:false,
maximizable:true,
title:'定时任务',
// autoHideMenuBar: true, // 隐藏窗口的系统菜单
autoHideMenuBar: false, // 隐藏窗口的系统菜单
webPreferences: {
// icon: path.join(__dirname, './assets/logo/app.ico'),
nodeIntegration: true,
enableRemoteModule: true,
contextIsolation: false,
devTools:true // 关闭开发者工具
// devTools:false // 关闭开发者工具
},
})
if (process.env.WEBPACK_DEV_SERVER_URL) {
// Load the url of the dev server if in development mode
await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL)
// win.loadURL(process.env.WEBPACK_DEV_SERVER_URL)
if (!process.env.IS_TEST) win.webContents.openDevTools()//todo
} else {
createProtocol('app')
// Load the index.html when not in development
win.loadURL('app://./index.html')
}
}
// Quit when all windows are closed.
app.on('window-all-closed', () => {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', async () => {
if (isDevelopment && !process.env.IS_TEST) {
// Install Vue Devtools
try {
// await installExtension(VUEJS_DEVTOOLS)
// 新增的:安装devTools
// const {session}=require('electron');
// const path=require('path');
// session.defaultSession.loadExtension(
// path.resolve(__dirname,'../build/devTools')
// );
// console.log('dirname',__dirname)
} catch (e) {
console.error('Vue Devtools failed to install:', e.toString())
}
}
createWindow()
// let iconPath = path.join(__dirname, '../public/traylogo.png')
let iconPath = path.join(__dirname, '../public/logo.png')
// let iconPath = path.join(__dirname, './assets/logo/logo.png')
let tray = new Tray(iconPath)
// 设置托盘提示
tray.setToolTip('定时器系统')
// 设置托盘菜单
tray.setContextMenu(contextMenu)
})
// Exit cleanly on request from parent process in development mode.
if (isDevelopment) {
if (process.platform === 'win32') {
process.on('message', (data) => {
if (data === 'graceful-exit') {
app.quit()
}
})
} else {
process.on('SIGTERM', () => {
app.quit()
})
}
}
<template>
<div>
<el-upload
:ref="upload.ref"
multiple
:accept="upload.acceptFile"
action
:on-change="handleImportChanged"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传</em>
</div>
<div class="el-upload__tip" slot="tip">
</div>
<div class="el-upload__tip" style="color: red" slot="tip">
<p style="font-size:16px">温馨提示:</p>
<p>1、文件目前仅支持xlsx,xls,csv格式</p>
<p>2、导入数据量大时请耐心等待</p>
<p>3、数据导入中,请勿关闭本页面</p>
</div>
</el-upload>
<div slot="footer" class="dialog-footer" style="text-align:center;margin-top:20px;">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</div>
</template>
<script>
import {UploadImport} from '@/utils/excel'
export default {
name:"FileUpload",
props:[
'upload',
],
data() {
return {
};
},
computed: {
},
methods: {
handleImportChanged(files,fileList){
this.upload.file=files.raw;
if(fileList.length>1){//单文件上传,后者覆盖前者 配合参数设置 1去除limit=1设置 2允许多传 multiple
fileList.splice(0,1);
}
},
submitForm () { // 提交上传文件
if(this.checkFile(this.upload.file)){
// this.$emit('onFileSubmit',this.upload.file);
UploadImport(this.upload.file).then((data)=>{
this.$emit(this.upload.emitEventName,data);
// this.dealFile(data)
this.handleSuccess();
}).catch((err)=>{
this.$message.error(this.upload.submitErrorMsg);
this.handleSuccess();
console.log('err',err);
});
}
else{
return false;
}
},
cancel(){
this.upload.open=false;
},
checkFile(){
let fileSuffix=this.upload.file.name.substring(this.upload.file.name.lastIndexOf('.')+1);
console.log('whiteList',this.upload.whiteList);
if(this.upload.whiteList.indexOf(fileSuffix)===-1){
this.$message.error(this.upload.formatMsg);
return false;
}
else{
return true
}
},
handleSuccess () { // 文件上传成功处理
this.upload.isUploading = false
this.$refs.upload.clearFiles()
// this.upload.open = false
},
handleFileUploadProgress () {// 文件上传中处理
this.upload.isUploading = true
},
},
created() {
},
};
</script>
\ No newline at end of file \ No newline at end of file
<!-- 调度日志 -->
<template style="background:#e6ebf5;z-index:100;">
<div class="app-container">
<!-- 标题 -->
<div class="main-title" style="padding:10px 0;">
<i class="el-icon-date" style="color:#1890ff"></i>
<span style="padding:0 10px;">调度日志</span>
</div>
<!-- 分割线 -->
<div class="border-line"></div>
<!-- 表单查询条件 -->
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
label-width="68px"
>
<el-form-item
label="任务名称"
prop="jobName"
>
<el-input
v-model="queryParams.jobName"
placeholder="请输入任务名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="任务组名"
prop="jobGroup"
>
<el-select
v-model="queryParams.jobGroup"
placeholder="请选择任务组名"
clearable
size="small"
>
<el-option
v-for="dict in jobGroupOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item
label="执行时间"
prop="jobRangeDateTime"
>
<el-date-picker
v-model="queryParams.jobRangeDateTime"
size="small"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
></el-date-picker>
</el-form-item>
<el-form-item
label="执行状态"
prop="status"
>
<el-select
v-model="queryParams.status"
placeholder="请选择执行状态"
clearable
size="small"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button>
<el-button
icon="el-icon-refresh-right"
size="mini"
@click="handleRefresh"
>刷新</el-button>
<el-button
icon="el-icon-back"
size="mini"
@click="handleBack"
>返回</el-button>
</el-form-item>
</el-form>
<!-- 表格分页列表 -->
<el-table
v-loading="loading"
:data="showData"
:height="tableHeight"
style="width:100%;"
v-tableHeight="{bottomOffset:60}"
>
<el-table-column
min-width="220px"
label="执行时间"
align="center"
prop="jobRangeDateTime"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<span>{{scope.row.jobRangeDateTime.join(' ~ ')}}</span>
</template>
</el-table-column>
<el-table-column
label="任务名称"
align="center"
prop="jobName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="任务组名"
align="center"
prop="jobGroup"
:formatter="jobGroupFormat"
/>
<el-table-column
label="任务地址"
align="center"
prop="jobAddr"
:show-overflow-tooltip="true"
/>
<el-table-column
label="执行状态"
align="center"
prop="status"
:formatter="jobStatusFormat"
:show-overflow-tooltip="true"
/>
<el-table-column
label="失败原因"
align="center"
prop="failReason"
:show-overflow-tooltip="true"
/>
<el-table-column
label="任务参数"
align="center"
prop="taskParams"
:show-overflow-tooltip="true"
/>
<el-table-column
label="备注"
align="center"
prop="remark"
:show-overflow-tooltip="true"
/>
</el-table>
<el-pagination
background
v-show="total>0"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 20, 30, 50]"
:page-size="10"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
<!-- 脚垫 -->
<div style="height:10px;"></div>
</div>
</template>
<script>
// 引入json数据库
import lowdb from 'lowdb'
import fileSync from 'lowdb/adapters/FileSync'
let adapter = new fileSync('db.json');
const db = lowdb(adapter);
import {changeArr } from '@/utils/index'
export default {
data () {
return {
tableHeight:450,
showData:[],
jobId:null,
currentPage: 1,
// 遮罩层
loading: true,
// 总条数
total: 0,
// 任务组名字典
jobGroupOptions: [],
// 状态字典
statusOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
jobName: undefined,
jobAddr: undefined,
jobGroup: undefined,
status: undefined,
jobRangeDateTime: undefined,
type: undefined,
},
};
},
created () {
this.jobGroupOptions=[
{dictLabel:'默认',dictValue:'default'},
{dictLabel:'系统',dictValue:'system'},
];
this.statusOptions=[
{dictLabel:'开启',dictValue:'0'},
{dictLabel:'关闭',dictValue:'1'},
];
},
mounted () {
//获取传参jobId
this.jobId=this.$route.params.jobId?this.$route.params.jobId:sessionStorage.getItem('jobId');
// 获取表格数据
this.getList();
},
methods: {
/** 查询调度日志列表 */
getList(params,fun) {
this.loading=true;
params=params||{
pageNum:this.queryParams.pageNum,
pageSize:this.queryParams.pageSize,
type:this.queryParams.type
}
let resData = db.read().get('logDB').value()[this.jobId];
// console.log('resData',resData);
if(params.type==='filter'){
resData=this.getFilterData(resData);
}
this.showData=[];//清空列表
this.total = resData?resData.length:0;
if(this.total>0){
resData=changeArr(resData,params.pageSize);//保存分组后的全部数据,默认一页10条
this.showData=resData[params.pageNum-1];//显示第一页数据
}
this.loading=false;
if(fun){
fun();
}
},
getFilterData(filterData=[]){
// 按条件一层层过滤
// 任务名称
if(this.queryParams['jobName']){
filterData=filterData.filter((item)=>{return item.jobName.indexOf(this.queryParams['jobName'])!=-1});
// console.log('filter-jobName',filterData);
}
// 任务组名
if(this.queryParams['jobGroup']){
filterData=filterData.filter((item)=>{return item.jobGroup===this.queryParams['jobGroup']});
// console.log('filter-jobGroup',filterData);
}
// 执行状态
if(this.queryParams['status']!==undefined){
filterData=filterData.filter((item)=>{return item.status===this.queryParams['status']});
// console.log('filter-status',filterData);
}
// // 任务地址
// if(this.queryParams['jobAddr']){
// filterData=filterData.filter((item)=>{return item.jobAddr.indexOf(this.queryParams['jobAddr'])!=-1});
// // console.log('filter-jobAddr',filterData);
// }
// 执行时间
if(this.queryParams['jobRangeDateTime']&&this.queryParams['jobRangeDateTime'].length===2){
console.log('jobRangeDateTime',this.queryParams['jobRangeDateTime']);
filterData=filterData.filter((item)=>{
let condition1=item.runStartTime>=this.queryParams['jobRangeDateTime'][0]&&item.runEndTime<=this.queryParams['jobRangeDateTime'][1],
condition2=item.runStartTime<this.queryParams['jobRangeDateTime'][0]&&item.runEndTime>this.queryParams['jobRangeDateTime'][0]&&item.runEndTime<this.queryParams['jobRangeDateTime'][1],
condition3=item.runStartTime>this.queryParams['jobRangeDateTime'][0]&&item.runEndTime>this.queryParams['jobRangeDateTime'][1];
if(condition1||condition2||condition3){
return true
}
});
console.log('filterData',filterData);
}
return filterData;
},
selectDictLabel(datas, value) {
var actions = [];
Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + value)) {
actions.push(datas[key].dictLabel);
return true;
}
})
return actions.join('');
},
// 任务组名字典翻译
jobGroupFormat(row) {
return this.selectDictLabel(this.jobGroupOptions, row.jobGroup);
},
// 执行状态字典翻译
jobStatusFormat(row) {
return this.selectDictLabel(this.statusOptions, row.status);
},
handleQuery(){
this.$refs['queryForm'].validate((valid) => {
if (valid) {
this.queryParams.type='filter';
this.getList()
}
})
},
handleRefresh () {
location.reload()
},
handleBack () {
// window.history.go(-1);
this.$router.push({name:'TimingTask'});
},
resetQuery () {
this.$refs['queryForm'].resetFields()
this.queryParams={
pageNum: 1,
pageSize: 10,
jobName: undefined,
jobAddr: undefined,
jobGroup: undefined,
status: undefined,
jobRangeDateTime: undefined,
type: undefined,
},
this.getList()
},
handleSizeChange (val) {
this.queryParams.pageSize = val
this.getList()
},
handleCurrentChange (val) {
this.queryParams.pageNum = val
this.getList()
},
}
}
</script>
\ No newline at end of file \ No newline at end of file
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/styles/common.css';
// 公用表格高度计算
import tableHeight from './utils/tableHeight'
// 表格自适应指令
Vue.use(tableHeight)
Vue.config.productionTip = false
Vue.use(ElementUI);
/* eslint-disable no-new */
// new Vue({
// components: { App },
// router,
// template: '<App/>'
// }).$mount('#app')
new Vue({
router,
render: h => h(App),
}).$mount('#app')
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
export default new Router({
routes: [
{
path: '/',
name: 'TimingTask',
component: require('@/components/TimingTask.vue').default,
},
// {
// path: '/timingTask',
// name: 'TimingTask',
// component: require('@/components/TimingTask.vue').default,
// },
{
path: '/operLog',
// name: 'landing-page',
name: 'OperLog',
// component: require('@/components/LandingPage').default
component: require('@/components/OperLog.vue').default,
// children: [
// {
// path: 'log/:tableId',
// component: (resolve) => require(['@/views/orderSys/declineMag/declineConfirm/detail'], resolve),
// name: 'declineConfirmDetail',
// // meta: { title: '调度日志'}
// },
// ]
},
{
path: '*',
redirect: '/'
}
]
})
import xlsx from 'xlsx'
import FileSaver from 'file-saver'
// 读取文件
export const ReadFile=(file)=>{
return new Promise(resolve => {
let reader = new FileReader();
reader.readAsBinaryString(file);
reader.onload = ev => { resolve(ev.target.result); }
})
}
// 导入excel
export function UploadImport(file) {
return new Promise((resolve,reject)=>{
// ReadFile(file.raw).then((result)=>{
ReadFile(file).then((result)=>{
let dataBinary= result;// 读取文件
let workBook = xlsx.read(dataBinary,{type:"binary",cellDates:true});
let workSheet = workBook.Sheets[workBook.SheetNames[0]];
let data = xlsx.utils.sheet_to_json(workSheet)||[];
if(data.length>0){
resolve(data);
}
else{
reject();
}
})
});
}
export function importExcel(_this) {
let fullscreenLoading = _this.$loading({
lock: true,
text: '导入中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
let obj = _this.imFile
if (!obj.files) {
fullscreenLoading.close();
return
}
var f = obj.files[0]
var reader = new FileReader()
reader.onload = function (e) {
var data = e.target.result
// console.log('data',data);
if (_this.rABS) {
_this.wb = xlsx.read(btoa(this.fixdata(data)), {// 手动转化
type: 'base64'
})
} else {
_this.wb = xlsx.read(data, {
type: 'binary'
})
}
// console.log('wb',_this.wb.Sheets[_this.wb.SheetNames[0]]);
let json = xlsx.utils.sheet_to_json(_this.wb.Sheets[_this.wb.SheetNames[0]])
// console.log('json',typeof json)
_this.dealFile(analyzeData(json)) // analyzeData: 解析导入数据
fullscreenLoading.close();
}
if (_this.rABS) {
reader.readAsArrayBuffer(f)
}
else {
reader.readAsBinaryString(f)
}
function analyzeData (data) { // 此处可以解析导入数据
return data||[]
}
}
// 导出excel
export function exportExcel(params) {
params=params||{
xlsxData:[["任务名称","任务地址"]],
sheetName:'sheet1',
fileName:'template'
}
const s2ab = s => {
if (typeof ArrayBuffer !== 'undefined') {
let buf = new ArrayBuffer(s.length)
let view = new Uint8Array(buf)
for (let i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xff
return buf
} else {
let buf = new Array(s.length);
for (let i = 0; i != s.length; ++i) buf[i] = s.charCodeAt(i) & 0xFF;
return buf;
}
}
let worksheet=xlsx.utils.aoa_to_sheet(params.xlsxData);
let workBook =xlsx.utils.book_new();
xlsx.utils.book_append_sheet(workBook,worksheet,params.sheetName);// 第三个参数可选,是工作表名称
let wopts = { bookType: 'xlsx', bookSST: false, type: 'binary'} //写入的样式
let wbout = xlsx.write(workBook, wopts)
try{
let blob = new Blob([s2ab(wbout)], { type: 'application/octet-stream' })
FileSaver.saveAs(blob, params.fileName+'.xlsx')
}
catch(e){
if(typeof console!=='undefined'){
console.log(e,wbout)
}
}
}
\ No newline at end of file \ No newline at end of file
此文件的差异被折叠, 点击展开。
import tableHeight from './tableHeight'
const install = function(Vue) {
// 绑定v-adaptive指令
Vue.directive('tableHeight', tableHeight)
}
if (window.Vue) {
window['tableHeight'] = tableHeight
// eslint-disable-next-line no-undef
Vue.use(install)
}
tableHeight.install = install
export default tableHeight
import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event'
// 设置表格高度
const doResize = async (el, binding, vnode) => {
// 获取表格Dom对象
const { componentInstance: $table } = await vnode
// 获取调用传递过来的数据
const { value } = binding
// if (!$table.height) {
// throw new Error(`el-$table must set the height. Such as height='100px'`)
// }
// console.log($table, '$table$table$table$table')
// 获取距底部距离(用于展示页码等信息)
const bottomOffset = (value && value.bottomOffset) || 30
if (!$table) return
// 计算列表高度并设置
const height = window.innerHeight - el.getBoundingClientRect().top - bottomOffset
// $table.layout.setMaxHeight(height)
$table.layout.setHeight(height)
// $table.maxHeight = height
$table.doLayout()
}
export default {
// 初始化设置
bind(el, binding, vnode) {
// 设置resize监听方法
el.resizeListener = async () => {
await doResize(el, binding, vnode)
}
// 绑定监听方法到addResizeListener
addResizeListener(window.document.body, el.resizeListener)
},
// // 绑定默认高度
async inserted(el, binding, vnode) {
await doResize(el, binding, vnode)
},
// // 销毁时设置
unbind(el) {
// 移除resize监听
removeResizeListener(el, el.resizeListener)
}
}
\ No newline at end of file \ No newline at end of file
module.exports = {
pluginOptions: {
electronBuilder: {
nodeIntegration: true,
builderOptions: {
productName: "定时器系统",
appId: 'test.com',
win: {
"target": [
"nsis"
],
icon: './src/assets/logo/app.ico',
"requestedExecutionLevel": "requireAdministrator"
},
"nsis": {
"installerIcon": "./src/assets/logo/app.ico",
"uninstallerIcon": "./src/assets/logo/app.ico",
"uninstallDisplayName": "timersys",
// "license": "license.txt",
"oneClick": false,
"allowToChangeInstallationDirectory": true
}
},
}
}
}
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!