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