allocationList.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. <template>
  2. <div>
  3. <el-tabs v-model="activeName" @tab-click="handleClick">
  4. <el-tab-pane label="全局系统配置" name="first">
  5. <el-table v-loading="tableDataLoading" :data="tableData">
  6. <el-table-column fixed prop="type" label="编号" align="center" width="80">
  7. </el-table-column>
  8. <el-table-column prop="min" label="类型">
  9. </el-table-column>
  10. <el-table-column prop="value" label="内容" width="500">
  11. <template slot-scope="scope">
  12. <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
  13. </template>
  14. </el-table-column>
  15. <el-table-column prop="createAt" label="创建时间">
  16. </el-table-column>
  17. <el-table-column label="操作" prop="id" width="120">
  18. <template slot-scope="scope">
  19. <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
  20. @click="amend(scope.$index, scope.row)">编辑
  21. </el-button>
  22. </template>
  23. </el-table-column>
  24. </el-table>
  25. </el-tab-pane>
  26. <el-tab-pane label="服务费配置" name="fuwufei">
  27. <el-table v-loading="tableDataLoading" :data="tableData">
  28. <el-table-column fixed prop="type" label="编号" align="center" width="80">
  29. </el-table-column>
  30. <el-table-column prop="min" label="类型">
  31. </el-table-column>
  32. <el-table-column prop="value" label="内容" width="500">
  33. <template slot-scope="scope">
  34. <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
  35. </template>
  36. </el-table-column>
  37. <el-table-column prop="createAt" label="创建时间">
  38. </el-table-column>
  39. <el-table-column label="操作" prop="id" width="120">
  40. <template slot-scope="scope">
  41. <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
  42. @click="amend(scope.$index, scope.row)">编辑
  43. </el-button>
  44. </template>
  45. </el-table-column>
  46. </el-table>
  47. </el-tab-pane>
  48. <!-- <el-tab-pane label="佣金配置" name="yongjin">
  49. <el-table v-loading="tableDataLoading" :data="tableData">
  50. <el-table-column fixed prop="type" label="编号" align="center" width="80">
  51. </el-table-column>
  52. <el-table-column prop="min" label="类型">
  53. </el-table-column>
  54. <el-table-column prop="value" label="内容" width="500">
  55. <template slot-scope="scope">
  56. <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
  57. </template>
  58. </el-table-column>
  59. <el-table-column prop="createAt" label="创建时间">
  60. </el-table-column>
  61. <el-table-column label="操作" prop="id" width="120">
  62. <template slot-scope="scope">
  63. <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
  64. @click="amend(scope.$index, scope.row)">编辑
  65. </el-button>
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. </el-tab-pane> -->
  70. <!-- <el-tab-pane label="首页配置" name="thirdly">
  71. <el-table
  72. v-loading="tableDataLoading"
  73. :data="tableData">
  74. <el-table-column
  75. fixed
  76. prop="type"
  77. label="编号"
  78. align="center"
  79. width="80">
  80. </el-table-column>
  81. <el-table-column
  82. prop="min"
  83. label="类型">
  84. </el-table-column>
  85. <el-table-column
  86. prop="value"
  87. label="是否启用"
  88. width="500">
  89. </el-table-column>
  90. <el-table-column
  91. prop="createAt"
  92. label="创建时间">
  93. </el-table-column>
  94. <el-table-column
  95. label="操作"
  96. prop="id"
  97. width="120">
  98. <template slot-scope="scope">
  99. <el-button
  100. size="mini"
  101. type="primary"
  102. :disabled="!isAuth('allocationList:update')"
  103. @click="amendWhether(scope.$index, scope.row)">编辑
  104. </el-button>
  105. </template>
  106. </el-table-column>
  107. </el-table>
  108. 修改弹框
  109. <el-dialog title="修改" :visible.sync="dialogFormVisible1" center>
  110. <el-form :model="form2">
  111. <el-form-item label="配置类型:" :label-width="formLabelWidth" >
  112. <el-input v-model="form2.min" style="width:65%;" readonly ></el-input>
  113. </el-form-item>
  114. <el-form-item label="是否启用:" :label-width="formLabelWidth" >
  115. <el-select v-model="form2.value" placeholder="请选择类型" style="width:65%;">
  116. <el-option v-for="item in values" :key="item.value" :label="item.label" :value="item.label">
  117. </el-option>
  118. </el-select>
  119. </el-form-item>
  120. </el-form>
  121. <div slot="footer" class="dialog-footer">
  122. <el-button @click="dialogFormVisible1 = false">取 消</el-button>
  123. <el-button type="primary" @click="WhetherNoticeTo()">确 定</el-button>
  124. </div>
  125. </el-dialog>
  126. </el-tab-pane> -->
  127. <el-tab-pane label="微信配置" name="fifth">
  128. <el-table v-loading="tableDataLoading" :data="tableData">
  129. <el-table-column fixed prop="type" label="编号" align="center" width="80">
  130. </el-table-column>
  131. <el-table-column prop="min" label="类型">
  132. </el-table-column>
  133. <el-table-column prop="value" label="内容" width="500">
  134. <template slot-scope="scope">
  135. <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
  136. </template>
  137. </el-table-column>
  138. <el-table-column prop="createAt" label="创建时间">
  139. </el-table-column>
  140. <el-table-column label="操作" prop="id" width="120">
  141. <template slot-scope="scope">
  142. <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
  143. @click="amend(scope.$index, scope.row)">编辑
  144. </el-button>
  145. </template>
  146. </el-table-column>
  147. </el-table>
  148. </el-tab-pane>
  149. <el-tab-pane label="支付宝配置" name="sixth">
  150. <el-table v-loading="tableDataLoading" :data="tableData">
  151. <el-table-column fixed prop="type" label="编号" align="center" width="80">
  152. </el-table-column>
  153. <el-table-column prop="min" label="类型">
  154. </el-table-column>
  155. <el-table-column prop="value" label="内容" width="500">
  156. <template slot-scope="scope">
  157. <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
  158. </template>
  159. </el-table-column>
  160. <el-table-column prop="createAt" label="创建时间">
  161. </el-table-column>
  162. <el-table-column label="操作" prop="id" width="120">
  163. <template slot-scope="scope">
  164. <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
  165. @click="amend(scope.$index, scope.row)">编辑
  166. </el-button>
  167. </template>
  168. </el-table-column>
  169. </el-table>
  170. </el-tab-pane>
  171. <el-tab-pane label="短信配置" name="seventh">
  172. <el-table v-loading="tableDataLoading" :data="tableData">
  173. <el-table-column fixed prop="type" label="编号" align="center" width="80">
  174. </el-table-column>
  175. <el-table-column prop="min" label="类型">
  176. </el-table-column>
  177. <el-table-column prop="value" label="内容" width="500">
  178. <template slot-scope="scope">
  179. <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
  180. </template>
  181. </el-table-column>
  182. <el-table-column prop="createAt" label="创建时间">
  183. </el-table-column>
  184. <el-table-column label="操作" prop="id" width="120">
  185. <template slot-scope="scope">
  186. <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
  187. @click="amend(scope.$index, scope.row)">编辑
  188. </el-button>
  189. </template>
  190. </el-table-column>
  191. </el-table>
  192. </el-tab-pane>
  193. <el-tab-pane label="协议配置" name="xieyi">
  194. <el-table v-loading="tableDataLoading" :data="tableData">
  195. <el-table-column fixed prop="type" label="编号" align="center" width="80">
  196. </el-table-column>
  197. <el-table-column prop="min" label="类型">
  198. </el-table-column>
  199. <el-table-column prop="value" label="内容" width="500">
  200. <template slot-scope="scope">
  201. <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
  202. </template>
  203. </el-table-column>
  204. <el-table-column prop="createAt" label="创建时间">
  205. </el-table-column>
  206. <el-table-column label="操作" prop="id" width="120">
  207. <template slot-scope="scope">
  208. <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
  209. @click="amend(scope.$index, scope.row)">编辑
  210. </el-button>
  211. </template>
  212. </el-table-column>
  213. </el-table>
  214. </el-tab-pane>
  215. <el-tab-pane label="APP消息推送配置" name="app">
  216. <el-table v-loading="tableDataLoading" :data="tableData">
  217. <el-table-column fixed prop="type" label="编号" align="center" width="80">
  218. </el-table-column>
  219. <el-table-column prop="min" label="类型">
  220. </el-table-column>
  221. <el-table-column prop="value" label="内容" width="500">
  222. <template slot-scope="scope">
  223. <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
  224. </template>
  225. </el-table-column>
  226. <el-table-column prop="createAt" label="创建时间">
  227. </el-table-column>
  228. <el-table-column label="操作" prop="id" width="120">
  229. <template slot-scope="scope">
  230. <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
  231. @click="amend(scope.$index, scope.row)">编辑
  232. </el-button>
  233. </template>
  234. </el-table-column>
  235. </el-table>
  236. </el-tab-pane>
  237. <el-tab-pane label="文件上传配置" name="wenjian">
  238. <el-table v-loading="tableDataLoading" :data="tableData">
  239. <el-table-column fixed prop="type" label="编号" align="center" width="80">
  240. </el-table-column>
  241. <el-table-column prop="min" label="类型">
  242. </el-table-column>
  243. <el-table-column prop="value" label="内容" width="500">
  244. <template slot-scope="scope">
  245. <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
  246. </template>
  247. </el-table-column>
  248. <el-table-column prop="createAt" label="创建时间">
  249. </el-table-column>
  250. <el-table-column label="操作" prop="id" width="120">
  251. <template slot-scope="scope">
  252. <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
  253. @click="amend(scope.$index, scope.row)">编辑
  254. </el-button>
  255. </template>
  256. </el-table-column>
  257. </el-table>
  258. </el-tab-pane>
  259. <el-tab-pane label="会员配置" name="vip">
  260. <el-table v-loading="tableDataLoading" :data="tableData">
  261. <el-table-column fixed prop="type" label="编号" align="center" width="80">
  262. </el-table-column>
  263. <el-table-column prop="min" label="类型">
  264. </el-table-column>
  265. <el-table-column prop="value" label="内容" width="500">
  266. <template slot-scope="scope">
  267. <div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
  268. </template>
  269. </el-table-column>
  270. <el-table-column prop="createAt" label="创建时间">
  271. </el-table-column>
  272. <el-table-column label="操作" prop="id" width="120">
  273. <template slot-scope="scope">
  274. <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
  275. @click="amend(scope.$index, scope.row)">编辑
  276. </el-button>
  277. </template>
  278. </el-table-column>
  279. </el-table>
  280. </el-tab-pane>
  281. <el-tab-pane label="开关配置" name="kaiguan">
  282. <el-table v-loading="tableDataLoading" :data="tableData">
  283. <el-table-column fixed prop="type" label="编号" align="center" width="80">
  284. </el-table-column>
  285. <el-table-column prop="min" label="类型" width="250">
  286. </el-table-column>
  287. <el-table-column prop="value" label="内容">
  288. </el-table-column>
  289. <el-table-column prop="createAt" label="创建时间" width="180">
  290. </el-table-column>
  291. <el-table-column label="操作" prop="id" width="120">
  292. <template slot-scope="scope">
  293. <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
  294. @click="amend(scope.$index, scope.row)">编辑
  295. </el-button>
  296. </template>
  297. </el-table-column>
  298. </el-table>
  299. </el-tab-pane>
  300. <el-tab-pane label="一键登录" name="login">
  301. <el-table v-loading="tableDataLoading" :data="tableData">
  302. <el-table-column fixed prop="type" label="编号" align="center" width="80">
  303. </el-table-column>
  304. <el-table-column prop="min" label="类型" width="250">
  305. </el-table-column>
  306. <el-table-column prop="value" label="内容">
  307. </el-table-column>
  308. <el-table-column prop="createAt" label="创建时间" width="180">
  309. </el-table-column>
  310. <el-table-column label="操作" prop="id" width="120">
  311. <template slot-scope="scope">
  312. <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
  313. @click="amend(scope.$index, scope.row)">编辑
  314. </el-button>
  315. </template>
  316. </el-table-column>
  317. </el-table>
  318. </el-tab-pane>
  319. <el-tab-pane label="图片配置" name="image">
  320. <el-table v-loading="tableDataLoading" :data="tableData">
  321. <el-table-column fixed prop="type" label="编号" align="center" width="80">
  322. </el-table-column>
  323. <el-table-column prop="min" label="类型" width="250">
  324. </el-table-column>
  325. <el-table-column prop="value" label="内容">
  326. <template slot-scope="scope">
  327. <div
  328. style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">
  329. {{scope.row.value}}
  330. </div>
  331. </template>
  332. </el-table-column>
  333. <el-table-column prop="createAt" label="创建时间" width="180">
  334. </el-table-column>
  335. <el-table-column label="操作" prop="id" width="120">
  336. <template slot-scope="scope">
  337. <el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
  338. @click="amend(scope.$index, scope.row)">编辑
  339. </el-button>
  340. </template>
  341. </el-table-column>
  342. </el-table>
  343. </el-tab-pane>
  344. </el-tabs>
  345. <!-- 修改弹框 -->
  346. <el-dialog title="修改" :visible.sync="dialogFormVisible" center>
  347. <el-form :model="form">
  348. <el-form-item label="配置类型:" :label-width="formLabelWidth">
  349. <el-input v-model="form.min" style="width:65%;" readonly></el-input>
  350. </el-form-item>
  351. <el-form-item label="内容:" :label-width="formLabelWidth">
  352. <quill-editor v-if="form.conditionFrom=='xieyi' " ref="myTextEditor" v-model="form.value" :options="quillOption"
  353. style="padding-bottom: 50px;height: 300px;width: 72%;display: inline-table;margin-bottom: 60px;">
  354. </quill-editor>
  355. <div v-else-if="form.conditionFrom=='kaiguan'">
  356. <div>
  357. <el-radio-group v-model="form.value">
  358. <el-radio label="是">是</el-radio>
  359. <el-radio label="否">否</el-radio>
  360. </el-radio-group>
  361. </div>
  362. </div>
  363. <div v-else-if="form.conditionFrom=='image'"
  364. style=" width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
  365. <el-upload class="avatar-uploader" v-model="form.value"
  366. :action="$http.adornUrl('alioss/upload')" :show-file-list="false"
  367. :on-success="handleAvatarSuccess">
  368. <img v-if="form.value" :src="form.value" class="avatar"
  369. style="border-radius: 6px;width: 140px;height: 140px;" />
  370. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  371. </el-upload>
  372. </div>
  373. <el-input v-else v-model="form.value" style="width:65%;"></el-input>
  374. <!-- <el-input v-model="form.value" style="width:65%;"></el-input> -->
  375. </el-form-item>
  376. </el-form>
  377. <div slot="footer" class="dialog-footer">
  378. <el-button @click="dialogFormVisible = false">取 消</el-button>
  379. <el-button type="primary" @click="amendNoticeTo()">确 定</el-button>
  380. </div>
  381. </el-dialog>
  382. </div>
  383. </template>
  384. <script>
  385. import {
  386. quillEditor
  387. } from 'vue-quill-editor'
  388. import 'quill/dist/quill.core.css'
  389. import 'quill/dist/quill.snow.css'
  390. import 'quill/dist/quill.bubble.css'
  391. import quillConfig from '../mission/quill-config.js'
  392. export default {
  393. name: 'news',
  394. components: {
  395. quillEditor
  396. },
  397. data() {
  398. return {
  399. openValue: '是',
  400. closeValue: '否',
  401. limit: 10,
  402. page: 0,
  403. min: '',
  404. value: '',
  405. id: '',
  406. condition: 'xitong',
  407. activeName: 'first',
  408. dialogFormVisible: false,
  409. dialogFormVisible1: false,
  410. tableDataLoading: true,
  411. formLabelWidth: '200px',
  412. form: {
  413. id: '',
  414. min: '',
  415. value: '',
  416. type: '',
  417. },
  418. form2: {
  419. id: '',
  420. min: '',
  421. value: '',
  422. type: '',
  423. },
  424. values: [{
  425. value: 1,
  426. label: '是'
  427. },
  428. {
  429. value: 2,
  430. label: '否'
  431. }
  432. ],
  433. tableData: [],
  434. quillOption: quillConfig,
  435. checkBoxData: [] //多选框选择的值
  436. }
  437. },
  438. methods: {
  439. handleSizeChange(val) {
  440. this.limit = val;
  441. this.dataSelect();
  442. },
  443. handleCurrentChange(val) {
  444. this.page = val - 1;
  445. this.dataSelect();
  446. },
  447. handleClick(tab, event) {
  448. if (tab._props.label == '全局系统配置') {
  449. this.condition = 'xitong'
  450. this.dataSelect()
  451. }
  452. if (tab._props.label == '首页配置') {
  453. this.condition = 'shouye'
  454. this.dataSelect()
  455. }
  456. if (tab._props.label == '微信配置') {
  457. this.condition = 'weixin'
  458. this.dataSelect()
  459. }
  460. if (tab._props.label == '支付宝配置') {
  461. this.condition = 'zhifubao'
  462. this.dataSelect()
  463. }
  464. if (tab._props.label == '短信配置') {
  465. this.condition = 'duanxin'
  466. this.dataSelect()
  467. }
  468. if (tab._props.label == '服务系统配置') {
  469. this.condition = 'renwu'
  470. this.dataSelect()
  471. }
  472. if (tab._props.label == '协议配置') {
  473. this.condition = 'xieyi'
  474. this.dataSelect()
  475. }
  476. if (tab._props.label == 'APP消息推送配置') {
  477. this.condition = 'push'
  478. this.dataSelect()
  479. }
  480. if (tab._props.label == '文件上传配置') {
  481. this.condition = 'oss'
  482. this.dataSelect()
  483. }
  484. if (tab._props.label == '服务费配置') {
  485. this.condition = 'fuwufei'
  486. this.dataSelect()
  487. }
  488. if (tab._props.label == '佣金配置') {
  489. this.condition = 'yongjin'
  490. this.dataSelect()
  491. }
  492. if (tab._props.label == '会员配置') {
  493. this.condition = 'vip'
  494. this.dataSelect()
  495. }
  496. if (tab._props.label == '开关配置') {
  497. this.condition = 'kaiguan'
  498. this.dataSelect()
  499. }
  500. if (tab._props.label == '图片配置') {
  501. this.condition = 'image'
  502. this.dataSelect()
  503. }
  504. },
  505. // 修改弹框
  506. amend(index, rows) {
  507. this.dialogFormVisible = true;
  508. this.form.id = rows.id;
  509. this.form.type = rows.type
  510. this.form.min = rows.min;
  511. this.form.value = rows.value;
  512. this.form.max = rows.max;
  513. this.form.createAt = rows.createAt;
  514. this.form.conditionFrom = rows.conditionFrom
  515. },
  516. // 修改
  517. amendNoticeTo() {
  518. this.$http({
  519. url: this.$http.adornUrl('common/update'),
  520. method: 'post',
  521. data: this.$http.adornData({
  522. 'id': this.form.id,
  523. 'type': this.form.type,
  524. 'value': this.form.value,
  525. 'min': this.form.min,
  526. 'max': this.form.max,
  527. 'createAt': this.form.createAt,
  528. 'conditionFrom': this.form.conditionFrom
  529. })
  530. }).then(({
  531. data
  532. }) => {
  533. if (data && data.code === 0) {
  534. this.dialogFormVisible = false
  535. this.$message({
  536. message: '操作成功',
  537. type: 'success',
  538. duration: 1500,
  539. onClose: () => {
  540. this.dataSelect()
  541. }
  542. })
  543. } else {
  544. this.$message.error(data.msg)
  545. }
  546. })
  547. },
  548. // 修改首页
  549. amendWhether(index, rows) {
  550. this.dialogFormVisible1 = true;
  551. this.form2.id = rows.id;
  552. this.form2.type = rows.type
  553. this.form2.min = rows.min;
  554. this.form2.value = rows.value;
  555. this.form2.max = rows.max;
  556. this.form2.createAt = rows.createAt;
  557. this.form2.conditionFrom = rows.conditionFrom
  558. },
  559. WhetherNoticeTo() {
  560. this.$http({
  561. url: this.$http.adornUrl('common/update'),
  562. method: 'post',
  563. data: this.$http.adornData({
  564. 'id': this.form2.id,
  565. 'type': this.form2.type,
  566. 'value': this.form2.value,
  567. 'min': this.form2.min,
  568. 'max': this.form2.max,
  569. 'createAt': this.form2.createAt,
  570. 'conditionFrom': this.form2.conditionFrom
  571. })
  572. }).then(({
  573. data
  574. }) => {
  575. if (data && data.code === 0) {
  576. this.dialogFormVisible1 = false
  577. this.$message({
  578. message: '操作成功',
  579. type: 'success',
  580. duration: 1500,
  581. onClose: () => {
  582. this.dataSelect()
  583. }
  584. })
  585. } else {
  586. this.$message.error(data.msg)
  587. }
  588. })
  589. },
  590. // 获取数据列表
  591. dataSelect() {
  592. this.tableDataLoading = true
  593. this.$http({
  594. url: this.$http.adornUrl(`common/type/condition/${this.condition}`),
  595. method: 'get',
  596. params: this.$http.adornParams({})
  597. }).then(({
  598. data
  599. }) => {
  600. if (data && data.code === 0) {
  601. this.tableDataLoading = false
  602. let returnData = data.data;
  603. this.tableData = returnData
  604. }
  605. })
  606. },
  607. // 图标上传
  608. handleAvatarSuccess(file) {
  609. this.form.value = file.data;
  610. },
  611. beforeAvatarUpload(file) {
  612. console.log('file.size',file.size)
  613. // const isJPG = file.type === 'image/jpeg';
  614. const isLt2M = file.size / 1024 < 100;
  615. // if (!isJPG) {
  616. // this.$message.error('上传头像图片只能是 JPG 格式!');
  617. // }
  618. if (!isLt2M) {
  619. this.$message.error('上传头像图片大小不能超过 100KB!');
  620. }
  621. return isLt2M;
  622. }
  623. },
  624. mounted() {
  625. this.dataSelect()
  626. }
  627. }
  628. </script>
  629. <style scoped="scoped">
  630. .eit {
  631. height: 120px;
  632. }
  633. </style>