| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <template>
- <el-row>
- <el-col :span="4" >
- <el-card :body-style="{'padding':'0'}">
- <export-tree-list-with-check-box-sk
- :pid="pid"
- :type="type"
- :pidNodes="pidNodes"
- :style="{'max-height':dxdcAsideHeight+'px'}"
- @treeCheckedDataChange="treeCheckedDataChange"
- ></export-tree-list-with-check-box-sk>
- </el-card>
- </el-col>
- <el-col :span="20">
- <el-card :body-style="{'padding-top':'0'}">
- <el-checkbox :indeterminate="isIndeterminate"
- v-model="checkAll"
- @change="handleCheckAllChange"
- style="margin-top: 10px"
- >全选</el-checkbox>
- <!--<el-checkbox :indeterminate="isIndeterminate"-->
- <!--v-model="checkSum"-->
- <!--@change="handleCheckSumChange"-->
- <!--style="margin-top: 10px"-->
- <!-->合并</el-checkbox>-->
- <el-checkbox-group v-model="checkTable">
- <el-checkbox v-for="table in tables"
- :label="table"
- :key="table"
- style="margin-top: 10px;"
- >{{table}}
- </el-checkbox>
- <el-button type="primary" icon="el-icon-check" style="float: right" @click="createExecl">导出</el-button>
- </el-checkbox-group>
- </el-card>
- <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
- <div style="width: 100%;height: 100%;overflow-y: auto" v-show="showDiv" v-loading="loadDiv" id="myDiv" ref="myDiv" >
- </div>
- </el-card>
- </el-col>
- </el-row>
- </template>
- <script>
- const tableOptions = [
- '小水库督查情况表'
- ];
- import request from '../../utils/gw_ajax_request.js';
- import exportTreeListWithCheckBoxSk from './exportTreeListWithCheckBox_sk'
- export default {
- name: "generalExport_shuiku",
- components: {
- exportTreeListWithCheckBoxSk:exportTreeListWithCheckBoxSk,
- },
- data() {
- return {
- tableIds:[],
- ids:[],
- pid:'000',
- pidNodes:[],
- type:'001',
- tables: tableOptions,
- checkAll:false,
- checkSum:false,
- checkSumState:0,
- checkTable:['小水库督查情况表'],
- dxdcMainHeight: window.innerHeight-160,
- dxdcAsideHeight: window.innerHeight-90,
- showDiv:true,
- loadDiv:false,
- }
- },
- mounted() {
- },
- computed: {
- userId: function () {
- return localStorage.getItem("userid")
- ? localStorage.getItem("userid")
- : "1098101939614724096";
- }
- },
- methods: {
- //树节点选中事件
- treeCheckedDataChange(params){
- //
- // 如果是选中状态,把元素id加入到ids里
- if(params.newStatus){
- params.newCheckedArray.forEach((element,index) => {
- let id = element.id;
- if(id != null && id !== undefined && id !=='' ){
- this.ids.push(id)
- }
- });
- }else {
- // 删除取消的元素id
- params.changedItem.forEach((element,index) => {
- let id = element.id;
- let inx = this.ids.indexOf(id);
- if(inx > -1) {
- delete this.ids[inx]
- }
- });
- }
- // 去重
- this.ids = Array.from(new Set(this.ids));
- },
- //表格点击选中事件
- handleCheckAllChange(val) {
- //
- this.checkTable = val ? tableOptions : [];
- this.isIndeterminate = false;
- },
- //合并按钮点击选中事件
- handleCheckSumChange(val){
- if(val){
- this.checkSumState = 1;
- }else{
- this.checkSumState = 0;
- }
- this.isIndeterminate = false;
- },
- //创建Excel事件
- createExecl(){
- this.$refs.myDiv.innerHTML = "";
- this.loadDiv = true;
- let _tableIds = [];
- this.checkTable.forEach((element,index) => {
- let tableName = "";
- switch (element){
- case "小水库督查情况表" :
- tableName = "08";
- break;
- }
- _tableIds.push(tableName);
- });
- this.tableIds = _tableIds;
- let params = {
- "type":"rsvr",
- "presId":this.userId,
- "pType":"1",
- "tableIds":this.tableIds.toString(),
- "ids":this.ids.toString()
- }
- request.post('/dc/gd/base/create/sk', params).then((res) => {
- this.$refs.myDiv.innerHTML = res;
- this.loadDiv = false;
- })
- },
- },
- watch:{
- }
- }
- </script>
- <style scoped>
- </style>
|