cloud-web-corejs 1.0.54-dev.135 → 1.0.54-dev.136

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.
@@ -206,7 +206,7 @@
206
206
  <template #widget="obj">
207
207
  <component
208
208
  :is="getColumnWidgetName(obj.column.params.widget)"
209
- :field="obj.column.params.widget"
209
+ :field="getRowWidget(obj)"
210
210
  :form-model="globalModel.formModel"
211
211
  :designer="null"
212
212
  :key="obj.column.params.widget.id+'-'+obj.rowIndex"
@@ -105,6 +105,7 @@ modules = {
105
105
  showTreeMoveDialog: false,
106
106
  tableConfig: {},
107
107
  showTableFormDialogContent: true,
108
+ widgetMap: {},
108
109
  };
109
110
  },
110
111
  watch: {
@@ -167,6 +168,30 @@ modules = {
167
168
  this.unregisterFromRefList();
168
169
  },
169
170
  methods: {
171
+ getRowRefKey(row, name) {
172
+ let keyVal = row._X_ROW_KEY;
173
+ let key = name +"_"+ keyVal;
174
+ return key;
175
+ },
176
+ getTableRowWidgetRef(index, name) {
177
+ let row = this.getGridTable().getTableData().fullData[index]
178
+ let key = this.getRowRefKey(row, name);
179
+ return this.getWidgetRef(key);
180
+ },
181
+ getRowWidget(rowParam) {
182
+ let row = rowParam.row;
183
+ let params = rowParam.column.params;
184
+ let key = this.getRowRefKey(row, params.widget.options.name);
185
+ let widget = this.widgetMap[key];
186
+ if (!widget) {
187
+ this.$set(
188
+ this.widgetMap,
189
+ key,
190
+ this.$baseLodash.cloneDeep(params.widget)
191
+ );
192
+ }
193
+ return this.widgetMap[key];
194
+ },
170
195
  getGridTableName() {
171
196
  let formCode = this.getFormRef().reportTemplate.formCode;
172
197
  let tableName = formCode + "_" + this.widget.options.name;
@@ -76,10 +76,6 @@
76
76
  <el-input type="text" autocomplete="off" v-model="exportTemplate.etCompanyCode" clearable/>
77
77
  </el-form-item>
78
78
  </td>
79
-
80
-
81
- </tr>
82
- <tr>
83
79
  <th>
84
80
  {{ $t1('是否启用') }}
85
81
  </th>
@@ -91,21 +87,10 @@
91
87
  </el-radio-group>
92
88
  </el-form-item>
93
89
  </td>
94
- <th>
95
- {{ $t1('通知类型') }}
96
- </th>
97
- <td colspan="3">
98
- <el-form-item prop="ntType;" :rules="[{ required: false, trigger: 'blur' }]">
99
- <el-radio-group v-model="exportTemplate.ntType">
100
- <el-radio :label="0">{{ $t1('系统通知') }}</el-radio>
101
- <el-radio :label="1">{{ $t1('邮件通知') }}</el-radio>
102
- </el-radio-group>
103
- </el-form-item>
104
- </td>
105
90
  </tr>
106
91
  <tr>
107
92
  <th>{{ $t1('备注') }}</th>
108
- <td colspan="5">
93
+ <td colspan="7">
109
94
  <el-input type="textarea" :rows="2" :placeholder="$t1('请输入内容')" size="small"
110
95
  v-model="exportTemplate.remark"
111
96
  clearable></el-input>
@@ -203,7 +188,7 @@ export default {
203
188
  isEdit: false,
204
189
  tabIndex: 'first',
205
190
  dataId: '',
206
- exportTemplate: {enabled: true, etType: null,ntType:0},
191
+ exportTemplate: {enabled: true, etType: null},
207
192
  showCodeEditor: false,
208
193
  showHiprintDesignDialog: false,
209
194
  printTypes: [2, 3, 6, 7, 8, 9],
@@ -136,10 +136,6 @@ export default {
136
136
  7: this.$t1('拼多多打印'),
137
137
  8: this.$t1('唯品会打印'),
138
138
  9: this.$t1('小红书打印')
139
- },
140
- ntTypeMap: {
141
- 0: this.$t1('系统通知'),
142
- 1: this.$t1('邮件通知')
143
139
  }
144
140
  };
145
141
  },
@@ -206,16 +202,6 @@ export default {
206
202
  },
207
203
  },
208
204
  },
209
- {
210
- title: this.$t1('通知类型'),
211
- field: "ntType",
212
- width: 250,
213
- slots: {
214
- default: ({row}) => {
215
- return this.ntTypeMap[row.ntType] || "";
216
- },
217
- },
218
- },
219
205
  {
220
206
  title: this.$t1('组织编码'),
221
207
  field: "etCompanyCode",
@@ -1,187 +1,188 @@
1
- <template>
2
- <div class="detail-wrap">
3
- <el-form ref="editForm" :model="notifyTemplate">
4
- <div class="d-header clearfix">
5
- <div class="fl">
6
- <i class="el-icon-info"/>
7
- {{ dataId ? $t1('查看通知模板') : $t1('新增通知模板') }}
8
- </div>
9
- <div class="fr">
10
- <el-button type="primary" plain class="button-sty" @click="$baseReload()" icon="el-icon-refresh-right">
11
- {{ $t1('重置') }}
12
- </el-button>
13
- <el-button type="primary" class="button-sty" icon="el-icon-check" @click="saveData">{{ $t1('保存') }}
14
- </el-button>
15
- </div>
16
- </div>
17
- <baseTabs>
18
- <baseTabPane :label="$t1('基本信息')">
19
- <template #default>
20
- <table class="table-detail">
21
- <tbody>
22
- <tr>
23
- <th><em class="f-red">*</em>{{ $t1('通知模板编码') }}</th>
24
- <td>
25
- <el-form-item prop="notifyType" :rules="[{ required: true, trigger: 'blur' }]">
26
- <el-input type="text" autocomplete="off" v-model="notifyTemplate.notifyType" clearable/>
27
- </el-form-item>
28
- </td>
29
- <th>
30
- <em class="f-red">*</em>
31
- {{ $t1('通知模板名称') }}
32
- </th>
33
- <td>
34
- <el-form-item prop="ntName" :rules="[{ required: true, trigger: 'blur' }]">
35
- <el-input type="text" autocomplete="off" v-model="notifyTemplate.ntName" clearable/>
36
- </el-form-item>
37
- </td>
38
- <th>{{ $t1('是否启用') }}</th>
39
- <td>
40
- <el-form-item prop="enabled" :rules="[{ required: false, trigger: 'blur' }]">
41
- <el-radio-group v-model="notifyTemplate.enabled">
42
- <el-radio :label="true">{{ $t1('启用') }}</el-radio>
43
- <el-radio :label="false">{{ $t1('禁用') }}</el-radio>
44
- </el-radio-group>
45
- </el-form-item>
46
- </td>
47
- </tr>
48
- <tr>
49
- <th><em class="f-red">*</em>{{ $t1('通知内容') }}</th>
50
- <td colspan="5">
51
- <el-form-item prop="content" :rules="[{ required: true, trigger: 'blur' }]">
52
- <el-input type="textarea" :rows="2" size="small"
53
- v-model="notifyTemplate.content"
54
- clearable></el-input>
55
- </el-form-item>
56
- </td>
57
- </tr>
58
- <tr>
59
- <th>{{ $t1('跳转内容') }}</th>
60
- <td colspan="5">
61
- <el-form-item prop="jumpContent" :rules="[{ required: false, trigger: 'blur' }]">
62
- <el-input type="textarea" :rows="2" size="small"
63
- v-model="notifyTemplate.jumpContent"
64
- clearable></el-input>
65
- </el-form-item>
66
- </td>
67
- </tr>
68
- <tr>
69
- <th>{{ $t1('备注') }}</th>
70
- <td colspan="5">
71
- <el-input type="textarea" :rows="2" size="small" v-model="notifyTemplate.remark"
72
- clearable></el-input>
73
- </td>
74
- </tr>
75
- <tr>
76
- <th>
77
- {{ $t1('脚本(获取通知人)') }}
78
- <!-- <scriptDescriptionButton path="static/readme/PushSetting.txt"></scriptDescriptionButton>-->
79
- <scriptTestButton :script.sync="notifyTemplate.script"></scriptTestButton>
80
- </th>
81
- <td colspan="7">
82
- <el-form-item prop="script" :rules="[{ required: false, trigger: 'blur' }]">
83
- <code-editor mode="java" :readonly="!1" v-model="notifyTemplate.script"
84
- v-if="showCodeEditor"></code-editor>
85
- </el-form-item>
86
- </td>
87
- </tr>
88
- <tr>
89
- <th>{{ $t1('创建人') }}</th>
90
- <td>{{ notifyTemplate.createBy }}</td>
91
- <th>{{ $t1('创建时间') }}</th>
92
- <td>{{ notifyTemplate.createDate }}</td>
93
- <th>{{ $t1('更新人') }}</th>
94
- <td>{{ notifyTemplate.modifyBy }}</td>
95
- <th>{{ $t1('更新时间') }}</th>
96
- <td>{{ notifyTemplate.modifyDate }}</td>
97
- </tr>
98
- </tbody>
99
- </table>
100
- </template>
101
- </baseTabPane>
102
- </baseTabs>
103
- </el-form>
104
- </div>
105
- </template>
106
-
107
- <script>
108
- export default {
109
- name: 'notify_templateEdit',
110
- props: {
111
- _dataId: [String, Number]
112
- },
113
- components: {},
114
- data() {
115
- return {
116
- isEdit: false,
117
- tabIndex: 'first',
118
- dataId: '',
119
- notifyTemplate: {
120
- enabled: true
121
- },
122
- showCodeEditor: false
123
- };
124
- },
125
- created() {
126
- if (this._dataId && !isNaN(this._dataId)) this.dataId = this._dataId;
127
- },
128
- mounted() {
129
- this.getData();
130
- },
131
- methods: {
132
- getData() {
133
- if (this.dataId && !isNaN(this.dataId)) {
134
- this.isEdit = true;
135
- this.$commonHttp({
136
- url: USER_PREFIX + `/notify_template/get`,
137
- method: `post`,
138
- data: {
139
- id: this.dataId
140
- },
141
- isLoading: true,
142
- modalStrictly: true,
143
- success: res => {
144
- this.notifyTemplate = res.objx || {};
145
- this.showCodeEditor = true;
146
- }
147
- });
148
- } else {
149
- this.showCodeEditor = true;
150
- }
151
- },
152
- saveData() {
153
- this.$refs.editForm.$baseValidate(valid => {
154
- if (valid) {
155
- this.$baseConfirm(this.$t1('您确定要保存吗?')).then(() => {
156
- var url = USER_PREFIX + (this.isEdit ? `/notify_template/update` : `/notify_template/save`);
157
- this.$http({
158
- url: url,
159
- method: `post`,
160
- data: this.notifyTemplate,
161
- isLoading: true,
162
- success: res => {
163
- this.$message({
164
- message: res.content,
165
- type: 'success',
166
- duration: 500,
167
- onClose: t => {
168
- if (this.isEdit) {
169
- this.$baseReload();
170
- } else {
171
- this.$baseReload({
172
- updateParam: {
173
- _dataId: res.objx
174
- }
175
- });
176
- }
177
- }
178
- });
179
- }
180
- });
181
- });
182
- }
183
- });
184
- }
185
- }
186
- };
187
- </script>
1
+ <template>
2
+ <div class="detail-wrap">
3
+ <el-form ref="editForm" :model="notifyTemplate">
4
+ <div class="d-header clearfix">
5
+ <div class="fl">
6
+ <i class="el-icon-info"/>
7
+ {{ dataId ? $t1('查看通知模板') : $t1('新增通知模板') }}
8
+ </div>
9
+ <div class="fr">
10
+ <el-button type="primary" plain class="button-sty" @click="$baseReload()" icon="el-icon-refresh-right">
11
+ {{ $t1('重置') }}
12
+ </el-button>
13
+ <el-button type="primary" class="button-sty" icon="el-icon-check" @click="saveData">{{ $t1('保存') }}
14
+ </el-button>
15
+ </div>
16
+ </div>
17
+ <baseTabs>
18
+ <baseTabPane :label="$t1('基本信息')">
19
+ <template #default>
20
+ <table class="table-detail">
21
+ <tbody>
22
+ <tr>
23
+ <th><em class="f-red">*</em>{{ $t1('通知模板编码') }}</th>
24
+ <td>
25
+ <el-form-item prop="notifyType" :rules="[{ required: true, trigger: 'blur' }]">
26
+ <el-input type="text" autocomplete="off" v-model="notifyTemplate.notifyType" clearable/>
27
+ </el-form-item>
28
+ </td>
29
+ <th>
30
+ <em class="f-red">*</em>
31
+ {{ $t1('通知模板名称') }}
32
+ </th>
33
+ <td>
34
+ <el-form-item prop="ntName" :rules="[{ required: true, trigger: 'blur' }]">
35
+ <el-input type="text" autocomplete="off" v-model="notifyTemplate.ntName" clearable/>
36
+ </el-form-item>
37
+ </td>
38
+ <th>{{ $t1('是否启用') }}</th>
39
+ <td>
40
+ <el-form-item prop="enabled" :rules="[{ required: false, trigger: 'blur' }]">
41
+ <el-radio-group v-model="notifyTemplate.enabled">
42
+ <el-radio :label="true">{{ $t1('启用') }}</el-radio>
43
+ <el-radio :label="false">{{ $t1('禁用') }}</el-radio>
44
+ </el-radio-group>
45
+ </el-form-item>
46
+ </td>
47
+ </tr>
48
+ <tr>
49
+ <th><em class="f-red">*</em>{{ $t1('通知内容') }}</th>
50
+ <td colspan="5">
51
+ <el-form-item prop="content" :rules="[{ required: true, trigger: 'blur' }]">
52
+ <el-input type="textarea" :rows="2" size="small"
53
+ v-model="notifyTemplate.content"
54
+ clearable></el-input>
55
+ </el-form-item>
56
+ </td>
57
+ </tr>
58
+ <tr>
59
+ <th>{{ $t1('跳转内容') }}</th>
60
+ <td colspan="5">
61
+ <el-form-item prop="jumpContent" :rules="[{ required: false, trigger: 'blur' }]">
62
+ <el-input type="textarea" :rows="2" size="small"
63
+ v-model="notifyTemplate.jumpContent"
64
+ clearable></el-input>
65
+ </el-form-item>
66
+ </td>
67
+ </tr>
68
+ <tr>
69
+ <th>{{ $t1('备注') }}</th>
70
+ <td colspan="5">
71
+ <el-input type="textarea" :rows="2" size="small" v-model="notifyTemplate.remark"
72
+ clearable></el-input>
73
+ </td>
74
+ </tr>
75
+ <tr>
76
+ <th>
77
+ {{ $t1('脚本(获取通知人)') }}
78
+ <!-- <scriptDescriptionButton path="static/readme/PushSetting.txt"></scriptDescriptionButton>-->
79
+ <scriptTestButton :script.sync="notifyTemplate.script"></scriptTestButton>
80
+ </th>
81
+ <td colspan="7">
82
+ <el-form-item prop="script" :rules="[{ required: false, trigger: 'blur' }]">
83
+ <code-editor mode="java" :readonly="!1" v-model="notifyTemplate.script"
84
+ v-if="showCodeEditor"></code-editor>
85
+ </el-form-item>
86
+ </td>
87
+ </tr>
88
+ <tr>
89
+ <th>{{ $t1('创建人') }}</th>
90
+ <td>{{ notifyTemplate.createBy }}</td>
91
+ <th>{{ $t1('创建时间') }}</th>
92
+ <td>{{ notifyTemplate.createDate }}</td>
93
+ <th>{{ $t1('更新人') }}</th>
94
+ <td>{{ notifyTemplate.modifyBy }}</td>
95
+ <th>{{ $t1('更新时间') }}</th>
96
+ <td>{{ notifyTemplate.modifyDate }}</td>
97
+ </tr>
98
+ </tbody>
99
+ </table>
100
+ </template>
101
+ </baseTabPane>
102
+ </baseTabs>
103
+ </el-form>
104
+ </div>
105
+ </template>
106
+
107
+ <script>
108
+ export default {
109
+ name: 'notify_templateEdit',
110
+ props: {
111
+ _dataId: [String, Number]
112
+ },
113
+ components: {},
114
+ data() {
115
+ return {
116
+ isEdit: false,
117
+ tabIndex: 'first',
118
+ dataId: '',
119
+ notifyTemplate: {
120
+ enabled: true,
121
+ ntType:0
122
+ },
123
+ showCodeEditor: false
124
+ };
125
+ },
126
+ created() {
127
+ if (this._dataId && !isNaN(this._dataId)) this.dataId = this._dataId;
128
+ },
129
+ mounted() {
130
+ this.getData();
131
+ },
132
+ methods: {
133
+ getData() {
134
+ if (this.dataId && !isNaN(this.dataId)) {
135
+ this.isEdit = true;
136
+ this.$commonHttp({
137
+ url: USER_PREFIX + `/notify_template/get`,
138
+ method: `post`,
139
+ data: {
140
+ id: this.dataId
141
+ },
142
+ isLoading: true,
143
+ modalStrictly: true,
144
+ success: res => {
145
+ this.notifyTemplate = res.objx || {};
146
+ this.showCodeEditor = true;
147
+ }
148
+ });
149
+ } else {
150
+ this.showCodeEditor = true;
151
+ }
152
+ },
153
+ saveData() {
154
+ this.$refs.editForm.$baseValidate(valid => {
155
+ if (valid) {
156
+ this.$baseConfirm(this.$t1('您确定要保存吗?')).then(() => {
157
+ var url = USER_PREFIX + (this.isEdit ? `/notify_template/update` : `/notify_template/save`);
158
+ this.$http({
159
+ url: url,
160
+ method: `post`,
161
+ data: this.notifyTemplate,
162
+ isLoading: true,
163
+ success: res => {
164
+ this.$message({
165
+ message: res.content,
166
+ type: 'success',
167
+ duration: 500,
168
+ onClose: t => {
169
+ if (this.isEdit) {
170
+ this.$baseReload();
171
+ } else {
172
+ this.$baseReload({
173
+ updateParam: {
174
+ _dataId: res.objx
175
+ }
176
+ });
177
+ }
178
+ }
179
+ });
180
+ }
181
+ });
182
+ });
183
+ }
184
+ });
185
+ }
186
+ }
187
+ };
188
+ </script>