数据权限

szh-new
sunzehua 2 months ago
parent 369a6809a7
commit f3ce9bf8c8

@ -4,15 +4,17 @@
<!-- 费用模版表单 -->
<BasicForm @register="registerForm" @linkageForm="ChangeColumnView" />
<div style="font-weight: bold;font-size: 12px;">权限规则</div>
<div style="margin-bottom: 10px" >
<div style="margin-bottom: 10px">
<a-button type="link" @click="copy('{loginUser}')"><i class="icon-fuzhi3 iconfont"></i>本人</a-button>
<a-button type="link" @click="copy('{loginDept}')"><i class="icon-fuzhi3 iconfont"></i>本部门</a-button>
<a-button type="link" @click="copy('{loginOrg}')"><i class="icon-fuzhi3 iconfont"></i>本公司</a-button>
<a-select v-model:value="orgListValue" @change="handleCopySelect" size="small" mode="multiple" style="width: 250px">
<a-select v-model:value="orgListValue" @change="handleCopySelect" size="small" mode="multiple"
style="width: 250px">
<a-select-option v-for="(item, index) in orgList" :value="item.value" :key="index">{{ item.label
}}</a-select-option>
</a-select>
<a-select v-model:value="userListValue" @change="handleCopySelectUser" size="small" mode="multiple" style="width: 250px;margin-left: 20px">
<a-select v-model:value="userListValue" @change="handleCopySelectUser" size="small" mode="multiple"
style="width: 250px;margin-left: 20px">
<a-select-option v-for="(item, index) in userList" :value="item.value" :key="index">{{ item.label
}}</a-select-option>
</a-select>
@ -44,7 +46,7 @@ import { BasicForm, useForm } from '/@/components/Form/index'
import { getDictOption } from '/@/utils/dictUtil'
import { getColumns, getClientPermissionList } from '/@/api/system/role'
import {
getOrgList,GetUserList
getOrgList, GetUserList
} from '/@/api/common'
import columnView from './columnView.vue'
//
@ -64,9 +66,12 @@ onMounted(() => {
columnViewData.value.push({
label: item.description,
value: item.description,
...item,
...item
})
})
setTimeout(() => {
columnViewData.value = uniqueObjectsByProperty(columnViewData.value, 'label');
})
}
})
getOrgList().then(res => {
@ -193,6 +198,10 @@ const formSchema = [
componentProps: (e) => {
return {
options: columnViewData.value,
showSearch: true,
onfilterOption: (input: string, option: any) => {
return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
getPopupContainer: () => document.body,
onChange: (val: any) => {
let tableViewName = ''
@ -204,12 +213,6 @@ const formSchema = [
})
}
})
// console.log(formActionType)
// const res: any = getColumns({ tableViewName })
// if (res.succeeded) {
// console.log(res.data)
// formActionType ? formActionType.linkageForm(res.data) : null
// }
},
}
},
@ -276,6 +279,14 @@ function handleCopySelectUser(val) {
document.execCommand('copy');
document.body.removeChild(cInput);
}
function uniqueObjectsByProperty(array, property) {
const seen = new Set();
return array.filter(item => {
const key = JSON.stringify(item[property]);
return !seen.has(key) && seen.add(key);
});
}
// Emits
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)

@ -5,17 +5,7 @@ import { getColumns, getClientPermissionList } from '/@/api/system/role'
import { Tag } from 'ant-design-vue'
// 引入字典数据
import { getDictOption } from '/@/utils/dictUtil'
const columnViewData: any = []
const res: API.DataResult = await getTablesByClient()
if (res.succeeded) {
res.data.forEach((item) => {
columnViewData.push({
label: item.description,
value: item.description,
...item,
})
})
}
// 下拉框数据接口
import { GetClientListByCode } from '/@/api/common'
export const columns: BasicColumn[] = [
@ -89,5 +79,11 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input',
colProps: { span: 6 },
},
{
field: 'columnView',
label: '中文视图名',
component: 'Input',
colProps: { span: 6 },
},
]

@ -95,9 +95,6 @@
<a-button type="link" @click="openUser"
><i class="icon-zhuanfa iconfont"></i>任务转交</a-button
>
<a-button type="link" @click="openCustom"
><i class="icon-liebiao iconfont"></i>任务自定义列</a-button
>
<!-- <a-button type="link" @click="FnPrint"><i class="icon-weibiaoti-- iconfont"></i>打印</a-button> -->
<!-- <a-button type="link" @click="FnSendCar"><i class="icon-chezaikucun iconfont"></i>派车</a-button>
<a-button type="link" @click="CancelSendCar"><i
@ -197,7 +194,11 @@
>
</template>
</template>
<template #toolbar> </template>
<template #toolbar>
<a-button type="link" @click="openCustom"
><i class=" icon-shuliebiao iconfont"></i>列设置</a-button
>
</template>
<template v-slot:bodyCell="{ column, record }">
<template v-if="column.key === 'iS_EXCEPT'">
<span v-if="record.iS_EXCEPT == 1"></span>
@ -291,7 +292,7 @@
</a-table>
</div>
</template>
<span style="cursor: pointer; color: blue">{{ record.recvUserListName }}</span>
<span style="cursor: pointer; color: #257afa">{{ record.recvUserListName }}</span>
</a-popover>
</template>
<template v-if="column.key === 'busI_TYPE'">
@ -462,6 +463,7 @@
setProps({
rowSelection: {
onChange: onSelectChange,
fixed:true
},
})
})
@ -845,7 +847,7 @@
return new Promise((resolve) => {
res.data.forEach((item) => {
if (item.recvUserList) {
item.recvUserListName = item.recvUserList.map((ite) => ite.recvUserName).join('/')
item.recvUserListName = item.recvUserList.map((ite) => ite.recvUserName).join(' / ')
}
})
resolve({

@ -14,7 +14,8 @@
{"dataIndex":"createUserName","title":"创建人","width":100},
{"dataIndex":"ouT_BUSI_NO","title":"外业务编号","width":120},
{"dataIndex":"ouT_BUSI_TYPE","title":"外业务类型","width":120},
{"dataIndex":"tasK_BASE_TYPE","title":"基础业务类型","width":120},
{"dataIndex":"tasK_TYPE","title":"业务类型编码","width":100},
{"dataIndex":"tasK_TYPE_NAME","title":"业务类型名称","width":120},
{"dataIndex":"carrieR_CODE","title":"船公司","width":100},
{"dataIndex":"mbL_NO","title":"主单号","width":150, "sortable": true},
{"dataIndex":"remark","title":"备注","width":100},
@ -26,16 +27,14 @@
{"dataIndex":"etd","title":"开船日期","width":100, "sortable": true},
{"dataIndex":"completE_DEAL","title":"任务完成方式","width":120},
{"dataIndex":"issuE_TYPE_NAME","title":"签单方式","width":100},
{"dataIndex":"contA_INFO","title":"箱型箱量","width":150, "sortable": true},
{"dataIndex":"vesseL_VOYNO","title":"船名航次","width":100, "sortable": true},
{"dataIndex":"yarD_NAME","title":"场站","width":150, "sortable": true},
{"dataIndex":"trucK_NAME","title":"车队名称","width":170, "sortable": true},
{"dataIndex":"customeR_NAME","title":"委托客户","width":200, "sortable": true},
{"dataIndex":"needArriveTime","title":"要求到达时间","width":200, "sortable": true},
{"dataIndex":"realUserName","title":"实际操作人","width":100},
{"dataIndex":"batcH_STATIC","title":"批次统计","width":100},
{"dataIndex":"systeM_NAME","title":"平台名称","width":100},
{"dataIndex":"recvUserList","title":"接收人","width":100},
{"dataIndex":"recvUserList","title":"接收人","width":150},
{"dataIndex":"hbL_NO","title":"分单号","width":100},
{"dataIndex":"bookinG_NO","title":"订舱编号","width":100},
{"dataIndex":"customeR_NUM","title":"客户编号","width":100},
@ -46,7 +45,7 @@
{"dataIndex":"customerServiceName","title":"客服","width":100},
{"dataIndex":"customerName","title":"客户","width":100},
{"dataIndex":"cntrTotal","title":"箱型箱量","width":100},
{"dataIndex":"createdTime","title":"创建时间","width":200, "sortable": true}
{"dataIndex":"createTime","title":"创建时间","width":200, "sortable": true}
]
},
{

@ -3,7 +3,11 @@
<div class="main-title">
<div v-if="showBtn" class="switch"><a-switch @change="handleChangeSwitch" style="margin-right: 10px;"
v-model:checked="isSetDefault" />是否默认配置</div>
<span>*使用说明上下拖动字段排序勾选字段会显示在任务台账</span>
<div>
<div> *使用说明1.左侧勾选的字段会始终显示在任务台账列表</div>
<div> 2.除了左侧的基础字段当任务类型为指定类型时右侧勾选的字段也会额外显示出来</div>
</div>
</div>
<div style="display: flex;">
<div class="left">
@ -152,10 +156,10 @@ function getInfo() {
}
const showBtn = ref(false)
onMounted(() => {
showBtn.value = userStore.getUserInfo.userType==1 ? true : false
showBtn.value = userStore.getUserInfo.userType == 1 ? true : false
})
const emit = defineEmits(['handleSuccess'])
function init(){
function init() {
Data.forEach(item => {
if (item.type === taskType.value) {
taskList.value = item.list
@ -177,13 +181,19 @@ function getInfoBasic() {
if (res.succeeded) {
if (res.data.length > 0) {
const arr = JSON.parse(res.data[0].content)
basicList.value.forEach(item=>{
arr.forEach(ite=>{
if(item.dataIndex==ite.dataIndex){
arr.forEach((item,index)=>{
item.sort = index
})
basicList.value.forEach(item => {
arr.forEach(ite => {
if (item.dataIndex == ite.dataIndex) {
item.checked = ite.checked
item.sort = ite.sort
}
})
})
basicList.value = sortBySort(basicList.value)
console.log(basicList.value)
} else {
basicList.value.forEach(item => {
item.checked = false
@ -193,6 +203,9 @@ function getInfoBasic() {
loading1.value = false
})
}
function sortBySort(arr) {
return arr.sort((a, b) => a.sort - b.sort);
}
defineExpose({ init })
</script>

Loading…
Cancel
Save