cyl/dev
wangxia 4 years ago
parent 3479b4e51e
commit f3b717af1f

@ -1,4 +1,16 @@
let plugins = [];
// production
if (process.env.NODE_ENV === "production") {
plugins = ["transform-remove-console"];
}
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
plugins: [
// [
// "import",
// { libraryName: "ant-design-vue", libraryDirectory: "es", style: true },
// ],
...plugins,
],
// publicPath: "./",
};

@ -4,12 +4,14 @@
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build": "vue-cli-service build --report",
"lint": "vue-cli-service lint"
},
"dependencies": {
"ant-design-vue": "^1.7.8",
"axios": "^0.25.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"clean-webpack-plugin": "3.0.0",
"clipboard": "^2.0.10",
"core-js": "^3.6.5",
"jquery": "^3.6.0",

@ -13,6 +13,9 @@ export default {
reload: this.loader,
};
},
created() {
console.log(this);
},
data() {
return {
isRouterViewshow: true,

@ -11,21 +11,25 @@
v-for="(item, index) in relationList"
:key="index"
>
<router-link :to="'/detail/' + item.id">
<a href="javascript:;" @click="resetpage">
<div class="imgbox">
<img v-if="item.logo" :src="item.logo" alt="" />
<img v-else src="../../../../static/img/nopicture.png" alt="" />
<span>服务费{{ item.servetype }}</span>
</div>
<div class="jobname">
{{
item.storeName !== null && item.storeName !== ""
? item.storeName
: item.aliasName
}}
</div>
</a>
<router-link
target="_blank"
:to="'/detail?id=' + item.id"
@click.prevent="resetpage"
>
<!-- <a href="javascript:;" > -->
<div class="imgbox">
<img v-if="item.logo" :src="item.logo" alt="" />
<img v-else src="../../../../static/img/nopicture.png" alt="" />
<span>服务费{{ item.servetype }}</span>
</div>
<div class="jobname">
{{
item.storeName !== null && item.storeName !== ""
? item.storeName
: item.aliasName
}}
</div>
<!-- </a> -->
</router-link>
<div class="jobinfo">
<span>{{ item.district }}</span>

@ -286,7 +286,7 @@
>财务结算</span
>
</div>
<div class="copy" @click="xiangdanVisible = true">通告</div>
<!-- <div class="copy" @click="xiangdanVisible = true">通告</div> -->
<a-modal
v-model="xiangdanVisible"
title="通告"

@ -1101,13 +1101,22 @@ export default {
},
//
getJobSpecial() {
console.log(
new Date().getTime() -
JSON.parse(localStorage.getItem("SPECIALLIST")).timestamp
);
console.log(
new Date(
new Date().getTime() -
JSON.parse(localStorage.getItem("SPECIALLIST")).timestamp
)
);
let diffTime =
new Date().getTime() -
JSON.parse(localStorage.getItem("SPECIALLIST")).timestamp;
if (isNotEmptyCheck(localStorage.getItem("SPECIALLIST"))) {
if (
new Date(
new Date().getTime() -
JSON.parse(localStorage.getItem("SPECIALLIST")).timestamp
).getHours() > 2
) {
if (diffTime / 3600000 > 2) {
console.log("======================", "needRequest");
this.getJobSpecialList().then((res) => {
this.specialList = res;
this.specialList.forEach((item) => {
@ -1216,6 +1225,7 @@ export default {
data: data.data,
timestamp: new Date().getTime(),
};
console.log(container.timestamp);
localStorage.setItem("SPECIALLIST", JSON.stringify(container));
return data.data;
}

@ -48,7 +48,7 @@
billNumber.num999 == 0 ? "" : billNumber.num999
}}</span>
</li>
<li
<!-- <li
@click="pagination.status = 50"
:class="{ townsmanactive: pagination.status === 50 }"
>
@ -59,7 +59,7 @@
:class="{ townsmanactive: pagination.status === 70 }"
>
稍后<span>{{ billNumber.num == 0 ? "" : billNumber.num }}</span>
</li>
</li> -->
<!-- <li
@click="pagination.status = 70"
:class="{ townsmanactive: pagination.status === 70 }"

@ -0,0 +1,44 @@
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import antd from "ant-design-vue";
import "ant-design-vue/dist/antd.css";
import "../src/style/index.less";
import "../src/style/userinfo.less"; //用户账号设置和个人中心的样式
import "@/permission"; // permission control
import "./svg";
import moment from "moment";
import "moment/locale/zh-cn";
import AMap from "vue-amap";
Vue.use(AMap);
console.log("development");
AMap.initAMapApiLoader({
// 高德key
key: "44f4591aabba558514366f6e55f8d20e", // 自己到官网申请,我随便写的
// 插件集合 (插件按需引入)
plugin: [
"AMap.Autocomplete",
"AMap.PlaceSearch",
"AMap.Scale",
"AMap.OverView",
"AMap.ToolBar",
"AMap.MapType",
"AMap.PolyEditor",
"AMap.CircleEditor",
"AMap.MarkerClusterer",
],
v: "1.4.15", // 我也不知道为什么要写这个,不写项目会报错,而且我随便写的,跟我下载的版本对应不了
uiVersion: "1.0.11", // ui版本号也是需要写不配置不加载,
});
moment.locale("zh-cn"); //设置语言 或 moment.lang('zh-cn');
Vue.prototype.$moment = moment; //挂载到当前vue实例对象
Vue.config.productionTip = false;
Vue.use(antd);
new Vue({
router,
store,
render: (h) => h(App),
}).$mount("#app");
export default Vue;

@ -12,7 +12,7 @@ import moment from "moment";
import "moment/locale/zh-cn";
import AMap from "vue-amap";
Vue.use(AMap);
console.log("production");
AMap.initAMapApiLoader({
// 高德key
key: "44f4591aabba558514366f6e55f8d20e", // 自己到官网申请,我随便写的

@ -1,6 +1,5 @@
module.exports = {
title: '',
title: "",
/**
* @type {boolean} true | false
@ -12,5 +11,5 @@ module.exports = {
* @type {boolean} true | false
* @description Whether show the logo in sidebar
*/
sidebarLogo: true
}
sidebarLogo: true,
};

@ -13,10 +13,10 @@ console.log(baseURL);
axios.defaults.withCredentials = true; //添加这行代码
// console.log(axios);
const service = axios.create({
// baseURL: "/api_prod", // url = base url + request url
baseURL: baseURL, // baseURL: "/api", // url = base url + request url
baseURL: "/api_prod", // url = base url + request url
// baseURL: baseURL, // baseURL: "/api", // url = base url + request url
withCredentials: true, // send cookies when cross-domain requests
timeout: 10000, // request timeout
timeout: 60000, // request timeout
crossDomain: true,
});
service.interceptors.response.use(

@ -10,23 +10,9 @@ function resolve(dir) {
const name = defaultSettings.title || "vue Admin Template"; // page title
// If your port is set to 80,
// use administrator privileges to execute the command line.
// For example, Mac: sudo npm run
// You can change the port by the following methods:
// port = 9528 npm run dev OR npm run dev --port = 9528
const port = 8888 || process.env.port || process.env.npm_config_port; // dev port
// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {
/**
* You will need to set publicPath if you plan to deploy your site under a sub path,
* for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
* then publicPath should be set to "/bar/".
* In most cases please use '/' !!!
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: "./",
outputDir: "dist",
assetsDir: "static",
@ -82,6 +68,15 @@ module.exports = {
// before: require('./mock/mock-server.js')
},
chainWebpack: (config) => {
// 开发环境的webpack配置
config.when(process.env.NODE_ENV === "development", (config) => {
config.entry("app").clear().add("./src/main-dev.js");
config.set("externals", {});
});
// 生产环境的webpack配置
config.when(process.env.NODE_ENV === "production", (config) => {
config.entry("app").clear().add("./src/main-prod.js");
});
config.plugins.delete("fork-ts-checker"), // 禁用fork-ts-checker
config.plugins.delete("prefetch");
},

@ -1,3 +0,0 @@
module.exports = {
extensions: [".AMap"],
};

@ -0,0 +1,56 @@
const path = require("path");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
module.exports = {
entry: {
entry1: "./src/entry/entry1.js",
entry2: "./src/entry/entry2.js",
},
plugins: [new CleanWebpackPlugin()],
output: {
filename: "[name].bundle.js",
path: path.resolve(__dirname, "dist"),
},
optimization: {
splitChunks: {
chunks: "initial",
minSize: 1,
maxSize: 0,
cacheGroups: {
vendors: {
test: /[\\/]node_modules[\\/]/,
priority: -10,
},
default: {
minChunks: 1,
priority: -20,
reuseExistingChunk: true,
},
},
},
},
// default config
// optimization: {
// splitChunks: {
// chunks: 'async',
// minSize: 30000,
// minChunks: 1,
// maxAsyncRequests: 5,
// maxInitialRequests: 3,
// automaticNameDelimiter: '~',
// automaticNameMaxLength: 30,
// name: true,
// cacheGroups: {
// vendors: {
// test: /[\\/]node_modules[\\/]/,
// priority: -10
// },
// default: {
// minChunks: 2,
// priority: -20,
// reuseExistingChunk: true
// }
// }
// }
// }
};

@ -1216,7 +1216,7 @@
"@types/source-list-map" "*"
source-map "^0.7.3"
"@types/webpack@^4", "@types/webpack@^4.0.0":
"@types/webpack@^4", "@types/webpack@^4.0.0", "@types/webpack@^4.4.31":
version "4.41.32"
resolved "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.32.tgz"
integrity sha512-cb+0ioil/7oz5//7tZUSwbrSAN/NWHrQylz5cW8G0dWTcF/g+/dSdMlKVZspBYuMAN1+WnwHrkxiRrLcwd0Heg==
@ -2098,6 +2098,11 @@ babel-plugin-syntax-dynamic-import@^6.18.0:
resolved "https://registry.npmmirror.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz"
integrity sha512-MioUE+LfjCEz65Wf7Z/Rm4XCP5k2c+TbMd2Z2JKc7U9uwjBhAfNPE48KC4GTGKhppMeYVepwDBNO/nGY6NYHBA==
babel-plugin-transform-remove-console@^6.9.4:
version "6.9.4"
resolved "https://registry.npmmirror.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz#b980360c067384e24b357a588d807d3c83527780"
integrity sha512-88blrUrMX3SPiGkT1GnvVY8E/7A+k6oj3MNvUtTIxJflFzXTw1bHkuJ/y039ouhFMp2prRn5cQGzokViYi1dsg==
babel-runtime@6.x, babel-runtime@^6.23.0, babel-runtime@^6.26.0:
version "6.26.0"
resolved "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz"
@ -2670,6 +2675,14 @@ clean-stack@^2.0.0:
resolved "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz"
integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==
clean-webpack-plugin@3.0.0:
version "3.0.0"
resolved "https://registry.npmmirror.com/clean-webpack-plugin/-/clean-webpack-plugin-3.0.0.tgz#a99d8ec34c1c628a4541567aa7b457446460c62b"
integrity sha512-MciirUH5r+cYLGCOL5JX/ZLzOZbVr1ot3Fw+KcvbhUb6PM+yycqd9ZhIlcigQ5gl+XhppNmw3bEFuaaMNyLj3A==
dependencies:
"@types/webpack" "^4.4.31"
del "^4.1.1"
cli-cursor@^2.0.0, cli-cursor@^2.1.0:
version "2.1.0"
resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz"

Loading…
Cancel
Save