@lambo-design/workflow-approve 1.0.0-beta.4 → 1.0.0-beta.6

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,302 @@
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">
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
+ 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,24 +1,24 @@
1
- <template>
2
- <div class="model-header">
3
- <slot></slot>
4
- </div>
5
- </template>
6
-
7
- <script>
8
- export default {
9
- name: "model-title"
10
- }
11
- </script>
12
-
13
- <style scoped lang="less">
14
- .model-header{
15
- background: #F2F2F2;
16
- line-height: 24px;
17
- padding: 10px 15px;
18
- font-size: 14px;
19
- font-weight: bolder;
20
- overflow: hidden;
21
- margin: 5px 0;
22
- color: #989898;
23
- }
24
- </style>
1
+ <template>
2
+ <div class="model-header">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: "model-title"
10
+ }
11
+ </script>
12
+
13
+ <style scoped lang="less">
14
+ .model-header{
15
+ background: #F2F2F2;
16
+ line-height: 24px;
17
+ padding: 10px 15px;
18
+ font-size: 14px;
19
+ font-weight: bolder;
20
+ overflow: hidden;
21
+ margin: 5px 0;
22
+ color: #989898;
23
+ }
24
+ </style>