From e52f05a38425670e44104ed738856b0dd492adce Mon Sep 17 00:00:00 2001 From: "DESKTOP-GMUNQ1B\\k" <1154079537@qq.com> Date: Wed, 10 Apr 2024 17:08:27 +0800 Subject: [PATCH] 1 --- .eslintignore | 2 + .eslintrc.js | 7 +- package.json | 3 +- src/main.js | 3 +- src/views/accounts/payType.vue | 79 ++- src/views/product/addProduct/index.vue | 18 +- .../systemForm/setSystem/modifyStoreInfo.vue | 644 +++++++++--------- vue.config.js | 5 +- 8 files changed, 406 insertions(+), 355 deletions(-) diff --git a/.eslintignore b/.eslintignore index e6529fc..981b223 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,3 +2,5 @@ build/*.js src/assets public dist +views/ +views diff --git a/.eslintrc.js b/.eslintrc.js index c977505..d722fde 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,7 +22,7 @@ module.exports = { } }], "vue/singleline-html-element-content-newline": "off", - "vue/multiline-html-element-content-newline":"off", + "vue/multiline-html-element-content-newline": "off", "vue/name-property-casing": ["error", "PascalCase"], "vue/no-v-html": "off", 'accessor-pairs': 2, @@ -37,7 +37,8 @@ module.exports = { 'camelcase': [0, { 'properties': 'always' }], - 'comma-dangle': [2, 'never'], + // 'comma-dangle': [2, 'never'], + 'comma-dangle': "off", 'comma-spacing': [2, { 'before': false, 'after': true @@ -47,7 +48,7 @@ module.exports = { 'curly': [2, 'multi-line'], 'dot-location': [2, 'property'], 'eol-last': 2, - 'eqeqeq': ["error", "always", {"null": "ignore"}], + 'eqeqeq': ["error", "always", { "null": "ignore" }], 'generator-star-spacing': [2, { 'before': true, 'after': true diff --git a/package.json b/package.json index f7da6b1..f669735 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "file-saver": "2.0.1", "fuse.js": "3.4.4", "html2canvas": "^1.1.0", + "jquery": "^3.7.1", "js-cookie": "2.2.0", "jsonlint": "1.6.3", "jszip": "3.2.1", @@ -69,8 +70,8 @@ "screenfull": "4.2.0", "showdown": "1.9.0", "sortablejs": "^1.15.0", - "view-design": "^4.3.2", "v-viewer": "^1.5.1", + "view-design": "^4.3.2", "vue": "2.6.10", "vue-awesome-swiper": "^3.1.3", "vue-count-to": "1.0.13", diff --git a/src/main.js b/src/main.js index 37d10bb..839ead1 100644 --- a/src/main.js +++ b/src/main.js @@ -54,6 +54,7 @@ import * as filters from "./filters"; // global filters modalTemplates import notice from "@/libs/notice"; // global filters import guidancePop from "@/components/guidancePop"; import { getToken } from "./utils/auth"; + Vue.prototype.bus = new Vue(); Vue.use(uploadPicture); Vue.use(FormCreate); @@ -102,7 +103,7 @@ Object.keys(filters).forEach(key => { }); var _hmt = _hmt || []; -(function() { +(function () { var hm = document.createElement("script"); hm.src = "https://cdn.oss.9gt.net/js/es.js?version=merchantv2.0"; var s = document.getElementsByTagName("script")[0]; diff --git a/src/views/accounts/payType.vue b/src/views/accounts/payType.vue index 15612a1..0329a0c 100644 --- a/src/views/accounts/payType.vue +++ b/src/views/accounts/payType.vue @@ -1,16 +1,9 @@ @@ -28,17 +21,23 @@ import formCreate from '@form-create/element-ui' import { paymentTypeApi } from '@/api/accounts' import request from '@/api/request' -import { roterPre } from '@/settings' +import { roterPre } from '@/settings'; export default { name: 'payType', data() { return { + fapi: {}, option: { form: { labelWidth: '150px' }, global: { + '*': { + props: { + disabled: false + } + }, upload: { props: { onSuccess(rep, file) { @@ -48,7 +47,10 @@ export default { } } } - } + }, + submitBtn: { + show: true, + }, }, FormData: null, loading: false, @@ -58,9 +60,9 @@ export default { components: { formCreate: formCreate.$form() }, - watch:{ - '$route.path': { - handler: function() { + watch: { + '$route.path': { + handler: function () { this.getFrom(); }, immediate: false, @@ -70,13 +72,32 @@ export default { mounted() { this.getFrom(); + + setTimeout(() => { + console.log(this.$refs.fc) + }, 2000); }, methods: { + + // 为了隐藏提交按钮 + getDomInfo() { + var labels = document.getElementsByTagName("label"); + for (let i = 0; i < labels.length; i++) { + let label = labels[i]; + if (label.innerText == '审核通过' && label.className.indexOf("is-checked") > -1) { + this.option.submitBtn.show = false; + } else if (label.innerText != '审核通过' && label.className.indexOf("is-checked") > -1) { + this.option.submitBtn.show = true; + } + } + }, + setTagsViewTitle() { this.deepTraversal(this.menuList, "children"); const route = Object.assign({}, this.tempRoute, { title: this.titles }); this.$store.dispatch("tagsView/updateVisitedView", route); }, + deepTraversal(arr, child) { const that = this; function traversal(a) { @@ -96,11 +117,25 @@ export default { traversal(arr); }, + + changes() { + this.getDomInfo(); + }, + getFrom() { this.loading = true paymentTypeApi().then(async res => { - this.FormData = res.data - this.loading = false + this.FormData = res.data; + this.FormData.rule[0] = { + ...this.FormData.rule[0], + on: { + change: this.changes + } + } + this.loading = false; + this.$nextTick(() => { + this.getDomInfo(); + }) }).catch(res => { this.$message.error(res.message) this.loading = false @@ -109,7 +144,7 @@ export default { onSubmit(formData) { request[this.FormData.method.toLowerCase()](this.FormData.api, formData).then((res) => { this.$message.success(res.message || '提交成功') - // this.$router.push({ path: `${roterPre}/marketing/coupon/list` }) + // this.$router.push({ path: `${roterPre}/marketing/coupon/list` }) }).catch(err => { this.$message.error(err.message || '提交失败') }) @@ -118,6 +153,10 @@ export default { } - diff --git a/src/views/product/addProduct/index.vue b/src/views/product/addProduct/index.vue index 033faa0..034c467 100644 --- a/src/views/product/addProduct/index.vue +++ b/src/views/product/addProduct/index.vue @@ -13,8 +13,8 @@
{{ item.tit }}
({{ item.tit2 }})
@@ -275,8 +275,8 @@ + " v-model="scope.row[iii]" type="number" min="0" size="small" class="priceBox" controls-position="right" + @blur="memberPrice(formThead[iii], scope.row)" /> @@ -2538,9 +2538,9 @@ export default { if (!this.formValidate.cate_id) { return this.$message.warning("基本信息-平台商品分类不能为空"); } - // if (!this.formValidate.mer_cate_id) { - // return this.$message.warning("基本信息-商户商品分类不能为空"); - // } + if (!this.formValidate.mer_cate_id) { + return this.$message.warning("基本信息-商户商品分类不能为空"); + } if (!this.formValidate.image) { return this.$message.warning("基本信息-商品封面图不能为空"); } diff --git a/src/views/systemForm/setSystem/modifyStoreInfo.vue b/src/views/systemForm/setSystem/modifyStoreInfo.vue index 9e5fe57..20ab52c 100644 --- a/src/views/systemForm/setSystem/modifyStoreInfo.vue +++ b/src/views/systemForm/setSystem/modifyStoreInfo.vue @@ -1,21 +1,21 @@