@lambo-design/workflow-approve 1.0.0-beta.9 → 1.0.0-beta.90

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.
@@ -1,302 +1,322 @@
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
- smartFlowServerContext: {
76
- type: String,
77
- default: '/api/smart-flow-server',
78
- },
79
- },
80
- data() {
81
- return {
82
- requestSuccessCodes: [200, "200"],
83
- tempFileArr: [],
84
- fileList: [],
85
- ossFilePutUrl: '/manage/oss/file/put',
86
- auditOpinionText: '',
87
- customCommentListModal: false,
88
- auditOpinion: '',
89
- customCommentDetailModal: false,
90
- customCommentDetailTitle: '',
91
- dataUrl: this.smartFlowServerContext + '/manage/smartflowCustomComment/list',
92
- customCommentDetailForm: {
93
- id: '',
94
- commentContent: '',
95
- orders: 10
96
- },
97
- customCommentRuleValidate: {
98
- commentContent: [
99
- {required: true, trigger: "blur", message: "意见不能为空"},
100
- {max: 1000, message: "意见不能大于1000位", trigger: "blur"}
101
- ]
102
- },
103
- }
104
- },
105
- computed: {
106
- tableColumn() {
107
- let column = [];
108
- let self = this;
109
- column.push({
110
- title: '常用意见',
111
- key: "commentContent",
112
- minWidth: 150,
113
- align: 'center',
114
- });
115
- column.push({
116
- title: "意见类型",
117
- key: "commentType",
118
- width: 170,
119
- align: "center",
120
- render: (v, param) => {
121
- if (param.row.commentType === '10') {
122
- return v("span", '自定义');
123
- }
124
- return v("span", '系统预置')
125
- }
126
- });
127
- column.push({
128
- title: "排序码",
129
- key: "orders",
130
- width: 100,
131
- align: "center",
132
- });
133
-
134
- column.push({
135
- title: "修改时间",
136
- key: "updateTime",
137
- width: 170,
138
- align: "center",
139
- render: (v, param) => {
140
- if (param.row.updateTime) {
141
- let date = new Date(param.row.updateTime)
142
- let y = date.getFullYear() // 年
143
- let MM = date.getMonth() + 1 // 月
144
- MM = MM < 10 ? ('0' + MM) : MM
145
- let d = date.getDate() // 日
146
- d = d < 10 ? ('0' + d) : d
147
- let h = date.getHours() // 时
148
- h = h < 10 ? ('0' + h) : h
149
- let m = date.getMinutes()//
150
- m = m < 10 ? ('0' + m) : m
151
- let s = date.getSeconds()// 秒
152
- s = s < 10 ? ('0' + s) : s
153
- let state = y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
154
- return v("span", state);
155
- }
156
- return v("span", '')
157
- }
158
- });
159
-
160
- column.push({
161
- title: "操作", width: 160, align: 'center', tooltip: true,
162
- render: (h, {row}) => {
163
- if (row.commentType === '10'){
164
- return h("div", [
165
- operateHref(this, h, row, "修改", () => {
166
- this.openDetailModal('update', row);
167
- }, "primary"),
168
- operateHref(this, h, row, "删除", () => {
169
- this.deleteCustomComment(row);
170
- }, "error"),
171
- operateHref(this, h, row, "选择", () => {
172
- this.choose(row);
173
- }, "primary")
174
- ]);
175
- }else {
176
- return h("div", [
177
- operateHref(this, h, row, "选择", () => {
178
- this.choose(row);
179
- }, "primary")
180
- ]);
181
- }
182
-
183
- }
184
-
185
- });
186
-
187
- return column;
188
- },
189
- },
190
- methods: {
191
- openDetailModal(type, row) {
192
- this.customCommentDetailModal = true
193
- if (type === 'create') {
194
- this.customCommentDetailTitle = '新增常用意见'
195
- } else {
196
- this.customCommentDetailTitle = '修改常用意见'
197
- this.customCommentDetailForm.id = row.id
198
- this.customCommentDetailForm.commentContent = row.commentContent
199
- this.customCommentDetailForm.orders = row.orders
200
- }
201
- },
202
- customCommentDetailCancel() {
203
- this.getAuditOpinionForSelect()
204
- this.customCommentDetailForm = {
205
- id: '',
206
- commentContent: '',
207
- orders: 10
208
- }
209
- this.customCommentDetailModal = false
210
- },
211
- customCommentDetailOk() {
212
- const self = this
213
- self.$refs.customCommentForm.validate((valid) => {
214
- if (valid) {
215
- if (self.customCommentDetailForm.id) {
216
- ajax.post(self.smartFlowServerContext + "/manage/smartflowCustomComment/update", self.customCommentDetailForm).then((resp) => {
217
- if (resp.data.code === "200") {
218
- self.customCommentDetailForm = {
219
- id: '',
220
- commentContent: '',
221
- orders: 10
222
- }
223
- self.refreshTable()
224
- }
225
- }).catch(err => {
226
- console.log(err);
227
- })
228
- } else {
229
- ajax.post(self.smartFlowServerContext + "/manage/smartflowCustomComment/insert", self.customCommentDetailForm).then((resp) => {
230
- if (resp.data.code === "200") {
231
- self.customCommentDetailForm = {
232
- id: '',
233
- commentContent: '',
234
- orders: 10
235
- }
236
- self.refreshTable()
237
- }
238
- }).catch(err => {
239
- console.log(err);
240
- })
241
- }
242
- self.customCommentDetailModal = false
243
- }
244
- })
245
- },
246
- deleteCustomComment(row) {
247
- const self = this
248
- self.$Modal.confirm({
249
- title: '提示',
250
- content: `<p>确定要删除${row.commentContent}吗?</p>`,
251
- onOk: () => {
252
- ajax.post(self.smartFlowServerContext + "/manage/smartflowCustomComment/delete/" + row.id).then(function (resp) {
253
- if (resp.data.code === "200") {
254
- self.refreshTable()
255
- } else {
256
- self.$Message.error(resp.data.message);
257
- }
258
- }).catch(function (err) {
259
- self.$Message.error('删除失败,请联系应用管理员');
260
- });
261
- }
262
- });
263
- },
264
- refreshTable() {
265
- this.$refs.customCommentTable.tableRefresh()
266
- },
267
- choose(row) {
268
- this.auditOpinion = row.commentContent
269
- this.customCommentListModal = false
270
- },
271
- uploadFile(file){
272
- const self = this;
273
- file.forEach(item => {
274
- self.attachmentdata.push({
275
- fileName: item.fileName,
276
- fileId: item.fileCode,
277
- });
278
- })
279
- },
280
- forRemoveAttachment: function (index) {
281
- this.attachmentdata.splice(index, 1);
282
- },
283
- },
284
- mounted() {
285
- },
286
- watch: {
287
- auditOpinionText(label) {
288
- this.auditOpinion = label;
289
- },
290
- auditOpinion(val) {
291
- this.$emit('input', val)
292
- }
293
- }
294
-
295
- }
296
- </script>
297
-
298
- <style scoped>
299
- /deep/ .upload-btn-box{
300
- padding-bottom: 0;
301
- }
302
- </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
+ value: {
63
+ type: String,
64
+ required: false,
65
+ default: ''
66
+ },
67
+ attachmentFile:{
68
+ type: Boolean,
69
+ default: false,
70
+ },
71
+ actionUrl: {
72
+ default: "/api/oss-server/file/put",
73
+ },
74
+ attachmentdata: {
75
+ type: Array,
76
+ default: function () {
77
+ return []
78
+ }
79
+ },
80
+ defaultAuditOpinion: {
81
+ type: String,
82
+ required: false,
83
+ default: ''
84
+ },
85
+ smartFlowServerContext: {
86
+ type: String,
87
+ default: '/api/smart-flow-server',
88
+ },
89
+ },
90
+ data() {
91
+ return {
92
+ requestSuccessCodes: [200, "200"],
93
+ tempFileArr: [],
94
+ fileList: [],
95
+ ossFilePutUrl: '/manage/oss/file/put',
96
+ auditOpinionText: '',
97
+ customCommentListModal: false,
98
+ auditOpinion: '',
99
+ customCommentDetailModal: false,
100
+ customCommentDetailTitle: '',
101
+ dataUrl: this.smartFlowServerContext + '/manage/smartflowCustomComment/list',
102
+ customCommentDetailForm: {
103
+ id: '',
104
+ commentContent: '',
105
+ orders: 10
106
+ },
107
+ customCommentRuleValidate: {
108
+ commentContent: [
109
+ {required: true, trigger: "blur", message: "意见不能为空"},
110
+ {max: 1000, message: "意见不能大于1000位", trigger: "blur"}
111
+ ]
112
+ },
113
+ }
114
+ },
115
+ computed: {
116
+ tableColumn() {
117
+ let column = [];
118
+ let self = this;
119
+ column.push({
120
+ title: '常用意见',
121
+ key: "commentContent",
122
+ minWidth: 150,
123
+ align: 'center',
124
+ });
125
+ column.push({
126
+ title: "意见类型",
127
+ key: "commentType",
128
+ width: 170,
129
+ align: "center",
130
+ render: (v, param) => {
131
+ if (param.row.commentType === '10') {
132
+ return v("span", '自定义');
133
+ }
134
+ return v("span", '系统预置')
135
+ }
136
+ });
137
+ column.push({
138
+ title: "排序码",
139
+ key: "orders",
140
+ width: 100,
141
+ align: "center",
142
+ });
143
+
144
+ column.push({
145
+ title: "修改时间",
146
+ key: "updateTime",
147
+ width: 170,
148
+ align: "center",
149
+ render: (v, param) => {
150
+ if (param.row.updateTime) {
151
+ let date = new Date(param.row.updateTime)
152
+ let y = date.getFullYear() //
153
+ let MM = date.getMonth() + 1 //
154
+ MM = MM < 10 ? ('0' + MM) : MM
155
+ let d = date.getDate() // 日
156
+ d = d < 10 ? ('0' + d) : d
157
+ let h = date.getHours() // 时
158
+ h = h < 10 ? ('0' + h) : h
159
+ let m = date.getMinutes()// 分
160
+ m = m < 10 ? ('0' + m) : m
161
+ let s = date.getSeconds()//
162
+ s = s < 10 ? ('0' + s) : s
163
+ let state = y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
164
+ return v("span", state);
165
+ }
166
+ return v("span", '')
167
+ }
168
+ });
169
+
170
+ column.push({
171
+ title: "操作", width: 160, align: 'center', tooltip: true,
172
+ render: (h, {row}) => {
173
+ if (row.commentType === '10'){
174
+ return h("div", [
175
+ operateHref(this, h, row, "修改", () => {
176
+ this.openDetailModal('update', row);
177
+ }, "primary"),
178
+ operateHref(this, h, row, "删除", () => {
179
+ this.deleteCustomComment(row);
180
+ }, "error"),
181
+ operateHref(this, h, row, "选择", () => {
182
+ this.choose(row);
183
+ }, "primary")
184
+ ]);
185
+ }else {
186
+ return h("div", [
187
+ operateHref(this, h, row, "选择", () => {
188
+ this.choose(row);
189
+ }, "primary")
190
+ ]);
191
+ }
192
+
193
+ }
194
+
195
+ });
196
+
197
+ return column;
198
+ },
199
+ },
200
+ methods: {
201
+ openDetailModal(type, row) {
202
+ this.customCommentDetailModal = true
203
+ if (type === 'create') {
204
+ this.customCommentDetailTitle = '新增常用意见'
205
+ } else {
206
+ this.customCommentDetailTitle = '修改常用意见'
207
+ this.customCommentDetailForm.id = row.id
208
+ this.customCommentDetailForm.commentContent = row.commentContent
209
+ this.customCommentDetailForm.orders = row.orders
210
+ }
211
+ },
212
+ customCommentDetailCancel() {
213
+ this.getAuditOpinionForSelect()
214
+ this.customCommentDetailForm = {
215
+ id: '',
216
+ commentContent: '',
217
+ orders: 10
218
+ }
219
+ this.customCommentDetailModal = false
220
+ },
221
+ customCommentDetailOk() {
222
+ const self = this
223
+ self.$refs.customCommentForm.validate((valid) => {
224
+ if (valid) {
225
+ if (self.customCommentDetailForm.id) {
226
+ ajax.post(self.smartFlowServerContext + "/manage/smartflowCustomComment/update", self.customCommentDetailForm).then((resp) => {
227
+ if (resp.data.code === "200") {
228
+ self.customCommentDetailForm = {
229
+ id: '',
230
+ commentContent: '',
231
+ orders: 10
232
+ }
233
+ self.refreshTable()
234
+ }
235
+ }).catch(err => {
236
+ console.log(err);
237
+ })
238
+ } else {
239
+ ajax.post(self.smartFlowServerContext + "/manage/smartflowCustomComment/insert", self.customCommentDetailForm).then((resp) => {
240
+ if (resp.data.code === "200") {
241
+ self.customCommentDetailForm = {
242
+ id: '',
243
+ commentContent: '',
244
+ orders: 10
245
+ }
246
+ self.refreshTable()
247
+ }
248
+ }).catch(err => {
249
+ console.log(err);
250
+ })
251
+ }
252
+ self.customCommentDetailModal = false
253
+ }
254
+ })
255
+ },
256
+ deleteCustomComment(row) {
257
+ const self = this
258
+ self.$Modal.confirm({
259
+ title: '提示',
260
+ content: `<p>确定要删除${row.commentContent}吗?</p>`,
261
+ onOk: () => {
262
+ ajax.post(self.smartFlowServerContext + "/manage/smartflowCustomComment/delete/" + row.id).then(function (resp) {
263
+ if (resp.data.code === "200") {
264
+ self.refreshTable()
265
+ } else {
266
+ self.$Message.error(resp.data.message);
267
+ }
268
+ }).catch(function (err) {
269
+ self.$Message.error('删除失败,请联系应用管理员');
270
+ });
271
+ }
272
+ });
273
+ },
274
+ refreshTable() {
275
+ this.$refs.customCommentTable.tableRefresh()
276
+ },
277
+ choose(row) {
278
+ this.auditOpinion = row.commentContent
279
+ this.customCommentListModal = false
280
+ },
281
+ uploadFile(file){
282
+ const self = this;
283
+ file.forEach(item => {
284
+ self.attachmentdata.push({
285
+ fileName: item.fileName,
286
+ fileId: item.fileCode,
287
+ });
288
+ })
289
+ self.$emit('handle-file', self.attachmentdata)
290
+ },
291
+ forRemoveAttachment: function (index) {
292
+ this.attachmentdata.splice(index, 1);
293
+ this.$emit('handle-file', this.attachmentdata)
294
+ },
295
+ },
296
+ mounted() {
297
+ this.auditOpinion = this.defaultAuditOpinion || this.value
298
+ },
299
+ watch: {
300
+ auditOpinionText(label) {
301
+ this.auditOpinion = label;
302
+ },
303
+ auditOpinion(val) {
304
+ this.$emit('input', val)
305
+ },
306
+ value(newVal) {
307
+ this.auditOpinion = newVal;
308
+ },
309
+ defaultAuditOpinion(val) {
310
+ this.auditOpinion = this.defaultAuditOpinion
311
+ this.$emit('input', val)
312
+ }
313
+ }
314
+
315
+ }
316
+ </script>
317
+
318
+ <style scoped>
319
+ /deep/ .upload-btn-box{
320
+ padding-bottom: 0;
321
+ }
322
+ </style>