222
schangxiang@126.com
2025-04-29 4352ad5cbeef498392178655cb367ee38e574178
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
<template>
  <section>
    <!--¹¤¾ßÌõ-->
    <el-col :span="24"
            class="toolbar"
            style="padding-bottom: 0px;">
      <el-form :inline="true"
               @submit.native.prevent>
        <toolbar :buttonList="buttonList"
                 @callFunction="callFunction">
        </toolbar>
        <!-- ËÑË÷ -->
        <SearchForm :commonSearchOptionSet="c_commonSearchOptionSet"
                    :searchValControlStyle="c_searchValControlStyle"
                    :searchFormInputPlaceholder="c_searchFormInputPlaceholder"
                    :searchFormInputAttrs="c_searchFormInputAttrs"
                    :formOptions="h_formOptions"
                    :drawerSize="h_drawerSize"
                    :labelWidth="h_labelWidth"
                    :controlStyle="h_controlStyle"
                    ref="ChildSearchForm"
                    @onSearch="_get$Modulelogo$s" />
      </el-form>
    </el-col>
 
    <!--Áбí-->
    <el-table :data="$Modulelogo$s"
              :max-height="tableHeight"
              highlight-current-row
              size="small"
              :height="tableHeight"
              @current-change="selectCurrentRow"
              v-loading="listLoading"
              @selection-change="selsChange"
              style="width: 99%;">
      <el-table-column type="index"
                       :index="indexMethod"
                       label="#"
                       align="center"
                       width="50">
      </el-table-column>
      $el-table-column$
      <el-table-column label="²Ù×÷"
                       fixed="right"
                       width="180"
                       v-if="isShowOperatorColumn">
        <template scope="scope">
          <el-button size="small"
                     icon="el-icon-edit"
                     type="primary"
                     v-if="isShowOperatorButton('edit')"
                     @click="handleEdit(scope.row)">±à¼­</el-button>
          <el-button type="danger"
                     size="small"
                     icon="el-icon-delete"
                     v-if="isShowOperatorButton('del')"
                     @click="handleDel(scope.row)">ɾ³ý</el-button>
        </template>
      </el-table-column>
    </el-table>
 
    <!--¹¤¾ßÌõ-->
    <el-col :span="24"
            style="margin:10px 10px 10px 0px;"
            class="toolbar">
      <el-pagination @size-change="handleSizeChange"
                     @current-change="handleCurrentChange"
                     :current-page="page"
                     background
                     :page-sizes="[5,10,50,100, 200, 300, 400]"
                     :page-size="pageSize"
                     layout="total, sizes, prev, pager, next, jumper"
                     :total="total">
      </el-pagination>
    </el-col>
    <!--ÐÂÔö/±à¼­½çÃæ-->
    <el-dialog :title="dialogTitle"
               :visible.sync="addFormVisible"
               :close-on-click-modal="false"
               :before-close="cancelHandle">
      <el-form :model="addForm"
               size="small"
               label-width="120px"
               ref="addForm">
        $el-item$
      </el-form>
      <div slot="footer"
           class="dialog-footer">
        <el-button @click.native="cancelHandle" icon="fa fa-power-off">È¡Ïû</el-button>
        <el-button type="primary"
                   @click.native="submitDataHandle"
                   :loading="addLoading" icon="fa fa-send">Ìá½»</el-button>
      </div>
    </el-dialog>
     <!--²é¿´½çÃæ-->
    <el-dialog title="²é¿´"
               :visible.sync="viewDetailVisible"
               :before-close="cancelHandle">
      <el-form :model="viewDetailForm"
               size="small"
               disabled="true"
               label-width="120px"
               ref="viewDetailForm">
       $el-item-view$
      </el-form>
      <div slot="footer"
           class="dialog-footer">
        <el-button @click.native="closeViewHandle" icon="fa fa-power-off">¹Ø±Õ</el-button>
      </div>
    </el-dialog>
    <!-- µ¼³ö×é¼þ -->
    <ToolbarExport ref="cmToolbarExport"
                   :exportFileName="export_exportFileName"
                   :currentPageData="export_currentPageData"
                   :exportColumnHeader="export_columnHeader" />
    <!-- µ¼ÈëExcel×é¼þ -->
    <ToolbarImportExcel ref="tbImportExcel"
                        :importExcelCategroy="emport_excelCategroy"
                        :templeteFileDownName="emport_templeteFileDownName"></ToolbarImportExcel>
  </section>
</template>
 
<script>
import util from '../../../util/date'
import { get$Modulelogo$ListPage, remove$Modulelogo$, edit$Modulelogo$, add$Modulelogo$ } from '../../api/api';
import { getButtonList } from "../../promissionRouter";
import Toolbar from "../../components/ToolbarButton";
import SearchForm from "../../components/SearchForm";
import ToolbarExport from "../../components/ToolbarExport";
import ToolbarImportExcel from "../../components/ToolbarImportExcel";
import { formatDate, setformOptionsNewValue } from '../../../util/tools'
import { isShowOperatorButtonCommon, isNeedShowOperatorColumn, isMobile } from '../../../util/common'
 
 
export default {
  components: { Toolbar, SearchForm, ToolbarExport,ToolbarImportExcel },//×¢²á×Ó×é¼þ
  data () {
    return {
      //µ¼ÈëExcelÊý¾ÝÏà¹Ø
      emport_templeteFileDownName: '$emport_templeteFileDownName$.xlsx',//ÎļþÏÂÔØÃû×Ö
      emport_excelCategroy: "$emport_excelCategroy$",//ÉÏ´«ÎļþµÄÇëÇó·ÖÀà
      //µ¼³ö×é¼þÏà¹Ø
      export_exportFileName: '$ChinaComment$ÐÅÏ¢',//Òªµ¼³öµÄÎļþÃû
      export_currentPageData: [],//µ±Ç°Ò³ÃæµÄÁбíÊý¾Ý
      export_columnHeader: {$VueExportColumnHeaderStr$},//µ±Ç°Ò³ÃæÁбíµÄ±íÍ·ºº×ÖºÍÊôÐÔÊý×飬µ¼³öÓà
 
      //ËÑË÷¿òÏà¹Ø
      c_commonSearchOptionSet: "Ä£ºý",//ͨÓòéѯµÄĬÈÏÅäÖÃ,"Ä£ºý"»ò"¾«×¼"
      c_searchValControlStyle: {//ÉèÖÃͨÓÃËÑË÷¿òµÄ³¤¶ÈµÈÑùʽ 
        width: '300px',
      },
      c_searchFormInputPlaceholder: 'ÇëÊäÈë$SearchFormInputPlaceholderStr$',//Òª¸ø×ÓËÑË÷×é¼þ´«µÝµÄÖµ
      c_searchFormInputAttrs: [$SearchFormInputPlaceholderNameStr$],//Òª¸ø×ÓËÑË÷×é¼þ´«µÝµÄÊôÐÔÃû
      h_controlStyle: {//ÉèÖø߼¶ËÑË÷¿Ø¼þµÄ³¤¶ÈµÈÑùʽ 
        width: '350px',
      },
      h_labelWidth: "100px",//ÏÔʾLabelµÄ¿í¶È
      h_drawerSize: "600px",//drawner¿í¶ÈÉèÖÃ
      h_formOptions: [
        $FormOptionsStr$
      ],
 
      isShowOperatorColumn: true,// ÊÇ·ñÏÔʾ¡¾²Ù×÷¡¿ÁÐ,trueÏÔʾ false²»ÏÔʾ
      tableHeight: window.innerHeight - 180, // ¿ØÖƱí¸ñµÄ¸ß¶È
 
      isAdd: false, // ÊÇ·ñÊÇÐÂÔö
      dialogTitle: '',
 
       //²é¿´ÓйØ
      viewDetailVisible: false,
      viewDetailForm: {},
 
      filters: {
        name: ''
      },
      $Modulelogo$s: [],
      total: 0,
      buttonList: [],
      currentRow: null,
      page: 1,
      pageSize: 10,
      listLoading: false,
      sels: [],//ÁбíÑ¡ÖÐÁÐ
 
      addFormVisible: false,//ÐÂÔö½çÃæÊÇ·ñÏÔʾ
      addLoading: false,
      //ÐÂÔö»ò±à¼­½çÃæÊý¾Ý
      addForm: {
        //×¢Ò⣺ÕâÀï²»ÐèҪд³õʼֵ£¬³õʼֵ¶¼Ð´ÔÚ init_addFormÖÐ
      },
      init_addForm: {
        //×¢Ò⣺ÕâÀïд³õʼֵ
      }
    }
  },
  methods: {
     //ÊÇ·ñÏÔʾij¸ö²Ù×÷°´Å¥
    isShowOperatorButton (flag) {
      return isShowOperatorButtonCommon(this.isShowOperatorColumn, flag, this.buttonList)
    },
    // ÉèÖÃË÷Òý
    indexMethod (index) {
      return (this.page - 1) * this.pageSize + 1 + index
    },
    // Ê±¼ä¸ñʽ»¯
    formatterDateTime (row, column, cellValue, index) {
       if (cellValue === null || cellValue === '') {
        return ''
      }
      var NewDtime = new Date(Date.parse(cellValue))
      return formatDate(NewDtime, 'yyyy-MM-dd hh:mm:ss')
    },
    selectCurrentRow (val) {
      this.currentRow = val;
    },
    callFunction (item) {
      this.filters = {
        name: item.search
      };
      this[item.Func].apply(this, item);
    },
    handleCurrentChange (val) {
      this.page = val;
      this.get$Modulelogo$s();
    },
    handleSizeChange (val) {
      this.pageSize = val;
      this.get$Modulelogo$s();
    },
    /**
     * »ñÈ¡ÇëÇó²ÎÊý
     * flag:±ê¼Ç£¬1´ú±íÆÕͨ·ÖÒ³²éѯ£¬2´ú±í²»·ÖÒ³£¬»ñȡȫ²¿Êý¾Ý
     */
    getPostParam (flag) {
      let para = Object.assign({}, this.$refs.ChildSearchForm.getFormData());
      para.page = this.page
      para.pageSize = this.pageSize
      if (flag === '2') { // È«²¿µ¼³ö
        para.page = 1
        para.pageSize = 10000
      }
      return para
    },
    //µã»÷°´Å¥¡¾²éѯ¡¿
    _get$Modulelogo$s () {
      this.page = 1
      this.get$Modulelogo$s()
    },
    //»ñÈ¡Áбí
    get$Modulelogo$s (formValue) {
      //this.total = 0
      //this.$Modulelogo$s = null
      let para = this.getPostParam('1');
      this.listLoading = true;
      get$Modulelogo$ListPage(para).then((res) => {
        if (res.data.success) {
          this.total = res.data.response.dataCount;
          this.$Modulelogo$s = res.data.response.data;
        } else {
          this.$message({
            message: res.data.msg,
            type: 'error'
          });
        }
        this.listLoading = false;
      });
    },
    //»ñȡȫ²¿Áбí
    exportAllData () {
      let para = this.getPostParam('2');
      this.listLoading = true;
      get$Modulelogo$ListPage(para).then((res) => {
        var allData = res.data.response.data;
        this.$refs.cmToolbarExport.export2Excel(allData);
        this.listLoading = false;
      });
    },
    //ɾ³ý
    handleDel (selRow) {
      let row = {};
      if (selRow && selRow != undefined) {
        this.currentRow = selRow;
      }
      row = this.currentRow;
      if (!row) {
        this.$message({
          message: "ÇëÑ¡ÔñҪɾ³ýµÄÒ»ÐÐÊý¾Ý£¡",
          type: "warning"
        });
        return;
      }
      this.$confirm('È·ÈÏɾ³ý¸Ã¼Ç¼Âð?', 'Ìáʾ', {
        type: 'warning'
      }).then(() => {
        this.listLoading = true;
        let para = { id: row.Id };
        remove$Modulelogo$(para).then((res) => {
 
          if (util.isEmt.format(res)) {
            this.listLoading = false;
            return;
          }
          this.listLoading = false;
          if (res.data.success) {
            this.$message({
              message: 'ɾ³ý³É¹¦',
              type: 'success'
            });
 
          } else {
            this.$message({
              message: res.data.msg,
              type: 'error'
            });
          }
 
          this._get$Modulelogo$s();
        });
      }).catch(() => {
 
      });
    },
    //ÏÔʾ±à¼­½çÃæ
    handleEdit (selRow) {
      let row = {};
      if (selRow && selRow != undefined) {
        this.currentRow = selRow;
      }
      row = this.currentRow;
      if (!row) {
        this.$message({
          message: "ÇëÑ¡ÔñÒª±à¼­µÄÒ»ÐÐÊý¾Ý£¡",
          type: "warning"
        });
 
        return;
      }
      this.isAdd = false
      this.dialogTitle = '±à¼­'
      this.addFormVisible = true;
      this.addForm = Object.assign({}, row);
    },
    //ÏÔʾÐÂÔö½çÃæ
    handleAdd () {
      this.isAdd = true
      this.dialogTitle = 'ÐÂÔö'
      this.addFormVisible = true;
      this.setInitAddForm()
    },
    //È¡ÏûÌá½»Êý¾Ý²Ù×÷
    cancelHandle (done) {
      this.setInitAddForm()
      this.addFormVisible = false
 
      done() //done ÓÃÓڹرՠDialog
    },
    // Ìá½»Êý¾Ý
    submitDataHandle (formName) {
      this.submitDisabled = true
 
      this.$refs.addForm.validate((valid) => {
        if (valid) {
          this.$confirm('È·ÈÏÌá½»Âð£¿', 'Ìáʾ', {}).then(() => {
            this.addLoading = true;
            let para = Object.assign({}, this.addForm);
            if (this.isAdd) {//ÐÂÔö
              add$Modulelogo$(para).then((res) => {
                if (util.isEmt.format(res)) {
                  this.addLoading = false;
                  return;
                }
 
                if (res.data.success) {
                  this.addLoading = false;
                  this.$message({
                    message: res.data.msg,
                    type: 'success'
                  });
                  this.$refs['addForm'].resetFields();
                  this.addFormVisible = false;
                  this._get$Modulelogo$s();
                }
                else {
                  this.addLoading = false;
                  this.$message({
                    message: res.data.msg,
                    type: 'error'
                  });
                }
 
              });
            } else {//±à¼­
              edit$Modulelogo$(para).then((res) => {
                if (util.isEmt.format(res)) {
                  this.addLoading = false;
                  return;
                }
                if (res.data.success) {
                  this.addLoading = false;
                  //NProgress.done();
                  this.$message({
                    message: res.data.msg,
                    type: 'success'
                  });
                  this.$refs['addForm'].resetFields();
                  this.addFormVisible = false;
                  this._get$Modulelogo$s();
                }
                else {
                  this.addLoading = false;
                  this.$message({
                    message: res.data.msg,
                    type: 'error'
                  });
                }
              });
            }
          });
        }
      });
    },
    selsChange: function (sels) {
      this.sels = sels;
    },
    //µ¼³ö
    handleExport () {
      this.export_currentPageData = this.$Modulelogo$s
      this.$refs.cmToolbarExport.showPrintPage()
    },
    //µ¼Èë 
    handleImport () {
      this.$refs.tbImportExcel.showPage()
    },
      /******************************************[²é¿´½çÃæ]¿ªÊ¼*********************************************************** */
    //ÏÔʾ²é¿´½çÃæ 
    handleView (selRow) {
      let row = {};
      if (selRow && selRow != undefined) {
        this.currentRow = selRow;
      }
      row = this.currentRow;
      if (!row) {
        this.$message({
          message: "ÇëÑ¡ÔñÒª²é¿´µÄÒ»ÐÐÊý¾Ý£¡",
          type: "warning"
        });
        return;
      }
      this.viewDetailVisible = true
      this.viewDetailForm = {
      };
      this.viewDetailForm = Object.assign({}, row);
    },
    //¹Ø±Õ²é¿´½çÃæ
    closeViewHandle () {
      this.viewDetailVisible = false
    },
    /******************************************[²é¿´½çÃæ]½áÊø*********************************************************** */
    //addForm¸³³õʼֵ
    setInitAddForm () {
      this.addForm = Object.assign({}, this.init_addForm)
    }
  },
  mounted () {
    if (isMobile()) {
      this.h_drawerSize = "99%"//drawner¿í¶ÈÉèÖà
    } else {
      this.h_drawerSize = "600px"//drawner¿í¶ÈÉèÖà
    }
    this.setInitAddForm()
    this._get$Modulelogo$s();
 
    let routers = window.localStorage.router
      ? JSON.parse(window.localStorage.router)
      : [];
    this.buttonList = getButtonList(this.$route.path, routers);
    let isShow = isNeedShowOperatorColumn(this.buttonList);//¿ØÖÆÊÇ·ñÒªÏÔʾ¡¾²Ù×÷¡¿ÁÐ
    this.isShowOperatorColumn = isShow;
  }
}
 
</script>
 
<style lang="scss" scoped>
</style>