2 files modified
3 files added
| New file |
| | |
| | | import request from '@/axios';
|
| | |
|
| | | export const getList = (current, size, params) => {
|
| | | return request({
|
| | | url: '/evaluate/evaluateResult/list',
|
| | | method: 'get',
|
| | | params: {
|
| | | ...params,
|
| | | current,
|
| | | size,
|
| | | }
|
| | | })
|
| | | }
|
| | |
|
| | | export const getDetail = (id) => {
|
| | | return request({
|
| | | url: '/evaluate/evaluateResult/detail',
|
| | | method: 'get',
|
| | | params: {
|
| | | id
|
| | | }
|
| | | })
|
| | | }
|
| | |
|
| | | export const remove = (ids) => {
|
| | | return request({
|
| | | url: '/evaluate/evaluateResult/remove',
|
| | | method: 'post',
|
| | | params: {
|
| | | ids,
|
| | | }
|
| | | })
|
| | | }
|
| | |
|
| | | export const add = (row) => {
|
| | | return request({
|
| | | url: '/evaluate/evaluateResult/submit',
|
| | | method: 'post',
|
| | | data: row
|
| | | })
|
| | | }
|
| | |
|
| | | export const update = (row) => {
|
| | | return request({
|
| | | url: '/evaluate/evaluateResult/submit',
|
| | | method: 'post',
|
| | | data: row
|
| | | })
|
| | | }
|
| | |
|
| New file |
| | |
| | | export default {
|
| | | height:'auto',
|
| | | calcHeight: 30,
|
| | | tip: false,
|
| | | searchShow: true,
|
| | | searchMenuSpan: 6,
|
| | | border: true,
|
| | | index: true,
|
| | | viewBtn: true,
|
| | | selection: true,
|
| | | dialogClickModal: false,
|
| | | column: [
|
| | | {
|
| | | label: "主键",
|
| | | prop: "id",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "租户ID",
|
| | | prop: "tenantId",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "评优任务",
|
| | | prop: "assessmentTaskId",
|
| | | type: "input",
|
| | | },
|
| | | {
|
| | | label: "被评优的人/部门",
|
| | | prop: "beId",
|
| | | type: "input",
|
| | | },
|
| | | {
|
| | | label: "评优人",
|
| | | prop: "scoreUserId",
|
| | | type: "input",
|
| | | },
|
| | | {
|
| | | label: "评优说明",
|
| | | prop: "remark",
|
| | | type: "input",
|
| | | },
|
| | | {
|
| | | label: "类型(0:员工评优,1:部门评优,2:公司评优)",
|
| | | prop: "type",
|
| | | type: "input",
|
| | | },
|
| | | {
|
| | | label: "创建人",
|
| | | prop: "createUser",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "创建部门",
|
| | | prop: "createDept",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "创建时间",
|
| | | prop: "createTime",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "修改人",
|
| | | prop: "updateUser",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "修改时间",
|
| | | prop: "updateTime",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "状态",
|
| | | prop: "status",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "是否已删除",
|
| | | prop: "isDeleted",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | ]
|
| | | }
|
| | |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | | viewBtn: false, |
| | | deleteBtn: false, |
| | | editBtn: false, |
| | | addBtn: false, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | menu: false, |
| | | column: [ |
| | | { |
| | | label: "主键", |
| | |
| | | label: "留言内容", |
| | | prop: "content", |
| | | type: "input", |
| | | search: true |
| | | }, |
| | | { |
| | | label: "图片数组", |
| | | prop: "imageUrls", |
| | | type: "input", |
| | | slot: true |
| | | }, |
| | | { |
| | | label: "创建人", |
| New file |
| | |
| | | <template>
|
| | | <basic-container>
|
| | | <avue-crud :option="option" v-model:search="search" v-model:page="page" v-model="form" :table-loading="loading"
|
| | | :data="data" :permission="permissionList" :before-open="beforeOpen" ref="crud" @row-update="rowUpdate"
|
| | | @row-save="rowSave" @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset"
|
| | | @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
|
| | | @refresh-change="refreshChange" @on-load="onLoad">
|
| | | <template #menu-left>
|
| | | <el-button type="danger" icon="el-icon-delete" plain v-if="permission.evaluateResult_delete"
|
| | | @click="handleDelete">删 除
|
| | | </el-button>
|
| | | <el-button type="warning" plain icon="el-icon-download" @click="handleExport">导 出
|
| | | </el-button>
|
| | | </template>
|
| | | </avue-crud>
|
| | | </basic-container>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { getList, getDetail, add, update, remove } from "@/api/evaluate/evaluateResult";
|
| | | import option from "@/option/evaluate/evaluateResult";
|
| | | import { mapGetters } from "vuex";
|
| | | import { exportBlob } from "@/api/common";
|
| | | import { getToken } from '@/utils/auth';
|
| | | import { downloadXls } from "@/utils/util";
|
| | | import { dateNow } from "@/utils/date";
|
| | | import NProgress from 'nprogress';
|
| | | import 'nprogress/nprogress.css';
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | form: {},
|
| | | query: {},
|
| | | search: {},
|
| | | loading: true,
|
| | | page: {
|
| | | pageSize: 10,
|
| | | currentPage: 1,
|
| | | total: 0
|
| | | },
|
| | | selectionList: [],
|
| | | option: option,
|
| | | data: []
|
| | | };
|
| | | },
|
| | | computed: {
|
| | | ...mapGetters(["permission"]),
|
| | | permissionList() {
|
| | | return {
|
| | | addBtn: this.validData(this.permission.evaluateResult_add, false),
|
| | | viewBtn: this.validData(this.permission.evaluateResult_view, false),
|
| | | delBtn: this.validData(this.permission.evaluateResult_delete, false),
|
| | | editBtn: this.validData(this.permission.evaluateResult_edit, false)
|
| | | };
|
| | | },
|
| | | ids() {
|
| | | let ids = [];
|
| | | this.selectionList.forEach(ele => {
|
| | | ids.push(ele.id);
|
| | | });
|
| | | return ids.join(",");
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | rowSave(row, done, loading) {
|
| | | add(row).then(() => {
|
| | | this.onLoad(this.page);
|
| | | this.$message({
|
| | | type: "success",
|
| | | message: "操作成功!"
|
| | | });
|
| | | done();
|
| | | }, error => {
|
| | | loading();
|
| | | window.console.log(error);
|
| | | });
|
| | | },
|
| | | rowUpdate(row, index, done, loading) {
|
| | | update(row).then(() => {
|
| | | this.onLoad(this.page);
|
| | | this.$message({
|
| | | type: "success",
|
| | | message: "操作成功!"
|
| | | });
|
| | | done();
|
| | | }, error => {
|
| | | loading();
|
| | | console.log(error);
|
| | | });
|
| | | },
|
| | | rowDel(row) {
|
| | | this.$confirm("确定将选择数据删除?", {
|
| | | confirmButtonText: "确定",
|
| | | cancelButtonText: "取消",
|
| | | type: "warning"
|
| | | })
|
| | | .then(() => {
|
| | | return remove(row.id);
|
| | | })
|
| | | .then(() => {
|
| | | this.onLoad(this.page);
|
| | | this.$message({
|
| | | type: "success",
|
| | | message: "操作成功!"
|
| | | });
|
| | | });
|
| | | },
|
| | | handleDelete() {
|
| | | if (this.selectionList.length === 0) {
|
| | | this.$message.warning("请选择至少一条数据");
|
| | | return;
|
| | | }
|
| | | this.$confirm("确定将选择数据删除?", {
|
| | | confirmButtonText: "确定",
|
| | | cancelButtonText: "取消",
|
| | | type: "warning"
|
| | | })
|
| | | .then(() => {
|
| | | return remove(this.ids);
|
| | | })
|
| | | .then(() => {
|
| | | this.onLoad(this.page);
|
| | | this.$message({
|
| | | type: "success",
|
| | | message: "操作成功!"
|
| | | });
|
| | | this.$refs.crud.toggleSelection();
|
| | | });
|
| | | },
|
| | | handleExport() {
|
| | | let downloadUrl = `/evaluate/evaluateResult/export-evaluateResult?${this.website.tokenHeader}=${getToken()}`;
|
| | | const {
|
| | | } = this.query;
|
| | | let values = {
|
| | | };
|
| | | this.$confirm("是否导出数据?", "提示", {
|
| | | confirmButtonText: "确定",
|
| | | cancelButtonText: "取消",
|
| | | type: "warning"
|
| | | }).then(() => {
|
| | | NProgress.start();
|
| | | exportBlob(downloadUrl, values).then(res => {
|
| | | downloadXls(res.data, `评优结果${dateNow()}.xlsx`);
|
| | | NProgress.done();
|
| | | })
|
| | | });
|
| | | },
|
| | | beforeOpen(done, type) {
|
| | | if (["edit", "view"].includes(type)) {
|
| | | getDetail(this.form.id).then(res => {
|
| | | this.form = res.data.data;
|
| | | });
|
| | | }
|
| | | done();
|
| | | },
|
| | | searchReset() {
|
| | | this.query = {};
|
| | | this.onLoad(this.page);
|
| | | },
|
| | | searchChange(params, done) {
|
| | | this.query = params;
|
| | | this.page.currentPage = 1;
|
| | | this.onLoad(this.page, params);
|
| | | done();
|
| | | },
|
| | | selectionChange(list) {
|
| | | this.selectionList = list;
|
| | | },
|
| | | selectionClear() {
|
| | | this.selectionList = [];
|
| | | this.$refs.crud.toggleSelection();
|
| | | },
|
| | | currentChange(currentPage) {
|
| | | this.page.currentPage = currentPage;
|
| | | },
|
| | | sizeChange(pageSize) {
|
| | | this.page.pageSize = pageSize;
|
| | | },
|
| | | refreshChange() {
|
| | | this.onLoad(this.page, this.query);
|
| | | },
|
| | | onLoad(page, params = {}) {
|
| | | this.loading = true;
|
| | |
|
| | | const {
|
| | | } = this.query;
|
| | |
|
| | | let values = {
|
| | | };
|
| | |
|
| | | getList(page.currentPage, page.pageSize, values).then(res => {
|
| | | const data = res.data.data;
|
| | | this.page.total = data.total;
|
| | | this.data = data.records;
|
| | | this.loading = false;
|
| | | this.selectionClear();
|
| | | });
|
| | | }
|
| | | }
|
| | | };
|
| | | </script>
|
| | |
|
| | | <style></style>
|
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | v-model:search="search" |
| | | v-model:page="page" |
| | | v-model="form" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | ref="crud" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @row-del="rowDel" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <avue-crud :option="option" v-model:search="search" v-model:page="page" v-model="form" :table-loading="loading" |
| | | :data="data" :permission="permissionList" :before-open="beforeOpen" ref="crud" @row-update="rowUpdate" |
| | | @row-save="rowSave" @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" |
| | | @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @on-load="onLoad"> |
| | | <template #menu-left> |
| | | <el-button type="danger" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.leaveWords_delete" |
| | | @click="handleDelete">删 除 |
| | | <el-button type="danger" icon="el-icon-delete" plain v-if="permission.leaveWords_delete" @click="handleDelete">删 除 |
| | | </el-button> |
| | | <el-button type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | @click="handleExport">导 出 |
| | | <el-button type="warning" plain icon="el-icon-download" @click="handleExport">导 出 |
| | | </el-button> |
| | | </template> |
| | | <template #imageUrls="{ row }"> |
| | | <div v-if="row.imageUrls.length > 0 || !!row.imageUrls"> |
| | | <el-image style="width: 70px;height: 70px;" :src="row.imageUrls[1]" :zoom-rate="1.2" :max-scale="7" |
| | | :min-scale="0.2" :preview-src-list="row.imageUrls" :initial-index="4" fit="cover"></el-image> |
| | | </div> |
| | | <div v-else>暂无图片</div> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, getTree, add, update, remove} from "@/api/leave/leaveWords"; |
| | | import option from "@/option/leave/leaveWords"; |
| | | import {mapGetters} from "vuex"; |
| | | import {exportBlob} from "@/api/common"; |
| | | import {getToken} from '@/utils/auth'; |
| | | import {downloadXls} from "@/utils/util"; |
| | | import {dateNow} from "@/utils/date"; |
| | | import NProgress from 'nprogress'; |
| | | import 'nprogress/nprogress.css'; |
| | | import { getList, getDetail, getTree, add, update, remove } from "@/api/leave/leaveWords"; |
| | | import option from "@/option/leave/leaveWords"; |
| | | import { mapGetters } from "vuex"; |
| | | import { exportBlob } from "@/api/common"; |
| | | import { getToken } from '@/utils/auth'; |
| | | import { downloadXls } from "@/utils/util"; |
| | | import { dateNow } from "@/utils/date"; |
| | | import NProgress from 'nprogress'; |
| | | import 'nprogress/nprogress.css'; |
| | | |
| | | export default { |
| | | data() { |
| | | export default { |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | search: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | selectionList: [], |
| | | option: option, |
| | | data: [] |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | search: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | selectionList: [], |
| | | option: option, |
| | | data: [] |
| | | addBtn: this.validData(this.permission.leaveWords_add, false), |
| | | viewBtn: this.validData(this.permission.leaveWords_view, false), |
| | | delBtn: this.validData(this.permission.leaveWords_delete, false), |
| | | editBtn: this.validData(this.permission.leaveWords_edit, false) |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.validData(this.permission.leaveWords_add, false), |
| | | viewBtn: this.validData(this.permission.leaveWords_view, false), |
| | | delBtn: this.validData(this.permission.leaveWords_delete, false), |
| | | editBtn: this.validData(this.permission.leaveWords_edit, false) |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | loading(); |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | handleExport() { |
| | | let downloadUrl = `/leave/leaveWords/export-leaveWords?${this.website.tokenHeader}=${getToken()}`; |
| | | const { |
| | | } = this.query; |
| | | let values = { |
| | | }; |
| | | this.$confirm("是否导出数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | NProgress.start(); |
| | | exportBlob(downloadUrl, values).then(res => { |
| | | downloadXls(res.data, `留言板块${dateNow()}.xlsx`); |
| | | NProgress.done(); |
| | | }) |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange(currentPage){ |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize){ |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | |
| | | const { |
| | | } = this.query; |
| | | |
| | | let values = { |
| | | }; |
| | | |
| | | getList(page.currentPage, page.pageSize, values).then(res => { |
| | | this.data = res.data.data; |
| | | this.loading = false; |
| | | getTree().then(res => { |
| | | const column = this.findObject(this.option.column, "parentId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | }); |
| | | } |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | } |
| | | }; |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | loading(); |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | handleExport() { |
| | | let downloadUrl = `/leave/leaveWords/export-leaveWords?${this.website.tokenHeader}=${getToken()}`; |
| | | const { |
| | | } = this.query; |
| | | let values = { |
| | | }; |
| | | this.$confirm("是否导出数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | NProgress.start(); |
| | | exportBlob(downloadUrl, values).then(res => { |
| | | downloadXls(res.data, `留言板块${dateNow()}.xlsx`); |
| | | NProgress.done(); |
| | | }) |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | |
| | | const { |
| | | } = this.query; |
| | | |
| | | let values = { |
| | | ...this.query, |
| | | ...params |
| | | }; |
| | | |
| | | getList(page.currentPage, page.pageSize, values).then(res => { |
| | | this.data = res.data.data; |
| | | this.loading = false; |
| | | getTree().then(res => { |
| | | const column = this.findObject(this.option.column, "parentId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | </style> |
| | | <style></style> |