Commit 4fd8d1e5a4f1f9ee24c232f91311f64487cd8e5a
Merge branch 'f-dev' into 'main'
fix:修改teambition上的问题 See merge request huang/yun-teng-iot-front!234
Showing
10 changed files
with
136 additions
and
60 deletions
| @@ -111,7 +111,8 @@ export const getOrganizationAlarmConfig = (params: { organizationId }) => { | @@ -111,7 +111,8 @@ export const getOrganizationAlarmConfig = (params: { organizationId }) => { | ||
| 111 | * 获取设备属性列表 | 111 | * 获取设备属性列表 |
| 112 | */ | 112 | */ |
| 113 | export const getAttribute = (orgId, deviceIds) => { | 113 | export const getAttribute = (orgId, deviceIds) => { |
| 114 | + const joinText = deviceIds == null ? [] : '?deviceIds=' + deviceIds; | ||
| 114 | return defHttp.get({ | 115 | return defHttp.get({ |
| 115 | - url: ScreenManagerApi.GET_ATTRBUTELIST + '/' + orgId + '?' + deviceIds, | 116 | + url: ScreenManagerApi.GET_ATTRBUTELIST + '/' + orgId + joinText, |
| 116 | }); | 117 | }); |
| 117 | }; | 118 | }; |
| @@ -58,7 +58,7 @@ export const phoneRule: Rule[] = [ | @@ -58,7 +58,7 @@ export const phoneRule: Rule[] = [ | ||
| 58 | export const emailRule: Rule[] = [ | 58 | export const emailRule: Rule[] = [ |
| 59 | { | 59 | { |
| 60 | validator: (_, value: string) => { | 60 | validator: (_, value: string) => { |
| 61 | - const reg = /^[a-zA-Z0-9]+([-_.][A-Za-zd]+)*@([a-zA-Z0-9]+[-.])+[A-Za-zd]{2,5}$/; | 61 | + const reg = /^\w{3,}(\.\w+)*@[A-z0-9]+(\.[A-z]{2,5}){1,2}$/; |
| 62 | if (!value) { | 62 | if (!value) { |
| 63 | return Promise.resolve(); | 63 | return Promise.resolve(); |
| 64 | } else if (!reg.test(value)) { | 64 | } else if (!reg.test(value)) { |
| @@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
| 7 | search | 7 | search |
| 8 | :clickRowToExpand="false" | 8 | :clickRowToExpand="false" |
| 9 | :treeData="treeData" | 9 | :treeData="treeData" |
| 10 | + :expandedKeys="treeExpandData" | ||
| 10 | :replaceFields="{ key: 'id', title: 'name' }" | 11 | :replaceFields="{ key: 'id', title: 'name' }" |
| 11 | :selectedKeys="selectedKeys" | 12 | :selectedKeys="selectedKeys" |
| 12 | @select="handleSelect" | 13 | @select="handleSelect" |
| @@ -20,17 +21,25 @@ | @@ -20,17 +21,25 @@ | ||
| 20 | const emit = defineEmits(['select']); | 21 | const emit = defineEmits(['select']); |
| 21 | const treeData = ref<TreeItem[]>([]); | 22 | const treeData = ref<TreeItem[]>([]); |
| 22 | const selectedKeys = ref<string[]>(); | 23 | const selectedKeys = ref<string[]>(); |
| 23 | - | 24 | + const treeExpandData = ref([]); |
| 25 | + //获取所有父级id | ||
| 26 | + function findForAllId(data = [], arr = []) { | ||
| 27 | + for (const item of data) { | ||
| 28 | + arr.push(item.id); | ||
| 29 | + } | ||
| 30 | + return arr; | ||
| 31 | + } | ||
| 24 | function handleSelect(keys) { | 32 | function handleSelect(keys) { |
| 25 | emit('select', keys[0]); | 33 | emit('select', keys[0]); |
| 26 | } | 34 | } |
| 27 | - | ||
| 28 | function resetOrganization() { | 35 | function resetOrganization() { |
| 29 | selectedKeys.value = []; | 36 | selectedKeys.value = []; |
| 30 | } | 37 | } |
| 31 | - | ||
| 32 | onMounted(async () => { | 38 | onMounted(async () => { |
| 33 | treeData.value = (await getOrganizationList()) as unknown as TreeItem[]; | 39 | treeData.value = (await getOrganizationList()) as unknown as TreeItem[]; |
| 40 | + const getAllIds = findForAllId(treeData.value as any, []); | ||
| 41 | + //设置要展开的id | ||
| 42 | + treeExpandData.value = getAllIds; | ||
| 34 | }); | 43 | }); |
| 35 | defineExpose({ | 44 | defineExpose({ |
| 36 | resetOrganization, | 45 | resetOrganization, |
| @@ -204,12 +204,12 @@ | @@ -204,12 +204,12 @@ | ||
| 204 | const helpDoc = ref([ | 204 | const helpDoc = ref([ |
| 205 | { | 205 | { |
| 206 | title: '如何接入设备?', | 206 | title: '如何接入设备?', |
| 207 | - href: 'https://docs.thingskit.com/', | 207 | + href: 'https://docs.thingskit.com/thingskit-link/operation-guide/device-manage.html#%E8%AE%BE%E5%A4%87%E5%88%97%E8%A1%A8', |
| 208 | target: '_blank ', | 208 | target: '_blank ', |
| 209 | }, | 209 | }, |
| 210 | { | 210 | { |
| 211 | title: '什么是设备配置?', | 211 | title: '什么是设备配置?', |
| 212 | - href: 'https://docs.thingskit.com/', | 212 | + href: 'https://docs.thingskit.com/thingskit-link/operation-guide/device-manage.html#%E8%AE%BE%E5%A4%87%E9%85%8D%E7%BD%AE', |
| 213 | target: '_blank ', | 213 | target: '_blank ', |
| 214 | }, | 214 | }, |
| 215 | { | 215 | { |
| @@ -270,11 +270,11 @@ | @@ -270,11 +270,11 @@ | ||
| 270 | try { | 270 | try { |
| 271 | // 该设备是否正在被场景联动使用中? | 271 | // 该设备是否正在被场景联动使用中? |
| 272 | const isEnabled = await checkDeviceOccupied(record.id); | 272 | const isEnabled = await checkDeviceOccupied(record.id); |
| 273 | - if (!isEnabled) { | 273 | + if (!isEnabled.data) { |
| 274 | + createMessage.warn(`${isEnabled.message}`); | ||
| 275 | + } else { | ||
| 274 | await cancelDispatchCustomer(record); | 276 | await cancelDispatchCustomer(record); |
| 275 | handleReload(); | 277 | handleReload(); |
| 276 | - } else { | ||
| 277 | - createMessage.warn('该设备正在使用中~'); | ||
| 278 | } | 278 | } |
| 279 | } catch {} | 279 | } catch {} |
| 280 | } | 280 | } |
| @@ -18,7 +18,9 @@ | @@ -18,7 +18,9 @@ | ||
| 18 | @click="handleDeleteOrBatchDelete(null)" | 18 | @click="handleDeleteOrBatchDelete(null)" |
| 19 | :disabled="singleStopDeleteStatus || hasBatchDelete" | 19 | :disabled="singleStopDeleteStatus || hasBatchDelete" |
| 20 | > | 20 | > |
| 21 | - 批量删除 | 21 | + <span :style="{ color: singleStopDeleteStatus || hasBatchDelete ? 'grey' : 'white' }" |
| 22 | + >批量删除</span | ||
| 23 | + > | ||
| 22 | </a-button> | 24 | </a-button> |
| 23 | </Authority> | 25 | </Authority> |
| 24 | <a-button | 26 | <a-button |
| @@ -128,6 +130,7 @@ | @@ -128,6 +130,7 @@ | ||
| 128 | let isJudgeSelectRowsArr: any = ref([]); | 130 | let isJudgeSelectRowsArr: any = ref([]); |
| 129 | const handleSuccess = () => { | 131 | const handleSuccess = () => { |
| 130 | reload(); | 132 | reload(); |
| 133 | + resetSelectedRowKeys(); | ||
| 131 | }; | 134 | }; |
| 132 | const [registerModal, { openModal }] = useModal(); | 135 | const [registerModal, { openModal }] = useModal(); |
| 133 | const [ | 136 | const [ |
| @@ -155,16 +158,14 @@ | @@ -155,16 +158,14 @@ | ||
| 155 | fixed: 'right', | 158 | fixed: 'right', |
| 156 | }, | 159 | }, |
| 157 | }); | 160 | }); |
| 158 | - const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete( | ||
| 159 | - deleteConvertApi, | ||
| 160 | - handleSuccess, | ||
| 161 | - setProps | ||
| 162 | - ); | 161 | + const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } = |
| 162 | + useBatchDelete(deleteConvertApi, handleSuccess, setProps); | ||
| 163 | selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => { | 163 | selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => { |
| 164 | - // Demo:status为1的选择框禁用 | 164 | + //status为1的选择框禁用 |
| 165 | if (record.status === 1) { | 165 | if (record.status === 1) { |
| 166 | return { disabled: true }; | 166 | return { disabled: true }; |
| 167 | } else { | 167 | } else { |
| 168 | + disabledStatus2.value = true; | ||
| 168 | singleStopDeleteStatus.value = false; | 169 | singleStopDeleteStatus.value = false; |
| 169 | return { disabled: false }; | 170 | return { disabled: false }; |
| 170 | } | 171 | } |
| @@ -204,8 +205,13 @@ | @@ -204,8 +205,13 @@ | ||
| 204 | if (res !== '') { | 205 | if (res !== '') { |
| 205 | createMessage.success('流转配置启用成功'); | 206 | createMessage.success('流转配置启用成功'); |
| 206 | setLoading(false); | 207 | setLoading(false); |
| 207 | - reload(); | 208 | + handleSuccess(); |
| 209 | + singleStopDeleteStatus.value = true; | ||
| 208 | disabledStatus1.value = true; | 210 | disabledStatus1.value = true; |
| 211 | + disabledStatus2.value = true; | ||
| 212 | + disabledStatus3.value = true; | ||
| 213 | + resetSelectedRowKeys(); | ||
| 214 | + clearSelectedRowKeys(); | ||
| 209 | } else { | 215 | } else { |
| 210 | createMessage.error('流转配置启用失败'); | 216 | createMessage.error('流转配置启用失败'); |
| 211 | } | 217 | } |
| @@ -228,7 +234,13 @@ | @@ -228,7 +234,13 @@ | ||
| 228 | if (res !== '') { | 234 | if (res !== '') { |
| 229 | createMessage.success('流转配置禁用成功'); | 235 | createMessage.success('流转配置禁用成功'); |
| 230 | setLoading(false); | 236 | setLoading(false); |
| 231 | - reload(); | 237 | + handleSuccess(); |
| 238 | + singleStopDeleteStatus.value = true; | ||
| 239 | + disabledStatus1.value = true; | ||
| 240 | + disabledStatus2.value = true; | ||
| 241 | + disabledStatus3.value = true; | ||
| 242 | + resetSelectedRowKeys(); | ||
| 243 | + clearSelectedRowKeys(); | ||
| 232 | } else { | 244 | } else { |
| 233 | createMessage.error('流转配置禁用失败'); | 245 | createMessage.error('流转配置禁用失败'); |
| 234 | } | 246 | } |
| @@ -287,7 +299,7 @@ | @@ -287,7 +299,7 @@ | ||
| 287 | if (res !== '') { | 299 | if (res !== '') { |
| 288 | createMessage.success('流转配置多项禁用成功'); | 300 | createMessage.success('流转配置多项禁用成功'); |
| 289 | setLoading(false); | 301 | setLoading(false); |
| 290 | - reload(); | 302 | + handleSuccess(); |
| 291 | } else { | 303 | } else { |
| 292 | createMessage.error('流转配置多项禁用失败'); | 304 | createMessage.error('流转配置多项禁用失败'); |
| 293 | } | 305 | } |
| @@ -314,7 +326,7 @@ | @@ -314,7 +326,7 @@ | ||
| 314 | if (res !== '') { | 326 | if (res !== '') { |
| 315 | createMessage.success('流转配置多项启用成功'); | 327 | createMessage.success('流转配置多项启用成功'); |
| 316 | setLoading(false); | 328 | setLoading(false); |
| 317 | - reload(); | 329 | + handleSuccess(); |
| 318 | disabledStatus1.value = true; | 330 | disabledStatus1.value = true; |
| 319 | singleStopDeleteStatus.value = true; | 331 | singleStopDeleteStatus.value = true; |
| 320 | } else { | 332 | } else { |
| @@ -169,7 +169,6 @@ | @@ -169,7 +169,6 @@ | ||
| 169 | organizationId, | 169 | organizationId, |
| 170 | triggers.map((m) => m.entityId).join(',') | 170 | triggers.map((m) => m.entityId).join(',') |
| 171 | ); | 171 | ); |
| 172 | - | ||
| 173 | // 生成回显时对应得组件数量 | 172 | // 生成回显时对应得组件数量 |
| 174 | triggerData.value = [...new Array(triggers.length).keys()]; | 173 | triggerData.value = [...new Array(triggers.length).keys()]; |
| 175 | conditionData.value = [...new Array(doConditions.length).keys()]; | 174 | conditionData.value = [...new Array(doConditions.length).keys()]; |
| @@ -194,6 +193,8 @@ | @@ -194,6 +193,8 @@ | ||
| 194 | }; | 193 | }; |
| 195 | }); | 194 | }); |
| 196 | deviceList.value = editEntryIdData.value; | 195 | deviceList.value = editEntryIdData.value; |
| 196 | + deviceExcludeDoAction.value = editEntryIdExcludeDoActionData.value; | ||
| 197 | + | ||
| 197 | //回显属性列表 | 198 | //回显属性列表 |
| 198 | editAttrIdData = attrList; | 199 | editAttrIdData = attrList; |
| 199 | nextTick(() => { | 200 | nextTick(() => { |
| @@ -538,7 +539,6 @@ | @@ -538,7 +539,6 @@ | ||
| 538 | function setFields(linkAge, isOrganizationChange = false) { | 539 | function setFields(linkAge, isOrganizationChange = false) { |
| 539 | unref(linkAge).map((item) => { | 540 | unref(linkAge).map((item) => { |
| 540 | isOrganizationChange && item.resetFieldsValueFunc(); | 541 | isOrganizationChange && item.resetFieldsValueFunc(); |
| 541 | - console.log(item); | ||
| 542 | if (item.isTriggerAndConditionFlag == 'isTriggerAndConditionFlag') { | 542 | if (item.isTriggerAndConditionFlag == 'isTriggerAndConditionFlag') { |
| 543 | item.updateExcludeActionFieldDeviceId(deviceExcludeDoAction); | 543 | item.updateExcludeActionFieldDeviceId(deviceExcludeDoAction); |
| 544 | } else { | 544 | } else { |
| 1 | import { BasicColumn, FormSchema } from '/@/components/Table'; | 1 | import { BasicColumn, FormSchema } from '/@/components/Table'; |
| 2 | import moment from 'moment'; | 2 | import moment from 'moment'; |
| 3 | +import { findDictItemByCode } from '/@/api/system/dict'; | ||
| 3 | 4 | ||
| 5 | +//格式化资源类型和操作类型 | ||
| 6 | +let formatText; | ||
| 7 | +let actionTypeText; | ||
| 8 | +async function formatTextFunc() { | ||
| 9 | + formatText = await findDictItemByCode({ dictCode: 'operate_log' }); | ||
| 10 | + actionTypeText = await findDictItemByCode({ dictCode: 'exception_log' }); | ||
| 11 | +} | ||
| 12 | +formatTextFunc(); | ||
| 4 | // 表格数据 | 13 | // 表格数据 |
| 5 | export const columns: BasicColumn[] = [ | 14 | export const columns: BasicColumn[] = [ |
| 6 | { | 15 | { |
| @@ -17,6 +26,14 @@ export const columns: BasicColumn[] = [ | @@ -17,6 +26,14 @@ export const columns: BasicColumn[] = [ | ||
| 17 | title: '资源类型', | 26 | title: '资源类型', |
| 18 | dataIndex: 'entityType', | 27 | dataIndex: 'entityType', |
| 19 | width: 180, | 28 | width: 180, |
| 29 | + format: (_, record) => { | ||
| 30 | + const text = formatText.find((f) => { | ||
| 31 | + if (f.itemValue == record.entityType) { | ||
| 32 | + return f.itemText; | ||
| 33 | + } | ||
| 34 | + }); | ||
| 35 | + return text?.itemText; | ||
| 36 | + }, | ||
| 20 | }, | 37 | }, |
| 21 | { | 38 | { |
| 22 | title: '资源名称', | 39 | title: '资源名称', |
| @@ -32,18 +49,29 @@ export const columns: BasicColumn[] = [ | @@ -32,18 +49,29 @@ export const columns: BasicColumn[] = [ | ||
| 32 | title: '操作类型', | 49 | title: '操作类型', |
| 33 | dataIndex: 'actionType', | 50 | dataIndex: 'actionType', |
| 34 | width: 180, | 51 | width: 180, |
| 52 | + format: (_, record) => { | ||
| 53 | + const text = actionTypeText.find((f) => { | ||
| 54 | + if (f.itemValue == record.actionType) { | ||
| 55 | + return f.itemText; | ||
| 56 | + } | ||
| 57 | + }); | ||
| 58 | + return text?.itemText; | ||
| 59 | + }, | ||
| 35 | }, | 60 | }, |
| 36 | { | 61 | { |
| 37 | title: '操作状态', | 62 | title: '操作状态', |
| 38 | dataIndex: 'actionStatus', | 63 | dataIndex: 'actionStatus', |
| 39 | width: 180, | 64 | width: 180, |
| 65 | + format: (_, record) => { | ||
| 66 | + return record.actionStatus == 'SUCCESS' ? '成功' : '失败'; | ||
| 67 | + }, | ||
| 40 | }, | 68 | }, |
| 41 | { | 69 | { |
| 42 | title: '操作时间', | 70 | title: '操作时间', |
| 43 | dataIndex: 'createdTime', | 71 | dataIndex: 'createdTime', |
| 44 | - width: 80, | 72 | + width: 180, |
| 45 | format: (_, record) => { | 73 | format: (_, record) => { |
| 46 | - return moment(record.createdTime).format('YYYY-MM-DD'); | 74 | + return moment(record.createdTime).format('YYYY-MM-DD-HH-MM-ss'); |
| 47 | }, | 75 | }, |
| 48 | }, | 76 | }, |
| 49 | ]; | 77 | ]; |
| 1 | import { BasicColumn, FormSchema } from '/@/components/Table'; | 1 | import { BasicColumn, FormSchema } from '/@/components/Table'; |
| 2 | import moment from 'moment'; | 2 | import moment from 'moment'; |
| 3 | +import { findDictItemByCode } from '/@/api/system/dict'; | ||
| 3 | 4 | ||
| 5 | +//格式化资源类型和操作类型 | ||
| 6 | +let formatText; | ||
| 7 | +let actionTypeText; | ||
| 8 | + | ||
| 9 | +async function formatTextFunc() { | ||
| 10 | + formatText = await findDictItemByCode({ dictCode: 'operate_log' }); | ||
| 11 | + actionTypeText = await findDictItemByCode({ dictCode: 'exception_log' }); | ||
| 12 | +} | ||
| 13 | +formatTextFunc(); | ||
| 4 | // 表格数据 | 14 | // 表格数据 |
| 5 | export const columns: BasicColumn[] = [ | 15 | export const columns: BasicColumn[] = [ |
| 6 | { | 16 | { |
| @@ -17,6 +27,14 @@ export const columns: BasicColumn[] = [ | @@ -17,6 +27,14 @@ export const columns: BasicColumn[] = [ | ||
| 17 | title: '资源类型', | 27 | title: '资源类型', |
| 18 | dataIndex: 'entityType', | 28 | dataIndex: 'entityType', |
| 19 | width: 180, | 29 | width: 180, |
| 30 | + format: (_, record) => { | ||
| 31 | + const text = formatText.find((f) => { | ||
| 32 | + if (f.itemValue == record.entityType) { | ||
| 33 | + return f.itemText; | ||
| 34 | + } | ||
| 35 | + }); | ||
| 36 | + return text?.itemText; | ||
| 37 | + }, | ||
| 20 | }, | 38 | }, |
| 21 | { | 39 | { |
| 22 | title: '资源名称', | 40 | title: '资源名称', |
| @@ -32,18 +50,29 @@ export const columns: BasicColumn[] = [ | @@ -32,18 +50,29 @@ export const columns: BasicColumn[] = [ | ||
| 32 | title: '操作类型', | 50 | title: '操作类型', |
| 33 | dataIndex: 'actionType', | 51 | dataIndex: 'actionType', |
| 34 | width: 180, | 52 | width: 180, |
| 53 | + format: (_, record) => { | ||
| 54 | + const text = actionTypeText.find((f) => { | ||
| 55 | + if (f.itemValue == record.actionType) { | ||
| 56 | + return f.itemText; | ||
| 57 | + } | ||
| 58 | + }); | ||
| 59 | + return text?.itemText; | ||
| 60 | + }, | ||
| 35 | }, | 61 | }, |
| 36 | { | 62 | { |
| 37 | title: '操作状态', | 63 | title: '操作状态', |
| 38 | dataIndex: 'actionStatus', | 64 | dataIndex: 'actionStatus', |
| 39 | width: 180, | 65 | width: 180, |
| 66 | + format: (_, record) => { | ||
| 67 | + return record.actionStatus == 'SUCCESS' ? '成功' : '失败'; | ||
| 68 | + }, | ||
| 40 | }, | 69 | }, |
| 41 | { | 70 | { |
| 42 | title: '操作时间', | 71 | title: '操作时间', |
| 43 | dataIndex: 'createdTime', | 72 | dataIndex: 'createdTime', |
| 44 | - width: 80, | 73 | + width: 180, |
| 45 | format: (_, record) => { | 74 | format: (_, record) => { |
| 46 | - return moment(record.createdTime).format('YYYY-MM-DD'); | 75 | + return moment(record.createdTime).format('YYYY-MM-DD-HH-MM-ss'); |
| 47 | }, | 76 | }, |
| 48 | }, | 77 | }, |
| 49 | ]; | 78 | ]; |
| @@ -53,30 +82,28 @@ export const searchFormSchema: FormSchema[] = [ | @@ -53,30 +82,28 @@ export const searchFormSchema: FormSchema[] = [ | ||
| 53 | { | 82 | { |
| 54 | field: 'entityType', | 83 | field: 'entityType', |
| 55 | label: '资源类型', | 84 | label: '资源类型', |
| 56 | - component: 'Select', | 85 | + component: 'ApiSelect', |
| 57 | componentProps: { | 86 | componentProps: { |
| 58 | - options: [ | ||
| 59 | - { label: 'DEVICE', value: 'DEVICE' }, | ||
| 60 | - { label: 'DEVICE_PROFILE', value: 'DEVICE_PROFILE' }, | ||
| 61 | - { label: 'RPC', value: 'RPC' }, | ||
| 62 | - { label: 'TENANT', value: 'TENANT' }, | ||
| 63 | - { label: 'TENANT_PROFILE', value: 'TENANT_PROFILE' }, | ||
| 64 | - ], | 87 | + api: findDictItemByCode, |
| 88 | + params: { | ||
| 89 | + dictCode: 'operate_log', | ||
| 90 | + }, | ||
| 91 | + labelField: 'itemText', | ||
| 92 | + valueField: 'itemValue', | ||
| 65 | }, | 93 | }, |
| 66 | colProps: { span: 6 }, | 94 | colProps: { span: 6 }, |
| 67 | }, | 95 | }, |
| 68 | { | 96 | { |
| 69 | field: 'actionType', | 97 | field: 'actionType', |
| 70 | label: '操作类型', | 98 | label: '操作类型', |
| 71 | - component: 'Select', | 99 | + component: 'ApiSelect', |
| 72 | componentProps: { | 100 | componentProps: { |
| 73 | - options: [ | ||
| 74 | - { label: 'ALL', value: '' }, | ||
| 75 | - { label: 'ADDED', value: 'ADDED' }, | ||
| 76 | - { label: 'DELETED', value: 'DELETED' }, | ||
| 77 | - { label: 'RPC_CALL', value: 'RPC_CALL' }, | ||
| 78 | - { label: 'UPDATED', value: 'UPDATED' }, | ||
| 79 | - ], | 101 | + api: findDictItemByCode, |
| 102 | + params: { | ||
| 103 | + dictCode: 'exception_log', | ||
| 104 | + }, | ||
| 105 | + labelField: 'itemText', | ||
| 106 | + valueField: 'itemValue', | ||
| 80 | }, | 107 | }, |
| 81 | colProps: { span: 6 }, | 108 | colProps: { span: 6 }, |
| 82 | }, | 109 | }, |
| 1 | import { BasicColumn, FormSchema } from '/@/components/Table'; | 1 | import { BasicColumn, FormSchema } from '/@/components/Table'; |
| 2 | import moment from 'moment'; | 2 | import moment from 'moment'; |
| 3 | +import { findDictItemByCode } from '/@/api/system/dict'; | ||
| 3 | 4 | ||
| 4 | // 表格数据 | 5 | // 表格数据 |
| 5 | export const columns: BasicColumn[] = [ | 6 | export const columns: BasicColumn[] = [ |
| @@ -14,16 +15,6 @@ export const columns: BasicColumn[] = [ | @@ -14,16 +15,6 @@ export const columns: BasicColumn[] = [ | ||
| 14 | width: 120, | 15 | width: 120, |
| 15 | }, | 16 | }, |
| 16 | { | 17 | { |
| 17 | - title: '资源类型', | ||
| 18 | - dataIndex: 'entityType', | ||
| 19 | - width: 180, | ||
| 20 | - }, | ||
| 21 | - { | ||
| 22 | - title: '资源名称', | ||
| 23 | - dataIndex: 'entityName', | ||
| 24 | - width: 180, | ||
| 25 | - }, | ||
| 26 | - { | ||
| 27 | title: '操作人员', | 18 | title: '操作人员', |
| 28 | dataIndex: 'userName', | 19 | dataIndex: 'userName', |
| 29 | width: 180, | 20 | width: 180, |
| @@ -32,18 +23,24 @@ export const columns: BasicColumn[] = [ | @@ -32,18 +23,24 @@ export const columns: BasicColumn[] = [ | ||
| 32 | title: '操作类型', | 23 | title: '操作类型', |
| 33 | dataIndex: 'actionType', | 24 | dataIndex: 'actionType', |
| 34 | width: 180, | 25 | width: 180, |
| 26 | + format: (_, record) => { | ||
| 27 | + return record.actionType == 'LOGIN' ? '登录' : '登出'; | ||
| 28 | + }, | ||
| 35 | }, | 29 | }, |
| 36 | { | 30 | { |
| 37 | title: '操作状态', | 31 | title: '操作状态', |
| 38 | dataIndex: 'actionStatus', | 32 | dataIndex: 'actionStatus', |
| 39 | width: 180, | 33 | width: 180, |
| 34 | + format: (_, record) => { | ||
| 35 | + return record.actionStatus == 'SUCCESS' ? '成功' : '失败'; | ||
| 36 | + }, | ||
| 40 | }, | 37 | }, |
| 41 | { | 38 | { |
| 42 | title: '操作时间', | 39 | title: '操作时间', |
| 43 | dataIndex: 'createdTime', | 40 | dataIndex: 'createdTime', |
| 44 | - width: 80, | 41 | + width: 180, |
| 45 | format: (_, record) => { | 42 | format: (_, record) => { |
| 46 | - return moment(record.createdTime).format('YYYY-MM-DD'); | 43 | + return moment(record.createdTime).format('YYYY-MM-DD-HH-MM-ss'); |
| 47 | }, | 44 | }, |
| 48 | }, | 45 | }, |
| 49 | ]; | 46 | ]; |
| @@ -53,12 +50,14 @@ export const searchFormSchema: FormSchema[] = [ | @@ -53,12 +50,14 @@ export const searchFormSchema: FormSchema[] = [ | ||
| 53 | { | 50 | { |
| 54 | field: 'actionType', | 51 | field: 'actionType', |
| 55 | label: '操作类型', | 52 | label: '操作类型', |
| 56 | - component: 'Select', | 53 | + component: 'ApiSelect', |
| 57 | componentProps: { | 54 | componentProps: { |
| 58 | - options: [ | ||
| 59 | - { label: 'LOGIN', value: 'LOGIN' }, | ||
| 60 | - { label: 'LOGOUT', value: 'LOGOUT' }, | ||
| 61 | - ], | 55 | + api: findDictItemByCode, |
| 56 | + params: { | ||
| 57 | + dictCode: 'user_log', | ||
| 58 | + }, | ||
| 59 | + labelField: 'itemText', | ||
| 60 | + valueField: 'itemValue', | ||
| 62 | }, | 61 | }, |
| 63 | colProps: { span: 6 }, | 62 | colProps: { span: 6 }, |
| 64 | }, | 63 | }, |