diff --git a/components/index.js b/components/index.js
index 32334ef7..7cca617a 100644
--- a/components/index.js
+++ b/components/index.js
@@ -5,6 +5,15 @@ let components = [];
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
const install = function (Vue) {
if (install.installed) return;
+ // 声明全局业务对象类
+ const models = require.context('./model', true, /\.js$/)
+ if (models) {
+ const model = {}
+ models.keys().map(e => {
+ model[e.replace(/\.[\/\\]([^\\\/]+)\.js$/, '$1')] = models(e).default
+ })
+ Vue.prototype.MODEL = model
+ }
// 遍历注册全局组件
let contexts = require.context('.', true, /[\\\/]Ai([^\\\/]+)\.vue$/);
if (contexts) {
diff --git a/components/model/Party.js b/components/model/Party.js
new file mode 100644
index 00000000..e69de29b
diff --git a/components/model/PartyOrg.js b/components/model/PartyOrg.js
new file mode 100644
index 00000000..c853d293
--- /dev/null
+++ b/components/model/PartyOrg.js
@@ -0,0 +1,25 @@
+import http from "dvcp-ui/lib/js/request";
+
+export default class PartyOrg {
+ constructor(id) {
+ this.id = id
+ this.loaded = false
+ this.init().finally(() => this.loaded = true)
+ }
+
+ init() {
+ return PartyOrg.getInfo(this.id).then(data => {
+ Object.entries(data).map(([k, v]) => this[k] = v)
+ })
+ }
+
+ static getInfo(id) {
+ return http.post("/app/partyOrganization/queryOrgById", null, {
+ params: {id}
+ }).then(res => {
+ if (res?.data) {
+ return res.data
+ }
+ })
+ }
+}
diff --git a/project/pingchang/apps/AppOrganizationChange/AppOrganizationChange.vue b/project/pingchang/apps/AppOrganizationChange/AppOrganizationChange.vue
index fb79d1fd..5f104e68 100644
--- a/project/pingchang/apps/AppOrganizationChange/AppOrganizationChange.vue
+++ b/project/pingchang/apps/AppOrganizationChange/AppOrganizationChange.vue
@@ -15,9 +15,15 @@ import organizationSetting from "./components/organizationSetting.vue";
export default {
name: "AppOrganizationChange",
label: "组织换届",
+ provide() {
+ return {
+ ...this.$props
+ }
+ },
props: {
instance: Function,
dict: Object,
+ permissions: Function
},
components: {
List,
@@ -36,7 +42,6 @@ export default {
},
data() {
return {
- component: "List",
params: {},
include: [],
selected: {},
@@ -47,10 +52,6 @@ export default {
this.params = data.params;
},
},
- created() {
- let {organizationId: id, organizationName: name} = this.user.info
- this.selected = {id, name}
- }
}
diff --git a/project/pingchang/apps/AppOrganizationChange/components/List.vue b/project/pingchang/apps/AppOrganizationChange/components/List.vue
index 3bce306e..78f43c61 100644
--- a/project/pingchang/apps/AppOrganizationChange/components/List.vue
+++ b/project/pingchang/apps/AppOrganizationChange/components/List.vue
@@ -1,11 +1,7 @@
-
-
- 换届设置
-
-
+
@@ -19,10 +15,14 @@
+
+
+ 换届设置
+
+
-
+
@@ -36,12 +36,7 @@ import history from './history.vue'
export default {
name: 'List',
- props: {
- instance: Function,
- permissions: Function,
- dict: Object,
- selected: Object
- },
+ inject: ['permissions', 'instance', 'dict'],
data() {
return {
tabs: [
@@ -49,6 +44,7 @@ export default {
{label: '历史届次', name: 'history', comp: history, permission: ''}
],
currIndex: '0',
+ selected: null
}
},
components: {
@@ -57,25 +53,15 @@ export default {
},
computed: {
...mapState(['user']),
-
- orgTree() {
- return this.$refs.tree?.$refs?.partyTree
- },
},
-
methods: {
- showNeighbourSetting(id) {
- this.$router.push({query: {id}, hash: "#ns"})
- },
onTreeChange(e) {
- this.$emit("update:selected", e)
+ this.selected = e
this.$refs[this.tabs[Number(this.currIndex)].name][0].getList(e.id)
},
-
onSearch(v) {
- this.orgTree.filter(v)
+ this.$refs.tree?.$refs?.partyTree?.filter(v)
},
-
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
@@ -83,9 +69,13 @@ export default {
toAdd(id) {
this.$router.push({hash: "#add", query: {id}})
},
- toSetting(id) {
- this.$router.push({hash: "#setting", query: {id}})
+ toSetting(oid) {
+ this.$router.push({hash: "#setting", query: {oid}})
}
+ },
+ created() {
+ const {organizationId: id, organizationName: name} = this.user.info
+ this.selected = {id, name}
}
}
@@ -132,6 +122,7 @@ export default {
.ai-list__content--right-wrapper {
width: 100%;
+ padding-top: 0;
}
}
diff --git a/project/pingchang/apps/AppOrganizationChange/components/moment.vue b/project/pingchang/apps/AppOrganizationChange/components/moment.vue
index 8b60104b..8f6dfb30 100644
--- a/project/pingchang/apps/AppOrganizationChange/components/moment.vue
+++ b/project/pingchang/apps/AppOrganizationChange/components/moment.vue
@@ -53,8 +53,11 @@
- 暂无换届信息,请完善基础内容后,再进行后续操作
- 开始设置
+
+ 暂无换届信息
+
+
+
@@ -82,12 +85,7 @@