Showing
4 changed files
with
166 additions
and
141 deletions
@@ -27,7 +27,6 @@ | @@ -27,7 +27,6 @@ | ||
27 | <el-image style="width: 50%; height: 50%;border-radius: 10px;" :src="domainName+row.code" | 27 | <el-image style="width: 50%; height: 50%;border-radius: 10px;" :src="domainName+row.code" |
28 | :preview-src-list="[domainName+row.code]" | 28 | :preview-src-list="[domainName+row.code]" |
29 | :initial-index="1" | 29 | :initial-index="1" |
30 | - :z-index="99999999999999" | ||
31 | :preview-teleported="true" | 30 | :preview-teleported="true" |
32 | fit="cover"/> | 31 | fit="cover"/> |
33 | </div> | 32 | </div> |
@@ -4,24 +4,7 @@ export default { | @@ -4,24 +4,7 @@ export default { | ||
4 | components: {}, | 4 | components: {}, |
5 | data() { | 5 | data() { |
6 | return { | 6 | return { |
7 | - radio: '0', | ||
8 | - docRulesForm: { | ||
9 | - name: [{ | ||
10 | - required: true, | ||
11 | - message: '请填写名称!', | ||
12 | - trigger: 'blur' | ||
13 | - }], | ||
14 | - code: [{ | ||
15 | - required: true, | ||
16 | - message: '请填写编码!', | ||
17 | - trigger: 'blur' | ||
18 | - }], | ||
19 | - groupId: [{ | ||
20 | - required: true, | ||
21 | - message: '请填写组Id!', | ||
22 | - trigger: 'blur' | ||
23 | - }] | ||
24 | - } | 7 | + radio: '0' |
25 | } | 8 | } |
26 | }, | 9 | }, |
27 | props: {}, | 10 | props: {}, |
@@ -173,6 +156,7 @@ export default { | @@ -173,6 +156,7 @@ export default { | ||
173 | uploadFile:'' | 156 | uploadFile:'' |
174 | }; | 157 | }; |
175 | cacheVisible.value = true; | 158 | cacheVisible.value = true; |
159 | + isAdd.value = true; | ||
176 | } | 160 | } |
177 | //关闭弹框 | 161 | //关闭弹框 |
178 | let cancelBtn = () => { | 162 | let cancelBtn = () => { |
@@ -185,30 +169,58 @@ export default { | @@ -185,30 +169,58 @@ export default { | ||
185 | fileFrom.value = row; | 169 | fileFrom.value = row; |
186 | isAdd.value = false; | 170 | isAdd.value = false; |
187 | } | 171 | } |
172 | + | ||
173 | + //表单规则校验 | ||
174 | + let docRulesForm = Vue.ref({ | ||
175 | + name: [{ | ||
176 | + required: true, | ||
177 | + message: '请填写名称!', | ||
178 | + trigger: 'blur' | ||
179 | + }], | ||
180 | + code: [{ | ||
181 | + required: true, | ||
182 | + message: '请填写编码!', | ||
183 | + trigger: 'blur' | ||
184 | + }], | ||
185 | + groupId: [{ | ||
186 | + required: true, | ||
187 | + message: '请填写组Id!', | ||
188 | + trigger: 'blur' | ||
189 | + }] | ||
190 | + }); | ||
191 | + | ||
192 | + // 新增 | ||
188 | let addFrom = () => { | 193 | let addFrom = () => { |
189 | let params = fileFrom.value; | 194 | let params = fileFrom.value; |
190 | - if (isAdd.value){ | ||
191 | - proxy.$http.uploadFile("/api-web/file/add", params, function (res) { | ||
192 | - hasRefresh.value = false; | ||
193 | - if (res && res.success) { | ||
194 | - proxy.$global.showMsg("新增成功!"); | ||
195 | - cacheVisible.value = false; | ||
196 | - getDataList(); | ||
197 | - } | ||
198 | - }) | ||
199 | - }else { | ||
200 | - proxy.$http.uploadFile("/api-web/file/update", params, function (res) { | ||
201 | - hasRefresh.value = false; | ||
202 | - if (res && res.success) { | ||
203 | - proxy.$global.showMsg("修改成功!"); | ||
204 | - cacheVisible.value = false; | ||
205 | - getDataList(); | 195 | + proxy.$refs.ruleForm.validate((valid) => { |
196 | + if (valid) { | ||
197 | + if (isAdd.value){ | ||
198 | + proxy.$http.uploadFile("/api-web/file/add", params, function (res) { | ||
199 | + hasRefresh.value = false; | ||
200 | + if (res && res.success) { | ||
201 | + proxy.$global.showMsg("新增成功!"); | ||
202 | + cacheVisible.value = false; | ||
203 | + getDataList(); | ||
204 | + } | ||
205 | + }) | ||
206 | }else { | 206 | }else { |
207 | - proxy.$global.showMsg(res.msg,'warning'); | 207 | + proxy.$http.uploadFile("/api-web/file/update", params, function (res) { |
208 | + hasRefresh.value = false; | ||
209 | + if (res && res.success) { | ||
210 | + proxy.$global.showMsg("修改成功!"); | ||
211 | + cacheVisible.value = false; | ||
212 | + getDataList(); | ||
213 | + }else { | ||
214 | + proxy.$global.showMsg(res.msg,'warning'); | ||
215 | + } | ||
216 | + | ||
217 | + }) | ||
208 | } | 218 | } |
219 | + }else { | ||
220 | + return false; | ||
221 | + } | ||
222 | + }) | ||
209 | 223 | ||
210 | - }) | ||
211 | - } | ||
212 | } | 224 | } |
213 | 225 | ||
214 | //重新加载表格数据 | 226 | //重新加载表格数据 |
@@ -244,7 +256,8 @@ export default { | @@ -244,7 +256,8 @@ export default { | ||
244 | handleUpdate, | 256 | handleUpdate, |
245 | isAdd, | 257 | isAdd, |
246 | titleName, | 258 | titleName, |
247 | - loadTableDataList | 259 | + loadTableDataList, |
260 | + docRulesForm | ||
248 | } | 261 | } |
249 | } | 262 | } |
250 | } | 263 | } |
@@ -11,44 +11,38 @@ | @@ -11,44 +11,38 @@ | ||
11 | <el-button :size="$global.elementConfig.size.button" @click="handleAdd()">新增</el-button> | 11 | <el-button :size="$global.elementConfig.size.button" @click="handleAdd()">新增</el-button> |
12 | </div> | 12 | </div> |
13 | <div class="search-table"> | 13 | <div class="search-table"> |
14 | - <el-table | ||
15 | - :data="tableData" | ||
16 | - style="width: 100%;margin: 0px 0px;" | ||
17 | - row-key="id" | ||
18 | - border | ||
19 | - :tree-props="{ children: 'children'}" | ||
20 | - header-row-class-name="tbl-header-class"> | ||
21 | - <el-table-column prop="name" label="第三方系统" sortable=true align="center" width="350" > | ||
22 | - <template #default="scope"> | ||
23 | - <el-tag effect="light" v-if="scope.row.type == 'user'"> | ||
24 | - <i class="iconfont icon-haoyou" /> {{scope.row.name}} | 14 | + <cm-table-page :columns="columns" :dataList="tableData" :height="(height - 130)" |
15 | + :loading="false" :pageSize="pageSize" :showBorder="true" | ||
16 | + :showIndex="true" :showPage="true" :showSelection="false" | ||
17 | + :showTools="true" :total="count" @loaddata="loadTableDataList" :toolsWith="120"> | ||
18 | + <template #default="{row,prop,column}"> | ||
19 | + <div v-if="prop == 'auth'"> | ||
20 | + <el-tag | ||
21 | + v-for="tag in row.authorizeList" | ||
22 | + :key="tag" | ||
23 | + class="mx-1" | ||
24 | + closable | ||
25 | + :disable-transitions="false" | ||
26 | + @close="handleClose(tag)" | ||
27 | + > | ||
28 | + {{tag.nickName}} | ||
25 | </el-tag> | 29 | </el-tag> |
26 | - | ||
27 | - <el-tag effect="light" v-if="scope.row.type == 'role'"> | ||
28 | - <i class="iconfont icon-jiaoseguanli" /> {{scope.row.name}} | ||
29 | - </el-tag> | ||
30 | - </template> | ||
31 | - </el-table-column> | ||
32 | - <el-table-column prop="detail" label="系统请求地址" sortable=true align="center" /> | ||
33 | - <el-table-column prop="sort" label="排序" sortable=true align="center" width="100" /> | ||
34 | - <el-table-column prop="createTime" label="创建时间" sortable=true align="center"width="300" /> | ||
35 | - <el-table-column fixed="right" label="操作" width="150" align="center"> | ||
36 | - <template #default="scope"> | ||
37 | - <div class="list-handle"> | ||
38 | - <span class="icon-bg" v-if="scope.row.type == '0'"> | ||
39 | - <i @click="handleAuth(scope.row)" class="iconfont icon-icon--quanxian" title="授权"></i> | ||
40 | - </span> | ||
41 | - <span class="icon-bg" v-if="scope.row.type == '0'"> | ||
42 | - <i @click="handleUpdate(scope.row)" class="el-icon-edit-outline" title="修改"></i> | ||
43 | - </span> | ||
44 | - <span class="icon-bg"> | ||
45 | - <i @click="handleDelete(scope.row)" class="el-icon-delete" title="删除"></i> | ||
46 | - </span> | ||
47 | - </div> | ||
48 | - </template> | ||
49 | - </el-table-column> | ||
50 | - </el-table> | ||
51 | - | 30 | + </div> |
31 | + </template> | ||
32 | + <template #tools="{scope}"> | ||
33 | + <div class="list-handle"> | ||
34 | + <span class="icon-bg" v-if="scope.row.type == '0'"> | ||
35 | + <i @click="handleAuth(scope.row)" class="iconfont icon-icon--quanxian" title="授权"></i> | ||
36 | + </span> | ||
37 | + <span class="icon-bg" v-if="scope.row.type == '0'"> | ||
38 | + <i @click="handleUpdate(scope.row)" class="el-icon-edit-outline" title="修改"></i> | ||
39 | + </span> | ||
40 | + <span class="icon-bg"> | ||
41 | + <i @click="handleDelete(scope.row)" class="el-icon-delete" title="删除"></i> | ||
42 | + </span> | ||
43 | + </div> | ||
44 | + </template> | ||
45 | + </cm-table-page> | ||
52 | </div> | 46 | </div> |
53 | 47 | ||
54 | 48 | ||
@@ -77,8 +71,8 @@ | @@ -77,8 +71,8 @@ | ||
77 | <el-form-item label="请求地址" prop="detail"> | 71 | <el-form-item label="请求地址" prop="detail"> |
78 | <el-input :size="$global.elementConfig.size.input" placeholder="请输入请求地址或事件" clearable v-model="confAdd.detail"></el-input> | 72 | <el-input :size="$global.elementConfig.size.input" placeholder="请输入请求地址或事件" clearable v-model="confAdd.detail"></el-input> |
79 | </el-form-item> | 73 | </el-form-item> |
80 | - <el-form-item label="排序" prop="detail"> | ||
81 | - <el-input :size="$global.elementConfig.size.input" placeholder="请输入排序" clearable v-model="confAdd.sort"></el-input> | 74 | + <el-form-item label="排序" prop="sort"> |
75 | + <el-input type="number" :size="$global.elementConfig.size.input" placeholder="请输入排序" clearable v-model="confAdd.sort"></el-input> | ||
82 | </el-form-item> | 76 | </el-form-item> |
83 | 77 | ||
84 | <el-form-item> | 78 | <el-form-item> |
@@ -3,23 +3,6 @@ export default { | @@ -3,23 +3,6 @@ export default { | ||
3 | template:"", | 3 | template:"", |
4 | data() { | 4 | data() { |
5 | return { | 5 | return { |
6 | - docRulesForm: { | ||
7 | - name: [{ | ||
8 | - required: true, | ||
9 | - message: '请填写系统名称!', | ||
10 | - trigger: 'blur' | ||
11 | - }], | ||
12 | - detail: [{ | ||
13 | - required: true, | ||
14 | - message: '请填写请求地址或事件!', | ||
15 | - trigger: 'blur' | ||
16 | - }], | ||
17 | - sort: [{ | ||
18 | - required: true, | ||
19 | - message: '请填写排序!', | ||
20 | - trigger: 'blur' | ||
21 | - }] | ||
22 | - } | ||
23 | } | 6 | } |
24 | }, | 7 | }, |
25 | setup(props,{attrs,slots,emit}){ | 8 | setup(props,{attrs,slots,emit}){ |
@@ -46,6 +29,41 @@ export default { | @@ -46,6 +29,41 @@ export default { | ||
46 | let userFileRight = Vue.ref([]); | 29 | let userFileRight = Vue.ref([]); |
47 | //获取用户 | 30 | //获取用户 |
48 | let userList = Vue.ref([]); | 31 | let userList = Vue.ref([]); |
32 | + let columns = Vue.ref([ | ||
33 | + { | ||
34 | + prop: 'name', | ||
35 | + label: '第三方系统', | ||
36 | + sortable: true, | ||
37 | + width: '300', | ||
38 | + align: 'center' | ||
39 | + }, | ||
40 | + { | ||
41 | + prop: 'detail', | ||
42 | + label: '系统请求地址', | ||
43 | + sortable: true, | ||
44 | + align: 'center' | ||
45 | + }, | ||
46 | + { | ||
47 | + prop: 'auth', | ||
48 | + label: '授权用户(角色)', | ||
49 | + sortable: true, | ||
50 | + align: 'center' | ||
51 | + }, | ||
52 | + { | ||
53 | + prop: 'sort', | ||
54 | + label: '排序', | ||
55 | + sortable: true, | ||
56 | + align: 'center', | ||
57 | + width: '120' | ||
58 | + }, | ||
59 | + { | ||
60 | + prop: 'createTime', | ||
61 | + label: '创建时间', | ||
62 | + sortable: true, | ||
63 | + align: 'center', | ||
64 | + width: '170' | ||
65 | + } | ||
66 | + ]) | ||
49 | 67 | ||
50 | 68 | ||
51 | // 获取系统 | 69 | // 获取系统 |
@@ -53,29 +71,6 @@ export default { | @@ -53,29 +71,6 @@ export default { | ||
53 | proxy.$http.get(`/api-web/thirdParty/conf/list`, {keywords:keyword.value}, function (res) { | 71 | proxy.$http.get(`/api-web/thirdParty/conf/list`, {keywords:keyword.value}, function (res) { |
54 | if (res && res.success == true) { | 72 | if (res && res.success == true) { |
55 | tableData.value = res.data; | 73 | tableData.value = res.data; |
56 | - tableData.value.forEach(function (e) { | ||
57 | - let report = {} | ||
58 | - | ||
59 | - let authUser = e.authorizeList; | ||
60 | - let authRole = e.authorizeRoleList; | ||
61 | - | ||
62 | - let children = []; | ||
63 | - if(authUser){ | ||
64 | - authUser.forEach((v) => { | ||
65 | - children.push({id:v.id,type:'user',name:v.nickName,code:v.userName}); | ||
66 | - }) | ||
67 | - } | ||
68 | - if(authRole){ | ||
69 | - authRole.forEach((v) => { | ||
70 | - children.push({id:v.id,type:'role',name:v.roleName,code:v.id}); | ||
71 | - }) | ||
72 | - } | ||
73 | - | ||
74 | - e.children = children; | ||
75 | - report.label = e.name; | ||
76 | - report.value = e.id; | ||
77 | - options.value.push(report) | ||
78 | - }); | ||
79 | } | 74 | } |
80 | }) | 75 | }) |
81 | }; | 76 | }; |
@@ -146,15 +141,6 @@ export default { | @@ -146,15 +141,6 @@ export default { | ||
146 | proxy.$http.get("/api-user/org/getOrgUserList?orgCode=xxzx", {}, function (res) { | 141 | proxy.$http.get("/api-user/org/getOrgUserList?orgCode=xxzx", {}, function (res) { |
147 | if (res && res.data) { | 142 | if (res && res.data) { |
148 | res.data.map(function (v) { | 143 | res.data.map(function (v) { |
149 | - let desc = []; | ||
150 | - let orgName = v.orgName; | ||
151 | - let nickname = v.nickname; | ||
152 | - if (orgName) { | ||
153 | - desc.push(orgName); | ||
154 | - } | ||
155 | - if (nickname) { | ||
156 | - desc.push(nickname); | ||
157 | - } | ||
158 | proxy.userList.push({ | 144 | proxy.userList.push({ |
159 | value: v.username, | 145 | value: v.username, |
160 | type: 'USER', | 146 | type: 'USER', |
@@ -185,28 +171,53 @@ export default { | @@ -185,28 +171,53 @@ export default { | ||
185 | } | 171 | } |
186 | } | 172 | } |
187 | 173 | ||
174 | + let docRulesForm = Vue.ref({ | ||
175 | + name: [{ | ||
176 | + required: true, | ||
177 | + message: '请填写系统名称!', | ||
178 | + trigger: 'blur' | ||
179 | + }], | ||
180 | + detail: [{ | ||
181 | + required: true, | ||
182 | + message: '请填写请求地址或事件!', | ||
183 | + trigger: 'blur' | ||
184 | + }], | ||
185 | + sort: [{ | ||
186 | + required: true, | ||
187 | + message: '请填写排序!', | ||
188 | + trigger: 'blur' | ||
189 | + }] | ||
190 | + }); | ||
191 | + | ||
188 | 192 | ||
189 | 193 | ||
190 | // 新增或修改配置 | 194 | // 新增或修改配置 |
191 | let handleConfAdd = () => { | 195 | let handleConfAdd = () => { |
192 | let url = ''; | 196 | let url = ''; |
193 | let msg = ''; | 197 | let msg = ''; |
194 | - if (isAdd.value){ | ||
195 | - url='/api-web/thirdParty/conf/add'; | ||
196 | - msg='新增成功' | ||
197 | - }else { | ||
198 | - url='/api-web/thirdParty/conf/update'; | ||
199 | - msg='修改成功' | ||
200 | - } | ||
201 | - proxy.$http.post(url, confAdd.value, function (res) { | ||
202 | - if (res && res.success){ | ||
203 | - proxy.$global.showMsg(msg,'success'); | ||
204 | - cacheVisible.value = false; | ||
205 | - getDetailList(); | 198 | + proxy.$refs.ruleForm.validate((valid) => { |
199 | + if (valid) { | ||
200 | + if (isAdd.value){ | ||
201 | + url='/api-web/thirdParty/conf/add'; | ||
202 | + msg='新增成功' | ||
203 | + }else { | ||
204 | + url='/api-web/thirdParty/conf/update'; | ||
205 | + msg='修改成功' | ||
206 | + } | ||
207 | + proxy.$http.post(url, confAdd.value, function (res) { | ||
208 | + if (res && res.success){ | ||
209 | + proxy.$global.showMsg(msg,'success'); | ||
210 | + cacheVisible.value = false; | ||
211 | + getDetailList(); | ||
212 | + }else { | ||
213 | + proxy.$global.showMsg(res.msg,'warning'); | ||
214 | + } | ||
215 | + }) | ||
206 | }else { | 216 | }else { |
207 | - proxy.$global.showMsg(res.msg,'warning'); | 217 | + return false; |
208 | } | 218 | } |
209 | }) | 219 | }) |
220 | + | ||
210 | } | 221 | } |
211 | // 删除 | 222 | // 删除 |
212 | let handleDelete = (row) => { | 223 | let handleDelete = (row) => { |
@@ -233,6 +244,10 @@ export default { | @@ -233,6 +244,10 @@ export default { | ||
233 | }) | 244 | }) |
234 | }) | 245 | }) |
235 | } | 246 | } |
247 | + //删除标签授权 | ||
248 | + let handleClose = (tag) => { | ||
249 | + handleDelete(tag); | ||
250 | + } | ||
236 | let handleUpdate = (row) =>{ | 251 | let handleUpdate = (row) =>{ |
237 | cacheVisible.value = true; | 252 | cacheVisible.value = true; |
238 | isAdd.value = false; | 253 | isAdd.value = false; |
@@ -240,6 +255,7 @@ export default { | @@ -240,6 +255,7 @@ export default { | ||
240 | confAdd.value.id = row.id; | 255 | confAdd.value.id = row.id; |
241 | confAdd.value.name = row.name; | 256 | confAdd.value.name = row.name; |
242 | confAdd.value.detail = row.detail; | 257 | confAdd.value.detail = row.detail; |
258 | + confAdd.value.sort = row.sort; | ||
243 | } | 259 | } |
244 | 260 | ||
245 | //关闭弹框 | 261 | //关闭弹框 |
@@ -275,7 +291,10 @@ export default { | @@ -275,7 +291,10 @@ export default { | ||
275 | showUserDialogVisible, | 291 | showUserDialogVisible, |
276 | selectUser, | 292 | selectUser, |
277 | userFileRight, | 293 | userFileRight, |
278 | - userList | 294 | + userList, |
295 | + columns, | ||
296 | + handleClose, | ||
297 | + docRulesForm | ||
279 | } | 298 | } |
280 | } | 299 | } |
281 | } | 300 | } |
-
Please register or login to post a comment