cloud-web-corejs 1.0.54-dev.593 → 1.0.54-dev.594

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,207 +1,221 @@
1
- import formOplogTable from "@base/components/formOplog/index.vue";
2
- import preformDialog from "@base/views/bd/setting/form_script/preformDialog.vue";
3
- import projectTagView from "@base/components/projectTag/view.vue";
4
- import MenuKindDialog from "@base/views/bd/setting/menu_kind/dialog.vue";
5
- import {getBdFlag} from "@base/api/user";
6
- import otherAuthDialog from "../otherAuthDialog.vue";
7
-
8
- let modules = {};
9
- modules = {
10
- name: 'user_form_scriptEdit',
11
- props: {
12
- _dataId: [String, Number],
13
- formCode: String,
14
- formTemplate: Object,
15
- currentFormType: Object,
16
- readonly: Boolean,
17
- otherFlag:Boolean,
18
- scriptType: {
19
- type: Number,
20
- default: 0
21
- },
22
- },
23
- components: {formOplogTable, preformDialog, projectTagView, MenuKindDialog,otherAuthDialog},
24
- data() {
25
- return {
26
- isEdit: false,
27
- tabIndex: 'first',
28
- dataId: '',
29
- formScript: {
30
- scriptType: 0,
31
- enabled: true,
32
- formCode: null,
33
- menuKindCode: null,
34
- menuKindName: null,
35
- serviceName: null,
36
- transactions: 1,
37
- formScriptTagDTOs: []
38
- },
39
- showCodeEditor: false,
40
- showMenuKindDialog: false,
41
- isDev: true,
42
- showPreformDialog: false,
43
- menuKindAuth: {
44
- editAuth: 0
45
- },
46
- sid: null,
47
- showOtherAuthDialog:false
48
- };
49
- },
50
- created() {
51
- if (this._dataId && !isNaN(this._dataId)) {
52
- this.dataId = this._dataId;
53
- } else {
54
- if (this.formTemplate) {
55
- this.formScript.scriptType = 1;
56
- this.formScript.formCode = this.formTemplate.formCode;
57
- this.formScript.menuKindCode = this.formTemplate.menuKindCode;
58
- this.formScript.menuKindName = this.formTemplate.menuKindName;
59
- this.formScript.serviceName = this.formTemplate.serviceName;
60
- } else {
61
- this.formScript.scriptType = this.scriptType;
62
- this.formScript.formCode = 'intf';
63
- this.formScript.menuKindName = this.currentFormType?.name || null;
64
- this.formScript.menuKindCode = this.currentFormType?.menuKindCode || null;
65
- this.formScript.serviceName = this.currentFormType?.serviceName || null;
66
- }
67
-
68
- }
69
- },
70
- mounted() {
71
- this.getBdEnv();
72
- this.getData();
73
- },
74
- methods: {
75
- getData() {
76
- if (this.dataId && !isNaN(this.dataId)) {
77
- this.isEdit = true;
78
- this.$commonHttp({
79
- aes: true,
80
- url: USER_PREFIX + `/formScript/get`,
81
- method: `post`,
82
- data: {
83
- id: this.dataId
84
- },
85
- isLoading: true,
86
- modalStrictly: true,
87
- success: res => {
88
- this.formScript = res.objx || {};
89
- this.showCodeEditor = true;
90
- this.getMenuKindAuth(this.formScript.menuKindCode);
91
- //获取操作日志数据
92
- this.$refs['oplogTable'].initData({
93
- param: () => {
94
- return {
95
- logType: "FormScript",
96
- logObjCode: this.formScript.sid
97
- };
98
- }
99
- });
100
- }
101
- });
102
- } else {
103
- this.getMenuKindAuth(this.formScript.menuKindCode);
104
- this.showCodeEditor = true;
105
- }
106
- },
107
- saveData() {
108
- this.$refs.editForm.$baseValidate(valid => {
109
- if (valid) {
110
- this.openPreformDialog();
111
- }
112
- });
113
- },
114
- saveDataHandle(preformData) {
115
- var url = USER_PREFIX + (this.isEdit ? `/formScript/update` : `/formScript/save`);
116
- let formData = {
117
- ...this.formScript,
118
- logContent: preformData.logContent,
119
- transactions: preformData.transactions
120
- };
121
- this.$http({
122
- aes: true,
123
- url: url,
124
- method: `post`,
125
- data: formData,
126
- isLoading: true,
127
- success: res => {
128
- this.$message({
129
- message: res.content,
130
- type: 'success',
131
- duration: 500,
132
- onClose: t => {
133
- if (this.isEdit) {
134
- this.$baseReload();
135
- } else {
136
- this.$baseReload({
137
- updateParam: {
138
- _dataId: res.objx
139
- }
140
- });
141
- }
142
- }
143
- });
144
- }
145
- });
146
- },
147
- openPreformDialog() {
148
- this.showPreformDialog = true;
149
- },
150
- confirmPreformDialog(preformData) {
151
- this.saveDataHandle(preformData);
152
- },
153
- confirmInsertMenuKind(rows) {
154
- if (rows.length > 0) {
155
- let row = rows[0];
156
- this.$set(this.formScript, 'menuKindCode', row.menuKindCode);
157
- this.$set(this.formScript, 'menuKindName', row.name);
158
- }
159
- },
160
- getBdEnv() {
161
- getBdFlag({
162
- success: res => {
163
- this.isDev = res.objx == 1
164
- }
165
- });
166
- },
167
- getMenuKindAuth(menuKindCode) {
168
- if(this.otherFlag){
169
- this.getOtherMenuKindAuth();
170
- }else if (menuKindCode) {
171
- this.$http({
172
- aes: true,
173
- url: USER_PREFIX + '/menu_kind_auth/getAuth',
174
- method: `post`,
175
- data: {stringOne: menuKindCode},
176
- isLoading: true,
177
- success: res => {
178
- this.menuKindAuth = res.objx || {}
179
- }
180
- });
181
- }
182
- },
183
-
184
- getOtherMenuKindAuth() {
185
- if (this.otherFlag && this.formScript.sid) {
186
- this.$http({
187
- aes: true,
188
- url: USER_PREFIX + "/form_script_auth/getAuth",
189
- method: `post`,
190
- data: {stringOne: this.formScript.sid},
191
- isLoading: true,
192
- success: (res) => {
193
- this.menuKindAuth = res.objx || {};
194
- },
195
- });
196
- }
197
- },
198
- openOtherAuthDialog(){
199
- this.sid = this.formScript.sid
200
- this.showOtherAuthDialog = true
201
- },
202
- confirmOtherAuthDialog(){
203
- this.$baseReload()
204
- },
205
- }
206
- };
207
- export default modules
1
+ import formOplogTable from "@base/components/formOplog/index.vue";
2
+ import preformDialog from "@base/views/bd/setting/form_script/preformDialog.vue";
3
+ import projectTagView from "@base/components/projectTag/view.vue";
4
+ import MenuKindDialog from "@base/views/bd/setting/menu_kind/dialog.vue";
5
+ import {getBdFlag} from "@base/api/user";
6
+ import otherAuthDialog from "../otherAuthDialog.vue";
7
+
8
+ let modules = {};
9
+ modules = {
10
+ name: 'user_form_scriptEdit',
11
+ props: {
12
+ _dataId: [String, Number],
13
+ formCode: String,
14
+ formTemplate: Object,
15
+ currentFormType: Object,
16
+ // readonly: Boolean,
17
+ otherFlag:Boolean,
18
+ scriptType: {
19
+ type: Number,
20
+ default: 0
21
+ },
22
+ hData: Object,
23
+ },
24
+ components: {formOplogTable, preformDialog, projectTagView, MenuKindDialog,otherAuthDialog},
25
+ data() {
26
+ return {
27
+ isEdit: false,
28
+ tabIndex: 'first',
29
+ dataId: '',
30
+ formScript: {
31
+ scriptType: 0,
32
+ enabled: true,
33
+ formCode: null,
34
+ menuKindCode: null,
35
+ menuKindName: null,
36
+ serviceName: null,
37
+ transactions: 1,
38
+ formScriptTagDTOs: []
39
+ },
40
+ showCodeEditor: false,
41
+ showMenuKindDialog: false,
42
+ isDev: true,
43
+ showPreformDialog: false,
44
+ menuKindAuth: {
45
+ editAuth: 0
46
+ },
47
+ sid: null,
48
+ showOtherAuthDialog:false,
49
+ readonly: false,
50
+ };
51
+ },
52
+ created() {
53
+ if(this.hData){
54
+ this.readonly = true;
55
+ }else{
56
+ this.readonly = this.$attrs.readonly || false;
57
+ }
58
+ if (this._dataId && !isNaN(this._dataId)) {
59
+ this.dataId = this._dataId;
60
+ } else {
61
+ if (this.formTemplate) {
62
+ this.formScript.scriptType = 1;
63
+ this.formScript.formCode = this.formTemplate.formCode;
64
+ this.formScript.menuKindCode = this.formTemplate.menuKindCode;
65
+ this.formScript.menuKindName = this.formTemplate.menuKindName;
66
+ this.formScript.serviceName = this.formTemplate.serviceName;
67
+ } else {
68
+ this.formScript.scriptType = this.scriptType;
69
+ this.formScript.formCode = 'intf';
70
+ this.formScript.menuKindName = this.currentFormType?.name || null;
71
+ this.formScript.menuKindCode = this.currentFormType?.menuKindCode || null;
72
+ this.formScript.serviceName = this.currentFormType?.serviceName || null;
73
+ }
74
+
75
+ }
76
+ },
77
+ mounted() {
78
+ this.getBdEnv();
79
+ this.getData();
80
+ },
81
+ methods: {
82
+ getData() {
83
+ if (this.dataId && !isNaN(this.dataId)) {
84
+ this.isEdit = true;
85
+ this.$commonHttp({
86
+ aes: true,
87
+ url: USER_PREFIX + `/formScript/get`,
88
+ method: `post`,
89
+ data: {
90
+ id: this.dataId
91
+ },
92
+ isLoading: true,
93
+ modalStrictly: true,
94
+ success: res => {
95
+ this.formScript = res.objx || {};
96
+ this.showCodeEditor = true;
97
+ this.getMenuKindAuth(this.formScript.menuKindCode);
98
+ //获取操作日志数据
99
+ this.$refs['oplogTable'].initData({
100
+ param: () => {
101
+ return {
102
+ logType: "FormScript",
103
+ logObjCode: this.formScript.sid
104
+ };
105
+ }
106
+ });
107
+ }
108
+ });
109
+ } else if (this.hData){
110
+ this.isEdit = true;
111
+ this.formScript = this.$baseLodash.cloneDeep(this.hData);
112
+ this.dataId = this.hData.id
113
+ this.isInited = true;
114
+ this.getMenuKindAuth(this.formScript.menuKindCode);
115
+ this.showCodeEditor = true;
116
+ } else {
117
+ this.getMenuKindAuth(this.formScript.menuKindCode);
118
+ this.showCodeEditor = true;
119
+ }
120
+ },
121
+ saveData() {
122
+ this.$refs.editForm.$baseValidate(valid => {
123
+ if (valid) {
124
+ this.openPreformDialog();
125
+ }
126
+ });
127
+ },
128
+ saveDataHandle(preformData) {
129
+ var url = USER_PREFIX + (this.isEdit ? `/formScript/update` : `/formScript/save`);
130
+ let formData = {
131
+ ...this.formScript,
132
+ logContent: preformData.logContent,
133
+ transactions: preformData.transactions
134
+ };
135
+ this.$http({
136
+ aes: true,
137
+ url: url,
138
+ method: `post`,
139
+ data: formData,
140
+ isLoading: true,
141
+ success: res => {
142
+ this.$message({
143
+ message: res.content,
144
+ type: 'success',
145
+ duration: 500,
146
+ onClose: t => {
147
+ if (this.isEdit) {
148
+ this.$baseReload();
149
+ } else {
150
+ this.$baseReload({
151
+ updateParam: {
152
+ _dataId: res.objx
153
+ }
154
+ });
155
+ }
156
+ }
157
+ });
158
+ }
159
+ });
160
+ },
161
+ openPreformDialog() {
162
+ this.showPreformDialog = true;
163
+ },
164
+ confirmPreformDialog(preformData) {
165
+ this.saveDataHandle(preformData);
166
+ },
167
+ confirmInsertMenuKind(rows) {
168
+ if (rows.length > 0) {
169
+ let row = rows[0];
170
+ this.$set(this.formScript, 'menuKindCode', row.menuKindCode);
171
+ this.$set(this.formScript, 'menuKindName', row.name);
172
+ }
173
+ },
174
+ getBdEnv() {
175
+ getBdFlag({
176
+ success: res => {
177
+ this.isDev = res.objx == 1
178
+ }
179
+ });
180
+ },
181
+ getMenuKindAuth(menuKindCode) {
182
+ if(this.otherFlag){
183
+ this.getOtherMenuKindAuth();
184
+ }else if (menuKindCode) {
185
+ this.$http({
186
+ aes: true,
187
+ url: USER_PREFIX + '/menu_kind_auth/getAuth',
188
+ method: `post`,
189
+ data: {stringOne: menuKindCode},
190
+ isLoading: true,
191
+ success: res => {
192
+ this.menuKindAuth = res.objx || {}
193
+ }
194
+ });
195
+ }
196
+ },
197
+
198
+ getOtherMenuKindAuth() {
199
+ if (this.otherFlag && this.formScript.sid) {
200
+ this.$http({
201
+ aes: true,
202
+ url: USER_PREFIX + "/form_script_auth/getAuth",
203
+ method: `post`,
204
+ data: {stringOne: this.formScript.sid},
205
+ isLoading: true,
206
+ success: (res) => {
207
+ this.menuKindAuth = res.objx || {};
208
+ },
209
+ });
210
+ }
211
+ },
212
+ openOtherAuthDialog(){
213
+ this.sid = this.formScript.sid
214
+ this.showOtherAuthDialog = true
215
+ },
216
+ confirmOtherAuthDialog(){
217
+ this.$baseReload()
218
+ },
219
+ }
220
+ };
221
+ export default modules