|
@@ -19,6 +19,7 @@
|
|
|
<div class="up-se">
|
|
|
<span class="upload fun-ctrls">
|
|
|
<ui-input
|
|
|
+ width="200px"
|
|
|
class="input"
|
|
|
:accept="ft"
|
|
|
:maxSize="maxSize"
|
|
@@ -26,7 +27,7 @@
|
|
|
type="file"
|
|
|
>
|
|
|
<template v-slot:replace>
|
|
|
- <Button type="primary" ghost>
|
|
|
+ <Button type="primary" ghost ref="btn" style="width: 100%">
|
|
|
<ui-icon type="add" class="icon" />{{ $t("sys.upload.place1") }}
|
|
|
</Button>
|
|
|
</template>
|
|
@@ -67,10 +68,10 @@
|
|
|
<template v-if="column.key === 'status'">
|
|
|
{{
|
|
|
record.status === 1
|
|
|
- ? $t('material.uploadSuccess')
|
|
|
+ ? $t("material.uploadSuccess")
|
|
|
: record.status === -1
|
|
|
- ? $t('material.uploadErr')
|
|
|
- : $t('material.uploadIng')
|
|
|
+ ? $t("material.uploadErr")
|
|
|
+ : $t("material.uploadIng")
|
|
|
}}
|
|
|
</template>
|
|
|
<template v-if="column.key === 'group'">
|
|
@@ -78,7 +79,7 @@
|
|
|
</template>
|
|
|
<template v-else-if="column.key === 'action'">
|
|
|
<span>
|
|
|
- <a @click="delHandler(record.id)">{{ $t('sys.del') }}</a>
|
|
|
+ <a @click="delHandler(record.id)">{{ $t("sys.del") }}</a>
|
|
|
</span>
|
|
|
</template>
|
|
|
</template>
|
|
@@ -97,7 +98,7 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { Modal, Input, Table, Empty, TableProps, Button } from "ant-design-vue";
|
|
|
-import { computed, reactive, ref, watch } from "vue";
|
|
|
+import { computed, reactive, ref, watch, watchEffect } from "vue";
|
|
|
import { createLoadPack, debounceStack, getSizeStr } from "@/utils";
|
|
|
import type { PagingResult } from "@/api";
|
|
|
import {
|
|
@@ -149,6 +150,10 @@ const origin = ref<PagingResult<Material[]>>({
|
|
|
const groups = ref<MaterialGroup[]>([]);
|
|
|
const selectKeys = ref<Material["id"][]>([]);
|
|
|
const allData: Record<Material["id"], Material> = reactive({});
|
|
|
+const btn = ref();
|
|
|
+watchEffect(() => {
|
|
|
+ console.log("===>", btn.value);
|
|
|
+});
|
|
|
|
|
|
const rowSelection: any = ref({
|
|
|
selectedRowKeys: selectKeys,
|
|
@@ -160,7 +165,7 @@ const rowSelection: any = ref({
|
|
|
if (typeof props.count !== "number" || props.count >= newKeys.length) {
|
|
|
selectKeys.value = newKeys;
|
|
|
} else {
|
|
|
- Message.error(ui18n.t('material.selectCount', props));
|
|
|
+ Message.error(ui18n.t("material.selectCount", props));
|
|
|
}
|
|
|
},
|
|
|
getCheckboxProps: (record: Material) => {
|
|
@@ -174,31 +179,31 @@ const rowSelection: any = ref({
|
|
|
});
|
|
|
const cloumns = computed(() => [
|
|
|
{
|
|
|
- title: ui18n.t('material.tabs.name'),
|
|
|
+ title: ui18n.t("material.tabs.name"),
|
|
|
dataIndex: "name",
|
|
|
key: "name",
|
|
|
},
|
|
|
{
|
|
|
width: "100px",
|
|
|
- title: ui18n.t('material.tabs.format'),
|
|
|
+ title: ui18n.t("material.tabs.format"),
|
|
|
dataIndex: "format",
|
|
|
key: "format",
|
|
|
},
|
|
|
{
|
|
|
width: "100px",
|
|
|
- title: ui18n.t('material.tabs.size'),
|
|
|
+ title: ui18n.t("material.tabs.size"),
|
|
|
dataIndex: "size",
|
|
|
key: "size",
|
|
|
},
|
|
|
{
|
|
|
width: "100px",
|
|
|
- title: ui18n.t('material.tabs.status'),
|
|
|
+ title: ui18n.t("material.tabs.status"),
|
|
|
dataIndex: "status",
|
|
|
key: "status",
|
|
|
},
|
|
|
{
|
|
|
width: "100px",
|
|
|
- title: ui18n.t('material.tabs.group'),
|
|
|
+ title: ui18n.t("material.tabs.group"),
|
|
|
dataIndex: "group",
|
|
|
key: "group",
|
|
|
filters: groups.value.map((g) => ({
|
|
@@ -208,7 +213,7 @@ const cloumns = computed(() => [
|
|
|
},
|
|
|
{
|
|
|
width: "100px",
|
|
|
- title: ui18n.t('material.tabs.action'),
|
|
|
+ title: ui18n.t("material.tabs.action"),
|
|
|
key: "action",
|
|
|
},
|
|
|
]);
|
|
@@ -242,7 +247,7 @@ const addHandler = async (file: File) => {
|
|
|
refresh();
|
|
|
};
|
|
|
const delHandler = async (id: Material["id"]) => {
|
|
|
- if (await Dialog.confirm(ui18n.t('sys.delConfrm'))) {
|
|
|
+ if (await Dialog.confirm(ui18n.t("sys.delConfrm"))) {
|
|
|
await delMaterial(id);
|
|
|
const ndx = selectKeys.value.indexOf(id);
|
|
|
console.log(selectKeys.value, id);
|
|
@@ -283,8 +288,9 @@ const handleTableChange: TableProps["onChange"] = (pag, filters) => {
|
|
|
align-items: center;
|
|
|
|
|
|
.upload {
|
|
|
+ flex: 0 0 auto;
|
|
|
margin-right: 10px;
|
|
|
- width: 100px;
|
|
|
+ min-width: 100px;
|
|
|
// overflow: hidden;
|
|
|
}
|
|
|
}
|