feat: 软件管理

This commit is contained in:
TsMask
2023-10-07 15:35:40 +08:00
parent ee2a5290b1
commit aab98b016f
5 changed files with 416 additions and 149 deletions

View File

@@ -1,11 +1,11 @@
<script setup lang="ts">
import { reactive, toRaw, watch, ref } from 'vue';
import { message } from 'ant-design-vue/lib';
import { SizeType } from 'ant-design-vue/lib/config-provider';
import { ColumnsType } from 'ant-design-vue/lib/table';
import { listNeVersion } from '@/api/configManage/softwareManage';
import { parseDateToStr } from '@/utils/date-utils';
import useDictStore from '@/store/modules/dict';
import useNeInfoStore from '@/store/modules/neinfo';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useI18n from '@/hooks/useI18n';
const { t } = useI18n();
@@ -159,11 +159,6 @@ let tablePagination = reactive({
},
});
/**表格多选 */
function fnTableSelectedRowKeys(keys: (string | number)[]) {
tableState.selectedRowKeys = keys;
}
/**查询角色未授权用户列表 */
function fnGetList() {
if (tableState.loading) return;
@@ -175,10 +170,6 @@ function fnGetList() {
queryParams.endTime = queryRangePicker.value[1];
listNeVersion(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
// 取消勾选
if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = [];
}
tablePagination.total = res.total;
tableState.data = res.rows;
}
@@ -186,20 +177,8 @@ function fnGetList() {
});
}
/**弹框确认按钮事件 */
function fnModalOk() {
const userIds = tableState.selectedRowKeys;
if (userIds.length <= 0) {
message.error(`请选择要分配的用户`, 2);
return;
}
emit('update:visible', false);
emit('ok', userIds);
}
/**弹框取消按钮事件 */
function fnModalCancel() {
emit('update:visible', false);
emit('cancel');
}
@@ -231,8 +210,8 @@ watch(
:visible="props.visible"
:keyboard="false"
:mask-closable="false"
@ok="fnModalOk"
@cancel="fnModalCancel"
:footer="null"
>
<!-- 表格搜索栏 -->
<a-form
@@ -243,13 +222,16 @@ watch(
>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="网元类型" name="neType">
<a-input
<a-form-item
:label="t('views.configManage.softwareManage.neType')"
name="neType"
>
<a-auto-complete
v-model:value="queryParams.neType"
:options="useNeInfoStore().getNeSelectOtions"
allow-clear
:maxlength="30"
placeholder="查询网元类型"
></a-input>
:placeholder="t('views.configManage.softwareManage.neTypePlease')"
/>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
@@ -299,19 +281,9 @@ watch(
:loading="tableState.loading"
:data-source="tableState.data"
:size="tableState.size"
:scroll="{ scrollToFirstRowOnChange: true, y: 400, x: true }"
:scroll="{ y: 400, x: true }"
:pagination="tablePagination"
:row-selection="{
type: 'checkbox',
selectedRowKeys: tableState.selectedRowKeys,
onChange: fnTableSelectedRowKeys,
}"
>
<!-- <template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'">
<DictTag :options="dict.sysNormalDisable" :value="record.status" />
</template>
</template> -->
</a-table>
</a-modal>
</template>