3bf974c7 by lihua

修改logok,支持用户切换角色

1 parent 40ced974
1 # 页面标题 1 # 页面标题
2 VITE_APP_TITLE = 可信数据空间 2 VITE_APP_TITLE = 可信数据服务平台
3 # 接口域名 3 # 接口域名
4 VITE_API_BASEURL = https://sz-tds.zgsjzc.com/ 4 VITE_API_BASEURL = https://sz-tds.zgsjzc.com/
5 # VITE_API_BASEURL = http://49.4.26.201:31709/ 5 # VITE_API_BASEURL = http://49.4.26.201:31709/
......

9.52 KB | W: | H:

11.5 KB | W: | H:

src/assets/images/logo.png
src/assets/images/logo.png
src/assets/images/logo.png
src/assets/images/logo.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -286,10 +286,15 @@ onMounted(() => { ...@@ -286,10 +286,15 @@ onMounted(() => {
286 <span v-else>{{ props.tableInfo.sortable ? (scope.row.index) : (scope.$index + 1) }}</span> 286 <span v-else>{{ props.tableInfo.sortable ? (scope.row.index) : (scope.$index + 1) }}</span>
287 </template> 287 </template>
288 <template #default="scope" v-else-if="item.type == 'tag'"> 288 <template #default="scope" v-else-if="item.type == 'tag'">
289 <el-tag v-if="scope.row[item.field] !== undefined" 289 <div v-if="scope.row[item.field] !== undefined" style="position: relative;">
290 <el-tag
290 :type="item.tagType ? item.tagType(scope) : tagType(scope.row, item.field)">{{ 291 :type="item.tagType ? item.tagType(scope) : tagType(scope.row, item.field)">{{
291 item.getName ? item.getName(scope) : tagMethod(scope.row, item.field) 292 item.getName ? item.getName(scope) : tagMethod(scope.row, item.field)
292 }}</el-tag> 293 }}</el-tag>
294 <span v-if="item.btn && item.btn?.visible?.(scope) !== false && item.btn?.visible !== false" class="text_btn" style="position: absolute;right: 0;"
295 @click="(item.btn.click && !item.btn.disabled && !scope.row.disabled) ? item.btn.click(scope, item.btn) : handleClick(scope, item.btn)"
296 v-preReClick>{{ item.btn.label }}</span>
297 </div>
293 <span v-else>{{ '--' }}</span> 298 <span v-else>{{ '--' }}</span>
294 </template> 299 </template>
295 <template #default="scope" v-else-if="item.type == 'approveTagBtn'"> 300 <template #default="scope" v-else-if="item.type == 'approveTagBtn'">
......
...@@ -3,12 +3,23 @@ import { useFullscreen } from '@vueuse/core' ...@@ -3,12 +3,23 @@ import { useFullscreen } from '@vueuse/core'
3 import eventBus from '@/utils/eventBus' 3 import eventBus from '@/utils/eventBus'
4 import useSettingsStore from '@/store/modules/settings' 4 import useSettingsStore from '@/store/modules/settings'
5 import useUserStore from '@/store/modules/user' 5 import useUserStore from '@/store/modules/user'
6 import { USERROLE } from '@/utils/enum'
7 import { ElMessage } from 'element-plus'
6 const router = useRouter() 8 const router = useRouter()
7 const settingsStore = useSettingsStore() 9 const settingsStore = useSettingsStore()
8 const userStore = useUserStore() 10 const userStore = useUserStore()
11 const userData = JSON.parse(userStore.userData);
9 const mainPage = useMainPage() 12 const mainPage = useMainPage()
10 const { isFullscreen, toggle } = useFullscreen() 13 const { isFullscreen, toggle } = useFullscreen()
11 function userCommand(command: 'home' | 'setting' | 'updatePwd' | 'hotkeys' | 'logout') { 14
15 const dataRole = computed(() => {
16 return localStorage.getItem('userRole');
17 })
18
19 /** 记录用户选择的角色 */
20 const selectRole: any = ref(USERROLE.USE); //TODO,在专区需要默认值是平台运营方。
21
22 function userCommand(command: 'home' | 'setting' | 'updatePwd' | 'hotkeys' | 'logout' | 'changeRole') {
12 switch (command) { 23 switch (command) {
13 case 'home': 24 case 'home':
14 router.push({ 25 router.push({
...@@ -31,6 +42,10 @@ function userCommand(command: 'home' | 'setting' | 'updatePwd' | 'hotkeys' | 'lo ...@@ -31,6 +42,10 @@ function userCommand(command: 'home' | 'setting' | 'updatePwd' | 'hotkeys' | 'lo
31 case 'logout': 42 case 'logout':
32 userStore.logout() 43 userStore.logout()
33 break 44 break
45 case 'changeRole':
46 selectRole.value = dataRole.value;
47 verifyDialogInfo.value.visible = true;
48 break;
34 } 49 }
35 } 50 }
36 function pro() { 51 function pro() {
...@@ -40,6 +55,46 @@ const loaclStorageInfo: any = localStorage.getItem("userData") ...@@ -40,6 +55,46 @@ const loaclStorageInfo: any = localStorage.getItem("userData")
40 onMounted(() => { 55 onMounted(() => {
41 console.log('mounted', JSON.parse(userStore.userData).abbreviation) 56 console.log('mounted', JSON.parse(userStore.userData).abbreviation)
42 }) 57 })
58
59 const verifyDialogInfo = ref({
60 visible: false,
61 size: 600,
62 direction: "column",
63 header: {
64 title: "角色选择",
65 },
66 type: '',
67 contents: [],
68 footer: {
69 btns: [
70 { type: "default", label: "取消", value: "cancel" },
71 { type: "primary", label: "确定", value: "submit", loading: false },
72 ],
73 },
74 })
75
76 const verifyDialogBtnClick = (btn, info) => {
77 if (btn.value == 'submit') {
78 verifyDialogInfo.value.footer.btns[1].loading = true;
79 userStore.getUserSystemMenuByRole(selectRole.value).then((res) => {
80 verifyDialogInfo.value.footer.btns[1].loading = false;
81 if (res && res !== false) {
82 if (res?.length === 0) {
83 ElMessage.warning('该系统用户暂无可用的菜单,请先配置');
84 return;
85 }
86 localStorage.setItem('userRole', selectRole.value);
87 // 从浏览器缓存中重新加载页面
88 location.reload();
89 }
90 }).catch(() => {
91 verifyDialogInfo.value.footer.btns[1].loading = false;
92 });
93 } else if (btn.value == 'cancel') {
94 verifyDialogInfo.value.visible = false;
95 }
96 };
97
43 </script> 98 </script>
44 <template> 99 <template>
45 <div class="tools"> 100 <div class="tools">
...@@ -50,7 +105,9 @@ onMounted(() => { ...@@ -50,7 +105,9 @@ onMounted(() => {
50 </el-icon> 105 </el-icon>
51 </span> 106 </span>
52 </div> --> 107 </div> -->
53 <el-dropdown class="user-container" size="default" @command="userCommand"> 108 <el-popover class="user-container" :width="280" :show-arrow="false" popper-class="user-setting">
109 <template #reference>
110 <div class="user-container">
54 <div class="user-wrapper"> 111 <div class="user-wrapper">
55 112
56 <div class="v-uerinfo"> 113 <div class="v-uerinfo">
...@@ -68,20 +125,64 @@ onMounted(() => { ...@@ -68,20 +125,64 @@ onMounted(() => {
68 </el-icon> 125 </el-icon>
69 </div> --> 126 </div> -->
70 </div> 127 </div>
71 <template #dropdown> 128 </div>
72 <el-dropdown-menu class="user-dropdown"> 129 </template>
73 <!-- <el-dropdown-item command="setting"> 130 <template #default>
74 个人设置 131 <div class="avatar-info">
75 </el-dropdown-item> --> 132 <div class='flex-row'>
76 <el-dropdown-item command="updatePwd"> 133 <el-avatar>
77 修改密码 134 <el-icon>
78 </el-dropdown-item> 135 <svg-icon name="ep:user-filled" />
79 <el-dropdown-item divided command="logout"> 136 </el-icon>
80 退出登录 137 </el-avatar>
81 </el-dropdown-item> 138 <div class="ml8">
82 </el-dropdown-menu> 139 <div class="color-21">
140 {{ userStore.userName }}
141 </div>
142 <div class="text-left">
143 账号: {{ userData.mobileNo.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') }}
144 </div>
145 </div>
146 </div>
147 </div>
148 <div class="horizontal-line"></div>
149 <div class="user-setting-menu">
150 <div class="menu-wrapper" @click="userCommand('changeRole')">
151 <span class="color-21">用户角色</span>
152 <span>{{ dataRole == USERROLE.USE ? '数据使用方' : (dataRole == USERROLE.OPERATION ? '平台运营方' : '数据提供方') }}
153 <el-icon>
154 <svg-icon name="ep:arrow-right" />
155 </el-icon>
156 </span>
157 </div>
158 </div>
159 <div class="horizontal-line"></div>
160 <div class="login-out">
161 <div class="login-out-btn" @click="userCommand('logout')">
162 {{ '退出登录' }}
163 </div>
164 </div>
83 </template> 165 </template>
84 </el-dropdown> 166 </el-popover>
167
168 <Dialog :dialogInfo="verifyDialogInfo" @btnClick="verifyDialogBtnClick">
169 <div class="row-main">
170 <div class="per" :class="selectRole == USERROLE.USE ? 'selected' : ''" @click="selectRole = USERROLE.USE">
171 <div class="img-use"></div>
172 <div class="title">数据使用方</div>
173 </div>
174 <div class="per" :class="selectRole == USERROLE.PROVIDER ? 'selected' : ''"
175 @click="selectRole = USERROLE.PROVIDER">
176 <div class="img-provider"></div>
177 <div class="title">数据提供方</div>
178 </div>
179 <!-- 只有专区的超级管理员才有 -->
180 <!-- <div class="per" :class="selectRole == USERROLE.OPERATION ? 'selected' : ''" @click="selectRole = USERROLE.OPERATION">
181 <div class="img-operation"></div>
182 <div class="title">平台运营方</div>
183 </div> -->
184 </div>
185 </Dialog>
85 </div> 186 </div>
86 </template> 187 </template>
87 <style lang="scss" scoped> 188 <style lang="scss" scoped>
...@@ -158,6 +259,88 @@ onMounted(() => { ...@@ -158,6 +259,88 @@ onMounted(() => {
158 } 259 }
159 } 260 }
160 261
262 :deep(.el-popper) {
263 padding: 0;
264 }
265
266 :deep(.user-setting) {
267 padding: 0 !important;
268 }
269
270 .horizontal-line {
271 border: none;
272 height: 1px;
273 background-color: #E5E5E5;
274 width: 100%;
275 /* 宽度为容器的100% */
276 }
277
278 .menu-wrapper {
279 cursor: pointer;
280 display: flex;
281 justify-content: space-between;
282 padding: 10px 0;
283 }
284
285 .menu-wrapper:hover {
286 background: #F5F5F5;
287 }
288
289 .login-out {
290 cursor: pointer;
291 text-align: center;
292 padding: 0 10px;
293 }
294
295 .login-out-btn {
296 height: 32px;
297 line-height: 32px;
298 margin-top: 10px;
299 width: 100%;
300 background: #FFFFFF;
301 border: 1px solid rgba(217, 217, 217, 1);
302 }
303
304 .color-21 {
305 color: #212121;
306 font-size: 14px;
307 padding-right: 12px;
308
309 &.mark-icon {
310 padding: 0 16px;
311 display: flex;
312 align-items: center;
313 position: relative;
314
315 img {
316 width: 24px;
317 height: 24px;
318 margin-right: 8px;
319 }
320
321 &::after {
322 height: 40px;
323 content: '';
324 border-right: 1px solid #E5E5E5;
325 position: absolute;
326 top: 50%;
327 right: 0;
328 transform: translateY(-50%);
329 }
330 }
331 }
332
333 .avatar-info {
334 padding-bottom: 10px;
335 }
336
337 .flex-row {
338 display: flex;
339 flex-direction: row;
340 align-items: center;
341 justify-content: flex-start;
342 }
343
161 :deep(.user-container) { 344 :deep(.user-container) {
162 display: inline-block; 345 display: inline-block;
163 height: 24px; 346 height: 24px;
...@@ -191,4 +374,80 @@ onMounted(() => { ...@@ -191,4 +374,80 @@ onMounted(() => {
191 } 374 }
192 } 375 }
193 } 376 }
377
378 .ml8 {
379 margin-left: 8px;
380 }
381
382 .row-main {
383 display: flex;
384 flex-direction: row;
385 column-gap: 40px;
386 margin: 30px 20px 10px;
387
388 .per {
389 cursor: pointer;
390
391 &.selected {
392 .img-use {
393 background-image: url('@/assets/images/dataUser-select.png');
394 }
395
396 .img-provider {
397 background-image: url('@/assets/images/dataProvider-select.png');
398 }
399
400 .img-operation {
401 background-image: url('@/assets/images/dataOperation-select.png');
402 }
403
404 .title {
405 color: #1478E9;
406 }
407 }
408
409 .img-use {
410 width: 100px;
411 height: 100px;
412 background-image: url('@/assets/images/dataUser-default.png');
413 background-size: cover;
414 /* 背景图覆盖整个元素 */
415 background-position: center;
416 /* 背景图居中 */
417 background-repeat: no-repeat;
418 }
419
420 .img-provider {
421 width: 100px;
422 height: 100px;
423 background-image: url('@/assets/images/dataProvider-default.png');
424 background-size: cover;
425 /* 背景图覆盖整个元素 */
426 background-position: center;
427 /* 背景图居中 */
428 background-repeat: no-repeat;
429 }
430
431 .img-operation {
432 width: 100px;
433 height: 100px;
434 background-image: url('@/assets/images/dataOperation-default.png');
435 background-size: cover;
436 /* 背景图覆盖整个元素 */
437 background-position: center;
438 /* 背景图居中 */
439 background-repeat: no-repeat;
440 }
441
442 .title {
443 margin-top: 8px;
444 font-size: 14px;
445 color: #666666;
446 line-height: 21px;
447 font-weight: 400;
448 text-align: center;
449 width: 100px;
450 }
451 }
452 }
194 </style> 453 </style>
......
...@@ -271,7 +271,6 @@ const beforeLogin = () => { ...@@ -271,7 +271,6 @@ const beforeLogin = () => {
271 271
272 .title { 272 .title {
273 margin-top: 8px; 273 margin-top: 8px;
274 font-family: PingFangSC-Regular;
275 font-size: 14px; 274 font-size: 14px;
276 color: #666666; 275 color: #666666;
277 line-height: 21px; 276 line-height: 21px;
......
1 <script lang="ts" setup name="dataDelivery"> 1 <script lang="ts" setup name="dataDelivery">
2 import TableTools from "@/components/Tools/table_tools.vue"; 2 import TableTools from "@/components/Tools/table_tools.vue";
3 import { commonPageConfig } from '@/utils/enum'; 3 import { commonPageConfig, TableColumnWidth } from '@/utils/enum';
4 import { 4 import {
5 getPageList, 5 getPageList,
6 deleteDeliveryContract 6 deleteDeliveryContract
...@@ -114,7 +114,15 @@ const tableFields = ref([ ...@@ -114,7 +114,15 @@ const tableFields = ref([
114 } 114 }
115 }, 115 },
116 { 116 {
117 label: "核验状态", field: "verifySatus", type: "tag", width: 96, align: 'center', 117 label: "核验状态", field: "verifySatus", type: "tag", width: 148, align: 'center',
118 btn: {
119 label: '查看', visible: (scope) => {
120 return scope.row.verifySatus != 1;
121 }, click: (scope) => {
122 //弹出查看日志框。
123 dialogInfo.value.visible = true;
124 },
125 },
118 getName: (scope) => { 126 getName: (scope) => {
119 const verifySatus = scope.row.verifySatus 127 const verifySatus = scope.row.verifySatus
120 switch (verifySatus) { 128 switch (verifySatus) {
...@@ -162,7 +170,7 @@ const tableInfo = ref({ ...@@ -162,7 +170,7 @@ const tableInfo = ref({
162 rowKey: 'guid', 170 rowKey: 'guid',
163 loading: false, 171 loading: false,
164 fields: tableFields.value, 172 fields: tableFields.value,
165 data: [{ verifySatus: 4 }, {}], 173 data: [{verifySatus: 2}, { verifySatus: 4 }, { verifySatus: 3, deliveryStatus: 2, }],
166 page: { 174 page: {
167 type: "normal", 175 type: "normal",
168 rows: 0, 176 rows: 0,
...@@ -195,22 +203,29 @@ const tableInfo = ref({ ...@@ -195,22 +203,29 @@ const tableInfo = ref({
195 } 203 }
196 }); 204 });
197 } else { 205 } else {
198 btns.push({
199 value: 'refresh', label: '刷新', click: (scope) => {
200 206
201 } 207 }
202 });
203 }
204 208
205 // 交付只有核验通过有。 209 // 交付只有核验通过有。
206 let verifySatus = row.verifySatus; 210 let verifySatus = row.verifySatus;
211 (verifySatus == 1 || verifySatus == 4) && btns.push({
212 value: 'refresh', label: '刷新', click: (scope) => {
213
214 }
215 });
207 if (verifySatus == 2) { 216 if (verifySatus == 2) {
208 btns.push({ 217 btns.push({
209 value: 'verify', label: '核验', click: (scope) => { 218 value: 'verify', label: '核验', click: (scope) => {
210 219 verifyDialogInfo.value.visible = true;
211 } 220 }
212 }); 221 });
213 } 222 }
223 //已通过且未交付时,有交付按钮
224 verifySatus == 3 && deliveryStatus != 2 && btns.push({
225 value: 'delivery', label: '交付', click: (scope) => {
226
227 }
228 });
214 return btns; 229 return btns;
215 } 230 }
216 } 231 }
...@@ -266,6 +281,128 @@ onBeforeMount(() => { ...@@ -266,6 +281,128 @@ onBeforeMount(() => {
266 toSearch({}); 281 toSearch({});
267 }); 282 });
268 283
284 const dialogInfo = ref({
285 visible: false,
286 size: 700,
287 direction: "column",
288 header: {
289 title: "查看执行内容",
290 },
291 footer: {
292 visible: false
293 }
294 });
295
296 const handleDialogCancel = () => {
297 dialogInfo.value.visible = false;
298 }
299
300 const execTableInfo = ref({
301 id: "exec-table",
302 height: '214px',
303 fields: <any[]>[
304 { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
305 { label: "策略id", field: "strategyId", width: 260 },
306 { label: "操作行为", field: "action", width: 120 },
307 { label: "操作行为英文名称", field: "actionEnName", width: 140 },
308 { label: "约束条件", field: "constraintName", width: 120 },
309 { label: "约束条件英文名称", field: "constraintEnName", width: 140 },
310 { label: "约束条件运算符", field: "constraintOperatorName", width: 140 },
311 { label: "约束条件值", field: "constraintValue", width: 150 },
312 { label: "检验结果", field: "result", width: 130 },
313 // { label: "上报时间", field: "reportingTime", width: 170 },
314 ],
315 data: [],
316 showPage: false,
317 actionInfo: {
318 show: false
319 },
320 loading: false
321 });
322
323 const verifyDialogInfo = ref({
324 visible: false,
325 size: 460,
326 direction: "column",
327 header: {
328 title: "核验",
329 },
330 type: '',
331 contents: [
332 {
333 type: 'form',
334 title: '',
335 formInfo: {
336 id: 'batch-pass-form',
337 items: [
338 {
339 type: 'radio-group',
340 label: ' ',
341 field: 'verifySatus ',
342 default: 'TG',
343 required: false,
344 options: [
345 { label: '通过', value: 'TG' },
346 { label: '未通过', value: 'NTG' },
347 ],
348 },
349 {
350 label: '',
351 type: "textarea",
352 placeholder: "请填写未通过理由(必填)",
353 field: "approveSuggest",
354 clearable: true,
355 required: true,
356 visible: true,
357 block: true,
358 col: 'margin_b_0',
359 }
360 ]
361 }
362 }
363 ],
364 footer: {
365 btns: [
366 { type: "default", label: "取消", value: "cancel" },
367 { type: "primary", label: "确定", value: "submit", loading: false },
368 ],
369 },
370 });
371
372 const verifyDialogRadioChange = (val, row, info) => {
373
374 }
375
376 const verifyDialogBtnClick = (btn, info) => {
377 if (btn.value == 'submit') {
378 // passDialogInfo.value.footer.btns[1].loading = true;
379 // let params = {
380 // guid: currTableData.value.approveVO.approveGuid,
381 // flowType: currTableData.value.approveVO.flowType,
382 // approveSuggest: info.approveSuggest,
383 // approveStaffGuid: userData.staffGuid,
384 // }
385 // passFlowData(params, currTableData.value.tenantGuid).then((res: any) => {
386 // passDialogInfo.value.footer.btns[1].loading = false;
387 // if (res?.code == proxy.$passCode) {
388 // if (res.data) {
389 // ElMessage.success('审批成功');
390 // passDialogInfo.value.visible = false;
391 // getTableData();
392 // } else {
393 // ElMessage.error('审批失败');
394 // }
395 // } else {
396 // ElMessage.error(res.msg);
397 // }
398 // }).catch(() => {
399 // passDialogInfo.value.footer.btns[1].loading = false;
400 // });
401 } else if (btn.value == 'cancel') {
402 verifyDialogInfo.value.visible = false;
403 }
404 };
405
269 </script> 406 </script>
270 407
271 <template> 408 <template>
...@@ -276,6 +413,11 @@ onBeforeMount(() => { ...@@ -276,6 +413,11 @@ onBeforeMount(() => {
276 <div class="table_panel_wrap" style="height: calc(100% - 44px);"> 413 <div class="table_panel_wrap" style="height: calc(100% - 44px);">
277 <Table :tableInfo="tableInfo" @tablePageChange="tablePageChange" /> 414 <Table :tableInfo="tableInfo" @tablePageChange="tablePageChange" />
278 </div> 415 </div>
416 <el-dialog v-model="dialogInfo.visible" :title="dialogInfo.header.title" width="700" :modal="true"
417 :close-on-click-modal="true" destroy-on-close align-center @close="handleDialogCancel">
418 <Table ref="execTableRef" :tableInfo="execTableInfo" class="exec-table" />
419 </el-dialog>
420 <Dialog :dialogInfo="verifyDialogInfo" @btnClick="verifyDialogBtnClick" @radio-group-change=verifyDialogRadioChange />
279 </div> 421 </div>
280 </template> 422 </template>
281 423
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!