%2
z1j}FyDN@Bk-4L}96%<89&?NfFfw#-d?7V$%=DnSrS?9oGnBks#zwe%N@A=Lf(cz{J
z$4{5QL`Se2fo=o}?!e?sA=?Xpv%r_Yyn>rl)cpx?4cH;+QSD@-B4B$i@E5SS=*lJg
z-vic23PK}RkH86Fcgc&FHQgymRoLng7y?$5wBk#^z>JdS`&-h=tO&dUrj@i{oTJ#J
z?Iq3kTGI4Z5?G%Qh(lP0wUoe+q*a01_AQ_)^i8s9DS^F`jwJ;40Y{qzUFp^`0{;OE
zB|T0E%m?lRQwx%48G)ZAZK(un`xjtSrx4g6=}HZOZ-GngK;SL#9C()UM7cjGDenIf
zv;9H*o=B6~K;<(h`93STwbFRzN}Ikvh91rC}Jmskglx_$LG4`3SG1H;oXn{ULAx*qY(jBk6Y9n5+ma15%wU
zCXG~zl#0~Kv_!JUjTC1s%a%*J(=34yVIj!!*eIo#=487O#oJs8+5R*+#PONOu1fkk
z&p_K(fv@t61)_oJl@ygc`w%DL{Q~%*!LDpT(xE({Y!4(gA!{T+n)o`o`&s_^k5i_?bx^%z$Xoo7&ihJ
zC2bBciDc*p4hN|OV1PXU3=WgDeG&MsT?q6`I$^sPI0vjv0rn@bP0|h9L2|HN2=pZd
zDH@k48K9zqM|1OIa?3TsVO&z^Um)^(X(LFI0vYd~K5D>kTnIF!K6
zZcFN^1Xiz*odkBZBl?i`lB%$E+RNQ&Y^oG*T{+#+uh-i&by8tX&VOh+DGJ>POmwum
f5$Hys;10Y4ol`SFLHS^500000NkvXXu0mjf+t!T!
diff --git a/src/static/logo.png b/src/static/logo.png
deleted file mode 100644
index b5771e209bb677e2ebd5ff766ad5ee11790f305a..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 4023
zcmaJ^c|25Y`#+XyC`+5OUafkYqmlSEl)+V
zC53EJB$S8m@9Vz4*Y&-Yb3W(3Y;(d~fM1#)0003Cvn<7K1}HtM`$d{YenwQ;C^-S(Bw!dKGPRQ{5d$=<+Bb^=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g(*rDz;hg}s
SYs}WS&%*SCNx89m_ {
- if (err) {
- console.error('err: ', err);
- } else {
- commit('setPermanents', data);
- }
- });
- },
-
- /**
- * 根据时间和角色查找日常任务
- * @param {*} commit
- * @param {object} param 请求参数 roleId, timeNode, timeUnit
- */
- getGlobal({ commit }, param) {
- uni.$t.$q.getGlobal(param, (err, data) => {
- if (err) {
- console.error('err: ', err);
- } else {
- commit('setDailyTasks', data);
- }
- });
- },
-};
-
-export default actions;
diff --git a/src/store/task/getters.js b/src/store/task/getters.js
deleted file mode 100644
index dcd7982..0000000
--- a/src/store/task/getters.js
+++ /dev/null
@@ -1,23 +0,0 @@
-const getters = {
- // 所有的日常任务 永久 + 可变 日常任务
- globals({ dailyTasks, permanents }) {
- return [...permanents, ...dailyTasks];
- },
-
- unitConfig({ timeUnit }) {
- const target = uni.$t.timeConfig.timeUnits.find(item => item.id === timeUnit);
- return target;
- },
-
- // 计算任务开始时间的格式
- startTimeFormat(state, { unitConfig }) {
- return unitConfig.format || 'D日 HH:mm';
- },
-
- // 计算颗粒度 对应的 dayjs add 的单位
- timeGranularity(state, { unitConfig }) {
- return unitConfig.granularity;
- },
-};
-
-export default getters;
diff --git a/src/store/task/index.js b/src/store/task/index.js
deleted file mode 100644
index d22f64a..0000000
--- a/src/store/task/index.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import state from './state';
-import getters from './getters';
-import mutations from './mutations';
-import actions from './actions';
-
-export default {
- namespaced: true,
- state,
- getters,
- mutations,
- actions,
-};
diff --git a/src/store/task/mutations.js b/src/store/task/mutations.js
deleted file mode 100644
index e644faa..0000000
--- a/src/store/task/mutations.js
+++ /dev/null
@@ -1,168 +0,0 @@
-const mutations = {
- /**
- * 记录时间轴向上滚动的距离
- * @param { object } state
- * @param { number } num
- */
- setScrollTop(state, num) {
- state.scrollTop = num;
- },
-
- /**
- * 记录时间轴向上滚动的距离
- * @param { object } state
- * @param { string } data
- */
- setViewId(state, data) {
- state.viewId = data;
- },
-
- /**
- * 设置日常任务当前是否应该处于收缩状态
- * @param { object } state
- * @param { boolean } data
- */
- setShrink(state, data) {
- state.isShrink = data;
- },
-
- /**
- * 设置tip的值
- * @param {object} state
- * @param {object} data
- */
- setTip(state, data) {
- if (!data) return;
- state.tip = { ...data };
- },
-
- /**
- * 是否显示tips
- * @param { object } state
- * @param { boolean } show
- */
- setTipShow(state, show) {
- state.tip.show = show;
- },
-
- /**
- * 是否显示tips
- * @param { object } state
- * @param { number } status
- */
- setStatus(state, status) {
- state.tip.status = status;
- },
-
- /**
- * 设置时间基准点
- * @param { object } state
- * @param { number } data
- */
- setTimeNode(state, data) {
- state.timeNode = data;
- },
-
- /**
- * 设置时间颗粒度
- * @param { object } state
- * @param { number } data
- */
- setTimeUnit(state, data) {
- state.timeUnit = data;
- },
-
- /**
- * 设置向上查到的定期任务数据
- * @param {Object} state
- * @param {Array} data 服务端返回的模板数组
- */
- setUpTasks(state, data) {
- if (!state.tasks.length) {
- state.tasks = [...data];
- } else {
- state.tasks = [...data.concat(state.tasks)];
- }
- },
-
- /**
- * 设置向下查到的定期任务数据
- * @param {Object} state
- * @param {Array} data 服务端返回的模板数组
- */
- setDownTasks(state, data) {
- if (!state.tasks && !state.tasks.length) {
- state.tasks = [...data];
- } else {
- state.tasks = [...state.tasks.concat(data)];
- }
- },
-
- /**
- * 设置日常任务数据
- * @param {Object} state
- * @param {Array} data 服务端返回的模板数组
- */
- setDailyTasks(state, data) {
- state.dailyTasks = data || [];
- },
-
- /**
- * 设置永久固定任务
- * @param {object} state
- * @param {array} tasks 服务端查询到的永久日常任务书籍
- */
- setPermanents(state, tasks) {
- state.permanents = tasks || [];
- },
-
- /**
- * 设置时间轴是否继续向上查任务
- * @param {Object} state
- * @param {Boolean} show
- */
- setTopEnd(state, show) {
- state.topEnd = show;
- },
-
- /**
- * 设置时间轴是否继续向下查任务
- * @param {Object} state
- * @param {Boolean} show
- */
- setBottomEnd(state, show) {
- state.bottomEnd = show;
- },
-
- // 清空标志位 如切换角色等使用
- clearEndFlag(state) {
- state.topEnd = false;
- state.bottomEnd = false;
- },
-
- // 清空定期任务
- clearTasks(state) {
- state.tasks = [];
- },
-
- /**
- * 收到消息设置任务状态
- * @param {Object} state
- * @param {Array} data 服务端返回的模板数组
- */
- setTaskStatus(state, data) {
- const item = state.tasks.find(i => i.id === data.id);
- item.process = data.taskStatus;
- },
-
- /**
- * 设置骨架屏是否显示
- * @param {Object} state
- * @param {Boolean} show
- */
- setShowSkeleton(state, show) {
- state.showSkeleton = show;
- },
-};
-
-export default mutations;
diff --git a/src/store/task/state.js b/src/store/task/state.js
deleted file mode 100644
index a4b4fab..0000000
--- a/src/store/task/state.js
+++ /dev/null
@@ -1,23 +0,0 @@
-const state = {
- scrollTop: 0,
- viewId: '', // 时间轴自动滚动的位置
- isShrink: false, // true: 收起, false:展开
- tip: {
- taskId: '', // 当前正在修改状态的任务的id
- show: false,
- status: 0, // 所点击任务的当前状态码
- text: '',
- left: 0, // 鼠标点击位置距离左边的距离
- top: 0, // 鼠标点击位置距离上边的距离
- },
- timeNode: new Date().getTime(), // 时间基准点
- timeUnit: 4, // 时间颗粒度
- topEnd: false, // 时间轴向上查任务到顶了
- bottomEnd: false, // 时间轴向下查任务到底了
- permanents: [], // 永久日常任务
- dailyTasks: [], // 日常任务
- tasks: [], // 所有的定期任务
- showSkeleton: false, // 定期任务骨架屏
-};
-
-export default state;
diff --git a/src/test/util/time.test.js b/src/test/util/time.test.js
deleted file mode 100644
index 11e64b2..0000000
--- a/src/test/util/time.test.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import Time from '../../utils/time.js';
-
-// 测试计算进行中剩余时长显示数值
-describe('utils/time.js computeDurationText function', () => {
- const { computeDurationText } = Time;
- // const leftTime = +realStart + +planDuration - Date.now(); // 剩余时间
- it ('leftTime is 60ms, num=60, time=16', () => {
- expect(computeDurationText(60)).toEqual({ num: 60, time: 16 })
- })
-
- it ('leftTime is 300ms, num=300, time=16', () => {
- expect(computeDurationText(300)).toEqual({ num: 300, time: 16 })
- })
-
- it ('leftTime is 10s20ms, num=10, time=1000', () => {
- expect(computeDurationText(10*1000 + 20)).toEqual({ num: 10, time: 1000 })
- })
-
- it ('leftTime is 8分钟10s20ms, num=8, time=1000', () => {
- expect(computeDurationText(8*60*1000 + 10*1000 + 20)).toEqual({ num: 8, time: 1000 })
- })
-
- it ('leftTime is 3小时8分钟10s20ms, num=3, time=1000', () => {
- expect(computeDurationText(3*60*60*1000 + 8*60*1000 + 10*1000 + 20)).toEqual({ num: 3, time: 1000 })
- })
-
- it ('leftTime is 11天3小时8分钟10s20ms, num=11, time=60 * 60 * 1000', () => {
- expect(computeDurationText(11*24*60*60*1000 + 3*60*60*1000 + 8*60*1000 + 10*1000 + 20)).toEqual({ num: 11, time: 60 * 60 * 1000 })
- })
-
- it ('leftTime is 2个月11天3小时8分钟10s20ms, num=2, time=60 * 60 * 1000', () => {
- expect(computeDurationText(2*30*24*60*60*1000 + 11*24*60*60*1000 + 3*60*60*1000 + 8*60*1000 + 10*1000 + 20)).toEqual({ num: 2, time: 60 * 60 * 1000 })
- })
-
- it ('leftTime is 7年2个月11天3小时8分钟10s20ms, num=7, time=60 * 60 * 1000', () => {
- expect(computeDurationText(7*12*30*24*60*60*1000 + 2*30*24*60*60*1000 + 11*24*60*60*1000 + 3*60*60*1000 + 8*60*1000 + 10*1000 + 20)).toEqual({ num: 7, time: 60 * 60 * 1000 })
- })
-
- it ('leftTime <=0, num=0, time=null', () => {
- expect(computeDurationText(-10)).toEqual({ num: 0, time: null })
- })
-
- it ('leftTime 不是数字, num=0, time=null', () => {
- expect(computeDurationText('abc')).toEqual({ num: 0, time: null })
- })
-})
diff --git a/src/uni.scss b/src/uni.scss
index 0a86a65..cf66c08 100644
--- a/src/uni.scss
+++ b/src/uni.scss
@@ -12,10 +12,8 @@
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
@import 'uview-ui/theme.scss';
-
-/* 颜色变量 */
-
-/* 行为相关颜色 */
+@import './common/styles/tailwind.scss';
+/* 颜色变量 */ /* 行为相关颜色 */
$uni-color-primary: #007aff;
$uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e;
diff --git a/src/utils/indexedDB.js b/src/utils/indexedDB.js
deleted file mode 100644
index 30a0e90..0000000
--- a/src/utils/indexedDB.js
+++ /dev/null
@@ -1,163 +0,0 @@
-import { name } from '@/config/db';
-import { curry } from 'lodash';
-
-// 创建表
-const createCollection = (Vue, db) => {
- // projects项目表
- !db.objectStoreNames.contains('projects') && db.createObjectStore('projects', { keyPath: 'id' });
- // roles 角色表
- !db.objectStoreNames.contains('roles') && db.createObjectStore('roles', { keyPath: 'id' });
- // plan_tasks 定期任务
- !db.objectStoreNames.contains('plan_tasks') && db.createObjectStore('plan_tasks', { keyPath: 'id' });
- // fixed_tasks 固定全局任务
- Vue.prototype.$db.fixed_tasks = !db.objectStoreNames.contains('fixed_tasks') && db.createObjectStore('fixed_tasks', { keyPath: 'id' });
- // variable_tasks 可变全局任务
- Vue.prototype.$db.variable_tasks =
- !db.objectStoreNames.contains('variable_tasks') && db.createObjectStore('variable_tasks', { keyPath: 'id' });
- // plugins 插件表
- Vue.prototype.$db.plugins = !db.objectStoreNames.contains('plugins') && db.createObjectStore('plugins', { keyPath: 'id' });
-};
-
-/**
- * 新增数据
- *
- * @param {object} db 数据库database
- * @param {string} collection 集合/表
- * @param {object} data 数据
- */
-const create = (db, collection, data) => {
- return new Promise((resolve, reject) => {
- const request = db.transaction([collection], 'readwrite').objectStore(collection).add(data);
- request.onsuccess = () => resolve();
-
- request.onerror = event => {
- const { name, message } = event.target.error;
- if (name === 'ConstraintError') {
- reject('数据已存在');
- } else {
- reject(message);
- }
- };
- });
-};
-
-/**
- * 找到1条数据
- *
- * @param {object} db 数据库database
- * @param {string} collection 集合/表
- * @param {string} key 索引关键字 一般是id
- */
-const findOne = (db, collection, key) => {
- return new Promise((resolve, reject) => {
- const request = db.transaction([collection]).objectStore(collection).get(key);
- request.onerror = event => reject(event.target.error.message);
- request.onsuccess = event => resolve(event.target.result);
- });
-};
-
-/**
- * 找到所有数据
- *
- * @param {object} db 数据库database
- * @param {string} collection 集合/表
- */
-const find = (db, collection) => {
- return new Promise((resolve, reject) => {
- const request = db.transaction(collection).objectStore(collection).openCursor();
- let result = [];
-
- request.onerror = event => reject(event.target.error.message);
- request.onsuccess = event => {
- const cursor = event.target.result;
- if (cursor) {
- result.push(cursor.value);
- cursor.continue();
- } else {
- resolve(result);
- }
- };
- });
-};
-
-/**
- * 更新数据
- *
- * @param {object} db 数据库database
- * @param {string} collection 集合/表
- * @param {object} newData 新数据
- */
-const update = (db, collection, newData) => {
- return new Promise((resolve, reject) => {
- const request = db.transaction([collection], 'readwrite').objectStore(collection).put(newData);
- request.onerror = event => reject(event.target.error.message);
- request.onsuccess = () => resolve(newData);
- });
-};
-
-/**
- * 移除数据 通过关键字
- *
- * @param {object} db 数据库database
- * @param {string} collection 集合/表
- * @param {string} key 关键字
- */
-const remove = (db, collection, key) => {
- return new Promise((resolve, reject) => {
- const request = db.transaction([collection], 'readwrite').objectStore(collection).delete(key);
- request.onerror = event => reject(event.target.error.message);
- request.onsuccess = () => resolve();
- });
-};
-
-/**
- * 创建索引
- *
- * @param {object} db 数据库database
- * @param {string} collection 集合/表
- * @param {string} field 创建索引的字段名称
- * @param {string} key 关键字
- */
-const createIndexAndFind = (db, collection, field, key) => {
- return new Promise((resolve, reject) => {
- const store = db.transaction([collection], 'readonly').objectStore(collection);
- store.createIndex(field, field);
- const index = store.index(field);
- const request = index.get(key);
- request.onerror = event => reject(event.target.error.message);
- request.onsuccess = event => resolve(event.target.result);
- });
-};
-
-const curriedCreate = curry(create);
-export const curriedFindOne = curry(findOne);
-export const curriedFind = curry(find);
-export const curriedRemove = curry(remove);
-export const curriedUpdate = curry(update);
-export const curriedIndex = curry(createIndexAndFind);
-
-const install = Vue => {
- uni.$db = Vue.prototype.$db = {};
- Vue.prototype.$db.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
- const request = Vue.prototype.$db.indexedDB.open(name, Date.now()); // IDBRequest 对象
- request.onerror = error => console.error('打开数据库失败', error);
- request.onsuccess = event => {
- console.log('INDEXED_DB OPEN SUCCESS');
- Vue.prototype.$db.db = event.target.result;
- };
- request.onupgradeneeded = event => {
- console.log('INDEXED_DB OPEN onupgradeneeded');
- Vue.prototype.$db.db = event.target.result;
- // 创建表
- createCollection(Vue, Vue.prototype.$db.db);
-
- Vue.prototype.$db.create = curriedCreate(Vue.prototype.$db.db); // create 新增数据,颗粒化以后就不用再传db数据了
- Vue.prototype.$db.findOne = curriedFindOne(Vue.prototype.$db.db); // 查一条
- Vue.prototype.$db.find = curriedFind(Vue.prototype.$db.db); // 查集合里的所有数据
- Vue.prototype.$db.update = curriedUpdate(Vue.prototype.$db.db); // 更新某条数据
- Vue.prototype.$db.remove = curriedRemove(Vue.prototype.$db.db); // 删除某条数据
- // Vue.prototype.$db.createIndex = curriedIndex(Vue.prototype.$db.db); // 创建索引
- };
-};
-
-export default { install };
diff --git a/src/utils/tall.js b/src/utils/tall.js
index b6a1e4c..39c0ca5 100644
--- a/src/utils/tall.js
+++ b/src/utils/tall.js
@@ -1,10 +1,8 @@
import app from '@/config/app.js';
import cache from '@/utils/cache.js';
import cacheAndRequest from '@/utils/cacheAndRequest.js';
-import plugin from '@/config/plugin.js';
import storage from '@/utils/storage.js';
import time from '@/utils/time.js';
-import timeConfig from '@/config/time';
import ui from '@/utils/ui.js';
import upload from '@/utils/upload.js';
import user from '@/config/user.js';
@@ -15,10 +13,8 @@ const gateway = process.env.VUE_APP_API_URL;
const $t = {
zIndex, // 定位元素层级
app, // app级别的相关配置
- plugin, // 插件相关配置信息
storage, // 本地存储storage封装
time, // 时间处理
- timeConfig, // 时间相关配置
ui, // ui界面提示相关
chooseAndUpload: upload.chooseAndUpload, // 选择并上传单个文件相关的封装
domain: `${gateway}/defaultwbs`,