bill 2 月之前
父节点
当前提交
47d24a483e
共有 3 个文件被更改,包括 37 次插入20 次删除
  1. 21 15
      src/components/materials/index.vue
  2. 13 2
      src/config.ts
  3. 3 3
      src/lang/weblate/en.json

+ 21 - 15
src/components/materials/index.vue

@@ -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;
   }
 }

+ 13 - 2
src/config.ts

@@ -1,9 +1,20 @@
 
-import zhCN from "ant-design-vue/es/locale/zh_CN";
+import zh from "ant-design-vue/es/locale/zh_CN";
+import jp from "ant-design-vue/es/locale/ja_JP";
+import ka from "ant-design-vue/es/locale/ko_KR";
+import en from "ant-design-vue/es/locale/en_US";
 import { theme } from "ant-design-vue";
+import { langKey, langNameEum } from "./lang";
+
+const map = {
+  [langNameEum.en]: en,
+  [langNameEum.zh]: zh,
+  [langNameEum.ja]: jp,
+  [langNameEum.kr]: ka,
+}
 
 export const config = {
-  locale: zhCN,
+  locale: map[langKey],
   theme: {
     algorithm: theme.darkAlgorithm,
     token: {

+ 3 - 3
src/lang/weblate/en.json

@@ -105,7 +105,7 @@
             "add": "Add viewpoint",
             "clear": "Clear the view",
             "time": "Video duration",
-            "name": "Guided tour",
+            "name": "tour",
             "delConfirm": "Are you sure you want to delete this view?",
             "clearConfirm": "Are you sure you want to clear the view?",
             "unItems": "Unable to save empty path guide tour!"
@@ -139,7 +139,7 @@
         "type": {
             "3": "Footprint",
             "2": "Handprint",
-            "7": "Physical evidence",
+            "7": "Evidence",
             "1": "Trace",
             "4": "Bloodstain ",
             "6": "Other",
@@ -153,7 +153,7 @@
         "posTabs": {
             "typeVal": [
                 "Hover",
-                "Attach to Floor/Wall"
+                "Attach"
             ],
             "fontSize": "Font size",
             "rotation": "Rotate icon",