todoManage.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. <style lang="less">
  2. @import '~@assets/less/common.less';
  3. </style>
  4. <template>
  5. <div class="search">
  6. <a-card>
  7. <!-- 查询 -->
  8. <div class="table-page-search-wrapper">
  9. <a-form layout="inline" @keyup.enter.native="handleSearch">
  10. <a-row :gutter="24">
  11. <a-col :md="6" :sm="8">
  12. <a-form-item label="关键字" prop="name">
  13. <a-input type="text" allowClear v-model="searchForm.name" placeholder="请输入业务信息或流程发起人" />
  14. </a-form-item>
  15. </a-col>
  16. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  17. <a-col :md="6" :sm="12">
  18. <a-button type="primary" style="left: 10px" @click="handleSearch" icon="search">查询</a-button>
  19. <a-button type="primary" @click="handleReset" icon="reload" style="margin-left: 8px;left: 10px"
  20. >重置</a-button
  21. >
  22. </a-col>
  23. </span>
  24. </a-row>
  25. </a-form>
  26. </div>
  27. <!--<a-row class="operation">
  28. <a-button @click="passAll" icon="md-checkmark-circle-outline">批量通过</a-button>
  29. <a-button @click="backAll" icon="md-close">批量驳回</a-button>
  30. <a-button @click="getDataList" icon="md-refresh">刷新</a-button>
  31. </a-row>-->
  32. <a-row :gutter="24">
  33. <a-col :md="24" :sm="24">
  34. <!-- :scroll="scroll" -->
  35. <a-table
  36. bordered
  37. :loading="loading"
  38. rowKey="id"
  39. :dataSource="data"
  40. :pagination="ipagination"
  41. @change="handleTableChange"
  42. ref="table"
  43. >
  44. <a-table-column title="#" width="5%" align="center">
  45. <template slot-scope="t, r, i">
  46. <span> {{ i + 1 }} </span>
  47. </template>
  48. </a-table-column>
  49. <a-table-column title="任务名称" dataIndex="name" width="10%" align="center">
  50. <template slot-scope="t">
  51. <span> {{ t }} </span>
  52. </template>
  53. </a-table-column>
  54. <a-table-column title="所属流程" dataIndex="processName" width="8%" align="center">
  55. <template slot-scope="t">
  56. <span> {{ t }} </span>
  57. </template>
  58. </a-table-column>
  59. <a-table-column title="业务信息" dataIndex="description" width="8%" align="center">
  60. <template slot-scope="t">
  61. <span> {{ t }} </span>
  62. </template>
  63. </a-table-column>
  64. <a-table-column title="委托代办人" dataIndex="owner" align="center" width="8%">
  65. <template slot-scope="t">
  66. <span> {{ t }} </span>
  67. </template>
  68. </a-table-column>
  69. <a-table-column title="流程发起人" dataIndex="applyer" width="8%" align="center">
  70. <template slot-scope="t">
  71. <span> {{ t }} </span>
  72. </template>
  73. </a-table-column>
  74. <!-- 优先级 -->
  75. <a-table-column
  76. title="优先级"
  77. dataIndex="priority"
  78. width="10%"
  79. align="center"
  80. key="so"
  81. :sorter="(a, b) => a.priority - b.priority"
  82. >
  83. <template slot-scope="t">
  84. <span v-if="t == 0" style="color: green;"> 普通 </span>
  85. <span v-else-if="t == 1" style="color: orange;"> 重要 </span>
  86. <span v-else-if="t == 2" style="color: red;"> 紧急 </span>
  87. <span v-else style="color: #999;"> 无 </span>
  88. </template>
  89. </a-table-column>
  90. <!-- 状态 -->
  91. <a-table-column
  92. title="状态"
  93. dataIndex="isSuspended"
  94. :width="100"
  95. align="center"
  96. key="z"
  97. :sorter="(a, b) => (Boolean(a.isSuspended) ? 0 : 1 - Boolean(b.isSuspended) ? 0 : 1)"
  98. >
  99. <template slot-scope="t">
  100. <a-tag color="green" v-if="!Boolean(t)">已激活</a-tag>
  101. <a-tag color="orange" v-if="Boolean(t)">已挂起</a-tag>
  102. </template>
  103. </a-table-column>
  104. <a-table-column title="创建时间" dataIndex="createTime" width="20%" align="center">
  105. <template slot-scope="t">
  106. <span>{{ t }}</span>
  107. </template>
  108. </a-table-column>
  109. <a-table-column title="操作" dataIndex="" align="center">
  110. <template slot-scope="t, r, i">
  111. <!-- <a href="javascript:void(0);" @click="passTask(r)" style="color: green">通过</a>
  112. <a-divider type="vertical" /> -->
  113. <a href="javascript:void(0);" @click="detail(r)">审批</a>
  114. <a-divider type="vertical" />
  115. <!--
  116. <span
  117. v-if="Boolean(r.isSuspended)"
  118. style="cursor: no-drop;color: #999999;"
  119. title="流程已被挂起,无法操作!">
  120. 通过
  121. <a-divider type="vertical" />驳回
  122. <a-divider type="vertical" />委托
  123. <a-divider type="vertical" />
  124. </span>
  125. <span v-else>
  126. <a href="javascript:void(0);" @click="passTask(r)" style="color: green">通过</a>
  127. <a-divider type="vertical" />
  128. <a href="javascript:void(0);" @click="backTask(r)" style="color: orange">驳回</a>
  129. <a-divider type="vertical" />
  130. <a href="javascript:void(0);" @click="delegateTask(r)" style="color: #00A0E9">委托</a>
  131. <a-divider type="vertical" />
  132. </span>-->
  133. <a href="javascript:void(0);" @click="history(r)" style="color: gray">审批历史</a>
  134. </template>
  135. </a-table-column>
  136. </a-table>
  137. </a-col>
  138. </a-row>
  139. </a-card>
  140. <!--审批历史-->
  141. <a-modal title="审批历史" v-model="modalLsVisible" :mask-closable="false" :width="'80%'" :footer="null">
  142. <div v-if="modalLsVisible">
  143. <component :is="historicDetail" :procInstId="procInstId"></component>
  144. </div>
  145. </a-modal>
  146. <!--流程表单-->
  147. <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="80%">
  148. <component
  149. :disabled="lcModa.disabled"
  150. v-if="lcModa.visible"
  151. :is="lcModa.formComponent"
  152. :processData="lcModa.processData"
  153. :isNew="lcModa.isNew"
  154. @close=";(lcModa.visible = false), (lcModa.disabled = false)"
  155. @getDataList="getDataList"
  156. ></component>
  157. </a-modal>
  158. <!-- 审批操作 -->
  159. <a-modal :title="modalTaskTitle" v-model="modalTaskVisible" :mask-closable="false" :width="500">
  160. <div v-if="modalTaskVisible">
  161. <a-form ref="form" :model="form" :label-width="85" :rules="formValidate">
  162. <a-form-item label="审批意见" prop="reason">
  163. <a-input type="textarea" v-model="form.comment" :rows="4" />
  164. </a-form-item>
  165. <a-form-item label="下一审批人" prop="assignees" v-show="showAssign" :error="error">
  166. <a-select v-model="form.assignees" placeholder="请选择" allowClear mode="multiple" :loading="userLoading">
  167. <a-select-option v-for="(item, i) in assigneeList" :key="i" :value="item.username">{{
  168. item.realname
  169. }}</a-select-option>
  170. </a-select>
  171. </a-form-item>
  172. <a-form-item label="下一审批人" v-show="isGateway">
  173. <span>分支网关处暂不支持自定义选择下一审批人,将发送给下一节点所有人</span>
  174. </a-form-item>
  175. <div v-show="form.type == 1">
  176. <a-form-item label="驳回至">
  177. <a-select v-model="form.backTaskKey" :loading="backLoading" @change="changeBackTask">
  178. <a-select-option v-for="(item, i) in backList" :key="i" :value="item.key">{{item.name}}
  179. </a-select-option>
  180. </a-select>
  181. </a-form-item>
  182. <a-form-item label="指定原节点审批人" prop="assignees" v-show="form.backTaskKey != -1" :error="error">
  183. <a-select v-model="form.assignees" placeholder="请选择" allowClear mode="multiple" :loading="userLoading">
  184. <a-select-option v-for="(item, i) in assigneeList" :key="i" :value="item.username">{{item.realname}}
  185. </a-select-option>
  186. </a-select>
  187. </a-form-item>
  188. </div>
  189. <a-form-item label="选择委托人" prop="userId" :error="error" v-show="form.type == 2">
  190. <JSelectUserByDep v-model="form.userId" :multi="false"></JSelectUserByDep>
  191. </a-form-item>
  192. <a-form-item label="消息通知">
  193. <a-checkbox v-model="form.sendMessage">站内消息通知</a-checkbox>
  194. <!-- <a-checkbox v-model="form.sendSms" disabled>短信通知</a-checkbox>
  195. <a-checkbox v-model="form.sendEmail" disabled>邮件通知</a-checkbox> -->
  196. </a-form-item>
  197. </a-form>
  198. </div>
  199. <div slot="footer">
  200. <a-button type="text" @click="modalTaskVisible = false">取消</a-button>
  201. <a-button type="primary" :loading="submitLoading" @click="handelSubmit">提交</a-button>
  202. </div>
  203. </a-modal>
  204. <outerForm-check ref="outerFormCheck" @refreshData="handleSearch" ></outerForm-check>
  205. </div>
  206. </template>
  207. <script>
  208. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  209. import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
  210. import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
  211. import outerFormCheck from '../../share/modal/OuterFormCheck'
  212. import {getEditorJumpUrl,getProjctManageUrl}from '../../../url.config'
  213. import { getAction } from '@/api/manage'
  214. export default {
  215. name: 'todo-manage',
  216. mixins: [activitiMixin, JeecgListMixin],
  217. components: { JSelectUserByDep, outerFormCheck },
  218. data() {
  219. return {
  220. editorJumpUrl: '', //申请详情跳转外部项目的地址
  221. openSearch: true,
  222. openTip: true,
  223. loading: true, // 表单加载状态
  224. modalTaskVisible: false,
  225. userLoading: false,
  226. backLoading: false,
  227. selectCount: 0, // 多选计数
  228. selectList: [], // 多选数据
  229. assigneeList: [],
  230. backList: [
  231. {
  232. key: '-1',
  233. name: '发起人'
  234. }
  235. ],
  236. error: '',
  237. showAssign: false,
  238. searchForm: {
  239. // 搜索框对应data对象
  240. name: ''
  241. },
  242. modalTaskTitle: '',
  243. modalTitle: '', // 添加或编辑标题
  244. form: {
  245. id: '',
  246. userId: '',
  247. procInstId: '',
  248. comment: '',
  249. type: 0,
  250. assignees: [],
  251. backTaskKey: '-1',
  252. sendMessage: true,
  253. sendSms: false,
  254. sendEmail: false
  255. },
  256. formValidate: {
  257. // 表单验证规则
  258. },
  259. submitLoading: false, // 添加或编辑提交状态
  260. data: [], // 表单数据
  261. total: 0, // 表单数据总数
  262. dictPriority: [],
  263. isGateway: false,
  264. lcModa: {
  265. title: '',
  266. disabled: false,
  267. visible: false,
  268. formComponent: null,
  269. isNew: false
  270. },
  271. url: {
  272. todoList: '/actTask/todoList',
  273. pass: '/actTask/pass',
  274. back: '/actTask/back',
  275. backToTask: '/actTask/backToTask',
  276. delegate: '/actTask/delegate',
  277. getNextNode: '/activiti_process/getNextNode',
  278. getNode: '/activiti_process/getNode/',
  279. getBackList: '/actTask/getBackList/',
  280. passAll: '/actTask/passAll/',
  281. backAll: '/actTask/backAll/',
  282. outformViewUrl:"/actBusiness/external/getViewUrl",
  283. },
  284. /*历史*/
  285. modalLsVisible: false,
  286. procInstId: ''
  287. }
  288. },
  289. mounted() {
  290. this.init()
  291. },
  292. methods: {
  293. forminitial() {
  294. this.form = {
  295. id: '',
  296. userId: '',
  297. procInstId: '',
  298. comment: '',
  299. type: 0,
  300. assignees: [],
  301. backTaskKey: '-1',
  302. sendMessage: true,
  303. sendSms: false,
  304. sendEmail: false
  305. }
  306. },
  307. init() {
  308. this.getDataList()
  309. },
  310. loadData() {},
  311. getDataList() {
  312. this.loading = true
  313. this.postFormAction(this.url.todoList, this.searchForm).then(res => {
  314. this.loading = false
  315. if (res.success) {
  316. this.data = res.result || []
  317. this.total = this.data.leading
  318. }
  319. })
  320. },
  321. handleTableChange(pagination, filters, sorter) {
  322. //分页、排序、筛选变化时触发
  323. if (Object.keys(sorter).length > 0) {
  324. this.isorter.column = sorter.field
  325. this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
  326. }
  327. this.ipagination = pagination
  328. // this.loadData();
  329. },
  330. handleSearch() {
  331. this.getDataList()
  332. },
  333. handleReset() {
  334. this.searchForm = {}
  335. // 重新加载数据
  336. this.getDataList()
  337. },
  338. showSelect(e) {
  339. this.selectList = e
  340. this.selectCount = e.length
  341. },
  342. clearSelectAll() {
  343. this.$refs.table.selectAll(false)
  344. },
  345. handelSubmit() {
  346. console.log('提交')
  347. this.submitLoading = true
  348. var formData = Object.assign({}, this.form)
  349. formData.assignees = formData.assignees.join(',')
  350. if (formData.type == 0) {
  351. // 通过
  352. if (this.showAssign && formData.assignees.length < 1) {
  353. this.$message.error('请至少选择一个审批人')
  354. this.submitLoading = false
  355. return
  356. } else {
  357. this.error = ''
  358. }
  359. this.postFormAction(this.url.pass, formData).then(res => {
  360. this.submitLoading = false
  361. if (res.success) {
  362. this.$message.success('操作成功')
  363. this.modalTaskVisible = false
  364. this.getDataList()
  365. }
  366. })
  367. } else if (formData.type == 1) {
  368. // 驳回
  369. if (formData.backTaskKey == '-1') {
  370. // 驳回至发起人
  371. this.postFormAction(this.url.back, formData).then(res => {
  372. this.submitLoading = false
  373. if (res.success) {
  374. this.$message.success('操作成功')
  375. this.modalTaskVisible = false
  376. this.getDataList()
  377. }
  378. })
  379. } else {
  380. // 自定义驳回
  381. if (formData.backTaskKey != '-1' && formData.assignees.length < 1) {
  382. this.$message.error('请至少选择一个审批人')
  383. this.submitLoading = false
  384. return
  385. } else {
  386. this.error = ''
  387. }
  388. this.postFormAction(this.url.backToTask, formData).then(res => {
  389. this.submitLoading = false
  390. if (res.success) {
  391. this.$message.success('操作成功')
  392. this.modalTaskVisible = false
  393. this.getDataList()
  394. }
  395. })
  396. }
  397. } else if (formData.type == 2) {
  398. // 委托
  399. if (!formData.userId) {
  400. this.$message.error('请选择一委托人')
  401. this.submitLoading = false
  402. return
  403. } else {
  404. this.error = ''
  405. }
  406. this.postFormAction(this.url.delegate, formData).then(res => {
  407. this.submitLoading = false
  408. if (res.success) {
  409. this.$message.success('操作成功')
  410. this.modalTaskVisible = false
  411. this.getDataList()
  412. }
  413. })
  414. }
  415. },
  416. detail(r) {
  417. if (!r.routeName) {
  418. this.$message.warning('该流程信息未配置表单,请联系开发人员!')
  419. return
  420. }
  421. r.operationType = '1' //代办
  422. if (r.routeName.indexOf('外部表单') != -1||r.tableName.indexOf('外部表单') != -1) {
  423. //其他项目的表单流程
  424. var id = r.tableId //项目管理合同数据id
  425. //打开MyIframe弹框
  426. //this.$refs.MyIframe.editorVisible = true
  427. //并传入地址参数
  428. //this.$refs.MyIframe.editorJumpUrlMy = getProjctManageUrl()+'/contract-process-view?id=' + id
  429. this.showOuterFormViewDlg(r.tableId, '业务流程审批:' + r.processName, r);
  430. } else if (r.routeName.indexOf('自定义') != -1) {
  431. //自定义的表单流程
  432. this.lcModa.disabled = true
  433. this.lcModa.title = '查看流程业务信息:' + r.processName
  434. let com = { component: () => import(`@/views/activiti/form/demoForm2`) }
  435. this.lcModa.formComponent = com.component
  436. this.lcModa.isNew = false
  437. this.lcModa.processData = r
  438. this.lcModa.visible = true
  439. } else {
  440. //固定的表单流程
  441. this.lcModa.disabled = true
  442. this.lcModa.title = '查看流程业务信息:' + r.processName
  443. this.lcModa.formComponent = this.getFormComponent(r.routeName).component
  444. this.lcModa.processData = r
  445. this.lcModa.isNew = false
  446. this.lcModa.visible = true
  447. }
  448. },
  449. passTask(v) {
  450. // console.log("v.id",v.id);
  451. // console.log("v.procInstId",v.procInstId);
  452. // console.log("v.priority",v.priority);
  453. // console.log("this.url.getNextNode",this.url.getNextNode);
  454. // console.log("this.url.getNextNode",this.url.getNextNode);
  455. this.forminitial()
  456. this.modalTaskTitle = '审批通过'
  457. this.form.id = v.id
  458. this.form.procInstId = v.procInstId
  459. this.form.priority = v.priority
  460. this.form.type = 0
  461. this.form.comment = "已同意";
  462. this.modalTaskVisible = true
  463. this.userLoading = true
  464. this.getAction(this.url.getNextNode, { procDefId: v.procDefId, currActId: v.key, procInstId: v.procInstId }).then(
  465. res => {
  466. this.userLoading = false
  467. if (res.success) {
  468. if (res.result.type == 3 || res.result.type == 4) {
  469. this.isGateway = true
  470. this.showAssign = false
  471. this.error = ''
  472. return
  473. }
  474. this.isGateway = false
  475. if (res.result.users && res.result.users.length > 0) {
  476. this.error = ''
  477. this.assigneeList = res.result.users
  478. // 默认勾选
  479. let ids = []
  480. res.result.users.forEach(e => {
  481. ids.push(e.username)
  482. })
  483. this.form.assignees = ids
  484. this.showAssign = true
  485. } else {
  486. this.form.assignees = []
  487. this.showAssign = false
  488. }
  489. }
  490. }
  491. )
  492. },
  493. changeBackTask(v) {
  494. // console.log(this.url.getNode)
  495. // console.log(v)
  496. // console.log(this.form.procInstId)
  497. if (v == '-1') {
  498. return
  499. }
  500. this.userLoading = true
  501. this.getAction(this.url.getNode + v + '&' + this.form.procInstId).then(res => {
  502. this.userLoading = false
  503. if (res.success) {
  504. if (res.result.users && res.result.users.length > 0) {
  505. this.assigneeList = res.result.users
  506. // 默认勾选
  507. let ids = []
  508. res.result.users.forEach(e => {
  509. ids.push(e.username)
  510. })
  511. this.form.assignees = ids
  512. }
  513. }
  514. })
  515. },
  516. backTask(v) {
  517. this.forminitial()
  518. this.modalTaskTitle = '审批驳回'
  519. this.form.id = v.id
  520. this.form.procInstId = v.procInstId
  521. this.form.procDefId = v.procDefId
  522. this.form.priority = v.priority
  523. this.form.type = 1
  524. this.showAssign = false
  525. this.modalTaskVisible = true
  526. // 获取可驳回节点
  527. this.backList = [
  528. {
  529. key: '-1',
  530. name: '发起人'
  531. }
  532. ]
  533. this.form.backTaskKey = '-1'
  534. this.backLoading = true
  535. this.getAction(this.url.getBackList + v.procInstId).then(res => {
  536. this.backLoading = false
  537. if (res.success) {
  538. res.result.forEach(e => {
  539. this.backList.push(e)
  540. })
  541. }
  542. })
  543. },
  544. delegateTask(v) {
  545. this.forminitial()
  546. this.modalTaskTitle = '委托他人代办'
  547. this.form.id = v.id
  548. this.form.procInstId = v.procInstId
  549. this.form.type = 2
  550. this.showAssign = false
  551. this.modalTaskVisible = true
  552. },
  553. history(v) {
  554. if (!v.procInstId) {
  555. this.$message.error('流程实例ID不存在')
  556. return
  557. }
  558. this.procInstId = v.procInstId
  559. this.modalLsVisible = true
  560. },
  561. passAll() {
  562. if (this.selectCount <= 0) {
  563. this.$message.warning('您还未选择要通过的数据')
  564. return
  565. }
  566. // 批量通过
  567. this.modalVisible = true
  568. this.$confirm({
  569. title: '确认通过',
  570. content: '您确认要通过所选的 ' + this.selectCount + ' 条数据? 注意:将默认分配给节点设定的所有可审批用户',
  571. loading: true,
  572. onOk: () => {
  573. let ids = ''
  574. this.selectList.forEach(function(e) {
  575. ids += e.id + ','
  576. })
  577. ids = ids.substring(0, ids.length - 1)
  578. this.postFormAction(this.url.passAll, { ids: ids }).then(res => {
  579. if (res.success) {
  580. this.$message.success('操作成功')
  581. this.modalVisible = false
  582. this.clearSelectAll()
  583. this.getDataList()
  584. }
  585. })
  586. }
  587. })
  588. },
  589. backAll() {
  590. if (this.selectCount <= 0) {
  591. this.$message.warning('您还未选择要驳回的数据')
  592. return
  593. }
  594. // 批量驳回
  595. this.modalVisible = true
  596. this.$confirm({
  597. title: '确认驳回',
  598. content: '您确认要驳回所选的 ' + this.selectCount + ' 条数据? 注意:所有流程将驳回至发起人',
  599. loading: true,
  600. onOk: () => {
  601. let procInstIds = ''
  602. this.selectList.forEach(function(e) {
  603. procInstIds += e.procInstId + ','
  604. })
  605. procInstIds = procInstIds.substring(0, procInstIds.length - 1)
  606. this.postFormAction(this.url.backAll, { procInstIds: procInstIds }).then(res => {
  607. if (res.success) {
  608. this.$message.success('操作成功')
  609. this.modalVisible = false
  610. this.clearSelectAll()
  611. this.getDataList()
  612. }
  613. })
  614. }
  615. })
  616. },
  617. showOuterFormViewDlg(tableId, title, processData){
  618. getAction(this.url.outformViewUrl,{tableId:tableId}).then(res=>{
  619. if (res.success){
  620. var url = res.result.url;
  621. var param = res.result.param;
  622. url = url+"?"+this.jsonToUrlParam(param);
  623. this.$refs.outerFormCheck.openDialog(url, title, processData);
  624. }else{
  625. this.$message.error(res.message);
  626. }
  627. });
  628. },
  629. jsonToUrlParam(query){
  630. var tmpArr = [];
  631. for (var i in query){
  632. var key = encodeURIComponent(i);
  633. var value = encodeURIComponent(query[i]);
  634. tmpArr.push(key+"="+value);
  635. }
  636. return tmpArr.join("&");
  637. },
  638. }
  639. }
  640. </script>