123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <template>
- <div class="__cus-manage_content">
- <div class="__cus-manage_content-title"><SvgIcon class="flag" name="flag_1" color="var(--cus-main-color)"/>{{$route.meta.title}}</div>
- <div class="__cus-manage_content-filters">
- <CusForm labelWidth="100px" @handleEnter="onSearch">
- <CusFormColumn
- :span="8"
- v-model:param="state.query.form.keyword"
- placeholder="请输入索引中文名称或索引表名进行搜索"
- />
- <CusButton type="main" title="搜索" @click="onSearch"/>
- <CusButton type="main" title="重置" @click="onReset"/>
- <CusButton title="导出" style="margin-left: auto"/>
- <CusButton type="main" title="新增" @click="onAdd"/>
- </CusForm>
- </div>
- <div class="__cus-manage_content-main" v-loading="state.query.loading">
- <CusTable
- :page-num="state.query.page.pageNum"
- :page-size="state.query.page.pageSize"
- :total="state.query.result.total"
- :data="state.query.result.data"
- :table-head="state.query.tableHead"
- @handlePage="onPage"
- >
- <template #shareMethod-column-value="{scope}">
- {{DictionaryStore.gxMethodMap.get(scope.row.shareMethod)}}
- </template>
- <template #shareCycle-column-value="{scope}">
- {{DictionaryStore.gxCycleMap.get(scope.row.shareCycle)}}
- </template>
- <template #themeMode-column-value="{scope}">
- {{DictionaryStore.themeModeMap.get(scope.row.themeMode)}}
- </template>
- <template #do-column-value="{scope}">
- <CusButton type="table" icon="relation" title="关联分类" @click="onRelation(scope.row)"/>
- <CusButton type="table-add" icon="text" title="字段" @click="onText(scope.row)"/>
- <CusButton type="table-edit" @click="onEdit(scope.row)"/>
- <CusButton type="table-del" @click="onDel(scope.row)"/>
- </template>
- </CusTable>
- </div>
- <DetailCom v-model:show="state.detail.show" :transfer="state.detail.transfer" @refresh="onSearch"/>
- <RelationCom v-model:show="state.relation.show" :transfer="state.relation.transfer" @refresh="onSearch"/>
- <TextCom v-model:show="state.text.show" :transfer="state.text.transfer"/>
- </div>
- </template>
- <script setup lang="ts">
- import {getCurrentInstance, onMounted, reactive} from "vue";
- import {ElMessage} from "element-plus";
- import {sysIndexFindIndexByPage} from "@/api/modules/manage";
- import DetailCom from "./detail.vue";
- import RelationCom from "./relation.vue";
- import TextCom from "./text.vue";
- import {useDictionaryStore} from "@/stores";
- const {proxy} = getCurrentInstance()
- const DictionaryStore = useDictionaryStore()
- const state: any = reactive({
- query: {
- loading: false,
- page: {
- pageNum: 1,
- pageSize: 10
- },
- tableHead: [
- {value: "indexName", label: "索引中文", fixed: 'left', width: 180},
- {value: "indexTableName", label: "索引表名", fixed: 'left', width: 180, popover: true},
- {value: "dataSource", label: "数据共享来源", width: 180},
- {value: "dataOffer", label: "数据提供来源", width: 180},
- {value: "shareMethod", label: "共享方式", width: 180},
- {value: "shareCycle", label: "共享周期", width: 180},
- {value: "pictureField", label: "图片字段", width: 180},
- {value: "themeMode", label: "主题模式", width: 180},
- {value: "pictureModeCardNum", label: "图模式卡片数", width: 180},
- {value: "cardColumnNum", label: "卡片列数", width: 180},
- {value: "columnModelNum", label: "列模式列数", width: 180},
- {value: "num", label: "数据量", width: 180},
- {value: "linkTypeNum", label: "关联分类数量", width: 180},
- {value: "createTime", label: "创建时间", width: 180},
- {value: "updateTime", label: "最后修改时间", width: 180},
- {value: "remark", label: "备注", width: 200},
- {value: "do", label: "操作", width: 320, fixed: 'right'},
- ],
- form: {},
- formReal: {},
- result: {
- total: 0,
- data: []
- }
- },
- detail: {
- show: false,
- transfer: {}
- },
- relation: {
- show: false,
- transfer: {}
- },
- text: {
- show: false,
- transfer: {}
- }
- })
- const onPage = (pageNum, pageSize) => {
- state.query.page = {
- pageNum: pageNum,
- pageSize: pageSize
- }
- const params = {
- page: state.query.page.pageNum,
- size: state.query.page.pageSize,
- }
- if (proxy.$util.isValue(state.query.formReal.keyword)) {
- params.keyword = state.query.formReal.keyword
- }
- state.query.loading = true
- sysIndexFindIndexByPage(proxy.$util.formatGetParam(params)).then(res => {
- if (res.code === 200) {
- state.query.result.total = res.data.totalElements
- state.query.result.data = res.data.content
- state.query.loading = false
- } else {
- ElMessage.error(res.msg)
- }
- })
- }
- const onSearch = () => {
- state.query.formReal = JSON.parse(JSON.stringify(state.query.form))
- onPage(1, state.query.page.pageSize)
- }
- const onReset = () => {
- state.query.page = {
- pageNum: 1,
- pageSize: 10
- }
- state.query.form = {}
- onSearch()
- }
- const onRelation = (row) => {
- state.relation.transfer = {
- id: row.id
- }
- state.relation.show = true
- }
- const onText = (row) => {
- state.text.transfer = {
- id: row.id,
- }
- state.text.show = true
- }
- const onAdd = () => {
- state.detail.transfer = {
- mode: 'add'
- }
- state.detail.show = true
- }
- const onEdit = (row) => {
- state.detail.transfer = {
- mode: 'edit',
- id: row.id,
- }
- state.detail.show = true
- }
- const onDel = (row) => {
- }
- const initDictionary = () => {
- DictionaryStore.initDict('gx_method')
- DictionaryStore.initDict('gx_cycle')
- DictionaryStore.initDict('theme_mode')
- DictionaryStore.initDict('default_model')
- }
- onMounted(() => {
- initDictionary()
- onReset()
- })
- </script>
- <style lang="scss" scoped>
- </style>
|