cloud-web-corejs 1.0.54-dev.345 → 1.0.54-dev.346

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.345",
4
+ "version": "1.0.54-dev.346",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -3,14 +3,25 @@
3
3
  <el-form ref="editForm" :model="position">
4
4
  <div class="d-header clearfix">
5
5
  <div class="fl">
6
- <i class="el-icon-info"/>
7
- {{ dataId ? $t1('查看岗位') : $t1('新增岗位') }}
6
+ <i class="el-icon-info" />
7
+ {{ dataId ? $t1("查看岗位") : $t1("新增岗位") }}
8
8
  </div>
9
9
  <div class="fr">
10
- <el-button type="primary" plain class="button-sty" @click="$baseReload()" icon="el-icon-refresh-right">
11
- {{ $t1('重置') }}
10
+ <el-button
11
+ type="primary"
12
+ plain
13
+ class="button-sty"
14
+ @click="$baseReload()"
15
+ icon="el-icon-refresh-right"
16
+ >
17
+ {{ $t1("重置") }}
12
18
  </el-button>
13
- <el-button type="primary" class="button-sty" icon="el-icon-check" @click="saveData">{{ $t1('保存') }}
19
+ <el-button
20
+ type="primary"
21
+ class="button-sty"
22
+ icon="el-icon-check"
23
+ @click="saveData"
24
+ >{{ $t1("保存") }}
14
25
  </el-button>
15
26
  </div>
16
27
  </div>
@@ -19,51 +30,76 @@
19
30
  <template #default>
20
31
  <table class="table-detail">
21
32
  <tbody>
22
- <tr>
23
- <th>
24
- <em class="f-red">*</em>
25
- {{ $t1('岗位名称') }}
26
- </th>
27
- <td>
28
- <el-form-item prop="name" :rules="[{ required: true, trigger: 'blur' }]">
29
- <el-input type="text" autocomplete="off" v-model="position.name" clearable/>
30
- </el-form-item>
31
- </td>
32
- <th>
33
- <em class="f-red">*</em>
34
- {{ $t1('岗位编码') }}
35
- </th>
36
- <td>
37
- <template v-if="dataId">
38
- {{ position.code }}
39
- </template>
40
- <el-form-item v-else prop="code" :rules="[{ required: true, trigger: 'blur' }]">
41
- <el-input type="text" autocomplete="off" v-model="position.code" clearable/>
42
- </el-form-item>
43
- </td>
44
- <th>{{ $t1('设置') }}</th>
45
- <td>
46
- <el-checkbox :label="$t1('是否启用')" v-model="position.enabled"></el-checkbox>
47
- </td>
48
- </tr>
49
- <tr>
50
- <th>{{ $t1('备注') }}</th>
51
- <td colspan="5">
52
- <el-input type="textarea" :rows="2" :placeholder="$t1('请输入内容')" size="small"
53
- v-model="position.memo"
54
- clearable></el-input>
55
- </td>
56
- </tr>
57
- <tr>
58
- <th>{{ $t1('创建人') }}</th>
59
- <td>{{ position._createBy }}</td>
60
- <th>{{ $t1('创建时间') }}</th>
61
- <td>{{ position.createDate }}</td>
62
- <th>{{ $t1('更新人') }}</th>
63
- <td>{{ position._modifyBy }}</td>
64
- <th>{{ $t1('更新时间') }}</th>
65
- <td>{{ position.modifyDate }}</td>
66
- </tr>
33
+ <tr>
34
+ <th>
35
+ <em class="f-red">*</em>
36
+ {{ $t1("岗位名称") }}
37
+ </th>
38
+ <td>
39
+ <el-form-item
40
+ prop="name"
41
+ :rules="[{ required: true, trigger: 'blur' }]"
42
+ >
43
+ <el-input
44
+ type="text"
45
+ autocomplete="off"
46
+ v-model="position.name"
47
+ clearable
48
+ />
49
+ </el-form-item>
50
+ </td>
51
+ <th>
52
+ <em class="f-red">*</em>
53
+ {{ $t1("岗位编码") }}
54
+ </th>
55
+ <td>
56
+ <template v-if="dataId">
57
+ {{ position.code }}
58
+ </template>
59
+ <el-form-item
60
+ v-else
61
+ prop="code"
62
+ :rules="[{ required: true, trigger: 'blur' }]"
63
+ >
64
+ <el-input
65
+ type="text"
66
+ autocomplete="off"
67
+ v-model="position.code"
68
+ clearable
69
+ />
70
+ </el-form-item>
71
+ </td>
72
+ <th>{{ $t1("设置") }}</th>
73
+ <td>
74
+ <el-checkbox
75
+ :label="$t1('是否启用')"
76
+ v-model="position.enabled"
77
+ ></el-checkbox>
78
+ </td>
79
+ </tr>
80
+ <tr>
81
+ <th>{{ $t1("备注") }}</th>
82
+ <td colspan="5">
83
+ <el-input
84
+ type="textarea"
85
+ :rows="2"
86
+ :placeholder="$t1('请输入内容')"
87
+ size="small"
88
+ v-model="position.memo"
89
+ clearable
90
+ ></el-input>
91
+ </td>
92
+ </tr>
93
+ <tr>
94
+ <th>{{ $t1("创建人") }}</th>
95
+ <td>{{ position._createBy }}</td>
96
+ <th>{{ $t1("创建时间") }}</th>
97
+ <td>{{ position.createDate }}</td>
98
+ <th>{{ $t1("更新人") }}</th>
99
+ <td>{{ position._modifyBy }}</td>
100
+ <th>{{ $t1("更新时间") }}</th>
101
+ <td>{{ position.modifyDate }}</td>
102
+ </tr>
67
103
  </tbody>
68
104
  </table>
69
105
  </template>
@@ -75,19 +111,19 @@
75
111
 
76
112
  <script>
77
113
  export default {
78
- name: 'positionEdit',
114
+ name: "positionEdit",
79
115
  props: {
80
- _dataId: [String, Number]
116
+ _dataId: [String, Number],
81
117
  },
82
118
  components: {},
83
119
  data() {
84
120
  return {
85
121
  isEdit: false,
86
- tabIndex: 'first',
87
- dataId: '',
122
+ tabIndex: "first",
123
+ dataId: "",
88
124
  position: {
89
- enabled: true
90
- }
125
+ enabled: true,
126
+ },
91
127
  };
92
128
  },
93
129
  created() {
@@ -104,53 +140,49 @@ export default {
104
140
  url: USER_PREFIX + `/position/get`,
105
141
  method: `post`,
106
142
  data: {
107
- id: this.dataId
143
+ id: this.dataId,
108
144
  },
109
145
  isLoading: true,
110
146
  modalStrictly: true,
111
- success: res => {
147
+ success: (res) => {
112
148
  this.position = res.objx || {};
113
- }
149
+ },
114
150
  });
115
- } else {
116
- this.position = {
117
- enabled: true
118
- };
119
151
  }
120
152
  },
121
153
  saveData() {
122
- this.$refs.editForm.$baseValidate(valid => {
154
+ this.$refs.editForm.$baseValidate((valid) => {
123
155
  if (valid) {
124
- this.$baseConfirm(this.$t1('您确定要保存吗?')).then(() => {
156
+ this.$baseConfirm(this.$t1("您确定要保存吗?")).then(() => {
125
157
  var url = USER_PREFIX + (this.isEdit ? `/position/update` : `/position/save`);
126
158
  this.$http({
127
159
  url: url,
128
160
  method: `post`,
129
161
  data: this.position,
130
162
  isLoading: true,
131
- success: res => {
163
+ success: (res) => {
132
164
  this.$message({
133
165
  message: res.content,
134
- type: 'success',
166
+ type: "success",
135
167
  duration: 500,
136
- onClose: t => {
168
+ onClose: (t) => {
137
169
  if (this.isEdit) {
138
170
  this.$baseReload();
139
171
  } else {
140
172
  this.$baseReload({
141
173
  updateParam: {
142
- _dataId: res.objx
143
- }
174
+ _dataId: res.objx,
175
+ },
144
176
  });
145
177
  }
146
- }
178
+ },
147
179
  });
148
- }
180
+ },
149
181
  });
150
182
  });
151
183
  }
152
184
  });
153
- }
154
- }
185
+ },
186
+ },
155
187
  };
156
188
  </script>
@@ -2,43 +2,62 @@
2
2
  <div id="containt">
3
3
  <el-tabs v-model="activeName" class="tab-box">
4
4
  <el-tab-pane :label="$t1('常规')" name="first">
5
- <editView v-if="showEdit" visible-key="showEdit" :_dataId.sync="dataId" :parent-target="_self"
6
- @reload="$reloadHandle"></editView>
5
+ <editView
6
+ v-if="showEdit"
7
+ visible-key="showEdit"
8
+ :_dataId.sync="dataId"
9
+ :parent-target="_self"
10
+ @reload="$reloadHandle"
11
+ ></editView>
7
12
  </el-tab-pane>
8
13
  <el-tab-pane :label="$t1('列表')" name="second">
9
14
  <div class="grid-height">
10
- <vxe-grid ref="table-m1" v-bind="vxeOption" @resizable-change="$vxeTableUtil.onColumnWitchChange"
11
- @custom="$vxeTableUtil.customHandle">
15
+ <vxe-grid
16
+ ref="table-m1"
17
+ v-bind="vxeOption"
18
+ @resizable-change="$vxeTableUtil.onColumnWitchChange"
19
+ @custom="$vxeTableUtil.customHandle"
20
+ >
12
21
  <template #form>
13
- <div class="clearfix screen-btns">
14
- <div class="fl">
15
- <vxe-button status="primary" class="button-sty" icon="el-icon-plus" @click="openEditDialog">
16
- {{ $t1('新增') }}
22
+ <tableForm
23
+ :formData.sync="formData"
24
+ @searchEvent="searchEvent"
25
+ @resetEvent="resetEvent"
26
+ >
27
+ <template #buttonLeft>
28
+ <vxe-button
29
+ status="primary"
30
+ class="button-sty"
31
+ icon="el-icon-plus"
32
+ @click="openEditDialog"
33
+ >
34
+ {{ $t1("新增") }}
17
35
  </vxe-button>
18
- <base-table-export :option="{ title: $t1('岗位导出'), targetRef: 'table-m1'}" :parent-target="_self"/>
19
- </div>
20
- <div class="fr">
21
- <vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
22
- plain>{{ $t1('重置') }}
36
+ <base-table-export
37
+ :option="{ title: $t1('岗位导出'), targetRef: 'table-m1' }"
38
+ :parent-target="_self"
39
+ />
40
+ </template>
41
+ <template #buttonRight>
42
+ <vxe-button
43
+ icon="el-icon-brush"
44
+ class="button-sty"
45
+ @click="resetEvent"
46
+ type="text"
47
+ status="primary"
48
+ plain
49
+ >{{ $t1("重置") }}
23
50
  </vxe-button>
24
- <vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">
25
- {{ $t1('搜索') }}
51
+ <vxe-button
52
+ status="warning"
53
+ icon="el-icon-search"
54
+ class="button-sty"
55
+ @click="searchEvent"
56
+ >
57
+ {{ $t1("搜索") }}
26
58
  </vxe-button>
27
- </div>
28
- </div>
29
- <vxe-form ref="form" class="screen-box" title-width="92px" title-align="right" :data="formData"
30
- @submit="searchEvent" @reset="searchEvent">
31
- <vxe-form-item :title="$t1('岗位名称')+':'" field="name">
32
- <template v-slot>
33
- <el-input v-model="formData.name" size="small" clearable/>
34
- </template>
35
- </vxe-form-item>
36
- <!-- <vxe-form-item :title="$t1('岗位编码')+':'" field="code">
37
- <template v-slot>
38
- <el-input v-model="formData.code" size="small" clearable/>
39
- </template>
40
- </vxe-form-item> -->
41
- </vxe-form>
59
+ </template>
60
+ </tableForm>
42
61
  </template>
43
62
  </vxe-grid>
44
63
  </div>
@@ -48,18 +67,18 @@
48
67
  </template>
49
68
 
50
69
  <script>
51
- import editView from './edit.vue';
52
-
70
+ import editView from "./edit.vue";
71
+ import tableForm from "@base/components/table/tableForm.vue";
53
72
  export default {
54
- name: 'position:list',
55
- components: {editView},
73
+ name: "position:list",
74
+ components: { tableForm, editView },
56
75
  data() {
57
76
  return {
58
- activeName: 'second',
77
+ activeName: "second",
59
78
  dataId: 0,
60
79
  showEdit: false,
61
80
  vxeOption: {},
62
- formData: {}
81
+ formData: {},
63
82
  };
64
83
  },
65
84
  mounted() {
@@ -67,85 +86,85 @@ export default {
67
86
  },
68
87
  methods: {
69
88
  searchEvent() {
70
- this.$refs['table-m1'].commitProxy('reload');
89
+ this.$refs["table-m1"].commitProxy("reload");
71
90
  },
72
91
  resetEvent() {
73
92
  this.formData = {};
74
- this.$refs['table-m1'].commitProxy('reload');
93
+ this.$refs["table-m1"].commitProxy("reload");
75
94
  },
76
95
  openEditDialog(id) {
77
- this.dataId = !id || typeof id == 'object' ? 0 : id;
78
- this.activeName = 'first';
79
- this.$openEditView('showEdit');
96
+ this.dataId = !id || typeof id == "object" ? 0 : id;
97
+ this.activeName = "first";
98
+ this.$openEditView("showEdit");
80
99
  },
81
100
  initTableList() {
82
101
  let that = this;
83
102
  let tableOption = {
84
103
  vue: this,
85
- tableRef: 'table-m1',
86
- tableName: 'basic_position_list-m2',
87
- path: USER_PREFIX + '/position/listCurrentPage',
104
+ tableRef: "table-m1",
105
+ tableName: "basic_position_list-m2",
106
+ path: USER_PREFIX + "/position/listCurrentPage",
88
107
  param: () => {
89
108
  return this.formData;
90
109
  },
91
110
  columns: [
92
- {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
111
+ { type: "checkbox", width: 48, resizable: false, fixed: "left" },
93
112
  {
94
- title: this.$t1('岗位名称'),
95
- field: 'name',
113
+ title: this.$t1("岗位名称"),
114
+ field: "name",
96
115
  width: 150,
97
- fixed: 'left'
116
+ fixed: "left",
98
117
  },
99
118
  /* {
100
119
  field: 'code',
101
120
  title: this.$t1('岗位编码'),
102
121
  width: 250
103
122
  }, */
104
- {title: this.$t1('所属组织'), field: 'companyName', width: 150},
123
+ { title: this.$t1("所属组织"), field: "companyName", width: 150 },
105
124
  {
106
- field: 'enabled',
107
- title: this.$t1('是否启用'),
125
+ field: "enabled",
126
+ title: this.$t1("是否启用"),
108
127
  width: 150,
109
128
  slots: {
110
- default: ({row}) => {
129
+ default: ({ row }) => {
111
130
  if (row.enabled) {
112
131
  return [
113
132
  <div class="txt-status">
114
- <span>{this.$t1('启用')}</span>
115
- </div>
133
+ <span>{this.$t1("启用")}</span>
134
+ </div>,
116
135
  ];
117
136
  } else {
118
137
  return [
119
138
  <div class="txt-status disable">
120
- <span>{this.$t1('禁用')}</span>
121
- </div>
139
+ <span>{this.$t1("禁用")}</span>
140
+ </div>,
122
141
  ];
123
142
  }
124
- }
125
- }
143
+ },
144
+ },
126
145
  },
127
146
  {
128
- field: 'createDate',
129
- title: this.$t1('创建时间'),
130
- width: 150
147
+ field: "createDate",
148
+ title: this.$t1("创建时间"),
149
+ width: 150,
131
150
  },
132
151
  {
133
- field: '_createBy',
134
- title: this.$t1('创建人'),
135
- width: 150
152
+ field: "_createBy",
153
+ title: this.$t1("创建人"),
154
+ width: 150,
136
155
  },
137
156
  {
138
- field: '_modifyBy',
139
- title: this.$t1('更新人'),
140
- width: 150
157
+ field: "_modifyBy",
158
+ title: this.$t1("更新人"),
159
+ width: 150,
141
160
  },
142
161
  {
143
162
  width: 47,
144
- fixed: 'right',
145
- title: '',
163
+ fixed: "right",
164
+ title: "",
146
165
  sortable: false,
147
166
  slots: {
148
- default: ({row}) => {
167
+ default: ({ row }) => {
149
168
  return [
150
169
  <div>
151
170
  <a
@@ -155,19 +174,32 @@ export default {
155
174
  this.openEditDialog(row.id);
156
175
  }}
157
176
  >
158
- <el-tooltip enterable={false} effect="dark" content={this.$t1('查看')} placement="top"
159
- popper-class="tooltip-skin">
160
- <i class="el-icon-edit"/>
177
+ <el-tooltip
178
+ enterable={false}
179
+ effect="dark"
180
+ content={this.$t1("查看")}
181
+ placement="top"
182
+ popper-class="tooltip-skin"
183
+ >
184
+ <i class="el-icon-edit" />
161
185
  </el-tooltip>
162
186
  </a>
163
- </div>
187
+ </div>,
164
188
  ];
165
- }
166
- }
167
- }
168
- ]
189
+ },
190
+ },
191
+ },
192
+ ],
193
+ searchColumns: [
194
+ {
195
+ title: this.$t1("岗位名称"),
196
+ field: "name",
197
+ type: "input",
198
+ common: true,
199
+ },
200
+ ],
169
201
  };
170
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
202
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
171
203
  this.vxeOption = opts;
172
204
  });
173
205
  },
@@ -175,14 +207,14 @@ export default {
175
207
  let that = this;
176
208
  that.$excelImport({
177
209
  prefix: USER_PREFIX,
178
- excel: USER_PREFIX + '/excelTemplate/position/position.xlsx',
210
+ excel: USER_PREFIX + "/excelTemplate/position/position.xlsx",
179
211
  multi: false,
180
- saveUrl: USER_PREFIX + '/position/save',
212
+ saveUrl: USER_PREFIX + "/position/save",
181
213
  callback: () => {
182
214
  that.searchEvent();
183
- }
215
+ },
184
216
  });
185
- }
186
- }
217
+ },
218
+ },
187
219
  };
188
220
  </script>