@lambo-design/workflow-approve 1.0.0-beta.56 → 1.0.0-beta.58

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.
@@ -47,7 +47,7 @@
47
47
  </Row>
48
48
  <Row v-if="item.auditComment">
49
49
  <tooltip max-width="200px" placement="bottom-start">
50
- <span class="audit-name-style">{{ item.auditComment }}</span>
50
+ <span class="audit-comment-style">{{ item.auditComment }}</span>
51
51
  <div slot="content" style="white-space: normal"> {{ item.auditComment }}</div>
52
52
  </tooltip>
53
53
  </Row>
@@ -1,308 +1,312 @@
1
- <template>
2
- <div>
3
- <div style="font-size: small; background-color: #f0f0f0">
4
- &nbsp;
5
- <a style="color: black" @click="customCommentListModal = true"><Icon type="ios-browsers-outline" /> 常用意见</a> &nbsp;
6
- <Tooltip placement="bottom" v-if="attachmentFile" max-width="200">
7
- <div style="font-size: smaller" slot="content">支持扩展名:.pdf .doc .docx .txt .xls .xlsx .jpg .jpeg .png .gif</div>
8
- <UploadFile @upload-result="uploadFile" :upload-btn="false" :show-file-list="false" :multiple="true"
9
- :oss-server-context="smartFlowServerContext" :oss-file-put-url="ossFilePutUrl"></UploadFile>
10
- </Tooltip>
11
- </div>
12
- <Input v-model="auditOpinion" type="textarea" :autosize="{ minRows: 3, maxRows: 5 }" show-word-limit
13
- :maxlength="200" placeholder="处理意见" style="width: 100%"
14
- ></Input>
15
- <div>
16
- <div v-for="(item, index) in attachmentdata" :key="index" style="font-size: 14px">
17
- <span style="color:#2D8cF0 "> {{ item.fileName }}</span>
18
- <a @click="forRemoveAttachment(index)" style="font-size: 13px;"> &nbsp;.删除</a>
19
- </div>
20
- </div>
21
- <Modal v-model="customCommentListModal" title="常用意见" width="800px" footer-hide>
22
- <LamboPagingTable :requestSuccessCodes="requestSuccessCodes" ref="customCommentTable" :dataUrl="dataUrl"
23
- :columns="tableColumn">
24
- <div slot="buttons">
25
- <Button type="primary" ghost icon="md-add" @click="openDetailModal('create')">新增</Button>
26
- </div>
27
- </LamboPagingTable>
28
- </Modal>
29
- <Modal v-model="customCommentDetailModal" :title="customCommentDetailTitle" width="700px"
30
- @on-cancel="customCommentDetailCancel"
31
- @on-ok="customCommentDetailOk">
32
- <Card v-model="customCommentDetailModal" width="600px" dis-hover>
33
- <Form ref="customCommentForm" :model="customCommentDetailForm" :rules="customCommentRuleValidate"
34
- :label-width="100" label-position="right">
35
- <FormItem label="常用意见:" prop="commentContent">
36
- <Input type="textarea" v-model="customCommentDetailForm.commentContent" show-word-limit :maxlength="1000"
37
- style="width: 500px"/>
38
- </FormItem>
39
- <FormItem label="排序码:">
40
- <Input style="width: 100px" v-model="customCommentDetailForm.orders"/>
41
- </FormItem>
42
- </Form>
43
- </Card>
44
- </Modal>
45
- </div>
46
- </template>
47
-
48
- <script>
49
- import ajax from "@lambo-design/shared/utils/ajax";
50
- import { operateHref } from '@lambo-design/shared/utils/assist';
51
- import LamboPagingTable from "@lambo-design/paging-table";
52
- import UploadFile from "@lambo-design/upload-file";
53
-
54
- // 引入docx-preview插件
55
- let docx = require('docx-preview');
56
- export default {
57
- components: {
58
- LamboPagingTable,
59
- UploadFile
60
- },
61
- props: {
62
- attachmentFile:{
63
- type: Boolean,
64
- default: false,
65
- },
66
- actionUrl: {
67
- default: "/api/oss-server/file/put",
68
- },
69
- attachmentdata: {
70
- type: Array,
71
- default: function () {
72
- return []
73
- }
74
- },
75
- defaultAuditOpinion: {
76
- type: String,
77
- required: false,
78
- default: ''
79
- },
80
- smartFlowServerContext: {
81
- type: String,
82
- default: '/api/smart-flow-server',
83
- },
84
- },
85
- data() {
86
- return {
87
- requestSuccessCodes: [200, "200"],
88
- tempFileArr: [],
89
- fileList: [],
90
- ossFilePutUrl: '/manage/oss/file/put',
91
- auditOpinionText: '',
92
- customCommentListModal: false,
93
- auditOpinion: '',
94
- customCommentDetailModal: false,
95
- customCommentDetailTitle: '',
96
- dataUrl: this.smartFlowServerContext + '/manage/smartflowCustomComment/list',
97
- customCommentDetailForm: {
98
- id: '',
99
- commentContent: '',
100
- orders: 10
101
- },
102
- customCommentRuleValidate: {
103
- commentContent: [
104
- {required: true, trigger: "blur", message: "意见不能为空"},
105
- {max: 1000, message: "意见不能大于1000位", trigger: "blur"}
106
- ]
107
- },
108
- }
109
- },
110
- computed: {
111
- tableColumn() {
112
- let column = [];
113
- let self = this;
114
- column.push({
115
- title: '常用意见',
116
- key: "commentContent",
117
- minWidth: 150,
118
- align: 'center',
119
- });
120
- column.push({
121
- title: "意见类型",
122
- key: "commentType",
123
- width: 170,
124
- align: "center",
125
- render: (v, param) => {
126
- if (param.row.commentType === '10') {
127
- return v("span", '自定义');
128
- }
129
- return v("span", '系统预置')
130
- }
131
- });
132
- column.push({
133
- title: "排序码",
134
- key: "orders",
135
- width: 100,
136
- align: "center",
137
- });
138
-
139
- column.push({
140
- title: "修改时间",
141
- key: "updateTime",
142
- width: 170,
143
- align: "center",
144
- render: (v, param) => {
145
- if (param.row.updateTime) {
146
- let date = new Date(param.row.updateTime)
147
- let y = date.getFullYear() // 年
148
- let MM = date.getMonth() + 1 // 月
149
- MM = MM < 10 ? ('0' + MM) : MM
150
- let d = date.getDate() // 日
151
- d = d < 10 ? ('0' + d) : d
152
- let h = date.getHours() // 时
153
- h = h < 10 ? ('0' + h) : h
154
- let m = date.getMinutes()// 分
155
- m = m < 10 ? ('0' + m) : m
156
- let s = date.getSeconds()// 秒
157
- s = s < 10 ? ('0' + s) : s
158
- let state = y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
159
- return v("span", state);
160
- }
161
- return v("span", '')
162
- }
163
- });
164
-
165
- column.push({
166
- title: "操作", width: 160, align: 'center', tooltip: true,
167
- render: (h, {row}) => {
168
- if (row.commentType === '10'){
169
- return h("div", [
170
- operateHref(this, h, row, "修改", () => {
171
- this.openDetailModal('update', row);
172
- }, "primary"),
173
- operateHref(this, h, row, "删除", () => {
174
- this.deleteCustomComment(row);
175
- }, "error"),
176
- operateHref(this, h, row, "选择", () => {
177
- this.choose(row);
178
- }, "primary")
179
- ]);
180
- }else {
181
- return h("div", [
182
- operateHref(this, h, row, "选择", () => {
183
- this.choose(row);
184
- }, "primary")
185
- ]);
186
- }
187
-
188
- }
189
-
190
- });
191
-
192
- return column;
193
- },
194
- },
195
- methods: {
196
- openDetailModal(type, row) {
197
- this.customCommentDetailModal = true
198
- if (type === 'create') {
199
- this.customCommentDetailTitle = '新增常用意见'
200
- } else {
201
- this.customCommentDetailTitle = '修改常用意见'
202
- this.customCommentDetailForm.id = row.id
203
- this.customCommentDetailForm.commentContent = row.commentContent
204
- this.customCommentDetailForm.orders = row.orders
205
- }
206
- },
207
- customCommentDetailCancel() {
208
- this.getAuditOpinionForSelect()
209
- this.customCommentDetailForm = {
210
- id: '',
211
- commentContent: '',
212
- orders: 10
213
- }
214
- this.customCommentDetailModal = false
215
- },
216
- customCommentDetailOk() {
217
- const self = this
218
- self.$refs.customCommentForm.validate((valid) => {
219
- if (valid) {
220
- if (self.customCommentDetailForm.id) {
221
- ajax.post(self.smartFlowServerContext + "/manage/smartflowCustomComment/update", self.customCommentDetailForm).then((resp) => {
222
- if (resp.data.code === "200") {
223
- self.customCommentDetailForm = {
224
- id: '',
225
- commentContent: '',
226
- orders: 10
227
- }
228
- self.refreshTable()
229
- }
230
- }).catch(err => {
231
- console.log(err);
232
- })
233
- } else {
234
- ajax.post(self.smartFlowServerContext + "/manage/smartflowCustomComment/insert", self.customCommentDetailForm).then((resp) => {
235
- if (resp.data.code === "200") {
236
- self.customCommentDetailForm = {
237
- id: '',
238
- commentContent: '',
239
- orders: 10
240
- }
241
- self.refreshTable()
242
- }
243
- }).catch(err => {
244
- console.log(err);
245
- })
246
- }
247
- self.customCommentDetailModal = false
248
- }
249
- })
250
- },
251
- deleteCustomComment(row) {
252
- const self = this
253
- self.$Modal.confirm({
254
- title: '提示',
255
- content: `<p>确定要删除${row.commentContent}吗?</p>`,
256
- onOk: () => {
257
- ajax.post(self.smartFlowServerContext + "/manage/smartflowCustomComment/delete/" + row.id).then(function (resp) {
258
- if (resp.data.code === "200") {
259
- self.refreshTable()
260
- } else {
261
- self.$Message.error(resp.data.message);
262
- }
263
- }).catch(function (err) {
264
- self.$Message.error('删除失败,请联系应用管理员');
265
- });
266
- }
267
- });
268
- },
269
- refreshTable() {
270
- this.$refs.customCommentTable.tableRefresh()
271
- },
272
- choose(row) {
273
- this.auditOpinion = row.commentContent
274
- this.customCommentListModal = false
275
- },
276
- uploadFile(file){
277
- const self = this;
278
- file.forEach(item => {
279
- self.attachmentdata.push({
280
- fileName: item.fileName,
281
- fileId: item.fileCode,
282
- });
283
- })
284
- },
285
- forRemoveAttachment: function (index) {
286
- this.attachmentdata.splice(index, 1);
287
- },
288
- },
289
- mounted() {
290
- this.auditOpinion = this.defaultAuditOpinion
291
- },
292
- watch: {
293
- auditOpinionText(label) {
294
- this.auditOpinion = label;
295
- },
296
- auditOpinion(val) {
297
- this.$emit('input', val)
298
- }
299
- }
300
-
301
- }
302
- </script>
303
-
304
- <style scoped>
305
- /deep/ .upload-btn-box{
306
- padding-bottom: 0;
307
- }
308
- </style>
1
+ <template>
2
+ <div>
3
+ <div style="font-size: small; background-color: #f0f0f0">
4
+ &nbsp;
5
+ <a style="color: black" @click="customCommentListModal = true"><Icon type="ios-browsers-outline" /> 常用意见</a> &nbsp;
6
+ <Tooltip placement="bottom" v-if="attachmentFile" max-width="200">
7
+ <div style="font-size: smaller" slot="content">支持扩展名:.pdf .doc .docx .txt .xls .xlsx .jpg .jpeg .png .gif</div>
8
+ <UploadFile @upload-result="uploadFile" :upload-btn="false" :show-file-list="false" :multiple="true"
9
+ :oss-server-context="smartFlowServerContext" :oss-file-put-url="ossFilePutUrl"></UploadFile>
10
+ </Tooltip>
11
+ </div>
12
+ <Input v-model="auditOpinion" type="textarea" :autosize="{ minRows: 3, maxRows: 5 }" show-word-limit
13
+ :maxlength="200" placeholder="处理意见" style="width: 100%"
14
+ ></Input>
15
+ <div>
16
+ <div v-for="(item, index) in attachmentdata" :key="index" style="font-size: 14px">
17
+ <span style="color:#2D8cF0 "> {{ item.fileName }}</span>
18
+ <a @click="forRemoveAttachment(index)" style="font-size: 13px;"> &nbsp;.删除</a>
19
+ </div>
20
+ </div>
21
+ <Modal v-model="customCommentListModal" title="常用意见" width="800px" footer-hide>
22
+ <LamboPagingTable :requestSuccessCodes="requestSuccessCodes" ref="customCommentTable" :dataUrl="dataUrl"
23
+ :columns="tableColumn">
24
+ <div slot="buttons">
25
+ <Button type="primary" ghost icon="md-add" @click="openDetailModal('create')">新增</Button>
26
+ </div>
27
+ </LamboPagingTable>
28
+ </Modal>
29
+ <Modal v-model="customCommentDetailModal" :title="customCommentDetailTitle" width="700px"
30
+ @on-cancel="customCommentDetailCancel"
31
+ @on-ok="customCommentDetailOk">
32
+ <Card v-model="customCommentDetailModal" width="600px" dis-hover>
33
+ <Form ref="customCommentForm" :model="customCommentDetailForm" :rules="customCommentRuleValidate"
34
+ :label-width="100" label-position="right">
35
+ <FormItem label="常用意见:" prop="commentContent">
36
+ <Input type="textarea" v-model="customCommentDetailForm.commentContent" show-word-limit :maxlength="1000"
37
+ style="width: 500px"/>
38
+ </FormItem>
39
+ <FormItem label="排序码:">
40
+ <Input style="width: 100px" v-model="customCommentDetailForm.orders"/>
41
+ </FormItem>
42
+ </Form>
43
+ </Card>
44
+ </Modal>
45
+ </div>
46
+ </template>
47
+
48
+ <script>
49
+ import ajax from "@lambo-design/shared/utils/ajax";
50
+ import { operateHref } from '@lambo-design/shared/utils/assist';
51
+ import LamboPagingTable from "@lambo-design/paging-table";
52
+ import UploadFile from "@lambo-design/upload-file";
53
+
54
+ // 引入docx-preview插件
55
+ let docx = require('docx-preview');
56
+ export default {
57
+ components: {
58
+ LamboPagingTable,
59
+ UploadFile
60
+ },
61
+ props: {
62
+ attachmentFile:{
63
+ type: Boolean,
64
+ default: false,
65
+ },
66
+ actionUrl: {
67
+ default: "/api/oss-server/file/put",
68
+ },
69
+ attachmentdata: {
70
+ type: Array,
71
+ default: function () {
72
+ return []
73
+ }
74
+ },
75
+ defaultAuditOpinion: {
76
+ type: String,
77
+ required: false,
78
+ default: ''
79
+ },
80
+ smartFlowServerContext: {
81
+ type: String,
82
+ default: '/api/smart-flow-server',
83
+ },
84
+ },
85
+ data() {
86
+ return {
87
+ requestSuccessCodes: [200, "200"],
88
+ tempFileArr: [],
89
+ fileList: [],
90
+ ossFilePutUrl: '/manage/oss/file/put',
91
+ auditOpinionText: '',
92
+ customCommentListModal: false,
93
+ auditOpinion: '',
94
+ customCommentDetailModal: false,
95
+ customCommentDetailTitle: '',
96
+ dataUrl: this.smartFlowServerContext + '/manage/smartflowCustomComment/list',
97
+ customCommentDetailForm: {
98
+ id: '',
99
+ commentContent: '',
100
+ orders: 10
101
+ },
102
+ customCommentRuleValidate: {
103
+ commentContent: [
104
+ {required: true, trigger: "blur", message: "意见不能为空"},
105
+ {max: 1000, message: "意见不能大于1000位", trigger: "blur"}
106
+ ]
107
+ },
108
+ }
109
+ },
110
+ computed: {
111
+ tableColumn() {
112
+ let column = [];
113
+ let self = this;
114
+ column.push({
115
+ title: '常用意见',
116
+ key: "commentContent",
117
+ minWidth: 150,
118
+ align: 'center',
119
+ });
120
+ column.push({
121
+ title: "意见类型",
122
+ key: "commentType",
123
+ width: 170,
124
+ align: "center",
125
+ render: (v, param) => {
126
+ if (param.row.commentType === '10') {
127
+ return v("span", '自定义');
128
+ }
129
+ return v("span", '系统预置')
130
+ }
131
+ });
132
+ column.push({
133
+ title: "排序码",
134
+ key: "orders",
135
+ width: 100,
136
+ align: "center",
137
+ });
138
+
139
+ column.push({
140
+ title: "修改时间",
141
+ key: "updateTime",
142
+ width: 170,
143
+ align: "center",
144
+ render: (v, param) => {
145
+ if (param.row.updateTime) {
146
+ let date = new Date(param.row.updateTime)
147
+ let y = date.getFullYear() // 年
148
+ let MM = date.getMonth() + 1 // 月
149
+ MM = MM < 10 ? ('0' + MM) : MM
150
+ let d = date.getDate() // 日
151
+ d = d < 10 ? ('0' + d) : d
152
+ let h = date.getHours() // 时
153
+ h = h < 10 ? ('0' + h) : h
154
+ let m = date.getMinutes()// 分
155
+ m = m < 10 ? ('0' + m) : m
156
+ let s = date.getSeconds()// 秒
157
+ s = s < 10 ? ('0' + s) : s
158
+ let state = y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
159
+ return v("span", state);
160
+ }
161
+ return v("span", '')
162
+ }
163
+ });
164
+
165
+ column.push({
166
+ title: "操作", width: 160, align: 'center', tooltip: true,
167
+ render: (h, {row}) => {
168
+ if (row.commentType === '10'){
169
+ return h("div", [
170
+ operateHref(this, h, row, "修改", () => {
171
+ this.openDetailModal('update', row);
172
+ }, "primary"),
173
+ operateHref(this, h, row, "删除", () => {
174
+ this.deleteCustomComment(row);
175
+ }, "error"),
176
+ operateHref(this, h, row, "选择", () => {
177
+ this.choose(row);
178
+ }, "primary")
179
+ ]);
180
+ }else {
181
+ return h("div", [
182
+ operateHref(this, h, row, "选择", () => {
183
+ this.choose(row);
184
+ }, "primary")
185
+ ]);
186
+ }
187
+
188
+ }
189
+
190
+ });
191
+
192
+ return column;
193
+ },
194
+ },
195
+ methods: {
196
+ openDetailModal(type, row) {
197
+ this.customCommentDetailModal = true
198
+ if (type === 'create') {
199
+ this.customCommentDetailTitle = '新增常用意见'
200
+ } else {
201
+ this.customCommentDetailTitle = '修改常用意见'
202
+ this.customCommentDetailForm.id = row.id
203
+ this.customCommentDetailForm.commentContent = row.commentContent
204
+ this.customCommentDetailForm.orders = row.orders
205
+ }
206
+ },
207
+ customCommentDetailCancel() {
208
+ this.getAuditOpinionForSelect()
209
+ this.customCommentDetailForm = {
210
+ id: '',
211
+ commentContent: '',
212
+ orders: 10
213
+ }
214
+ this.customCommentDetailModal = false
215
+ },
216
+ customCommentDetailOk() {
217
+ const self = this
218
+ self.$refs.customCommentForm.validate((valid) => {
219
+ if (valid) {
220
+ if (self.customCommentDetailForm.id) {
221
+ ajax.post(self.smartFlowServerContext + "/manage/smartflowCustomComment/update", self.customCommentDetailForm).then((resp) => {
222
+ if (resp.data.code === "200") {
223
+ self.customCommentDetailForm = {
224
+ id: '',
225
+ commentContent: '',
226
+ orders: 10
227
+ }
228
+ self.refreshTable()
229
+ }
230
+ }).catch(err => {
231
+ console.log(err);
232
+ })
233
+ } else {
234
+ ajax.post(self.smartFlowServerContext + "/manage/smartflowCustomComment/insert", self.customCommentDetailForm).then((resp) => {
235
+ if (resp.data.code === "200") {
236
+ self.customCommentDetailForm = {
237
+ id: '',
238
+ commentContent: '',
239
+ orders: 10
240
+ }
241
+ self.refreshTable()
242
+ }
243
+ }).catch(err => {
244
+ console.log(err);
245
+ })
246
+ }
247
+ self.customCommentDetailModal = false
248
+ }
249
+ })
250
+ },
251
+ deleteCustomComment(row) {
252
+ const self = this
253
+ self.$Modal.confirm({
254
+ title: '提示',
255
+ content: `<p>确定要删除${row.commentContent}吗?</p>`,
256
+ onOk: () => {
257
+ ajax.post(self.smartFlowServerContext + "/manage/smartflowCustomComment/delete/" + row.id).then(function (resp) {
258
+ if (resp.data.code === "200") {
259
+ self.refreshTable()
260
+ } else {
261
+ self.$Message.error(resp.data.message);
262
+ }
263
+ }).catch(function (err) {
264
+ self.$Message.error('删除失败,请联系应用管理员');
265
+ });
266
+ }
267
+ });
268
+ },
269
+ refreshTable() {
270
+ this.$refs.customCommentTable.tableRefresh()
271
+ },
272
+ choose(row) {
273
+ this.auditOpinion = row.commentContent
274
+ this.customCommentListModal = false
275
+ },
276
+ uploadFile(file){
277
+ const self = this;
278
+ file.forEach(item => {
279
+ self.attachmentdata.push({
280
+ fileName: item.fileName,
281
+ fileId: item.fileCode,
282
+ });
283
+ })
284
+ },
285
+ forRemoveAttachment: function (index) {
286
+ this.attachmentdata.splice(index, 1);
287
+ },
288
+ },
289
+ mounted() {
290
+ this.auditOpinion = this.defaultAuditOpinion
291
+ },
292
+ watch: {
293
+ auditOpinionText(label) {
294
+ this.auditOpinion = label;
295
+ },
296
+ auditOpinion(val) {
297
+ this.$emit('input', val)
298
+ },
299
+ defaultAuditOpinion(val) {
300
+ this.auditOpinion = this.defaultAuditOpinion
301
+ this.$emit('input', val)
302
+ }
303
+ }
304
+
305
+ }
306
+ </script>
307
+
308
+ <style scoped>
309
+ /deep/ .upload-btn-box{
310
+ padding-bottom: 0;
311
+ }
312
+ </style>