dai-cli
更改列表
index.js 12(+6 -6)
temp/module-m/.gitignore 4(+4 -0)
temp/module-m/api.js 38(+38 -0)
temp/module-m/desktop.ini 6(+6 -0)
temp/module-m/index.js 14(+14 -0)
temp/module-m/page/index.vue 54(+54 -0)
temp/module-m/routes.js 10(+10 -0)
temp/module-w/.gitignore 4(+4 -0)
temp/module-w/api.js 38(+38 -0)
temp/module-w/desktop.ini 6(+6 -0)
temp/module-w/index.js 14(+14 -0)
temp/module-w/page/index.vue 53(+53 -0)
temp/module-w/routes.js 10(+10 -0)
temp/site-admin-iview/.babelrc 4(+4 -0)
temp/site-admin-iview/.gitignore 4(+4 -0)
temp/site-admin-iview/.prettierrc 16(+16 -0)
temp/site-admin-iview/build/build.js 3(+3 -0)
temp/site-admin-iview/build/config.js 20(+20 -0)
temp/site-admin-iview/build/dev.js 3(+3 -0)
temp/site-admin-iview/desktop.ini 6(+6 -0)
temp/site-admin-iview/main/config/config.js 33(+33 -0)
temp/site-admin-iview/main/index.html 17(+17 -0)
temp/site-admin-iview/main/index.js 45(+45 -0)
temp/site-admin-iview/main/interceptor.js 62(+62 -0)
temp/site-admin-iview/main/page/header.vue 75(+75 -0)
temp/site-admin-iview/main/page/index.vue 31(+31 -0)
temp/site-admin-iview/main/page/main.vue 123(+123 -0)
temp/site-admin-iview/main/page/nav.vue 142(+142 -0)
temp/site-admin-iview/main/page/navSub.vue 59(+59 -0)
temp/site-admin-iview/main/store.js 20(+20 -0)
temp/site-admin-iview/package.json 17(+17 -0)
temp/site-admin-iview/src/api.js 19(+19 -0)
temp/site-admin-iview/src/index.js 6(+6 -0)
temp/site-admin-iview/src/page/404.vue 34(+34 -0)
temp/site-admin-iview/src/page/daiTc.vue 98(+98 -0)
temp/site-admin-iview/src/page/dialog.vue 68(+68 -0)
temp/site-admin-iview/src/page/home.vue 28(+28 -0)
temp/site-admin-iview/src/page/loading.vue 46(+46 -0)
temp/site-admin-iview/src/page/routerMap.vue 56(+56 -0)
temp/site-admin-iview/src/routes.js 9(+9 -0)
temp/site-admin-iview/types/type.d.ts 154(+154 -0)
temp/site-m/.babelrc 4(+4 -0)
temp/site-m/.gitignore 4(+4 -0)
temp/site-m/.prettierrc 16(+16 -0)
temp/site-m/build/build.js 3(+3 -0)
temp/site-m/build/config.js 22(+22 -0)
temp/site-m/build/dev.js 3(+3 -0)
temp/site-m/desktop.ini 6(+6 -0)
temp/site-m/main/config/config.js 33(+33 -0)
temp/site-m/main/config/configDev.js 9(+9 -0)
temp/site-m/main/config/configPro.js 12(+12 -0)
temp/site-m/main/config/configTest.js 10(+10 -0)
temp/site-m/main/favicon.ico 0(+0 -0)
temp/site-m/main/index.html 20(+20 -0)
temp/site-m/main/index.js 41(+41 -0)
temp/site-m/main/interceptor.js 62(+62 -0)
temp/site-m/main/modules.js 2(+2 -0)
temp/site-m/main/store.js 20(+20 -0)
temp/site-m/main/style.less 2(+2 -0)
temp/site-m/package.json 16(+16 -0)
temp/site-m/src/api.js 19(+19 -0)
temp/site-m/src/index.js 6(+6 -0)
temp/site-m/src/page/404.vue 34(+34 -0)
temp/site-m/src/page/home.vue 28(+28 -0)
temp/site-m/src/page/routerMap.vue 56(+56 -0)
temp/site-m/src/routes.js 6(+6 -0)
temp/site-m/types/type.d.ts 154(+154 -0)
temp/site-w/.babelrc 4(+4 -0)
temp/site-w/.gitignore 4(+4 -0)
temp/site-w/.prettierrc 16(+16 -0)
temp/site-w/build/build.js 3(+3 -0)
temp/site-w/build/config.js 22(+22 -0)
temp/site-w/build/dev.js 3(+3 -0)
temp/site-w/desktop.ini 6(+6 -0)
temp/site-w/main/config/config.js 33(+33 -0)
temp/site-w/main/config/configDev.js 9(+9 -0)
temp/site-w/main/config/configPro.js 12(+12 -0)
temp/site-w/main/config/configTest.js 10(+10 -0)
temp/site-w/main/favicon.ico 0(+0 -0)
temp/site-w/main/index.html 16(+16 -0)
temp/site-w/main/index.js 41(+41 -0)
temp/site-w/main/interceptor.js 62(+62 -0)
temp/site-w/main/modules.js 1(+1 -0)
temp/site-w/main/store.js 20(+20 -0)
temp/site-w/main/style.less 2(+2 -0)
temp/site-w/package.json 16(+16 -0)
temp/site-w/src/api.js 19(+19 -0)
temp/site-w/src/index.js 6(+6 -0)
temp/site-w/src/page/404.vue 34(+34 -0)
temp/site-w/src/page/home.vue 28(+28 -0)
temp/site-w/src/page/routerMap.vue 56(+56 -0)
temp/site-w/src/routes.js 6(+6 -0)
temp/site-w/types/type.d.ts 154(+154 -0)
详细信息
index.js 12(+6 -6)
diff --git a/index.js b/index.js
index 57b00ef..d26e267 100644
--- a/index.js
+++ b/index.js
@@ -9,16 +9,16 @@ import path from 'path';
import { fileURLToPath } from 'url';
const projectList = [
- { name: 'dai-vue-m 移动端项目', value: 'http://git.daicms.com/dai-vue-temp-m.git#master' },
- { name: 'dai-vue-w 电脑端项目', value: 'http://git.daicms.com/dai-vue-temp-w.git#master' },
+ { name: 'site-m 移动端项目', value: 'http://git.daicms.com/dai-cli.git#master', path: '/site-m' },
+ { name: 'site-w 电脑端项目', value: 'http://git.daicms.com/dai-cli.git#master', path: '/site-w' },
{
- name: 'dai-vue-admin-iview 电脑端后台模板(iview)',
- value: 'http://git.daicms.com/dai-vue-temp-iview-admin.git#master'
+ name: 'site-admin-iview 电脑端后台模板(iview)',
+ value: 'http://git.daicms.com/dai-cli.git#master', path: '/site-admin-iview'
}
];
const moduleList = [
- { name: 'dai-vue-module-m 移动端模块', value: 'http://git.daicms.com/dai-vue-module-m.git#master' },
- { name: 'dai-vue-module-w 电脑端模块', value: 'http://git.daicms.com/dai-vue-module-w.git#master' }
+ { name: 'module-m 移动端模块', value: 'http://git.daicms.com/dai-cli.git#master', path: '/module-m' },
+ { name: 'module-w 电脑端模块', value: 'http://git.daicms.com/dai-cli.git#master', path: '/module-w' }
];
//下载项目
let downloadProject = function (answers) {
temp/module-m/.gitignore 4(+4 -0)
diff --git a/temp/module-m/.gitignore b/temp/module-m/.gitignore
new file mode 100644
index 0000000..8a8eb06
--- /dev/null
+++ b/temp/module-m/.gitignore
@@ -0,0 +1,4 @@
+node_modules/
+dist/
+package-lock.json
+.vscode/
\ No newline at end of file
temp/module-m/api.js 38(+38 -0)
diff --git a/temp/module-m/api.js b/temp/module-m/api.js
new file mode 100644
index 0000000..f5aca16
--- /dev/null
+++ b/temp/module-m/api.js
@@ -0,0 +1,38 @@
+var module__name_test = {
+ $config: {
+ /**读取配置文件中 service 字段,默认 default*/
+ service: 'default',
+ /**基础URL */
+ baseURL: '/module__name_test/',
+ /**请求方式,不配置为 payload*/
+ // requestType: 'formData'
+ /**模块自定义拦截器 */
+ interceptor: {
+ /**请求拦截器 完全拦截*/
+ // request(options) {},
+ /**响应拦截器 完全拦截*/
+ // response(data, options) {},
+ /**请求拦截器 不完全拦截,处理数据后交给全局拦截器 存在 request 则不生效*/
+ // requestCheck(options) {},
+ /**响应拦截器 不完全拦截,处理数据后交给全局拦截器 存在 response 则不生效*/
+ // responseCheck(data, options) {
+ // if (data && data.data && data.data.code == 1003) {
+ // this.$vue.$router.replace({
+ // path: '../../user/login',
+ // query: { path: this.$vue.$route.path, query: JSON.stringify(this.$vue.$route.query) }
+ // });
+ // throw new Error('用户未登录');
+ // }
+ // }
+ }
+ },
+ /**
+ * 接口方法 在 vue 页面中可以使用方法 await this.$api.module__name_test.test({});
+ * @param {Object} data
+ * @returns
+ */
+ async test(data) {
+ return await this.$get('test', data);
+ }
+};
+export { module__name_test };
temp/module-m/desktop.ini 6(+6 -0)
diff --git a/temp/module-m/desktop.ini b/temp/module-m/desktop.ini
new file mode 100644
index 0000000..4b62f2e
--- /dev/null
+++ b/temp/module-m/desktop.ini
@@ -0,0 +1,6 @@
+[.ShellClassInfo]
+InfoTip=DaiVUE DaiVUE��� ģ��ģ��-�ƶ���
+[ViewState]
+Mode=
+Vid=
+FolderType=Generic
temp/module-m/index.js 14(+14 -0)
diff --git a/temp/module-m/index.js b/temp/module-m/index.js
new file mode 100644
index 0000000..0b8f725
--- /dev/null
+++ b/temp/module-m/index.js
@@ -0,0 +1,14 @@
+import * as api from './api.js';
+import routes from './routes.js';
+import './static/style/style.less';
+export default {
+ use: [],
+ //API 会注入到VUE 中 调用方法 this.$api.xxx
+ api,
+ //路由
+ routes,
+ //注入根路由
+ routesRoot: [],
+ //扩展方法,会注入到VUE 中 调用方法 this.$extend.xxx
+ extend: {},
+};
temp/module-m/page/index.vue 54(+54 -0)
diff --git a/temp/module-m/page/index.vue b/temp/module-m/page/index.vue
new file mode 100644
index 0000000..c4e5ee9
--- /dev/null
+++ b/temp/module-m/page/index.vue
@@ -0,0 +1,54 @@
+<style lang="less" scoped>
+</style>
+<template>
+ <div style="text-align: center;">
+ <div><img style="width:200px;" src="../static/image/vue-logo.png" /></div>
+ <div style="font-size:28px;">DaiVUE</div>
+ <div>简易VUE网站快速成型框架</div>
+ <div>功能模块示例</div>
+ </div>
+</template>
+<script type="text/javascript">
+import { Vuex } from "dai-vue";
+export default {
+ /**混入对象 */
+ mixins: [],
+ /**接收来自父组件的数据 */
+ props: {},
+ data() {
+ return {};
+ },
+ components: {},
+ methods: {},
+ watch: {},
+ //计算属性
+ computed: {
+ ...Vuex.mapGetters(["vx_userInfo"]),
+ },
+ /** 在实例初始化之后,进行数据侦听和事件/侦听器的配置之前同步调用*/
+ beforeCreate() {},
+ /** 在实例创建完成后被立即同步调用*/
+ created() {},
+ /**在挂载开始之前被调用 */
+ beforeMount() {},
+ /**实例被挂载后调用 */
+ mounted() {},
+ /**在数据发生改变后,DOM 被更新之前被调用。 */
+ beforeUpdate() {},
+ /**在数据更改导致的虚拟 DOM 重新渲染和更新完毕之后被调用。 */
+ updated() {},
+ /**被 keep-alive 缓存的组件激活时调用。 */
+ activated() {},
+ /**被 keep-alive 缓存的组件失活时调用。 */
+ deactivated() {},
+ /**实例销毁之前调用。在这一步,实例仍然完全可用。 */
+ beforeDestroy() {},
+ /**实例销毁后调用。 */
+ destroyed() {},
+ /** 在捕获一个来自后代组件的错误时被调用。*/
+ errorCaptured(error, component, info) {
+ //此钩子可以返回 false 以阻止该错误继续向上传播。
+ // return false;
+ },
+};
+</script>
\ No newline at end of file
temp/module-m/routes.js 10(+10 -0)
diff --git a/temp/module-m/routes.js b/temp/module-m/routes.js
new file mode 100644
index 0000000..1011fc8
--- /dev/null
+++ b/temp/module-m/routes.js
@@ -0,0 +1,10 @@
+const routes = [
+ {
+ path: '/module__name_test',
+ component: { template: '<router-view class="module__module_test"></router-view>' },
+ children: [
+ { path: 'index', component: () => import('./page/index.vue'), meta: { pageName: '模块模板' } }
+ ]
+ }
+];
+export default routes;
diff --git a/temp/module-m/static/image/vue-logo.png b/temp/module-m/static/image/vue-logo.png
new file mode 100644
index 0000000..102329c
Binary files /dev/null and b/temp/module-m/static/image/vue-logo.png differ
diff --git a/temp/module-m/static/style/style.less b/temp/module-m/static/style/style.less
new file mode 100644
index 0000000..c96fd0a
--- /dev/null
+++ b/temp/module-m/static/style/style.less
@@ -0,0 +1,3 @@
+//模块内样式
+.module__module_test {
+}
temp/module-w/.gitignore 4(+4 -0)
diff --git a/temp/module-w/.gitignore b/temp/module-w/.gitignore
new file mode 100644
index 0000000..8a8eb06
--- /dev/null
+++ b/temp/module-w/.gitignore
@@ -0,0 +1,4 @@
+node_modules/
+dist/
+package-lock.json
+.vscode/
\ No newline at end of file
temp/module-w/api.js 38(+38 -0)
diff --git a/temp/module-w/api.js b/temp/module-w/api.js
new file mode 100644
index 0000000..f5aca16
--- /dev/null
+++ b/temp/module-w/api.js
@@ -0,0 +1,38 @@
+var module__name_test = {
+ $config: {
+ /**读取配置文件中 service 字段,默认 default*/
+ service: 'default',
+ /**基础URL */
+ baseURL: '/module__name_test/',
+ /**请求方式,不配置为 payload*/
+ // requestType: 'formData'
+ /**模块自定义拦截器 */
+ interceptor: {
+ /**请求拦截器 完全拦截*/
+ // request(options) {},
+ /**响应拦截器 完全拦截*/
+ // response(data, options) {},
+ /**请求拦截器 不完全拦截,处理数据后交给全局拦截器 存在 request 则不生效*/
+ // requestCheck(options) {},
+ /**响应拦截器 不完全拦截,处理数据后交给全局拦截器 存在 response 则不生效*/
+ // responseCheck(data, options) {
+ // if (data && data.data && data.data.code == 1003) {
+ // this.$vue.$router.replace({
+ // path: '../../user/login',
+ // query: { path: this.$vue.$route.path, query: JSON.stringify(this.$vue.$route.query) }
+ // });
+ // throw new Error('用户未登录');
+ // }
+ // }
+ }
+ },
+ /**
+ * 接口方法 在 vue 页面中可以使用方法 await this.$api.module__name_test.test({});
+ * @param {Object} data
+ * @returns
+ */
+ async test(data) {
+ return await this.$get('test', data);
+ }
+};
+export { module__name_test };
temp/module-w/desktop.ini 6(+6 -0)
diff --git a/temp/module-w/desktop.ini b/temp/module-w/desktop.ini
new file mode 100644
index 0000000..4b62f2e
--- /dev/null
+++ b/temp/module-w/desktop.ini
@@ -0,0 +1,6 @@
+[.ShellClassInfo]
+InfoTip=DaiVUE DaiVUE��� ģ��ģ��-�ƶ���
+[ViewState]
+Mode=
+Vid=
+FolderType=Generic
temp/module-w/index.js 14(+14 -0)
diff --git a/temp/module-w/index.js b/temp/module-w/index.js
new file mode 100644
index 0000000..7a03b9e
--- /dev/null
+++ b/temp/module-w/index.js
@@ -0,0 +1,14 @@
+import * as api from './api.js';
+import routes from './routes.js';
+import './static/style/style.less';
+export default {
+ use:[],
+ //API 会注入到VUE 中 调用方法 this.$api.xxx
+ api,
+ //路由
+ routes,
+ //注入根路由
+ routesRoot:[],
+ //扩展方法,会注入到VUE 中 调用方法 this.$extend.xxx
+ extend:{}
+};
temp/module-w/page/index.vue 53(+53 -0)
diff --git a/temp/module-w/page/index.vue b/temp/module-w/page/index.vue
new file mode 100644
index 0000000..3dae156
--- /dev/null
+++ b/temp/module-w/page/index.vue
@@ -0,0 +1,53 @@
+<style lang="less" scoped>
+</style>
+<template>
+ <div style="text-align: center;">
+ <div><img style="width:200px;" src="../static/image/vue-logo.png" /></div>
+ <div style="font-size:28px;">DaiVUE</div>
+ <div>简易VUE网站快速成型框架</div>
+ <div>功能模块示例</div>
+ </div>
+</template>
+<script type="text/javascript">
+import { Vuex } from "dai-vue";
+export default {
+ /**混入对象 */
+ mixins: [],
+ /**接收来自父组件的数据 */
+ props: {},
+ data() {
+ return {};
+ },
+ components: {},
+ methods: {},
+ watch: {},
+ //计算属性
+ computed: {
+ ...Vuex.mapGetters(["vx_userInfo"]),
+ },
+ beforeCreate() {},
+ /** 在实例创建完成后被立即同步调用*/
+ created() {},
+ /**在挂载开始之前被调用 */
+ beforeMount() {},
+ /**实例被挂载后调用 */
+ mounted() {},
+ /**在数据发生改变后,DOM 被更新之前被调用。 */
+ beforeUpdate() {},
+ /**在数据更改导致的虚拟 DOM 重新渲染和更新完毕之后被调用。 */
+ updated() {},
+ /**被 keep-alive 缓存的组件激活时调用。 */
+ activated() {},
+ /**被 keep-alive 缓存的组件失活时调用。 */
+ deactivated() {},
+ /**实例销毁之前调用。在这一步,实例仍然完全可用。 */
+ beforeDestroy() {},
+ /**实例销毁后调用。 */
+ destroyed() {},
+ /** 在捕获一个来自后代组件的错误时被调用。*/
+ errorCaptured(error, component, info) {
+ //此钩子可以返回 false 以阻止该错误继续向上传播。
+ // return false;
+ },
+};
+</script>
\ No newline at end of file
temp/module-w/routes.js 10(+10 -0)
diff --git a/temp/module-w/routes.js b/temp/module-w/routes.js
new file mode 100644
index 0000000..1011fc8
--- /dev/null
+++ b/temp/module-w/routes.js
@@ -0,0 +1,10 @@
+const routes = [
+ {
+ path: '/module__name_test',
+ component: { template: '<router-view class="module__module_test"></router-view>' },
+ children: [
+ { path: 'index', component: () => import('./page/index.vue'), meta: { pageName: '模块模板' } }
+ ]
+ }
+];
+export default routes;
diff --git a/temp/module-w/static/image/vue-logo.png b/temp/module-w/static/image/vue-logo.png
new file mode 100644
index 0000000..102329c
Binary files /dev/null and b/temp/module-w/static/image/vue-logo.png differ
diff --git a/temp/module-w/static/style/style.less b/temp/module-w/static/style/style.less
new file mode 100644
index 0000000..c96fd0a
--- /dev/null
+++ b/temp/module-w/static/style/style.less
@@ -0,0 +1,3 @@
+//模块内样式
+.module__module_test {
+}
temp/site-admin-iview/.babelrc 4(+4 -0)
diff --git a/temp/site-admin-iview/.babelrc b/temp/site-admin-iview/.babelrc
new file mode 100644
index 0000000..3364bf8
--- /dev/null
+++ b/temp/site-admin-iview/.babelrc
@@ -0,0 +1,4 @@
+{
+ "presets": ["@babel/preset-env"],
+ "plugins": ["@babel/plugin-transform-runtime", "@babel/plugin-proposal-class-properties"]
+}
temp/site-admin-iview/.gitignore 4(+4 -0)
diff --git a/temp/site-admin-iview/.gitignore b/temp/site-admin-iview/.gitignore
new file mode 100644
index 0000000..8a8eb06
--- /dev/null
+++ b/temp/site-admin-iview/.gitignore
@@ -0,0 +1,4 @@
+node_modules/
+dist/
+package-lock.json
+.vscode/
\ No newline at end of file
temp/site-admin-iview/.prettierrc 16(+16 -0)
diff --git a/temp/site-admin-iview/.prettierrc b/temp/site-admin-iview/.prettierrc
new file mode 100644
index 0000000..6c1a4ff
--- /dev/null
+++ b/temp/site-admin-iview/.prettierrc
@@ -0,0 +1,16 @@
+{
+ "printWidth": 120,
+ "tabWidth": 4,
+ "semi": true,
+ "singleQuote": true,
+ "trailingComma": "none",
+ "bracketSpacing": true,
+ "jsxBracketSameLine": false,
+ "arrowParens": "always",
+ "requirePragma": false,
+ "proseWrap": "preserve",
+ "stylelintIntegration": true,
+ "stylelint.config": {
+ "indentation": 2
+ }
+}
temp/site-admin-iview/build/build.js 3(+3 -0)
diff --git a/temp/site-admin-iview/build/build.js b/temp/site-admin-iview/build/build.js
new file mode 100644
index 0000000..a7dd1c9
--- /dev/null
+++ b/temp/site-admin-iview/build/build.js
@@ -0,0 +1,3 @@
+import webpackBuild from 'dai-vue/src/build/webpack.build.js';
+import config from './config.js';
+webpackBuild(config);
temp/site-admin-iview/build/config.js 20(+20 -0)
diff --git a/temp/site-admin-iview/build/config.js b/temp/site-admin-iview/build/config.js
new file mode 100644
index 0000000..0387511
--- /dev/null
+++ b/temp/site-admin-iview/build/config.js
@@ -0,0 +1,20 @@
+export default {
+ // port: 8090,
+ //打包目标目录
+ buildPath: './dist/',
+ //拷贝目录及文件
+ copy: [
+ // {
+ // //源目录/文件
+ // from: './html',
+ // //目标目录/文件
+ // to: './dist/html',
+ // ignore: ['.*']
+ // }
+ ],
+ webpack: {
+ devServer: {
+ sockHost: '192.168.88.88'
+ }
+ }
+};
temp/site-admin-iview/build/dev.js 3(+3 -0)
diff --git a/temp/site-admin-iview/build/dev.js b/temp/site-admin-iview/build/dev.js
new file mode 100644
index 0000000..d55bfbe
--- /dev/null
+++ b/temp/site-admin-iview/build/dev.js
@@ -0,0 +1,3 @@
+import webpackDev from 'dai-vue/src/build/webpack.dev.js';
+import config from './config.js';
+webpackDev(config);
temp/site-admin-iview/desktop.ini 6(+6 -0)
diff --git a/temp/site-admin-iview/desktop.ini b/temp/site-admin-iview/desktop.ini
new file mode 100644
index 0000000..a0d6bfe
--- /dev/null
+++ b/temp/site-admin-iview/desktop.ini
@@ -0,0 +1,6 @@
+[.ShellClassInfo]
+InfoTip=DaiVue ��PC����Ŀģ��
+[ViewState]
+Mode=
+Vid=
+FolderType=Generic
temp/site-admin-iview/main/config/config.js 33(+33 -0)
diff --git a/temp/site-admin-iview/main/config/config.js b/temp/site-admin-iview/main/config/config.js
new file mode 100644
index 0000000..466867b
--- /dev/null
+++ b/temp/site-admin-iview/main/config/config.js
@@ -0,0 +1,33 @@
+import extend from 'extend2';
+import configTest from './configTest.js';
+import configDev from './configDev.js';
+import configPro from './configPro.js';
+
+var config = {};
+var env = process.env.NODE_ENV;
+var hostname = window.location.hostname.toLowerCase();
+
+//根据域名判断
+if (
+ hostname.indexOf('127.0.0.1') === 0 ||
+ hostname.indexOf('192.168') === 0 ||
+ hostname.indexOf('dev.') === 0 ||
+ hostname == 'localhost'
+) {
+ env = 'development';
+} else if (hostname.indexOf('test.') === 0) {
+ env = 'test';
+}
+
+//合并配置
+if (env == 'development') {
+ config = extend(true, {}, configPro, configDev);
+ config.isDev = true;
+} else if (env == 'test') {
+ config = extend(true, {}, configPro, configTest);
+ config.isDev = true;
+} else {
+ config = extend(true, {}, configPro);
+ config.isDev = false;
+}
+export default config;
diff --git a/temp/site-admin-iview/main/config/configDev.js b/temp/site-admin-iview/main/config/configDev.js
new file mode 100644
index 0000000..4c18249
--- /dev/null
+++ b/temp/site-admin-iview/main/config/configDev.js
@@ -0,0 +1,9 @@
+/**
+ * 开发环境配置
+ */
+const config = {
+ isDev: true,
+ service: {}
+};
+
+export default config;
diff --git a/temp/site-admin-iview/main/config/configPro.js b/temp/site-admin-iview/main/config/configPro.js
new file mode 100644
index 0000000..edc9758
--- /dev/null
+++ b/temp/site-admin-iview/main/config/configPro.js
@@ -0,0 +1,13 @@
+var config = {
+ //是否开发模式
+ isDev: false,
+ title:'DaiVUE Admin',
+ domain: 'http://localhost:8080',
+ //版本
+ version: '1.0.0',
+ //接口服务配置
+ service: {
+ default: 'http://192.168.88.88:8010'
+ }
+};
+export default config;
\ No newline at end of file
diff --git a/temp/site-admin-iview/main/config/configTest.js b/temp/site-admin-iview/main/config/configTest.js
new file mode 100644
index 0000000..b04a19e
--- /dev/null
+++ b/temp/site-admin-iview/main/config/configTest.js
@@ -0,0 +1,10 @@
+/**
+ * 开发环境配置
+ */
+const config = {
+ //是否开发模式
+ isDev: false,
+ service: {}
+};
+
+export default config;
diff --git a/temp/site-admin-iview/main/config/navConfig.js b/temp/site-admin-iview/main/config/navConfig.js
new file mode 100644
index 0000000..401b269
--- /dev/null
+++ b/temp/site-admin-iview/main/config/navConfig.js
@@ -0,0 +1,60 @@
+const navConfig = [
+ {
+ to: '/',
+ icon: 'ios-paper',
+ isAdmin: false,
+ title: '首页',
+ children: []
+ },
+ {
+ to: '/demo',
+ icon: 'ios-paper',
+ isAdmin: false,
+ title: '功能演示',
+ children: [
+ { to: '/demo/dialog', icon: 'ios-paper', title: '提示(dialog)' },
+ { to: '/demo/loading', icon: 'ios-paper', title: '加载(loading)' },
+ { to: '/demo/daiTc', icon: 'ios-paper', title: '标题内容(dai-tc)' },
+ ]
+ },
+ {
+ to: '/shengzi/list',
+ icon: 'ios-paper',
+ isAdmin: false,
+ title: '一级菜单-1',
+ children: [
+ { to: '/shengzi/list', icon: 'ios-paper', title: '二级菜单' },
+ { to: '/common/wenzhang', icon: 'ios-paper', title: '二级菜单' },
+ { to: '/common/ciList', icon: 'ios-paper', title: '二级菜单' },
+ { to: '/common/chengyuList', icon: 'ios-paper', title: '二级菜单' },
+ { to: '/common/testList', icon: 'ios-paper', title: '二级菜单' }
+ ]
+ },
+ {
+ // icon: 'ios-paper',
+ isAdmin: false,
+ title: '一级菜单-2',
+ children: [
+ { to: '/douyon/liveList', icon: 'ios-paper', title: '二级菜单' },
+ {
+ to: '/c1/c2/c3-1',
+ icon: 'ios-paper',
+ title: '二级菜单',
+ children: [
+ { to: '/c1/c2/c3-1', icon: 'ios-paper', title: '三级菜单-1' },
+ { to: '/c1/c2/c3-2', icon: 'ios-paper', title: '三级菜单-2' }
+ ]
+ }
+ ]
+ },
+ {
+ // icon: 'ios-paper',
+ isAdmin: false,
+ title: '系统设置',
+ children: [
+ { to: '/member/typeList', icon: 'ios-paper', title: '会员管理' },
+ { to: '/version/list', icon: 'ios-paper', title: '系统设置' }
+ ]
+ }
+];
+export default navConfig;
diff --git a/temp/site-admin-iview/main/favicon.ico b/temp/site-admin-iview/main/favicon.ico
new file mode 100644
index 0000000..0eed320
Binary files /dev/null and b/temp/site-admin-iview/main/favicon.ico differ
temp/site-admin-iview/main/index.html 17(+17 -0)
diff --git a/temp/site-admin-iview/main/index.html b/temp/site-admin-iview/main/index.html
new file mode 100644
index 0000000..288476a
--- /dev/null
+++ b/temp/site-admin-iview/main/index.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <!-- 禁止缓存 -->
+ <!-- <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
+ <meta http-equiv="Pragma" content="no-cache" />
+ <meta http-equiv="Expires" content="0" /> -->
+ <title><%= htmlWebpackPlugin.options.title %></title>
+ </head>
+ <body>
+ <div id="dai-app" class="dai-app d-box-v" style="height: 100vh; overflow: auto;">
+ <router-view class="d-box-flex"></router-view>
+ </div>
+ <script type="text/javascript" src="http://static.daicms.com/scripts/jquery-3.3.1.min.js"></script>
+ </body>
+</html>
\ No newline at end of file
temp/site-admin-iview/main/index.js 45(+45 -0)
diff --git a/temp/site-admin-iview/main/index.js b/temp/site-admin-iview/main/index.js
new file mode 100644
index 0000000..3fae3cc
--- /dev/null
+++ b/temp/site-admin-iview/main/index.js
@@ -0,0 +1,45 @@
+import { DaiVue, Vuex, Vue } from 'dai-vue';
+import * as modules from './modules.js';
+import config from './config/config.js';
+import interceptor from './interceptor.js';
+import store from './store.js';
+import iview from 'view-design';
+import daiVueIview from 'dai-vue-iview';
+
+import './style.less';
+import main from './page/index.vue';
+
+var vm = DaiVue(
+ {
+ store,
+ data() {
+ return {};
+ },
+ methods: {},
+ created: function () {},
+ watch: {},
+ components: {},
+ //计算属性
+ computed: {
+ ...Vuex.mapGetters(['vx_userInfo'])
+ }
+ },
+ {
+ //全局配置
+ config,
+ //引用的所有模块
+ modules: modules,
+ //主路由模块,可以是一个布局模块
+ main,
+ use: {
+ iview: { plugin: iview },
+ dialog: { plugin: daiVueIview }
+ },
+ //http 拦截器
+ interceptor
+ }
+);
+
+//挂载VUE
+vm.$mount('#dai-app');
+window.baseVue = vm;
temp/site-admin-iview/main/interceptor.js 62(+62 -0)
diff --git a/temp/site-admin-iview/main/interceptor.js b/temp/site-admin-iview/main/interceptor.js
new file mode 100644
index 0000000..3a2e532
--- /dev/null
+++ b/temp/site-admin-iview/main/interceptor.js
@@ -0,0 +1,62 @@
+const interceptor = {
+ //请求拦截
+ request(options) {
+ options.headers.token = localStorage.getItem('token');
+ },
+ //响应拦截
+ response(response, options) {
+ let obj = { isErr: false, data: '' };
+ if (response.status == '200') {
+ var json = response.data;
+ if (json.isErr) {
+ //如果显示错误信息,弹出错误,否则继续执行
+ if (options.showMsg) {
+ options.onError(this, '错误', json.errMsg);
+ this.$vue.$Notice.error({
+ title: '错误',
+ desc: json.errMsg
+ });
+ console.error(json.errMsg);
+ obj.isErr = true;
+ obj.data = json;
+ return obj;
+ } else {
+ //继续执行,内部处理错误
+ obj.isErr = false;
+ obj.data = json;
+ return obj;
+ }
+ } else {
+ //当现实返回消息时
+ if (options.showMsg) {
+ if (json.msg) {
+ // options.onMessage(this, '消息', json.msg);
+ this.$vue.$Notice.success({
+ title: json.msg
+ // desc: nodesc ? '' : 'Here is the notification description. Here is the notification description. '
+ });
+ }
+ obj.isErr = false;
+ obj.data = json.data;
+ return obj;
+ }
+ //当不现实返回消息时
+ else {
+ obj.isErr = false;
+ obj.data = json;
+ return obj;
+ }
+ }
+ } else {
+ console.error(response);
+ if (options.showMsg) {
+ options.onError(this, '网络错误', '请联系管理员解决');
+ }
+ obj.isErr = true;
+ obj.data = '网络错误';
+ return obj;
+ }
+ return obj;
+ }
+};
+export default interceptor;
diff --git a/temp/site-admin-iview/main/modules.js b/temp/site-admin-iview/main/modules.js
new file mode 100644
index 0000000..9124704
--- /dev/null
+++ b/temp/site-admin-iview/main/modules.js
@@ -0,0 +1 @@
+export { default as main } from '../src/index.js';
\ No newline at end of file
diff --git a/temp/site-admin-iview/main/page/breadcrumb.vue b/temp/site-admin-iview/main/page/breadcrumb.vue
new file mode 100644
index 0000000..651469c
--- /dev/null
+++ b/temp/site-admin-iview/main/page/breadcrumb.vue
@@ -0,0 +1,51 @@
+<style lang="less" scoped>
+/deep/.ivu-breadcrumb a { color: #fff;}
+/deep/.ivu-breadcrumb-item-link { color: #fff;}
+</style>
+<template>
+ <Breadcrumb>
+ <BreadcrumbItem to="/">首页</BreadcrumbItem>
+ <BreadcrumbItem v-for="(item,index) in list" :key="index" :to="item.to">{{item.title}}</BreadcrumbItem>
+ </Breadcrumb>
+</template>
+<script>
+export default {
+ props: {
+ breadcrumb: {
+ type: Array,
+ default() {
+ return [];
+ }
+ }
+ },
+ data: function () {
+ return {
+ loading: true,
+ show: false,
+ list: this.breadcrumb
+ };
+ },
+ components: {},
+ methods: {
+ //以路由中 pageName 为优先
+ setList() {
+ this.list = this.breadcrumb;
+ if (this.list.length > 0 && this.list[this.list.length - 1].to == this.$route.path) {
+ this.list[this.list.length - 1].title = this.$route.meta.pageName;
+ }
+ }
+ },
+ watch: {
+ breadcrumb(val) {
+ this.setList();
+ }
+ },
+ created: async function () {},
+ mounted: function () {
+ this.setList();
+ },
+ //计算属性
+ computed: {},
+ destroyed: function () {}
+};
+</script>
\ No newline at end of file
temp/site-admin-iview/main/page/header.vue 75(+75 -0)
diff --git a/temp/site-admin-iview/main/page/header.vue b/temp/site-admin-iview/main/page/header.vue
new file mode 100644
index 0000000..0f09777
--- /dev/null
+++ b/temp/site-admin-iview/main/page/header.vue
@@ -0,0 +1,75 @@
+<style lang="less" >
+.vue-2018112102 {
+ height: 36px;
+ background-color: #444851;
+ .title {
+ // background: url('../images/logo-26.png') no-repeat;
+ background-position: 15px 5px;
+ width: 180px;
+ background-color: #000000;
+ color: #fff;
+ // padding-left: 50px;
+ font-size: 20px;
+ line-height: 36px;
+ text-align: center;
+ }
+ .breadcrumb {
+ padding-left: 20px;
+ color: #fff;
+ font-size: 18px;
+ line-height: 36px;
+ }
+ .info {
+ text-align: right;
+ color: #fff;
+ line-height: 36px;
+ padding-right: 20px;
+ font-size: 14px;
+ }
+}
+</style>
+<template>
+ <!--备注-->
+ <div class="vue-2018112102 d-box">
+ <div class="title" :style="{width:titleWidth}">{{$config.title}}</div>
+ <div class="breadcrumb">
+ <breadcrumb :breadcrumb="breadcrumb"></breadcrumb> {{$route.meta.pageName}}
+ </div>
+ <div class="info d-box-flex">
+ <slot></slot>
+ </div>
+ </div>
+</template>
+<script type="text/javascript">
+import breadcrumb from './breadcrumb.vue';
+export default {
+ props: {
+ /**宽度 */
+ titleWidth: {
+ type: String | Number,
+ default: '180px'
+ },
+ breadcrumb: {
+ type: Array,
+ default() {
+ return [];
+ }
+ }
+ },
+ data: function () {
+ return {
+ tuserInfo: {},
+ fuwuInfo: {
+ codeName: ''
+ }
+ };
+ },
+ components: { breadcrumb },
+ methods: {},
+ watch: {},
+ created: async function () {},
+ mounted: function () {},
+ //计算属性
+ computed: {}
+};
+</script>
\ No newline at end of file
temp/site-admin-iview/main/page/index.vue 31(+31 -0)
diff --git a/temp/site-admin-iview/main/page/index.vue b/temp/site-admin-iview/main/page/index.vue
new file mode 100644
index 0000000..60b6b85
--- /dev/null
+++ b/temp/site-admin-iview/main/page/index.vue
@@ -0,0 +1,31 @@
+<style scoped>
+</style>
+<template>
+ <main-box :navConfig="navConfig">
+ <template v-slot:headerInfo>正文</template>
+ </main-box>
+</template>
+<script>
+//可以使用预置框架
+// import main from 'dai-vue-ivew/main/page/main.vue';
+import main from './main.vue';
+import navConfig from '../config/navConfig.js';
+export default {
+ mixins: [],
+ components: {
+ mainBox: main
+ },
+ props: [],
+ data: function () {
+ return {
+ navConfig
+ };
+ },
+ methods: {},
+ watch: {},
+ async created() {},
+ mounted() {},
+ //计算属性
+ computed: {}
+};
+</script>
\ No newline at end of file
temp/site-admin-iview/main/page/main.vue 123(+123 -0)
diff --git a/temp/site-admin-iview/main/page/main.vue b/temp/site-admin-iview/main/page/main.vue
new file mode 100644
index 0000000..1287c58
--- /dev/null
+++ b/temp/site-admin-iview/main/page/main.vue
@@ -0,0 +1,123 @@
+<style lang="less"></style>
+<template>
+ <!--软件主体部分-->
+ <div class="d-box-v">
+ <header>
+ <header-box :title-width="navWidth" :breadcrumb="breadcrumb">
+ <!-- 头部会员登录等信息 -->
+ <slot name="headerInfo"></slot>
+ </header-box>
+ </header>
+ <div class="d-box-flex d-box">
+ <nav class="d-box">
+ <nav-box @on-select="onSelect" :nav-config="navConfig" :active-name="navActiveName"
+ :open-names="openNames" :accordion="accordion" :width="navWidth">
+ </nav-box>
+ </nav>
+ <main class="d-box-flex-1 d-box-v">
+ <nav-sub :nav-config="navConfig" :active-name="navActiveName"></nav-sub>
+ <div class="d-box-flex" style="overflow:auto;">
+ <router-view></router-view>
+ </div>
+ </main>
+ </div>
+ </div>
+</template>
+<script type="text/javascript">
+import headerBox from './header.vue';
+import navBox from './nav.vue';
+import navSub from './navSub.vue';
+export default {
+ props: {
+ navConfig: {
+ type: Array,
+ default() {
+ return [];
+ }
+ },
+ activeName: {
+ type: String,
+ default: '0-0'
+ },
+ accordion: {
+ type: Boolean,
+ default: true
+ }
+ },
+ data() {
+ return {
+ navActiveName: '0-0',
+ openNames: ['0', '1'],
+ navWidth: '200px',
+ //面包屑
+ breadcrumb: []
+ };
+ },
+ components: { navBox, navSub, headerBox },
+ methods: {
+ onSelect(name) {
+ this.navActiveName = name;
+ },
+ setNavActive() {
+ var path = this.$route.path;
+ //循环一级
+ for (var x = 0; x < this.navConfig.length; x++) {
+ let item = this.navConfig[x];
+ if (path == item.to) {
+ this.navActiveName = x.toString();
+ this.openNames = [x.toString()];
+ this.breadcrumb = [{ to: item.to, title: item.title }];
+ // console.log(this.breadcrumb);
+ return;
+ }
+ //循环二级
+ for (var y = 0; y < item.children.length; y++) {
+ let item2 = item.children[y];
+ if (path == item2.to) {
+ this.navActiveName = x + '-' + y;
+ this.openNames.length = 0;
+ this.openNames.push(x.toString());
+ this.openNames.push(x + '-' + y);
+ this.breadcrumb = [
+ { to: item.to, title: item.title },
+ { to: item2.to, title: item2.title }
+ ];
+ // console.log(this.breadcrumb);
+ return;
+ }
+ //循环三级
+ if (item2.children) {
+ for (var z = 0; z < this.navConfig[x].children[y].children.length; z++) {
+ let item3 = item2.children[z];
+ if (path == item3.to) {
+ this.navActiveName = x + '-' + y;
+ //只保留一二级
+ this.openNames = [x.toString(), x + '-' + y];
+ this.breadcrumb = [
+ { to: item.to, title: item.title },
+ { to: item2.to, title: item2.title }
+ ];
+ // console.log(this.breadcrumb);
+ return;
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ created: function () {
+ this.setNavActive();
+ },
+ watch: {
+ '$route.path'() {
+ this.setNavActive();
+ }
+ },
+ mounted: function () {
+ // console.log(this.accordion);
+ },
+ //计算属性
+ computed: {}
+};
+</script>
\ No newline at end of file
temp/site-admin-iview/main/page/nav.vue 142(+142 -0)
diff --git a/temp/site-admin-iview/main/page/nav.vue b/temp/site-admin-iview/main/page/nav.vue
new file mode 100644
index 0000000..f35019b
--- /dev/null
+++ b/temp/site-admin-iview/main/page/nav.vue
@@ -0,0 +1,142 @@
+<style lang="less">
+//使用ID的目的是为了优先级,覆盖IVIEW样式
+#vue-2018112101 {
+ background-color: #444851;
+ overflow-y: auto;
+ .ivu-menu {
+ .ivu-menu {
+ .ivu-menu-item,
+ .ivu-menu-submenu-title {
+ height: 34px;
+ padding: 0px 15px;
+ line-height: 34px;
+ background-color: #6d707b;
+ font-size: 15px;
+ color: #fff;
+ padding-left: 30px !important;
+ }
+ }
+ background-color: #444851;
+ .ivu-menu-item,
+ .ivu-menu-submenu-title {
+ font-size: 17px;
+ padding: 10px 15px;
+ border-left: #ccc 5px solid;
+ color: #fff;
+ // background-color: #555;
+ }
+ .ivu-menu-item:hover,
+ .ivu-menu-submenu-title:hover {
+ color: #333;
+ border-left: #f90 5px solid;
+ background-color: #fff !important;
+ }
+ .ivu-menu-item-active {
+ .ivu-menu-submenu-title {
+ border-left-color: #f60;
+ background-color: #342f3a;
+ }
+ }
+ .ivu-menu-item-selected {
+ color: #333;
+ border-left: #f90 5px solid;
+ background-color: #fff !important;
+ }
+ }
+ .ivu-menu-opened {
+ .ivu-menu-submenu-title {
+ background-color: #342f3a !important;
+ }
+ }
+
+ .ivu-menu-submenu-title,
+ .ivu-menu-item {
+ padding-right: 10px;
+ }
+ .ivu-menu-submenu-title-icon,
+ .ivu-menu-vertical .ivu-menu-submenu-title-icon {
+ right: 5px !important;
+ }
+ .ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu .ivu-menu-item-active {
+ color: #333;
+ background-color: #fff !important;
+ }
+}
+</style>
+<template>
+ <!--备注-->
+ <div id="vue-2018112101" :style="{width:width}">
+ <Menu theme="dark" :active-name="activeName" :open-names="openNames" :width="width" @on-select="onSelect"
+ :accordion="accordion">
+ <component v-for="(item,index) in navConfig" :key="index"
+ :is="item.children.length == 0 ? MenuItem : Submenu"
+ :to="item.children.length == 0 ? (item.to || '') : ''" :name="''+index"
+ v-if="(!item.isAdmin || $config.isAdmin) && ($config.isDev || !item.isDev)">
+ <template v-if="item.children.length == 0">
+ <Icon v-if="item.icon" :type="item.icon" />{{item.title}}
+ </template>
+ <template v-else slot="title">
+ <Icon v-if="item.icon" :type="item.icon" />{{item.title}}
+ </template>
+ <MenuItem
+ v-if="item.children.length > 0 && (!item_1.isAdmin || $config.isAdmin) && ($config.isDev || !item_1.isDev)"
+ v-for="(item_1,index_1) in item.children" :key="index_1" :name="index+'-'+index_1" :to="item_1.to">
+ <Icon v-if="item_1.icon" :type="item_1.icon" />
+ {{item_1.title}}</MenuItem>
+ </component>
+ </Menu>
+ </div>
+</template>
+<script type="text/javascript">
+import Menu from 'view-design/src/components/menu';
+export default {
+ props: {
+ activeName: {
+ type: String,
+ default: '0-0'
+ },
+ openNames: {
+ type: Array,
+ default() {
+ return [];
+ }
+ },
+ navConfig: {
+ type: Array,
+ default() {
+ return [];
+ }
+ },
+ accordion: {
+ type: Boolean,
+ default: true
+ },
+ /**宽度 */
+ width: {
+ type: String | Number,
+ default: '180px'
+ }
+ },
+ data: function () {
+ return {
+ Menu,
+ MenuGroup: Menu.Group,
+ MenuItem: Menu.Item,
+ Submenu: Menu.Sub
+ };
+ },
+ components: {},
+ methods: {
+ onSelect(name) {
+ this.$emit('on-select', name);
+ }
+ },
+ watch: {
+ openNames(val, oldval) {}
+ },
+ created: function () {},
+ mounted: function () {},
+ //计算属性
+ computed: {}
+};
+</script>
\ No newline at end of file
temp/site-admin-iview/main/page/navSub.vue 59(+59 -0)
diff --git a/temp/site-admin-iview/main/page/navSub.vue b/temp/site-admin-iview/main/page/navSub.vue
new file mode 100644
index 0000000..da8a2f6
--- /dev/null
+++ b/temp/site-admin-iview/main/page/navSub.vue
@@ -0,0 +1,59 @@
+<style lang="less" scoped>
+ .tab-box{
+ background-color: #ffffff;border-bottom: #aaa 1px solid; line-height: 34px;font-size:16px;
+ height: 36px; padding: 0 20px;
+ >div{ float: left; height: 36px; padding: 2px 20px 0 20px; cursor: pointer;}
+ .active{border-bottom: 3px solid #2d8cf0; color: #2d8cf0;}
+ }
+</style>
+<template>
+ <div class="tab-box" v-if="list.length>0">
+ <div v-for="(item,index) in list" @click="onClick(index)" :class="navIndex == index ?'active':''">{{item.title}}
+ </div>
+ </div>
+</template>
+<script type="text/javascript">
+import navConfig from '../config/navConfig.js';
+export default {
+ props: {
+ activeName: {
+ type: String,
+ default: ''
+ }
+ },
+ data() {
+ return {
+ navIndex: 0,
+ navConfig,
+ list: []
+ };
+ },
+ components: {},
+ methods: {
+ setNav(name) {
+ var array = name.split('-');
+ try {
+ let list = this.navConfig[array[0]].children[array[1]].children;
+ this.list = list || [];
+ } catch (ex) {
+ this.list = [];
+ }
+ },
+ onClick(index) {
+ this.navIndex = index;
+ this.$router.push({ path: this.list[this.navIndex].to });
+ }
+ },
+ watch: {
+ activeName(val, oldname) {
+ this.setNav(val);
+ }
+ },
+ created() {
+ this.setNav(this.activeName);
+ },
+ mounted() {},
+ //计算属性
+ computed: {}
+};
+</script>
\ No newline at end of file
temp/site-admin-iview/main/store.js 20(+20 -0)
diff --git a/temp/site-admin-iview/main/store.js b/temp/site-admin-iview/main/store.js
new file mode 100644
index 0000000..033e7f2
--- /dev/null
+++ b/temp/site-admin-iview/main/store.js
@@ -0,0 +1,20 @@
+import { Vue, Vuex } from 'dai-vue';
+Vue.use(Vuex);
+//创建VueX对象
+const store = new Vuex.Store({
+ state: {
+ //用户信息
+ vx_userInfo: {}
+ },
+ getters: {
+ vx_userInfo: (state) => state.vx_userInfo
+ },
+ mutations: {
+ vx_userInfo(state, userInfo) {
+ // 变更状态
+ state.userInfo = userInfo;
+ }
+ }
+});
+
+export default store;
diff --git a/temp/site-admin-iview/main/style.less b/temp/site-admin-iview/main/style.less
new file mode 100644
index 0000000..e38a195
--- /dev/null
+++ b/temp/site-admin-iview/main/style.less
@@ -0,0 +1,6 @@
+//全局样式配置
+@import '~dai-style/src/dai.less';
+@import '~view-design/dist/styles/iview.css';
+@import '~dai-vue-iview/styles/style.less';
+body, td, th, select, input { font-size: 14px; color: #333;}
+body { background-color: #fafafa;}
\ No newline at end of file
temp/site-admin-iview/package.json 17(+17 -0)
diff --git a/temp/site-admin-iview/package.json b/temp/site-admin-iview/package.json
new file mode 100644
index 0000000..1a1028d
--- /dev/null
+++ b/temp/site-admin-iview/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "dai-vue-ivieweee",
+ "type": "module",
+ "version": "1.0.0",
+ "description": "description",
+ "scripts": {
+ "dev": "node ./build/dev.js",
+ "build": "node ./build/build.js"
+ },
+ "author": "description",
+ "license": "ISC",
+ "dependencies": {
+ "dai-vue": "^1.0.23",
+ "dai-vue-iview": "^1.0.1",
+ "view-design": "^4.4.0"
+ }
+}
temp/site-admin-iview/src/api.js 19(+19 -0)
diff --git a/temp/site-admin-iview/src/api.js b/temp/site-admin-iview/src/api.js
new file mode 100644
index 0000000..5d3a2da
--- /dev/null
+++ b/temp/site-admin-iview/src/api.js
@@ -0,0 +1,19 @@
+var test = {
+ $config: {
+ /**读取配置文件中 service 字段,默认 default*/
+ service: 'default',
+ /**基础URL */
+ baseURL: '/test/',
+ /**请求方式,不配置为 payload*/
+ requestType: 'formData'
+ },
+ /**
+ * 接口方法 在 vue 页面中可以使用方法 await this.$api.test.test({});
+ * @param {Object} data
+ * @returns
+ */
+ async test(data) {
+ return await this.$get('test', data);
+ }
+};
+export { test };
temp/site-admin-iview/src/index.js 6(+6 -0)
diff --git a/temp/site-admin-iview/src/index.js b/temp/site-admin-iview/src/index.js
new file mode 100644
index 0000000..cffdb9f
--- /dev/null
+++ b/temp/site-admin-iview/src/index.js
@@ -0,0 +1,6 @@
+import * as api from './api.js';
+import routes from './routes.js';
+export default {
+ api,
+ routes
+};
temp/site-admin-iview/src/page/404.vue 34(+34 -0)
diff --git a/temp/site-admin-iview/src/page/404.vue b/temp/site-admin-iview/src/page/404.vue
new file mode 100644
index 0000000..afaa80d
--- /dev/null
+++ b/temp/site-admin-iview/src/page/404.vue
@@ -0,0 +1,34 @@
+<style scoped>
+.page-404 {
+ text-align: center; padding: 50px 20px 0 20px;color: #999;
+}
+</style>
+<template>
+ <div class="page-404">
+ <div style="font-size:68px;">404</div>
+ <div style="font-size:18px;margin-top:20px;">糟糕,你的页面走丢了!</div>
+ </div>
+</template>
+<script>
+import { mapGetters } from 'vuex';
+export default {
+ mixins: [],
+ components: {},
+ props: [],
+ data: function () {
+ return {};
+ },
+ methods: {
+ async init() {}
+ },
+ watch: {},
+ created() {
+ this.init();
+ },
+ mounted() {},
+ //计算属性
+ computed: {
+ ...mapGetters(['vx_userInfo'])
+ }
+};
+</script>
\ No newline at end of file
temp/site-admin-iview/src/page/daiTc.vue 98(+98 -0)
diff --git a/temp/site-admin-iview/src/page/daiTc.vue b/temp/site-admin-iview/src/page/daiTc.vue
new file mode 100644
index 0000000..df5e7d7
--- /dev/null
+++ b/temp/site-admin-iview/src/page/daiTc.vue
@@ -0,0 +1,98 @@
+<style>
+</style>
+<template>
+ <div class="d-p-10">
+ <div class="d-tc">
+ <div class="tc-title">
+ <div>标题-default</div>
+ <div style="float: right;">右侧功能</div>
+ </div>
+ <div class="tc-cont">内容</div>
+ </div>
+ <div class="d-tc-small d-mt-10">
+ <div class="tc-title">
+ <div>标题-small</div>
+ </div>
+ <div class="tc-cont">内容</div>
+ </div>
+ <div class="d-tc-mini d-mt-10">
+ <div class="tc-title">
+ <div>标题-small</div>
+ </div>
+ <div class="tc-cont">内容</div>
+ </div>
+ <dai-tc title="组件方式" class="d-mt-10">内容</dai-tc>
+ <dai-tc title="组件方式" class="d-mt-10" size="small">
+ <template #title-right>右侧内容</template>
+ <div>内容</div>
+ </dai-tc>
+ <div class="d-box d-mt-10">
+ <div class="d-tab d-box-flex">
+ <div class="d-tab-bar">
+ <div class="d-tab-tab d-tab-tab-active">TAB1</div>
+ <div class="d-tab-tab">TAB2</div>
+ </div>
+ <div class="d-tab-cont">内容</div>
+ </div>
+ <div class="d-tab-small d-box-flex d-ml-10">
+ <div class="d-tab-bar">
+ <div class="d-tab-tab d-tab-tab-active">TAB1</div>
+ <div class="d-tab-tab">TAB2</div>
+ </div>
+ <div class="d-tab-cont">内容</div>
+ </div>
+ <div class="d-tab-mini d-box-flex d-ml-10">
+ <div class="d-tab-bar">
+ <div class="d-tab-tab d-tab-tab-active">TAB1</div>
+ <div class="d-tab-tab">TAB2</div>
+ </div>
+ <div class="d-tab-cont">内容</div>
+ </div>
+ <div class="d-tab-mini d-box-flex d-ml-10">
+ <div class="d-tab-bar">
+ <div class="d-tab-tab d-tab-tab-active">TAB1</div>
+ <div class="d-tab-tab">TAB2</div>
+ </div>
+ <div class="d-tab-cont">内容</div>
+ <div class="d-tab-bar-hr">
+ <div class="d-tab-tab d-tab-tab-active">TAB1</div>
+ <div class="d-tab-tab">TAB2</div>
+ </div>
+ <div class="d-tab-cont">内容</div>
+ </div>
+ </div>
+ <div class="d-box d-mt-10">
+ <Tabs value="name1" class="d-iview-tabs d-box-flex d-iview-tabs-border">
+ <TabPane label="标签一" name="name1">标签一的内容</TabPane>
+ <TabPane label="标签二" name="name2">标签二的内容</TabPane>
+ <TabPane label="标签三" name="name3">标签三的内容</TabPane>
+ <TabPane label="标签一" name="name4">标签一的内容</TabPane>
+ <TabPane label="标签二" name="name5">标签二的内容</TabPane>
+ <TabPane label="标签三" name="name6">标签三的内容</TabPane>
+ <TabPane label="标签一" name="name7">标签一的内容</TabPane>
+ </Tabs>
+ <Tabs value="name1" class="d-iview-tabs-small d-box-flex d-ml-10">
+ <TabPane label="标签一" name="name1">标签一的内容</TabPane>
+ <TabPane label="标签二" name="name2">标签二的内容</TabPane>
+ <TabPane label="标签三" name="name3">标签三的内容</TabPane>
+ <TabPane label="标签一" name="name4">标签一的内容</TabPane>
+ <TabPane label="标签二" name="name5">标签二的内容</TabPane>
+ <TabPane label="标签三" name="name6">标签三的内容</TabPane>
+ <TabPane label="标签一" name="name7">标签一的内容</TabPane>
+ </Tabs>
+ <Tabs value="name1" class="d-iview-tabs-mini d-box-flex d-ml-10">
+ <TabPane label="标签一" name="name1">标签一的内容</TabPane>
+ <TabPane label="标签二" name="name2">标签二的内容</TabPane>
+ <TabPane label="标签三" name="name3">标签三的内容</TabPane>
+ <TabPane label="标签一" name="name4">标签一的内容</TabPane>
+ <TabPane label="标签二" name="name5">标签二的内容</TabPane>
+ <TabPane label="标签三" name="name6">标签三的内容</TabPane>
+ <TabPane label="标签一" name="name7">标签一的内容</TabPane>
+ </Tabs>
+ </div>
+ </div>
+</template>
+
+<script>
+export default {};
+</script>
\ No newline at end of file
temp/site-admin-iview/src/page/dialog.vue 68(+68 -0)
diff --git a/temp/site-admin-iview/src/page/dialog.vue b/temp/site-admin-iview/src/page/dialog.vue
new file mode 100644
index 0000000..ee650e5
--- /dev/null
+++ b/temp/site-admin-iview/src/page/dialog.vue
@@ -0,0 +1,68 @@
+<style lang="less" scoped>
+</style>
+<template>
+ <div style="height:100%;" v-loading="loading" loading-text="加载中..." loading-text-size="15"
+ loading-type="1" :loading-size="160">
+ <div>
+ <Button @click="dialogAlert">Dialog.alert</Button>
+ <Button @click="dialogAlert">Dialog.info</Button>
+ <Button @click="dialogSuccess">Dialog.success</Button>
+ <Button @click="dialogWarning">Dialog.warning</Button>
+ <Button @click="dialogError">Dialog.error</Button>
+ <Button @click="dialogConfirm">Dialog.confirm</Button>
+ <Button @click="dialogInput">Dialog.input</Button>
+ <Button @click="dialogTextarea">Dialog.textarea</Button>
+ </div>
+ </div>
+</template>
+<script type="text/javascript">
+import { Vuex } from 'dai-vue';
+export default {
+ props: {},
+ data() {
+ return {
+ loading: false
+ };
+ },
+ components: {},
+ methods: {
+ async dialogAlert() {
+ await this.$dialog.alert({ title: '提示', content: '内容已经删除!' });
+ },
+ async dialogSuccess() {
+ await this.$dialog.success({ title: '成功', content: '成功' });
+ },
+ async dialogWarning() {
+ await this.$dialog.warning({ title: '警告', content: '警告' });
+ },
+ async dialogError() {
+ await this.$dialog.error({ title: '错误', content: '错误' });
+ },
+ async dialogConfirm() {
+ let b = await this.$dialog.confirm({ title: '提示', content: '是否删除?' });
+ await this.$dialog.alert({ title: '提示', content: b });
+ },
+ async dialogInput() {
+ let text = await this.$dialog.input({ value: '123' });
+ console.log('输入的内容', text);
+ },
+ async dialogTextarea() {
+ let text = await this.$dialog.input({
+ title: '请输入',
+ value: '123',
+ type: 'textarea',
+ rules: [{ required: true, message: '此项为必填', trigger: 'blur,change' }]
+ });
+ console.log('输入的内容', text);
+ }
+ },
+ watch: {},
+ created() {},
+ mounted() {},
+ //计算属性
+ computed: {
+ ...Vuex.mapGetters(['vx_userInfo'])
+ },
+ destroyed() {}
+};
+</script>
\ No newline at end of file
temp/site-admin-iview/src/page/home.vue 28(+28 -0)
diff --git a/temp/site-admin-iview/src/page/home.vue b/temp/site-admin-iview/src/page/home.vue
new file mode 100644
index 0000000..b625459
--- /dev/null
+++ b/temp/site-admin-iview/src/page/home.vue
@@ -0,0 +1,28 @@
+<style lang="less" scoped>
+</style>
+<template>
+ <div style="text-align: center;">
+ <div><img style="width:200px;" src="../static/image/vue-logo.png" /></div>
+ <div style="font-size:28px;">DaiVUE</div>
+ <div>简易VUE网站快速成型框架</div>
+ </div>
+</template>
+<script type="text/javascript">
+import { Vuex } from 'dai-vue';
+export default {
+ props: {},
+ data() {
+ return {};
+ },
+ components: {},
+ methods: {},
+ watch: {},
+ created() {},
+ mounted() {},
+ //计算属性
+ computed: {
+ ...Vuex.mapGetters(['vx_userInfo'])
+ },
+ destroyed() {}
+};
+</script>
\ No newline at end of file
temp/site-admin-iview/src/page/loading.vue 46(+46 -0)
diff --git a/temp/site-admin-iview/src/page/loading.vue b/temp/site-admin-iview/src/page/loading.vue
new file mode 100644
index 0000000..2e1b9e2
--- /dev/null
+++ b/temp/site-admin-iview/src/page/loading.vue
@@ -0,0 +1,46 @@
+<style lang="less" scoped>
+</style>
+<template>
+ <div style="height:100%;" v-loading="loading" loading-text="加载中..." loading-text-size="15"
+ loading-type="1" :loading-size="160">
+ <div>
+ <Button @click="openLoading">打开loading</Button>
+ <Button @click="fullLoading">全屏loading</Button>
+ </div>
+ </div>
+</template>
+<script type="text/javascript">
+import { Vuex } from 'dai-vue';
+export default {
+ props: {},
+ data() {
+ return {
+ loading: false
+ };
+ },
+ components: {},
+ methods: {
+ openLoading() {
+ this.loading = true;
+ setTimeout(() => {
+ this.loading = false;
+ }, 3000);
+ },
+ fullLoading() {
+ let load = this.$loading({ text: '载入中....', type: 1 });
+ setTimeout(() => {
+ // load.remove();
+ this.$loading.remove();
+ }, 3000);
+ }
+ },
+ watch: {},
+ created() {},
+ mounted() {},
+ //计算属性
+ computed: {
+ ...Vuex.mapGetters(['vx_userInfo'])
+ },
+ destroyed() {}
+};
+</script>
\ No newline at end of file
temp/site-admin-iview/src/page/routerMap.vue 56(+56 -0)
diff --git a/temp/site-admin-iview/src/page/routerMap.vue b/temp/site-admin-iview/src/page/routerMap.vue
new file mode 100644
index 0000000..2802682
--- /dev/null
+++ b/temp/site-admin-iview/src/page/routerMap.vue
@@ -0,0 +1,56 @@
+<style lang="less" scoped>
+.page-map {
+ color: #333;
+}
+</style>
+<template>
+ <div class="page-map">
+ <route-item :route="item" v-for="(item,index) in list" :key="index"></route-item>
+ </div>
+</template>
+<script>
+import { mapGetters } from 'vuex';
+
+export default {
+ mixins: [],
+ components: {
+ 'route-item': {
+ name: 'route-item',
+ props: {
+ route: {
+ type: Object,
+ default() {
+ return {};
+ }
+ },
+ base: {
+ type: String,
+ default: ''
+ }
+ },
+ template:
+ '<div style="padding-left:20px;"><div @click="$router.push({path:base + route.path})">{{route.meta && route.meta.pageName || route.path}}({{base + route.path}})</div><route-item :base="base + route.path" :route="item" v-for="(item,index) in route.children" :key="index"></route-item></div>'
+ }
+ },
+ props: [],
+ data: function () {
+ return {
+ list: []
+ };
+ },
+ methods: {
+ async init() {
+ this.list = this.$router.options.routes;
+ }
+ },
+ watch: {},
+ created() {
+ this.init();
+ },
+ mounted() {},
+ //计算属性
+ computed: {
+ ...mapGetters(['vx_userInfo'])
+ }
+};
+</script>
\ No newline at end of file
temp/site-admin-iview/src/routes.js 9(+9 -0)
diff --git a/temp/site-admin-iview/src/routes.js b/temp/site-admin-iview/src/routes.js
new file mode 100644
index 0000000..d748572
--- /dev/null
+++ b/temp/site-admin-iview/src/routes.js
@@ -0,0 +1,9 @@
+const routes = [
+ { path: '', component: () => import('./page/home.vue'), meta: { pageName: '首页' } },
+ { path: 'routerMap', component: () => import('./page/routerMap.vue'), meta: { pageName: '网站地图' } },
+ { path: 'demo/dialog', component: () => import('./page/dialog.vue'), meta: { pageName: '弹出层(dialog)' } },
+ { path: 'demo/loading', component: () => import('./page/loading.vue'), meta: { pageName: '加载(loading)' } },
+ { path: 'demo/daiTc', component: () => import('./page/daiTc.vue'), meta: { pageName: '标题内容(dai-tc)' } },
+ { path: '*', component: () => import('./page/404.vue'), meta: { pageName: '404' } }
+];
+export default routes;
diff --git a/temp/site-admin-iview/src/static/image/vue-logo.png b/temp/site-admin-iview/src/static/image/vue-logo.png
new file mode 100644
index 0000000..102329c
Binary files /dev/null and b/temp/site-admin-iview/src/static/image/vue-logo.png differ
diff --git a/temp/site-admin-iview/src/static/style/style.less b/temp/site-admin-iview/src/static/style/style.less
new file mode 100644
index 0000000..b5736f8
--- /dev/null
+++ b/temp/site-admin-iview/src/static/style/style.less
@@ -0,0 +1,4 @@
+//模块内样式
+.module-test{
+
+}
\ No newline at end of file
temp/site-admin-iview/types/type.d.ts 154(+154 -0)
diff --git a/temp/site-admin-iview/types/type.d.ts b/temp/site-admin-iview/types/type.d.ts
new file mode 100644
index 0000000..4c078d4
--- /dev/null
+++ b/temp/site-admin-iview/types/type.d.ts
@@ -0,0 +1,154 @@
+declare module uni {
+ // /**
+ // * 保留当前页面,跳转到应用内的某个页面,使用uni.navigateBack可以返回到原页面。
+ // * @param object
+ // */
+ function navigateTo(object: object);
+ /**
+ * 关闭当前页面,跳转到应用内的某个页面。
+ * @param object
+ */
+ function redirectTo(object: object);
+ /**
+ * 关闭所有页面,打开到应用内的某个页面。
+ * @param object
+ */
+ function reLaunch(object: object);
+ /**
+ * 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面
+ * @param object
+ */
+ function switchTab(object: object);
+ /**
+ * 关闭当前页面,返回上一页面或多级页面。
+ * @param object
+ */
+ function navigateBack(object: object): null;
+ /**
+ * 预加载页面,是一种性能优化技术。被预载的页面,在打开时速度更快。
+ * @param object {Object}
+ */
+ function preloadPage(object: object);
+ /**
+ * 将数据存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个异步接口。
+ * @param object
+ */
+ function setStorage(object: object);
+ /**
+ * 将 data 存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个同步接口。
+ * @param key
+ * @param value
+ */
+ function setStorageSync(key: string, value: string);
+ /**
+ * 从本地缓存中异步获取指定 key 对应的内容。
+ * @param object
+ */
+ function getStorage(object: object);
+ /**
+ * 从本地缓存中同步获取指定 key 对应的内容。
+ * @param key
+ */
+ function getStorageSync(key: string): string;
+ /**
+ * 异步获取当前 storage 的相关信息。
+ * @param object
+ */
+ function getStorageInfo(object: object);
+ /**
+ * 同步获取当前 storage 的相关信息。
+ * @param object
+ */
+ function getStorageInfoSync(object: string): object;
+ /**
+ * 从本地缓存中异步移除指定 key。
+ * @param object
+ */
+ function removeStorage(object: object);
+ /**
+ * 从本地缓存中同步移除指定 key。
+ * @param object
+ */
+ function removeStorageSync(object: object);
+ /**
+ * 同步清理本地数据缓存。
+ * @param object
+ */
+ function clearStorage(object: object);
+ /**
+ * 同步清理本地数据缓存。
+ * @param object
+ */
+ function clearStorageSync(object: object);
+ /**
+ * 获取当前的地理位置、速度。 在微信小程序中,当用户离开应用后,此接口无法调用,除非申请后台持续定位权限;当用户点击“显示在聊天顶部”时,此接口可继续调用。
+ * @param object
+ */
+ function getLocation(object: object);
+ /**
+ * 打开地图选择位置。
+ * @param object
+ */
+ function chooseLocation(object: object);
+ /**
+ * 使用应用内置地图查看位置。
+ * @param object
+ */
+ function openLocation(object: object);
+ /**
+ * 显示消息提示框。
+ * @param object
+ */
+ function showToast(object: object);
+ /**
+ * 隐藏消息框
+ * @param object
+ */
+ function hideToast(object: object);
+ /**
+ * 显示 loading 提示框, 需主动调用 uni.hideLoading 才能关闭提示框。
+ * @param object
+ */
+ function showLoading(object: object);
+ /**
+ * 隐藏 loading 提示框。
+ * @param object
+ */
+ function hideLoading(object: object);
+ /**
+ * 显示模态弹窗,可以只有一个确定按钮,也可以同时有确定和取消按钮。类似于一个API整合了 html 中:alert、confirm。
+ * @param object
+ */
+ function showModal(object: object);
+ /**
+ * 从底部向上弹出操作菜单
+ * @param object
+ */
+ function showActionSheet(object: object);
+ /**
+ * 动态设置当前页面的标题。
+ * @param object
+ */
+ function setNavigationBarTitle(object: object);
+ /**
+ * 设置页面导航条颜色。如果需要进入页面就设置颜色,请延迟执行,防止被框架内设置颜色逻辑覆盖
+ * @param object
+ */
+ function setNavigationBarColor(object: object);
+ /**
+ * 在当前页面显示导航条加载动画。
+ * @param object
+ */
+ function showNavigationBarLoading(object: object);
+ /**
+ * 在当前页面隐藏导航条加载动画。
+ * @param object
+ */
+ function hideNavigationBarLoading(object: object);
+ /**
+ * 隐藏返回首页按钮。
+ * @param object
+ */
+ function hideHomeButton(object: object);
+ function xxxxxxxxx(object: object);
+}
temp/site-m/.babelrc 4(+4 -0)
diff --git a/temp/site-m/.babelrc b/temp/site-m/.babelrc
new file mode 100644
index 0000000..3364bf8
--- /dev/null
+++ b/temp/site-m/.babelrc
@@ -0,0 +1,4 @@
+{
+ "presets": ["@babel/preset-env"],
+ "plugins": ["@babel/plugin-transform-runtime", "@babel/plugin-proposal-class-properties"]
+}
temp/site-m/.gitignore 4(+4 -0)
diff --git a/temp/site-m/.gitignore b/temp/site-m/.gitignore
new file mode 100644
index 0000000..8a8eb06
--- /dev/null
+++ b/temp/site-m/.gitignore
@@ -0,0 +1,4 @@
+node_modules/
+dist/
+package-lock.json
+.vscode/
\ No newline at end of file
temp/site-m/.prettierrc 16(+16 -0)
diff --git a/temp/site-m/.prettierrc b/temp/site-m/.prettierrc
new file mode 100644
index 0000000..6c1a4ff
--- /dev/null
+++ b/temp/site-m/.prettierrc
@@ -0,0 +1,16 @@
+{
+ "printWidth": 120,
+ "tabWidth": 4,
+ "semi": true,
+ "singleQuote": true,
+ "trailingComma": "none",
+ "bracketSpacing": true,
+ "jsxBracketSameLine": false,
+ "arrowParens": "always",
+ "requirePragma": false,
+ "proseWrap": "preserve",
+ "stylelintIntegration": true,
+ "stylelint.config": {
+ "indentation": 2
+ }
+}
temp/site-m/build/build.js 3(+3 -0)
diff --git a/temp/site-m/build/build.js b/temp/site-m/build/build.js
new file mode 100644
index 0000000..a7dd1c9
--- /dev/null
+++ b/temp/site-m/build/build.js
@@ -0,0 +1,3 @@
+import webpackBuild from 'dai-vue/src/build/webpack.build.js';
+import config from './config.js';
+webpackBuild(config);
temp/site-m/build/config.js 22(+22 -0)
diff --git a/temp/site-m/build/config.js b/temp/site-m/build/config.js
new file mode 100644
index 0000000..ede94b8
--- /dev/null
+++ b/temp/site-m/build/config.js
@@ -0,0 +1,22 @@
+import path from "path"
+const __dirname = path.resolve();
+export default {
+ port: 8090,
+ //打包目标目录
+ buildPath: './dist/',
+ //拷贝目录及文件
+ copy: [
+ {
+ //源目录/文件
+ from: './html',
+ //目标目录/文件
+ to: './dist/html',
+ ignore: ['.*']
+ }
+ ],
+ webpack: {
+ devServer: {
+ sockHost: '192.168.88.88'
+ }
+ }
+};
temp/site-m/build/dev.js 3(+3 -0)
diff --git a/temp/site-m/build/dev.js b/temp/site-m/build/dev.js
new file mode 100644
index 0000000..d55bfbe
--- /dev/null
+++ b/temp/site-m/build/dev.js
@@ -0,0 +1,3 @@
+import webpackDev from 'dai-vue/src/build/webpack.dev.js';
+import config from './config.js';
+webpackDev(config);
temp/site-m/desktop.ini 6(+6 -0)
diff --git a/temp/site-m/desktop.ini b/temp/site-m/desktop.ini
new file mode 100644
index 0000000..6d58c28
--- /dev/null
+++ b/temp/site-m/desktop.ini
@@ -0,0 +1,6 @@
+[.ShellClassInfo]
+InfoTip=DaiVue ����Ŀģ��
+[ViewState]
+Mode=
+Vid=
+FolderType=Generic
temp/site-m/main/config/config.js 33(+33 -0)
diff --git a/temp/site-m/main/config/config.js b/temp/site-m/main/config/config.js
new file mode 100644
index 0000000..466867b
--- /dev/null
+++ b/temp/site-m/main/config/config.js
@@ -0,0 +1,33 @@
+import extend from 'extend2';
+import configTest from './configTest.js';
+import configDev from './configDev.js';
+import configPro from './configPro.js';
+
+var config = {};
+var env = process.env.NODE_ENV;
+var hostname = window.location.hostname.toLowerCase();
+
+//根据域名判断
+if (
+ hostname.indexOf('127.0.0.1') === 0 ||
+ hostname.indexOf('192.168') === 0 ||
+ hostname.indexOf('dev.') === 0 ||
+ hostname == 'localhost'
+) {
+ env = 'development';
+} else if (hostname.indexOf('test.') === 0) {
+ env = 'test';
+}
+
+//合并配置
+if (env == 'development') {
+ config = extend(true, {}, configPro, configDev);
+ config.isDev = true;
+} else if (env == 'test') {
+ config = extend(true, {}, configPro, configTest);
+ config.isDev = true;
+} else {
+ config = extend(true, {}, configPro);
+ config.isDev = false;
+}
+export default config;
temp/site-m/main/config/configDev.js 9(+9 -0)
diff --git a/temp/site-m/main/config/configDev.js b/temp/site-m/main/config/configDev.js
new file mode 100644
index 0000000..4c18249
--- /dev/null
+++ b/temp/site-m/main/config/configDev.js
@@ -0,0 +1,9 @@
+/**
+ * 开发环境配置
+ */
+const config = {
+ isDev: true,
+ service: {}
+};
+
+export default config;
temp/site-m/main/config/configPro.js 12(+12 -0)
diff --git a/temp/site-m/main/config/configPro.js b/temp/site-m/main/config/configPro.js
new file mode 100644
index 0000000..05f5aff
--- /dev/null
+++ b/temp/site-m/main/config/configPro.js
@@ -0,0 +1,12 @@
+var config = {
+ //是否开发模式
+ isDev: false,
+ domain: 'http://localhost:8080',
+ //版本
+ version: '1.0.0',
+ //接口服务配置
+ service: {
+ default: 'http://192.168.88.88:8010'
+ }
+};
+export default config;
\ No newline at end of file
temp/site-m/main/config/configTest.js 10(+10 -0)
diff --git a/temp/site-m/main/config/configTest.js b/temp/site-m/main/config/configTest.js
new file mode 100644
index 0000000..b04a19e
--- /dev/null
+++ b/temp/site-m/main/config/configTest.js
@@ -0,0 +1,10 @@
+/**
+ * 开发环境配置
+ */
+const config = {
+ //是否开发模式
+ isDev: false,
+ service: {}
+};
+
+export default config;
temp/site-m/main/favicon.ico 0(+0 -0)
diff --git a/temp/site-m/main/favicon.ico b/temp/site-m/main/favicon.ico
new file mode 100644
index 0000000..0eed320
Binary files /dev/null and b/temp/site-m/main/favicon.ico differ
temp/site-m/main/index.html 20(+20 -0)
diff --git a/temp/site-m/main/index.html b/temp/site-m/main/index.html
new file mode 100644
index 0000000..b6f1c3e
--- /dev/null
+++ b/temp/site-m/main/index.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta
+ name="viewport"
+ content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"
+ />
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <!-- 禁止缓存 -->
+ <!-- <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
+ <meta http-equiv="Pragma" content="no-cache" />
+ <meta http-equiv="Expires" content="0" /> -->
+ <title><%= htmlWebpackPlugin.options.title %></title>
+ </head>
+ <body>
+ <div id="dai-app" class="dai-app d-box-v">
+ <router-view class="d-box-flex"></router-view>
+ </div>
+ </body>
+</html>
temp/site-m/main/index.js 41(+41 -0)
diff --git a/temp/site-m/main/index.js b/temp/site-m/main/index.js
new file mode 100644
index 0000000..c4a461e
--- /dev/null
+++ b/temp/site-m/main/index.js
@@ -0,0 +1,41 @@
+import { DaiVue, Vuex } from 'dai-vue';
+import * as modules from './modules.js';
+import config from './config/config.js';
+import interceptor from './interceptor.js';
+import store from './store.js';
+
+import './style.less';
+
+var vm = DaiVue(
+ {
+ store,
+ data() {
+ return {};
+ },
+ methods: {},
+ created: function () {},
+ watch: {},
+ components: {},
+ //计算属性
+ computed: {
+ ...Vuex.mapGetters(['vx_userInfo'])
+ }
+ },
+ {
+ //全局配置
+ config,
+ //引用的所有模块
+ modules: modules,
+ //主路由模块,可以是一个布局模块
+ main: { template: '<keep-alive><router-view></router-view></keep-alive>' },
+ use: {
+ // Vant: { plugin: Vant }
+ },
+ //http 拦截器
+ interceptor
+ }
+);
+
+//挂载VUE
+vm.$mount('#dai-app');
+window.baseVue = vm;
temp/site-m/main/interceptor.js 62(+62 -0)
diff --git a/temp/site-m/main/interceptor.js b/temp/site-m/main/interceptor.js
new file mode 100644
index 0000000..a14f0aa
--- /dev/null
+++ b/temp/site-m/main/interceptor.js
@@ -0,0 +1,62 @@
+const interceptor = {
+ //请求拦截
+ request(options) {
+ options.headers.token = localStorage.getItem('token');
+ },
+ //响应拦截
+ response(response, options) {
+ let obj = { isErr: false, data: '' };
+ if (response.status == '200') {
+ var json = response.data;
+ if (json.isErr) {
+ //如果显示错误信息,弹出错误,否则继续执行
+ if (options.showMsg) {
+ options.onError(this, '错误', json.errMsg);
+ this.$vue.$Notice.error({
+ title: '错误',
+ desc: json.errMsg
+ });
+ console.error(json.errMsg);
+ obj.isErr = true;
+ obj.data = json;
+ return obj;
+ } else {
+ //继续执行,内部处理错误
+ obj.isErr = false;
+ obj.data = json;
+ return obj;
+ }
+ } else {
+ //当现实返回消息时
+ if (options.showMsg) {
+ if (json.msg) {
+ // options.onMessage(this, '消息', json.msg);
+ this.$vue.$Notice.success({
+ title: json.msg,
+ // desc: nodesc ? '' : 'Here is the notification description. Here is the notification description. '
+ });
+ }
+ obj.isErr = false;
+ obj.data = json.data;
+ return obj;
+ }
+ //当不现实返回消息时
+ else {
+ obj.isErr = false;
+ obj.data = json;
+ return obj;
+ }
+ }
+ } else {
+ console.error(response);
+ if (options.showMsg) {
+ options.onError(this, '网络错误', '请联系管理员解决');
+ }
+ obj.isErr = true;
+ obj.data = '网络错误';
+ return obj;
+ }
+ return obj;
+ }
+};
+export default interceptor;
\ No newline at end of file
temp/site-m/main/modules.js 2(+2 -0)
diff --git a/temp/site-m/main/modules.js b/temp/site-m/main/modules.js
new file mode 100644
index 0000000..316032a
--- /dev/null
+++ b/temp/site-m/main/modules.js
@@ -0,0 +1,2 @@
+import main from '../src/index.js';
+export { main };
temp/site-m/main/store.js 20(+20 -0)
diff --git a/temp/site-m/main/store.js b/temp/site-m/main/store.js
new file mode 100644
index 0000000..033e7f2
--- /dev/null
+++ b/temp/site-m/main/store.js
@@ -0,0 +1,20 @@
+import { Vue, Vuex } from 'dai-vue';
+Vue.use(Vuex);
+//创建VueX对象
+const store = new Vuex.Store({
+ state: {
+ //用户信息
+ vx_userInfo: {}
+ },
+ getters: {
+ vx_userInfo: (state) => state.vx_userInfo
+ },
+ mutations: {
+ vx_userInfo(state, userInfo) {
+ // 变更状态
+ state.userInfo = userInfo;
+ }
+ }
+});
+
+export default store;
temp/site-m/main/style.less 2(+2 -0)
diff --git a/temp/site-m/main/style.less b/temp/site-m/main/style.less
new file mode 100644
index 0000000..332f5b2
--- /dev/null
+++ b/temp/site-m/main/style.less
@@ -0,0 +1,2 @@
+//全局样式配置
+// @import '~dai-style/src/dai.less';
temp/site-m/package.json 16(+16 -0)
diff --git a/temp/site-m/package.json b/temp/site-m/package.json
new file mode 100644
index 0000000..97badd2
--- /dev/null
+++ b/temp/site-m/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "dai-vue-temp-m",
+ "type": "module",
+ "version": "1.0.0",
+ "description": "dai-vue",
+ "main": "src/index.js",
+ "scripts": {
+ "dev": "node ./build/dev.js",
+ "build": "node ./build/build.js"
+ },
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "dai-vue": "^1.0.15"
+ }
+}
temp/site-m/src/api.js 19(+19 -0)
diff --git a/temp/site-m/src/api.js b/temp/site-m/src/api.js
new file mode 100644
index 0000000..5d3a2da
--- /dev/null
+++ b/temp/site-m/src/api.js
@@ -0,0 +1,19 @@
+var test = {
+ $config: {
+ /**读取配置文件中 service 字段,默认 default*/
+ service: 'default',
+ /**基础URL */
+ baseURL: '/test/',
+ /**请求方式,不配置为 payload*/
+ requestType: 'formData'
+ },
+ /**
+ * 接口方法 在 vue 页面中可以使用方法 await this.$api.test.test({});
+ * @param {Object} data
+ * @returns
+ */
+ async test(data) {
+ return await this.$get('test', data);
+ }
+};
+export { test };
temp/site-m/src/index.js 6(+6 -0)
diff --git a/temp/site-m/src/index.js b/temp/site-m/src/index.js
new file mode 100644
index 0000000..cffdb9f
--- /dev/null
+++ b/temp/site-m/src/index.js
@@ -0,0 +1,6 @@
+import * as api from './api.js';
+import routes from './routes.js';
+export default {
+ api,
+ routes
+};
temp/site-m/src/page/404.vue 34(+34 -0)
diff --git a/temp/site-m/src/page/404.vue b/temp/site-m/src/page/404.vue
new file mode 100644
index 0000000..afaa80d
--- /dev/null
+++ b/temp/site-m/src/page/404.vue
@@ -0,0 +1,34 @@
+<style scoped>
+.page-404 {
+ text-align: center; padding: 50px 20px 0 20px;color: #999;
+}
+</style>
+<template>
+ <div class="page-404">
+ <div style="font-size:68px;">404</div>
+ <div style="font-size:18px;margin-top:20px;">糟糕,你的页面走丢了!</div>
+ </div>
+</template>
+<script>
+import { mapGetters } from 'vuex';
+export default {
+ mixins: [],
+ components: {},
+ props: [],
+ data: function () {
+ return {};
+ },
+ methods: {
+ async init() {}
+ },
+ watch: {},
+ created() {
+ this.init();
+ },
+ mounted() {},
+ //计算属性
+ computed: {
+ ...mapGetters(['vx_userInfo'])
+ }
+};
+</script>
\ No newline at end of file
temp/site-m/src/page/home.vue 28(+28 -0)
diff --git a/temp/site-m/src/page/home.vue b/temp/site-m/src/page/home.vue
new file mode 100644
index 0000000..b625459
--- /dev/null
+++ b/temp/site-m/src/page/home.vue
@@ -0,0 +1,28 @@
+<style lang="less" scoped>
+</style>
+<template>
+ <div style="text-align: center;">
+ <div><img style="width:200px;" src="../static/image/vue-logo.png" /></div>
+ <div style="font-size:28px;">DaiVUE</div>
+ <div>简易VUE网站快速成型框架</div>
+ </div>
+</template>
+<script type="text/javascript">
+import { Vuex } from 'dai-vue';
+export default {
+ props: {},
+ data() {
+ return {};
+ },
+ components: {},
+ methods: {},
+ watch: {},
+ created() {},
+ mounted() {},
+ //计算属性
+ computed: {
+ ...Vuex.mapGetters(['vx_userInfo'])
+ },
+ destroyed() {}
+};
+</script>
\ No newline at end of file
temp/site-m/src/page/routerMap.vue 56(+56 -0)
diff --git a/temp/site-m/src/page/routerMap.vue b/temp/site-m/src/page/routerMap.vue
new file mode 100644
index 0000000..2802682
--- /dev/null
+++ b/temp/site-m/src/page/routerMap.vue
@@ -0,0 +1,56 @@
+<style lang="less" scoped>
+.page-map {
+ color: #333;
+}
+</style>
+<template>
+ <div class="page-map">
+ <route-item :route="item" v-for="(item,index) in list" :key="index"></route-item>
+ </div>
+</template>
+<script>
+import { mapGetters } from 'vuex';
+
+export default {
+ mixins: [],
+ components: {
+ 'route-item': {
+ name: 'route-item',
+ props: {
+ route: {
+ type: Object,
+ default() {
+ return {};
+ }
+ },
+ base: {
+ type: String,
+ default: ''
+ }
+ },
+ template:
+ '<div style="padding-left:20px;"><div @click="$router.push({path:base + route.path})">{{route.meta && route.meta.pageName || route.path}}({{base + route.path}})</div><route-item :base="base + route.path" :route="item" v-for="(item,index) in route.children" :key="index"></route-item></div>'
+ }
+ },
+ props: [],
+ data: function () {
+ return {
+ list: []
+ };
+ },
+ methods: {
+ async init() {
+ this.list = this.$router.options.routes;
+ }
+ },
+ watch: {},
+ created() {
+ this.init();
+ },
+ mounted() {},
+ //计算属性
+ computed: {
+ ...mapGetters(['vx_userInfo'])
+ }
+};
+</script>
\ No newline at end of file
temp/site-m/src/routes.js 6(+6 -0)
diff --git a/temp/site-m/src/routes.js b/temp/site-m/src/routes.js
new file mode 100644
index 0000000..b1134fa
--- /dev/null
+++ b/temp/site-m/src/routes.js
@@ -0,0 +1,6 @@
+const routes = [
+ { path: '', component: () => import('./page/home.vue'), meta: { pageName: '首页' } },
+ { path: 'routerMap', component: () => import('./page/routerMap.vue'), meta: { pageName: '网站地图' } },
+ { path: '*', component: () => import('./page/404.vue'), meta: { pageName: '404' } },
+];
+export default routes;
diff --git a/temp/site-m/src/static/image/vue-logo.png b/temp/site-m/src/static/image/vue-logo.png
new file mode 100644
index 0000000..102329c
Binary files /dev/null and b/temp/site-m/src/static/image/vue-logo.png differ
diff --git a/temp/site-m/src/static/style/style.less b/temp/site-m/src/static/style/style.less
new file mode 100644
index 0000000..b5736f8
--- /dev/null
+++ b/temp/site-m/src/static/style/style.less
@@ -0,0 +1,4 @@
+//模块内样式
+.module-test{
+
+}
\ No newline at end of file
temp/site-m/types/type.d.ts 154(+154 -0)
diff --git a/temp/site-m/types/type.d.ts b/temp/site-m/types/type.d.ts
new file mode 100644
index 0000000..4c078d4
--- /dev/null
+++ b/temp/site-m/types/type.d.ts
@@ -0,0 +1,154 @@
+declare module uni {
+ // /**
+ // * 保留当前页面,跳转到应用内的某个页面,使用uni.navigateBack可以返回到原页面。
+ // * @param object
+ // */
+ function navigateTo(object: object);
+ /**
+ * 关闭当前页面,跳转到应用内的某个页面。
+ * @param object
+ */
+ function redirectTo(object: object);
+ /**
+ * 关闭所有页面,打开到应用内的某个页面。
+ * @param object
+ */
+ function reLaunch(object: object);
+ /**
+ * 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面
+ * @param object
+ */
+ function switchTab(object: object);
+ /**
+ * 关闭当前页面,返回上一页面或多级页面。
+ * @param object
+ */
+ function navigateBack(object: object): null;
+ /**
+ * 预加载页面,是一种性能优化技术。被预载的页面,在打开时速度更快。
+ * @param object {Object}
+ */
+ function preloadPage(object: object);
+ /**
+ * 将数据存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个异步接口。
+ * @param object
+ */
+ function setStorage(object: object);
+ /**
+ * 将 data 存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个同步接口。
+ * @param key
+ * @param value
+ */
+ function setStorageSync(key: string, value: string);
+ /**
+ * 从本地缓存中异步获取指定 key 对应的内容。
+ * @param object
+ */
+ function getStorage(object: object);
+ /**
+ * 从本地缓存中同步获取指定 key 对应的内容。
+ * @param key
+ */
+ function getStorageSync(key: string): string;
+ /**
+ * 异步获取当前 storage 的相关信息。
+ * @param object
+ */
+ function getStorageInfo(object: object);
+ /**
+ * 同步获取当前 storage 的相关信息。
+ * @param object
+ */
+ function getStorageInfoSync(object: string): object;
+ /**
+ * 从本地缓存中异步移除指定 key。
+ * @param object
+ */
+ function removeStorage(object: object);
+ /**
+ * 从本地缓存中同步移除指定 key。
+ * @param object
+ */
+ function removeStorageSync(object: object);
+ /**
+ * 同步清理本地数据缓存。
+ * @param object
+ */
+ function clearStorage(object: object);
+ /**
+ * 同步清理本地数据缓存。
+ * @param object
+ */
+ function clearStorageSync(object: object);
+ /**
+ * 获取当前的地理位置、速度。 在微信小程序中,当用户离开应用后,此接口无法调用,除非申请后台持续定位权限;当用户点击“显示在聊天顶部”时,此接口可继续调用。
+ * @param object
+ */
+ function getLocation(object: object);
+ /**
+ * 打开地图选择位置。
+ * @param object
+ */
+ function chooseLocation(object: object);
+ /**
+ * 使用应用内置地图查看位置。
+ * @param object
+ */
+ function openLocation(object: object);
+ /**
+ * 显示消息提示框。
+ * @param object
+ */
+ function showToast(object: object);
+ /**
+ * 隐藏消息框
+ * @param object
+ */
+ function hideToast(object: object);
+ /**
+ * 显示 loading 提示框, 需主动调用 uni.hideLoading 才能关闭提示框。
+ * @param object
+ */
+ function showLoading(object: object);
+ /**
+ * 隐藏 loading 提示框。
+ * @param object
+ */
+ function hideLoading(object: object);
+ /**
+ * 显示模态弹窗,可以只有一个确定按钮,也可以同时有确定和取消按钮。类似于一个API整合了 html 中:alert、confirm。
+ * @param object
+ */
+ function showModal(object: object);
+ /**
+ * 从底部向上弹出操作菜单
+ * @param object
+ */
+ function showActionSheet(object: object);
+ /**
+ * 动态设置当前页面的标题。
+ * @param object
+ */
+ function setNavigationBarTitle(object: object);
+ /**
+ * 设置页面导航条颜色。如果需要进入页面就设置颜色,请延迟执行,防止被框架内设置颜色逻辑覆盖
+ * @param object
+ */
+ function setNavigationBarColor(object: object);
+ /**
+ * 在当前页面显示导航条加载动画。
+ * @param object
+ */
+ function showNavigationBarLoading(object: object);
+ /**
+ * 在当前页面隐藏导航条加载动画。
+ * @param object
+ */
+ function hideNavigationBarLoading(object: object);
+ /**
+ * 隐藏返回首页按钮。
+ * @param object
+ */
+ function hideHomeButton(object: object);
+ function xxxxxxxxx(object: object);
+}
temp/site-w/.babelrc 4(+4 -0)
diff --git a/temp/site-w/.babelrc b/temp/site-w/.babelrc
new file mode 100644
index 0000000..3364bf8
--- /dev/null
+++ b/temp/site-w/.babelrc
@@ -0,0 +1,4 @@
+{
+ "presets": ["@babel/preset-env"],
+ "plugins": ["@babel/plugin-transform-runtime", "@babel/plugin-proposal-class-properties"]
+}
temp/site-w/.gitignore 4(+4 -0)
diff --git a/temp/site-w/.gitignore b/temp/site-w/.gitignore
new file mode 100644
index 0000000..8a8eb06
--- /dev/null
+++ b/temp/site-w/.gitignore
@@ -0,0 +1,4 @@
+node_modules/
+dist/
+package-lock.json
+.vscode/
\ No newline at end of file
temp/site-w/.prettierrc 16(+16 -0)
diff --git a/temp/site-w/.prettierrc b/temp/site-w/.prettierrc
new file mode 100644
index 0000000..6c1a4ff
--- /dev/null
+++ b/temp/site-w/.prettierrc
@@ -0,0 +1,16 @@
+{
+ "printWidth": 120,
+ "tabWidth": 4,
+ "semi": true,
+ "singleQuote": true,
+ "trailingComma": "none",
+ "bracketSpacing": true,
+ "jsxBracketSameLine": false,
+ "arrowParens": "always",
+ "requirePragma": false,
+ "proseWrap": "preserve",
+ "stylelintIntegration": true,
+ "stylelint.config": {
+ "indentation": 2
+ }
+}
temp/site-w/build/build.js 3(+3 -0)
diff --git a/temp/site-w/build/build.js b/temp/site-w/build/build.js
new file mode 100644
index 0000000..a7dd1c9
--- /dev/null
+++ b/temp/site-w/build/build.js
@@ -0,0 +1,3 @@
+import webpackBuild from 'dai-vue/src/build/webpack.build.js';
+import config from './config.js';
+webpackBuild(config);
temp/site-w/build/config.js 22(+22 -0)
diff --git a/temp/site-w/build/config.js b/temp/site-w/build/config.js
new file mode 100644
index 0000000..ede94b8
--- /dev/null
+++ b/temp/site-w/build/config.js
@@ -0,0 +1,22 @@
+import path from "path"
+const __dirname = path.resolve();
+export default {
+ port: 8090,
+ //打包目标目录
+ buildPath: './dist/',
+ //拷贝目录及文件
+ copy: [
+ {
+ //源目录/文件
+ from: './html',
+ //目标目录/文件
+ to: './dist/html',
+ ignore: ['.*']
+ }
+ ],
+ webpack: {
+ devServer: {
+ sockHost: '192.168.88.88'
+ }
+ }
+};
temp/site-w/build/dev.js 3(+3 -0)
diff --git a/temp/site-w/build/dev.js b/temp/site-w/build/dev.js
new file mode 100644
index 0000000..d55bfbe
--- /dev/null
+++ b/temp/site-w/build/dev.js
@@ -0,0 +1,3 @@
+import webpackDev from 'dai-vue/src/build/webpack.dev.js';
+import config from './config.js';
+webpackDev(config);
temp/site-w/desktop.ini 6(+6 -0)
diff --git a/temp/site-w/desktop.ini b/temp/site-w/desktop.ini
new file mode 100644
index 0000000..a0d6bfe
--- /dev/null
+++ b/temp/site-w/desktop.ini
@@ -0,0 +1,6 @@
+[.ShellClassInfo]
+InfoTip=DaiVue ��PC����Ŀģ��
+[ViewState]
+Mode=
+Vid=
+FolderType=Generic
temp/site-w/main/config/config.js 33(+33 -0)
diff --git a/temp/site-w/main/config/config.js b/temp/site-w/main/config/config.js
new file mode 100644
index 0000000..466867b
--- /dev/null
+++ b/temp/site-w/main/config/config.js
@@ -0,0 +1,33 @@
+import extend from 'extend2';
+import configTest from './configTest.js';
+import configDev from './configDev.js';
+import configPro from './configPro.js';
+
+var config = {};
+var env = process.env.NODE_ENV;
+var hostname = window.location.hostname.toLowerCase();
+
+//根据域名判断
+if (
+ hostname.indexOf('127.0.0.1') === 0 ||
+ hostname.indexOf('192.168') === 0 ||
+ hostname.indexOf('dev.') === 0 ||
+ hostname == 'localhost'
+) {
+ env = 'development';
+} else if (hostname.indexOf('test.') === 0) {
+ env = 'test';
+}
+
+//合并配置
+if (env == 'development') {
+ config = extend(true, {}, configPro, configDev);
+ config.isDev = true;
+} else if (env == 'test') {
+ config = extend(true, {}, configPro, configTest);
+ config.isDev = true;
+} else {
+ config = extend(true, {}, configPro);
+ config.isDev = false;
+}
+export default config;
temp/site-w/main/config/configDev.js 9(+9 -0)
diff --git a/temp/site-w/main/config/configDev.js b/temp/site-w/main/config/configDev.js
new file mode 100644
index 0000000..4c18249
--- /dev/null
+++ b/temp/site-w/main/config/configDev.js
@@ -0,0 +1,9 @@
+/**
+ * 开发环境配置
+ */
+const config = {
+ isDev: true,
+ service: {}
+};
+
+export default config;
temp/site-w/main/config/configPro.js 12(+12 -0)
diff --git a/temp/site-w/main/config/configPro.js b/temp/site-w/main/config/configPro.js
new file mode 100644
index 0000000..05f5aff
--- /dev/null
+++ b/temp/site-w/main/config/configPro.js
@@ -0,0 +1,12 @@
+var config = {
+ //是否开发模式
+ isDev: false,
+ domain: 'http://localhost:8080',
+ //版本
+ version: '1.0.0',
+ //接口服务配置
+ service: {
+ default: 'http://192.168.88.88:8010'
+ }
+};
+export default config;
\ No newline at end of file
temp/site-w/main/config/configTest.js 10(+10 -0)
diff --git a/temp/site-w/main/config/configTest.js b/temp/site-w/main/config/configTest.js
new file mode 100644
index 0000000..b04a19e
--- /dev/null
+++ b/temp/site-w/main/config/configTest.js
@@ -0,0 +1,10 @@
+/**
+ * 开发环境配置
+ */
+const config = {
+ //是否开发模式
+ isDev: false,
+ service: {}
+};
+
+export default config;
temp/site-w/main/favicon.ico 0(+0 -0)
diff --git a/temp/site-w/main/favicon.ico b/temp/site-w/main/favicon.ico
new file mode 100644
index 0000000..0eed320
Binary files /dev/null and b/temp/site-w/main/favicon.ico differ
temp/site-w/main/index.html 16(+16 -0)
diff --git a/temp/site-w/main/index.html b/temp/site-w/main/index.html
new file mode 100644
index 0000000..496ea64
--- /dev/null
+++ b/temp/site-w/main/index.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <!-- 禁止缓存 -->
+ <!-- <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
+ <meta http-equiv="Pragma" content="no-cache" />
+ <meta http-equiv="Expires" content="0" /> -->
+ <title><%= htmlWebpackPlugin.options.title %></title>
+ </head>
+ <body>
+ <div id="dai-app" class="dai-app d-box-v">
+ <router-view class="d-box-flex"></router-view>
+ </div>
+ </body>
+</html>
\ No newline at end of file
temp/site-w/main/index.js 41(+41 -0)
diff --git a/temp/site-w/main/index.js b/temp/site-w/main/index.js
new file mode 100644
index 0000000..c4a461e
--- /dev/null
+++ b/temp/site-w/main/index.js
@@ -0,0 +1,41 @@
+import { DaiVue, Vuex } from 'dai-vue';
+import * as modules from './modules.js';
+import config from './config/config.js';
+import interceptor from './interceptor.js';
+import store from './store.js';
+
+import './style.less';
+
+var vm = DaiVue(
+ {
+ store,
+ data() {
+ return {};
+ },
+ methods: {},
+ created: function () {},
+ watch: {},
+ components: {},
+ //计算属性
+ computed: {
+ ...Vuex.mapGetters(['vx_userInfo'])
+ }
+ },
+ {
+ //全局配置
+ config,
+ //引用的所有模块
+ modules: modules,
+ //主路由模块,可以是一个布局模块
+ main: { template: '<keep-alive><router-view></router-view></keep-alive>' },
+ use: {
+ // Vant: { plugin: Vant }
+ },
+ //http 拦截器
+ interceptor
+ }
+);
+
+//挂载VUE
+vm.$mount('#dai-app');
+window.baseVue = vm;
temp/site-w/main/interceptor.js 62(+62 -0)
diff --git a/temp/site-w/main/interceptor.js b/temp/site-w/main/interceptor.js
new file mode 100644
index 0000000..3a2e532
--- /dev/null
+++ b/temp/site-w/main/interceptor.js
@@ -0,0 +1,62 @@
+const interceptor = {
+ //请求拦截
+ request(options) {
+ options.headers.token = localStorage.getItem('token');
+ },
+ //响应拦截
+ response(response, options) {
+ let obj = { isErr: false, data: '' };
+ if (response.status == '200') {
+ var json = response.data;
+ if (json.isErr) {
+ //如果显示错误信息,弹出错误,否则继续执行
+ if (options.showMsg) {
+ options.onError(this, '错误', json.errMsg);
+ this.$vue.$Notice.error({
+ title: '错误',
+ desc: json.errMsg
+ });
+ console.error(json.errMsg);
+ obj.isErr = true;
+ obj.data = json;
+ return obj;
+ } else {
+ //继续执行,内部处理错误
+ obj.isErr = false;
+ obj.data = json;
+ return obj;
+ }
+ } else {
+ //当现实返回消息时
+ if (options.showMsg) {
+ if (json.msg) {
+ // options.onMessage(this, '消息', json.msg);
+ this.$vue.$Notice.success({
+ title: json.msg
+ // desc: nodesc ? '' : 'Here is the notification description. Here is the notification description. '
+ });
+ }
+ obj.isErr = false;
+ obj.data = json.data;
+ return obj;
+ }
+ //当不现实返回消息时
+ else {
+ obj.isErr = false;
+ obj.data = json;
+ return obj;
+ }
+ }
+ } else {
+ console.error(response);
+ if (options.showMsg) {
+ options.onError(this, '网络错误', '请联系管理员解决');
+ }
+ obj.isErr = true;
+ obj.data = '网络错误';
+ return obj;
+ }
+ return obj;
+ }
+};
+export default interceptor;
temp/site-w/main/modules.js 1(+1 -0)
diff --git a/temp/site-w/main/modules.js b/temp/site-w/main/modules.js
new file mode 100644
index 0000000..9124704
--- /dev/null
+++ b/temp/site-w/main/modules.js
@@ -0,0 +1 @@
+export { default as main } from '../src/index.js';
\ No newline at end of file
temp/site-w/main/store.js 20(+20 -0)
diff --git a/temp/site-w/main/store.js b/temp/site-w/main/store.js
new file mode 100644
index 0000000..033e7f2
--- /dev/null
+++ b/temp/site-w/main/store.js
@@ -0,0 +1,20 @@
+import { Vue, Vuex } from 'dai-vue';
+Vue.use(Vuex);
+//创建VueX对象
+const store = new Vuex.Store({
+ state: {
+ //用户信息
+ vx_userInfo: {}
+ },
+ getters: {
+ vx_userInfo: (state) => state.vx_userInfo
+ },
+ mutations: {
+ vx_userInfo(state, userInfo) {
+ // 变更状态
+ state.userInfo = userInfo;
+ }
+ }
+});
+
+export default store;
temp/site-w/main/style.less 2(+2 -0)
diff --git a/temp/site-w/main/style.less b/temp/site-w/main/style.less
new file mode 100644
index 0000000..332f5b2
--- /dev/null
+++ b/temp/site-w/main/style.less
@@ -0,0 +1,2 @@
+//全局样式配置
+// @import '~dai-style/src/dai.less';
temp/site-w/package.json 16(+16 -0)
diff --git a/temp/site-w/package.json b/temp/site-w/package.json
new file mode 100644
index 0000000..fccbc63
--- /dev/null
+++ b/temp/site-w/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "dai-vue-temp-m",
+ "type": "module",
+ "version": "1.0.0",
+ "description": "dai-vue",
+ "main": "src/index.js",
+ "scripts": {
+ "dev": "node ./build/dev.js",
+ "build": "node ./build/build.js"
+ },
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "dai-vue": "^1.0.22"
+ }
+}
temp/site-w/src/api.js 19(+19 -0)
diff --git a/temp/site-w/src/api.js b/temp/site-w/src/api.js
new file mode 100644
index 0000000..5d3a2da
--- /dev/null
+++ b/temp/site-w/src/api.js
@@ -0,0 +1,19 @@
+var test = {
+ $config: {
+ /**读取配置文件中 service 字段,默认 default*/
+ service: 'default',
+ /**基础URL */
+ baseURL: '/test/',
+ /**请求方式,不配置为 payload*/
+ requestType: 'formData'
+ },
+ /**
+ * 接口方法 在 vue 页面中可以使用方法 await this.$api.test.test({});
+ * @param {Object} data
+ * @returns
+ */
+ async test(data) {
+ return await this.$get('test', data);
+ }
+};
+export { test };
temp/site-w/src/index.js 6(+6 -0)
diff --git a/temp/site-w/src/index.js b/temp/site-w/src/index.js
new file mode 100644
index 0000000..cffdb9f
--- /dev/null
+++ b/temp/site-w/src/index.js
@@ -0,0 +1,6 @@
+import * as api from './api.js';
+import routes from './routes.js';
+export default {
+ api,
+ routes
+};
temp/site-w/src/page/404.vue 34(+34 -0)
diff --git a/temp/site-w/src/page/404.vue b/temp/site-w/src/page/404.vue
new file mode 100644
index 0000000..afaa80d
--- /dev/null
+++ b/temp/site-w/src/page/404.vue
@@ -0,0 +1,34 @@
+<style scoped>
+.page-404 {
+ text-align: center; padding: 50px 20px 0 20px;color: #999;
+}
+</style>
+<template>
+ <div class="page-404">
+ <div style="font-size:68px;">404</div>
+ <div style="font-size:18px;margin-top:20px;">糟糕,你的页面走丢了!</div>
+ </div>
+</template>
+<script>
+import { mapGetters } from 'vuex';
+export default {
+ mixins: [],
+ components: {},
+ props: [],
+ data: function () {
+ return {};
+ },
+ methods: {
+ async init() {}
+ },
+ watch: {},
+ created() {
+ this.init();
+ },
+ mounted() {},
+ //计算属性
+ computed: {
+ ...mapGetters(['vx_userInfo'])
+ }
+};
+</script>
\ No newline at end of file
temp/site-w/src/page/home.vue 28(+28 -0)
diff --git a/temp/site-w/src/page/home.vue b/temp/site-w/src/page/home.vue
new file mode 100644
index 0000000..b625459
--- /dev/null
+++ b/temp/site-w/src/page/home.vue
@@ -0,0 +1,28 @@
+<style lang="less" scoped>
+</style>
+<template>
+ <div style="text-align: center;">
+ <div><img style="width:200px;" src="../static/image/vue-logo.png" /></div>
+ <div style="font-size:28px;">DaiVUE</div>
+ <div>简易VUE网站快速成型框架</div>
+ </div>
+</template>
+<script type="text/javascript">
+import { Vuex } from 'dai-vue';
+export default {
+ props: {},
+ data() {
+ return {};
+ },
+ components: {},
+ methods: {},
+ watch: {},
+ created() {},
+ mounted() {},
+ //计算属性
+ computed: {
+ ...Vuex.mapGetters(['vx_userInfo'])
+ },
+ destroyed() {}
+};
+</script>
\ No newline at end of file
temp/site-w/src/page/routerMap.vue 56(+56 -0)
diff --git a/temp/site-w/src/page/routerMap.vue b/temp/site-w/src/page/routerMap.vue
new file mode 100644
index 0000000..2802682
--- /dev/null
+++ b/temp/site-w/src/page/routerMap.vue
@@ -0,0 +1,56 @@
+<style lang="less" scoped>
+.page-map {
+ color: #333;
+}
+</style>
+<template>
+ <div class="page-map">
+ <route-item :route="item" v-for="(item,index) in list" :key="index"></route-item>
+ </div>
+</template>
+<script>
+import { mapGetters } from 'vuex';
+
+export default {
+ mixins: [],
+ components: {
+ 'route-item': {
+ name: 'route-item',
+ props: {
+ route: {
+ type: Object,
+ default() {
+ return {};
+ }
+ },
+ base: {
+ type: String,
+ default: ''
+ }
+ },
+ template:
+ '<div style="padding-left:20px;"><div @click="$router.push({path:base + route.path})">{{route.meta && route.meta.pageName || route.path}}({{base + route.path}})</div><route-item :base="base + route.path" :route="item" v-for="(item,index) in route.children" :key="index"></route-item></div>'
+ }
+ },
+ props: [],
+ data: function () {
+ return {
+ list: []
+ };
+ },
+ methods: {
+ async init() {
+ this.list = this.$router.options.routes;
+ }
+ },
+ watch: {},
+ created() {
+ this.init();
+ },
+ mounted() {},
+ //计算属性
+ computed: {
+ ...mapGetters(['vx_userInfo'])
+ }
+};
+</script>
\ No newline at end of file
temp/site-w/src/routes.js 6(+6 -0)
diff --git a/temp/site-w/src/routes.js b/temp/site-w/src/routes.js
new file mode 100644
index 0000000..b1134fa
--- /dev/null
+++ b/temp/site-w/src/routes.js
@@ -0,0 +1,6 @@
+const routes = [
+ { path: '', component: () => import('./page/home.vue'), meta: { pageName: '首页' } },
+ { path: 'routerMap', component: () => import('./page/routerMap.vue'), meta: { pageName: '网站地图' } },
+ { path: '*', component: () => import('./page/404.vue'), meta: { pageName: '404' } },
+];
+export default routes;
diff --git a/temp/site-w/src/static/image/vue-logo.png b/temp/site-w/src/static/image/vue-logo.png
new file mode 100644
index 0000000..102329c
Binary files /dev/null and b/temp/site-w/src/static/image/vue-logo.png differ
diff --git a/temp/site-w/src/static/style/style.less b/temp/site-w/src/static/style/style.less
new file mode 100644
index 0000000..b5736f8
--- /dev/null
+++ b/temp/site-w/src/static/style/style.less
@@ -0,0 +1,4 @@
+//模块内样式
+.module-test{
+
+}
\ No newline at end of file
temp/site-w/types/type.d.ts 154(+154 -0)
diff --git a/temp/site-w/types/type.d.ts b/temp/site-w/types/type.d.ts
new file mode 100644
index 0000000..4c078d4
--- /dev/null
+++ b/temp/site-w/types/type.d.ts
@@ -0,0 +1,154 @@
+declare module uni {
+ // /**
+ // * 保留当前页面,跳转到应用内的某个页面,使用uni.navigateBack可以返回到原页面。
+ // * @param object
+ // */
+ function navigateTo(object: object);
+ /**
+ * 关闭当前页面,跳转到应用内的某个页面。
+ * @param object
+ */
+ function redirectTo(object: object);
+ /**
+ * 关闭所有页面,打开到应用内的某个页面。
+ * @param object
+ */
+ function reLaunch(object: object);
+ /**
+ * 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面
+ * @param object
+ */
+ function switchTab(object: object);
+ /**
+ * 关闭当前页面,返回上一页面或多级页面。
+ * @param object
+ */
+ function navigateBack(object: object): null;
+ /**
+ * 预加载页面,是一种性能优化技术。被预载的页面,在打开时速度更快。
+ * @param object {Object}
+ */
+ function preloadPage(object: object);
+ /**
+ * 将数据存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个异步接口。
+ * @param object
+ */
+ function setStorage(object: object);
+ /**
+ * 将 data 存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个同步接口。
+ * @param key
+ * @param value
+ */
+ function setStorageSync(key: string, value: string);
+ /**
+ * 从本地缓存中异步获取指定 key 对应的内容。
+ * @param object
+ */
+ function getStorage(object: object);
+ /**
+ * 从本地缓存中同步获取指定 key 对应的内容。
+ * @param key
+ */
+ function getStorageSync(key: string): string;
+ /**
+ * 异步获取当前 storage 的相关信息。
+ * @param object
+ */
+ function getStorageInfo(object: object);
+ /**
+ * 同步获取当前 storage 的相关信息。
+ * @param object
+ */
+ function getStorageInfoSync(object: string): object;
+ /**
+ * 从本地缓存中异步移除指定 key。
+ * @param object
+ */
+ function removeStorage(object: object);
+ /**
+ * 从本地缓存中同步移除指定 key。
+ * @param object
+ */
+ function removeStorageSync(object: object);
+ /**
+ * 同步清理本地数据缓存。
+ * @param object
+ */
+ function clearStorage(object: object);
+ /**
+ * 同步清理本地数据缓存。
+ * @param object
+ */
+ function clearStorageSync(object: object);
+ /**
+ * 获取当前的地理位置、速度。 在微信小程序中,当用户离开应用后,此接口无法调用,除非申请后台持续定位权限;当用户点击“显示在聊天顶部”时,此接口可继续调用。
+ * @param object
+ */
+ function getLocation(object: object);
+ /**
+ * 打开地图选择位置。
+ * @param object
+ */
+ function chooseLocation(object: object);
+ /**
+ * 使用应用内置地图查看位置。
+ * @param object
+ */
+ function openLocation(object: object);
+ /**
+ * 显示消息提示框。
+ * @param object
+ */
+ function showToast(object: object);
+ /**
+ * 隐藏消息框
+ * @param object
+ */
+ function hideToast(object: object);
+ /**
+ * 显示 loading 提示框, 需主动调用 uni.hideLoading 才能关闭提示框。
+ * @param object
+ */
+ function showLoading(object: object);
+ /**
+ * 隐藏 loading 提示框。
+ * @param object
+ */
+ function hideLoading(object: object);
+ /**
+ * 显示模态弹窗,可以只有一个确定按钮,也可以同时有确定和取消按钮。类似于一个API整合了 html 中:alert、confirm。
+ * @param object
+ */
+ function showModal(object: object);
+ /**
+ * 从底部向上弹出操作菜单
+ * @param object
+ */
+ function showActionSheet(object: object);
+ /**
+ * 动态设置当前页面的标题。
+ * @param object
+ */
+ function setNavigationBarTitle(object: object);
+ /**
+ * 设置页面导航条颜色。如果需要进入页面就设置颜色,请延迟执行,防止被框架内设置颜色逻辑覆盖
+ * @param object
+ */
+ function setNavigationBarColor(object: object);
+ /**
+ * 在当前页面显示导航条加载动画。
+ * @param object
+ */
+ function showNavigationBarLoading(object: object);
+ /**
+ * 在当前页面隐藏导航条加载动画。
+ * @param object
+ */
+ function hideNavigationBarLoading(object: object);
+ /**
+ * 隐藏返回首页按钮。
+ * @param object
+ */
+ function hideHomeButton(object: object);
+ function xxxxxxxxx(object: object);
+}