Commit 67f65398 by cwq0219

权限

1 parent b7b4c95c
...@@ -1869,6 +1869,15 @@ ...@@ -1869,6 +1869,15 @@
"integrity": "sha512-4diPfzWbLEIElVG4AnqP+00SULlPzNuyJFNnmMrLgyaxG6tZXJ1sn7mjBu4fHrJE+Yp/jgylOweJn2xsLMFggQ==", "integrity": "sha512-4diPfzWbLEIElVG4AnqP+00SULlPzNuyJFNnmMrLgyaxG6tZXJ1sn7mjBu4fHrJE+Yp/jgylOweJn2xsLMFggQ==",
"dev": true "dev": true
}, },
"adler-32": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.2.0.tgz",
"integrity": "sha1-aj5r8KY5ALoVZSgIyxXGgT0aXyU=",
"requires": {
"exit-on-epipe": "~1.0.1",
"printj": "~1.1.0"
}
},
"ajv": { "ajv": {
"version": "6.10.2", "version": "6.10.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz",
...@@ -3159,6 +3168,16 @@ ...@@ -3159,6 +3168,16 @@
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
"dev": true "dev": true
}, },
"cfb": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.0.tgz",
"integrity": "sha512-sXMvHsKCICVR3Naq+J556K+ExBo9n50iKl6LGarlnvuA2035uMlGA/qVrc0wQtow5P1vJEw9UyrKLCbtIKz+TQ==",
"requires": {
"adler-32": "~1.2.0",
"crc-32": "~1.2.0",
"printj": "~1.1.2"
}
},
"chalk": { "chalk": {
"version": "2.4.2", "version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
...@@ -3516,6 +3535,22 @@ ...@@ -3516,6 +3535,22 @@
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"dev": true "dev": true
}, },
"codepage": {
"version": "1.14.0",
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.14.0.tgz",
"integrity": "sha1-jL4lSBMjVZ19MHVxsP/5HnodL5k=",
"requires": {
"commander": "~2.14.1",
"exit-on-epipe": "~1.0.1"
},
"dependencies": {
"commander": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz",
"integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw=="
}
}
},
"collection-visit": { "collection-visit": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
...@@ -3962,6 +3997,15 @@ ...@@ -3962,6 +3997,15 @@
} }
} }
}, },
"crc-32": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.0.tgz",
"integrity": "sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA==",
"requires": {
"exit-on-epipe": "~1.0.1",
"printj": "~1.1.0"
}
},
"create-ecdh": { "create-ecdh": {
"version": "4.0.3", "version": "4.0.3",
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz",
...@@ -5902,6 +5946,11 @@ ...@@ -5902,6 +5946,11 @@
"integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=",
"dev": true "dev": true
}, },
"exit-on-epipe": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz",
"integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw=="
},
"expand-brackets": { "expand-brackets": {
"version": "2.1.4", "version": "2.1.4",
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
...@@ -6297,6 +6346,11 @@ ...@@ -6297,6 +6346,11 @@
} }
} }
}, },
"file-saver": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.2.tgz",
"integrity": "sha512-Wz3c3XQ5xroCxd1G8b7yL0Ehkf0TC9oYC6buPFkNnU9EnaPlifeAFCyCh+iewXTyFRcg0a6j3J7FmJsIhlhBdw=="
},
"filename-regex": { "filename-regex": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz",
...@@ -6498,6 +6552,11 @@ ...@@ -6498,6 +6552,11 @@
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=",
"dev": true "dev": true
}, },
"frac": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz",
"integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA=="
},
"fragment-cache": { "fragment-cache": {
"version": "0.2.1", "version": "0.2.1",
"resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
...@@ -12051,6 +12110,11 @@ ...@@ -12051,6 +12110,11 @@
} }
} }
}, },
"printj": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz",
"integrity": "sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ=="
},
"private": { "private": {
"version": "0.1.8", "version": "0.1.8",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
...@@ -12274,6 +12338,12 @@ ...@@ -12274,6 +12338,12 @@
"unpipe": "1.0.0" "unpipe": "1.0.0"
} }
}, },
"raw-loader": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-0.5.1.tgz",
"integrity": "sha1-DD0L6u2KAclm2Xh793goElKpeao=",
"dev": true
},
"read-pkg": { "read-pkg": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
...@@ -12880,6 +12950,15 @@ ...@@ -12880,6 +12950,15 @@
"resolved": "https://registry.npmjs.org/screenfull/-/screenfull-4.2.1.tgz", "resolved": "https://registry.npmjs.org/screenfull/-/screenfull-4.2.1.tgz",
"integrity": "sha512-PLSp6f5XdhvjCCCO8OjavRfzkSGL3Qmdm7P82bxyU8HDDDBhDV3UckRaYcRa/NDNTYt8YBpzjoLWHUAejmOjLg==" "integrity": "sha512-PLSp6f5XdhvjCCCO8OjavRfzkSGL3Qmdm7P82bxyU8HDDDBhDV3UckRaYcRa/NDNTYt8YBpzjoLWHUAejmOjLg=="
}, },
"script-loader": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/script-loader/-/script-loader-0.7.2.tgz",
"integrity": "sha512-UMNLEvgOAQuzK8ji8qIscM3GIrRCWN6MmMXGD4SD5l6cSycgGsCo0tX5xRnfQcoghqct0tjHjcykgI1PyBE2aA==",
"dev": true,
"requires": {
"raw-loader": "~0.5.1"
}
},
"select-hose": { "select-hose": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz",
...@@ -13517,6 +13596,14 @@ ...@@ -13517,6 +13596,14 @@
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
"dev": true "dev": true
}, },
"ssf": {
"version": "0.11.2",
"resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz",
"integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==",
"requires": {
"frac": "~1.1.2"
}
},
"sshpk": { "sshpk": {
"version": "1.16.1", "version": "1.16.1",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
...@@ -15618,6 +15705,16 @@ ...@@ -15618,6 +15705,16 @@
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
"dev": true "dev": true
}, },
"wmf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz",
"integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw=="
},
"word": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz",
"integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA=="
},
"wordwrap": { "wordwrap": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
...@@ -15716,6 +15813,29 @@ ...@@ -15716,6 +15813,29 @@
"async-limiter": "~1.0.0" "async-limiter": "~1.0.0"
} }
}, },
"xlsx": {
"version": "0.16.8",
"resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.16.8.tgz",
"integrity": "sha512-qWub4YCn0xLEGHI7WWhk6IJ73MDu7sPSJQImxN6/LiI8wsHi0hUhICEDbyqBT+jgFgORZxrii0HvhNSwBNAPoQ==",
"requires": {
"adler-32": "~1.2.0",
"cfb": "^1.1.4",
"codepage": "~1.14.0",
"commander": "~2.17.1",
"crc-32": "~1.2.0",
"exit-on-epipe": "~1.0.1",
"ssf": "~0.11.2",
"wmf": "~1.0.1",
"word": "~0.3.0"
},
"dependencies": {
"commander": {
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
"integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg=="
}
}
},
"xml-name-validator": { "xml-name-validator": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz",
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
"dayjs": "^1.8.12", "dayjs": "^1.8.12",
"default-passive-events": "^2.0.0", "default-passive-events": "^2.0.0",
"element-ui": "^2.11.1", "element-ui": "^2.11.1",
"file-saver": "^2.0.2",
"flex.css": "^1.1.7", "flex.css": "^1.1.7",
"fuse.js": "^3.4.4", "fuse.js": "^3.4.4",
"hotkeys-js": "^3.6.2", "hotkeys-js": "^3.6.2",
...@@ -33,7 +34,8 @@ ...@@ -33,7 +34,8 @@
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-i18n": "^8.14.0", "vue-i18n": "^8.14.0",
"vue-router": "^3.0.3", "vue-router": "^3.0.3",
"vuex": "^3.0.1" "vuex": "^3.0.1",
"xlsx": "^0.16.8"
}, },
"devDependencies": { "devDependencies": {
"@kazupon/vue-i18n-loader": "^0.4.1", "@kazupon/vue-i18n-loader": "^0.4.1",
...@@ -50,6 +52,7 @@ ...@@ -50,6 +52,7 @@
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"sass": "^1.18.0", "sass": "^1.18.0",
"sass-loader": "^7.1.0", "sass-loader": "^7.1.0",
"script-loader": "^0.7.2",
"svg-sprite-loader": "^4.1.3", "svg-sprite-loader": "^4.1.3",
"vue-template-compiler": "^2.5.21", "vue-template-compiler": "^2.5.21",
"webpack-bundle-analyzer": "^3.4.1", "webpack-bundle-analyzer": "^3.4.1",
......
...@@ -42,3 +42,9 @@ export function baseGoodsUpdate(data) { ...@@ -42,3 +42,9 @@ export function baseGoodsUpdate(data) {
data.method = `${path}basegoods.update` data.method = `${path}basegoods.update`
return request(data, 'post') return request(data, 'post')
} }
// 导出
export function exportBaseList(data) {
data.method = `${path}basegoods.export`
return request(data, 'post')
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: limin * @Author: limin
* @Date: 2019-08-26 18:02:55 * @Date: 2019-08-26 18:02:55
* @Last Modified by: chenwq * @Last Modified by: chenwq
* @Last Modified time: 2020-11-12 19:02:01 * @Last Modified time: 2020-11-12 20:49:55
*/ */
import request from './request' import request from './request'
...@@ -42,6 +42,12 @@ export function AccountLogin(data) { ...@@ -42,6 +42,12 @@ export function AccountLogin(data) {
// }) // })
} }
// 权限
export function getAuths(data) {
data.method = `${USER_PATH}userauth.getUserAuth`
return request(data)
}
/** /**
* 注册 * 注册
* @param {*} data 参数 * @param {*} data 参数
......
/* eslint-disable */
/* Blob.js
* A Blob implementation.
* 2014-05-27
*
* By Eli Grey, http://eligrey.com
* By Devin Samarin, https://github.com/eboyjr
* License: X11/MIT
* See LICENSE.md
*/
/*global self, unescape */
/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
plusplus: true */
/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
(function (view) {
"use strict";
view.URL = view.URL || view.webkitURL;
if (view.Blob && view.URL) {
try {
new Blob;
return;
} catch (e) {}
}
// Internally we use a BlobBuilder implementation to base Blob off of
// in order to support older browsers that only have BlobBuilder
var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) {
var
get_class = function(object) {
return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
}
, FakeBlobBuilder = function BlobBuilder() {
this.data = [];
}
, FakeBlob = function Blob(data, type, encoding) {
this.data = data;
this.size = data.length;
this.type = type;
this.encoding = encoding;
}
, FBB_proto = FakeBlobBuilder.prototype
, FB_proto = FakeBlob.prototype
, FileReaderSync = view.FileReaderSync
, FileException = function(type) {
this.code = this[this.name = type];
}
, file_ex_codes = (
"NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
+ "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
).split(" ")
, file_ex_code = file_ex_codes.length
, real_URL = view.URL || view.webkitURL || view
, real_create_object_URL = real_URL.createObjectURL
, real_revoke_object_URL = real_URL.revokeObjectURL
, URL = real_URL
, btoa = view.btoa
, atob = view.atob
, ArrayBuffer = view.ArrayBuffer
, Uint8Array = view.Uint8Array
;
FakeBlob.fake = FB_proto.fake = true;
while (file_ex_code--) {
FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
}
if (!real_URL.createObjectURL) {
URL = view.URL = {};
}
URL.createObjectURL = function(blob) {
var
type = blob.type
, data_URI_header
;
if (type === null) {
type = "application/octet-stream";
}
if (blob instanceof FakeBlob) {
data_URI_header = "data:" + type;
if (blob.encoding === "base64") {
return data_URI_header + ";base64," + blob.data;
} else if (blob.encoding === "URI") {
return data_URI_header + "," + decodeURIComponent(blob.data);
} if (btoa) {
return data_URI_header + ";base64," + btoa(blob.data);
} else {
return data_URI_header + "," + encodeURIComponent(blob.data);
}
} else if (real_create_object_URL) {
return real_create_object_URL.call(real_URL, blob);
}
};
URL.revokeObjectURL = function(object_URL) {
if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
real_revoke_object_URL.call(real_URL, object_URL);
}
};
FBB_proto.append = function(data/*, endings*/) {
var bb = this.data;
// decode data to a binary string
if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
var
str = ""
, buf = new Uint8Array(data)
, i = 0
, buf_len = buf.length
;
for (; i < buf_len; i++) {
str += String.fromCharCode(buf[i]);
}
bb.push(str);
} else if (get_class(data) === "Blob" || get_class(data) === "File") {
if (FileReaderSync) {
var fr = new FileReaderSync;
bb.push(fr.readAsBinaryString(data));
} else {
// async FileReader won't work as BlobBuilder is sync
throw new FileException("NOT_READABLE_ERR");
}
} else if (data instanceof FakeBlob) {
if (data.encoding === "base64" && atob) {
bb.push(atob(data.data));
} else if (data.encoding === "URI") {
bb.push(decodeURIComponent(data.data));
} else if (data.encoding === "raw") {
bb.push(data.data);
}
} else {
if (typeof data !== "string") {
data += ""; // convert unsupported types to strings
}
// decode UTF-16 to binary string
bb.push(unescape(encodeURIComponent(data)));
}
};
FBB_proto.getBlob = function(type) {
if (!arguments.length) {
type = null;
}
return new FakeBlob(this.data.join(""), type, "raw");
};
FBB_proto.toString = function() {
return "[object BlobBuilder]";
};
FB_proto.slice = function(start, end, type) {
var args = arguments.length;
if (args < 3) {
type = null;
}
return new FakeBlob(
this.data.slice(start, args > 1 ? end : this.data.length)
, type
, this.encoding
);
};
FB_proto.toString = function() {
return "[object Blob]";
};
FB_proto.close = function() {
this.size = this.data.length = 0;
};
return FakeBlobBuilder;
}(view));
view.Blob = function Blob(blobParts, options) {
var type = options ? (options.type || "") : "";
var builder = new BlobBuilder();
if (blobParts) {
for (var i = 0, len = blobParts.length; i < len; i++) {
builder.append(blobParts[i]);
}
}
return builder.getBlob(type);
};
}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));
/* eslint-disable */
require('script-loader!file-saver');
require('./Blob');
require('script-loader!xlsx/dist/xlsx.core.min');
function generateArray(table) {
var out = [];
var rows = table.querySelectorAll('tr');
var ranges = [];
for (var R = 0; R < rows.length; ++R) {
var outRow = [];
var row = rows[R];
var columns = row.querySelectorAll('td');
for (var C = 0; C < columns.length; ++C) {
var cell = columns[C];
var colspan = cell.getAttribute('colspan');
var rowspan = cell.getAttribute('rowspan');
var cellValue = cell.innerText;
if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
//Skip ranges
ranges.forEach(function (range) {
if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
}
});
//Handle Row Span
if (rowspan || colspan) {
rowspan = rowspan || 1;
colspan = colspan || 1;
ranges.push({s: {r: R, c: outRow.length}, e: {r: R + rowspan - 1, c: outRow.length + colspan - 1}});
}
;
//Handle Value
outRow.push(cellValue !== "" ? cellValue : null);
//Handle Colspan
if (colspan) for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
}
out.push(outRow);
}
return [out, ranges];
};
function datenum(v, date1904) {
if (date1904) v += 1462;
var epoch = Date.parse(v);
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
}
function sheet_from_array_of_arrays(data, opts) {
var ws = {};
var range = {s: {c: 10000000, r: 10000000}, e: {c: 0, r: 0}};
for (var R = 0; R != data.length; ++R) {
for (var C = 0; C != data[R].length; ++C) {
if (range.s.r > R) range.s.r = R;
if (range.s.c > C) range.s.c = C;
if (range.e.r < R) range.e.r = R;
if (range.e.c < C) range.e.c = C;
var cell = {v: data[R][C]};
if (cell.v == null) continue;
var cell_ref = XLSX.utils.encode_cell({c: C, r: R});
if (typeof cell.v === 'number') cell.t = 'n';
else if (typeof cell.v === 'boolean') cell.t = 'b';
else if (cell.v instanceof Date) {
cell.t = 'n';
cell.z = XLSX.SSF._table[14];
cell.v = datenum(cell.v);
}
else cell.t = 's';
ws[cell_ref] = cell;
}
}
if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
return ws;
}
function Workbook() {
if (!(this instanceof Workbook)) return new Workbook();
this.SheetNames = [];
this.Sheets = {};
}
function s2ab(s) {
var buf = new ArrayBuffer(s.length);
var view = new Uint8Array(buf);
for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
return buf;
}
export function export_table_to_excel(id) {
var theTable = document.getElementById(id);
console.log('a')
var oo = generateArray(theTable);
var ranges = oo[1];
/* original data */
var data = oo[0];
var ws_name = "SheetJS";
console.log(data);
var wb = new Workbook(), ws = sheet_from_array_of_arrays(data);
/* add ranges to worksheet */
// ws['!cols'] = ['apple', 'banan'];
ws['!merges'] = ranges;
/* add worksheet to workbook */
wb.SheetNames.push(ws_name);
wb.Sheets[ws_name] = ws;
var wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: false, type: 'binary'});
saveAs(new Blob([s2ab(wbout)], {type: "application/octet-stream"}), "test.xlsx")
}
function formatJson(jsonData) {
console.log(jsonData)
}
export function export_json_to_excel(th, jsonData, defaultTitle) {
/* original data */
var data = jsonData;
data.unshift(th);
var ws_name = "SheetJS";
var wb = new Workbook(), ws = sheet_from_array_of_arrays(data);
/* add worksheet to workbook */
wb.SheetNames.push(ws_name);
wb.Sheets[ws_name] = ws;
var wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: false, type: 'binary'});
var title = defaultTitle || '列表'
saveAs(new Blob([s2ab(wbout)], {type: "application/octet-stream"}), title + ".xlsx")
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: limin * @Author: limin
* @Date: 2019-08-27 19:16:26 * @Date: 2019-08-27 19:16:26
* @Last Modified by: chenwq * @Last Modified by: chenwq
* @Last Modified time: 2020-10-29 18:13:28 * @Last Modified time: 2020-11-13 09:44:00
*/ */
const permision = {} const permision = {}
/** /**
...@@ -78,7 +78,7 @@ const _loop = function(res, fnGetMenu) { ...@@ -78,7 +78,7 @@ const _loop = function(res, fnGetMenu) {
if (!__oMenu) { // 不存在 可能是 按钮 直接继续循环 if (!__oMenu) { // 不存在 可能是 按钮 直接继续循环
return true return true
} }
if (+(__oMenu.parentId) === 0) { // 取出1级菜单 if (+(__oMenu.parentId) === 1) { // 取出1级菜单
__aParent.push(__oMenu) __aParent.push(__oMenu)
} else { // 取出子菜单 } else { // 取出子菜单
__aSub.push(__oMenu) __aSub.push(__oMenu)
......
...@@ -29,6 +29,7 @@ Vue.prototype.notice = notice ...@@ -29,6 +29,7 @@ Vue.prototype.notice = notice
// Vue.use(D2Crud) // Vue.use(D2Crud)
var baseConfig = '' var baseConfig = ''
axios({ axios({
// baseURL: process.env.VUE_APP_REPO + '/dj-car-life-system-config-test',
baseURL: process.env.VUE_APP_REPO + '/dj-car-life-system-config', baseURL: process.env.VUE_APP_REPO + '/dj-car-life-system-config',
method: 'get' method: 'get'
}).then(({ }).then(({
......
...@@ -24,8 +24,8 @@ export const home = { ...@@ -24,8 +24,8 @@ export const home = {
icon: 's-home', icon: 's-home',
meta: { meta: {
title: '预录客户', title: '预录客户',
authId: '101', authId: '901',
parentId: '0', parentId: '1',
cache: true cache: true
}, },
component: _import('flow/editCustomer') component: _import('flow/editCustomer')
...@@ -57,154 +57,156 @@ export const sys = [ ...@@ -57,154 +57,156 @@ export const sys = [
* 106 - 系统设置 * 106 - 系统设置
*/ */
export const resources = { export const resources = {
'103': { '903': {
path: '/goods', path: '/goods',
name: 'goods', name: 'goods',
icon: 'document', icon: 'document',
meta: { meta: {
title: '商品库', title: '商品库',
authId: '103', authId: '903',
parentId: '0', parentId: '1',
cache: true cache: true
} }
}, },
'10301': { '90301': {
path: '/product', path: '/product',
name: 'product', name: 'product',
icon: 'document', icon: 'document',
meta: { meta: {
title: '产品管理', title: '产品管理',
authId: '10301', authId: '90301',
parentId: '103', parentId: '903',
cache: true cache: true
}, },
auth: [{ auth: [{
authId: '1030101', authId: '9030101',
parentId: '10301', parentId: '90301',
label: '新增商品', label: '新增商品',
category: 'Button', category: 'Button',
type: 'primary', type: 'primary',
handle: 'handleAdd' handle: 'handleAdd'
}, { },
authId: '1030102', // {
parentId: '10301', // authId: '1030102',
label: '导出', // parentId: '10301',
category: 'Button', // label: '导出',
handle: 'handleExport' // category: 'Button',
}, { // handle: 'handleExport'
authId: '1030103', // },
parentId: '10301', {
authId: '9030102',
parentId: '90301',
label: '修改', label: '修改',
handle: 'handleEdit' handle: 'handleEdit'
}], }],
component: _import('goods/product') component: _import('goods/product')
}, },
'10304': { '90304': {
path: '/editProduct', path: '/editProduct',
name: 'editProduct', name: 'editProduct',
icon: 'document', icon: 'document',
meta: { meta: {
title: '产品编辑', title: '产品编辑',
authId: '10304', authId: '90304',
parentId: '103', parentId: '903',
cache: true, cache: true,
sideHidden: true sideHidden: true
}, },
component: _import('goods/editProduct') component: _import('goods/editProduct')
}, },
'10302': { '90302': {
path: '/commodity', path: '/commodity',
name: 'commodity', name: 'commodity',
icon: 'document', icon: 'document',
meta: { meta: {
title: '商品管理', title: '商品管理',
authId: '10302', authId: '90302',
parentId: '103', parentId: '903',
cache: true cache: true
}, },
auth: [{ auth: [{
authId: '1030201', authId: '9030201',
parentId: '10302', parentId: '90302',
label: '新增商品', label: '新增商品',
category: 'Button', category: 'Button',
type: 'primary', type: 'primary',
handle: 'handleAdd' handle: 'handleAdd'
}, { }, {
authId: '1030202', authId: '9030202',
parentId: '10302', parentId: '90302',
label: '导出', label: '导出',
category: 'Button', category: 'Button',
handle: 'handleExport' handle: 'handleExport'
// rule:{0: '上架',} // rule:{0: '上架',}
}, { }, {
authId: '1030203', authId: '9030203',
parentId: '10302', parentId: '90302',
label: '编辑', label: '编辑',
handle: 'handleEdit' handle: 'handleEdit'
}, { }, {
authId: '1030204', authId: '9030204',
parentId: '10302', parentId: '90302',
label: '查看门店', label: '查看门店',
handle: 'handleDetail' handle: 'handleDetail'
}], }],
component: _import('goods/commodity') component: _import('goods/commodity')
}, },
'10305': { '90305': {
path: '/editCommodity', path: '/editCommodity',
name: 'editCommodity', name: 'editCommodity',
icon: 'document', icon: 'document',
meta: { meta: {
title: '商品编辑', title: '商品编辑',
authId: '10305', authId: '90305',
parentId: '103', parentId: '903',
// cache: true, // cache: true,
sideHidden: true sideHidden: true
}, },
component: _import('goods/editCommodity') component: _import('goods/editCommodity')
}, },
'106': { '906': {
path: '/systemConfig', path: '/systemConfig',
name: 'systemConfig', name: 'systemConfig',
icon: 'document', icon: 'document',
meta: { meta: {
title: '系统设置', title: '系统设置',
authId: '106', authId: '906',
parentId: '0', parentId: '1',
cache: true cache: true
} }
}, },
'10601': { '90601': {
path: '/personalInfo', path: '/personalInfo',
name: 'personalInfo', name: 'personalInfo',
icon: 'document', icon: 'document',
meta: { meta: {
title: '个人信息', title: '个人信息',
authId: '10601', authId: '90601',
parentId: '106', parentId: '906',
cache: true cache: true
}, },
component: _import('systemConfig/personalInfo') component: _import('systemConfig/personalInfo')
}, },
'10602': { '90602': {
path: '/serviceStore', path: '/serviceStore',
name: 'serviceStore', name: 'serviceStore',
icon: 'document', icon: 'document',
meta: { meta: {
title: '服务4s店', title: '服务4s店',
authId: '10602', authId: '90602',
parentId: '106', parentId: '906',
cache: true cache: true
}, },
auth: [{ auth: [{
authId: '1060201', authId: '9060201',
parentId: '10602', parentId: '90602',
label: '新增服务门店', label: '新增服务门店',
category: 'Button', category: 'Button',
type: 'primary', type: 'primary',
handle: 'handleAdd' handle: 'handleAdd'
}, { }, {
authId: '1060202', authId: '9060202',
parentId: '10602', parentId: '90602',
label: '删除', label: '删除',
handle: 'handleDelete' handle: 'handleDelete'
}], }],
......
import util from '@/libs/util.js' import util from '@/libs/util.js'
import { AccountLogin } from '@api/sys.account' import { AccountLogin, getAuths } from '@api/sys.account'
import { SUPPER_ADMIN } from '@/common/constants' import { SUPPER_ADMIN } from '@/common/constants'
import { localRoutes } from '@/router/routes' import { localRoutes } from '@/router/routes'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
...@@ -25,14 +25,21 @@ export default { ...@@ -25,14 +25,21 @@ export default {
// 如有必要 token 需要定时更新,默认保存一天 // 如有必要 token 需要定时更新,默认保存一天
// util.cookies.set('uuid', data.loginName) // util.cookies.set('uuid', data.loginName)
util.cookies.set('token', data.sessionId) util.cookies.set('token', data.sessionId)
getAuths({}).then(async res => {
console.log(res)
!res.map(i => i.authId).includes('901') && res.unshift({
authId: '901',
name: '预录客户',
parentId: '1'
})
data.roleType = baseConfig.hasAuth ? data.roleType : SUPPER_ADMIN data.roleType = baseConfig.hasAuth ? data.roleType : SUPPER_ADMIN
const authes = (+data.roleType === SUPPER_ADMIN) const authes = (+data.roleType === SUPPER_ADMIN)
? util.permision.flatten(Object.values(localRoutes)) ? util.permision.flatten(Object.values(localRoutes))
.map(obj => ({ authId: obj.authId, parentId: obj.parentId })) .map(obj => ({ authId: obj.authId, parentId: obj.parentId }))
: _.cloneDeep(data.authes) : _.cloneDeep(res)
await dispatch('d2admin/auth/set', authes, { root: true }) await dispatch('d2admin/auth/set', authes, { root: true })
// // 设置 vuex 用户信息 // // 设置 vuex 用户信息
delete data.authes // delete data.authes
await dispatch('d2admin/user/set', data, { root: true }) await dispatch('d2admin/user/set', data, { root: true })
// 初始化权限 // 初始化权限
await dispatch('d2admin/auth/init', null, { root: true }) await dispatch('d2admin/auth/init', null, { root: true })
...@@ -41,6 +48,7 @@ export default { ...@@ -41,6 +48,7 @@ export default {
// 结束 // 结束
resolve() resolve()
}) })
})
.catch(err => { .catch(err => {
console.log('err: ', err) console.log('err: ', err)
reject(err) reject(err)
......
...@@ -106,8 +106,10 @@ ...@@ -106,8 +106,10 @@
</template> </template>
<script> <script>
import { getList } from '@api/commodity' import { getList, exportBaseList } from '@api/commodity'
import { BaseData } from '@/common/constants.js' import { BaseData } from '@/common/constants.js'
import Blob from '@/common/Blob.js'
import Export2Excel from '@/common/Export2Excel.js'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import _ from 'lodash' import _ from 'lodash'
import storeDetail from './storeDetail' import storeDetail from './storeDetail'
...@@ -220,7 +222,14 @@ export default { ...@@ -220,7 +222,14 @@ export default {
} }
}) })
}, },
handleExport() { }, handleExport() {
const tHeader = ['商品ID', '商品名称', '分类', '品牌商']
const fieldVal = ['goodsCode', 'goodsName', 'goodsTypeName', 'brandMerchantName']
exportBaseList(this.searchForm).then(res => {
console.log(res)
// const exportData = this.
})
},
handleEdit(row) { handleEdit(row) {
this.$router.push({ this.$router.push({
name: 'editCommodity', name: 'editCommodity',
......
...@@ -186,7 +186,7 @@ export default { ...@@ -186,7 +186,7 @@ export default {
} }
}) })
}, },
handleExport() { }, // handleExport() { },
handleEdit(row) { handleEdit(row) {
// console.log(row) // console.log(row)
this.$router.push({ this.$router.push({
......
...@@ -121,8 +121,8 @@ export default { ...@@ -121,8 +121,8 @@ export default {
time: dayjs().format('HH:mm:ss'), time: dayjs().format('HH:mm:ss'),
// 表单 // 表单
formLogin: { formLogin: {
// userName: 'dongdao', userName: 'dongdao',
userName: 'houlai', // userName: 'houlai',
password: '123456' password: '123456'
}, },
// 表单校验 // 表单校验
......
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
const clone = util.deepClone(Object.values(localRoutes)) const clone = util.deepClone(Object.values(localRoutes))
const { menus } = util.permision.packMenusBtns(clone) const { menus } = util.permision.packMenusBtns(clone)
const all = util.permision.flatten(clone) const all = util.permision.flatten(clone)
menus.find(o => o.authId === '101').disabled = true menus.find(o => o.authId === '901').disabled = true
return { menus, all } return { menus, all }
} }
}, },
......
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
handler(value) { handler(value) {
if (!value) return if (!value) return
const chk = [] const chk = []
const treeChk = ['101'] const treeChk = ['901']
this.$nextTick(() => { this.$nextTick(() => {
value.forEach(v => { value.forEach(v => {
v.authId += '' v.authId += ''
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!