diff --git a/.env.development b/.env.development
new file mode 100644
index 0000000..12f9368
--- /dev/null
+++ b/.env.development
@@ -0,0 +1,2 @@
+# .env.development
+VUE_APP_BASE_API=https://admintest.malls.iformall.com/api
\ No newline at end of file
diff --git a/.env.production b/.env.production
new file mode 100644
index 0000000..86d52d6
--- /dev/null
+++ b/.env.production
@@ -0,0 +1,2 @@
+# .env.test
+VUE_APP_BASE_API=https://api.test.com
\ No newline at end of file
diff --git a/example/data/options.js b/example/data/options.js
index cafea22..db1dce3 100644
--- a/example/data/options.js
+++ b/example/data/options.js
@@ -163,7 +163,6 @@ export const OutStockOptions = [
snCode: ' [SPP1Y79G1]',
price: '12.00'
}
-
],
tabelHtml: '',
columnsAttr: [
diff --git a/example/main.js b/example/main.js
index 7c65de3..6c86df5 100644
--- a/example/main.js
+++ b/example/main.js
@@ -5,21 +5,22 @@ import VueRouter from 'vue-router'
import Designer from './page/designer.vue'
import Index from './page/index.vue'
import { outStockTemp } from './data/defaultTemp'
+import axios from 'axios';
+import 'element-ui/lib/theme-chalk/index.css';
// 默认设置一条模板示例
-let tempList
-try {
- tempList = JSON.parse(localStorage.getItem('tempList')) || []
-} catch (error) {
- tempList = []
-}
-
-if (tempList.length == 0) {
- localStorage.setItem('tempList', outStockTemp)
-}
-
+// let tempList
+// try {
+// tempList = JSON.parse(localStorage.getItem('tempList')) || []
+// } catch (error) {
+// tempList = []
+// }
+// if (tempList.length == 0) {
+// localStorage.setItem('tempList', outStockTemp)
+// }
+Vue.prototype.$axios = axios;
Vue.use(VueRouter)
Vue.use(vuePrintDesigner)
const routes = [
diff --git a/example/page/designer.vue b/example/page/designer.vue
index 1645912..42abc85 100644
--- a/example/page/designer.vue
+++ b/example/page/designer.vue
@@ -7,6 +7,7 @@ export default {
data() {
return {
index: '',
+ printData: [],
value: {
title: 'demo',
width: 750,
@@ -21,24 +22,22 @@ export default {
created() {
this.index = this.$route.query.index
+ this.printData = this.$route.query.printData
try {
- let tempList = JSON.parse(localStorage.getItem('tempList')) || []
- this.value = tempList[this.index]
- this.widgets = this.value.type == 1 ? OutStockOptions : InStockOptions
+ this.value = this.printData
+ this.widgets = OutStockOptions
} catch (err) {
console.error(err)
}
},
methods: {
handleSave(data) {
- let tempList = JSON.parse(localStorage.getItem('tempList')) || []
- tempList[this.index] = data
- localStorage.setItem('tempList', JSON.stringify(tempList))
+ console.log(data, 'data')
this.$router.back()
},
// 手动初始话模板数据
- initTemp(){
- this.$refs.printDesigner.initTemp(this.value,this.widgets)
+ initTemp() {
+ this.$refs.printDesigner.initTemp(this.value, this.widgets)
}
},
}
diff --git a/example/page/index.vue b/example/page/index.vue
index 89afe08..17ffd06 100644
--- a/example/page/index.vue
+++ b/example/page/index.vue
@@ -1,16 +1,31 @@
打印模板设计器
-
ID:{{ currentID }}
+
ID:{{ tenantId }}
模板管理
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询模板
+
+
-
+
{{ scope.row.width + ' * ' + scope.row.height }}
@@ -29,8 +44,7 @@
设计
预览
复制新增
- 删除
+ 删除
@@ -39,12 +53,12 @@
-
+
@@ -64,7 +78,7 @@
-
-
diff --git a/package.json b/package.json
index 03d00ac..00196ca 100644
--- a/package.json
+++ b/package.json
@@ -11,10 +11,12 @@
"author": "liuxia",
"scripts": {
"dev": "vue-cli-service serve",
- "build": "vue-cli-service build",
+ "build:test": "vue-cli-service build --mode development",
+ "build:pro": "vue-cli-service build --mode production",
"lib": "vue-cli-service build --target lib --name kr-print-designer --dest lib src/index.js"
},
"dependencies": {
+ "axios": "^1.7.3",
"nanoid": "^1.0.1"
},
"devDependencies": {
@@ -22,11 +24,11 @@
"@vue/cli-service": "^4.0.0",
"babel-eslint": "^10.0.3",
"babel-plugin-component": "^1.1.1",
+ "element-ui": "2.13.0",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
- "element-ui": "2.13.0",
"vue": "^2.6.11",
"vue-router": "^3.4.8",
"vue-template-compiler": "^2.6.10"
@@ -36,4 +38,4 @@
"last 2 versions",
"not dead"
]
-}
+}
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
index f42a1bc..cd1827f 100644
--- a/src/index.js
+++ b/src/index.js
@@ -19,7 +19,7 @@ import {
Form,
FormItem,
Tag,
- ColorPicker,
+ ColorPicker
} from 'element-ui';
import './assets/style/index.scss'
// LODOP打印服务
diff --git a/yarn.lock b/yarn.lock
index 9d17f19..c51a37a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2107,6 +2107,15 @@ aws4@^1.8.0:
resolved "https://registry.npmmirror.com/aws4/-/aws4-1.13.0.tgz#d9b802e9bb9c248d7be5f7f5ef178dc3684e9dcc"
integrity sha512-3AungXC4I8kKsS9PuS4JH2nc+0bVY/mjgrephHTIi8fpEeGsTHBUJeosp0Wc1myYMElmD0B3Oc4XL/HVJ4PV2g==
+axios@^1.7.3:
+ version "1.7.3"
+ resolved "https://registry.npmmirror.com/axios/-/axios-1.7.3.tgz#a1125f2faf702bc8e8f2104ec3a76fab40257d85"
+ integrity sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw==
+ dependencies:
+ follow-redirects "^1.15.6"
+ form-data "^4.0.0"
+ proxy-from-env "^1.1.0"
+
babel-eslint@^10.0.3:
version "10.1.0"
resolved "https://registry.npmmirror.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232"
@@ -2825,7 +2834,7 @@ color@^3.0.0:
color-convert "^1.9.3"
color-string "^1.6.0"
-combined-stream@^1.0.6, combined-stream@~1.0.6:
+combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6:
version "1.0.8"
resolved "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
@@ -4274,7 +4283,7 @@ flush-write-stream@^1.0.0:
inherits "^2.0.3"
readable-stream "^2.3.6"
-follow-redirects@^1.0.0:
+follow-redirects@^1.0.0, follow-redirects@^1.15.6:
version "1.15.6"
resolved "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b"
integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==
@@ -4296,6 +4305,15 @@ forever-agent@~0.6.1:
resolved "https://registry.npmmirror.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==
+form-data@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452"
+ integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==
+ dependencies:
+ asynckit "^0.4.0"
+ combined-stream "^1.0.8"
+ mime-types "^2.1.12"
+
form-data@~2.3.2:
version "2.3.3"
resolved "https://registry.npmmirror.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
@@ -7000,6 +7018,11 @@ proxy-addr@~2.0.7:
forwarded "0.2.0"
ipaddr.js "1.9.1"
+proxy-from-env@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
+ integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
+
prr@~1.0.1:
version "1.0.1"
resolved "https://registry.npmmirror.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476"