cloud-web-corejs 1.0.54-dev.352 → 1.0.54-dev.354

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.54-dev.352",
4
+ "version": "1.0.54-dev.354",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -1,16 +1,36 @@
1
1
  <template>
2
2
  <span class="button-sty">
3
- <el-button type="success" class="btn-connect" icon="iconfont icon-zancun" @click="openSubmitDialog" plain :disabled="disabled">暂存</el-button>
4
- <el-tooltip class="item" effect="dark" content="查看暂存数据" placement="top">
5
- <el-button class="btn-connect" @click="openTempStorageDialog" icon="iconfont icon-chakanshuju" type="success" :disabled="disabled"></el-button>
6
- </el-tooltip>
3
+ <el-button
4
+ type="success"
5
+ class="btn-connect"
6
+ icon="iconfont icon-zancun"
7
+ @click="openSubmitDialog"
8
+ plain
9
+ :disabled="disabled"
10
+ >
11
+ {{ $t1("暂存") }}
12
+ </el-button>
13
+ <el-tooltip class="item" effect="dark" :content="$t1('查看暂存数据')" placement="top">
14
+ <el-button
15
+ class="btn-connect"
16
+ @click="openTempStorageDialog"
17
+ icon="iconfont icon-chakanshuju"
18
+ type="success"
19
+ :disabled="disabled"
20
+ ></el-button>
21
+ </el-tooltip>
7
22
 
8
- <tempStorageDialog v-if="showTempStorageDialog" :visiable.sync="showTempStorageDialog"
9
- @confirm="confirmTempStorageDialog" :storageType="storageType" multi="false"/>
23
+ <tempStorageDialog
24
+ v-if="showTempStorageDialog"
25
+ :visiable.sync="showTempStorageDialog"
26
+ @confirm="confirmTempStorageDialog"
27
+ :storageType="storageType"
28
+ multi="false"
29
+ />
10
30
  <el-dialog
11
31
  v-if="showSubmitDialog"
12
32
  :visible.sync="showSubmitDialog"
13
- title="暂存"
33
+ :title="$t1('暂存')"
14
34
  :modal-append-to-body="false"
15
35
  :close-on-click-modal="false"
16
36
  :modal="false"
@@ -18,35 +38,40 @@
18
38
  v-el-drag-dialog
19
39
  v-el-dialog-center
20
40
  >
21
- <el-form>
22
- <div id="containt">
23
- <table class="table-detail">
24
- <tbody>
41
+ <el-form>
42
+ <div id="containt">
43
+ <table class="table-detail">
44
+ <tbody>
25
45
  <tr>
26
46
  <th>
27
- <span class="t">
28
- 描述
29
- </span>
47
+ <span class="t">
48
+ {{ $t1("描述") }}
49
+ </span>
30
50
  </th>
31
51
  <td>
32
- <el-input type="textarea" :rows="8" v-model="remark"></el-input>
52
+ <el-input type="textarea" :rows="8" v-model="remark"></el-input>
33
53
  </td>
34
54
  </tr>
35
- </tbody>
36
- </table>
37
- </div>
38
- </el-form>
39
- <span slot="footer" class="dialog-footer">
40
- <el-button type="primary" plain class="button-sty" @click="showSubmitDialog = false">
41
- <i class="el-icon-close el-icon"></i>
42
- {{ $t2('取 消', 'system.button.cancel2') }}
43
- </el-button>
44
- <el-button type="primary" @click="saveData" class="button-sty">
45
- <i class="el-icon-check el-icon"></i>
46
- {{ $t2('确 定', 'system.button.confirm2') }}
47
- </el-button>
48
- </span>
49
- </el-dialog>
55
+ </tbody>
56
+ </table>
57
+ </div>
58
+ </el-form>
59
+ <span slot="footer" class="dialog-footer">
60
+ <el-button
61
+ type="primary"
62
+ plain
63
+ class="button-sty"
64
+ @click="showSubmitDialog = false"
65
+ >
66
+ <i class="el-icon-close el-icon"></i>
67
+ {{ $t1("取 消") }}
68
+ </el-button>
69
+ <el-button type="primary" @click="saveData" class="button-sty">
70
+ <i class="el-icon-check el-icon"></i>
71
+ {{ $t1("确 定") }}
72
+ </el-button>
73
+ </span>
74
+ </el-dialog>
50
75
  </span>
51
76
  </template>
52
77
  <script>
@@ -58,31 +83,27 @@ export default {
58
83
  disabled: Boolean,
59
84
  },
60
85
  components: {
61
- tempStorageDialog
86
+ tempStorageDialog,
62
87
  },
63
88
  data() {
64
89
  return {
65
90
  storageType: null,
66
91
  showTempStorageDialog: false,
67
92
  showSubmitDialog: false,
68
- remark: null
93
+ remark: null,
69
94
  };
70
95
  },
71
- created() {
72
-
73
- },
74
- mounted() {
75
-
76
- },
96
+ created() {},
97
+ mounted() {},
77
98
  methods: {
78
99
  openSubmitDialog() {
79
100
  this.remark = null;
80
101
  this.showSubmitDialog = true;
81
102
  },
82
103
  saveData() {
83
- let url = USER_PREFIX + '/temp_storage/save';
104
+ let url = USER_PREFIX + "/temp_storage/save";
84
105
  let billData = this.option.data() || {};
85
- let data = JSON.stringify(billData)
106
+ let data = JSON.stringify(billData);
86
107
 
87
108
  let that = this.option.vue || this.$$attrs["parent-target"] || this.$parent;
88
109
  this.showSubmitDialog = false;
@@ -93,19 +114,19 @@ export default {
93
114
  storageType: this.option.storageType,
94
115
  data: data,
95
116
  remark: this.remark,
96
- retains: (this.option.retains || null)
117
+ retains: this.option.retains || null,
97
118
  },
98
119
  isLoading: true,
99
- success: res => {
120
+ success: (res) => {
100
121
  this.$message({
101
122
  message: res.content,
102
- type: 'success',
123
+ type: "success",
103
124
  duration: 500,
104
- onClose: t => {
125
+ onClose: (t) => {
105
126
  this.option.saveConfirm && this.option.saveConfirm(res);
106
- }
127
+ },
107
128
  });
108
- }
129
+ },
109
130
  });
110
131
  },
111
132
  openTempStorageDialog() {
@@ -118,10 +139,7 @@ export default {
118
139
  this.option.chooseConfirm && this.option.chooseConfirm(billData, rows);
119
140
  }
120
141
  },
121
- }
122
- }
123
-
142
+ },
143
+ };
124
144
  </script>
125
- <style scoped>
126
-
127
- </style>
145
+ <style scoped></style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <el-dialog
3
- title="暂存数据列表"
3
+ :title="$t1('暂存数据列表')"
4
4
  :append-to-body="true"
5
5
  :modal-append-to-body="true"
6
6
  :close-on-click-modal="falseValue"
@@ -12,7 +12,7 @@
12
12
  v-el-drag-dialog
13
13
  v-el-dialog-center
14
14
  >
15
- <div class="cont" style="height:450px">
15
+ <div class="cont" style="height: 450px">
16
16
  <vxe-grid
17
17
  class="is-pointer"
18
18
  ref="table-m1"
@@ -25,24 +25,46 @@
25
25
  >
26
26
  <template #form>
27
27
  <div class="clearfix screen-btns">
28
+ <div class="fl">
29
+ <el-button class="button-sty" icon="el-icon-delete" @click="mulitidDelete"
30
+ >{{ $t1("删除") }}
31
+ </el-button>
32
+ </div>
28
33
  <div class="fr">
29
- <vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
30
- plain>重置
34
+ <vxe-button
35
+ icon="el-icon-brush"
36
+ class="button-sty"
37
+ @click="resetEvent"
38
+ type="text"
39
+ status="primary"
40
+ plain
41
+ >{{ $t1("重置") }}
31
42
  </vxe-button>
32
- <vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">搜索
43
+ <vxe-button
44
+ status="warning"
45
+ icon="el-icon-search"
46
+ class="button-sty"
47
+ @click="searchEvent"
48
+ >{{ $t1("搜索") }}
33
49
  </vxe-button>
34
50
  </div>
35
51
  </div>
36
- <vxe-form class="screen-box" title-width="92px" title-align="right" :data="formData" @submit="searchEvent"
37
- @reset="resetEvent">
38
- <vxe-form-item title="暂存编码:" field="storageCode">
52
+ <vxe-form
53
+ class="screen-box"
54
+ title-width="92px"
55
+ title-align="right"
56
+ :data="formData"
57
+ @submit="searchEvent"
58
+ @reset="resetEvent"
59
+ >
60
+ <vxe-form-item :title="$t1('暂存编码') + ':'" field="storageCode">
39
61
  <template v-slot>
40
- <el-input v-model="formData.storageCode" size="small" clearable/>
62
+ <el-input v-model="formData.storageCode" size="small" clearable />
41
63
  </template>
42
64
  </vxe-form-item>
43
- <vxe-form-item title="描述:" field="remark">
65
+ <vxe-form-item :title="$t1('描述') + ':'" field="remark">
44
66
  <template v-slot>
45
- <el-input v-model="formData.remark" size="small" clearable/>
67
+ <el-input v-model="formData.remark" size="small" clearable />
46
68
  </template>
47
69
  </vxe-form-item>
48
70
  <vxe-button type="submit" @click="searchEvent" v-show="false"></vxe-button>
@@ -57,8 +79,13 @@
57
79
  </div>
58
80
  </label>
59
81
  <div class="multipleChoice">
60
- <el-tooltip :enterable="false" effect="dark" :content="$t1('全部删除')" placement="top"><a
61
- class="allDel icon-quanbushanchu" @click="clearChecked()"></a></el-tooltip>
82
+ <el-tooltip
83
+ :enterable="false"
84
+ effect="dark"
85
+ :content="$t1('全部删除')"
86
+ placement="top"
87
+ ><a class="allDel icon-quanbushanchu" @click="clearChecked()"></a
88
+ ></el-tooltip>
62
89
  <div class="list">
63
90
  <div class="item" v-for="(checkRow, index) in checkRows" :key="index">
64
91
  <p>{{ checkRow.storageCode }}</p>
@@ -67,95 +94,193 @@
67
94
  </div>
68
95
  </div>
69
96
  <span slot="footer" class="dialog-footer">
70
- <span class="fl tips" v-if="!selectMulti">{{ $t1('注:双击确认选择(单选)') }}</span>
71
- <el-button type="primary" plain class="button-sty" @click="dialogClose">
72
- <i class="el-icon-close el-icon"></i>
73
-
74
- </el-button>
75
- <el-button type="primary" @click="dialogPrimary" class="button-sty">
76
- <i class="el-icon-check el-icon"></i>
77
-
78
- </el-button>
79
- </span>
97
+ <span class="fl tips">{{ $t1("注:双击确认选择(单选)") }}</span>
98
+ <el-button type="primary" plain class="button-sty" @click="dialogClose">
99
+ <i class="el-icon-close el-icon"></i>
100
+ {{ $t1("取消") }}
101
+ </el-button>
102
+ <el-button type="primary" @click="dialogPrimary()" class="button-sty">
103
+ <i class="el-icon-check el-icon"></i>
104
+ {{ $t1("确定") }}
105
+ </el-button>
106
+ </span>
80
107
  </el-dialog>
81
108
  </template>
82
109
 
83
110
  <script>
84
- import {selectDialogMixins} from '../../mixins/selectDialog/index.js';
111
+ import { selectDialogMixins } from "../../mixins/selectDialog/index.js";
85
112
 
86
113
  export default {
87
- name: 'positionDialog',
88
- props: ['visiable', 'multi', 'rows', 'param', 'storageType'],
114
+ name: "positionDialog",
115
+ props: ["visiable", "multi", "rows", "param", "storageType"],
89
116
  mixins: [selectDialogMixins],
90
117
  created() {
91
118
  this.initSetting();
119
+ this.selectMulti = true;
92
120
  },
93
121
  mounted() {
94
122
  this.initTableM1();
95
123
  },
96
124
  data() {
97
- var that = this;
98
125
  return {
99
126
  showDialog: true,
100
127
  falseValue: false,
101
128
  selectMulti: true,
102
129
  formData: {},
103
- vxeOption: {}
130
+ vxeOption: {},
104
131
  };
105
132
  },
106
133
  methods: {
107
134
  initTableM1() {
108
135
  let that = this;
109
- let url = USER_PREFIX + '/temp_storage/listPage';
136
+ let url = USER_PREFIX + "/temp_storage/listPage";
110
137
  let tableOption = {
111
138
  vue: that,
112
- tableRef: 'table-m1',
113
- tableName: 'user_temp_storage_dialog-m1',
139
+ tableRef: "table-m1",
140
+ tableName: "user_temp_storage_dialog-m1",
114
141
  path: url,
115
142
  param: () => {
116
143
  return {
117
144
  ...this.formData,
118
- storageType: this.storageType
119
- }
145
+ storageType: this.storageType,
146
+ };
120
147
  },
121
148
  columns: [
122
- {type: 'checkbox', fixed: 'left', width: 48, resizable: false},
149
+ { type: "checkbox", fixed: "left", width: 48, resizable: false },
123
150
  {
124
- field: 'remark',
125
- title: '描述',
151
+ field: "remark",
152
+ title: this.$t1("描述"),
126
153
  width: 250,
127
- fixed: 'left'
154
+ fixed: "left",
128
155
  },
129
156
  {
130
- field: 'createDate',
131
- title: '创建时间',
132
- width: 150
157
+ field: "createDate",
158
+ title: this.$t1("创建时间"),
159
+ width: 150,
133
160
  },
134
161
  {
135
- title: '暂存编码',
136
- field: 'storageCode',
137
- width: 300
162
+ title: this.$t1("暂存编码"),
163
+ field: "storageCode",
164
+ width: 300,
138
165
  },
139
- {title: '暂存数据', field: 'data', width: 350, visible: false},
166
+ { title: this.$t1("暂存数据"), field: "data", width: 350, visible: false },
140
167
  {
168
+ title: this.$t1("操作"),
141
169
  width: 47,
142
- fixed: 'right',
143
- title: '',
144
- sortable: false
145
- }
170
+ fixed: "right",
171
+ title: "",
172
+ sortable: false,
173
+ slots: {
174
+ default: ({ row, rowIndex, $table }) => {
175
+ return [
176
+ <a
177
+ href="javascript:void(0);"
178
+ class="a-link"
179
+ onclick={(event) => {
180
+ event.stopPropagation();
181
+ this.deleteRow(row);
182
+ }}
183
+ >
184
+ <el-tooltip
185
+ enterable={false}
186
+ effect="dark"
187
+ content={this.$t1("删除")}
188
+ placement="top"
189
+ popper-class="tooltip-skin"
190
+ >
191
+ <i class="el-icon-delete" />
192
+ </el-tooltip>
193
+ </a>,
194
+ ];
195
+ },
196
+ },
197
+ },
146
198
  ],
147
199
  config: {
148
200
  checkboxConfig: {
149
201
  checkStrictly: true,
150
202
  showHeader: this.selectMulti,
151
- trigger: 'row'
203
+ trigger: "row",
204
+ },
205
+ },
206
+ callback: (rows) => {
207
+ if (!rows.length) return;
208
+ let checkRows = this.checkRows;
209
+ if (checkRows.length) {
210
+ let checkIds = checkRows.map((item) => item.id);
211
+ let items = rows.filter((item) => checkIds.includes(item.id));
212
+ if (items.length) {
213
+ this.$refs["table-m1"].setCheckboxRow(items, true);
214
+ }
152
215
  }
153
- }
216
+ },
154
217
  };
155
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
218
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
156
219
  that.vxeOption = opts;
157
220
  });
158
- }
159
- }
221
+ },
222
+ deleteRow(row) {
223
+ this.$baseConfirm(this.$t1("您确定要删除当前暂存数据吗?")).then(() => {
224
+ this.deleteHandle([row]);
225
+ });
226
+ },
227
+ mulitidDelete() {
228
+ let checkRows = this.checkRows;
229
+ if (checkRows.length == 0) {
230
+ this.$message({
231
+ message: this.$t1("请选择要删除的暂存数据"),
232
+ type: "error",
233
+ });
234
+ return;
235
+ }
236
+ this.$baseConfirm(this.$t1("您确定要删除选中的暂存数据吗?")).then(() => {
237
+ this.deleteHandle(checkRows);
238
+ });
239
+ },
240
+ deleteHandle(rows) {
241
+ if (!rows || !rows.length) {
242
+ return;
243
+ }
244
+ let data = rows.map((row) => row.id);
245
+ this.$http({
246
+ url: USER_PREFIX + "/temp_storage/delete",
247
+ method: `post`,
248
+ data: data,
249
+ isLoading: true,
250
+ success: (res) => {
251
+ this.$message({
252
+ message: res.content,
253
+ type: "success",
254
+ });
255
+ this.checkRows = this.checkRows.filter((row) => !data.includes(row.id));
256
+ this.searchEvent();
257
+ },
258
+ });
259
+ },
260
+ checkWithSubmit(obj) {
261
+ let $grid1 = this.$refs["table-m1"];
262
+ this.checkRows = [obj.row];
263
+ $grid1.clearCheckboxRow();
264
+ $grid1.setCheckboxRow(obj.row, true);
265
+ setTimeout(() => {
266
+ this.dialogPrimary();
267
+ }, 100);
268
+ },
269
+ dialogPrimary() {
270
+ let rows = this.checkRows;
271
+ if (rows.length > 1) {
272
+ this.$message({
273
+ message: this.$t1("请选择一条暂存数据进行操作"),
274
+ type: "error",
275
+ });
276
+ return;
277
+ }
278
+ if (this.beforeConfirm && this.beforeConfirm(rows, this.dialogClose) === false) {
279
+ return false;
280
+ }
281
+ this.$emit("confirm", rows);
282
+ this.dialogClose();
283
+ },
284
+ },
160
285
  };
161
286
  </script>
@@ -1,8 +1,14 @@
1
1
  <template>
2
- <el-tabs v-model="activeName" class="tab-box tab-morenav" @tab-remove="removeTab" @tab-click="tabClick" ref="tabs">
2
+ <el-tabs
3
+ v-model="activeName"
4
+ class="tab-box tab-morenav"
5
+ @tab-remove="removeTab"
6
+ @tab-click="tabClick"
7
+ ref="tabs"
8
+ >
3
9
  <slot name="default"></slot>
4
- <template v-for="(tab,index) in tabs">
5
- <slot name="editTab" v-bind="{tab,index,tabs,reloadTabContent}"></slot>
10
+ <template v-for="(tab, index) in tabs">
11
+ <slot name="editTab" v-bind="{ tab, index, tabs, reloadTabContent }"></slot>
6
12
  </template>
7
13
  </el-tabs>
8
14
  </template>
@@ -13,14 +19,14 @@ export default {
13
19
  value: String,
14
20
  paneKeyName: {
15
21
  type: String,
16
- default: () => "id"
17
- }
22
+ default: () => "id",
23
+ },
18
24
  },
19
25
  data() {
20
26
  return {
21
27
  activeName: "0",
22
- tabs: []
23
- }
28
+ tabs: [],
29
+ };
24
30
  },
25
31
  watch: {
26
32
  value(val) {
@@ -28,7 +34,7 @@ export default {
28
34
  },
29
35
  activeName(val) {
30
36
  this.$emit("input", val);
31
- }
37
+ },
32
38
  },
33
39
  created() {
34
40
  if (this.value) {
@@ -36,16 +42,18 @@ export default {
36
42
  }
37
43
  },
38
44
  methods: {
39
- openEditTab(row,param) {
45
+ openEditTab(row, param, option) {
40
46
  let paneKeyName = this.paneKeyName;
41
- let tab = this.tabs.find(tab => tab.data[paneKeyName] === row[paneKeyName])
47
+ let tab = this.tabs.find((tab) => tab.data[paneKeyName] === row[paneKeyName]);
42
48
  if (!tab) {
49
+ let tabParam = option?.tabParam || {};
43
50
  tab = {
44
51
  data: row,
45
52
  showContent: false,
46
53
  dataId: row[paneKeyName],
47
- param
48
- }
54
+ param,
55
+ ...tabParam,
56
+ };
49
57
  if (this.tabs.length >= 30) {
50
58
  this.tabs.splice(0, 1, tab);
51
59
  } else {
@@ -53,10 +61,10 @@ export default {
53
61
  }
54
62
  this.$nextTick(() => {
55
63
  let paneName = this.getCurrentPaneName();
56
- tab.paneName = paneName
57
- })
64
+ tab.paneName = paneName;
65
+ });
58
66
  }
59
- this.activeName = row[paneKeyName] + '';
67
+ this.activeName = row[paneKeyName] + "";
60
68
  tab.showContent = false;
61
69
  setTimeout(() => {
62
70
  tab.showContent = true;
@@ -64,12 +72,14 @@ export default {
64
72
  },
65
73
  removeTab(targetName) {
66
74
  let paneKeyName = this.paneKeyName;
67
- let tabIndex = this.tabs.findIndex(tab => tab.data[paneKeyName] + '' === targetName);
75
+ let tabIndex = this.tabs.findIndex(
76
+ (tab) => tab.data[paneKeyName] + "" === targetName
77
+ );
68
78
  if (this.activeName === targetName) {
69
79
  if (tabIndex > 0) {
70
- this.activeName = this.tabs[tabIndex - 1].data[paneKeyName] + '';
80
+ this.activeName = this.tabs[tabIndex - 1].data[paneKeyName] + "";
71
81
  } else {
72
- this.activeName = 'second';
82
+ this.activeName = "second";
73
83
  }
74
84
  }
75
85
  if (tabIndex !== -1) {
@@ -82,18 +92,19 @@ export default {
82
92
  },
83
93
  getCurrntPaneTarget() {
84
94
  let panes = this.$refs.tabs.panes;
85
- let target = panes.find(pane => pane.active)
95
+ let target = panes.find((pane) => pane.active);
86
96
  return target;
87
97
  },
88
98
  reloadTabContent(target, param, tab) {
89
- let updateParam = param != null && param.updateParam != null ? param.updateParam : {};
99
+ let updateParam =
100
+ param != null && param.updateParam != null ? param.updateParam : {};
90
101
  for (let key in updateParam) {
91
102
  target.$emit("update:" + key, updateParam[key]);
92
103
  }
93
104
 
94
105
  if (!tab) {
95
106
  let activeName = this.activeName;
96
- tab = this.tabs.find(item => item.paneName == activeName)
107
+ tab = this.tabs.find((item) => item.paneName == activeName);
97
108
  }
98
109
  if (tab) {
99
110
  tab.showContent = false;
@@ -104,10 +115,8 @@ export default {
104
115
  },
105
116
  tabClick(targetName) {
106
117
  this.$emit("tabClick", targetName);
107
- }
108
- }
109
- }
118
+ },
119
+ },
120
+ };
110
121
  </script>
111
- <style scoped>
112
-
113
- </style>
122
+ <style scoped></style>