qj-common 4.3.0 → 4.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +12 -12
- package/.eslintrc.js +25 -25
- package/.idea/common.iml +11 -11
- package/.idea/modules.xml +7 -7
- package/.idea/vcs.xml +5 -5
- package/.postcssrc.js +9 -9
- package/.prettierrc.js +7 -7
- package/.project +37 -37
- package/README.md +2 -2
- package/gulpfile.js +20 -20
- package/package.json +18 -18
- package/src/api/apimanage.js +146 -146
- package/src/api/common/index.js +192 -192
- package/src/api/login.js +160 -160
- package/src/api/shopFbu.js +515 -515
- package/src/api/upload.js +8 -8
- package/src/components/Bounced/index.vue +145 -145
- package/src/components/Breadcrumb/index.vue +71 -71
- package/src/components/Checkbox/index.vue +53 -53
- package/src/components/Hamburger/index.vue +48 -48
- package/src/components/Logistics/logic.vue +186 -186
- package/src/components/ScrollBar/index.vue +60 -60
- package/src/components/Sticky/index.vue +76 -76
- package/src/components/SvgIcon/index.vue +42 -42
- package/src/components/ThemePicker/index.vue +243 -243
- package/src/components/Tinymce/components/editorImage.vue +94 -94
- package/src/components/Tinymce/index.vue +166 -166
- package/src/components/Tinymce/plugins.js +7 -7
- package/src/components/Tinymce/toolbar.js +6 -6
- package/src/components/TreeTable/customEval.js +44 -44
- package/src/components/TreeTable/eval.js +29 -29
- package/src/components/TreeTable/index.vue +124 -124
- package/src/components/TreeTable/readme.md +89 -89
- package/src/components/TreeTableApi/customEval.js +49 -49
- package/src/components/TreeTableApi/eval.js +29 -29
- package/src/components/TreeTableApi/index.vue +124 -124
- package/src/components/TreeTableApi/readme.md +89 -89
- package/src/components/Upload/singleImage.vue +123 -123
- package/src/components/Upload/singleImage2.vue +118 -118
- package/src/components/Upload/singleImage3.vue +138 -138
- package/src/components/Upload/upload.vue +295 -295
- package/src/components/workOrderList/index.vue +158 -158
- package/src/dependencies.js +119 -119
- package/src/iconShop/demo.css +539 -539
- package/src/iconShop/demo_index.html +8445 -8445
- package/src/iconShop/iconfont.css +1451 -1451
- package/src/iconShop/iconfont.json +2522 -2522
- package/src/iconShop/iconfont.svg +1070 -1070
- package/src/iconfont/demo.css +539 -539
- package/src/iconfont/demo_index.html +5276 -5276
- package/src/iconfont/iconfont.css +905 -905
- package/src/iconfont/iconfont.json +1563 -1563
- package/src/iconfont/iconfont.svg +692 -692
- package/src/icons/index.js +9 -9
- package/src/lang/e.js +48 -48
- package/src/lang/en.js +48 -48
- package/src/lang/zh.js +48 -48
- package/src/main.js +62 -62
- package/src/permission.js +283 -283
- package/src/permissionForMall.backup.js +375 -375
- package/src/permissionForMall.js +375 -375
- package/src/preset.js +67 -67
- package/src/router/_import_common.js +1 -1
- package/src/router/_import_development.js +1 -1
- package/src/router/_import_production.js +1 -1
- package/src/store/getters.js +39 -39
- package/src/store/index.js +18 -18
- package/src/store/modules/app.js +34 -30
- package/src/store/modules/menu.js +82 -82
- package/src/store/modules/user.js +227 -227
- package/src/styles/element-ui.scss +1368 -1368
- package/src/styles/index.scss +166 -166
- package/src/styles/mixin.scss +27 -27
- package/src/styles/pc-ui.scss +1031 -1031
- package/src/styles/scrollBar.scss +21 -21
- package/src/styles/sidebar.scss +123 -123
- package/src/styles/transition.scss +32 -32
- package/src/styles/variables.scss +44 -44
- package/src/styles/wf-ui.scss +86 -86
- package/src/utils/auth.js +57 -57
- package/src/utils/dom.js +12 -12
- package/src/utils/getQueryString.js +5 -5
- package/src/utils/import.js +5 -5
- package/src/utils/index.js +355 -355
- package/src/utils/interceptor.js +34 -34
- package/src/utils/menu.js +116 -116
- package/src/utils/proapp.js +35 -35
- package/src/utils/query.js +26 -26
- package/src/utils/request.js +366 -366
- package/src/utils/routeMapping.js +39 -39
- package/src/utils/routeMapping.json +310 -310
- package/src/utils/utils.js +84 -84
- package/src/utils/validate.js +102 -102
- package/src/views/404.vue +72 -72
- package/src/views/Layout.vue +106 -106
- package/src/views/imgSwiper/index.vue +34 -34
- package/src/views/layout/Layout.vue +181 -170
- package/src/views/layout/components/AppMain.vue +20 -20
- package/src/views/layout/components/Footer.vue +22 -22
- package/src/views/layout/components/LeftNavbar.vue +318 -310
- package/src/views/layout/components/NavMenu.vue +15 -15
- package/src/views/layout/components/Navbar.vue +664 -661
- package/src/views/layout/components/Sidebar/SidebarItem.vue +116 -113
- package/src/views/layout/components/Sidebar/index.vue +203 -193
- package/src/views/layout/components/index.js +19 -19
- package/src/views/layout/theme/darkBlue/Layout.vue +140 -140
- package/src/views/layout/theme/darkBlue/components/AppMain.vue +38 -38
- package/src/views/layout/theme/darkBlue/components/Footer.vue +147 -147
- package/src/views/layout/theme/darkBlue/components/LeftNavbar(/345/261/225/347/244/272/345/205/250/351/203/250/350/217/234/345/215/225).vue +448 -448
- package/src/views/layout/theme/darkBlue/components/LeftNavbar.3.vue +191 -191
- package/src/views/layout/theme/darkBlue/components/LeftNavbar.vue +466 -466
- package/src/views/layout/theme/darkBlue/components/Navbar.vue +200 -200
- package/src/views/layout/theme/darkBlue/components/Sidebar/SidebarItem.vue +71 -71
- package/src/views/layout/theme/darkBlue/components/Sidebar/index.vue +49 -49
- package/src/views/layout/theme/darkBlue/components/index.js +15 -15
- package/src/views/layout-default/Layout.vue +134 -134
- package/src/views/layout-default/components/AppMain.vue +19 -19
- package/src/views/layout-default/components/Footer.vue +22 -22
- package/src/views/layout-default/components/LeftNavbar.vue +164 -164
- package/src/views/layout-default/components/Navbar.vue +295 -295
- package/src/views/layout-default/components/Sidebar/SidebarItem.vue +67 -67
- package/src/views/layout-default/components/Sidebar/index.vue +59 -59
- package/src/views/layout-default/components/index.js +4 -4
- package/src/views/layout-default/theme/darkBlue/Layout.vue +140 -140
- package/src/views/layout-default/theme/darkBlue/components/AppMain.vue +38 -38
- package/src/views/layout-default/theme/darkBlue/components/Footer.vue +147 -147
- package/src/views/layout-default/theme/darkBlue/components/LeftNavbar.vue +465 -465
- package/src/views/layout-default/theme/darkBlue/components/Navbar.vue +200 -200
- package/src/views/layout-default/theme/darkBlue/components/Sidebar/SidebarItem.vue +69 -69
- package/src/views/layout-default/theme/darkBlue/components/Sidebar/index.vue +49 -49
- package/src/views/layout-default/theme/darkBlue/components/index.js +15 -15
- package/src/views/pc/Internationalization.vue +80 -80
- package/src/views/pc/default/Layout.vue +442 -442
- package/src/views/pc/default/LayoutCard.vue +424 -424
- package/src/views/pc/default/assets/flex.scss +99 -99
- package/src/views/pc/default/footer-modules/DgFooter/index.vue +179 -179
- package/src/views/pc/default/footer-modules/DgFooter/indexSDX.vue +187 -187
- package/src/views/pc/default/footer-modules/footer.vue +171 -171
- package/src/views/pc/default/footer-modules/footerAns.vue +167 -167
- package/src/views/pc/default/footer-modules/footerBulk.vue +169 -169
- package/src/views/pc/default/footer-modules/footerDM.vue +254 -254
- package/src/views/pc/default/footer-modules/footerDefault.vue +267 -267
- package/src/views/pc/default/footer-modules/footerDefaultA.vue +270 -270
- package/src/views/pc/default/footer-modules/footerDefaultNew.vue +201 -201
- package/src/views/pc/default/footer-modules/footerHDB.vue +153 -153
- package/src/views/pc/default/footer-modules/footerHy.vue +63 -63
- package/src/views/pc/default/footer-modules/footerKYW.vue +163 -163
- package/src/views/pc/default/footer-modules/footerMh.vue +30 -30
- package/src/views/pc/default/footer-modules/footerNew.vue +116 -116
- package/src/views/pc/default/footer-modules/footer_yzj.vue +169 -169
- package/src/views/pc/default/footer-modules/footerayd.vue +85 -85
- package/src/views/pc/default/footer-modules/ymFooter.vue +154 -154
- package/src/views/pc/default/footer-modules/zgl.vue +250 -250
- package/src/views/pc/default/header-modules/DgHeader/Logo.vue +57 -57
- package/src/views/pc/default/header-modules/DgHeader/Search.vue +135 -135
- package/src/views/pc/default/header-modules/DgHeader/Settleup.vue +46 -46
- package/src/views/pc/default/header-modules/DgHeader/index.vue +38 -38
- package/src/views/pc/default/header-modules/active.vue +177 -177
- package/src/views/pc/default/header-modules/header.vue +97 -97
- package/src/views/pc/default/header-modules/headerA.vue +142 -142
- package/src/views/pc/default/header-modules/headerFLPT.vue +157 -157
- package/src/views/pc/default/header-modules/headerMh.vue +187 -187
- package/src/views/pc/default/header-modules/headerNew.vue +121 -121
- package/src/views/pc/default/header-modules/headerSDX.vue +304 -304
- package/src/views/pc/default/header-modules/headerStyle2.vue +173 -173
- package/src/views/pc/default/header-modules/headerStyle3.vue +190 -190
- package/src/views/pc/default/header-modules/headerStyle4.vue +163 -163
- package/src/views/pc/default/header-modules/headerStyleAns.vue +400 -400
- package/src/views/pc/default/header-modules/headerStyleBulk.vue +427 -427
- package/src/views/pc/default/header-modules/headerStyleDefalut.vue +209 -209
- package/src/views/pc/default/header-modules/headerStyleKYW.vue +435 -435
- package/src/views/pc/default/header-modules/headerStyle_yzj.vue +427 -427
- package/src/views/pc/default/header-modules/headerayd.vue +187 -187
- package/src/views/pc/default/header-modules/index.vue +466 -466
- package/src/views/pc/default/header-modules/ymHeader.vue +292 -292
- package/src/views/pc/default/header-modules/ysHeader.vue +248 -248
- package/src/views/pc/default/header-modules/zgl.vue +855 -855
- package/src/views/pc/default/leftMenu-modules/leftMenu-logo.vue +194 -194
- package/src/views/pc/default/leftMenu-modules/leftMenu-style2.vue +206 -206
- package/src/views/pc/default/leftMenu-modules/leftMenu-style3.vue +207 -207
- package/src/views/pc/default/leftMenu-modules/leftMenu-style4.vue +192 -192
- package/src/views/pc/default/leftMenu-modules/leftMenu.vue +183 -183
- package/src/views/pc/default/leftMenu-modules/leftMenuDefault.vue +212 -212
- package/src/views/pc/default/leftMenu-modules/leftMenuDefaultEn.vue +214 -214
- package/src/views/pc/default/leftMenu-modules/leftMenuDefaultFLPT.vue +220 -220
- package/src/views/pc/default/leftMenu-modules/leftMenuDefaultayd.vue +220 -220
- package/src/views/pc/default/nav-modules/nav.vue +52 -52
- package/src/views/pc/default/nav-modules/navAns.vue +60 -60
- package/src/views/pc/default/nav-modules/navBulk.vue +60 -60
- package/src/views/pc/default/top-modules/DgTopShortcut/index.vue +177 -177
- package/src/views/pc/default/top-modules/Toplg.vue +280 -280
- package/src/views/pc/default/top-modules/topA.vue +136 -136
- package/src/views/pc/default/top-modules/topAns.vue +261 -261
- package/src/views/pc/default/top-modules/topAns_yzj.vue +282 -282
- package/src/views/pc/default/top-modules/topBar.vue +304 -304
- package/src/views/pc/default/top-modules/topBulk.vue +280 -280
- package/src/views/pc/default/top-modules/topDefault.vue +244 -244
- package/src/views/pc/default/top-modules/topDefaultDM.vue +197 -197
- package/src/views/pc/default/top-modules/topDefaultNew.vue +271 -271
- package/src/views/pc/default/top-modules/topFLPT.vue +197 -197
- package/src/views/pc/default/top-modules/topHDB.vue +479 -479
- package/src/views/pc/default/top-modules/topKYW.vue +258 -258
- package/src/views/pc/default/top-modules/topMh.vue +174 -174
- package/src/views/pc/default/top-modules/topNew.vue +97 -97
- package/src/views/pc/default/top-modules/topSDX.vue +298 -298
- package/src/views/pc/default/top-modules/topSimple.vue +247 -247
- package/src/views/pc/default/top-modules/topSimpleHy.vue +256 -256
- package/src/views/pc/default/top-modules/topUcc.vue +264 -264
- package/src/views/pc/default/top-modules/topayd.vue +170 -170
- package/src/views/pc/default/top-modules/ymTop.vue +299 -299
- package/src/views/pc/default/top-modules/zgltop.vue +499 -499
- package/src/views/routerView.vue +9 -9
- package/src/views/templates/components/temp-select.vue +80 -80
- package/src/views/templates/components/temp-upload.vue +233 -233
- package/src/views/templates/readme.md +2 -2
- package/src/views/templates/templateInput.vue +421 -421
- package/src/views/templates/templateReadme.html +588 -588
- package/src/views/templates/templateReadme.md +619 -619
- package/src/views/templates/templateTable.vue +2243 -2243
- package/src/views/templates/templateTableData.vue +1883 -1883
- package/src/views/templates/templateUi/templateTableContent.vue +187 -187
- package/src/views/treeTemplate/index.vue +559 -559
- package/src/views/treeTemplate/treeTemplate.md +274 -274
- package/src/views/uploadDialog/index copy.vue +352 -352
- package/src/views/uploadDialog/index.vue +558 -558
- package/src/views/uploadDialog/indexOlay.vue +582 -582
- package/src/views/uploadDialog/indexPM.vue +578 -578
- package/src/views/uploadDialog/indexUpload.vue +543 -543
- package/src/views/uploadDialog/readme.md +45 -45
package/src/views/routerView.vue
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<keep-alive>
|
|
4
|
-
<router-view></router-view>
|
|
5
|
-
</keep-alive>
|
|
6
|
-
</div>
|
|
7
|
-
</template>
|
|
8
|
-
<style lang="scss">
|
|
9
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<keep-alive>
|
|
4
|
+
<router-view></router-view>
|
|
5
|
+
</keep-alive>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
<style lang="scss">
|
|
9
|
+
</style>
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-select
|
|
3
|
-
v-model.trim="item.value"
|
|
4
|
-
filterable
|
|
5
|
-
remote
|
|
6
|
-
:placeholder="'placeholder' in item ? item.placeholder : ''"
|
|
7
|
-
@change="selChange($event,item)"
|
|
8
|
-
@visible-change="valid($event,item)"
|
|
9
|
-
:remote-method="remoteMethod"
|
|
10
|
-
:loading="loading">
|
|
11
|
-
<el-option v-for="(itemOption , indexOption) in optionList" :key="indexOption" :label="'props' in item ? itemOption[item.props.label] : itemOption.label" :value="'props' in item ? itemOption[item.props.value]:itemOption.value"></el-option>
|
|
12
|
-
</el-select>
|
|
13
|
-
</template>
|
|
14
|
-
<script>
|
|
15
|
-
import request from "#/utils/request";
|
|
16
|
-
const querystring = require("querystring");
|
|
17
|
-
export default {
|
|
18
|
-
props: ["item"],
|
|
19
|
-
data() {
|
|
20
|
-
return {
|
|
21
|
-
optionList: [],
|
|
22
|
-
loading: false
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
mounted() {},
|
|
26
|
-
methods: {
|
|
27
|
-
remoteMethod(query) {
|
|
28
|
-
if (query !== "") {
|
|
29
|
-
this.loading = true;
|
|
30
|
-
this.throttle(this.getOptionList(query), 500);
|
|
31
|
-
} else {
|
|
32
|
-
this.optionList = [];
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
getOptionList(val) {
|
|
36
|
-
let formData = {};
|
|
37
|
-
formData[this.item.searchParam] = val;
|
|
38
|
-
return request({
|
|
39
|
-
url: this.item.url,
|
|
40
|
-
method: "get",
|
|
41
|
-
params: formData
|
|
42
|
-
}).then(res => {
|
|
43
|
-
this.optionList = res.rows;
|
|
44
|
-
this.item.options = res.rows
|
|
45
|
-
this.loading = false;
|
|
46
|
-
});
|
|
47
|
-
},
|
|
48
|
-
throttle(fn, delay) {
|
|
49
|
-
var timer = null;
|
|
50
|
-
var startTime = Date.now();
|
|
51
|
-
|
|
52
|
-
return function() {
|
|
53
|
-
let curTime = Date.now();
|
|
54
|
-
let remaining = delay - (curTime - startTime);
|
|
55
|
-
let context = this;
|
|
56
|
-
let args = arguments;
|
|
57
|
-
|
|
58
|
-
clearTimeout(timer);
|
|
59
|
-
if (remaining <= 0) {
|
|
60
|
-
fn.apply(context, args);
|
|
61
|
-
startTime = Date.now();
|
|
62
|
-
} else {
|
|
63
|
-
timer = setTimeout(fn, remaining);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
selChange(val, item) {
|
|
68
|
-
//select选中的事件
|
|
69
|
-
console.log(item, "目前选中的值");
|
|
70
|
-
console.log(this.temInput);
|
|
71
|
-
this.$emit("selChange", val, item);
|
|
72
|
-
},
|
|
73
|
-
valid(val, item) {
|
|
74
|
-
if(!val) {
|
|
75
|
-
this.$parent.$parent.validateField(item.name)
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<el-select
|
|
3
|
+
v-model.trim="item.value"
|
|
4
|
+
filterable
|
|
5
|
+
remote
|
|
6
|
+
:placeholder="'placeholder' in item ? item.placeholder : ''"
|
|
7
|
+
@change="selChange($event,item)"
|
|
8
|
+
@visible-change="valid($event,item)"
|
|
9
|
+
:remote-method="remoteMethod"
|
|
10
|
+
:loading="loading">
|
|
11
|
+
<el-option v-for="(itemOption , indexOption) in optionList" :key="indexOption" :label="'props' in item ? itemOption[item.props.label] : itemOption.label" :value="'props' in item ? itemOption[item.props.value]:itemOption.value"></el-option>
|
|
12
|
+
</el-select>
|
|
13
|
+
</template>
|
|
14
|
+
<script>
|
|
15
|
+
import request from "#/utils/request";
|
|
16
|
+
const querystring = require("querystring");
|
|
17
|
+
export default {
|
|
18
|
+
props: ["item"],
|
|
19
|
+
data() {
|
|
20
|
+
return {
|
|
21
|
+
optionList: [],
|
|
22
|
+
loading: false
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
mounted() {},
|
|
26
|
+
methods: {
|
|
27
|
+
remoteMethod(query) {
|
|
28
|
+
if (query !== "") {
|
|
29
|
+
this.loading = true;
|
|
30
|
+
this.throttle(this.getOptionList(query), 500);
|
|
31
|
+
} else {
|
|
32
|
+
this.optionList = [];
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
getOptionList(val) {
|
|
36
|
+
let formData = {};
|
|
37
|
+
formData[this.item.searchParam] = val;
|
|
38
|
+
return request({
|
|
39
|
+
url: this.item.url,
|
|
40
|
+
method: "get",
|
|
41
|
+
params: formData
|
|
42
|
+
}).then(res => {
|
|
43
|
+
this.optionList = res.rows;
|
|
44
|
+
this.item.options = res.rows
|
|
45
|
+
this.loading = false;
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
throttle(fn, delay) {
|
|
49
|
+
var timer = null;
|
|
50
|
+
var startTime = Date.now();
|
|
51
|
+
|
|
52
|
+
return function() {
|
|
53
|
+
let curTime = Date.now();
|
|
54
|
+
let remaining = delay - (curTime - startTime);
|
|
55
|
+
let context = this;
|
|
56
|
+
let args = arguments;
|
|
57
|
+
|
|
58
|
+
clearTimeout(timer);
|
|
59
|
+
if (remaining <= 0) {
|
|
60
|
+
fn.apply(context, args);
|
|
61
|
+
startTime = Date.now();
|
|
62
|
+
} else {
|
|
63
|
+
timer = setTimeout(fn, remaining);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
selChange(val, item) {
|
|
68
|
+
//select选中的事件
|
|
69
|
+
console.log(item, "目前选中的值");
|
|
70
|
+
console.log(this.temInput);
|
|
71
|
+
this.$emit("selChange", val, item);
|
|
72
|
+
},
|
|
73
|
+
valid(val, item) {
|
|
74
|
+
if(!val) {
|
|
75
|
+
this.$parent.$parent.validateField(item.name)
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
</script>
|
|
@@ -1,234 +1,234 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<!--imgs-->
|
|
4
|
-
<el-upload
|
|
5
|
-
v-if="item.type === 'upload' && (!item.fileType || item.fileType === 'image') && item.showFileList"
|
|
6
|
-
action="'xxxxxxx'"
|
|
7
|
-
:showFileList="showFileList = item.showFileList"
|
|
8
|
-
:name="uploadName = item.name"
|
|
9
|
-
:index="imgIndex=index"
|
|
10
|
-
:uploadUrl="uploadUrl='url' in item ? item.url : uploadUrl"
|
|
11
|
-
:http-request="picUpload"
|
|
12
|
-
list-type="picture-card"
|
|
13
|
-
:limit="limit ='limit' in item ? item.limit : 1"
|
|
14
|
-
:on-exceed="exceed"
|
|
15
|
-
:before-upload="beforeAvatarUpload"
|
|
16
|
-
:on-remove="handleRemove"
|
|
17
|
-
class="el-upload-add"
|
|
18
|
-
>
|
|
19
|
-
<i class="el-icon-plus" v-loading="imgLoading"></i>
|
|
20
|
-
</el-upload>
|
|
21
|
-
<!--img-->
|
|
22
|
-
<el-upload
|
|
23
|
-
v-loading="imgLoading"
|
|
24
|
-
v-if="item.type === 'upload' && (!item.fileType || item.fileType === 'image') && !item.showFileList"
|
|
25
|
-
action="'xxxxxxx'"
|
|
26
|
-
:showFileList="showFileList = item.showFileList || false"
|
|
27
|
-
:name="uploadName = item.name"
|
|
28
|
-
:uploadUrl="uploadUrl='url' in item ? item.url : uploadUrl"
|
|
29
|
-
:http-request="picUpload"
|
|
30
|
-
:index="imgIndex =index"
|
|
31
|
-
:before-upload="beforeAvatarUpload"
|
|
32
|
-
>
|
|
33
|
-
<img v-if="item.value" :src="imageUrl=item.value" class="avatar">
|
|
34
|
-
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
35
|
-
</el-upload>
|
|
36
|
-
|
|
37
|
-
<el-upload
|
|
38
|
-
v-loading="imgLoading"
|
|
39
|
-
v-if="item.type === 'upload' && item.fileType === 'video'"
|
|
40
|
-
action="'xxxxxxx'"
|
|
41
|
-
:showFileList="showFileList = item.showFileList"
|
|
42
|
-
:file-list="fileList"
|
|
43
|
-
:name="uploadName = item.name"
|
|
44
|
-
:uploadUrl="uploadUrl='url' in item ? item.url : uploadUrl"
|
|
45
|
-
:http-request="picUpload"
|
|
46
|
-
:index="imgIndex =index"
|
|
47
|
-
:before-upload="beforeUpload"
|
|
48
|
-
>
|
|
49
|
-
<el-button size="small" type="primary">点击上传</el-button>
|
|
50
|
-
</el-upload>
|
|
51
|
-
</div>
|
|
52
|
-
</template>
|
|
53
|
-
<script>
|
|
54
|
-
import request from "#/utils/request";
|
|
55
|
-
export default {
|
|
56
|
-
props: ["item", "index"],
|
|
57
|
-
data() {
|
|
58
|
-
return {
|
|
59
|
-
fileList: [],
|
|
60
|
-
restaurants: null,
|
|
61
|
-
showFileList: null, //单个图片还是多个图片状态
|
|
62
|
-
imgLoading: false, //图片loading状态
|
|
63
|
-
uploadName: null, //上传图片name
|
|
64
|
-
imgIndex: null, //多个上传图片的位置
|
|
65
|
-
uploadUrl: "/web/rs/goodsFile/uploadGoodsFile.json", //图片上传的默认url
|
|
66
|
-
imageUrl: "" //单个图片的imgurl,
|
|
67
|
-
};
|
|
68
|
-
},
|
|
69
|
-
mounted() {},
|
|
70
|
-
methods: {
|
|
71
|
-
exceed() {
|
|
72
|
-
//图片个数超出的验证
|
|
73
|
-
this.$message.error(`最多上传${this.limit}张!`);
|
|
74
|
-
},
|
|
75
|
-
handleAvatarSuccess(res, file) {
|
|
76
|
-
this.imageUrl = URL.createObjectURL(file.raw);
|
|
77
|
-
console.log(this.imageUrl);
|
|
78
|
-
},
|
|
79
|
-
picUpload(_file) {
|
|
80
|
-
this.imgLoading = true;
|
|
81
|
-
var formData = new FormData();
|
|
82
|
-
|
|
83
|
-
formData.append("file", _file.file);
|
|
84
|
-
console.log(formData, "formData");
|
|
85
|
-
return request({
|
|
86
|
-
url: this.uploadUrl,
|
|
87
|
-
method: "post",
|
|
88
|
-
data: formData
|
|
89
|
-
})
|
|
90
|
-
.then(res => {
|
|
91
|
-
if(res.errorCode=="error"){
|
|
92
|
-
console.log(res.errorCode,"res.errorCode1");
|
|
93
|
-
this.$message.error(res.msg)
|
|
94
|
-
}
|
|
95
|
-
console.log(this.showFileList, this.uploadName, this.imgIndex);
|
|
96
|
-
if (this.showFileList && this.uploadName) {
|
|
97
|
-
//表示多个图片
|
|
98
|
-
//组件中添加showFileList就是判断是否是单个图片
|
|
99
|
-
this.item.value.push({
|
|
100
|
-
url: res.fileUrl,
|
|
101
|
-
uid: file.file.uid
|
|
102
|
-
});
|
|
103
|
-
} else if (this.item.fileType === "video") {
|
|
104
|
-
this.fileList.push({
|
|
105
|
-
name: item.value,
|
|
106
|
-
url: item.value
|
|
107
|
-
});
|
|
108
|
-
this.item.value = res.fileUrl;
|
|
109
|
-
this.$set(this.item, "value", res.fileUrl);
|
|
110
|
-
this.$parent.$parent.validateField(item.name);
|
|
111
|
-
} else {
|
|
112
|
-
this.item.value = res.fileUrl;
|
|
113
|
-
this.$set(this.item, "value", res.fileUrl);
|
|
114
|
-
this.$parent.$parent.validateField(item.name);
|
|
115
|
-
}
|
|
116
|
-
this.imgLoading = false;
|
|
117
|
-
})
|
|
118
|
-
.catch(() => {
|
|
119
|
-
this.imgLoading = false;
|
|
120
|
-
//未对失败做优化
|
|
121
|
-
console.log("上传失败");
|
|
122
|
-
});
|
|
123
|
-
},
|
|
124
|
-
handleRemove(file, fileList) {},
|
|
125
|
-
beforeAvatarUpload(file) {
|
|
126
|
-
//上传之前的回调
|
|
127
|
-
this.item.value = "";
|
|
128
|
-
const fileType = /\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(
|
|
129
|
-
file.name.toLowerCase()
|
|
130
|
-
);
|
|
131
|
-
if (!fileType) {
|
|
132
|
-
this.$message.error("图片格式为常见的jpg、png、gif格式!");
|
|
133
|
-
}
|
|
134
|
-
const isLt2M = file.size / 1024 / 1024 < 5;
|
|
135
|
-
if (!isLt2M) {
|
|
136
|
-
this.$message.error("上传的图片大小不能超过 5MB!");
|
|
137
|
-
}
|
|
138
|
-
return isLt2M && fileType;
|
|
139
|
-
},
|
|
140
|
-
beforeUpload(file) {
|
|
141
|
-
//上传之前的回调
|
|
142
|
-
const fileType = /\.(mp4|ogg|flv|mkv|MP4|FLV|MKV|OGG)$/.test(
|
|
143
|
-
file.name.toLowerCase()
|
|
144
|
-
);
|
|
145
|
-
if (!fileType) {
|
|
146
|
-
this.$message.error("文件格式为常见的mp4,ogg,flv,mkv格式!");
|
|
147
|
-
}
|
|
148
|
-
const isLt2M = file.size / 1024 / 1024 < 100;
|
|
149
|
-
if (!isLt2M) {
|
|
150
|
-
this.$message.error("上传的文件大小不能超过100MB!");
|
|
151
|
-
}
|
|
152
|
-
if (isLt2M && fileType) {
|
|
153
|
-
this.uploading.push(file.uid);
|
|
154
|
-
}
|
|
155
|
-
return isLt2M && fileType;
|
|
156
|
-
},
|
|
157
|
-
handleAvatarSuccess(res, file) {
|
|
158
|
-
this.imageUrl = URL.createObjectURL(file.raw);
|
|
159
|
-
console.log(this.imageUrl);
|
|
160
|
-
},
|
|
161
|
-
handelError(error, file, fileList) {
|
|
162
|
-
console.log(response);
|
|
163
|
-
console.log(file);
|
|
164
|
-
console.log(fileList);
|
|
165
|
-
},
|
|
166
|
-
handleRemove(file, fileList) {
|
|
167
|
-
this.item.value = "";
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
watch: {
|
|
171
|
-
item: {
|
|
172
|
-
handler() {
|
|
173
|
-
if (this.item.fileType === "video" && this.item.value) {
|
|
174
|
-
this.fileList = [];
|
|
175
|
-
this.fileList.push({
|
|
176
|
-
name: item.value,
|
|
177
|
-
url: item.value
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
deep: true //深度监听
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
</script>
|
|
186
|
-
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
187
|
-
.el-icon-plus.avatar-uploader-icon {
|
|
188
|
-
line-height: 100px;
|
|
189
|
-
}
|
|
190
|
-
</style>
|
|
191
|
-
<style>
|
|
192
|
-
.template-input .el-upload-list--picture-card .el-upload-list__item,
|
|
193
|
-
.template-input .el-upload--picture-card {
|
|
194
|
-
width: 100px;
|
|
195
|
-
height: 100px;
|
|
196
|
-
}
|
|
197
|
-
.template-input .el-upload--picture-card {
|
|
198
|
-
line-height: 104px;
|
|
199
|
-
}
|
|
200
|
-
.template-input .el-select {
|
|
201
|
-
width: 220px;
|
|
202
|
-
}
|
|
203
|
-
.template-input .el-form-item__content .el-loading-mask {
|
|
204
|
-
width: 102px;
|
|
205
|
-
height: 102px;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.template-input .el-upload-add .el-loading-mask {
|
|
209
|
-
top: -36px;
|
|
210
|
-
right: 72px;
|
|
211
|
-
left: initial;
|
|
212
|
-
}
|
|
213
|
-
.avatar-uploader-icon {
|
|
214
|
-
font-size: 28px;
|
|
215
|
-
color: #8c939d;
|
|
216
|
-
width: 100px;
|
|
217
|
-
height: 100px;
|
|
218
|
-
line-height: 100px;
|
|
219
|
-
text-align: center;
|
|
220
|
-
border: 1px dashed #c0ccda;
|
|
221
|
-
border-radius: 6px;
|
|
222
|
-
background-color: #fbfdff;
|
|
223
|
-
}
|
|
224
|
-
.avatar {
|
|
225
|
-
width: 100px;
|
|
226
|
-
height: 100px;
|
|
227
|
-
display: block;
|
|
228
|
-
}
|
|
229
|
-
.el-upload,
|
|
230
|
-
.el-upload img {
|
|
231
|
-
/* border: 1px dashed #c0ccda; */
|
|
232
|
-
border-radius: 6px;
|
|
233
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<!--imgs-->
|
|
4
|
+
<el-upload
|
|
5
|
+
v-if="item.type === 'upload' && (!item.fileType || item.fileType === 'image') && item.showFileList"
|
|
6
|
+
action="'xxxxxxx'"
|
|
7
|
+
:showFileList="showFileList = item.showFileList"
|
|
8
|
+
:name="uploadName = item.name"
|
|
9
|
+
:index="imgIndex=index"
|
|
10
|
+
:uploadUrl="uploadUrl='url' in item ? item.url : uploadUrl"
|
|
11
|
+
:http-request="picUpload"
|
|
12
|
+
list-type="picture-card"
|
|
13
|
+
:limit="limit ='limit' in item ? item.limit : 1"
|
|
14
|
+
:on-exceed="exceed"
|
|
15
|
+
:before-upload="beforeAvatarUpload"
|
|
16
|
+
:on-remove="handleRemove"
|
|
17
|
+
class="el-upload-add"
|
|
18
|
+
>
|
|
19
|
+
<i class="el-icon-plus" v-loading="imgLoading"></i>
|
|
20
|
+
</el-upload>
|
|
21
|
+
<!--img-->
|
|
22
|
+
<el-upload
|
|
23
|
+
v-loading="imgLoading"
|
|
24
|
+
v-if="item.type === 'upload' && (!item.fileType || item.fileType === 'image') && !item.showFileList"
|
|
25
|
+
action="'xxxxxxx'"
|
|
26
|
+
:showFileList="showFileList = item.showFileList || false"
|
|
27
|
+
:name="uploadName = item.name"
|
|
28
|
+
:uploadUrl="uploadUrl='url' in item ? item.url : uploadUrl"
|
|
29
|
+
:http-request="picUpload"
|
|
30
|
+
:index="imgIndex =index"
|
|
31
|
+
:before-upload="beforeAvatarUpload"
|
|
32
|
+
>
|
|
33
|
+
<img v-if="item.value" :src="imageUrl=item.value" class="avatar">
|
|
34
|
+
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
35
|
+
</el-upload>
|
|
36
|
+
|
|
37
|
+
<el-upload
|
|
38
|
+
v-loading="imgLoading"
|
|
39
|
+
v-if="item.type === 'upload' && item.fileType === 'video'"
|
|
40
|
+
action="'xxxxxxx'"
|
|
41
|
+
:showFileList="showFileList = item.showFileList"
|
|
42
|
+
:file-list="fileList"
|
|
43
|
+
:name="uploadName = item.name"
|
|
44
|
+
:uploadUrl="uploadUrl='url' in item ? item.url : uploadUrl"
|
|
45
|
+
:http-request="picUpload"
|
|
46
|
+
:index="imgIndex =index"
|
|
47
|
+
:before-upload="beforeUpload"
|
|
48
|
+
>
|
|
49
|
+
<el-button size="small" type="primary">点击上传</el-button>
|
|
50
|
+
</el-upload>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
<script>
|
|
54
|
+
import request from "#/utils/request";
|
|
55
|
+
export default {
|
|
56
|
+
props: ["item", "index"],
|
|
57
|
+
data() {
|
|
58
|
+
return {
|
|
59
|
+
fileList: [],
|
|
60
|
+
restaurants: null,
|
|
61
|
+
showFileList: null, //单个图片还是多个图片状态
|
|
62
|
+
imgLoading: false, //图片loading状态
|
|
63
|
+
uploadName: null, //上传图片name
|
|
64
|
+
imgIndex: null, //多个上传图片的位置
|
|
65
|
+
uploadUrl: "/web/rs/goodsFile/uploadGoodsFile.json", //图片上传的默认url
|
|
66
|
+
imageUrl: "" //单个图片的imgurl,
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
mounted() {},
|
|
70
|
+
methods: {
|
|
71
|
+
exceed() {
|
|
72
|
+
//图片个数超出的验证
|
|
73
|
+
this.$message.error(`最多上传${this.limit}张!`);
|
|
74
|
+
},
|
|
75
|
+
handleAvatarSuccess(res, file) {
|
|
76
|
+
this.imageUrl = URL.createObjectURL(file.raw);
|
|
77
|
+
console.log(this.imageUrl);
|
|
78
|
+
},
|
|
79
|
+
picUpload(_file) {
|
|
80
|
+
this.imgLoading = true;
|
|
81
|
+
var formData = new FormData();
|
|
82
|
+
|
|
83
|
+
formData.append("file", _file.file);
|
|
84
|
+
console.log(formData, "formData");
|
|
85
|
+
return request({
|
|
86
|
+
url: this.uploadUrl,
|
|
87
|
+
method: "post",
|
|
88
|
+
data: formData
|
|
89
|
+
})
|
|
90
|
+
.then(res => {
|
|
91
|
+
if(res.errorCode=="error"){
|
|
92
|
+
console.log(res.errorCode,"res.errorCode1");
|
|
93
|
+
this.$message.error(res.msg)
|
|
94
|
+
}
|
|
95
|
+
console.log(this.showFileList, this.uploadName, this.imgIndex);
|
|
96
|
+
if (this.showFileList && this.uploadName) {
|
|
97
|
+
//表示多个图片
|
|
98
|
+
//组件中添加showFileList就是判断是否是单个图片
|
|
99
|
+
this.item.value.push({
|
|
100
|
+
url: res.fileUrl,
|
|
101
|
+
uid: file.file.uid
|
|
102
|
+
});
|
|
103
|
+
} else if (this.item.fileType === "video") {
|
|
104
|
+
this.fileList.push({
|
|
105
|
+
name: item.value,
|
|
106
|
+
url: item.value
|
|
107
|
+
});
|
|
108
|
+
this.item.value = res.fileUrl;
|
|
109
|
+
this.$set(this.item, "value", res.fileUrl);
|
|
110
|
+
this.$parent.$parent.validateField(item.name);
|
|
111
|
+
} else {
|
|
112
|
+
this.item.value = res.fileUrl;
|
|
113
|
+
this.$set(this.item, "value", res.fileUrl);
|
|
114
|
+
this.$parent.$parent.validateField(item.name);
|
|
115
|
+
}
|
|
116
|
+
this.imgLoading = false;
|
|
117
|
+
})
|
|
118
|
+
.catch(() => {
|
|
119
|
+
this.imgLoading = false;
|
|
120
|
+
//未对失败做优化
|
|
121
|
+
console.log("上传失败");
|
|
122
|
+
});
|
|
123
|
+
},
|
|
124
|
+
handleRemove(file, fileList) {},
|
|
125
|
+
beforeAvatarUpload(file) {
|
|
126
|
+
//上传之前的回调
|
|
127
|
+
this.item.value = "";
|
|
128
|
+
const fileType = /\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(
|
|
129
|
+
file.name.toLowerCase()
|
|
130
|
+
);
|
|
131
|
+
if (!fileType) {
|
|
132
|
+
this.$message.error("图片格式为常见的jpg、png、gif格式!");
|
|
133
|
+
}
|
|
134
|
+
const isLt2M = file.size / 1024 / 1024 < 5;
|
|
135
|
+
if (!isLt2M) {
|
|
136
|
+
this.$message.error("上传的图片大小不能超过 5MB!");
|
|
137
|
+
}
|
|
138
|
+
return isLt2M && fileType;
|
|
139
|
+
},
|
|
140
|
+
beforeUpload(file) {
|
|
141
|
+
//上传之前的回调
|
|
142
|
+
const fileType = /\.(mp4|ogg|flv|mkv|MP4|FLV|MKV|OGG)$/.test(
|
|
143
|
+
file.name.toLowerCase()
|
|
144
|
+
);
|
|
145
|
+
if (!fileType) {
|
|
146
|
+
this.$message.error("文件格式为常见的mp4,ogg,flv,mkv格式!");
|
|
147
|
+
}
|
|
148
|
+
const isLt2M = file.size / 1024 / 1024 < 100;
|
|
149
|
+
if (!isLt2M) {
|
|
150
|
+
this.$message.error("上传的文件大小不能超过100MB!");
|
|
151
|
+
}
|
|
152
|
+
if (isLt2M && fileType) {
|
|
153
|
+
this.uploading.push(file.uid);
|
|
154
|
+
}
|
|
155
|
+
return isLt2M && fileType;
|
|
156
|
+
},
|
|
157
|
+
handleAvatarSuccess(res, file) {
|
|
158
|
+
this.imageUrl = URL.createObjectURL(file.raw);
|
|
159
|
+
console.log(this.imageUrl);
|
|
160
|
+
},
|
|
161
|
+
handelError(error, file, fileList) {
|
|
162
|
+
console.log(response);
|
|
163
|
+
console.log(file);
|
|
164
|
+
console.log(fileList);
|
|
165
|
+
},
|
|
166
|
+
handleRemove(file, fileList) {
|
|
167
|
+
this.item.value = "";
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
watch: {
|
|
171
|
+
item: {
|
|
172
|
+
handler() {
|
|
173
|
+
if (this.item.fileType === "video" && this.item.value) {
|
|
174
|
+
this.fileList = [];
|
|
175
|
+
this.fileList.push({
|
|
176
|
+
name: item.value,
|
|
177
|
+
url: item.value
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
deep: true //深度监听
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
</script>
|
|
186
|
+
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
187
|
+
.el-icon-plus.avatar-uploader-icon {
|
|
188
|
+
line-height: 100px;
|
|
189
|
+
}
|
|
190
|
+
</style>
|
|
191
|
+
<style>
|
|
192
|
+
.template-input .el-upload-list--picture-card .el-upload-list__item,
|
|
193
|
+
.template-input .el-upload--picture-card {
|
|
194
|
+
width: 100px;
|
|
195
|
+
height: 100px;
|
|
196
|
+
}
|
|
197
|
+
.template-input .el-upload--picture-card {
|
|
198
|
+
line-height: 104px;
|
|
199
|
+
}
|
|
200
|
+
.template-input .el-select {
|
|
201
|
+
width: 220px;
|
|
202
|
+
}
|
|
203
|
+
.template-input .el-form-item__content .el-loading-mask {
|
|
204
|
+
width: 102px;
|
|
205
|
+
height: 102px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.template-input .el-upload-add .el-loading-mask {
|
|
209
|
+
top: -36px;
|
|
210
|
+
right: 72px;
|
|
211
|
+
left: initial;
|
|
212
|
+
}
|
|
213
|
+
.avatar-uploader-icon {
|
|
214
|
+
font-size: 28px;
|
|
215
|
+
color: #8c939d;
|
|
216
|
+
width: 100px;
|
|
217
|
+
height: 100px;
|
|
218
|
+
line-height: 100px;
|
|
219
|
+
text-align: center;
|
|
220
|
+
border: 1px dashed #c0ccda;
|
|
221
|
+
border-radius: 6px;
|
|
222
|
+
background-color: #fbfdff;
|
|
223
|
+
}
|
|
224
|
+
.avatar {
|
|
225
|
+
width: 100px;
|
|
226
|
+
height: 100px;
|
|
227
|
+
display: block;
|
|
228
|
+
}
|
|
229
|
+
.el-upload,
|
|
230
|
+
.el-upload img {
|
|
231
|
+
/* border: 1px dashed #c0ccda; */
|
|
232
|
+
border-radius: 6px;
|
|
233
|
+
}
|
|
234
234
|
</style>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
###三、分页的方法
|
|
2
|
-
####
|
|
1
|
+
###三、分页的方法
|
|
2
|
+
####
|