This commit is contained in:
2023-04-11 18:36:41 +08:00
parent 1fd8a381ea
commit f6225b2afb
51 changed files with 5066 additions and 193 deletions

View File

@@ -0,0 +1,234 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="组织id" prop="deptId">
<el-input v-model="queryParams.deptId" placeholder="请输入组织id" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="文件名" prop="fileName">
<el-input v-model="queryParams.fileName" placeholder="请输入文件名" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="文件路径" prop="fileUrl">
<el-input v-model="queryParams.fileUrl" placeholder="请输入文件路径" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="上传时间" prop="uploadTime">
<el-date-picker clearable v-model="queryParams.uploadTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择上传时间">
</el-date-picker>
</el-form-item>
<el-form-item label="上传人员" prop="uploadUser">
<el-input v-model="queryParams.uploadUser" placeholder="请输入上传人员" clearable @keyup.enter.native="handleQuery" />
</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-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:file:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:file:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:file:remove']">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:file:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="fileList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="${comment}" align="center" prop="fileId" />
<el-table-column label="组织id" align="center" prop="deptId" />
<el-table-column label="文件名" align="center" prop="fileName" />
<el-table-column label="文件路径" align="center" prop="fileUrl" />
<el-table-column label="上传时间" align="center" prop="uploadTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.uploadTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="上传人员" align="center" prop="uploadUser" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:file:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:file:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 添加或修改文件对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="组织id" prop="deptId">
<el-input v-model="form.deptId" placeholder="请输入组织id" />
</el-form-item>
<el-form-item label="文件名" prop="fileName">
<el-input v-model="form.fileName" placeholder="请输入文件名" />
</el-form-item>
<el-form-item label="文件路径" prop="fileUrl">
<el-input v-model="form.fileUrl" placeholder="请输入文件路径" />
</el-form-item>
<el-form-item label="上传时间" prop="uploadTime">
<el-date-picker clearable v-model="form.uploadTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择上传时间">
</el-date-picker>
</el-form-item>
<el-form-item label="上传人员" prop="uploadUser">
<el-input v-model="form.uploadUser" placeholder="请输入上传人员" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listFile, getFile, delFile, addFile, updateFile } from "@/api/sch/file";
export default {
name: "File",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 文件表格数据
fileList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
deptId: null,
fileName: null,
fileUrl: null,
uploadTime: null,
uploadUser: null
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询文件列表 */
getList() {
this.loading = true;
listFile(this.queryParams).then(response => {
this.fileList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
fileId: null,
deptId: null,
fileName: null,
fileUrl: null,
uploadTime: null,
uploadUser: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.fileId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加文件";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const fileId = row.fileId || this.ids
getFile(fileId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改文件";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.fileId != null) {
updateFile(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addFile(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const fileIds = row.fileId || this.ids;
this.$modal.confirm('是否确认删除文件编号为"' + fileIds + '"的数据项?').then(function () {
return delFile(fileIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
},
/** 导出按钮操作 */
handleExport() {
this.download('system/file/export', {
...this.queryParams
}, `file_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@@ -280,7 +280,7 @@ export default {
},
//
importMap() {
const url = 'https://webapi.amap.com/maps?v=1.4.15&key=124646b0e6076de9d801400f833ac986&callback=onLoad';
const url = 'https://webapi.amap.com/maps?v=1.4.15&key=f2f35d6adc4a16bb879d303cead56237&callback=onLoad';
var jsapi = document.createElement('script');
jsapi.charset = 'utf-8';
jsapi.src = url;

View File

@@ -0,0 +1,236 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="制度名" prop="ruleName">
<el-input v-model="queryParams.ruleName" placeholder="请输入制度名" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="实施时间" prop="implementTime">
<el-date-picker clearable v-model="queryParams.implementTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择实施时间">
</el-date-picker>
</el-form-item>
<el-form-item label="到期时间" prop="dueTime">
<el-date-picker clearable v-model="queryParams.dueTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择到期时间">
</el-date-picker>
</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-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:rules:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:rules:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:rules:remove']">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:rules:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="rulesList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="${comment}" align="center" prop="ruleId" />
<el-table-column label="制度名" align="center" prop="ruleName" />
<el-table-column label="实施时间" align="center" prop="implementTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.implementTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="到期时间" align="center" prop="dueTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.dueTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="制度内容" align="center" prop="ruleContent" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:rules:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:rules:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 添加或修改规章制度对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="制度名" prop="ruleName">
<el-input v-model="form.ruleName" placeholder="请输入制度名" />
</el-form-item>
<el-form-item label="实施时间" prop="implementTime">
<el-date-picker clearable v-model="form.implementTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择实施时间">
</el-date-picker>
</el-form-item>
<el-form-item label="到期时间" prop="dueTime">
<el-date-picker clearable v-model="form.dueTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择到期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="制度内容">
<editor v-model="form.ruleContent" :min-height="192" />
</el-form-item>
<el-form-item label="是否删除" prop="delFlag">
<el-input v-model="form.delFlag" placeholder="请输入是否删除" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listRules, getRules, delRules, addRules, updateRules } from "@/api/sch/rules";
export default {
name: "Rules",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 规章制度表格数据
rulesList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
ruleName: null,
implementTime: null,
dueTime: null,
ruleContent: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询规章制度列表 */
getList() {
this.loading = true;
listRules(this.queryParams).then(response => {
this.rulesList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
ruleId: null,
ruleName: null,
implementTime: null,
dueTime: null,
ruleContent: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.ruleId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加规章制度";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const ruleId = row.ruleId || this.ids
getRules(ruleId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改规章制度";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.ruleId != null) {
updateRules(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addRules(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ruleIds = row.ruleId || this.ids;
this.$modal.confirm('是否确认删除规章制度编号为"' + ruleIds + '"的数据项?').then(function () {
return delRules(ruleIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
},
/** 导出按钮操作 */
handleExport() {
this.download('system/rules/export', {
...this.queryParams
}, `rules_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@@ -115,7 +115,7 @@ export default {
this.$modal.msgSuccess('删除成功');
}
})
.catch(() => {});
.catch(() => { });
}
}
};