再次推送功能开发
Showing
3 changed files
with
242 additions
and
0 deletions
... | @@ -159,5 +159,23 @@ export function getZjgcdyList (data) { | ... | @@ -159,5 +159,23 @@ export function getZjgcdyList (data) { |
159 | }) | 159 | }) |
160 | } | 160 | } |
161 | 161 | ||
162 | // 数据上报推送查询 | ||
163 | export function getSjsbPushList (data) { | ||
164 | return request({ | ||
165 | url: SERVER.SERVERAPI + '/rest/system/sysPushRecord/list', | ||
166 | method: 'post', | ||
167 | data | ||
168 | }) | ||
169 | } | ||
170 | |||
171 | // 数据上报推送 | ||
172 | export function pushSjsbRecord (data) { | ||
173 | return request({ | ||
174 | url: SERVER.SERVERAPI + '/rest/system/sysPushRecord/push', | ||
175 | method: 'post', | ||
176 | data | ||
177 | }) | ||
178 | } | ||
179 | |||
162 | 180 | ||
163 | 181 | ... | ... |
src/views/sjgx/sbxtsjts/djbcxdata.js
0 → 100644
1 | import filter from '@/utils/filter.js' | ||
2 | let vm = null | ||
3 | |||
4 | const sendThis = (_this) => { | ||
5 | vm = _this | ||
6 | } | ||
7 | class data extends filter { | ||
8 | constructor() { | ||
9 | super() | ||
10 | } | ||
11 | columns () { | ||
12 | return [ | ||
13 | { | ||
14 | label: '序号', | ||
15 | type: 'index', | ||
16 | width: '50', | ||
17 | render: (h, scope) => { | ||
18 | return ( | ||
19 | <div> | ||
20 | {(vm.pageData.currentPage - 1) * vm.pageData.pageSize + scope.$index + 1} | ||
21 | </div> | ||
22 | ) | ||
23 | } | ||
24 | }, | ||
25 | { | ||
26 | prop: "ywh", | ||
27 | label: "业务号", | ||
28 | width: '110', | ||
29 | }, | ||
30 | { | ||
31 | label: "权属状态", | ||
32 | width: '80', | ||
33 | render: (h, scope) => { | ||
34 | let obj = { | ||
35 | "0": { | ||
36 | text: '成功', | ||
37 | color: '#4BD863' | ||
38 | }, | ||
39 | "1": { | ||
40 | text: '失败', | ||
41 | color: 'red' | ||
42 | } | ||
43 | } | ||
44 | let textName = obj[scope.row.status]?.text || '' | ||
45 | let colorName = obj[scope.row.status]?.color || '' | ||
46 | return ( | ||
47 | <div> | ||
48 | <span style={`color:${colorName}`}>● </span> | ||
49 | <span >{textName}</span> | ||
50 | </div> | ||
51 | ) | ||
52 | } | ||
53 | }, | ||
54 | { | ||
55 | prop: "createtime", | ||
56 | label: "创建时间", | ||
57 | width: '180', | ||
58 | }, | ||
59 | { | ||
60 | prop: "json", | ||
61 | label: "json体", | ||
62 | }, | ||
63 | { | ||
64 | label: '操作', | ||
65 | width: '130', | ||
66 | render: (h, scope) => { | ||
67 | return ( | ||
68 | <div> | ||
69 | <el-button type="text" icon="el-icon-edit-outline" onClick={() => { vm.openDialog(scope.row) }}>推送</el-button> | ||
70 | </div> | ||
71 | ) | ||
72 | } | ||
73 | } | ||
74 | ] | ||
75 | } | ||
76 | |||
77 | } | ||
78 | let datas = new data() | ||
79 | export { | ||
80 | datas, | ||
81 | sendThis | ||
82 | } |
src/views/sjgx/sbxtsjts/sbxtsjts.vue
0 → 100644
1 | <template> | ||
2 | <div class="from-clues"> | ||
3 | <!-- 表单部分 --> | ||
4 | <div class="from-clues-header"> | ||
5 | <el-form :model="queryForm" ref="queryForm" @submit.native.prevent label-width="70px"> | ||
6 | <el-row> | ||
7 | <el-col :span="5"> | ||
8 | <el-form-item label="业务号"> | ||
9 | <el-input placeholder="请输入业务号" v-model="queryForm.ywh" clearable class="width100"> | ||
10 | </el-input> | ||
11 | </el-form-item> | ||
12 | </el-col> | ||
13 | |||
14 | <el-col :span="4" class="btnColRight"> | ||
15 | <el-form-item> | ||
16 | <el-button type="primary" native-type="submit" @click="handleSearch">查询</el-button> | ||
17 | </el-form-item> | ||
18 | </el-col> | ||
19 | </el-row> | ||
20 | </el-form> | ||
21 | </div> | ||
22 | <!-- 表格 --> | ||
23 | <div class="from-clues-content"> | ||
24 | <lb-table :page-size="pageData.size" class="loadingtext" @sort-change="handleSort" | ||
25 | :current-page.sync="pageData.current" :total="tableData.total" @size-change="handleSizeChange" | ||
26 | @p-current-change="handleCurrentChange" :column="tableData.columns" :data="tableData.data"> | ||
27 | </lb-table> | ||
28 | </div> | ||
29 | </div> | ||
30 | </template> | ||
31 | <script> | ||
32 | import { mapGetters } from "vuex"; | ||
33 | import table from "@/utils/mixin/table"; | ||
34 | import { datas, sendThis } from "./djbcxdata"; | ||
35 | import { getSjsbPushList, pushSjsbRecord } from "@/api/zhcx.js"; | ||
36 | |||
37 | export default { | ||
38 | name: "djbcx", | ||
39 | mixins: [table], | ||
40 | mounted () { | ||
41 | sendThis(this); | ||
42 | this.queryClick() | ||
43 | }, | ||
44 | data () { | ||
45 | return { | ||
46 | queryForm: { | ||
47 | qllx: "", | ||
48 | bdcdyh: "", | ||
49 | bdcqzh: "", | ||
50 | ywh: "", | ||
51 | }, | ||
52 | pageData: { | ||
53 | current: 1, | ||
54 | size: 10, | ||
55 | total: 0, | ||
56 | }, | ||
57 | tableData: { | ||
58 | columns: datas.columns(), | ||
59 | data: [], | ||
60 | }, | ||
61 | qllxs: [], | ||
62 | isDialog: false, | ||
63 | djbxxData: {}, | ||
64 | }; | ||
65 | }, | ||
66 | computed: { | ||
67 | ...mapGetters(["dictData"]), | ||
68 | }, | ||
69 | methods: { | ||
70 | // 初始化数据 | ||
71 | queryClick () { | ||
72 | this.$startLoading() | ||
73 | getSjsbPushList({ ...this.queryForm, ...this.pageData }).then((res) => { | ||
74 | this.$endLoading() | ||
75 | if (res.code === 200) { | ||
76 | let { total, records } = res.result; | ||
77 | this.tableData.data = records; | ||
78 | this.tableData.total = total; | ||
79 | } | ||
80 | }); | ||
81 | }, | ||
82 | handleSort (name, sort) { | ||
83 | console.log(name, sort); | ||
84 | }, | ||
85 | pushRecord (row, done) { | ||
86 | this.$startLoading() | ||
87 | pushSjsbRecord(row).then((res) => { | ||
88 | this.$endLoading() | ||
89 | if (res.code === 200) { | ||
90 | this.$message.success("推送成功"); | ||
91 | this.queryClick(); | ||
92 | done(); | ||
93 | } else { | ||
94 | this.$message.warning(res.message); | ||
95 | } | ||
96 | }); | ||
97 | }, | ||
98 | // 高级查询 | ||
99 | moreQueryClick () { }, | ||
100 | openDialog (scroll) { | ||
101 | |||
102 | const h = this.$createElement; | ||
103 | this.$msgbox({ | ||
104 | title: '推送', | ||
105 | message: h('p', null, [ | ||
106 | h('span', null, '是否推送 '), | ||
107 | h('i', { style: 'color: teal' }, scroll.ywh), | ||
108 | h('span', null, ' 记录') | ||
109 | ]), | ||
110 | showCancelButton: true, | ||
111 | confirmButtonText: '确定', | ||
112 | cancelButtonText: '取消', | ||
113 | beforeClose: (action, instance, done) => { | ||
114 | if (action === 'confirm') { | ||
115 | this.pushRecord(scroll, done); | ||
116 | } else { | ||
117 | done(); | ||
118 | } | ||
119 | } | ||
120 | }).then(action => {}); | ||
121 | |||
122 | }, | ||
123 | } | ||
124 | } | ||
125 | </script> | ||
126 | <style scoped lang="scss"> | ||
127 | @import "~@/styles/public.scss"; | ||
128 | |||
129 | .icon-circle { | ||
130 | position: relative; | ||
131 | } | ||
132 | |||
133 | .icon-circle::before { | ||
134 | content: ""; | ||
135 | width: 4px; | ||
136 | height: 4px; | ||
137 | border-radius: 50%; | ||
138 | background: #000; | ||
139 | top: 0px; | ||
140 | left: 0px; | ||
141 | } | ||
142 | </style> |
-
Please register or sign in to post a comment