From 6f9dc32e8aa57fc265ec15db758f1a71b92580c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=98=8A=E5=A4=A9?= <442384644@qq.com> Date: Tue, 27 Sep 2022 15:30:30 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=A8=A1=E7=89=88=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E3=80=91=E6=9B=B4=E6=96=B0=E7=AE=A1=E7=90=86=E7=AB=AF=E6=BA=90?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/admin/package-lock.json | 33 +- template/admin/package.json | 2 +- template/admin/src/api/product.js | 13 + template/admin/src/api/setting.js | 11 + template/admin/src/api/user.js | 11 + .../components/main/components/user/user.vue | 7 + .../src/pages/product/productList/index.vue | 276 +++++++++++++++- .../pages/setting/multiLanguage/country.vue | 42 ++- .../pages/setting/multiLanguage/langList.vue | 2 +- .../admin/src/pages/setting/user/index.vue | 10 - .../src/pages/setting/userFile/index.vue | 80 +++++ .../system/maintain/systemFile/opendir.vue | 303 ++++++++++++++---- template/admin/src/router/routers.js | 9 + template/admin/src/styles/style.css | 1 + 14 files changed, 706 insertions(+), 94 deletions(-) create mode 100644 template/admin/src/pages/setting/userFile/index.vue diff --git a/template/admin/package-lock.json b/template/admin/package-lock.json index a65efb656..c2d8587ea 100644 --- a/template/admin/package-lock.json +++ b/template/admin/package-lock.json @@ -4992,8 +4992,7 @@ "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==" }, "binary-extensions": { "version": "2.0.0", @@ -8004,8 +8003,7 @@ "emojis-list": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==" }, "encodeurl": { "version": "1.0.2", @@ -12822,7 +12820,6 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", - "dev": true, "requires": { "minimist": "^1.2.5" } @@ -14446,9 +14443,29 @@ "integrity": "sha1-sr52n6MZQL6e7qZGnAdeNQBvo9M=" }, "monaco-editor": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.21.3.tgz", - "integrity": "sha512-9N7wATLpi+googstvtm6IKg97vPQ77FDYEpkow5tLriM/VJ0DaTRyUP4UVzcoH7KlPDX+e/rE7/imcOUeGkT6g==" + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.28.1.tgz", + "integrity": "sha512-P1vPqxB4B1ZFzTeR1ScggSp9/5NoQrLCq88fnlNUsuRAP1usEBN4TIpI2lw0AYIZNVIanHk0qwjze2uJwGOHUw==" + }, + "monaco-editor-webpack-plugin": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/monaco-editor-webpack-plugin/-/monaco-editor-webpack-plugin-4.2.0.tgz", + "integrity": "sha512-/P3sFiEgBl+Y50he4mbknMhbLJVop5gBUZiPS86SuHUDOOnQiQ5rL1jU5lwt1XKAwMEkhwZbUwqaHxTPkb1Utw==", + "requires": { + "loader-utils": "^2.0.0" + }, + "dependencies": { + "loader-utils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", + "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + } + } }, "move-concurrently": { "version": "1.0.1", diff --git a/template/admin/package.json b/template/admin/package.json index c381d6a39..8a7e00c6a 100644 --- a/template/admin/package.json +++ b/template/admin/package.json @@ -52,7 +52,7 @@ "uglifyjs-webpack-plugin": "^2.2.0", "v-org-tree": "^1.0.6", "v-viewer": "^1.5.1", - "view-design": "^4.4.0", + "view-design": "^4.7.0", "vue": "^2.5.10", "vue-awesome-swiper": "^4.1.1", "vue-codemirror": "^4.0.6", diff --git a/template/admin/src/api/product.js b/template/admin/src/api/product.js index 784151ab2..9ea260325 100644 --- a/template/admin/src/api/product.js +++ b/template/admin/src/api/product.js @@ -388,3 +388,16 @@ export function importCard(data) { params: data, }); } + +/** + * @description 商品批量设置 + * @param {Number} param id {Number} 属性id + * @param {Object} param data {Object} 传值参数 + */ + export function batchSetting(data) { + return request({ + url: `product/batch/setting`, + method: 'POST', + data, + }); +} \ No newline at end of file diff --git a/template/admin/src/api/setting.js b/template/admin/src/api/setting.js index 6ff04a6d1..1bece6f59 100644 --- a/template/admin/src/api/setting.js +++ b/template/admin/src/api/setting.js @@ -1077,4 +1077,15 @@ export function saveType(type) { method: 'get', params: data, }); +} +/** + * 添加语言地区表单 + * @param {*} id + * @returns + */ + export function langCountryForm(id) { + return request({ + url: `setting/lang_country/form/${id}`, + method: 'get', + }); } \ No newline at end of file diff --git a/template/admin/src/api/user.js b/template/admin/src/api/user.js index 14e6b3268..51cda2137 100644 --- a/template/admin/src/api/user.js +++ b/template/admin/src/api/user.js @@ -310,6 +310,17 @@ export function updtaeAdmin(data) { data, }); } +/** + * @description 文件管理 --- 设置密码 + * data 请求参数 + */ +export function setFilePassword(data) { + return request({ + url: `setting/set_file_password`, + method: 'PUT', + data, + }); +} /** * @description 个人中心 --- 设置会员等级 diff --git a/template/admin/src/components/main/components/user/user.vue b/template/admin/src/components/main/components/user/user.vue index e4de6982a..2ccd10419 100644 --- a/template/admin/src/components/main/components/user/user.vue +++ b/template/admin/src/components/main/components/user/user.vue @@ -11,6 +11,7 @@ 个人中心 + 文件管理 退出登录 @@ -75,6 +76,9 @@ export default { userCenter() { this.$router.push('/admin/system/user'); }, + fileEdit(){ + this.$router.push('/admin/system/files'); + }, message() { this.$router.push({ name: 'message_page', @@ -91,6 +95,9 @@ export default { case 'message': this.message(); break; + case 'fileEdit': + this.fileEdit(); + break; } }, }, diff --git a/template/admin/src/pages/product/productList/index.vue b/template/admin/src/pages/product/productList/index.vue index 7d9b68de2..b3fb3bf05 100644 --- a/template/admin/src/pages/product/productList/index.vue +++ b/template/admin/src/pages/product/productList/index.vue @@ -45,6 +45,20 @@ > + + + + 分类设置 + 物流设置 + 赠送积分 + 赠送优惠券 + 用户标签 + 商品推荐 + + + + +
+
+
+
+ {{ + item.label_name + }} +
+ 选择用户关联标签 +
+
+
+
+
+ + + 热卖单品 + 促销单品 + 精品推荐 + 首发新品 + 优品推荐 + + + + + + + + + +
+ @@ -148,19 +276,23 @@ import toExcel from '../../../utils/Excel.js'; import { mapState } from 'vuex'; import taoBao from './taoBao'; import goodsDetail from './components/goodsDetail.vue'; +import couponList from '@/components/couponList'; import { getGoodHeade, getGoods, PostgoodsIsShow, - treeListApi, + treeListApi, // 分类列表 productShowApi, productUnshowApi, storeProductApi, + batchSetting, } from '@/api/product'; +import userLabel from '@/components/labelList'; + export default { name: 'product_productList', - components: { expandRow, attribute, taoBao, goodsDetail }, + components: { expandRow, attribute, taoBao, goodsDetail, userLabel, couponList }, computed: { ...mapState('userLevel', ['categoryId']), }, @@ -168,6 +300,24 @@ export default { return { template: false, modals: false, + batchModal: false, + labelShow: false, + batchType: 1, // 批量设置类型 + batchFormData: { + cate_id: [], + logistics: [], + freight: 2, + postage: 0, + temp_id: null, + give_integral: 0, + label_id: [], + coupon_ids: [], + recommend: [], + }, + ruleBatch: {}, + couponName: [], // 优惠券 + dataLabel: [], // 标签 + templateList: [], // 运费模版 grid: { xl: 6, lg: 8, @@ -278,6 +428,7 @@ export default { ids: [], goodsId: '', isProductBox: false, + treeSelect: [], }; }, watch: { @@ -298,10 +449,104 @@ export default { } }, methods: { + batchSub() { + console.log(this.selectedIds, this.ids); + let data = this.batchFormData; + data.ids = this.ids; + data.type = this.batchType; + let activeIds = []; + this.dataLabel.forEach((item) => { + activeIds.push(item.id); + }); + data.label_id = activeIds; + batchSetting(data) + .then((res) => { + this.$Message.success(res.msg); + this.getDataList(); + this.clearBatchData(); + }) + .catch((err) => { + this.$Message.error(err.msg); + }); + }, + clearBatchData(status) { + if (!status) { + this.batchFormData = { + cate_id: [], + logistics: [], + freight: 0, + postage: null, + temp_id: null, + give_integral: null, + label_id: [], + coupon_ids: [], + recommend: [], + }; + this.ids = []; + this.dataLabel = []; + this.clearAll(false); + } + }, + // 批量设置商品 + batchSelect(type) { + if (this.ids.length === 0) { + this.$Message.warning('请选择要设置的商品'); + } else { + this.batchType = type; + this.batchModal = true; + this.productGetTemplate(); + } + }, + activeData(dataLabel) { + this.labelShow = false; + this.dataLabel = dataLabel; + }, + nameId(id, names) { + this.batchFormData.coupon_ids = id; + this.couponName = this.unique(names); + }, + handleClose(name) { + let index = this.couponName.indexOf(name); + this.couponName.splice(index, 1); + this.formValidate.coupon_ids.splice(index, 1); + }, + //对象数组去重; + unique(arr) { + const res = new Map(); + return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1)); + }, + // 获取运费模板; + productGetTemplate() { + productGetTemplateApi().then((res) => { + this.templateList = res.data; + }); + }, + // 标签弹窗关闭 + labelClose() { + this.labelShow = false; + }, look(row) { this.goodsId = row.id; this.isProductBox = true; }, + // 物流方式 + logisticsBtn(e) { + this.batchFormData.logistics = e; + }, + // 关联用户标签 + openLabel(row) { + this.labelShow = true; + this.$refs.userLabel.userLabel(JSON.parse(JSON.stringify(this.dataLabel))); + }, + closeLabel(label) { + let index = this.dataLabel.indexOf(this.dataLabel.filter((d) => d.id == label.id)[0]); + this.dataLabel.splice(index, 1); + }, + // 添加优惠券 + addCoupon() { + this.$refs.couponTemplates.isTemplate = true; + this.$refs.couponTemplates.tableList(); + }, getPath() { this.columns2 = [...this.columns]; if (name !== '1' && name !== '2') { @@ -376,6 +621,7 @@ export default { }); } }, + // 全选 // onSelectTab (selection) { // let data = [] @@ -412,6 +658,9 @@ export default { this.setChecked(); }); }, + clearAll(status) { + this.$refs.table.selectAll(status); + }, // 取消某一行 handleCancelRow(selection, row) { this.selectedIds.delete(row.id); @@ -605,7 +854,13 @@ export default { overflow: auto; } } +.batch-box{ + >>> .ivu-modal-body { + overflow: auto; + min-height: 350px; + } +} .tabBox_img { width: 36px; height: 36px; @@ -655,4 +910,21 @@ export default { border: 1px solid #eee; } } + +.labelInput { + border: 1px solid #dcdee2; + width: 20%; + padding: 0 5px; + border-radius: 5px; + min-height: 30px; + cursor: pointer; + + .span { + color: #c5c8ce; + } + + .iconxiayi { + font-size: 12px; + } +} diff --git a/template/admin/src/pages/setting/multiLanguage/country.vue b/template/admin/src/pages/setting/multiLanguage/country.vue index fa4a035fd..30105a56e 100644 --- a/template/admin/src/pages/setting/multiLanguage/country.vue +++ b/template/admin/src/pages/setting/multiLanguage/country.vue @@ -34,6 +34,11 @@ + + + + + 编辑 - 删除 + 删除
@@ -64,10 +69,17 @@ + + diff --git a/template/admin/src/pages/system/maintain/systemFile/opendir.vue b/template/admin/src/pages/system/maintain/systemFile/opendir.vue index 6ccec2a53..f50f2bb03 100644 --- a/template/admin/src/pages/system/maintain/systemFile/opendir.vue +++ b/template/admin/src/pages/system/maintain/systemFile/opendir.vue @@ -27,13 +27,13 @@ - +

{{title}}

- +
@@ -48,7 +48,7 @@
-