| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <template>
- <basic-container>
- <avue-crud :option="option"
- :data="dataList"
- ref="crud"
- v-model="form"
- :page.sync="page"
- @row-del="rowDel"
- @row-update="rowUpdate"
- @row-save="rowSave"
- @search-change="searchChange"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @cell-dblclick="cellDblclick"
- @on-load="onLoad">
- </avue-crud>
- </basic-container>
- </template>
- <script>
- import option from "./configuration/statisticalList.json";
- export default {
- name: "statisticalList",
- data() {
- return {
- form: {},
- option: option,
- parentId:0,
- dataList: [],
- page: {
- pageSize: 10,
- pagerCount: 5,
- total: 0,
- },
- query:{}
- }
- },
- created() {
- console.log(parseInt(this.option.column.length / 4),111111111)
- if (parseInt(this.option.column.length / 4) !== this.option.column.length / 4){
- console.log(123)
- this.option.searchMenuSpan = 6;
- this.option.searchMenuPosition = "center";
- }else {
- this.option.searchMenuPosition = "right";
- }
- },
- mounted() {
- option.height = window.innerHeight - 340 ;
- },
- methods: {
- //删除列表后面的删除按钮触发触发(row, index, done)
- rowDel(row, index, done) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- // 数据回调进行刷新
- done();
- });
- },
- //修改时的修改按钮点击触发
- rowUpdate(row, index, done, loading) {
- setTimeout(() => {
- this.$message.success("修改成功");
- loading();
- done();
- }, 1000);
- // typeSave(row).then(() => {
- // this.$message({
- // type: "success",
- // message: "操作成功!"
- // });
- // // 数据回调进行刷新
- // done(row);
- // }, error => {
- // window.console.log(error);
- // loading();
- // });
- },
- //新增修改时保存触发
- rowSave(row, done, loading) {
- setTimeout(() => {
- this.$message.success("保存成功");
- loading();
- done();
- }, 1000);
- },
- //点击搜索按钮触发
- searchChange(params, done) {
- this.query = params;
- this.page.currentPage = 1;
- params.parentId = 0
- this.onLoad(this.page, params);
- done()
- },
- searchReset() {
- console.log('1')
- },
- selectionChange() {
- console.log('1')
- },
- currentChange() {
- console.log('1')
- },
- sizeChange() {
- console.log('1')
- },
- refreshChange() {
- console.log('1')
- },
- onLoad(page, params = {}) {
- const {createTimeA} = this.query;
- let values = {
- ...params,
- size:this.page.pageSize,
- current:this.page.currentPage
- };
- if (createTimeA) {
- values = {
- ...params,
- createTime: createTimeA[0] + ' 00:00:00',
- endTime: createTimeA[1] + ' 23:59:59',
- ...this.query,
- size:this.page.pageSize,
- current:this.page.currentPage
- };
- values.createTimeA = null;
- }
- values.parentId = 0;
- this.dataList = [
- {
- custmerName:"途宝",
- Ymoney:"2100",
- Smoney:"1500",
- qianfei:"600",
- kehuzt:"暂存",
- beizhu:"你好",
- zuixinxgr:"LOL",
- zuixinxgsj:"3030-10-10",
- },
- {
- custmerName:"途宝",
- Ymoney:"2100",
- Smoney:"1500",
- qianfei:"600",
- kehuzt:"暂存",
- beizhu:"你好",
- zuixinxgr:"LOL",
- zuixinxgsj:"3030-10-10",
- }
- ]
- this.page.total = 1
- // customerList(values).then(res => {
- //
- // })
- },
- cellDblclick(row, column, cell, event) {
- this.$refs.crud.rowEdit(row);
- }
- }
- }
- </script>
- <style scoped>
- </style>
|