|
@@ -2,37 +2,183 @@
|
|
|
<div id="index">
|
|
|
<el-row>
|
|
|
<el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
|
|
|
- <el-col :span="24" class="one">系统首页</el-col>
|
|
|
+ <el-col :span="24" class="one">
|
|
|
+ <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch"> </cSearch>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="two">
|
|
|
+ <cButton @toAdd="toAdd()">
|
|
|
+ <template v-slot:custom>
|
|
|
+ <el-button type="primary" @click="toAuto">自动分发</el-button>
|
|
|
+ <el-button type="danger" @click="toError">错误信息</el-button>
|
|
|
+ </template>
|
|
|
+ </cButton>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="thr">
|
|
|
+ <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @view="toView" @del="toDel"> </cTable>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <cDialog :dialog="dialog" @toClose="toClose">
|
|
|
+ <template v-slot:info>
|
|
|
+ <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
|
|
|
+ <cTable :fields="filefields" :opera="fileopera" :list="form.warn_file" :usePage="false" @down="toDown"> </cTable>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="dialog_two" v-else-if="dialog.type == '2'">
|
|
|
+ <cTable :fields="errorfields" :opera="[]" :list="errorList" :usePage="false"> </cTable>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="dialog_thr" v-else-if="dialog.type == '3'">
|
|
|
+ <cForm :span="24" :fields="autofields" :form="autoForm" @save="autoSave" label-width="auto">
|
|
|
+ <template #file>
|
|
|
+ <cUpload :model="`${'file'}`" :limit="6" url="/files/zkzx/patent/upload" accept="*" :list="form.file" @change="onUpload"></cUpload>
|
|
|
+ </template>
|
|
|
+ </cForm>
|
|
|
+ </el-col>
|
|
|
+ </template>
|
|
|
+ </cDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
-<script setup lang="ts">
|
|
|
-// 基础
|
|
|
+<script lang="ts" setup>
|
|
|
+import _ from 'lodash';
|
|
|
import type { Ref } from 'vue';
|
|
|
-// reactive,
|
|
|
-import { onMounted, ref, getCurrentInstance } from 'vue';
|
|
|
+import { ref, onMounted, getCurrentInstance } from 'vue';
|
|
|
+import { ElMessage } from 'element-plus';
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
+
|
|
|
// 接口
|
|
|
-//import { TestStore } from '@common/src/stores/test';
|
|
|
-//import type { IQueryResult } from '@/util/types.util';
|
|
|
-//const testAxios = TestStore();
|
|
|
+import { CpcMessageStore } from '@common/src/stores/patent/cpcMessage';
|
|
|
+import { CpcMessageerrorStore } from '@common/src/stores/patent/cpcMessageerror';
|
|
|
+
|
|
|
+import type { IQueryResult } from '@/util/types.util';
|
|
|
+const cpcmessageAxios = CpcMessageStore();
|
|
|
+const cpcmessageerrorAxios = CpcMessageerrorStore();
|
|
|
+
|
|
|
+// 路由
|
|
|
+const router = useRouter();
|
|
|
+
|
|
|
const { proxy } = getCurrentInstance() as any;
|
|
|
+
|
|
|
// 加载中
|
|
|
-const loading: Ref<any> = ref(false);
|
|
|
-// 分页数据
|
|
|
-// const skip = 0;
|
|
|
-// const limit = proxy.limit;;
|
|
|
-// 请求
|
|
|
+const loading = ref(false);
|
|
|
+// 列表数据
|
|
|
+let list: Ref<any> = ref([]);
|
|
|
+let total: Ref<number> = ref(0);
|
|
|
+let skip = 0;
|
|
|
+let limit: number = proxy.$limit;
|
|
|
+let fields: Ref<any[]> = ref([
|
|
|
+ { label: '申请号', model: 'create_number', isSearch: true },
|
|
|
+ { label: '专利名称', model: 'patent_name', isSearch: true },
|
|
|
+ { label: '接收人', model: 'receive_name', isSearch: true },
|
|
|
+ { label: '发送时间', model: 'send_date' }
|
|
|
+]);
|
|
|
+// 操作
|
|
|
+let opera: Ref<any[]> = ref([
|
|
|
+ { label: '文件', method: 'view' },
|
|
|
+ { label: '删除', method: 'del', confirm: true, type: 'danger' }
|
|
|
+]);
|
|
|
+
|
|
|
+// 查询数据
|
|
|
+let searchForm: Ref<any> = ref({});
|
|
|
+
|
|
|
+// 弹框
|
|
|
+const dialog: Ref<any> = ref({ title: '反馈文件', show: false, type: '1' });
|
|
|
+const form: Ref<any> = ref({});
|
|
|
+let filefields: Ref<any[]> = ref([
|
|
|
+ { label: '文件名称', model: 'name' },
|
|
|
+ { label: '文件路径', model: 'uri' },
|
|
|
+ { label: '文件完成路径', model: 'url' }
|
|
|
+]);
|
|
|
+// 操作
|
|
|
+let fileopera: Ref<any[]> = ref([{ label: '下载', method: 'down' }]);
|
|
|
+
|
|
|
+// 错误信息
|
|
|
+const errorList: Ref<any> = ref([]);
|
|
|
+const errorfields: Ref<any> = ref([
|
|
|
+ { label: '申请号', model: 'create_number' },
|
|
|
+ { label: '专利名称', model: 'patent_name' },
|
|
|
+ { label: '专利信息key', model: 'patent_key' },
|
|
|
+ { label: '错误信息', model: 'content' },
|
|
|
+ { label: '导入的zip包', model: 'zip_url' },
|
|
|
+ { label: '导入时间', model: 'create_date' }
|
|
|
+]);
|
|
|
+// 自动分发
|
|
|
+const autoForm: Ref<any> = ref({});
|
|
|
+const autofields: Ref<any> = ref([{ label: '文件', model: 'file', custom: true }]);
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
- loading.value = true;
|
|
|
- // await search({ skip, limit });
|
|
|
+ loading.value = false;
|
|
|
+ await search({ skip, limit });
|
|
|
loading.value = false;
|
|
|
});
|
|
|
-//const search = async (e: { skip: number; limit: number }) => {
|
|
|
-// const info = { skip: e.skip, limit: e.limit, ...searchInfo.value };
|
|
|
-// const res: IQueryResult = await testAxios.query(info);
|
|
|
-// console.log(res);
|
|
|
-//};
|
|
|
+// 查询
|
|
|
+const search = async (e: { skip: number; limit: number }) => {
|
|
|
+ const { skip, limit } = e;
|
|
|
+ const condition = _.cloneDeep(searchForm.value);
|
|
|
+ let info = { limit: limit, skip: skip, ...condition };
|
|
|
+ let res: IQueryResult = await cpcmessageAxios.query(info);
|
|
|
+ if (res.errcode == 0) {
|
|
|
+ list.value = res.data;
|
|
|
+ total.value = res.total;
|
|
|
+ }
|
|
|
+};
|
|
|
+const toSearch = (query) => {
|
|
|
+ searchForm.value = query;
|
|
|
+ search({ skip, limit });
|
|
|
+};
|
|
|
+// 查看
|
|
|
+const toView = (data) => {
|
|
|
+ form.value = data;
|
|
|
+ dialog.value = { title: '反馈文件', show: true, type: '1' };
|
|
|
+};
|
|
|
+const toDown = (data) => {
|
|
|
+ window.open(data.url);
|
|
|
+};
|
|
|
+// 错误信息
|
|
|
+const toError = async () => {
|
|
|
+ let res: IQueryResult = await cpcmessageerrorAxios.query({});
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ errorList.value = res.data;
|
|
|
+ }
|
|
|
+ dialog.value = { title: '错误信息', show: true, type: '2' };
|
|
|
+};
|
|
|
+// 自动分发
|
|
|
+const toAuto = () => {
|
|
|
+ dialog.value = { title: '自动分发', show: true, type: '3' };
|
|
|
+};
|
|
|
+const onUpload = (e: { model: string; value: Array<[]> }) => {
|
|
|
+ const { model, value } = e;
|
|
|
+ autoForm.value[model] = value;
|
|
|
+};
|
|
|
+// 提交保存
|
|
|
+const autoSave = async (data) => {
|
|
|
+ console.log(data);
|
|
|
+};
|
|
|
+// 关闭弹框
|
|
|
+const toClose = () => {
|
|
|
+ autoForm.value = {};
|
|
|
+ form.value = {};
|
|
|
+ dialog.value = { show: false };
|
|
|
+ search({ skip, limit });
|
|
|
+};
|
|
|
+// 添加
|
|
|
+const toAdd = () => {
|
|
|
+ router.push({ path: '/spatentexam/cpc/detail' });
|
|
|
+};
|
|
|
+// 删除
|
|
|
+const toDel = async (data) => {
|
|
|
+ let res: IQueryResult = await cpcmessageAxios.del(data._id);
|
|
|
+ if (res.errcode == 0) {
|
|
|
+ ElMessage({ type: `success`, message: `刪除信息成功` });
|
|
|
+ search({ skip, limit });
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
-<style scoped lang="scss"></style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.main {
|
|
|
+ .one {
|
|
|
+ margin: 0 0 10px 0;
|
|
|
+ }
|
|
|
+ .two {
|
|
|
+ margin: 0 0 10px 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|