From a637cdb04ab7e0954196ad0d8e7cc24ae22ee93a Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 10 三月 2026 13:22:22 +0800
Subject: [PATCH] #
---
src/main/webapp/static/js/basDevp/basDevp.js | 2829 ++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 2,517 insertions(+), 312 deletions(-)
diff --git a/src/main/webapp/static/js/basDevp/basDevp.js b/src/main/webapp/static/js/basDevp/basDevp.js
index a373c0a..60dd95f 100644
--- a/src/main/webapp/static/js/basDevp/basDevp.js
+++ b/src/main/webapp/static/js/basDevp/basDevp.js
@@ -1,328 +1,2533 @@
-var pageCurr;
-layui
- .config({
- base: baseUrl + "/static/layui/lay/modules/",
- })
- .use(["table", "laydate", "form", "admin"], function () {
- var table = layui.table;
- var $ = layui.jquery;
- var layer = layui.layer;
- var layDate = layui.laydate;
- var form = layui.form;
- var admin = layui.admin;
+(function () {
+ var simpleEntityName = 'basDevp';
+ var entityName = 'BasDevp';
+ var primaryKeyField = 'id';
+ var fieldMeta = dedupeFieldMeta([
+ {
+ field: 'devNo',
+ columnName: 'dev_no',
+ label: '',
+ tableProp: 'devNo',
+ exportField: 'devNo',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'decDesc',
+ columnName: 'dec_desc',
+ label: '',
+ tableProp: 'decDesc',
+ exportField: 'decDesc',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'devMk',
+ columnName: 'dev_mk',
+ label: '',
+ tableProp: 'devMk',
+ exportField: 'devMk',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'inEnable',
+ columnName: 'in_enable',
+ label: '',
+ tableProp: 'inEnable',
+ exportField: 'inEnable',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'outEnable',
+ columnName: 'out_enable',
+ label: '',
+ tableProp: 'outEnable',
+ exportField: 'outEnable',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'autoing',
+ columnName: 'autoing',
+ label: '',
+ tableProp: 'autoing',
+ exportField: 'autoing',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'loading',
+ columnName: 'loading',
+ label: '',
+ tableProp: 'loading',
+ exportField: 'loading',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'canining',
+ columnName: 'canining',
+ label: '',
+ tableProp: 'canining',
+ exportField: 'canining',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'canouting',
+ columnName: 'canouting',
+ label: '',
+ tableProp: 'canouting',
+ exportField: 'canouting',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'fronting',
+ columnName: 'fronting',
+ label: '',
+ tableProp: 'fronting',
+ exportField: 'fronting',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'rearing',
+ columnName: 'rearing',
+ label: '',
+ tableProp: 'rearing',
+ exportField: 'rearing',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'uping',
+ columnName: 'uping',
+ label: '',
+ tableProp: 'uping',
+ exportField: 'uping',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'downing',
+ columnName: 'downing',
+ label: '',
+ tableProp: 'downing',
+ exportField: 'downing',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'inreq1',
+ columnName: 'inreq1',
+ label: '',
+ tableProp: 'inreq1',
+ exportField: 'inreq1',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'inreq2',
+ columnName: 'inreq2',
+ label: '',
+ tableProp: 'inreq2',
+ exportField: 'inreq2',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'wrkNo',
+ columnName: 'wrk_no',
+ label: '',
+ tableProp: 'wrkNo',
+ exportField: 'wrkNo',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'wrkNo1',
+ columnName: 'wrk_no1',
+ label: '',
+ tableProp: 'wrkNo1',
+ exportField: 'wrkNo1',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'ctnType',
+ columnName: 'ctn_type',
+ label: '',
+ tableProp: 'ctnType',
+ exportField: 'ctnType',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'barcode',
+ columnName: 'barcode',
+ label: '',
+ tableProp: 'barcode',
+ exportField: 'barcode',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'inQty',
+ columnName: 'in_qty',
+ label: '',
+ tableProp: 'inQty',
+ exportField: 'inQty',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'row1',
+ columnName: 'row1',
+ label: '',
+ tableProp: 'row1',
+ exportField: 'row1',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'ioTime',
+ columnName: 'io_time',
+ label: '',
+ tableProp: 'ioTime$',
+ exportField: 'ioTime$',
+ kind: 'date',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 168,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'area',
+ columnName: 'area',
+ label: '',
+ tableProp: 'area',
+ exportField: 'area',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'inOk',
+ columnName: 'in_ok',
+ label: '',
+ tableProp: 'inOk',
+ exportField: 'inOk',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'outOk',
+ columnName: 'out_ok',
+ label: '',
+ tableProp: 'outOk',
+ exportField: 'outOk',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'locType1',
+ columnName: 'loc_type1',
+ label: '',
+ tableProp: 'locType1',
+ exportField: 'locType1',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'locType2',
+ columnName: 'loc_type2',
+ label: '',
+ tableProp: 'locType2',
+ exportField: 'locType2',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'locType3',
+ columnName: 'loc_type3',
+ label: '',
+ tableProp: 'locType3',
+ exportField: 'locType3',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'modiUser',
+ columnName: 'modi_user',
+ label: '',
+ tableProp: 'modiUser',
+ exportField: 'modiUser',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'modiTime',
+ columnName: 'modi_time',
+ label: '',
+ tableProp: 'modiTime$',
+ exportField: 'modiTime$',
+ kind: 'date',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 168,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'appeUser',
+ columnName: 'appe_user',
+ label: '',
+ tableProp: 'appeUser',
+ exportField: 'appeUser',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'appeTime',
+ columnName: 'appe_time',
+ label: '',
+ tableProp: 'appeTime$',
+ exportField: 'appeTime$',
+ kind: 'date',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 168,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'stdQty',
+ columnName: 'std_qty',
+ label: '',
+ tableProp: 'stdQty',
+ exportField: 'stdQty',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'minWt',
+ columnName: 'min_wt',
+ label: '',
+ tableProp: 'minWt',
+ exportField: 'minWt',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'maxWt',
+ columnName: 'max_wt',
+ label: '',
+ tableProp: 'maxWt',
+ exportField: 'maxWt',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'grossWt',
+ columnName: 'gross_wt',
+ label: '',
+ tableProp: 'grossWt',
+ exportField: 'grossWt',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'cartPos',
+ columnName: 'cart_pos',
+ label: '',
+ tableProp: 'cartPos',
+ exportField: 'cartPos',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'qrCodeValue',
+ columnName: 'qr_code_value',
+ label: '',
+ tableProp: 'qrCodeValue',
+ exportField: 'qrCodeValue',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'locNo',
+ columnName: 'loc_no',
+ label: '',
+ tableProp: 'locNo',
+ exportField: 'locNo',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'lev',
+ columnName: 'lev',
+ label: '',
+ tableProp: 'lev',
+ exportField: 'lev',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'liftNo',
+ columnName: 'lift_no',
+ label: '',
+ tableProp: 'liftNo',
+ exportField: 'liftNo',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'devNo',
+ columnName: 'dev_no',
+ label: '',
+ tableProp: 'devNo',
+ exportField: 'devNo',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'decDesc',
+ columnName: 'dec_desc',
+ label: '',
+ tableProp: 'decDesc',
+ exportField: 'decDesc',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'devMk',
+ columnName: 'dev_mk',
+ label: '',
+ tableProp: 'devMk',
+ exportField: 'devMk',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'inEnable',
+ columnName: 'in_enable',
+ label: '',
+ tableProp: 'inEnable',
+ exportField: 'inEnable',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'outEnable',
+ columnName: 'out_enable',
+ label: '',
+ tableProp: 'outEnable',
+ exportField: 'outEnable',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'autoing',
+ columnName: 'autoing',
+ label: '',
+ tableProp: 'autoing',
+ exportField: 'autoing',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'loading',
+ columnName: 'loading',
+ label: '',
+ tableProp: 'loading',
+ exportField: 'loading',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'canining',
+ columnName: 'canining',
+ label: '',
+ tableProp: 'canining',
+ exportField: 'canining',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'canouting',
+ columnName: 'canouting',
+ label: '',
+ tableProp: 'canouting',
+ exportField: 'canouting',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'fronting',
+ columnName: 'fronting',
+ label: '',
+ tableProp: 'fronting',
+ exportField: 'fronting',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'rearing',
+ columnName: 'rearing',
+ label: '',
+ tableProp: 'rearing',
+ exportField: 'rearing',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'uping',
+ columnName: 'uping',
+ label: '',
+ tableProp: 'uping',
+ exportField: 'uping',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'downing',
+ columnName: 'downing',
+ label: '',
+ tableProp: 'downing',
+ exportField: 'downing',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'inreq1',
+ columnName: 'inreq1',
+ label: '',
+ tableProp: 'inreq1',
+ exportField: 'inreq1',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'inreq2',
+ columnName: 'inreq2',
+ label: '',
+ tableProp: 'inreq2',
+ exportField: 'inreq2',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'wrkNo',
+ columnName: 'wrk_no',
+ label: '',
+ tableProp: 'wrkNo',
+ exportField: 'wrkNo',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'wrkNo1',
+ columnName: 'wrk_no1',
+ label: '',
+ tableProp: 'wrkNo1',
+ exportField: 'wrkNo1',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'ctnType',
+ columnName: 'ctn_type',
+ label: '',
+ tableProp: 'ctnType',
+ exportField: 'ctnType',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'barcode',
+ columnName: 'barcode',
+ label: '',
+ tableProp: 'barcode',
+ exportField: 'barcode',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'inQty',
+ columnName: 'in_qty',
+ label: '',
+ tableProp: 'inQty',
+ exportField: 'inQty',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'row1',
+ columnName: 'row1',
+ label: '',
+ tableProp: 'row1',
+ exportField: 'row1',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'ioTime',
+ columnName: 'io_time',
+ label: '',
+ tableProp: 'ioTime$',
+ exportField: 'ioTime$',
+ kind: 'date',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 168,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'area',
+ columnName: 'area',
+ label: '',
+ tableProp: 'area',
+ exportField: 'area',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'inOk',
+ columnName: 'in_ok',
+ label: '',
+ tableProp: 'inOk',
+ exportField: 'inOk',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'outOk',
+ columnName: 'out_ok',
+ label: '',
+ tableProp: 'outOk',
+ exportField: 'outOk',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'locType1',
+ columnName: 'loc_type1',
+ label: '',
+ tableProp: 'locType1',
+ exportField: 'locType1',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'locType2',
+ columnName: 'loc_type2',
+ label: '',
+ tableProp: 'locType2',
+ exportField: 'locType2',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'locType3',
+ columnName: 'loc_type3',
+ label: '',
+ tableProp: 'locType3',
+ exportField: 'locType3',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'modiUser',
+ columnName: 'modi_user',
+ label: '',
+ tableProp: 'modiUser',
+ exportField: 'modiUser',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'modiTime',
+ columnName: 'modi_time',
+ label: '',
+ tableProp: 'modiTime$',
+ exportField: 'modiTime$',
+ kind: 'date',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 168,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'appeUser',
+ columnName: 'appe_user',
+ label: '',
+ tableProp: 'appeUser',
+ exportField: 'appeUser',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'appeTime',
+ columnName: 'appe_time',
+ label: '',
+ tableProp: 'appeTime$',
+ exportField: 'appeTime$',
+ kind: 'date',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 168,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'stdQty',
+ columnName: 'std_qty',
+ label: '',
+ tableProp: 'stdQty',
+ exportField: 'stdQty',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'minWt',
+ columnName: 'min_wt',
+ label: '',
+ tableProp: 'minWt',
+ exportField: 'minWt',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'maxWt',
+ columnName: 'max_wt',
+ label: '',
+ tableProp: 'maxWt',
+ exportField: 'maxWt',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'grossWt',
+ columnName: 'gross_wt',
+ label: '',
+ tableProp: 'grossWt',
+ exportField: 'grossWt',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'cartPos',
+ columnName: 'cart_pos',
+ label: '',
+ tableProp: 'cartPos',
+ exportField: 'cartPos',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'qrCodeValue',
+ columnName: 'qr_code_value',
+ label: '',
+ tableProp: 'qrCodeValue',
+ exportField: 'qrCodeValue',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'locNo',
+ columnName: 'loc_no',
+ label: '',
+ tableProp: 'locNo',
+ exportField: 'locNo',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'lev',
+ columnName: 'lev',
+ label: '',
+ tableProp: 'lev',
+ exportField: 'lev',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'liftNo',
+ columnName: 'lift_no',
+ label: '',
+ tableProp: 'liftNo',
+ exportField: 'liftNo',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'id',
+ columnName: 'id',
+ label: '缂栥��銆�鍙�',
+ tableProp: 'id',
+ exportField: 'id',
+ kind: 'text',
+ valueType: 'number',
+ required: true,
+ primaryKey: true,
+ sortable: true,
+ textarea: false,
+ minWidth: 90,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'devpNo',
+ columnName: 'devp_no',
+ label: '璁惧缂栧彿',
+ tableProp: 'devpNo',
+ exportField: 'devpNo',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'status',
+ columnName: 'status',
+ label: '鐘躲��銆�鎬�',
+ tableProp: 'status$',
+ exportField: 'status$',
+ kind: 'enum',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 120,
+ enumOptions: [{ rawValue: '1', label: '姝e父' }, { rawValue: '0', label: '绂佺敤' }],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'createBy',
+ columnName: 'create_by',
+ label: '鍒涘缓浜哄憳',
+ tableProp: 'createBy',
+ exportField: 'createBy',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'createTime',
+ columnName: 'create_time',
+ label: '鍒涘缓鏃堕棿',
+ tableProp: 'createTime$',
+ exportField: 'createTime$',
+ kind: 'date',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 168,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'updateBy',
+ columnName: 'update_by',
+ label: '淇敼浜哄憳',
+ tableProp: 'updateBy',
+ exportField: 'updateBy',
+ kind: 'text',
+ valueType: 'number',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: '1',
+ checkboxInactiveRaw: '0'
+ },
+ {
+ field: 'updateTime',
+ columnName: 'update_time',
+ label: '淇敼鏃堕棿',
+ tableProp: 'updateTime$',
+ exportField: 'updateTime$',
+ kind: 'date',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 168,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'memo',
+ columnName: 'memo',
+ label: '澶囥��銆�娉�',
+ tableProp: 'memo',
+ exportField: 'memo',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: true,
+ minWidth: 180,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'stationList',
+ columnName: 'station_list',
+ label: '绔欑偣鏁版嵁',
+ tableProp: 'stationList',
+ exportField: 'stationList',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'barcodeStationList',
+ columnName: 'barcode_station_list',
+ label: '鏉$爜绔欑偣鏁版嵁',
+ tableProp: 'barcodeStationList',
+ exportField: 'barcodeStationList',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 134,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'inStationList',
+ columnName: 'in_station_list',
+ label: '鍏ュ簱绔欑偣鏁版嵁',
+ tableProp: 'inStationList',
+ exportField: 'inStationList',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 134,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'outStationList',
+ columnName: 'out_station_list',
+ label: '鍑哄簱绔欑偣鏁版嵁',
+ tableProp: 'outStationList',
+ exportField: 'outStationList',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 134,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'runBlockReassignLocStationList',
+ columnName: 'run_block_reassign_loc_station_list',
+ label: '杩愯鍫靛閲嶆柊鍒嗛厤搴撲綅绔欑偣鏁版嵁',
+ tableProp: 'runBlockReassignLocStationList',
+ exportField: 'runBlockReassignLocStationList',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 180,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'isOutOrderList',
+ columnName: 'is_out_order_list',
+ label: '璇疯緭鍏ュ嚭搴撴帓搴忎氦浜掔偣',
+ tableProp: 'isOutOrderList',
+ exportField: 'isOutOrderList',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ },
+ {
+ field: 'isLiftTransferList',
+ columnName: 'is_lift_transfer_list',
+ label: '璇疯緭鍏ョ數姊腑杞偣',
+ tableProp: 'isLiftTransferList',
+ exportField: 'isLiftTransferList',
+ kind: 'text',
+ valueType: 'string',
+ required: false,
+ primaryKey: false,
+ sortable: false,
+ textarea: false,
+ minWidth: 110,
+ enumOptions: [],
+ foreignQuery: '',
+ checkboxActiveRaw: 'Y',
+ checkboxInactiveRaw: 'N'
+ }
- // 鏁版嵁娓叉煋
- tableIns = table.render({
- elem: "#basDevp",
- headers: { token: localStorage.getItem("token") },
- url: baseUrl + "/basDevp/list/auth",
- page: true,
- limit: 15,
- limits: [15, 30, 50, 100, 200, 500],
- toolbar: "#toolbar",
- cellMinWidth: 50,
- height: "full-120",
- cols: [
- [
- { type: "checkbox" },
- { field: "id", align: "center", title: "缂栧彿" },
- { field: "devpNo", align: "center", title: "璁惧缂栧彿" },
- { field: "status$", align: "center", title: "鐘舵��" },
- // { field: "createBy", align: "center", title: "鍒涘缓浜哄憳" },
- // { field: "createTime$", align: "center", title: "鍒涘缓鏃堕棿" },
- // { field: "updateBy", align: "center", title: "淇敼浜哄憳" },
- // { field: "updateTime$", align: "center", title: "淇敼鏃堕棿" },
- { field: "memo", align: "center", title: "澶囨敞" },
- { field: "stationList", align: "center", title: "绔欑偣鏁版嵁" },
- { field: "barcodeStationList", align: "center", title: "鏉$爜绔欑偣鏁版嵁" },
- { field: "inStationList", align: "center", title: "鍏ュ簱绔欑偣鏁版嵁" },
- { field: "outStationList", align: "center", title: "鍑哄簱绔欑偣鏁版嵁" },
- { field: "runBlockReassignLocStationList", align: "center", title: "杩愯鍫靛閲嶆柊鍒嗛厤搴撲綅绔欑偣鏁版嵁" },
- { field: "isOutOrderList", align: "center", title: "鍑哄簱鎺掑簭浜や簰鐐�" },
- { field: "isLiftTransferList", align: "center", title: "椤跺崌绉绘牻鐐�" },
+ ]);
- {
- fixed: "right",
- title: "鎿嶄綔",
- align: "center",
- toolbar: "#operate",
- width: 240,
- },
- ],
- ],
- request: {
- pageName: "curr",
- pageSize: "limit",
- },
- parseData: function (res) {
- return {
- code: res.code,
- msg: res.msg,
- count: res.data.total,
- data: res.data.records,
+ function formatFieldLabel(field) {
+ var raw = field && field.label ? String(field.label).trim() : '';
+ if (raw) {
+ return raw;
+ }
+ raw = field && field.columnName ? field.columnName : (field && field.field ? field.field : '');
+ if (!raw) {
+ return '';
+ }
+ raw = String(raw)
+ .replace(/\$/g, '')
+ .replace(/([a-z0-9])([A-Z])/g, '$1_$2')
+ .replace(/_/g, ' ')
+ .replace(/\s+/g, ' ')
+ .trim();
+ return raw.replace(/\b[a-z]/g, function (letter) {
+ return letter.toUpperCase();
+ });
+ }
+
+ function dedupeFieldMeta(list) {
+ var result = [];
+ var seen = {};
+ (list || []).forEach(function (field) {
+ if (!field || !field.field || seen[field.field]) {
+ return;
+ }
+ field.label = formatFieldLabel(field);
+ seen[field.field] = true;
+ result.push(field);
+ });
+ return result;
+ }
+
+ function isEmptyValue(value) {
+ return value === null || value === undefined || value === '';
+ }
+
+ function stringValue(value) {
+ return isEmptyValue(value) ? '' : String(value);
+ }
+
+ function valueOrDash(value) {
+ return isEmptyValue(value) ? '--' : value;
+ }
+
+ function normalizeOptionValue(field, rawValue) {
+ if (rawValue === null || rawValue === undefined) {
+ return null;
+ }
+ if (rawValue === '') {
+ return '';
+ }
+ if (field && field.valueType === 'number') {
+ var numberVal = Number(rawValue);
+ return isNaN(numberVal) ? rawValue : numberVal;
+ }
+ return String(rawValue);
+ }
+
+ function isSearchableField(field) {
+ return !!field && field.kind !== 'image' && !field.textarea;
+ }
+
+ function isSortableField(field) {
+ if (!field) {
+ return false;
+ }
+ if (field.primaryKey) {
+ return true;
+ }
+ return field.kind !== 'image' && !field.textarea && field.kind !== 'foreign';
+ }
+
+ function defaultFieldValue(field) {
+ if (field.primaryKey) {
+ return null;
+ }
+ if (field.kind === 'checkbox') {
+ return normalizeOptionValue(field, field.checkboxInactiveRaw);
+ }
+ return '';
+ }
+
+ function defaultSearchFieldValue(field) {
+ if (field.kind === 'date') {
+ return [];
+ }
+ if (field.kind === 'enum' || field.kind === 'checkbox') {
+ return null;
+ }
+ return '';
+ }
+
+ function createSearchDefaults() {
+ var result = {
+ condition: ''
};
- },
- response: {
- statusCode: 200,
- },
- done: function (res, curr, count) {
- if (res.code === 403) {
- top.location.href = baseUrl + "/";
+ fieldMeta.forEach(function (field) {
+ if (!isSearchableField(field)) {
+ return;
+ }
+ result[field.field] = defaultSearchFieldValue(field);
+ });
+ return result;
+ }
+
+ function createSearchDisplayDefaults() {
+ var result = {};
+ fieldMeta.forEach(function (field) {
+ if (field.kind === 'foreign' && isSearchableField(field)) {
+ result[field.field] = '';
+ }
+ });
+ return result;
+ }
+
+ function createDefaultVisibleColumnKeys() {
+ return fieldMeta.map(function (field) {
+ return field.field;
+ });
+ }
+
+ function createFormDefaults() {
+ var result = {};
+ fieldMeta.forEach(function (field) {
+ result[field.field] = defaultFieldValue(field);
+ });
+ return result;
+ }
+
+ function createDisplayDefaults() {
+ var result = {};
+ fieldMeta.forEach(function (field) {
+ if (field.kind === 'foreign') {
+ result[field.field] = '';
+ }
+ });
+ return result;
+ }
+
+ function createFormRules() {
+ var rules = {};
+ fieldMeta.forEach(function (field) {
+ if (field.primaryKey || !field.required) {
+ return;
+ }
+ rules[field.field] = [{
+ required: true,
+ message: (field.kind === 'date' || field.kind === 'enum' ? '璇烽�夋嫨' : '璇疯緭鍏�') + field.label,
+ trigger: (field.kind === 'date' || field.kind === 'enum') ? 'change' : 'blur'
+ }];
+ });
+ return rules;
+ }
+
+ function getTableValue(row, field) {
+ var prop = field.tableProp || field.field;
+ if (row && !isEmptyValue(row[prop])) {
+ return row[prop];
}
- pageCurr = curr;
- limit();
- },
- });
+ return row ? row[field.field] : '';
+ }
- // 鐩戝惉鎺掑簭浜嬩欢
- table.on("sort(basDevp)", function (obj) {
- var searchData = {};
- $.each($("#search-box [name]").serializeArray(), function () {
- searchData[this.name] = this.value;
- });
- searchData["orderByField"] = obj.field;
- searchData["orderByType"] = obj.type;
- tableIns.reload({
- where: searchData,
- page: { curr: 1 },
- });
- });
+ function isCheckboxChecked(row, field) {
+ var value = row ? row[field.field] : null;
+ var activeValue = normalizeOptionValue(field, field.checkboxActiveRaw);
+ return String(value) === String(activeValue);
+ }
- // 鐩戝惉澶村伐鍏锋爮浜嬩欢
- table.on("toolbar(basDevp)", function (obj) {
- var checkStatus = table.checkStatus(obj.config.id).data;
- switch (obj.event) {
- case "addData":
- showEditModel();
- break;
- case "deleteData":
- if (checkStatus.length === 0) {
- layer.msg("璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁", { icon: 2 });
- return;
- }
- del(
- checkStatus.map(function (d) {
- return d.id;
- })
- );
- break;
- case "exportData":
- admin.confirm("纭畾瀵煎嚭Excel鍚�", { shadeClose: true }, function () {
- var titles = [];
- var fields = [];
- obj.config.cols[0].map(function (col) {
- if (
- col.type === "normal" &&
- col.hide === false &&
- col.toolbar == null
- ) {
- titles.push(col.title);
- fields.push(col.field);
- }
- });
- var exportData = {};
- $.each($("#search-box [name]").serializeArray(), function () {
- exportData[this.name] = this.value;
- });
- var param = {
- basDevp: exportData,
- fields: fields,
+ function exportCell(value) {
+ return stringValue(value).replace(/\t/g, ' ').replace(/\r?\n/g, ' ');
+ }
+
+ function escapeHtml(value) {
+ return exportCell(value)
+ .replace(/&/g, '&')
+ .replace(/</g, '<')
+ .replace(/>/g, '>')
+ .replace(/"/g, '"')
+ .replace(/'/g, ''');
+ }
+
+ function buildPayload(form) {
+ var payload = {};
+ fieldMeta.forEach(function (field) {
+ var value = form[field.field];
+ if (field.primaryKey) {
+ if (!isEmptyValue(value)) {
+ payload[field.field] = value;
+ }
+ return;
+ }
+ if (field.kind === 'foreign' && isEmptyValue(value)) {
+ value = null;
+ }
+ if (field.kind === 'enum' && value === '') {
+ value = null;
+ }
+ if (field.kind === 'checkbox' && isEmptyValue(value)) {
+ value = normalizeOptionValue(field, field.checkboxInactiveRaw);
+ }
+ if (field.valueType === 'number' && !isEmptyValue(value)) {
+ value = Number(value);
+ }
+ if (field.valueType === 'number' && value === '') {
+ value = null;
+ }
+ payload[field.field] = value;
+ });
+ return payload;
+ }
+
+ function fillFormFromRow(row, form, display) {
+ fieldMeta.forEach(function (field) {
+ if (field.primaryKey) {
+ form[field.field] = row[field.field];
+ return;
+ }
+ if (field.kind === 'date') {
+ form[field.field] = row[field.tableProp] || row[field.field] || '';
+ return;
+ }
+ if (field.kind === 'foreign') {
+ form[field.field] = isEmptyValue(row[field.field]) ? '' : normalizeOptionValue(field, row[field.field]);
+ if (display) {
+ display[field.field] = row[field.tableProp] || (isEmptyValue(row[field.field]) ? '' : String(row[field.field]));
+ }
+ return;
+ }
+ if (field.kind === 'enum') {
+ form[field.field] = isEmptyValue(row[field.field]) ? '' : normalizeOptionValue(field, row[field.field]);
+ return;
+ }
+ if (field.kind === 'checkbox') {
+ form[field.field] = isEmptyValue(row[field.field])
+ ? normalizeOptionValue(field, field.checkboxInactiveRaw)
+ : normalizeOptionValue(field, row[field.field]);
+ return;
+ }
+ form[field.field] = isEmptyValue(row[field.field])
+ ? ''
+ : (field.valueType === 'number' ? String(row[field.field]) : row[field.field]);
+ });
+ }
+
+ function resolveSearchParam(field) {
+ if (field.kind === 'date' && field.columnName) {
+ return field.columnName;
+ }
+ return field.field;
+ }
+
+ function createDownloadFile(filename, titles, rows) {
+ var html = [
+ '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">',
+ '<head><meta charset="UTF-8"></head><body><table border="1"><thead><tr>',
+ titles.map(function (title) {
+ return '<th>' + escapeHtml(title) + '</th>';
+ }).join(''),
+ '</tr></thead><tbody>',
+ (rows || []).map(function (row) {
+ return '<tr>' + (row || []).map(function (value) {
+ return '<td style="mso-number-format:\\@;">' + escapeHtml(value) + '</td>';
+ }).join('') + '</tr>';
+ }).join(''),
+ '</tbody></table></body></html>'
+ ].join('');
+ var blob = new Blob(['\ufeff' + html], {
+ type: 'application/vnd.ms-excel;charset=utf-8;'
+ });
+ var anchor = document.createElement('a');
+ anchor.href = URL.createObjectURL(blob);
+ anchor.download = filename;
+ document.body.appendChild(anchor);
+ anchor.click();
+ setTimeout(function () {
+ URL.revokeObjectURL(anchor.href);
+ document.body.removeChild(anchor);
+ }, 0);
+ }
+
+ function buildTimestamp() {
+ var now = new Date();
+ var pad = function (num) {
+ return num < 10 ? '0' + num : String(num);
+ };
+ return now.getFullYear()
+ + pad(now.getMonth() + 1)
+ + pad(now.getDate())
+ + '_'
+ + pad(now.getHours())
+ + pad(now.getMinutes())
+ + pad(now.getSeconds());
+ }
+
+ function authHeaders() {
+ return {
+ token: localStorage.getItem('token')
+ };
+ }
+
+ function handleForbidden(res) {
+ if (res && res.code === 403) {
+ top.location.href = baseUrl + '/';
+ return true;
+ }
+ return false;
+ }
+
+ var sharedMethods = {
+ authHeaders: authHeaders,
+ handleForbidden: handleForbidden,
+ valueOrDash: valueOrDash,
+ stringValue: stringValue,
+ getTableValue: getTableValue,
+ isCheckboxChecked: isCheckboxChecked,
+ normalizeOptionValue: normalizeOptionValue,
+ isSortableField: isSortableField,
+ getSuggestionFetcher: function (field) {
+ var self = this;
+ return function (queryString, callback) {
+ self.fetchForeignSuggestions(field, queryString, callback);
};
- $.ajax({
- url: baseUrl + "/basDevp/export/auth",
- headers: { token: localStorage.getItem("token") },
- data: JSON.stringify(param),
- dataType: "json",
- contentType: "application/json;charset=UTF-8",
- method: "POST",
- success: function (res) {
- layer.closeAll();
- if (res.code === 200) {
- table.exportFile(titles, res.data, "xls");
- } else if (res.code === 403) {
- top.location.href = baseUrl + "/";
- } else {
- layer.msg(res.msg, { icon: 2 });
- }
- },
- });
- });
- break;
- }
- });
-
- // 鐩戝惉琛屽伐鍏蜂簨浠�
- table.on("tool(basDevp)", function (obj) {
- var data = obj.data;
- switch (obj.event) {
- case "edit":
- showEditModel(data);
- break;
- case "del":
- del([data.id]);
- break;
- case "initStation":
- showInitStation(data);
- break;
- }
- });
-
- function showInitStation(mData) {
- admin.open({
- type: 1,
- area: "600px",
- title: "鍒濆鍖栫珯鐐规暟鎹�",
- content: $("#initStationDialog").html(),
- success: function (layero, dIndex) {
- layDateRender(mData);
- form.val("detail", mData);
- form.on("submit(editSubmit)", function (data) {
- var loadIndex = layer.load(2);
- $.ajax({
- url: baseUrl + "/basDevp/initStation/auth",
- headers: { token: localStorage.getItem("token") },
- contentType: "application/json;charset=UTF-8",
- data: JSON.stringify(data.field),
- method: "POST",
- success: function (res) {
- layer.close(loadIndex);
- if (res.code === 200) {
- layer.close(dIndex);
- layer.msg(res.msg, { icon: 1 });
- tableReload();
- } else if (res.code === 403) {
- top.location.href = baseUrl + "/";
- } else {
- layer.msg(res.msg, { icon: 2 });
- }
- },
- });
- return false;
- });
- $(layero).children(".layui-layer-content").css("overflow", "visible");
- layui.form.render("select");
},
- });
- }
-
- /* 寮圭獥 - 鏂板銆佷慨鏀� */
- function showEditModel(mData) {
- admin.open({
- type: 1,
- area: "600px",
- title: (mData ? "淇敼" : "娣诲姞") + "璁㈠崟鐘舵��",
- content: $("#editDialog").html(),
- success: function (layero, dIndex) {
- layDateRender(mData);
- form.val("detail", mData);
- form.on("submit(editSubmit)", function (data) {
- var loadIndex = layer.load(2);
+ fetchForeignSuggestions: function (field, queryString, callback) {
+ if (!field.foreignQuery || !queryString) {
+ callback([]);
+ return;
+ }
+ var self = this;
$.ajax({
- url: baseUrl + "/basDevp/" + (mData ? "update" : "add") + "/auth",
- headers: { token: localStorage.getItem("token") },
- data: data.field,
- method: "POST",
- success: function (res) {
- layer.close(loadIndex);
- if (res.code === 200) {
- layer.close(dIndex);
- layer.msg(res.msg, { icon: 1 });
- tableReload();
- } else if (res.code === 403) {
- top.location.href = baseUrl + "/";
- } else {
- layer.msg(res.msg, { icon: 2 });
+ url: baseUrl + '/' + field.foreignQuery + 'Query/auth',
+ method: 'GET',
+ headers: self.authHeaders(),
+ data: { condition: queryString },
+ success: function (res) {
+ if (self.handleForbidden(res)) {
+ return;
+ }
+ if (!res || res.code !== 200 || !Array.isArray(res.data)) {
+ callback([]);
+ return;
+ }
+ callback(res.data.map(function (item) {
+ return {
+ id: item.id,
+ value: item.value
+ };
+ }));
+ },
+ error: function () {
+ callback([]);
}
- },
});
- return false;
- });
- $(layero).children(".layui-layer-content").css("overflow", "visible");
- layui.form.render("select");
},
- });
- }
-
- /* 鍒犻櫎 */
- function del(ids) {
- layer.confirm(
- "纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵",
- {
- skin: "layui-layer-admin",
- shade: 0.1,
+ handleForeignSelect: function (field, item) {
+ this.$set(this.displayTarget, field.field, item && item.value ? item.value : '');
+ this.$set(this.formTarget, field.field, item && item.id !== undefined ? normalizeOptionValue(field, item.id) : '');
},
- function (i) {
- layer.close(i);
- var loadIndex = layer.load(2);
- $.ajax({
- url: baseUrl + "/basDevp/delete/auth",
- headers: { token: localStorage.getItem("token") },
- data: { ids: ids },
- method: "POST",
- success: function (res) {
- layer.close(loadIndex);
- if (res.code === 200) {
- layer.msg(res.msg, { icon: 1 });
- tableReload();
- } else if (res.code === 403) {
- top.location.href = baseUrl + "/";
- } else {
- layer.msg(res.msg, { icon: 2 });
- }
- },
- });
+ handleForeignInput: function (field) {
+ if (!this.displayTarget || !this.formTarget) {
+ return;
+ }
+ if (this.displayTarget[field.field]) {
+ return;
+ }
+ this.$set(this.formTarget, field.field, '');
}
- );
+ };
+
+ if (document.getElementById('app')) {
+ new Vue({
+ el: '#app',
+ data: function () {
+ return {
+ fieldMeta: fieldMeta,
+ primaryKeyField: primaryKeyField,
+ loading: false,
+ exporting: false,
+ tableData: [],
+ selection: [],
+ advancedFiltersVisible: false,
+ allColumns: fieldMeta.slice(),
+ visibleColumnKeys: createDefaultVisibleColumnKeys(),
+ searchForm: createSearchDefaults(),
+ searchDisplay: createSearchDisplayDefaults(),
+ page: {
+ curr: 1,
+ limit: 15,
+ total: 0
+ },
+ sortState: {
+ prop: '',
+ order: ''
+ },
+ dialog: {
+ visible: false,
+ mode: 'create',
+ submitting: false
+ },
+ layoutTimer: null,
+ tableResizeHandler: null,
+ dialogForm: createFormDefaults(),
+ dialogDisplay: createDisplayDefaults(),
+ dialogRules: createFormRules()
+ };
+ },
+ computed: {
+ searchableFields: function () {
+ return this.fieldMeta.filter(function (field) {
+ return isSearchableField(field);
+ });
+ },
+ quickSearchableFields: function () {
+ var result = [];
+ this.searchableFields.forEach(function (field) {
+ if (result.length >= 3 || field.kind === 'date') {
+ return;
+ }
+ result.push(field);
+ });
+ return result;
+ },
+ advancedSearchableFields: function () {
+ var quickKeys = this.quickSearchableFields.map(function (field) {
+ return field.field;
+ });
+ return this.searchableFields.filter(function (field) {
+ return quickKeys.indexOf(field.field) === -1;
+ });
+ },
+ hasAdvancedFilters: function () {
+ return this.advancedSearchableFields.length > 0;
+ },
+ visibleColumns: function () {
+ var keys = this.visibleColumnKeys;
+ return this.allColumns.filter(function (field) {
+ return keys.indexOf(field.field) !== -1;
+ });
+ },
+ editableFields: function () {
+ return this.fieldMeta.filter(function (field) {
+ return !field.primaryKey;
+ });
+ },
+ exportColumns: function () {
+ return this.visibleColumns.map(function (field) {
+ return {
+ field: field.exportField || field.tableProp || field.field,
+ label: field.label
+ };
+ });
+ },
+ tableHeight: function () {
+ return this.advancedFiltersVisible && this.hasAdvancedFilters
+ ? 'calc(100vh - 390px)'
+ : 'calc(100vh - 300px)';
+ },
+ formTarget: function () {
+ return this.dialogForm;
+ },
+ displayTarget: function () {
+ return this.dialogDisplay;
+ }
+ },
+ created: function () {
+ this.loadTable();
+ },
+ mounted: function () {
+ var self = this;
+ self.requestTableLayout(80);
+ self.tableResizeHandler = function () {
+ self.requestTableLayout(80);
+ };
+ window.addEventListener('resize', self.tableResizeHandler);
+ },
+ beforeDestroy: function () {
+ if (this.layoutTimer) {
+ clearTimeout(this.layoutTimer);
+ this.layoutTimer = null;
+ }
+ if (this.tableResizeHandler) {
+ window.removeEventListener('resize', this.tableResizeHandler);
+ this.tableResizeHandler = null;
+ }
+ },
+ methods: $.extend({}, sharedMethods, {
+ requestTableLayout: function (delay) {
+ var self = this;
+ if (self.layoutTimer) {
+ clearTimeout(self.layoutTimer);
+ }
+ self.$nextTick(function () {
+ self.layoutTimer = setTimeout(function () {
+ var table = self.$refs.dataTable;
+ if (table && typeof table.doLayout === 'function') {
+ table.doLayout();
+ }
+ }, delay || 40);
+ });
+ },
+ isColumnVisible: function (fieldName) {
+ return this.visibleColumnKeys.indexOf(fieldName) !== -1;
+ },
+ toggleColumn: function (fieldName, visible) {
+ if (visible) {
+ if (this.visibleColumnKeys.indexOf(fieldName) === -1) {
+ this.visibleColumnKeys.push(fieldName);
+ }
+ this.requestTableLayout(80);
+ return;
+ }
+ if (this.visibleColumnKeys.length === 1) {
+ this.$message.warning('鑷冲皯淇濈暀涓�鍒�');
+ return;
+ }
+ this.visibleColumnKeys = this.visibleColumnKeys.filter(function (item) {
+ return item !== fieldName;
+ });
+ this.requestTableLayout(80);
+ },
+ selectAllColumns: function () {
+ this.visibleColumnKeys = createDefaultVisibleColumnKeys();
+ this.requestTableLayout(80);
+ },
+ resetColumns: function () {
+ this.visibleColumnKeys = createDefaultVisibleColumnKeys();
+ this.requestTableLayout(80);
+ },
+ toggleAdvancedFilters: function () {
+ this.advancedFiltersVisible = !this.advancedFiltersVisible;
+ this.requestTableLayout(260);
+ },
+ handleSearchForeignSelect: function (field, item) {
+ this.$set(this.searchDisplay, field.field, item && item.value ? item.value : '');
+ this.$set(this.searchForm, field.field, item && item.id !== undefined ? normalizeOptionValue(field, item.id) : '');
+ },
+ handleSearchForeignInput: function (field) {
+ if (this.searchDisplay[field.field]) {
+ return;
+ }
+ this.$set(this.searchForm, field.field, '');
+ },
+ buildQueryParams: function () {
+ var self = this;
+ var params = {
+ curr: self.page.curr,
+ limit: self.page.limit
+ };
+ if (self.searchForm.condition) {
+ params.condition = self.searchForm.condition;
+ }
+ self.searchableFields.forEach(function (field) {
+ var value = self.searchForm[field.field];
+ if (field.kind === 'date') {
+ if (value && value.length === 2) {
+ params[resolveSearchParam(field)] = value[0] + ' - ' + value[1];
+ }
+ return;
+ }
+ if (!isEmptyValue(value)) {
+ params[resolveSearchParam(field)] = value;
+ }
+ });
+ if (self.sortState.prop && self.sortState.order) {
+ params.orderByField = self.sortState.prop;
+ params.orderByType = self.sortState.order === 'ascending' ? 'asc' : 'desc';
+ }
+ return params;
+ },
+ loadTable: function () {
+ var self = this;
+ self.loading = true;
+ $.ajax({
+ url: baseUrl + '/' + simpleEntityName + '/list/auth',
+ method: 'GET',
+ headers: self.authHeaders(),
+ data: self.buildQueryParams(),
+ success: function (res) {
+ self.loading = false;
+ if (self.handleForbidden(res)) {
+ return;
+ }
+ if (!res || res.code !== 200) {
+ self.$message.error((res && res.msg) ? res.msg : '鍔犺浇澶辫触');
+ return;
+ }
+ var payload = res.data || {};
+ self.tableData = Array.isArray(payload.records) ? payload.records : [];
+ self.page.total = payload.total || 0;
+ self.requestTableLayout(80);
+ },
+ error: function () {
+ self.loading = false;
+ self.requestTableLayout(80);
+ self.$message.error('鍔犺浇澶辫触');
+ }
+ });
+ },
+ handleSearch: function () {
+ this.page.curr = 1;
+ this.loadTable();
+ },
+ handleReset: function () {
+ this.searchForm = createSearchDefaults();
+ this.searchDisplay = createSearchDisplayDefaults();
+ this.advancedFiltersVisible = false;
+ this.page.curr = 1;
+ this.sortState = {
+ prop: '',
+ order: ''
+ };
+ this.loadTable();
+ },
+ handleSelectionChange: function (rows) {
+ this.selection = rows || [];
+ },
+ handleSortChange: function (payload) {
+ this.sortState = {
+ prop: payload && payload.prop ? payload.prop : '',
+ order: payload && payload.order ? payload.order : ''
+ };
+ this.page.curr = 1;
+ this.loadTable();
+ },
+ handleCurrentChange: function (curr) {
+ this.page.curr = curr;
+ this.loadTable();
+ },
+ handleSizeChange: function (limit) {
+ this.page.limit = limit;
+ this.page.curr = 1;
+ this.loadTable();
+ },
+ resetDialogState: function () {
+ this.dialogForm = createFormDefaults();
+ this.dialogDisplay = createDisplayDefaults();
+ if (this.$refs.dialogForm) {
+ this.$refs.dialogForm.clearValidate();
+ }
+ },
+ openCreateDialog: function () {
+ this.dialog.mode = 'create';
+ this.dialog.visible = true;
+ this.$nextTick(this.resetDialogState);
+ },
+ openEditDialog: function (row) {
+ var self = this;
+ self.dialog.mode = 'edit';
+ self.dialog.visible = true;
+ self.$nextTick(function () {
+ self.resetDialogState();
+ fillFormFromRow(row, self.dialogForm, self.dialogDisplay);
+ if (self.$refs.dialogForm) {
+ self.$refs.dialogForm.clearValidate();
+ }
+ });
+ },
+ submitDialog: function () {
+ var self = this;
+ if (!self.$refs.dialogForm) {
+ return;
+ }
+ self.$refs.dialogForm.validate(function (valid) {
+ if (!valid) {
+ return false;
+ }
+ self.dialog.submitting = true;
+ $.ajax({
+ url: baseUrl + '/' + simpleEntityName + '/' + (self.dialog.mode === 'create' ? 'add' : 'update') + '/auth',
+ method: 'POST',
+ headers: self.authHeaders(),
+ data: buildPayload(self.dialogForm),
+ success: function (res) {
+ self.dialog.submitting = false;
+ if (self.handleForbidden(res)) {
+ return;
+ }
+ if (!res || res.code !== 200) {
+ self.$message.error((res && res.msg) ? res.msg : '淇濆瓨澶辫触');
+ return;
+ }
+ self.$message.success(res.msg || '淇濆瓨鎴愬姛');
+ self.dialog.visible = false;
+ self.loadTable();
+ },
+ error: function () {
+ self.dialog.submitting = false;
+ self.$message.error('淇濆瓨澶辫触');
+ }
+ });
+ return true;
+ });
+ },
+ removeSelection: function () {
+ var self = this;
+ var ids = self.selection.map(function (row) {
+ return row[self.primaryKeyField];
+ });
+ self.removeRows(ids);
+ },
+ removeRows: function (ids) {
+ var self = this;
+ if (!ids || ids.length === 0) {
+ self.$message.warning('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁');
+ return;
+ }
+ self.$confirm('纭畾鍒犻櫎閫変腑鐨勮褰曞悧锛�', '鎻愮ず', { type: 'warning' }).then(function () {
+ $.ajax({
+ url: baseUrl + '/' + simpleEntityName + '/delete/auth',
+ method: 'POST',
+ headers: self.authHeaders(),
+ traditional: true,
+ data: { 'ids[]': ids },
+ success: function (res) {
+ if (self.handleForbidden(res)) {
+ return;
+ }
+ if (!res || res.code !== 200) {
+ self.$message.error((res && res.msg) ? res.msg : '鍒犻櫎澶辫触');
+ return;
+ }
+ self.$message.success(res.msg || '鍒犻櫎鎴愬姛');
+ self.selection = [];
+ if (self.tableData.length === ids.length && self.page.curr > 1) {
+ self.page.curr = self.page.curr - 1;
+ }
+ self.loadTable();
+ },
+ error: function () {
+ self.$message.error('鍒犻櫎澶辫触');
+ }
+ });
+ }).catch(function () {});
+ },
+ exportRows: function () {
+ var self = this;
+ self.exporting = true;
+ var requestBody = {
+ fields: self.exportColumns.map(function (item) {
+ return item.field;
+ })
+ };
+ requestBody[simpleEntityName] = self.buildQueryParams();
+ $.ajax({
+ url: baseUrl + '/' + simpleEntityName + '/export/auth',
+ method: 'POST',
+ headers: $.extend({ 'Content-Type': 'application/json;charset=UTF-8' }, self.authHeaders()),
+ data: JSON.stringify(requestBody),
+ success: function (res) {
+ self.exporting = false;
+ if (self.handleForbidden(res)) {
+ return;
+ }
+ if (!res || res.code !== 200) {
+ self.$message.error((res && res.msg) ? res.msg : '瀵煎嚭澶辫触');
+ return;
+ }
+ createDownloadFile(
+ simpleEntityName + '_' + buildTimestamp() + '.xls',
+ self.exportColumns.map(function (item) {
+ return item.label;
+ }),
+ Array.isArray(res.data) ? res.data : []
+ );
+ self.$message.success('瀵煎嚭鎴愬姛');
+ },
+ error: function () {
+ self.exporting = false;
+ self.$message.error('瀵煎嚭澶辫触');
+ }
+ });
+ }
+ })
+ });
}
- // 鎼滅储
- form.on("submit(search)", function (data) {
- pageCurr = 1;
- tableReload(false);
- });
-
- // 閲嶇疆
- form.on("submit(reset)", function (data) {
- pageCurr = 1;
- clearFormVal($("#search-box"));
- tableReload(false);
- });
-
- // 鏃堕棿閫夋嫨鍣�
- function layDateRender(data) {
- setTimeout(function () {
- layDate.render({
- elem: ".layui-laydate-range",
- type: "datetime",
- range: true,
- });
- layDate.render({
- elem: "#createTime\\$",
- type: "datetime",
- value: data !== undefined ? data["createTime\\$"] : null,
- });
- layDate.render({
- elem: "#updateTime\\$",
- type: "datetime",
- value: data !== undefined ? data["updateTime\\$"] : null,
- });
- }, 300);
- }
- layDateRender();
- });
-
-// 鍏抽棴鍔ㄤ綔
-$(document).on("click", "#data-detail-close", function () {
- parent.layer.closeAll();
-});
-
-function tableReload(child) {
- var searchData = {};
- $.each($("#search-box [name]").serializeArray(), function () {
- searchData[this.name] = this.value;
- });
- tableIns.reload({
- where: searchData,
- page: { curr: pageCurr },
- });
-}
+})();
--
Gitblit v1.9.1