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

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