产品库工程目录调整

This commit is contained in:
aixianling
2021-11-17 17:13:52 +08:00
parent 9ebcd19f0a
commit eea22bacc7
6 changed files with 37 additions and 35 deletions

View File

@@ -58,15 +58,22 @@ const start = () => {
easycom: { easycom: {
"^u-(.*)": "@/uview/components/u-$1/u-$1.vue" "^u-(.*)": "@/uview/components/u-$1/u-$1.vue"
}, },
pages: [], pages: [
{path: 'pages/loading'},
{path: 'pages/login'}
],
globalStyle: { globalStyle: {
pageOrientation: "auto", pageOrientation: "auto",
navigationStyle: "custom" navigationStyle: "custom"
} }
} }
findApp('src/pages', file => { findApp('src/apps', file => {
if (/.*\\(.+)\.vue/g.test(file)) { if (/.*\\.+\\App[^\\]+\.vue/g.test(file)) {
json.pages.push({path: file.replace(/^src\\(.*).vue/g, '$1').replace(/\\/g,'/')}) let app = {
name: file.replace(/.*\\([^\\]+).vue/g, '$1'),
path: file.replace(/^src\\(.*).vue/g, '$1').replace(/\\/g, '/')
}
json.pages.push(app)
} }
}).then(() => { }).then(() => {
fsExtra.outputJson('src/pages.json', json, () => { fsExtra.outputJson('src/pages.json', json, () => {

View File

@@ -5,12 +5,12 @@
"author": "Kubbo", "author": "Kubbo",
"scripts": { "scripts": {
"dev": "node bin/serve.js&&cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve --minimize", "dev": "node bin/serve.js&&cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve --minimize",
"lib": "npm unpublish --force&&npm publish" "lib": "npm unpublish --force&&npm publish",
"pages": "node bin/serve.js"
}, },
"files": [ "files": [
"src/components", "src/components",
"src/pages", "src/apps"
"src/pages.json"
], ],
"dependencies": { "dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1", "@amap/amap-jsapi-loader": "^1.0.1",
@@ -64,6 +64,7 @@
"node-sass": "npm:dart-sass@^1.25.0", "node-sass": "npm:dart-sass@^1.25.0",
"postcss-comment": "^2.0.0", "postcss-comment": "^2.0.0",
"sass-loader": "^7.1.0", "sass-loader": "^7.1.0",
"uview-ui": "^2.0.3",
"vue-template-compiler": "^2.6.11" "vue-template-compiler": "^2.6.11"
}, },
"browserslist": [ "browserslist": [

View File

@@ -45,14 +45,14 @@ import AiFixedBtn from "../../components/AiFixedBtn";
export default { export default {
name: "AppInterview", name: "AppInterview",
label: "调查走访", appName: "调查走访",
components: {AiFixedBtn, AiDate, AiImage, AiCard, AiTopFixed, AiSelect}, components: {AiFixedBtn, AiDate, AiImage, AiCard, AiTopFixed, AiSelect},
data() { data() {
return { return {
search: {title: ""}, search: {title: ""},
list: [], list: [],
current: 1, current: 1,
pages: 0 pages: 0,
} }
}, },
computed: { computed: {

View File

@@ -10,7 +10,7 @@
<b v-for="app in apps" :key="app.key" @tap="redirectTo(app.path)">{{ app.name }}</b> <b v-for="app in apps" :key="app.key" @tap="redirectTo(app.path)">{{ app.name }}</b>
</div> </div>
</section> </section>
</template> </template>0
<script> <script>
import {mapActions, mapState} from 'vuex' import {mapActions, mapState} from 'vuex'
@@ -22,14 +22,15 @@ export default {
components: {UTag, AiResult}, components: {UTag, AiResult},
inject: ['root'], inject: ['root'],
computed: { computed: {
...mapState(['token', 'apps', 'openUser', 'user']), ...mapState(['token', 'openUser', 'user']),
currentApp() { currentApp() {
return this.apps.find(e => e.key == this.$route.query.app) || {} return this.apps.find(e => e.key == this.$route.query.app) || {}
} }
}, },
data() { data() {
return { return {
result: {} result: {},
apps: []
} }
}, },
methods: { methods: {
@@ -38,16 +39,30 @@ export default {
let {query, hash} = this.$route let {query, hash} = this.$route
delete query.app delete query.app
uni.navigateTo({ uni.navigateTo({
url: `/pages${path}`, success: () => { url: `/apps${path}`, success: () => {
this.$router.push({query, hash}) this.$router.push({query, hash})
},
fail: err => {
console.error(err)
} }
}) })
}, },
handleLogin() { handleLogin() {
uni.navigateTo({url: "./login"}) uni.navigateTo({url: "./login"})
},
getApps() {
this.apps = []
let applications = require.context('../apps', true, /\.(\/.+)\/App[^\/]+\.vue$/)
applications.keys().map(path => {
if (applications(path).default) {
let {name: key, appName: name} = applications(path).default
this.apps.push({key, name, path: path.replace(/^\.(.+).vue$/g, '$1')})
}
})
} }
}, },
created() { created() {
this.getApps()
this.result = { this.result = {
tips: "欢迎进入开发应用", tips: "欢迎进入开发应用",
} }

View File

@@ -5,26 +5,7 @@ import http from '../common/axios'
import CryptoJS from '../utils/crypto-js' import CryptoJS from '../utils/crypto-js'
Vue.use(Vuex) Vue.use(Vuex)
let agentSignURL = "", apiList = [], agentConfig = {}, let agentSignURL = "", apiList = [], agentConfig = {}
apps = [
{name: '调查走访', key: "interview", path: '/interview/AppInterview'},
{name: '工作去向', key: "whereabouts", path: '/whereabouts/whereabouts'},
{name: '随手拍', key: "snapshot", path: '/snapshot/snapshot'},
{name: '随心问', key: "casuallyask", path: '/casuallyask/casuallyask'},
{name: '网上办事', key: "workonline", path: '/workonline/workonline'},
{name: '居民画像', key: "resident", path: '/resident/comp'},
{name: '话术库', key: "quickReply", path: '/quickReply/quickReply'},
{name: '积分超市', key: "supermarket", path: '/supermarket/supermarket'},
{name: '调查问卷', key: "askForm", path: '/askForm/askForm'},
{name: '问卷表单', key: "askFormIndex", path: '/askForm/index'},
{name: '会议通知', key: "meetingNotice", path: '/meetingNotice/meetingNotice'},
{name: '公文流转', key: "documentFlow", path: '/documentFlow/documentFlow'},
{name: '工作任务', key: "workTask", path: '/workTask/workTask'},
{name: '通知公告', key: "notification", path: '/notification/notification'},
{name: '智慧监测', key: "guardianship", path: '/guardianship/guardianship'},
{name: '广播通知', key: "broadcast", path: '/bigHorn/bigHorn'},
{name: '视频监控', key: "videoMonitor", path: '/videoSurveillance/videoSurveillance'},
]
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
token: "", token: "",
@@ -33,11 +14,9 @@ const store = new Vuex.Store({
openUser: {}, openUser: {},
dicts: [], dicts: [],
user: {}, user: {},
apps,
}, },
mutations: { mutations: {
login(state, token) { login(state, token) {
state.apps = apps
state.token = token state.token = token
}, },
logout(state) { logout(state) {