diff --git a/src/assets/scss/main.scss b/src/assets/scss/main.scss index f95b389..2064c08 100644 --- a/src/assets/scss/main.scss +++ b/src/assets/scss/main.scss @@ -11,6 +11,7 @@ ul, li { margin: 0; padding: 0; box-sizing: border-box; + outline: none!important; } html, body { @@ -94,4 +95,21 @@ body { background:#F5FAFF !important; padding: 0 !important; //border: 1px solid #4D6DE4 !important; +} +$btn-color: #4d99e4; +$lighter-color: #6eaeed; +.btn{ + cursor: pointer; + width: 120px; + height: 42px; + line-height: 42px; + background: $btn-color; + border-radius: 6px; + color: #FFF; + font-size: 15px; + text-align: center; + &:hover{ + background: $lighter-color; + } + } \ No newline at end of file diff --git a/src/views/social/directory.vue b/src/views/social/directory.vue index 5d0cb42..5c703ea 100644 --- a/src/views/social/directory.vue +++ b/src/views/social/directory.vue @@ -12,11 +12,28 @@
- -
- 更新目录 +
+ +
+
搜索
+
+ +
+
+ +
目录更新
+ +
+
+
@@ -30,13 +47,27 @@ v-model:current-page="current_page" @current-change="change_page"/>
- + {{ tip_message }}
+ + +
+ +
开始更新
+
{{tip}}
+
+ +
@@ -46,14 +77,17 @@ import {ElNotification, type TabsPaneContext} from 'element-plus' import {post} from '@/utils/request.ts' import {Search} from '@element-plus/icons-vue' import Mask from "@/components/common/Mask.vue"; - - +let isUpdate1312=ref(false) +let isUpdate1318=ref(false) +let isUpdate1319=ref(false) +let updt_time = ref(new Date()) let current_page = ref(1); let total_page = ref(0) let current_tab = ref(1301); let column_list = ref([]); let search_keyword = ref(""); let isDownLoading = ref(false); +let tip=ref("") const tabs = [ {label: '中西成药', name: 1301}, {label: '中药饮片', name: 1302}, @@ -69,6 +103,47 @@ const tabs = [ ]; let tableData: any = ref([]) let content: any = ref(null); +let update1312 = (current_page:number) => { + if(current_page==1){ + tip.value="开始更新第1页" + } + post("social/directory_upinfo/get_page", { + updt_time: updt_time.value, + page:current_page + }, {catch_error: true}).then((res: any) => { + let pages = res.pages; + let number = res.number; + if (current_page < pages&&isUpdate1312.value) { + current_page++ + let percent = Math.floor((current_page / pages) * 100) + tip.value= "开始更新第:" + current_page + "/" + pages; + update1312(current_page); + } else { + tip.value= "所有更新已完成" + isUpdate1312.value = false + } + + }).catch((err: any) => { + isUpdate1312.value = false; + current_page=1; + }) +} +const openUpdateBox = (type:number) => { + //获取30天前时间 + let start_time = new Date(); + start_time.setDate(start_time.getDate() - 30); + updt_time.value = start_time; + if(type==1312){ + isUpdate1312.value = true + } + if(type==1318){ + isUpdate1318.value = true + } + if(type==1319){ + isUpdate1319.value = true + } + +} onMounted(() => { init() }); @@ -122,10 +197,8 @@ let change_tab = (tab: TabsPaneContext, event: Event) => { nextTick(()=>{ init() }) - - } -let loading = ref(false) +let UpdateDirectoryLoading = ref(false) let uploadMsg = ref("正在更新目录,请稍后...") const format = ((p: number) => { return `正在更新` @@ -134,12 +207,12 @@ let percentage = ref(0) const tip_message = ref("正在更新目录,请稍后...") const start_type = () => { - loading.value = true + UpdateDirectoryLoading.value = true post("social/directory_version/get_current", {type: current_tab.value}, {catch_error: true}).then((res: any) => { tip_message.value = "正在更新目录,上一个版本:" + res.currentVersionName + ",请不要强制关闭程序,否则数据不完整"; download(res.currentVersionName, current_tab.value); }).catch((err: any) => { - loading.value = false; + UpdateDirectoryLoading.value = false; ElNotification({ title: '提示', message: "当前是最新版本", @@ -150,7 +223,7 @@ const start_type = () => { let download = (ver: any, type: any) => { post("social/directory/download", {ver: ver, type: type}).then((res: any) => { if (res == null || res == "") { - loading.value = false; + UpdateDirectoryLoading.value = false; ElNotification({ title: '提示', message: "当前是最新版本", @@ -162,7 +235,7 @@ let download = (ver: any, type: any) => { start_type() }).catch((err: any) => { - loading.value = false; + UpdateDirectoryLoading.value = false; ElNotification({ title: '提示', message: "当前是最新版本", @@ -174,6 +247,12 @@ let download = (ver: any, type: any) => {