-
+
@@ -18,6 +58,10 @@ Vue.use(VueResizeObserver);
return {};
}
},
+ autoWidth: {
+ type: Boolean,
+ default: true
+ },
minWidth: {
type: Number,
default: 80
@@ -26,6 +70,12 @@ Vue.use(VueResizeObserver);
type: String,
default: ''
},
+ menu: {
+ type: Array,
+ default: () => {
+ return [];
+ }
+ },
},
data() {
return {
@@ -46,8 +96,16 @@ Vue.use(VueResizeObserver);
tdStyle() {
const style = {};
const {align} = this;
- if (['left', 'center', 'right'].includes(align.toLowerCase())) {
- style.textAlign = align;
+ switch (align.toLowerCase()) {
+ case 'left':
+ style.justifyContent = 'flex-start';
+ break;
+ case 'center':
+ style.justifyContent = 'center';
+ break;
+ case 'right':
+ style.justifyContent = 'flex-end';
+ break;
}
return style;
}
@@ -65,6 +123,9 @@ Vue.use(VueResizeObserver);
})
},
onResize({ width, height }) {
+ if (!this.autoWidth) {
+ return;
+ }
$A(".ivu-table-column-" + this.column.__id).each((index, el) => {
let action = $A(el).find(".td-action-container")
if (action.length > 0) {
@@ -81,7 +142,14 @@ Vue.use(VueResizeObserver);
if (this.column.maxWidth) {
newWidth = Math.min(this.column.maxWidth, newWidth);
}
- newWidth != this.column.width && this.$set(this.column, 'width', newWidth)
+ if (newWidth != this.column.width) {
+ this.$nextTick(() => {
+ this.$set(this.column, 'width', newWidth);
+ })
+ }
+ },
+ onClick(action) {
+ this.$emit("action", action)
}
}
}
diff --git a/resources/assets/js/components/TagInput.vue b/resources/assets/js/components/TagInput.vue
index acefbd18..1ba785a3 100755
--- a/resources/assets/js/components/TagInput.vue
+++ b/resources/assets/js/components/TagInput.vue
@@ -1,12 +1,22 @@
-
@@ -218,6 +218,10 @@ export default {
this.$emit("command", task, command)
},
+ onPriority(data) {
+ this.$emit("on-priority", data)
+ },
+
getSublist(task) {
if (this.taskOpen[task.id] === true) {
this.$set(this.taskOpen, task.id, false);
diff --git a/resources/assets/js/pages/manage/setting/index.vue b/resources/assets/js/pages/manage/setting/index.vue
index b9b7adbe..bf1b65d0 100644
--- a/resources/assets/js/pages/manage/setting/index.vue
+++ b/resources/assets/js/pages/manage/setting/index.vue
@@ -13,9 +13,8 @@
@@ -34,13 +33,6 @@ export default {
data() {
return {
curPath: this.$route.path,
-
- menu: [
- {path: 'personal', admin: false, name: '个人设置'},
- {path: 'password', admin: false, name: '密码设置'},
- {path: 'system', admin: true, name: '系统设置'},
- {path: 'priority', admin: true, name: '任务等级'},
- ],
}
},
mounted() {
@@ -49,6 +41,20 @@ export default {
computed: {
...mapState(['userInfo', 'userIsAdmin']),
+ menu() {
+ let menu = [
+ {path: 'personal', name: '个人设置'},
+ {path: 'password', name: '密码设置'},
+ ]
+ if (this.userIsAdmin) {
+ menu.push(...[
+ {path: 'system', name: '系统设置', divided: true},
+ {path: 'priority', name: '任务等级'},
+ ])
+ }
+ return menu;
+ },
+
titleNameRoute() {
const {curPath, menu} = this;
let name = '';
@@ -71,9 +77,10 @@ export default {
this.goForward({path: '/manage/setting/' + path});
},
- classNameRoute(path) {
+ classNameRoute(path, divided) {
return {
- "active": $A.leftExists(this.curPath, '/manage/setting/' + path)
+ "active": $A.leftExists(this.curPath, '/manage/setting/' + path),
+ "divided": !!divided
};
},
}
diff --git a/resources/assets/js/pages/manage/setting/personal.vue b/resources/assets/js/pages/manage/setting/personal.vue
index ef381b9e..637b0092 100644
--- a/resources/assets/js/pages/manage/setting/personal.vue
+++ b/resources/assets/js/pages/manage/setting/personal.vue
@@ -1,18 +1,18 @@