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.
Files changed (229) hide show
  1. package/.babelrc +12 -12
  2. package/.eslintrc.js +25 -25
  3. package/.idea/common.iml +11 -11
  4. package/.idea/modules.xml +7 -7
  5. package/.idea/vcs.xml +5 -5
  6. package/.postcssrc.js +9 -9
  7. package/.prettierrc.js +7 -7
  8. package/.project +37 -37
  9. package/README.md +2 -2
  10. package/gulpfile.js +20 -20
  11. package/package.json +18 -18
  12. package/src/api/apimanage.js +146 -146
  13. package/src/api/common/index.js +192 -192
  14. package/src/api/login.js +160 -160
  15. package/src/api/shopFbu.js +515 -515
  16. package/src/api/upload.js +8 -8
  17. package/src/components/Bounced/index.vue +145 -145
  18. package/src/components/Breadcrumb/index.vue +71 -71
  19. package/src/components/Checkbox/index.vue +53 -53
  20. package/src/components/Hamburger/index.vue +48 -48
  21. package/src/components/Logistics/logic.vue +186 -186
  22. package/src/components/ScrollBar/index.vue +60 -60
  23. package/src/components/Sticky/index.vue +76 -76
  24. package/src/components/SvgIcon/index.vue +42 -42
  25. package/src/components/ThemePicker/index.vue +243 -243
  26. package/src/components/Tinymce/components/editorImage.vue +94 -94
  27. package/src/components/Tinymce/index.vue +166 -166
  28. package/src/components/Tinymce/plugins.js +7 -7
  29. package/src/components/Tinymce/toolbar.js +6 -6
  30. package/src/components/TreeTable/customEval.js +44 -44
  31. package/src/components/TreeTable/eval.js +29 -29
  32. package/src/components/TreeTable/index.vue +124 -124
  33. package/src/components/TreeTable/readme.md +89 -89
  34. package/src/components/TreeTableApi/customEval.js +49 -49
  35. package/src/components/TreeTableApi/eval.js +29 -29
  36. package/src/components/TreeTableApi/index.vue +124 -124
  37. package/src/components/TreeTableApi/readme.md +89 -89
  38. package/src/components/Upload/singleImage.vue +123 -123
  39. package/src/components/Upload/singleImage2.vue +118 -118
  40. package/src/components/Upload/singleImage3.vue +138 -138
  41. package/src/components/Upload/upload.vue +295 -295
  42. package/src/components/workOrderList/index.vue +158 -158
  43. package/src/dependencies.js +119 -119
  44. package/src/iconShop/demo.css +539 -539
  45. package/src/iconShop/demo_index.html +8445 -8445
  46. package/src/iconShop/iconfont.css +1451 -1451
  47. package/src/iconShop/iconfont.json +2522 -2522
  48. package/src/iconShop/iconfont.svg +1070 -1070
  49. package/src/iconfont/demo.css +539 -539
  50. package/src/iconfont/demo_index.html +5276 -5276
  51. package/src/iconfont/iconfont.css +905 -905
  52. package/src/iconfont/iconfont.json +1563 -1563
  53. package/src/iconfont/iconfont.svg +692 -692
  54. package/src/icons/index.js +9 -9
  55. package/src/lang/e.js +48 -48
  56. package/src/lang/en.js +48 -48
  57. package/src/lang/zh.js +48 -48
  58. package/src/main.js +62 -62
  59. package/src/permission.js +283 -283
  60. package/src/permissionForMall.backup.js +375 -375
  61. package/src/permissionForMall.js +375 -375
  62. package/src/preset.js +67 -67
  63. package/src/router/_import_common.js +1 -1
  64. package/src/router/_import_development.js +1 -1
  65. package/src/router/_import_production.js +1 -1
  66. package/src/store/getters.js +39 -39
  67. package/src/store/index.js +18 -18
  68. package/src/store/modules/app.js +34 -30
  69. package/src/store/modules/menu.js +82 -82
  70. package/src/store/modules/user.js +227 -227
  71. package/src/styles/element-ui.scss +1368 -1368
  72. package/src/styles/index.scss +166 -166
  73. package/src/styles/mixin.scss +27 -27
  74. package/src/styles/pc-ui.scss +1031 -1031
  75. package/src/styles/scrollBar.scss +21 -21
  76. package/src/styles/sidebar.scss +123 -123
  77. package/src/styles/transition.scss +32 -32
  78. package/src/styles/variables.scss +44 -44
  79. package/src/styles/wf-ui.scss +86 -86
  80. package/src/utils/auth.js +57 -57
  81. package/src/utils/dom.js +12 -12
  82. package/src/utils/getQueryString.js +5 -5
  83. package/src/utils/import.js +5 -5
  84. package/src/utils/index.js +355 -355
  85. package/src/utils/interceptor.js +34 -34
  86. package/src/utils/menu.js +116 -116
  87. package/src/utils/proapp.js +35 -35
  88. package/src/utils/query.js +26 -26
  89. package/src/utils/request.js +366 -366
  90. package/src/utils/routeMapping.js +39 -39
  91. package/src/utils/routeMapping.json +310 -310
  92. package/src/utils/utils.js +84 -84
  93. package/src/utils/validate.js +102 -102
  94. package/src/views/404.vue +72 -72
  95. package/src/views/Layout.vue +106 -106
  96. package/src/views/imgSwiper/index.vue +34 -34
  97. package/src/views/layout/Layout.vue +181 -170
  98. package/src/views/layout/components/AppMain.vue +20 -20
  99. package/src/views/layout/components/Footer.vue +22 -22
  100. package/src/views/layout/components/LeftNavbar.vue +318 -310
  101. package/src/views/layout/components/NavMenu.vue +15 -15
  102. package/src/views/layout/components/Navbar.vue +664 -661
  103. package/src/views/layout/components/Sidebar/SidebarItem.vue +116 -113
  104. package/src/views/layout/components/Sidebar/index.vue +203 -193
  105. package/src/views/layout/components/index.js +19 -19
  106. package/src/views/layout/theme/darkBlue/Layout.vue +140 -140
  107. package/src/views/layout/theme/darkBlue/components/AppMain.vue +38 -38
  108. package/src/views/layout/theme/darkBlue/components/Footer.vue +147 -147
  109. 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
  110. package/src/views/layout/theme/darkBlue/components/LeftNavbar.3.vue +191 -191
  111. package/src/views/layout/theme/darkBlue/components/LeftNavbar.vue +466 -466
  112. package/src/views/layout/theme/darkBlue/components/Navbar.vue +200 -200
  113. package/src/views/layout/theme/darkBlue/components/Sidebar/SidebarItem.vue +71 -71
  114. package/src/views/layout/theme/darkBlue/components/Sidebar/index.vue +49 -49
  115. package/src/views/layout/theme/darkBlue/components/index.js +15 -15
  116. package/src/views/layout-default/Layout.vue +134 -134
  117. package/src/views/layout-default/components/AppMain.vue +19 -19
  118. package/src/views/layout-default/components/Footer.vue +22 -22
  119. package/src/views/layout-default/components/LeftNavbar.vue +164 -164
  120. package/src/views/layout-default/components/Navbar.vue +295 -295
  121. package/src/views/layout-default/components/Sidebar/SidebarItem.vue +67 -67
  122. package/src/views/layout-default/components/Sidebar/index.vue +59 -59
  123. package/src/views/layout-default/components/index.js +4 -4
  124. package/src/views/layout-default/theme/darkBlue/Layout.vue +140 -140
  125. package/src/views/layout-default/theme/darkBlue/components/AppMain.vue +38 -38
  126. package/src/views/layout-default/theme/darkBlue/components/Footer.vue +147 -147
  127. package/src/views/layout-default/theme/darkBlue/components/LeftNavbar.vue +465 -465
  128. package/src/views/layout-default/theme/darkBlue/components/Navbar.vue +200 -200
  129. package/src/views/layout-default/theme/darkBlue/components/Sidebar/SidebarItem.vue +69 -69
  130. package/src/views/layout-default/theme/darkBlue/components/Sidebar/index.vue +49 -49
  131. package/src/views/layout-default/theme/darkBlue/components/index.js +15 -15
  132. package/src/views/pc/Internationalization.vue +80 -80
  133. package/src/views/pc/default/Layout.vue +442 -442
  134. package/src/views/pc/default/LayoutCard.vue +424 -424
  135. package/src/views/pc/default/assets/flex.scss +99 -99
  136. package/src/views/pc/default/footer-modules/DgFooter/index.vue +179 -179
  137. package/src/views/pc/default/footer-modules/DgFooter/indexSDX.vue +187 -187
  138. package/src/views/pc/default/footer-modules/footer.vue +171 -171
  139. package/src/views/pc/default/footer-modules/footerAns.vue +167 -167
  140. package/src/views/pc/default/footer-modules/footerBulk.vue +169 -169
  141. package/src/views/pc/default/footer-modules/footerDM.vue +254 -254
  142. package/src/views/pc/default/footer-modules/footerDefault.vue +267 -267
  143. package/src/views/pc/default/footer-modules/footerDefaultA.vue +270 -270
  144. package/src/views/pc/default/footer-modules/footerDefaultNew.vue +201 -201
  145. package/src/views/pc/default/footer-modules/footerHDB.vue +153 -153
  146. package/src/views/pc/default/footer-modules/footerHy.vue +63 -63
  147. package/src/views/pc/default/footer-modules/footerKYW.vue +163 -163
  148. package/src/views/pc/default/footer-modules/footerMh.vue +30 -30
  149. package/src/views/pc/default/footer-modules/footerNew.vue +116 -116
  150. package/src/views/pc/default/footer-modules/footer_yzj.vue +169 -169
  151. package/src/views/pc/default/footer-modules/footerayd.vue +85 -85
  152. package/src/views/pc/default/footer-modules/ymFooter.vue +154 -154
  153. package/src/views/pc/default/footer-modules/zgl.vue +250 -250
  154. package/src/views/pc/default/header-modules/DgHeader/Logo.vue +57 -57
  155. package/src/views/pc/default/header-modules/DgHeader/Search.vue +135 -135
  156. package/src/views/pc/default/header-modules/DgHeader/Settleup.vue +46 -46
  157. package/src/views/pc/default/header-modules/DgHeader/index.vue +38 -38
  158. package/src/views/pc/default/header-modules/active.vue +177 -177
  159. package/src/views/pc/default/header-modules/header.vue +97 -97
  160. package/src/views/pc/default/header-modules/headerA.vue +142 -142
  161. package/src/views/pc/default/header-modules/headerFLPT.vue +157 -157
  162. package/src/views/pc/default/header-modules/headerMh.vue +187 -187
  163. package/src/views/pc/default/header-modules/headerNew.vue +121 -121
  164. package/src/views/pc/default/header-modules/headerSDX.vue +304 -304
  165. package/src/views/pc/default/header-modules/headerStyle2.vue +173 -173
  166. package/src/views/pc/default/header-modules/headerStyle3.vue +190 -190
  167. package/src/views/pc/default/header-modules/headerStyle4.vue +163 -163
  168. package/src/views/pc/default/header-modules/headerStyleAns.vue +400 -400
  169. package/src/views/pc/default/header-modules/headerStyleBulk.vue +427 -427
  170. package/src/views/pc/default/header-modules/headerStyleDefalut.vue +209 -209
  171. package/src/views/pc/default/header-modules/headerStyleKYW.vue +435 -435
  172. package/src/views/pc/default/header-modules/headerStyle_yzj.vue +427 -427
  173. package/src/views/pc/default/header-modules/headerayd.vue +187 -187
  174. package/src/views/pc/default/header-modules/index.vue +466 -466
  175. package/src/views/pc/default/header-modules/ymHeader.vue +292 -292
  176. package/src/views/pc/default/header-modules/ysHeader.vue +248 -248
  177. package/src/views/pc/default/header-modules/zgl.vue +855 -855
  178. package/src/views/pc/default/leftMenu-modules/leftMenu-logo.vue +194 -194
  179. package/src/views/pc/default/leftMenu-modules/leftMenu-style2.vue +206 -206
  180. package/src/views/pc/default/leftMenu-modules/leftMenu-style3.vue +207 -207
  181. package/src/views/pc/default/leftMenu-modules/leftMenu-style4.vue +192 -192
  182. package/src/views/pc/default/leftMenu-modules/leftMenu.vue +183 -183
  183. package/src/views/pc/default/leftMenu-modules/leftMenuDefault.vue +212 -212
  184. package/src/views/pc/default/leftMenu-modules/leftMenuDefaultEn.vue +214 -214
  185. package/src/views/pc/default/leftMenu-modules/leftMenuDefaultFLPT.vue +220 -220
  186. package/src/views/pc/default/leftMenu-modules/leftMenuDefaultayd.vue +220 -220
  187. package/src/views/pc/default/nav-modules/nav.vue +52 -52
  188. package/src/views/pc/default/nav-modules/navAns.vue +60 -60
  189. package/src/views/pc/default/nav-modules/navBulk.vue +60 -60
  190. package/src/views/pc/default/top-modules/DgTopShortcut/index.vue +177 -177
  191. package/src/views/pc/default/top-modules/Toplg.vue +280 -280
  192. package/src/views/pc/default/top-modules/topA.vue +136 -136
  193. package/src/views/pc/default/top-modules/topAns.vue +261 -261
  194. package/src/views/pc/default/top-modules/topAns_yzj.vue +282 -282
  195. package/src/views/pc/default/top-modules/topBar.vue +304 -304
  196. package/src/views/pc/default/top-modules/topBulk.vue +280 -280
  197. package/src/views/pc/default/top-modules/topDefault.vue +244 -244
  198. package/src/views/pc/default/top-modules/topDefaultDM.vue +197 -197
  199. package/src/views/pc/default/top-modules/topDefaultNew.vue +271 -271
  200. package/src/views/pc/default/top-modules/topFLPT.vue +197 -197
  201. package/src/views/pc/default/top-modules/topHDB.vue +479 -479
  202. package/src/views/pc/default/top-modules/topKYW.vue +258 -258
  203. package/src/views/pc/default/top-modules/topMh.vue +174 -174
  204. package/src/views/pc/default/top-modules/topNew.vue +97 -97
  205. package/src/views/pc/default/top-modules/topSDX.vue +298 -298
  206. package/src/views/pc/default/top-modules/topSimple.vue +247 -247
  207. package/src/views/pc/default/top-modules/topSimpleHy.vue +256 -256
  208. package/src/views/pc/default/top-modules/topUcc.vue +264 -264
  209. package/src/views/pc/default/top-modules/topayd.vue +170 -170
  210. package/src/views/pc/default/top-modules/ymTop.vue +299 -299
  211. package/src/views/pc/default/top-modules/zgltop.vue +499 -499
  212. package/src/views/routerView.vue +9 -9
  213. package/src/views/templates/components/temp-select.vue +80 -80
  214. package/src/views/templates/components/temp-upload.vue +233 -233
  215. package/src/views/templates/readme.md +2 -2
  216. package/src/views/templates/templateInput.vue +421 -421
  217. package/src/views/templates/templateReadme.html +588 -588
  218. package/src/views/templates/templateReadme.md +619 -619
  219. package/src/views/templates/templateTable.vue +2243 -2243
  220. package/src/views/templates/templateTableData.vue +1883 -1883
  221. package/src/views/templates/templateUi/templateTableContent.vue +187 -187
  222. package/src/views/treeTemplate/index.vue +559 -559
  223. package/src/views/treeTemplate/treeTemplate.md +274 -274
  224. package/src/views/uploadDialog/index copy.vue +352 -352
  225. package/src/views/uploadDialog/index.vue +558 -558
  226. package/src/views/uploadDialog/indexOlay.vue +582 -582
  227. package/src/views/uploadDialog/indexPM.vue +578 -578
  228. package/src/views/uploadDialog/indexUpload.vue +543 -543
  229. package/src/views/uploadDialog/readme.md +45 -45
@@ -1,2243 +1,2243 @@
1
- <template>
2
- <div>
3
- <div class="template-table">
4
- <!--header-->
5
- <div class="tem-header" v-if="temInputPack">
6
- <ul class="clearfix">
7
- <li :class="{ li: temInputPack[0].btnArray }" :key="index" v-for="(item, index) in temInputPack">
8
- <label v-if="'label' in item && item.label">{{ item.label }}:</label>
9
- <div v-if="'type' in item">
10
- <div v-if="item.type === 'text'">
11
- <el-input :placeholder="'placeholder' in item ? item.placeholder : ''" clearable :disabled="'disabled' in item && item.disabled ? item.disabled : false" v-model.trim="item.value">
12
- </el-input>
13
- </div>
14
- <div v-if="item.type === 'select'">
15
- <el-select
16
- :filterable="'filterable' in item ? item.filterable : false"
17
- :remote="'filterable' in item ? item.filterable : false"
18
- :multiple="'multiple' in item ? item.multiple : false"
19
- :placeholder="'placeholder' in item ? item.placeholder : ''"
20
- @change="inputSelChange($event, item)"
21
- @visible-change="getSltInfo(item, $event)"
22
- :remote-method="remoteMethod"
23
- @input.native="filterData($event, item)"
24
- clearable
25
- collapse-tags
26
- :loading="loadings"
27
- v-model.trim="item.value"
28
- >
29
- <!-- :multiple="'multiple' in item ? item.multiple : false"
30
- :collapse-tags="'collapseTags' in item ? item.collapseTags : false"-->
31
- <el-option
32
- :key="'props' in item ? item2[item.props.value] : item2.value"
33
- :label="'props' in item ? item2[item.props.label] : item2.label"
34
- :value="'props' in item ? item2[item.props.value] : item2.value"
35
- clearable
36
- v-for="item2 in item.options"
37
- v-if="'options' in item"
38
- ></el-option>
39
- <!-- {{item.options}} -->
40
- <!-- {{ item.pagenation.page }}>> >>={{ item.pageCount }} -->
41
-
42
- <div class="selectJob" v-if="item.pagenation || false">
43
- <span @click.stop="prePage(item)" class="text" style="padding-right: 40px" v-if="item.pagenation.page > 1">上一页</span>
44
- <span @click.stop="nextPage(item)" class="text" v-if="item.pageCount && item.pageCount > 1 && item.pagenation.page < item.pageCount">下一页</span>
45
- </div>
46
- </el-select>
47
- </div>
48
- <div v-if="item.type === 'remoteSelect'">
49
- <temp-select :item="item" @selChange="inputSelChange"></temp-select>
50
- </div>
51
- <div v-if="item.type === 'date'">
52
- <el-date-picker
53
- :picker-options="'pickerOptions' in item ? item.pickerOptions : {}"
54
- :placeholder="'placeholder' in item ? item.placeholder : ''"
55
- size="small"
56
- type="date"
57
- v-model.trim="item.value"
58
- value-format="yyyy-MM-dd"
59
- ></el-date-picker>
60
- </div>
61
- <div @click="getOption('none', item)" v-if="item.type === 'cascader'">
62
- <el-cascader
63
- :collapse-tags="'collapseTags' in item ? item.collapseTags : true"
64
- :disabled="'disabled' in item && item.disabled ? item.disabled : false"
65
- :options="'options' in item ? item.options : []"
66
- :placeholder="'placeholder' in item ? item.placeholder : ''"
67
- :props="'props' in item ? item.props : {}"
68
- :show-all-levels="'showAllLevels' in item ? item.showAllLevels : true"
69
- change-on-select
70
- clearable
71
- filterable
72
- size="small"
73
- v-model.trim="item.value"
74
- ></el-cascader>
75
- </div>
76
- <div v-if="item.type === 'daterange'">
77
- <el-date-picker
78
- :end-placeholder="'endPlaceholder' in item ? item.endPlaceholder || '结束时间' : '结束时间'"
79
- :picker-options="'pickerOptions' in item ? item.pickerOptions : {}"
80
- :range-separator="'rangeSeparator' in item ? item.rangeSeparator || '-' : '-'"
81
- :start-placeholder="'startPlaceholder' in item ? item.startPlaceholder || '开始时间' : '开始时间'"
82
- size="small"
83
- type="daterange"
84
- v-model.trim="item.value"
85
- value-format="yyyy-MM-dd"
86
- ></el-date-picker>
87
- </div>
88
- <div v-if="item.type === 'month'">
89
-               <el-date-picker
90
- :end-placeholder="'endPlaceholder' in item ? item.endPlaceholder || '结束时间' : '结束时间'"
91
- :picker-options="'pickerOptions' in item ? item.pickerOptions : {}"
92
- :range-separator="'rangeSeparator' in item ? item.rangeSeparator || '-' : '-'"
93
- :start-placeholder="'startPlaceholder' in item ? item.startPlaceholder || '开始时间' : '开始时间'"
94
- size="small"
95
- type="month"
96
- v-model.trim="item.value"
97
- value-format="yyyy-MM"
98
- ></el-date-picker>
99
-             
100
- </div>
101
- <div v-if="item.type === 'datetimerange'">
102
- <el-date-picker
103
- :end-placeholder="'endPlaceholder' in item ? item.endPlaceholder || '结束时间' : '结束时间'"
104
- :picker-options="'pickerOptions' in item ? item.pickerOptions : {}"
105
- :range-separator="'rangeSeparator' in item ? item.rangeSeparator || '-' : '-'"
106
- :start-placeholder="'startPlaceholder' in item ? item.startPlaceholder || '开始时间' : '开始时间'"
107
- size="small"
108
- type="datetimerange"
109
- v-model.trim="item.value"
110
- value-format="yyyy-MM-dd HH:mm:ss"
111
- >
112
- </el-date-picker>
113
- </div>
114
- <div v-if="item.type === 'textMore'">
115
- <div :key="indexMore" style="display: inline-block" v-for="(itemMore, indexMore) in item.children">
116
- <el-input :disabled="'disabled' in itemMore && itemMore.disabled ? itemMore.disabled : false" :placeholder="itemMore.placeholder" type="text" v-model="itemMore.value"></el-input>
117
- <span v-if="indexMore % 2 == 0">~</span>
118
- </div>
119
- </div>
120
- <!--input 支持搜索-->
121
- <div v-if="item.type === 'autocomplete'">
122
- <el-autocomplete
123
- :fetch-suggestions="querySearchAsync"
124
- :loadAll="(restaurants = item.restaurants)"
125
- :placeholder="item.placeholder"
126
- :rowkey="(rowkey = temTablePack.rowkey)"
127
- @select="handleSelect"
128
- v-model.trim="item.value"
129
- ></el-autocomplete>
130
- </div>
131
- </div>
132
- <!-- <div v-if="'btnArray' in item">
133
- <el-button v-for="(itemBtn,indexBtn) in item.btnArray " :key="indexBtn" :type="itemBtn.type" v-if="itemBtn.type=='query'|| itemBtn.type=='search' " @keyup.enter="btn(itemBtn,indexBtn)" @click="btn(itemBtn,indexBtn)">{{itemBtn.label}}</el-button>
134
- <el-button v-for="(itemBtn,indexBtn) in item.btnArray " :key="indexBtn" :type="itemBtn.type" v-if="itemBtn.type!='query'&& itemBtn.type!='search' " @click="btn(itemBtn,indexBtn)">{{itemBtn.label}}</el-button>
135
- </div>-->
136
- </li>
137
- </ul>
138
- <template v-for="item in temInputPack" v-if="'btnArray' in item">
139
- <el-button
140
- :key="indexBtn"
141
- :type="itemBtn.type || 'primary'"
142
- @click="btn(itemBtn, indexBtn)"
143
- v-for="(itemBtn, indexBtn) in item.btnArray"
144
- v-if="itemBtn.type == 'query' || itemBtn.type == 'search'"
145
- >
146
- {{ itemBtn.label }}</el-button
147
- >
148
- <el-button
149
- :disabled="'disabled' in itemBtn && itemBtn.disabled ? itemBtn.disabled : false"
150
- :key="indexBtn"
151
- :type="itemBtn.type || ''"
152
- @click="btn(itemBtn, indexBtn)"
153
- v-for="(itemBtn, indexBtn) in item.btnArray"
154
- v-if="itemBtn.type != 'query' && itemBtn.type != 'search'"
155
- >{{ itemBtn.label }}</el-button
156
- >
157
- <div class="page-count flex justify-content--flex-end" v-if="subtotal">
158
- <p :key="index" v-for="(item, index) in subtotal">{{ item.label }}{{ item.beforeUnit }}{{ item.value }}{{ item.afterUnit }}</p>
159
- </div>
160
- </template>
161
- </div>
162
- <!--tab-->
163
- <el-row v-if="temTab && 'tabPane' in temTab">
164
- <el-col :span="24">
165
- <el-tabs @tab-click="handleClickTab" type="border-card" v-model="activeName">
166
- <el-tab-pane :key="index" :label="item.label" v-for="(item, index) in temTab.tabPane"></el-tab-pane>
167
- </el-tabs>
168
- <!--main table-->
169
- <!-- {{activeName}} -->
170
- <div class="template-box" v-for="(item, index) in temTab.tabPane" v-if="activeName == index">
171
- <div class="tem-main" v-if="temTablePack">
172
- <h3 class="temTablePack-title" v-if="'title' in temTablePack ? temTablePack.title : ''">{{ temTablePack.title }}:</h3>
173
- <el-table
174
- :data="tableData"
175
- :empty-text="'emptyText' in temTablePack ? temTablePack.emptyText : '暂无数据'"
176
- :row-key="row_Key"
177
- :rowKey="(rowKey = temTablePack.rowKey ? temTablePack.rowKey : '')"
178
- @select="handleSelectionChange"
179
- @select-all="handleSelectionChange"
180
- @toggleSelection="toggleSelection"
181
- ref="multipleTable"
182
- style="width: 100%"
183
- v-loading="loading"
184
- stripe
185
- :height="'tabHeight' in temTablePack ? temTablePack.tabHeight : false"
186
- >
187
- <el-table-column
188
- :reserve-selection="temTablePack.reserve_selection ? true : false"
189
- type="selection"
190
- v-if="'selection' in temTablePack ? temTablePack.selection.state : false"
191
- width="40"
192
- ></el-table-column>
193
- <el-table-column
194
- :align="'align' in item ? item.align : ''"
195
- :key="index"
196
- :label="'label' in item ? item.label : ''"
197
- :min-width="'minWidth' in item ? item.minWidth : ''"
198
- :prop="'prop' in item ? item.prop : ''"
199
- :width="'width' in item ? item.width : 'auto'"
200
- v-for="(item, index) in temTablePack.tableHead"
201
- :fixed="'fixed' in item ? item.fixed : false"
202
- :show-overflow-tooltip="'overflow' in item ? item.overflow : false"
203
- >
204
- <template slot-scope="scope">
205
- <template-table-content :item="item" :scope="scope" @changeGetData="getDataList"> </template-table-content>
206
- </template>
207
- </el-table-column>
208
- <el-table-column
209
- :width="'tabBtnWidth' in temTablePack ? temTablePack.tabBtnWidth : '180'"
210
- label="操作"
211
- :fixed="'fixed' in temTablePack ? temTablePack.fixed : false"
212
- v-if="'tabBtnState' in temTablePack ? temTablePack.tabBtnState : true"
213
- >
214
- <template slot-scope="scope">
215
- <!--四个以内的按钮是这么显示-->
216
- <span :key="index" class="tem-span-btn" style="display: inline-block" v-for="(item, index) in temTablePack.tableBtn">
217
- <template v-if="'renderTemp' in item">
218
- <child :item="item" :para="scope.row" :temp="item.renderTemp"></child>
219
- </template>
220
- <template v-else>
221
- <span style="display: inline-block" v-if="'dropdown' in item && item.dropdown">
222
- <!--dropdown 为false 表示不需要折叠-->
223
- <!-- v-if="dropdownState(scope.row.dataState,item.dropdowMenu)" -->
224
- <el-dropdown @command="handleClick($event, scope, index)" @click.native="open($event, scope, index)">
225
- <el-button class="el-dropdown-link" size="text">
226
- 处理
227
- <i class="el-icon-arrow-down el-icon--right"></i>
228
- </el-button>
229
- <el-dropdown-menu slot="dropdown">
230
- <el-dropdown-item
231
- :command="dropdowItem"
232
- :key="(dropdowIndexObj[scope.$index] = dropdowIndex)"
233
- v-for="(dropdowItem, dropdowIndex) in item.dropdowMenu"
234
- v-if="('dataState' in dropdowItem && dropdowItem.dataState.split(',').includes(scope.row.dataState.toString())) || ('state' in dropdowItem && dropdowItem.state)"
235
- >
236
- {{ dropdowItem.label }}</el-dropdown-item
237
- >
238
- </el-dropdown-menu>
239
- </el-dropdown>
240
- </span>
241
- <span style="display: inline-block" v-else>
242
- <template v-if="'dataState' in item && item.dataState == null">
243
- <template v-if="'reverse' in item && item.reverse">
244
- <el-button
245
- :class="'type' in item && item.type ? item.type : 'primary'"
246
- @click="handleClick(item, scope, index)"
247
- size="small"
248
- type="text"
249
- v-if="item.props && scope.row[item.props['dataState']] != null"
250
- >{{ item.label }}
251
- </el-button>
252
- </template>
253
- <template v-else>
254
- <el-button
255
- :class="'type' in item && item.type ? item.type : 'primary'"
256
- @click="handleClick(item, scope, index)"
257
- size="small"
258
- type="text"
259
- v-if="item.props && scope.row[item.props['dataState']] == null"
260
- >{{ item.label }}
261
- </el-button>
262
- </template>
263
- </template>
264
- <template v-if="'otherState' in item && item.otherState">
265
- <!-- {{scope.row[item.props['dataState']]}}
266
- {{item[item.props['dataState']]}}-->
267
- <el-button
268
- :class="'type' in item && item.type ? item.type : 'primary'"
269
- @click="handleClick(item, scope, index)"
270
- size="small"
271
- type="text"
272
- v-if="'dataState' in item && 'props' in item && scope.row.dataState == item.dataState && scope.row[item.props['dataState']] == item[item.props['dataState']]"
273
- >
274
- {{ item.label }}</el-button
275
- >
276
- <el-button
277
- :class="'type' in item && item.type ? item.type : 'primary'"
278
- @click="handleClick(item, scope, index)"
279
- size="small"
280
- type="text"
281
- v-else-if="!item.dataState && item.props && scope.row[item.props['dataState']] == item[item.props['dataState']]"
282
- >
283
- {{ item.label }}</el-button
284
- >
285
- </template>
286
- <template v-else>
287
- <!--万恶的后台接口,数据==null 显示-->
288
- <!-- {{dataState}} -->
289
- <!-- <el-button v-if="'dataState' in item && 'props' in item && scope.row[item.props['dataState']] == item.dataState" :class="'type' in item && item.type ? item.type : 'primary'" @click="handleClick(item,scope,index)" type="text" size="small">{{item.label}}</el-button> -->
290
- <el-button
291
- :class="'type' in item && item.type ? item.type : 'primary'"
292
- @click="handleClick(item, scope, index)"
293
- size="small"
294
- type="text"
295
- v-if="'dataState' in item && 'props' in item && String(item.dataState).split(',').includes(scope.row[item.props['dataState']].toString())"
296
- >
297
- {{ item.label }}</el-button
298
- >
299
- <el-button
300
- :class="'type' in item && item.type ? item.type : 'primary'"
301
- @click="handleClick(item, scope, index)"
302
- size="small"
303
- type="text"
304
- v-else-if="'dataState' in item && scope.row.dataState == item.dataState && !item.props"
305
- >
306
- {{ item.label }}</el-button
307
- >
308
- <el-button :class="'type' in item && item.type ? item.type : 'primary'" @click="handleClick(item, scope, index)" size="small" type="text" v-else-if="item.state">{{
309
- item.label
310
- }}</el-button>
311
- </template>
312
- </span>
313
- </template>
314
- </span>
315
- </template>
316
- </el-table-column>
317
- </el-table>
318
- </div>
319
-
320
- <div class="page-box">
321
- <!-- 按钮部分 -->
322
- <div v-if="'tablePageBtn' in temTablePack">
323
- <el-button :key="indexBtn" :type="itemBtn.type" @click="btn(itemBtn, indexBtn)" v-for="(itemBtn, indexBtn) in temTablePack.tablePageBtn">{{ itemBtn.label }}</el-button>
324
- </div>
325
- <div class="page-item" v-if="'tabpageState' in temTablePack ? temTablePack.tabpageState : true">
326
- <!--page-->
327
- <div class="tem-page" v-if="pagenation && pagenation.total">
328
- <!-- 'currentPage' in pagenation ? pagenation.currentPage : 1 -->
329
- <!-- 'pageSize' in pagenation && pagenation.pageSize ? pagenation.pageSize : 10 -->
330
- <el-pagination
331
- :current-page="data.page"
332
- :page-size="data.rows"
333
- :page-sizes="'pageSizes' in pagenation && pagenation.pageSizes ? pagenation.pageSizes : [10, 20, 50, 100]"
334
- :pager-count="5"
335
- :total="'total' in pagenation ? pagenation.total : 1"
336
- @current-change="currentChange"
337
- @size-change="sizeChange"
338
- layout="total, sizes, prev, pager, next, jumper"
339
- ></el-pagination>
340
- </div>
341
- </div>
342
- </div>
343
- </div>
344
- </el-col>
345
- </el-row>
346
-
347
- <div v-else>
348
- <div class="template-box template-boild-box">
349
- <!--main table-->
350
- <div class="tem-main" v-if="temTablePack">
351
- <h3 class="temTablePack-title" v-if="'title' in temTablePack ? temTablePack.title : ''">{{ temTablePack.title }}:</h3>
352
- <el-table
353
- :data="tableData"
354
- :empty-text="'emptyText' in temTablePack ? temTablePack.emptyText : '暂无数据'"
355
- :row-key="row_Key"
356
- :rowKey="(rowKey = temTablePack.rowKey ? temTablePack.rowKey : '')"
357
- @select="handleSelectionChange"
358
- @select-all="handleSelectionChange"
359
- @toggleSelection="toggleSelection"
360
- ref="multipleTable"
361
- style="width: 100%"
362
- v-loading="loading"
363
- stripe
364
- :height="'tabHeight' in temTablePack ? temTablePack.tabHeight : false"
365
- >
366
- <el-table-column
367
- :reserve-selection="temTablePack.reserve_selection ? true : false"
368
- type="selection"
369
- v-if="'selection' in temTablePack ? temTablePack.selection.state : false"
370
- width="40"
371
- ></el-table-column>
372
- <el-table-column
373
- :align="'align' in item ? item.align : ''"
374
- :key="index"
375
- :label="'label' in item ? item.label : ''"
376
- :min-width="'minWidth' in item ? item.minWidth : ''"
377
- :prop="'prop' in item ? item.prop : ''"
378
- :width="'width' in item ? item.width : 'auto'"
379
- v-for="(item, index) in temTablePack.tableHead"
380
- :fixed="'fixed' in item ? item.fixed : false"
381
- :show-overflow-tooltip="'overflow' in item ? item.overflow : false"
382
- >
383
- <!-- min-width 产品后期要最小宽度,开发以改了部分,以无法修改,width 代替min-width -->
384
- <template slot-scope="scope">
385
- <template-table-content :item="item" :scope="scope" @changeGetData="getDataList"> </template-table-content>
386
- </template>
387
- </el-table-column>
388
- <el-table-column
389
- :width="'tabBtnWidth' in temTablePack ? temTablePack.tabBtnWidth : '180'"
390
- label="操作"
391
- :fixed="'fixed' in temTablePack ? temTablePack.fixed : false"
392
- v-if="'tabBtnState' in temTablePack ? temTablePack.tabBtnState : true"
393
- >
394
- <template slot-scope="scope">
395
- <!--四个以内的按钮是这么显示-->
396
-
397
- <span :key="index" class="tem-span-btn" style="display: inline-block" v-for="(item, index) in temTablePack.tableBtn">
398
- <template v-if="'renderTemp' in item">
399
- <child :item="item" :para="scope.row" :temp="item.renderTemp"></child>
400
- </template>
401
- <template v-else>
402
- <span style="display: inline-block" v-if="'dropdown' in item && item.dropdown">
403
- <!--dropdown 为false 表示不需要折叠-->
404
- <!-- v-if="dropdownState(scope.row.dataState,item.dropdowMenu)" -->
405
- <el-dropdown @command="handleClick($event, scope, index)">
406
- <el-button class="el-dropdown-link" size="text">
407
- 处理
408
- <i class="el-icon-arrow-down el-icon--right"></i>
409
- </el-button>
410
- <el-dropdown-menu slot="dropdown">
411
- <el-dropdown-item
412
- :command="dropdowItem"
413
- :key="(dropdowIndex = dropdowIndex)"
414
- v-for="(dropdowItem, dropdowIndex) in item.dropdowMenu"
415
- v-if="('dataState' in dropdowItem && dropdowItem.dataState.split(',').includes(scope.row.dataState.toString())) || ('state' in dropdowItem && dropdowItem.state)"
416
- >
417
- {{ dropdowItem.label }}</el-dropdown-item
418
- >
419
- </el-dropdown-menu>
420
- </el-dropdown>
421
- </span>
422
-
423
- <span style="display: inline-block" v-else>
424
- <template v-if="'dataState' in item && item.dataState == null">
425
- <template v-if="'reverse' in item && item.reverse">
426
- <el-button
427
- :class="'type' in item && item.type ? item.type : 'primary'"
428
- @click="handleClick(item, scope, index)"
429
- size="small"
430
- type="text"
431
- v-if="'reverse' in item && item.props && scope.row[item.props['dataState']] != null"
432
- >
433
- {{ item.label }}</el-button
434
- >
435
- </template>
436
- <template v-else>
437
- <el-button
438
- :class="'type' in item && item.type ? item.type : 'primary'"
439
- @click="handleClick(item, scope, index)"
440
- size="small"
441
- type="text"
442
- v-if="item.props && scope.row[item.props['dataState']] == null"
443
- >{{ item.label }}
444
- </el-button>
445
- </template>
446
- </template>
447
- <template v-if="'otherState' in item && item.otherState">
448
- <!-- {{scope.row[item.props['dataState']]}}
449
- {{item[item.props['dataState']]}}-->
450
- <el-button
451
- :class="'type' in item && item.type ? item.type : 'primary'"
452
- @click="handleClick(item, scope, index)"
453
- size="small"
454
- type="text"
455
- v-if="'dataState' in item && 'props' in item && scope.row.dataState == item.dataState && scope.row[item.props['dataState']] == item[item.props['dataState']]"
456
- >
457
- {{ item.label }}</el-button
458
- >
459
- <el-button
460
- :class="'type' in item && item.type ? item.type : 'primary'"
461
- @click="handleClick(item, scope, index)"
462
- size="small"
463
- type="text"
464
- v-else-if="!item.dataState && item.props && scope.row[item.props['dataState']] == item[item.props['dataState']]"
465
- >
466
- {{ item.label }}</el-button
467
- >
468
- </template>
469
-
470
- <template v-else>
471
- <!--万恶的后台接口,数据==null 显示-->
472
- <!-- <el-button v-if="'dataState' in item && 'props' in item && scope.row[item.props['dataState']] == item.dataState" :class="'type' in item && item.type ? item.type : 'primary'" @click="handleClick(item,scope,index)" type="text" size="small">{{item.label}}</el-button> -->
473
- <el-button
474
- :class="'type' in item && item.type ? item.type : 'primary'"
475
- @click="handleClick(item, scope, index)"
476
- size="small"
477
- type="text"
478
- v-if="
479
- 'dataState' in item &&
480
- 'props' in item &&
481
- (scope.row[item.props['dataState']] || scope.row[item.props['dataState']] == 0) &&
482
- String(item.dataState).split(',').includes(scope.row[item.props['dataState']].toString())
483
- "
484
- >{{ item.label }}</el-button
485
- >
486
- <el-button
487
- :class="'type' in item && item.type ? item.type : 'primary'"
488
- @click="handleClick(item, scope, index)"
489
- size="small"
490
- type="text"
491
- v-else-if="'dataState' in item && scope.row.dataState == item.dataState && !item.props"
492
- >
493
- {{ item.label }}</el-button
494
- >
495
- <el-button :class="'type' in item && item.type ? item.type : 'primary'" @click="handleClick(item, scope, index)" size="small" type="text" v-else-if="item.state">{{
496
- item.label
497
- }}</el-button>
498
- </template>
499
- </span>
500
- </template>
501
- </span>
502
- </template>
503
- </el-table-column>
504
- </el-table>
505
- </div>
506
-
507
- <div class="page-box" v-if="temTablePack">
508
- <!-- 按钮部分 -->
509
- <div v-if="'tablePageBtn' in temTablePack">
510
- <el-button :key="indexBtn" :type="itemBtn.type" @click="btn(itemBtn, indexBtn)" v-for="(itemBtn, indexBtn) in temTablePack.tablePageBtn">{{ itemBtn.label }}</el-button>
511
- </div>
512
- <div class="page-item" v-if="'tabpageState' in temTablePack ? temTablePack.tabpageState : true">
513
- <!--page-->
514
- <div class="tem-page" v-if="pagenation && pagenation.total">
515
- <!-- 'currentPage' in pagenation ? pagenation.currentPage : 1 -->
516
- <!-- 'pageSize' in pagenation && pagenation.pageSize ? pagenation.pageSize : 10 -->
517
- <el-pagination
518
- :current-page="data.page"
519
- :layout="temLayout"
520
- :page-size="data.rows"
521
- :page-sizes="'pageSizes' in pagenation && pagenation.pageSizes ? pagenation.pageSizes : [10, 20, 50, 100]"
522
- :pager-count="5"
523
- :total="'total' in pagenation ? pagenation.total : 1"
524
- @current-change="currentChange"
525
- @size-change="sizeChange"
526
- ></el-pagination>
527
- </div>
528
- </div>
529
- </div>
530
- <!-- count -->
531
- <!-- <div class="page-count flex justify-content--flex-end" v-if="count">
532
- <p
533
- v-for="(item,index) in count"
534
- :key="index"
535
- >{{item.label}}{{item.beforeUnit}}{{item.value}}{{item.afterUnit}}</p>
536
- </div>-->
537
- </div>
538
- </div>
539
-
540
- <!--编辑-->
541
- <el-dialog
542
- :title="'title' in dialogData.template ? dialogData.template.title : ''"
543
- :visible.sync="dialogFormVisible"
544
- @close="dialogClose"
545
- append-to-body
546
- :width="'width' in dialogData.template ? dialogData.template.width : '660px'"
547
- v-if="dialogData && dialogData.template"
548
- >
549
- <template-input
550
- :labelWidth="dialogData.template.labelWidth"
551
- :rules="dialogData.template.rules"
552
- :temInput="dialogData.template.html"
553
- @cancel="dialogCancel"
554
- @getData="getDataList"
555
- @handleSelect="handleSelect"
556
- @inputBlur="inputBlur"
557
- @inputBtnClick="inputBtnClick"
558
- @radioChange="radioChange"
559
- @selChange="selChange"
560
- ref="child"
561
- ></template-input>
562
- </el-dialog>
563
- <!--查看-->
564
- <el-dialog
565
- :title="dialogDataSee && 'title' in dialogDataSee ? dialogDataSee.title : ''"
566
- :visible.sync="dialogFormVisibleSee"
567
- append-to-body
568
- :width="dialogDataSee && 'width' in dialogDataSee ? dialogDataSee.width : '660px'"
569
- v-if="JSON.stringify(dialogDataSee) != '{}'"
570
- >
571
- <ul class="dialogSee-ui">
572
- <li :key="index" class="clearfix" v-for="(item, index) in dialogDataSee.html">
573
- <div v-if="'state' in item">
574
- <div v-if="item.state == item.stateValue">
575
- <label :style="{ width: 'labelWidth' in dialogDataSee ? dialogDataSee.labelWidth + 'px' : 'auto' }" v-if="'label' in item">{{ item.label }}:</label>
576
- <div class="dialog-main" v-if="'type' in item">
577
- <p v-if="item.type === 'text'">
578
- {{ 'template' in item && item.template === 'format' ? parseTime(item.value) : item.value }}
579
- </p>
580
- <!--表示文本框-->
581
- <p v-if="item.type === 'select'">{{ item.template[item.value] }}</p>
582
- <img :src="item.value" v-if="item.type === 'img'" />
583
- <p class="dialogSee-textarea" v-if="item.type === 'textarea'">{{ item.value }}</p>
584
- </div>
585
- </div>
586
- </div>
587
- <div v-else>
588
- <label :style="{ width: 'labelWidth' in dialogDataSee ? dialogDataSee.labelWidth + 'px' : 'auto' }" v-if="'label' in item">{{ item.label }}:</label>
589
- <div class="dialog-main" v-if="'type' in item">
590
- <p v-if="item.type === 'text'">
591
- {{ 'template' in item && item.template === 'format' ? parseTime(item.value) : item.value }}
592
- </p>
593
- <!--表示文本框-->
594
- <p v-if="item.type === 'select'">{{ item.template[item.value] }}</p>
595
- <img :src="item.value" v-if="item.type === 'img'" />
596
-
597
- <p class="dialogSee-textarea" v-if="item.type === 'textarea'">{{ item.value }}</p>
598
- </div>
599
- </div>
600
- <el-button :key="indexBtn" :type="itemBtn.type" @click="reviewClick(itemBtn, dialogDataSee.html)" v-for="(itemBtn, indexBtn) in item.btnArray" v-if="'btnArray' in item">{{
601
- itemBtn.label
602
- }}</el-button>
603
- </li>
604
- </ul>
605
- </el-dialog>
606
- </div>
607
- </div>
608
- </template>
609
- <script>
610
- import request from '#/utils/request';
611
- import templateTableContent from './templateUi/templateTableContent';
612
- import tempSelect from './components/temp-select';
613
- import templateInput from './templateInput';
614
- const querystring = require('querystring');
615
- import { isUndefined } from 'lodash';
616
- import { parseTime } from '#/utils/index'; //时间格式化
617
- export default {
618
- props: ['temInput', 'params', 'temTable', 'temPage', 'temTab', 'url', 'temPageLayout', 'subtotal'],
619
- computed: {
620
- temInputPack() {
621
- if (!this.temInput) {
622
- return this.temInput;
623
- }
624
- if (isUndefined(this.$route.meta.btnRules)) {
625
- return this.temInput;
626
- }
627
- const index = this.temInput.findIndex((item) => Array.isArray(item.btnArray));
628
- if (index === -1) {
629
- return this.temInput;
630
- }
631
-
632
- let inputData = this.temInput;
633
- const result = inputData[index];
634
- result.btnArray = result.btnArray.filter((item1) => {
635
- if (item1.menuCode) {
636
- return this.$route.meta.btnRules.some((items) => items.menuCode == item1.menuCode);
637
- } else {
638
- return this.$route.meta.btnRules.some((items) => items.menuName == item1.label);
639
- }
640
- });
641
- return inputData;
642
- },
643
- temTablePack() {
644
- if (!this.temTable) {
645
- return this.temTable;
646
- }
647
- if (isUndefined(this.$route.meta.btnRules)) {
648
- return this.temTable;
649
- }
650
- if (!Array.isArray(this.temTable['tableBtn'])) {
651
- return this.temTable;
652
- }
653
-
654
- let tabBtnData = this.temTable;
655
-
656
- tabBtnData['tableBtn'] = tabBtnData['tableBtn'].filter((item1) => {
657
- if (item1.menuCode) {
658
- return this.$route.meta.btnRules.some((items) => items.menuCode == item1.menuCode);
659
- } else {
660
- return this.$route.meta.btnRules.some((items) => items.menuName == item1.label);
661
- }
662
- });
663
- return tabBtnData;
664
- },
665
- },
666
- components: {
667
- tempSelect,
668
- 'template-table-content': templateTableContent,
669
- 'template-input': templateInput,
670
- child: {
671
- functional: true,
672
- render: (h, context) => {
673
- let temp = context.props.temp;
674
- let para = context.props.para;
675
- let item = context.props.item;
676
- return temp(h, para, item);
677
- },
678
- props: {
679
- temp: {
680
- type: Function,
681
- required: true,
682
- },
683
- para: {
684
- type: Object,
685
- required: true,
686
- },
687
- item: {
688
- type: Object,
689
- required: true,
690
- },
691
- },
692
- },
693
- },
694
- data() {
695
- return {
696
- rowKey: '',
697
- row_Key: 'row[this.rowKey]',
698
- temLayout: 'total, sizes, prev, pager, next, jumper',
699
- pagenation: null,
700
- data: {
701
- rows: 10,
702
- page: 1,
703
- },
704
- sltPage: 1,
705
- sltItem: {},
706
- pageCount: null,
707
- restaurants: null, //搜索的数据
708
- searchUrl: '',
709
- parseTime,
710
- loading: false,
711
- loadings: false,
712
- dialogFormVisible: false, //dialog编辑是否显示
713
- dialogFormVisibleSee: false, //dialog查看是否显示
714
- dialogData: {},
715
- dialogDataSee: {},
716
- formLabelWidth: '9rem', //长度根据标题长度来,一个字一个rem
717
- activeName: '0',
718
- tableData: [],
719
- ruleForm: {}, //编辑from
720
- limit: null, //限制图片上传的数量
721
- uploadUrl: '/web/rs/goodsFile/uploadGoodsFile.json', //图片上传的默认url
722
- imageUrl: '', //单个图片的imgurl,
723
- uploadImgValue: [], //上传图片url
724
- showFileList: null,
725
- uploadName: null, //上传图片name
726
- imgLoading: false,
727
- btnState: null, //1表示增加,2表示编辑
728
- imgIndex: null,
729
- iptSltname: '', //table内容
730
- dropdowIndexObj: {},
731
- flag: 0,
732
- inputHtmlReset: null, //初始化数据
733
- clickState: true, //防止多次重复点击
734
- };
735
- },
736
- // beforeCreate() {
737
- // this.dialogData
738
- // },
739
- mounted() {
740
- // console.log(this.temInputPack, "ddd");
741
- // 在template-table上新增加绑定一个temPageLayout,值是字符串,不传默认是'total, sizes, prev, pager, next, jumper',
742
- // 根据需要添加或者减少
743
- if (localStorage.getItem('currenPage')) {
744
- this.data.page = localStorage.getItem('currenPage');
745
- this.getDataList();
746
- }
747
- if (this.temPageLayout) {
748
- this.temLayout = this.temPageLayout;
749
- }
750
-
751
- this.temPage
752
- ? (this.pagenation = this.temPage)
753
- : this.temPage === false
754
- ? (this.pagenation = false)
755
- : (this.pagenation = {
756
- currentPage: 1,
757
- pageSizes: [10, 20, 50, 100],
758
- pageSize: 10,
759
- total: 1,
760
- });
761
- if (this.temPage && 'pageSize' in this.temPage) {
762
- this.data.rows = this.temPage.pageSize;
763
- }
764
- //查询商家列表
765
- this.getDataList();
766
- },
767
- methods: {
768
- open(item, val, index) {
769
- console.log('2222++++++++++', item, val, index);
770
- if (val.row.dataState == -1 || val.row.dataState == 4) {
771
- this.$message.warning('暂无操作');
772
- return;
773
- }
774
- },
775
- btn(itemBtn, index) {
776
- console.log(itemBtn, index, '+++++++++++++++++++++++++++++');
777
- if (itemBtn.id === 'query' || itemBtn.id === 'search') {
778
- //表示查询
779
- this.data.page = 1;
780
- this.searchUrl = 'url' in itemBtn && itemBtn.url ? itemBtn.url : '';
781
- console.log(this.searchUrl, 'this.searchUrl222222222222222222222++++++++++++++++++++++++++++++++++');
782
- this.getDataList(this.searchUrl);
783
- } else if (itemBtn.id === 'add') {
784
- itemBtn.template.html.forEach((el) => {
785
- this.$set(this.ruleForm, el.name, el.value);
786
- });
787
- // 给add 抛出一个方法
788
- this.$emit('inputBtnClickAdd', itemBtn, index);
789
- // this.$emit("editClick", val.row, index);
790
- this.dialogData = itemBtn;
791
- this.dialogFormVisible = true;
792
- this.btnState = 1; //表示增加
793
- } else if (itemBtn.id === 'accurateQuery') {
794
- this.searchUrl = 'url' in itemBtn && itemBtn.url ? itemBtn.url : '';
795
- this.getDataList(this.searchUrl, itemBtn.id);
796
- } else if (itemBtn.id == 'exImportData') {
797
- this.searchUrl = 'url' in itemBtn && itemBtn.url ? itemBtn.url : '';
798
- let jump = 'jumpUrl' in itemBtn && itemBtn.jumpUrl ? itemBtn.jumpUrl : '';
799
- this.importData(this.searchUrl, itemBtn.id, jump);
800
- } else {
801
- this.$emit('inputBtnClick', itemBtn, index);
802
- }
803
- // this.$emit("inputBtnClick", itemBtn, index);
804
- },
805
- inputBtnClick(itemBtn, indexBtn) {
806
- //input子组件传递的通用事件
807
- this.$emit('inputBtnClick', itemBtn, indexBtn);
808
- },
809
-
810
- dialogClose() {
811
- // console.log(this.$refs.child);
812
- this.$refs.child.setReset();
813
- this.dialogFormVisible = false;
814
- // console.log("close");
815
- },
816
- reviewClick(itemBtn, item) {
817
- if (itemBtn.id == 'review') {
818
- //表示确定
819
- this.setData(itemBtn.url, itemBtn, item);
820
- }
821
- },
822
- inputBlur(item) {
823
- this.$emit('inputBlur', item);
824
- },
825
- setData(url, btnarr, item) {
826
- if (url) {
827
- let data = {};
828
- btnarr.params.forEach((res) => {
829
- if (res.value) {
830
- data[res.name] = res.value;
831
- } else {
832
- data[res.name] = item[res.index].value;
833
- }
834
- });
835
- //编辑请求接口
836
- request({
837
- url: url,
838
- method: 'post',
839
- data: querystring.stringify(data),
840
- }).then((res) => {
841
- if (res.success) {
842
- this.$message({
843
- message: res.msg,
844
- type: 'success',
845
- });
846
- this.getDataList();
847
- this.dialogFormVisibleSee = false;
848
- } else {
849
- this.$message.error(res.msg);
850
- }
851
- });
852
- }
853
- },
854
- getOption(e, item) {
855
- console.log(item, 'item');
856
- if (item.url && !item.state) {
857
- request({
858
- url: item.url,
859
- method: 'get',
860
- }).then((res) => {
861
- item.options = res;
862
- item.state = true;
863
- });
864
- }
865
- },
866
- prePage(item) {
867
- // console.log(item,'item2')
868
- --item.pagenation.page;
869
- // this.sltPage = item.pagenation.page;
870
-
871
- if (item.pagenation.page < 1) {
872
- // 判断点击的页数是否小于1
873
- this.$message.error('已到第一页');
874
- item.pagenation.page = 1;
875
- return;
876
- }
877
- item.state = false;
878
- this.getSltInfo(item, true);
879
- },
880
- nextPage(item) {
881
- // console.log(item,'item1')
882
- // console.log(this.pageCount,'this.pageCount')
883
- if (item.pagenation.page < item.pageCount) {
884
- // 判断点击的页数是否小于总页数;
885
- ++item.pagenation.page;
886
- // this.sltPage = item.pagenation.page;
887
- item.state = false;
888
- this.getSltInfo(item, true);
889
- } else {
890
- this.$message.error('已到最后一页');
891
- }
892
- },
893
- remoteMethod(data) {
894
- this.sltItem.pagenation.page = 1;
895
- this.sltItem.state = false;
896
- this.loadings = true;
897
- this.sltItem.pageCount = '';
898
- this.iptSltname = data;
899
-
900
- // let item=JSON.parse(JSON.stringify(this.sltItem));
901
- console.log(this.iptSltname, 'item');
902
- this.getSltInfo(this.sltItem, true);
903
- },
904
- filterData(data, item) {},
905
- getSltInfo(item, flag) {
906
- this.sltItem = item;
907
- console.log(item, this.iptSltname, 'item');
908
- // this.sltItem=JSON.parse(JSON.stringify(item));
909
- if (item.url && !item.state) {
910
- let json = {
911
- rows: (item.pagenation && item.pagenation.rows) || null,
912
- page: (item.pagenation && item.pagenation.page) || null,
913
- };
914
- if (!item.pagenation) {
915
- delete json.page;
916
- delete json.rows;
917
- }
918
- if (item.props.label && this.iptSltname) {
919
- json[item.props.label] = this.iptSltname;
920
- } else {
921
- delete json[item.props.label];
922
- }
923
- request({
924
- url: item.url,
925
- method: 'post',
926
- data: json,
927
- }).then((res) => {
928
- item.pageCount = item.pagenation && item.pagenation.rows ? Math.ceil(res.total / item.pagenation.rows) : 1;
929
- if (res) {
930
- if (Array.isArray(res)) {
931
- item.options = res;
932
- } else {
933
- item.options = res.list;
934
- }
935
- }
936
- this.loadings = false;
937
- item.state = true;
938
- });
939
- }
940
- },
941
- handleClick(item, val, index) {
942
- console.log('xialacaozuo++++++++++++++++');
943
- // console.log(item);
944
- //index表示btn的位置
945
- let id = item.id;
946
- if (id === 'see') {
947
- // console.log(,"item")
948
-
949
- this.seeDetails(item, val, index);
950
- } else if (id === 'edit') {
951
- item.template.html.forEach((el) => {
952
- if (el.name in val.row) {
953
- //判断属性是否存在
954
- if (el.type === 'cascader') {
955
- el.value = val.row[el.name] ? [...val.row[el.name]] : '';
956
- } else {
957
- el.value = val.row[el.name];
958
- }
959
- }
960
-
961
- // 没有值时,保留原有的值,不作处理
962
- // else {
963
- // el.value = ""; //没有值的时候,为空
964
- // }
965
- });
966
- this.dialogData = item;
967
- this.dialogFormVisible = true;
968
- this.btnState = 2; //表示编辑
969
- } else if (id === 'del' && !('params' in item)) {
970
- console.log('删除');
971
- this.delData(val, item);
972
- } else if ('params' in item || ('prompt' in item && item.prompt)) {
973
- //判断url和params 都不存在,还需要弹框时候"prompt" in item && item.prompt
974
- // (!("params" in item) && !("url" in item))
975
- this.changeData(item, val);
976
- }
977
-
978
- this.$emit('tableBtnClick', val.row, item, index);
979
- },
980
- querySearchAsync(queryString, cb) {
981
- var restaurants = this.restaurants;
982
- var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;
983
-
984
- clearTimeout(this.timeout);
985
- this.timeout = setTimeout(() => {
986
- cb(results);
987
- }, 3000 * Math.random());
988
- },
989
- createStateFilter(queryString) {
990
- return (state) => {
991
- return state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0;
992
- };
993
- },
994
- handleSelect(item) {
995
- console.log('开始选');
996
- this.$emit('handleSelect', item);
997
- },
998
- sizeChange(val) {
999
- this.data.rows = val;
1000
- this.data.page = 1;
1001
- this.getDataList();
1002
- this.$emit('sizeChange', val);
1003
- },
1004
- currentChange(val) {
1005
- console.log('开始请求');
1006
- this.data.page = val;
1007
- this.getDataList();
1008
- this.$emit('currentChange', val);
1009
- },
1010
- handleCommand(key, data) {
1011
- console.log(key, data, 'f');
1012
- //折叠按钮请求
1013
- // this.$message("click on item " + command);
1014
- // this.$emit("tableBtnClick", command); //抛出去,根据id来执行事件
1015
- },
1016
- importData(paramsUrl, btnId, jump) {
1017
- let paramsResult = null, //判断参数是否必传
1018
- disabledPrompt = null, //参数必传的提示语
1019
- disabledValueArray = null; //参数必传的name值的数组
1020
- let requestUrl = paramsUrl ? paramsUrl : this.searchUrl ? this.searchUrl : this.url ? this.url : '';
1021
- if (requestUrl === '') {
1022
- // this.$message.error("url not defined");
1023
- return false;
1024
- }
1025
- let params = {};
1026
-
1027
- //获取参数
1028
- this.temInputPack &&
1029
- this.temInputPack.forEach((el, index) => {
1030
- if ('disabledStatic' in el && el.disabledStatic) {
1031
- //添加这个字段表示这个字段传递后,才可点击搜索框
1032
- paramsResult = true; //设定为true,表示有这个字段
1033
- if ('disabledPrompt' in el && el.disabledPrompt) {
1034
- //这个字段只需给一个,一般以第一个为准
1035
- disabledPrompt = el.disabledPrompt;
1036
- }
1037
- disabledValueArray = [];
1038
- disabledValueArray.push(el.value);
1039
- }
1040
- if (el.type === 'daterange') {
1041
- //这是时间段
1042
- // console.log(el.name, "ddd");
1043
- el.name.split(',').forEach((res, index) => {
1044
- if (el.value) {
1045
- params[res] = el.value[index];
1046
- }
1047
- });
1048
- } else if (el.type === 'datetimerange') {
1049
- //这是时间段
1050
- console.log(el.name, 'ddd');
1051
- el.name.split(',').forEach((res, index) => {
1052
- if (el.value) {
1053
- params[res] = el.value[index];
1054
- }
1055
- });
1056
- } else if (el.type === 'cascader') {
1057
- let _array = el.options;
1058
- // 先判断是几级
1059
- if (el.value.length - 1) {
1060
- }
1061
- // if (Array.isArray(el.value[0])) {
1062
- // let _val = "";
1063
- // el.value.forEach((res, reIndex) => {
1064
- // _val +=
1065
- // el.value.length - 1 == reIndex
1066
- // ? res[res.length - 1]
1067
- // : res[res.length - 1] + ",";
1068
- // });
1069
- // params[el.name] = _val;
1070
- // } else {
1071
- if (el.value.length > 0) {
1072
- params[el.name] = el.value[el.value.length - 1];
1073
- }
1074
- // }
1075
- } else if (el.type === 'select') {
1076
- if (Array.isArray(el.value) && el.value.length > 0) {
1077
- let _val = '';
1078
- el.value.forEach((res, reIndex) => {
1079
- _val += el.value.length - 1 == reIndex ? res : res + ',';
1080
- });
1081
- params[el.name] = _val;
1082
- } else {
1083
- if (el.value) {
1084
- params[el.name] = el.value;
1085
- console.log(el, el.value, params, 'el.value');
1086
- }
1087
- }
1088
- } else if (el.name) {
1089
- if (el.value) {
1090
- //暂时修改,后台接口返回问题
1091
- // if(el.multiple){
1092
- // params[el.name]=el.value.toString()
1093
- // }else{
1094
- params[el.name] = el.value;
1095
- // }
1096
-
1097
- console.log(el, el.value, params, 'el.value');
1098
- }
1099
- } else if (el.type === 'textMore') {
1100
- el.children.forEach((response) => {
1101
- if (response.value) {
1102
- params[response.name] = response.value;
1103
- }
1104
- });
1105
- }
1106
- });
1107
- if (this.temTab && this.temTab.tabPane[this.activeName].value != '') {
1108
- this.temTab.tabPane[this.activeName].name.split(',').forEach((elpar, elIndex) => {
1109
- this.$set(params, elpar, this.temTab.tabPane[this.activeName].value.split(',')[elIndex]);
1110
- });
1111
- }
1112
- //查询列表
1113
-
1114
- console.log(params, '+++++++++++++');
1115
- // this.loading = true;
1116
- // 请求需要携带的参数params
1117
- this.params &&
1118
- this.params.forEach((par) => {
1119
- if (par.value) {
1120
- params[par.name] = par.value;
1121
- }
1122
- });
1123
- params.exportFlag = true;
1124
- request({
1125
- url: requestUrl,
1126
- method: 'post',
1127
- data: querystring.stringify(params),
1128
- }).then((res) => {
1129
- this.$message.success('操作成功,请耐心等待');
1130
-
1131
- setTimeout(() => {
1132
- if (!jump) {
1133
- window.locationProxy.href = process.env.API_ROOT + '/paas/system-manager/index.html#/importData';
1134
- } else {
1135
- window.locationProxy.href = jump;
1136
- }
1137
- }, 500);
1138
- });
1139
- },
1140
- getDataList(paramsUrl, btnId) {
1141
- if (this.clickState) {
1142
- this.clickState = false;
1143
-
1144
- // debugger
1145
- let paramsResult = null, //判断参数是否必传
1146
- disabledPrompt = null, //参数必传的提示语
1147
- disabledValueArray = null; //参数必传的name值的数组
1148
- let requestUrl = paramsUrl ? paramsUrl : this.searchUrl ? this.searchUrl : this.url ? this.url : '';
1149
- if (requestUrl === '') {
1150
- // this.$message.error("url not defined");
1151
- return false;
1152
- }
1153
- let params = {};
1154
- if (!btnId) {
1155
- params['rows'] = this.data.rows;
1156
- params['page'] = this.data.page;
1157
- }
1158
- if (this.temPage == false) {
1159
- delete params.rows;
1160
- delete params.page;
1161
- }
1162
- //获取参数
1163
- this.temInputPack &&
1164
- this.temInputPack.forEach((el, index) => {
1165
- if ('disabledStatic' in el && el.disabledStatic) {
1166
- //添加这个字段表示这个字段传递后,才可点击搜索框
1167
- paramsResult = true; //设定为true,表示有这个字段
1168
- if ('disabledPrompt' in el && el.disabledPrompt) {
1169
- //这个字段只需给一个,一般以第一个为准
1170
- disabledPrompt = el.disabledPrompt;
1171
- }
1172
- disabledValueArray = [];
1173
- disabledValueArray.push(el.value);
1174
- }
1175
- if (el.type === 'daterange') {
1176
- //这是时间段
1177
- // console.log(el.name, "ddd");
1178
- el.name.split(',').forEach((res, index) => {
1179
- if (el.value) {
1180
- params[res] = el.value[index];
1181
- }
1182
- });
1183
- } else if (el.type === 'datetimerange') {
1184
- //这是时间段
1185
- console.log(el.name, 'ddd');
1186
- el.name.split(',').forEach((res, index) => {
1187
- if (el.value) {
1188
- params[res] = el.value[index];
1189
- }
1190
- });
1191
- } else if (el.type === 'cascader') {
1192
- let _array = el.options;
1193
- // 先判断是几级
1194
- if (el.value.length - 1) {
1195
- }
1196
- // if (Array.isArray(el.value[0])) {
1197
- // let _val = "";
1198
- // el.value.forEach((res, reIndex) => {
1199
- // _val +=
1200
- // el.value.length - 1 == reIndex
1201
- // ? res[res.length - 1]
1202
- // : res[res.length - 1] + ",";
1203
- // });
1204
- // params[el.name] = _val;
1205
- // } else {
1206
- if (el.value.length > 0) {
1207
- params[el.name] = el.value[el.value.length - 1];
1208
- }
1209
- // }
1210
- } else if (el.type === 'select') {
1211
- if (Array.isArray(el.value) && el.value.length > 0) {
1212
- let _val = '';
1213
- el.value.forEach((res, reIndex) => {
1214
- _val += el.value.length - 1 == reIndex ? res : res + ',';
1215
- });
1216
- params[el.name] = _val;
1217
- } else {
1218
- if (el.value) {
1219
- params[el.name] = el.value;
1220
- console.log(el, el.value, params, 'el.value');
1221
- }
1222
- }
1223
- } else if (el.name) {
1224
- if (el.value) {
1225
- //暂时修改,后台接口返回问题
1226
- // if(el.multiple){
1227
- // params[el.name]=el.value.toString()
1228
- // }else{
1229
- params[el.name] = el.value;
1230
- // }
1231
-
1232
- console.log(el, el.value, params, 'el.value');
1233
- }
1234
- } else if (el.type === 'textMore') {
1235
- el.children.forEach((response) => {
1236
- if (response.value) {
1237
- params[response.name] = response.value;
1238
- }
1239
- });
1240
- }
1241
- });
1242
- if (this.temTab && this.temTab.tabPane[this.activeName].value != '') {
1243
- console.log('111111111');
1244
-
1245
- this.temTab.tabPane[this.activeName].name.split(',').forEach((elpar, elIndex) => {
1246
- this.$set(params, elpar, this.temTab.tabPane[this.activeName].value.split(',')[elIndex]);
1247
- });
1248
- } else if (this.temTab && this.temTab.tabPane[this.activeName].value == '') {
1249
- if (this.temTab.tabPane[this.activeName].url) {
1250
- requestUrl = this.temTab.tabPane[this.activeName].url;
1251
- }
1252
- }
1253
- //查询列表
1254
- if (Object.keys(params).length === 0 && btnId) {
1255
- this.tableData = [];
1256
- return;
1257
- }
1258
- if (paramsResult) {
1259
- //表示需要判断
1260
- console.log(disabledValueArray, 'disabledValueArray');
1261
- // debugger
1262
- if ((disabledValueArray.indexOf('') || disabledValueArray.indexOf('underfind') || disabledValueArray.indexOf('null') || disabledValueArray.indexOf(null)) != -1) {
1263
- this.$message.error(disabledPrompt);
1264
- return;
1265
- }
1266
- }
1267
- this.loading = true;
1268
- // 请求需要携带的参数params
1269
- this.params &&
1270
- this.params.forEach((par) => {
1271
- if (par.value) {
1272
- params[par.name] = par.value;
1273
- }
1274
- });
1275
- console.log(requestUrl, 'requestUrl');
1276
- request({
1277
- url: requestUrl,
1278
- method: 'post',
1279
- data: querystring.stringify(params),
1280
- }).then((res) => {
1281
- this.loading = false;
1282
- this.clickState = true;
1283
- if (res) {
1284
- if (Array.isArray(res)) {
1285
- this.tableData = res;
1286
- this.$emit('getData', res);
1287
- // 小计
1288
-
1289
- if (res.length > 0) {
1290
- if (this.subtotal && this.subtotal.length > 0) {
1291
- this.subtotal.forEach((el) => {
1292
- el.value = 0;
1293
- if (el.name) {
1294
- res.forEach((res) => {
1295
- el.value = this.accAdd(el.value, Number(res[el.name]));
1296
- el.value = el.value.toFixed(2);
1297
- });
1298
- }
1299
- });
1300
- }
1301
- } else {
1302
- if (this.subtotal && this.subtotal.length > 0) {
1303
- this.subtotal.forEach((el) => {
1304
- el.value = 0;
1305
- });
1306
- }
1307
- }
1308
- } else if (res && res.rows) {
1309
- this.tableData = res.rows;
1310
- if (this.temPage !== false) {
1311
- this.pagenation.total = res.total;
1312
- }
1313
- this.tableData = res.rows;
1314
- this.$emit('getData', res.rows);
1315
- this.$emit('getTotal', res.total);
1316
- // 小计
1317
- if (res.rows.length > 0) {
1318
- if (this.subtotal && this.subtotal.length > 0) {
1319
- this.subtotal.forEach((el) => {
1320
- el.value = 0;
1321
- if (el.name) {
1322
- res.rows.forEach((res) => {
1323
- el.value = this.accAdd(el.value, Number(res[el.name]));
1324
- el.value = el.value.toFixed(2);
1325
- });
1326
- }
1327
- });
1328
- }
1329
- } else {
1330
- if (this.subtotal && this.subtotal.length > 0) {
1331
- this.subtotal.forEach((el) => {
1332
- el.value = 0;
1333
- });
1334
- }
1335
- }
1336
- } else {
1337
- if (this.temPage !== false) {
1338
- this.pagenation.total = 0;
1339
- }
1340
- if (this.subtotal && this.subtotal.length > 0) {
1341
- this.subtotal.forEach((el) => {
1342
- el.value = 0;
1343
- });
1344
- }
1345
- this.tableData = [];
1346
- this.$emit('getData', []);
1347
- this.$emit('getTotal', 0);
1348
- }
1349
- } else {
1350
- if (this.temPage !== false) {
1351
- this.pagenation.total = 0;
1352
- }
1353
- this.tableData = [];
1354
- this.$emit('getData', []);
1355
- this.$emit('getTotal', 0);
1356
- }
1357
- });
1358
- }
1359
- },
1360
- seeDetails(item, val, index) {
1361
- console.log(item, val);
1362
- let nData = val.row;
1363
- let params = {};
1364
- if (item.props) {
1365
- item.props.forEach((res) => {
1366
- if ('extend' in res && res.exteng === false) {
1367
- params[res.name] = res.value;
1368
- } else {
1369
- params[res.name] = nData[res.value];
1370
- if (!res.value) {
1371
- params[res.name] = nData[res.name];
1372
- }
1373
- }
1374
- });
1375
- }
1376
- if (Object.keys(params).length === 0) {
1377
- params['1'] = '';
1378
- }
1379
- if (item.url) {
1380
- request({
1381
- url: item.url,
1382
- method: 'post',
1383
- data: querystring.stringify(params),
1384
- }).then((res) => {
1385
- if (res && !res.success) {
1386
- this.showDetails(item, res);
1387
- } else {
1388
- this.$message.error('操作失败');
1389
- }
1390
- });
1391
- } else {
1392
- this.showDetails(item, nData);
1393
- }
1394
- },
1395
- showDetails(item, data) {
1396
- let template = JSON.parse(JSON.stringify(item.template)); //去除数据的双向绑定
1397
- template.html.forEach((el) => {
1398
- if (el.value === '') {
1399
- if ('template' in el) {
1400
- if (el.template === 'format') {
1401
- el.value = data[el.name] ? parseTime(data[el.name]) : data[el.name];
1402
- } else if (el.template === 'area') {
1403
- el.name &&
1404
- el.name.map((val) => {
1405
- console.log(data, val);
1406
- if (data[val]) {
1407
- el.value += data[val] + ' ';
1408
- }
1409
- });
1410
- } else {
1411
- el.value = el.template[data[el.name]];
1412
- }
1413
- } else {
1414
- el.value = data[el.name];
1415
- }
1416
- if ('state' in el) {
1417
- el.stateValue = data[el.stateName];
1418
- }
1419
- }
1420
- });
1421
- console.log(template, 'template');
1422
- this.dialogDataSee = template;
1423
- // console.log(this.dialogDataSee.html, "template");
1424
- // var seeDe=this.dialogDataSee.html;
1425
- // for(var i in seeDe){
1426
- // if(seeDe[i].type=="img"){
1427
- // console.log(seeDe[i].value)
1428
- // }
1429
- // }
1430
- this.dialogFormVisibleSee = true;
1431
- },
1432
- accAdd(num1, num2) {
1433
- var r1, r2, m;
1434
- try {
1435
- r1 = num1.toString().split('.')[1].length;
1436
- } catch (e) {
1437
- r1 = 0;
1438
- }
1439
- try {
1440
- r2 = num2.toString().split('.')[1].length;
1441
- } catch (e) {
1442
- r2 = 0;
1443
- }
1444
- m = Math.pow(10, Math.max(r1, r2));
1445
- // return (num1*m+num2*m)/m;
1446
- return Math.round(num1 * m + num2 * m) / m;
1447
- },
1448
- inputSelChange(val, item) {
1449
- // this.getDataList();
1450
- this.$emit('selChange', val, item);
1451
- },
1452
- selChange(val, item) {
1453
- this.$emit('selChange', val, item);
1454
- },
1455
- dialogCancel() {
1456
- //取消
1457
- this.dialogFormVisible = false;
1458
- },
1459
- dialogConfirm(url, formName) {
1460
- //编辑确定
1461
- this.$refs[formName].validate((valid) => {
1462
- //编辑验证
1463
- if (valid) {
1464
- if (url && this.dialogData.html) {
1465
- let data = this.ruleForm;
1466
- //编辑请求接口
1467
- request({
1468
- url: url,
1469
- method: 'post',
1470
- data: querystring.stringify(data),
1471
- }).then((res) => {
1472
- if (res.success) {
1473
- if (this.btnState === 1) {
1474
- //表示增加
1475
- this.$message({
1476
- message: '新增成功',
1477
- type: 'success',
1478
- });
1479
- } else {
1480
- this.$message({
1481
- message: '编辑成功',
1482
- type: 'success',
1483
- });
1484
- }
1485
-
1486
- this.dialogFormVisible = false;
1487
- this.getDataList();
1488
- } else {
1489
- this.$message.error(res.msg);
1490
- }
1491
- });
1492
- }
1493
- }
1494
- });
1495
- },
1496
- addData(data) {
1497
- // console.log(data, "dd");
1498
- },
1499
- delData(val, item) {
1500
- let promptTitle = item.promptTitle ? item.promptTitle : '是否确认删除?';
1501
- this.$confirm(promptTitle, {
1502
- center: true,
1503
- }).then((res) => {
1504
- return request({
1505
- url: item.url,
1506
- method: 'post',
1507
- data: querystring.stringify(val.row),
1508
- })
1509
- .then((res) => {
1510
- if (res.success) {
1511
- this.$message.success(res.msg);
1512
- this.getDataList();
1513
- }
1514
- //和request 封装的response起冲突
1515
- // else {
1516
- // this.$message.error(res.msg);
1517
- // }
1518
- this.$emit('btnConfirm', val, item); //抛出确认按钮
1519
- })
1520
- .catch((err) => {
1521
- console.log(err);
1522
- });
1523
- });
1524
- },
1525
- handleAvatarSuccess(res, file) {
1526
- console.log(res, file);
1527
- this.imageUrl = URL.createObjectURL(file.raw);
1528
- },
1529
- handleClickTab(tab, event) {
1530
- //tab事件操作
1531
- this.$emit('handleClickTab', this.temTab.tabPane[this.activeName]);
1532
- this.data.page = 1;
1533
- this.getDataList();
1534
- },
1535
- exceed() {
1536
- //图片个数超出的验证
1537
- this.$message.error(`最多上传${this.limit}张!`);
1538
- },
1539
- beforeAvatarUpload(file) {
1540
- //上传之前的回调
1541
- const fileType = /\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(file.name);
1542
- if (!fileType) {
1543
- this.$message.error('图片格式为常见的jpg、png、gif格式!');
1544
- }
1545
- const isLt2M = file.size / 1024 / 1024 < 5;
1546
- if (!isLt2M) {
1547
- this.$message.error('上传的图片大小不能超过 5MB!');
1548
- }
1549
- return isLt2M && fileType;
1550
- },
1551
- picUpload(file) {
1552
- // this.imgLoading = true;
1553
- const formData = new FormData(); //转表单对象
1554
- formData.append('file', file.file);
1555
- return request({
1556
- url: this.uploadUrl,
1557
- method: 'post',
1558
- data: formData,
1559
- })
1560
- .then((res) => {
1561
- if (!this.showFileList) {
1562
- //组件中添加showFileList就是判断是否是单个图片
1563
- this.uploadImgValue = [];
1564
- }
1565
- this.uploadImgValue.push({ url: res.fileUrl, uid: file.file.uid });
1566
- if (this.uploadName) {
1567
- this.ruleForm[this.uploadName] = res.fileUrl;
1568
- }
1569
- // this.imgLoading = false;
1570
- })
1571
- .catch(() => {
1572
- // this.imgLoading = false;
1573
- console.log('上传失败');
1574
- });
1575
- },
1576
- handleRemove(file, fileList) {
1577
- //删除图片
1578
- this.uploadImgValue = this.uploadImgValue.filter((val) => {
1579
- return val.uid !== file.uid;
1580
- });
1581
- console.log(this.uploadImgValue);
1582
- },
1583
- handleSelectionChange(selection, row) {
1584
- console.log('多选222222222222', selection, row, this.tableData);
1585
- this.$emit('handleSelectionChange', selection, row);
1586
- localStorage.setItem('selectList', this.tableData);
1587
- this.multipleSelection = selection;
1588
- this.select_order_number = this.multipleSelection.length;
1589
-
1590
- this.select_more = [];
1591
- if (selection) {
1592
- selection.forEach((row) => {
1593
- if (row) {
1594
- this.select_more.push(row);
1595
- }
1596
- });
1597
- }
1598
- console.log('多页', this.select_more);
1599
- },
1600
- toggleSelection(rows) {
1601
- if (rows) {
1602
- rows.forEach((row) => {
1603
- this.$refs.multipleTable.toggleRowSelection(row, true);
1604
- });
1605
- } else {
1606
- this.$refs.multipleTable.clearSelection();
1607
- }
1608
- this.$emit('toggleSelection', row);
1609
- },
1610
- dropdownState(state, arr) {
1611
- arr.every((res) => {
1612
- return res.dataState == state;
1613
- });
1614
- // let aa = arr.some(el => {
1615
- // return el.dataState == state;
1616
- // });
1617
- // console.log(aa);
1618
- },
1619
-
1620
- changeData(item, val) {
1621
- let params = 'params' in item ? JSON.parse(JSON.stringify(item.params)) : {};
1622
- for (let el in params) {
1623
- if (params[el] === '') {
1624
- params[el] = val.row[el];
1625
- }
1626
- }
1627
- if ('paramProps' in item) {
1628
- for (let el in item.paramProps) {
1629
- params[el] = val.row[item.paramProps[el]];
1630
- }
1631
- }
1632
- if ('url' in item && item.url) {
1633
- if ('promptTitle' in item) {
1634
- let title = 'title' in item ? item.title : '提示';
1635
- this.$confirm(item.promptTitle, title, {
1636
- center: true,
1637
- })
1638
- .then(() => {
1639
- this.postData(item.url, params);
1640
- this.$emit('btnConfirm', val, item); //抛出确认按钮,接口请求完成后
1641
- })
1642
- .catch(() => {
1643
- this.$message({
1644
- type: 'info',
1645
- message: '已取消',
1646
- });
1647
- });
1648
- } else {
1649
- this.postData(item.url, params);
1650
- }
1651
- } else {
1652
- if (item.prompt) {
1653
- //prompt 为true时表示有提示框
1654
- //当url不存在,表示不需要请求
1655
- this.$confirm(item.promptTitle, '提示', {
1656
- center: true,
1657
- })
1658
- .then(() => {
1659
- this.$emit('btnConfirm', val, item); //抛出确认按钮,接口请求完成后
1660
- })
1661
- .catch(() => {
1662
- this.$message({
1663
- type: 'info',
1664
- message: '已取消',
1665
- });
1666
- });
1667
- } else if ('url' in item && !item.url) {
1668
- //当url不传的时候
1669
- this.$message.error('url not defined');
1670
- }
1671
- }
1672
- },
1673
- postData(url, params) {
1674
- request({
1675
- url: url,
1676
- method: 'post',
1677
- data: querystring.stringify(params),
1678
- }).then((res) => {
1679
- if (res.success) {
1680
- //表示增加
1681
- this.$message({
1682
- message: '操作成功',
1683
- type: 'success',
1684
- });
1685
-
1686
- this.getDataList();
1687
- } else {
1688
- this.$message.error(res.msg);
1689
- }
1690
- });
1691
- },
1692
- radioChange(val, item) {
1693
- this.$emit('radioChange', val, item);
1694
- },
1695
- },
1696
- watch: {
1697
- temPage: {
1698
- handler() {
1699
- this.pagenation = this.temPage;
1700
- },
1701
- deep: true, //深度监听
1702
- },
1703
- dialogFormVisible(val) {
1704
- if (this.dialogFormVisible) {
1705
- this.$nextTick(function () {
1706
- this.$refs.child.clearValidate();
1707
- });
1708
- }
1709
- },
1710
- temInputPack(val) {
1711
- console.log(val, 'sss');
1712
- },
1713
- $route: function (to, form) {
1714
- //路由改变,重新请求页面
1715
- this.getDataList();
1716
- },
1717
- },
1718
- };
1719
- </script>
1720
- <style lang="scss">
1721
- .el-tabs__item:focus.is-active.is-focus:not(:active) {
1722
- -webkit-box-shadow: none !important;
1723
- box-shadow: none !important;
1724
- }
1725
-
1726
- // .template-table .el-select {
1727
- // width: 120px !important;
1728
- // }
1729
- .el-button {
1730
- height: 30px !important;
1731
- border-radius: 2px !important;
1732
- }
1733
-
1734
- .el-input__inner {
1735
- border-radius: 2px;
1736
- }
1737
-
1738
- .tem-header .el-input {
1739
- width: inherit;
1740
- }
1741
-
1742
- .tem-header li {
1743
- margin-bottom: 10px !important;
1744
- }
1745
-
1746
- .tem-header .li {
1747
- margin-bottom: 0px !important;
1748
- line-height: 0;
1749
- }
1750
-
1751
- // .tem-header .el-input .el-input__inner {
1752
- // height: 30px;
1753
- // line-height: 30px;
1754
- // padding: 0 20px 0 10px;
1755
- // width: 120px;
1756
- // font-size: 12px;
1757
- // text-overflow: ellipsis;
1758
- // white-space: nowrap;
1759
- // }
1760
- .tem-header .el-input .el-input__inner + .el-input__suffix {
1761
- right: 0px !important;
1762
- }
1763
-
1764
- .el-tabs--border-card > .el-tabs__header {
1765
- background-color: #fff !important;
1766
- border-bottom: 1px solid transparent !important;
1767
- }
1768
-
1769
- .el-table thead.has-gutter tr th {
1770
- background: #f3f4f5;
1771
- }
1772
-
1773
- .el-table .el-table__header .cell {
1774
- color: #666;
1775
- font-weight: normal;
1776
- line-height: 20px;
1777
- text-align: left !important;
1778
- }
1779
-
1780
- .el-table .el-table__body .cell {
1781
- font-size: 12px;
1782
- text-align: left !important;
1783
- }
1784
-
1785
- .el-tabs--border-card > .el-tabs__content {
1786
- padding: 0 !important;
1787
- }
1788
-
1789
- .template-box {
1790
- padding: 0 15px 20px 15px !important;
1791
- background: #fff;
1792
- }
1793
-
1794
- .template-boild-box {
1795
- // border: 1px solid #ededed !important;
1796
- box-shadow: 0 0px 0px 0 transparent, 0 0 0px 0 transparent !important;
1797
- -webkit-box-shadow: 0 0px 0px 0 transparent, 0 0 0px 0 transparent !important;
1798
- }
1799
-
1800
- .el-tabs--border-card {
1801
- border: 1px solid #ededed !important;
1802
- box-shadow: 0 0px 0px 0 transparent, 0 0 0px 0 transparent !important;
1803
- -webkit-box-shadow: 0 0px 0px 0 transparent, 0 0 0px 0 transparent !important;
1804
- }
1805
-
1806
- .el-tabs--border-card > .el-tabs__header .el-tabs__item.is-active {
1807
- border-left-color: transparent !important;
1808
- }
1809
-
1810
- .el-tabs--border-card > .el-tabs__header .el-tabs__item {
1811
- border-right: 1px solid #e0e0e0 !important;
1812
- height: 18px;
1813
- line-height: 18px;
1814
- margin: 20px 0 !important;
1815
- font-size: 16px;
1816
- }
1817
-
1818
- .el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child {
1819
- border: none !important;
1820
- }
1821
-
1822
- .tem-table-img {
1823
- width: 40px;
1824
- height: 40px;
1825
- border-radius: 2px;
1826
- margin-right: 10px;
1827
- float: left;
1828
- }
1829
-
1830
- .tem-table-img-center {
1831
- width: 40px;
1832
- height: 40px;
1833
- border-radius: 2px;
1834
- }
1835
-
1836
- .tem-img-list img {
1837
- width: 150px;
1838
- display: inline-block;
1839
- }
1840
-
1841
- .el-table td {
1842
- padding: 5px 0 !important;
1843
- }
1844
-
1845
- .tem-ul-alert li {
1846
- line-height: 30px;
1847
- }
1848
-
1849
- .tem-ul-alert li label {
1850
- float: left;
1851
- }
1852
-
1853
- .tem-span-btn button {
1854
- margin: 0;
1855
- margin-right: 10px;
1856
- }
1857
-
1858
- .el-dialog {
1859
- width: 660px;
1860
- }
1861
-
1862
- .el-upload-list--picture-card .el-upload-list__item,
1863
- .el-upload--picture-card {
1864
- width: 100px;
1865
- height: 100px;
1866
- }
1867
-
1868
- .el-upload--picture-card {
1869
- line-height: 104px;
1870
- }
1871
-
1872
- .el-form-item__content .el-loading-mask {
1873
- width: 102px;
1874
- height: 102px;
1875
- }
1876
-
1877
- .el-upload-add .el-loading-mask {
1878
- top: -36px;
1879
- right: 72px;
1880
- left: initial;
1881
- }
1882
-
1883
- .mar-t10 {
1884
- margin-top: 10px;
1885
- }
1886
-
1887
- .btn-custom-cancel {
1888
- float: right;
1889
- margin-left: 10px;
1890
- }
1891
-
1892
- .el-checkbox {
1893
- margin-left: 15px;
1894
- }
1895
-
1896
- .el-cascader-menu__item {
1897
- padding: 8px !important;
1898
- }
1899
-
1900
- .el-cascader-menu {
1901
- height: 550px !important;
1902
- min-width: 120px !important;
1903
- }
1904
-
1905
- .el-message-box {
1906
- width: 390px !important;
1907
-
1908
- &.el-message-box--center {
1909
- padding-bottom: 20px;
1910
- }
1911
-
1912
- /deep/ .el-message-box__title {
1913
- justify-content: flex-start !important;
1914
- }
1915
-
1916
- .el-message-box__content {
1917
- padding: 0;
1918
- }
1919
-
1920
- .el-message-box__message {
1921
- text-align: center;
1922
- font-size: 18px;
1923
- margin: 30px 0;
1924
- }
1925
-
1926
- .el-message-box__btns {
1927
- text-align: center;
1928
- // margin-bottom: 30px;
1929
- }
1930
- }
1931
-
1932
- // .el-message-box {
1933
- // width: 590px !important;
1934
- // .el-message-box--center {
1935
- // padding-bottom: 0px;
1936
- // }
1937
- // .el-message-box__content {
1938
- // padding: 0;
1939
- // }
1940
- // .el-message-box__message {
1941
- // text-align: center;
1942
- // font-size: 18px;
1943
- // margin: 45px 0;
1944
- // }
1945
- // .el-message-box__btns {
1946
- // text-align: center;
1947
- // margin-bottom: 30px;
1948
- // }
1949
- // }
1950
-
1951
- //组件改变
1952
- .template-table {
1953
- .el-select {
1954
- .el-select__tags-text {
1955
- display: inline-block;
1956
- max-width: 84px;
1957
- white-space: nowrap;
1958
- /*规定段落中的文本不进行换行*/
1959
- overflow: hidden;
1960
- /*内容会被修剪,并且其余内容是不可见的。*/
1961
- text-overflow: ellipsis;
1962
- /*显示省略号来代表被修剪的文本*/
1963
- }
1964
- }
1965
-
1966
- .el-select .el-tag__close.el-icon-close {
1967
- top: -6px;
1968
- }
1969
-
1970
- .el-select__tags {
1971
- white-space: nowrap;
1972
- height: 30px;
1973
- }
1974
- }
1975
- </style>
1976
- <style lang="scss" scoped>
1977
- .el-select {
1978
- /deep/ .el-icon-::before {
1979
- content: '\e6e1' !important;
1980
- }
1981
- }
1982
-
1983
- .page-count {
1984
- color: #333;
1985
- font-size: 14px;
1986
-
1987
- p {
1988
- margin-left: 20px;
1989
- }
1990
- }
1991
-
1992
- /**color**/
1993
-
1994
- .success {
1995
- color: #67c23a;
1996
-
1997
- &:focus {
1998
- color: #67c23a;
1999
- }
2000
-
2001
- &:link {
2002
- color: #67c23a;
2003
- }
2004
-
2005
- &:hover {
2006
- color: #67c23a;
2007
- }
2008
-
2009
- &:active {
2010
- color: #67c23a;
2011
- }
2012
-
2013
- &:visited {
2014
- color: #67c23a;
2015
- }
2016
- }
2017
-
2018
- .info {
2019
- color: #909399;
2020
-
2021
- &:focus {
2022
- color: #909399;
2023
- }
2024
-
2025
- &:link {
2026
- color: #909399;
2027
- }
2028
-
2029
- &:hover {
2030
- color: #909399;
2031
- }
2032
-
2033
- &:active {
2034
- color: #909399;
2035
- }
2036
-
2037
- &:visited {
2038
- color: #909399;
2039
- }
2040
- }
2041
-
2042
- .warning {
2043
- color: #e6a23c;
2044
-
2045
- &:focus {
2046
- color: #e6a23c;
2047
- }
2048
-
2049
- &:link {
2050
- color: #e6a23c;
2051
- }
2052
-
2053
- &:hover {
2054
- color: #e6a23c;
2055
- }
2056
-
2057
- &:active {
2058
- color: #e6a23c;
2059
- }
2060
-
2061
- &:visited {
2062
- color: #e6a23c;
2063
- }
2064
- }
2065
-
2066
- .danger {
2067
- color: #f56c6c;
2068
-
2069
- &:focus {
2070
- color: #f56c6c;
2071
- }
2072
-
2073
- &:link {
2074
- color: #f56c6c;
2075
- }
2076
-
2077
- color: #f56c6c;
2078
-
2079
- &:hover {
2080
- color: #f56c6c;
2081
- }
2082
-
2083
- &:active {
2084
- color: #f56c6c;
2085
- }
2086
-
2087
- &:visited {
2088
- color: #f56c6c;
2089
- }
2090
- }
2091
-
2092
- .dialogSee-ui {
2093
- padding-bottom: 30px;
2094
- }
2095
-
2096
- .dialogSee-ui li {
2097
- margin: 10px 0;
2098
- }
2099
-
2100
- .dialogSee-ui li img {
2101
- width: 200px;
2102
- }
2103
-
2104
- .dialogSee-textarea {
2105
- width: 360px;
2106
- white-space: normal;
2107
- word-break: break-all;
2108
- }
2109
-
2110
- .dialogSee-ui label {
2111
- display: block;
2112
- text-align: right;
2113
- float: left;
2114
- }
2115
-
2116
- .dialog-main {
2117
- float: left;
2118
- }
2119
-
2120
- .tem-table-span {
2121
- text-align: left;
2122
- }
2123
-
2124
- .clearfix:after {
2125
- content: '';
2126
- display: block;
2127
- clear: both;
2128
- }
2129
-
2130
- .template-table {
2131
- //margin: 10px;
2132
- overflow: auto;
2133
- }
2134
-
2135
- .tem-header {
2136
- // margin-bottom: 30px;
2137
- padding: 20px;
2138
- background: #fff;
2139
- border: 1px solid #ededed;
2140
- margin-bottom: 12px;
2141
- }
2142
-
2143
- .tem-header li {
2144
- // float: left;
2145
- display: inline-block;
2146
- margin-right: 20px;
2147
- margin-bottom: 20px;
2148
- }
2149
-
2150
- .tem-header li > div {
2151
- display: inline-block;
2152
- }
2153
-
2154
- .tem-header li label {
2155
- font-size: 14px;
2156
- color: #666;
2157
- }
2158
-
2159
- .temTablePack-title {
2160
- font-weight: normal;
2161
- font-size: 16px;
2162
- margin: 10px 0 10px;
2163
- }
2164
-
2165
- // .template-table .el-select {
2166
- // width: 140px;
2167
- // }
2168
- .el-date-editor .el-range-separator {
2169
- width: auto;
2170
- }
2171
-
2172
- .el-date-editor--daterange.el-input__inner {
2173
- width: 320px;
2174
- }
2175
-
2176
- .avatar-uploader .el-upload {
2177
- border: 1px dashed #d9d9d9;
2178
- border-radius: 6px;
2179
- cursor: pointer;
2180
- position: relative;
2181
- overflow: hidden;
2182
- }
2183
-
2184
- .avatar-uploader .el-upload:hover {
2185
- border-color: #409eff;
2186
- }
2187
-
2188
- .avatar-uploader-icon {
2189
- font-size: 28px;
2190
- color: #8c939d;
2191
- width: 100px;
2192
- height: 100px;
2193
- line-height: 100px;
2194
- text-align: center;
2195
- border: 1px dashed #c0ccda;
2196
- border-radius: 6px;
2197
- background-color: #fbfdff;
2198
- }
2199
-
2200
- .avatar {
2201
- width: 100px;
2202
- height: 100px;
2203
- display: block;
2204
- }
2205
-
2206
- .el-upload,
2207
- .el-upload img {
2208
- /* border: 1px dashed #c0ccda; */
2209
- border-radius: 6px;
2210
- }
2211
-
2212
- .page-box {
2213
- display: flex;
2214
- display: -webkit-flex;
2215
- /* Safari */
2216
- margin: 20px 0 0;
2217
- }
2218
-
2219
- .page-item {
2220
- flex-grow: 1;
2221
- /* default 0 */
2222
- }
2223
-
2224
- .selectJob {
2225
- text-align: center;
2226
- padding: 10px 0;
2227
-
2228
- span {
2229
- width: 120px;
2230
- overflow: hidden;
2231
- text-overflow: ellipsis;
2232
- white-space: nowrap;
2233
- }
2234
-
2235
- .text {
2236
- padding-left: 10px;
2237
- font-size: 14px;
2238
- font-weight: bold;
2239
- cursor: pointer;
2240
- color: cornflowerblue;
2241
- }
2242
- }
2243
- </style>
1
+ <template>
2
+ <div>
3
+ <div class="template-table">
4
+ <!--header-->
5
+ <div class="tem-header" v-if="temInputPack">
6
+ <ul class="clearfix">
7
+ <li :class="{ li: temInputPack[0].btnArray }" :key="index" v-for="(item, index) in temInputPack">
8
+ <label v-if="'label' in item && item.label">{{ item.label }}:</label>
9
+ <div v-if="'type' in item">
10
+ <div v-if="item.type === 'text'">
11
+ <el-input :placeholder="'placeholder' in item ? item.placeholder : ''" clearable :disabled="'disabled' in item && item.disabled ? item.disabled : false" v-model.trim="item.value">
12
+ </el-input>
13
+ </div>
14
+ <div v-if="item.type === 'select'">
15
+ <el-select
16
+ :filterable="'filterable' in item ? item.filterable : false"
17
+ :remote="'filterable' in item ? item.filterable : false"
18
+ :multiple="'multiple' in item ? item.multiple : false"
19
+ :placeholder="'placeholder' in item ? item.placeholder : ''"
20
+ @change="inputSelChange($event, item)"
21
+ @visible-change="getSltInfo(item, $event)"
22
+ :remote-method="remoteMethod"
23
+ @input.native="filterData($event, item)"
24
+ clearable
25
+ collapse-tags
26
+ :loading="loadings"
27
+ v-model.trim="item.value"
28
+ >
29
+ <!-- :multiple="'multiple' in item ? item.multiple : false"
30
+ :collapse-tags="'collapseTags' in item ? item.collapseTags : false"-->
31
+ <el-option
32
+ :key="'props' in item ? item2[item.props.value] : item2.value"
33
+ :label="'props' in item ? item2[item.props.label] : item2.label"
34
+ :value="'props' in item ? item2[item.props.value] : item2.value"
35
+ clearable
36
+ v-for="item2 in item.options"
37
+ v-if="'options' in item"
38
+ ></el-option>
39
+ <!-- {{item.options}} -->
40
+ <!-- {{ item.pagenation.page }}>> >>={{ item.pageCount }} -->
41
+
42
+ <div class="selectJob" v-if="item.pagenation || false">
43
+ <span @click.stop="prePage(item)" class="text" style="padding-right: 40px" v-if="item.pagenation.page > 1">上一页</span>
44
+ <span @click.stop="nextPage(item)" class="text" v-if="item.pageCount && item.pageCount > 1 && item.pagenation.page < item.pageCount">下一页</span>
45
+ </div>
46
+ </el-select>
47
+ </div>
48
+ <div v-if="item.type === 'remoteSelect'">
49
+ <temp-select :item="item" @selChange="inputSelChange"></temp-select>
50
+ </div>
51
+ <div v-if="item.type === 'date'">
52
+ <el-date-picker
53
+ :picker-options="'pickerOptions' in item ? item.pickerOptions : {}"
54
+ :placeholder="'placeholder' in item ? item.placeholder : ''"
55
+ size="small"
56
+ type="date"
57
+ v-model.trim="item.value"
58
+ value-format="yyyy-MM-dd"
59
+ ></el-date-picker>
60
+ </div>
61
+ <div @click="getOption('none', item)" v-if="item.type === 'cascader'">
62
+ <el-cascader
63
+ :collapse-tags="'collapseTags' in item ? item.collapseTags : true"
64
+ :disabled="'disabled' in item && item.disabled ? item.disabled : false"
65
+ :options="'options' in item ? item.options : []"
66
+ :placeholder="'placeholder' in item ? item.placeholder : ''"
67
+ :props="'props' in item ? item.props : {}"
68
+ :show-all-levels="'showAllLevels' in item ? item.showAllLevels : true"
69
+ change-on-select
70
+ clearable
71
+ filterable
72
+ size="small"
73
+ v-model.trim="item.value"
74
+ ></el-cascader>
75
+ </div>
76
+ <div v-if="item.type === 'daterange'">
77
+ <el-date-picker
78
+ :end-placeholder="'endPlaceholder' in item ? item.endPlaceholder || '结束时间' : '结束时间'"
79
+ :picker-options="'pickerOptions' in item ? item.pickerOptions : {}"
80
+ :range-separator="'rangeSeparator' in item ? item.rangeSeparator || '-' : '-'"
81
+ :start-placeholder="'startPlaceholder' in item ? item.startPlaceholder || '开始时间' : '开始时间'"
82
+ size="small"
83
+ type="daterange"
84
+ v-model.trim="item.value"
85
+ value-format="yyyy-MM-dd"
86
+ ></el-date-picker>
87
+ </div>
88
+ <div v-if="item.type === 'month'">
89
+               <el-date-picker
90
+ :end-placeholder="'endPlaceholder' in item ? item.endPlaceholder || '结束时间' : '结束时间'"
91
+ :picker-options="'pickerOptions' in item ? item.pickerOptions : {}"
92
+ :range-separator="'rangeSeparator' in item ? item.rangeSeparator || '-' : '-'"
93
+ :start-placeholder="'startPlaceholder' in item ? item.startPlaceholder || '开始时间' : '开始时间'"
94
+ size="small"
95
+ type="month"
96
+ v-model.trim="item.value"
97
+ value-format="yyyy-MM"
98
+ ></el-date-picker>
99
+             
100
+ </div>
101
+ <div v-if="item.type === 'datetimerange'">
102
+ <el-date-picker
103
+ :end-placeholder="'endPlaceholder' in item ? item.endPlaceholder || '结束时间' : '结束时间'"
104
+ :picker-options="'pickerOptions' in item ? item.pickerOptions : {}"
105
+ :range-separator="'rangeSeparator' in item ? item.rangeSeparator || '-' : '-'"
106
+ :start-placeholder="'startPlaceholder' in item ? item.startPlaceholder || '开始时间' : '开始时间'"
107
+ size="small"
108
+ type="datetimerange"
109
+ v-model.trim="item.value"
110
+ value-format="yyyy-MM-dd HH:mm:ss"
111
+ >
112
+ </el-date-picker>
113
+ </div>
114
+ <div v-if="item.type === 'textMore'">
115
+ <div :key="indexMore" style="display: inline-block" v-for="(itemMore, indexMore) in item.children">
116
+ <el-input :disabled="'disabled' in itemMore && itemMore.disabled ? itemMore.disabled : false" :placeholder="itemMore.placeholder" type="text" v-model="itemMore.value"></el-input>
117
+ <span v-if="indexMore % 2 == 0">~</span>
118
+ </div>
119
+ </div>
120
+ <!--input 支持搜索-->
121
+ <div v-if="item.type === 'autocomplete'">
122
+ <el-autocomplete
123
+ :fetch-suggestions="querySearchAsync"
124
+ :loadAll="(restaurants = item.restaurants)"
125
+ :placeholder="item.placeholder"
126
+ :rowkey="(rowkey = temTablePack.rowkey)"
127
+ @select="handleSelect"
128
+ v-model.trim="item.value"
129
+ ></el-autocomplete>
130
+ </div>
131
+ </div>
132
+ <!-- <div v-if="'btnArray' in item">
133
+ <el-button v-for="(itemBtn,indexBtn) in item.btnArray " :key="indexBtn" :type="itemBtn.type" v-if="itemBtn.type=='query'|| itemBtn.type=='search' " @keyup.enter="btn(itemBtn,indexBtn)" @click="btn(itemBtn,indexBtn)">{{itemBtn.label}}</el-button>
134
+ <el-button v-for="(itemBtn,indexBtn) in item.btnArray " :key="indexBtn" :type="itemBtn.type" v-if="itemBtn.type!='query'&& itemBtn.type!='search' " @click="btn(itemBtn,indexBtn)">{{itemBtn.label}}</el-button>
135
+ </div>-->
136
+ </li>
137
+ </ul>
138
+ <template v-for="item in temInputPack" v-if="'btnArray' in item">
139
+ <el-button
140
+ :key="indexBtn"
141
+ :type="itemBtn.type || 'primary'"
142
+ @click="btn(itemBtn, indexBtn)"
143
+ v-for="(itemBtn, indexBtn) in item.btnArray"
144
+ v-if="itemBtn.type == 'query' || itemBtn.type == 'search'"
145
+ >
146
+ {{ itemBtn.label }}</el-button
147
+ >
148
+ <el-button
149
+ :disabled="'disabled' in itemBtn && itemBtn.disabled ? itemBtn.disabled : false"
150
+ :key="indexBtn"
151
+ :type="itemBtn.type || ''"
152
+ @click="btn(itemBtn, indexBtn)"
153
+ v-for="(itemBtn, indexBtn) in item.btnArray"
154
+ v-if="itemBtn.type != 'query' && itemBtn.type != 'search'"
155
+ >{{ itemBtn.label }}</el-button
156
+ >
157
+ <div class="page-count flex justify-content--flex-end" v-if="subtotal">
158
+ <p :key="index" v-for="(item, index) in subtotal">{{ item.label }}{{ item.beforeUnit }}{{ item.value }}{{ item.afterUnit }}</p>
159
+ </div>
160
+ </template>
161
+ </div>
162
+ <!--tab-->
163
+ <el-row v-if="temTab && 'tabPane' in temTab">
164
+ <el-col :span="24">
165
+ <el-tabs @tab-click="handleClickTab" type="border-card" v-model="activeName">
166
+ <el-tab-pane :key="index" :label="item.label" v-for="(item, index) in temTab.tabPane"></el-tab-pane>
167
+ </el-tabs>
168
+ <!--main table-->
169
+ <!-- {{activeName}} -->
170
+ <div class="template-box" v-for="(item, index) in temTab.tabPane" v-if="activeName == index">
171
+ <div class="tem-main" v-if="temTablePack">
172
+ <h3 class="temTablePack-title" v-if="'title' in temTablePack ? temTablePack.title : ''">{{ temTablePack.title }}:</h3>
173
+ <el-table
174
+ :data="tableData"
175
+ :empty-text="'emptyText' in temTablePack ? temTablePack.emptyText : '暂无数据'"
176
+ :row-key="row_Key"
177
+ :rowKey="(rowKey = temTablePack.rowKey ? temTablePack.rowKey : '')"
178
+ @select="handleSelectionChange"
179
+ @select-all="handleSelectionChange"
180
+ @toggleSelection="toggleSelection"
181
+ ref="multipleTable"
182
+ style="width: 100%"
183
+ v-loading="loading"
184
+ stripe
185
+ :height="'tabHeight' in temTablePack ? temTablePack.tabHeight : false"
186
+ >
187
+ <el-table-column
188
+ :reserve-selection="temTablePack.reserve_selection ? true : false"
189
+ type="selection"
190
+ v-if="'selection' in temTablePack ? temTablePack.selection.state : false"
191
+ width="40"
192
+ ></el-table-column>
193
+ <el-table-column
194
+ :align="'align' in item ? item.align : ''"
195
+ :key="index"
196
+ :label="'label' in item ? item.label : ''"
197
+ :min-width="'minWidth' in item ? item.minWidth : ''"
198
+ :prop="'prop' in item ? item.prop : ''"
199
+ :width="'width' in item ? item.width : 'auto'"
200
+ v-for="(item, index) in temTablePack.tableHead"
201
+ :fixed="'fixed' in item ? item.fixed : false"
202
+ :show-overflow-tooltip="'overflow' in item ? item.overflow : false"
203
+ >
204
+ <template slot-scope="scope">
205
+ <template-table-content :item="item" :scope="scope" @changeGetData="getDataList"> </template-table-content>
206
+ </template>
207
+ </el-table-column>
208
+ <el-table-column
209
+ :width="'tabBtnWidth' in temTablePack ? temTablePack.tabBtnWidth : '180'"
210
+ label="操作"
211
+ :fixed="'fixed' in temTablePack ? temTablePack.fixed : false"
212
+ v-if="'tabBtnState' in temTablePack ? temTablePack.tabBtnState : true"
213
+ >
214
+ <template slot-scope="scope">
215
+ <!--四个以内的按钮是这么显示-->
216
+ <span :key="index" class="tem-span-btn" style="display: inline-block" v-for="(item, index) in temTablePack.tableBtn">
217
+ <template v-if="'renderTemp' in item">
218
+ <child :item="item" :para="scope.row" :temp="item.renderTemp"></child>
219
+ </template>
220
+ <template v-else>
221
+ <span style="display: inline-block" v-if="'dropdown' in item && item.dropdown">
222
+ <!--dropdown 为false 表示不需要折叠-->
223
+ <!-- v-if="dropdownState(scope.row.dataState,item.dropdowMenu)" -->
224
+ <el-dropdown @command="handleClick($event, scope, index)" @click.native="open($event, scope, index)">
225
+ <el-button class="el-dropdown-link" size="text">
226
+ 处理
227
+ <i class="el-icon-arrow-down el-icon--right"></i>
228
+ </el-button>
229
+ <el-dropdown-menu slot="dropdown">
230
+ <el-dropdown-item
231
+ :command="dropdowItem"
232
+ :key="(dropdowIndexObj[scope.$index] = dropdowIndex)"
233
+ v-for="(dropdowItem, dropdowIndex) in item.dropdowMenu"
234
+ v-if="('dataState' in dropdowItem && dropdowItem.dataState.split(',').includes(scope.row.dataState.toString())) || ('state' in dropdowItem && dropdowItem.state)"
235
+ >
236
+ {{ dropdowItem.label }}</el-dropdown-item
237
+ >
238
+ </el-dropdown-menu>
239
+ </el-dropdown>
240
+ </span>
241
+ <span style="display: inline-block" v-else>
242
+ <template v-if="'dataState' in item && item.dataState == null">
243
+ <template v-if="'reverse' in item && item.reverse">
244
+ <el-button
245
+ :class="'type' in item && item.type ? item.type : 'primary'"
246
+ @click="handleClick(item, scope, index)"
247
+ size="small"
248
+ type="text"
249
+ v-if="item.props && scope.row[item.props['dataState']] != null"
250
+ >{{ item.label }}
251
+ </el-button>
252
+ </template>
253
+ <template v-else>
254
+ <el-button
255
+ :class="'type' in item && item.type ? item.type : 'primary'"
256
+ @click="handleClick(item, scope, index)"
257
+ size="small"
258
+ type="text"
259
+ v-if="item.props && scope.row[item.props['dataState']] == null"
260
+ >{{ item.label }}
261
+ </el-button>
262
+ </template>
263
+ </template>
264
+ <template v-if="'otherState' in item && item.otherState">
265
+ <!-- {{scope.row[item.props['dataState']]}}
266
+ {{item[item.props['dataState']]}}-->
267
+ <el-button
268
+ :class="'type' in item && item.type ? item.type : 'primary'"
269
+ @click="handleClick(item, scope, index)"
270
+ size="small"
271
+ type="text"
272
+ v-if="'dataState' in item && 'props' in item && scope.row.dataState == item.dataState && scope.row[item.props['dataState']] == item[item.props['dataState']]"
273
+ >
274
+ {{ item.label }}</el-button
275
+ >
276
+ <el-button
277
+ :class="'type' in item && item.type ? item.type : 'primary'"
278
+ @click="handleClick(item, scope, index)"
279
+ size="small"
280
+ type="text"
281
+ v-else-if="!item.dataState && item.props && scope.row[item.props['dataState']] == item[item.props['dataState']]"
282
+ >
283
+ {{ item.label }}</el-button
284
+ >
285
+ </template>
286
+ <template v-else>
287
+ <!--万恶的后台接口,数据==null 显示-->
288
+ <!-- {{dataState}} -->
289
+ <!-- <el-button v-if="'dataState' in item && 'props' in item && scope.row[item.props['dataState']] == item.dataState" :class="'type' in item && item.type ? item.type : 'primary'" @click="handleClick(item,scope,index)" type="text" size="small">{{item.label}}</el-button> -->
290
+ <el-button
291
+ :class="'type' in item && item.type ? item.type : 'primary'"
292
+ @click="handleClick(item, scope, index)"
293
+ size="small"
294
+ type="text"
295
+ v-if="'dataState' in item && 'props' in item && String(item.dataState).split(',').includes(scope.row[item.props['dataState']].toString())"
296
+ >
297
+ {{ item.label }}</el-button
298
+ >
299
+ <el-button
300
+ :class="'type' in item && item.type ? item.type : 'primary'"
301
+ @click="handleClick(item, scope, index)"
302
+ size="small"
303
+ type="text"
304
+ v-else-if="'dataState' in item && scope.row.dataState == item.dataState && !item.props"
305
+ >
306
+ {{ item.label }}</el-button
307
+ >
308
+ <el-button :class="'type' in item && item.type ? item.type : 'primary'" @click="handleClick(item, scope, index)" size="small" type="text" v-else-if="item.state">{{
309
+ item.label
310
+ }}</el-button>
311
+ </template>
312
+ </span>
313
+ </template>
314
+ </span>
315
+ </template>
316
+ </el-table-column>
317
+ </el-table>
318
+ </div>
319
+
320
+ <div class="page-box">
321
+ <!-- 按钮部分 -->
322
+ <div v-if="'tablePageBtn' in temTablePack">
323
+ <el-button :key="indexBtn" :type="itemBtn.type" @click="btn(itemBtn, indexBtn)" v-for="(itemBtn, indexBtn) in temTablePack.tablePageBtn">{{ itemBtn.label }}</el-button>
324
+ </div>
325
+ <div class="page-item" v-if="'tabpageState' in temTablePack ? temTablePack.tabpageState : true">
326
+ <!--page-->
327
+ <div class="tem-page" v-if="pagenation && pagenation.total">
328
+ <!-- 'currentPage' in pagenation ? pagenation.currentPage : 1 -->
329
+ <!-- 'pageSize' in pagenation && pagenation.pageSize ? pagenation.pageSize : 10 -->
330
+ <el-pagination
331
+ :current-page="data.page"
332
+ :page-size="data.rows"
333
+ :page-sizes="'pageSizes' in pagenation && pagenation.pageSizes ? pagenation.pageSizes : [10, 20, 50, 100]"
334
+ :pager-count="5"
335
+ :total="'total' in pagenation ? pagenation.total : 1"
336
+ @current-change="currentChange"
337
+ @size-change="sizeChange"
338
+ layout="total, sizes, prev, pager, next, jumper"
339
+ ></el-pagination>
340
+ </div>
341
+ </div>
342
+ </div>
343
+ </div>
344
+ </el-col>
345
+ </el-row>
346
+
347
+ <div v-else>
348
+ <div class="template-box template-boild-box">
349
+ <!--main table-->
350
+ <div class="tem-main" v-if="temTablePack">
351
+ <h3 class="temTablePack-title" v-if="'title' in temTablePack ? temTablePack.title : ''">{{ temTablePack.title }}:</h3>
352
+ <el-table
353
+ :data="tableData"
354
+ :empty-text="'emptyText' in temTablePack ? temTablePack.emptyText : '暂无数据'"
355
+ :row-key="row_Key"
356
+ :rowKey="(rowKey = temTablePack.rowKey ? temTablePack.rowKey : '')"
357
+ @select="handleSelectionChange"
358
+ @select-all="handleSelectionChange"
359
+ @toggleSelection="toggleSelection"
360
+ ref="multipleTable"
361
+ style="width: 100%"
362
+ v-loading="loading"
363
+ stripe
364
+ :height="'tabHeight' in temTablePack ? temTablePack.tabHeight : false"
365
+ >
366
+ <el-table-column
367
+ :reserve-selection="temTablePack.reserve_selection ? true : false"
368
+ type="selection"
369
+ v-if="'selection' in temTablePack ? temTablePack.selection.state : false"
370
+ width="40"
371
+ ></el-table-column>
372
+ <el-table-column
373
+ :align="'align' in item ? item.align : ''"
374
+ :key="index"
375
+ :label="'label' in item ? item.label : ''"
376
+ :min-width="'minWidth' in item ? item.minWidth : ''"
377
+ :prop="'prop' in item ? item.prop : ''"
378
+ :width="'width' in item ? item.width : 'auto'"
379
+ v-for="(item, index) in temTablePack.tableHead"
380
+ :fixed="'fixed' in item ? item.fixed : false"
381
+ :show-overflow-tooltip="'overflow' in item ? item.overflow : false"
382
+ >
383
+ <!-- min-width 产品后期要最小宽度,开发以改了部分,以无法修改,width 代替min-width -->
384
+ <template slot-scope="scope">
385
+ <template-table-content :item="item" :scope="scope" @changeGetData="getDataList"> </template-table-content>
386
+ </template>
387
+ </el-table-column>
388
+ <el-table-column
389
+ :width="'tabBtnWidth' in temTablePack ? temTablePack.tabBtnWidth : '180'"
390
+ label="操作"
391
+ :fixed="'fixed' in temTablePack ? temTablePack.fixed : false"
392
+ v-if="'tabBtnState' in temTablePack ? temTablePack.tabBtnState : true"
393
+ >
394
+ <template slot-scope="scope">
395
+ <!--四个以内的按钮是这么显示-->
396
+
397
+ <span :key="index" class="tem-span-btn" style="display: inline-block" v-for="(item, index) in temTablePack.tableBtn">
398
+ <template v-if="'renderTemp' in item">
399
+ <child :item="item" :para="scope.row" :temp="item.renderTemp"></child>
400
+ </template>
401
+ <template v-else>
402
+ <span style="display: inline-block" v-if="'dropdown' in item && item.dropdown">
403
+ <!--dropdown 为false 表示不需要折叠-->
404
+ <!-- v-if="dropdownState(scope.row.dataState,item.dropdowMenu)" -->
405
+ <el-dropdown @command="handleClick($event, scope, index)">
406
+ <el-button class="el-dropdown-link" size="text">
407
+ 处理
408
+ <i class="el-icon-arrow-down el-icon--right"></i>
409
+ </el-button>
410
+ <el-dropdown-menu slot="dropdown">
411
+ <el-dropdown-item
412
+ :command="dropdowItem"
413
+ :key="(dropdowIndex = dropdowIndex)"
414
+ v-for="(dropdowItem, dropdowIndex) in item.dropdowMenu"
415
+ v-if="('dataState' in dropdowItem && dropdowItem.dataState.split(',').includes(scope.row.dataState.toString())) || ('state' in dropdowItem && dropdowItem.state)"
416
+ >
417
+ {{ dropdowItem.label }}</el-dropdown-item
418
+ >
419
+ </el-dropdown-menu>
420
+ </el-dropdown>
421
+ </span>
422
+
423
+ <span style="display: inline-block" v-else>
424
+ <template v-if="'dataState' in item && item.dataState == null">
425
+ <template v-if="'reverse' in item && item.reverse">
426
+ <el-button
427
+ :class="'type' in item && item.type ? item.type : 'primary'"
428
+ @click="handleClick(item, scope, index)"
429
+ size="small"
430
+ type="text"
431
+ v-if="'reverse' in item && item.props && scope.row[item.props['dataState']] != null"
432
+ >
433
+ {{ item.label }}</el-button
434
+ >
435
+ </template>
436
+ <template v-else>
437
+ <el-button
438
+ :class="'type' in item && item.type ? item.type : 'primary'"
439
+ @click="handleClick(item, scope, index)"
440
+ size="small"
441
+ type="text"
442
+ v-if="item.props && scope.row[item.props['dataState']] == null"
443
+ >{{ item.label }}
444
+ </el-button>
445
+ </template>
446
+ </template>
447
+ <template v-if="'otherState' in item && item.otherState">
448
+ <!-- {{scope.row[item.props['dataState']]}}
449
+ {{item[item.props['dataState']]}}-->
450
+ <el-button
451
+ :class="'type' in item && item.type ? item.type : 'primary'"
452
+ @click="handleClick(item, scope, index)"
453
+ size="small"
454
+ type="text"
455
+ v-if="'dataState' in item && 'props' in item && scope.row.dataState == item.dataState && scope.row[item.props['dataState']] == item[item.props['dataState']]"
456
+ >
457
+ {{ item.label }}</el-button
458
+ >
459
+ <el-button
460
+ :class="'type' in item && item.type ? item.type : 'primary'"
461
+ @click="handleClick(item, scope, index)"
462
+ size="small"
463
+ type="text"
464
+ v-else-if="!item.dataState && item.props && scope.row[item.props['dataState']] == item[item.props['dataState']]"
465
+ >
466
+ {{ item.label }}</el-button
467
+ >
468
+ </template>
469
+
470
+ <template v-else>
471
+ <!--万恶的后台接口,数据==null 显示-->
472
+ <!-- <el-button v-if="'dataState' in item && 'props' in item && scope.row[item.props['dataState']] == item.dataState" :class="'type' in item && item.type ? item.type : 'primary'" @click="handleClick(item,scope,index)" type="text" size="small">{{item.label}}</el-button> -->
473
+ <el-button
474
+ :class="'type' in item && item.type ? item.type : 'primary'"
475
+ @click="handleClick(item, scope, index)"
476
+ size="small"
477
+ type="text"
478
+ v-if="
479
+ 'dataState' in item &&
480
+ 'props' in item &&
481
+ (scope.row[item.props['dataState']] || scope.row[item.props['dataState']] == 0) &&
482
+ String(item.dataState).split(',').includes(scope.row[item.props['dataState']].toString())
483
+ "
484
+ >{{ item.label }}</el-button
485
+ >
486
+ <el-button
487
+ :class="'type' in item && item.type ? item.type : 'primary'"
488
+ @click="handleClick(item, scope, index)"
489
+ size="small"
490
+ type="text"
491
+ v-else-if="'dataState' in item && scope.row.dataState == item.dataState && !item.props"
492
+ >
493
+ {{ item.label }}</el-button
494
+ >
495
+ <el-button :class="'type' in item && item.type ? item.type : 'primary'" @click="handleClick(item, scope, index)" size="small" type="text" v-else-if="item.state">{{
496
+ item.label
497
+ }}</el-button>
498
+ </template>
499
+ </span>
500
+ </template>
501
+ </span>
502
+ </template>
503
+ </el-table-column>
504
+ </el-table>
505
+ </div>
506
+
507
+ <div class="page-box" v-if="temTablePack">
508
+ <!-- 按钮部分 -->
509
+ <div v-if="'tablePageBtn' in temTablePack">
510
+ <el-button :key="indexBtn" :type="itemBtn.type" @click="btn(itemBtn, indexBtn)" v-for="(itemBtn, indexBtn) in temTablePack.tablePageBtn">{{ itemBtn.label }}</el-button>
511
+ </div>
512
+ <div class="page-item" v-if="'tabpageState' in temTablePack ? temTablePack.tabpageState : true">
513
+ <!--page-->
514
+ <div class="tem-page" v-if="pagenation && pagenation.total">
515
+ <!-- 'currentPage' in pagenation ? pagenation.currentPage : 1 -->
516
+ <!-- 'pageSize' in pagenation && pagenation.pageSize ? pagenation.pageSize : 10 -->
517
+ <el-pagination
518
+ :current-page="data.page"
519
+ :layout="temLayout"
520
+ :page-size="data.rows"
521
+ :page-sizes="'pageSizes' in pagenation && pagenation.pageSizes ? pagenation.pageSizes : [10, 20, 50, 100]"
522
+ :pager-count="5"
523
+ :total="'total' in pagenation ? pagenation.total : 1"
524
+ @current-change="currentChange"
525
+ @size-change="sizeChange"
526
+ ></el-pagination>
527
+ </div>
528
+ </div>
529
+ </div>
530
+ <!-- count -->
531
+ <!-- <div class="page-count flex justify-content--flex-end" v-if="count">
532
+ <p
533
+ v-for="(item,index) in count"
534
+ :key="index"
535
+ >{{item.label}}{{item.beforeUnit}}{{item.value}}{{item.afterUnit}}</p>
536
+ </div>-->
537
+ </div>
538
+ </div>
539
+
540
+ <!--编辑-->
541
+ <el-dialog
542
+ :title="'title' in dialogData.template ? dialogData.template.title : ''"
543
+ :visible.sync="dialogFormVisible"
544
+ @close="dialogClose"
545
+ append-to-body
546
+ :width="'width' in dialogData.template ? dialogData.template.width : '660px'"
547
+ v-if="dialogData && dialogData.template"
548
+ >
549
+ <template-input
550
+ :labelWidth="dialogData.template.labelWidth"
551
+ :rules="dialogData.template.rules"
552
+ :temInput="dialogData.template.html"
553
+ @cancel="dialogCancel"
554
+ @getData="getDataList"
555
+ @handleSelect="handleSelect"
556
+ @inputBlur="inputBlur"
557
+ @inputBtnClick="inputBtnClick"
558
+ @radioChange="radioChange"
559
+ @selChange="selChange"
560
+ ref="child"
561
+ ></template-input>
562
+ </el-dialog>
563
+ <!--查看-->
564
+ <el-dialog
565
+ :title="dialogDataSee && 'title' in dialogDataSee ? dialogDataSee.title : ''"
566
+ :visible.sync="dialogFormVisibleSee"
567
+ append-to-body
568
+ :width="dialogDataSee && 'width' in dialogDataSee ? dialogDataSee.width : '660px'"
569
+ v-if="JSON.stringify(dialogDataSee) != '{}'"
570
+ >
571
+ <ul class="dialogSee-ui">
572
+ <li :key="index" class="clearfix" v-for="(item, index) in dialogDataSee.html">
573
+ <div v-if="'state' in item">
574
+ <div v-if="item.state == item.stateValue">
575
+ <label :style="{ width: 'labelWidth' in dialogDataSee ? dialogDataSee.labelWidth + 'px' : 'auto' }" v-if="'label' in item">{{ item.label }}:</label>
576
+ <div class="dialog-main" v-if="'type' in item">
577
+ <p v-if="item.type === 'text'">
578
+ {{ 'template' in item && item.template === 'format' ? parseTime(item.value) : item.value }}
579
+ </p>
580
+ <!--表示文本框-->
581
+ <p v-if="item.type === 'select'">{{ item.template[item.value] }}</p>
582
+ <img :src="item.value" v-if="item.type === 'img'" />
583
+ <p class="dialogSee-textarea" v-if="item.type === 'textarea'">{{ item.value }}</p>
584
+ </div>
585
+ </div>
586
+ </div>
587
+ <div v-else>
588
+ <label :style="{ width: 'labelWidth' in dialogDataSee ? dialogDataSee.labelWidth + 'px' : 'auto' }" v-if="'label' in item">{{ item.label }}:</label>
589
+ <div class="dialog-main" v-if="'type' in item">
590
+ <p v-if="item.type === 'text'">
591
+ {{ 'template' in item && item.template === 'format' ? parseTime(item.value) : item.value }}
592
+ </p>
593
+ <!--表示文本框-->
594
+ <p v-if="item.type === 'select'">{{ item.template[item.value] }}</p>
595
+ <img :src="item.value" v-if="item.type === 'img'" />
596
+
597
+ <p class="dialogSee-textarea" v-if="item.type === 'textarea'">{{ item.value }}</p>
598
+ </div>
599
+ </div>
600
+ <el-button :key="indexBtn" :type="itemBtn.type" @click="reviewClick(itemBtn, dialogDataSee.html)" v-for="(itemBtn, indexBtn) in item.btnArray" v-if="'btnArray' in item">{{
601
+ itemBtn.label
602
+ }}</el-button>
603
+ </li>
604
+ </ul>
605
+ </el-dialog>
606
+ </div>
607
+ </div>
608
+ </template>
609
+ <script>
610
+ import request from '#/utils/request';
611
+ import templateTableContent from './templateUi/templateTableContent';
612
+ import tempSelect from './components/temp-select';
613
+ import templateInput from './templateInput';
614
+ const querystring = require('querystring');
615
+ import { isUndefined } from 'lodash';
616
+ import { parseTime } from '#/utils/index'; //时间格式化
617
+ export default {
618
+ props: ['temInput', 'params', 'temTable', 'temPage', 'temTab', 'url', 'temPageLayout', 'subtotal'],
619
+ computed: {
620
+ temInputPack() {
621
+ if (!this.temInput) {
622
+ return this.temInput;
623
+ }
624
+ if (isUndefined(this.$route.meta.btnRules)) {
625
+ return this.temInput;
626
+ }
627
+ const index = this.temInput.findIndex((item) => Array.isArray(item.btnArray));
628
+ if (index === -1) {
629
+ return this.temInput;
630
+ }
631
+
632
+ let inputData = this.temInput;
633
+ const result = inputData[index];
634
+ result.btnArray = result.btnArray.filter((item1) => {
635
+ if (item1.menuCode) {
636
+ return this.$route.meta.btnRules.some((items) => items.menuCode == item1.menuCode);
637
+ } else {
638
+ return this.$route.meta.btnRules.some((items) => items.menuName == item1.label);
639
+ }
640
+ });
641
+ return inputData;
642
+ },
643
+ temTablePack() {
644
+ if (!this.temTable) {
645
+ return this.temTable;
646
+ }
647
+ if (isUndefined(this.$route.meta.btnRules)) {
648
+ return this.temTable;
649
+ }
650
+ if (!Array.isArray(this.temTable['tableBtn'])) {
651
+ return this.temTable;
652
+ }
653
+
654
+ let tabBtnData = this.temTable;
655
+
656
+ tabBtnData['tableBtn'] = tabBtnData['tableBtn'].filter((item1) => {
657
+ if (item1.menuCode) {
658
+ return this.$route.meta.btnRules.some((items) => items.menuCode == item1.menuCode);
659
+ } else {
660
+ return this.$route.meta.btnRules.some((items) => items.menuName == item1.label);
661
+ }
662
+ });
663
+ return tabBtnData;
664
+ },
665
+ },
666
+ components: {
667
+ tempSelect,
668
+ 'template-table-content': templateTableContent,
669
+ 'template-input': templateInput,
670
+ child: {
671
+ functional: true,
672
+ render: (h, context) => {
673
+ let temp = context.props.temp;
674
+ let para = context.props.para;
675
+ let item = context.props.item;
676
+ return temp(h, para, item);
677
+ },
678
+ props: {
679
+ temp: {
680
+ type: Function,
681
+ required: true,
682
+ },
683
+ para: {
684
+ type: Object,
685
+ required: true,
686
+ },
687
+ item: {
688
+ type: Object,
689
+ required: true,
690
+ },
691
+ },
692
+ },
693
+ },
694
+ data() {
695
+ return {
696
+ rowKey: '',
697
+ row_Key: 'row[this.rowKey]',
698
+ temLayout: 'total, sizes, prev, pager, next, jumper',
699
+ pagenation: null,
700
+ data: {
701
+ rows: 10,
702
+ page: 1,
703
+ },
704
+ sltPage: 1,
705
+ sltItem: {},
706
+ pageCount: null,
707
+ restaurants: null, //搜索的数据
708
+ searchUrl: '',
709
+ parseTime,
710
+ loading: false,
711
+ loadings: false,
712
+ dialogFormVisible: false, //dialog编辑是否显示
713
+ dialogFormVisibleSee: false, //dialog查看是否显示
714
+ dialogData: {},
715
+ dialogDataSee: {},
716
+ formLabelWidth: '9rem', //长度根据标题长度来,一个字一个rem
717
+ activeName: '0',
718
+ tableData: [],
719
+ ruleForm: {}, //编辑from
720
+ limit: null, //限制图片上传的数量
721
+ uploadUrl: '/web/rs/goodsFile/uploadGoodsFile.json', //图片上传的默认url
722
+ imageUrl: '', //单个图片的imgurl,
723
+ uploadImgValue: [], //上传图片url
724
+ showFileList: null,
725
+ uploadName: null, //上传图片name
726
+ imgLoading: false,
727
+ btnState: null, //1表示增加,2表示编辑
728
+ imgIndex: null,
729
+ iptSltname: '', //table内容
730
+ dropdowIndexObj: {},
731
+ flag: 0,
732
+ inputHtmlReset: null, //初始化数据
733
+ clickState: true, //防止多次重复点击
734
+ };
735
+ },
736
+ // beforeCreate() {
737
+ // this.dialogData
738
+ // },
739
+ mounted() {
740
+ // console.log(this.temInputPack, "ddd");
741
+ // 在template-table上新增加绑定一个temPageLayout,值是字符串,不传默认是'total, sizes, prev, pager, next, jumper',
742
+ // 根据需要添加或者减少
743
+ if (localStorage.getItem('currenPage')) {
744
+ this.data.page = localStorage.getItem('currenPage');
745
+ this.getDataList();
746
+ }
747
+ if (this.temPageLayout) {
748
+ this.temLayout = this.temPageLayout;
749
+ }
750
+
751
+ this.temPage
752
+ ? (this.pagenation = this.temPage)
753
+ : this.temPage === false
754
+ ? (this.pagenation = false)
755
+ : (this.pagenation = {
756
+ currentPage: 1,
757
+ pageSizes: [10, 20, 50, 100],
758
+ pageSize: 10,
759
+ total: 1,
760
+ });
761
+ if (this.temPage && 'pageSize' in this.temPage) {
762
+ this.data.rows = this.temPage.pageSize;
763
+ }
764
+ //查询商家列表
765
+ this.getDataList();
766
+ },
767
+ methods: {
768
+ open(item, val, index) {
769
+ console.log('2222++++++++++', item, val, index);
770
+ if (val.row.dataState == -1 || val.row.dataState == 4) {
771
+ this.$message.warning('暂无操作');
772
+ return;
773
+ }
774
+ },
775
+ btn(itemBtn, index) {
776
+ console.log(itemBtn, index, '+++++++++++++++++++++++++++++');
777
+ if (itemBtn.id === 'query' || itemBtn.id === 'search') {
778
+ //表示查询
779
+ this.data.page = 1;
780
+ this.searchUrl = 'url' in itemBtn && itemBtn.url ? itemBtn.url : '';
781
+ console.log(this.searchUrl, 'this.searchUrl222222222222222222222++++++++++++++++++++++++++++++++++');
782
+ this.getDataList(this.searchUrl);
783
+ } else if (itemBtn.id === 'add') {
784
+ itemBtn.template.html.forEach((el) => {
785
+ this.$set(this.ruleForm, el.name, el.value);
786
+ });
787
+ // 给add 抛出一个方法
788
+ this.$emit('inputBtnClickAdd', itemBtn, index);
789
+ // this.$emit("editClick", val.row, index);
790
+ this.dialogData = itemBtn;
791
+ this.dialogFormVisible = true;
792
+ this.btnState = 1; //表示增加
793
+ } else if (itemBtn.id === 'accurateQuery') {
794
+ this.searchUrl = 'url' in itemBtn && itemBtn.url ? itemBtn.url : '';
795
+ this.getDataList(this.searchUrl, itemBtn.id);
796
+ } else if (itemBtn.id == 'exImportData') {
797
+ this.searchUrl = 'url' in itemBtn && itemBtn.url ? itemBtn.url : '';
798
+ let jump = 'jumpUrl' in itemBtn && itemBtn.jumpUrl ? itemBtn.jumpUrl : '';
799
+ this.importData(this.searchUrl, itemBtn.id, jump);
800
+ } else {
801
+ this.$emit('inputBtnClick', itemBtn, index);
802
+ }
803
+ // this.$emit("inputBtnClick", itemBtn, index);
804
+ },
805
+ inputBtnClick(itemBtn, indexBtn) {
806
+ //input子组件传递的通用事件
807
+ this.$emit('inputBtnClick', itemBtn, indexBtn);
808
+ },
809
+
810
+ dialogClose() {
811
+ // console.log(this.$refs.child);
812
+ this.$refs.child.setReset();
813
+ this.dialogFormVisible = false;
814
+ // console.log("close");
815
+ },
816
+ reviewClick(itemBtn, item) {
817
+ if (itemBtn.id == 'review') {
818
+ //表示确定
819
+ this.setData(itemBtn.url, itemBtn, item);
820
+ }
821
+ },
822
+ inputBlur(item) {
823
+ this.$emit('inputBlur', item);
824
+ },
825
+ setData(url, btnarr, item) {
826
+ if (url) {
827
+ let data = {};
828
+ btnarr.params.forEach((res) => {
829
+ if (res.value) {
830
+ data[res.name] = res.value;
831
+ } else {
832
+ data[res.name] = item[res.index].value;
833
+ }
834
+ });
835
+ //编辑请求接口
836
+ request({
837
+ url: url,
838
+ method: 'post',
839
+ data: querystring.stringify(data),
840
+ }).then((res) => {
841
+ if (res.success) {
842
+ this.$message({
843
+ message: res.msg,
844
+ type: 'success',
845
+ });
846
+ this.getDataList();
847
+ this.dialogFormVisibleSee = false;
848
+ } else {
849
+ this.$message.error(res.msg);
850
+ }
851
+ });
852
+ }
853
+ },
854
+ getOption(e, item) {
855
+ console.log(item, 'item');
856
+ if (item.url && !item.state) {
857
+ request({
858
+ url: item.url,
859
+ method: 'get',
860
+ }).then((res) => {
861
+ item.options = res;
862
+ item.state = true;
863
+ });
864
+ }
865
+ },
866
+ prePage(item) {
867
+ // console.log(item,'item2')
868
+ --item.pagenation.page;
869
+ // this.sltPage = item.pagenation.page;
870
+
871
+ if (item.pagenation.page < 1) {
872
+ // 判断点击的页数是否小于1
873
+ this.$message.error('已到第一页');
874
+ item.pagenation.page = 1;
875
+ return;
876
+ }
877
+ item.state = false;
878
+ this.getSltInfo(item, true);
879
+ },
880
+ nextPage(item) {
881
+ // console.log(item,'item1')
882
+ // console.log(this.pageCount,'this.pageCount')
883
+ if (item.pagenation.page < item.pageCount) {
884
+ // 判断点击的页数是否小于总页数;
885
+ ++item.pagenation.page;
886
+ // this.sltPage = item.pagenation.page;
887
+ item.state = false;
888
+ this.getSltInfo(item, true);
889
+ } else {
890
+ this.$message.error('已到最后一页');
891
+ }
892
+ },
893
+ remoteMethod(data) {
894
+ this.sltItem.pagenation.page = 1;
895
+ this.sltItem.state = false;
896
+ this.loadings = true;
897
+ this.sltItem.pageCount = '';
898
+ this.iptSltname = data;
899
+
900
+ // let item=JSON.parse(JSON.stringify(this.sltItem));
901
+ console.log(this.iptSltname, 'item');
902
+ this.getSltInfo(this.sltItem, true);
903
+ },
904
+ filterData(data, item) {},
905
+ getSltInfo(item, flag) {
906
+ this.sltItem = item;
907
+ console.log(item, this.iptSltname, 'item');
908
+ // this.sltItem=JSON.parse(JSON.stringify(item));
909
+ if (item.url && !item.state) {
910
+ let json = {
911
+ rows: (item.pagenation && item.pagenation.rows) || null,
912
+ page: (item.pagenation && item.pagenation.page) || null,
913
+ };
914
+ if (!item.pagenation) {
915
+ delete json.page;
916
+ delete json.rows;
917
+ }
918
+ if (item.props.label && this.iptSltname) {
919
+ json[item.props.label] = this.iptSltname;
920
+ } else {
921
+ delete json[item.props.label];
922
+ }
923
+ request({
924
+ url: item.url,
925
+ method: 'post',
926
+ data: json,
927
+ }).then((res) => {
928
+ item.pageCount = item.pagenation && item.pagenation.rows ? Math.ceil(res.total / item.pagenation.rows) : 1;
929
+ if (res) {
930
+ if (Array.isArray(res)) {
931
+ item.options = res;
932
+ } else {
933
+ item.options = res.list;
934
+ }
935
+ }
936
+ this.loadings = false;
937
+ item.state = true;
938
+ });
939
+ }
940
+ },
941
+ handleClick(item, val, index) {
942
+ console.log('xialacaozuo++++++++++++++++');
943
+ // console.log(item);
944
+ //index表示btn的位置
945
+ let id = item.id;
946
+ if (id === 'see') {
947
+ // console.log(,"item")
948
+
949
+ this.seeDetails(item, val, index);
950
+ } else if (id === 'edit') {
951
+ item.template.html.forEach((el) => {
952
+ if (el.name in val.row) {
953
+ //判断属性是否存在
954
+ if (el.type === 'cascader') {
955
+ el.value = val.row[el.name] ? [...val.row[el.name]] : '';
956
+ } else {
957
+ el.value = val.row[el.name];
958
+ }
959
+ }
960
+
961
+ // 没有值时,保留原有的值,不作处理
962
+ // else {
963
+ // el.value = ""; //没有值的时候,为空
964
+ // }
965
+ });
966
+ this.dialogData = item;
967
+ this.dialogFormVisible = true;
968
+ this.btnState = 2; //表示编辑
969
+ } else if (id === 'del' && !('params' in item)) {
970
+ console.log('删除');
971
+ this.delData(val, item);
972
+ } else if ('params' in item || ('prompt' in item && item.prompt)) {
973
+ //判断url和params 都不存在,还需要弹框时候"prompt" in item && item.prompt
974
+ // (!("params" in item) && !("url" in item))
975
+ this.changeData(item, val);
976
+ }
977
+
978
+ this.$emit('tableBtnClick', val.row, item, index);
979
+ },
980
+ querySearchAsync(queryString, cb) {
981
+ var restaurants = this.restaurants;
982
+ var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;
983
+
984
+ clearTimeout(this.timeout);
985
+ this.timeout = setTimeout(() => {
986
+ cb(results);
987
+ }, 3000 * Math.random());
988
+ },
989
+ createStateFilter(queryString) {
990
+ return (state) => {
991
+ return state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0;
992
+ };
993
+ },
994
+ handleSelect(item) {
995
+ console.log('开始选');
996
+ this.$emit('handleSelect', item);
997
+ },
998
+ sizeChange(val) {
999
+ this.data.rows = val;
1000
+ this.data.page = 1;
1001
+ this.getDataList();
1002
+ this.$emit('sizeChange', val);
1003
+ },
1004
+ currentChange(val) {
1005
+ console.log('开始请求');
1006
+ this.data.page = val;
1007
+ this.getDataList();
1008
+ this.$emit('currentChange', val);
1009
+ },
1010
+ handleCommand(key, data) {
1011
+ console.log(key, data, 'f');
1012
+ //折叠按钮请求
1013
+ // this.$message("click on item " + command);
1014
+ // this.$emit("tableBtnClick", command); //抛出去,根据id来执行事件
1015
+ },
1016
+ importData(paramsUrl, btnId, jump) {
1017
+ let paramsResult = null, //判断参数是否必传
1018
+ disabledPrompt = null, //参数必传的提示语
1019
+ disabledValueArray = null; //参数必传的name值的数组
1020
+ let requestUrl = paramsUrl ? paramsUrl : this.searchUrl ? this.searchUrl : this.url ? this.url : '';
1021
+ if (requestUrl === '') {
1022
+ // this.$message.error("url not defined");
1023
+ return false;
1024
+ }
1025
+ let params = {};
1026
+
1027
+ //获取参数
1028
+ this.temInputPack &&
1029
+ this.temInputPack.forEach((el, index) => {
1030
+ if ('disabledStatic' in el && el.disabledStatic) {
1031
+ //添加这个字段表示这个字段传递后,才可点击搜索框
1032
+ paramsResult = true; //设定为true,表示有这个字段
1033
+ if ('disabledPrompt' in el && el.disabledPrompt) {
1034
+ //这个字段只需给一个,一般以第一个为准
1035
+ disabledPrompt = el.disabledPrompt;
1036
+ }
1037
+ disabledValueArray = [];
1038
+ disabledValueArray.push(el.value);
1039
+ }
1040
+ if (el.type === 'daterange') {
1041
+ //这是时间段
1042
+ // console.log(el.name, "ddd");
1043
+ el.name.split(',').forEach((res, index) => {
1044
+ if (el.value) {
1045
+ params[res] = el.value[index];
1046
+ }
1047
+ });
1048
+ } else if (el.type === 'datetimerange') {
1049
+ //这是时间段
1050
+ console.log(el.name, 'ddd');
1051
+ el.name.split(',').forEach((res, index) => {
1052
+ if (el.value) {
1053
+ params[res] = el.value[index];
1054
+ }
1055
+ });
1056
+ } else if (el.type === 'cascader') {
1057
+ let _array = el.options;
1058
+ // 先判断是几级
1059
+ if (el.value.length - 1) {
1060
+ }
1061
+ // if (Array.isArray(el.value[0])) {
1062
+ // let _val = "";
1063
+ // el.value.forEach((res, reIndex) => {
1064
+ // _val +=
1065
+ // el.value.length - 1 == reIndex
1066
+ // ? res[res.length - 1]
1067
+ // : res[res.length - 1] + ",";
1068
+ // });
1069
+ // params[el.name] = _val;
1070
+ // } else {
1071
+ if (el.value.length > 0) {
1072
+ params[el.name] = el.value[el.value.length - 1];
1073
+ }
1074
+ // }
1075
+ } else if (el.type === 'select') {
1076
+ if (Array.isArray(el.value) && el.value.length > 0) {
1077
+ let _val = '';
1078
+ el.value.forEach((res, reIndex) => {
1079
+ _val += el.value.length - 1 == reIndex ? res : res + ',';
1080
+ });
1081
+ params[el.name] = _val;
1082
+ } else {
1083
+ if (el.value) {
1084
+ params[el.name] = el.value;
1085
+ console.log(el, el.value, params, 'el.value');
1086
+ }
1087
+ }
1088
+ } else if (el.name) {
1089
+ if (el.value) {
1090
+ //暂时修改,后台接口返回问题
1091
+ // if(el.multiple){
1092
+ // params[el.name]=el.value.toString()
1093
+ // }else{
1094
+ params[el.name] = el.value;
1095
+ // }
1096
+
1097
+ console.log(el, el.value, params, 'el.value');
1098
+ }
1099
+ } else if (el.type === 'textMore') {
1100
+ el.children.forEach((response) => {
1101
+ if (response.value) {
1102
+ params[response.name] = response.value;
1103
+ }
1104
+ });
1105
+ }
1106
+ });
1107
+ if (this.temTab && this.temTab.tabPane[this.activeName].value != '') {
1108
+ this.temTab.tabPane[this.activeName].name.split(',').forEach((elpar, elIndex) => {
1109
+ this.$set(params, elpar, this.temTab.tabPane[this.activeName].value.split(',')[elIndex]);
1110
+ });
1111
+ }
1112
+ //查询列表
1113
+
1114
+ console.log(params, '+++++++++++++');
1115
+ // this.loading = true;
1116
+ // 请求需要携带的参数params
1117
+ this.params &&
1118
+ this.params.forEach((par) => {
1119
+ if (par.value) {
1120
+ params[par.name] = par.value;
1121
+ }
1122
+ });
1123
+ params.exportFlag = true;
1124
+ request({
1125
+ url: requestUrl,
1126
+ method: 'post',
1127
+ data: querystring.stringify(params),
1128
+ }).then((res) => {
1129
+ this.$message.success('操作成功,请耐心等待');
1130
+
1131
+ setTimeout(() => {
1132
+ if (!jump) {
1133
+ window.locationProxy.href = process.env.API_ROOT + '/paas/system-manager/index.html#/importData';
1134
+ } else {
1135
+ window.locationProxy.href = jump;
1136
+ }
1137
+ }, 500);
1138
+ });
1139
+ },
1140
+ getDataList(paramsUrl, btnId) {
1141
+ if (this.clickState) {
1142
+ this.clickState = false;
1143
+
1144
+ // debugger
1145
+ let paramsResult = null, //判断参数是否必传
1146
+ disabledPrompt = null, //参数必传的提示语
1147
+ disabledValueArray = null; //参数必传的name值的数组
1148
+ let requestUrl = paramsUrl ? paramsUrl : this.searchUrl ? this.searchUrl : this.url ? this.url : '';
1149
+ if (requestUrl === '') {
1150
+ // this.$message.error("url not defined");
1151
+ return false;
1152
+ }
1153
+ let params = {};
1154
+ if (!btnId) {
1155
+ params['rows'] = this.data.rows;
1156
+ params['page'] = this.data.page;
1157
+ }
1158
+ if (this.temPage == false) {
1159
+ delete params.rows;
1160
+ delete params.page;
1161
+ }
1162
+ //获取参数
1163
+ this.temInputPack &&
1164
+ this.temInputPack.forEach((el, index) => {
1165
+ if ('disabledStatic' in el && el.disabledStatic) {
1166
+ //添加这个字段表示这个字段传递后,才可点击搜索框
1167
+ paramsResult = true; //设定为true,表示有这个字段
1168
+ if ('disabledPrompt' in el && el.disabledPrompt) {
1169
+ //这个字段只需给一个,一般以第一个为准
1170
+ disabledPrompt = el.disabledPrompt;
1171
+ }
1172
+ disabledValueArray = [];
1173
+ disabledValueArray.push(el.value);
1174
+ }
1175
+ if (el.type === 'daterange') {
1176
+ //这是时间段
1177
+ // console.log(el.name, "ddd");
1178
+ el.name.split(',').forEach((res, index) => {
1179
+ if (el.value) {
1180
+ params[res] = el.value[index];
1181
+ }
1182
+ });
1183
+ } else if (el.type === 'datetimerange') {
1184
+ //这是时间段
1185
+ console.log(el.name, 'ddd');
1186
+ el.name.split(',').forEach((res, index) => {
1187
+ if (el.value) {
1188
+ params[res] = el.value[index];
1189
+ }
1190
+ });
1191
+ } else if (el.type === 'cascader') {
1192
+ let _array = el.options;
1193
+ // 先判断是几级
1194
+ if (el.value.length - 1) {
1195
+ }
1196
+ // if (Array.isArray(el.value[0])) {
1197
+ // let _val = "";
1198
+ // el.value.forEach((res, reIndex) => {
1199
+ // _val +=
1200
+ // el.value.length - 1 == reIndex
1201
+ // ? res[res.length - 1]
1202
+ // : res[res.length - 1] + ",";
1203
+ // });
1204
+ // params[el.name] = _val;
1205
+ // } else {
1206
+ if (el.value.length > 0) {
1207
+ params[el.name] = el.value[el.value.length - 1];
1208
+ }
1209
+ // }
1210
+ } else if (el.type === 'select') {
1211
+ if (Array.isArray(el.value) && el.value.length > 0) {
1212
+ let _val = '';
1213
+ el.value.forEach((res, reIndex) => {
1214
+ _val += el.value.length - 1 == reIndex ? res : res + ',';
1215
+ });
1216
+ params[el.name] = _val;
1217
+ } else {
1218
+ if (el.value) {
1219
+ params[el.name] = el.value;
1220
+ console.log(el, el.value, params, 'el.value');
1221
+ }
1222
+ }
1223
+ } else if (el.name) {
1224
+ if (el.value) {
1225
+ //暂时修改,后台接口返回问题
1226
+ // if(el.multiple){
1227
+ // params[el.name]=el.value.toString()
1228
+ // }else{
1229
+ params[el.name] = el.value;
1230
+ // }
1231
+
1232
+ console.log(el, el.value, params, 'el.value');
1233
+ }
1234
+ } else if (el.type === 'textMore') {
1235
+ el.children.forEach((response) => {
1236
+ if (response.value) {
1237
+ params[response.name] = response.value;
1238
+ }
1239
+ });
1240
+ }
1241
+ });
1242
+ if (this.temTab && this.temTab.tabPane[this.activeName].value != '') {
1243
+ console.log('111111111');
1244
+
1245
+ this.temTab.tabPane[this.activeName].name.split(',').forEach((elpar, elIndex) => {
1246
+ this.$set(params, elpar, this.temTab.tabPane[this.activeName].value.split(',')[elIndex]);
1247
+ });
1248
+ } else if (this.temTab && this.temTab.tabPane[this.activeName].value == '') {
1249
+ if (this.temTab.tabPane[this.activeName].url) {
1250
+ requestUrl = this.temTab.tabPane[this.activeName].url;
1251
+ }
1252
+ }
1253
+ //查询列表
1254
+ if (Object.keys(params).length === 0 && btnId) {
1255
+ this.tableData = [];
1256
+ return;
1257
+ }
1258
+ if (paramsResult) {
1259
+ //表示需要判断
1260
+ console.log(disabledValueArray, 'disabledValueArray');
1261
+ // debugger
1262
+ if ((disabledValueArray.indexOf('') || disabledValueArray.indexOf('underfind') || disabledValueArray.indexOf('null') || disabledValueArray.indexOf(null)) != -1) {
1263
+ this.$message.error(disabledPrompt);
1264
+ return;
1265
+ }
1266
+ }
1267
+ this.loading = true;
1268
+ // 请求需要携带的参数params
1269
+ this.params &&
1270
+ this.params.forEach((par) => {
1271
+ if (par.value) {
1272
+ params[par.name] = par.value;
1273
+ }
1274
+ });
1275
+ console.log(requestUrl, 'requestUrl');
1276
+ request({
1277
+ url: requestUrl,
1278
+ method: 'post',
1279
+ data: querystring.stringify(params),
1280
+ }).then((res) => {
1281
+ this.loading = false;
1282
+ this.clickState = true;
1283
+ if (res) {
1284
+ if (Array.isArray(res)) {
1285
+ this.tableData = res;
1286
+ this.$emit('getData', res);
1287
+ // 小计
1288
+
1289
+ if (res.length > 0) {
1290
+ if (this.subtotal && this.subtotal.length > 0) {
1291
+ this.subtotal.forEach((el) => {
1292
+ el.value = 0;
1293
+ if (el.name) {
1294
+ res.forEach((res) => {
1295
+ el.value = this.accAdd(el.value, Number(res[el.name]));
1296
+ el.value = el.value.toFixed(2);
1297
+ });
1298
+ }
1299
+ });
1300
+ }
1301
+ } else {
1302
+ if (this.subtotal && this.subtotal.length > 0) {
1303
+ this.subtotal.forEach((el) => {
1304
+ el.value = 0;
1305
+ });
1306
+ }
1307
+ }
1308
+ } else if (res && res.rows) {
1309
+ this.tableData = res.rows;
1310
+ if (this.temPage !== false) {
1311
+ this.pagenation.total = res.total;
1312
+ }
1313
+ this.tableData = res.rows;
1314
+ this.$emit('getData', res.rows);
1315
+ this.$emit('getTotal', res.total);
1316
+ // 小计
1317
+ if (res.rows.length > 0) {
1318
+ if (this.subtotal && this.subtotal.length > 0) {
1319
+ this.subtotal.forEach((el) => {
1320
+ el.value = 0;
1321
+ if (el.name) {
1322
+ res.rows.forEach((res) => {
1323
+ el.value = this.accAdd(el.value, Number(res[el.name]));
1324
+ el.value = el.value.toFixed(2);
1325
+ });
1326
+ }
1327
+ });
1328
+ }
1329
+ } else {
1330
+ if (this.subtotal && this.subtotal.length > 0) {
1331
+ this.subtotal.forEach((el) => {
1332
+ el.value = 0;
1333
+ });
1334
+ }
1335
+ }
1336
+ } else {
1337
+ if (this.temPage !== false) {
1338
+ this.pagenation.total = 0;
1339
+ }
1340
+ if (this.subtotal && this.subtotal.length > 0) {
1341
+ this.subtotal.forEach((el) => {
1342
+ el.value = 0;
1343
+ });
1344
+ }
1345
+ this.tableData = [];
1346
+ this.$emit('getData', []);
1347
+ this.$emit('getTotal', 0);
1348
+ }
1349
+ } else {
1350
+ if (this.temPage !== false) {
1351
+ this.pagenation.total = 0;
1352
+ }
1353
+ this.tableData = [];
1354
+ this.$emit('getData', []);
1355
+ this.$emit('getTotal', 0);
1356
+ }
1357
+ });
1358
+ }
1359
+ },
1360
+ seeDetails(item, val, index) {
1361
+ console.log(item, val);
1362
+ let nData = val.row;
1363
+ let params = {};
1364
+ if (item.props) {
1365
+ item.props.forEach((res) => {
1366
+ if ('extend' in res && res.exteng === false) {
1367
+ params[res.name] = res.value;
1368
+ } else {
1369
+ params[res.name] = nData[res.value];
1370
+ if (!res.value) {
1371
+ params[res.name] = nData[res.name];
1372
+ }
1373
+ }
1374
+ });
1375
+ }
1376
+ if (Object.keys(params).length === 0) {
1377
+ params['1'] = '';
1378
+ }
1379
+ if (item.url) {
1380
+ request({
1381
+ url: item.url,
1382
+ method: 'post',
1383
+ data: querystring.stringify(params),
1384
+ }).then((res) => {
1385
+ if (res && !res.success) {
1386
+ this.showDetails(item, res);
1387
+ } else {
1388
+ this.$message.error('操作失败');
1389
+ }
1390
+ });
1391
+ } else {
1392
+ this.showDetails(item, nData);
1393
+ }
1394
+ },
1395
+ showDetails(item, data) {
1396
+ let template = JSON.parse(JSON.stringify(item.template)); //去除数据的双向绑定
1397
+ template.html.forEach((el) => {
1398
+ if (el.value === '') {
1399
+ if ('template' in el) {
1400
+ if (el.template === 'format') {
1401
+ el.value = data[el.name] ? parseTime(data[el.name]) : data[el.name];
1402
+ } else if (el.template === 'area') {
1403
+ el.name &&
1404
+ el.name.map((val) => {
1405
+ console.log(data, val);
1406
+ if (data[val]) {
1407
+ el.value += data[val] + ' ';
1408
+ }
1409
+ });
1410
+ } else {
1411
+ el.value = el.template[data[el.name]];
1412
+ }
1413
+ } else {
1414
+ el.value = data[el.name];
1415
+ }
1416
+ if ('state' in el) {
1417
+ el.stateValue = data[el.stateName];
1418
+ }
1419
+ }
1420
+ });
1421
+ console.log(template, 'template');
1422
+ this.dialogDataSee = template;
1423
+ // console.log(this.dialogDataSee.html, "template");
1424
+ // var seeDe=this.dialogDataSee.html;
1425
+ // for(var i in seeDe){
1426
+ // if(seeDe[i].type=="img"){
1427
+ // console.log(seeDe[i].value)
1428
+ // }
1429
+ // }
1430
+ this.dialogFormVisibleSee = true;
1431
+ },
1432
+ accAdd(num1, num2) {
1433
+ var r1, r2, m;
1434
+ try {
1435
+ r1 = num1.toString().split('.')[1].length;
1436
+ } catch (e) {
1437
+ r1 = 0;
1438
+ }
1439
+ try {
1440
+ r2 = num2.toString().split('.')[1].length;
1441
+ } catch (e) {
1442
+ r2 = 0;
1443
+ }
1444
+ m = Math.pow(10, Math.max(r1, r2));
1445
+ // return (num1*m+num2*m)/m;
1446
+ return Math.round(num1 * m + num2 * m) / m;
1447
+ },
1448
+ inputSelChange(val, item) {
1449
+ // this.getDataList();
1450
+ this.$emit('selChange', val, item);
1451
+ },
1452
+ selChange(val, item) {
1453
+ this.$emit('selChange', val, item);
1454
+ },
1455
+ dialogCancel() {
1456
+ //取消
1457
+ this.dialogFormVisible = false;
1458
+ },
1459
+ dialogConfirm(url, formName) {
1460
+ //编辑确定
1461
+ this.$refs[formName].validate((valid) => {
1462
+ //编辑验证
1463
+ if (valid) {
1464
+ if (url && this.dialogData.html) {
1465
+ let data = this.ruleForm;
1466
+ //编辑请求接口
1467
+ request({
1468
+ url: url,
1469
+ method: 'post',
1470
+ data: querystring.stringify(data),
1471
+ }).then((res) => {
1472
+ if (res.success) {
1473
+ if (this.btnState === 1) {
1474
+ //表示增加
1475
+ this.$message({
1476
+ message: '新增成功',
1477
+ type: 'success',
1478
+ });
1479
+ } else {
1480
+ this.$message({
1481
+ message: '编辑成功',
1482
+ type: 'success',
1483
+ });
1484
+ }
1485
+
1486
+ this.dialogFormVisible = false;
1487
+ this.getDataList();
1488
+ } else {
1489
+ this.$message.error(res.msg);
1490
+ }
1491
+ });
1492
+ }
1493
+ }
1494
+ });
1495
+ },
1496
+ addData(data) {
1497
+ // console.log(data, "dd");
1498
+ },
1499
+ delData(val, item) {
1500
+ let promptTitle = item.promptTitle ? item.promptTitle : '是否确认删除?';
1501
+ this.$confirm(promptTitle, {
1502
+ center: true,
1503
+ }).then((res) => {
1504
+ return request({
1505
+ url: item.url,
1506
+ method: 'post',
1507
+ data: querystring.stringify(val.row),
1508
+ })
1509
+ .then((res) => {
1510
+ if (res.success) {
1511
+ this.$message.success(res.msg);
1512
+ this.getDataList();
1513
+ }
1514
+ //和request 封装的response起冲突
1515
+ // else {
1516
+ // this.$message.error(res.msg);
1517
+ // }
1518
+ this.$emit('btnConfirm', val, item); //抛出确认按钮
1519
+ })
1520
+ .catch((err) => {
1521
+ console.log(err);
1522
+ });
1523
+ });
1524
+ },
1525
+ handleAvatarSuccess(res, file) {
1526
+ console.log(res, file);
1527
+ this.imageUrl = URL.createObjectURL(file.raw);
1528
+ },
1529
+ handleClickTab(tab, event) {
1530
+ //tab事件操作
1531
+ this.$emit('handleClickTab', this.temTab.tabPane[this.activeName]);
1532
+ this.data.page = 1;
1533
+ this.getDataList();
1534
+ },
1535
+ exceed() {
1536
+ //图片个数超出的验证
1537
+ this.$message.error(`最多上传${this.limit}张!`);
1538
+ },
1539
+ beforeAvatarUpload(file) {
1540
+ //上传之前的回调
1541
+ const fileType = /\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(file.name);
1542
+ if (!fileType) {
1543
+ this.$message.error('图片格式为常见的jpg、png、gif格式!');
1544
+ }
1545
+ const isLt2M = file.size / 1024 / 1024 < 5;
1546
+ if (!isLt2M) {
1547
+ this.$message.error('上传的图片大小不能超过 5MB!');
1548
+ }
1549
+ return isLt2M && fileType;
1550
+ },
1551
+ picUpload(file) {
1552
+ // this.imgLoading = true;
1553
+ const formData = new FormData(); //转表单对象
1554
+ formData.append('file', file.file);
1555
+ return request({
1556
+ url: this.uploadUrl,
1557
+ method: 'post',
1558
+ data: formData,
1559
+ })
1560
+ .then((res) => {
1561
+ if (!this.showFileList) {
1562
+ //组件中添加showFileList就是判断是否是单个图片
1563
+ this.uploadImgValue = [];
1564
+ }
1565
+ this.uploadImgValue.push({ url: res.fileUrl, uid: file.file.uid });
1566
+ if (this.uploadName) {
1567
+ this.ruleForm[this.uploadName] = res.fileUrl;
1568
+ }
1569
+ // this.imgLoading = false;
1570
+ })
1571
+ .catch(() => {
1572
+ // this.imgLoading = false;
1573
+ console.log('上传失败');
1574
+ });
1575
+ },
1576
+ handleRemove(file, fileList) {
1577
+ //删除图片
1578
+ this.uploadImgValue = this.uploadImgValue.filter((val) => {
1579
+ return val.uid !== file.uid;
1580
+ });
1581
+ console.log(this.uploadImgValue);
1582
+ },
1583
+ handleSelectionChange(selection, row) {
1584
+ console.log('多选222222222222', selection, row, this.tableData);
1585
+ this.$emit('handleSelectionChange', selection, row);
1586
+ localStorage.setItem('selectList', this.tableData);
1587
+ this.multipleSelection = selection;
1588
+ this.select_order_number = this.multipleSelection.length;
1589
+
1590
+ this.select_more = [];
1591
+ if (selection) {
1592
+ selection.forEach((row) => {
1593
+ if (row) {
1594
+ this.select_more.push(row);
1595
+ }
1596
+ });
1597
+ }
1598
+ console.log('多页', this.select_more);
1599
+ },
1600
+ toggleSelection(rows) {
1601
+ if (rows) {
1602
+ rows.forEach((row) => {
1603
+ this.$refs.multipleTable.toggleRowSelection(row, true);
1604
+ });
1605
+ } else {
1606
+ this.$refs.multipleTable.clearSelection();
1607
+ }
1608
+ this.$emit('toggleSelection', row);
1609
+ },
1610
+ dropdownState(state, arr) {
1611
+ arr.every((res) => {
1612
+ return res.dataState == state;
1613
+ });
1614
+ // let aa = arr.some(el => {
1615
+ // return el.dataState == state;
1616
+ // });
1617
+ // console.log(aa);
1618
+ },
1619
+
1620
+ changeData(item, val) {
1621
+ let params = 'params' in item ? JSON.parse(JSON.stringify(item.params)) : {};
1622
+ for (let el in params) {
1623
+ if (params[el] === '') {
1624
+ params[el] = val.row[el];
1625
+ }
1626
+ }
1627
+ if ('paramProps' in item) {
1628
+ for (let el in item.paramProps) {
1629
+ params[el] = val.row[item.paramProps[el]];
1630
+ }
1631
+ }
1632
+ if ('url' in item && item.url) {
1633
+ if ('promptTitle' in item) {
1634
+ let title = 'title' in item ? item.title : '提示';
1635
+ this.$confirm(item.promptTitle, title, {
1636
+ center: true,
1637
+ })
1638
+ .then(() => {
1639
+ this.postData(item.url, params);
1640
+ this.$emit('btnConfirm', val, item); //抛出确认按钮,接口请求完成后
1641
+ })
1642
+ .catch(() => {
1643
+ this.$message({
1644
+ type: 'info',
1645
+ message: '已取消',
1646
+ });
1647
+ });
1648
+ } else {
1649
+ this.postData(item.url, params);
1650
+ }
1651
+ } else {
1652
+ if (item.prompt) {
1653
+ //prompt 为true时表示有提示框
1654
+ //当url不存在,表示不需要请求
1655
+ this.$confirm(item.promptTitle, '提示', {
1656
+ center: true,
1657
+ })
1658
+ .then(() => {
1659
+ this.$emit('btnConfirm', val, item); //抛出确认按钮,接口请求完成后
1660
+ })
1661
+ .catch(() => {
1662
+ this.$message({
1663
+ type: 'info',
1664
+ message: '已取消',
1665
+ });
1666
+ });
1667
+ } else if ('url' in item && !item.url) {
1668
+ //当url不传的时候
1669
+ this.$message.error('url not defined');
1670
+ }
1671
+ }
1672
+ },
1673
+ postData(url, params) {
1674
+ request({
1675
+ url: url,
1676
+ method: 'post',
1677
+ data: querystring.stringify(params),
1678
+ }).then((res) => {
1679
+ if (res.success) {
1680
+ //表示增加
1681
+ this.$message({
1682
+ message: '操作成功',
1683
+ type: 'success',
1684
+ });
1685
+
1686
+ this.getDataList();
1687
+ } else {
1688
+ this.$message.error(res.msg);
1689
+ }
1690
+ });
1691
+ },
1692
+ radioChange(val, item) {
1693
+ this.$emit('radioChange', val, item);
1694
+ },
1695
+ },
1696
+ watch: {
1697
+ temPage: {
1698
+ handler() {
1699
+ this.pagenation = this.temPage;
1700
+ },
1701
+ deep: true, //深度监听
1702
+ },
1703
+ dialogFormVisible(val) {
1704
+ if (this.dialogFormVisible) {
1705
+ this.$nextTick(function () {
1706
+ this.$refs.child.clearValidate();
1707
+ });
1708
+ }
1709
+ },
1710
+ temInputPack(val) {
1711
+ console.log(val, 'sss');
1712
+ },
1713
+ $route: function (to, form) {
1714
+ //路由改变,重新请求页面
1715
+ this.getDataList();
1716
+ },
1717
+ },
1718
+ };
1719
+ </script>
1720
+ <style lang="scss">
1721
+ .el-tabs__item:focus.is-active.is-focus:not(:active) {
1722
+ -webkit-box-shadow: none !important;
1723
+ box-shadow: none !important;
1724
+ }
1725
+
1726
+ // .template-table .el-select {
1727
+ // width: 120px !important;
1728
+ // }
1729
+ .el-button {
1730
+ height: 30px !important;
1731
+ border-radius: 2px !important;
1732
+ }
1733
+
1734
+ .el-input__inner {
1735
+ border-radius: 2px;
1736
+ }
1737
+
1738
+ .tem-header .el-input {
1739
+ width: inherit;
1740
+ }
1741
+
1742
+ .tem-header li {
1743
+ margin-bottom: 10px !important;
1744
+ }
1745
+
1746
+ .tem-header .li {
1747
+ margin-bottom: 0px !important;
1748
+ line-height: 0;
1749
+ }
1750
+
1751
+ // .tem-header .el-input .el-input__inner {
1752
+ // height: 30px;
1753
+ // line-height: 30px;
1754
+ // padding: 0 20px 0 10px;
1755
+ // width: 120px;
1756
+ // font-size: 12px;
1757
+ // text-overflow: ellipsis;
1758
+ // white-space: nowrap;
1759
+ // }
1760
+ .tem-header .el-input .el-input__inner + .el-input__suffix {
1761
+ right: 0px !important;
1762
+ }
1763
+
1764
+ .el-tabs--border-card > .el-tabs__header {
1765
+ background-color: #fff !important;
1766
+ border-bottom: 1px solid transparent !important;
1767
+ }
1768
+
1769
+ .el-table thead.has-gutter tr th {
1770
+ background: #f3f4f5;
1771
+ }
1772
+
1773
+ .el-table .el-table__header .cell {
1774
+ color: #666;
1775
+ font-weight: normal;
1776
+ line-height: 20px;
1777
+ text-align: left !important;
1778
+ }
1779
+
1780
+ .el-table .el-table__body .cell {
1781
+ font-size: 12px;
1782
+ text-align: left !important;
1783
+ }
1784
+
1785
+ .el-tabs--border-card > .el-tabs__content {
1786
+ padding: 0 !important;
1787
+ }
1788
+
1789
+ .template-box {
1790
+ padding: 0 15px 20px 15px !important;
1791
+ background: #fff;
1792
+ }
1793
+
1794
+ .template-boild-box {
1795
+ // border: 1px solid #ededed !important;
1796
+ box-shadow: 0 0px 0px 0 transparent, 0 0 0px 0 transparent !important;
1797
+ -webkit-box-shadow: 0 0px 0px 0 transparent, 0 0 0px 0 transparent !important;
1798
+ }
1799
+
1800
+ .el-tabs--border-card {
1801
+ border: 1px solid #ededed !important;
1802
+ box-shadow: 0 0px 0px 0 transparent, 0 0 0px 0 transparent !important;
1803
+ -webkit-box-shadow: 0 0px 0px 0 transparent, 0 0 0px 0 transparent !important;
1804
+ }
1805
+
1806
+ .el-tabs--border-card > .el-tabs__header .el-tabs__item.is-active {
1807
+ border-left-color: transparent !important;
1808
+ }
1809
+
1810
+ .el-tabs--border-card > .el-tabs__header .el-tabs__item {
1811
+ border-right: 1px solid #e0e0e0 !important;
1812
+ height: 18px;
1813
+ line-height: 18px;
1814
+ margin: 20px 0 !important;
1815
+ font-size: 16px;
1816
+ }
1817
+
1818
+ .el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child {
1819
+ border: none !important;
1820
+ }
1821
+
1822
+ .tem-table-img {
1823
+ width: 40px;
1824
+ height: 40px;
1825
+ border-radius: 2px;
1826
+ margin-right: 10px;
1827
+ float: left;
1828
+ }
1829
+
1830
+ .tem-table-img-center {
1831
+ width: 40px;
1832
+ height: 40px;
1833
+ border-radius: 2px;
1834
+ }
1835
+
1836
+ .tem-img-list img {
1837
+ width: 150px;
1838
+ display: inline-block;
1839
+ }
1840
+
1841
+ .el-table td {
1842
+ padding: 5px 0 !important;
1843
+ }
1844
+
1845
+ .tem-ul-alert li {
1846
+ line-height: 30px;
1847
+ }
1848
+
1849
+ .tem-ul-alert li label {
1850
+ float: left;
1851
+ }
1852
+
1853
+ .tem-span-btn button {
1854
+ margin: 0;
1855
+ margin-right: 10px;
1856
+ }
1857
+
1858
+ .el-dialog {
1859
+ width: 660px;
1860
+ }
1861
+
1862
+ .el-upload-list--picture-card .el-upload-list__item,
1863
+ .el-upload--picture-card {
1864
+ width: 100px;
1865
+ height: 100px;
1866
+ }
1867
+
1868
+ .el-upload--picture-card {
1869
+ line-height: 104px;
1870
+ }
1871
+
1872
+ .el-form-item__content .el-loading-mask {
1873
+ width: 102px;
1874
+ height: 102px;
1875
+ }
1876
+
1877
+ .el-upload-add .el-loading-mask {
1878
+ top: -36px;
1879
+ right: 72px;
1880
+ left: initial;
1881
+ }
1882
+
1883
+ .mar-t10 {
1884
+ margin-top: 10px;
1885
+ }
1886
+
1887
+ .btn-custom-cancel {
1888
+ float: right;
1889
+ margin-left: 10px;
1890
+ }
1891
+
1892
+ .el-checkbox {
1893
+ margin-left: 15px;
1894
+ }
1895
+
1896
+ .el-cascader-menu__item {
1897
+ padding: 8px !important;
1898
+ }
1899
+
1900
+ .el-cascader-menu {
1901
+ height: 550px !important;
1902
+ min-width: 120px !important;
1903
+ }
1904
+
1905
+ .el-message-box {
1906
+ width: 390px !important;
1907
+
1908
+ &.el-message-box--center {
1909
+ padding-bottom: 20px;
1910
+ }
1911
+
1912
+ /deep/ .el-message-box__title {
1913
+ justify-content: flex-start !important;
1914
+ }
1915
+
1916
+ .el-message-box__content {
1917
+ padding: 0;
1918
+ }
1919
+
1920
+ .el-message-box__message {
1921
+ text-align: center;
1922
+ font-size: 18px;
1923
+ margin: 30px 0;
1924
+ }
1925
+
1926
+ .el-message-box__btns {
1927
+ text-align: center;
1928
+ // margin-bottom: 30px;
1929
+ }
1930
+ }
1931
+
1932
+ // .el-message-box {
1933
+ // width: 590px !important;
1934
+ // .el-message-box--center {
1935
+ // padding-bottom: 0px;
1936
+ // }
1937
+ // .el-message-box__content {
1938
+ // padding: 0;
1939
+ // }
1940
+ // .el-message-box__message {
1941
+ // text-align: center;
1942
+ // font-size: 18px;
1943
+ // margin: 45px 0;
1944
+ // }
1945
+ // .el-message-box__btns {
1946
+ // text-align: center;
1947
+ // margin-bottom: 30px;
1948
+ // }
1949
+ // }
1950
+
1951
+ //组件改变
1952
+ .template-table {
1953
+ .el-select {
1954
+ .el-select__tags-text {
1955
+ display: inline-block;
1956
+ max-width: 84px;
1957
+ white-space: nowrap;
1958
+ /*规定段落中的文本不进行换行*/
1959
+ overflow: hidden;
1960
+ /*内容会被修剪,并且其余内容是不可见的。*/
1961
+ text-overflow: ellipsis;
1962
+ /*显示省略号来代表被修剪的文本*/
1963
+ }
1964
+ }
1965
+
1966
+ .el-select .el-tag__close.el-icon-close {
1967
+ top: -6px;
1968
+ }
1969
+
1970
+ .el-select__tags {
1971
+ white-space: nowrap;
1972
+ height: 30px;
1973
+ }
1974
+ }
1975
+ </style>
1976
+ <style lang="scss" scoped>
1977
+ .el-select {
1978
+ /deep/ .el-icon-::before {
1979
+ content: '\e6e1' !important;
1980
+ }
1981
+ }
1982
+
1983
+ .page-count {
1984
+ color: #333;
1985
+ font-size: 14px;
1986
+
1987
+ p {
1988
+ margin-left: 20px;
1989
+ }
1990
+ }
1991
+
1992
+ /**color**/
1993
+
1994
+ .success {
1995
+ color: #67c23a;
1996
+
1997
+ &:focus {
1998
+ color: #67c23a;
1999
+ }
2000
+
2001
+ &:link {
2002
+ color: #67c23a;
2003
+ }
2004
+
2005
+ &:hover {
2006
+ color: #67c23a;
2007
+ }
2008
+
2009
+ &:active {
2010
+ color: #67c23a;
2011
+ }
2012
+
2013
+ &:visited {
2014
+ color: #67c23a;
2015
+ }
2016
+ }
2017
+
2018
+ .info {
2019
+ color: #909399;
2020
+
2021
+ &:focus {
2022
+ color: #909399;
2023
+ }
2024
+
2025
+ &:link {
2026
+ color: #909399;
2027
+ }
2028
+
2029
+ &:hover {
2030
+ color: #909399;
2031
+ }
2032
+
2033
+ &:active {
2034
+ color: #909399;
2035
+ }
2036
+
2037
+ &:visited {
2038
+ color: #909399;
2039
+ }
2040
+ }
2041
+
2042
+ .warning {
2043
+ color: #e6a23c;
2044
+
2045
+ &:focus {
2046
+ color: #e6a23c;
2047
+ }
2048
+
2049
+ &:link {
2050
+ color: #e6a23c;
2051
+ }
2052
+
2053
+ &:hover {
2054
+ color: #e6a23c;
2055
+ }
2056
+
2057
+ &:active {
2058
+ color: #e6a23c;
2059
+ }
2060
+
2061
+ &:visited {
2062
+ color: #e6a23c;
2063
+ }
2064
+ }
2065
+
2066
+ .danger {
2067
+ color: #f56c6c;
2068
+
2069
+ &:focus {
2070
+ color: #f56c6c;
2071
+ }
2072
+
2073
+ &:link {
2074
+ color: #f56c6c;
2075
+ }
2076
+
2077
+ color: #f56c6c;
2078
+
2079
+ &:hover {
2080
+ color: #f56c6c;
2081
+ }
2082
+
2083
+ &:active {
2084
+ color: #f56c6c;
2085
+ }
2086
+
2087
+ &:visited {
2088
+ color: #f56c6c;
2089
+ }
2090
+ }
2091
+
2092
+ .dialogSee-ui {
2093
+ padding-bottom: 30px;
2094
+ }
2095
+
2096
+ .dialogSee-ui li {
2097
+ margin: 10px 0;
2098
+ }
2099
+
2100
+ .dialogSee-ui li img {
2101
+ width: 200px;
2102
+ }
2103
+
2104
+ .dialogSee-textarea {
2105
+ width: 360px;
2106
+ white-space: normal;
2107
+ word-break: break-all;
2108
+ }
2109
+
2110
+ .dialogSee-ui label {
2111
+ display: block;
2112
+ text-align: right;
2113
+ float: left;
2114
+ }
2115
+
2116
+ .dialog-main {
2117
+ float: left;
2118
+ }
2119
+
2120
+ .tem-table-span {
2121
+ text-align: left;
2122
+ }
2123
+
2124
+ .clearfix:after {
2125
+ content: '';
2126
+ display: block;
2127
+ clear: both;
2128
+ }
2129
+
2130
+ .template-table {
2131
+ //margin: 10px;
2132
+ overflow: auto;
2133
+ }
2134
+
2135
+ .tem-header {
2136
+ // margin-bottom: 30px;
2137
+ padding: 20px;
2138
+ background: #fff;
2139
+ border: 1px solid #ededed;
2140
+ margin-bottom: 12px;
2141
+ }
2142
+
2143
+ .tem-header li {
2144
+ // float: left;
2145
+ display: inline-block;
2146
+ margin-right: 20px;
2147
+ margin-bottom: 20px;
2148
+ }
2149
+
2150
+ .tem-header li > div {
2151
+ display: inline-block;
2152
+ }
2153
+
2154
+ .tem-header li label {
2155
+ font-size: 14px;
2156
+ color: #666;
2157
+ }
2158
+
2159
+ .temTablePack-title {
2160
+ font-weight: normal;
2161
+ font-size: 16px;
2162
+ margin: 10px 0 10px;
2163
+ }
2164
+
2165
+ // .template-table .el-select {
2166
+ // width: 140px;
2167
+ // }
2168
+ .el-date-editor .el-range-separator {
2169
+ width: auto;
2170
+ }
2171
+
2172
+ .el-date-editor--daterange.el-input__inner {
2173
+ width: 320px;
2174
+ }
2175
+
2176
+ .avatar-uploader .el-upload {
2177
+ border: 1px dashed #d9d9d9;
2178
+ border-radius: 6px;
2179
+ cursor: pointer;
2180
+ position: relative;
2181
+ overflow: hidden;
2182
+ }
2183
+
2184
+ .avatar-uploader .el-upload:hover {
2185
+ border-color: #409eff;
2186
+ }
2187
+
2188
+ .avatar-uploader-icon {
2189
+ font-size: 28px;
2190
+ color: #8c939d;
2191
+ width: 100px;
2192
+ height: 100px;
2193
+ line-height: 100px;
2194
+ text-align: center;
2195
+ border: 1px dashed #c0ccda;
2196
+ border-radius: 6px;
2197
+ background-color: #fbfdff;
2198
+ }
2199
+
2200
+ .avatar {
2201
+ width: 100px;
2202
+ height: 100px;
2203
+ display: block;
2204
+ }
2205
+
2206
+ .el-upload,
2207
+ .el-upload img {
2208
+ /* border: 1px dashed #c0ccda; */
2209
+ border-radius: 6px;
2210
+ }
2211
+
2212
+ .page-box {
2213
+ display: flex;
2214
+ display: -webkit-flex;
2215
+ /* Safari */
2216
+ margin: 20px 0 0;
2217
+ }
2218
+
2219
+ .page-item {
2220
+ flex-grow: 1;
2221
+ /* default 0 */
2222
+ }
2223
+
2224
+ .selectJob {
2225
+ text-align: center;
2226
+ padding: 10px 0;
2227
+
2228
+ span {
2229
+ width: 120px;
2230
+ overflow: hidden;
2231
+ text-overflow: ellipsis;
2232
+ white-space: nowrap;
2233
+ }
2234
+
2235
+ .text {
2236
+ padding-left: 10px;
2237
+ font-size: 14px;
2238
+ font-weight: bold;
2239
+ cursor: pointer;
2240
+ color: cornflowerblue;
2241
+ }
2242
+ }
2243
+ </style>