Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/config/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export default {
host,

// 请求地址
baseUrl: `/${value}`
baseUrl: `${host}`
};
2 changes: 1 addition & 1 deletion src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const config = {
// 路由
router: {
// 模式
mode: import.meta.env.MODE == 'static' ? 'hash' : 'history',
mode: 'hash',
// 转场动画
transition: 'slide'
}
Expand Down
2 changes: 1 addition & 1 deletion src/config/prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default {
if (mode == 'static') {
return location.origin;
} else {
return '/api';
return proxy['/prod/'].target;
}
}
};
2 changes: 1 addition & 1 deletion src/config/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const proxy = {
'/prod/': {
target: 'https://show.cool-admin.com',
changeOrigin: true,
rewrite: (path: string) => path.replace(/^\/prod/, '/api')
rewrite: (path: string) => path.replace(/^\/prod/, '/')
}
};

Expand Down
78 changes: 78 additions & 0 deletions src/modules/base/components/remote-select/remote-select.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<template>

<el-select-v2
v-model="value"
style="width: 240px"
:multiple="multiple"
filterable
remote
:remote-method="remoteMethod"
clearable
:options="options"
:loading="loading"
placeholder="Please enter a keyword"
/>

</template>

<script lang="ts">
import { defineComponent, PropType } from 'vue';
import { BaseService } from '/@/cool';

export default defineComponent({
name: 'remote-select',
props: {

// 服务器请求地址
namespace: {
type: String,
},

// 显示给用户看的字段
field: {
type: String,
default: 'title',
},

// 是否多选
multiple: {
type: Boolean,
default: false,
}
},
data() {
return {
value: '',
loading: false,
options: [],
service: Object as BaseService,
};
},
mounted() {
this.service = new BaseService( this.namespace )

this.remoteMethod('')
},
methods: {
async remoteMethod(query: string = '') {

this.loading = true;

const res: any = await this.service.page( { keyWord: query, page: 1, size: 100 } )

this.options = res.list.map((item) => {
return {
value: item.id,
label: item[this.field]
}
})

this.loading = false;


}
}
});
</script>

<style scoped lang="scss"></style>
2 changes: 1 addition & 1 deletion src/modules/base/views/menu/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ const Upsert = useUpsert({
{
prop: 'router',
label: t('节点路由'),
hidden: ({ scope }) => scope.type != 1,
hidden: ({ scope }) => scope.type == 2,
component: {
name: 'el-input',
props: {
Expand Down
18 changes: 18 additions & 0 deletions src/modules/base/views/param.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ const options = reactive({
{
label: t('文件'),
value: 2
},
{
label: t('JSON'),
value: 3
}
]
});
Expand Down Expand Up @@ -195,6 +199,20 @@ const Upsert = useUpsert({
}
}
},
{
prop: 'data_3',
label: '数据',
required: true,
hidden({ scope }) {
return scope.dataType != 3;
},
component: {
name: 'cl-editor',
props: {
name: 'cl-editor-monaco',
}
}
},
{
prop: 'remark',
label: t('备注'),
Expand Down
20 changes: 20 additions & 0 deletions src/modules/helper/components/auto-menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,33 @@ function open() {
});
}

import { ref } from 'vue';

// 菜单列表
const menuList = ref<any[]>([]);
service.base.sys.menu.list().then(res => {
menuList.value = res.filter( item => item.type==0 );
});

// 实体切换
function onEntityChange(val: any) {
const item = list.find(e => e.value == val?.join('/'));

if (item) {
Form.value?.setForm('router', `/${item.value}`);
Form.value?.setForm('module', item.module);

if ( item.menu ){
Form.value?.setForm('name', item.menu + '管理' );
}

const module = `/${item.module}`
menuList.value.forEach( menuItem => {
if (menuItem.router == module ) {
Form.value?.setForm('parentId', menuItem.id );
}
})

}
}

Expand Down