lanceJiang 11 місяців тому
батько
коміт
db0fff2539

+ 1 - 1
.env

@@ -10,7 +10,7 @@ VITE_APP_BASE_API = 'https://apiboot.aizuda.com'
 VITE_DROP_CONSOLE = true
 
 # 本地端口号
-VITE_PORT = 3000
+VITE_PORT = 3003
 
 # 是否使用本地路由配置数据
 VITE_APP_USE_LOCAL_ROUTES = 0

+ 1 - 1
src/api/system/menu.ts

@@ -25,7 +25,7 @@ export function getMenuList(): AxiosPromise {
 	}).then((res: any) => {
 		// console.error(JSON.stringify(res), 'res...')
 		// res['menu'] = [res.menu[0]/*, res.menu[1]*/]
-		// res['menu'].unshift(...localDemoRoutes) // 注释当前test环境的菜单
+		res['menu'].unshift(...localDemoRoutes) // 注释当前test环境的菜单
 		return res
 		// return Promise.resolve({
 		// 	// 路由菜单

+ 90 - 0
src/components/SelectRole.vue

@@ -0,0 +1,90 @@
+<script lang="tsx">
+import { defineComponent, unref } from 'vue'
+import { useI18n } from 'vue-i18n'
+import { useFormSize } from 'element-plus'
+const Props = {
+	modelValue: {},
+	params: {
+		type: Object
+	}
+	// 扩展
+	// 1. prefix -> prefixIcon (prefix 已被vue 拦截)
+	// prefixIcon: String, // eg: '测试Prefix'
+	// 2. suffix -> suffixIcon (prefix 已被vue 拦截 与 suffix 对应做处理)
+	// suffixIcon: String, // eg: '测试suffix'
+	// 3. v-slot: { prefix, suffix } or slots: { prefix: render, suffix: render, }
+}
+const Component = defineComponent({
+	name: 'LeInputNumber',
+	props: Props,
+	emits: [
+		'change',
+		// "update:modelValue"
+	],
+	setup(props, ctx) {
+		const { t } = useI18n()
+		return () => {
+			const { prefixIcon, suffixIcon, prop, controlsPosition, t_placeholder, size, placeholder, max = 999999999999999, ...local_props } = ctx.attrs
+			const inputNumberSize = size || unref(useFormSize())
+			const _prefix = prefixIcon ? <span class="le-addon le-input-number__prefix">{prefixIcon}</span> : ''
+			const _suffix = suffixIcon ? <span class="le-addon le-input-number__suffix">{suffixIcon}</span> : ''
+			const _placeholder = (t_placeholder ? t(t_placeholder) : placeholder) ?? t('le.el.input.placeholder')
+			const slots = Object.keys(ctx.slots).length ? ctx.slots : local_props.slots || {}
+			const onChange = (...v) => {
+				ctx.emit('change', ...v)
+			}
+			return (
+				<div
+					class={`le-input-number le-input-number--${inputNumberSize} el-input el-input-group
+					 ${_prefix || slots.prefix ? 'el-input-group--prepend le-input-number--prefix' : ''}
+					 ${_suffix || slots.suffix ? 'el-input-group--append le-input-number--suffix' : ''}
+				 `}
+				>
+					{slots.prefix ? slots.prefix() : _prefix}
+					<el-input-number
+						max={max}
+						{...local_props}
+						onChange={onChange}
+						size={inputNumberSize}
+						controlsPosition={controlsPosition ?? 'right'}
+						placeholder={_placeholder}
+						model-value={props.modelValue}
+					/>
+					{slots.suffix ? slots.suffix() : _suffix}
+				</div>
+			)
+		}
+	}
+	/*render() {
+		const { t } = useI18n()
+		const { prefix, suffix, prop, controlsPosition, placeholder, max = 999999999999999, ...props } = this.$attrs
+		const { inputNumberSize, value } = this
+		const $slots = this.$slots
+		// const onEvents = this.$listeners
+
+		const _prefix = prefix ? <span class="le-addon le-input-number__prefix">{prefix}</span> : ''
+		const _suffix = suffix ? <span class="le-addon le-input-number__suffix">{suffix}</span> : ''
+		return (
+			<div
+				class={`le-input-number le-input-number--${inputNumberSize} el-input el-input-group
+     ${_prefix || $slots.prefix ? 'le-input-number--prefix' : ''}
+     ${_suffix || $slots.suffix ? 'le-input-number--suffix' : ''}
+     `}
+			>
+				{$slots.prefix || _prefix}
+				<el-input-number
+					max={max}
+					{...props}
+					size={inputNumberSize}
+					controlsPosition={controlsPosition || 'right'}
+					placeholder={placeholder || t('le.el.input.placeholder')}
+					// value={this.localValue}
+					value={value}
+				/>
+				{$slots.suffix || _suffix}
+			</div>
+		)
+	},*/
+})
+export default Component
+</script>

+ 90 - 0
src/components/SelectUser.vue

@@ -0,0 +1,90 @@
+<script lang="tsx">
+import { defineComponent, unref } from 'vue'
+import { useI18n } from 'vue-i18n'
+import { useFormSize } from 'element-plus'
+const Props = {
+	modelValue: {},
+	params: {
+		type: Object
+	}
+	// 扩展
+	// 1. prefix -> prefixIcon (prefix 已被vue 拦截)
+	// prefixIcon: String, // eg: '测试Prefix'
+	// 2. suffix -> suffixIcon (prefix 已被vue 拦截 与 suffix 对应做处理)
+	// suffixIcon: String, // eg: '测试suffix'
+	// 3. v-slot: { prefix, suffix } or slots: { prefix: render, suffix: render, }
+}
+const Component = defineComponent({
+	name: 'LeInputNumber',
+	props: Props,
+	emits: [
+		'change',
+		// "update:modelValue"
+	],
+	setup(props, ctx) {
+		const { t } = useI18n()
+		return () => {
+			const { prefixIcon, suffixIcon, prop, controlsPosition, t_placeholder, size, placeholder, max = 999999999999999, ...local_props } = ctx.attrs
+			const inputNumberSize = size || unref(useFormSize())
+			const _prefix = prefixIcon ? <span class="le-addon le-input-number__prefix">{prefixIcon}</span> : ''
+			const _suffix = suffixIcon ? <span class="le-addon le-input-number__suffix">{suffixIcon}</span> : ''
+			const _placeholder = (t_placeholder ? t(t_placeholder) : placeholder) ?? t('le.el.input.placeholder')
+			const slots = Object.keys(ctx.slots).length ? ctx.slots : local_props.slots || {}
+			const onChange = (...v) => {
+				ctx.emit('change', ...v)
+			}
+			return (
+				<div
+					class={`le-input-number le-input-number--${inputNumberSize} el-input el-input-group
+					 ${_prefix || slots.prefix ? 'el-input-group--prepend le-input-number--prefix' : ''}
+					 ${_suffix || slots.suffix ? 'el-input-group--append le-input-number--suffix' : ''}
+				 `}
+				>
+					{slots.prefix ? slots.prefix() : _prefix}
+					<el-input-number
+						max={max}
+						{...local_props}
+						onChange={onChange}
+						size={inputNumberSize}
+						controlsPosition={controlsPosition ?? 'right'}
+						placeholder={_placeholder}
+						model-value={props.modelValue}
+					/>
+					{slots.suffix ? slots.suffix() : _suffix}
+				</div>
+			)
+		}
+	}
+	/*render() {
+		const { t } = useI18n()
+		const { prefix, suffix, prop, controlsPosition, placeholder, max = 999999999999999, ...props } = this.$attrs
+		const { inputNumberSize, value } = this
+		const $slots = this.$slots
+		// const onEvents = this.$listeners
+
+		const _prefix = prefix ? <span class="le-addon le-input-number__prefix">{prefix}</span> : ''
+		const _suffix = suffix ? <span class="le-addon le-input-number__suffix">{suffix}</span> : ''
+		return (
+			<div
+				class={`le-input-number le-input-number--${inputNumberSize} el-input el-input-group
+     ${_prefix || $slots.prefix ? 'le-input-number--prefix' : ''}
+     ${_suffix || $slots.suffix ? 'le-input-number--suffix' : ''}
+     `}
+			>
+				{$slots.prefix || _prefix}
+				<el-input-number
+					max={max}
+					{...props}
+					size={inputNumberSize}
+					controlsPosition={controlsPosition || 'right'}
+					placeholder={placeholder || t('le.el.input.placeholder')}
+					// value={this.localValue}
+					value={value}
+				/>
+				{$slots.suffix || _suffix}
+			</div>
+		)
+	},*/
+})
+export default Component
+</script>

+ 1 - 1
src/router/index.ts

@@ -393,7 +393,7 @@ export const constantRoutes: AppRouteRecordRaw[] = [
 		name: 'dashboard',
 		meta: { title: 'dashboard', icon: 'icon-homepage', affix: true, parentName: 'mainLayout' }
 	},
-	// ...localDemoRoutes,
+	...localDemoRoutes,
 	// 用户
 	{
 		path: '/profile',

+ 1 - 1
src/views/components/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<div class="flex-column-page-wrap pageWrap">
 		Home
-		<div class="common_title">多语言 使用</div>
+		<div class="common_title" style="background: #f00">多语言 使用  todo 选择 人员 选择角色</div>
 		<div class="content">
 			<el-button size="small" @click="switchLang">
 				lang: 切换

+ 7 - 1
vite.config.ts

@@ -114,7 +114,13 @@ export default defineConfig(({ mode /*command,*/ }: ConfigEnv): UserConfig => {
 			open: viteEnv.VITE_OPEN,
 			cors: true,
 			// Load proxy configuration from .env.development
-			proxy: {}
+			proxy: {
+				'/sssss': {
+					target: 'https://api.everright.site', // 目标接口的域名
+					changeOrigin: true, // 是否改变源地址
+					rewrite: (path) => path.replace(/^\/sssss/, ''), // 重写路径
+				},
+			},
 		},
 		plugins: [
 			examplePlugin(),