Skip to content

Commit

Permalink
feat:更新版本选择无不展示下面,添加id和version
Browse files Browse the repository at this point in the history
  • Loading branch information
superDragon committed Nov 11, 2020
1 parent df9e14e commit 648b8da
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "collection",
"productName": "廉情信息报告表",
"version": "1.1.5",
"version": "1.1.6",
"private": true,
"scripts": {
"dev": "vue-cli-service electron:serve",
Expand Down
3 changes: 3 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export default {
else this.win.restore()
this.originSize = !this.originSize
}
},
mounted(){
this.$store.dispatch('updateVersion', this.$version)
}
}
</script>
Expand Down
4 changes: 3 additions & 1 deletion src/db.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/**
* checkPassword,是对password的校验,
* other,是其他项类似备注的,
* tableStatus是表的标示,有无此类情况格式类似tableStatus:{table1:1,table2:0},1为有0为没有
* tableStatus是表的标示,有无此类情况格式类似tableStatus:{table1:1,table2:0},1为有2为没有
*/
const db = {
uid:'', // 生成数据表唯一id
version: '', // 版本号
name: '', // 姓名
gender: '', // 性别
idCard: '', // 身份证号
Expand Down
1 change: 1 addition & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Vue.prototype.$ipc = ipc
Vue.prototype.$dialog = dialog
Vue.prototype.$db = db
Vue.prototype.$utils = utils
Vue.prototype.$version = '1.1.6'
Vue.config.productionTip = false
Vue.use(ElementUI, { size: 'mini' })
Vue.use(filter)
Expand Down
19 changes: 16 additions & 3 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,21 @@ export default new Vuex.Store({
}

},
// 生成唯一id
setUid (state, uid) {
state.user.uid = uid
},
setVersion (state, version) {
state.user.version = version
},
setOther (state, other) {
state.user.other = other// 将传参设置给state的city
state.user.other = other
},
setStockAllMarketValue (state, allMarketValue) {
state.user.stock.allMarketValue = allMarketValue// 将传参设置给state的city
state.user.stock.allMarketValue = allMarketValue
},
setStockDesc (state, desc) {
state.user.stock.desc = desc// 将传参设置给state的city
state.user.stock.desc = desc
},
setFundAllMarketValue (state, allMarketValue) {
state.user.fund.allMarketValue = allMarketValue
Expand All @@ -126,6 +133,12 @@ export default new Vuex.Store({
// 调用mutaions里面的方法
commit('setUser', user)
},
updateUid ({ commit, state }, uid) {
commit('setUid', uid)
},
updateVersion ({ commit, state }, version) {
commit('setVersion', version)
},
updateOther ({ commit, state }, other) {
commit('setOther', other)
},
Expand Down
2 changes: 1 addition & 1 deletion src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<el-radio label="1" style="margin-left:30px" v-model="tableStatus[item.content]">有此类情况</el-radio>
<el-radio label="2" v-model="tableStatus[item.content]">无此类情况</el-radio>
</p>
<component :is="item.content" />
<component :is="item.content" v-show="tableStatus[item.content]!=='2'"/>
</el-tab-pane>
</el-tabs>
</template>
Expand Down
7 changes: 7 additions & 0 deletions src/views/userInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,12 @@ export default {
computed: {
form() {
return this.$store.getters.getUser
},
id() {
return (
this.$formatDay(new Date(), 'YYYYMMDDHHmmss') +
this.form.idCard.slice(-8)
)
},
identityList() {
const arr = []
Expand Down Expand Up @@ -548,6 +554,7 @@ export default {
const self = this
// 初始化一个zip打包对象
var zip = new JSZip()
this.$store.dispatch('updateUid', this.id)
// 创建一个被用来打包的文件
zip.file('user.json', JSON.stringify(this.form))
if (this.form.password) {
Expand Down

0 comments on commit 648b8da

Please sign in to comment.